mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Some improvements for Ban functionality (#1262)
* Some improvements for Ban functionality * Updated * Updated * Update functions.php * Updated * Update viewprofile.php * Update viewtopic.php * Updated * Updated * Updated * Updated * Update mysql.sql * Updated * Updated
This commit is contained in:
parent
d090678e14
commit
7beb4afa72
18 changed files with 83 additions and 272 deletions
|
@ -317,15 +317,13 @@ if ($t_data['topic_show_first_post'] && $start) {
|
|||
u.user_opt, u.user_gender, u.user_birthday,
|
||||
p.*, g.group_name, g.group_description, g.group_id, g.group_signature, g.avatar_ext_id as rg_avatar_id,
|
||||
u2.username as mc_username, u2.user_rank as mc_user_rank,
|
||||
h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text,
|
||||
ban.ban_userid
|
||||
h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text
|
||||
FROM " . BB_POSTS . " p
|
||||
LEFT JOIN " . BB_USERS . " u ON(u.user_id = p.poster_id)
|
||||
LEFT JOIN " . BB_POSTS_TEXT . " pt ON(pt.post_id = p.post_id)
|
||||
LEFT JOIN " . BB_POSTS_HTML . " h ON(h.post_id = p.post_id)
|
||||
LEFT JOIN " . BB_USERS . " u2 ON(u2.user_id = p.mc_user_id)
|
||||
LEFT JOIN " . BB_GROUPS . " g ON(g.group_id = p.poster_rg_id)
|
||||
LEFT JOIN " . BB_BANLIST . " ban ON(ban.ban_userid = u.user_id)
|
||||
WHERE
|
||||
p.post_id = {$t_data['topic_first_post_id']}
|
||||
LIMIT 1
|
||||
|
@ -340,15 +338,13 @@ $sql = "
|
|||
u.user_opt, u.user_gender, u.user_birthday,
|
||||
p.*, g.group_name, g.group_description, g.group_id, g.group_signature, g.avatar_ext_id as rg_avatar_id,
|
||||
u2.username as mc_username, u2.user_rank as mc_user_rank,
|
||||
h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text,
|
||||
ban.ban_userid
|
||||
h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text
|
||||
FROM " . BB_POSTS . " p
|
||||
LEFT JOIN " . BB_USERS . " u ON(u.user_id = p.poster_id)
|
||||
LEFT JOIN " . BB_POSTS_TEXT . " pt ON(pt.post_id = p.post_id)
|
||||
LEFT JOIN " . BB_POSTS_HTML . " h ON(h.post_id = p.post_id)
|
||||
LEFT JOIN " . BB_USERS . " u2 ON(u2.user_id = p.mc_user_id)
|
||||
LEFT JOIN " . BB_GROUPS . " g ON(g.group_id = p.poster_rg_id)
|
||||
LEFT JOIN " . BB_BANLIST . " ban ON(ban.ban_userid = u.user_id)
|
||||
WHERE p.topic_id = $topic_id
|
||||
$limit_posts_time
|
||||
GROUP BY p.post_id
|
||||
|
@ -595,7 +591,6 @@ for ($i = 0; $i < $total_posts; $i++) {
|
|||
|
||||
$poster_rank = $rank_image = '';
|
||||
$user_rank = $postrow[$i]['user_rank'];
|
||||
$user_ban_status = $postrow[$i]['ban_userid'];
|
||||
if (!$user->opt_js['h_rnk_i'] and isset($ranks[$user_rank])) {
|
||||
$rank_image = ($bb_cfg['show_rank_image'] && $ranks[$user_rank]['rank_image']) ? '<img src="' . $ranks[$user_rank]['rank_image'] . '" alt="" title="" border="0" />' : '';
|
||||
$poster_rank = $bb_cfg['show_rank_text'] ? $ranks[$user_rank]['rank_title'] : '';
|
||||
|
@ -694,7 +689,6 @@ for ($i = 0; $i < $total_posts; $i++) {
|
|||
'POSTER_NAME_JS' => addslashes($poster),
|
||||
'POSTER_RANK' => $poster_rank,
|
||||
'RANK_IMAGE' => $rank_image,
|
||||
'POSTER_BANNED' => $user_ban_status,
|
||||
'POSTER_JOINED' => $bb_cfg['show_poster_joined'] ? $poster_longevity : '',
|
||||
|
||||
'POSTER_JOINED_DATE' => $poster_joined,
|
||||
|
@ -741,6 +735,14 @@ for ($i = 0; $i < $total_posts; $i++) {
|
|||
'RG_SIG_ATTACH' => $postrow[$i]['attach_rg_sig']
|
||||
]);
|
||||
|
||||
// Ban information
|
||||
if ($banInfo = getUserBanInfo($poster_id)) {
|
||||
$template->assign_block_vars('postrow.ban', [
|
||||
'IS_BANNED' => true,
|
||||
'BAN_REASON' => $banInfo['ban_reason']
|
||||
]);
|
||||
}
|
||||
|
||||
if (isset($postrow[$i]['post_attachment']) && $is_auth['auth_download'] && function_exists('display_post_attachments')) {
|
||||
display_post_attachments($post_id, $postrow[$i]['post_attachment']);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue