diff --git a/admin/admin_attach_cp.php b/admin/admin_attach_cp.php index 6e32a7d17..abbcf1515 100644 --- a/admin/admin_attach_cp.php +++ b/admin/admin_attach_cp.php @@ -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 = ''; @@ -461,7 +461,7 @@ if ($view === 'attachments') { '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, diff --git a/admin/admin_attachments.php b/admin/admin_attachments.php index f230138a9..e18719a94 100644 --- a/admin/admin_attachments.php +++ b/admin/admin_attachments.php @@ -30,7 +30,7 @@ if (!empty($setmodules)) { $module['ATTACHMENTS']['QUOTA_LIMITS'] = $filename . '?mode=quota'; return; } -require('./pagestart.php'); +require './pagestart.php'; $error = false; @@ -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; @@ -408,7 +408,7 @@ if ($submit && $mode == 'quota') { 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'); } } @@ -437,7 +437,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 @@ -469,7 +469,7 @@ if ($submit && $mode == 'quota') { $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'); } } diff --git a/admin/admin_board.php b/admin/admin_board.php index f08178dd9..88cf2eb1a 100644 --- a/admin/admin_board.php +++ b/admin/admin_board.php @@ -138,8 +138,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'], @@ -151,12 +151,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 3502dff46..9151de72f 100644 --- a/admin/admin_bt_forum_cfg.php +++ b/admin/admin_bt_forum_cfg.php @@ -132,11 +132,11 @@ foreach ($db_fields_bool as $field_name => $field_def_val) { foreach ($rowset as $rid => $forum) { foreach ($db_fields_bool as $field_name => $field_def_val) { $forum_name = $forum['forum_name']; - $selected = ($forum[$field_name]) ? ' selected="selected"' : ''; + $selected = $forum[$field_name] ? ' selected="selected"' : ''; $forum_name = str_short($forum_name, $max_forum_name_len); - $$field_name .= '\n"; + $$field_name .= '\n"; } } diff --git a/admin/admin_cron.php b/admin/admin_cron.php index 8fff900c9..acabaf568 100644 --- a/admin/admin_cron.php +++ b/admin/admin_cron.php @@ -38,7 +38,7 @@ $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 { @@ -67,7 +67,7 @@ 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'], )); diff --git a/admin/admin_disallow.php b/admin/admin_disallow.php index 36695ec6c..1c2ee09ce 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']); @@ -54,7 +54,7 @@ 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"; $result = DB()->sql_query($sql); diff --git a/admin/admin_extensions.php b/admin/admin_extensions.php index 63ed1420a..7f10dd9f0 100644 --- a/admin/admin_extensions.php +++ b/admin/admin_extensions.php @@ -29,7 +29,7 @@ if (!empty($setmodules)) { $module['ATTACHMENTS']['EXTENSION_GROUP_MANAGE'] = $filename . '?mode=groups'; return; } -require('./pagestart.php'); +require './pagestart.php'; function update_attach_extensions() { @@ -57,7 +57,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(); @@ -132,7 +132,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( @@ -259,7 +259,7 @@ if ($submit && $mode == 'groups') { } for ($i = 0; $i < count($group_change_list); $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]); @@ -275,7 +275,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'); } } @@ -312,8 +312,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 @@ -354,7 +354,7 @@ 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'); } } @@ -383,7 +383,7 @@ if ($mode == 'groups') { $template->assign_vars(array( 'TPL_ATTACH_EXTENSION_GROUPS' => true, - 'ADD_GROUP_NAME' => (isset($submit)) ? @$extension_group : '', + 'ADD_GROUP_NAME' => isset($submit) ? @$extension_group : '', 'MAX_FILESIZE' => $max_add_filesize, 'S_FILESIZE' => size_select('add_size_select', $size), 'S_ADD_DOWNLOAD_MODE' => download_select('add_download_mode'), @@ -458,8 +458,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 = ''; diff --git a/admin/admin_forum_prune.php b/admin/admin_forum_prune.php index 51c3a172f..50b39adf2 100644 --- a/admin/admin_forum_prune.php +++ b/admin/admin_forum_prune.php @@ -27,7 +27,7 @@ if (!empty($setmodules)) { $module['FORUMS']['PRUNE'] = basename(__FILE__); return; } -require('./pagestart.php'); +require './pagestart.php'; $all_forums = -1; $pruned_total = 0; diff --git a/admin/admin_forumauth.php b/admin/admin_forumauth.php index c54490b8b..aed6b63d8 100644 --- a/admin/admin_forumauth.php +++ b/admin/admin_forumauth.php @@ -27,7 +27,7 @@ if (!empty($setmodules)) { $module['FORUMS']['PERMISSIONS'] = basename(__FILE__); return; } -require('./pagestart.php'); +require './pagestart.php'; $forum_auth_fields = array( 'auth_view', @@ -226,9 +226,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 d43b6d22e..b6dbfcc99 100644 --- a/admin/admin_forumauth_list.php +++ b/admin/admin_forumauth_list.php @@ -27,7 +27,7 @@ if (!empty($setmodules)) { $module['FORUMS']['PERMISSIONS_LIST'] = basename(__FILE__); return; } -require('./pagestart.php'); +require './pagestart.php'; // View Read Post Reply Edit Delete Sticky Announce Vote Poll PostAttach Download $simple_auth_ary = array( @@ -81,7 +81,7 @@ $forum_auth_levels = array('ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN'); $forum_auth_const = array(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); @@ -89,7 +89,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); @@ -227,7 +227,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'], )); @@ -286,7 +286,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 dad2fe48d..7e2e62cfc 100644 --- a/admin/admin_forums.php +++ b/admin/admin_forums.php @@ -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); @@ -250,7 +250,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_order = (int)$_POST['forum_display_order']; $forum_display_sort = (int)$_POST['forum_display_sort']; @@ -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) { @@ -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); @@ -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); @@ -750,7 +750,7 @@ if (!$mode || $show_main_page) { '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'], @@ -758,8 +758,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", @@ -859,7 +859,7 @@ function get_list($mode, $id, $select) $catlist .= '\n'; } - return ($catlist); + return $catlist; } function renumber_order($mode, $cat = 0) @@ -1052,8 +1052,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 .= ''; diff --git a/admin/admin_groups.php b/admin/admin_groups.php index 74cd18a95..20204eaa2 100644 --- a/admin/admin_groups.php +++ b/admin/admin_groups.php @@ -82,7 +82,7 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) { '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, + 'RELEASE_GROUP' => $group_info['release_group'] ? true : false, 'S_GROUP_ACTION' => "admin_groups.php", 'S_HIDDEN_FIELDS' => $s_hidden_fields, )); diff --git a/admin/admin_log.php b/admin/admin_log.php index 36f09a744..dbedebda5 100644 --- a/admin/admin_log.php +++ b/admin/admin_log.php @@ -27,7 +27,7 @@ if (!empty($setmodules)) { $module['USERS']['ACTIONS_LOG'] = basename(__FILE__); return; } -require('./pagestart.php'); +require './pagestart.php'; $datastore->enqueue(array( 'moderators', @@ -145,7 +145,7 @@ $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 @@ -202,19 +202,19 @@ $from = "FROM " . BB_LOG; $where = " WHERE log_time BETWEEN $time_start_val AND $time_end_val "; -$where .= ($type_csv) ? " +$where .= $type_csv ? " AND log_type_id IN($type_csv) " : ''; -$where .= ($user_csv) ? " +$where .= $user_csv ? " AND log_user_id IN($user_csv) " : ''; -$where .= ($forum_csv) ? " +$where .= $forum_csv ? " AND log_forum_id IN($forum_csv) " : ''; -$where .= ($topic_csv) ? " +$where .= $topic_csv ? " AND log_topic_id IN($topic_csv) " : ''; -$where .= ($title_match_sql) ? " +$where .= $title_match_sql ? " AND MATCH (log_topic_title) AGAINST ('$title_match_sql' IN BOOLEAN MODE) " : ''; @@ -355,7 +355,7 @@ if ($log_rowset) { } $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']), @@ -379,7 +379,7 @@ $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, diff --git a/admin/admin_mass_email.php b/admin/admin_mass_email.php index c25b5902b..e987b5ef2 100644 --- a/admin/admin_mass_email.php +++ b/admin/admin_mass_email.php @@ -27,7 +27,7 @@ if (!empty($setmodules)) { $module['MODS']['MASS_EMAIL'] = basename(__FILE__); return; } -require('./pagestart.php'); +require './pagestart.php'; @set_time_limit(1200); @@ -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_phpinfo.php b/admin/admin_phpinfo.php index f2a86a541..0761714fb 100644 --- a/admin/admin_phpinfo.php +++ b/admin/admin_phpinfo.php @@ -27,6 +27,6 @@ if (!empty($setmodules)) { $module['GENERAL']['PHP_INFO'] = basename(__FILE__); return; } -require('./pagestart.php'); +require './pagestart.php'; phpinfo(); diff --git a/admin/admin_ranks.php b/admin/admin_ranks.php index d5510668f..c046fcea8 100644 --- a/admin/admin_ranks.php +++ b/admin/admin_ranks.php @@ -27,7 +27,7 @@ if (!empty($setmodules)) { $module['USERS']['RANKS'] = basename(__FILE__); return; } -require('./pagestart.php'); +require './pagestart.php'; $_POST['special_rank'] = 1; $_POST['min_posts'] = -1; @@ -52,7 +52,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 = ''; @@ -83,7 +83,7 @@ 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']) ? '' : '', @@ -96,12 +96,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']); @@ -159,7 +159,7 @@ 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; } @@ -213,13 +213,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..83ca87d67 100644 --- a/admin/admin_rebuild_search.php +++ b/admin/admin_rebuild_search.php @@ -237,7 +237,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 @@ -383,7 +383,7 @@ if ($mode == 'submit' || $mode == 'refresh') { // 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()); diff --git a/admin/admin_smilies.php b/admin/admin_smilies.php index a8e463168..f1fcf5642 100644 --- a/admin/admin_smilies.php +++ b/admin/admin_smilies.php @@ -27,7 +27,7 @@ if (!empty($setmodules)) { $module['GENERAL']['SMILIES'] = basename(__FILE__); return; } -require('./pagestart.php'); +require './pagestart.php'; // Check to see what mode we should operate in if (isset($_POST['mode']) || isset($_GET['mode'])) { 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 3c38f1771..a454e0793 100644 --- a/admin/admin_ug_auth.php +++ b/admin/admin_ug_auth.php @@ -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, )); } } @@ -346,11 +346,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 +364,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 +374,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, )); } } diff --git a/admin/admin_user_ban.php b/admin/admin_user_ban.php index 85bfee439..cef1b212a 100644 --- a/admin/admin_user_ban.php +++ b/admin/admin_user_ban.php @@ -27,7 +27,7 @@ if (!empty($setmodules)) { $module['USERS']['BAN_MANAGEMENT'] = basename(__FILE__); return; } -require('./pagestart.php'); +require './pagestart.php'; if (isset($_POST['submit'])) { $user_bansql = ''; diff --git a/admin/admin_user_search.php b/admin/admin_user_search.php index 1d8029885..d4f4955fb 100644 --- a/admin/admin_user_search.php +++ b/admin/admin_user_search.php @@ -94,7 +94,7 @@ if (!isset($_REQUEST['dosearch'])) { $last_cat_id = $row['cat_id']; } - $forums_list .= ''; + $forums_list .= ''; } } @@ -888,7 +888,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; @@ -915,7 +915,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 = ''; @@ -980,8 +980,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 9fea045f7..6bf2f8196 100644 --- a/admin/admin_words.php +++ b/admin/admin_words.php @@ -27,7 +27,7 @@ if (!empty($setmodules)) { $module['GENERAL']['WORD_CENSOR'] = basename(__FILE__); return; } -require('./pagestart.php'); +require './pagestart.php'; if (!$bb_cfg['use_word_censor']) { bb_die('Word censor disabled

($bb_cfg[\'use_word_censor\'] in config.php)'); diff --git a/admin/index.php b/admin/index.php index 375c91e97..f054ccd35 100644 --- a/admin/index.php +++ b/admin/index.php @@ -23,7 +23,7 @@ * SOFTWARE. */ -require('./pagestart.php'); +require './pagestart.php'; // Generate relevant output if (isset($_GET['pane']) && $_GET['pane'] == 'left') { @@ -32,7 +32,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') { $setmodules = 1; while ($file = @readdir($dir)) { if (preg_match('/^admin_.*?\.php$/', $file)) { - include('./' . $file); + include './' . $file; } } unset($setmodules); @@ -74,8 +74,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 @@ -156,7 +156,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') { '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'], + 'GZIP_COMPRESSION' => $bb_cfg['gzip_compress'] ? $lang['ON'] : $lang['OFF'], )); if (@$_GET['users_online']) { diff --git a/admin/stats/tr_stats.php b/admin/stats/tr_stats.php index e3c4c093f..214baf40c 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(); @@ -64,7 +64,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 a3e2ec78d..02ab827d7 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(); @@ -149,7 +149,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/bt/announce.php b/bt/announce.php index d357f284d..6178c32c0 100644 --- a/bt/announce.php +++ b/bt/announce.php @@ -189,7 +189,7 @@ function msg_die($msg) // Start announcer define('TR_ROOT', './'); -require(TR_ROOT . 'includes/init_tr.php'); +require TR_ROOT . 'includes/init_tr.php'; $seeder = ($left == 0) ? 1 : 0; $stopped = ($event === 'stopped'); @@ -340,7 +340,7 @@ if ($tr_cfg['gold_silver_enabled'] && $down_add) { // Insert/update peer info $peer_info_updated = false; -$update_time = ($stopped) ? 0 : TIMENOW; +$update_time = $stopped ? 0 : TIMENOW; if ($lp_info) { $sql = "UPDATE " . BB_BT_TRACKER . " SET update_time = $update_time"; @@ -354,8 +354,8 @@ if ($lp_info) { $sql .= ($downloaded != $lp_info['downloaded']) ? ", downloaded = $downloaded" : ''; $sql .= ", remain = $left"; - $sql .= ($up_add) ? ", up_add = up_add + $up_add" : ''; - $sql .= ($down_add) ? ", down_add = down_add + $down_add" : ''; + $sql .= $up_add ? ", up_add = up_add + $up_add" : ''; + $sql .= $down_add ? ", down_add = down_add + $down_add" : ''; $sql .= ", speed_up = $speed_up"; $sql .= ", speed_down = $speed_down"; diff --git a/bt/scrape.php b/bt/scrape.php index d30a6dac9..f33301ec8 100644 --- a/bt/scrape.php +++ b/bt/scrape.php @@ -60,7 +60,7 @@ function msg_die($msg) } define('TR_ROOT', './'); -require(TR_ROOT . 'includes/init_tr.php'); +require TR_ROOT . 'includes/init_tr.php'; $info_hash_sql = rtrim(DB()->escape($info_hash), ' '); diff --git a/common.php b/common.php index 4258d95eb..50a17c7b2 100644 --- a/common.php +++ b/common.php @@ -63,14 +63,14 @@ require_once __DIR__ . '/vendor/autoload.php'; // Get initial config require __DIR__ . '/library/config.php'; -$server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://'; -$server_port = (in_array($bb_cfg['server_port'], array(80, 443), true)) ? '' : ':' . $bb_cfg['server_port']; +$server_protocol = $bb_cfg['cookie_secure'] ? 'https://' : 'http://'; +$server_port = in_array($bb_cfg['server_port'], array(80, 443), true) ? '' : ':' . $bb_cfg['server_port']; define('FORUM_PATH', $bb_cfg['script_path']); define('FULL_URL', $server_protocol . $bb_cfg['server_name'] . $server_port . $bb_cfg['script_path']); unset($server_protocol, $server_port); // Debug options -define('DBG_USER', (isset($_COOKIE[COOKIE_DBG]))); +define('DBG_USER', isset($_COOKIE[COOKIE_DBG])); // Board/Tracker shared constants and functions define('BB_BT_TORRENTS', 'bb_bt_torrents'); @@ -201,7 +201,7 @@ function short_query($sql, $esc_html = false) } } - return ($esc_html) ? htmlCHR($sql, true) : $sql; + return $esc_html ? htmlCHR($sql, true) : $sql; } // Functions @@ -215,7 +215,7 @@ function bb_log($msg, $file_name) if (is_array($msg)) { $msg = implode(LOG_LF, $msg); } - $file_name .= (LOG_EXT) ? '.' . LOG_EXT : ''; + $file_name .= LOG_EXT ? '.' . LOG_EXT : ''; return file_write($msg, LOG_DIR . '/' . $file_name); } @@ -451,7 +451,7 @@ function log_request($file = '', $prepend_str = false, $add_post = true) { global $user; - $file = ($file) ?: 'req/' . date('m-d'); + $file = $file ?: 'req/' . date('m-d'); $str = array(); $str[] = date('m-d H:i:s'); if ($prepend_str !== false) { diff --git a/dl_list.php b/dl_list.php index 48706c0d5..56ac14414 100644 --- a/dl_list.php +++ b/dl_list.php @@ -57,10 +57,10 @@ $full_url = isset($_POST['full_url']) ? str_replace('&', '&', htmlspecialcha if (isset($_POST['redirect_type']) && $_POST['redirect_type'] == 'search') { $redirect_type = "search.php"; - $redirect = ($full_url) ?: "$dl_key=1"; + $redirect = $full_url ?: "$dl_key=1"; } else { $redirect_type = (!$topic_id) ? "viewforum.php" : "viewtopic.php"; - $redirect = ($full_url) ?: ((!$topic_id) ? POST_FORUM_URL . "=$forum_id" : POST_TOPIC_URL . "=$topic_id"); + $redirect = $full_url ?: ((!$topic_id) ? POST_FORUM_URL . "=$forum_id" : POST_TOPIC_URL . "=$topic_id"); } // Start session management diff --git a/group.php b/group.php index 2990c3ec1..fa25f0f8f 100644 --- a/group.php +++ b/group.php @@ -42,19 +42,19 @@ function generate_user_info(&$row, $group_mod, &$from, &$posts, &$joined, &$pm, $from = (!empty($row['user_from'])) ? $row['user_from'] : ''; $joined = bb_date($row['user_regdate']); $user_time = (!empty($row['user_time'])) ? bb_date($row['user_time']) : $lang['NONE']; - $posts = ($row['user_posts']) ?: 0; - $pm = ($bb_cfg['text_buttons']) ? '' . $lang['SEND_PM_TXTB'] . '' : '' . $lang['SEND_PRIVATE_MESSAGE'] . ''; + $posts = $row['user_posts'] ?: 0; + $pm = $bb_cfg['text_buttons'] ? '' . $lang['SEND_PM_TXTB'] . '' : '' . $lang['SEND_PRIVATE_MESSAGE'] . ''; $avatar = get_avatar($row['user_id'], $row['avatar_ext_id'], !bf($row['user_opt'], 'user_opt', 'dis_avatar'), '', 50, 50); if (bf($row['user_opt'], 'user_opt', 'user_viewemail') || $group_mod) { - $email_uri = ($bb_cfg['board_email_form']) ? ("profile.php?mode=email&" . POST_USERS_URL . "=" . $row['user_id']) : 'mailto:' . $row['user_email']; + $email_uri = $bb_cfg['board_email_form'] ? ("profile.php?mode=email&" . POST_USERS_URL . "=" . $row['user_id']) : 'mailto:' . $row['user_email']; $email = '' . $row['user_email'] . ''; } else { $email = ''; } if ($row['user_website']) { - $www = ($bb_cfg['text_buttons']) ? '' . $lang['VISIT_WEBSITE_TXTB'] . '' : '' . $lang['VISIT_WEBSITE'] . ''; + $www = $bb_cfg['text_buttons'] ? '' . $lang['VISIT_WEBSITE_TXTB'] . '' : '' . $lang['VISIT_WEBSITE'] . ''; } else { $www = ''; } @@ -136,7 +136,7 @@ if (!$group_id) { continue; } - $data = array('id' => $row['group_id'], 'm' => ($row['members'] - $row['candidates']), 'c' => $row['candidates'], 'rg' => $row['release_group']); + $data = array('id' => $row['group_id'], 'm' => $row['members'] - $row['candidates'], 'c' => $row['candidates'], 'rg' => $row['release_group']); $groups[$type][$row['group_name']] = $data; } @@ -149,11 +149,11 @@ if (!$group_id) { foreach ($params as $name => $data) { $text = htmlCHR(str_short(rtrim($name), HTML_SELECT_MAX_LENGTH)); - $members = ($data['m']) ? $lang['MEMBERS_IN_GROUP'] . ': ' . $data['m'] : $lang['NO_GROUP_MEMBERS']; - $candidates = ($data['c']) ? $lang['PENDING_MEMBERS'] . ': ' . $data['c'] : $lang['NO_PENDING_GROUP_MEMBERS']; + $members = $data['m'] ? $lang['MEMBERS_IN_GROUP'] . ': ' . $data['m'] : $lang['NO_GROUP_MEMBERS']; + $candidates = $data['c'] ? $lang['PENDING_MEMBERS'] . ': ' . $data['c'] : $lang['NO_PENDING_GROUP_MEMBERS']; $options .= '
  • ' . $text . '
  • '; - $options .= ($data['rg']) ? '