Ejemplo n.º 1
0
/**
 * Display a menu bar, like is displayed at the top of the forum.
 *
 * @param string $output_method
 */
function ssi_menubar($output_method = 'echo')
{
    global $context;
    if ($output_method == 'echo') {
        template_menu();
    } else {
        return $context['menu_buttons'];
    }
}
Ejemplo n.º 2
0
/**
 * Section above the main contents of the page, after opening the body tag
 */
function template_body_above()
{
    global $context, $settings, $scripturl, $txt, $modSettings;
    // Go to top/bottom of page links and skipnav link for a11y.
    echo '
	<a id="top" href="#skipnav">', $txt['skip_nav'], '</a>
	<a href="#top" id="gotop" title="', $txt['go_up'], '">&#8593;</a>
	<a href="#bot" id="gobottom" title="', $txt['go_down'], '">&#8595;</a>';
    // Skip nav link.
    echo '
	<div id="top_section">
		<div class="wrapper">';
    echo '
		</div>';
    // WAI-ARIA a11y tweaks have been applied here.
    echo '
		<div class="wrapper">
		<div class="menu_bg">
			<div class="menu_bg_margin">
				<div class="menu_bg_content">
					<div class="menu_bg_center">
					
					<div class="community_name">
					<div class="floatleft">
					<a href="', $scripturl, '">', $context['forum_name'], '</a>
					</div>
					</div>
					
					', template_menu(), '';
    call_template_callbacks('th', $context['theme_header_callbacks']);
    echo '		
					</div>
				</div>
			</div>
		</div>
		</div>
		
	</div>
	<div id="wrapper" class="wrapper">
		<div id="upper_section"', empty($context['minmax_preferences']['upshrink']) ? '' : ' style="display: none;" aria-hidden="true"', '>';
    call_template_callbacks('uc', $context['upper_content_callbacks']);
    echo '
		</div>';
    // Show the navigation tree.
    theme_linktree();
    // The main content should go here. @todo - Skip nav link.
    echo '
		<div id="main_content_section"><a id="skipnav"></a>';
}
Ejemplo n.º 3
0
function template_body_above()
{
    global $context, $scripturl, $txt;
    echo '
	<div data-role="page" id="the-page">
		<div data-role="header" class="ui-bar ui-bar-b">
			<a data-iconpos="notext" data-mini="true" data-role="button" data-icon="search" href="', $scripturl, '?action=search">', $txt['search'], '</a>
			<h1><a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : $context['page_title'], '</a></h1>
		</div>';
    template_menu();
    echo '
		<div data-role="content">';
    //-- Main content goes here --
}
Ejemplo n.º 4
0
function template_body_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    echo '
	<div id="fwidth">';
    if ($context['user']['is_logged'] && $context['in_maintenance'] && $context['user']['is_admin']) {
        echo '
		<div id="fnotice" class="themepadding">', $txt['maintain_mode_on'], '</div>';
    }
    echo '
		<div id="ftop">
			<div id="fheader"><div class="bwgrid">
				<div class="bwcell8"><div class="themepadding">
					<a href="', $scripturl, '"><img src="', !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/theme/logo.png', '" style="max-width: 100%;" alt="" /></a>
					', !empty($settings['site_slogan']) ? '<div class="subtitle">' . $settings['site_slogan'] . '</div>' : '', '
				</div></div>
				<div class="bwcell8"><div class="themepadding">
					<div id="qsearch" class="bwfloatright">
						<form id="search_form" class="floatright" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
							<input type="text" name="search" value="" id="qsearch_search" class="input_text" />
							<input type="hidden" name="advanced" value="0" />';
    // Search within current topic?
    if (!empty($context['current_topic'])) {
        echo '
							<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
    } elseif (!empty($context['current_board'])) {
        echo '
							<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
    }
    echo '
						</form>
					</div>';
    if (!empty($settings['enable_news'])) {
        echo '<div id="qnews" class="floatright">', $txt['news'], ': ', $context['random_news_line'], '</div>';
    }
    echo '	<br><br>
				</div></div>
			</div></div>
		</div>
		<div id="fcontent">
			<div id="fmenu">';
    // If the user is logged in, display stuff like their name, new messages, etc.
    if ($context['user']['is_logged']) {
        echo '
				<div class="greeting">';
        if (!empty($context['user']['avatar'])) {
            echo '
					<div class="roundavatar" style="float: left; vertical-align: 50%; ">', $context['user']['avatar']['image'], '</div>';
        }
        echo '
					<span class="floatleft">
						<ul class="horiz_list floatleft">
							<li><a class="', $context['current_action'] == 'profile' ? 'active ' : '', '" href="', $scripturl, '?action=profile"><strong>', $context['user']['name'], '</strong></a></li>
							<li><a class="', $context['current_action'] == 'unread' ? 'active ' : '', '" href="', $scripturl, '?action=unread">', $txt['o_unread'], '</a></li>
							<li><a class="', $context['current_action'] == 'unreadreplies' ? 'active ' : '', '" href="', $scripturl, '?action=unreadreplies">', $txt['o_replies'], '</a></li>';
        // Are there any members waiting for approval?
        if (!empty($context['unapproved_members'])) {
            echo '
							<li><a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $txt['o_approve'] . '</a><em class="dark_notice">' . $context['unapproved_members'], '</em></li>';
        }
        if (!empty($context['open_mod_reports']) && $context['show_open_reports']) {
            echo '
							<li><a href="', $scripturl, '?action=moderate;area=reports">', $txt['o_reports'], '</a><em class="dark_notice">', $context['open_mod_reports'], '</em></li>';
        }
        // finally, add in the ones we left out
        foreach ($context['menu_buttons'] as $act => $button) {
            if (!in_array($act, array('profile', 'pm'))) {
                continue;
            }
            echo '
							<li><a class="', $context['current_action'] == $act ? 'active ' : '', '" href="', $button['href'], '">', $button['title'], '</a></li>';
        }
        echo '
						</ul>
					</span>
				</div>';
    } elseif (!empty($context['show_login_bar'])) {
        echo '
				<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
				<form id="guest_form" class="themepadding" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
					<div class="info">', sprintf($txt['welcome_guest'], $txt['guest_title']), '</div>
					<input type="text" name="user" size="10" class="input_text" />
					<input type="password" name="passwrd" size="10" class="input_password" />
					<select name="cookielength">
						<option value="60">', $txt['one_hour'], '</option>
						<option value="1440">', $txt['one_day'], '</option>
						<option value="10080">', $txt['one_week'], '</option>
						<option value="43200">', $txt['one_month'], '</option>
						<option value="-1" selected="selected">', $txt['forever'], '</option>
					</select>
					<input type="submit" value="', $txt['login'], '" class="button_submit" /><br />
					<div class="info">', $txt['quick_login_dec'], '</div>';
        if (!empty($modSettings['enableOpenID'])) {
            echo '
					<br /><input type="text" name="openid_identifier" id="openid_url" size="25" class="input_text openid_login" />';
        }
        echo '
					<input type="hidden" name="hash_passwrd" value="" />
				</form>';
    }
    echo '	<div style="clear: both;" id="fmainmenu">', template_menu(), '</div>
			</div>
			<div id="fbody">
				<div class="themepadding">', theme_linktree(), '</div>';
}
Ejemplo n.º 5
0
function template_body_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '
	<div id="header"><div class="frame">
		<div id="top_section">
			<h1 class="forumtitle">
				<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
			</h1>';
    // the upshrink image, right-floated
    echo '
			<img id="upshrink" src="', $settings['images_url'], '/upshrink.png" alt="*" title="', $txt['upshrink_description'], '" style="display: none;" />';
    echo '
			', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '</div>', '
		</div>
		<div id="upper_section" class="middletext"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
			<div class="user">';
    // If the user is logged in, display stuff like their name, new messages, etc.
    if ($context['user']['is_logged']) {
        if (!empty($context['user']['avatar'])) {
            echo '
				<p class="avatar">', $context['user']['avatar']['image'], '</p>';
        }
        echo '
				<ul class="reset">
					<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
					<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
					<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';
        // Is the forum in maintenance mode?
        if ($context['in_maintenance'] && $context['user']['is_admin']) {
            echo '
					<li class="notice">', $txt['maintain_mode_on'], '</li>';
        }
        // Are there any members waiting for approval?
        if (!empty($context['unapproved_members'])) {
            echo '
					<li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';
        }
        if (!empty($context['open_mod_reports']) && $context['show_open_reports']) {
            echo '
					<li><a href="', $scripturl, '?action=moderate;area=reports">', sprintf($txt['mod_reports_waiting'], $context['open_mod_reports']), '</a></li>';
        }
        echo '
					<li>', $context['current_time'], '</li>
				</ul>';
    } elseif (!empty($context['show_login_bar'])) {
        echo '
				<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
				<form id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
					<div class="info">', sprintf($txt['welcome_guest'], $txt['guest_title']), '</div>
					<input type="text" name="user" size="10" class="input_text" />
					<input type="password" name="passwrd" size="10" class="input_password" />
					<select name="cookielength">
						<option value="60">', $txt['one_hour'], '</option>
						<option value="1440">', $txt['one_day'], '</option>
						<option value="10080">', $txt['one_week'], '</option>
						<option value="43200">', $txt['one_month'], '</option>
						<option value="-1" selected="selected">', $txt['forever'], '</option>
					</select>
					<input type="submit" value="', $txt['login'], '" class="button_submit" /><br />
					<div class="info">', $txt['quick_login_dec'], '</div>';
        if (!empty($modSettings['enableOpenID'])) {
            echo '
					<br /><input type="text" name="openid_identifier" id="openid_url" size="25" class="input_text openid_login" />';
        }
        echo '
					<input type="hidden" name="hash_passwrd" value="" />
				</form>';
    }
    echo '
			</div>
			<div class="news normaltext">
				<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
					<input type="text" name="search" value="" class="input_text" />&nbsp;
					<input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
					<input type="hidden" name="advanced" value="0" />';
    // Search within current topic?
    if (!empty($context['current_topic'])) {
        echo '
					<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
    } elseif (!empty($context['current_board'])) {
        echo '
					<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
    }
    echo '</form>';
    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news'])) {
        echo '
				<h2>', $txt['news'], ': </h2>
				<p>', $context['random_news_line'], '</p>';
    }
    echo '
			</div>
		</div>
		<br class="clear" />';
    // Define the upper_section toggle in JavaScript.
    echo '
		<script type="text/javascript"><!-- // --><![CDATA[
			var oMainHeaderToggle = new smc_Toggle({
				bToggleEnabled: true,
				bCurrentlyCollapsed: ', empty($options['collapse_header']) ? 'false' : 'true', ',
				aSwappableContainers: [
					\'upper_section\'
				],
				aSwapImages: [
					{
						sId: \'upshrink\',
						srcExpanded: smf_images_url + \'/upshrink.png\',
						altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
						srcCollapsed: smf_images_url + \'/upshrink2.png\',
						altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
					}
				],
				oThemeOptions: {
					bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
					sOptionName: \'collapse_header\',
					sSessionVar: ', JavaScriptEscape($context['session_var']), ',
					sSessionId: ', JavaScriptEscape($context['session_id']), '
				},
				oCookieOptions: {
					bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
					sCookieName: \'upshrink\'
				}
			});
		// ]]></script>';
    // Show the menu here, according to the menu sub template.
    template_menu();
    echo '
		<br class="clear" />
	</div></div>';
    // The main content should go here.
    echo '
	<div id="content_section"><div class="frame">
		<div id="main_content_section">';
    // Custom banners and shoutboxes should be placed here, before the linktree.
    // Show the navigation tree.
    theme_linktree();
}
Ejemplo n.º 6
0
function template_body_above()
{
    global $context, $settings, $scripturl, $txt, $modSettings;
    // Wrapper div now echoes permanently for better layout options. h1 a is now target for "Go up" links.
    echo '
	<div id="header">
		<div class="frame">
			<h1 class="forumtitle rubberBand">
				<a id="top" href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name_html_safe'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name_html_safe'] . '">', '</a>
			</h1>';
    echo '
			', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum">' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '</div>', '';
    echo '
		</div>
	</div>
	<div id="wrapper">
	<div id="top_section">
		<div class="frame">';
    // If the user is logged in, display some things that might be useful.
    if ($context['user']['is_logged']) {
        // Firstly, the user's menu
        echo '
			<ul class="floatleft" id="top_info">
				<li>
					<a class="welcomelen1" href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">';
        if (!empty($context['user']['avatar'])) {
            echo $context['user']['avatar']['image'];
        }
        echo $context['user']['name'], ' &#9660;</a>
					<div id="profile_menu" class="top_menu"></div>
				</li>';
        // Secondly, PMs if we're doing them
        if ($context['allow_pm']) {
            echo '
				<li>
					<a class="welcomelen1" href="', $scripturl, '?action=pm"', !empty($context['self_pm']) ? ' class="active"' : '', ' id="pm_menu_top">', $txt['pm_short'], !empty($context['user']['unread_messages']) ? ' <span class="amt">' . $context['user']['unread_messages'] . '</span>' : '', '</a>
					<div id="pm_menu" class="top_menu scrollable"></div>
				</li>';
        }
        // Thirdly, alerts
        echo '
				<li>
					<a class="welcomelen1" href="', $scripturl, '?action=profile;area=showalerts;u=', $context['user']['id'], '"', !empty($context['self_alerts']) ? ' class="active"' : '', ' id="alerts_menu_top">', $txt['alerts'], !empty($context['user']['alerts']) ? ' <span class="amt">' . $context['user']['alerts'] . '</span>' : '', '</a>
					<div id="alerts_menu" class="top_menu scrollable"></div>
				</li>';
        // And now we're done.
        echo '
			<li>
				<a class="welcomelen1" href="', $scripturl, '?action=unread" title="', $txt['unread_since_visit'], '">', $txt['view_unread_category'], '</a>
			</li><li>	
				<a class="welcomelen1" href="', $scripturl, '?action=unreadreplies" title="', $txt['show_unread_replies'], '">', $txt['unread_replies'], '</a>
			</li>
			</ul>';
    } else {
        echo '
			<ul class="floatleft welcome">
				<li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register1' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li>
			</ul>';
    }
    if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) {
        echo '
			<form id="languages_form" action="" method="get" class="floatright">
				<select id="language_select" name="language" onchange="this.form.submit()">';
        foreach ($context['languages'] as $language) {
            echo '
					<option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>';
        }
        echo '
				</select>
				<noscript>
					<input type="submit" value="', $txt['quick_mod_go'], '" />
				</noscript>
			</form>';
    }
    if ($context['allow_search']) {
        echo '<div class="konusal-search">
			<form  class="floatright" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
				<input type="search" name="search" value="" class="">&nbsp;';
        // Using the quick search dropdown?
        $selected = !empty($context['current_topic']) ? 'current_topic' : (!empty($context['current_board']) ? 'current_board' : 'all');
        echo '<label>
			<select name="search_selection">
				<option value="all"', $selected == 'all' ? ' selected' : '', '>', $txt['search_entireforum'], ' </option>';
        // Can't limit it to a specific topic if we are not in one
        if (!empty($context['current_topic'])) {
            echo '
				<option value="topic"', $selected == 'current_topic' ? ' selected' : '', '>', $txt['search_thistopic'], '</option>';
        }
        // Can't limit it to a specific board if we are not in one
        if (!empty($context['current_board'])) {
            echo '
					<option value="board"', $selected == 'current_board' ? ' selected' : '', '>', $txt['search_thisbrd'], '</option>';
        }
        echo '
					<option value="members"', $selected == 'members' ? ' selected' : '', '>', $txt['search_members'], ' </option>
				</select></label>';
        // Search within current topic?
        if (!empty($context['current_topic'])) {
            echo '
				<input type="hidden" name="sd_topic" value="', $context['current_topic'], '">';
        } elseif (!empty($context['current_board'])) {
            echo '
				<input type="hidden" name="sd_brd[', $context['current_board'], ']" value="', $context['current_board'], '">';
        }
        echo '
				<button type="submit" name="search2" value="', $txt['search'], '" >', $txt['search'], '</button>
				<input type="hidden" name="advanced" value="0">
			</form></div>';
    }
    echo '
		</div>
	</div>
		<div id="upper_section">
			<div id="inner_section">
				<div id="inner_wrap">
					<div class="user">
						', $context['current_time'], '
					</div>';
    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) {
        echo '
					<div class="news">
						<h2>', $txt['news'], ': </h2>
						<p>', $context['random_news_line'], '</p>
					</div>';
    }
    echo '
					<hr class="clear">
				</div>';
    // Show the menu here, according to the menu sub template, followed by the navigation tree.
    theme_linktree();
    global $context, $settings, $scripturl, $txt, $modSettings;
    require_once $settings['theme_dir'] . '/konusal-com.php';
    if (empty($context['current_board']) && empty($context['current_action'])) {
        global $context, $options, $txt;
        // Here's where the "Info Center" starts...
        echo '
	<div class="roundframe" id="info_center">
		<div class="title_bar">
			<h3 class="titlebg">
				<span class="toggle_up floatright" id="upshrink_ic" title="', $txt['hide_infocenter'], '" style="display: none;"></span>
				<a href="#" id="upshrink_link">', sprintf($txt['info_center_title'], $context['forum_name_html_safe']), '</a>
			</h3>
		</div>
		<div id="upshrinkHeaderIC"', empty($options['collapse_header_ic']) ? '' : ' style="display: none;"', '>';
        top10();
        echo '
		</div>
	</div>';
        // Info center collapse object.
        echo '
	<script><!-- // --><![CDATA[
		var oInfoCenterToggle = new smc_Toggle({
			bToggleEnabled: true,
			bCurrentlyCollapsed: ', empty($options['collapse_header_ic']) ? 'false' : 'true', ',
			aSwappableContainers: [
				\'upshrinkHeaderIC\'
			],
			aSwapImages: [
				{
					sId: \'upshrink_ic\',
					altExpanded: ', JavaScriptEscape($txt['hide_infocenter']), ',
					altCollapsed: ', JavaScriptEscape($txt['show_infocenter']), '
				}
			],
			aSwapLinks: [
				{
					sId: \'upshrink_link\',
					msgExpanded: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), ',
					msgCollapsed: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), '
				}
			],
			oThemeOptions: {
				bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
				sOptionName: \'collapse_header_ic\',
				sSessionId: smf_session_id,
				sSessionVar: smf_session_var,
			},
			oCookieOptions: {
				bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
				sCookieName: \'upshrinkIC\'
			}
		});
	// ]]></script>';
    }
    template_menu();
    echo '
			</div>
		</div>';
    // The main content should go here.
    echo '
		<div id="content_section">             
			<div class="scrollbar-light" id="main_content_section" >';
}
Ejemplo n.º 7
0
function template_main_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    // Show right to left and the character set for ease of translating.
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
	<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
	<meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
	<meta name="robots" content="noindex" />', '
	<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
	<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>
	<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
		var smf_theme_url = "', $settings['theme_url'], '";
		var smf_images_url = "', $settings['images_url'], '";
		var smf_scripturl = "', $scripturl, '";
		var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
		var smf_charset = "', $context['character_set'], '";
	// ]]></script>
	<title>', $context['page_title'], '</title>';
    // The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
    echo '
	<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?fin11" />
	<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />';
    /* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
    		Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
    		Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
    		Standards compliance mode happens when you use xhtml... */
    if ($context['browser']['needs_size_fix']) {
        echo '
	<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';
    }
    // Show all the relative links, such as help, search, contents, and the like.
    echo '
	<link rel="help" href="', $scripturl, '?action=help" target="_blank" />
	<link rel="search" href="' . $scripturl . '?action=search" />
	<link rel="contents" href="', $scripturl, '" />';
    // If RSS feeds are enabled, advertise the presence of one.
    if (!empty($modSettings['xmlnews_enable'])) {
        echo '
	<link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';
    }
    // If we're viewing a topic, these should be the previous and next topics, respectively.
    if (!empty($context['current_topic'])) {
        echo '
	<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
	<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';
    }
    // 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 '
	<link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';
    }
    // We'll have to use the cookie to remember the header...
    if ($context['user']['is_guest']) {
        $options['collapse_header'] = !empty($_COOKIE['upshrink']);
    }
    // Output any remaining HTML headers. (from mods, maybe?)
    echo $context['html_headers'], '

	<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
		var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

		function shrinkHeader(mode)
		{';
    // Guests don't have theme options!!
    if ($context['user']['is_guest']) {
        echo '
			document.cookie = "upshrink=" + (mode ? 1 : 0);';
    } else {
        echo '
			smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';
    }
    echo '
			document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

			document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";

			current_header = mode;
		}
	// ]]></script>
</head>
<body>';
    // 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%!)
    echo '
	<div id="headerarea" style="padding: 12px 30px 4px 30px;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">';
    // The logo and the three info boxes.
    echo '
		<table cellspacing="0" cellpadding="0" border="0" width="100%" style="position: relative;">
			<tr>
				<td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">';
    // This part is the logo and forum name.  You should be able to change this to whatever you want...
    echo '
					<img src="', $settings['images_url'], '/smflogo.gif" style="width: 250px; float: ', !$context['right_to_left'] ? 'right' : 'left', ';" alt="" />';
    if (empty($settings['header_logo_url'])) {
        echo '
					<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>';
    } else {
        echo '
					<img src="', $settings['header_logo_url'], '" alt="', $context['forum_name'], '" border="0" />';
    }
    echo '
				</td>
			</tr>
			<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
				<td valign="top">
					<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
					<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url(', $settings['images_url'], '/box_bg.gif);">
						<img src="', $settings['images_url'], '/', $context['user']['language'], '/userinfo.gif" style="position: absolute; left: ', $context['browser']['is_ie5'] || $context['browser']['is_ie4'] ? '0' : '-1px', '; top: -16px; clear: both;" alt="" />
						<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';
    if (!empty($context['user']['avatar'])) {
        echo '<td valign="middle">', $context['user']['avatar']['image'], '</td>';
    }
    echo '<td valign="top" class="smalltext" style="width: 100%; font-family: verdana, arial, sans-serif;">';
    // If the user is logged in, display stuff like their name, new messages, etc.
    if ($context['user']['is_logged']) {
        echo '
							', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>';
        // Only tell them about their messages if they can read their messages!
        if ($context['allow_pm']) {
            echo ', ', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
        }
        echo '.<br />';
        // Is the forum in maintenance mode?
        if ($context['in_maintenance'] && $context['user']['is_admin']) {
            echo '
							<b>', $txt[616], '</b><br />';
        }
        // Are there any members waiting for approval?
        if (!empty($context['unapproved_members'])) {
            echo '
							', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';
        }
        // Show the total time logged in?
        if (!empty($context['user']['total_time_logged_in'])) {
            echo '
							', $txt['totalTimeLogged1'];
            // If days is just zero, don't bother to show it.
            if ($context['user']['total_time_logged_in']['days'] > 0) {
                echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];
            }
            // Same with hours - only show it if it's above zero.
            if ($context['user']['total_time_logged_in']['hours'] > 0) {
                echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
            }
            // But, let's always show minutes - Time wasted here: 0 minutes ;).
            echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
        }
        echo '
							<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
							<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
							', $context['current_time'];
    } else {
        echo '
							', $txt['welcome_guest'], '<br />
							', $context['current_time'], '<br />

							<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

							<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
								<div style="text-align: right;">
									<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
									<select name="cookielength">
										<option value="60">', $txt['smf53'], '</option>
										<option value="1440">', $txt['smf47'], '</option>
										<option value="10080">', $txt['smf48'], '</option>
										<option value="43200">', $txt['smf49'], '</option>
										<option value="-1" selected="selected">', $txt['smf50'], '</option>
									</select>
									<input type="submit" value="', $txt[34], '" /><br />
									', $txt['smf52'], '
									<input type="hidden" name="hash_passwrd" value="" />
								</div>
							</form>';
    }
    echo '
						</td></tr></table>
					</div>

					<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
						<div style="margin-top: 7px;">
							<b>', $txt[182], ': </b><input type="text" name="search" value="" style="width: 190px;" />&nbsp;
							<input type="submit" name="submit" value="', $txt[182], '" style="width: 8ex;" />&nbsp;
							<a href="', $scripturl, '?action=search;advanced">', $txt['smf298'], '</a>
							<input type="hidden" name="advanced" value="0" />';
    // Search within current topic?
    if (!empty($context['current_topic'])) {
        echo '
							<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
    } elseif (!empty($context['current_board'])) {
        echo '
							<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
    }
    echo '
						</div>
					</form>

				</td>
				<td style="width: 262px; ', !$context['right_to_left'] ? 'padding-left' : 'padding-right', ': 6px;" valign="top">';
    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news'])) {
        echo '
					<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
					<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif); margin-bottom: 8px;">
						<img src="', $settings['images_url'], '/', $context['user']['language'], '/newsbox.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
						<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">', $context['random_news_line'], '</div>
					</div>';
    }
    // The "key stats" box.
    echo '
					<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
					<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif);">
						<img src="', $settings['images_url'], '/', $context['user']['language'], '/keystats.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
						<div style="', !$context['browser']['is_ie'] ? 'min-height: 35px;' : 'height: 4em;', ' padding: 5px;" class="smalltext">
							<b>', $context['common_stats']['total_posts'], '</b> ', $txt[95], ' ', $txt['smf88'], ' <b>', $context['common_stats']['total_topics'], '</b> ', $txt[64], ' ', $txt[525], ' <span style="white-space: nowrap;"><b>', $context['common_stats']['total_members'], '</b> ', $txt[19], '</span><br />
							', $txt[656], ': <b> ', $context['common_stats']['latest_member']['link'], '</b>
						</div>
					</div>';
    echo '
				</td>
			</tr>
		</table>

		<a href="javascript:void(0);" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 2ex 2px 0;" border="0" /></a>';
    // Show the menu here, according to the menu sub template.
    template_menu();
    echo '
	</div>';
    // The main content should go here.  A table is used because IE 6 just can't handle a div.
    echo '
	<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
		<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">';
}
/**
 * Section above the main contents of the page, after opening the body tag
 */
