'' . $txt['pages'] . '', 'previous_page' => '', 'current_page' => '%1$d ', 'page' => '%2$s ', 'expand_pages' => ' ... ', 'next_page' => '', 'extra_after' => '', ); // Allow css/js files to be disabled for this specific theme. // Add the identifier as an array key. IE array('smf_script'); Some external files might not add identifiers, on those cases SMF uses its filename as reference. if (!isset($settings['disable_files'])) $settings['disable_files'] = array(); } /** * The main sub template above the content. */ function template_html_above() { global $context, $scripturl, $txt, $modSettings; // Show right to left, the language code, and the character set for ease of translating. echo ' '; /* You don't need to manually load index.css, this will be set up for you. Note that RTL will also be loaded for you. To load other CSS and JS files you should use the functions loadCSSFile() and loadJavaScriptFile() respectively. This approach will let you take advantage of SMF's automatic CSS minimization and other benefits. You can, of course, manually add any other files you want after template_css() has been run. * Short example: - CSS: loadCSSFile('filename.css', array('minimize' => true)); - JS: loadJavaScriptFile('filename.js', array('minimize' => true)); You can also read more detailed usages of the parameters for these functions on the SMF wiki. * Themes: The most efficient way of writing multi themes is to use a master index.css plus variant.css files. If you've set them up properly (through $settings['theme_variants']), the variant files will be loaded for you automatically. Additionally, tweaking the CSS for the editor requires you to include a custom 'jquery.sceditor.theme.css' file in the css folder if you need it. * MODs: If you want to load CSS or JS files in here, the best way is to use the 'integrate_load_theme' hook for adding multiple files, or using 'integrate_pre_css_output', 'integrate_pre_javascript_output' for a single file. */ // load in any css from mods or themes so they can overwrite if wanted template_css(); // load in any javascript files from mods and themes template_javascript(); echo ' ', $context['page_title_html_safe'], ' '; // Content related meta tags, like description, keywords, Open Graph stuff, etc... foreach ($context['meta_tags'] as $meta_tag) { echo ' $meta_value) echo ' ', $meta_key, '="', $meta_value, '"'; echo '>'; } /* What is your Lollipop's color? Theme Authors, you can change the color here to make sure your theme's main color gets visible on tab */ echo ' '; // Please don't index these Mr Robot. if (!empty($context['robot_no_index'])) echo ' '; // Present a canonical url for search engines to prevent duplicate content in their indices. if (!empty($context['canonical_url'])) echo ' '; // Show all the relative links, such as help, search, contents, and the like. echo ' ', ($context['allow_search'] ? ' ' : ''); // If RSS feeds are enabled, advertise the presence of one. if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) echo ' '; // If we're viewing a topic, these should be the previous and next topics, respectively. if (!empty($context['links']['next'])) echo ' '; if (!empty($context['links']['prev'])) echo ' '; // If we're in a board, or a topic for that matter, the index will be the board's index. if (!empty($context['current_board'])) echo ' '; // Output any remaining HTML headers. (from mods, maybe?) echo $context['html_headers']; echo '
'; } /** * The upper part of the main template layer. This is the stuff that shows above the main forum content. */ function template_body_above() { global $context, $settings, $scripturl, $txt, $modSettings, $maintenance; // Wrapper div now echoes permanently for better layout options. h1 a is now target for "Go up" links. echo '
'; // If the user is logged in, display some things that might be useful. if ($context['user']['is_logged']) { // Firstly, the user's menu echo ' '; } // Otherwise they're a guest. Ask them to either register or login. elseif (empty($maintenance)) { // Some people like to do things the old-fashioned way. if (!empty($settings['login_main_menu'])) { echo '
  • ', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ', \'login\');', $scripturl . '?action=signup'), '
'; } else { echo ' '; } } else // In maintenance mode, only login is allowed and don't show OverlayDiv echo '
  • ', sprintf($txt['welcome_guest'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return true;'), '
'; if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) { echo '
'; } if ($context['allow_search']) { echo '
 '; // Using the quick search dropdown? $selected = !empty($context['current_topic']) ? 'current_topic' : (!empty($context['current_board']) ? 'current_board' : 'all'); echo ' '; // Search within current topic? if (!empty($context['current_topic'])) echo ' '; // If we're on a certain board, limit it to this board ;). elseif (!empty($context['current_board'])) echo ' '; echo '
