diff --git a/CHANGELOG.md b/CHANGELOG.md index 212346939..1d0d5ed4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ - Translations for config.php, raised scrape interval [\#1100](https://github.com/torrentpier/torrentpier/pull/1100) ([kovalensky](https://github.com/kovalensky)) - Don't re-announce for hybrids if the event is "stopped" [\#1099](https://github.com/torrentpier/torrentpier/pull/1099) ([kovalensky](https://github.com/kovalensky)) - Security measures [\#1098](https://github.com/torrentpier/torrentpier/pull/1098), [\#1113](https://github.com/torrentpier/torrentpier/pull/1113) ([kovalensky](https://github.com/kovalensky), [belomaxorka](https://github.com/belomaxorka)) -- Minor improvements [\#1121](https://github.com/torrentpier/torrentpier/pull/1121), [\#1122](https://github.com/torrentpier/torrentpier/pull/1122), [\#1123](https://github.com/torrentpier/torrentpier/pull/1123) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#1121](https://github.com/torrentpier/torrentpier/pull/1121), [\#1122](https://github.com/torrentpier/torrentpier/pull/1122), [\#1123](https://github.com/torrentpier/torrentpier/pull/1123), [\#1125](https://github.com/torrentpier/torrentpier/pull/1125) ([belomaxorka](https://github.com/belomaxorka)) - New Crowdin updates [\#1097](https://github.com/torrentpier/torrentpier/pull/1097), [\#1101](https://github.com/torrentpier/torrentpier/pull/1101) ([Exileum](https://github.com/Exileum)) ## [v2.4.0-beta4](https://github.com/torrentpier/torrentpier/tree/v2.4.0-beta4) (2023-11-14) diff --git a/group_edit.php b/group_edit.php index 3b3cdaf18..681415157 100644 --- a/group_edit.php +++ b/group_edit.php @@ -44,7 +44,7 @@ if ($is_moderator) { bb_die(implode($upload->errors)); } - DB()->query("UPDATE " . BB_GROUPS . " SET avatar_ext_id = $avatar_ext_id WHERE group_id = $group_id"); + DB()->query("UPDATE " . BB_GROUPS . " SET avatar_ext_id = $avatar_ext_id WHERE group_id = $group_id LIMIT 1"); } } diff --git a/library/ajax/avatar.php b/library/ajax/avatar.php index 4040bf9cc..49c2fc4db 100644 --- a/library/ajax/avatar.php +++ b/library/ajax/avatar.php @@ -36,7 +36,7 @@ switch ($mode) { $this->ajax_die('Invalid mode'); } -DB()->query("UPDATE " . BB_USERS . " SET avatar_ext_id = $new_ext_id WHERE user_id = $user_id"); +DB()->query("UPDATE " . BB_USERS . " SET avatar_ext_id = $new_ext_id WHERE user_id = $user_id LIMIT 1"); \TorrentPier\Sessions::cache_rm_user_sessions($user_id); diff --git a/library/ajax/callseed.php b/library/ajax/callseed.php index a9279f6f5..dc929c686 100644 --- a/library/ajax/callseed.php +++ b/library/ajax/callseed.php @@ -65,7 +65,7 @@ if ($user_list) { send_pm($t_data['poster_id'], $subject, $message, BOT_UID); } -DB()->query("UPDATE " . BB_BT_TORRENTS . " SET call_seed_time = " . TIMENOW . " WHERE topic_id = $topic_id"); +DB()->query("UPDATE " . BB_BT_TORRENTS . " SET call_seed_time = " . TIMENOW . " WHERE topic_id = $topic_id LIMIT 1"); function topic_info($topic_id) { diff --git a/library/ajax/change_user_opt.php b/library/ajax/change_user_opt.php index 76d0969bd..3c6ae7064 100644 --- a/library/ajax/change_user_opt.php +++ b/library/ajax/change_user_opt.php @@ -30,7 +30,7 @@ foreach ($bf['user_opt'] as $opt_name => $opt_bit) { } } -DB()->query("UPDATE " . BB_USERS . " SET user_opt = {$u_data['user_opt']} WHERE user_id = $user_id"); +DB()->query("UPDATE " . BB_USERS . " SET user_opt = {$u_data['user_opt']} WHERE user_id = $user_id LIMIT 1"); // Удаляем данные из кеша \TorrentPier\Sessions::cache_rm_user_sessions($user_id); diff --git a/library/ajax/mod_action.php b/library/ajax/mod_action.php index 7c1b52521..7ae4292e3 100644 --- a/library/ajax/mod_action.php +++ b/library/ajax/mod_action.php @@ -55,7 +55,7 @@ switch ($mode) { $topic_title_sql = DB()->escape($new_title); - DB()->query("UPDATE " . BB_TOPICS . " SET topic_title = '$topic_title_sql' WHERE topic_id = $topic_id"); + DB()->query("UPDATE " . BB_TOPICS . " SET topic_title = '$topic_title_sql' WHERE topic_id = $topic_id LIMIT 1"); // Обновление кеша новостей на главной $news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id'])); diff --git a/library/ajax/posts.php b/library/ajax/posts.php index 8d5b80535..15612e9c4 100644 --- a/library/ajax/posts.php +++ b/library/ajax/posts.php @@ -135,9 +135,9 @@ switch ($this->request['type']) { $this->ajax_die(sprintf($lang['MAX_SMILIES_PER_POST'], $bb_cfg['max_smilies'])); } } - DB()->query("UPDATE " . BB_POSTS_TEXT . " SET post_text = '" . DB()->escape($text) . "' WHERE post_id = $post_id"); + DB()->query("UPDATE " . BB_POSTS_TEXT . " SET post_text = '" . DB()->escape($text) . "' WHERE post_id = $post_id LIMIT 1"); if ($post['topic_last_post_id'] != $post['post_id'] && $userdata['user_id'] == $post['poster_id']) { - DB()->query("UPDATE " . BB_POSTS . " SET post_edit_time = '" . TIMENOW . "', post_edit_count = post_edit_count + 1 WHERE post_id = $post_id"); + DB()->query("UPDATE " . BB_POSTS . " SET post_edit_time = '" . TIMENOW . "', post_edit_count = post_edit_count + 1 WHERE post_id = $post_id LIMIT 1"); } $s_text = str_replace('\n', "\n", $text); $s_topic_title = str_replace('\n', "\n", $post['topic_title']); @@ -229,7 +229,7 @@ switch ($this->request['type']) { $message = prepare_message($message); // Flood control - $where_sql = (IS_GUEST) ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}"; + $where_sql = IS_GUEST ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}"; $sql = "SELECT MAX(p.post_time) AS last_post_time FROM " . BB_POSTS . " p WHERE $where_sql"; if ($row = DB()->fetch_row($sql) and $row['last_post_time']) { diff --git a/library/ajax/user_register.php b/library/ajax/user_register.php index 1baba2474..964d63159 100644 --- a/library/ajax/user_register.php +++ b/library/ajax/user_register.php @@ -42,7 +42,7 @@ switch ($mode) { if ($err = \TorrentPier\Validate::password($pass, $pass_confirm)) { $html = ' ' . $err . ''; } else { - $text = (IS_GUEST) ? $lang['CHOOSE_PASS_REG_OK'] : $lang['CHOOSE_PASS_OK']; + $text = IS_GUEST ? $lang['CHOOSE_PASS_REG_OK'] : $lang['CHOOSE_PASS_OK']; $html = ' ' . $text . ''; } break; diff --git a/library/includes/functions.php b/library/includes/functions.php index a265810f6..ac4f9bf22 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -1025,7 +1025,7 @@ function make_jumpbox() $jumpbox = $datastore->get('jumpbox'); } - $template->assign_vars(['JUMPBOX' => (IS_GUEST) ? DB()->escape($jumpbox['guest']) : DB()->escape($jumpbox['user'])]); + $template->assign_vars(['JUMPBOX' => IS_GUEST ? DB()->escape($jumpbox['guest']) : DB()->escape($jumpbox['user'])]); } // $mode: array(not_auth_forum1,not_auth_forum2,..) or (string) 'mode' diff --git a/library/includes/page_header.php b/library/includes/page_header.php index 46be0facd..078d81614 100644 --- a/library/includes/page_header.php +++ b/library/includes/page_header.php @@ -119,7 +119,7 @@ $template->assign_vars([ 'USER_LANG' => $userdata['user_lang'], 'INCLUDE_BBCODE_JS' => !empty($page_cfg['include_bbcode_js']), - 'USER_OPTIONS_JS' => (IS_GUEST) ? '{}' : json_encode($user->opt_js, JSON_THROW_ON_ERROR), + 'USER_OPTIONS_JS' => IS_GUEST ? '{}' : json_encode($user->opt_js, JSON_THROW_ON_ERROR), 'USE_TABLESORTER' => !empty($page_cfg['use_tablesorter']), diff --git a/search.php b/search.php index a08438f8b..602ab7e09 100644 --- a/search.php +++ b/search.php @@ -90,7 +90,7 @@ $url = basename(__FILE__); $anon_id = GUEST_UID; $user_id = $userdata['user_id']; -$lastvisit = (IS_GUEST) ? TIMENOW : $userdata['user_lastvisit']; +$lastvisit = IS_GUEST ? TIMENOW : $userdata['user_lastvisit']; $search_id = (isset($_GET['id']) && verify_id($_GET['id'], SEARCH_ID_LENGTH)) ? $_GET['id'] : ''; $session_id = $userdata['session_id']; @@ -800,11 +800,11 @@ else { 'FORUM_ID' => $forum_id, 'FORUM_NAME' => $forum_name_html[$forum_id], 'TOPIC_ID' => $topic_id, - 'HREF_TOPIC_ID' => ($moved) ? $topic['topic_moved_id'] : $topic['topic_id'], + 'HREF_TOPIC_ID' => $moved ? $topic['topic_moved_id'] : $topic['topic_id'], 'TOPIC_TITLE' => wbr($topic['topic_title']), 'IS_UNREAD' => $is_unread, 'TOPIC_ICON' => get_topic_icon($topic, $is_unread), - 'PAGINATION' => ($moved) ? '' : build_topic_pagination(TOPIC_URL . $topic_id, $topic['topic_replies'], $bb_cfg['posts_per_page']), + 'PAGINATION' => $moved ? '' : build_topic_pagination(TOPIC_URL . $topic_id, $topic['topic_replies'], $bb_cfg['posts_per_page']), 'REPLIES' => $topic['topic_replies'], 'ATTACH' => $topic['topic_attachment'], 'STATUS' => $topic['topic_status'], diff --git a/src/Legacy/Post.php b/src/Legacy/Post.php index 9a9662d5c..4f2725c78 100644 --- a/src/Legacy/Post.php +++ b/src/Legacy/Post.php @@ -101,7 +101,7 @@ class Post // Flood control $row = null; - $where_sql = (IS_GUEST) ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}"; + $where_sql = IS_GUEST ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}"; if ($mode == 'newtopic' || $mode == 'reply') { $sql = "SELECT MAX(p.post_time) AS last_post_time FROM " . BB_POSTS . " p WHERE $where_sql"; diff --git a/src/Legacy/Torrent.php b/src/Legacy/Torrent.php index f43bd1f7c..a52048c66 100644 --- a/src/Legacy/Torrent.php +++ b/src/Legacy/Torrent.php @@ -645,7 +645,7 @@ class Torrent } } else { // Update exists passkey - DB()->query("UPDATE IGNORE " . BB_BT_USERS . " SET auth_key = '$passkey_val' WHERE user_id = $user_id"); + DB()->query("UPDATE IGNORE " . BB_BT_USERS . " SET auth_key = '$passkey_val' WHERE user_id = $user_id LIMIT 1"); if (DB()->affected_rows() == 1) { // Ocelot if ($bb_cfg['ocelot']['enabled']) { diff --git a/styles/templates/default/usercp_viewprofile.tpl b/styles/templates/default/usercp_viewprofile.tpl index a44008ac3..8e61e1357 100644 --- a/styles/templates/default/usercp_viewprofile.tpl +++ b/styles/templates/default/usercp_viewprofile.tpl @@ -246,20 +246,15 @@ ajax.callback.index_data = function(data) { {L_ICQ}: - {ICQ} - - + {ICQ} - {L_SKYPE}: - {SKYPE} - - + {SKYPE} diff --git a/tracker.php b/tracker.php index db548cb56..d6210362a 100644 --- a/tracker.php +++ b/tracker.php @@ -704,8 +704,8 @@ if ($allowed_forums) { $size = $tor['size']; $tor_magnet = create_magnet($tor['info_hash'], $tor['info_hash_v2'], \TorrentPier\Legacy\Torrent::getPasskey($user_id), html_ent_decode($tor['topic_title'])); $compl = $tor['complete_count']; - $dl_sp = ($dl) ? humn_size($dl, 0, 'KB') . '/s' : '0 KB/s'; - $ul_sp = ($ul) ? humn_size($ul, 0, 'KB') . '/s' : '0 KB/s'; + $dl_sp = $dl ? humn_size($dl, 0, 'KB') . '/s' : '0 KB/s'; + $ul_sp = $ul ? humn_size($ul, 0, 'KB') . '/s' : '0 KB/s'; $dl_class = isset($tor['dl_status']) ? $dl_link_css[$tor['dl_status']] : 'genmed'; $row_class = !($row_num & 1) ? $row_class_1 : $row_class_2; @@ -717,15 +717,15 @@ if ($allowed_forums) { $template->assign_block_vars('tor', array( 'CAT_ID' => $cat_id, - 'CAT_TITLE' => ($cat_id) ? $cat_title_html[$cat_id] : '', + 'CAT_TITLE' => $cat_id ? $cat_title_html[$cat_id] : '', 'FORUM_ID' => $forum_id, - 'FORUM_NAME' => ($forum_id) ? $forum_name_html[$forum_id] : '', + 'FORUM_NAME' => $forum_id ? $forum_name_html[$forum_id] : '', 'TOPIC_ID' => $tor['topic_id'], 'TOPIC_TITLE' => wbr($tor['topic_title']), 'TOPIC_TIME' => bb_date($tor['topic_time'], 'd-M-y') . ' · ' . delta_time($tor['topic_time']), 'POST_ID' => $tor['post_id'], 'POSTER_ID' => $poster_id, - 'USERNAME' => ($hide_author) ? '' : profile_url(array('username' => $tor['username'], 'user_rank' => $tor['user_rank'])), + 'USERNAME' => $hide_author ? '' : profile_url(array('username' => $tor['username'], 'user_rank' => $tor['user_rank'])), 'ROW_CLASS' => $row_class, 'ROW_NUM' => $row_num, @@ -737,7 +737,7 @@ if ($allowed_forums) { 'MAGNET' => $tor_magnet, 'TOR_TYPE' => is_gold($tor['tor_type']), - 'TOR_FROZEN' => (!IS_AM) ? isset($bb_cfg['tor_frozen'][$tor['tor_status']]) : '', + 'TOR_FROZEN' => !IS_AM ? isset($bb_cfg['tor_frozen'][$tor['tor_status']]) : '', 'TOR_STATUS_ICON' => $bb_cfg['tor_icons'][$tor['tor_status']], 'TOR_STATUS_TEXT' => $lang['TOR_STATUS_NAME'][$tor['tor_status']], @@ -746,7 +746,7 @@ if ($allowed_forums) { 'UL_SPEED' => $ul_sp, 'DL_SPEED' => $dl_sp, 'SEEDS' => $seeds ?: 0, - 'SEEDS_TITLE' => ($seeds) ? $lang['SEEDERS'] : ($lang['SEED_NOT_SEEN'] . ":\n " . (($s_last) ? bb_date($s_last, $date_format) : $lang['NEVER'])), + 'SEEDS_TITLE' => $seeds ? $lang['SEEDERS'] : ($lang['SEED_NOT_SEEN'] . ":\n " . (($s_last) ? bb_date($s_last, $date_format) : $lang['NEVER'])), 'LEECHS' => $leechs ?: 0, 'COMPLETED' => $compl ?: 0, 'REPLIES' => $tor['topic_replies'], diff --git a/viewforum.php b/viewforum.php index d274c5afa..19bd53d4c 100644 --- a/viewforum.php +++ b/viewforum.php @@ -33,7 +33,7 @@ $anon = GUEST_UID; // Start session $user->session_start(); -$lastvisit = (IS_GUEST) ? TIMENOW : $userdata['user_lastvisit']; +$lastvisit = IS_GUEST ? TIMENOW : $userdata['user_lastvisit']; // Caching output $req_page = "forum_f{$forum_id}"; @@ -440,12 +440,12 @@ foreach ($topic_rowset as $topic) { $template->assign_block_vars('t', [ 'FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, - 'HREF_TOPIC_ID' => ($moved) ? $topic['topic_moved_id'] : $topic['topic_id'], + 'HREF_TOPIC_ID' => $moved ? $topic['topic_moved_id'] : $topic['topic_id'], 'TOPIC_TITLE' => wbr($topic['topic_title']), 'TOPICS_SEPARATOR' => $separator, 'IS_UNREAD' => $is_unread, 'TOPIC_ICON' => get_topic_icon($topic, $is_unread), - 'PAGINATION' => ($moved) ? '' : build_topic_pagination(TOPIC_URL . $topic_id, $replies, $bb_cfg['posts_per_page']), + 'PAGINATION' => $moved ? '' : build_topic_pagination(TOPIC_URL . $topic_id, $replies, $bb_cfg['posts_per_page']), 'REPLIES' => $replies, 'VIEWS' => $topic['topic_views'], 'TOR_STALED' => ($forum_data['allow_reg_tracker'] && !($t_type == POST_ANNOUNCE || $t_type == POST_STICKY || $topic['tor_size'])), @@ -485,14 +485,14 @@ foreach ($topic_rowset as $topic) { unset($topic_rowset); $pg_url = FORUM_URL . $forum_id; -$pg_url .= ($sort_value) ? "&sort=$sort_value" : ''; -$pg_url .= ($order_value) ? "&order=$order_value" : ''; +$pg_url .= $sort_value ? "&sort=$sort_value" : ''; +$pg_url .= $order_value ? "&order=$order_value" : ''; $template->assign_var('MOD_URL', $pg_url); $pg_url = FORUM_URL . $forum_id; -$pg_url .= ($topic_days) ? "&topicdays=$topic_days" : ''; -$pg_url .= ($sort_value) ? "&sort=$sort_value" : ''; -$pg_url .= ($order_value) ? "&order=$order_value" : ''; -$pg_url .= ($moderation) ? "&mod=1" : ''; +$pg_url .= $topic_days ? "&topicdays=$topic_days" : ''; +$pg_url .= $sort_value ? "&sort=$sort_value" : ''; +$pg_url .= $order_value ? "&order=$order_value" : ''; +$pg_url .= $moderation ? "&mod=1" : ''; $pg_url .= ($topics_per_page != $bb_cfg['topics_per_page']) ? "&tpp=$topics_per_page" : ''; if ($found_topics) { diff --git a/viewtopic.php b/viewtopic.php index 4454754dc..a2642974f 100644 --- a/viewtopic.php +++ b/viewtopic.php @@ -427,7 +427,7 @@ if ($can_watch_topic) { $s_watching_topic_img = (isset($images['topic_un_watch'])) ? "' . $lang['STOP_WATCHING_TOPIC'] . '' : ''; } else { $s_watching_topic = "' . $lang['START_WATCHING_TOPIC'] . ''; - $s_watching_topic_img = (isset($images['Topic_watch'])) ? "' . $lang['START_WATCHING_TOPIC'] . '' : ''; + $s_watching_topic_img = (isset($images['topic_watch'])) ? "' . $lang['START_WATCHING_TOPIC'] . '' : ''; } } @@ -565,13 +565,16 @@ $prev_post_time = $max_post_time = 0; for ($i = 0; $i < $total_posts; $i++) { $poster_id = $postrow[$i]['user_id']; - $poster = ($poster_id == GUEST_UID) ? $lang['GUEST'] : $postrow[$i]['username']; + $poster_guest = ($poster_id == GUEST_UID); + $poster_bot = ($poster_id == BOT_UID); + $poster = $poster_guest ? $lang['GUEST'] : $postrow[$i]['username']; + $post_date = bb_date($postrow[$i]['post_time'], $bb_cfg['post_date_format']); $max_post_time = max($max_post_time, $postrow[$i]['post_time']); - $poster_posts = ($poster_id != GUEST_UID) ? $postrow[$i]['user_posts'] : ''; - $poster_from = ($postrow[$i]['user_from'] && $poster_id != GUEST_UID) ? $postrow[$i]['user_from'] : ''; - $poster_joined = ($poster_id != GUEST_UID) ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], 'Y-m-d H:i') : ''; - $poster_longevity = ($poster_id != GUEST_UID) ? delta_time($postrow[$i]['user_regdate']) : ''; + $poster_posts = !$poster_guest ? $postrow[$i]['user_posts'] : ''; + $poster_from = ($postrow[$i]['user_from'] && !$poster_guest) ? $postrow[$i]['user_from'] : ''; + $poster_joined = !$poster_guest ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], 'Y-m-d H:i') : ''; + $poster_longevity = !$poster_guest ? delta_time($postrow[$i]['user_regdate']) : ''; $post_id = $postrow[$i]['post_id']; $mc_type = $postrow[$i]['mc_type']; $mc_comment = $postrow[$i]['mc_comment']; @@ -584,7 +587,7 @@ for ($i = 0; $i < $total_posts; $i++) { $rg_signature = $postrow[$i]['group_signature'] ? bbcode2html(htmlCHR($postrow[$i]['group_signature'])) : ''; $poster_avatar = ''; - if (!$user->opt_js['h_av'] && $poster_id != GUEST_UID) { + if (!$user->opt_js['h_av'] && !$poster_guest) { $poster_avatar = get_avatar($poster_id, $postrow[$i]['avatar_ext_id'], !bf($postrow[$i]['user_opt'], 'user_opt', 'dis_avatar')); } @@ -596,19 +599,19 @@ for ($i = 0; $i < $total_posts; $i++) { } // Handle anon users posting with usernames - if ($poster_id == GUEST_UID && $postrow[$i]['post_username'] != '') { + if ($poster_guest && !empty($postrow[$i]['post_username'])) { $poster = $postrow[$i]['post_username']; } // Buttons $pm_btn = $profile_btn = $delpost_btn = $edit_btn = $ip_btn = $quote_btn = ''; - if ($poster_id != GUEST_UID) { + if (!$poster_guest) { $profile_btn = true; $pm_btn = true; } - if ($poster_id != BOT_UID) { + if (!$poster_bot) { $quote_btn = true; $edit_btn = (($userdata['user_id'] == $poster_id && $is_auth['auth_edit']) || $is_auth['auth_mod']); $ip_btn = ($is_auth['auth_mod'] || IS_MOD); @@ -698,16 +701,17 @@ for ($i = 0; $i < $total_posts; $i++) { 'POSTER_NAME_JS' => addslashes($poster), 'POSTER_RANK' => $poster_rank, 'RANK_IMAGE' => $rank_image, - 'POSTER_JOINED' => ($bb_cfg['show_poster_joined']) ? $poster_longevity : '', + 'POSTER_JOINED' => $bb_cfg['show_poster_joined'] ? $poster_longevity : '', 'POSTER_JOINED_DATE' => $poster_joined, - 'POSTER_POSTS' => ($bb_cfg['show_poster_posts']) ? '' . $poster_posts . '' : '', - 'POSTER_FROM' => ($bb_cfg['show_poster_from']) ? wbr($poster_from) : '', - 'POSTER_BOT' => ($poster_id == BOT_UID), + 'POSTER_POSTS' => $bb_cfg['show_poster_posts'] ? '' . $poster_posts . '' : '', + 'POSTER_FROM' => $bb_cfg['show_poster_from'] ? wbr($poster_from) : '', + 'POSTER_BOT' => $poster_bot, + 'POSTER_GUEST' => $poster_guest, 'POSTER_ID' => $poster_id, 'POSTER_AUTHOR' => ($poster_id == $t_data['topic_poster']), - 'POSTER_GENDER' => ($bb_cfg['gender']) ? gender_image($postrow[$i]['user_gender']) : '', - 'POSTED_AFTER' => ($prev_post_time) ? delta_time($postrow[$i]['post_time'], $prev_post_time) : '', + 'POSTER_GENDER' => $bb_cfg['gender'] ? gender_image($postrow[$i]['user_gender']) : '', + 'POSTED_AFTER' => $prev_post_time ? delta_time($postrow[$i]['post_time'], $prev_post_time) : '', 'IS_UNREAD' => is_unread($postrow[$i]['post_time'], $topic_id, $forum_id), 'IS_FIRST_POST' => (!$start && $is_first_post), 'MOD_CHECKBOX' => ($moderation && ($start || defined('SPLIT_FORM_START'))), @@ -728,8 +732,8 @@ for ($i = 0; $i < $total_posts; $i++) { 'POSTER_BIRTHDAY' => user_birthday_icon($postrow[$i]['user_birthday'], $postrow[$i]['user_id']), - 'MC_COMMENT' => ($mc_type) ? bbcode2html($mc_comment) : '', - 'MC_BBCODE' => ($mc_type) ? $mc_comment : '', + 'MC_COMMENT' => $mc_type ? bbcode2html($mc_comment) : '', + 'MC_BBCODE' => $mc_type ? $mc_comment : '', 'MC_CLASS' => $mc_class, 'MC_TITLE' => sprintf($lang['MC_COMMENT'][$mc_type]['title'], $mc_user_id), 'MC_SELECT_TYPE' => build_select("mc_type_$post_id", array_flip($mc_select_type), $mc_type), @@ -751,7 +755,7 @@ for ($i = 0; $i < $total_posts; $i++) { define('SPLIT_FORM_START', true); } - if ($poster_id != BOT_UID) { + if (!$poster_bot) { $prev_post_time = $postrow[$i]['post_time']; } }