function template_body_above()
{
    global $context, $settings, $scripturl, $txt, $modSettings;
    // Go to top/bottom of page links and skipnav link for a11y.
    echo '
	<a id="top" href="#skipnav">', $txt['skip_nav'], '</a>
	<a href="#top" id="gotop" title="', $txt['go_up'], '">&#8593;</a>
	<a href="#bot" id="gobottom" title="', $txt['go_down'], '">&#8595;</a>';
    // Skip nav link.
    echo '
	<div id="top_section">
		<div class="wrapper">';
    call_template_callbacks('th', $context['theme_header_callbacks']);
    echo '
		</div>
		<div id="header" class="wrapper centerheader"', empty($context['minmax_preferences']['upshrink']) ? '' : ' style="display: none;" aria-hidden="true"', '>

			<div id="logobox">';
    if (!empty($settings['header_logo_url'])) {
        echo '
			<h1 id="forumtitle">
			    <a href="', $scripturl, '"><img id="logo" src="', $settings['header_logo_url'], '" alt="', $context['forum_name_html_safe'], '" title="', $context['forum_name_html_safe'], '" /></a>
			</h1>';
    } else {
        echo '
			<h1 id="forumtitle">
				<a href="', $scripturl, '">', $context['forum_name'], '</a>
			</h1>';
    }
    echo '
		</div>', empty($settings['site_slogan']) ? '' : '';
    echo '
			    <div id="siteslogan" class="bluelkslogan">' . $settings['site_slogan'] . '<br /></div>', '
			   </div>';
    // Show the menu here, according to the menu sub template.
    // WAI-ARIA a11y tweaks have been applied here.
    echo '
		<div id="menu_nav" role="navigation">
			', template_menu(), '
		</div>
	</div>
	<div id="wrapper" class="wrapper">
		<div id="upper_section"', empty($context['minmax_preferences']['upshrink']) ? '' : ' style="display: none;" aria-hidden="true"', '>';
    call_template_callbacks('uc', $context['upper_content_callbacks']);
    echo '
		</div>';
    // Show the navigation tree.
    theme_linktree();
    // The main content should go here. @todo - Skip nav link.
    echo '
		<div id="main_content_section"><a id="skipnav"></a>';
}
Ejemplo n.º 9
0
function template_body_above()
{
    global $context, $settings, $scripturl, $txt, $modSettings;
    // Wrapper div now echoes permanently for better layout options. h1 a is now target for "Go up" links.
    echo '
	<div id="top_section">
		<div class="frame">';
    // If the user is logged in, display some things that might be useful.
    if ($context['user']['is_logged']) {
        // Firstly, the user's menu
        echo '
			<ul class="floatleft" id="top_info">
				<li>
					<a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">';
        if (!empty($context['user']['avatar'])) {
            echo $context['user']['avatar']['image'];
        }
        echo $context['user']['name'], ' &#9660;</a>
					<div id="profile_menu" class="top_menu"></div>
				</li>';
        // Secondly, PMs if we're doing them
        if ($context['allow_pm']) {
            echo '
				<li>
					<a href="', $scripturl, '?action=pm"', !empty($context['self_pm']) ? ' class="active"' : '', ' id="pm_menu_top">', $txt['pm_short'], !empty($context['user']['unread_messages']) ? ' <span class="amt">' . $context['user']['unread_messages'] . '</span>' : '', '</a>
					<div id="pm_menu" class="top_menu scrollable"></div>
				</li>';
        }
        // Thirdly, alerts
        echo '
				<li>
					<a href="', $scripturl, '?action=profile;area=showalerts;u=', $context['user']['id'], '"', !empty($context['self_alerts']) ? ' class="active"' : '', ' id="alerts_menu_top">', $txt['alerts'], !empty($context['user']['alerts']) ? ' <span class="amt">' . $context['user']['alerts'] . '</span>' : '', '</a>
					<div id="alerts_menu" class="top_menu scrollable"></div>
				</li>';
        // And now we're done.
        echo '
			</ul>';
    } else {
        echo '
			<ul class="floatleft welcome">
				<li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li>
			</ul>';
    }
    if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) {
        echo '
			<form id="languages_form" action="" method="get" class="floatright">
				<select id="language_select" name="language" onchange="this.form.submit()">';
        foreach ($context['languages'] as $language) {
            echo '
					<option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>';
        }
        echo '
				</select>
				<noscript>
					<input type="submit" value="', $txt['quick_mod_go'], '" />
				</noscript>
			</form>';
    }
    if ($context['allow_search']) {
        echo '
			<form id="search_form" class="floatright" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
				<input type="search" name="search" value="" class="input_text">&nbsp;';
        // Using the quick search dropdown?
        $selected = !empty($context['current_topic']) ? 'current_topic' : (!empty($context['current_board']) ? 'current_board' : 'all');
        echo '
			<select name="search_selection">
				<option value="all"', $selected == 'all' ? ' selected' : '', '>', $txt['search_entireforum'], ' </option>';
        // Can't limit it to a specific topic if we are not in one
        if (!empty($context['current_topic'])) {
            echo '
				<option value="topic"', $selected == 'current_topic' ? ' selected' : '', '>', $txt['search_thistopic'], '</option>';
        }
        // Can't limit it to a specific board if we are not in one
        if (!empty($context['current_board'])) {
            echo '
					<option value="board"', $selected == 'current_board' ? ' selected' : '', '>', $txt['search_thisbrd'], '</option>';
        }
        echo '
					<option value="members"', $selected == 'members' ? ' selected' : '', '>', $txt['search_members'], ' </option>
				</select>';
        // Search within current topic?
        if (!empty($context['current_topic'])) {
            echo '
				<input type="hidden" name="sd_topic" value="', $context['current_topic'], '">';
        } elseif (!empty($context['current_board'])) {
            echo '
				<input type="hidden" name="sd_brd[', $context['current_board'], ']" value="', $context['current_board'], '">';
        }
        echo '
				<input type="submit" name="search2" value="', $txt['search'], '" class="button_submit">
				<input type="hidden" name="advanced" value="0">
			</form>';
    }
    echo '
		</div>
	</div>';
    echo '
		<!-- Uses a header that scrolls with the text, rather than staying
  locked at the top -->
