Procházet zdrojové kódy

Merge pull request #1145 from Arantor/release-2.1

Theme fixes
Arantor před 11 roky
rodič
revize
60435117d7

+ 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');
 }

+ 0 - 6
Themes/default/Display.template.php

@@ -637,12 +637,6 @@ function template_single_post($message, $force_alternate = null)
 			if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
 				echo '
 										<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
-
-			// Don't show the email address if they want it hidden.
-			if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')) && $context['can_send_email'])
-				echo '
-										<li><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>';
-
 										
 			// Since we know this person isn't a guest, you *can* message them.
 			if ($context['can_send_pm'])

+ 38 - 31
Themes/default/MessageIndex.template.php

@@ -355,28 +355,9 @@ function template_main()
 	// Show breadcrumbs at the bottom too.
 	theme_linktree();
 
-	echo '
-	<div class="tborder" id="topic_icons">
-		<div class="description">
-			<p class="floatright" id="message_index_jump_to">&nbsp;</p>';
-
-	if (!$context['no_topic_listing'])
-		echo '
-			<p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
-				<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon" /> ' . $txt['participation_caption'] . '<br />' : '', '
-				'. ($modSettings['pollMode'] == '1' ? '<img src="' . $settings['images_url'] . '/topic/normal_poll.png" alt="" class="centericon" /> ' . $txt['poll'] : '') . '<br />
-				<img src="' . $settings['images_url'] . '/post/moved.png" alt="" class="centericon sizefix" /> ' . $txt['moved_topic'] . '<br />
-			</p>
-			<p>
-				<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 />
-			</p>';
-
-	echo '
-			<script type="text/javascript"><!-- // --><![CDATA[';
-
 	if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
 		echo '