'; } echo '
'; echo '
'; if ($context['user']['is_logged']) echo ' '; echo '
'; // Show a random news item? (or you could pick one from news_lines...) if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) echo '

', $txt['news'], ':

', $context['random_news_line'], '

'; echo '
'; // Show the menu here, according to the menu sub template, followed by the navigation tree. // Load mobile menu here echo ' ', $txt['mobile_user_menu'], ' '; theme_linktree(); echo '
'; // The main content should go here. echo '
'; } /** * The stuff shown immediately below the main content, including the footer */ function template_body_below() { global $context, $txt, $scripturl, $modSettings; echo '
'; // Show the footer with copyright, terms and help links. echo ' '; } /** * This shows any deferred JavaScript and closes out the HTML */ function template_html_below() { // Load in any javascipt that could be deferred to the end of the page template_javascript(true); echo ' '; } /** * Show a linktree. This is that thing that shows "My Community | General Category | General Discussion".. * * @param bool $force_show Whether to force showing it even if settings say otherwise */ function theme_linktree($force_show = false) { global $context, $shown_linktree, $scripturl, $txt; // If linktree is empty, just return - also allow an override. if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) return; echo ' '; $shown_linktree = true; } /** * Show the menu up top. Something like [home] [help] [profile] [logout]... */ function template_menu() { global $context; echo ' '; } /** * Generate a strip of buttons. * * @param array $button_strip An array with info for displaying the strip * @param string $direction The direction * @param array $strip_options Options for the button strip */ function template_button_strip($button_strip, $direction = '', $strip_options = array()) { global $context, $txt; if (!is_array($strip_options)) $strip_options = array(); // Create the buttons... $buttons = array(); foreach ($button_strip as $key => $value) { // As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!) if (!isset($value['test']) || !empty($context[$value['test']])) { if (!isset($value['id'])) $value['id'] = $key; $button = ' '.(!empty($value['icon']) ? '' : '').'' . $txt[$value['text']] . ''; if (!empty($value['sub_buttons'])) { $button .= '
'; foreach ($value['sub_buttons'] as $element) { if (isset($element['test']) && empty($context[$element['test']])) continue; $button .= ' ' . $txt[$element['text']] . ''; if (isset($txt[$element['text'] . '_desc'])) $button .= '
' . $txt[$element['text'] . '_desc'] . ''; $button .= '
'; } $button .= '
'; } $buttons[] = $button; } } // No buttons? No button strip either. if (empty($buttons)) return; echo ' '; } /** * Generate a list of quickbuttons. * * @param array $list_items An array with info for displaying the strip * @param string $list_class Used for integration hooks and as a class name * @param string $output_method The output method. If 'echo', simply displays the buttons, otherwise returns the HTML for them * @return void|string Returns nothing unless output_method is something other than 'echo' */ function template_quickbuttons($list_items, $list_class = null, $output_method = 'echo') { global $txt; // Enable manipulation with hooks if (!empty($list_class)) call_integration_hook('integrate_' . $list_class . '_quickbuttons', array(&$list_items)); // Make sure the list has at least one shown item foreach ($list_items as $key => $li) { // Is there a sublist, and does it have any shown items if ($key == 'more') { foreach ($li as $subkey => $subli) if (isset($subli['show']) && !$subli['show']) unset($list_items[$key][$subkey]); if (empty($list_items[$key])) unset($list_items[$key]); } // A normal list item elseif (isset($li['show']) && !$li['show']) unset($list_items[$key]); } // Now check if there are any items left if (empty($list_items)) return; // Print the quickbuttons $output = ' '; // There are a few spots where the result needs to be returned if ($output_method == 'echo') echo $output; else return $output; } /** * The upper part of the maintenance warning box */ function template_maint_warning_above() { global $txt, $context, $scripturl; echo '
', $txt['forum_in_maintenance'], '
', sprintf($txt['maintenance_page'], $scripturl . '?action=admin;area=serversettings;' . $context['session_var'] . '=' . $context['session_id']), '
'; } /** * The lower part of the maintenance warning box. */ function template_maint_warning_below() { } ?>