<div class="mdl-layout mdl-js-layout mdl-layout--overlay-drawer-button">
  <div class="mdl-layout__drawer">
    <span class="mdl-layout-title">', $context['user']['name'], '</span>
    <nav class="mdl-navigation">
      ', template_menu_mdl(), '
    </nav>
  </div>
  <main class="mdl-layout__content">
    <div class="page-content">
	';
    echo '
	<div id="header">
		<a id="top" href="', $scripturl, '"><img id="hlogo" src="', $settings['theme_url'], '/images/logo.png" alt="' . $context['forum_name_html_safe'] . '"></a>
	';
    echo '
	</div>
	<div id="wrapper">
		<div id="upper_section">
			<div id="inner_section">
				<div id="inner_wrap">
					<div class="user">
						', $context['current_time'], '
					</div>';
    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) {
        echo '
					<div class="news">
						<h2>', $txt['news'], ': </h2>
						<p>', $context['random_news_line'], '</p>
					</div>';
    }
    echo '
					<hr class="clear">
				</div>';
    // Show the menu here, according to the menu sub template, followed by the navigation tree.
    template_menu();
    theme_linktree();
    echo '
			</div>
		</div>';
    // The main content should go here.
    echo '
		<div id="content_section">
			<div id="main_content_section">';
}
Ejemplo n.º 10
0
function template_body_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    echo '
    <div id="wrapper">
	   <div id="topbar">
			<div id="memb_time">
						<span>', $context['current_time'], '</span>
					</div>
					  <div id="user_area">';
    // If the user is logged in, display stuff like their name, new messages, etc.
    if ($context['user']['is_logged']) {
        if (!empty($context['user']['avatar'])) {
            echo '
							<p class="your_avatar"><a href="', $scripturl, '?action=profile">' . $context['user']['avatar']['image'] . '</a></p>';
        }
        echo '
							<ul>
								<li class="user_greeting">', $txt['hello_member_ndt'], ' ', $context['user']['name'], '</li>';
        echo '
								<li><a href="', $scripturl, '?action=unread">', $txt['show_unread'], '</a></li>
								<li><a class="last" href="', $scripturl, '?action=unreadreplies">', $txt['show_replies'], '</a></li>';
        echo '
							</ul>';
    } else {
        echo '
				  <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
				  <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 4px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
					<input type="text" name="user" class="userlog"  size="10" />
					<input type="password" name="passwrd" class="userlog"  size="10" />
					<input type="submit" value="', $txt['login'], '" class="button_submit" />
					<input type="hidden" name="hash_passwrd" value="" />
				</form>';
    }
    echo '
	  </div>
	</div>';
    echo '
          <div id="header">
			 <div id="logo">
				<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="' . $settings['images_url'] . '/theme/logo.png" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />' : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />', '</a>
			  </div></div>';
    echo '

			<div id="bodyarea">
		      <div id="navibar">
               <div id="center-menu">
		       ', template_menu(), '
		       </div>
              </div>';
    theme_linktree();
}
Ejemplo n.º 11
0
function template_body_above()
{
    global $context, $settings, $scripturl, $txt, $modSettings;
    // Wrapper div now echoes permanently for better layout options. h1 a is now target for "Go up" links.
    echo '
	<div id="ust">
		<div class="frame">';
    // If the user is logged in, display some things that might be useful.
    if ($context['user']['is_logged']) {
        // Firstly, the user's menu
        echo '
			<ul class="floatleft" id="top_info">
				<li>
					<a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">';
        if (!empty($context['user']['avatar'])) {
            echo $context['user']['avatar']['image'];
        }
        echo $context['user']['name'], ' &#9660;</a>
					<div id="profile_menu" class="top_menu"></div>
				</li>';
        // Secondly, PMs if we're doing them
        if ($context['allow_pm']) {
            echo '
				<li>
					<a href="', $scripturl, '?action=pm"', !empty($context['self_pm']) ? ' class="active"' : '', ' id="pm_menu_top">', $txt['pm_short'], !empty($context['user']['unread_messages']) ? ' <span class="amt">' . $context['user']['unread_messages'] . '</span>' : '', '</a>
					<div id="pm_menu" class="top_menu scrollable"></div>
				</li>';
        }
        // Thirdly, alerts
        echo '
				<li>
					<a href="', $scripturl, '?action=profile;area=showalerts;u=', $context['user']['id'], '"', !empty($context['self_alerts']) ? ' class="active"' : '', ' id="alerts_menu_top">', $txt['alerts'], !empty($context['user']['alerts']) ? ' <span class="amt">' . $context['user']['alerts'] . '</span>' : '', '</a>
					<div id="alerts_menu" class="top_menu scrollable"></div>
				</li>';
        // And now we're done.
        echo '
			</ul>';
    } else {
        echo '
			<ul class="floatleft welcome">
				<li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li>
			</ul>';
    }
    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) {
        echo '
					<div class="news">
						<h2>', $txt['news'], ': </h2>
						<p>', $context['random_news_line'], '</p>
					</div>';
    }
    global $db_prefix, $scripturl, $smcFunc;
    $request = $smcFunc['db_query']('', "SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.totaldownloads, f.title AS ftitle,\n\t  c.title, m.real_Name, m.ID_MEMBER AS mID_MEMBER\n\t  FROM {$db_prefix}down_file AS f, {$db_prefix}down_cat AS c, {$db_prefix}members AS m\n\t  WHERE f.ID_CAT = '7'\n\t  AND f.approved = '1'\n\t  AND f.ID_MEMBER = m.ID_MEMBER\n\t  ORDER BY RAND()\n\t  LIMIT 1");
    while ($row = $smcFunc['db_fetch_assoc']($request)) {
        echo '
		  <div class="solborder rightla"><a href="', $scripturl, '?action=downloads;sa=view;id=', $row['ID_FILE'], '" title="', $row['ftitle'], '">' . shorten_subject($row['ftitle'], 30) . '</a></div>';
    }
    echo '
		</div>
	</div>';
    echo '
	<div class="menuyeri">
	<div id="mcolor" class="floatright">
			<a class="mor" href="', $scripturl, '?variant=mor" title=""></a>
			<a class="red" href="', $scripturl, '?variant=red" title=""></a>
			<a class="blue" href="', $scripturl, '?variant=blue" title=""></a>
			<a class="green" href="', $scripturl, '?variant=green" title=""></a>
			<a class="orange" href="', $scripturl, '?variant=orange" title=""></a>	
			<a class="black" href="', $scripturl, '?variant=black" title=""></a>
    </div>
		<div class="frame">
			<a href="', $scripturl, '" title="Smf Destek"><img id="logos" src="' . $settings['images_url'] . '/theme/logo.png" alt="smfdestek" title="Smf Destek"></a>';
    template_menu();
    if ($context['allow_search']) {
        echo '
			<form id="aramaz" class="floatright" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
				<input type="search" name="search" value="" class="aramaz">&nbsp;';
        // Search within current topic?
        if (!empty($context['current_topic'])) {
            echo '
				<input type="hidden" name="sd_topic" value="', $context['current_topic'], '">';
        } elseif (!empty($context['current_board'])) {
            echo '
				<input type="hidden" name="sd_brd[', $context['current_board'], ']" value="', $context['current_board'], '">';
        }
        echo '
			</form>';
    }
    echo '
		  </div>
	</div>';
    echo '
	<div id="wrapper">
			<div id="inner_section">';
    // Show the menu here, according to the menu sub template, followed by the navigation tree.
    theme_linktree();
    echo '
		</div>';
    // The main content should go here.
}
function template_body_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    /*Empezando a escribir lo del body, thx smf*/
    /*Navbar responsive, estilizada al foro*/
    echo '
			<header class="header header-transparent header-waterfall">

				<table>
					<tr>
						<td class="tresrayas">
							<ul class="nav nav-list pull-left">
								<li>
									<a data-toggle="menu" href="#al_menu">
										<span class="icon icon-lg">menu</span>
									</a>
								</li>
							</ul>
						</td>
						<td class="titulo-overflow contenido">

							<a class="header-affix-hide header-logo margin-left-no margin-right-no" data-offset-top="50" data-spy="affix" href="', $scripturl, '">', $context['forum_name'], '</a>

							<h1><span class="header-affix header-logo margin-left-no margin-right-no" data-offset-top="50" data-spy="affix">';
    //Trabajando en el fix del titulo, ya que esto afecta solo al index.template.php
    //Sacar el forumname
    $valnombre = strlen($context['forum_name']);
    $valortitulo = substr($context['page_title_html_safe'], 0, $valnombre);
    //Aca se pregunta si tiene un valor igual al nombre de foro, asi se sabe que hacer. En caso de que si, se hace una cuenta para mostrar solo index
    if ($valortitulo == $context['forum_name']) {
        $rmtitulo = strlen($context['forum_name']) + 3;
        $cttitulo = strlen($context['page_title_html_safe']);
        echo substr($context['page_title_html_safe'], $rmtitulo, $cttitulo);
    } else {
        echo $context['page_title_html_safe'];
    }
    echo '</span></h1>
						</td>




						<td class="tbusqueda ocultar-pequeno">
							<div class="busqueda  ">
								<form action="https://www.google.com" id="cse-search-box">
									<div>
										<input type="hidden" name="cx" value="partner-pub-5234228783629303:3299510057" />
										<input type="hidden" name="ie" value="UTF-8" />
										<input style="background-color:transparent; " type="text" name="q" class="form-control" />
										<input class="oculto" type="submit" name="sa" value="Buscar" />
									</div>
								</form>

								<script type="text/javascript" src="https://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=es"></script>

							</div>
						</td>
						<td class="menu-usuario">
							<ul class="nav nav-list pull-right">
								<li class="dropdown margin-right">
									<a class="dropdown-toggle padding-left-no padding-right-no" data-toggle="dropdown">
										<span class="access-hide">', $context['user']['name'], '</span>
										<span class="avatar avatar-sm"><img alt="avatar de ', $context['user']['name'], '" src="', !empty($context['user']['avatar']['href']) ? $context['user']['avatar']['href'] : $settings['images_url'] . '/noavatar.png', '" alt="', $context['user']['name'], '" /></span>
									</a>
									<ul class="dropdown-menu">';
    if ($context['user']['is_logged']) {
        echo '
												<li>
													<a class="padding-right-lg waves-attach" href="', $scripturl, '?action=profile;area=forumprofile;"><span class="icon icon-lg margin-right">edit</span>', $txt['edit_profile'], '</a>
												</li>
												<li>
													<a class="padding-right-lg waves-attach" href="', $scripturl, '?action=profile;area=account;"><span class="icon icon-lg margin-right">account_box</span>', $txt['profile_account'], '</a>
												</li>
												<li>
													<a class="padding-right-lg waves-attach" href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><span class="icon icon-lg margin-right">exit_to_app</span>', $txt['logout'], '</a>
												</li>';
    } else {
        echo '
												<li>
													<a class="padding-right-lg waves-attach" href="', $scripturl, '?action=login"><span class="icon icon-lg margin-right">person</span>', $txt['login'], '</a>
												</li>
												<li>
													<a class="padding-right-lg waves-attach" href="', $scripturl, '?action=register"><span class="icon icon-lg margin-right">assignment_ind</span>', $txt['register'], '</a>
												</li>';
    }
    echo '
									</ul>
								</li>
							</ul>
						</td>
					</tr>
				</table>
			</header>

	';
    //Añadiendo el panel de usuario de Materialize adaptado a este FW.
    echo '
	<nav aria-hidden="true" class="menu" id="al_menu" tabindex="-1">
		<div class="menu-scroll mdc-bg-blue-grey-700">
			<div class="menu-top">
				<div class="menu-top-img">
					<img src="', !empty($context['user']['avatar']['href']) ? $context['user']['avatar']['href'] : $settings['images_url'] . '/material/defaultbg.png', '" alt="User Background ', $context['user']['name'], '" >
				</div>
				<div class="menu-top-info">
					<a class="menu-top-user" href="', $scripturl, '?action=profile"><span class="avatar pull-left"><img src="', !empty($context['user']['avatar']['href']) ? $context['user']['avatar']['href'] : $settings['images_url'] . '/noavatar.png', '" alt="', $context['user']['name'], '"></span>';
    if ($context['user']['is_logged']) {
        echo $context['user']['name'];
    } else {
        echo $txt['guest_title'];
    }
    echo '
					</a>
				</div>
				<div class="menu-top-info-sub">
					<small>    Menú de Usuario    </small>
				</div>
			</div>
			<div class="menu-content">
				<ul class="nav">
				<li>
					<a class="waves-attach" href="', $scripturl, '"><span class="icon icon-lg margin-right">home</span>', $txt['home'], '</a>
				</li>';
    //Editando el listado para mostrar los menus mas importantes del mod
    if (!empty($context['user']['is_logged'])) {
        echo '
					<li>
						<a class="waves-attach" href="', $scripturl, '?action=profile"><span class="icon icon-lg margin-right">account_circle</span>', $txt['forumprofile_short'], '</a>
					</li>
					<li>
						<a class="waves-attach" href="', $scripturl, '?action=pm"><span class="icon icon-lg margin-right">inbox</span>', $txt['pm'], '</a>
					</li>
					<li class="hidden-md">
						<a class="waves-attach" href="javascript:void(0)" data-target="#doc_menu_profile_settings" data-toggle="collapse"><span class="icon icon-lg margin-right">menu</span>', $txt['almenu'], '</a>
						<span class="collapsed menu-collapse-toggle waves-attach" data-target="#doc_menu_profile_settings" data-toggle="collapse"><i class="icon menu-collapse-toggle-close">close</i><i class="icon menu-collapse-toggle-default">add</i></span>
						<ul class="collapse menu-collapse" id="doc_menu_profile_settings">';
        menu_lateral();
        echo '</ul>
					</li>';
        // Muestra los Likes del Like Mod
        if (!empty($modSettings['LikePosts::$LikePostsUtils->showLikeNotification())'])) {
            echo '
					<li>
						<a class="waves-attach" href="', $scripturl, '?action=likepostsstats"><span class="icon icon-lg margin-right">thumb_up</span>', $txt['like_show_notifications'], '</a>
					</li>';
        }
    }
    echo '<li>
						<a class="waves-attach" href="', $scripturl, '?action=help"><span class="icon icon-lg margin-right">help</span>', $txt['help'], '</a>
					</li>
				</ul>
			</div>
		</div>
	</nav>';
    //Añadiendo un content, en el cual despues vemos si agregar algo mas
    echo '
	<div class="content">
		<div class="content-heading">
		</div>
		<div class="container">
			<div class="row">
				<div class="visible-md-block visible-lg-block">
					<div class="card margin-bottom-no">
				    <div class="card-main">
			        <div class="card-inner mdc-text-grey-900"  style="margin-bottom: 0px;">
								<div class="container">
									<div class="row">
										<div class="col-md-6">
										';
    if (!$context['user']['is_logged']) {
        // Otherwise they're a guest - this time ask them to either register or login - lazy bums...
        echo '
											<form class="form-inline" id="login-form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
												<div class="container-fluid">
													<div class="col-md-6">
														<div class="form-group sinmargen">
															<div class="form-group-label sinmargen">
																<label class="floating-label" for="', $txt['username'], '">', $txt['username'], '</label>
																<input type="text" name="user" size="10" class="form-control" placeholder="', $txt['username'], '"/>
															</div>
															<div class="form-group-label sinmargen" style="margin-top: 10px;">
																<label class="floating-label" for="', $txt['password'], '">', $txt['password'], '</label>														
																<input type="password" name="passwrd" size="10" class="form-control" placeholder="', $txt['password'], '"/>
															</div>
														</div>
																			';
        if (!empty($modSettings['enableOpenID'])) {
            echo '
														<input placeholder="', $txt['openid'], ' no Obligatorio" type="text" name="openid_identifier" id="openid_url" size="25" class="form-control openid_login" />';
        }
        echo '
														<input type="hidden" name="hash_passwrd" value="" />
													</div>
													<div class="col-md-6">
														<div class="form-group sinmargen">
															<select name="cookielength" class="form-control">
																<option value="60">', $txt['one_hour'], '</option>
																<option value="1440">', $txt['one_day'], '</option>
																<option value="10080">', $txt['one_week'], '</option>
																<option value="43200">', $txt['one_month'], '</option>
																<option value="-1" selected="selected">', $txt['forever'], '</option>
															</select>
														</div>
														<div>
															<a href="#" onclick="document.getElementById(\'login-form\').submit()" class="btn mdc-text-blue-800 btn-flat waves-attach waves-button waves-effect">', $txt['login'], '</a>
															<a class="btn mdc-text-blue-800 btn-flat waves-attach waves-button" href="', $scripturl, '?action=register">', $txt['register'], '
															</a>
															<span class="oculto">
																<input type="submit" value="', $txt['login'], '" class="btn btn-default" />
															</span>
														</div>
													</div>
												</div>
											</form>
														';
    } else {
        echo '
											<div class="bienvenido">
												', $txt['welmsg_welcome'] . ' ' . $context['user']['name'] . '
											</div>
														';
        echo '
											<div>
												<a class="btn mdc-text-blue-800 btn-flat waves-attach waves-button" href="', $scripturl, '?action=unread"> ', $txt['view_unread_category'], '
												</a>
								        <a class="btn mdc-text-blue-800 btn-flat waves-attach waves-button" href="', $scripturl, '?action=unreadreplies"> ', $txt['replies'], '</a>
											</div>';
        // Is the forum in maintenance mode?
        if ($context['in_maintenance'] && $context['user']['is_admin']) {
            echo '<span class="notice">', $txt['maintain_mode_on'], '</span>';
        }
        // Are there any members waiting for approval?
        if (!empty($context['unapproved_members'])) {
            echo '<span>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</span>';
        }
        if (!empty($context['open_mod_reports']) && $context['show_open_reports']) {
            echo '<span><a href="', $scripturl, '?action=moderate;area=reports">', sprintf($txt['mod_reports_waiting'], $context['open_mod_reports']), '</a></span>';
        }
    }
    echo '
										</div>
										<div class="col-md-6">
										';
    //aqui para noticias en dispositivos grandes
    echo '
											<div class="text-center">', $txt['date'], ': ', $context['current_time'], '.</div>
											';
    if (!empty($settings['enable_news'])) {
        echo show_news("desktop");
    }
    echo '
										</div>
									</div>
								</div>

								<div class="row">
									<div class="container ">
										<div class="visible-md-block visible-lg-block">
												', template_menu(), '
										</div>
									</div>
								</div>
							</div>';
    //aqui debe de ir el div dard action
    echo '
						</div>
					</div>
				</div>
			</div>
		</div>


	';
    //dejo sin cerrar el <div class="content"> para cerrar en el final del documento
    // Agregar la seccion de noticias desplazables para tablets y celulares.
    if (!empty($settings['enable_news'])) {
        echo show_news("movil");
    }
    // Define the upper_section toggle in JavaScript.
    echo '
		<div class="clearfix"></div>';
    // The main content should go here.
    echo '
	<main class="contenedor">
		<div class="container">
			<div class="row">
				<div class="col-xs-12">
	';
    // Custom banners and shoutboxes should be placed here, before the linktree.
    // Show the navigation tree.
    theme_linktree();
    echo '

	';
}
Ejemplo n.º 13
0
function template_main_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    // Show right to left and the character set for ease of translating.
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
	<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
	<meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
	<meta name="robots" content="noindex" />', '
	<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
	<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>
	<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
		var smf_theme_url = "', $settings['theme_url'], '";
		var smf_images_url = "', $settings['images_url'], '";
		var smf_scripturl = "', $scripturl, '";
		var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
		var smf_charset = "', $context['character_set'], '";
	// ]]></script>
	<title>', $context['page_title'], '</title>';
    // The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
    echo '
	<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?fin11" />
	<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />';
    /* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
    		Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
    		Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
    		Standards compliance mode happens when you use xhtml... */
    if ($context['browser']['needs_size_fix']) {
        echo '
	<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';
    }
    // Show all the relative links, such as help, search, contents, and the like.
    echo '
	<link rel="help" href="', $scripturl, '?action=help" target="_blank" />
	<link rel="search" href="' . $scripturl . '?action=search" />
	<link rel="contents" href="', $scripturl, '" />';
    // If RSS feeds are enabled, advertise the presence of one.
    if (!empty($modSettings['xmlnews_enable'])) {
        echo '
	<link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';
    }
    // If we're viewing a topic, these should be the previous and next topics, respectively.
    if (!empty($context['current_topic'])) {
        echo '
	<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
	<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';
    }
    // 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 '
	<link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';
    }
    // We'll have to use the cookie to remember the header...
    if ($context['user']['is_guest']) {
        $options['collapse_header'] = !empty($_COOKIE['upshrink']);
        $options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
    }
    // Output any remaining HTML headers. (from mods, maybe?)
    echo $context['html_headers'], '

	<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
		var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

		function shrinkHeader(mode)
		{';
    // Guests don't have theme options!!
    if ($context['user']['is_guest']) {
        echo '
			document.cookie = "upshrink=" + (mode ? 1 : 0);';
    } else {
        echo '
			smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';
    }
    echo '
			document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

			document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
			document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

			current_header = mode;
		}
	// ]]></script>';
    // the routine for the info center upshrink
    echo '
		<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
			var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';

			function shrinkHeaderIC(mode)
			{';
    if ($context['user']['is_guest']) {
        echo '
				document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';
    } else {
        echo '
				smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';
    }
    echo '
				document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

				document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

				current_header_ic = mode;
			}
		// ]]></script>