+			<script type="text/javascript"><!-- // --><![CDATA[
 				if (typeof(window.XMLHttpRequest) != "undefined")
 					aJumpTo[aJumpTo.length] = new JumpTo({
 						sContainerId: "quick_mod_jump_to",
@@ -392,9 +373,45 @@ function template_main()
 						bNoRedirect: true,
 						bDisabled: true,
 						sCustomName: "move_to"
-					});';
+					});
+			// ]]></script>';
+
+	// Javascript for inline editing.
+	echo '
+<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/topic.js"></script>
+<script type="text/javascript"><!-- // --><![CDATA[
+	var oQuickModifyTopic = new QuickModifyTopic({
+		aHidePrefixes: Array("lockicon", "stickyicon", "pages", "newicon"),
+		bMouseOnDiv: false,
+	});
+// ]]></script>';
+
+	template_topic_legend();
+}
+
+function template_topic_legend()
+{
+	global $context, $settings, $txt, $options, $modSettings;
+
+	echo '
+	<div class="tborder" id="topic_icons">
+		<div class="description">
+			<p class="floatright" id="message_index_jump_to">&nbsp;</p>';
+
+	if (empty($context['no_topic_listing']))
+		echo '
+			<p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
+				<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon" /> ' . $txt['participation_caption'] . '<br />' : '', '
+				'. ($modSettings['pollMode'] == '1' ? '<img src="' . $settings['images_url'] . '/topic/normal_poll.png" alt="" class="centericon" /> ' . $txt['poll'] : '') . '<br />
+				<img src="' . $settings['images_url'] . '/post/moved.png" alt="" class="centericon sizefix" /> ' . $txt['moved_topic'] . '<br />
+			</p>
+			<p>
+				<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 />
+			</p>';
 
 	echo '
+			<script type="text/javascript"><!-- // --><![CDATA[
 				if (typeof(window.XMLHttpRequest) != "undefined")
 					aJumpTo[aJumpTo.length] = new JumpTo({
 						sContainerId: "message_index_jump_to",
@@ -412,16 +429,6 @@ function template_main()
 			<br class="clear" />
 		</div>
 	</div>';
-
-	// Javascript for inline editing.
-	echo '
-<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/topic.js"></script>
-<script type="text/javascript"><!-- // --><![CDATA[
-	var oQuickModifyTopic = new QuickModifyTopic({
-		aHidePrefixes: Array("lockicon", "stickyicon", "pages", "newicon"),
-		bMouseOnDiv: false,
-	});
-// ]]></script>';
 }
 
 ?>

+ 26 - 60
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;
 
@@ -95,13 +95,10 @@ function template_unread()
 	if (!empty($context['topics']))
 	{
 		echo '
-			<div class="pagesection">';
-
-		if (!empty($context['recent_buttons']))
-			template_button_strip($context['recent_buttons'], 'right');
-
-		echo '
-				<div class="pagelinks floatleft">', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#bot"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
+			<div class="pagesection">
+				', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#bot" class="topbottom floatleft">' . $txt['go_down'] . '</a>' : '', '
+				<div class="pagelinks floatleft">', $context['page_index'], '</div>
+				', !empty($context['recent_buttons']) ? template_button_strip($context['recent_buttons'], 'right') : '', '
 			</div>';
 
 		// [WIP] There is trial code here to hide the topic icon column. Colspan can be cleaned up later.
@@ -186,7 +183,7 @@ function template_unread()
 								', $topic['views'], ' ', $txt['views'], '
 							</td>
 							<td class="', $color_class2, ' lastpost">
-								<a href="', $topic['last_post']['href'], '"><span class="generic_icons last_post" title="', $txt['last_post'], '"></a>
+								<a href="', $topic['last_post']['href'], '"><span class="generic_icons last_post" title="', $txt['last_post'], '"></span></a>
 								', sprintf($txt['last_post_topic'], $topic['last_post']['time'], $topic['last_post']['member']['link']), '
 							</td>';
 
@@ -207,13 +204,10 @@ function template_unread()
 					</tbody>
 				</table>
 			</div>
-			<div class="pagesection" id="readbuttons">';
-
-		if (!empty($context['recent_buttons']))
-			template_button_strip($context['recent_buttons'], 'right');
-
-		echo '
-				<div class="pagelinks floatleft">', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#main_content_section"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
+			<div class="pagesection">
+				', !empty($context['recent_buttons']) ? template_button_strip($context['recent_buttons'], 'right') : '', '
+				', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#recent" class="topbottom floatleft">' . $txt['go_up'] . '</a>' : '', '
+				<div class="pagelinks">', $context['page_index'], '</div>
 			</div>';
 	}
 	else
@@ -229,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()
@@ -263,13 +246,10 @@ function template_replies()
 	if (!empty($context['topics']))
 	{
 		echo '
-			<div class="pagesection">';
-
-		if (!empty($context['recent_buttons']))
-			template_button_strip($context['recent_buttons'], 'right');
-
-		echo '
-				<div class="pagelinks floatleft">', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#bot"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
+			<div class="pagesection">
+				', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#bot" class="topbottom floatleft">' . $txt['go_down'] . '</a>' : '', '
+				<div class="pagelinks floatleft">', $context['page_index'], '</div>
+				', !empty($context['recent_buttons']) ? template_button_strip($context['recent_buttons'], 'right') : '', '
 			</div>';
 
 		// [WIP] There is trial code here to hide the topic icon column. Colspan can be cleaned up later.
@@ -354,7 +334,7 @@ function template_replies()
 								', $topic['views'], ' ', $txt['views'], '
 							</td>
 							<td class="', $color_class2, ' lastpost">
-								<a href="', $topic['last_post']['href'], '"><span class="generic_icons last_post" title="', $txt['last_post'], '"></a>
+								<a href="', $topic['last_post']['href'], '"><span class="generic_icons last_post" title="', $txt['last_post'], '"></span></a>
 								', sprintf($txt['last_post_topic'], $topic['last_post']['time'], $topic['last_post']['member']['link']), '
 							</td>';
 
@@ -371,14 +351,11 @@ function template_replies()
 					</tbody>
 				</table>
 			</div>
-			<div class="pagesection">';
-
-		if (!empty($context['recent_buttons']))
-			template_button_strip($context['recent_buttons'], 'right');
-
-		echo '
-				<div class="pagelinks floatleft">', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#main_content_section"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
- 			</div>';
+			<div class="pagesection">
+				', !empty($context['recent_buttons']) ? template_button_strip($context['recent_buttons'], 'right') : '', '
+				', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#recent" class="topbottom floatleft">' . $txt['go_up'] . '</a>' : '', '
+				<div class="pagelinks">', $context['page_index'], '</div>
+			</div>';
 	}
 	else
 		echo '
@@ -393,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();
 }
 
 ?>