Browse Source

! When looking at the list of boards in the reports page, show if a board is a redirect board and if so, where it redirects to.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 10 years ago
parent
commit
befec60e70
2 changed files with 12 additions and 2 deletions
  1. 11 2
      Sources/Reports.php
  2. 1 0
      Themes/default/languages/Reports.english.php

+ 11 - 2
Sources/Reports.php

@@ -185,6 +185,7 @@ function BoardReport()
 	$boardSettings = array(
 		'category' => $txt['board_category'],
 		'parent' => $txt['board_parent'],
+		'redirect' => $txt['board_redirect'],
 		'num_topics' => $txt['board_num_topics'],
 		'num_posts' => $txt['board_num_posts'],
 		'count_posts' => $txt['board_count_posts'],
@@ -204,7 +205,7 @@ function BoardReport()
 	// Go through each board!
 	$request = $smcFunc['db_query']('order_by_board_order', '
 		SELECT b.id_board, b.name, b.num_posts, b.num_topics, b.count_posts, b.member_groups, b.override_theme, b.id_profile, b.deny_member_groups,
-			c.name AS cat_name, IFNULL(par.name, {string:text_none}) AS parent_name, IFNULL(th.value, {string:text_none}) AS theme_name
+			b.redirect, c.name AS cat_name, IFNULL(par.name, {string:text_none}) AS parent_name, IFNULL(th.value, {string:text_none}) AS theme_name
 		FROM {db_prefix}boards AS b
 			LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
 			LEFT JOIN {db_prefix}boards AS par ON (par.id_board = b.id_parent)
@@ -220,8 +221,12 @@ function BoardReport()
 		// Each board has it's own table.
 		newTable($row['name'], '', 'left', 'auto', 'left', 200, 'left');
 
+		$this_boardSettings = $boardSettings;
+		if (empty($row['redirect']))
+			unset($this_boardSettings['redirect']);
+
 		// First off, add in the side key.
-		addData($boardSettings);
+		addData($this_boardSettings);
 
 		// Format the profile name.
 		$profile_name = $context['profiles'][$row['id_profile']]['name'];
@@ -230,6 +235,7 @@ function BoardReport()
 		$boardData = array(
 			'category' => $row['cat_name'],
 			'parent' => $row['parent_name'],
+			'redirect' => $row['redirect'],
 			'num_posts' => $row['num_posts'],
 			'num_topics' => $row['num_topics'],
 			'count_posts' => empty($row['count_posts']) ? $txt['yes'] : $txt['no'],
@@ -263,6 +269,9 @@ function BoardReport()
 			$boardData['disallowed_groups'] = implode(', ', $disallowedGroups);
 		}
 
+		if (empty($row['redirect']))
+			unset ($boardData['redirect']);
+
 		// Next add the main data.
 		addData($boardData);
 	}

+ 1 - 0
Themes/default/languages/Reports.english.php

@@ -82,6 +82,7 @@ $txt['member_group_access'] = 'Board Access';
 $txt['none'] = 'None';
 $txt['board_category'] = 'Category';
 $txt['board_parent'] = 'Parent Board';
+$txt['board_redirect'] = 'Redirection Board, redirects to';
 $txt['board_num_topics'] = 'Number of Topics';
 $txt['board_num_posts'] = 'Number of Posts';
 $txt['board_count_posts'] = 'Count Posts';