Просмотр исходного кода

! And make unread/replies use the legend - this incidentally fixes the fact the old legend was out of date and also layout-broken.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 лет назад
Родитель
Сommit
441305de24
2 измененных файлов с 15 добавлено и 29 удалено
  1. 8 0
      Sources/Recent.php
  2. 7 29
      Themes/default/Recent.template.php

+ 8 - 0
Sources/Recent.php

@@ -79,6 +79,7 @@ function RecentPosts()
 
 	loadTemplate('Recent');
 	$context['page_title'] = $txt['recent_posts'];
+	$context['sub_template'] = 'recent';
 
 	if (isset($_REQUEST['start']) && $_REQUEST['start'] > 95)
 		$_REQUEST['start'] = 95;
@@ -650,6 +651,7 @@ function UnreadTopics()
 	else
 	{
 		loadTemplate('Recent');
+		loadTemplate('MessageIndex');
 		$context['sub_template'] = $_REQUEST['action'] == 'unread' ? 'unread' : 'replies';
 	}
 
@@ -814,6 +816,7 @@ function UnreadTopics()
 			markBoardsRead(empty($boards) ? $board : $boards);
 
 			$context['topics'] = array();
+			$context['no_topic_listing'] = true;
 			if ($context['querystring_board_limits'] == ';start=%1$d')
 				$context['querystring_board_limits'] = '';
 			else
@@ -901,6 +904,7 @@ function UnreadTopics()
 			}
 
 			$context['topics'] = array();
+			$context['no_topic_listing'] = true;
 			if ($context['querystring_board_limits'] == ';start=%d')
 				$context['querystring_board_limits'] = '';
 			else
@@ -1061,6 +1065,7 @@ function UnreadTopics()
 		if ($num_topics == 0)
 		{
 			$context['topics'] = array();
+			$context['no_topic_listing'] = true;
 			if ($context['querystring_board_limits'] == ';start=%d')
 				$context['querystring_board_limits'] = '';
 			else
@@ -1119,6 +1124,7 @@ function UnreadTopics()
 		if (empty($topics))
 		{
 			$context['topics'] = array();
+			$context['no_topic_listing'] = true;
 			if ($context['querystring_board_limits'] == ';start=%d')
 				$context['querystring_board_limits'] = '';
 			else
@@ -1365,6 +1371,8 @@ function UnreadTopics()
 		call_integration_hook('integrate_recent_buttons');
 	}
 
+	$context['no_topic_listing'] = empty($context['topics']);
+
 	// Allow helpdesks and bug trackers and what not to add their own unread data (just add a template_layer to show custom stuff in the template!)
  	call_integration_hook('integrate_unread_list');
 }

+ 7 - 29
Themes/default/Recent.template.php

@@ -10,7 +10,7 @@
  * @version 2.1 Alpha 1
  */
 
-function template_main()
+function template_recent()
 {
 	global $context, $settings, $options, $txt, $scripturl;
 
@@ -223,21 +223,10 @@ function template_unread()
 		</form>';
 
 	echo '
-		<div class="description " id="topic_icons">
-			<p class="smalltext floatleft">
-				', !empty($modSettings['enableParticipation']) ? '
-				<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon" /> ' . $txt['participation_caption'] . '<br />' : '', '
-				<img src="', $settings['images_url'], '/topic/normal_post.png" alt="" class="centericon" /> ', $txt['normal_topic'], '<br />
-				<img src="', $settings['images_url'], '/topic/hot_post.png" alt="" class="centericon" /> ', sprintf($txt['hot_topics'], $modSettings['hotTopicPosts']), '<br />
-				<img src="', $settings['images_url'], '/topic/veryhot_post.png" alt="" class="centericon" /> ', sprintf($txt['very_hot_topics'], $modSettings['hotTopicVeryPosts']), '
-			</p>
-			<p class="smalltext para2">
-				<img src="', $settings['images_url'], '/icons/quick_lock.png" alt="" class="centericon" /> ', $txt['locked_topic'], '<br />
-				<img src="', $settings['images_url'], '/icons/quick_sticky.png" alt="" class="centericon" /> ', $txt['sticky_topic'], '<br />', ($modSettings['pollMode'] == '1' ? '
-				<img src="' . $settings['images_url'] . '/topic/normal_poll.png" alt="" class="centericon" /> ' . $txt['poll'] : ''), '
-			</p>
-		</div>
 	</div>';
+
+	if (empty($context['no_topic_listing']))
+		template_topic_legend();
 }
 
 function template_replies()
@@ -381,21 +370,10 @@ function template_replies()
 		</form>';
 
 	echo '
-		<div class="description flow_auto" id="topic_icons">
-			<p class="smalltext floatleft">
-				', !empty($modSettings['enableParticipation']) ? '
-				<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon" /> ' . $txt['participation_caption'] . '<br />' : '', '
-				<img src="', $settings['images_url'], '/topic/normal_post.png" alt="" class="centericon" /> ', $txt['normal_topic'], '<br />
-				<img src="', $settings['images_url'], '/topic/hot_post.png" alt="" class="centericon" /> ', sprintf($txt['hot_topics'], $modSettings['hotTopicPosts']), '<br />
-				<img src="', $settings['images_url'], '/topic/veryhot_post.png" alt="" class="centericon" /> ', sprintf($txt['very_hot_topics'], $modSettings['hotTopicVeryPosts']), '
-			</p>
-			<p class="smalltext para2">
-				<img src="', $settings['images_url'], '/icons/quick_lock.png" alt="" class="centericon" /> ', $txt['locked_topic'], '<br />
-				<img src="' . $settings['images_url'] . '/icons/quick_sticky.png" alt="" class="centericon" /> ' . $txt['sticky_topic'] . '<br />' . ($modSettings['pollMode'] == '1' ? '
-				<img src="' . $settings['images_url'] . '/topic/normal_poll.png" alt="" class="centericon" /> ' . $txt['poll'] : '') . '
-			</p>
-		</div>
 	</div>';
+
+	if (empty($context['no_topic_listing']))
+		template_topic_legend();
 }
 
 ?>