Browse Source

! When showing the reported posts, show which board they're in at the same time.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 năm trước cách đây
mục cha
commit
4e806d924e
2 tập tin đã thay đổi với 24 bổ sung1 xóa
  1. 23 0
      Sources/ModerationCenter.php
  2. 1 1
      Themes/default/ModerationCenter.template.php

+ 23 - 0
Sources/ModerationCenter.php

@@ -697,6 +697,29 @@ function ReportedPosts()
 	}
 	$smcFunc['db_free_result']($request);
 
+	// Get the names of boards those topics are in. Slightly faster this way.
+	if (!empty($report_boards_ids))
+	{
+		$report_boards_ids = array_unique($report_boards_ids);
+		$board_names = array();
+		$request = $smcFunc['db_query']('', '
+			SELECT id_board, name
+			FROM {db_prefix}boards
+			WHERE id_board IN ({array_int:boards})',
+			array(
+				'boards' => $report_boards_ids,
+			)
+		);
+
+		while ($row = $smcFunc['db_fetch_assoc']($request))
+			$board_names[$row['id_board']] = $row['name'];
+		$smcFunc['db_free_result']($request);
+
+		foreach ($context['reports'] as $id_report => $report)
+			if (!empty($board_names[$report['topic']['id_board']]))
+				$context['reports'][$id_report]['topic']['board_name'] = $board_names[$report['topic']['id_board']];
+	}
+
 	// Now get all the people who reported it.
 	if (!empty($report_ids))
 	{

+ 1 - 1
Themes/default/ModerationCenter.template.php

@@ -224,7 +224,7 @@ function template_reported_posts()
 		<div class="generic_list_wrapper ', $report['alternate'] ? 'windowbg' : 'windowbg2', '">
 			<div class="content">
 				<h5>
-					<strong><a href="', $report['topic']['href'], '">', $report['subject'], '</a></strong> ', $txt['mc_reportedp_by'], ' <strong>', $report['author']['link'], '</strong>
+					<strong>', !empty($report['topic']['board_name']) ? '<a href="' . $scripturl . '?board=' . $report['topic']['id_board'] . '.0">' . $report['topic']['board_name'] . '</a>' : '??', ' / <a href="', $report['topic']['href'], '">', $report['subject'], '</a></strong> ', $txt['mc_reportedp_by'], ' <strong>', $report['author']['link'], '</strong>
 				</h5>
 				<div class="smalltext">
 					', $txt['mc_reportedp_last_reported'], ': ', $report['last_updated'], '&nbsp;-&nbsp;';