</head>
<body>';
    echo '
	<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td class="catbg" height="32">';
    if (empty($settings['header_logo_url'])) {
        echo '
					<span style="font-family: Verdana, sans-serif; font-size: 140%; ">', $context['forum_name'], '</span>';
    } else {
        echo '
					<img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />';
    }
    echo '
				</td>
				<td align="right" class="catbg">
					<img src="', $settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
				</td>
			</tr>
		</table>';
    // display user name
    echo '
		<table width="100%" cellpadding="0" cellspacing="0" border="0" >
			<tr>';
    if ($context['user']['is_logged']) {
        echo '
				<td class="titlebg2" height="32">
					<span style="font-size: 130%;"> ', $txt['hello_member_ndt'], ' <b>', $context['user']['name'], '</b></span>
				</td>';
    }
    // display the time
    echo '
				<td class="titlebg2" height="32" align="right">
					<span class="smalltext">', $context['current_time'], '</span>';
    // this is the upshrink button for the user info section
    echo '
					<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
				</td>
			</tr>
			<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
				<td valign="top" colspan="2">
					<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
						<tr>';
    if (!empty($context['user']['avatar'])) {
        echo '
							<td class="windowbg" valign="middle">', $context['user']['avatar']['image'], '</td>';
    }
    echo '
							<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">';
    // If the user is logged in, display stuff like their name, new messages, etc.
    if ($context['user']['is_logged']) {
        echo '
								<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
								<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';
    } else {
        echo $txt['welcome_guest'];
    }
    // Now, onto our second set of info, are they logged in again?
    if ($context['user']['is_logged']) {
        // Is the forum in maintenance mode?
        if ($context['in_maintenance'] && $context['user']['is_admin']) {
            echo '
								<b>', $txt[616], '</b><br />';
        }
        // Are there any members waiting for approval?
        if (!empty($context['unapproved_members'])) {
            echo '
								', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';
        }
        // Show the total time logged in?
        if (!empty($context['user']['total_time_logged_in'])) {
            echo '
								', $txt['totalTimeLogged1'];
            // If days is just zero, don't bother to show it.
            if ($context['user']['total_time_logged_in']['days'] > 0) {
                echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];
            }
            // Same with hours - only show it if it's above zero.
            if ($context['user']['total_time_logged_in']['hours'] > 0) {
                echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
            }
            // But, let's always show minutes - Time wasted here: 0 minutes ;).
            echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
        }
        echo '				</span>';
    } else {
        echo '				</span>
								<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

								<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
									<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
									<select name="cookielength">
										<option value="60">', $txt['smf53'], '</option>
										<option value="1440">', $txt['smf47'], '</option>
										<option value="10080">', $txt['smf48'], '</option>
										<option value="43200">', $txt['smf49'], '</option>
										<option value="-1" selected="selected">', $txt['smf50'], '</option>
									</select>
									<input type="submit" value="', $txt[34], '" /><br />
									<span class="middletext">', $txt['smf52'], '</span>
									<input type="hidden" name="hash_passwrd" value="" />
								</form>';
    }
    echo '
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>';
    echo '
		<table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
			<tr>';
    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news'])) {
        echo '
				<td width="90%" class="titlebg2">
					<span class="smalltext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span>
				</td>';
    }
    echo '
				<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
					<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
						<a href="', $scripturl, '?action=search;advanced"><img src="' . $settings['images_url'] . '/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
						<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
						<input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
						<input type="hidden" name="advanced" value="0" />';
    // Search within current topic?
    if (!empty($context['current_topic'])) {
        echo '
						<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
    } elseif (!empty($context['current_board'])) {
        echo '
						<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
    }
    echo '
					</form>
				</td>
			</tr>
		</table>
	</div>';
    // Show the menu here, according to the menu sub template.
    template_menu();
    // The main content should go here.
    echo '
	<div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">';
}
function template_body_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    echo '
<nav class="navbar navbar-default navbar-static-top" role="navigation">
	<div class="container">
		<div class="row">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
					<span class="sr-only">Toggle navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand visible-xs" href="', $scripturl, '">', $context['forum_name'], '</a>
			</div>
			<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
				<ul class="nav navbar-nav">';
    // Show the menu here, according to the menu sub template.
    template_menu();
    echo '
				</ul>
			</div>
		</div>
	</div>
</nav>
<header>
	<div class="container">
		<div class="row">
			<div class="col-md-9">
				<a href="', $scripturl, '"><img src="', !empty($context['header_logo_url_html_safe']) ? $context['header_logo_url_html_safe'] : $settings['images_url'] . '/logo.png', '" alt="' . $context['forum_name'] . '" /></a>
			</div>
			<div class="col-md-3">';
    if ($context['user']['is_logged']) {
        if (!empty($context['user']['avatar'])) {
            echo '
					<img src="', $context['user']['avatar']['href'], '" class="avatar img-circle img-thumbnail" alt="*" />';
        }
        echo '
					<ul class="reset">
						<li class="user">', $context['user']['name'], '</li>
						<li><a href="', $scripturl, '?action=profile">', $txt['profile'], '</a></li>
						<li><a href="', $scripturl, '?action=profile;area=forumprofile">', $txt['forumprofile'], '</a></li>
						<li><a href="', $scripturl, '?action=unread">', $txt['unread_topics_visit'], '</a></li>
						<li><a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>
					</ul>';
    } else {
        echo '
				<button type="button" class="btn btn-success" data-toggle="modal" data-target="#myModal">', $txt['login'], '</button>
				<button type="button" class="btn btn-primary" onclick="location.href=\'' . $scripturl . '?action=register\'">', $txt['register'], '</button>
				<form id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
					<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-dialog modal-sm">
							<div class="modal-content">
								<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
									<h4 class="modal-title" id="myModalLabel">', $txt['login'], '</h4>
								</div>
								<div class="modal-body">
										<div class="form-group">
											<input type="text" name="user" class="form-control" placeholder="', $txt['user'], '" />
										</div>
										<div class="form-group">
											<input type="password" name="passwrd" class="form-control" placeholder="', $txt['password'], '" />
										</div>
										<div class="checkbox">
											<label>
												<input name="cookielength" type="checkbox" value="-1" /> ', $txt['rs_remember'], '
											</label>
										</div>
								</div>
								<div class="modal-footer">
									<button type="submit" class="btn btn-success">', $txt['login'], '</button>
								</div>
							</div>
						</div>
					</div>
				</form>';
    }
    echo '
			</div>
		</div>
	</div>
</header>';
    // Show the navigation tree.
    theme_linktree();
    echo '
<div class="container">
	<div class="row">';
    // The main content should go here.
    echo '
		<div id="main_content_section">';
    // Custom banners and shoutboxes should be placed here, before the linktree.
}
Ejemplo n.º 15
0
function template_main_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    // Show right to left and the character set for ease of translating.
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
	<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
	<meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
	<meta name="robots" content="noindex" />', '
	<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
	<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>
	<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
		var smf_theme_url = "', $settings['theme_url'], '";
		var smf_images_url = "', $settings['images_url'], '";
		var smf_scripturl = "', $scripturl, '";
		var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
		var smf_charset = "', $context['character_set'], '";
	// ]]></script>
	<title>', $context['page_title'], '</title>
	<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?fin11" />
	<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />';
    /* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
    		Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
    		Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
    		Standards compliance mode happens when you use xhtml... */
    if ($context['browser']['needs_size_fix']) {
        echo '
	<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';
    }
    // Show all the relative links, such as help, search, contents, and the like.
    echo '
	<link rel="help" href="', $scripturl, '?action=help" target="_blank" />
	<link rel="search" href="' . $scripturl . '?action=search" />
	<link rel="contents" href="', $scripturl, '" />';
    // If RSS feeds are enabled, advertise the presence of one.
    if (!empty($modSettings['xmlnews_enable'])) {
        echo '
	<link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';
    }
    // If we're viewing a topic, these should be the previous and next topics, respectively.
    if (!empty($context['current_topic'])) {
        echo '
	<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
	<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';
    }
    // 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 '
	<link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';
    }
    // Output any remaining HTML headers. (from mods, maybe?)
    echo $context['html_headers'], '
