Chris@76:
Chris@76: ', empty($context['robot_no_index']) ? '' : '
Chris@76: ', '
Chris@76:
Chris@76:
Chris@76:
Chris@76: ', $context['page_title'], '';
Chris@76:
Chris@76: // The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
Chris@76: echo '
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: /* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Chris@76: Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Chris@76: Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Chris@76: Standards compliance mode happens when you use xhtml... */
Chris@76: if ($context['browser']['needs_size_fix'])
Chris@76: echo '
Chris@76: ';
Chris@76:
Chris@76: // Show all the relative links, such as help, search, contents, and the like.
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // If RSS feeds are enabled, advertise the presence of one.
Chris@76: if (!empty($modSettings['xmlnews_enable']))
Chris@76: echo '
Chris@76: ';
Chris@76:
Chris@76: // If we're viewing a topic, these should be the previous and next topics, respectively.
Chris@76: if (!empty($context['current_topic']))
Chris@76: echo '
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // If we're in a board, or a topic for that matter, the index will be the board's index.
Chris@76: if (!empty($context['current_board']))
Chris@76: echo '
Chris@76: ';
Chris@76:
Chris@76: // We'll have to use the cookie to remember the header...
Chris@76: if ($context['user']['is_guest'])
Chris@76: $options['collapse_header'] = !empty($_COOKIE['upshrink']);
Chris@76:
Chris@76: // Output any remaining HTML headers. (from mods, maybe?)
Chris@76: echo $context['html_headers'], '
Chris@76:
Chris@76:
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // Because of the way width/padding are calculated, we have to tell Internet Explorer 4 and 5 that the content should be 100% wide. (or else it will assume about 108%!)
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // The logo and the three info boxes.
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76:
';
Chris@76:
Chris@76: // This part is the logo and forum name. You should be able to change this to whatever you want...
Chris@76: echo '
Chris@76: ';
Chris@76: if (empty($settings['header_logo_url']))
Chris@76: echo '
Chris@76: ', $context['forum_name'], '';
Chris@76: else
Chris@76: echo '
Chris@76: ';
Chris@76:
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
';
Chris@76:
Chris@76: if (!empty($context['user']['avatar']))
Chris@76: echo '
', $context['user']['avatar']['image'], '
';
Chris@76:
Chris@76: echo '
';
Chris@76:
Chris@76: // If the user is logged in, display stuff like their name, new messages, etc.
Chris@76: if ($context['user']['is_logged'])
Chris@76: {
Chris@76: echo '
Chris@76: ', $txt['hello_member'], ' ', $context['user']['name'], '';
Chris@76:
Chris@76: // Only tell them about their messages if they can read their messages!
Chris@76: if ($context['allow_pm'])
Chris@76: echo ', ', $txt[152], ' ', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
Chris@76: echo '. ';
Chris@76:
Chris@76: // Is the forum in maintenance mode?
Chris@76: if ($context['in_maintenance'] && $context['user']['is_admin'])
Chris@76: echo '
Chris@76: ', $txt[616], ' ';
Chris@76:
Chris@76: // Are there any members waiting for approval?
Chris@76: if (!empty($context['unapproved_members']))
Chris@76: echo '
Chris@76: ', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' ', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], ' ', $txt['approve_members_waiting'], ' ';
Chris@76:
Chris@76: // Show the total time logged in?
Chris@76: if (!empty($context['user']['total_time_logged_in']))
Chris@76: {
Chris@76: echo '
Chris@76: ', $txt['totalTimeLogged1'];
Chris@76:
Chris@76: // If days is just zero, don't bother to show it.
Chris@76: if ($context['user']['total_time_logged_in']['days'] > 0)
Chris@76: echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];
Chris@76:
Chris@76: // Same with hours - only show it if it's above zero.
Chris@76: if ($context['user']['total_time_logged_in']['hours'] > 0)
Chris@76: echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
Chris@76:
Chris@76: // But, let's always show minutes - Time wasted here: 0 minutes ;).
Chris@76: echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], ' ';
Chris@76: }
Chris@76:
Chris@76: echo '
Chris@76: ', $txt['unread_since_visit'], '
Chris@76: ', $txt['show_unread_replies'], '
Chris@76: ', $context['current_time'];
Chris@76: }
Chris@76: // Otherwise they're a guest - so politely ask them to register or login.
Chris@76: else
Chris@76: {
Chris@76: echo '
Chris@76: ', $txt['welcome_guest'], '
Chris@76: ', $context['current_time'], '
Chris@76:
Chris@76:
Chris@76:
Chris@76: ';
Chris@76: }
Chris@76:
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
Chris@76:
';
Chris@76:
Chris@76: // Show a random news item? (or you could pick one from news_lines...)
Chris@76: if (!empty($settings['enable_news']))
Chris@76: echo '
Chris@76:
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // Show the menu here, according to the menu sub template.
Chris@76: template_menu();
Chris@76:
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // The main content should go here. A table is used because IE 6 just can't handle a div.
Chris@76: echo '
Chris@76:
Chris@76:
';
Chris@76: }
Chris@76:
Chris@76: function template_main_below()
Chris@76: {
Chris@76: global $context, $settings, $options, $scripturl, $txt;
Chris@76:
Chris@76: echo '
Chris@76:
';
Chris@76:
Chris@76: // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
Chris@76: echo '
Chris@76:
Chris@76: ';
Chris@76:
Chris@76: // This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
Chris@76: if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
Chris@76: {
Chris@76: // The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
Chris@76: echo '
Chris@76: ';
Chris@76: }
Chris@76:
Chris@76: // The following will be used to let the user know that some AJAX process is running
Chris@76: echo '
Chris@76:
', $txt['ajax_in_progress'], '
Chris@76:
Chris@76: ';
Chris@76: }
Chris@76:
Chris@76: // Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
Chris@76: function theme_linktree()
Chris@76: {
Chris@76: global $context, $settings, $options;
Chris@76:
Chris@76: // Folder style or inline? Inline has a smaller font.
Chris@76: echo '';
Chris@76:
Chris@76: // Each tree item has a URL and name. Some may have extra_before and extra_after.
Chris@76: foreach ($context['linktree'] as $link_num => $tree)
Chris@76: {
Chris@76: // Show the | | |-[] Folders.
Chris@76: if (!$settings['linktree_inline'])
Chris@76: {
Chris@76: if ($link_num > 0)
Chris@76: echo str_repeat('', $link_num - 1), '';
Chris@76: echo ' ';
Chris@76: }
Chris@76:
Chris@76: // Show something before the link?
Chris@76: if (isset($tree['extra_before']))
Chris@76: echo $tree['extra_before'];
Chris@76:
Chris@76: // Show the link, including a URL if it should have one.
Chris@76: echo '', $settings['linktree_link'] && isset($tree['url']) ? '' . $tree['name'] . '' : $tree['name'], '';
Chris@76:
Chris@76: // Show something after the link...?
Chris@76: if (isset($tree['extra_after']))
Chris@76: echo $tree['extra_after'];
Chris@76:
Chris@76: // Don't show a separator for the last one.
Chris@76: if ($link_num != count($context['linktree']) - 1)
Chris@76: echo $settings['linktree_inline'] ? ' | ' : ' ';
Chris@76: }
Chris@76:
Chris@76: echo '';
Chris@76: }
Chris@76:
Chris@76: // Show the menu up top. Something like [home] [help] [profile] [logout]...
Chris@76: function template_menu()
Chris@76: {
Chris@76: global $context, $settings, $options, $scripturl, $txt;
Chris@76:
Chris@76: // Show the [home] and [help] buttons.
Chris@76: echo '
Chris@76: ', ($settings['use_image_buttons'] ? '' : $txt[103]), '', $context['menu_separator'], '
Chris@76: ', ($settings['use_image_buttons'] ? '' : $txt[119]), '', $context['menu_separator'];
Chris@76:
Chris@76: // How about the [search] button?
Chris@76: if ($context['allow_search'])
Chris@76: echo '
Chris@76: ', ($settings['use_image_buttons'] ? '' : $txt[182]), '', $context['menu_separator'];
Chris@76:
Chris@76: // Is the user allowed to administrate at all? ([admin])
Chris@76: if ($context['allow_admin'])
Chris@76: echo '
Chris@76: ', ($settings['use_image_buttons'] ? '' : $txt[2]), '', $context['menu_separator'];
Chris@76:
Chris@76: // Edit Profile... [profile]
Chris@76: if ($context['allow_edit_profile'])
Chris@76: echo '
Chris@76: ', ($settings['use_image_buttons'] ? '' : $txt[467]), '', $context['menu_separator'];
Chris@76:
Chris@76: // The [calendar]!
Chris@76: if ($context['allow_calendar'])
Chris@76: echo '
Chris@76: ', ($settings['use_image_buttons'] ? '' : $txt['calendar24']), '', $context['menu_separator'];
Chris@76:
Chris@76: // If the user is a guest, show [login] and [register] buttons.
Chris@76: if ($context['user']['is_guest'])
Chris@76: {
Chris@76: echo '
Chris@76: ', ($settings['use_image_buttons'] ? '' : $txt[34]), '', $context['menu_separator'], '
Chris@76: ', ($settings['use_image_buttons'] ? '' : $txt[97]), '';
Chris@76: }
Chris@76: // Otherwise, they might want to [logout]...
Chris@76: else
Chris@76: echo '
Chris@76: ', ($settings['use_image_buttons'] ? '' : $txt[108]), '';
Chris@76: }
Chris@76:
Chris@76: // Generate a strip of buttons, out of buttons.
Chris@76: function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
Chris@76: {
Chris@76: global $settings, $buttons, $context, $txt, $scripturl;
Chris@76:
Chris@76: if (empty($button_strip))
Chris@76: return '';
Chris@76:
Chris@76: // Create the buttons...
Chris@76: foreach ($button_strip as $key => $value)
Chris@76: {
Chris@76: if (isset($value['test']) && empty($context[$value['test']]))
Chris@76: {
Chris@76: unset($button_strip[$key]);
Chris@76: continue;
Chris@76: }
Chris@76: elseif (!isset($buttons[$key]) || $force_reset)
Chris@76: $buttons[$key] = '' . ($settings['use_image_buttons'] ? '' : $txt[$value['text']]) . '';
Chris@76:
Chris@76: $button_strip[$key] = $buttons[$key];
Chris@76: }
Chris@76:
Chris@76: echo '
Chris@76: