mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 21:33:54 -07:00
Minor improvements (#1125)
* Minor improvements * Updated * Updated * Updated * Update viewtopic.php * Update viewtopic.php * Update viewtopic.php * Update CHANGELOG.md
This commit is contained in:
parent
3a7d7bd097
commit
9ebe3a4d5c
17 changed files with 58 additions and 59 deletions
|
@ -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)
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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']));
|
||||
|
|
|
@ -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']) {
|
||||
|
|
|
@ -42,7 +42,7 @@ switch ($mode) {
|
|||
if ($err = \TorrentPier\Validate::password($pass, $pass_confirm)) {
|
||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . $err . '</span>';
|
||||
} 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 = '<img src="./styles/images/good.gif"> <span class="seedmed bold">' . $text . '</span>';
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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']),
|
||||
|
||||
|
|
|
@ -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'],
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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']) {
|
||||
|
|
|
@ -246,20 +246,15 @@ ajax.callback.index_data = function(data) {
|
|||
<tr>
|
||||
<th>{L_ICQ}:</th>
|
||||
<td class="tLeft med" id="user_icq">
|
||||
<span class="editable">{ICQ}
|
||||
<a href="http://www.icq.com/people/{ICQ}"><img align="middle" src="http://web.icq.com/whitepages/online?icq={ICQ}&img=5"></a>
|
||||
</span>
|
||||
<span class="editable">{ICQ}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF SKYPE -->
|
||||
<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
|
||||
<tr>
|
||||
<th>{L_SKYPE}:</th>
|
||||
<td class="tLeft med" id="user_skype">
|
||||
<span class="editable">{SKYPE}
|
||||
<a href="skype:{SKYPE}"><img align="middle" src="http://mystatus.skype.com/smallicon/{SKYPE}" width="16" height="16"></a>
|
||||
</span>
|
||||
<span class="editable">{SKYPE}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
|
|
14
tracker.php
14
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') . ' <b>·</b> ' . 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'],
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -427,7 +427,7 @@ if ($can_watch_topic) {
|
|||
$s_watching_topic_img = (isset($images['topic_un_watch'])) ? "<a href=\"" . TOPIC_URL . "$topic_id&unwatch=topic&start=$start&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_un_watch'] . '" alt="' . $lang['STOP_WATCHING_TOPIC'] . '" title="' . $lang['STOP_WATCHING_TOPIC'] . '" border="0"></a>' : '';
|
||||
} else {
|
||||
$s_watching_topic = "<a href=\"" . TOPIC_URL . $topic_id . "&watch=topic&start=$start&sid=" . $userdata['session_id'] . '">' . $lang['START_WATCHING_TOPIC'] . '</a>';
|
||||
$s_watching_topic_img = (isset($images['Topic_watch'])) ? "<a href=\"" . TOPIC_URL . "$topic_id&watch=topic&start=$start&sid=" . $userdata['session_id'] . '"><img src="' . $images['Topic_watch'] . '" alt="' . $lang['START_WATCHING_TOPIC'] . '" title="' . $lang['START_WATCHING_TOPIC'] . '" border="0"></a>' : '';
|
||||
$s_watching_topic_img = (isset($images['topic_watch'])) ? "<a href=\"" . TOPIC_URL . "$topic_id&watch=topic&start=$start&sid=" . $userdata['session_id'] . '"><img src="' . $images['Topic_watch'] . '" alt="' . $lang['START_WATCHING_TOPIC'] . '" title="' . $lang['START_WATCHING_TOPIC'] . '" border="0"></a>' : '';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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']) ? '<a href="search.php?search_author=1&uid=' . $poster_id . '" target="_blank">' . $poster_posts . '</a>' : '',
|
||||
'POSTER_FROM' => ($bb_cfg['show_poster_from']) ? wbr($poster_from) : '',
|
||||
'POSTER_BOT' => ($poster_id == BOT_UID),
|
||||
'POSTER_POSTS' => $bb_cfg['show_poster_posts'] ? '<a href="search.php?search_author=1&uid=' . $poster_id . '" target="_blank">' . $poster_posts . '</a>' : '',
|
||||
'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'];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue