本文整理汇总了PHP中SE_Language::_preload方法的典型用法代码示例。如果您正苦于以下问题:PHP SE_Language::_preload方法的具体用法?PHP SE_Language::_preload怎么用?PHP SE_Language::_preload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SE_Language
的用法示例。
在下文中一共展示了SE_Language::_preload方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notify_summary
function notify_summary()
{
global $database, $user;
$total_notifications = 0;
$notify_array = array();
// CHECK THAT USER EXISTS
if (is_object($user) && $user->user_exists && $user->user_info['user_hasnotifys']) {
// BUILD NOTIFICATION QUERY
$notify_query = "\r\n (\r\n SELECT \r\n '0' AS notify_grouped,\r\n count(se_notifys.notify_id) AS total_notifications, \r\n se_notifytypes.notifytype_id, \r\n se_notifytypes.notifytype_desc, \r\n se_notifytypes.notifytype_icon, \r\n se_notifytypes.notifytype_url, \r\n se_notifys.notify_urlvars, \r\n se_notifys.notify_text \r\n FROM se_notifys \r\n LEFT JOIN se_notifytypes \r\n ON se_notifys.notify_notifytype_id=se_notifytypes.notifytype_id \r\n WHERE \r\n notify_user_id='{$user->user_info['user_id']}'\r\n AND\r\n notifytype_group=1\r\n GROUP BY se_notifys.notify_notifytype_id\r\n ) UNION ALL (\r\n SELECT \r\n se_notifys.notify_object_id AS notify_grouped,\r\n count(se_notifys.notify_id) AS total_notifications, \r\n se_notifytypes.notifytype_id, \r\n se_notifytypes.notifytype_desc, \r\n se_notifytypes.notifytype_icon, \r\n se_notifytypes.notifytype_url, \r\n se_notifys.notify_urlvars, \r\n se_notifys.notify_text \r\n FROM se_notifys \r\n LEFT JOIN se_notifytypes \r\n ON se_notifys.notify_notifytype_id=se_notifytypes.notifytype_id \r\n WHERE \r\n notify_user_id='{$user->user_info['user_id']}' \r\n AND\r\n notifytype_group=0\r\n GROUP BY se_notifys.notify_notifytype_id, se_notifys.notify_object_id\r\n )\r\n ";
// GET NOTIFICATIONS
$notifys = $database->database_query($notify_query);
while ($notify = $database->database_fetch_assoc($notifys)) {
// REGISTER PRELOADED TEXT
SE_Language::_preload($notify['notifytype_desc']);
// GET URL VARS
$urlvars = unserialize($notify['notify_urlvars']);
$notify_url = vsprintf($notify['notifytype_url'], $urlvars);
// GET DESC TEXT VARS
$notify_text = unserialize($notify['notify_text']);
// ADD THIS NOTIFICATION TO OUTPUT ARRAY
$total_notifications += $notify['total_notifications'];
$notify_array[] = array('notifytype_id' => $notify['notifytype_id'], 'notify_grouped' => $notify['notify_grouped'], 'notify_icon' => $notify['notifytype_icon'], 'notify_url' => $notify_url, 'notify_desc' => $notify['notifytype_desc'], 'notify_text' => $notify_text, 'notify_total' => $notify['total_notifications']);
}
}
// RETURN LIST OF NOTIFICATIONS
return array('total' => (int) $total_notifications, 'total_grouped' => (int) count($notify_array), 'notifys' => $notify_array);
}
示例2: search_poll
function search_poll()
{
global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;
// CONSTRUCT QUERY
$sql = "\r\n SELECT\r\n se_polls.poll_id,\r\n se_polls.poll_title,\r\n se_users.user_id,\r\n se_users.user_username,\r\n se_users.user_photo,\r\n se_users.user_fname,\r\n se_users.user_lname\r\n FROM\r\n se_polls,\r\n se_users,\r\n se_levels\r\n WHERE\r\n se_polls.poll_user_id=se_users.user_id &&\r\n se_users.user_level_id=se_levels.level_id &&\r\n (\r\n se_polls.poll_search='1' ||\r\n se_levels.level_poll_search='0'\r\n ) &&\r\n (\r\n poll_title LIKE '%{$search_text}%' ||\r\n poll_desc LIKE '%{$search_text}%' ||\r\n poll_options LIKE '%{$search_text}%'\r\n )\r\n ";
// GET TOTAL ENTRIES
$total_polls = $database->database_num_rows($database->database_query($sql . " LIMIT 201"));
// IF NOT TOTAL ONLY
if ($t == "poll") {
// MAKE POLL PAGES
$start = ($p - 1) * $results_per_page;
$limit = $results_per_page + 1;
// SEARCH POLLS
$sql .= " ORDER BY se_polls.poll_id DESC LIMIT {$start}, {$limit}";
$resource = $database->database_query($sql) or die($database->database_error());
while ($poll_info = $database->database_fetch_assoc($resource)) {
// CREATE AN OBJECT FOR AUTHOR
$profile = new se_user();
$profile->user_info['user_id'] = $poll_info['user_id'];
$profile->user_info['user_username'] = $poll_info['user_username'];
$profile->user_info['user_fname'] = $poll_info['user_fname'];
$profile->user_info['user_lname'] = $poll_info['user_lname'];
$profile->user_info['user_photo'] = $poll_info['user_photo'];
$profile->user_displayname();
$result_url = $url->url_create('poll', $poll_info['user_username'], $poll_info['poll_id']);
$result_name = 2500112;
$result_desc = 2500113;
// IF EMPTY TITLE
if (!trim($poll_info['poll_title'])) {
SE_Language::_preload(589);
SE_Language::load();
$poll_info['poll_title'] = SE_Language::_get(589);
}
$results[] = array('result_url' => $result_url, 'result_icon' => './images/icons/poll_poll48.gif', 'result_name' => $result_name, 'result_name_1' => $poll_info['poll_title'], 'result_desc' => $result_desc, 'result_desc_1' => $url->url_create('profile', $profile->user_info['user_username']), 'result_desc_2' => $profile->user_displayname, 'result_desc_3' => $poll_info['poll_desc']);
}
// SET TOTAL RESULTS
$total_results = $total_polls;
}
// SET ARRAY VALUES
SE_Language::_preload_multi(2500111, 2500112, 2500113);
if ($total_polls > 200) {
$total_polls = "200+";
}
$search_objects[] = array('search_type' => 'poll', 'search_lang' => 2500111, 'search_total' => $total_polls);
}
示例3: array
<?php
// ENSURE THIS IS BEING INCLUDED IN AN SE SCRIPT
if (!defined('SE_PAGE')) {
exit;
}
// INCLUDE MUSIC CLASS FILES
include "./include/class_music.php";
include "./include/functions_music.php";
// PRELOAD LANGUAGE
SE_Language::_preload(4000004);
// SET MAIN MENU VARS
$plugin_vars['menu_main'] = array('file' => 'browse_music.php', 'title' => 4000004);
// SET USER MENU VARS
if ($user->level_info['level_music_allow']) {
$plugin_vars['menu_user'] = array('file' => 'user_music.php', 'icon' => 'music_music16.gif', 'title' => 4000004);
}
// SET PROFILE MENU VARS
if ($owner->level_info['level_music_allow'] && $page == "profile") {
// GET USER SETTINGS
$user->user_settings('usersetting_music_profile_autoplay,usersetting_music_site_autoplay,usersetting_xspfskin_id');
$owner->user_settings('usersetting_music_profile_autoplay,usersetting_music_site_autoplay,usersetting_xspfskin_id');
// GET SKIN INFO
$owner_music = new se_music($owner->user_info['user_id']);
$skin_info = $owner_music->skin_info($user->usersetting_info['usersetting_xspfskin_id']);
if (!empty($skin_info)) {
$smarty->assign('skin_title', $skin_info['xspfskin_title']);
$smarty->assign('skin_height', $skin_info['xspfskin_height']);
$smarty->assign('skin_width', $skin_info['xspfskin_width']);
}
// AUTOPLAY
示例4: field_list
//.........这里部分代码省略.........
// DO NOT VALIDATE FIELD VALUE AND DON'T CREATE SEARCH VALUE
} else {
// RETRIEVE DATABASE FIELD VALUE
if ($this->value_info != "") {
$value_column = $this->type . "value_" . $field_info[field_id];
$field_value = $this->value_info[$value_column];
}
}
// FORMAT VALUE FOR DISPLAY
if ($format == 1 && $field_info[field_display] != 0) {
// LINK BROWSABLE FIELD VALUES IF NECESSARY
if ($field_info[field_display] == 2) {
$br_exploded_field_values = explode("<br>", trim($field_value));
$exploded_field_values = array();
foreach ($br_exploded_field_values as $key => $value) {
$comma_exploded_field_values = explode(",", trim($value));
array_walk($comma_exploded_field_values, 'link_field_values', array($field_info[field_id], "", $field_info[field_link], $field_info[field_display]));
$exploded_field_values[$key] = implode(", ", $comma_exploded_field_values);
}
$field_value_formatted = implode("<br>", $exploded_field_values);
// MAKE SURE TO LINK FIELDS WITH A LINK TAG
} else {
$exploded_field_values = array(trim($field_value));
array_walk($exploded_field_values, 'link_field_values', array($field_info[field_id], "", $field_info[field_link], $field_info[field_display]));
$field_value_formatted = implode("", $exploded_field_values);
}
// DECODE TO MAKE HTML TAGS FOR FIELDS VALID
$field_value_formatted = htmlspecialchars_decode($field_value_formatted, ENT_QUOTES);
// FORMAT VALUE FOR FORM
} else {
if ($field_info[field_type] == 1) {
$options = unserialize($field_info[field_options]);
for ($i = 0, $max = count($options); $i < $max; $i++) {
SE_Language::_preload_multi($options[$i][label]);
SE_Language::load();
$field_options[] = array('label' => SE_Language::_get($options[$i][label]));
}
}
if ($field_info[field_type] == 2) {
$field_value = str_replace("<br>", "\r\n", $field_value);
}
}
break;
case 3:
// SELECT BOX
// SELECT BOX
case 4:
// RADIO BUTTON
// VALIDATE POSTED FIELD
if ($validate == 1) {
// RETRIEVE POSTED FIELD VALUE
$var = "field_" . $field_info[field_id];
$field_value = censor($_POST[$var]);
// CHECK FOR REQUIRED
if ($field_info[field_required] != 0 && ($field_value == "-1" || $field_value == "")) {
$this->is_error = 96;
$is_field_error = 1;
}
// UPDATE SAVE VALUE QUERY
if ($this->field_query != "") {
$this->field_query .= ", ";
}
$this->field_query .= $this->type . "value_{$field_info['field_id']}='{$field_value}'";
// CREATE A SEARCH QUERY FROM POSTED FIELD VALUE
} elseif ($search == 1) {
if ($field_info[field_search] == 2) {
示例5: se_user
$block_user = new se_user();
$block_user->user_info['user_id'] = $block['user_id'];
$block_user->user_info['user_username'] = $block['user_username'];
$block_user->user_info['user_photo'] = $block['user_photo'];
$block_user->user_info['user_fname'] = $block['user_fname'];
$block_user->user_info['user_lname'] = $block['user_lname'];
$block_user->user_displayname();
$block_array[] = $block_user;
}
}
// GET PREVIOUS PRIVACY SETTINGS
for ($c = 0; $c < count($level_profile_privacy); $c++) {
if (user_privacy_levels($level_profile_privacy[$c]) != "") {
SE_Language::_preload(user_privacy_levels($level_profile_privacy[$c]));
$privacy_options[$level_profile_privacy[$c]] = user_privacy_levels($level_profile_privacy[$c]);
}
}
for ($c = 0; $c < count($level_profile_comments); $c++) {
if (user_privacy_levels($level_profile_comments[$c]) != "") {
SE_Language::_preload(user_privacy_levels($level_profile_comments[$c]));
$comment_options[$level_profile_comments[$c]] = user_privacy_levels($level_profile_comments[$c]);
}
}
// ASSIGN VARIABLES AND INCLUDE FOOTER
$smarty->assign('result', $result);
$smarty->assign('is_error', $is_error);
$smarty->assign('blocked_users', $block_array);
$smarty->assign('actiontypes', $actiontypes_array);
$smarty->assign('privacy_options', $privacy_options);
$smarty->assign('comment_options', $comment_options);
include "footer.php";
示例6: user_privacy_levels
}
}
// GET PREVIOUS PRIVACY SETTINGS
for ($c = 0; $c < count($level_album_privacy); $c++) {
if (user_privacy_levels($level_album_privacy[$c]) != "") {
SE_Language::_preload(user_privacy_levels($level_album_privacy[$c]));
$privacy_options[$level_album_privacy[$c]] = user_privacy_levels($level_album_privacy[$c]);
}
}
for ($c = 0; $c < count($level_album_comments); $c++) {
if (user_privacy_levels($level_album_comments[$c]) != "") {
SE_Language::_preload(user_privacy_levels($level_album_comments[$c]));
$comment_options[$level_album_comments[$c]] = user_privacy_levels($level_album_comments[$c]);
}
}
for ($c = 0; $c < count($level_album_tag); $c++) {
if (user_privacy_levels($level_album_tag[$c]) != "") {
SE_Language::_preload(user_privacy_levels($level_album_tag[$c]));
$tag_options[$level_album_tag[$c]] = user_privacy_levels($level_album_tag[$c]);
}
}
// RESTORE LINE BREAKS
$album_info[album_desc] = str_replace("<br>", "\r\n", $album_info[album_desc]);
// ASSIGN VARIABLES AND SHOW EDIT ALBUMS PAGE
$smarty->assign('result', $result);
$smarty->assign('is_error', $is_error);
$smarty->assign('album_info', $album_info);
$smarty->assign('privacy_options', $privacy_options);
$smarty->assign('comment_options', $comment_options);
$smarty->assign('tag_options', $tag_options);
include "footer.php";
示例7: while
$user->user_delete();
$total_users = $total_users - 1;
}
}
}
// LOOP OVER USER LEVELS
$levels = $database->database_query("SELECT level_id, level_name FROM se_levels ORDER BY level_name");
while ($level_info = $database->database_fetch_assoc($levels)) {
$level_array[$level_info[level_id]] = $level_info;
}
// LOOP OVER SUBNETWORKS
$subnets = $database->database_query("SELECT subnet_id, subnet_name FROM se_subnets ORDER BY subnet_name");
$subnet_array[0] = array('subnet_id' => 0, 'subnet_name' => 152);
SE_Language::_preload(152);
while ($subnet_info = $database->database_fetch_assoc($subnets)) {
SE_Language::_preload($subnet_info[subnet_name]);
$subnet_array[$subnet_info[subnet_id]] = $subnet_info;
}
// PULL USERS INTO AN ARRAY
$users = $database->database_query($user_query);
while ($user_info = $database->database_fetch_assoc($users)) {
$user = new se_user();
$user->user_info[user_id] = $user_info[user_id];
$user->user_info[user_username] = $user_info[user_username];
$user->user_info[user_fname] = $user_info[user_fname];
$user->user_info[user_lname] = $user_info[user_lname];
$user->user_displayname();
$user_info[user_displayname] = $user->user_displayname;
$user_array[] = $user_info;
}
// ASSIGN VARIABLES AND SHOW VIEW USERS PAGE
示例8: defined
<?php
// ENSURE THIS IS BEING INCLUDED IN AN SE SCRIPT
defined('SE_PAGE') or exit;
// INCLUDE FUNCTION FILE
include_once "./include/functions_document.php";
// INCLUDE CLASS FILE
include_once "./include/class_document.php";
// PRELOAD LANGUAGE
SE_Language::_preload(650003010);
$query = "SELECT * FROM se_document_parameters";
$params = $database->database_fetch_assoc($database->database_query($query));
// SET MAIN MENU VARS
if (!$user->user_exists && $params[permission_document] || $user->user_exists && $user->level_info['level_document_allow']) {
$plugin_vars['menu_main'] = array('file' => 'browse_documents.php', 'title' => 650003010);
}
// SET USER MENU VARS
if ($user->user_exists && $user->level_info['level_document_allow']) {
$plugin_vars[menu_user] = array('file' => 'user_documents.php', 'icon' => 'document16.gif', 'title' => 650003010);
}
// SET PROFILE MENU VARS
if ($owner->level_info['level_document_allow'] && $page == "profile") {
//SHOWING A DOCUMENT TAB IF THE USER HAS ATLEAST ONE DOCUMENT
if ($page == "profile") {
if (isset($_POST['p'])) {
$p = $_POST['p'];
} elseif (isset($_GET['p'])) {
$p = $_GET['p'];
} else {
$p = 1;
}
示例9: array
// AN ERROR OCCURED SEND THE DATA BACK
$blogentry_info = array('blogentry_id' => $blogentry_id, 'blogentry_title' => $blogentry_title, 'blogentry_body' => $blogentry_body, 'blogentry_blogentrycat_id' => $blogentry_blogentrycat_id, 'blogentry_search' => $blogentry_search, 'blogentry_privacy' => $blogentry_privacy, 'blogentry_comments' => $blogentry_comments, 'blogentry_trackbacks' => $blogentry_trackbacks);
}
// GET BLOG ENTRY CATEGORIES
$blogentrycats_array = $blog->blog_category_list($user->user_info['user_id']);
// GET PREVIOUS PRIVACY SETTINGS
$level_blog_privacy = unserialize($user->level_info['level_blog_privacy']);
rsort($level_blog_privacy);
for ($c = 0; $c < count($level_blog_privacy); $c++) {
$lvar = user_privacy_levels($level_blog_privacy[$c]);
if ($lvar) {
SE_Language::_preload($privacy_options[$level_blog_privacy[$c]] = $lvar);
}
}
$level_blog_comments = unserialize($user->level_info['level_blog_comments']);
rsort($level_blog_comments);
for ($c = 0; $c < count($level_blog_comments); $c++) {
$lvar = user_privacy_levels($level_blog_comments[$c]);
if ($lvar) {
SE_Language::_preload($comment_options[$level_blog_comments[$c]] = $lvar);
}
}
// CONVERT HTML CHARACTERS BACK
$blogentry_info['blogentry_body'] = str_replace("\r\n", "", htmlspecialchars_decode($blogentry_info['blogentry_body']));
// ASSIGN VARIABLES AND SHOW NEW BLOGENTRY PAGE
$smarty->assign('blogentry_info', $blogentry_info);
$smarty->assign('blogentrycats', $blogentrycats_array);
$smarty->assign('privacy_options', $privacy_options);
$smarty->assign('comment_options', $comment_options);
$smarty->assign('comments_total', $comments_total);
include "footer.php";
示例10: album_list
function album_list($start, $limit, $sort_by = "album_id DESC", $where = "")
{
global $database, $user, $owner;
// BEGIN QUERY
$sql = "\r\n SELECT\r\n se_albums.*,\r\n se_albums.album_totalfiles AS total_files,\r\n se_albums.album_totalspace AS total_space\r\n ";
// IF NO USER ID SPECIFIED, RETRIEVE USER INFORMATION
if (!$this->user_id) {
$sql .= ",\r\n se_users.user_id,\r\n se_users.user_username,\r\n se_users.user_photo,\r\n se_users.user_fname,\r\n se_users.user_lname\r\n ";
}
// CONTINUE QUERY
$sql .= "\r\n FROM\r\n se_albums\r\n ";
// IF NO USER ID SPECIFIED, JOIN TO USER TABLE
if (!$this->user_id) {
$sql .= "\r\n LEFT JOIN\r\n se_users\r\n ON se_albums.album_user_id=se_users.user_id\r\n ";
}
// ADD WHERE IF NECESSARY
if (!empty($where) || $this->user_id) {
$sql .= "\r\n WHERE\r\n ";
}
// ENSURE USER ID IS NOT EMPTY
if ($this->user_id) {
$sql .= "\r\n album_user_id='{$this->user_id}'\r\n ";
}
// INSERT AND IF NECESSARY
if ($this->user_id && !empty($where)) {
$sql .= " AND";
}
// ADD WHERE CLAUSE, IF NECESSARY
if (!empty($where)) {
$sql .= "\r\n {$where}\r\n ";
}
// ADD ORDER, AND LIMIT CLAUSE
$sql .= "\r\n ORDER BY\r\n {$sort_by}\r\n LIMIT\r\n {$start}, {$limit}\r\n ";
// RUN QUERY
$resource = $database->database_query($sql);
// GET ALBUMS INTO AN ARRAY
$album_array = array();
while ($album_info = $database->database_fetch_assoc($resource)) {
// IF NO USER ID SPECIFIED, CREATE OBJECT FOR AUTHOR
if (!$this->user_id) {
$author = new se_user();
$author->user_exists = TRUE;
$author->user_info['user_id'] = $album_info['user_id'];
$author->user_info['user_username'] = $album_info['user_username'];
$author->user_info['user_fname'] = $album_info['user_fname'];
$author->user_info['user_lname'] = $album_info['user_lname'];
$author->user_info['user_photo'] = $album_info['user_photo'];
$author->user_displayname();
} elseif ($owner->user_exists && $owner->user_info['user_id'] == $album_info['album_user_id']) {
$author =& $owner;
} elseif ($user->user_exists && $user->user_info['user_id'] == $album_info['album_user_id']) {
$author =& $user;
}
// CONVERT SPACE TO MB
$album_space_mb = $album_info['total_space'] / 1024 / 1024;
$album_space_mb = round($album_space_mb, 2);
// GET PATH OF ALBUM COVER
$album_cover_id = 0;
$album_cover_ext = "";
if ($album_info['album_cover']) {
$album_cover_query = $database->database_query("SELECT media_id, media_ext FROM se_media WHERE media_id='{$album_info['album_cover']}' AND media_album_id='{$album_info['album_id']}' LIMIT 1");
if ($database->database_num_rows($album_cover_query)) {
$album_cover_array = $database->database_fetch_assoc($album_cover_query);
$album_cover_id = $album_cover_array['media_id'];
$album_cover_ext = $album_cover_array['media_ext'];
}
}
// CREATE ARRAY OF ALBUM DATA
SE_Language::_preload(user_privacy_levels($album_info['album_privacy']));
// SET OTHER INFO
$album_info['album_author'] =& $author;
$album_info['album_space'] = $album_space_mb;
$album_info['album_privacy'] = user_privacy_levels($album_info['album_privacy']);
$album_info['album_cover_id'] = $album_cover_id;
$album_info['album_cover_ext'] = $album_cover_ext;
$album_info['album_files'] = $album_info['total_files'];
$album_array[] = $album_info;
unset($author, $album_info);
}
// RETURN ARRAY
return $album_array;
}
示例11: explode
}
$level_menu[] = $new_level_menu;
$plugin_info['plugin_pages_level'] = $new_level_menu;
// GET MAIN PAGES
$plugin_pages_main = explode("<~!~>", $plugin_info['plugin_pages_main']);
$main_pages = array();
for ($l = 0; $l < count($plugin_pages_main); $l++) {
$plugin_page = explode("<!>", $plugin_pages_main[$l]);
if ($plugin_page[0] != "" && $plugin_page[2] != "") {
SE_Language::_preload($plugin_page[0]);
$main_pages[] = array('title' => $plugin_page[0], 'icon' => $plugin_page[1], 'file' => $plugin_page[2]);
}
}
$plugin_info['plugin_pages_main'] = $main_pages;
// SET GLOBAL PLUGIN ARRAY
SE_Language::_preload($plugin_info['plugin_menu_title']);
$global_plugins[$plugin_info['plugin_type']] = $plugin_info;
unset($plugin_vars);
}
// BACKWARDS COMPATIBILITY FOR THE $global_plugin CHANGE
if (strpos($page, 'admin_level') !== FALSE) {
$global_plugins = array_values($global_plugins);
// Flush level settings
$level_id = !empty($_POST['level_id']) ? $_POST['level_id'] : (!empty($_GET['level_id']) ? $_GET['level_id'] : NULL);
if (is_object($cache_object) && $level_id && ($_GET['task'] == "dosave" || $_POST['task'] == "dosave")) {
$cache_object->remove('site_level_settings_' . $level_id);
}
}
// Nasty code to flush site settings
if ((!empty($_GET['task']) || !empty($_POST['task'])) && is_object($cache_object)) {
$cache_object->remove('site_settings');
示例12: poll_list
function poll_list($start, $limit, $sort_by = "poll_id DESC", $where = "", $poll_details = 0)
{
global $database, $user;
// BEGIN QUERY
$sql = "\r\n SELECT\r\n se_polls.*,\r\n se_polls.poll_totalcomments AS total_comments\r\n ";
// SELECT RELEVANT poll DETAILS IF NECESSARY
if ($poll_details == 1) {
$sql .= ",\r\n se_users.user_id,\r\n se_users.user_username,\r\n se_users.user_photo,\r\n se_users.user_fname,\r\n se_users.user_lname\r\n ";
}
// CONTINUE QUERY
$sql .= "\r\n FROM\r\n se_polls\r\n ";
// CONTINUE QUERY IF NECESSARY
if ($poll_details == 1) {
$sql .= "\r\n LEFT JOIN\r\n se_users\r\n ON se_polls.poll_user_id=se_users.user_id\r\n ";
}
// ADD WHERE IF NECESSARY
if ($where != "" | $this->user_id != 0) {
$sql .= "\r\n WHERE\r\n ";
}
// ENSURE USER ID IS NOT EMPTY
if ($this->user_id != 0) {
$sql .= "\r\n poll_user_id='{$this->user_id}'\r\n ";
}
// INSERT AND IF NECESSARY
if ($this->user_id != 0 & $where != "") {
$sql .= " AND";
}
// ADD WHERE CLAUSE, IF NECESSARY
if ($where != "") {
$sql .= "\r\n {$where}\r\n ";
}
// ADD ORDER, AND LIMIT CLAUSE
$sql .= "\r\n ORDER BY\r\n {$sort_by}\r\n LIMIT\r\n {$start}, {$limit}\r\n ";
// RUN QUERY
$resource = $database->database_query($sql) or die($database->database_error() . " SQL: " . $sql);
// GET pollS INTO AN ARRAY
$poll_array = array();
while ($poll_info = $database->database_fetch_assoc($resource)) {
// CREATE OBJECT FOR poll
$poll = new se_poll($poll_info['user_id']);
$poll->poll_exists = TRUE;
// CREATE OBJECT FOR poll CREATOR IF poll DETAILS
if ($poll_details) {
$creator = new se_user();
$creator->user_exists = TRUE;
$creator->user_info['user_id'] = $poll_info['user_id'];
$creator->user_info['user_username'] = $poll_info['user_username'];
$creator->user_info['user_photo'] = $poll_info['user_photo'];
$creator->user_info['user_fname'] = $poll_info['user_fname'];
$creator->user_info['user_lname'] = $poll_info['user_lname'];
$creator->user_displayname();
$poll->poll_owner =& $creator;
unset($creator);
}
// TURN OPTIONS AND ANSWERS INTO ARRAYS, GET TOTAL VOTES
$poll_info['poll_options'] = unserialize($poll_info['poll_options']);
$poll_info['poll_answers'] = unserialize($poll_info['poll_answers']);
$poll_info['poll_voted'] = unserialize($poll_info['poll_voted']);
// GET IF THIS POLL HAS BEEN VOTED ON
if (!$user->user_exists || in_array($user->user_info['user_id'], $poll_info['poll_voted'])) {
$poll_info['poll_viewonly'] = TRUE;
} else {
$poll_info['poll_viewonly'] = FALSE;
}
// PRIVACY
$poll_info['poll_privacy_lang'] = user_privacy_levels($poll_info['poll_privacy']);
SE_Language::_preload($poll_info['poll_privacy_lang']);
$poll->poll_info = $poll_info;
$poll_array[] = $poll;
}
// RETURN ARRAY
return $poll_array;
}
示例13: json_encode
$forum_info[forum_mods_js] = json_encode($mod_array);
$forum_info[forum_mods_id_js] = json_encode($mod_array_id);
// GET LEVELS
$view_levels = array();
$post_levels = array();
$forumlevels = $database->database_query("SELECT * FROM se_forumlevels WHERE forumlevel_forum_id='{$forum_info['forum_id']}'");
while ($forumlevel_info = $database->database_fetch_assoc($forumlevels)) {
if ($forumlevel_info[forumlevel_post]) {
$post_levels[] = $forumlevel_info[forumlevel_level_id];
}
$view_levels[] = $forumlevel_info[forumlevel_level_id];
}
$forum_info[forum_level_view] = json_encode($view_levels);
$forum_info[forum_level_post] = json_encode($post_levels);
$forum_array[] = $forum_info;
}
SE_Language::_preload($forumcat_info[forumcat_title]);
$forumcat_info[forums] = $forum_array;
$forumcat_array[] = $forumcat_info;
}
// GET USER LEVELS
$levels = $database->database_query("SELECT level_id, level_name, level_default FROM se_levels");
$level_array = array();
while ($level_info = $database->database_fetch_assoc($levels)) {
$level_array[] = $level_info;
}
// ASSIGN VARIABLES AND SHOW FORUM SETUP PAGE
$smarty->assign('is_error', $is_error);
$smarty->assign('forumcats', $forumcat_array);
$smarty->assign("levels", $level_array);
include "admin_footer.php";
示例14: str_replace
if ($_FILES[$fileid]['name'] != "") {
$file_result[$fileid] = $group->group_media_upload($fileid, $groupalbum_info['groupalbum_id'], $space_left);
if ($file_result[$fileid]['is_error'] == 0) {
$file_result[$fileid]['message'] = 2000248;
$media_path = str_replace('./', '', $group->group_dir($group->group_info['group_id']) . $file_result[$fileid]['groupmedia_id'] . "_thumb.jpg");
$media_link = "group_album_file.php?group_id={$group->group_info['group_id']}&groupmedia_id={$file_result[$fileid]['groupmedia_id']}";
if (file_exists($media_path)) {
$media_width = $misc->photo_size($media_path, "100", "100", "w");
$media_height = $misc->photo_size($media_path, "100", "100", "h");
$action_media[] = array('media_link' => $media_link, 'media_path' => $media_path, 'media_width' => $media_width, 'media_height' => $media_height);
}
$update_album = 1;
} else {
$file_result[$fileid]['message'] = $file_result[$fileid]['is_error'];
}
SE_Language::_preload($file_result[$fileid]['message']);
}
}
// UPDATE ALBUM UPDATED DATE AND ALBUM COVER IF FILE UPLOADED
if ($update_album) {
$database->database_query("UPDATE se_groupalbums SET groupalbum_dateupdated='" . time() . "' WHERE groupalbum_id='{$groupalbum_info['groupalbum_id']}'");
// UPDATE LAST UPDATE DATE (SAY THAT 10 TIMES FAST)
$group->group_lastupdate();
// INSERT ACTION
$group_title = $group->group_info['group_title'];
if (strlen($group_title) > 100) {
$group_title = substr($group_title, 0, 97) . "...";
}
$actions->actions_add($user, "newgroupmedia", array($user->user_info['user_username'], $user->user_displayname, $group->group_info['group_id'], $group_title), $action_media, 60, FALSE, "group", $group->group_info['group_id'], $group->group_info['group_privacy']);
}
// OUTPUT JSON RESULT
示例15: group_privacy_levels
if (group_privacy_levels($priv) != "") {
SE_Language::_preload(group_privacy_levels($priv));
$privacy_options[$priv] = group_privacy_levels($priv);
}
}
for ($c = 8; $c >= 0; $c--) {
$priv = pow(2, $c) - 1;
if (group_privacy_levels($priv) != "") {
SE_Language::_preload(group_privacy_levels($priv));
$comment_options[$priv] = group_privacy_levels($priv);
}
}
for ($c = 7; $c >= 0; $c--) {
$priv = pow(2, $c) - 1;
if (group_privacy_levels($priv) != "") {
SE_Language::_preload(group_privacy_levels($priv));
$upload_options[$priv] = group_privacy_levels($priv);
}
}
// ASSIGN VARIABLES AND SHOW USER GROUPS PAGE
$smarty->assign('result', $result);
$smarty->assign('is_error', $is_error);
$smarty->assign('level_info', $level_info);
$smarty->assign('level_group_privacy', unserialize($level_info[level_group_privacy]));
$smarty->assign('level_group_comments', unserialize($level_info[level_group_comments]));
$smarty->assign('level_group_discussion', unserialize($level_info[level_group_discussion]));
$smarty->assign('level_group_upload', unserialize($level_info[level_group_upload]));
$smarty->assign('level_group_tag', unserialize($level_info[level_group_tag]));
$smarty->assign('group_privacy', $privacy_options);
$smarty->assign('group_comments', $comment_options);
$smarty->assign('group_discussion', $comment_options);