diff options
-rw-r--r-- | phpBB/includes/functions_posting.php | 33 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/posting_topic_review.html | 4 |
2 files changed, 36 insertions, 1 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 48d30a9341..3a2004396c 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -924,7 +924,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id } $sql_ary = array( - 'SELECT' => 'u.username, u.user_id, u.user_colour, p.*, z.friend, z.foe', + 'SELECT' => 'u.username, u.user_id, u.user_colour, p.*, z.friend, z.foe, uu.username as post_delete_username, uu.user_colour as post_delete_user_colour', 'FROM' => array( USERS_TABLE => 'u', @@ -936,6 +936,10 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id 'FROM' => array(ZEBRA_TABLE => 'z'), 'ON' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id', ), + array( + 'FROM' => array(USERS_TABLE => 'uu'), + 'ON' => 'uu.user_id = p.post_delete_user', + ), ), 'WHERE' => $db->sql_in_set('p.post_id', $post_list) . ' @@ -1042,6 +1046,31 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id $post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id']; $u_show_post = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, "f=$forum_id&t=$topic_id&p={$row['post_id']}&view=show#p{$row['post_id']}"); + $l_deleted_message = ''; + if ($row['post_visibility'] == ITEM_DELETED) + { + $display_postername = get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']); + + // User having deleted the post also being the post author? + if (!$row['post_delete_user'] || $row['post_delete_user'] == $poster_id) + { + $display_username = $display_postername; + } + else + { + $display_username = get_username_string('full', $row['post_delete_user'], $row['post_delete_username'], $row['post_delete_user_colour']); + } + + if ($row['post_delete_reason']) + { + $l_deleted_message = $user->lang('POST_DELETED_BY_REASON', $display_postername, $display_username, $user->format_date($row['post_delete_time'], false, true), $row['post_delete_reason']); + } + else + { + $l_deleted_message = $user->lang('POST_DELETED_BY', $display_postername, $display_username, $user->format_date($row['post_delete_time'], false, true)); + } + } + $post_row = array( 'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), @@ -1052,6 +1081,8 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id 'S_FRIEND' => ($row['friend']) ? true : false, 'S_IGNORE_POST' => ($row['foe']) ? true : false, 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"phpbb.toggleDisplay('{$post_anchor}', 1); return false;\">", '</a>') : '', + 'S_POST_DELETED' => ($row['post_visibility'] == ITEM_DELETED) ? true : false, + 'L_DELETE_POST' => $l_deleted_message, 'POST_SUBJECT' => $post_subject, 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']), diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html index 3d7856d27a..857c686774 100644 --- a/phpBB/styles/prosilver/template/posting_topic_review.html +++ b/phpBB/styles/prosilver/template/posting_topic_review.html @@ -16,6 +16,10 @@ <div class="post bg3 post-ignore"> <div class="inner"> {topic_review_row.L_IGNORE_POST} + <!-- ELSE IF topic_review_row.S_POST_DELETED --> + <div class="post bg3 post-ignore"> + <div class="inner"> + {topic_review_row.L_DELETE_POST} <!-- ELSE --> <div class="post <!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF topic_review_row.POST_ID == REPORTED_POST_ID --> reported<!-- ENDIF -->"> <div class="inner"> |