</head>
<body>';
    // The logo, user information, news, and menu.
    echo '
	<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
		<tr style="background-color: #ffffff;">
			<td valign="middle" align="left"><img src="', !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/smflogo.gif', '" alt="" /></td>
			<td valign="middle">';
    // If the user is logged in, display stuff like their name, new messages, etc.
    if ($context['user']['is_logged']) {
        echo '
				', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>', $context['allow_pm'] ? ', ' . $txt[152] . ' <a href="' . $scripturl . '?action=pm">' . $context['user']['messages'] . ' ' . ($context['user']['messages'] != 1 ? $txt[153] : $txt[471]) . '</a>' . $txt['newmessages4'] . ' ' . $context['user']['unread_messages'] . ' ' . ($context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1']) : '', '.';
        // Are there any members waiting for approval?
        if (!empty($context['unapproved_members'])) {
            echo '<br />
				', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'];
        }
        // Is the forum in maintenance mode?
        if ($context['in_maintenance'] && $context['user']['is_admin']) {
            echo '<br />
				<b>', $txt[616], '</b>';
        }
    } else {
        echo '
				', $txt['welcome_guest'];
    }
    echo '
				<br />', $context['current_time'], '
			</td>
		</tr>
		<tr class="windowbg2">
			<td colspan="2" valign="middle" align="center" class="tborder" style="border-width: 1px 0 0 0; font-size: smaller;">';
    // Show the menu here, according to the menu sub template.
    template_menu();
    echo '
			</td>
		</tr>';
    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news'])) {
        echo '
		<tr class="windowbg2">
			<td colspan="2" height="24" class="tborder" style="border-width: 1px 0 0 0; padding-left: 1ex;">
				<b>', $txt[102], ':</b> ', $context['random_news_line'], '
			</td>
		</tr>';
    }
    echo '
	</table>

	<br />
	<table cellspacing="0" cellpadding="10" border="0" align="center" width="95%" class="tborder">
		<tr><td valign="top" style="background-color: #ffffff;">';
}
Ejemplo n.º 16
0
function template_body_above()
{
    global $context, $settings, $scripturl, $txt, $user_info, $modSettings;
    $alerts = $user_info['notify_count'] > 0 ? $user_info['notify_count'] : '';
    $scope = 0;
    $search_label = $txt['search_all_boards'];
    if (isset($context['current_topic']) && $context['current_topic']) {
        $search_label = $txt['search_topic'];
        $scope = 2;
    } elseif (isset($context['current_board'])) {
        $search_label = $txt['search_board'];
        $scope = 1;
    }
    echo '
	<div id="__t_script" style="display:none;"></div>
	<div id="jsconfirm" style="width:450px;" class="jqmWindow"><div class="jqmWindow_container"><div class="glass jsconfirm title"></div><div class="jsconfirm content blue_container norounded smallpadding mediummargin tinytext"></div><div class="floatright mediummargin"><span class="button default" id="c_yes">Yes</span><span class="button" id="c_no">No</span><span class="button" id="c_ok">Ok</span></div><div class="clear"></div></div></div>
	<div id="ajaxbusy" style="display:none;"><img src="', $settings['images_url'], '/ajax-loader.gif" alt="loader" /></div>
	<div id="mcard" style="display:none;"><div onclick="mcardClose();" id="mcard_close">X</div><div id="mcard_inner"></div></div>
	<div id="wrap" style="max-width:', empty($settings['forum_width']) ? '3000px;' : $settings['forum_width'], ';">
	<header>
	<div id="header">
	<div id="upper_section" class="smalltext">
		<div class="floatleft" style="overflow:hidden;max-height:90px;"><img src="', $settings['images_url'], '/logo.png" alt="logo" /></div>
		', $context['template_hooks']['global']['header'], '
		<div class="clear"></div>
	</div>
		<div class="notibar">
			<div class="notibar right">
			<div class="floatright">
			<span title="', $txt['font_increase'], '" onclick="setTextSize(textsize + 1,0);return(false);" class="fontinc">&nbsp;</span>
			<span title="', $txt['font_decrease'], '" onclick="setTextSize(textsize - 1,0);return(false);" class="fontdec">&nbsp;</span>
			<span title="', $txt['toggle_font_style'], '" onclick="toggleFontStyle();return(false);" class="fontstyle">&nbsp;</span>
			</div>
      		<div class="floatright"><a style="', $alerts > 0 ? '' : 'display:none; ', 'position:relative;top:-12px;right:12px;z-index:9999;" id="alerts">', $alerts, '</a></div>
      		<div class="floatright nowrap" id="notification_target">
  				<ul class="dropmenu menu compact" id="menu_content">';
    foreach ($context['usermenu_buttons'] as $key => $button) {
        echo '
          			<li id="button_', $key, '" class="', isset($button['active_button']) ? 'active' : '', '">', isset($button['link']) ? $button['link'] : '<a class="firstlevel compact" href="' . $button['href'] . '">' . $button['title'] . '</a>';
        if (!empty($button['sub_buttons'])) {
            echo '
            		&nbsp;&nbsp;<span onclick="onMenuArrowClick($(this));" style="display:inline-block;" id="_', $key, '" class="m_downarrow compact">&nbsp;</span>
            		<ul style="z-index:9000;">';
            foreach ($button['sub_buttons'] as $sbutton) {
                echo '
              			<li>', isset($sbutton['link']) ? $sbutton['link'] : '<a href="' . $sbutton['href'] . '"><span>' . $sbutton['title'] . '</span></a>', '
              			</li>';
            }
            echo '
            		</ul>';
        }
        echo '
          			</li>';
    }
    echo '
  				</ul>
      		</div>
			</div>
			<div class="notibar_intro"></div>
		</div>
	<nav>';
    // Show the menu here, according to the menu sub template.
    template_menu();
    echo '</nav>
	<script>
		// <![CDATA[
    	setTextSize(textsize);
		// ]]>
	</script>
	</div></header>';
    // The main content should go here.
    echo '
	<div id="content_section">
	<div id="main_content_section">';
    // Custom banners and shoutboxes should be placed here, before the linktree.
    theme_linktree();
    $sidebar_allowed = isset($context['show_sidebar']);
    // todo: make this more flexible and define a set of pages where the sidebar can show up
    $sidebar_vis = !$user_info['smf_sidebar_disabled'];
    if ($sidebar_allowed) {
        echo '
    		<a href="', $context['query_string'], ';sbtoggle" data-class="', $context['sidebar_class'], '" onclick="sbToggle($(this));return(false);" id="sbtoggle" class="', $sidebar_vis ? 'collapse' : 'expand', '">&nbsp;</a>';
    }
    // Show the navigation tree.
    if (isset($context['can_search']) && !empty($context['can_search'])) {
        echo '<div style="position:relative;">
		  <form onmouseout="return false;" onsubmit="submitSearchBox();" class="floatright" id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="UTF-8">';
        // Search within current topic?
        echo '
				<div id="adv_search" style="width:246px;padding:0;" class="smalltext">
				<input style="width:215px;padding-left:26px;margin:0;" onclick="var s_event = arguments[0] || window.event;openAdvSearch(s_event);return(false);" type="text" onfocus="if(!this._haschanged){this.value=\'\'};this._haschanged=true;" name="search" value="', $search_label, '" class="searchfield" />
				<br><br><h3 class="bbc_head l2">', $txt['search_by_member'], '</h3>
				<div style="text-align:center;margin-bottom:10px;"><input style="width:90%;" class="input_text" type="text" name="userspec" id="userspec" value="*" /></div>
				<input class="input_check floatleft" type="checkbox" name="show_complete" id="show_complete" value="1" />&nbsp;<h3 class="bbc_head l2" style="margin-left:0;">', $txt['search_show_complete_messages'], '</h3><br class="clear">';
        if ($scope == 2) {
            echo '<div style="padding-left:20px;"><input type="radio" name="type" id="i_topic" class="input_radio" checked="checked" />', $txt['search_topic'], '<br />
						<input type="radio" name="type" id="i_board" class="input_radio" />', $txt['search_board'], '<br />
						<input type="radio" name="type" id="i_site" class="input_radio" />', $txt['search_all_boards'], '
						<input type="hidden" id="s_topic" name="topic" value="', $context['current_topic'], '" />
						<input type="hidden" id="s_board" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" /></div>';
        } else {
            if ($scope == 1) {
                echo '<div style="padding-left:20px;"><input name="type" type="radio" id="i_board" checked="checked" class="input_radio" />', $txt['search_board'], '<br />
						<input type="radio" name="type" id="i_site" class="input_radio" />', $txt['search_all_boards'], '
						<input type="hidden" id="s_board" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" /></div>';
            }
        }
        echo '<input style="width:100%;margin:10px 0;display:none;" type="submit" name="submit" value="', 'Search now', '" class="default" />
			 	  <div class="centertext"><a href="', url::action($scripturl . '?action=search'), '" >', $txt['search_advanced'], '</a></div>';
        echo '</div>
				<noscript>
				<input style="margin:0;" type="submit" name="submit" value="', $txt['go'], '" class="button_submit" />
				</noscript>';
        echo '
	</form>
	</div>';
    }
    echo '
	<div class="clear cContainer_end"></div>
	', $context['template_hooks']['global']['above'];
    echo $context['additional_admin_errors'];
    if ($context['news_item_count']) {
        template_news_listitems();
    }
    echo '<aside>
		  <div id="sidebar" style="width:260px;display:', $sidebar_allowed ? 'inline' : 'none', ';">';
    if ($sidebar_allowed && is_callable($context['sidebar_context_output'])) {
        $context['sidebar_context_output']();
    }
    echo '</div>
		  </aside>
	      <div id="container" style="margin-right:', $sidebar_allowed ? '270px' : '0', ';">
		  <script>
  		  // <![CDATA[
  		  		$("#sidebar").css("display", ', $sidebar_vis && $sidebar_allowed ? '"inline"' : '"none"', ');
  		  		$("#container").css("margin-right", ', $sidebar_vis && $sidebar_allowed ? 'sideBarWidth + 20 + "px"' : "0", ');
		  // ]]>
	      </script>';
}
Ejemplo n.º 17
0
function template_body_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    echo '
<div id="mainframe"', !empty($settings['forum_width']) ? ' style="width: ' . $settings['forum_width'] . '"' : '', '>
	<div class="tborder">
		<div class="catbg">
			<img class="floatright" id="smflogo" src="', $settings['images_url'], '/smflogo.gif" alt="Simple Machines Forum" />
			<h1 id="forum_name">';
    if (empty($context['header_logo_url_html_safe'])) {
        echo $context['forum_name_html_safe'];
    } else {
        echo '
				<img src="', $context['header_logo_url_html_safe'], '" alt="', $context['forum_name_html_safe'], '" />';
    }
    echo '
			</h1>
		</div>';
    // Display user name and time.
    echo '
		<ul id="greeting_section" class="reset titlebg2">
			<li id="time" class="smalltext floatright">
				', $context['current_time'], '
				<img id="upshrink" src="', $settings['images_url'], '/upshrink.gif" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" />
			</li>';
    if ($context['user']['is_logged']) {
        echo '
			<li id="name">', $txt['hello_member_ndt'], ' <em>', $context['user']['name'], '</em></li>';
    } else {
        echo '
			<li id="name">', $txt['hello_guest'], ' <em>', $txt['guest'], '</em></li>';
    }
    echo '
		</ul>';
    if ($context['user']['is_logged'] || !empty($context['show_login_bar'])) {
        echo '
		<div id="user_section" class="bordercolor"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
			<div class="windowbg2 clearfix">';
    }
    if (!empty($context['user']['avatar'])) {
        echo '
				<div id="myavatar">', $context['user']['avatar']['image'], '</div>';
    }
    // If the user is logged in, display stuff like their name, new messages, etc.
    if ($context['user']['is_logged']) {
        echo '
				<ul class="reset">
					<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
					<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';
        // Is the forum in maintenance mode?
        if ($context['in_maintenance'] && $context['user']['is_admin']) {
            echo '
					<li class="notice">', $txt['maintain_mode_on'], '</li>';
        }
        // Are there any members waiting for approval?
        if (!empty($context['unapproved_members'])) {
            echo '
					<li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';
        }
        // Show the total time logged in?
        if (!empty($context['user']['total_time_logged_in'])) {
            echo '
					<li>', $txt['totalTimeLogged1'];
            // If days is just zero, don't bother to show it.
            if ($context['user']['total_time_logged_in']['days'] > 0) {
                echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];
            }
            // Same with hours - only show it if it's above zero.
            if ($context['user']['total_time_logged_in']['hours'] > 0) {
                echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
            }
            // But, let's always show minutes - Time wasted here: 0 minutes ;).
            echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '
					</li>';
        }
        if (!empty($context['open_mod_reports']) && $context['show_open_reports']) {
            echo '
					<li><a href="', $scripturl, '?action=moderate;area=reports">', sprintf($txt['mod_reports_waiting'], $context['open_mod_reports']), '</a></li>';
        }
        echo '
				</ul>';
    } elseif (!empty($context['show_login_bar'])) {
        echo '
				<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
				<form class="windowbg" id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
					', $txt['login_or_register'], '<br />
					<input type="text" name="user" size="10" class="input_text" />
					<input type="password" name="passwrd" size="10" class="input_password" />
					<select name="cookielength">
						<option value="60">', $txt['one_hour'], '</option>
						<option value="1440">', $txt['one_day'], '</option>
						<option value="10080">', $txt['one_week'], '</option>
						<option value="43200">', $txt['one_month'], '</option>
						<option value="-1" selected="selected">', $txt['forever'], '</option>
					</select>
					<input type="submit" value="', $txt['login'], '" class="button_submit" /><br />
					', $txt['quick_login_dec'];
        if (!empty($modSettings['enableOpenID'])) {
            echo '
					<br />
					<input type="text" name="openid_identifier" id="openid_url" size="25" class="input_text openid_login" />';
        }
        echo '
					<input type="hidden" name="hash_passwrd" value="" />
				</form>';
    }
    if ($context['user']['is_logged'] || !empty($context['show_login_bar'])) {
        echo '
			</div>
		</div>';
    }
    echo '
		<div id="news_section" class="titlebg2 clearfix"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
			<form class="floatright" id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
				<a href="', $scripturl, '?action=search;advanced" title="', $txt['search_advanced'], '"><img id="advsearch" src="' . $settings['images_url'] . '/filter.gif" align="middle" alt="', $txt['search_advanced'], '" /></a>
				<input type="text" name="search" value="" style="width: 190px;" class="input_text" />&nbsp;
				<input type="submit" name="submit" value="', $txt['search'], '" style="width: 11ex;" class="button_submit" />
				<input type="hidden" name="advanced" value="0" />';
    // Search within current topic?
    if (!empty($context['current_topic'])) {
        echo '
				<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
    } elseif (!empty($context['current_board'])) {
        echo '
				<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
    }
    echo '
			</form>';
    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news'])) {
        echo '
			<div id="random_news"><h3>', $txt['news'], ':</h3><p>', $context['random_news_line'], '</p></div>';
    }
    echo '
		</div>
	</div>';
    // Define the upper_section toggle in JavaScript.
    echo '
	<script type="text/javascript"><!-- // --><![CDATA[
		var oMainHeaderToggle = new smc_Toggle({
			bToggleEnabled: true,
			bCurrentlyCollapsed: ', empty($options['collapse_header']) ? 'false' : 'true', ',
			aSwappableContainers: [
				\'user_section\',
				\'news_section\'
			],
			aSwapImages: [
				{
					sId: \'upshrink\',
					srcExpanded: smf_images_url + \'/upshrink.gif\',
					altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
					srcCollapsed: smf_images_url + \'/upshrink2.gif\',
					altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
				}
			],
			oThemeOptions: {
				bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
				sOptionName: \'collapse_header\',
				sSessionVar: ', JavaScriptEscape($context['session_var']), ',
				sSessionId: ', JavaScriptEscape($context['session_id']), '
			},
			oCookieOptions: {
				bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
				sCookieName: \'upshrink\'
			}
		});
	// ]]></script>';
    // Show the menu here, according to the menu sub template.
    template_menu();
    // Show the navigation tree.
    theme_linktree();
    // The main content should go here.
    echo '
	<div id="bodyarea">';
}
Ejemplo n.º 18
0
function template_body_above()

