Browse Source

Merge pull request #287 from emanuele45/boardindex_layers

BoardIndex re-organization to make it more easy to extend - inspired by ...
emanuele45 12 years ago
parent
commit
a6ab19f0b0
2 changed files with 17 additions and 1 deletions
  1. 1 0
      Sources/BoardIndex.php
  2. 16 1
      Themes/default/BoardIndex.template.php

+ 1 - 0
Sources/BoardIndex.php

@@ -36,6 +36,7 @@ function BoardIndex()
 
 	// Set a canonical URL for this page.
 	$context['canonical_url'] = $scripturl;
+	$context['template_layers'][] = 'boardindex_outer';
 
 	// Do not let search engines index anything if there is a random thing in $_GET.
 	if (!empty($_GET))

+ 16 - 1
Themes/default/BoardIndex.template.php

@@ -10,7 +10,7 @@
  * @version 2.1 Alpha 1
  */
 
-function template_main()
+function template_boardindex_outer_above()
 {
 	global $context, $settings, $options, $txt, $scripturl, $modSettings;
 
@@ -22,6 +22,13 @@ function template_main()
 		', $settings['show_latest_member'] ? ' ' . sprintf($txt['welcome_newest_member'], ' <strong>' . $context['common_stats']['latest_member']['link'] . '</strong>') : '' , '
 	</div>';
 
+	template_newsfader();
+}
+
+function template_newsfader()
+{
+	global $context, $settings, $options, $txt, $scripturl, $modSettings;
+
 	// Show the news fader?  (assuming there are things to show...)
 	if (!empty($settings['show_newsfader']) && !empty($context['news_lines']))
 	{
@@ -81,6 +88,11 @@ function template_main()
 			// ]]></script>
 		';
 	}
+}
+
+function template_main()
+{
+	global $context, $settings, $options, $txt, $scripturl, $modSettings;
 
 	echo '
 	<div id="boardindex_table" class="boardindex_table">
@@ -239,7 +251,10 @@ function template_main()
 	if ($settings['show_mark_read'] && !empty($context['categories']))
 	echo '
 		<div class="mark_read">', template_button_strip($context['mark_read_button'], 'right'), '</div>';
+}
 
+function template_boardindex_outer_below()
+{
 	template_info_center();
 }