diff --git a/admin/admin_attach_cp.php b/admin/admin_attach_cp.php index 8be0ef95f..40adf9a0e 100644 --- a/admin/admin_attach_cp.php +++ b/admin/admin_attach_cp.php @@ -179,7 +179,7 @@ if ($confirm && count($delete_id_list) > 0) { } print_confirmation(array( - 'FORM_ACTION' => "admin_attach_cp.php", + 'FORM_ACTION' => 'admin_attach_cp.php', 'HIDDEN_FIELDS' => $hidden_fields, )); } @@ -214,9 +214,9 @@ if ($submit_change && $view === 'attachments') { while ($attachrow = DB()->sql_fetchrow($result)) { if (isset($attachments['_' . $attachrow['attach_id']])) { if ($attachrow['comment'] != $attachments['_' . $attachrow['attach_id']]['comment'] || $attachrow['download_count'] != $attachments['_' . $attachrow['attach_id']]['download_count']) { - $sql = "UPDATE " . BB_ATTACHMENTS_DESC . " - SET comment = '" . attach_mod_sql_escape($attachments['_' . $attachrow['attach_id']]['comment']) . "', download_count = " . (int)$attachments['_' . $attachrow['attach_id']]['download_count'] . " - WHERE attach_id = " . (int)$attachrow['attach_id']; + $sql = 'UPDATE ' . BB_ATTACHMENTS_DESC . " + SET comment = '" . attach_mod_sql_escape($attachments['_' . $attachrow['attach_id']]['comment']) . "', download_count = " . (int)$attachments['_' . $attachrow['attach_id']]['download_count'] . ' + WHERE attach_id = ' . (int)$attachrow['attach_id']; if (!DB()->sql_query($sql)) { bb_die('Could not update attachments informations'); @@ -234,17 +234,17 @@ if ($view == 'stats') { $attachment_quota = humn_size($attach_config['attachment_quota']); // number_of_attachments - $row = DB()->fetch_row("SELECT COUNT(*) AS total FROM " . BB_ATTACHMENTS_DESC); + $row = DB()->fetch_row('SELECT COUNT(*) AS total FROM ' . BB_ATTACHMENTS_DESC); $number_of_attachments = $number_of_posts = $row['total']; $number_of_pms = 0; // number_of_topics - $row = DB()->fetch_row("SELECT COUNT(*) AS topics FROM " . BB_TOPICS . " WHERE topic_attachment = 1"); + $row = DB()->fetch_row('SELECT COUNT(*) AS topics FROM ' . BB_TOPICS . ' WHERE topic_attachment = 1'); $number_of_topics = $row['topics']; // number_of_users - $row = DB()->fetch_row("SELECT COUNT(DISTINCT user_id_1) AS users FROM " . BB_ATTACHMENTS . " WHERE post_id != 0"); + $row = DB()->fetch_row('SELECT COUNT(DISTINCT user_id_1) AS users FROM ' . BB_ATTACHMENTS . ' WHERE post_id != 0'); $number_of_users = $row['users']; $template->assign_vars(array( @@ -263,10 +263,10 @@ if ($view == 'stats') { if ($view === 'search') { // Get Forums and Categories //sf - add [, f.forum_parent] - $sql = "SELECT c.cat_title, c.cat_id, f.forum_name, f.forum_id, f.forum_parent - FROM " . BB_CATEGORIES . " c, " . BB_FORUMS . " f + $sql = 'SELECT c.cat_title, c.cat_id, f.forum_name, f.forum_id, f.forum_parent + FROM ' . BB_CATEGORIES . ' c, ' . BB_FORUMS . ' f WHERE f.cat_id = c.cat_id - ORDER BY c.cat_id, f.forum_order"; + ORDER BY c.cat_id, f.forum_order'; if (!($result = DB()->sql_query($sql))) { bb_die('Could not obtain forum_name / forum_id'); @@ -275,7 +275,7 @@ if ($view === 'search') { $s_forums = ''; $list_cat = []; while ($row = DB()->sql_fetchrow($result)) { //sf - $s_forums .= ''; + $s_forums .= ''; if (empty($list_cat[$row['cat_id']])) { $list_cat[$row['cat_id']] = $row['cat_title']; @@ -318,7 +318,7 @@ if ($view === 'username') { // Attachments if ($view === 'attachments') { - $user_based = ($uid) ? true : false; + $user_based = $uid ? true : false; $search_based = (isset($_POST['search']) && $_POST['search']); $hidden_fields = ''; @@ -333,7 +333,7 @@ if ($view === 'attachments') { // Are we called from Username ? if ($user_based) { - $sql = "SELECT username FROM " . BB_USERS . " WHERE user_id = " . (int)$uid; + $sql = 'SELECT username FROM ' . BB_USERS . ' WHERE user_id = ' . (int)$uid; if (!($result = DB()->sql_query($sql))) { bb_die('Error getting username'); @@ -352,10 +352,10 @@ if ($view === 'attachments') { 'L_STATISTICS_FOR_USER' => sprintf($lang['STATISTICS_FOR_USER'], $username), )); - $sql = "SELECT attach_id - FROM " . BB_ATTACHMENTS . " - WHERE user_id_1 = " . (int)$uid . " - GROUP BY attach_id"; + $sql = 'SELECT attach_id + FROM ' . BB_ATTACHMENTS . ' + WHERE user_id_1 = ' . (int)$uid . ' + GROUP BY attach_id'; if (!($result = DB()->sql_query($sql))) { bb_die('Could not query attachments #1'); @@ -377,9 +377,9 @@ if ($view === 'attachments') { $attach_id[] = (int)$attach_ids[$j]['attach_id']; } - $sql = "SELECT a.* - FROM " . BB_ATTACHMENTS_DESC . " a - WHERE a.attach_id IN (" . implode(', ', $attach_id) . ") " . + $sql = 'SELECT a.* + FROM ' . BB_ATTACHMENTS_DESC . ' a + WHERE a.attach_id IN (' . implode(', ', $attach_id) . ') ' . $order_by; if (!($result = DB()->sql_query($sql))) { @@ -411,9 +411,9 @@ if ($view === 'attachments') { // If it's not assigned to any post, it's an private message thingy. ;) $post_titles = []; - $sql = "SELECT * - FROM " . BB_ATTACHMENTS . " - WHERE attach_id = " . (int)$attachments[$i]['attach_id']; + $sql = 'SELECT * + FROM ' . BB_ATTACHMENTS . ' + WHERE attach_id = ' . (int)$attachments[$i]['attach_id']; if (!($result = DB()->sql_query($sql))) { bb_die('Could not query attachments #3'); @@ -425,10 +425,10 @@ if ($view === 'attachments') { for ($j = 0; $j < $num_ids; $j++) { if ($ids[$j]['post_id'] != 0) { - $sql = "SELECT t.topic_title - FROM " . BB_TOPICS . " t, " . BB_POSTS . " p - WHERE p.post_id = " . (int)$ids[$j]['post_id'] . " AND p.topic_id = t.topic_id - GROUP BY t.topic_id, t.topic_title"; + $sql = 'SELECT t.topic_title + FROM ' . BB_TOPICS . ' t, ' . BB_POSTS . ' p + WHERE p.post_id = ' . (int)$ids[$j]['post_id'] . ' AND p.topic_id = t.topic_id + GROUP BY t.topic_id, t.topic_title'; if (!($result = DB()->sql_query($sql))) { bb_die('Could not query topic'); @@ -455,13 +455,13 @@ if ($view === 'attachments') { $hidden_field = ''; $template->assign_block_vars('attachrow', array( - 'ROW_NUMBER' => $i + (@$_GET['start'] + 1), + 'ROW_NUMBER' => $i + ($_GET['start'] + 1), 'ROW_CLASS' => $row_class, 'FILENAME' => htmlspecialchars($attachments[$i]['real_filename']), 'COMMENT' => htmlspecialchars($attachments[$i]['comment']), 'EXTENSION' => $attachments[$i]['extension'], - 'SIZE' => round(($attachments[$i]['filesize'] / 1024), 2), + 'SIZE' => round($attachments[$i]['filesize'] / 1024, 2), 'DOWNLOAD_COUNT' => $attachments[$i]['download_count'], 'POST_TIME' => bb_date($attachments[$i]['filetime']), 'POST_TITLE' => $post_titles, @@ -475,7 +475,7 @@ if ($view === 'attachments') { if (!$search_based && !$user_based) { if (!$attachments) { - $sql = "SELECT attach_id FROM " . BB_ATTACHMENTS_DESC; + $sql = 'SELECT attach_id FROM ' . BB_ATTACHMENTS_DESC; if (!($result = DB()->sql_query($sql))) { bb_die('Could not query attachment description table'); diff --git a/admin/admin_attachments.php b/admin/admin_attachments.php index a89fcca06..7a1782673 100644 --- a/admin/admin_attachments.php +++ b/admin/admin_attachments.php @@ -49,10 +49,10 @@ $size = request_var('size', ''); $quota_size = request_var('quota_size', ''); $pm_size = request_var('pm_size', ''); -$submit = (isset($_POST['submit'])) ? true : false; -$check_upload = (isset($_POST['settings'])) ? true : false; -$check_image_cat = (isset($_POST['cat_settings'])) ? true : false; -$search_imagick = (isset($_POST['search_imagick'])) ? true : false; +$submit = isset($_POST['submit']) ? true : false; +$check_upload = isset($_POST['settings']) ? true : false; +$check_image_cat = isset($_POST['cat_settings']) ? true : false; +$search_imagick = isset($_POST['search_imagick']) ? true : false; // Re-evaluate the Attachment Configuration $sql = 'SELECT * FROM ' . BB_ATTACH_CONFIG; @@ -118,11 +118,11 @@ while ($row = DB()->sql_fetchrow($result)) { } } - $sql = "UPDATE " . BB_ATTACH_CONFIG . " + $sql = 'UPDATE ' . BB_ATTACH_CONFIG . " SET config_value = '" . attach_mod_sql_escape($new_attach[$config_name]) . "' WHERE config_name = '" . attach_mod_sql_escape($config_name) . "'"; } else { - $sql = "UPDATE " . BB_ATTACH_CONFIG . " + $sql = 'UPDATE ' . BB_ATTACH_CONFIG . " SET config_value = '" . attach_mod_sql_escape($new_attach[$config_name]) . "' WHERE config_name = '" . attach_mod_sql_escape($config_name) . "'"; } @@ -168,13 +168,13 @@ if ($search_imagick) { } elseif (preg_match('/WIN/i', PHP_OS)) { $path = 'c:/imagemagick/convert.exe'; - if (!@file_exists(@amod_realpath($path))) { + if (!@file_exists(amod_realpath($path))) { $imagick = $path; } } } - if (!@file_exists(@amod_realpath(trim($imagick)))) { + if (!@file_exists(amod_realpath(trim($imagick)))) { $new_attach['img_imagick'] = trim($imagick); } else { $new_attach['img_imagick'] = ''; @@ -209,7 +209,7 @@ if ($check_upload) { $error = false; // Does the target directory exist, is it a directory and writeable - if (!@file_exists(@amod_realpath($upload_dir))) { + if (!@file_exists(amod_realpath($upload_dir))) { $error = true; $error_msg = sprintf($lang['DIRECTORY_DOES_NOT_EXIST'], $attach_config['upload_dir']) . '
'; } @@ -359,11 +359,11 @@ if ($check_image_cat) { $error = false; // Does the target directory exist, is it a directory and writeable - if (!@file_exists(@amod_realpath($upload_dir))) { - @mkdir($upload_dir, 0755); + if (!@file_exists(amod_realpath($upload_dir))) { + mkdir($upload_dir, 0755); @chmod($upload_dir, 0777); - if (!@file_exists(@amod_realpath($upload_dir))) { + if (!@file_exists(amod_realpath($upload_dir))) { $error = true; $error_msg = sprintf($lang['DIRECTORY_DOES_NOT_EXIST'], $upload_dir) . '
'; } @@ -403,10 +403,10 @@ if ($submit && $mode == 'quota') { $filesize_list[$i] = ($size_select_list[$i] == 'kb') ? round($filesize_list[$i] * 1024) : (($size_select_list[$i] == 'mb') ? round($filesize_list[$i] * 1048576) : $filesize_list[$i]); $sql = 'UPDATE ' . BB_QUOTA_LIMITS . " - SET quota_desc = '" . attach_mod_sql_escape($quota_desc_list[$i]) . "', quota_limit = " . (int)$filesize_list[$i] . " - WHERE quota_limit_id = " . (int)$quota_change_list[$i]; + SET quota_desc = '" . attach_mod_sql_escape($quota_desc_list[$i]) . "', quota_limit = " . (int)$filesize_list[$i] . ' + WHERE quota_limit_id = ' . (int)$quota_change_list[$i]; - if (!(DB()->sql_query($sql))) { + if (!DB()->sql_query($sql)) { bb_die('Could not update quota limits'); } } @@ -435,7 +435,7 @@ if ($submit && $mode == 'quota') { $quota_desc = get_var('quota_description', ''); $filesize = get_var('add_max_filesize', 0); $size_select = get_var('add_size_select', ''); - $add = (isset($_POST['add_quota_check'])) ? true : false; + $add = isset($_POST['add_quota_check']) ? true : false; if ($quota_desc != '' && $add) { // check Quota Description @@ -464,10 +464,10 @@ if ($submit && $mode == 'quota') { if (!$error) { $filesize = ($size_select == 'kb') ? round($filesize * 1024) : (($size_select == 'mb') ? round($filesize * 1048576) : $filesize); - $sql = "INSERT INTO " . BB_QUOTA_LIMITS . " (quota_desc, quota_limit) - VALUES ('" . attach_mod_sql_escape($quota_desc) . "', " . (int)$filesize . ")"; + $sql = 'INSERT INTO ' . BB_QUOTA_LIMITS . " (quota_desc, quota_limit) + VALUES ('" . attach_mod_sql_escape($quota_desc) . "', " . (int)$filesize . ')'; - if (!(DB()->sql_query($sql))) { + if (!DB()->sql_query($sql)) { bb_die('Could not add quota limit'); } } @@ -495,7 +495,7 @@ if ($mode == 'quota') { 'S_ATTACH_ACTION' => 'admin_attachments.php?mode=quota', )); - $sql = "SELECT * FROM " . BB_QUOTA_LIMITS . " ORDER BY quota_limit DESC"; + $sql = 'SELECT * FROM ' . BB_QUOTA_LIMITS . ' ORDER BY quota_limit DESC'; if (!($result = DB()->sql_query($sql))) { bb_die('Could not get quota limits #1'); @@ -532,7 +532,7 @@ if ($mode == 'quota' && $e_mode == 'view_quota') { $template->assign_block_vars('switch_quota_limit_desc', array()); - $sql = "SELECT * FROM " . BB_QUOTA_LIMITS . " WHERE quota_limit_id = " . (int)$quota_id . " LIMIT 1"; + $sql = 'SELECT * FROM ' . BB_QUOTA_LIMITS . ' WHERE quota_limit_id = ' . (int)$quota_id . ' LIMIT 1'; if (!($result = DB()->sql_query($sql))) { bb_die('Could not get quota limits #2'); diff --git a/admin/admin_board.php b/admin/admin_board.php index 0853a5096..c7dd5c50c 100644 --- a/admin/admin_board.php +++ b/admin/admin_board.php @@ -42,7 +42,7 @@ $return_links = array( /** * Pull all config data */ -$sql = "SELECT * FROM " . BB_CONFIG; +$sql = 'SELECT * FROM ' . BB_CONFIG; if (!$result = DB()->sql_query($sql)) { bb_die('Could not query config information in admin_board'); } else { @@ -96,7 +96,6 @@ switch ($mode) { 'BIRTHDAY_CHECK_DAY' => $new['birthday_check_day'], 'PREMOD' => $new['premod'], 'TOR_COMMENT' => $new['tor_comment'], - 'NEW_TPLS' => $new['new_tpls'], 'SEED_BONUS_ENABLED' => $new['seed_bonus_enabled'], 'SEED_BONUS_TOR_SIZE' => $new['seed_bonus_tor_size'], 'SEED_BONUS_USER_REGDATE' => $new['seed_bonus_user_regdate'], @@ -142,8 +141,8 @@ switch ($mode) { 'SITENAME' => htmlCHR($new['sitename']), 'CONFIG_SITE_DESCRIPTION' => htmlCHR($new['site_desc']), - 'DISABLE_BOARD' => ($new['board_disable']) ? true : false, - 'ALLOW_AUTOLOGIN' => ($new['allow_autologin']) ? true : false, + 'DISABLE_BOARD' => $new['board_disable'] ? true : false, + 'ALLOW_AUTOLOGIN' => $new['allow_autologin'] ? true : false, 'AUTOLOGIN_TIME' => (int)$new['max_autologin_time'], 'MAX_POLL_OPTIONS' => $new['max_poll_options'], 'FLOOD_INTERVAL' => $new['flood_interval'], @@ -155,12 +154,12 @@ switch ($mode) { 'TIMEZONE_SELECT' => tz_select($new['board_timezone'], 'board_timezone'), 'MAX_LOGIN_ATTEMPTS' => $new['max_login_attempts'], 'LOGIN_RESET_TIME' => $new['login_reset_time'], - 'PRUNE_ENABLE' => ($new['prune_enable']) ? true : false, - 'ALLOW_BBCODE' => ($new['allow_bbcode']) ? true : false, - 'ALLOW_SMILIES' => ($new['allow_smilies']) ? true : false, - 'ALLOW_SIG' => ($new['allow_sig']) ? true : false, + 'PRUNE_ENABLE' => $new['prune_enable'] ? true : false, + 'ALLOW_BBCODE' => $new['allow_bbcode'] ? true : false, + 'ALLOW_SMILIES' => $new['allow_smilies'] ? true : false, + 'ALLOW_SIG' => $new['allow_sig'] ? true : false, 'SIG_SIZE' => $new['max_sig_chars'], - 'ALLOW_NAMECHANGE' => ($new['allow_namechange']) ? true : false, + 'ALLOW_NAMECHANGE' => $new['allow_namechange'] ? true : false, 'SMILIES_PATH' => $new['smilies_path'], )); break; diff --git a/admin/admin_bt_forum_cfg.php b/admin/admin_bt_forum_cfg.php index 3a8b7b128..152d0ad16 100644 --- a/admin/admin_bt_forum_cfg.php +++ b/admin/admin_bt_forum_cfg.php @@ -119,10 +119,10 @@ set_tpl_vars_lang($default_cfg_num); set_tpl_vars_lang($db_fields_bool); // Get Forums list -$sql = "SELECT f.* - FROM " . BB_CATEGORIES . " c, " . BB_FORUMS . " f +$sql = 'SELECT f.* + FROM ' . BB_CATEGORIES . ' c, ' . BB_FORUMS . ' f WHERE f.cat_id = c.cat_id - ORDER BY c.cat_order, f.forum_order"; + ORDER BY c.cat_order, f.forum_order'; if (!$result = DB()->sql_query($sql)) { bb_die('Could not obtain forum names'); diff --git a/admin/admin_cron.php b/admin/admin_cron.php index a669d92a4..27ed0344e 100644 --- a/admin/admin_cron.php +++ b/admin/admin_cron.php @@ -38,7 +38,7 @@ $cron_action = isset($_POST['cron_action']) ? $_POST['cron_action'] : ''; if ($mode == 'run' && !$job_id) { define('BB_ROOT', './../'); - require(BB_ROOT . 'common.php'); + require BB_ROOT . 'common.php'; $user->session_start(); redirect('admin/' . basename(__FILE__) . '?mode=list'); } else { @@ -52,7 +52,7 @@ if (!IS_SUPER_ADMIN) { require INC_DIR . '/functions_admin_torrent.php'; require INC_DIR . '/functions_admin_cron.php'; -$sql = DB()->fetch_rowset("SELECT * FROM " . BB_CONFIG . " WHERE config_name = 'cron_enabled' OR config_name = 'cron_check_interval'"); +$sql = DB()->fetch_rowset('SELECT * FROM ' . BB_CONFIG . " WHERE config_name = 'cron_enabled' OR config_name = 'cron_check_interval'"); foreach ($sql as $row) { $config_name = $row['config_name']; @@ -67,13 +67,13 @@ foreach ($sql as $row) { } $template->assign_vars(array( - 'CRON_ENABLED' => ($new['cron_enabled']) ? true : false, + 'CRON_ENABLED' => $new['cron_enabled'] ? true : false, 'CRON_CHECK_INTERVAL' => $new['cron_check_interval'], )); switch ($mode) { case 'list': - $sql = DB()->fetch_rowset("SELECT * FROM " . BB_CRON . " ORDER BY cron_id"); + $sql = DB()->fetch_rowset('SELECT * FROM ' . BB_CRON . ' ORDER BY cron_id'); foreach ($sql as $i => $row) { $template->assign_block_vars('list', array( @@ -107,7 +107,7 @@ switch ($mode) { case 'repair': if (file_exists('../triggers/cron_running')) { - rename("../triggers/cron_running", "../triggers/cron_allowed"); + rename('../triggers/cron_running', '../triggers/cron_allowed'); } redirect('admin/' . basename(__FILE__) . '?mode=list'); break; @@ -118,7 +118,7 @@ switch ($mode) { break; case 'edit': - $sql = DB()->fetch_rowset("SELECT * FROM " . BB_CRON . " WHERE cron_id = $job_id"); + $sql = DB()->fetch_rowset('SELECT * FROM ' . BB_CRON . " WHERE cron_id = $job_id"); foreach ($sql as $row) { $template->assign_vars(array( diff --git a/admin/admin_disallow.php b/admin/admin_disallow.php index 18443e292..f7743a564 100644 --- a/admin/admin_disallow.php +++ b/admin/admin_disallow.php @@ -34,7 +34,7 @@ $message = ''; if (isset($_POST['add_name'])) { include INC_DIR . '/functions_validate.php'; - $disallowed_user = (isset($_POST['disallowed_user'])) ? trim($_POST['disallowed_user']) : trim($_GET['disallowed_user']); + $disallowed_user = isset($_POST['disallowed_user']) ? trim($_POST['disallowed_user']) : trim($_GET['disallowed_user']); if ($disallowed_user == '') { bb_die($lang['FIELDS_EMPTY']); @@ -42,7 +42,7 @@ if (isset($_POST['add_name'])) { if (!validate_username($disallowed_user)) { $message = $lang['DISALLOWED_ALREADY']; } else { - $sql = "INSERT INTO " . BB_DISALLOW . " (disallow_username) VALUES('" . DB()->escape($disallowed_user) . "')"; + $sql = 'INSERT INTO ' . BB_DISALLOW . " (disallow_username) VALUES('" . DB()->escape($disallowed_user) . "')"; $result = DB()->sql_query($sql); if (!$result) { bb_die('Could not add disallowed user'); @@ -54,9 +54,9 @@ if (isset($_POST['add_name'])) { bb_die($message); } elseif (isset($_POST['delete_name'])) { - $disallowed_id = (isset($_POST['disallowed_id'])) ? (int)$_POST['disallowed_id'] : (int)$_GET['disallowed_id']; + $disallowed_id = isset($_POST['disallowed_id']) ? (int)$_POST['disallowed_id'] : (int)$_GET['disallowed_id']; - $sql = "DELETE FROM " . BB_DISALLOW . " WHERE disallow_id = $disallowed_id"; + $sql = 'DELETE FROM ' . BB_DISALLOW . " WHERE disallow_id = $disallowed_id"; $result = DB()->sql_query($sql); if (!$result) { bb_die('Could not removed disallowed user'); @@ -70,7 +70,7 @@ if (isset($_POST['add_name'])) { /** * Grab the current list of disallowed usernames */ -$sql = "SELECT * FROM " . BB_DISALLOW; +$sql = 'SELECT * FROM ' . BB_DISALLOW; $result = DB()->sql_query($sql); if (!$result) { bb_die('Could not get disallowed users'); diff --git a/admin/admin_extensions.php b/admin/admin_extensions.php index b9cea0fa1..e730e2355 100644 --- a/admin/admin_extensions.php +++ b/admin/admin_extensions.php @@ -58,7 +58,7 @@ $size = get_var('size', ''); $mode = get_var('mode', ''); $e_mode = get_var('e_mode', ''); -$submit = (isset($_POST['submit'])) ? true : false; +$submit = isset($_POST['submit']) ? true : false; // Get Attachment Config $attach_config = array(); @@ -133,7 +133,7 @@ if ($submit && $mode == 'extensions') { $extension = get_var('add_extension', ''); $extension_explain = get_var('add_extension_explain', ''); $extension_group = get_var('add_group_select', 0); - $add = (isset($_POST['add_extension_check'])) ? true : false; + $add = isset($_POST['add_extension_check']) ? true : false; if ($extension != '' && $add) { $template->assign_vars(array( @@ -141,7 +141,7 @@ if ($submit && $mode == 'extensions') { 'ADD_EXTENSION_EXPLAIN' => $extension_explain, )); - if (!@$error) { + if (!$error) { // check extension $sql = 'SELECT extension FROM ' . BB_EXTENSIONS; @@ -165,7 +165,7 @@ if ($submit && $mode == 'extensions') { } } - if (!@$error) { + if (!$error) { $sql_ary = array( 'group_id' => (int)$extension_group, 'extension' => (string)strtolower($extension), @@ -181,7 +181,7 @@ if ($submit && $mode == 'extensions') { } } - if (!@$error) { + if (!$error) { bb_die($lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } } @@ -260,7 +260,7 @@ if ($submit && $mode == 'groups') { } for ($i = 0, $iMax = count($group_change_list); $i < $iMax; $i++) { - $allowed = (isset($allowed_list[$i])) ? 1 : 0; + $allowed = isset($allowed_list[$i]) ? 1 : 0; $filesize_list[$i] = ($size_select_list[$i] == 'kb') ? round($filesize_list[$i] * 1024) : (($size_select_list[$i] == 'mb') ? round($filesize_list[$i] * 1048576) : $filesize_list[$i]); @@ -276,7 +276,7 @@ if ($submit && $mode == 'groups') { $sql = 'UPDATE ' . BB_EXTENSION_GROUPS . ' SET ' . attach_mod_sql_build_array('UPDATE', $sql_ary) . ' WHERE group_id = ' . (int)$group_change_list[$i]; - if (!(DB()->sql_query($sql))) { + if (!DB()->sql_query($sql)) { bb_die('Could not update extension groups informations'); } } @@ -313,8 +313,8 @@ if ($submit && $mode == 'groups') { $filesize = get_var('add_max_filesize', 0); $size_select = get_var('add_size_select', ''); - $is_allowed = (isset($_POST['add_allowed'])) ? 1 : 0; - $add = (isset($_POST['add_extension_group_check'])) ? true : false; + $is_allowed = isset($_POST['add_allowed']) ? 1 : 0; + $add = isset($_POST['add_extension_group_check']) ? true : false; if ($extension_group != '' && $add) { // check Extension Group @@ -340,7 +340,7 @@ if ($submit && $mode == 'groups') { } } - if (!@$error) { + if (!$error) { $filesize = ($size_select == 'kb') ? round($filesize * 1024) : (($size_select == 'mb') ? round($filesize * 1048576) : $filesize); $sql_ary = array( @@ -355,13 +355,13 @@ if ($submit && $mode == 'groups') { $sql = 'INSERT INTO ' . BB_EXTENSION_GROUPS . ' ' . attach_mod_sql_build_array('INSERT', $sql_ary); - if (!(DB()->sql_query($sql))) { + if (!DB()->sql_query($sql)) { bb_die('Could not add extension group'); } } } - if (!@$error) { + if (!$error) { bb_die($lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } } @@ -384,7 +384,7 @@ if ($mode == 'groups') { $template->assign_vars(array( 'TPL_ATTACH_EXTENSION_GROUPS' => true, - 'ADD_GROUP_NAME' => (isset($submit)) ? @$extension_group : '', + 'ADD_GROUP_NAME' => isset($extension_group) ? $extension_group : '', 'MAX_FILESIZE' => $max_add_filesize, 'S_FILESIZE' => size_select('add_size_select', $size), 'S_ADD_DOWNLOAD_MODE' => download_select('add_download_mode'), @@ -430,8 +430,8 @@ if ($mode == 'groups') { 'S_FILESIZE' => size_select('size_select_list[]', $size_format), 'MAX_FILESIZE' => $extension_group[$i]['max_filesize'], - 'CAT_BOX' => ($viewgroup == $extension_group[$i]['group_id']) ? '+' : '-', - 'U_VIEWGROUP' => ($viewgroup == $extension_group[$i]['group_id']) ? "admin_extensions.php?mode=groups" : "admin_extensions.php?mode=groups&" . POST_GROUPS_URL . "=" . $extension_group[$i]['group_id'], + 'CAT_BOX' => ($viewgroup == $extension_group[$i]['group_id']) ? '-' : '+', + 'U_VIEWGROUP' => ($viewgroup == $extension_group[$i]['group_id']) ? 'admin_extensions.php?mode=groups' : 'admin_extensions.php?mode=groups&' . POST_GROUPS_URL . '=' . $extension_group[$i]['group_id'], 'U_FORUM_PERMISSIONS' => "admin_extensions.php?mode=$mode&e_mode=perm&e_group=" . $extension_group[$i]['group_id'], )); @@ -459,8 +459,8 @@ if ($mode == 'groups') { if ($e_mode == 'perm') { $group = get_var('e_group', 0); - $add_forum = (isset($_POST['add_forum'])) ? true : false; - $delete_forum = (isset($_POST['del_forum'])) ? true : false; + $add_forum = isset($_POST['add_forum']) ? true : false; + $delete_forum = isset($_POST['del_forum']) ? true : false; if (isset($_POST['close_perm'])) { $e_mode = ''; @@ -468,7 +468,7 @@ if ($e_mode == 'perm') { } // Add Forums -if (@$add_forum && $e_mode == 'perm' && $group) { +if ($add_forum && $e_mode == 'perm' && $group) { $add_forums_list = get_var('entries', array(0)); $add_all_forums = false; @@ -524,7 +524,7 @@ if (@$add_forum && $e_mode == 'perm' && $group) { } // Delete Forums -if (@$delete_forum && $e_mode == 'perm' && $group) { +if ($delete_forum && $e_mode == 'perm' && $group) { $delete_forums_list = get_var('entries', array(0)); // Get the current Forums @@ -585,7 +585,7 @@ if ($e_mode == 'perm' && $group) { $forum_p = array(); $act_id = 0; $forum_p = auth_unpack($allowed_forums); - $sql = "SELECT forum_id, forum_name FROM " . BB_FORUMS . " WHERE forum_id IN (" . implode(', ', $forum_p) . ")"; + $sql = 'SELECT forum_id, forum_name FROM ' . BB_FORUMS . ' WHERE forum_id IN (' . implode(', ', $forum_p) . ')'; if (!($result = DB()->sql_query($sql))) { bb_die('Could not get forum names'); } @@ -612,7 +612,7 @@ if ($e_mode == 'perm' && $group) { $forum_option_values = array(0 => $lang['PERM_ALL_FORUMS']); - $sql = "SELECT forum_id, forum_name FROM " . BB_FORUMS; + $sql = 'SELECT forum_id, forum_name FROM ' . BB_FORUMS; if (!($result = DB()->sql_query($sql))) { bb_die('Could not get forums #1'); @@ -632,7 +632,7 @@ if ($e_mode == 'perm' && $group) { $empty_perm_forums = array(); - $sql = "SELECT forum_id, forum_name FROM " . BB_FORUMS . " WHERE auth_attachments < " . AUTH_ADMIN; + $sql = 'SELECT forum_id, forum_name FROM ' . BB_FORUMS . ' WHERE auth_attachments < ' . AUTH_ADMIN; if (!($f_result = DB()->sql_query($sql))) { bb_die('Could not get forums #2'); @@ -641,10 +641,10 @@ if ($e_mode == 'perm' && $group) { while ($row = DB()->sql_fetchrow($f_result)) { $forum_id = $row['forum_id']; - $sql = "SELECT forum_permissions - FROM " . BB_EXTENSION_GROUPS . " + $sql = 'SELECT forum_permissions + FROM ' . BB_EXTENSION_GROUPS . ' WHERE allow_group = 1 - ORDER BY group_name ASC"; + ORDER BY group_name ASC'; if (!($result = DB()->sql_query($sql))) { bb_die('Could not query extension groups'); @@ -681,7 +681,7 @@ if ($e_mode == 'perm' && $group) { } } -if (@$error) { +if ($error) { $template->assign_vars(array('ERROR_MESSAGE' => $error_msg)); } diff --git a/admin/admin_forum_prune.php b/admin/admin_forum_prune.php index a96874b38..358084eba 100644 --- a/admin/admin_forum_prune.php +++ b/admin/admin_forum_prune.php @@ -47,7 +47,7 @@ if (isset($_REQUEST['submit'])) { $where_sql = ($forum_csv != $all_forums) ? "WHERE forum_id IN($forum_csv)" : ''; - $sql = "SELECT forum_id, forum_name FROM " . BB_FORUMS . " $where_sql"; + $sql = 'SELECT forum_id, forum_name FROM ' . BB_FORUMS . " $where_sql"; foreach (DB()->fetch_rowset($sql) as $i => $row) { $pruned_topics = topic_delete('prune', $row['forum_id'], $prunetime, !empty($_POST['prune_all_topic_types'])); diff --git a/admin/admin_forumauth.php b/admin/admin_forumauth.php index 738517e3b..8e999cbfa 100644 --- a/admin/admin_forumauth.php +++ b/admin/admin_forumauth.php @@ -74,7 +74,7 @@ foreach ($forum_auth_fields as $auth_type) { $forum_auth_levels = ['ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN']; $forum_auth_const = [AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN]; -if ($_REQUEST[POST_FORUM_URL]) { +if (isset($_REQUEST[POST_FORUM_URL])) { $forum_id = (int)$_REQUEST[POST_FORUM_URL]; $forum_sql = "WHERE forum_id = $forum_id"; } else { @@ -103,7 +103,7 @@ if (isset($_POST['submit'])) { } if (is_array($simple_ary)) { - $sql = "UPDATE " . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id"; + $sql = 'UPDATE ' . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id"; } } else { for ($i = 0, $iMax = count($forum_auth_fields); $i < $iMax; $i++) { @@ -118,7 +118,7 @@ if (isset($_POST['submit'])) { $sql .= (($sql != '') ? ', ' : '') . $forum_auth_fields[$i] . ' = ' . $value; } - $sql = "UPDATE " . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id"; + $sql = 'UPDATE ' . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id"; } if ($sql != '') { @@ -132,13 +132,13 @@ if (isset($_POST['submit'])) { } $datastore->update('cat_forums'); - bb_die($lang['FORUM_AUTH_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '', "")); + bb_die($lang['FORUM_AUTH_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '', '')); } /** * Get required information */ -$forum_rows = DB()->fetch_rowset("SELECT * FROM " . BB_FORUMS . " $forum_sql"); +$forum_rows = DB()->fetch_rowset('SELECT * FROM ' . BB_FORUMS . " $forum_sql"); if (empty($forum_id)) { // Output the selection table if no forum id was specified @@ -215,9 +215,9 @@ if (empty($forum_id)) { } } - $adv_mode = (empty($adv)) ? '1' : '0'; + $adv_mode = empty($adv) ? '1' : '0'; $switch_mode = "admin_forumauth.php?f=$forum_id&adv=$adv_mode"; - $switch_mode_text = (empty($adv)) ? $lang['ADVANCED_MODE'] : $lang['SIMPLE_MODE']; + $switch_mode_text = empty($adv) ? $lang['ADVANCED_MODE'] : $lang['SIMPLE_MODE']; $u_switch_mode = '' . $switch_mode_text . ''; $s_hidden_fields = ''; diff --git a/admin/admin_forumauth_list.php b/admin/admin_forumauth_list.php index 9717cca81..fc2b26b1e 100644 --- a/admin/admin_forumauth_list.php +++ b/admin/admin_forumauth_list.php @@ -75,7 +75,7 @@ $forum_auth_levels = ['ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN']; $forum_auth_const = [AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN]; if (isset($_GET[POST_FORUM_URL]) || isset($_POST[POST_FORUM_URL])) { - $forum_id = (isset($_POST[POST_FORUM_URL])) ? (int)$_POST[POST_FORUM_URL] : (int)$_GET[POST_FORUM_URL]; + $forum_id = isset($_POST[POST_FORUM_URL]) ? (int)$_POST[POST_FORUM_URL] : (int)$_GET[POST_FORUM_URL]; $forum_sql = "AND forum_id = $forum_id"; } else { unset($forum_id); @@ -83,7 +83,7 @@ if (isset($_GET[POST_FORUM_URL]) || isset($_POST[POST_FORUM_URL])) { } if (isset($_GET[POST_CAT_URL]) || isset($_POST[POST_CAT_URL])) { - $cat_id = (isset($_POST[POST_CAT_URL])) ? (int)$_POST[POST_CAT_URL] : (int)$_GET[POST_CAT_URL]; + $cat_id = isset($_POST[POST_CAT_URL]) ? (int)$_POST[POST_CAT_URL] : (int)$_GET[POST_CAT_URL]; $cat_sql = "AND c.cat_id = $cat_id"; } else { unset($cat_id); @@ -111,7 +111,7 @@ if (isset($_POST['submit'])) { } if (is_array($simple_ary)) { - $sql = "UPDATE " . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id"; + $sql = 'UPDATE ' . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id"; } } else { for ($i = 0, $iMax = count($forum_auth_fields); $i < $iMax; $i++) { @@ -126,7 +126,7 @@ if (isset($_POST['submit'])) { $sql .= (($sql != '') ? ', ' : '') . $forum_auth_fields[$i] . ' = ' . $value; } - $sql = "UPDATE " . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id"; + $sql = 'UPDATE ' . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id"; } if ($sql != '') { @@ -150,7 +150,7 @@ if (isset($_POST['submit'])) { $sql .= (($sql != '') ? ', ' : '') . $forum_auth_fields[$i] . ' = ' . $value; } - $sql = "UPDATE " . BB_FORUMS . " SET $sql WHERE cat_id = $cat_id"; + $sql = 'UPDATE ' . BB_FORUMS . " SET $sql WHERE cat_id = $cat_id"; if ($sql != '') { if (!DB()->sql_query($sql)) { @@ -162,7 +162,7 @@ if (isset($_POST['submit'])) { } $datastore->update('cat_forums'); - bb_die($lang['FORUM_AUTH_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '', "")); + bb_die($lang['FORUM_AUTH_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '', '')); } // End of submit // @@ -170,8 +170,8 @@ if (isset($_POST['submit'])) { // no id was specified or just the requsted forum // or category if it was // -$sql = "SELECT f.* - FROM " . BB_FORUMS . " f, " . BB_CATEGORIES . " c +$sql = 'SELECT f.* + FROM ' . BB_FORUMS . ' f, ' . BB_CATEGORIES . " c WHERE c.cat_id = f.cat_id $forum_sql $cat_sql ORDER BY c.cat_order ASC, f.forum_order ASC"; @@ -199,9 +199,9 @@ if (empty($forum_id) && empty($cat_id)) { } // Obtain the category list - $sql = "SELECT c.cat_id, c.cat_title, c.cat_order - FROM " . BB_CATEGORIES . " c - ORDER BY c.cat_order"; + $sql = 'SELECT c.cat_id, c.cat_title, c.cat_order + FROM ' . BB_CATEGORIES . ' c + ORDER BY c.cat_order'; if (!($result = DB()->sql_query($sql))) { bb_die('Could not query categories list #1'); } @@ -221,7 +221,7 @@ if (empty($forum_id) && empty($cat_id)) { if ($cat_id == $forum_rows[$j]['cat_id']) { $template->assign_block_vars('cat_row.forum_row', array( 'ROW_CLASS' => !($j % 2) ? 'row4' : 'row5', - 'FORUM_NAME' => '' . htmlCHR($forum_rows[$j]['forum_name']) . '', + 'FORUM_NAME' => '' . htmlCHR($forum_rows[$j]['forum_name']) . '', 'IS_SUBFORUM' => $forum_rows[$j]['forum_parent'], )); @@ -258,8 +258,8 @@ if (empty($forum_id) && empty($cat_id)) { } // obtain the category list - $sql = "SELECT c.cat_id, c.cat_title, c.cat_order - FROM " . BB_CATEGORIES . " c + $sql = 'SELECT c.cat_id, c.cat_title, c.cat_order + FROM ' . BB_CATEGORIES . " c WHERE c.cat_id = $cat_id ORDER BY c.cat_order"; if (!($result = DB()->sql_query($sql))) { @@ -280,7 +280,7 @@ if (empty($forum_id) && empty($cat_id)) { if ($cat_id == $forum_rows[$j]['cat_id']) { $template->assign_block_vars('cat_row.forum_row', array( 'ROW_CLASS' => !($j % 2) ? 'row4' : 'row5', - 'FORUM_NAME' => '' . htmlCHR($forum_rows[$j]['forum_name']) . '', + 'FORUM_NAME' => '' . htmlCHR($forum_rows[$j]['forum_name']) . '', 'IS_SUBFORUM' => $forum_rows[$j]['forum_parent'], )); diff --git a/admin/admin_forums.php b/admin/admin_forums.php index 8cbd47b55..33be039e5 100644 --- a/admin/admin_forums.php +++ b/admin/admin_forums.php @@ -49,7 +49,7 @@ $default_forum_auth = [ 'auth_download' => AUTH_REG, ]; -$mode = $_REQUEST['mode'] ? (string)$_REQUEST['mode'] : ''; +$mode = isset($_REQUEST['mode']) ? (string)$_REQUEST['mode'] : ''; $cat_forums = get_cat_forums(); @@ -60,7 +60,7 @@ $forum_parent = $cat_id = 0; $forumname = ''; if (isset($_REQUEST['addforum']) || isset($_REQUEST['addcategory'])) { - $mode = (isset($_REQUEST['addforum'])) ? "addforum" : "addcat"; + $mode = isset($_REQUEST['addforum']) ? 'addforum' : 'addcat'; if ($mode == 'addforum' && isset($_POST['addforum']) && isset($_POST['forumname']) && is_array($_POST['addforum'])) { $req_cat_id = array_keys($_POST['addforum']); @@ -133,7 +133,7 @@ if ($mode) { $catlist = get_list('category', $cat_id, true); $forumlocked = $forumunlocked = ''; - $forumstatus == (FORUM_LOCKED) ? $forumlocked = 'selected="selected"' : $forumunlocked = 'selected="selected"'; + $forumstatus == FORUM_LOCKED ? $forumlocked = 'selected="selected"' : $forumunlocked = 'selected="selected"'; $statuslist = '\n'; $statuslist .= '\n'; @@ -160,7 +160,7 @@ if ($mode) { 'SHOW_ON_INDEX' => $show_on_index, 'S_PARENT_FORUM' => $s_parent, - 'CAT_LIST_CLASS' => ($forum_parent) ? 'hidden' : '', + 'CAT_LIST_CLASS' => $forum_parent ? 'hidden' : '', 'SHOW_ON_INDEX_CLASS' => (!$forum_parent) ? 'hidden' : '', 'TPL_SELECT' => get_select('forum_tpl', $forum_tpl_id, 'html', $lang['TEMPLATE_DISABLE']), 'ALLOW_REG_TRACKER' => build_select('allow_reg_tracker', array($lang['DISALLOWED'] => 0, $lang['ALLOWED'] => 1), $allow_reg_tracker), @@ -187,7 +187,7 @@ if ($mode) { $prune_days = (int)$_POST['prune_days']; $forum_parent = ($_POST['forum_parent'] != -1) ? (int)$_POST['forum_parent'] : 0; - $show_on_index = ($forum_parent) ? (int)$_POST['show_on_index'] : 1; + $show_on_index = $forum_parent ? (int)$_POST['show_on_index'] : 1; $forum_display_sort = (int)$_POST['forum_display_sort']; $forum_display_order = (int)$_POST['forum_display_order']; @@ -207,7 +207,7 @@ if ($mode) { } $cat_id = $parent['cat_id']; - $forum_parent = ($parent['forum_parent']) ?: $parent['forum_id']; + $forum_parent = $parent['forum_parent'] ?: $parent['forum_id']; $forum_order = $parent['forum_order'] + 5; } else { $max_order = get_max_forum_order($cat_id); @@ -228,7 +228,7 @@ if ($mode) { $columns = ' forum_name, cat_id, forum_desc, forum_order, forum_status, prune_days, forum_parent, show_on_index, forum_display_sort, forum_display_order, forum_tpl_id, allow_reg_tracker, allow_porno_topic, self_moderated' . $field_sql; $values = "'$forum_name_sql', $cat_id, '$forum_desc_sql', $forum_order, $forum_status, $prune_days, $forum_parent, $show_on_index, $forum_display_sort, $forum_display_order, $forum_tpl_id, $allow_reg_tracker, $allow_porno_topic, $self_moderated" . $value_sql; - DB()->query("INSERT INTO " . BB_FORUMS . " ($columns) VALUES ($values)"); + DB()->query('INSERT INTO ' . BB_FORUMS . " ($columns) VALUES ($values)"); renumber_order('forum', $cat_id); $datastore->update('cat_forums'); @@ -273,7 +273,7 @@ if ($mode) { } $cat_id = $parent['cat_id']; - $forum_parent = ($parent['forum_parent']) ?: $parent['forum_id']; + $forum_parent = $parent['forum_parent'] ?: $parent['forum_id']; $forum_order = $parent['forum_order'] + 5; if ($forum_id == $forum_parent) { @@ -290,8 +290,8 @@ if ($mode) { $forum_name_sql = DB()->escape($forum_name); $forum_desc_sql = DB()->escape($forum_desc); - DB()->query(" - UPDATE " . BB_FORUMS . " SET + DB()->query(' + UPDATE ' . BB_FORUMS . " SET forum_name = '$forum_name_sql', cat_id = $cat_id, forum_desc = '$forum_desc_sql', @@ -322,7 +322,7 @@ if ($mode) { CACHE('bb_cache')->rm(); $message = $lang['FORUMS_UPDATED'] . '

'; - $message .= ($fix) ? "$fix

" : ''; + $message .= $fix ? "$fix

" : ''; $message .= sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); bb_die($message); @@ -338,14 +338,14 @@ if ($mode) { check_name_dup('cat', $new_cat_title); - $order = DB()->fetch_row("SELECT MAX(cat_order) AS max_order FROM " . BB_CATEGORIES); + $order = DB()->fetch_row('SELECT MAX(cat_order) AS max_order FROM ' . BB_CATEGORIES); $args = DB()->build_array('INSERT', array( 'cat_title' => (string)$new_cat_title, 'cat_order' => (int)$order['max_order'] + 10, )); - DB()->query("INSERT INTO " . BB_CATEGORIES . $args); + DB()->query('INSERT INTO ' . BB_CATEGORIES . $args); $datastore->update('cat_forums'); CACHE('bb_cache')->rm(); @@ -371,7 +371,7 @@ if ($mode) { 'CAT_TITLE' => htmlCHR($cat_info['cat_title']), 'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields), 'S_SUBMIT_VALUE' => $lang['UPDATE'], - 'S_FORUM_ACTION' => "admin_forums.php", + 'S_FORUM_ACTION' => 'admin_forums.php', )); break; @@ -394,8 +394,8 @@ if ($mode) { $new_cat_title_sql = DB()->escape($new_cat_title); - DB()->query(" - UPDATE " . BB_CATEGORIES . " SET + DB()->query(' + UPDATE ' . BB_CATEGORIES . " SET cat_title = '$new_cat_title_sql' WHERE cat_id = $cat_id "); @@ -432,7 +432,7 @@ if ($mode) { 'CAT_FORUM_NAME' => $lang['FORUM_NAME'], 'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields), - 'S_FORUM_ACTION' => "admin_forums.php", + 'S_FORUM_ACTION' => 'admin_forums.php', 'MOVE_TO_OPTIONS' => $move_to_options, 'S_SUBMIT_VALUE' => $lang['MOVE_AND_DELETE'], )); @@ -451,25 +451,25 @@ if ($mode) { topic_delete('prune', $from_id, 0, true); } else { // Move all posts - $sql = "SELECT * FROM " . BB_FORUMS . " WHERE forum_id IN($from_id, $to_id)"; + $sql = 'SELECT * FROM ' . BB_FORUMS . " WHERE forum_id IN($from_id, $to_id)"; $result = DB()->query($sql); if (DB()->num_rows($result) != 2) { bb_die('Ambiguous forum ID'); } - DB()->query("UPDATE " . BB_TOPICS . " SET forum_id = $to_id WHERE forum_id = $from_id"); - DB()->query("UPDATE " . BB_BT_TORRENTS . " SET forum_id = $to_id WHERE forum_id = $from_id"); + DB()->query('UPDATE ' . BB_TOPICS . " SET forum_id = $to_id WHERE forum_id = $from_id"); + DB()->query('UPDATE ' . BB_BT_TORRENTS . " SET forum_id = $to_id WHERE forum_id = $from_id"); - $row = DB()->fetch_row("SELECT MIN(post_id) AS start_id, MAX(post_id) AS finish_id FROM " . BB_POSTS); + $row = DB()->fetch_row('SELECT MIN(post_id) AS start_id, MAX(post_id) AS finish_id FROM ' . BB_POSTS); $start_id = (int)$row['start_id']; $finish_id = (int)$row['finish_id']; $per_cycle = 10000; while (true) { set_time_limit(600); $end_id = $start_id + $per_cycle - 1; - DB()->query(" - UPDATE " . BB_POSTS . " SET forum_id = $to_id WHERE post_id BETWEEN $start_id AND $end_id AND forum_id = $from_id + DB()->query(' + UPDATE ' . BB_POSTS . " SET forum_id = $to_id WHERE post_id BETWEEN $start_id AND $end_id AND forum_id = $from_id "); if ($end_id > $finish_id) { break; @@ -480,9 +480,9 @@ if ($mode) { sync('forum', $to_id); } - DB()->query("DELETE FROM " . BB_FORUMS . " WHERE forum_id = $from_id"); - DB()->query("DELETE FROM " . BB_AUTH_ACCESS . " WHERE forum_id = $from_id"); - DB()->query("DELETE FROM " . BB_AUTH_ACCESS_SNAP . " WHERE forum_id = $from_id"); + DB()->query('DELETE FROM ' . BB_FORUMS . " WHERE forum_id = $from_id"); + DB()->query('DELETE FROM ' . BB_AUTH_ACCESS . " WHERE forum_id = $from_id"); + DB()->query('DELETE FROM ' . BB_AUTH_ACCESS_SNAP . " WHERE forum_id = $from_id"); $cat_forums = get_cat_forums(); fix_orphan_sf(); @@ -501,7 +501,7 @@ if ($mode) { $categories_count = $catinfo['number']; if ($categories_count == 1) { - $row = DB()->fetch_row("SELECT COUNT(*) AS forums_count FROM " . BB_FORUMS); + $row = DB()->fetch_row('SELECT COUNT(*) AS forums_count FROM ' . BB_FORUMS); if ($row['forums_count'] > 0) { bb_die($lang['MUST_DELETE_FORUMS']); @@ -523,7 +523,7 @@ if ($mode) { 'CAT_FORUM_NAME' => $lang['CATEGORY'], 'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields), - 'S_FORUM_ACTION' => "admin_forums.php", + 'S_FORUM_ACTION' => 'admin_forums.php', 'MOVE_TO_OPTIONS' => get_list('category', $cat_id, 0), 'S_SUBMIT_VALUE' => $lang['MOVE_AND_DELETE'], )); @@ -541,14 +541,14 @@ if ($mode) { $order_shear = get_max_forum_order($to_id) + 10; - DB()->query(" - UPDATE " . BB_FORUMS . " SET + DB()->query(' + UPDATE ' . BB_FORUMS . " SET cat_id = $to_id, forum_order = forum_order + $order_shear WHERE cat_id = $from_id "); - DB()->query("DELETE FROM " . BB_CATEGORIES . " WHERE cat_id = $from_id"); + DB()->query('DELETE FROM ' . BB_CATEGORIES . " WHERE cat_id = $from_id"); renumber_order('forum', $to_id); $cat_forums = get_cat_forums(); @@ -557,7 +557,7 @@ if ($mode) { CACHE('bb_cache')->rm(); $message = $lang['FORUMS_UPDATED'] . '

'; - $message .= ($fix) ? "$fix

" : ''; + $message .= $fix ? "$fix

" : ''; $message .= sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); bb_die($message); @@ -576,8 +576,8 @@ if ($mode) { $move_down_forum_id = false; $forums = $cat_forums[$cat_id]['f_ord']; $forum_order = $forum_info['forum_order']; - $prev_forum = (isset($forums[$forum_order - 10])) ? $forums[$forum_order - 10] : false; - $next_forum = (isset($forums[$forum_order + 10])) ? $forums[$forum_order + 10] : false; + $prev_forum = isset($forums[$forum_order - 10]) ? $forums[$forum_order - 10] : false; + $next_forum = isset($forums[$forum_order + 10]) ? $forums[$forum_order + 10] : false; // move selected forum ($forum_id) UP if ($move < 0 && $prev_forum) { @@ -607,20 +607,20 @@ if ($mode) { } if ($forum_info['forum_parent']) { - DB()->query(" - UPDATE " . BB_FORUMS . " SET + DB()->query(' + UPDATE ' . BB_FORUMS . " SET forum_order = forum_order + $move WHERE forum_id = $forum_id "); } elseif ($move_down_forum_id) { - DB()->query(" - UPDATE " . BB_FORUMS . " SET + DB()->query(' + UPDATE ' . BB_FORUMS . " SET forum_order = forum_order + $move_down_ord_val WHERE cat_id = $cat_id AND forum_order >= $move_down_forum_order "); - DB()->query(" - UPDATE " . BB_FORUMS . " SET + DB()->query(' + UPDATE ' . BB_FORUMS . " SET forum_order = forum_order - $move_up_ord_val WHERE forum_id = $move_up_forum_id OR forum_parent = $move_up_forum_id @@ -638,8 +638,8 @@ if ($mode) { $move = (int)$_GET['move']; $cat_id = (int)$_GET['c']; - DB()->query(" - UPDATE " . BB_CATEGORIES . " SET + DB()->query(' + UPDATE ' . BB_CATEGORIES . " SET cat_order = cat_order + $move WHERE cat_id = $cat_id "); @@ -674,7 +674,7 @@ if (!$mode || $show_main_page) { 'L_FORUM_TITLE' => $lang['FORUM_ADMIN_MAIN'], )); - $sql = "SELECT cat_id, cat_title, cat_order FROM " . BB_CATEGORIES . " ORDER BY cat_order"; + $sql = 'SELECT cat_id, cat_title, cat_order FROM ' . BB_CATEGORIES . ' ORDER BY cat_order'; if (!$q_categories = DB()->sql_query($sql)) { bb_die('Could not query categories list'); } @@ -695,7 +695,7 @@ if (!$mode || $show_main_page) { $where_cat_sql = "WHERE cat_id = '-1'"; } - $sql = "SELECT * FROM " . BB_FORUMS . " $where_cat_sql ORDER BY cat_id, forum_order"; + $sql = 'SELECT * FROM ' . BB_FORUMS . " $where_cat_sql ORDER BY cat_id, forum_order"; if (!$q_forums = DB()->sql_query($sql)) { bb_die('Could not query forums information'); } @@ -719,7 +719,7 @@ if (!$mode || $show_main_page) { for ($i = 0; $i < $total_categories; $i++) { $cat_id = $category_rows[$i]['cat_id']; - $template->assign_block_vars("c", array( + $template->assign_block_vars('c', array( 'S_ADD_FORUM_SUBMIT' => "addforum[$cat_id]", 'S_ADD_FORUM_NAME' => "forumname[$cat_id]", @@ -741,12 +741,12 @@ if (!$mode || $show_main_page) { $row_bgr = " class=\"$bgr_class\" onmouseover=\"this.className='$bgr_class_over';\" onmouseout=\"this.className='$bgr_class';\""; if ($forum_rows[$j]['cat_id'] == $cat_id) { - $template->assign_block_vars("c.f", array( + $template->assign_block_vars('c.f', array( 'FORUM_NAME' => htmlCHR($forum_rows[$j]['forum_name']), 'FORUM_DESC' => htmlCHR($forum_rows[$j]['forum_desc']), 'NUM_TOPICS' => $forum_rows[$j]['forum_topics'], 'NUM_POSTS' => $forum_rows[$j]['forum_posts'], - 'PRUNE_DAYS' => ($forum_rows[$j]['prune_days']) ?: '-', + 'PRUNE_DAYS' => $forum_rows[$j]['prune_days'] ?: '-', 'ORDER' => $forum_rows[$j]['forum_order'], 'FORUM_ID' => $forum_rows[$j]['forum_id'], @@ -754,8 +754,8 @@ if (!$mode || $show_main_page) { 'SHOW_ON_INDEX' => (bool)$forum_rows[$j]['show_on_index'], 'FORUM_PARENT' => $forum_rows[$j]['forum_parent'], - 'SF_PAD' => ($forum_rows[$j]['forum_parent']) ? ' style="padding-left: 20px;" ' : '', - 'FORUM_NAME_CLASS' => ($forum_rows[$j]['forum_parent']) ? 'genmed' : 'gen', + 'SF_PAD' => $forum_rows[$j]['forum_parent'] ? ' style="padding-left: 20px;" ' : '', + 'FORUM_NAME_CLASS' => $forum_rows[$j]['forum_parent'] ? 'genmed' : 'gen', 'ADD_SUB_HREF' => "admin_forums.php?mode=addforum&forum_parent={$forum_rows[$j]['forum_id']}", 'U_VIEWFORUM' => BB_ROOT . "viewforum.php?f=$forum_id", 'U_FORUM_EDIT' => "admin_forums.php?mode=editforum&f=$forum_id", @@ -865,7 +865,7 @@ function get_list($mode, $id, $select) $catlist .= '\n'; } - return ($catlist); + return $catlist; } /** @@ -1054,7 +1054,7 @@ function fix_orphan_sf($orphan_sf_sql = '', $show_mess = false) } if ($orphan_sf_sql) { - $sql = "UPDATE " . BB_FORUMS . " SET forum_parent = 0, show_on_index = 1 WHERE forum_id IN($orphan_sf_sql)"; + $sql = 'UPDATE ' . BB_FORUMS . " SET forum_parent = 0, show_on_index = 1 WHERE forum_id IN($orphan_sf_sql)"; if (!DB()->sql_query($sql)) { bb_die('Could not change subforums data'); @@ -1094,8 +1094,8 @@ function sf_get_list($mode, $exclude = 0, $select = 0) foreach ($c['f'] as $fid => $f) { $selected = ($fid == $select) ? HTML_SELECTED : ''; $disabled = ($fid == $exclude && !$forum_parent) ? HTML_DISABLED : ''; - $style = ($disabled) ? ' style="color: gray" ' : (($fid == $exclude) ? ' style="color: darkred" ' : ''); - $opt .= '\n"; + $style = $disabled ? ' style="color: gray" ' : (($fid == $exclude) ? ' style="color: darkred" ' : ''); + $opt .= '\n"; } $opt .= ''; @@ -1130,9 +1130,9 @@ function get_forum_data($forum_id) */ function get_max_forum_order($cat_id) { - $row = DB()->fetch_row(" + $row = DB()->fetch_row(' SELECT MAX(forum_order) AS max_forum_order - FROM " . BB_FORUMS . " + FROM ' . BB_FORUMS . " WHERE cat_id = $cat_id "); @@ -1151,10 +1151,10 @@ function check_name_dup($mode, $name, $die_on_error = true) if ($mode == 'cat') { $what_checked = 'category'; - $sql = "SELECT cat_id FROM " . BB_CATEGORIES . " WHERE cat_title = '$name_sql'"; + $sql = 'SELECT cat_id FROM ' . BB_CATEGORIES . " WHERE cat_title = '$name_sql'"; } else { $what_checked = 'forum'; - $sql = "SELECT forum_id FROM " . BB_FORUMS . " WHERE forum_name = '$name_sql'"; + $sql = 'SELECT forum_id FROM ' . BB_FORUMS . " WHERE forum_name = '$name_sql'"; } $name_is_dup = DB()->fetch_row($sql); @@ -1175,8 +1175,8 @@ function check_name_dup($mode, $name, $die_on_error = true) */ function change_sf_cat($parent_id, $new_cat_id, $order_shear) { - DB()->query(" - UPDATE " . BB_FORUMS . " SET + DB()->query(' + UPDATE ' . BB_FORUMS . " SET cat_id = $new_cat_id, forum_order = forum_order + $order_shear WHERE forum_parent = $parent_id diff --git a/admin/admin_groups.php b/admin/admin_groups.php index b6610dbf1..bb64b056b 100644 --- a/admin/admin_groups.php +++ b/admin/admin_groups.php @@ -49,7 +49,7 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) { 'release_group' => $row['release_group'], ); $mode = 'editgroup'; - $template->assign_block_vars('group_edit', array()); + $template->assign_block_vars('group_edit', []); } elseif (!empty($_POST['new'])) { $group_info = array( 'group_name' => '', @@ -75,15 +75,15 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) { 'GROUP_DESCRIPTION' => stripslashes(htmlspecialchars($group_info['group_description'])), 'GROUP_MODERATOR' => replace_quote($group_info['group_mod_name']), 'T_GROUP_EDIT_DELETE' => ($mode == 'newgroup') ? $lang['CREATE_NEW_GROUP'] : $lang['EDIT_GROUP'], - 'U_SEARCH_USER' => BB_ROOT . "search.php?mode=searchuser", + 'U_SEARCH_USER' => BB_ROOT . 'search.php?mode=searchuser', 'S_GROUP_OPEN_TYPE' => GROUP_OPEN, 'S_GROUP_CLOSED_TYPE' => GROUP_CLOSED, 'S_GROUP_HIDDEN_TYPE' => GROUP_HIDDEN, 'S_GROUP_OPEN_CHECKED' => ($group_info['group_type'] == GROUP_OPEN) ? HTML_CHECKED : '', 'S_GROUP_CLOSED_CHECKED' => ($group_info['group_type'] == GROUP_CLOSED) ? HTML_CHECKED : '', 'S_GROUP_HIDDEN_CHECKED' => ($group_info['group_type'] == GROUP_HIDDEN) ? HTML_CHECKED : '', - 'RELEASE_GROUP' => ($group_info['release_group']) ? true : false, - 'S_GROUP_ACTION' => "admin_groups.php", + 'RELEASE_GROUP' => $group_info['release_group'] ? true : false, + 'S_GROUP_ACTION' => 'admin_groups.php', 'S_HIDDEN_FIELDS' => $s_hidden_fields, )); } elseif (!empty($_POST['group_update'])) { @@ -126,7 +126,7 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) { 'group_single_user' => 0, ); - if ($mode == "editgroup") { + if ($mode == 'editgroup') { if (!$group_info = get_group_data($group_id)) { bb_die($lang['GROUP_NOT_EXIST']); } @@ -145,7 +145,7 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) { $sql_args = DB()->build_array('UPDATE', $sql_ary); // Update group's data - DB()->query("UPDATE " . BB_GROUPS . " SET $sql_args WHERE group_id = $group_id"); + DB()->query('UPDATE ' . BB_GROUPS . " SET $sql_args WHERE group_id = $group_id"); $message = $lang['UPDATED_GROUP'] . '

'; $message .= sprintf($lang['CLICK_RETURN_GROUPSADMIN'], '', '') . '

'; @@ -157,7 +157,7 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) { $sql_args = DB()->build_array('INSERT', $sql_ary); // Create new group - DB()->query("INSERT INTO " . BB_GROUPS . " $sql_args"); + DB()->query('INSERT INTO ' . BB_GROUPS . " $sql_args"); $new_group_id = DB()->sql_nextid(); // Create user_group for group's moderator @@ -176,7 +176,7 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) { $template->assign_vars(array( 'TPL_GROUP_SELECT' => true, - 'S_GROUP_ACTION' => "admin_groups.php", + 'S_GROUP_ACTION' => 'admin_groups.php', 'S_GROUP_SELECT' => stripslashes(get_select('groups')), )); } diff --git a/admin/admin_log.php b/admin/admin_log.php index 124d95d8a..9a8dd4d9e 100644 --- a/admin/admin_log.php +++ b/admin/admin_log.php @@ -147,12 +147,9 @@ $topic_csv = ''; if ($var =& $_REQUEST[$topic_key]) { $topic_selected = get_id_ary($var); $topic_csv = implode(',', $topic_selected); - $url = ($topic_csv) ? url_arg($url, $topic_key, $topic_csv) : $url; + $url = $topic_csv ? url_arg($url, $topic_key, $topic_csv) : $url; } -// Order -$order_val = 'log_time'; - // Sort $sort_val = $def_sort; @@ -181,7 +178,7 @@ $time_end_val = 86400 + mktime(0, 0, 0, date('m', $datetime_val), date('d', $dat $time_start_val = $time_end_val - 86400 * $daysback_val; // First log time -$row = DB()->fetch_row("SELECT MIN(log_time) AS first_log_time FROM " . BB_LOG); +$row = DB()->fetch_row('SELECT MIN(log_time) AS first_log_time FROM ' . BB_LOG); $first_log_time = (int)$row['first_log_time']; // Title match @@ -194,46 +191,21 @@ if ($var =& $_REQUEST[$title_match_key]) { } } -// // SQL -// -$select = "SELECT *"; +$where = " WHERE l.log_time BETWEEN '$time_start_val' AND '$time_end_val'"; +$where .= $type_csv ? " AND l.log_type_id IN($type_csv)" : ''; +$where .= $user_csv ? " AND l.log_user_id IN($user_csv)" : ''; +$where .= $forum_csv ? " AND l.log_forum_id IN($forum_csv)" : ''; +$where .= $topic_csv ? " AND l.log_topic_id IN($topic_csv)" : ''; +$where .= $title_match_sql ? " AND MATCH (l.log_topic_title) AGAINST ('$title_match_sql' IN BOOLEAN MODE)" : ''; -$from = "FROM " . BB_LOG; - -$where = " - WHERE log_time BETWEEN $time_start_val AND $time_end_val -"; -$where .= ($type_csv) ? " - AND log_type_id IN($type_csv) -" : ''; -$where .= ($user_csv) ? " - AND log_user_id IN($user_csv) -" : ''; -$where .= ($forum_csv) ? " - AND log_forum_id IN($forum_csv) -" : ''; -$where .= ($topic_csv) ? " - AND log_topic_id IN($topic_csv) -" : ''; -$where .= ($title_match_sql) ? " - AND MATCH (log_topic_title) AGAINST ('$title_match_sql' IN BOOLEAN MODE) -" : ''; - -$order = "ORDER BY $order_val"; - -$sort = $sort_val; - -$limit = "LIMIT $start, " . ($per_page + 1); - -$sql = " - $select - $from +$sql = 'SELECT l.*, u.* + FROM ' . BB_LOG . ' l + LEFT JOIN ' . BB_USERS . " u ON(u.user_id = l.log_user_id) $where - $order - $sort - $limit -"; + ORDER BY l.log_time + $sort_val + LIMIT $start, " . ($per_page + 1); $log_rowset = DB()->fetch_rowset($sql); $log_count = count($log_rowset); @@ -289,7 +261,7 @@ if ($log_rowset) { break; } - $msg .= " $row[log_msg]"; + $msg .= " {$row['log_msg']}"; $row_class = !($row_num & 1) ? $row_class_1 : $row_class_2; @@ -301,7 +273,7 @@ if ($log_rowset) { 'ACTION_HREF_S' => url_arg($url, $type_key, $row['log_type_id']), 'USER_ID' => $row['log_user_id'], - 'USERNAME' => $row['log_username'], + 'USERNAME' => profile_url($row), 'USER_HREF_S' => url_arg($url, $user_key, $row['log_user_id']), 'USER_IP' => Longman\IPTools\Ip::isValid($row['log_user_ip']) ? decode_ip($row['log_user_ip']) : '127.0.0.1', @@ -348,16 +320,16 @@ if ($log_rowset) { $filter['forums'][$forum_name] = true; } // Users - if ($user_csv && empty($filter['users'][$row['log_username']])) { + if ($user_csv && empty($filter['users'])) { $template->assign_block_vars('users', array( - 'USERNAME' => $row['log_username'], + 'USERNAME' => profile_url($row), )); - $filter['users'][$row['log_username']] = true; + $filter['users'] = true; } } $template->assign_vars(array( - 'FILTERS' => ($topic_csv || $forum_csv || $user_csv), + 'FILTERS' => $topic_csv || $forum_csv || $user_csv, 'FILTER_TOPICS' => !empty($filter['topics']), 'FILTER_FORUMS' => !empty($filter['forums']), 'FILTER_USERS' => !empty($filter['users']), @@ -366,14 +338,9 @@ if ($log_rowset) { $template->assign_block_vars('log_not_found', array()); } -// -// Selects -// +// Select $log_type_select = array($lang['ACTS_LOG_ALL_ACTIONS'] => $all_types) + $log_action->log_type_select; -// Order select -$order_options = ''; - $template->assign_vars(array( 'LOG_COLSPAN' => 4, @@ -381,15 +348,12 @@ $template->assign_vars(array( 'DATETIME_VAL' => date('Y-m-d', $datetime_val), 'DAYSBACK_NAME' => $daysback_key, 'DAYSBACK_VAL' => $daysback_val, - 'FIRST_LOG_TIME' => ($first_log_time) ? date('Y-m-d', $first_log_time) : $lang['ACC_NONE'], + 'FIRST_LOG_TIME' => $first_log_time ? date('Y-m-d', $first_log_time) : $lang['ACC_NONE'], 'TITLE_MATCH_MAX' => $title_match_max_len, 'TITLE_MATCH_NAME' => $title_match_key, 'TITLE_MATCH_VAL' => $title_match_val, - 'ORDER_NAME' => '', - 'ORDER_OPTIONS' => $order_options, - 'SORT_NAME' => $sort_key, 'SORT_ASC' => $sort_asc, 'SORT_DESC' => $sort_desc, @@ -400,7 +364,7 @@ $template->assign_vars(array( 'SEL_LOG_TYPE' => build_select("{$type_key}[]", $log_type_select, $type_selected, 60, $select_max_height), 'SEL_USERS' => build_select("{$user_key}[]", $users, $user_selected, 16, $select_max_height), - 'S_LOG_ACTION' => "admin_log.php", + 'S_LOG_ACTION' => 'admin_log.php', 'TOPIC_CSV' => $topic_csv, )); diff --git a/admin/admin_mass_email.php b/admin/admin_mass_email.php index 61204b5e4..27372b249 100644 --- a/admin/admin_mass_email.php +++ b/admin/admin_mass_email.php @@ -30,13 +30,13 @@ if (!empty($setmodules)) { require __DIR__ . '/pagestart.php'; -@set_time_limit(1200); +set_time_limit(1200); $subject = (string)trim(request_var('subject', '')); $message = (string)request_var('message', ''); $group_id = (int)request_var(POST_GROUPS_URL, 0); -$errors = $user_id_sql = array(); +$errors = $user_id_sql = []; if (isset($_POST['submit'])) { if (!$subject) { @@ -50,7 +50,7 @@ if (isset($_POST['submit'])) { } if (!$errors) { - $sql = DB()->fetch_rowset("SELECT ban_userid FROM " . BB_BANLIST . " WHERE ban_userid != 0"); + $sql = DB()->fetch_rowset('SELECT ban_userid FROM ' . BB_BANLIST . ' WHERE ban_userid != 0'); foreach ($sql as $row) { $user_id_sql[] = ',' . $row['ban_userid']; @@ -58,22 +58,22 @@ if (isset($_POST['submit'])) { $user_id_sql = implode('', $user_id_sql); if ($group_id != -1) { - $user_list = DB()->fetch_rowset(" + $user_list = DB()->fetch_rowset(' SELECT u.username, u.user_email, u.user_lang - FROM " . BB_USERS . " u, " . BB_USER_GROUP . " ug + FROM ' . BB_USERS . ' u, ' . BB_USER_GROUP . " ug WHERE ug.group_id = $group_id AND ug.user_pending = 0 AND u.user_id = ug.user_id AND u.user_active = 1 - AND u.user_id NOT IN(" . EXCLUDED_USERS . $user_id_sql . ") - "); + AND u.user_id NOT IN(" . EXCLUDED_USERS . $user_id_sql . ') + '); } else { - $user_list = DB()->fetch_rowset(" + $user_list = DB()->fetch_rowset(' SELECT username, user_email, user_lang - FROM " . BB_USERS . " + FROM ' . BB_USERS . ' WHERE user_active = 1 - AND user_id NOT IN(" . EXCLUDED_USERS . $user_id_sql . ") - "); + AND user_id NOT IN(' . EXCLUDED_USERS . $user_id_sql . ') + '); } foreach ($user_list as $i => $row) { @@ -98,11 +98,11 @@ if (isset($_POST['submit'])) { // // Generate page // -$sql = "SELECT group_id, group_name - FROM " . BB_GROUPS . " +$sql = 'SELECT group_id, group_name + FROM ' . BB_GROUPS . ' WHERE group_single_user = 0 ORDER BY group_name -"; +'; $groups = array('-- ' . $lang['ALL_USERS'] . ' --' => -1); foreach (DB()->fetch_rowset($sql) as $row) { @@ -113,7 +113,7 @@ $template->assign_vars(array( 'MESSAGE' => $message, 'SUBJECT' => $subject, - 'ERROR_MESSAGE' => ($errors) ? implode('
', array_unique($errors)) : '', + 'ERROR_MESSAGE' => $errors ? implode('
', array_unique($errors)) : '', 'S_USER_ACTION' => 'admin_mass_email.php', 'S_GROUP_SELECT' => build_select(POST_GROUPS_URL, $groups), diff --git a/admin/admin_ranks.php b/admin/admin_ranks.php index 7b7b28e19..c54ee142a 100644 --- a/admin/admin_ranks.php +++ b/admin/admin_ranks.php @@ -53,7 +53,7 @@ if ($mode != '') { // // They want to add a new rank, show the form. // - $rank_id = (isset($_GET['id'])) ? (int)$_GET['id'] : 0; + $rank_id = isset($_GET['id']) ? (int)$_GET['id'] : 0; $s_hidden_fields = ''; @@ -62,7 +62,7 @@ if ($mode != '') { bb_die($lang['MUST_SELECT_RANK']); } - $sql = "SELECT * FROM " . BB_RANKS . " WHERE rank_id = $rank_id"; + $sql = 'SELECT * FROM ' . BB_RANKS . " WHERE rank_id = $rank_id"; if (!$result = DB()->sql_query($sql)) { bb_die('Could not obtain ranks data #1'); } @@ -84,12 +84,12 @@ if ($mode != '') { 'RANK' => !empty($rank_info['rank_title']) ? $rank_info['rank_title'] : '', 'SPECIAL_RANK' => $rank_is_special, 'NOT_SPECIAL_RANK' => $rank_is_not_special, - 'MINIMUM' => ($rank_is_special) ? '' : @$rank_info['rank_min'], + 'MINIMUM' => $rank_is_special ? '' : $rank_info['rank_min'], 'IMAGE' => !empty($rank_info['rank_image']) ? $rank_info['rank_image'] : 'styles/images/ranks/rank_image.png', 'STYLE' => !empty($rank_info['rank_style']) ? $rank_info['rank_style'] : '', 'IMAGE_DISPLAY' => !empty($rank_info['rank_image']) ? '' : '', - 'S_RANK_ACTION' => "admin_ranks.php", + 'S_RANK_ACTION' => 'admin_ranks.php', 'S_HIDDEN_FIELDS' => $s_hidden_fields, )); } elseif ($mode == 'save') { @@ -97,12 +97,12 @@ if ($mode != '') { // Ok, they sent us our info, let's update it. // - $rank_id = (isset($_POST['id'])) ? (int)$_POST['id'] : 0; - $rank_title = (isset($_POST['title'])) ? trim($_POST['title']) : ''; - $rank_style = (isset($_POST['style'])) ? trim($_POST['style']) : ''; + $rank_id = isset($_POST['id']) ? (int)$_POST['id'] : 0; + $rank_title = isset($_POST['title']) ? trim($_POST['title']) : ''; + $rank_style = isset($_POST['style']) ? trim($_POST['style']) : ''; $special_rank = ($_POST['special_rank'] == 1) ? true : 0; - $min_posts = (isset($_POST['min_posts'])) ? (int)$_POST['min_posts'] : -1; - $rank_image = ((isset($_POST['rank_image']))) ? trim($_POST['rank_image']) : ''; + $min_posts = isset($_POST['min_posts']) ? (int)$_POST['min_posts'] : -1; + $rank_image = isset($_POST['rank_image']) ? trim($_POST['rank_image']) : ''; if ($rank_title == '') { bb_die($lang['MUST_SELECT_RANK']); @@ -124,12 +124,12 @@ if ($mode != '') { if ($rank_id) { if (!$special_rank) { - $sql = "UPDATE " . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id"; + $sql = 'UPDATE ' . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id"; if (!$result = DB()->sql_query($sql)) { bb_die($lang['NO_UPDATE_RANKS']); } } - $sql = "UPDATE " . BB_RANKS . " + $sql = 'UPDATE ' . BB_RANKS . " SET rank_title = '" . DB()->escape($rank_title) . "', rank_special = $special_rank, rank_min = $min_posts, @@ -139,7 +139,7 @@ if ($mode != '') { $message = $lang['RANK_UPDATED']; } else { - $sql = "INSERT INTO " . BB_RANKS . " (rank_title, rank_special, rank_min, rank_image, rank_style) + $sql = 'INSERT INTO ' . BB_RANKS . " (rank_title, rank_special, rank_min, rank_image, rank_style) VALUES ('" . DB()->escape($rank_title) . "', $special_rank, $min_posts, '" . DB()->escape($rank_image) . "', '" . DB()->escape($rank_style) . "')"; $message = $lang['RANK_ADDED']; @@ -160,19 +160,19 @@ if ($mode != '') { // if (isset($_POST['id']) || isset($_GET['id'])) { - $rank_id = (isset($_POST['id'])) ? (int)$_POST['id'] : (int)$_GET['id']; + $rank_id = isset($_POST['id']) ? (int)$_POST['id'] : (int)$_GET['id']; } else { $rank_id = 0; } if ($rank_id) { - $sql = "DELETE FROM " . BB_RANKS . " WHERE rank_id = $rank_id"; + $sql = 'DELETE FROM ' . BB_RANKS . " WHERE rank_id = $rank_id"; if (!$result = DB()->sql_query($sql)) { bb_die('Could not delete rank data'); } - $sql = "UPDATE " . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id"; + $sql = 'UPDATE ' . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id"; if (!$result = DB()->sql_query($sql)) { bb_die($lang['NO_UPDATE_RANKS']); } @@ -190,7 +190,7 @@ if ($mode != '') { // // Show the default page // - $sql = "SELECT * FROM " . BB_RANKS . " ORDER BY rank_min, rank_title"; + $sql = 'SELECT * FROM ' . BB_RANKS . ' ORDER BY rank_min, rank_title'; if (!$result = DB()->sql_query($sql)) { bb_die('Could not obtain ranks data #2'); } @@ -199,7 +199,7 @@ if ($mode != '') { $template->assign_vars(array( 'TPL_RANKS_LIST' => true, - 'S_RANKS_ACTION' => "admin_ranks.php", + 'S_RANKS_ACTION' => 'admin_ranks.php', )); for ($i = 0; $i < $rank_count; $i++) { @@ -214,13 +214,13 @@ if ($mode != '') { $row_class = !($i % 2) ? 'row1' : 'row2'; - $rank_is_special = ($special_rank) ? $lang['YES'] : $lang['NO']; + $rank_is_special = $special_rank ? $lang['YES'] : $lang['NO']; $template->assign_block_vars('ranks', array( 'ROW_CLASS' => $row_class, 'RANK' => $rank, 'STYLE' => $rank_rows[$i]['rank_style'], - 'IMAGE_DISPLAY' => ($rank_rows[$i]['rank_image']) ? '' : '', + 'IMAGE_DISPLAY' => $rank_rows[$i]['rank_image'] ? '' : '', 'SPECIAL_RANK' => $rank_is_special, 'RANK_MIN' => $rank_min, diff --git a/admin/admin_rebuild_search.php b/admin/admin_rebuild_search.php index 89081bcb3..e246d5abd 100644 --- a/admin/admin_rebuild_search.php +++ b/admin/admin_rebuild_search.php @@ -46,22 +46,22 @@ define('REBUILD_SEARCH_COMPLETED', 2); // when all the db posts have been proce // $def_post_limit = 50; $def_refresh_rate = 3; -$def_time_limit = ($sys_time_limit = @ini_get('max_execution_time')) ? $sys_time_limit : 30; +$def_time_limit = ($sys_time_limit = ini_get('max_execution_time')) ? $sys_time_limit : 30; $last_session_data = get_rebuild_session_details('last', 'all'); $last_session_id = (int)$last_session_data['rebuild_session_id']; $max_post_id = get_latest_post_id(); $start_time = TIMENOW; -$mode = (string)@$_REQUEST['mode']; +$mode = isset($_REQUEST['mode']) ? (string)$_REQUEST['mode'] : ''; // check if the user has choosen to stop processing if (isset($_REQUEST['cancel_button'])) { // update the rebuild_status if ($last_session_id) { - DB()->query(" - UPDATE " . BB_SEARCH_REBUILD . " SET - rebuild_session_status = " . REBUILD_SEARCH_ABORTED . " + DB()->query(' + UPDATE ' . BB_SEARCH_REBUILD . ' SET + rebuild_session_status = ' . REBUILD_SEARCH_ABORTED . " WHERE rebuild_session_id = $last_session_id "); } @@ -70,7 +70,7 @@ if (isset($_REQUEST['cancel_button'])) { } // from which post to start processing -$start = abs((int)(@$_REQUEST['start'])); +$start = isset($_REQUEST['start']) ? abs((int)$_REQUEST['start']) : 0; // get the total number of posts in the db $total_posts = get_total_posts(); @@ -86,7 +86,8 @@ $session_posts_processed = ($mode == 'refresh') ? get_processed_posts('session') $total_posts_processing = $total_posts - $total_posts_processed; // how many posts to process in this session -if ($session_posts_processing = @(int)$_REQUEST['session_posts_processing']) { +$session_posts_processing = isset($_REQUEST['session_posts_processing']) ? (int)$_REQUEST['session_posts_processing'] : null; +if (null !== $session_posts_processing) { if ($mode == 'submit') { // check if we passed over total_posts just after submitting if ($session_posts_processing + $total_posts_processed > $total_posts) { @@ -116,9 +117,9 @@ if (isset($_REQUEST['time_limit'])) { $time_limit_explain = $lang['TIME_LIMIT_EXPLAIN']; // check for webserver timeout (IE returns null) - if (isset($_SERVER["HTTP_KEEP_ALIVE"])) { + if (isset($_SERVER['HTTP_KEEP_ALIVE'])) { // get webserver timeout - $webserver_timeout = (int)$_SERVER["HTTP_KEEP_ALIVE"]; + $webserver_timeout = (int)$_SERVER['HTTP_KEEP_ALIVE']; $time_limit_explain .= '
' . sprintf($lang['TIME_LIMIT_EXPLAIN_WEBSERVER'], $webserver_timeout); if ($time_limit > $webserver_timeout) { @@ -138,7 +139,7 @@ if ($mode == 'submit') { } // Increase maximum execution time in case of a lot of posts, but don't complain about it if it isn't allowed. -@set_time_limit($time_limit + 20); +set_time_limit($time_limit + 20); // check if we are should start processing if ($mode == 'submit' || $mode == 'refresh') { @@ -157,12 +158,12 @@ if ($mode == 'submit' || $mode == 'refresh') { pt.post_id, pt.post_text, IF(p.post_id = t.topic_first_post_id, t.topic_title, '') AS post_subject FROM - " . BB_POSTS_TEXT . " pt, - " . BB_POSTS . " p, - " . BB_TOPICS . " t + " . BB_POSTS_TEXT . ' pt, + ' . BB_POSTS . ' p, + ' . BB_TOPICS . ' t WHERE p.post_id = pt.post_id AND t.topic_id = p.topic_id - AND p.poster_id NOT IN(" . BOT_UID . ") + AND p.poster_id NOT IN(' . BOT_UID . ") AND pt.post_id >= $start ORDER BY pt.post_id ASC LIMIT $post_limit @@ -174,7 +175,7 @@ if ($mode == 'submit' || $mode == 'refresh') { $words_sql = array(); while ($row = DB()->fetch_next($result) and !$timer_expired) { - @set_time_limit(600); + set_time_limit(600); $start_post_id = ($num_rows == 0) ? $row['post_id'] : $start_post_id; $end_post_id = $row['post_id']; @@ -192,7 +193,7 @@ if ($mode == 'submit' || $mode == 'refresh') { // Store search words if ($words_sql) { - DB()->query("REPLACE INTO " . BB_POSTS_SEARCH . DB()->build_array('MULTI_INSERT', $words_sql)); + DB()->query('REPLACE INTO ' . BB_POSTS_SEARCH . DB()->build_array('MULTI_INSERT', $words_sql)); } // find how much time the last cycle took @@ -214,13 +215,13 @@ if ($mode == 'submit' || $mode == 'refresh') { 'search_size' => (int)$search_tables_size, 'rebuild_session_status' => REBUILD_SEARCH_PROCESSED, )); - DB()->query("REPLACE INTO " . BB_SEARCH_REBUILD . $args); + DB()->query('REPLACE INTO ' . BB_SEARCH_REBUILD . $args); } else { // refresh // update the last session entry - DB()->query(" - UPDATE " . BB_SEARCH_REBUILD . " SET + DB()->query(' + UPDATE ' . BB_SEARCH_REBUILD . " SET end_post_id = $end_post_id, end_time = " . TIMENOW . ", last_cycle_time = $last_cycle_time, @@ -237,7 +238,7 @@ if ($mode == 'submit' || $mode == 'refresh') { $template->assign_vars(array('TPL_REBUILD_SEARCH_PROGRESS' => true)); $processing_messages = ''; - $processing_messages .= ($timer_expired) ? sprintf($lang['TIMER_EXPIRED'], TIMENOW - $start_time) : ''; + $processing_messages .= $timer_expired ? sprintf($lang['TIMER_EXPIRED'], TIMENOW - $start_time) : ''; $processing_messages .= ($start == 0 && $clear_search) ? $lang['CLEARED_SEARCH_TABLES'] : ''; // check if we have reached the end of our post processing @@ -267,7 +268,7 @@ if ($mode == 'submit' || $mode == 'refresh') { } else { // end of processing - $form_action = "admin_rebuild_search.php"; + $form_action = 'admin_rebuild_search.php'; $next_button = $lang['FINISHED']; $progress_bar_img = $images['progress_bar_full']; @@ -275,8 +276,8 @@ if ($mode == 'submit' || $mode == 'refresh') { $processing_messages .= ($total_posts_processed == $total_posts) ? $lang['ALL_POSTS_PROCESSED'] : $lang['ALL_SESSION_POSTS_PROCESSED']; // if we have processed all the db posts we need to update the rebuild_status - DB()->query("UPDATE " . BB_SEARCH_REBUILD . " SET - rebuild_session_status = " . REBUILD_SEARCH_COMPLETED . " + DB()->query('UPDATE ' . BB_SEARCH_REBUILD . ' SET + rebuild_session_status = ' . REBUILD_SEARCH_COMPLETED . " WHERE rebuild_session_id = $last_session_id AND end_post_id = $max_post_id "); @@ -369,7 +370,7 @@ if ($mode == 'submit' || $mode == 'refresh') { $last_saved_processing = sprintf($lang['INFO_PROCESSING_STOPPED'], $last_saved_post_id, $total_posts_processed, $last_saved_date); $clear_search_disabled = 'disabled="disabled"'; - $template->assign_block_vars("start_select_input", array()); + $template->assign_block_vars('start_select_input', array()); } elseif ($last_session_data['rebuild_session_status'] == REBUILD_SEARCH_ABORTED) { $last_saved_processing = sprintf($lang['INFO_PROCESSING_ABORTED'], $last_saved_post_id, $total_posts_processed, $last_saved_date); // check if the interrupted cycle has finished @@ -378,25 +379,25 @@ if ($mode == 'submit' || $mode == 'refresh') { } $clear_search_disabled = 'disabled="disabled"'; - $template->assign_block_vars("start_select_input", array()); + $template->assign_block_vars('start_select_input', array()); } else { // when finished if ($last_session_data['end_post_id'] < $max_post_id) { - $last_saved_processing = sprintf($lang['INFO_PROCESSING_FINISHED_NEW'], $last_saved_post_id, $total_posts_processed, $last_saved_date, ($total_posts - $total_posts_processed)); + $last_saved_processing = sprintf($lang['INFO_PROCESSING_FINISHED_NEW'], $last_saved_post_id, $total_posts_processed, $last_saved_date, $total_posts - $total_posts_processed); $clear_search_disabled = 'disabled="disabled"'; - $template->assign_block_vars("start_select_input", array()); + $template->assign_block_vars('start_select_input', array()); } else { $last_saved_processing = sprintf($lang['INFO_PROCESSING_FINISHED'], $total_posts, $last_saved_date); - $template->assign_block_vars("start_text_input", array()); + $template->assign_block_vars('start_text_input', array()); } } - $template->assign_block_vars("last_saved_info", array()); + $template->assign_block_vars('last_saved_info', array()); } else { - $template->assign_block_vars("start_text_input", array()); + $template->assign_block_vars('start_text_input', array()); } // create the output of page @@ -417,7 +418,7 @@ if ($mode == 'submit' || $mode == 'refresh') { 'SESSION_ID' => $userdata['session_id'], 'S_HIDDEN_FIELDS' => $s_hidden_fields, - 'S_REBUILD_SEARCH_ACTION' => "admin_rebuild_search.php?mode=submit", + 'S_REBUILD_SEARCH_ACTION' => 'admin_rebuild_search.php?mode=submit', )); } @@ -431,7 +432,7 @@ function get_db_sizes() $search_data_size = $search_index_size = 0; $search_table_like = DB()->escape(BB_POSTS_SEARCH); - $sql = "SHOW TABLE STATUS FROM `" . DB()->selected_db . "` LIKE '$search_table_like'"; + $sql = 'SHOW TABLE STATUS FROM `' . DB()->selected_db . "` LIKE '$search_table_like'"; foreach (DB()->fetch_rowset($sql) as $row) { $search_data_size += $row['Data_length']; @@ -444,7 +445,7 @@ function get_db_sizes() // get the latest post_id in the forum function get_latest_post_id() { - $row = DB()->fetch_row("SELECT MAX(post_id) as post_id FROM " . BB_POSTS_TEXT); + $row = DB()->fetch_row('SELECT MAX(post_id) as post_id FROM ' . BB_POSTS_TEXT); return (int)$row['post_id']; } @@ -474,9 +475,9 @@ function get_rebuild_session_details($id, $details = 'all') $session_details = get_empty_last_session_data(); if ($id != 'last') { - $sql = "SELECT * FROM " . BB_SEARCH_REBUILD . " WHERE rebuild_session_id = $id"; + $sql = 'SELECT * FROM ' . BB_SEARCH_REBUILD . " WHERE rebuild_session_id = $id"; } else { - $sql = "SELECT * FROM " . BB_SEARCH_REBUILD . " ORDER BY rebuild_session_id DESC LIMIT 1"; + $sql = 'SELECT * FROM ' . BB_SEARCH_REBUILD . ' ORDER BY rebuild_session_id DESC LIMIT 1'; } if ($row = DB()->fetch_row($sql)) { @@ -494,7 +495,7 @@ function get_processed_posts($mode = 'session') global $last_session_data; if ($mode == 'total') { - $sql = "SELECT SUM(session_posts) as posts FROM " . BB_SEARCH_REBUILD; + $sql = 'SELECT SUM(session_posts) as posts FROM ' . BB_SEARCH_REBUILD; $row = DB()->fetch_row($sql); } else { $row['posts'] = $last_session_data['session_posts']; @@ -508,10 +509,10 @@ function get_processed_posts($mode = 'session') function get_total_posts($mode = 'after', $post_id = 0) { if ($post_id) { - $sql = "SELECT COUNT(post_id) as total_posts FROM " . BB_POSTS_TEXT . " - WHERE post_id " . (($mode == 'after') ? '>= ' : '<= ') . (int)$post_id; + $sql = 'SELECT COUNT(post_id) as total_posts FROM ' . BB_POSTS_TEXT . ' + WHERE post_id ' . (($mode == 'after') ? '>= ' : '<= ') . (int)$post_id; } else { - $sql = "SELECT COUNT(*) as total_posts FROM " . BB_POSTS_TEXT; + $sql = 'SELECT COUNT(*) as total_posts FROM ' . BB_POSTS_TEXT; } $row = DB()->fetch_row($sql); @@ -521,13 +522,13 @@ function get_total_posts($mode = 'after', $post_id = 0) function clear_search_tables($mode = '') { - DB()->query("DELETE FROM " . BB_SEARCH_REBUILD); + DB()->query('DELETE FROM ' . BB_SEARCH_REBUILD); if ($mode) { $table_ary = array(BB_POSTS_SEARCH); foreach ($table_ary as $table) { - $sql = (($mode == 1) ? "DELETE FROM " : "TRUNCATE TABLE ") . $table; + $sql = (($mode == 1) ? 'DELETE FROM ' : 'TRUNCATE TABLE ') . $table; DB()->query($sql); } } @@ -559,7 +560,7 @@ function create_percent_color($percent) // create the hex representation of color function create_color($mode, $code) { - return (($mode == 'r') ? 'FF' : sprintf("%02X", $code)) . (($mode == 'g') ? 'FF' : sprintf("%02X", $code)) . (($mode == 'b') ? 'FF' : sprintf("%02X", $code)); + return (($mode == 'r') ? 'FF' : sprintf('%02X', $code)) . (($mode == 'g') ? 'FF' : sprintf('%02X', $code)) . (($mode == 'b') ? 'FF' : sprintf('%02X', $code)); } // create the percent bar & box diff --git a/admin/admin_sitemap.php b/admin/admin_sitemap.php index 3ef9de3a2..c9ac2737b 100644 --- a/admin/admin_sitemap.php +++ b/admin/admin_sitemap.php @@ -30,7 +30,7 @@ if (!empty($setmodules)) { require __DIR__ . '/pagestart.php'; require INC_DIR . '/functions_selects.php'; -$sql = "SELECT * FROM " . BB_CONFIG; +$sql = 'SELECT * FROM ' . BB_CONFIG; if (!$result = DB()->sql_query($sql)) { bb_die('Could not query config information in admin_sitemap'); diff --git a/admin/admin_smilies.php b/admin/admin_smilies.php index e7012c056..132b23ca9 100644 --- a/admin/admin_smilies.php +++ b/admin/admin_smilies.php @@ -32,21 +32,22 @@ require __DIR__ . '/pagestart.php'; // Check to see what mode we should operate in if (isset($_POST['mode']) || isset($_GET['mode'])) { - $mode = (isset($_POST['mode'])) ? $_POST['mode'] : $_GET['mode']; + $mode = isset($_POST['mode']) ? $_POST['mode'] : $_GET['mode']; $mode = htmlspecialchars($mode); } else { $mode = ''; } $delimeter = '=+:'; +$s_hidden_fields = ''; $smiley_paks = []; // Read a listing of uploaded smilies for use in the add or edit smliey code -$dir = @opendir(BB_ROOT . $bb_cfg['smilies_path']); +$dir = opendir(BB_ROOT . $bb_cfg['smilies_path']); while ($file = @readdir($dir)) { - if (!@is_dir(bb_realpath(BB_ROOT . $bb_cfg['smilies_path'] . '/' . $file))) { - $img_size = @getimagesize(BB_ROOT . $bb_cfg['smilies_path'] . '/' . $file); + if (!is_dir(bb_realpath(BB_ROOT . $bb_cfg['smilies_path'] . '/' . $file))) { + $img_size = getimagesize(BB_ROOT . $bb_cfg['smilies_path'] . '/' . $file); if ($img_size[0] && $img_size[1]) { $smiley_images[] = $file; @@ -56,7 +57,7 @@ while ($file = @readdir($dir)) { } } -@closedir($dir); +closedir($dir); // Select main mode if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { @@ -67,13 +68,13 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { if (!empty($smile_pak)) { // The user has already selected a smile_pak file.. Import it if (!empty($clear_current)) { - $sql = "DELETE FROM " . BB_SMILIES; + $sql = 'DELETE FROM ' . BB_SMILIES; if (!$result = DB()->sql_query($sql)) { bb_die('Could not delete current smilies'); } $datastore->update('smile_replacements'); } else { - $sql = "SELECT code FROM " . BB_SMILIES; + $sql = 'SELECT code FROM ' . BB_SMILIES; if (!$result = DB()->sql_query($sql)) { bb_die('Could not get current smilies'); } @@ -86,7 +87,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { } } - $fcontents = @file(BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smile_pak); + $fcontents = file(BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smile_pak); if (empty($fcontents)) { bb_die('Could not read smiley pak file'); @@ -103,14 +104,14 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { if (isset($smiles[$k])) { if (!empty($replace_existing)) { - $sql = "UPDATE " . BB_SMILIES . " + $sql = 'UPDATE ' . BB_SMILIES . " SET smile_url = '" . DB()->escape($smile_data[0]) . "', emoticon = '" . DB()->escape($smile_data[1]) . "' WHERE code = '" . DB()->escape($smile_data[$j]) . "'"; } else { $sql = ''; } } else { - $sql = "INSERT INTO " . BB_SMILIES . " (code, smile_url, emoticon) + $sql = 'INSERT INTO ' . BB_SMILIES . " (code, smile_url, emoticon) VALUES('" . DB()->escape($smile_data[$j]) . "', '" . DB()->escape($smile_data[0]) . "', '" . DB()->escape($smile_data[1]) . "')"; } @@ -149,7 +150,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { $export_pack = (string)request_var('export_pack', ''); if ($export_pack == 'send') { - $sql = "SELECT * FROM " . BB_SMILIES; + $sql = 'SELECT * FROM ' . BB_SMILIES; if (!$result = DB()->sql_query($sql)) { bb_die('Could not get smiley list'); } @@ -163,8 +164,8 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { $smile_pak .= $resultset[$i]['code'] . "\n"; } - header("Content-Type: text/x-delimtext; name=\"smiles.pak\""); - header("Content-disposition: attachment; filename=smiles.pak"); + header('Content-Type: text/x-delimtext; name="smiles.pak"'); + header('Content-disposition: attachment; filename=smiles.pak'); echo $smile_pak; @@ -183,7 +184,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { $template->assign_vars(array( 'TPL_SMILE_EDIT' => true, 'SMILEY_IMG' => BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smiley_images[0], - 'S_SMILEY_ACTION' => "admin_smilies.php", + 'S_SMILEY_ACTION' => 'admin_smilies.php', 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_FILENAME_OPTIONS' => $filename_list, 'S_SMILEY_BASEDIR' => BB_ROOT . $bb_cfg['smilies_path'] @@ -194,7 +195,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { $smiley_id = (!empty($_POST['id'])) ? $_POST['id'] : $_GET['id']; $smiley_id = (int)$smiley_id; - $sql = "DELETE FROM " . BB_SMILIES . " WHERE smilies_id = " . $smiley_id; + $sql = 'DELETE FROM ' . BB_SMILIES . ' WHERE smilies_id = ' . $smiley_id; $result = DB()->sql_query($sql); if (!$result) { bb_die('Could not delete smiley'); @@ -208,14 +209,14 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { $smiley_id = (!empty($_POST['id'])) ? $_POST['id'] : $_GET['id']; $smiley_id = (int)$smiley_id; - $sql = "SELECT * FROM " . BB_SMILIES . " WHERE smilies_id = " . $smiley_id; + $sql = 'SELECT * FROM ' . BB_SMILIES . ' WHERE smilies_id = ' . $smiley_id; $result = DB()->sql_query($sql); if (!$result) { bb_die('Could not obtain emoticon information'); } $smile_data = DB()->sql_fetchrow($result); - $filename_list = ''; + $filename_list = $smiley_edit_img = ''; for ($i = 0, $iMax = count($smiley_images); $i < $iMax; $i++) { if ($smiley_images[$i] == $smile_data['smile_url']) { $smiley_selected = 'selected="selected"'; @@ -233,7 +234,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { 'SMILEY_CODE' => $smile_data['code'], 'SMILEY_EMOTICON' => $smile_data['emoticon'], 'SMILEY_IMG' => BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smiley_edit_img, - 'S_SMILEY_ACTION' => "admin_smilies.php", + 'S_SMILEY_ACTION' => 'admin_smilies.php', 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_FILENAME_OPTIONS' => $filename_list, 'S_SMILEY_BASEDIR' => BB_ROOT . $bb_cfg['smilies_path'], @@ -242,11 +243,11 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { break; case 'save': - $smile_code = (isset($_POST['smile_code'])) ? trim($_POST['smile_code']) : trim($_GET['smile_code']); - $smile_url = (isset($_POST['smile_url'])) ? trim($_POST['smile_url']) : trim($_GET['smile_url']); + $smile_code = isset($_POST['smile_code']) ? trim($_POST['smile_code']) : trim($_GET['smile_code']); + $smile_url = isset($_POST['smile_url']) ? trim($_POST['smile_url']) : trim($_GET['smile_url']); $smile_url = bb_ltrim(basename($smile_url), "'"); - $smile_emotion = (isset($_POST['smile_emotion'])) ? trim($_POST['smile_emotion']) : trim($_GET['smile_emotion']); - $smile_id = (isset($_POST['smile_id'])) ? (int)$_POST['smile_id'] : (int)$_GET['smile_id']; + $smile_emotion = isset($_POST['smile_emotion']) ? trim($_POST['smile_emotion']) : trim($_GET['smile_emotion']); + $smile_id = isset($_POST['smile_id']) ? (int)$_POST['smile_id'] : (int)$_GET['smile_id']; // If no code was entered complain if ($smile_code == '' || $smile_url == '') { @@ -258,7 +259,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { $smile_code = str_replace('>', '>', $smile_code); // Proceed with updating the smiley table - $sql = "UPDATE " . BB_SMILIES . " + $sql = 'UPDATE ' . BB_SMILIES . " SET code = '" . DB()->escape($smile_code) . "', smile_url = '" . DB()->escape($smile_url) . "', emoticon = '" . DB()->escape($smile_emotion) . "' WHERE smilies_id = $smile_id"; if (!($result = DB()->sql_query($sql))) { @@ -270,10 +271,10 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { break; case 'savenew': - $smile_code = (isset($_POST['smile_code'])) ? $_POST['smile_code'] : $_GET['smile_code']; - $smile_url = (isset($_POST['smile_url'])) ? $_POST['smile_url'] : $_GET['smile_url']; + $smile_code = isset($_POST['smile_code']) ? $_POST['smile_code'] : $_GET['smile_code']; + $smile_url = isset($_POST['smile_url']) ? $_POST['smile_url'] : $_GET['smile_url']; $smile_url = bb_ltrim(basename($smile_url), "'"); - $smile_emotion = (isset($_POST['smile_emotion'])) ? $_POST['smile_emotion'] : $_GET['smile_emotion']; + $smile_emotion = isset($_POST['smile_emotion']) ? $_POST['smile_emotion'] : $_GET['smile_emotion']; $smile_code = trim($smile_code); $smile_url = trim($smile_url); $smile_emotion = trim($smile_emotion); @@ -288,7 +289,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { $smile_code = str_replace('>', '>', $smile_code); // Save the data to the smiley table - $sql = "INSERT INTO " . BB_SMILIES . " (code, smile_url, emoticon) + $sql = 'INSERT INTO ' . BB_SMILIES . " (code, smile_url, emoticon) VALUES ('" . DB()->escape($smile_code) . "', '" . DB()->escape($smile_url) . "', '" . DB()->escape($smile_emotion) . "')"; $result = DB()->sql_query($sql); if (!$result) { @@ -300,7 +301,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { break; } } else { - $sql = "SELECT * FROM " . BB_SMILIES; + $sql = 'SELECT * FROM ' . BB_SMILIES; $result = DB()->sql_query($sql); if (!$result) { bb_die('Could not obtain smileys from database'); @@ -310,7 +311,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { $template->assign_vars(array( 'TPL_SMILE_MAIN' => true, - 'S_HIDDEN_FIELDS' => @$s_hidden_fields, + 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_SMILEY_ACTION' => 'admin_smilies.php', )); @@ -329,8 +330,8 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { 'CODE' => $smilies[$i]['code'], 'EMOT' => $smilies[$i]['emoticon'], - 'U_SMILEY_EDIT' => "admin_smilies.php?mode=edit&id=" . $smilies[$i]['smilies_id'], - 'U_SMILEY_DELETE' => "admin_smilies.php?mode=delete&id=" . $smilies[$i]['smilies_id'], + 'U_SMILEY_EDIT' => 'admin_smilies.php?mode=edit&id=' . $smilies[$i]['smilies_id'], + 'U_SMILEY_DELETE' => 'admin_smilies.php?mode=delete&id=' . $smilies[$i]['smilies_id'], )); } } diff --git a/admin/admin_terms.php b/admin/admin_terms.php index 24d45d582..1b5298cab 100644 --- a/admin/admin_terms.php +++ b/admin/admin_terms.php @@ -38,8 +38,8 @@ if (isset($_POST['post']) && $bb_cfg['terms'] != $_POST['message']) { $template->assign_vars(array( 'S_ACTION' => 'admin_terms.php', 'EXT_LINK_NW' => $bb_cfg['ext_link_new_win'], - 'MESSAGE' => ($bb_cfg['terms']) ?: '', - 'PREVIEW_HTML' => (isset($_REQUEST['preview'])) ? bbcode2html($_POST['message']) : '', + 'MESSAGE' => $bb_cfg['terms'] ?: '', + 'PREVIEW_HTML' => isset($_REQUEST['preview']) ? bbcode2html($_POST['message']) : '', )); print_page('admin_terms.tpl', 'admin'); diff --git a/admin/admin_ug_auth.php b/admin/admin_ug_auth.php index cb96ac37f..4f3adfb7d 100644 --- a/admin/admin_ug_auth.php +++ b/admin/admin_ug_auth.php @@ -37,11 +37,11 @@ require INC_DIR . '/functions_group.php'; $yes_sign = '√'; $no_sign = 'x'; -$group_id = (int)@$_REQUEST['g']; -$user_id = (int)@$_REQUEST['u']; -$cat_id = (int)@$_REQUEST['c']; -$mode = (string)@$_REQUEST['mode']; -$submit = isset($_POST['submit']); +$group_id = isset($_REQUEST['g']) ? (int)$_REQUEST['g'] : 0; +$user_id = isset($_REQUEST['u']) ? (int)$_REQUEST['u'] : 0; +$cat_id = isset($_REQUEST['c']) ? (int)$_REQUEST['c'] : 0; +$mode = isset($_REQUEST['mode']) ? (string)$_REQUEST['mode'] : ''; +$submit = isset($_REQUEST['submit']); $group_data = array(); @@ -70,8 +70,8 @@ if ($submit && $mode == 'user') { $this_user_level = $row['user_level']; // Get "single_user" group_id for this user - $sql = "SELECT g.group_id - FROM " . BB_USER_GROUP . " ug, " . BB_GROUPS . " g + $sql = 'SELECT g.group_id + FROM ' . BB_USER_GROUP . ' ug, ' . BB_GROUPS . " g WHERE ug.user_id = $user_id AND g.group_id = ug.group_id AND g.group_single_user = 1"; @@ -87,12 +87,12 @@ if ($submit && $mode == 'user') { } // Make user an admin (if already user) - if (@$_POST['userlevel'] === 'admin') { + if ($_POST['userlevel'] === 'admin') { if ($userdata['user_id'] == $user_id || $user_id == GUEST_UID || $user_id == BOT_UID) { - bb_die("Could not update admin status"); + bb_die('Could not update admin status'); } - DB()->query("UPDATE " . BB_USERS . " SET user_level = " . ADMIN . " WHERE user_id = $user_id LIMIT 1"); + DB()->query('UPDATE ' . BB_USERS . ' SET user_level = ' . ADMIN . " WHERE user_id = $user_id LIMIT 1"); // Delete any entries in auth_access, they are not required if user is becoming an admin delete_permissions($group_id, $user_id); @@ -103,13 +103,13 @@ if ($submit && $mode == 'user') { bb_die($message); } // Make admin a user (if already admin) - elseif (@$_POST['userlevel'] === 'user') { + elseif ($_POST['userlevel'] === 'user') { // ignore if you're trying to change yourself from an admin to user! if ($userdata['user_id'] == $user_id) { - bb_die("Could not update admin status

Could not change yourself from an admin to user"); + bb_die('Could not update admin status

Could not change yourself from an admin to user'); } // Update users level, reset to USER - DB()->query("UPDATE " . BB_USERS . " SET user_level = " . USER . " WHERE user_id = $user_id LIMIT 1"); + DB()->query('UPDATE ' . BB_USERS . ' SET user_level = ' . USER . " WHERE user_id = $user_id LIMIT 1"); delete_permissions($group_id, $user_id); @@ -125,7 +125,7 @@ if ($submit && $mode == 'user') { // $auth = array(); - if (is_array(@$_POST['auth'])) { + if (is_array($_POST['auth'])) { array_deep($_POST['auth'], 'intval'); foreach ($_POST['auth'] as $f_id => $bf_ary) { @@ -150,7 +150,7 @@ if ($submit && $mode == 'user') { // // Submit new GROUP permissions // -elseif ($submit && $mode == 'group' && is_array(@$_POST['auth'])) { +elseif ($submit && $mode == 'group' && is_array($_POST['auth'])) { if (!$group_data = get_group_data($group_id)) { bb_die($lang['GROUP_NOT_EXIST']); } @@ -225,11 +225,11 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { 'DISABLED' => $disabled, 'FORUM_ID' => $f_id, 'FORUM_NAME' => str_short($forums['forum_name_html'][$f_id], $max_forum_name_length), - 'SF_SPACER' => ($f_data['forum_parent']) ? HTML_SF_SPACER : '', + 'SF_SPACER' => $f_data['forum_parent'] ? HTML_SF_SPACER : '', 'IS_MODERATOR' => (bool)$auth_mod, - 'MOD_STATUS' => ($auth_mod) ? $lang['MODERATOR'] : $lang['NONE'], - 'MOD_CLASS' => ($auth_mod) ? (($disabled) ? 'yesDisabled' : 'yesMOD') : 'noMOD', - 'AUTH_MOD_VAL' => ($auth_mod) ? 1 : 0, + 'MOD_STATUS' => $auth_mod ? $lang['MODERATOR'] : $lang['NONE'], + 'MOD_CLASS' => $auth_mod ? ($disabled ? 'yesDisabled' : 'yesMOD') : 'noMOD', + 'AUTH_MOD_VAL' => $auth_mod ? 1 : 0, )); foreach ($forum_auth_fields as $auth_type) { @@ -243,8 +243,8 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { $acl_class = ($auth_via_acl || $auth_mod) ? 'yes' : 'no'; } else { $disabled = true; - $perm_sign = ($auth_via_acl) ? $yes_sign : $no_sign; - $acl_class = ($auth_via_acl) ? 'yes' : 'no'; + $perm_sign = $auth_via_acl ? $yes_sign : $no_sign; + $acl_class = $auth_via_acl ? 'yes' : 'no'; } $template->assign_block_vars('c.f.acl', array( @@ -253,7 +253,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { 'ACL_CLASS' => $acl_class, 'FORUM_ID' => $f_id, 'ACL_TYPE_BF' => $bf_num, - 'ACL_VAL' => ($auth_via_acl) ? 1 : 0, + 'ACL_VAL' => $auth_via_acl ? 1 : 0, )); } } @@ -267,7 +267,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { foreach ($forum_auth_fields as $auth_type) { $template->assign_block_vars('acltype', array( - 'ACL_TYPE_NAME' => preg_replace("#(.{5})#u", "\\1
", $lang[strtoupper($auth_type)]), + 'ACL_TYPE_NAME' => preg_replace('#(.{5})#u', "\\1
", $lang[strtoupper($auth_type)]), 'ACL_TYPE_BF' => $bf['forum_perm'][$auth_type], )); $s_column_span++; @@ -297,17 +297,11 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { $template->assign_vars(array( 'TPL_AUTH_UG_MAIN' => true, - 'USER_OR_GROUPNAME' => $this_userdata['username'], 'USER_LEVEL' => $lang['USER_LEVEL'] . ' : ' . $s_user_type, - 'USER_GROUP_MEMBERSHIPS' => $lang['GROUP_MEMBERSHIPS'], - )); - - $template->assign_vars(array( 'T_USER_OR_GROUPNAME' => $lang['USERNAME'], 'T_AUTH_TITLE' => $lang['AUTH_CONTROL_USER'], 'T_AUTH_EXPLAIN' => $lang['USER_AUTH_EXPLAIN'], - 'S_COLUMN_SPAN' => $s_column_span, 'S_HIDDEN_FIELDS' => $s_hidden_fields, )); @@ -334,7 +328,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { 'CAT_HREF' => "$base_url&c=$c_id", )); - if (!$c =& $_REQUEST['c'] or !in_array($c, array('all', $c_id)) or empty($c_data['forums'])) { + if (!($c =& $_REQUEST['c']) || !in_array($c, array('all', $c_id)) || empty($c_data['forums'])) { continue; } @@ -346,11 +340,11 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { 'DISABLED' => false, 'FORUM_ID' => $f_id, 'FORUM_NAME' => str_short($forums['forum_name_html'][$f_id], $max_forum_name_length), - 'SF_SPACER' => ($f_data['forum_parent']) ? HTML_SF_SPACER : '', + 'SF_SPACER' => $f_data['forum_parent'] ? HTML_SF_SPACER : '', 'IS_MODERATOR' => (bool)$auth_mod, - 'MOD_STATUS' => ($auth_mod) ? $lang['MODERATOR'] : $lang['NO'], - 'MOD_CLASS' => ($auth_mod) ? 'yesMOD' : 'noMOD', - 'AUTH_MOD_VAL' => ($auth_mod) ? 1 : 0, + 'MOD_STATUS' => $auth_mod ? $lang['MODERATOR'] : $lang['NO'], + 'MOD_CLASS' => $auth_mod ? 'yesMOD' : 'noMOD', + 'AUTH_MOD_VAL' => $auth_mod ? 1 : 0, )); foreach ($forum_auth_fields as $auth_type) { @@ -364,8 +358,8 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { $acl_class = ($auth_via_acl || $auth_mod) ? 'yes' : 'no'; } else { $disabled = true; - $perm_sign = ($auth_via_acl) ? $yes_sign : $no_sign; - $acl_class = ($auth_via_acl) ? 'yes' : 'no'; + $perm_sign = $auth_via_acl ? $yes_sign : $no_sign; + $acl_class = $auth_via_acl ? 'yes' : 'no'; } $template->assign_block_vars('c.f.acl', array( @@ -374,7 +368,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { 'ACL_CLASS' => $acl_class, 'FORUM_ID' => $f_id, 'ACL_TYPE_BF' => $bf_num, - 'ACL_VAL' => ($auth_via_acl) ? 1 : 0, + 'ACL_VAL' => $auth_via_acl ? 1 : 0, )); } } @@ -388,7 +382,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { foreach ($forum_auth_fields as $auth_type) { $template->assign_block_vars('acltype', array( - 'ACL_TYPE_NAME' => preg_replace("#(.{5})#u", "\\1
", $lang[strtoupper($auth_type)]), + 'ACL_TYPE_NAME' => preg_replace('#(.{5})#u', "\\1
", $lang[strtoupper($auth_type)]), 'ACL_TYPE_BF' => $bf['forum_perm'][$auth_type], )); $s_column_span++; @@ -404,7 +398,6 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { $template->assign_vars(array( 'TPL_AUTH_UG_MAIN' => true, - 'T_USER_OR_GROUPNAME' => $lang['GROUP_NAME'], 'USER_LEVEL' => false, 'T_AUTH_TITLE' => $lang['AUTH_CONTROL_GROUP'], @@ -418,7 +411,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { if ($mode == 'user') { $template->assign_vars(array( 'TPL_SELECT_USER' => true, - 'U_SEARCH_USER' => BB_ROOT . "search.php?mode=searchuser", + 'U_SEARCH_USER' => BB_ROOT . 'search.php?mode=searchuser', )); } else { $template->assign_vars(array( @@ -437,9 +430,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { $template->assign_vars(array( 'YES_SIGN' => $yes_sign, 'NO_SIGN' => $no_sign, - 'T_MOD_YES' => $lang['MODERATOR'], - 'T_MOD_NO' => $lang['NO'], - 'S_AUTH_ACTION' => "admin_ug_auth.php", + 'S_AUTH_ACTION' => 'admin_ug_auth.php', 'SELECTED_CAT' => !empty($_REQUEST['c']) ? $_REQUEST['c'] : '', 'U_ALL_FORUMS' => !empty($base_url) ? "$base_url&c=all" : '', )); diff --git a/admin/admin_user_ban.php b/admin/admin_user_ban.php index f5cc03faf..e5f614698 100644 --- a/admin/admin_user_ban.php +++ b/admin/admin_user_ban.php @@ -67,7 +67,7 @@ if (isset($_POST['submit'])) { } } - $sql = "SELECT * FROM " . BB_BANLIST; + $sql = 'SELECT * FROM ' . BB_BANLIST; if (!($result = DB()->sql_query($sql))) { bb_die('Could not obtain banlist information'); } @@ -85,9 +85,9 @@ if (isset($_POST['submit'])) { } if (!$in_banlist) { - $kill_session_sql .= (($kill_session_sql != '') ? ' OR ' : '') . "session_user_id = " . $user_list[$i]; + $kill_session_sql .= (($kill_session_sql != '') ? ' OR ' : '') . 'session_user_id = ' . $user_list[$i]; - $sql = "INSERT INTO " . BB_BANLIST . " (ban_userid) VALUES (" . $user_list[$i] . ")"; + $sql = 'INSERT INTO ' . BB_BANLIST . ' (ban_userid) VALUES (' . $user_list[$i] . ')'; if (!DB()->sql_query($sql)) { bb_die('Could not insert ban_userid info into database'); } @@ -104,14 +104,14 @@ if (isset($_POST['submit'])) { if (!$in_banlist) { if (preg_match('/(ff\.)|(\.ff)/is', chunk_split($ip_list[$i], 2, '.'))) { - $kill_ip_sql = "session_ip LIKE '" . str_replace('.', '', preg_replace('/(ff\.)|(\.ff)/is', '%', chunk_split($ip_list[$i], 2, "."))) . "'"; + $kill_ip_sql = "session_ip LIKE '" . str_replace('.', '', preg_replace('/(ff\.)|(\.ff)/is', '%', chunk_split($ip_list[$i], 2, '.'))) . "'"; } else { $kill_ip_sql = "session_ip = '" . $ip_list[$i] . "'"; } $kill_session_sql .= (($kill_session_sql != '') ? ' OR ' : '') . $kill_ip_sql; - $sql = "INSERT INTO " . BB_BANLIST . " (ban_ip) VALUES ('" . $ip_list[$i] . "')"; + $sql = 'INSERT INTO ' . BB_BANLIST . " (ban_ip) VALUES ('" . $ip_list[$i] . "')"; if (!DB()->sql_query($sql)) { bb_die('Could not insert ban_ip info into database'); } @@ -120,7 +120,7 @@ if (isset($_POST['submit'])) { // Now we'll delete all entries from the session table if ($kill_session_sql != '') { - $sql = "DELETE FROM " . BB_SESSIONS . " WHERE $kill_session_sql"; + $sql = 'DELETE FROM ' . BB_SESSIONS . " WHERE $kill_session_sql"; if (!DB()->sql_query($sql)) { bb_die('Could not delete banned sessions from database'); } @@ -135,7 +135,7 @@ if (isset($_POST['submit'])) { } if (!$in_banlist) { - $sql = "INSERT INTO " . BB_BANLIST . " (ban_email) VALUES ('" . DB()->escape($email_list[$i]) . "')"; + $sql = 'INSERT INTO ' . BB_BANLIST . " (ban_email) VALUES ('" . DB()->escape($email_list[$i]) . "')"; if (!DB()->sql_query($sql)) { bb_die('Could not insert ban_email info into database'); } @@ -175,7 +175,7 @@ if (isset($_POST['submit'])) { } if ($where_sql != '') { - $sql = "DELETE FROM " . BB_BANLIST . " WHERE ban_id IN ($where_sql)"; + $sql = 'DELETE FROM ' . BB_BANLIST . " WHERE ban_id IN ($where_sql)"; if (!DB()->sql_query($sql)) { bb_die('Could not delete ban info from database'); } @@ -191,12 +191,12 @@ if (isset($_POST['submit'])) { $ipban_count = 0; $emailban_count = 0; - $sql = "SELECT b.ban_id, u.user_id, u.username - FROM " . BB_BANLIST . " b, " . BB_USERS . " u + $sql = 'SELECT b.ban_id, u.user_id, u.username + FROM ' . BB_BANLIST . ' b, ' . BB_USERS . ' u WHERE u.user_id = b.ban_userid AND b.ban_userid <> 0 - AND u.user_id <> " . GUEST_UID . " - ORDER BY u.username ASC"; + AND u.user_id <> ' . GUEST_UID . ' + ORDER BY u.username ASC'; if (!($result = DB()->sql_query($sql))) { bb_die('Could not select current user_id ban list'); } @@ -216,7 +216,7 @@ if (isset($_POST['submit'])) { $select_userlist = ''; - $sql = "SELECT ban_id, ban_ip, ban_email FROM " . BB_BANLIST . " ORDER BY ban_ip"; + $sql = 'SELECT ban_id, ban_ip, ban_email FROM ' . BB_BANLIST . ' ORDER BY ban_ip'; if (!($result = DB()->sql_query($sql))) { bb_die('Could not select current ip ban list'); } diff --git a/admin/admin_user_search.php b/admin/admin_user_search.php index 4a6f66a83..947365f1f 100644 --- a/admin/admin_user_search.php +++ b/admin/admin_user_search.php @@ -36,10 +36,10 @@ require INC_DIR . '/functions_selects.php'; $total_sql = ''; if (!isset($_REQUEST['dosearch'])) { - $sql = "SELECT group_id, group_name - FROM " . BB_GROUPS . " + $sql = 'SELECT group_id, group_name + FROM ' . BB_GROUPS . ' WHERE group_single_user = 0 - ORDER BY group_name ASC"; + ORDER BY group_name ASC'; if (!$result = DB()->sql_query($sql)) { bb_die('Could not select group data #1'); @@ -55,7 +55,7 @@ if (!isset($_REQUEST['dosearch'])) { } } - $sql = "SELECT * FROM " . BB_RANKS . " WHERE rank_special = 1 ORDER BY rank_title"; + $sql = 'SELECT * FROM ' . BB_RANKS . ' WHERE rank_special = 1 ORDER BY rank_title'; if (!($result = DB()->sql_query($sql))) { bb_die('Could not obtain ranks data'); } @@ -72,9 +72,9 @@ if (!isset($_REQUEST['dosearch'])) { $language_list = language_select('', 'language_type'); $timezone_list = tz_select('', 'timezone_type'); - $sql = "SELECT f.forum_id, f.forum_name, f.forum_parent, c.cat_id, c.cat_title - FROM ( " . BB_FORUMS . " AS f INNER JOIN " . BB_CATEGORIES . " AS c ON c.cat_id = f.cat_id ) - ORDER BY c.cat_order, f.forum_order ASC"; + $sql = 'SELECT f.forum_id, f.forum_name, f.forum_parent, c.cat_id, c.cat_title + FROM ( ' . BB_FORUMS . ' AS f INNER JOIN ' . BB_CATEGORIES . ' AS c ON c.cat_id = f.cat_id ) + ORDER BY c.cat_order, f.forum_order ASC'; if (!$result = DB()->sql_query($sql)) { bb_die('Could not select forum data'); @@ -94,7 +94,7 @@ if (!isset($_REQUEST['dosearch'])) { $last_cat_id = $row['cat_id']; } - $forums_list .= ''; + $forums_list .= ''; } } @@ -108,9 +108,9 @@ if (!isset($_REQUEST['dosearch'])) { $template->assign_vars(array( 'TPL_ADMIN_USER_SEARCH_MAIN' => true, - 'YEAR' => date("Y"), - 'MONTH' => date("m"), - 'DAY' => date("d"), + 'YEAR' => date('Y'), + 'MONTH' => date('m'), + 'DAY' => date('d'), 'GROUP_LIST' => $group_list, 'RANK_SELECT_BOX' => $rank_select_box, 'LANGUAGE_LIST' => $language_list, @@ -257,7 +257,7 @@ if (!isset($_REQUEST['dosearch'])) { $base_url = 'admin_user_search.php?dosearch=true'; - $select_sql = "SELECT u.user_id, u.username, u.user_rank, u.user_email, u.user_posts, u.user_regdate, u.user_level, u.user_active, u.user_lastvisit FROM " . BB_USERS . " AS u"; + $select_sql = 'SELECT u.user_id, u.username, u.user_rank, u.user_email, u.user_posts, u.user_regdate, u.user_level, u.user_active, u.user_lastvisit FROM ' . BB_USERS . ' AS u'; $lower_b = 'LOWER('; $lower_e = ')'; @@ -281,7 +281,7 @@ if (!isset($_REQUEST['dosearch'])) { bb_die($lang['SEARCH_INVALID_USERNAME']); } - $total_sql .= "SELECT COUNT(user_id) AS total FROM " . BB_USERS . " WHERE {$lower_b}username{$lower_e} $op '" . DB()->escape($username) . "' AND user_id <> " . GUEST_UID; + $total_sql .= 'SELECT COUNT(user_id) AS total FROM ' . BB_USERS . " WHERE {$lower_b}username{$lower_e} $op '" . DB()->escape($username) . "' AND user_id <> " . GUEST_UID; $select_sql .= " WHERE {$lower_b}u.username{$lower_e} $op '" . DB()->escape($username) . "' AND u.user_id <> " . GUEST_UID; break; @@ -302,7 +302,7 @@ if (!isset($_REQUEST['dosearch'])) { bb_die($lang['SEARCH_INVALID_EMAIL']); } - $total_sql .= "SELECT COUNT(user_id) AS total FROM " . BB_USERS . " WHERE {$lower_b}user_email{$lower_e} $op '" . DB()->escape($email) . "' AND user_id <> " . GUEST_UID; + $total_sql .= 'SELECT COUNT(user_id) AS total FROM ' . BB_USERS . " WHERE {$lower_b}user_email{$lower_e} $op '" . DB()->escape($email) . "' AND user_id <> " . GUEST_UID; $select_sql .= " WHERE {$lower_b}u.user_email{$lower_e} $op '" . DB()->escape($email) . "' AND u.user_id <> " . GUEST_UID; break; @@ -331,7 +331,7 @@ if (!isset($_REQUEST['dosearch'])) { $where_sql = ''; $where_sql .= ($ip_in_sql != '') ? "poster_ip IN ($ip_in_sql)" : ''; - $where_sql .= ($ip_like_sql != '') ? ($where_sql != "") ? " OR $ip_like_sql" : "$ip_like_sql" : ''; + $where_sql .= ($ip_like_sql != '') ? ($where_sql != '') ? " OR $ip_like_sql" : "$ip_like_sql" : ''; if (!$where_sql) { bb_die('invalid request'); @@ -340,7 +340,7 @@ if (!isset($_REQUEST['dosearch'])) { // start search $no_result_search = false; $ip_users_sql = ''; - $sql = "SELECT poster_id FROM " . BB_POSTS . " WHERE poster_id <> " . GUEST_UID . " AND ($where_sql) GROUP BY poster_id"; + $sql = 'SELECT poster_id FROM ' . BB_POSTS . ' WHERE poster_id <> ' . GUEST_UID . " AND ($where_sql) GROUP BY poster_id"; if (!$result = DB()->sql_query($sql)) { bb_die('Could not count users #1'); @@ -357,9 +357,9 @@ if (!isset($_REQUEST['dosearch'])) { } } $where_sql = ''; - $where_sql .= ($ip_in_sql != '') ? "user_last_ip IN ($ip_in_sql)" : ""; - $where_sql .= ($ip_like_sql_flylast != '') ? ($where_sql != "") ? " OR $ip_like_sql_flylast" : "$ip_like_sql_flylast" : ""; - $sql = "SELECT user_id FROM " . BB_USERS . " WHERE user_id <> " . GUEST_UID . " AND ($where_sql) GROUP BY user_id"; + $where_sql .= ($ip_in_sql != '') ? "user_last_ip IN ($ip_in_sql)" : ''; + $where_sql .= ($ip_like_sql_flylast != '') ? ($where_sql != '') ? " OR $ip_like_sql_flylast" : "$ip_like_sql_flylast" : ''; + $sql = 'SELECT user_id FROM ' . BB_USERS . ' WHERE user_id <> ' . GUEST_UID . " AND ($where_sql) GROUP BY user_id"; if (!$result = DB()->sql_query($sql)) { bb_die('Could not count users #2'); } @@ -374,9 +374,9 @@ if (!isset($_REQUEST['dosearch'])) { } } $where_sql = ''; - $where_sql .= ($ip_in_sql != '') ? "user_reg_ip IN ($ip_in_sql)" : ""; - $where_sql .= ($ip_like_sql_flyreg != '') ? ($where_sql != "") ? " OR $ip_like_sql_flyreg" : "$ip_like_sql_flyreg" : ""; - $sql = "SELECT user_id FROM " . BB_USERS . " WHERE user_id <> " . GUEST_UID . " AND ($where_sql) GROUP BY user_id"; + $where_sql .= ($ip_in_sql != '') ? "user_reg_ip IN ($ip_in_sql)" : ''; + $where_sql .= ($ip_like_sql_flyreg != '') ? ($where_sql != '') ? " OR $ip_like_sql_flyreg" : "$ip_like_sql_flyreg" : ''; + $sql = 'SELECT user_id FROM ' . BB_USERS . ' WHERE user_id <> ' . GUEST_UID . " AND ($where_sql) GROUP BY user_id"; if (!$result = DB()->sql_query($sql)) { bb_die('Could not count users #3'); } @@ -434,7 +434,7 @@ if (!isset($_REQUEST['dosearch'])) { $arg = '>'; } - $total_sql .= "SELECT COUNT(user_id) AS total FROM " . BB_USERS . " WHERE user_regdate $arg $time AND user_id <> " . GUEST_UID; + $total_sql .= 'SELECT COUNT(user_id) AS total FROM ' . BB_USERS . " WHERE user_regdate $arg $time AND user_id <> " . GUEST_UID; $select_sql .= " WHERE u.user_regdate $arg $time AND u.user_id <> " . GUEST_UID; break; @@ -447,7 +447,7 @@ if (!isset($_REQUEST['dosearch'])) { bb_die($lang['SEARCH_INVALID_GROUP']); } - $sql = "SELECT group_name FROM " . BB_GROUPS . " WHERE group_id = $group_id AND group_single_user = 0"; + $sql = 'SELECT group_name FROM ' . BB_GROUPS . " WHERE group_id = $group_id AND group_single_user = 0"; if (!$result = DB()->sql_query($sql)) { bb_die('Could not select group data #2'); @@ -461,13 +461,13 @@ if (!isset($_REQUEST['dosearch'])) { $text = sprintf($lang['SEARCH_FOR_GROUP'], strip_tags(htmlspecialchars($group_name['group_name']))); - $total_sql .= "SELECT COUNT(u.user_id) AS total - FROM " . BB_USERS . " AS u, " . BB_USER_GROUP . " AS ug + $total_sql .= 'SELECT COUNT(u.user_id) AS total + FROM ' . BB_USERS . ' AS u, ' . BB_USER_GROUP . " AS ug WHERE u.user_id = ug.user_id AND ug.group_id = $group_id AND u.user_id <> " . GUEST_UID; - $select_sql .= ", " . BB_USER_GROUP . " AS ug + $select_sql .= ', ' . BB_USER_GROUP . " AS ug WHERE u.user_id = ug.user_id AND ug.group_id = $group_id AND u.user_id <> " . GUEST_UID; @@ -482,7 +482,7 @@ if (!isset($_REQUEST['dosearch'])) { bb_die($lang['SEARCH_INVALID_RANK']); } - $sql = "SELECT rank_title FROM " . BB_RANKS . " WHERE rank_id = $rank_id AND rank_special = 1"; + $sql = 'SELECT rank_title FROM ' . BB_RANKS . " WHERE rank_id = $rank_id AND rank_special = 1"; if (!$result = DB()->sql_query($sql)) { bb_die('Could not select rank data'); @@ -496,8 +496,8 @@ if (!isset($_REQUEST['dosearch'])) { $text = sprintf($lang['SEARCH_FOR_RANK'], strip_tags(htmlspecialchars($rank_title['rank_title']))); - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . " WHERE user_rank = $rank_id AND user_id <> " . GUEST_UID; @@ -517,8 +517,8 @@ if (!isset($_REQUEST['dosearch'])) { $text = sprintf($lang['SEARCH_FOR_POSTCOUNT_GREATER'], $postcount_value); - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . " WHERE user_posts > $postcount_value AND user_id <> " . GUEST_UID; @@ -530,8 +530,8 @@ if (!isset($_REQUEST['dosearch'])) { $text = sprintf($lang['SEARCH_FOR_POSTCOUNT_LESSER'], $postcount_value); - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . " WHERE user_posts < $postcount_value AND user_id <> " . GUEST_UID; @@ -552,8 +552,8 @@ if (!isset($_REQUEST['dosearch'])) { $text = sprintf($lang['SEARCH_FOR_POSTCOUNT_RANGE'], $range_begin, $range_end); - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . " WHERE user_posts >= $range_begin AND user_posts <= $range_end AND user_id <> " . GUEST_UID; @@ -566,8 +566,8 @@ if (!isset($_REQUEST['dosearch'])) { $text = sprintf($lang['SEARCH_FOR_POSTCOUNT_EQUALS'], $postcount_value); - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . " WHERE user_posts = $postcount_value AND user_id <> " . GUEST_UID; @@ -632,8 +632,8 @@ if (!isset($_REQUEST['dosearch'])) { bb_die($lang['SEARCH_INVALID']); } - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . " WHERE {$lower_b}$field{$lower_e} $op '" . DB()->escape($userfield_value) . "' AND user_id <> " . GUEST_UID; @@ -653,8 +653,8 @@ if (!isset($_REQUEST['dosearch'])) { case 'in': $text = sprintf($lang['SEARCH_FOR_LASTVISITED_INTHELAST'], $lastvisited_days, (($lastvisited_days > 1) ? $lang['DAYS'] : $lang['DAY'])); - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . " WHERE user_lastvisit >= $lastvisited_seconds AND user_id <> " . GUEST_UID; @@ -664,8 +664,8 @@ if (!isset($_REQUEST['dosearch'])) { case 'after': $text = sprintf($lang['SEARCH_FOR_LASTVISITED_AFTERTHELAST'], $lastvisited_days, (($lastvisited_days > 1) ? $lang['DAYS'] : $lang['DAY'])); - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . " WHERE user_lastvisit < $lastvisited_seconds AND user_id <> " . GUEST_UID; @@ -689,8 +689,8 @@ if (!isset($_REQUEST['dosearch'])) { $text = sprintf($lang['SEARCH_FOR_LANGUAGE'], strip_tags(htmlspecialchars($language_type))); - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . " WHERE user_lang = '" . DB()->escape($language_type) . "' AND user_id <> " . GUEST_UID; @@ -704,8 +704,8 @@ if (!isset($_REQUEST['dosearch'])) { $timezone_type = (int)$timezone_type; - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . " WHERE user_timezone = $timezone_type AND user_id <> " . GUEST_UID; @@ -717,7 +717,7 @@ if (!isset($_REQUEST['dosearch'])) { $base_url .= '&search_moderators=true&moderators_forum=' . rawurlencode(stripslashes($moderators_forum)); $moderators_forum = (int)$moderators_forum; - $sql = "SELECT forum_name FROM " . BB_FORUMS . " WHERE forum_id = " . $moderators_forum; + $sql = 'SELECT forum_name FROM ' . BB_FORUMS . ' WHERE forum_id = ' . $moderators_forum; if (!$result = DB()->sql_query($sql)) { bb_die('Could not select forum data'); @@ -731,23 +731,23 @@ if (!isset($_REQUEST['dosearch'])) { $text = sprintf($lang['SEARCH_FOR_MODERATORS'], htmlCHR($forum_name['forum_name'])); - $total_sql .= "SELECT COUNT(DISTINCT u.user_id) AS total - FROM " . BB_USERS . " AS u, " . BB_GROUPS . " AS g, " . BB_USER_GROUP . " AS ug, " . BB_AUTH_ACCESS . " AS aa + $total_sql .= 'SELECT COUNT(DISTINCT u.user_id) AS total + FROM ' . BB_USERS . ' AS u, ' . BB_GROUPS . ' AS g, ' . BB_USER_GROUP . ' AS ug, ' . BB_AUTH_ACCESS . ' AS aa WHERE u.user_id = ug.user_id AND ug.group_id = g.group_id AND g.group_id = aa.group_id - AND aa.forum_id = " . $moderators_forum . " - AND aa.forum_perm & " . BF_AUTH_MOD . " - AND u.user_id <> " . GUEST_UID; + AND aa.forum_id = ' . $moderators_forum . ' + AND aa.forum_perm & ' . BF_AUTH_MOD . ' + AND u.user_id <> ' . GUEST_UID; - $select_sql .= ", " . BB_GROUPS . " AS g, " . BB_USER_GROUP . " AS ug, " . BB_AUTH_ACCESS . " AS aa + $select_sql .= ', ' . BB_GROUPS . ' AS g, ' . BB_USER_GROUP . ' AS ug, ' . BB_AUTH_ACCESS . ' AS aa WHERE u.user_id = ug.user_id AND ug.group_id = g.group_id AND g.group_id = aa.group_id - AND aa.forum_id = " . $moderators_forum . " - AND aa.forum_perm & " . BF_AUTH_MOD . " - AND u.user_id <> " . GUEST_UID . " - GROUP BY u.user_id, u.username, u.user_email, u.user_posts, u.user_regdate, u.user_level, u.user_active, u.user_lastvisit"; + AND aa.forum_id = ' . $moderators_forum . ' + AND aa.forum_perm & ' . BF_AUTH_MOD . ' + AND u.user_id <> ' . GUEST_UID . ' + GROUP BY u.user_id, u.username, u.user_email, u.user_posts, u.user_regdate, u.user_level, u.user_active, u.user_lastvisit'; break; case 'search_misc': @@ -760,48 +760,48 @@ if (!isset($_REQUEST['dosearch'])) { case 'admins': $text = $lang['SEARCH_FOR_ADMINS']; - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " - WHERE user_level = " . ADMIN . " - AND user_id <> " . GUEST_UID; + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . ' + WHERE user_level = ' . ADMIN . ' + AND user_id <> ' . GUEST_UID; - $select_sql .= " WHERE u.user_level = " . ADMIN . " - AND u.user_id <> " . GUEST_UID; + $select_sql .= ' WHERE u.user_level = ' . ADMIN . ' + AND u.user_id <> ' . GUEST_UID; break; case 'mods': $text = $lang['SEARCH_FOR_MODS']; - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " - WHERE user_level = " . MOD . " - AND user_id <> " . GUEST_UID; + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . ' + WHERE user_level = ' . MOD . ' + AND user_id <> ' . GUEST_UID; - $select_sql .= " WHERE u.user_level = " . MOD . " - AND u.user_id <> " . GUEST_UID; + $select_sql .= ' WHERE u.user_level = ' . MOD . ' + AND u.user_id <> ' . GUEST_UID; break; case 'banned': $text = $lang['SEARCH_FOR_BANNED']; - $total_sql .= "SELECT COUNT(u.user_id) AS total - FROM " . BB_USERS . " AS u, " . BB_BANLIST . " AS b + $total_sql .= 'SELECT COUNT(u.user_id) AS total + FROM ' . BB_USERS . ' AS u, ' . BB_BANLIST . ' AS b WHERE u.user_id = b.ban_userid - AND u.user_id <> " . GUEST_UID; + AND u.user_id <> ' . GUEST_UID; - $select_sql .= ", " . BB_BANLIST . " AS b + $select_sql .= ', ' . BB_BANLIST . ' AS b WHERE u.user_id = b.ban_userid - AND u.user_id <> " . GUEST_UID; + AND u.user_id <> ' . GUEST_UID; break; case 'disabled': $text = $lang['SEARCH_FOR_DISABLED']; - $total_sql .= "SELECT COUNT(user_id) AS total - FROM " . BB_USERS . " + $total_sql .= 'SELECT COUNT(user_id) AS total + FROM ' . BB_USERS . ' WHERE user_active = 0 - AND user_id <> " . GUEST_UID; + AND user_id <> ' . GUEST_UID; - $select_sql .= " WHERE u.user_active = 0 - AND u.user_id <> " . GUEST_UID; + $select_sql .= ' WHERE u.user_active = 0 + AND u.user_id <> ' . GUEST_UID; break; default: @@ -809,9 +809,9 @@ if (!isset($_REQUEST['dosearch'])) { } } - $select_sql .= " ORDER BY "; + $select_sql .= ' ORDER BY '; - switch (strtolower(@$_GET['sort'])) { + switch (strtolower($_GET['sort'])) { case 'regdate': $sort = 'regdate'; $select_sql .= 'u.user_regdate'; @@ -838,7 +838,7 @@ if (!isset($_REQUEST['dosearch'])) { $select_sql .= 'u.username'; } - switch (@$_GET['order']) { + switch ($_GET['order']) { case 'DESC': $order = 'DESC'; $o_order = 'ASC'; @@ -851,7 +851,7 @@ if (!isset($_REQUEST['dosearch'])) { $select_sql .= " $order"; - $page = (isset($_GET['page'])) ? (int)$_GET['page'] : (int)trim(@$_POST['page']); + $page = isset($_GET['page']) ? (int)$_GET['page'] : (int)trim($_POST['page']); if ($page < 1) { $page = 1; @@ -878,7 +878,7 @@ if (!isset($_REQUEST['dosearch'])) { bb_die($lang['SEARCH_NO_RESULTS']); } } - $num_pages = ceil(($total_pages['total'] / $bb_cfg['topics_per_page'])); + $num_pages = ceil($total_pages['total'] / $bb_cfg['topics_per_page']); $pagination = ''; @@ -919,7 +919,7 @@ if (!isset($_REQUEST['dosearch'])) { $users_sql .= ($users_sql == '') ? $array['user_id'] : ', ' . $array['user_id']; } - $sql = "SELECT ban_userid AS user_id FROM " . BB_BANLIST . " WHERE ban_userid IN ($users_sql)"; + $sql = 'SELECT ban_userid AS user_id FROM ' . BB_BANLIST . " WHERE ban_userid IN ($users_sql)"; if (!$result = DB()->sql_query($sql)) { bb_die('Could not select banned data'); @@ -943,8 +943,8 @@ if (!isset($_REQUEST['dosearch'])) { 'JOINDATE' => bb_date($rowset[$i]['user_regdate']), 'LASTVISIT' => bb_date($rowset[$i]['user_lastvisit']), 'POSTS' => $rowset[$i]['user_posts'], - 'BAN' => ((!isset($banned[$rowset[$i]['user_id']])) ? $lang['NOT_BANNED'] : $lang['BANNED']), - 'ABLED' => (($rowset[$i]['user_active']) ? $lang['ENABLED'] : $lang['DISABLED']), + 'BAN' => (!isset($banned[$rowset[$i]['user_id']])) ? $lang['NOT_BANNED'] : $lang['BANNED'], + 'ABLED' => $rowset[$i]['user_active'] ? $lang['ENABLED'] : $lang['DISABLED'], 'U_VIEWPOSTS' => "../search.php?search_author=1&uid={$rowset[$i]['user_id']}", 'U_MANAGE' => '../profile.php?mode=editprofile&' . POST_USERS_URL . '=' . $rowset[$i]['user_id'] . '&admin=1', diff --git a/admin/admin_words.php b/admin/admin_words.php index a76ec50bd..a69744f3d 100644 --- a/admin/admin_words.php +++ b/admin/admin_words.php @@ -51,7 +51,7 @@ if ($mode != '') { if ($mode == 'edit') { if ($word_id) { - $sql = "SELECT * FROM " . BB_WORDS . " WHERE word_id = $word_id"; + $sql = 'SELECT * FROM ' . BB_WORDS . " WHERE word_id = $word_id"; if (!$result = DB()->sql_query($sql)) { bb_die('Could not query words table #1'); } @@ -82,12 +82,12 @@ if ($mode != '') { } if ($word_id) { - $sql = "UPDATE " . BB_WORDS . " + $sql = 'UPDATE ' . BB_WORDS . " SET word = '" . DB()->escape($word) . "', replacement = '" . DB()->escape($replacement) . "' WHERE word_id = $word_id"; $message = $lang['WORD_UPDATED']; } else { - $sql = "INSERT INTO " . BB_WORDS . " (word, replacement) + $sql = 'INSERT INTO ' . BB_WORDS . " (word, replacement) VALUES ('" . DB()->escape($word) . "', '" . DB()->escape($replacement) . "')"; $message = $lang['WORD_ADDED']; } @@ -104,7 +104,7 @@ if ($mode != '') { $word_id = (int)request_var('id', 0); if ($word_id) { - $sql = "DELETE FROM " . BB_WORDS . " WHERE word_id = $word_id"; + $sql = 'DELETE FROM ' . BB_WORDS . " WHERE word_id = $word_id"; if (!$result = DB()->sql_query($sql)) { bb_die('Could not remove data from words table'); @@ -118,7 +118,7 @@ if ($mode != '') { } } } else { - $sql = "SELECT * FROM " . BB_WORDS . " ORDER BY word"; + $sql = 'SELECT * FROM ' . BB_WORDS . ' ORDER BY word'; if (!$result = DB()->sql_query($sql)) { bb_die('Could not query words table #2'); } diff --git a/admin/index.php b/admin/index.php index c4c921187..1b11e942f 100644 --- a/admin/index.php +++ b/admin/index.php @@ -27,19 +27,22 @@ require __DIR__ . '/pagestart.php'; // Generate relevant output if (isset($_GET['pane']) && $_GET['pane'] == 'left') { - if (!$module = CACHE('bb_cache')->get('admin_module')) { - $dir = @opendir('.'); + $module = []; + if (!$module = CACHE('bb_cache')->get('admin_module_' . $user->id)) { + $dir = opendir('.'); $setmodules = 1; - while ($file = @readdir($dir)) { + while ($file = readdir($dir)) { if (preg_match('/^admin_.*?\.php$/', $file)) { - include('./' . $file); + include './' . $file; } } unset($setmodules); - @closedir($dir); - CACHE('bb_cache')->set('admin_module', $module, 600); + closedir($dir); + CACHE('bb_cache')->set('admin_module_' . $user->id, $module, 600); } + $module = CACHE('bb_cache')->get('admin_module_' . $user->id); + $template->assign_vars(array( 'TPL_ADMIN_NAVIGATE' => true, 'U_FORUM_INDEX' => '../index.php', @@ -74,8 +77,8 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') { } elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') { $template->assign_vars(array( 'TPL_ADMIN_MAIN' => true, - 'ADMIN_LOCK' => ($bb_cfg['board_disable']) ? true : false, - 'ADMIN_LOCK_CRON' => (file_exists(BB_DISABLED)) ? true : false, + 'ADMIN_LOCK' => $bb_cfg['board_disable'] ? true : false, + 'ADMIN_LOCK_CRON' => file_exists(BB_DISABLED) ? true : false, )); // Get forum statistics @@ -91,13 +94,13 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') { $avatar_dir_size = 0; - if ($avatar_dir = @opendir(BB_ROOT . $bb_cfg['avatar_path'])) { - while ($file = @readdir($avatar_dir)) { + if ($avatar_dir = opendir($bb_cfg['avatars']['upload_path'])) { + while ($file = readdir($avatar_dir)) { if ($file != '.' && $file != '..') { $avatar_dir_size += @filesize(BB_ROOT . $bb_cfg['avatar_path'] . '/' . $file); } } - @closedir($avatar_dir); + closedir($avatar_dir); $avatar_dir_size = humn_size($avatar_dir_size); } else { @@ -116,36 +119,6 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') { $users_per_day = $total_users; } - // DB size ... MySQL only - $sql = "SELECT VERSION() AS mysql_version"; - if ($result = DB()->sql_query($sql)) { - $row = DB()->sql_fetchrow($result); - $version = $row['mysql_version']; - - if (preg_match('/^(3\.23|4\.|5\.|10\.)/', $version)) { - $dblist = array(); - foreach ($bb_cfg['db'] as $name => $row) { - $sql = "SHOW TABLE STATUS FROM {$row[1]}"; - if ($result = DB()->sql_query($sql)) { - $tabledata_ary = DB()->sql_fetchrowset($result); - - $dbsize = 0; - for ($i = 0, $iMax = count($tabledata_ary); $i < $iMax; $i++) { - if (@$tabledata_ary[$i]['Type'] != 'MRG_MYISAM') { - $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length']; - } - } - $dblist[] = '' . humn_size($dbsize) . ''; - } - } - $dbsize = implode(' | ', $dblist); - } else { - $dbsize = $lang['NOT_AVAILABLE']; - } - } else { - $dbsize = $lang['NOT_AVAILABLE']; - } - $template->assign_vars(array( 'NUMBER_OF_POSTS' => $total_posts, 'NUMBER_OF_TOPICS' => $total_topics, @@ -155,33 +128,31 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') { 'TOPICS_PER_DAY' => $topics_per_day, 'USERS_PER_DAY' => $users_per_day, 'AVATAR_DIR_SIZE' => $avatar_dir_size, - 'DB_SIZE' => $dbsize, - 'GZIP_COMPRESSION' => ($bb_cfg['gzip_compress']) ? $lang['ON'] : $lang['OFF'], )); - if (@$_GET['users_online']) { + if (isset($_GET['users_online'])) { $template->assign_vars(array( 'SHOW_USERS_ONLINE' => true, )); // Get users online information. - $sql = "SELECT u.user_id, u.username, u.user_rank, s.session_time AS user_session_time, u.user_opt, s.session_logged_in, s.session_ip, s.session_start - FROM " . BB_USERS . " u, " . BB_SESSIONS . " s + $sql = 'SELECT u.user_id, u.username, u.user_rank, s.session_time AS user_session_time, u.user_opt, s.session_logged_in, s.session_ip, s.session_start + FROM ' . BB_USERS . ' u, ' . BB_SESSIONS . ' s WHERE s.session_logged_in = 1 AND u.user_id = s.session_user_id - AND u.user_id <> " . GUEST_UID . " - AND s.session_time >= " . (TIMENOW - 300) . " - ORDER BY s.session_ip ASC, s.session_time DESC"; + AND u.user_id <> ' . GUEST_UID . ' + AND s.session_time >= ' . (TIMENOW - 300) . ' + ORDER BY s.session_ip ASC, s.session_time DESC'; if (!$result = DB()->sql_query($sql)) { bb_die('Could not obtain reged user / online information'); } $onlinerow_reg = DB()->sql_fetchrowset($result); - $sql = "SELECT session_logged_in, session_time, session_ip, session_start - FROM " . BB_SESSIONS . " + $sql = 'SELECT session_logged_in, session_time, session_ip, session_start + FROM ' . BB_SESSIONS . ' WHERE session_logged_in = 0 - AND session_time >= " . (TIMENOW - 300) . " - ORDER BY session_ip ASC, session_time DESC"; + AND session_time >= ' . (TIMENOW - 300) . ' + ORDER BY session_ip ASC, session_time DESC'; if (!$result = DB()->sql_query($sql)) { bb_die('Could not obtain guest user / online information'); } @@ -259,14 +230,3 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') { } print_page('index.tpl', 'admin'); - -// Functions -function inarray($needle, $haystack) -{ - for ($i = 0, $iMax = count($haystack); $i < $iMax; $i++) { - if ($haystack[$i] == $needle) { - return true; - } - } - return false; -} diff --git a/admin/pagestart.php b/admin/pagestart.php index 2290522b0..141816b94 100644 --- a/admin/pagestart.php +++ b/admin/pagestart.php @@ -34,7 +34,7 @@ require_once INC_DIR . '/functions_admin.php'; $user->session_start(); if (IS_GUEST) { - redirect(LOGIN_URL . "?redirect=admin/index.php"); + redirect(LOGIN_URL . '?redirect=admin/index.php'); } if (!IS_ADMIN) { diff --git a/admin/stats/tr_stats.php b/admin/stats/tr_stats.php index 11c783fc4..a01fb8a00 100644 --- a/admin/stats/tr_stats.php +++ b/admin/stats/tr_stats.php @@ -25,7 +25,7 @@ define('IN_ADMIN', true); define('BB_ROOT', './../../'); -require(BB_ROOT . 'common.php'); +require BB_ROOT . 'common.php'; $user->session_start(); @@ -61,7 +61,7 @@ if ($l = sys('la')) { echo "\n\nloadavg: $l[0] $l[1] $l[2]\n\n"; } -echo 'gen time: ' . sprintf('%.3f', (array_sum(explode(' ', microtime())) - TIMESTART)) . " sec\n"; +echo 'gen time: ' . sprintf('%.3f', array_sum(explode(' ', microtime())) - TIMESTART) . " sec\n"; echo ''; echo ''; diff --git a/admin/stats/tracker.php b/admin/stats/tracker.php index ee20aa372..874044deb 100644 --- a/admin/stats/tracker.php +++ b/admin/stats/tracker.php @@ -25,7 +25,7 @@ define('IN_ADMIN', true); define('BB_ROOT', './../../'); -require(BB_ROOT . 'common.php'); +require BB_ROOT . 'common.php'; $user->session_start(); @@ -41,8 +41,8 @@ $stat = array(); define('TMP_TRACKER_TABLE', 'tmp_tracker'); -DB()->query(" - CREATE TEMPORARY TABLE " . TMP_TRACKER_TABLE . " ( +DB()->query(' + CREATE TEMPORARY TABLE ' . TMP_TRACKER_TABLE . " ( `topic_id` mediumint(8) unsigned NOT NULL default '0', `user_id` mediumint(9) NOT NULL default '0', `ip` char(8) binary NOT NULL default '0', @@ -53,37 +53,37 @@ DB()->query(" ) SELECT topic_id, user_id, ip, seeder, speed_up, speed_down, update_time - FROM " . BB_BT_TRACKER . " -"); + FROM " . BB_BT_TRACKER . ' +'); // Peers within announce interval -$stat += DB()->fetch_row("SELECT COUNT(*) AS p_within_ann FROM " . TMP_TRACKER_TABLE . " WHERE update_time >= " . (TIMENOW - $announce_interval)); +$stat += DB()->fetch_row('SELECT COUNT(*) AS p_within_ann FROM ' . TMP_TRACKER_TABLE . ' WHERE update_time >= ' . (TIMENOW - $announce_interval)); // All peers, "max_peer_time" -$stat += DB()->fetch_row("SELECT COUNT(*) AS p_all, SUM(speed_up) as speed_up, SUM(speed_down) as speed_down, UNIX_TIMESTAMP() - MIN(update_time) AS max_peer_time, UNIX_TIMESTAMP() - MAX(update_time) AS last_peer_time FROM " . TMP_TRACKER_TABLE); +$stat += DB()->fetch_row('SELECT COUNT(*) AS p_all, SUM(speed_up) as speed_up, SUM(speed_down) as speed_down, UNIX_TIMESTAMP() - MIN(update_time) AS max_peer_time, UNIX_TIMESTAMP() - MAX(update_time) AS last_peer_time FROM ' . TMP_TRACKER_TABLE); // Active users -$stat += DB()->fetch_row("SELECT COUNT(DISTINCT user_id) AS u_bt_active FROM " . TMP_TRACKER_TABLE); +$stat += DB()->fetch_row('SELECT COUNT(DISTINCT user_id) AS u_bt_active FROM ' . TMP_TRACKER_TABLE); // All bt-users -$stat += DB()->fetch_row("SELECT COUNT(*) AS u_bt_all FROM " . BB_BT_USERS); +$stat += DB()->fetch_row('SELECT COUNT(*) AS u_bt_all FROM ' . BB_BT_USERS); // All bb-users -$stat += DB()->fetch_row("SELECT COUNT(*) AS u_bb_all FROM " . BB_USERS); +$stat += DB()->fetch_row('SELECT COUNT(*) AS u_bb_all FROM ' . BB_USERS); // Active torrents -$stat += DB()->fetch_row("SELECT COUNT(DISTINCT topic_id) AS tor_active FROM " . TMP_TRACKER_TABLE); +$stat += DB()->fetch_row('SELECT COUNT(DISTINCT topic_id) AS tor_active FROM ' . TMP_TRACKER_TABLE); // With seeder -$stat += DB()->fetch_row("SELECT COUNT(DISTINCT topic_id) AS tor_with_seeder FROM " . TMP_TRACKER_TABLE . " WHERE seeder = 1"); +$stat += DB()->fetch_row('SELECT COUNT(DISTINCT topic_id) AS tor_with_seeder FROM ' . TMP_TRACKER_TABLE . ' WHERE seeder = 1'); // All torrents -$stat += DB()->fetch_row("SELECT COUNT(*) AS tor_all, SUM(size) AS torrents_size FROM " . BB_BT_TORRENTS); +$stat += DB()->fetch_row('SELECT COUNT(*) AS tor_all, SUM(size) AS torrents_size FROM ' . BB_BT_TORRENTS); // Last xx minutes $peers_in_last_min = array(); foreach ($peers_in_last_minutes as $t) { - $row = DB()->fetch_row(" - SELECT COUNT(*) AS peers FROM " . TMP_TRACKER_TABLE . " WHERE update_time >= " . (TIMENOW - 60 * $t) . " - "); + $row = DB()->fetch_row(' + SELECT COUNT(*) AS peers FROM ' . TMP_TRACKER_TABLE . ' WHERE update_time >= ' . (TIMENOW - 60 * $t) . ' + '); $peers_in_last_min[$t] = (int)$row['peers']; } // Last xx seconds $peers_in_last_sec = array(); -$rowset = DB()->fetch_rowset("SELECT COUNT(*) AS peers FROM " . TMP_TRACKER_TABLE . " GROUP BY update_time DESC LIMIT $peers_in_last_sec_limit"); +$rowset = DB()->fetch_rowset('SELECT COUNT(*) AS peers FROM ' . TMP_TRACKER_TABLE . " GROUP BY update_time DESC LIMIT $peers_in_last_sec_limit"); foreach ($rowset as $cnt => $row) { $peers_in_last_sec[] = sprintf('%3s', $row['peers']) . (($cnt && !(++$cnt % 15)) ? " \n" : ''); } @@ -118,14 +118,14 @@ echo "\n $stat[p_all] / $stat[p_within_ann]   - [ up: " . humn_size($stat['speed_up']) . "/s, - down: " . humn_size($stat['speed_down']) . "/s ] + [ up: " . humn_size($stat['speed_up']) . '/s, + down: ' . humn_size($stat['speed_down']) . "/s ] \n"; echo "\n peers: in last " . implode(' / ', $peers_in_last_minutes) . " min\n"; echo "\n" . implode(' / ', $peers_in_last_min) . "\n"; -echo "\n peers in last $peers_in_last_sec_limit sec
[ per second, DESC order --> ]
last peer: $stat[last_peer_time] seconds ago
" . date("j M H:i:s [T O]") . " \n"; +echo "\n peers in last $peers_in_last_sec_limit sec
[ per second, DESC order --> ]
last peer: $stat[last_peer_time] seconds ago
" . date('j M H:i:s [T O]') . " \n"; echo '
 ' . implode(' ', $peers_in_last_sec) . "
\n"; echo ''; echo '
';
@@ -138,10 +138,10 @@ if ($l = sys('la')) {
     echo "\n\nloadavg: $l[0] $l[1] $l[2]\n\n";
 }
 
-echo 'gen time: ' . sprintf('%.3f', (array_sum(explode(' ', microtime())) - TIMESTART)) . " sec\n";
+echo 'gen time: ' . sprintf('%.3f', array_sum(explode(' ', microtime())) - TIMESTART) . " sec\n";
 echo '
'; echo ''; -DB()->query("DROP TEMPORARY TABLE " . TMP_TRACKER_TABLE); +DB()->query('DROP TEMPORARY TABLE ' . TMP_TRACKER_TABLE); bb_exit(); diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index 51a887780..73d33b853 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -555,7 +555,6 @@ INSERT INTO `bb_config` VALUES ('network_news_forum_id', '2'); INSERT INTO `bb_config` VALUES ('whois_info', 'http://whatismyipaddress.com/ip/'); INSERT INTO `bb_config` VALUES ('show_mod_index', '0'); INSERT INTO `bb_config` VALUES ('premod', '0'); -INSERT INTO `bb_config` VALUES ('new_tpls', '1'); INSERT INTO `bb_config` VALUES ('tor_comment', '1'); INSERT INTO `bb_config` VALUES ('terms', ''); @@ -826,7 +825,6 @@ DROP TABLE IF EXISTS `bb_log`; CREATE TABLE IF NOT EXISTS `bb_log` ( `log_type_id` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0', `log_user_id` MEDIUMINT(9) NOT NULL DEFAULT '0', - `log_username` VARCHAR(25) NOT NULL DEFAULT '', `log_user_ip` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', diff --git a/install/upgrade/changes.txt b/install/upgrade/changes.txt index 2dcce6914..7e29fcff0 100644 --- a/install/upgrade/changes.txt +++ b/install/upgrade/changes.txt @@ -60,3 +60,5 @@ DELETE FROM `bb_smilies` WHERE `code` = ':ad:'; INSERT INTO `bb_smilies` VALUES ('', ':сd:', 'сd.gif', 'сd'); DROP TABLE IF EXISTS `bb_ads`; DELETE FROM `bb_config` WHERE `config_name` = 'active_ads'; +ALTER TABLE `bb_log` DROP COLUMN `log_username`; +DELETE FROM `bb_config` WHERE `config_name` = 'new_tpls'; diff --git a/library/language/source/main.php b/library/language/source/main.php index 535dcfd45..a1278101b 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -2575,7 +2575,7 @@ $lang['ACTS_LOG_FORUM'] = 'Forum'; $lang['ACTS_LOG_ACTION'] = 'Action'; $lang['ACTS_LOG_USER'] = 'User'; $lang['ACTS_LOG_LOGS_FROM'] = 'Logs from '; -$lang['ACTS_LOG_FIRST'] = 'first '; +$lang['ACTS_LOG_FIRST'] = 'beginning with'; $lang['ACTS_LOG_DAYS_BACK'] = 'days back'; $lang['ACTS_LOG_TOPIC_MATCH'] = 'Topic title match'; $lang['ACTS_LOG_SORT_BY'] = 'Sort by'; @@ -2585,6 +2585,7 @@ $lang['ACTS_LOG_TIME'] = 'Time'; $lang['ACTS_LOG_INFO'] = 'Info'; $lang['ACTS_LOG_FILTER'] = 'Filter'; $lang['ACTS_LOG_TOPICS'] = 'Topics:'; +$lang['ACTS_LOG_OR'] = 'or'; $lang['RELEASE'] = 'Release Templates'; $lang['RELEASES'] = 'Releases'; diff --git a/src/Legacy/LogAction.php b/src/Legacy/LogAction.php index fd75d2029..ee768ed1f 100644 --- a/src/Legacy/LogAction.php +++ b/src/Legacy/LogAction.php @@ -79,18 +79,15 @@ class LogAction if (!empty($userdata)) { $user_id = $userdata['user_id']; - $username = $userdata['username']; $session_ip = $userdata['session_ip']; } else { $user_id = ''; - $username = defined('IN_CRON') ? 'cron' : CLIENT_IP; $session_ip = ''; } $sql_ary = [ 'log_type_id' => (int)$this->log_type["$type_name"], 'log_user_id' => (int)$user_id, - 'log_username' => (string)$username, 'log_user_ip' => (string)$session_ip, 'log_forum_id' => (int)$forum_id, 'log_forum_id_new' => (int)$forum_id_new, diff --git a/styles/templates/admin/admin_board.tpl b/styles/templates/admin/admin_board.tpl index 4d613411a..64a0eac9c 100644 --- a/styles/templates/admin/admin_board.tpl +++ b/styles/templates/admin/admin_board.tpl @@ -217,13 +217,6 @@ - -

{L_DESIGNER}

- -    - - - {L_LATEST_NEWS} diff --git a/styles/templates/admin/admin_log.tpl b/styles/templates/admin/admin_log.tpl index 1c3e04320..2014d50d3 100644 --- a/styles/templates/admin/admin_log.tpl +++ b/styles/templates/admin/admin_log.tpl @@ -1,168 +1,193 @@
- + - - - - - - - - - - - - - -
{L_ACTS_LOG_SEARCH_OPTIONS}
- - - - - - -
-
- {L_ACTS_LOG_FORUM} -
-

{SEL_FORUM}

-
-
-
-
- {L_ACTS_LOG_ACTION} -
-

{SEL_LOG_TYPE}

-
-
-
-
- {L_ACTS_LOG_USER} -
-

{SEL_USERS}

-
-
-
-
- - - - - - -
-
- {L_ACTS_LOG_LOGS_FROM} ({L_ACTS_LOG_FIRST}{FIRST_LOG_TIME}) -
-

- - & - - {L_ACTS_LOG_DAYS_BACK} -

-
-
-
-
- {L_ACTS_LOG_TOPIC_MATCH} -
-

-
-
-
-
- {L_ACTS_LOG_SORT_BY} -
-

- - - -

-
-
-
-
- -
+ + + + + + + + + + + + + +
{L_ACTS_LOG_SEARCH_OPTIONS}
+ + + + + + +
+
+ {L_ACTS_LOG_FORUM} +
+

{SEL_FORUM}

+
+
+
+
+ {L_ACTS_LOG_ACTION} +
+

{SEL_LOG_TYPE}

+
+
+
+
+ {L_USER} +
+

{SEL_USERS}

+
+
+
+
+ + + + + + +
+
+ {L_ACTS_LOG_LOGS_FROM} ({L_ACTS_LOG_FIRST}: {FIRST_LOG_TIME}) +
+

+ + {L_ACTS_LOG_OR} + + {L_ACTS_LOG_DAYS_BACK} +

+
+
+
+
+ {L_ACTS_LOG_TOPIC_MATCH} +
+

+ +

+
+
+
+
+ {L_ACTS_LOG_SORT_BY} +
+

+ + +

+
+
+
+
+ +
-
+
- - - - - - - - - - - - - - - - - - - - - - - -
{L_ACTS_LOG_LOGS_ACTION}{L_ACTS_LOG_USERNAME}{L_ACTS_LOG_TIME}{L_ACTS_LOG_INFO}
{log.ACTION_DESC} - -
{log.USER_IP}
-
-
{log.TIME}
- -
- -
{log.MSG}
- - -
- {log.TOPIC_TITLE} - - - - - » - {log.TOPIC_TITLE_NEW} - - -
- - - - -
{L_NO_MATCH}
+ + + + + + + + + + + + + + + + + + + + + + + +
{L_ACTS_LOG_LOGS_ACTION}{L_ACTS_LOG_USERNAME}{L_ACTS_LOG_TIME}{L_ACTS_LOG_INFO}
{log.ACTION_DESC} + +
{log.USER_IP}
+
+
{log.TIME}
+ +
+ +
{log.MSG}
+ + + + + + + +
{L_NO_MATCH}
+
+
- - -
- + + +
+
@@ -170,42 +195,43 @@ table.log_filters td {
-{L_ACTS_LOG_FILTER} - - - - - + {L_ACTS_LOG_FILTER} +
-

{L_FORUMS}:

-
- -

{forums.FORUM_NAME}

- -
-
+ + + + - - - + + + - - - + + + -
+

{L_FORUMS}:

+
+ +

{forums.FORUM_NAME}

+ +
+
-

{L_ACTS_LOG_TOPICS}

-
- -

{topics.TOPIC_TITLE}

- -
-
+

{L_ACTS_LOG_TOPICS}

+
+ +

{topics.TOPIC_TITLE}

+ +
+
-

{L_ACTS_LOG_USER}:

-
- -

{users.USERNAME}

- -
-
+

{L_USER}:

+
+ +

{users.USERNAME}

+ +
+
+ +
diff --git a/styles/templates/admin/index.tpl b/styles/templates/admin/index.tpl index 88e485d80..94db04210 100644 --- a/styles/templates/admin/index.tpl +++ b/styles/templates/admin/index.tpl @@ -3,14 +3,15 @@ - - - {L_ADMIN} + + + + {L_ADMIN} - - + + @@ -20,32 +21,42 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +
{L_ADMIN}
{L_ADMIN_INDEX}
{L_MAIN_INDEX}
{catrow.ADMIN_CATEGORY}
{catrow.modulerow.ADMIN_MODULE}
{L_ADMIN}
{L_ADMIN_INDEX}
{L_MAIN_INDEX}
{catrow.ADMIN_CATEGORY}
{catrow.modulerow.ADMIN_MODULE}
@@ -54,166 +65,165 @@ table.forumline { margin: 0 auto; } -
+
-

{L_ADMIN_DISABLE_CRON_TITLE}


- {L_ADMIN_UNLOCK_CRON} - ({L_ADMIN_DISABLE_CRON}) +

{L_ADMIN_DISABLE_CRON_TITLE}

+
+ {L_ADMIN_UNLOCK_CRON} + ({L_ADMIN_DISABLE_CRON})
-

{L_ADMIN_DISABLE_TITLE}


- {L_ADMIN_UNLOCK} - ({L_ADMIN_DISABLE}) +

{L_ADMIN_DISABLE_TITLE}

+
+ {L_ADMIN_UNLOCK} + ({L_ADMIN_DISABLE})
- - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +
{L_CLEAR_CACHE}: - {L_DATASTORE},  - {L_ALL_CACHE},  - {L_TEMPLATES} -
{L_UPDATE}: - {L_USER_LEVELS} - {L_INDEXER} -
{L_SYNCHRONIZE}: - {L_TOPICS},  - {L_USER_POSTS_COUNT} -
{L_STATISTICS}: - tr_stats.php,  - tracker.php -
{L_ADMIN}: - {L_CREATE_PROFILE} -
{L_CLEAR_CACHE}: + {L_DATASTORE},  + {L_ALL_CACHE},  + {L_TEMPLATES} +
{L_UPDATE}: + {L_USER_LEVELS} + ,  + {L_INDEXER} + +
{L_SYNCHRONIZE}: + {L_TOPICS},  + {L_USER_POSTS_COUNT} +
{L_STATISTICS}: + tr_stats.php,  + tracker.php +
{L_ADMIN}: + {L_CREATE_PROFILE} +
-
+
- - - - - - - - - - - + + + + + + + + + + +
{L_VERSION_INFORMATION}
{L_TP_VERSION}:{$bb_cfg['tp_release_codename']} ({$bb_cfg['tp_version']})
{L_TP_RELEASE_DATE}:{$bb_cfg['tp_release_date']}
{L_VERSION_INFORMATION}
{L_TP_VERSION}:{$bb_cfg['tp_release_codename']} ({$bb_cfg['tp_version']})
{L_TP_RELEASE_DATE}:{$bb_cfg['tp_release_date']}
-
+

{L_FORUM_STATS}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{L_STATISTIC}{L_VALUE}{L_STATISTIC}{L_VALUE}
{L_NUMBER_POSTS}:{NUMBER_OF_POSTS}{L_POSTS_PER_DAY}:{POSTS_PER_DAY}
{L_NUMBER_TOPICS}:{NUMBER_OF_TOPICS}{L_TOPICS_PER_DAY}:{TOPICS_PER_DAY}
{L_NUMBER_USERS}:{NUMBER_OF_USERS}{L_USERS_PER_DAY}:{USERS_PER_DAY}
{L_BOARD_STARTED}:{START_DATE}{L_AVATAR_DIR_SIZE}:{AVATAR_DIR_SIZE}
{L_DATABASE_SIZE}:{DB_SIZE}{L_GZIP_COMPRESSION}:{GZIP_COMPRESSION}
{L_STATISTIC}{L_VALUE}{L_STATISTIC}{L_VALUE}
{L_NUMBER_POSTS}:{NUMBER_OF_POSTS}{L_POSTS_PER_DAY}:{POSTS_PER_DAY}
{L_NUMBER_TOPICS}:{NUMBER_OF_TOPICS}{L_TOPICS_PER_DAY}:{TOPICS_PER_DAY}
{L_NUMBER_USERS}:{NUMBER_OF_USERS}{L_USERS_PER_DAY}:{USERS_PER_DAY}
{L_BOARD_STARTED}:{START_DATE}{L_AVATAR_DIR_SIZE}:{AVATAR_DIR_SIZE}
-
+

{L_WHOSONLINE}

- - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
{L_USERNAME}{L_LOGIN} / {L_LAST_UPDATED}{L_IP_ADDRESS}
{reg_user_row.USER}{reg_user_row.STARTED}-{reg_user_row.LASTUPDATE}{reg_user_row.IP_ADDRESS}
.
{L_GUEST}{guest_user_row.STARTED}-{guest_user_row.LASTUPDATE}{guest_user_row.IP_ADDRESS}
{L_USERNAME}{L_LOGIN} / {L_LAST_UPDATED}{L_IP_ADDRESS}
{reg_user_row.USER}{reg_user_row.STARTED}-{reg_user_row.LASTUPDATE}{reg_user_row.IP_ADDRESS} +
.
{L_GUEST}{guest_user_row.STARTED}-{guest_user_row.LASTUPDATE}{guest_user_row.IP_ADDRESS}
{L_SHOW_ONLINE_USERLIST} diff --git a/styles/templates/default/viewforum.tpl b/styles/templates/default/viewforum.tpl index ef6c679a3..3821e36ba 100644 --- a/styles/templates/default/viewforum.tpl +++ b/styles/templates/default/viewforum.tpl @@ -638,19 +638,16 @@ td.topic_id { cursor: pointer; }

{L_MARK_TOPICS_READ}

-

{L_AUTOCLEAN} {PRUNE_DAYS} {L_DAYS}{L_DISABLED}

+

{L_AUTOCLEAN}: {PRUNE_DAYS} {L_DAYS}{L_DISABLED}

-
-{L_ADMIN}:  - -{L_DESIGNER}  ·  - -{L_FORUM_LOGS}  ·  -{L_EDIT}  ·  -{L_PERMISSIONS}  ·  -{L_DELETE} +
{L_ADMIN}: + {L_DESIGNER} · + {L_FORUM_LOGS} · + {L_EDIT} · + {L_PERMISSIONS} · + {L_DELETE}