{

  global $context, $settings, $options, $scripturl, $txt, $modSettings;



  echo '

	<div id="top_banner">

		<div class="wrapper">

				<div class="user">
				';



  // If the user is logged in, display stuff like their name, new messages, etc.

  if ($context['user']['is_logged'])

  {

    if (!empty($context['user']['avatar']))

      echo '

						<p class="avatar">', $context['user']['avatar']['image'], '</p>';

    echo '

						<ul class="reset">

                                                        <li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span> &bull; <a href="', $scripturl, '?action=unread">', $txt['new_posts'], '</a> &bull; <a href="', $scripturl, '?action=unreadreplies">', $txt['replies'], '</a></li>';



    echo '

						</ul>';

  }

  // Otherwise they're a guest - this time ask them to either register or login - lazy bums...

  else

  {

    echo '

							<div class="info" style="padding:5px;"> Welcome, <strong>Guest</strong>. Please <a href="http://ballp.it/index.php?action=login">login</a> or <a href="http://ballp.it/index.php?action=register">register</a>.</div>

							<!-- <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>

							<form id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>

								<input type="text" name="user" size="17" class="input_text" />

								<input type="password" name="passwrd" size="17" class="input_password" />

								<input type="submit" value="', $txt['login'], '" class="button_submit" />

							</form> -->';

  }



  echo '
			     </div>

		     <div id="time"><span>', $context['current_time'],'</span></div>

		</div>

	</div>

	<div id="header">

		<div class="wrapper">

			<div id="search_box">

				<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">

				<input class="inputbox" type="search" name="search" placeholder="Search..."  />

                                <input id="submit" name="submit" type="submit" value="Search" />';



  // Search within current topic?

  if (!empty($context['current_topic']))

    echo '

					<input type="hidden" name="topic" value="', $context['current_topic'], '" />';

  // If we're on a certain board, limit it to this board ;).

  elseif (!empty($context['current_board']))

    echo '

					<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';



  echo '</form>

		         </div>

			<a class="hamburger"></a>
			<div id="logo">

				<a href="'.$scripturl.'" title=""></a>

			</div>

		</div>

	</div>';

  global $context, $user_info;

  if ($context['user']['is_guest'])

  {

    echo '

		<div class="statusbar">

			<div class="wrapper">

				<h2>ballp.it is the community forum for The F Plus.</h2>

				<p>You&apos;re only seeing part of the forum conversation. To see more, <a href="http://ballp.it/index.php?action=register">register for an account</a>. This will give you read-only access to nearly all the forums.</p>

			</div>

		</div>

		';

  }

  elseif ($context['user']['is_admin'])

  {

    echo '

		<div class="statusbar hidethis">

			<div class="wrapper">

				<h2>Hi Lemon.</h2>

			</div>

		</div>

		';

  }

  elseif (in_array(9, $user_info['groups']))

  {

    echo '

		<div class="statusbar hidethis">

			<div class="wrapper">

				<h2>Congratulations on being a Ridiculist.</h2>

			</div>

		</div>

		';

  }

  elseif (in_array(10, $user_info['groups']))

  {

    echo '

		<div class="statusbar hidethis">

			<div class="wrapper">

				<h2>I think you are a Paid member.</h2>

			</div>

		</div>

		';

  } else {

    echo '

		<div class="statusbar">

			<div class="wrapper">

				<h2>You do not yet have posting access.</h2>

				<p>As a registered member, you have read-only access to most of the forums. In order to post, you&apos;ll need to pay the <a href="http://ballp.it/index.php?action=profile;area=subscriptions">one-time fee</a>.<br /><a href="http://ballp.it/index.php?topic=16.msg28">Why is it ten bucks?</a></p>

			</div>

		</div>

		';

  }

  echo '

	<div id="bar">

		<div class="wrapper">
			', template_menu(), '
		</div>

	</div>

	<div id="main_body_section">

		<div class="wrapper">

			<div id="main_content_section">';



  // Show the navigation tree.

  theme_linktree();

}
Ejemplo n.º 19
0
function template_body_above()
{
    global $context, $settings, $scripturl, $txt, $modSettings;
    // Wrapper div now echoes permanently for better layout options. h1 a is now target for "Go up" links.
    echo '
	<div id="top_section">
		<div class="frame">
			<ul class="floatleft">';
    // If the user is logged in, display the time, or a maintenance warning for admins.
    if ($context['user']['is_logged']) {
        // Is the forum in maintenance mode?
        if ($context['in_maintenance'] && $context['user']['is_admin']) {
            echo '
				<li class="notice">', $txt['maintain_mode_on'], '</li>';
        } else {
            echo '
				<li>', $context['current_time'], '</li>';
        }
    } else {
        echo '
				<li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $scripturl . '?action=login'), '</li>';
    }
    echo '
			</ul>';
    if ($context['allow_search']) {
        echo '
			<form id="search_form" class="floatright" action="', $scripturl, '?action=search2" method="post" accept-charset="UTF-8">
				<input type="text" name="search" value="" class="input_text" />&nbsp;';
        // Using the quick search dropdown?
        if (!empty($modSettings['search_dropdown'])) {
            $selected = !empty($context['current_topic']) ? 'current_topic' : (!empty($context['current_board']) ? 'current_board' : 'all');
            echo '
				<select name="search_selection">
					<option value="all"', $selected == 'all' ? ' selected="selected"' : '', '>', $txt['search_entireforum'], ' </option>';
            // Can't limit it to a specific topic if we are not in one
            if (!empty($context['current_topic'])) {
                echo '
					<option value="topic"', $selected == 'current_topic' ? ' selected="selected"' : '', '>', $txt['search_thistopic'], '</option>';
            }
            // Can't limit it to a specific board if we are not in one
            if (!empty($context['current_board'])) {
                echo '
					<option value="board"', $selected == 'current_board' ? ' selected="selected"' : '', '>', $txt['search_thisbrd'], '</option>';
            }
            if (!empty($context['additional_dropdown_search'])) {
                foreach ($context['additional_dropdown_search'] as $name => $engine) {
                    echo '
					<option value="', $name, '">', $engine['name'], '</option>';
                }
            }
            echo '
					<option value="members"', $selected == 'members' ? ' selected="selected"' : '', '>', $txt['search_members'], ' </option>
				</select>';
        }
        // Search within current topic?
        if (!empty($context['current_topic'])) {
            echo '
				<input type="hidden" name="', !empty($modSettings['search_dropdown']) ? 'sd_topic' : 'topic', '" value="', $context['current_topic'], '" />';
        } elseif (!empty($context['current_board'])) {
            echo '
				<input type="hidden" name="', !empty($modSettings['search_dropdown']) ? 'sd_brd[' : 'brd[', $context['current_board'], ']"', ' value="', $context['current_board'], '" />';
        }
        echo '
				<input type="submit" name="search2" value="', $txt['search'], '" class="button_submit" />
				<input type="hidden" name="advanced" value="0" />
			</form>';
    }
    echo '
		</div>
	</div>';
    echo '
	<div id="header"', empty($context['minmax_preferences']['upshrink']) ? '' : ' style="display: none;"', '>
		<div class="frame">
			<h1 class="forumtitle">
				<a id="top" href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
			</h1>';
    echo '
			', empty($settings['site_slogan']) ? '<img id="logo" src="' . $settings['images_url'] . '/logo_elk.png" alt="Elkarte Community" title="Elkarte Community" />' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '</div>', '';
    echo '
		</div>
	</div>
	<div id="wrapper">
		<div id="upper_section">
			<div id="inner_section">
				<div id="inner_wrap"', empty($context['minmax_preferences']['upshrink']) ? '' : ' style="display: none;"', '>
					<div class="user floatright">';
    // Otherwise they're a guest - this time ask them to either register or login - lazy bums...
    if (!empty($context['show_login_bar'])) {
        echo '
						<script src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
						<form id="guest_form" action="', $scripturl, '?action=login2;quicklogin" method="post" accept-charset="UTF-8" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\', \'' . (!empty($context['login_token']) ? $context['login_token'] : '') . '\');"' : '', '>
							<input type="text" name="user" size="10" class="input_text" />
							<input type="password" name="passwrd" size="10" class="input_password" />
							<select name="cookielength">
								<option value="60">', $txt['one_hour'], '</option>
								<option value="1440">', $txt['one_day'], '</option>
								<option value="10080">', $txt['one_week'], '</option>
								<option value="43200">', $txt['one_month'], '</option>
								<option value="-1" selected="selected">', $txt['forever'], '</option>
							</select>
							<input type="submit" value="', $txt['login'], '" class="button_submit" />
							<div>', $txt['quick_login_dec'], '</div>';
        if (!empty($modSettings['enableOpenID'])) {
            echo '
							<br /><input type="text" name="openid_identifier" size="25" class="input_text openid_login" />';
        }
        echo '
							<input type="hidden" name="hash_passwrd" value="" />
							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
							<input type="hidden" name="', $context['login_token_var'], '" value="', $context['login_token'], '" />
						</form>';
    }
    // If the user is logged in, display stuff like their name, new messages, etc.
    if ($context['user']['is_logged']) {
        if (!empty($context['user']['avatar'])) {
            echo '
						<a href="', $scripturl, '?action=profile" class="avatar">', $context['user']['avatar']['image'], '</a>';
        }
        echo '
						<ul>
							<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>';
        // Are there any members waiting for approval?
        if (!empty($context['unapproved_members'])) {
            echo '
							<li>', $context['unapproved_members_text'], '</li>';
        }
        if (!empty($context['open_mod_reports']) && $context['show_open_reports']) {
            echo '
							<li><a href="', $scripturl, '?action=moderate;area=reports">', sprintf($txt['mod_reports_waiting'], $context['open_mod_reports']), '</a></li>';
        }
        echo '
						</ul>';
    }
    echo '
					</div>';
    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) {
        echo '
					<div class="news">
						<h2>', $txt['news'], ': </h2>
						<p>', $context['random_news_line'], '</p>
					</div>';
    }
    echo '
					<hr class="clear" />
				</div>';
    // Show the menu here, according to the menu sub template, followed by the navigation tree.
    template_menu();
    theme_linktree();
    echo '
			</div>
		</div>';
    // The main content should go here.
    echo '
		<div id="content_section">
			<div id="main_content_section">';
}
Ejemplo n.º 20
0
function template_body_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '

	<div class="jelou">
		<table width="100%">
			<tr>';
    if ($context['user']['is_logged']) {
        echo '
						<td>
							<table>
								<tr>
									<td>	
										<a class="primera" href="', $scripturl, '?action=unread">', $txt['unread_topics_visit'], '</a>
										&#8226; <a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a>
										&#8226; <a href="', $scripturl, '?action=pm">', $txt['personal_messages'], '</a>
									</td>
								</tr>
							</table>
						</td>
					';
    } else {
        echo '
						<td>
							', $txt['login_or_register'], '
						</td>
					';
    }
    echo '
					<td align="right">', $context['current_time'], '
					</td>
			</tr>
		</table>
	</div>
	
	<hr class="hr_min" />
	
	<div id="header">
		<div class="frame">
			<table width="100%">
				<tr>
					<td class="top_log">
						<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="' . $settings['theme_url'] . '/images/logo.png" alt="' . $context['forum_name'] . '" />' : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>	
					</td>
					<td align="right">';
    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news'])) {
        echo '
				<h2>', $txt['news'], '</h2>
				<p>', $context['random_news_line'], '</p>';
    }
    echo '</td>
				</tr>
			</table>';
    // Define the upper_section toggle in JavaScript.
    echo '
		<script type="text/javascript"><!-- // --><![CDATA[
			var oMainHeaderToggle = new smc_Toggle({
				bToggleEnabled: true,
				bCurrentlyCollapsed: ', empty($options['collapse_header']) ? 'false' : 'true', ',
				aSwappableContainers: [
					\'upper_section\'
				],
				aSwapImages: [
					{
						sId: \'upshrink\',
						srcExpanded: smf_images_url + \'/upshrink.png\',
						altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
						srcCollapsed: smf_images_url + \'/upshrink2.png\',
						altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
					}
				],
				oThemeOptions: {
					bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
					sOptionName: \'collapse_header\',
					sSessionVar: ', JavaScriptEscape($context['session_var']), ',
					sSessionId: ', JavaScriptEscape($context['session_id']), '
				},
				oCookieOptions: {
					bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
					sCookieName: \'upshrink\'
				}
			});
		// ]]></script>';
    echo '
		<br class="clear" />
	</div></div>';
    // Show the menu here, according to the menu sub template.
    template_menu();
    // The main content should go here.
    echo '
	<div id="content_section"><div class="frame">
		<div id="main_content_section">';
    // Custom banners and shoutboxes should be placed here, before the linktree.
    // Show the navigation tree.
    theme_linktree();
}
Ejemplo n.º 21
0
function template_body_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    // 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%!)
    echo '
	<div id="headerarea" style="padding: 12px 30px 4px 30px;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">';
    // The logo and the three info boxes.
    echo '
		<table cellspacing="0" cellpadding="0" border="0" width="100%" style="position: relative;">
			<tr>
				<td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">';
    // This part is the logo and forum name.  You should be able to change this to whatever you want...
    echo '
					<img src="', $settings['images_url'], '/smflogo.gif" style="width: 250px; float: ', !$context['right_to_left'] ? 'right' : 'left', ';" alt="" />';
    if (empty($context['header_logo_url_html_safe'])) {
        echo '
					<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name_html_safe'], '</span>';
    } else {
        echo '
					<img src="', $context['header_logo_url_html_safe'], '" alt="', $context['forum_name_html_safe'], '" border="0" />';
    }
    echo '
				</td>
			</tr>
			<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
				<td valign="top">
					<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
					<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url(', $settings['images_url'], '/box_bg.gif);">
						<img src="', $settings['lang_images_url'], '/userinfo.gif" style="position: absolute; left: ', $context['browser']['is_ie5'] || $context['browser']['is_ie4'] ? '0' : '-1px', '; top: -16px;" class="clear" alt="" />
						<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';
    if (!empty($context['user']['avatar'])) {
        echo '<td valign="middle">', $context['user']['avatar']['image'], '</td>';
    }
    echo '<td valign="top" class="smalltext" style="width: 100%; font-family: verdana, arial, sans-serif;">';
    // If the user is logged in, display stuff like their name, new messages, etc.
    if ($context['user']['is_logged']) {
        echo '
							', $txt['hello_member'], ' <strong>', $context['user']['name'], '</strong>';
        // Only tell them about their messages if they can read their messages!
        if ($context['allow_pm']) {
            echo ', ', $txt['msg_alert_you_have'], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt['msg_alert_messages'] : $txt['message_lowercase'], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
        }
        echo '.<br />';
        // Is the forum in maintenance mode?
        if ($context['in_maintenance'] && $context['user']['is_admin']) {
            echo '
							<strong>', $txt['maintain_mode_on'], '</strong><br />';
        }
        // Are there any members waiting for approval?
        if (!empty($context['unapproved_members'])) {
            echo '
							', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';
        }
        // Show the total time logged in?
        if (!empty($context['user']['total_time_logged_in'])) {
            echo '
							', $txt['totalTimeLogged1'];
            // If days is just zero, don't bother to show it.
            if ($context['user']['total_time_logged_in']['days'] > 0) {
                echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];
            }
            // Same with hours - only show it if it's above zero.
            if ($context['user']['total_time_logged_in']['hours'] > 0) {
                echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
            }
            // But, let's always show minutes - Time wasted here: 0 minutes ;).
            echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
        }
        echo '
							<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
							<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
							', $context['current_time'], '<br />';
        if (!empty($context['open_mod_reports']) && $context['show_open_reports']) {
            echo '
								<a href="', $scripturl, '?action=moderate;area=reports">', sprintf($txt['mod_reports_waiting'], $context['open_mod_reports']), '</a>';
        }
    } else {
        echo '
							', sprintf($txt['welcome_guest'], $txt['guest_title']), '<br />
							', $context['current_time'], '<br />

							<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>

							<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
								<div class="righttext">
									<input type="text" name="user" size="10" class="input_text" /> <input type="password" name="passwrd" size="10" class="input_password" />
									<select name="cookielength">
										<option value="60">', $txt['one_hour'], '</option>
										<option value="1440">', $txt['one_day'], '</option>
										<option value="10080">', $txt['one_week'], '</option>
										<option value="43200">', $txt['one_month'], '</option>
										<option value="-1" selected="selected">', $txt['forever'], '</option>
									</select>
									<input type="submit" value="', $txt['login'], '" class="button_submit" /><br />
									', $txt['quick_login_dec'], '
									<input type="hidden" name="hash_passwrd" value="" />
								</div>
							</form>';
    }
    echo '
						</td></tr></table>
					</div>

					<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
						<div style="margin-top: 7px;">
							<strong>', $txt['search'], ': </strong><input type="text" name="search" value="" style="width: 190px;" class="input_text" />&nbsp;
							<input type="submit" name="submit" value="', $txt['search'], '" style="width: 8ex;" class="button_submit" />&nbsp;
							<a href="', $scripturl, '?action=search;advanced">', $txt['search_advanced'], '</a>
							<input type="hidden" name="advanced" value="0" />';
    // Search within current topic?
    if (!empty($context['current_topic'])) {
        echo '
							<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
    } elseif (!empty($context['current_board'])) {
        echo '
							<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
    }
    echo '
						</div>
					</form>

				</td>
				<td style="width: 262px; ', !$context['right_to_left'] ? 'padding-left' : 'padding-right', ': 6px;" valign="top">';
    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news'])) {
        echo '
					<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
					<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif); margin-bottom: 8px;">
						<img src="', $settings['lang_images_url'], '/newsbox.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
						<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">', $context['random_news_line'], '</div>
					</div>';
    }
    // The "key stats" box.
    echo '
					<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
					<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif);">
						<img src="', $settings['lang_images_url'], '/keystats.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
						<div style="', !$context['browser']['is_ie'] ? 'min-height: 35px;' : 'height: 4em;', ' padding: 5px;" class="smalltext">
							<strong>', $context['common_stats']['total_posts'], '</strong> ', $txt['posts_made'], ' ', $txt['in'], ' <strong>', $context['common_stats']['total_topics'], '</strong> ', $txt['topics'], ' ', $txt['by'], ' <span style="white-space: nowrap;"><strong>', $context['common_stats']['total_members'], '</strong> ', $txt['members'], '</span><br />
							', $txt['latest_member'], ': <strong> ', $context['common_stats']['latest_member']['link'], '</strong>
						</div>
					</div>';
    echo '
				</td>
			</tr>
		</table>

		<img id="upshrink" src="', $settings['images_url'], '/upshrink.gif" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 2ex 2px 0; display: none;" border="0" />';
    // Show the menu here, according to the menu sub template.
    template_menu();
    // Define the upper_section toggle in JavaScript.
    echo '
		<script type="text/javascript"><!-- // --><![CDATA[
			var oMainHeaderToggle = new smc_Toggle({
				bToggleEnabled: true,
				bCurrentlyCollapsed: ', empty($options['collapse_header']) ? 'false' : 'true', ',
				aSwappableContainers: [
					\'upshrinkHeader\',
					\'upshrinkHeader2\'
				],
				aSwapImages: [
					{
						sId: \'upshrink\',
						srcExpanded: smf_images_url + \'/upshrink.gif\',
						altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
						srcCollapsed: smf_images_url + \'/upshrink2.gif\',
						altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
					}
				],
				oThemeOptions: {
					bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
					sOptionName: \'collapse_header\',
					sSessionVar: ', JavaScriptEscape($context['session_var']), ',
					sSessionId: ', JavaScriptEscape($context['session_id']), '
				},
				oCookieOptions: {
					bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
					sCookieName: \'upshrink\'
				}
			});
		// ]]></script>';
    echo '
	</div>';
    // The main content should go here.  A table is used because IE 6 just can't handle a div.
    echo '
	<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
		<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">';
    // Show the navigation tree.
    theme_linktree();
}
/**
* The sub template above the mainframe.
*/
function template_portamx_above()
{
    global $context, $options, $txt, $scripturl;
    echo '
	<div id="top_section">
		<div class="roundframe" style="background:#ffffff;">';
    // Insert a small menubar, if enabled
    if (!empty($context['pmx']['settings']['frontpagemenu'])) {
        $notShow = array('help', 'search', 'profile', 'pm', 'calendar', 'mlist');
        foreach ($notShow as $key) {
            unset($context['menu_buttons'][$key]);
        }
        echo '
			<div class="cat_bar rnd"><h3 class="catbg largetext rnd"><a href="' . $scripturl . '">' . $context['forum_name_html_safe'] . '</a></h3></div>
			<div class="menu_padding">', template_menu(), '</div>';
    }
    echo '
			<input type="hidden" id="pmx_topset" name="pmx_topset" value="" />';
    // head panel
    if (!empty($context['pmx']['show_headpanel'])) {
        echo '
			<div>';
        if (empty($context['pmx']['settings']['head_panel']['collapse']) && $context['pmx']['xbar_head']) {
            echo '
				<div id="xbarhead" title="' . (empty($options['collapse_head']) ? $txt['pmx_hidepanel'] : $txt['pmx_showpanel']) . $txt['pmx_block_panels']['head'] . '" onclick="headPanel.toggle()"></div>';
        }
        echo '
				<div id="pmx_head_panel">
					<div id="upshrinkHeadBar" style="margin-bottom:' . $context['pmx']['settings']['panelpad'] . 'px;';
        // Height / overflow set?
        if (!empty($context['pmx']['settings']['head_panel']['size'])) {
            echo ' max-height:' . $context['pmx']['settings']['head_panel']['size'] . 'px;';
            if (!empty($context['pmx']['settings']['head_panel']['overflow'])) {
                echo ' overflow:' . $context['pmx']['settings']['head_panel']['overflow'] . ';';
            }
        }
        if (empty($context['pmx']['settings']['head_panel']['collapse']) && !empty($options['collapse_head'])) {
            echo ' display:none;';
        }
        echo '">';
        PortaMx_ShowBlocks('head');
        echo '
					</div>
				</div>
			</div>';
    }
    echo '
			<div class="pmx_table">
				<div class="pmx_tbl_tr">';
    // Left panel
    if (empty($context['pmx']['settings']['left_panel']['collapse']) && !empty($context['pmx']['show_leftpanel'])) {
        echo '
					<div class="pmx_tbl_td">';
        if (!empty($context['pmx']['xbar_left']) && !empty($context['pmx']['show_leftpanel'])) {
            echo '
						<div id="xbarleft" title="' . (empty($options['collapse_left']) ? $txt['pmx_hidepanel'] : $txt['pmx_showpanel']) . $txt['pmx_block_panels']['left'] . '" onclick="leftPanel.toggle()"></div>';
        }
        Show_Block('Left');
        echo '
					</div>';
    }
    echo '
					<div class="pmx_tbl_td pmx_content">';
    // Top panel
    if (!empty($context['pmx']['show_toppanel'])) {
        if (empty($context['pmx']['settings']['top_panel']['collapse']) && $context['pmx']['xbar_top']) {
            echo '
						<div id="xbartop" title="' . (empty($options['collapse_top']) ? $txt['pmx_hidepanel'] : $txt['pmx_showpanel']) . $txt['pmx_block_panels']['top'] . '" onclick="topPanel.toggle()"></div>';
        }
        echo '
						<div id="upshrinkTopBar" style="margin-bottom:' . $context['pmx']['settings']['panelpad'] . 'px;';
        // Height / overflow set?
        if (!empty($context['pmx']['settings']['top_panel']['size'])) {
            echo ' max-height:' . $context['pmx']['settings']['top_panel']['size'] . 'px;';
            if (!empty($context['pmx']['settings']['top_panel']['overflow'])) {
                echo ' overflow:' . $context['pmx']['settings']['top_panel']['overflow'] . ';';
            }
        }
        if (empty($context['pmx']['settings']['top_panel']['collapse']) && !empty($options['collapse_top'])) {
            echo ' display:none;';
        }
        echo '">';
        PortaMx_ShowBlocks('top');
        echo '
						</div>';
    }
    echo '
						<div id="pmx_toppad">
							<div id="pmx_maintable">';
    // put in the cache clear ressult
    if (isset($_SESSION['pmx_cache_cleared'])) {
        echo '
								<div class="infobox" style="margin-bottom:' . $context['pmx']['settings']['panelpad'] . 'px;">' . $txt['cache_clear_ok'] . '</div>';
        unset($_SESSION['pmx_cache_cleared']);
    }
}