Ejemplo n.º 1
0
function template_shop_above()
{
    global $txt, $context, $modSettings, $scripturl;
    // Doing nothing? So be it :P
    if (!isset($context['shop_do'])) {
        $context['shop_do'] = '';
    }
    // TODO: Simplify the code (for the links) below?
    echo '
		<!-- The Linktree -->
		<table width="100%" cellpadding="3" cellspacing="0"><tr><td valign="bottom">', theme_linktree(), '</td></tr></table>
		<table width="100%" cellpadding="0" cellspacing="0" border="0" style="padding-top: 1ex;"><tr>
			<td width="180" valign="top" style="width: 26ex; padding-right: 10px; padding-bottom: 10px;">
				<table width="100%" cellpadding="4" cellspacing="1" border="0" class="bordercolor">
					<tr>
						<td class="catbg">', $txt['shop'], ' Stuff</td>
					</tr>
					<tr class="windowbg2">
						<td class="smalltext" style="line-height: 1.3; padding-bottom: 3ex;">
							', $context['shop_do'] == 'main' ? '<b>' : '', '<a href="', $scripturl, '?action=shop">', $txt['shop'], ' Home</a>', $context['shop_do'] == 'main' ? '</b>' : '', '<br />';
    // Allowed to buy stuff?
    if (allowedTo('shop_buy')) {
        echo '
							', ($context['shop_do'] == 'buy' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=buy">' . $txt['shop_buy'] . '</a>' . ($context['shop_do'] == 'buy' ? '</b>' : '') . '<br />';
    }
    // The inventory - Everyone can access this!
    echo '
							', ($context['shop_do'] == 'inv' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=inv">' . $txt['shop_yourinv'] . '</a>' . ($context['shop_do'] == 'inv' ? '</b>' : ''), '<br />';
    // Allowed to send money to other people
    if (allowedTo('shop_sendmoney')) {
        echo '
							', ($context['shop_do'] == 'sendmoney' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=sendmoney">' . $txt['shop_send_money'] . '</a>' . ($context['shop_do'] == 'sendmoney' ? '</b>' : '') . '<br />';
    }
    // Allowed to send items to other people?
    if (allowedTo('shop_senditems')) {
        echo '
							', $context['shop_do'] == 'senditems' ? '<b>' : '', '<a href="' . $scripturl . '?action=shop;do=senditems">' . $txt['shop_send_item'] . '</a>' . ($context['shop_do'] == 'senditems' ? '</b>' : ''), '<br />';
    }
    // Allowed to view inventory of others?
    if (allowedTo('shop_invother')) {
        echo '
							', $context['shop_do'] == 'invother' ? '<b>' : '', '<a href="' . $scripturl . '?action=shop;do=invother">' . $txt['shop_invother'] . '</a>' . ($context['shop_do'] == 'invother' ? '</b>' : ''), '<br />';
    }
    // Allowed to access the bank?
    if (allowedTo('shop_bank')) {
        echo '
							', ($context['shop_do'] == 'bank' ? '<b>' : '') . $modSettings['shopBankEnabled'] ? '<a href="' . $scripturl . '?action=shop;do=bank">' . $txt['shop_bank'] . '</a><br />' : '' . ($context['shop_do'] == 'bank' ? '</b>' : '');
    }
    // Allowed to access the trade centre?
    if (allowedTo('shop_trade')) {
        echo '
							', ($context['shop_do'] == 'trade' ? '<b>' : '') . $modSettings['shopTradeEnabled'] ? '<a href="' . $scripturl . '?action=shop;do=trade">' . $txt['shop_trade'] . '</a><br />' : '', $context['shop_do'] == 'trade' ? '</b>' : '';
    }
    echo '
						</td>
					</tr>
				</table>
			</td>
			<td valign="top">';
}
Ejemplo n.º 2
0
function template_pm_above()
{
    global $context, $settings, $options, $txt;
    echo '
		<div style="padding: 3px;">', theme_linktree(), '</div>';
    echo '
			<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>
				<td width="125" valign="top">
					<table border="0" cellpadding="4" cellspacing="1" class="bordercolor" width="100">';
    // Loop through every main area - giving a nice section heading.
    foreach ($context['pm_areas'] as $section) {
        echo '
						<tr>
							<td class="catbg">', $section['title'], '</td>
						</tr>
						<tr class="windowbg2">
							<td class="smalltext" style="padding-bottom: 2ex;">';
        // Each sub area.
        foreach ($section['areas'] as $i => $area) {
            if (empty($area)) {
                echo '<br />';
            } elseif (!empty($area['limit_bar'])) {
                // !!! Hardcoded colors = bad.
                echo '
								<br /><br />
								<div align="center">
									<b>', $txt['pm_capacity'], '</b>
									<div align="left" style="border: 1px solid black; height: 7px; width: 100px;">
										<div style="border: 0; background-color: ', $context['limit_bar']['percent'] > 85 ? '#A53D05' : ($context['limit_bar']['percent'] > 40 ? '#EEA800' : '#468008'), '; height: 7px; width: ', $context['limit_bar']['bar'], 'px;"></div>
									</div>
									<span', $context['limit_bar']['percent'] > 90 ? ' style="color: red;"' : '', '>', $context['limit_bar']['text'], '</span>
								</div>
								<br />';
            } else {
                if ($i == $context['pm_area']) {
                    echo '
								<b>', $area['link'], empty($area['unread_messages']) ? '' : ' (<b>' . $area['unread_messages'] . '</b>)', '</b><br />';
                } else {
                    echo '
								', $area['link'], empty($area['unread_messages']) ? '' : ' (<b>' . $area['unread_messages'] . '</b>)', '<br />';
                }
            }
        }
        echo '
							</td>
						</tr>';
    }
    echo '
					</table>
					<br />
				</td>
				<td valign="top">';
}
Ejemplo n.º 3
0
function template_main()
{
    global $context, $settings, $options, $scripturl, $txt;
    // Display the table header and linktree.
    echo '
	<div style="padding: 3px;">', theme_linktree(), '</div>
	<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">
		<tr class="titlebg">
			<td width="30%"><a href="' . $scripturl . '?action=who;start=', $context['start'], ';sort=user', $context['sort_direction'] != 'down' && $context['sort_by'] == 'user' ? '' : ';asc', '">', $txt['who_user'], ' ', $context['sort_by'] == 'user' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>
			<td style="width: 14ex;"><a href="' . $scripturl . '?action=who;start=', $context['start'], ';sort=time', $context['sort_direction'] == 'down' && $context['sort_by'] == 'time' ? ';asc' : '', '">', $txt['who_time'], ' ', $context['sort_by'] == 'time' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>
			<td>', $txt['who_action'], '</td>
		</tr>';
    // This is used to alternate the color of the background.
    $alternate = true;
    // For every member display their name, time and action (and more for admin).
    foreach ($context['members'] as $member) {
        // $alternate will either be true or false. If it's true, use "windowbg2" and otherwise use "windowbg".
        echo '
		<tr class="windowbg', $alternate ? '2' : '', '">
			<td>';
        // Guests don't have information like icq, msn, y!, and aim... and they can't be messaged.
        if (!$member['is_guest']) {
            echo '
				<div style="float: right; width: 14ex;">
					', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['text'], $context['can_send_pm'] ? '</a>' : '', '
					', $member['icq']['link'], ' ', $member['msn']['link'], ' ', $member['yim']['link'], ' ', $member['aim']['link'], '
				</div>';
        }
        echo '
				<span', $member['is_hidden'] ? ' style="font-style: italic;"' : '', '>', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt[92] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . '"') . '>' . $member['name'] . '</a>', '</span>';
        if (!empty($member['ip'])) {
            echo '
				(<a href="' . $scripturl . '?action=trackip;searchip=' . $member['ip'] . '" target="_blank">' . $member['ip'] . '</a>)';
        }
        echo '
			</td>
			<td nowrap="nowrap">', $member['time'], '</td>
			<td>', $member['action'], '</td>
		</tr>';
        // Switch alternate to whatever it wasn't this time. (true -> false -> true -> false, etc.)
        $alternate = !$alternate;
    }
    echo '
		<tr class="titlebg">
			<td colspan="3"><b>', $txt[139], ':</b> ', $context['page_index'], '</td>
		</tr>
	</table>';
}
Ejemplo n.º 4
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();
}
Ejemplo n.º 5
0
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines
 * @copyright 2011 Simple Machines
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.0
 */
function template_main()
{
    global $context, $settings, $options, $txt, $scripturl, $modSettings;
    // Show the anchor for the top and for the first message.  If the first message is new, say so.
    echo '
<a id="top"></a>
<a id="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a id="new"></a>' : '';
    // Show the linktree as well as the "Who's Viewing" information.
    echo '
<table width="100%" cellpadding="3" cellspacing="0">
	<tr>';
    if (!empty($settings['display_who_viewing'])) {
        echo '
		<td align="center" class="smalltext">';
        // Show just numbers...?
        if ($settings['display_who_viewing'] == 1) {
            echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
        } else {
            echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
        }
        // Now show how many guests are here too.
        echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '</td>';
    }
    // Show the previous/next links.
    echo '
		<td valign="bottom" align="', !$context['right_to_left'] ? 'right' : 'left', '" class="smalltext">
			<span class="nav">', $context['previous_next'], '</span>
		</td>
	</tr>
</table>';
    // Is this topic also a poll?
    if ($context['is_poll']) {
        echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="margin-bottom: 2ex;">
	<tr class="titlebg">
		<td colspan="2" valign="middle" style="padding-left: 6px;">
			<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="top" /> ', $txt['poll'], '
		</td>
	</tr>
	<tr class="windowbg">
		<td width="5%" valign="top"><strong>', $txt['poll_question'], ':</strong></td>
		<td>
			', $context['poll']['question'];
        if (!empty($context['poll']['expire_time'])) {
            echo '
			&nbsp;(', $context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on'], ': ', $context['poll']['expire_time'], ')';
        }
        // Are they not allowed to vote but allowed to view the options?
        if ($context['poll']['show_results'] || !$context['allow_vote']) {
            echo '
			<table>
				<tr>
					<td style="padding-top: 2ex;">
						<table border="0" cellpadding="0" cellspacing="0">';
            // Show each option with its corresponding percentage bar.
            foreach ($context['poll']['options'] as $option) {
                echo '
							<tr>
								<td style="padding-right: 2ex;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>', $context['allow_poll_view'] ? '
								<td nowrap="nowrap">' . $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)</td>' : '', '
							</tr>';
            }
            echo '
						</table>
					</td>
					<td valign="bottom" style="padding-left: 15px;">';
            // If they are allowed to revote - show them a link!
            if ($context['allow_change_vote']) {
                echo '
						<a href="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['poll_change_vote'], '</a><br />';
            }
            // If we're viewing the results... maybe we want to go back and vote?
            if ($context['allow_return_vote']) {
                echo '
						<a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], '">', $txt['poll_return_vote'], '</a><br />';
            }
            // If they're allowed to lock the poll, show a link!
            if ($context['poll']['lock']) {
                echo '
						<a href="', $scripturl, '?action=lockvoting;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['poll_lock'] : $txt['poll_unlock'], '</a><br />';
            }
            // If they're allowed to edit the poll... guess what... show a link!
            if ($context['poll']['edit']) {
                echo '
						<a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['poll_edit'], '</a><br />';
            }
            if ($context['can_remove_poll']) {
                echo '
						<a href="' . $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');">', $txt['poll_remove'], '</a>';
            }
            echo '
					</td>
				</tr>', $context['allow_poll_view'] ? '
				<tr>
					<td colspan="2"><strong>' . $txt['poll_total_voters'] . ': ' . $context['poll']['total_votes'] . '</strong></td>
				</tr>' : '', '
			</table><br />';
        } else {
            echo '
			<form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0px;">
				<table>
					<tr>
						<td colspan="2">';
            // Show a warning if they are allowed more than one option.
            if ($context['poll']['allowed_warning']) {
                echo '
							', $context['poll']['allowed_warning'], '
						</td>
					</tr><tr>
						<td>';
            }
            // Show each option with its button - a radio likely.
            foreach ($context['poll']['options'] as $option) {
                echo '
							<label for="', $option['id'], '">', $option['vote_button'], ' ', $option['option'], '</label><br />';
            }
            echo '
						</td>
						<td valign="bottom" style="padding-left: 15px;">';
            // Allowed to view the results? (without voting!)
            if ($context['show_view_results_button']) {
                echo '
							<a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], ';viewresults">', $txt['poll_results'], '</a><br />';
            }
            // Show a link for locking the poll as well...
            if ($context['poll']['lock']) {
                echo '
							<a href="', $scripturl, '?action=lockvoting;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['poll_lock'] : $txt['poll_unlock'], '</a><br />';
            }
            // Want to edit it?  Click right here......
            if ($context['poll']['edit']) {
                echo '
							<a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['poll_edit'], '</a><br />';
            }
            if ($context['can_remove_poll']) {
                echo '
						<a href="' . $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . '" onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');">', $txt['poll_remove'], '</a>';
            }
            echo '
						</td>
					</tr><tr>
						<td colspan="2"><input type="submit" value="', $txt['poll_vote'], '" class="button_submit" /></td>
					</tr>
				</table>
				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
			</form>';
        }
        echo '
		</td>
	</tr>
</table>';
    }
    // Does this topic have some events linked to it?
    if (!empty($context['linked_calendar_events'])) {
        echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="margin-bottom: 2ex;">
	<tr class="titlebg">
		<td colspan="2" valign="middle" align="left" style="padding-left: 6px;">
			', $txt['calendar_linked_events'], '
		</td>
	</tr>
	<tr class="windowbg">
		<td width="5%" valign="top">
			<ul>';
        foreach ($context['linked_calendar_events'] as $event) {
            echo '
				<li>
					', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: red;">*</a> ' : '', '<strong>', $event['title'], '</strong>: ', $event['start_date'], $event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : '', '
				</li>';
        }
        echo '
			</ul>
		</td>
	</tr>
</table>';
    }
    // Show the page index... "Pages: [1]".
    echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="margin-bottom: 1ex;">
	<tr>
		<td class="catbg" width="100%" height="35">
			<table cellpadding="3" cellspacing="0" width="100%">
				<tr>
					<td>
						<strong>', $txt['pages'], ':</strong> ', $context['page_index'];
    // Show a "go down" link?
    if (!empty($modSettings['topbottomEnable'])) {
        echo $context['menu_separator'], '<a href="#bot">', $settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/go_down.gif" alt="' . $txt['go_down'] . '" border="0" align="top" />' : $txt['go_down'], '</a>';
    }
    echo '
					</td>
					<td align="', !$context['right_to_left'] ? 'right' : 'left', '" style="font-size: smaller;">';
    $buttonArray = array();
    if ($context['can_reply']) {
        $buttonArray[] = '<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/reply.gif" alt="' . $txt['reply'] . '" border="0" />' : $txt['reply']) . '</a>';
    }
    if ($context['can_mark_notify']) {
        $buttonArray[] = '<a href="' . $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/' . ($context['is_marked_notify'] ? 'un' : '') . 'notify.gif" alt="' . $txt[$context['is_marked_notify'] ? 'unnotify' : 'notify'] . '" border="0" />' : $txt[$context['is_marked_notify'] ? 'unnotify' : 'notify']) . '</a>';
    }
    // This is a special case; if they can see mark unread, put it at the top... otherwise show add poll.
    if ($context['user']['is_logged'] && $settings['show_mark_read']) {
        $buttonArray[] = '<a href="' . $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/markunread.gif" alt="' . $txt['mark_unread'] . '" border="0" />' : $txt['mark_unread']) . '</a>';
    } elseif ($context['can_add_poll']) {
        $buttonArray[] = '<a href="' . $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/addpoll.gif" alt="' . $txt['add_poll'] . '" border="0" />' : $txt['add_poll']) . '</a>';
    }
    if ($context['can_send_topic']) {
        $buttonArray[] = '<a href="' . $scripturl . '?action=emailuser;sa=sendtopic;topic=' . $context['current_topic'] . '.0">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/sendtopic.gif" alt="' . $txt['send_topic'] . '" border="0" />' : $txt['send_topic']) . '</a>';
    }
    $buttonArray[] = '<a href="' . $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0" rel="new_win nofollow">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/print.gif" alt="' . $txt['print'] . '" border="0" />' : $txt['print']) . '</a>';
    echo implode($context['menu_separator'], $buttonArray);
    echo '</td>
				</tr>
			</table>
		</td>
	</tr>
</table>';
    // Show the topic information - icon, subject, etc.
    echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;">
	<tr class="titlebg">
		<td valign="middle" width="15%" style="padding-left: 6px;">
			<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" alt="" align="middle" /> ', $txt['author'], '
		</td>
		<td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
			', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')
		</td>
	</tr>
</table>

<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false;">

<table cellpadding="0" cellspacing="0" border="0" width="100%" class="bordercolor">';
    $removableMessageIDs = array();
    // Get all the messages...
    while ($message = $context['get_message']()) {
        if ($message['can_remove']) {
            $removableMessageIDs[] = $message['id'];
        }
        echo '
	<tr><td style="padding: 1px 1px 0 1px;">';
        // Show the message anchor and a "new" anchor if this message is new.
        if ($message['id'] != $context['first_message']) {
            echo '
		<a id="msg', $message['id'], '"></a>', $message['first_new'] ? '<a id="new"></a>' : '';
        }
        echo '
		<table width="100%" cellpadding="3" cellspacing="0" border="0">
			<tr><td class="', $message['approved'] ? $message['alternate'] == 0 ? 'windowbg' : 'windowbg2' : 'approvebg', '">';
        // Show information about the poster of this message.
        echo '
				<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
					<tr>
						<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
							<strong>', $message['member']['link'], '</strong>
							<div class="smalltext">';
        // Show the member's custom title, if they have one.
        if (isset($message['member']['title']) && $message['member']['title'] != '') {
            echo '
								', $message['member']['title'], '<br />';
        }
        // Show the member's primary group (like 'Administrator') if they have one.
        if (isset($message['member']['group']) && $message['member']['group'] != '') {
            echo '
								', $message['member']['group'], '<br />';
        }
        // Don't show these things for guests.
        if (!$message['member']['is_guest']) {
            // Show the post group if and only if they have no other group or the option is on, and they are in a post group.
            if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') {
                echo '
								', $message['member']['post_group'], '<br />';
            }
            echo '
								', $message['member']['group_stars'], '<br />';
            // Is karma display enabled?  Total or +/-?
            if ($modSettings['karmaMode'] == '1') {
                echo '
								<br />
								', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '<br />';
            } elseif ($modSettings['karmaMode'] == '2') {
                echo '
								<br />
								', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '<br />';
            }
            // Is this user allowed to modify this member's karma?
            if ($message['member']['karma']['allow']) {
                echo '
								<a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a>
								<a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a><br />';
            }
            // Show online and offline buttons?
            if (!empty($modSettings['onlineEnable'])) {
                echo '
								', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" align="middle" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '<br /><br />';
            }
            // Show the member's gender icon?
            if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender'])) {
                echo '
								', $txt['gender'], ': ', $message['member']['gender']['image'], '<br />';
            }
            // Show how many posts they have made.
            if (!isset($context['disabled_fields']['posts'])) {
                echo '
								', $txt['member_postcount'], ': ', $message['member']['posts'], '<br />';
            }
            // Any custom fields for standard placement?
            if (!empty($message['member']['custom_fields'])) {
                foreach ($message['member']['custom_fields'] as $custom) {
                    if (empty($custom['placement']) || empty($custom['value'])) {
                        echo '
								', $custom['title'], ': ', $custom['value'], '<br />';
                    }
                }
            }
            echo '<br />';
            // Show avatars, images, etc.?
            if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
                echo '
								<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';
            }
            // Show their personal text?
            if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '') {
                echo '
								', $message['member']['blurb'], '<br />
								<br />';
            }
            // Any custom fields to show as icons?
            if (!empty($message['member']['custom_fields'])) {
                foreach ($message['member']['custom_fields'] as $custom) {
                    if ($custom['placement'] == 1 || empty($custom['value'])) {
                        echo '
								', $custom['value'];
                    }
                }
            }
            // This shows the popular messaging icons.
            if ($message['member']['has_messenger'] && $message['member']['can_view_profile']) {
                echo '
								', !isset($context['disabled_fields']['icq']) ? $message['member']['icq']['link'] : '', '
								', !isset($context['disabled_fields']['msn']) ? $message['member']['msn']['link'] : '', '
								', !isset($context['disabled_fields']['aim']) ? $message['member']['aim']['link'] : '', '
								', !isset($context['disabled_fields']['yim']) ? $message['member']['yim']['link'] : '', '
								<br />';
            }
            // Show the profile, website, email address, and personal message buttons.
            if ($settings['show_profile_buttons']) {
                // Don't show the profile button if you're not allowed to view the profile.
                if ($message['member']['can_view_profile']) {
                    echo '
								<a href="', $message['member']['href'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '" border="0" />' : $txt['view_profile'], '</a>';
                }
                // Don't show an icon if they haven't specified a website.
                if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) {
                    echo '
								<a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $message['member']['website']['title'] . '" border="0" />' : $txt['www'], '</a>';
                }
                // Don't show the email address if they want it hidden.
                if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum'))) {
                    echo '
								<a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email'], '</a>';
                }
                // Since we know this person isn't a guest, you *can* message them.
                if ($context['can_send_pm']) {
                    echo '
								<a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '" border="0" />' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a>';
                }
            }
        } elseif (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')) && $message['member']['email']) {
            echo '
								<br />
								<br />
								<a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" border="0" />' : $txt['email'], '</a>';
        }
        // Done with the information about the poster... on to the post itself.
        echo '
							</div>
						</td>
						<td valign="top" width="85%" height="100%">
							<table width="100%" border="0"><tr>
								<td valign="middle"><img src="', $message['icon_url'] . '" alt="" border="0"', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' /></td>
								<td valign="middle">
									<div style="font-weight: bold;" id="subject_', $message['id'], '">
										<a href="', $message['href'], '" rel="nofollow">', $message['subject'], '</a>
									</div>';
        // If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
        echo '
									<div class="smalltext">&#171; <strong>', !empty($message['counter']) ? $txt['reply'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ':</strong> ', $message['time'], ' &#187;</div></td>
								<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" nowrap="nowrap" style="font-size: smaller;">';
        // Maybe we can approve it, maybe we should?
        if ($message['can_approve']) {
            echo '
									<a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/approve.gif" alt="' . $txt['approve'] . '" border="0" />' : $txt['approve'], '</a>';
        }
        // Can they reply?  Have they turned on quick reply?
        if ($context['can_reply'] && !empty($options['display_quick_reply'])) {
            echo '
									<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], '" onclick="return oQuickReply.quote(', $message['id'], ');">', $settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/quote.gif" alt="' . $txt['reply_quote'] . '" border="0" />' : $txt['reply_quote'], '</a>';
        } elseif ($context['can_reply']) {
            echo '
									<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/quote.gif" alt="' . $txt['reply_quote'] . '" border="0" />' : $txt['reply_quote'], '</a>';
        }
        // Can the user modify the contents of this post?
        if ($message['can_modify']) {
            echo '
									<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/modify.gif" alt="' . $txt['modify_msg'] . '" border="0" />' : $txt['modify'], '</a>';
        }
        // How about... even... remove it entirely?!
        if ($message['can_remove']) {
            echo '
									<a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');">', $settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/delete.gif" alt="' . $txt['remove_message'] . '" border="0" />' : $txt['remove'], '</a>';
        }
        // What about splitting it off the rest of the topic?
        if ($context['can_split'] && !empty($context['num_replies'])) {
            echo '
									<a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/split.gif" alt="' . $txt['split'] . '" border="0" />' : $txt['split'], '</a>';
        }
        // Show a checkbox for quick moderation?
        if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) {
            echo '
									<div style="display: none;" id="in_topic_mod_check_', $message['id'], '"></div>';
        }
        // Show the post itself, finally!
        echo '
								</td>
							</tr></table>
							<hr width="100%" size="1" class="hrcolor" />
							<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '
							<img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" title="' . $txt['modify_msg'] . '" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer;" onclick="oQuickModify.modifyMsg(\'' . $message['id'] . '\')" />' : '', '
						</td>
					</tr>';
        // Now for the attachments, signature, ip logged, etc...
        echo '
					<tr>
						<td valign="bottom" class="smalltext" width="85%">
							<table width="100%" border="0" style="table-layout: fixed;"><tr>
								<td colspan="2" class="smalltext" width="100%">';
        // Assuming there are attachments...
        if (!empty($message['attachment'])) {
            echo '
									<hr width="100%" size="1" class="hrcolor" />
									<div style="overflow: ', $context['browser']['is_firefox'] ? 'visible' : 'auto', '; width: 100%;">';
            $last_approved_state = 1;
            foreach ($message['attachment'] as $attachment) {
                // Show a special box for unpproved attachments...
                if ($attachment['is_approved'] != $last_approved_state) {
                    $last_approved_state = 0;
                    echo '
									<fieldset>
										<legend>', $txt['attach_awaiting_approve'], '&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]</legend>';
                }
                if ($attachment['is_image']) {
                    if ($attachment['thumbnail']['has_thumb']) {
                        echo '
									<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
                    } else {
                        echo '
									<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
                    }
                }
                echo '
										<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ';
                if (!$attachment['is_approved']) {
                    echo '
										[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
                }
                echo '
										(', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
            }
            // If we had unapproved attachments clean up.
            if ($last_approved_state == 0) {
                echo '
									</fieldset>';
            }
            echo '
									</div>';
        }
        echo '
								</td>
							</tr><tr>
								<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';
        // Show "� Last Edit: Time by Person �" if this post was edited.
        if ($settings['show_modify'] && !empty($message['modified']['name'])) {
            echo '
									&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';
        }
        echo '
								</td>
								<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">';
        // Maybe they want to report this post to the moderator(s)?
        if ($context['can_report_moderator']) {
            echo '
									<a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a> &nbsp;';
        }
        echo '
									<img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />';
        // Show the IP to this user for this post - because you can moderate?
        if ($context['can_moderate_forum'] && !empty($message['member']['ip'])) {
            echo '
									<a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a>';
        } elseif ($message['can_see_ip']) {
            echo '
									<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $message['member']['ip'], '</a>';
        } elseif (!$context['user']['is_guest']) {
            echo '
									<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $txt['logged'], '</a>';
        } else {
            echo '
									', $txt['logged'];
        }
        echo '
								</td>
							</tr></table>';
        // Are there any custom profile fields for above the signature?
        if (!empty($message['member']['custom_fields'])) {
            $shown = false;
            foreach ($message['member']['custom_fields'] as $custom) {
                if ($custom['placement'] != 2 || empty($custom['value'])) {
                    continue;
                }
                if (empty($shown)) {
                    $shown = true;
                    echo '
							<div class="custom_fields_above_signature">
								<ul class="reset nolist>';
                }
                echo '
									<li>', $custom['value'], '</li>';
            }
            if ($shown) {
                echo '
								</ul>
							</div>';
            }
        }
        // Show the member's signature?
        if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) {
            echo '
							<div class="signature">', $message['member']['signature'], '</div>';
        }
        echo '
						</td>
					</tr>
				</table>
			</td></tr>
		</table>
	</td></tr>';
    }
    echo '
	<tr><td style="padding: 0 0 1px 0;"></td></tr>
</table>
<a id="lastPost"></a>

<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="margin-top: 1ex;">
	<tr>
		<td class="catbg" width="100%" height="30">
			<table cellpadding="3" cellspacing="0" width="100%">
				<tr>
					<td>
						<a id="bot"></a><strong>', $txt['pages'], ':</strong> ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#top">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/go_up.gif" alt="' . $txt['go_up'] . '" border="0" align="top" />' : $txt['go_up']) . '</a>' : '', '
					</td>
					<td align="', !$context['right_to_left'] ? 'right' : 'left', '" style="font-size: smaller;">';
    $buttonArray = array();
    if ($context['can_reply']) {
        $buttonArray[] = '<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/reply.gif" alt="' . $txt['reply'] . '" border="0" />' : $txt['reply']) . '</a>';
    }
    if ($context['can_mark_notify']) {
        $buttonArray[] = '<a href="' . $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/' . ($context['is_marked_notify'] ? 'un' : '') . 'notify.gif" alt="' . $txt[$context['is_marked_notify'] ? 'unnotify' : 'notify'] . '" border="0" />' : $txt[$context['is_marked_notify'] ? 'unnotify' : 'notify']) . '</a>';
    }
    // Another special case, similar to above but reversed.  Show "add poll" unless they can't - then show unread here too.
    if ($context['can_add_poll']) {
        $buttonArray[] = '<a href="' . $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/addpoll.gif" alt="' . $txt['add_poll'] . '" border="0" />' : $txt['add_poll']) . '</a>';
    } elseif ($context['user']['is_logged'] && $settings['show_mark_read']) {
        $buttonArray[] = '<a href="' . $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/markunread.gif" alt="' . $txt['mark_unread'] . '" border="0" />' : $txt['mark_unread']) . '</a>';
    }
    if ($context['can_send_topic']) {
        $buttonArray[] = '<a href="' . $scripturl . '?action=emailuser;sa=sendtopic;topic=' . $context['current_topic'] . '.0">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/sendtopic.gif" alt="' . $txt['send_topic'] . '" border="0" />' : $txt['send_topic']) . '</a>';
    }
    $buttonArray[] = '<a href="' . $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0" target="_blank" class="new_win">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/print.gif" alt="' . $txt['print'] . '" border="0" />' : $txt['print']) . '</a>';
    echo implode($context['menu_separator'], $buttonArray);
    echo '&nbsp;
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
	<tr>';
    if ($settings['linktree_inline']) {
        echo '
		<td valign="top">', theme_linktree(), '</td> ';
    }
    echo '
		<td valign="top" align="', !$context['right_to_left'] ? 'right' : 'left', '" class="smalltext"> <span class="nav"> ', $context['previous_next'], '</span></td>
	</tr>
</table>
<div style="padding-top: 4px; padding-bottom: 4px;" id="moderationbuttons">', theme_show_mod_buttons(), '</div>';
    echo '
</form>';
    echo '
<div class="righttext" style="margin-bottom: 1ex;" id="display_jump_to">&nbsp;</div><br />';
    if ($context['can_reply'] && !empty($options['display_quick_reply'])) {
        echo '
<a id="quickreply"></a>
<table border="0" cellspacing="1" cellpadding="3" class="clear bordercolor" width="100%">
	<tr>
		<td colspan="2" class="catbg"><a href="javascript:oQuickReply.swap();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" border="0" id="quickReplyExpand" /></a> <a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a></td>
	</tr>
	<tr id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
		<td class="windowbg" width="25%" valign="top">', $txt['quick_reply_desc'], $context['is_locked'] ? '<br /><br /><strong>' . $txt['quick_reply_warning'] . '</strong>' : '', '</td>
		<td class="windowbg" width="75%" align="center">
			', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
			', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', '
			<form action="', $scripturl, '?action=post2', empty($context['current_board']) ? '' : ';board=' . $context['current_board'], '" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
				<input type="hidden" name="topic" value="', $context['current_topic'], '" />
				<input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
				<input type="hidden" name="icon" value="xx" />
				<input type="hidden" name="from_qr" value="1" />
				<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
				<input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
				<input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
				<input type="hidden" name="num_replies" value="', $context['num_replies'], '" />';
        // Guests just need more.
        if ($context['user']['is_guest']) {
            echo '
				<strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" />
				<strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" /><br />';
        }
        // Is visual verification enabled?
        if ($context['require_verification']) {
            echo '
				<strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />';
        }
        echo '
				<textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="', $context['tabindex']++, '"></textarea><br />
				<input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" class="button_submit" tabindex="', $context['tabindex']++, '" />
				<input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" class="button_submit" tabindex="', $context['tabindex']++, '" />';
        if ($context['show_spellchecking']) {
            echo '
				<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" class="button_submit" />';
        }
        echo '
				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
				<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
			</form>
		</td>
	</tr>
</table>';
    }
    if ($context['show_spellchecking']) {
        echo '
<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>';
    }
    echo '
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
<script type="text/javascript"><!-- // --><![CDATA[';
    if (!empty($options['display_quick_reply'])) {
        echo '
	var oQuickReply = new QuickReply({
		bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ',
		iTopicId: ', $context['current_topic'], ',
		iStart: ', $context['start'], ',
		sScriptUrl: smf_scripturl,
		sImagesUrl: "', $settings['images_url'], '",
		sContainerId: "quickReplyOptions",
		sImageId: "quickReplyExpand",
		sImageCollapsed: "collapse.gif",
		sImageExpanded: "expand.gif",
		sJumpAnchor: "quickreply"
	});';
    }
    if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post']) {
        echo '
	var oInTopicModeration = new InTopicModeration({
		sSelf: \'oInTopicModeration\',
		sCheckboxContainerMask: \'in_topic_mod_check_\',
		aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'],
		sSessionId: \'', $context['session_id'], '\',
		sSessionVar: \'', $context['session_var'], '\',
		sButtonStrip: \'moderationbuttons\',
		bUseImageButton: true,
		bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
		sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
		sRemoveButtonImage: \'', $settings['lang_images_url'], '/delete_selected.gif\',
		sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
		bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
		sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
		sRestoreButtonImage: \'', $settings['lang_images_url'], '/restore_selected.gif\',
		sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
		sFormId: \'quickModForm\'
	});';
    }
    echo '
	if (\'XMLHttpRequest\' in window)
	{
		var oQuickModify = new QuickModify({
			sScriptUrl: smf_scripturl,
			bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
			iTopicId: ', $context['current_topic'], ',
			sTemplateBodyEdit: ', JavaScriptEscape('
				<div id="quick_edit_body_container" style="width: 90%">
					<div id="error_box" style="padding: 4px;" class="error"></div>
					<textarea class="editor" name="message" rows="12" style="' . ($context['browser']['is_ie8'] ? 'max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br />
					<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
					<input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
					<input type="hidden" name="msg" value="%msg_id%" />
					<div class="righttext">
						<input type="submit" name="post" value="' . $txt['save'] . '" tabindex="8" onclick="return oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\');" accesskey="s" class="button_submit" />&nbsp;&nbsp;' . ($context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" tabindex="9" onclick="spellCheck(\'quickModForm\', \'message\');" class="button_submit" />&nbsp;&nbsp;' : '') . '<input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="9" onclick="return oQuickModify.modifyCancel();" class="button_submit" />
					</div>
				</div>'), ',
			sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%" name="subject" value="%subject%" size="80" maxlength="80" tabindex="6" class="input_text" />'), ',
			sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
			sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
			sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')'), ',
			sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), '
		});
		aJumpTo[aJumpTo.length] = new JumpTo({
			sContainerId: "display_jump_to",
			sJumpToTemplate: "<label class=\\"smalltext\\" for=\\"%select_id%\\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
			iCurBoardId: ', $context['current_board'], ',
			iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
			sCurBoardName: "', $context['jump_to']['board_name'], '",
			sBoardChildLevelIndicator: "==",
			sBoardPrefix: "=> ",
			sCatSeparator: "-----------------------------",
			sCatPrefix: "",
			sGoButtonLabel: "', $txt['go'], '"
		});

		aIconLists[aIconLists.length] = new IconList({
			sBackReference: "aIconLists[" + aIconLists.length + "]",
			sIconIdPrefix: "msg_icon_",
			sScriptUrl: smf_scripturl,
			bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
			iBoardId: ', $context['current_board'], ',
			iTopicId: ', $context['current_topic'], ',
			sSessionId: "', $context['session_id'], '",
			sSessionVar: "', $context['session_var'], '",
			sLabelIconList: "', $txt['message_icon'], '",
			sBoxBackground: "transparent",
			sBoxBackgroundHover: "#ffffff",
			iBoxBorderWidthHover: 1,
			sBoxBorderColorHover: "#adadad" ,
			sContainerBackground: "#ffffff",
			sContainerBorder: "1px solid #adadad",
			sItemBorder: "1px solid #ffffff",
			sItemBorderHover: "1px dotted gray",
			sItemBackground: "transparent",
			sItemBackgroundHover: "#e0e0f0"
		});
	}
// ]]></script>';
}
function template_body_above()
{
    //echo '<div class="panels row container-fluid">';
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    // 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>';
    }
    // Otherwise they're a guest - this time ask them to either register or login - lazy bums...
    /*
    	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" />';
    	// Show the menu here, according to the menu sub template.
    //	template_menu();
    
    	echo '
    		<br class="clear" />
    	</div>';
    */
    // The main content should go here.
    echo '
	<div id="content_section" class="row panels"><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.º 7
0
function template_mainview()
{
    global $scripturl, $txt, $settings, $modSettings, $ID_MEMBER, $subcats_linktree, $context;
    // To get Permissions text
    loadLanguage('Admin');
    // See if they can approve links
    $a_links = allowedTo('approve_links');
    $addlink = allowedTo('add_links');
    $m_cats = allowedTo('links_manage_cat');
    // Get the Category
    if (!empty($_REQUEST['cat'])) {
        $cat = (int) $_REQUEST['cat'];
    }
    echo '
		<div style="padding: 3px;">', theme_linktree(), '</div>';
    // Check if there was a category
    if (empty($cat)) {
        // No category found show the links index
        echo '<h1 align="center"><strong>', $txt['smflinks_indextitle'], '</strong></h1>';
        $ratelink = allowedTo('rate_links');
        // List all the catagories
        // Get category count
        $cat_count = $context['cat_count'];
        echo '<table cellspacing="0" cellpadding="10" border="0" align="center" width="90%" class="tborder">
			<tr>
				<td class="titlebg" colspan="2">', $txt['smflinks_ctitle'], '</td>
				<td class="titlebg">', $txt['smflinks_description'], '</td>
				<td class="titlebg">', $txt['smflinks_totallinks'], '</td>
				', $m_cats ? '<td class="titlebg">' . $txt['smflinks_options'] . '</td>' : '', '
			</tr>
		';
        foreach ($context['catlist'] as $row) {
            $totallinks = GetLinkTotals($row['ID_CAT']);
            echo '<tr>';
            if (empty($row['image'])) {
                echo '
					<td colspan="2" class="windowbg2">
						<a href="', $scripturl, '?action=links;cat=', $row['ID_CAT'], '">', parse_bbc($row['title']), '</a>
					</td>
					<td class="windowbg2">', parse_bbc($row['description']), '</td>
				';
            } else {
                echo '
					<td class="windowbg2">
						<a href="', $scripturl, '?action=links;cat=', $row['ID_CAT'], '">
							<img src="', $row['image'], '" border="0" alt="" />
						</a>
					</td>
					<td class="windowbg2">
						<a href="', $scripturl, '?action=links;cat=', $row['ID_CAT'], '">', parse_bbc($row['title']), '</a>
					</td>
					<td class="windowbg2">', parse_bbc($row['description']), '</td>
				';
            }
            echo '<td class="windowbg2">', $totallinks, '</td>';
            // Show Edit Delete and Order category
            if ($m_cats) {
                echo '<td class="windowbg2"><a href="', $scripturl, '?action=links;sa=catup;cat=', $row['ID_CAT'], ';sesc=', $context['session_id'], '">', $txt['smflinks_txtup'], '</a>&nbsp;<a href="', $scripturl, '?action=links;sa=catdown;cat=', $row['ID_CAT'], ';sesc=', $context['session_id'], '">', $txt['smflinks_txtdown'], '</a></span>&nbsp;<a href="', $scripturl, '?action=links;sa=catperm;cat=', $row['ID_CAT'], ';sesc=', $context['session_id'], '">', $txt['smflinks_txt_perm'], '</a>&nbsp;<a href="', $scripturl, '?action=links;sa=editcat;cat=', $row['ID_CAT'], ';sesc=', $context['session_id'], '">', $txt['smflinks_txtedit'], '</a>&nbsp;<a href="', $scripturl, '?action=links;sa=deletecat;cat=', $row['ID_CAT'], ';sesc=', $context['session_id'], '">', $txt['smflinks_txtdel'], '</a></td>';
            }
            echo '</tr>';
            if (!empty($subcats_linktree)) {
                echo '<tr class="titlebg">
					<td colspan="' . ($m_cats ? '5' : '4') . '">&nbsp;<span class="smalltext">', $subcats_linktree != '' ? $txt['smflinks_sub_cats'] . $subcats_linktree : '', '</span></td>
				</tr>';
            }
        }
        echo '</table>';
        // Permissions for Top 5 Rated, Top 5 Hits and Approval
        $editlink_own = allowedTo('edit_links_own');
        $editlink_any = allowedTo('edit_links_any');
        $deletelink_own = allowedTo('delete_links_own');
        $deletelink_any = allowedTo('delete_links_any');
        echo '<table border="0" cellpadding="0" cellspacing="0" width="90%" align="center">
  <tr>
    <td width="50%" valign="top">';
        // Show Top 5 rated
        if (!empty($modSettings['smflinks_setshowtoprate'])) {
            echo '<div class="tborder" style="margin: 2%;"><div class="catbg2" align="center">' . $txt['smflinks_topfiverated'] . '</div>';
            echo '<table align="center">';
            foreach ($context['linkstop5'] as $row) {
                echo '<tr>
				<td align="center">
				<a href="' . $scripturl . '?action=links;sa=visit&id=' . $row['ID_LINK'] . '" target="blank">' . $row['title'] . '</a>&nbsp;';
                echo $txt['smflinks_rating'] . $row['rating'];
                if ($editlink_any || $editlink_own && $ID_MEMBER == $row['ID_MEMBER']) {
                    echo '&nbsp;<a href="' . $scripturl . '?action=links;sa=editlink&id=' . $row['ID_LINK'] . '">' . $txt['smflinks_txtedit'] . '</a>&nbsp;';
                }
                if ($deletelink_any || $deletelink_own && $ID_MEMBER == $row['ID_MEMBER']) {
                    echo '<a href="' . $scripturl . '?action=links;sa=deletelink&id=' . $row['ID_LINK'] . '">' . $txt['smflinks_txtdel'] . '</a>';
                }
                echo '</td></tr>';
            }
            echo '</table>';
            echo '</div>';
        }
        echo '</td>';
        // Show Top 5 hits
        echo '<td width="50%" valign="top">';
        if (!empty($modSettings['smflinks_setshowmostvisited'])) {
            echo '<div class="tborder" style="margin: 2%;"><div class="catbg2" align="center">' . $txt['smflinks_topfivevisited'] . '</div>';
            echo '<table align="center">';
            foreach ($context['linkstophits'] as $row) {
                echo '<tr>
						<td align="center">';
                echo '<a href="' . $scripturl . '?action=links;sa=visit&id=' . $row['ID_LINK'] . '" target="blank">' . $row['title'] . '</a>&nbsp;';
                echo $txt['smflinks_hits'] . $row['hits'] . '&nbsp;';
                if ($editlink_any || $editlink_own && $ID_MEMBER == $row['ID_MEMBER']) {
                    echo '<a href="' . $scripturl . '?action=links;sa=editlink&id=' . $row['ID_LINK'] . '">' . $txt['smflinks_txtedit'] . '</a>&nbsp;';
                }
                if ($deletelink_any || $deletelink_own && $ID_MEMBER == $row['ID_MEMBER']) {
                    echo '<a href="' . $scripturl . '?action=links;sa=deletelink&id=' . $row['ID_LINK'] . '">' . $txt['smflinks_txtdel'] . '</a>';
                }
                echo '</td></tr>';
            }
            echo '</table>';
            echo '</div>';
        }
        echo '</td>';
        echo '</tr>
	</table>';
        //####################
        // See if they are allowed to add catagories Main Index only
        if ($m_cats) {
            echo '<div class="tborder" style="margin: 2%;"><div class="catbg2" align="center">' . $txt['smflinks_linkspanel'] . '</div>';
            echo '<div align="center" class="windowbg2"><a href="' . $scripturl . '?action=links;sa=addcat">' . $txt['smflinks_addcat'] . '</a>&nbsp;';
            if ($addlink) {
                echo '<a href="' . $scripturl . '?action=links;sa=addlink">' . $txt['smflinks_addlink'] . '</a>&nbsp;';
            }
            echo '<a href="' . $scripturl . '?action=links;sa=admin">' . $txt['smflinks_linkssettings'] . '</a>&nbsp;';
            echo '<a href="' . $scripturl . '?action=links;sa=adminperm">' . $txt['edit_permissions'] . '</a>';
            echo '</div></div>';
        }
        // See if they can approve links
        if ($a_links) {
            $alinks_total = $context['alinks_total'];
            echo '<div class="tborder" style="margin: 2%;"><div class="catbg2" align="center">' . $txt['smflinks_approvepanel'] . '</div>';
            echo '<div align="center" class="windowbg2"><a href="' . $scripturl . '?action=links;sa=alist">' . $txt['smflinks_approvelinks'] . '</a><br />';
            echo $txt['smflinks_thereare'] . '<strong>' . $alinks_total . '</strong>' . $txt['smflinks_waitingapproval'];
            echo '</div></div>';
        }
        // Stats
        if (!empty($modSettings['smflinks_setshowstats'])) {
            $link_count = $context['link_count'];
            echo '<div class="tborder" style="margin: 2%;"><div class="catbg2" align="center">' . $txt['smflinks_stats'] . '</div>';
            echo '<div align="center" class="windowbg2">' . $txt['smflinks_thereare'] . '<strong>' . $cat_count . '</strong>' . $txt['smflinks_catand'] . '<strong>' . $link_count . '</strong>' . $txt['smflinks_linkssystem'] . '</div></div>';
        }
    } else {
        // Category found show the links
        // Get the category name
        $row = $context['linkcatrow'];
        // Setup their permissions
        $editlink_own = allowedTo('edit_links_own');
        $editlink_any = allowedTo('edit_links_any');
        $deletelink_own = allowedTo('delete_links_own');
        $deletelink_any = allowedTo('delete_links_any');
        $ratelink = allowedTo('rate_links');
        $cattitle = $row['title'];
        echo '<h1 align="center"><strong>', $cattitle, '</strong></h1>';
        ShowSubCats($cat, $m_cats);
        if (!empty($_REQUEST['start'])) {
            $context['start'] = (int) $_REQUEST['start'];
        } else {
            $context['start'] = 0;
        }
        if (!empty($_REQUEST['sort'])) {
            switch ($_REQUEST['sort']) {
                case 'title':
                    $sort = 'l.title';
                    break;
                case 'date':
                    $sort = 'l.date';
                    break;
                case 'rating':
                    $sort = 'l.rating';
                    break;
                case 'hits':
                    $sort = 'l.hits';
                    break;
                case 'username':
                    $sort = 'm.realName';
                    break;
                default:
                    $sort = 'l.ID_LINK';
            }
        } else {
            $sort = 'l.ID_LINK';
        }
        if (!empty($_REQUEST['sorto']) && $_REQUEST['sorto'] == 'ASC') {
            $sorto = 'ASC';
        } else {
            $sorto = 'DESC';
        }
        //Change sort order for links
        if ($sorto == 'DESC') {
            $newsorto = 'ASC';
        } else {
            $newsorto = 'DESC';
        }
        if (empty($modSettings['smflinks_setlinksperpage'])) {
            $modSettings['smflinks_setlinksperpage'] = 10;
        }
        // Get Total Pages
        $total = $context['linkstotalpages'];
        // Show the links in that category
        // Check if no links where found
        if ($context['linkslist_count'] == 0) {
            echo '
			<table cellspacing="0" cellpadding="10" border="0" align="center" width="90%" class="tborder">
				<tr>
						<td class="titlebg" align="center"><a href="' . $scripturl . '?action=links;cat=' . $cat . '">' . $cattitle . '</a></td>
				</tr>
				<tr class="windowbg">
					<td align="center">', $txt['smflinks_nolinks'], '</td>
				</tr>



					';
            $numofspans = 1;
        } else {
            $numofspans = 1;
            // There are links found in the category
            echo '<br /><table cellspacing="0" cellpadding="10" border="0" align="center" width="90%" class="tborder">
					<tr>
						<td class="titlebg"><a href="' . $scripturl . '?action=links;cat=' . $cat . ';start=' . $context['start'] . ';sort=title;sorto=' . $newsorto . '">' . $txt['smflinks_ctitle'] . '</a></td>';
            if (!empty($modSettings['smflinks_disp_description'])) {
                echo '<td class="titlebg">' . $txt['smflinks_description'] . '</td>';
                $numofspans++;
            }
            if (!empty($modSettings['smflinks_disp_hits'])) {
                echo '<td class="titlebg"><a href="' . $scripturl . '?action=links;cat=' . $cat . ';start=' . $context['start'] . ';sort=hits;sorto=' . $newsorto . '">' . $txt['smflinks_chits'] . '</a></td>';
                $numofspans++;
            }
            if (!empty($modSettings['smflinks_disp_rating'])) {
                echo '<td class="titlebg"><a href="' . $scripturl . '?action=links;cat=' . $cat . ';start=' . $context['start'] . ';sort=rating;sorto=' . $newsorto . '">' . $txt['smflinks_crating'] . '</a></td>';
                $numofspans++;
            }
            if (!empty($modSettings['smflinks_disp_membername'])) {
                echo '<td class="titlebg"><a href="' . $scripturl . '?action=links;cat=' . $cat . ';start=' . $context['start'] . ';sort=username;sorto=' . $newsorto . '">' . $txt['smflinks_cusername'] . '</a></td>';
                $numofspans++;
            }
            if (!empty($modSettings['smflinks_disp_date'])) {
                echo '<td class="titlebg"><a href="' . $scripturl . '?action=links;cat=' . $cat . ';start=' . $context['start'] . ';sort=date;sorto=' . $newsorto . '">' . $txt['smflinks_cdate'] . '</a></td>';
                $numofspans++;
            }
            $showOptions = false;
            foreach ($context['linkslist'] as $row) {
                if ($editlink_any || $editlink_own && $ID_MEMBER == $row['ID_MEMBER']) {
                    $showOptions = true;
                }
                if ($deletelink_any || $deletelink_own && $ID_MEMBER == $row['ID_MEMBER']) {
                    $showOptions = true;
                }
                if ($a_links) {
                    $showOptions = true;
                }
            }
            if ($showOptions == true) {
                echo '
							<td class="titlebg">' . $txt['smflinks_options'] . '</td>';
                $numofspans++;
            }
            echo '
					</tr>';
            $styleclass = "windowbg";
            foreach ($context['linkslist'] as $row) {
                echo '<tr class="' . $styleclass . '">';
                echo '<td valign="top"><a href="' . $scripturl . '?action=links;sa=visit&id=' . $row['ID_LINK'] . '" target="blank">' . $row['title'] . '</a></td>';
                if (!empty($modSettings['smflinks_disp_description'])) {
                    if (empty($modSettings['smflinks_setallowbbc'])) {
                        echo '<td>' . $row['description'] . '</td>';
                    } else {
                        echo '<td>' . parse_bbc($row['description']) . '</td>';
                    }
                }
                if (!empty($modSettings['smflinks_disp_hits'])) {
                    echo '<td>' . $row['hits'] . '</td>';
                }
                if (!empty($modSettings['smflinks_disp_rating'])) {
                    echo '<td>' . $row['rating'];
                    if ($ratelink) {
                        echo '<br /><a href="' . $scripturl . '?action=links;sa=rate;value=1&id=' . $row['ID_LINK'] . '"><img src="', $settings['images_url'], '/post/thumbup.gif" alt="Good Link" border="0" /></a>&nbsp;&nbsp;<a href="' . $scripturl . '?action=links;sa=rate;value=0&id=' . $row['ID_LINK'] . '"><img src="', $settings['images_url'], '/post/thumbdown.gif" alt="Bad Link" border="0" /></a>';
                    }
                    echo '</td>';
                }
                // Check if it was a guest link
                if (!empty($modSettings['smflinks_disp_membername'])) {
                    if ($row['realName'] != '') {
                        echo '<td><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a></td>';
                    } else {
                        echo '<td>' . $txt['smflinks_txtguest'] . '</td>';
                    }
                }
                if (!empty($modSettings['smflinks_disp_date'])) {
                    echo '<td>' . timeformat($row['date']) . '</td>';
                }
                if ($showOptions == true) {
                    echo '<td>';
                    if ($editlink_any || $editlink_own && $ID_MEMBER == $row['ID_MEMBER']) {
                        echo '<a href="' . $scripturl . '?action=links;sa=editlink&id=' . $row['ID_LINK'] . '">' . $txt['smflinks_txtedit'] . '</a>&nbsp;';
                    }
                    if ($deletelink_any || $deletelink_own && $ID_MEMBER == $row['ID_MEMBER']) {
                        echo '<a href="' . $scripturl . '?action=links;sa=deletelink&id=' . $row['ID_LINK'] . '">' . $txt['smflinks_txtdel'] . '</a>&nbsp;';
                    }
                    if ($a_links) {
                        echo '<a href="' . $scripturl . '?action=links;sa=noapprove&id=' . $row['ID_LINK'] . ';sesc=' . $context['session_id'] . '">' . $txt['smflinks_txtunapprove'] . '</a>';
                    }
                    echo '</td>';
                }
                echo '</tr>';
                if ($styleclass == 'windowbg') {
                    $styleclass = 'windowbg2';
                } else {
                    $styleclass = 'windowbg';
                }
            }
            // Show the pages
            echo '
				<tr class="titlebg">
						<td align="left" colspan="' . $numofspans . '">
						' . $txt['smflinks_pages'];
            $context['page_index'] = constructPageIndex($scripturl . '?action=links;cat=' . $cat . (!empty($_REQUEST['sort']) ? ';sort=' . $_REQUEST['sort'] : '') . (!empty($_REQUEST['sorto']) ? ';sorto=' . $_REQUEST['sorto'] : ''), $context['start'], $total, $modSettings['smflinks_setlinksperpage']);
            echo $context['page_index'];
            echo '
						</td>
					</tr>';
        }
        // Show return to links index link
        echo '

			<tr class="titlebg"><td align="center" colspan="' . $numofspans . '">';
        // See if they are allowed to add a subcategory
        if ($m_cats) {
            echo '<a href="' . $scripturl . '?action=links;sa=addcat;cat=' . $cat . '">' . $txt['smflinks_addsubcat'] . '</a>&nbsp;&nbsp;';
        }
        // See if they are allowed to add links
        if ($addlink) {
            echo '<a href="' . $scripturl . '?action=links;sa=addlink;cat=' . $cat . '">' . $txt['smflinks_addlink'] . '</a>&nbsp;';
            echo '<br /><br />';
        }
        echo '
			<a href="' . $scripturl . '?action=links">' . $txt['smflinks_returnindex'] . '</a>';
        echo '</td></tr>
			</table>';
    }
    LinksCopyright();
}
Ejemplo n.º 8
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.º 9
0
function template_main()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    echo '
	<div style="margin-bottom: 2px;"><a name="top"></a>', theme_linktree(), '</div>';
    if (isset($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0)) {
        echo '
	<div class="tborder" style="margin-bottom: 3ex; ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
		<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor">
			<tr>
				<td colspan="4" class="catbg">', $txt['parent_boards'], '</td>
			</tr>';
        foreach ($context['boards'] as $board) {
            echo '
			<tr>
				<td ', !empty($board['children']) ? 'rowspan="2"' : '', ' class="windowbg" width="6%" align="center" valign="top"><a href="', $scripturl, '?action=unread;board=', $board['id'], '.0">';
            // If the board is new, show a strong indicator.
            if ($board['new']) {
                echo '<img src="', $settings['images_url'], '/on.gif" alt="', $txt[333], '" title="', $txt[333], '" />';
            } elseif ($board['children_new']) {
                echo '<img src="', $settings['images_url'], '/on2.gif" alt="', $txt[333], '" title="', $txt[333], '" />';
            } else {
                echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" />';
            }
            echo '</a>
				</td>
				<td class="windowbg2">
					<b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
					', $board['description'];
            // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
            if (!empty($board['moderators'])) {
                echo '
					<div style="padding-top: 1px;"><small><i>', count($board['moderators']) == 1 ? $txt[298] : $txt[299], ': ', implode(', ', $board['link_moderators']), '</i></small></div>';
            }
            // Show some basic information about the number of posts, etc.
            echo '
				</td>
				<td class="windowbg" valign="middle" align="center" style="width: 12ex;"><small>
					', $board['posts'], ' ', $txt[21], ' <br />
					', $board['topics'], ' ', $txt[330], '</small>
				</td>
				<td class="windowbg2" valign="middle" width="22%"><small>';
            /* The board's and children's 'last_post's have:
            			time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
            			link, href, subject, start (where they should go for the first unread post.),
            			and member. (which has id, name, link, href, username in it.) */
            if (!empty($board['last_post']['id'])) {
                echo '
					<b>', $txt[22], '</b> ', $txt[525], ' ', $board['last_post']['member']['link'], '<br />
					', $txt['smf88'], ' ', $board['last_post']['link'], '<br />
					', $txt[30], ' ', $board['last_post']['time'];
            }
            echo '</small>
				</td>
			</tr>';
            // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
            if (!empty($board['children'])) {
                // Sort the links into an array with new boards bold so it can be imploded.
                $children = array();
                /* Each child in each board's children has:
                			id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
                foreach ($board['children'] as $child) {
                    $child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
                    $children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
                }
                echo '
			<tr>
				<td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">
					<small><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</small>
				</td>
			</tr>';
            }
        }
        echo '
		</table>
	</div>';
    }
    if (!empty($options['show_board_desc']) && $context['description'] != '') {
        echo '
		<table width="100%" cellpadding="6" cellspacing="1" border="0" class="tborder" style="padding: 0; margin-bottom: 2ex;">
			<tr>
				<td class="titlebg2" width="100%" height="24" style="border-top: 0;">
					<small>', $context['description'], '</small>
				</td>
			</tr>
		</table>';
    }
    // Create the button set...
    $normal_buttons = array('markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;sesc=' . $context['session_id']), 'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';sesc=' . $context['session_id']), 'new_topic' => array('test' => 'can_post_new', 'text' => 'smf258', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0'), 'post_poll' => array('test' => 'can_post_poll', 'text' => 'smf20', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'));
    // They can only mark read if they are logged in and it's enabled!
    if (!$context['user']['is_logged'] || !$settings['show_mark_read']) {
        unset($normal_buttons['markread']);
    }
    if (!$context['no_topic_listing']) {
        echo '
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td class="middletext">', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><b>' . $txt['topbottom5'] . '</b></a>' : '', '</td>
				<td align="right" style="padding-right: 1ex;">
					<table cellpadding="0" cellspacing="0">
						<tr>
							', template_button_strip($normal_buttons, 'bottom'), '
						</tr>
					</table>
				</td>
			</tr>
		</table>';
        // If Quick Moderation is enabled start the form.
        if (!empty($options['display_quick_mod']) && !empty($context['topics'])) {
            echo '
	<form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;">';
        }
        echo '
			<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' : '', '>
				<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
					<tr>';
        // Are there actually any topics to show?
        if (!empty($context['topics'])) {
            echo '
						<td width="9%" colspan="2" class="catbg3"></td>

						<td class="catbg3"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[70], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>

						<td class="catbg3" width="11%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[109], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>

						<td class="catbg3" width="4%" align="center"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[110], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>

						<td class="catbg3" width="4%" align="center"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[301], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>

						<td class="catbg3" width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>';
            // Show a "select all" box for quick moderation?
            if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
                echo '
						<td class="catbg3" width="24" valign="middle" align="center">
							<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="check" />
						</td>';
            } elseif (!empty($options['display_quick_mod'])) {
                echo '
						<td class="catbg3" width="4%" valign="middle" align="center"></td>';
            }
        } else {
            echo '
						<td class="catbg3" width="100%" colspan="7"><b>', $txt[151], '</b></td>';
        }
        echo '
					</tr>';
        if (!empty($settings['display_who_viewing'])) {
            echo '
					<tr class="windowbg2">
						<td colspan="', !empty($options['display_quick_mod']) ? '8' : '7', '"><small>';
            if ($settings['display_who_viewing'] == 1) {
                echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19];
            } else {
                echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
            }
            echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '
						</small></td>
					</tr>';
        }
        foreach ($context['topics'] as $topic) {
            // Do we want to seperate the sticky and lock status out?
            if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false) {
                $topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
            }
            if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false) {
                $topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));
            }
            echo '
					<tr>
						<td class="windowbg2" valign="middle" align="center" width="5%">
							<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
						</td>
						<td class="windowbg2" valign="middle" align="center" width="4%">
							<img src="', $topic['first_post']['icon_url'], '" alt="" />
						</td>
						<td class="windowbg', !empty($settings['seperate_sticky_lock']) && $topic['is_sticky'] ? '3' : '', '" valign="middle" ', !empty($topic['quick_mod']['remove']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\', \'' . $context['session_id'] . '\');"' : '', '>';
            // Tagging System
            // Version 2.4.1+stef
            if ($modSettings['smftags_set_display_messageindex'] && in_array($context['current_board'], explode(" ", $modSettings['smftags_set_taggable']))) {
                if (allowedTo('smftags_edit_any') || $topic['first_post']['member']['id'] == $context['user']['id'] && allowedTo('smftags_edit_own')) {
                    // if we have edit rights and there are tags, show edit button
                    echo '<a href="' . $scripturl . '?action=tags;sa=edittopic;topic=' . $topic['id'] . '"><img src="' . $settings['images_url'] . '/icons/tag_blue', empty($topic['tagCount']) ? '_add.gif" title="' . $txt['smftags_addtopic'] . '" ' : '_edit.gif" title="' . $txt['smftags_edittopic'] . ' (' . ($topic['tagCount'] == 1 ? $txt['smftags_1tag'] : sprintf($txt['smftags_xtags'], $topic['tagCount'])) . ')"', ' align="right" id="tagicon' . $topic['id'] . '" style="margin: 0;" /></a>';
                } else {
                    if (!empty($topic['tagCount'])) {
                        // otherwise just show tag icon if there any
                        echo '<img src="' . $settings['images_url'] . '/icons/tag_blue.gif" title="' . ($topic['tagCount'] == 1 ? $txt['smftags_1tag'] : sprintf($txt['smftags_ntags'], $topic['tagCount'])) . '" align="right" id="tagicon' . $topic['id'] . '" style="margin: 0;" />';
                    }
                }
            }
            // End tagging system
            if (!empty($settings['seperate_sticky_lock'])) {
                echo '
							', $topic['is_locked'] ? '<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" id="lockicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '', '
							', $topic['is_sticky'] ? '<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" id="stickyicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '';
            }
            echo '
							', $topic['is_sticky'] ? '<b>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span>', $topic['is_sticky'] ? '</b>' : '';
            // Is this topic new? (assuming they are logged in!)
            if ($topic['new'] && $context['user']['is_logged']) {
                echo '
							<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a>';
            }
            echo '
							<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
						</td>
						<td class="windowbg2" valign="middle" width="14%">
							', $topic['first_post']['member']['link'], '
						</td>
						<td class="windowbg', $topic['is_sticky'] ? '3' : '', '" valign="middle" width="4%" align="center">
							', $topic['replies'], '
						</td>
						<td class="windowbg', $topic['is_sticky'] ? '3' : '', '" valign="middle" width="4%" align="center">
							', $topic['views'], '
						</td>
						<td class="windowbg2" valign="middle" width="22%">
							<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" style="float: right;" /></a>
							<span class="smalltext">
								', $topic['last_post']['time'], '<br />
								', $txt[525], ' ', $topic['last_post']['member']['link'], '
							</span>
						</td>';
            // Show the quick moderation options?
            if (!empty($options['display_quick_mod'])) {
                echo '
						<td class="windowbg', $topic['is_sticky'] ? '3' : '', '" valign="middle" align="center" width="4%">';
                if ($options['display_quick_mod'] == 1) {
                    echo '
								<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="check" />';
                } else {
                    // Check permissions on each and show only the ones they are allowed to use.
                    if ($topic['quick_mod']['remove']) {
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=remove;sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_remove.gif" width="16" alt="', $txt[63], '" title="', $txt[63], '" /></a>';
                    }
                    if ($topic['quick_mod']['lock']) {
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=lock;sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_lock.gif" width="16" alt="', $txt['smf279'], '" title="', $txt['smf279'], '" /></a>';
                    }
                    if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
                        echo '<br />';
                    }
                    if ($topic['quick_mod']['sticky']) {
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=sticky;sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_sticky.gif" width="16" alt="', $txt['smf277'], '" title="', $txt['smf277'], '" /></a>';
                    }
                    if ($topic['quick_mod']['move']) {
                        echo '<a href="', $scripturl, '?action=movetopic;board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><img src="', $settings['images_url'], '/icons/quick_move.gif" width="16" alt="', $txt[132], '" title="', $txt[132], '" /></a>';
                    }
                }
                echo '</td>';
            }
            echo '
					</tr>';
        }
        if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
            echo '
					<tr class="catbg">
						<td colspan="8" align="right">
					<select name="qaction"', $context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
								<option value="">--------</option>
								', $context['can_remove'] ? '<option value="remove">' . $txt['quick_mod_remove'] . '</option>' : '', '
								', $context['can_lock'] ? '<option value="lock">' . $txt['quick_mod_lock'] . '</option>' : '', '
								', $context['can_sticky'] ? '<option value="sticky">' . $txt['quick_mod_sticky'] . '</option>' : '', '
								', $context['can_move'] ? '<option value="move">' . $txt['quick_mod_move'] . ': </option>' : '', '
								', $context['can_merge'] ? '<option value="merge">' . $txt['quick_mod_merge'] . '</option>' : '', '
								<option value="markread">', $txt['quick_mod_markread'], '</option>
							</select>';
            if ($context['can_move']) {
                echo '
							<select id="moveItTo" name="move_to" disabled="disabled">';
                foreach ($context['jump_to'] as $category) {
                    foreach ($category['boards'] as $board) {
                        if (!$board['is_current']) {
                            echo '
												<option value="', $board['id'], '"', !empty($board['selected']) ? ' selected="selected"' : '', '>', str_repeat('-', $board['child_level'] + 1), ' ', $board['name'], '</option>';
                        }
                    }
                }
                echo '
							</select>';
            }
            echo '
							<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" />
						</td>
					</tr>';
        }
        echo '
				</table>
			</div>
			<a name="bot"></a>';
        // Finish off the form - again.
        if (!empty($options['display_quick_mod']) && !empty($context['topics'])) {
            echo '
			<input type="hidden" name="sc" value="' . $context['session_id'] . '" />
	</form>';
        }
        echo '
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td class="middletext">', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><b>' . $txt['topbottom4'] . '</b></a>' : '', '</td>
			<td align="right" style="padding-right: 1ex;">
				<table cellpadding="0" cellspacing="0">
					<tr>
						', template_button_strip($normal_buttons, 'top'), '
					</tr>
				</table>
			</td>
		</tr>
	</table>';
    }
    // Show breadcrumbs at the bottom too?
    echo '
	<div>', theme_linktree(), '<br /></div>';
    echo '
	<div class="tborder">
		<table cellpadding="8" cellspacing="0" width="100%" class="titlebg2">
			<tr>';
    if (!$context['no_topic_listing']) {
        echo '
				<td style="padding-top: 2ex;" class="smalltext">', !empty($modSettings['enableParticipation']) ? '
					<img src="' . $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['participation_caption'] . '<br />' : '', '
					<img src="' . $settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' . $txt[457] . '<br />
					<img src="' . $settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' . $txt[454] . '<br />
					<img src="' . $settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' . $txt[455] . '
				</td>
				<td valign="top" style="padding-top: 2ex;" class="smalltext">
					<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" alt="" align="middle" /> ' . $txt[456] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? '
					<img src="' . $settings['images_url'] . '/icons/quick_sticky.gif" alt="" align="middle" /> ' . $txt['smf96'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? '
					<img src="' . $settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' . $txt['smf43'] : '') . '
				</td>';
    }
    echo '
				<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="middle">
					<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" name="jumptoForm">
						<span class="smalltext"><label for="jumpto">' . $txt[160] . '</label>:</span>
					<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
								<option value="">' . $txt[251] . ':</option>';
    // Show each category - they all have an id, name, and the boards in them.
    foreach ($context['jump_to'] as $category) {
        // Show the category name with a link to the category. (index.php#id)
        echo '
								<option value="" disabled="disabled">-----------------------------</option>
								<option value="#', $category['id'], '">', $category['name'], '</option>
								<option value="" disabled="disabled">-----------------------------</option>';
        /* Now go through each board - they all have:
        			id, name, child_level (how many parents they have, basically...), and is_current. (is this the current board?) */
        foreach ($category['boards'] as $board) {
            // Show some more =='s if this is a child, so as to make it look nice.
            echo '
								<option value="?board=', $board['id'], '.0"', $board['is_current'] ? ' selected="selected"' : '', '> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>';
        }
    }
    echo '
						</select>&nbsp;
					<input type="button" value="', $txt[161], '" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \'', $scripturl, '\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" />
					</form>
				</td>
			</tr>
		</table>
	</div>';
    // Javascript for inline editing.
    echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/xml_board.js"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

	// Hide certain bits during topic edit.
	hide_prefixes.push("lockicon", "stickyicon", "pages", "newicon");

	// Use it to detect when we\'ve stopped editing.
	document.onclick = modify_topic_click;

	var mouse_on_div;
	function modify_topic_click()
	{
		if (in_edit_mode == 1 && mouse_on_div == 0)
			modify_topic_save("', $context['session_id'], '");
	}

	function modify_topic_keypress(oEvent)
	{
		if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13)
		{
			modify_topic_save("', $context['session_id'], '");
			if (typeof(oEvent.preventDefault) == "undefined")
				oEvent.returnValue = false;
			else
				oEvent.preventDefault();
		}
	}

	// For templating, shown when an inline edit is made.
	function modify_topic_show_edit(subject)
	{
		// Just template the subject.
		setInnerHTML(cur_subject_div, \'<input type="text" name="subject" value="\' + subject + \'" size="60" style="width: 99%;"  maxlength="80" onkeypress="modify_topic_keypress(event)" /><input type="hidden" name="topic" value="\' + cur_topic_id + \'" /><input type="hidden" name="msg" value="\' + cur_msg_id.substr(4) + \'" />\');
	}

	// And the reverse for hiding it.
	function modify_topic_hide_edit(subject)
	{
		// Re-template the subject!
		setInnerHTML(cur_subject_div, \'<a href="', $scripturl, '?topic=\' + cur_topic_id + \'.0">\' + subject + \'</a>\');
	}

// ]]></script>';
}
Ejemplo n.º 10
0
function template_main()
{
    global $context, $settings, $options, $txt, $scripturl, $modSettings;
    // Show the anchor for the top and for the first message.  If the first message is new, say so.
    echo '
<a name="top"></a>
<a name="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a name="new"></a>' : '';
    // Show the linktree as well as the "Who's Viewing" information.
    echo '
<table width="100%" cellpadding="3" cellspacing="0">
	<tr>
		<td valign="bottom">', theme_linktree(), '</td>';
    if (!empty($settings['display_who_viewing'])) {
        echo '
		<td align="center" class="smalltext">';
        // Show just numbers...?
        if ($settings['display_who_viewing'] == 1) {
            echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19];
        } else {
            echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
        }
        // Now show how many guests are here too.
        echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '</td>';
    }
    // Show the previous/next links.
    echo '
		<td valign="bottom" align="right" class="smalltext">
			<span class="nav">', $context['previous_next'], '</span>
		</td>
	</tr>
</table>';
    // Show the page index... "Pages: [1]".
    echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;">
	<tr>
		<td align="left" class="catbg" width="100%" height="35">
			<table cellpadding="3" cellspacing="0" width="100%">
				<tr>
					<td>
						<b>', $txt[139], ':</b> ', $context['page_index'];
    // Show a "go down" link?
    if (!empty($modSettings['topbottomEnable'])) {
        echo $context['menu_separator'], '<a href="#bot">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_down.gif" alt="' . $txt['topbottom5'] . '" border="0" align="top" />' : $txt['topbottom5'], '</a>';
    }
    echo '
					</td>
					<td align="right" style="font-size: smaller;">', theme_show_main_buttons(), '</td>
				</tr>
			</table>
		</td>
	</tr>
</table>';
    // Is this topic also a poll?
    if ($context['is_poll']) {
        echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="border-bottom: 0;">
	<tr class="titlebg">
		<td colspan="2" valign="middle" align="left" style="padding-left: 6px;">
			<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="top" /> ', $txt['smf43'], '
		</td>
	</tr>
	<tr class="windowbg">
		<td width="5%" valign="top"><b>', $txt['smf21'], ':</b></td>
		<td>
			', $context['poll']['question'];
        // Are they not allowed to vote but allowed to view the options?
        if ($context['poll']['show_results'] || !$context['allow_vote']) {
            echo '
			<table>
				<tr>
					<td style="padding-top: 2ex;">
						<table border="0" cellpadding="0" cellspacing="0">';
            // Show each option with its corresponding percentage bar.
            foreach ($context['poll']['options'] as $option) {
                echo '
							<tr>
								<td', $option['voted_this'] ? ' style="font-weight: bold;"' : '', '>', $option['option'], '</td>', $context['allow_poll_view'] ? '
								<td width="7">&nbsp;</td>
								<td nowrap="nowrap">' . $option['bar'] . $option['votes'] . ' (' . $option['percent'] . '%)</td>' : '', '
							</tr>';
            }
            echo '
						</table>
					</td>
					<td valign="bottom" style="padding-left: 15px;">';
            // If they are allowed to revote - show them a link!
            if ($context['allow_change_vote']) {
                echo '
						<a href="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], ';sesc=', $context['session_id'], '">', $txt['poll_change_vote'], '</a><br />';
            }
            // If we're viewing the results... maybe we want to go back and vote?
            if ($context['poll']['show_results'] && $context['allow_vote']) {
                echo '
						<a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], '">', $txt['poll_return_vote'], '</a><br />';
            }
            // If they're allowed to lock the poll, show a link!
            if ($context['poll']['lock']) {
                echo '
						<a href="', $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b'], '</a><br />';
            }
            // If they're allowed to edit the poll... guess what... show a link!
            if ($context['poll']['edit']) {
                echo '
						<a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>';
            }
            echo '
					</td>
				</tr>', $context['allow_poll_view'] ? '
				<tr>
					<td colspan="2"><b>' . $txt['smf24'] . ': ' . $context['poll']['total_votes'] . '</b></td>
				</tr>' : '', '
			</table><br />';
        } else {
            echo '
			<form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0px;">
				<table>
					<tr>
						<td colspan="2">';
            // Show a warning if they are allowed more than one option.
            if ($context['poll']['allowed_warning']) {
                echo '
							', $context['poll']['allowed_warning'], '
						</td>
					</tr><tr>
						<td>';
            }
            // Show each option with its button - a radio likely.
            foreach ($context['poll']['options'] as $option) {
                echo '
							<label for="', $option['id'], '">', $option['vote_button'], ' ', $option['option'], '</label><br />';
            }
            echo '
						</td>
						<td valign="bottom" style="padding-left: 15px;">';
            // Allowed to view the results? (without voting!)
            if ($context['allow_poll_view']) {
                echo '
							<a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], ';viewResults">', $txt['smf29'], '</a><br />';
            }
            // Show a link for locking the poll as well...
            if ($context['poll']['lock']) {
                echo '
							<a href="', $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b'], '</a><br />';
            }
            // Want to edit it?  Click right here......
            if ($context['poll']['edit']) {
                echo '
							<a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>';
            }
            echo '
						</td>
					</tr><tr>
						<td colspan="2"><input type="submit" value="', $txt['smf23'], '" /></td>
					</tr>
				</table>
				<input type="hidden" name="sc" value="', $context['session_id'], '" />
			</form>';
        }
        echo '
		</td>
	</tr>
</table>';
    }
    // Does this topic have some events linked to it?
    if (!empty($context['linked_calendar_events'])) {
        echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">
	<tr class="titlebg">
		<td colspan="2" valign="middle" align="left" style="padding-left: 6px;">
			', $txt['calendar_linked_events'], '
		</td>
	</tr>
	<tr class="windowbg">
		<td width="5%" valign="top">
			<ul>';
        foreach ($context['linked_calendar_events'] as $event) {
            echo '
				<li>
					<b>', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: red;">*</a> ' : '', $event['title'], '</b>: ', $event['start_date'], $event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : '';
            echo '
				</li>';
        }
        echo '
			</ul>
		</td>
	</tr>
</table>';
    }
    // Show the topic information - icon, subject, etc.
    echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" align="center" class="tborder" style="border-bottom: 0;">
	<tr class="titlebg">
		<td valign="middle" align="left" width="15%" style="padding-left: 6px;">
			<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" alt="" />
			', $txt[29], '
		</td>
		<td valign="middle" align="left" width="85%" style="padding-left: 6px;" id="top_subject">
			', $txt[118], ': ', $context['subject'], ' &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
		</td>
	</tr>
</table>';
    //if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
    echo '
<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return in_edit_mode == 1 ? modify_save(\'' . $context['session_id'] . '\') : confirm(\'' . $txt['quickmod_confirm'] . '\');">';
    echo '
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="bordercolor">';
    // Get all the messages...
    while ($message = $context['get_message']()) {
        echo '
	<tr><td style="padding: 1px 1px 0 1px;">';
        // Show the message anchor and a "new" anchor if this message is new.
        if ($message['id'] != $context['first_message']) {
            echo '
		<a name="msg', $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : '';
        }
        echo '
		<table cellpadding="3" cellspacing="0" border="0" width="100%">
			<tr><td class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', '">';
        // Show information about the poster of this message.
        echo '
				<table width="100%" cellpadding="5" cellspacing="0">
					<tr>
						<td valign="top" width="15%" rowspan="2">
							<b>', $message['member']['link'], '</b><br />
							<span class="smalltext">';
        // Show the member's custom title, if they have one.
        if (isset($message['member']['title']) && $message['member']['title'] != '') {
            echo '
								', $message['member']['title'], '<br />';
        }
        // Show the member's primary group (like 'Administrator') if they have one.
        if (isset($message['member']['group']) && $message['member']['group'] != '') {
            echo '
								', $message['member']['group'], '<br />';
        }
        // Don't show these things for guests.
        if (!$message['member']['is_guest']) {
            // Show the post group if and only if they have no other group or the option is on, and they are in a post group.
            if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') {
                echo '
								', $message['member']['post_group'], '<br />';
            }
            echo '
								', $message['member']['group_stars'], '<br />';
            // Is karma display enabled?  Total or +/-?
            if ($modSettings['karmaMode'] == '1') {
                echo '
								<br />
								', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '<br />';
            } elseif ($modSettings['karmaMode'] == '2') {
                echo '
								<br />
								', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '<br />';
            }
            // Is this user allowed to modify this member's karma?
            if ($message['member']['karma']['allow']) {
                echo '
								<a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a>
								<a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a><br />';
            }
            // Show online and offline buttons?
            if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) {
                echo '
								', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" align="middle" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '<br /><br />';
            }
            // Show the member's gender icon?
            if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '') {
                echo '
								', $txt[231], ': ', $message['member']['gender']['image'], '<br />';
            }
            // Show how many posts they have made.
            echo '
								', $txt[26], ': ', $message['member']['posts'], '<br />
								<br />';
            // Show avatars, images, etc.?
            if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
                echo '
								', $message['member']['avatar']['image'], '<br />';
            }
            // Show their personal text?
            if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '') {
                echo '
								', $message['member']['blurb'], '<br />
								<br />';
            }
            // This shows the popular messaging icons.
            echo '
								', $message['member']['icq']['link'], '
								', $message['member']['msn']['link'], '
								', $message['member']['yim']['link'], '
								', $message['member']['aim']['link'], '<br />';
            // Show the profile, website, email address, and personal message buttons.
            if ($settings['show_profile_buttons']) {
                // Don't show the profile button if you're not allowed to view the profile.
                if ($message['member']['can_view_profile']) {
                    echo '
								<a href="', $message['member']['href'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" border="0" />' : $txt[27], '</a>';
                }
                // Don't show an icon if they haven't specified a website.
                if ($message['member']['website']['url'] != '') {
                    echo '
								<a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $txt[515] . '" border="0" />' : $txt[515], '</a>';
                }
                // Don't show the email address if they want it hidden.
                if (empty($message['member']['hide_email'])) {
                    echo '
								<a href="mailto:', $message['member']['email'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69], '</a>';
                }
                // Since we know this person isn't a guest, you *can* message them.
                if ($context['can_send_pm']) {
                    echo '
								<a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['label'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . $message['member']['online']['label'] . '" border="0" />' : $message['member']['online']['label'], '</a>';
                }
            }
        } elseif (empty($message['member']['hide_email'])) {
            echo '
								<br />
								<br />
								<a href="mailto:', $message['member']['email'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69], '</a>';
        }
        // Done with the information about the poster... on to the post itself.
        echo '
							</span>
						</td>
						<td valign="top" width="85%" height="100%">
							<table width="100%" border="0"><tr>
								<td align="left" valign="middle"><a href="', $message['href'], '"><img src="', $message['icon_url'] . '" alt="" border="0" /></a></td>
								<td align="left" valign="middle">
									<div style="font-weight: bold;" id="subject_', $message['id'], '">
										<a href="', $message['href'], '">', $message['subject'], '</a>
									</div>';
        // If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
        echo '
									<span class="smalltext">&#171; <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' &#187;</span></td>
								<td align="right" valign="bottom" height="20" nowrap="nowrap" style="font-size: smaller;">';
        // Can they reply?  Have they turned on quick reply?
        if ($context['can_reply'] && !empty($options['display_quick_reply'])) {
            echo '
									<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '" onclick="doQuote(', $message['id'], ', \'', $context['session_id'], '\'); return false;">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145], '</a>';
        } elseif ($context['can_reply']) {
            echo '
									<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145], '</a>';
        }
        // Can the user modify the contents of this post?
        if ($message['can_modify']) {
            echo '
									<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/modify.gif" alt="' . $txt[66] . '" border="0" />' : $txt[17], '</a>';
        }
        // How about... even... remove it entirely?!
        if ($message['can_remove']) {
            echo '
									<a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete.gif" alt="' . $txt[121] . '" border="0" />' : $txt[31], '</a>';
        }
        // What about splitting it off the rest of the topic?
        if ($context['can_split']) {
            echo '
									<a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/split.gif" alt="' . $txt['smf251'] . '" border="0" />' : $txt['smf251'], '</a>';
        }
        // Show a checkbox for quick moderation?
        if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) {
            echo '
									<input type="checkbox" name="msgs[]" value="', $message['id'], '" class="check" />';
        }
        // Show the post itself, finally!
        echo '
								</td>
							</tr></table>
							<hr width="100%" size="1" class="hrcolor" />
							<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '
							<img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer;" onclick="modify_msg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '', '
						</td>
					</tr>';
        // Now for the attachments, signature, ip logged, etc...
        echo '
					<tr>
						<td valign="bottom" class="smalltext">
							<table width="100%" border="0"><tr>
								<td align="left" colspan="2" class="smalltext">';
        // Assuming there are attachments...
        if (!empty($message['attachment'])) {
            echo '
									<hr width="100%" size="1" class="hrcolor" />';
            foreach ($message['attachment'] as $attachment) {
                if ($attachment['is_image']) {
                    if ($attachment['thumbnail']['has_thumb']) {
                        echo '
									<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
                    } else {
                        echo '
									<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
                    }
                }
                echo '
									<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
            }
        }
        echo '
								</td>
							</tr><tr>
								<td align="left" valign="bottom" class="smalltext" id="modified_', $message['id'], '">';
        // Show "« Last Edit: Time by Person »" if this post was edited.
        if ($settings['show_modify'] && !empty($message['modified']['name'])) {
            echo '
									&#171; <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> &#187;';
        }
        echo '
								</td>
								<td align="right" valign="bottom" class="smalltext">';
        // Maybe they want to report this post to the moderator(s)?
        if ($context['can_report_moderator']) {
            echo '
									<a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['rtm1'], '</a> &nbsp;';
        }
        echo '
									<img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />';
        // Show the IP to this user for this post - because you can moderate?
        if ($context['can_moderate_forum'] && !empty($message['member']['ip'])) {
            echo '
									<a href="', $scripturl, '?action=trackip;searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a>';
        } elseif ($message['can_see_ip']) {
            echo '
									<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $message['member']['ip'], '</a>';
        } elseif (!$context['user']['is_guest']) {
            echo '
									<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $txt[511], '</a>';
        } else {
            echo '
									', $txt[511];
        }
        echo '
								</td>
							</tr></table>';
        // Show the member's signature?
        if (!empty($message['member']['signature']) && empty($options['show_no_signatures'])) {
            echo '
							<hr width="100%" size="1" class="hrcolor" />
							<div class="signature">', $message['member']['signature'], '</div>';
        }
        echo '
						</td>
					</tr>
				</table>
			</td></tr>
		</table>
	</td></tr>';
    }
    echo '
</table>
<a name="lastPost"></a>
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td>
	<table width="100%" border="0" cellpadding="3" cellspacing="1" class="bordercolor">
		<tr>
			<td align="left" class="catbg" width="100%" height="30">
				<table cellpadding="3" cellspacing="0" width="100%">
					<tr>
						<td>
							<a name="bot"></a><b>', $txt[139], ':</b> ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#top">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_up.gif" alt="' . $txt['topbottom4'] . '" border="0" align="top" />' : $txt['topbottom4']) . '</a>' : '', '
						</td>
						<td align="right" style="font-size: smaller;">
							', theme_show_main_buttons(), '&nbsp;
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</td></tr></table>';
    if ($context['show_spellchecking']) {
        echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/spellcheck.js"></script>';
    }
    echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/xml_topic.js"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
	quickReplyCollapsed = ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ';

	smf_topic = ', $context['current_topic'], ';
	smf_start = ', $context['start'], ';
	smf_show_modify = ', $settings['show_modify'] ? '1' : '0', ';

	// On quick modify, this is what the body will look like.
	var smf_template_body_edit = \'<div id="error_box" style="padding: 4px; color: red;"></div><textarea class="editor" name="message" rows="12" style="width: 94%; margin-bottom: 10px;">%body%</textarea><br /><input type="hidden" name="sc" value="', $context['session_id'], '" /><input type="hidden" name="topic" value="', $context['current_topic'], '" /><input type="hidden" name="msg" value="%msg_id%" /><div style="text-align: center;"><input type="submit" name="post" value="', $txt[10], '" onclick="return modify_save(\\\'' . $context['session_id'] . '\\\');" accesskey="s" />&nbsp;&nbsp;', $context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" onclick="spellCheck(\\\'quickModForm\\\', \\\'message\\\');" />&nbsp;&nbsp;' : '', '<input type="submit" name="cancel" value="', $txt['modify_cancel'], '" onclick="return modify_cancel();" /></div>\';

	// And this is the replacement for the subject.
	var smf_template_subject_edit = \'<input type="text" name="subject" value="%subject%" size="60" style="width: 99%;"  maxlength="80" />\';

	// Restore the message to this after editing.
	var smf_template_body_normal = \'%body%\';
	var smf_template_subject_normal = \'<a href="', $scripturl, '?topic=', $context['current_topic'], '.msg%msg_id%#msg%msg_id%">%subject%</a>\';
	var smf_template_top_subject = "', $txt[118], ': %subject% &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')"

	if (window.XMLHttpRequest)
		showModifyButtons();
// ]]></script>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
	<tr>';
    if ($settings['linktree_inline']) {
        echo '
		<td valign="top" align="left">', theme_linktree(), '</td> ';
    }
    echo '
		<td valign="top" align="right" class="smalltext"> <span class="nav"> ', $context['previous_next'], '</span></td>
	</tr><tr>
		<td align="left" colspan="2" style="padding-top: 4px;">
			', theme_show_mod_buttons(), '
		</td>
	</tr>
</table>';
    // This button has an identity crisis: it wishes it were an image. (kinda like the characters in The Wizard of Oz.)
    if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post']) {
        echo '
	<input type="hidden" name="sc" value="', $context['session_id'], '">';
    }
    echo '
</form>';
    echo '
<table border="0" width="100%">
	<tr>
		<td align="right" colspan="2">
			<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '">
				<span class="smalltext">' . $txt[160] . ':</span>
				<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
					<option value="">' . $txt[251] . ':</option>';
    foreach ($context['jump_to'] as $category) {
        echo '
					<option value="" disabled="disabled">-----------------------------</option>
					<option value="#', $category['id'], '">', $category['name'], '</option>
					<option value="" disabled="disabled">-----------------------------</option>';
        foreach ($category['boards'] as $board) {
            echo '
					<option value="?board=', $board['id'], '.0"', $board['is_current'] ? ' selected="selected"' : '', '> ' . str_repeat('==', $board['child_level']) . '=> ' . $board['name'] . '</option>';
        }
    }
    echo '
				</select>&nbsp;
				<input type="button" value="', $txt[161], '" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \'', $scripturl, '\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" />
			</form>
		</td>
	</tr>
</table>';
    if ($context['can_reply'] && !empty($options['display_quick_reply'])) {
        echo '
			<a name="quickreply"></a>
			<table border="0" cellspacing="1" cellpadding="3" class="bordercolor" width="100%" style="clear: both;">
				<tr>
					<td colspan="2" class="catbg"><a href="javascript:swapQuickReply();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" border="0" id="quickReplyExpand" /></a> <a href="javascript:swapQuickReply();">', $txt['quick_reply_1'], '</a></td>
				</tr>
				<tr id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
					<td class="windowbg" width="25%" valign="top">', $txt['quick_reply_2'], $context['is_locked'] ? '<br /><br /><b>' . $txt['quick_reply_warning'] . '</b>' : '', '</td>
					<td class="windowbg" width="75%" align="center">
						<form action="', $scripturl, '?action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" style="margin:0px;">
							<input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
							<input type="hidden" name="subject" value="' . $context['response_prefix'] . $context['subject'] . '" />
							<input type="hidden" name="icon" value="xx" />
							<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
							<input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
							<input type="hidden" name="num_replies" value="', $context['num_replies'], '" />
							<textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea><br />
							<input type="submit" name="post" value="' . $txt[105] . '" accesskey="s" tabindex="2" />
							<input type="submit" name="preview" value="' . $txt[507] . '" accesskey="p" tabindex="4" />';
        if ($context['show_spellchecking']) {
            echo '
							<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" />';
        }
        echo '
							<input type="hidden" name="sc" value="' . $context['session_id'] . '" />
							<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
						</form>
					</td>
				</tr>
			</table>';
    }
    if ($context['show_spellchecking']) {
        echo '
			<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';
    }
}
Ejemplo n.º 11
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.º 12
0
function template_search()
{
    global $context, $settings, $options, $scripturl, $txt;
    // Start the submission form for the search!
    echo '
		<form action="', $scripturl, '?action=mlist;sa=search" method="post" accept-charset="', $context['character_set'], '">';
    // Display that link tree...
    echo '
		<div style="padding: 3px;">', theme_linktree(), '</div>';
    // Display links to view all/search.
    if (!empty($settings['use_tabs'])) {
        echo '
		<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
			<tr>
				<td class="mirrortab_first">&nbsp;</td>';
        foreach ($context['sort_links'] as $link) {
            if ($link['selected']) {
                echo '
				<td class="mirrortab_active_first">&nbsp;</td>
				<td valign="top" class="mirrortab_active_back">
					<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">', $link['label'], '</a>
				</td>
				<td class="mirrortab_active_last">&nbsp;</td>';
            } else {
                echo '
				<td valign="top" class="mirrortab_back">
					<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">', $link['label'], '</a>
				</td>';
            }
        }
        echo '
				<td class="mirrortab_last">&nbsp;</td>
			</tr>
		</table>
		<div class="tborder">';
    } else {
        echo '
		<div class="bordercolor" style="padding: 1px;">
			<div class="titlebg" style="padding: 4px 4px 4px 10px;">';
        $links = array();
        foreach ($context['sort_links'] as $link) {
            $links[] = ($link['selected'] ? '<img src="' . $settings['images_url'] . '/selected.gif" alt="&gt;" /> ' : '') . '<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">' . $link['label'] . '</a>';
        }
        echo '
					', implode(' | ', $links), '
			</div>
		</div>
		<div class="bordercolor" style="padding: 1px">';
    }
    // Display the input boxes for the form.
    echo '
		
		<div class="windowbg" align="center" style="padding-bottom: 1ex;">
			<table width="440" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td colspan="2" align="left">
						<br />
						<b>', $txt[582], ':</b> <input type="text" name="search" value="', $context['old_search'], '" size="35" /> <input type="submit" name="submit" value="' . $txt[182] . '" style="margin-left: 20px;" /><br />
						<br />
					</td>
				</tr>
				<tr>
					<td align="left">
								<label for="fields-email"><input type="checkbox" name="fields[]" id="fields-email" value="email" checked="checked" class="check" /> ', $txt['mlist_search_email'], '</label><br />
								<label for="fields-messenger"><input type="checkbox" name="fields[]" id="fields-messenger" value="messenger" class="check" /> ', $txt['mlist_search_messenger'], '</label><br />
								<label for="fields-group"><input type="checkbox" name="fields[]" id="fields-group" value="group" class="check" /> ', $txt['mlist_search_group'], '</label>
					</td>
					<td align="left" valign="top">
								<label for="fields-name"><input type="checkbox" name="fields[]" id="fields-name" value="name" checked="checked" class="check" /> ', $txt['mlist_search_name'], '</label><br />
								<label for="fields-website"><input type="checkbox" name="fields[]" id="fields-website" value="website" class="check" /> ', $txt['mlist_search_website'], '</label>
					</td>
				</tr>
			</table>
		</div>
	</div>
</form>';
}
Ejemplo n.º 13
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.º 14
0
/**
 * @name      EosAlpha BBS
 * @copyright 2011 Alex Vie silvercircle(AT)gmail(DOT)com
 *
 * This software is a derived product, based on:
 *
 * Simple Machines Forum (SMF)
 * copyright:	2011 Simple Machines (http://www.simplemachines.org)
 * license:  	BSD, See included LICENSE.TXT for terms and conditions.
 *
 * @version 1.0pre
 */
function template_single_post()
{
    global $context, $settings, $options, $txt, $scripturl, $topic, $modSettings;
    echo '
		<div class="jqmWindow" style="display:none;" id="interpostlink_helper">
		<div class="jqmWindow_container">
		<div class="glass jsconfirm title">', $txt['quick_post_link_title'], '
		</div>
		<div class="flat_container lefttext smalltext">', $txt['quick_post_link_text'], '
		<dl class="common left" style="line-height:24px;">
		<dt><strong>', $txt['quick_post_link_bbcode'], '</strong></dt><dd><input size="78" type="text" id="interpostlink_helper_content" value="" /></dd>
		<dt><strong>', $txt['quick_post_link_full'], '</strong></dt><dd><input size="78" type="text" id="interpostlink_helper_content_full" value="" /></dd>
		</dl>
		</div>
		<div class="centertext smalltext smallpadding"><span class="button default centered" onclick="$(\'#interpostlink_helper\').css(\'position\',\'static\');$(\'#interpostlink_helper\').hide();setDimmed(0);">', $txt['quick_post_link_dismiss'], '</span></div>
		</div>
		</div>
		<div id="share_bar" style="display:none;position:absolute;right:0;white-space:nowrap;width:auto;">
		<div class="bmbar">
		 <span role="button" class="button icon share_this share_fb" data-href="http://www.facebook.com/sharer.php?u=%%uri%%">Share</span>
		 <span role="button" class="button icon share_this share_tw" data-href="http://twitter.com/share?text=%%txt%%&amp;url=%%uri%%">Tweet</span>
		 <span role="button" class="button icon share_this share_digg" data-href="http://digg.com/submit?phase=2&amp;title=%%txt%%&amp;url=%%uri%%">Digg</span>
		 <div class="clear"></div>
       	</div>
       	</div>';
    // Show the anchor for the top and for the first message. If the first message is new, say so.
    echo '
		<a id="top"></a>
		', $context['first_new_message'] ? '<a id="new"></a>' : '';
    // Build the normal button array.
    $normal_buttons = array('reply' => array('test' => 'can_reply', 'text' => 'reply', 'custom' => 'onclick="return oQuickReply.quote(0);" ', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';last_msg=' . $context['topic_last_message'], 'active' => true), 'add_poll' => array('test' => 'can_add_poll', 'text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start']), 'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : '') . 'notify.gif', 'lang' => true, 'custom' => 'onclick="return Eos_Confirm(\'\', \'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\', $(this).attr(\'href\'));"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'mark_unread' => array('test' => 'can_mark_unread', 'text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'send' => array('test' => 'can_send_topic', 'text' => 'send_topic', 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=emailuser;sa=sendtopic;topic=' . $context['current_topic'] . '.0'), 'print' => array('text' => 'print', 'image' => 'print.gif', 'lang' => true, 'custom' => 'rel="nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'));
    // Allow adding new buttons easily.
    HookAPI::callHook('integrate_display_buttons', array(&$normal_buttons));
    // Show the topic information - icon, subject, etc.
    echo '
			<div id="forumposts">';
    if ($context['tags_active']) {
        echo '
		<div id="tagstrip"><span id="tags">';
        foreach ($context['topic_tags'] as $i => $tag) {
            echo '<a href="' . $scripturl . '?action=tags;tagid=' . $tag['ID_TAG'] . '">' . $tag['tag'] . '</a>';
            if ($context['can_delete_tags']) {
                echo '<a href="' . $scripturl . '?action=tags;sa=deletetag;tagid=' . $tag['ID'] . '"><span onclick="sendRequest(\'action=xmlhttp;sa=tags;deletetag=1;tagid=' . $tag['ID'] . '\', $(\'#tags\'));return(false);" class="xtag">&nbsp;&nbsp;</span></a>';
            } else {
                echo '&nbsp;&nbsp;';
            }
        }
        echo '</span>';
        if ($context['can_add_tags']) {
            echo '
			&nbsp;<a rel="nofollow" id="addtag" onclick="$(\'#tagform\').remove();sendRequest(\'action=xmlhttp;sa=tags;addtag=1;topic=', $topic, '\', $(\'#addtag\'));return(false);" data-id="', $topic, '" href="' . $scripturl . '?action=tags;sa=addtag;topic=', $topic, '">' . $txt['smftags_addtag'] . '</a>';
        } else {
            echo '&nbsp;';
        }
        echo '
		</div>';
    }
    echo '
		<div class="clear"></div><form data-alt="', $scripturl, '?action=post;msg=%id_msg%;topic=', $context['current_topic'], '.', $context['start'], '" action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="UTF-8" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">';
    $ignoredMsgs = array();
    $removableMessageIDs = array();
    // Get all the messages...
    while ($message = $context['get_message']()) {
        if ($message['can_remove']) {
            $removableMessageIDs[] = $message['id'];
        }
        $context['postbit_callbacks']['firstpost']($message);
    }
    echo '
				<input type="hidden" name="goadvanced" value="1" />
				</form>
			</div>
			<a id="lastPost"></a>';
    $context['inline_footer_script'] .= '
	var smf_likelabel = \'' . $txt['like_label'] . '\';
	var smf_unlikelabel = \'' . $txt['unlike_label'] . '\'
	';
    // Show the lower breadcrumbs.
    $remove_url = $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;' . $context['session_var'] . '=' . $context['session_id'];
    $mod_buttons = array('move' => array('test' => 'can_move', 'text' => 'move_topic', 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'), 'delete' => array('test' => 'can_delete', 'text' => 'remove_topic', 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return Eos_Confirm(\'\',\'' . $txt['are_sure_remove_topic'] . '\',\'' . $remove_url . '\');"', 'url' => $remove_url), 'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'set_lock' : 'set_unlock', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_sticky']) ? 'set_sticky' : 'set_nonsticky', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'merge' => array('test' => 'can_merge', 'text' => 'merge', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']), 'calendar' => array('test' => 'calendar_post', 'text' => 'calendar_link', 'image' => 'linktocal.gif', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0'));
    // Restore topic. eh?  No monkey business.
    if ($context['can_restore_topic']) {
        $mod_buttons[] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
    }
    // Allow adding new mod buttons easily.
    HookAPI::callHook('integrate_mod_buttons', array(&$mod_buttons));
    echo '
		<div id="moderationbuttons">', template_button_strip($mod_buttons, 'right', array('id' => 'moderationbuttons_strip', 'class' => 'plainbuttonlist')), '</div>';
    if ($context['can_reply'] && !empty($options['display_quick_reply'])) {
        echo '
			<a id="quickreply"></a>
			<div class="clear"></div>
			<div style="display:none;overflow:hidden;" id="quickreplybox">';
        echo '
					<div class="cat_bar">
					 <strong>', $txt['post_reply'], '</strong>&nbsp;&nbsp;<a href="', $scripturl, '?action=helpadmin;help=quickreply_help', '" onclick="return reqWin(this.href);" class="help tinytext">', $txt['post_reply_help'], '</a>
					</div>
					<div class="flat_container mediumpadding">';
        echo '
							<input type="hidden" name="_qr_board" value="', $context['current_board'], '" />
							<input type="hidden" name="topic" value="', $context['current_topic'], '" />
							<input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
							<input type="hidden" name="icon" value="xx" />
							<input type="hidden" name="from_qr" value="1" />
							<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
							<input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
							<input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
							<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" />
							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
							<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />';
        // Guests just need more.
        if ($context['user']['is_guest']) {
            echo '
							<strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
							<strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />';
        }
        // Is visual verification enabled?
        if ($context['require_verification']) {
            echo '
							<strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />';
        }
        if (isset($context['user']['avatar']['image']) && !empty($context['user']['avatar']['image'])) {
            echo '
					<div class="floatleft blue_container smallpadding avatar">', $context['user']['avatar']['image'], '
					</div>';
        }
        echo '
							<div class="quickReplyContent" style="margin-left:150px;">';
        echo $context['is_locked'] ? '<div class="red_container tinytext">' . $txt['quick_reply_warning'] . '</div>' : '', $context['oldTopicError'] ? '<div class="red_container tinytext">' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</div>' : '', '
						', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
						', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '';
        echo '
								<textarea id="quickReplyMessage" style="width:99%;" rows="18" name="message" tabindex="', $context['tabindex']++, '"></textarea>';
        if ($context['automerge']) {
            echo '
								<input type="checkbox" name="want_automerge" id="want_automerge" checked="checked" value="1" />', $txt['want_automerge'];
        }
        echo '
								</div>
								<div class="righttext padding">
								<input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />
								<input type="submit" name="preview" value="', $txt['go_advanced'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />
								<input type="submit" name="cancel" value="', 'Cancel', '" onclick="return(oQuickReply.cancel());" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />
						</div>
				</div>
				<br>
			</div>';
    }
    theme_linktree();
    // Show the jumpto box, or actually...let Javascript do it.
    echo '
			<div class="plainbox" id="display_jump_to">&nbsp;</div>';
    $context['inline_footer_script'] .= '
	var oQuickReply = new QuickReply({
		bDefaultCollapsed: ' . (!empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true') . ',
		iTopicId: ' . $context['current_topic'] . ',
		iStart: ' . $context['start'] . ',
		sScriptUrl: smf_scripturl,
		sImagesUrl: "' . $settings['images_url'] . '",
		sContainerId: "quickReplyOptions",
		sImageId: "quickReplyExpand",
		sImageCollapsed: "collapse.gif",
		sImageExpanded: "expand.gif",
		iMarkedForMQ: ' . $context['multiquote_posts_count'] . ',
		sJumpAnchor: "quickreplybox",
		bEnabled: ' . (!empty($options['display_quick_reply']) ? 'true' : 'false') . '
	});
	';
    if (!empty($options['display_quick_mod']) && $context['can_remove_post']) {
        $context['inline_footer_script'] .= '
	var oInTopicModeration = new InTopicModeration({
		sSelf: \'oInTopicModeration\',
		sCheckboxContainerMask: \'in_topic_mod_check_\',
		aMessageIds: [\'' . implode('\', \'', $removableMessageIDs) . '\'],
		sSessionId: \'' . $context['session_id'] . '\',
		sSessionVar: \'' . $context['session_var'] . '\',
		sButtonStrip: \'moderationbuttons\',
		sButtonStripDisplay: \'moderationbuttons_strip\',
		bUseImageButton: false,
		bCanRemove: ' . ($context['can_remove_post'] ? 'true' : 'false') . ',
		sRemoveButtonLabel: \'' . $txt['quickmod_delete_selected'] . '\',
		sRemoveButtonImage: \'delete_selected.gif\',
		sRemoveButtonConfirm: \'' . $txt['quickmod_confirm'] . '\',
		bCanRestore: ' . ($context['can_restore_msg'] ? 'true' : 'false') . ',
		sRestoreButtonLabel: \'' . $txt['quick_mod_restore'] . '\',
		sRestoreButtonImage: \'restore_selected.gif\',
		sRestoreButtonConfirm: \'' . $txt['quickmod_confirm'] . '\',
		sFormId: \'quickModForm\'
	});
	';
    }
    $context['inline_footer_script'] .= '
	if (\'XMLHttpRequest\' in window)
	{
		var oQuickModify = new QuickModify({
		sScriptUrl: smf_scripturl,
		bShowModify: ' . ($settings['show_modify'] ? 'true' : 'false') . ',
		iTopicId: ' . $context['current_topic'] . ',
		sTemplateBodyEdit: ' . JavaScriptEscape('
			<div id="quick_edit_body_container">
			<div id="error_box" style="padding: 4px;" class="error"></div>
			<textarea class="editor" name="message" rows="20" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br />
			<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
			<input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
			<input type="hidden" name="msg" value="%msg_id%" />
			<input type="hidden" style="width: 50%;" name="subject" value="%subject%" size="50" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />
			<div class="righttext">
				<span class="button floatright" onclick="return oQuickModify.goAdvanced(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\');" />Go Advanced</a></span>
				<span class="button floatright" onclick="return oQuickModify.modifyCancel();" >' . $txt['modify_cancel'] . '</span>
				<span class="button floatright" onclick="return oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\');" accesskey="s">' . $txt['save'] . '</span>
			</div>
			</div>') . ',
		sTemplateSubjectEdit: ' . JavaScriptEscape('<input type="text" style="width: 50%;" name="subject_edit" value="%subject%" size="50" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />') . ',
		sTemplateBodyNormal: ' . JavaScriptEscape('%body%') . ',
		sTemplateSubjectNormal: ' . JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>') . ',
		sTemplateTopSubject: ' . JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')') . ',
		sErrorBorderStyle: ' . JavaScriptEscape('1px solid red') . '
		});

		aJumpTo[aJumpTo.length] = new JumpTo({
			sContainerId: "display_jump_to",
			sJumpToTemplate: "<label class=\\"smalltext\\" for=\\"%select_id%\\">' . $context['jump_to']['label'] . ':<" + "/label> %dropdown_list%",
			iCurBoardId: ' . $context['current_board'] . ',
			iCurBoardChildLevel: ' . $context['jump_to']['child_level'] . ',
			sCurBoardName: "' . $context['jump_to']['board_name'] . '",
			sBoardChildLevelIndicator: "==",
			sBoardPrefix: "=> ",
			sCatSeparator: "-----------------------------",
			sCatPrefix: "",
			sGoButtonLabel: "' . $txt['go'] . '"
		});
	}
	';
    if (!empty($ignoredMsgs)) {
        $context['inline_footer_script'] .= '';
    }
    $context['inline_footer_script'] .= '
	function getIntralink(e, mid) {
		var tid = ' . $context['current_topic'] . ';
		var _sid = "#subject_" + mid;
		var el = $("#interpostlink_helper");
		el.css("position", "fixed");
		var _content = "[ilink topic=" + tid + " post=" + mid + "]" + $(_sid).html().trim() + "[/ilink]";
		$("#interpostlink_helper_content").val(_content);
		$("#interpostlink_helper_content_full").val(e.attr("href"));
		centerElement(el, -200);
		el.css("z-index", 9999);
		setDimmed(1);
		el.show();
		$("#interpostlink_helper_content").focus();
		$("#interpostlink_helper_content").select();
	}
	$(document).keydown(function(e) {
		if(e.keyCode == 27 && $("#interpostlink_helper").css("display") != "none") {
        	$("#interpostlink_helper").css("position", "static");
        	$("#interpostlink_helper").hide();
			setDimmed(0);
    	}
	});
	var topic_id = ' . $context['current_topic'] . ';
	';
}
Ejemplo n.º 15
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.º 16
0
/**
 * The lower icons and jump to.
 */
function template_topic_listing_below()
{
    global $context, $txt, $options;
    if ($context['no_topic_listing']) {
        return;
    }
    template_pagesection('normal_buttons', 'right');
    // Show breadcrumbs at the bottom too.
    theme_linktree();
    echo '
	<div id="topic_icons" class="description">
		<div class="floatright" id="message_index_jump_to">&nbsp;</div>';
    if (!$context['no_topic_listing']) {
        template_basicicons_legend();
    }
    echo '
			<script><!-- // --><![CDATA[';
    if (!empty($context['using_relative_time'])) {
        echo '
				$(\'.topic_latest\').addClass(\'relative\');';
    }
    if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) {
        echo '
				aJumpTo[aJumpTo.length] = new JumpTo({
					sContainerId: "quick_mod_jump_to",
					sClassName: "qaction",
					sJumpToTemplate: "%dropdown_list%",
					iCurBoardId: ', $context['current_board'], ',
					iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
					sCurBoardName: "', $context['jump_to']['board_name'], '",
					sBoardChildLevelIndicator: "&#8195;",
					sBoardPrefix: "', isBrowser('ie8') ? '&#187; ' : '&#10148; ', '",
					sCatClass: "jump_to_header",
					sCatPrefix: "",
					bNoRedirect: true,
					bDisabled: true,
					sCustomName: "move_to"
				});';
    }
    echo '
				aJumpTo[aJumpTo.length] = new JumpTo({
					sContainerId: "message_index_jump_to",
					sJumpToTemplate: "<label class=\\"smalltext\\" for=\\"%select_id%\\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
					iCurBoardId: ', $context['current_board'], ',
					iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
					sCurBoardName: "', $context['jump_to']['board_name'], '",
					sBoardChildLevelIndicator: "&#8195;",
					sBoardPrefix: "', isBrowser('ie8') ? '&#187; ' : '&#10148; ', '",
					sCatPrefix: "",
					sCatClass: "jump_to_header",
					sGoButtonLabel: "', $txt['quick_mod_go'], '"
				});
			// ]]></script>
	</div>';
    // Javascript for inline editing.
    echo '
	<script><!-- // --><![CDATA[
		var oQuickModifyTopic = new QuickModifyTopic({
			aHidePrefixes: Array("lockicon", "stickyicon", "pages", "newicon"),
			bMouseOnDiv: false,
		});
	// ]]></script>';
}
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines
 * @copyright 2011 Simple Machines
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.0
 */
function template_main()
{
    global $context, $settings, $options, $txt, $scripturl, $modSettings;
    // Let them know, if their report was a success!
    if ($context['report_sent']) {
        echo '
<div class="windowbg" id="profile_success">
	', $txt['report_sent'], '
</div>';
    }
    // Show the anchor for the top and for the first message. If the first message is new, say so.
    echo '
<a id="top"></a>
<a id="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a id="new"></a>' : '';
    // Is this topic also a poll?
    if ($context['is_poll']) {
        echo '
<div class="tborder marginbottom" id="poll">
	<h3 class="titlebg">
		<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['poll'], '
	</h3>
	<h4 class="windowbg headerpadding" id="pollquestion">
		', $context['poll']['question'], '
	</h4>
	<div class="windowbg clearfix" id="poll_options">';
        // Are they not allowed to vote but allowed to view the options?
        if ($context['poll']['show_results'] || !$context['allow_vote']) {
            echo '
		<dl class="options">';
            // Show each option with its corresponding percentage bar.
            foreach ($context['poll']['options'] as $option) {
                echo '
			<dt class="middletext', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
			<dd class="middletext">', $context['allow_poll_view'] ? $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)' : '', '</dd>';
            }
            echo '
		</dl>';
            if ($context['allow_poll_view']) {
                echo '
		<p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>';
            }
        } else {
            echo '
		<form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">';
            // Show a warning if they are allowed more than one option.
            if ($context['poll']['allowed_warning']) {
                echo '
			<p class="smallpadding">', $context['poll']['allowed_warning'], '</p>';
            }
            echo '
			<ul class="reset options">';
            // Show each option with its button - a radio likely.
            foreach ($context['poll']['options'] as $option) {
                echo '
				<li class="middletext">', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>';
            }
            echo '
			</ul>

			<div class="submitbutton', !empty($context['poll']['expire_time']) ? ' border' : '', '">
				<input type="submit" value="', $txt['poll_vote'], '" class="button_submit" />
				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
			</div>
		</form>';
        }
        // Is the clock ticking?
        if (!empty($context['poll']['expire_time'])) {
            echo '
		<p><strong>', $context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on'], ':</strong> ', $context['poll']['expire_time'], '</p>';
        }
        echo '
	</div>
</div>
<div id="pollmoderation" class="clearfix">';
        // Build the poll moderation button array.
        $poll_buttons = array('vote' => array('test' => 'allow_return_vote', 'text' => 'poll_return_vote', 'image' => 'poll_options.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start']), 'results' => array('test' => 'show_view_results_button', 'text' => 'poll_results', 'image' => 'poll_results.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start'] . ';viewresults'), 'change_vote' => array('test' => 'allow_change_vote', 'text' => 'poll_change_vote', 'image' => 'poll_change_vote.gif', 'lang' => true, 'url' => $scripturl . '?action=vote;topic=' . $context['current_topic'] . '.' . $context['start'] . ';poll=' . $context['poll']['id'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'lock' => array('test' => 'allow_lock_poll', 'text' => !$context['poll']['is_locked'] ? 'poll_lock' : 'poll_unlock', 'image' => 'poll_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lockvoting;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'edit' => array('test' => 'allow_edit_poll', 'text' => 'poll_edit', 'image' => 'poll_edit.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;topic=' . $context['current_topic'] . '.' . $context['start']), 'remove_poll' => array('test' => 'can_remove_poll', 'text' => 'poll_remove', 'image' => 'admin_remove_poll.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');"', 'url' => $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']));
        template_button_strip($poll_buttons);
        echo '
</div><br class="clear" />';
    }
    // Does this topic have some events linked to it?
    if (!empty($context['linked_calendar_events'])) {
        echo '
<div class="linked_events">
	<h3 class="titlebg headerpadding">', $txt['calendar_linked_events'], '</h3>
	<div class="content windowbg">
		<ul class="reset">';
        foreach ($context['linked_calendar_events'] as $event) {
            echo '
			<li>
				', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" class="edit_event">*</a> ' : '', '<strong>', $event['title'], '</strong>: ', $event['start_date'], $event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : '', '
			</li>';
        }
        echo '
		</ul>
	</div>
</div>';
    }
    // Build the normal button array.
    $normal_buttons = array('reply' => array('test' => 'can_reply', 'text' => 'reply', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';last_msg=' . $context['topic_last_message']), 'add_poll' => array('test' => 'can_add_poll', 'text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start']), 'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : '') . 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'mark_unread' => array('test' => 'can_mark_unread', 'text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'send' => array('test' => 'can_send_topic', 'text' => 'send_topic', 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=emailuser;sa=sendtopic;topic=' . $context['current_topic'] . '.0'), 'print' => array('text' => 'print', 'image' => 'print.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'));
    // Allow adding new buttons easily.
    call_integration_hook('integrate_display_buttons', array(&$normal_buttons));
    // Show the page index... "Pages: [1]".
    echo '
<div class="clearfix margintop" id="postbuttons">
	<div class="next">', $context['previous_next'], '</div>
	<div class="margintop middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
	<div class="nav floatright">', template_button_strip($normal_buttons, 'bottom'), '</div>
</div>';
    // Show the topic information - icon, subject, etc.
    echo '
<div id="forumposts" class="tborder">
	<h3 class="catbg3">
		<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
		<span>', $txt['author'], '</span>
		<span id="top_subject">', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')</span>
	</h3>';
    if (!empty($settings['display_who_viewing'])) {
        echo '
	<div id="whoisviewing" class="smalltext headerpadding windowbg2">';
        // Show just numbers...?
        if ($settings['display_who_viewing'] == 1) {
            echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
        } else {
            echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
        }
        // Now show how many guests are here too.
        echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
	</div>';
    }
    echo '
	<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">';
    // These are some cache image buttons we may want.
    $reply_button = create_button('quote.gif', 'reply', 'quote', 'align="middle"');
    $modify_button = create_button('modify.gif', 'modify', 'modify', 'align="middle"');
    $remove_button = create_button('delete.gif', 'remove', 'remove', 'align="middle"');
    $split_button = create_button('split.gif', 'split', 'split', 'align="middle"');
    $approve_button = create_button('approve.gif', 'approve', 'approve', 'align="middle"');
    $restore_message_button = create_button('restore_topic.gif', 'restore_message', 'restore_message', 'align="middle"');
    $ignoredMsgs = array();
    $removableMessageIDs = array();
    // Get all the messages...
    while ($message = $context['get_message']()) {
        $is_first_post = !isset($is_first_post) ? true : false;
        $ignoring = false;
        if ($message['can_remove']) {
            $removableMessageIDs[] = $message['id'];
        }
        echo '
		<div class="bordercolor">';
        // Are we ignoring this message?
        if (!empty($message['is_ignored'])) {
            $ignoring = true;
            $ignoredMsgs[] = $message['id'];
        }
        // Show the message anchor and a "new" anchor if this message is new.
        if ($message['id'] != $context['first_message']) {
            echo '
			<a id="msg', $message['id'], '"></a>', $message['first_new'] ? '<a id="new"></a>' : '';
        }
        echo '
			<div class="clearfix ', !$is_first_post ? 'topborder ' : '', $message['approved'] ? $message['alternate'] == 0 ? 'windowbg' : 'windowbg2' : 'approvebg', ' largepadding">';
        // Show information about the poster of this message.
        echo '
				<div class="floatleft poster">
					<h4>', $message['member']['link'], '</h4>
					<ul class="reset smalltext" id="msg_', $message['id'], '_extra_info">';
        // Show the member's custom title, if they have one.
        if (isset($message['member']['title']) && $message['member']['title'] != '') {
            echo '
						<li>', $message['member']['title'], '</li>';
        }
        // Show the member's primary group (like 'Administrator') if they have one.
        if (isset($message['member']['group']) && $message['member']['group'] != '') {
            echo '
						<li>', $message['member']['group'], '</li>';
        }
        // Don't show these things for guests.
        if (!$message['member']['is_guest']) {
            // Show the post group if and only if they have no other group or the option is on, and they are in a post group.
            if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') {
                echo '
						<li>', $message['member']['post_group'], '</li>';
            }
            echo '
						<li>', $message['member']['group_stars'], '</li>';
            // Is karma display enabled?  Total or +/-?
            if ($modSettings['karmaMode'] == '1') {
                echo '
						<li class="margintop">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';
            } elseif ($modSettings['karmaMode'] == '2') {
                echo '
						<li class="margintop">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>';
            }
            // Is this user allowed to modify this member's karma?
            if ($message['member']['karma']['allow']) {
                echo '
						<li>
							<a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a>
							<a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a>
						</li>';
            }
            // Show online and offline buttons?
            if (!empty($modSettings['onlineEnable'])) {
                echo '
						<li>', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '</li>';
            }
            // Show the member's gender icon?
            if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender'])) {
                echo '
						<li>', $txt['gender'], ': ', $message['member']['gender']['image'], '</li>';
            }
            // Show how many posts they have made.
            if (!isset($context['disabled_fields']['posts'])) {
                echo '
						<li>', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
            }
            // Any custom fields for standard placement?
            if (!empty($message['member']['custom_fields'])) {
                foreach ($message['member']['custom_fields'] as $custom) {
                    if (empty($custom['placement']) && !empty($custom['value'])) {
                        echo '
						<li>', $custom['title'], ': ', $custom['value'], '</li>';
                    }
                }
            }
            // Show avatars, images, etc.?
            if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
                echo '
						<li class="margintop" style="overflow: auto;">', $message['member']['avatar']['image'], '</li>';
            }
            // Show their personal text?
            if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '') {
                echo '
						<li class="margintop">', $message['member']['blurb'], '</li>';
            }
            // Any custom fields to show as icons?
            if (!empty($message['member']['custom_fields'])) {
                $shown = false;
                foreach ($message['member']['custom_fields'] as $custom) {
                    if ($custom['placement'] != 1 || empty($custom['value'])) {
                        continue;
                    }
                    if (empty($shown)) {
                        $shown = true;
                        echo '
						<li class="margintop">
							<ul class="reset nolist">';
                    }
                    echo '
								<li>', $custom['value'], '</li>';
                }
                if ($shown) {
                    echo '
							</ul>
						</li>';
                }
            }
            // This shows the popular messaging icons.
            if ($message['member']['has_messenger'] && $message['member']['can_view_profile']) {
                echo '
						<li class="margintop">
							<ul class="reset nolist">
								', !isset($context['disabled_fields']['icq']) && !empty($message['member']['icq']['link']) ? '<li>' . $message['member']['icq']['link'] . '</li>' : '', '
								', !isset($context['disabled_fields']['msn']) && !empty($message['member']['msn']['link']) ? '<li>' . $message['member']['msn']['link'] . '</li>' : '', '
								', !isset($context['disabled_fields']['aim']) && !empty($message['member']['aim']['link']) ? '<li>' . $message['member']['aim']['link'] . '</li>' : '', '
								', !isset($context['disabled_fields']['yim']) && !empty($message['member']['yim']['link']) ? '<li>' . $message['member']['yim']['link'] . '</li>' : '', '
							</ul>
						</li>';
            }
            // Show the profile, website, email address, and personal message buttons.
            if ($settings['show_profile_buttons']) {
                echo '
						<li class="margintop">
							<ul class="reset nolist">';
                // Don't show the profile button if you're not allowed to view the profile.
                if ($message['member']['can_view_profile']) {
                    echo '
								<li><a href="', $message['member']['href'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '" border="0" />' : $txt['view_profile'], '</a></li>';
                }
                // Don't show an icon if they haven't specified a website.
                if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) {
                    echo '
								<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $message['member']['website']['title'] . '" border="0" />' : $txt['www'], '</a></li>';
                }
                // Don't show the email address if they want it hidden.
                if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum'))) {
                    echo '
								<li><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email'], '</a></li>';
                }
                // Since we know this person isn't a guest, you *can* message them.
                if ($context['can_send_pm']) {
                    echo '
								<li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '" border="0" />' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
                }
                echo '
							</ul>
						</li>';
            }
            // Are we showing the warning status?
            if ($message['member']['can_see_warning']) {
                echo '
						<li>', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<img src="', $settings['images_url'], '/warning_', $message['member']['warning_status'], '.gif" alt="', $txt['user_warn_' . $message['member']['warning_status']], '" />', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>';
            }
        } elseif (!empty($message['member']['email']) && in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum'))) {
            echo '
						<li><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" border="0" />' : $txt['email'], '</a></li>';
        }
        // Done with the information about the poster... on to the post itself.
        echo '
					</ul>
				</div>
				<div class="postarea">
					<div class="flow_hidden">
						<div class="keyinfo">
							<div class="messageicon"><img src="', $message['icon_url'] . '" alt="" border="0"', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' /></div>
							<h5 id="subject_', $message['id'], '">
								<a href="', $message['href'], '" rel="nofollow">', $message['subject'], '</a>
							</h5>
							<div class="smalltext">&#171; <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ':</strong> ', $message['time'], ' &#187;</div>
							<div id="msg_', $message['id'], '_quick_mod"></div>
						</div>';
        // If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
        if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) {
            echo '
						<ul class="reset smalltext postingbuttons">';
        }
        // Maybe we can approve it, maybe we should?
        if ($message['can_approve']) {
            echo '
							<li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $approve_button, '</a></li>';
        }
        // Can they reply? Have they turned on quick reply?
        if ($context['can_quote'] && !empty($options['display_quick_reply'])) {
            echo '
							<li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');">', $reply_button, '</a></li>';
        } elseif ($context['can_quote']) {
            echo '
							<li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '">', $reply_button, '</a></li>';
        }
        // Can the user modify the contents of this post?
        if ($message['can_modify']) {
            echo '
							<li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '">', $modify_button, '</a></li>';
        }
        // How about... even... remove it entirely?!
        if ($message['can_remove']) {
            echo '
							<li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');">', $remove_button, '</a></li>';
        }
        // What about splitting it off the rest of the topic?
        if ($context['can_split'] && !empty($context['real_num_replies'])) {
            echo '
							<li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $split_button, '</a></li>';
        }
        // Can we restore topics?
        if ($context['can_restore_msg']) {
            echo '
							<li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $restore_message_button, '</a></li>';
        }
        // Show a checkbox for quick moderation?
        if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) {
            echo '
							<li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
        }
        if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) {
            echo '
						</ul>';
        }
        echo '
					</div>';
        // Ignoring this user? Hide the post.
        if ($ignoring) {
            echo '
					<div class="ignored" id="msg_', $message['id'], '_ignored_prompt">
						', $txt['ignoring_user'], '
						<a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
					</div>';
        }
        // Show the post itself, finally!
        echo '
					<div class="post">
						<hr class="hrcolor" width="100%" size="1" />';
        if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) {
            echo '
						<div class="approve_post">
							', $txt['post_awaiting_approval'], '
						</div>';
        }
        echo '
						<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
					</div>', $message['can_modify'] ? '
					<img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="' . $txt['modify_msg'] . '" title="' . $txt['modify_msg'] . '" class="modifybutton" id="modify_button_' . $message['id'] . '" style="cursor: ' . ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] ? 'hand' : 'pointer') . '; display: none;" onclick="oQuickModify.modifyMsg(\'' . $message['id'] . '\')" />' : '';
        // Assuming there are attachments...
        if (!empty($message['attachment'])) {
            // Now for the attachments, signature, ip logged, etc...
            echo '
					<div id="msg_', $message['id'], '_footer" class="attachments smalltext">';
            $last_approved_state = 1;
            foreach ($message['attachment'] as $attachment) {
                // Show a special box for unapproved attachments...
                if ($attachment['is_approved'] != $last_approved_state) {
                    $last_approved_state = 0;
                    echo '
							<fieldset>
								<legend>', $txt['attach_awaiting_approve'];
                    if ($context['can_approve']) {
                        echo '&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
                    }
                    echo '</legend>';
                }
                if ($attachment['is_image']) {
                    if ($attachment['thumbnail']['has_thumb']) {
                        echo '
								<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
                    } else {
                        echo '
								<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
                    }
                }
                echo '
								<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ';
                if (!$attachment['is_approved'] && $context['can_approve']) {
                    echo '
								[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
                }
                echo '
										(', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
            }
            // If we had unapproved attachments clean up.
            if ($last_approved_state == 0) {
                echo '
							</fieldset>';
            }
            echo '
					</div>';
        }
        echo '
				</div>
				<div class="moderatorbar">
					<div class="smalltext floatleft" id="modified_', $message['id'], '">';
        // Show "« Last Edit: Time by Person »" if this post was edited.
        if ($settings['show_modify'] && !empty($message['modified']['name'])) {
            echo '
						&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';
        }
        echo '
					</div>
					<div class="smalltext largepadding floatright">';
        // Maybe they want to report this post to the moderator(s)?
        if ($context['can_report_moderator']) {
            echo '
						<a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a> &nbsp;';
        }
        // Can we issue a warning because of this post?  Remember, we can't give guests warnings.
        if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) {
            echo '
						<a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><img src="', $settings['images_url'], '/warn.gif" alt="', $txt['issue_warning_post'], '" title="', $txt['issue_warning_post'], '" border="0" /></a>';
        }
        echo '
						<img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />';
        // Show the IP to this user for this post - because you can moderate?
        if ($context['can_moderate_forum'] && !empty($message['member']['ip'])) {
            echo '
						<a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a>';
        } elseif ($message['can_see_ip']) {
            echo '
						<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $message['member']['ip'], '</a>';
        } elseif (!$context['user']['is_guest']) {
            echo '
						<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $txt['logged'], '</a>';
        } else {
            echo '
						', $txt['logged'];
        }
        echo '
					</div>';
        // Are there any custom profile fields for above the signature?
        if (!empty($message['member']['custom_fields'])) {
            $shown = false;
            foreach ($message['member']['custom_fields'] as $custom) {
                if ($custom['placement'] != 2 || empty($custom['value'])) {
                    continue;
                }
                if (empty($shown)) {
                    $shown = true;
                    echo '
						<div class="custom_fields_above_signature">
							<ul class="reset nolist>';
                }
                echo '
								<li>', $custom['value'], '</li>';
            }
            if ($shown) {
                echo '
							</ul>
						</div>';
            }
        }
        // Show the member's signature?
        if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) {
            echo '
					<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';
        }
        echo '
				</div>
			</div>
		</div>';
    }
    echo '
	</form>';
    echo '
</div>
<a id="lastPost"></a>';
    echo '
<div class="clearfix marginbottom" id="postbuttons_lower">
	<div class="nav floatright">', template_button_strip($normal_buttons, 'top'), '</div>
	<div class="middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
	<div class="clear">', $context['previous_next'], '</div>
</div>';
    // Show the lower breadcrumbs.
    theme_linktree();
    $mod_buttons = array('move' => array('test' => 'can_move', 'text' => 'move_topic', 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'), 'delete' => array('test' => 'can_delete', 'text' => 'remove_topic', 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['are_sure_remove_topic'] . '\');"', 'url' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;' . $context['session_var'] . '=' . $context['session_id']), 'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'set_lock' : 'set_unlock', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_sticky']) ? 'set_sticky' : 'set_nonsticky', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'merge' => array('test' => 'can_merge', 'text' => 'merge', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']), 'calendar' => array('test' => 'calendar_post', 'text' => 'calendar_link', 'image' => 'linktocal.gif', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0'));
    // Restore topic. eh?  No monkey business.
    if ($context['can_restore_topic']) {
        $mod_buttons[] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
    }
    // Allow adding new mod buttons easily.
    call_integration_hook('integrate_mod_buttons', array(&$mod_buttons));
    echo '
<div id="moderationbuttons" class="clearfix">', template_button_strip($mod_buttons, 'bottom', array('id' => 'moderationbuttons_strip')), '</div>';
    // Show the jumpto box, or actually...let Javascript do it.
    echo '
<div class="tborder">
	<div class="titlebg2" style="padding: 4px;" align="', !$context['right_to_left'] ? 'right' : 'left', '" id="display_jump_to">&nbsp;</div>
</div><br />';
    if ($context['can_reply'] && !empty($options['display_quick_reply'])) {
        echo '
<a id="quickreply"></a>
<div class="tborder" id="quickreplybox">';
        echo '
	<h3 class="catbg">
		<a href="javascript:oQuickReply.swap();">
			<img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" />
		</a>
		<a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a>
	</h3>
	<div class="windowbg" id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
		<div class="floatleft" id="quickReplyWarning">
			', $txt['quick_reply_desc'], $context['is_locked'] ? '<p><strong>' . $txt['quick_reply_warning'] . '</strong></p>' : '', $context['oldTopicError'] ? '<p><strong>' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</strong></p>' : '', '
		</div>
		<div id="quickReplyContent">', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
			', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', '
			<form action="', $scripturl, '?action=post2', empty($context['current_board']) ? '' : ';board=' . $context['current_board'], '" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);smc_saveEntities(\'postmodify\', [\'subject\', \'message\', \'guestname\', \'evtitle\', \'question\']);" style="margin: 0;">
				<input type="hidden" name="topic" value="', $context['current_topic'], '" />
				<input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
				<input type="hidden" name="icon" value="xx" />
				<input type="hidden" name="from_qr" value="1" />
				<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
				<input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
				<input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
				<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" />';
        // Guests just need more.
        if ($context['user']['is_guest']) {
            echo '
				<strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
				<strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />';
        }
        // Is visual verification enabled?
        if ($context['require_verification']) {
            echo '
				<strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />';
        }
        echo '
				<textarea cols="600" rows="7" name="message" tabindex="', $context['tabindex']++, '"></textarea><br />
				<input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />
				<input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />';
        if ($context['show_spellchecking']) {
            echo '
				<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="', $context['tabindex']++, '" class="button_submit" />';
        }
        echo '
				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
				<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
			</form>
		</div>
		<div class="clear"></div>
	</div>
</div>';
    }
    if ($context['show_spellchecking']) {
        echo '
<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>';
    }
    echo '
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
<script type="text/javascript"><!-- // --><![CDATA[';
    if (!empty($options['display_quick_reply'])) {
        echo '
	var oQuickReply = new QuickReply({
		bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ',
		iTopicId: ', $context['current_topic'], ',
		iStart: ', $context['start'], ',
		sScriptUrl: smf_scripturl,
		sImagesUrl: "', $settings['images_url'], '",
		sContainerId: "quickReplyOptions",
		sImageId: "quickReplyExpand",
		sImageCollapsed: "collapse.gif",
		sImageExpanded: "expand.gif",
		sJumpAnchor: "quickreply"
	});';
    }
    if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post']) {
        echo '
	var oInTopicModeration = new InTopicModeration({
		sSelf: \'oInTopicModeration\',
		sCheckboxContainerMask: \'in_topic_mod_check_\',
		aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'],
		sSessionId: \'', $context['session_id'], '\',
		sSessionVar: \'', $context['session_var'], '\',
		sButtonStrip: \'moderationbuttons\',
		sButtonStripDisplay: \'moderationbuttons_strip\',
		bUseImageButton: false,
		bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
		sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
		sRemoveButtonImage: \'delete_selected.gif\',
		sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
		bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
		sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
		sRestoreButtonImage: \'restore_selected.gif\',
		sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
		sFormId: \'quickModForm\'
	});';
    }
    echo '
	if (\'XMLHttpRequest\' in window)
	{
		var oQuickModify = new QuickModify({
			sScriptUrl: smf_scripturl,
			bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
			iTopicId: ', $context['current_topic'], ',
			sTemplateBodyEdit: ', JavaScriptEscape('
				<div id="quick_edit_body_container" style="width: 90%">
					<div id="error_box" style="padding: 4px;" class="error"></div>
					<textarea class="editor" name="message" rows="12" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 100%; min-width: 100%' : 'width: 100%') . ';  margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br />
					<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
					<input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
					<input type="hidden" name="msg" value="%msg_id%" />
					<div class="righttext">
						<input type="submit" name="post" value="' . $txt['save'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\');" accesskey="s" class="button_submit" />&nbsp;&nbsp;' . ($context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" tabindex="' . $context['tabindex']++ . '" onclick="spellCheck(\'quickModForm\' . \'message\');" class="button_submit" />&nbsp;&nbsp;' : '') . '<input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifyCancel();" class="button_submit" />
					</div>
				</div>'), ',
			sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ',
			sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
			sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
			sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')'), ',
			sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), '
		});

		aJumpTo[aJumpTo.length] = new JumpTo({
			sContainerId: "display_jump_to",
			sJumpToTemplate: "<label class=\\"smalltext\\" for=\\"%select_id%\\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
			iCurBoardId: ', $context['current_board'], ',
			iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
			sCurBoardName: "', $context['jump_to']['board_name'], '",
			sBoardChildLevelIndicator: "==",
			sBoardPrefix: "=> ",
			sCatSeparator: "-----------------------------",
			sCatPrefix: "",
			sGoButtonLabel: "', $txt['go'], '"
		});

		aIconLists[aIconLists.length] = new IconList({
			sBackReference: "aIconLists[" + aIconLists.length + "]",
			sIconIdPrefix: "msg_icon_",
			sScriptUrl: smf_scripturl,
			bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
			iBoardId: ', $context['current_board'], ',
			iTopicId: ', $context['current_topic'], ',
			sSessionId: "', $context['session_id'], '",
			sSessionVar: "', $context['session_var'], '",
			sLabelIconList: "', $txt['message_icon'], '",
			sBoxBackground: "transparent",
			sBoxBackgroundHover: "#ffffff",
			iBoxBorderWidthHover: 1,
			sBoxBorderColorHover: "#adadad" ,
			sContainerBackground: "#ffffff",
			sContainerBorder: "1px solid #adadad",
			sItemBorder: "1px solid #ffffff",
			sItemBorderHover: "1px dotted gray",
			sItemBackground: "transparent",
			sItemBackgroundHover: "#e0e0f0"
		});
	}';
    if (!empty($ignoredMsgs)) {
        echo '
	var aIgnoreToggles = new Array();';
        foreach ($ignoredMsgs as $msgid) {
            echo '
	aIgnoreToggles[', $msgid, '] = new smc_Toggle({
		bToggleEnabled: true,
		bCurrentlyCollapsed: true,
		aSwappableContainers: [
			\'msg_', $msgid, '_extra_info\',
			\'msg_', $msgid, '\',
			\'msg_', $msgid, '_footer\',
			\'msg_', $msgid, '_quick_mod\',
			\'modify_button_', $msgid, '\',
			\'msg_', $msgid, '_signature\'

		],
		aSwapLinks: [
			{
				sId: \'msg_', $msgid, '_ignored_link\',
				msgExpanded: \'\',
				msgCollapsed: ', JavaScriptEscape($txt['show_ignore_user_post']), '
			}
		]
	});';
        }
    }
    echo '
	// ]]></script>';
}
Ejemplo n.º 18
0
function template_event_post()
{
    global $context, $settings, $options, $txt, $scripturl, $modSettings;
    // Start the javascript for drop down boxes...
    echo '
		<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
			var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

			function generateDays()
			{
				var days = 0, selected = 0;
				var dayElement = document.getElementById("day"), yearElement = document.getElementById("year"), monthElement = document.getElementById("month");

				monthLength[1] = 28;
				if (yearElement.options[yearElement.selectedIndex].value % 4 == 0)
					monthLength[1] = 29;

				selected = dayElement.selectedIndex;
				while (dayElement.options.length)
					dayElement.options[0] = null;

				days = monthLength[monthElement.value - 1];

				for (i = 1; i <= days; i++)
					dayElement.options[dayElement.length] = new Option(i, i);

				if (selected < days)
					dayElement.selectedIndex = selected;
			}

			function toggleLinked(form)
			{
				form.board.disabled = !form.link_to_board.checked;
			}


			function saveEntities()
			{
				document.forms.postevent.evtitle.value = document.forms.postevent.evtitle.value.replace(/&#/g, "&#38;#");
			}
		// ]]></script>

		<form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);saveEntities();" style="margin: 0;">
			<table width="55%" align="center" cellpadding="0" cellspacing="3">
				<tr>
					<td valign="bottom" colspan="2">
						', theme_linktree(), '
					</td>
				</tr>
			</table>';
    if (!empty($context['event']['new'])) {
        echo '
			<input type="hidden" name="eventid" value="', $context['event']['eventid'], '" />';
    }
    // Start the main table.
    echo '
			<table border="0" width="55%" align="center" cellspacing="1" cellpadding="3" class="bordercolor">
				<tr class="titlebg">
					<td>', $context['page_title'], '</td>
				</tr>
				<tr>
					<td class="windowbg">
						<table border="0" cellpadding="3" width="100%">';
    if (!empty($context['post_error']['messages'])) {
        echo '
							<tr>
								<td></td>
								<td>
									', $context['error_type'] == 'serious' ? '<b>' . $txt['error_while_submitting'] . '</b>' : '', '
									<div style="color: red; margin: 1ex 0 2ex 3ex;">
										', implode('<br />', $context['post_error']['messages']), '
									</div>
								</td>
							</tr>';
    }
    echo '
							<tr>
								<td align="right">
									<b', isset($context['post_error']['no_event']) ? ' style="color: red;"' : '', '>', $txt['calendar12'], '</b>
								</td>
								<td class="smalltext">
									<input type="text" name="evtitle" maxlength="30" size="30" value="', $context['event']['title'], '" style="width: 90%;" />
								</td>
							</tr><tr>
								<td></td>
								<td class="smalltext">
									<input type="hidden" name="calendar" value="1" />', $txt['calendar10'], '&nbsp;
									<select name="year" id="year" onchange="generateDays();">';
    // Show a list of all the years we allow...
    for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) {
        echo '
										<option value="', $year, '"', $year == $context['event']['year'] ? ' selected="selected"' : '', '>', $year, '</option>';
    }
    echo '
									</select>&nbsp;
									', $txt['calendar9'], '&nbsp;
									<select name="month" id="month" onchange="generateDays();">';
    // There are 12 months per year - ensure that they all get listed.
    for ($month = 1; $month <= 12; $month++) {
        echo '
										<option value="', $month, '"', $month == $context['event']['month'] ? ' selected="selected"' : '', '>', $txt['months'][$month], '</option>';
    }
    echo '
									</select>&nbsp;
									', $txt['calendar11'], '&nbsp;
									<select name="day" id="day">';
    // This prints out all the days in the current month - this changes dynamically as we switch months.
    for ($day = 1; $day <= $context['event']['last_day']; $day++) {
        echo '
										<option value="', $day, '"', $day == $context['event']['day'] ? ' selected="selected"' : '', '>', $day, '</option>';
    }
    echo '
									</select>
								</td>
							</tr>';
    // If events can span more than one day then allow the user to select how long it should last.
    if (!empty($modSettings['cal_allowspan'])) {
        echo '
							<tr>
								<td align="right"><b>', $txt['calendar54'], '</b></td>
								<td class="smalltext">
									<select name="span">';
        for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++) {
            echo '
										<option value="', $days, '"', $context['event']['span'] == $days ? ' selected="selected"' : '', '>', $days, '</option>';
        }
        echo '
									</select>
								</td>
							</tr>';
    }
    // If this is a new event let the user specify which board they want the linked post to be put into.
    if ($context['event']['new']) {
        echo '
							<tr>
								<td align="right"><b>', $txt['calendar_link_event'], '</b></td>
								<td class="smalltext">
									<input type="checkbox" class="check" name="link_to_board" checked="checked" onclick="toggleLinked(this.form);" />
								</td>
							</tr>
							<tr>
								<td align="right"><b>', $txt['calendar13'], '</b></td>
								<td class="smalltext">
									<select id="board" name="board" onchange="this.form.submit();">';
        foreach ($context['event']['boards'] as $board) {
            echo '
										<option value="', $board['id'], '"', $board['id'] == $context['event']['board'] ? ' selected="selected"' : '', '>', $board['cat']['name'], ' - ', $board['prefix'], $board['name'], '</option>';
        }
        echo '
									</select>
								</td>
							</tr>';
    }
    echo '
							<tr align="center">
								<td colspan="2">
									<input type="submit" value="', empty($context['event']['new']) ? $txt[10] : $txt[105], '" />';
    // Delete button?
    if (empty($context['event']['new'])) {
        echo '
									<input type="submit" name="deleteevent" value="', $txt['calendar22'], '" onclick="return confirm(\'', $txt['calendar_confirm_delete'], '\');" />';
    }
    echo '
									<input type="hidden" name="sc" value="', $context['session_id'], '" />
									<input type="hidden" name="eventid" value="', $context['event']['eventid'], '" />
								</td>
							</tr>';
    echo '
						</table>
					</td>
				</tr>
			</table>
		</form>';
}
Ejemplo n.º 19
0
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines
 * @copyright 2011 Simple Machines
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.0
 */
function template_main()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    echo '
	<a id="top"></a>';
    if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0)) {
        echo '
	<div class="tborder childboards" id="board_', $context['current_board'], '_childboards">
		<div class="cat_bar">
			<h3 class="catbg">', $txt['parent_boards'], '</h3>
		</div>
		<div class="table_frame">
			<table class="table_list">
				<tbody id="board_', $context['current_board'], '_children" class="content">';
        foreach ($context['boards'] as $board) {
            echo '
				<tr id="board_', $board['id'], '" class="windowbg2">
					<td class="icon windowbg"', !empty($board['children']) ? ' rowspan="2"' : '', '>
						<a href="', $board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children', '">';
            // If the board or children is new, show an indicator.
            if ($board['new'] || $board['children_new']) {
                echo '
							<img src="', $settings['images_url'], '/' . $context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
            } elseif ($board['is_redirect']) {
                echo '
							<img src="', $settings['images_url'], '/' . $context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
            } else {
                echo '
							<img src="', $settings['images_url'], '/' . $context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
            }
            echo '
						</a>
					</td>
					<td class="info">
						<a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';
            // Has it outstanding posts for approval?
            if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) {
                echo '
						<a href="', $scripturl, '?action=moderate;area=postmod;sa=', $board['unapproved_topics'] > 0 ? 'topics' : 'posts', ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';
            }
            echo '

						<p>', $board['description'], '</p>';
            // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
            if (!empty($board['moderators'])) {
                echo '
						<p class="moderators">', count($board['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
            }
            // Show some basic information about the number of posts, etc.
            echo '
					</td>
					<td class="stats windowbg">
						<p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
						', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
						</p>
					</td>
					<td class="lastpost">';
            /* The board's and children's 'last_post's have:
            			time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
            			link, href, subject, start (where they should go for the first unread post.),
            			and member. (which has id, name, link, href, username in it.) */
            if (!empty($board['last_post']['id'])) {
                echo '
						<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
						', $txt['in'], ' ', $board['last_post']['link'], '<br />
						', $txt['on'], ' ', $board['last_post']['time'], '
						</p>';
            }
            echo '
					</td>
				</tr>';
            // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
            if (!empty($board['children'])) {
                // Sort the links into an array with new boards bold so it can be imploded.
                $children = array();
                /* Each child in each board's children has:
                			id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
                foreach ($board['children'] as $child) {
                    if (!$child['is_redirect']) {
                        $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' : '') . '</a>';
                    } else {
                        $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
                    }
                    // Has it posts awaiting approval?
                    if ($child['can_approve_posts'] && $child['unapproved_posts'] | $child['unapproved_topics']) {
                        $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
                    }
                    $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
                }
                echo '
				<tr id="board_', $board['id'], '_children"><td colspan="3" class="children windowbg"><strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '</td></tr>';
            }
        }
        echo '
				</tbody>
			</table>
		</div>
	</div>';
    }
    if (!empty($options['show_board_desc']) && $context['description'] != '') {
        echo '
	<p class="description_board">', $context['description'], '</p>';
    }
    // Create the button set...
    $normal_buttons = array('new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true), 'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'), 'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : '') . 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']));
    // They can only mark read if they are logged in and it's enabled!
    if (!$context['user']['is_logged'] || !$settings['show_mark_read']) {
        unset($normal_buttons['markread']);
    }
    // Allow adding new buttons easily.
    call_integration_hook('integrate_messageindex_buttons', array(&$normal_buttons));
    if (!$context['no_topic_listing']) {
        echo '
	<div class="pagesection">
		<div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
		', template_button_strip($normal_buttons, 'right'), '
	</div>';
        // If Quick Moderation is enabled start the form.
        if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) {
            echo '
	<form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">';
        }
        echo '
	<div class="tborder topic_table" id="messageindex">
		<table class="table_grid" cellspacing="0">
			<thead>
				<tr class="catbg">';
        // Are there actually any topics to show?
        if (!empty($context['topics'])) {
            echo '
					<th scope="col" class="first_th" width="8%" colspan="2">&nbsp;</th>
					<th scope="col" class="lefttext"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['started_by'], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
					<th scope="col" width="14%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['views'], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>';
            // Show a "select all" box for quick moderation?
            if (empty($context['can_quick_mod'])) {
                echo '
					<th scope="col" class="lefttext last_th" width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>';
            } else {
                echo '
					<th scope="col" class="lefttext" width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>';
            }
            // Show a "select all" box for quick moderation?
            if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) {
                echo '
					<th scope="col" class="last_th" width="24"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check" /></th>';
            } elseif (!empty($context['can_quick_mod'])) {
                echo '
					<th class="last_th" width="4%">&nbsp;</th>';
            }
        } else {
            echo '
					<th scope="col" class="first_th" width="8%">&nbsp;</th>
					<th colspan="3"><strong>', $txt['msg_alert_none'], '</strong></th>
					<th scope="col" class="last_th" width="8%">&nbsp;</th>';
        }
        echo '
				</tr>
			</thead>
			<tbody>';
        if (!empty($settings['display_who_viewing'])) {
            echo '
				<tr class="windowbg2 whos_viewing">
					<td colspan="', !empty($context['can_quick_mod']) ? '6' : '5', '" class="smalltext">';
            if ($settings['display_who_viewing'] == 1) {
                echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
            } else {
                echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
            }
            echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '
					</td>
				</tr>';
        }
        // If this person can approve items and we have some awaiting approval tell them.
        if (!empty($context['unapproved_posts_message'])) {
            echo '
				<tr class="windowbg2">
					<td colspan="', !empty($context['can_quick_mod']) ? '6' : '5', '">
						<span class="alert">!</span> ', $context['unapproved_posts_message'], '
					</td>
				</tr>';
        }
        foreach ($context['topics'] as $topic) {
            // Is this topic pending approval, or does it have any posts pending approval?
            if ($context['can_approve_posts'] && $topic['unapproved_posts']) {
                $color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
            } elseif ($topic['is_sticky'] && $topic['is_locked']) {
                $color_class = 'stickybg locked_sticky';
            } elseif ($topic['is_sticky']) {
                $color_class = 'stickybg';
            } elseif ($topic['is_locked']) {
                $color_class = 'lockedbg';
            } else {
                $color_class = 'windowbg';
            }
            // Some columns require a different shade of the color class.
            $alternate_class = $color_class . '2';
            echo '
				<tr>
					<td class="icon1 ', $color_class, '">
						<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
					</td>
					<td class="icon2 ', $color_class, '">
						<img src="', $topic['first_post']['icon_url'], '" alt="" />
					</td>
					<td class="subject ', $alternate_class, '">
						<div ', !empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : '', '>
							', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], !$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : '', '</span>', $topic['is_sticky'] ? '</strong>' : '';
            // Is this topic new? (assuming they are logged in!)
            if ($topic['new'] && $context['user']['is_logged']) {
                echo '
							<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';
            }
            echo '
							<p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
								<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
							</p>
						</div>
					</td>
					<td class="stats ', $color_class, '">
						', $topic['replies'], ' ', $txt['replies'], '
						<br />
						', $topic['views'], ' ', $txt['views'], '
					</td>
					<td class="lastpost ', $alternate_class, '">
						<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" /></a>
						', $topic['last_post']['time'], '<br />
						', $txt['by'], ' ', $topic['last_post']['member']['link'], '
					</td>';
            // Show the quick moderation options?
            if (!empty($context['can_quick_mod'])) {
                echo '
					<td class="moderation ', $color_class, '" align="center">';
                if ($options['display_quick_mod'] == 1) {
                    echo '
						<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check" />';
                } else {
                    // Check permissions on each and show only the ones they are allowed to use.
                    if ($topic['quick_mod']['remove']) {
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=remove;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_remove.gif" width="16" alt="', $txt['remove_topic'], '" title="', $txt['remove_topic'], '" /></a>';
                    }
                    if ($topic['quick_mod']['lock']) {
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=lock;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_lock.gif" width="16" alt="', $txt['set_lock'], '" title="', $txt['set_lock'], '" /></a>';
                    }
                    if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
                        echo '<br />';
                    }
                    if ($topic['quick_mod']['sticky']) {
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=sticky;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_sticky.gif" width="16" alt="', $txt['set_sticky'], '" title="', $txt['set_sticky'], '" /></a>';
                    }
                    if ($topic['quick_mod']['move']) {
                        echo '<a href="', $scripturl, '?action=movetopic;board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><img src="', $settings['images_url'], '/icons/quick_move.gif" width="16" alt="', $txt['move_topic'], '" title="', $txt['move_topic'], '" /></a>';
                    }
                }
                echo '
					</td>';
            }
            echo '
				</tr>';
        }
        if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
            echo '
				<tr class="titlebg">
					<td colspan="6" align="right">
						<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
							<option value="">--------</option>', $context['can_remove'] ? '
							<option value="remove">' . $txt['quick_mod_remove'] . '</option>' : '', $context['can_lock'] ? '
							<option value="lock">' . $txt['quick_mod_lock'] . '</option>' : '', $context['can_sticky'] ? '
							<option value="sticky">' . $txt['quick_mod_sticky'] . '</option>' : '', $context['can_move'] ? '
							<option value="move">' . $txt['quick_mod_move'] . ': </option>' : '', $context['can_merge'] ? '
							<option value="merge">' . $txt['quick_mod_merge'] . '</option>' : '', $context['can_restore'] ? '
							<option value="restore">' . $txt['quick_mod_restore'] . '</option>' : '', $context['can_approve'] ? '
							<option value="approve">' . $txt['quick_mod_approve'] . '</option>' : '', $context['user']['is_logged'] ? '
							<option value="markread">' . $txt['quick_mod_markread'] . '</option>' : '', '
						</select>';
            // Show a list of boards they can move the topic to.
            if ($context['can_move']) {
                echo '
						<select class="qaction" id="moveItTo" name="move_to" disabled="disabled">';
                foreach ($context['move_to_boards'] as $category) {
                    echo '
							<optgroup label="', $category['name'], '">';
                    foreach ($category['boards'] as $board) {
                        echo '
								<option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
                    }
                    echo '
							</optgroup>';
                }
                echo '
						</select>';
            }
            echo '
						<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit qaction" />
					</td>
				</tr>';
        }
        echo '
			</tbody>
		</table>
	</div>
	<a id="bot"></a>';
        // Finish off the form - again.
        if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) {
            echo '
	<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
	</form>';
        }
        echo '
	<div class="pagesection">
		', template_button_strip($normal_buttons, 'right'), '
		<div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
	</div>';
    }
    // Show breadcrumbs at the bottom too.
    theme_linktree();
    echo '
	<div class="tborder" id="topic_icons">
		<div class="description">
			<p class="floatright" id="message_index_jump_to">&nbsp;</p>';
    if (!$context['no_topic_listing']) {
        echo '
			<p class="floatleft smalltext">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
				<img src="' . $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['participation_caption'] . '<br />' : '', '
				<img src="' . $settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' . $txt['normal_topic'] . '<br />
				<img src="' . $settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' . sprintf($txt['hot_topics'], $modSettings['hotTopicPosts']) . '<br />
				<img src="' . $settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' . sprintf($txt['very_hot_topics'], $modSettings['hotTopicVeryPosts']) . '
			</p>
			<p class="smalltext">
				<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" alt="" align="middle" /> ' . $txt['locked_topic'] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? '
				<img src="' . $settings['images_url'] . '/icons/quick_sticky.gif" alt="" align="middle" /> ' . $txt['sticky_topic'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? '
				<img src="' . $settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' . $txt['poll'] : '') . '
			</p>';
    }
    echo '
			<script type="text/javascript"><!-- // --><![CDATA[
				if (typeof(window.XMLHttpRequest) != "undefined")
					aJumpTo[aJumpTo.length] = new JumpTo({
						sContainerId: "message_index_jump_to",
						sJumpToTemplate: "<label class=\\"smalltext\\" for=\\"%select_id%\\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
						iCurBoardId: ', $context['current_board'], ',
						iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
						sCurBoardName: "', $context['jump_to']['board_name'], '",
						sBoardChildLevelIndicator: "==",
						sBoardPrefix: "=> ",
						sCatSeparator: "-----------------------------",
						sCatPrefix: "",
						sGoButtonLabel: "', $txt['quick_mod_go'], '"
					});
			// ]]></script>
			<br class="clear" />
		</div>
	</div>';
    // Javascript for inline editing.
    echo '
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
<script type="text/javascript"><!-- // --><![CDATA[

	// Hide certain bits during topic edit.
	hide_prefixes.push("lockicon", "stickyicon", "pages", "newicon");

	// Use it to detect when we\'ve stopped editing.
	document.onclick = modify_topic_click;

	var mouse_on_div;
	function modify_topic_click()
	{
		if (in_edit_mode == 1 && mouse_on_div == 0)
			modify_topic_save("', $context['session_id'], '", "', $context['session_var'], '");
	}

	function modify_topic_keypress(oEvent)
	{
		if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13)
		{
			modify_topic_save("', $context['session_id'], '", "', $context['session_var'], '");
			if (typeof(oEvent.preventDefault) == "undefined")
				oEvent.returnValue = false;
			else
				oEvent.preventDefault();
		}
	}

	// For templating, shown when an inline edit is made.
	function modify_topic_show_edit(subject)
	{
		// Just template the subject.
		setInnerHTML(cur_subject_div, \'<input type="text" name="subject" value="\' + subject + \'" size="60" style="width: 95%;" maxlength="80" onkeypress="modify_topic_keypress(event)" class="input_text" /><input type="hidden" name="topic" value="\' + cur_topic_id + \'" /><input type="hidden" name="msg" value="\' + cur_msg_id.substr(4) + \'" />\');
	}

	// And the reverse for hiding it.
	function modify_topic_hide_edit(subject)
	{
		// Re-template the subject!
		setInnerHTML(cur_subject_div, \'<a href="', $scripturl, '?topic=\' + cur_topic_id + \'.0">\' + subject + \'<\' +\'/a>\');
	}

// ]]></script>';
}
Ejemplo n.º 20
0
function template_main()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    echo '
<table width="100%" cellpadding="3" cellspacing="0">
	<tr>
		<td><a name="top"></a>', theme_linktree(), '</td>';
    if (!empty($settings['display_who_viewing'])) {
        echo '
		<td class="smalltext" align="right">';
        if ($settings['display_who_viewing'] == 1) {
            echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19];
        } else {
            echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
        }
        echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '</td>';
    }
    echo '
	</tr>
</table>';
    if (isset($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0)) {
        echo '
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor">
	<tr class="titlebg">
		<td colspan="2">', $txt[20], '</td>
		<td width="6%" align="center">', $txt[330], '</td>
		<td width="6%" align="center">', $txt[21], '</td>
		<td width="22%" align="center">', $txt[22], '</td>
	</tr>';
        foreach ($context['boards'] as $board) {
            echo '
	<tr>
		<td class="windowbg" width="6%" align="center" valign="top">', $board['new'] ? '<img src="' . $settings['images_url'] . '/on.gif" alt="' . $txt[333] . '" title="' . $txt[333] . '" border="0" />' : '<img src="' . $settings['images_url'] . '/off.gif" alt="' . $txt[334] . '" title="' . $txt[334] . '" border="0" />', '</td>
		<td class="windowbg2" align="left" width="60%">
			<a name="b' . $board['id'] . '"></a>
			<b>' . $board['link'] . '</b><br />
			' . $board['description'];
            if (!empty($board['moderators'])) {
                echo '<br />
			<i class="smalltext">', count($board['moderators']) == 1 ? $txt[298] : $txt[299], ': ', implode(', ', $board['link_moderators']), '</i>';
            }
            if (!empty($board['children'])) {
                $children = array();
                foreach ($board['children'] as $child) {
                    if ($child['new']) {
                        $children[] = '<b>' . $child['link'] . '</b>';
                    } else {
                        $children[] = $child['link'];
                    }
                }
                echo '
			<br />
			<br /><i class="smalltext">', $txt['parent_boards'], ': ', implode(', ', $children), '</i>';
            }
            echo '
		</td>
		<td class="windowbg" valign="middle" align="center" width="6%">
			', $board['topics'], '
		</td>
		<td class="windowbg" valign="middle" align="center" width="6%">
			', $board['posts'], '
		</td>
		<td class="windowbg2" valign="middle" width="22%">
			<span class="smalltext">
				', $board['last_post']['time'], '<br />
				', $txt['smf88'], ' ', $board['last_post']['link'], '<br />
				', $txt[525], ' ', $board['last_post']['member']['link'], '
			</span>
		</td>
	</tr>';
        }
        echo '
</table>
<br />';
    }
    if (!empty($options['show_board_desc']) && $context['description'] != '') {
        echo '
<table width="100%" cellpadding="6" cellspacing="0" border="0" class="tborder" style="border-width: 1px 1px 0 1px;">
	<tr>
		<td align="left" class="catbg" width="100%" height="24">
			<span class="smalltext">', $context['description'], '</span>
		</td>
	</tr>
</table>';
    }
    if (!$context['no_topic_listing']) {
        echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-width: 1px 1px 0 1px;">
	<tr>
		<td align="left" class="catbg" width="100%" height="30">
			<table cellpadding="3" cellspacing="0" width="100%">
				<tr>
					<td><b>', $txt[139], ':</b> ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#bot">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_down.gif" alt="' . $txt['topbottom5'] . '" border="0" align="top" />' : $txt['topbottom5']) . '</a>' : '', '</td>
					<td align="right" nowrap="nowrap" style="font-size: smaller;">', theme_show_buttons(), '</td>
				</tr>
			</table>
		</td>
	</tr>
</table>';
        // If Quick Moderation is enabled (and set to checkboxes - 1) start the form.
        if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
            echo '
<form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">';
        }
        echo '
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
	<tr class="titlebg">';
        if (!empty($context['topics'])) {
            echo '
		<td width="9%" colspan="2"></td>
		<td width="42%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[70], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
		<td width="14%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[109], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
		<td width="4%" align="center"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[110], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
		<td width="4%" align="center"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[301], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
		<td width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>';
            if (!empty($options['display_quick_mod'])) {
                echo '
		<td width="8%" valign="middle" align="center">', $options['display_quick_mod'] != 1 ? '&nbsp;' : '
			<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="check" />
		', '</td>';
            }
        } else {
            echo '
		<td width="100%" colspan="7"><b>', $txt[151], '</b></td>';
        }
        echo '
	</tr>';
        foreach ($context['topics'] as $topic) {
            echo '
	<tr>
		<td class="windowbg2" valign="middle" align="center" width="5%">
			<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" /></td>
		<td class="windowbg2" valign="middle" align="center" width="4%">
			<img src="', $settings[$context['icon_sources'][$topic['first_post']['icon']]], '/post/', $topic['first_post']['icon'], '.gif" alt="" border="0" align="middle" /></td>
		<td class="windowbg" valign="middle" width="42%">
			', $topic['first_post']['link'], ' ', $topic['new'] && $context['user']['is_logged'] ? '<a href="' . $scripturl . '?topic=' . $topic['id'] . '.msg' . $topic['new_from'] . '#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>' : '', ' <span class="smalltext">', $topic['pages'], '</span></td>
		<td class="windowbg2" valign="middle" width="14%">
			', $topic['first_post']['member']['link'], '</td>
		<td class="windowbg" valign="middle" width="4%" align="center">
			', $topic['replies'], '</td>
		<td class="windowbg" valign="middle" width="4%" align="center">
			', $topic['views'], '</td>
		<td class="windowbg2" valign="middle" width="22%">
			<span class="smalltext">', $topic['last_post']['time'], '<br />', $txt[525], ' ', $topic['last_post']['member']['link'], '</span></td>';
            // Show the quick moderation options?
            if (!empty($options['display_quick_mod'])) {
                echo '
		<td class="windowbg" valign="middle" align="center" width="8%">';
                if ($options['display_quick_mod'] == 1) {
                    echo '
			<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="check" />';
                } else {
                    if ($topic['quick_mod']['remove']) {
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=remove;sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_remove.gif" width="16" alt="', $txt[63], '" title="', $txt[63], '" border="0" /></a>';
                    }
                    if ($topic['quick_mod']['lock']) {
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=lock;sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_lock.gif" width="16" alt="', $txt['smf279'], '" title="', $txt['smf279'], '" border="0" /></a>';
                    }
                    if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
                        echo '<br />';
                    }
                    if ($topic['quick_mod']['sticky']) {
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=sticky;sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_sticky.gif" width="16" alt="', $txt['smf277'], '" title="', $txt['smf277'], '" border="0" /></a>';
                    }
                    if ($topic['quick_mod']['move']) {
                        echo '<a href="', $scripturl, '?action=movetopic;board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><img src="', $settings['images_url'], '/icons/quick_move.gif" width="16" alt="', $txt[132], '" title="', $txt[132], '" border="0" /></a>';
                    }
                }
                echo '</td>';
            }
            echo '
	</tr>';
        }
        if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
            echo '
	<tr class="titlebg">
		<td colspan="8" align="right">
			<select name="qaction"', $context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
				<option value="">--------</option>', $context['can_remove'] ? '
				<option value="remove">' . $txt['quick_mod_remove'] . '</option>' : '', $context['can_lock'] ? '
				<option value="lock">' . $txt['quick_mod_lock'] . '</option>' : '', $context['can_sticky'] ? '
				<option value="sticky">' . $txt['quick_mod_sticky'] . '</option>' : '', $context['can_move'] ? '
				<option value="move">' . $txt['quick_mod_move'] . ': </option>' : '', $context['can_merge'] ? '
				<option value="merge">' . $txt['quick_mod_merge'] . '</option>' : '', '
				<option value="markread">', $txt['quick_mod_markread'], '</option>
			</select>';
            if ($context['can_move']) {
                echo '
			<select id="moveItTo" name="move_to" disabled="disabled">';
                foreach ($context['jump_to'] as $category) {
                    foreach ($category['boards'] as $board) {
                        if (!$board['is_current']) {
                            echo '
				<option value="', $board['id'], '"', !empty($board['selected']) ? ' selected="selected"' : '', '>', str_repeat('-', $board['child_level'] + 1), ' ', $board['name'], '</option>';
                        }
                    }
                }
                echo '
			</select>';
            }
            echo '
			<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return this.form.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" />
		</td>
	</tr>';
        }
        echo '
</table>';
        // Finish off the form - again, if Quick Moderation is being done with checkboxes. (1)
        if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
            echo '
	<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
        }
        echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-width: 0 1px 1px 1px;">
	<tr>
		<td align="left" class="catbg" width="100%" height="30">
			<table cellpadding="3" cellspacing="0" width="100%">
				<tr>
					<td><a name="bot"></a><b>', $txt[139], ':</b> ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#top">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_up.gif" alt="' . $txt['topbottom4'] . '" border="0" align="top" />' : $txt['topbottom4']) . '</a>' : '', '</td>
					<td align="right" nowrap="nowrap" style="font-size: smaller;">', theme_show_buttons(), '</td>
				</tr>
			</table>
		</td>
	</tr>
</table>';
    }
    echo '
<table cellpadding="0" cellspacing="0" width="100%">';
    if ($settings['linktree_inline']) {
        echo '
	<tr>
		<td colspan="3" valign="bottom">', theme_linktree(), '<br /><br /></td>
	</tr>';
    }
    echo '
	<tr>';
    if (!$context['no_topic_listing']) {
        echo '
		<td class="smalltext" align="left" style="padding-top: 1ex;">', !empty($modSettings['enableParticipation']) ? '
			<img src="' . $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['participation_caption'] . '<br />' : '', '
			<img src="' . $settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' . $txt[457] . '<br />
			<img src="' . $settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' . $txt[454] . '<br />
			<img src="' . $settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' . $txt[455] . '
		</td>
		<td class="smalltext" align="left" valign="top" style="padding-top: 1ex;">
			<img src="' . $settings['images_url'] . '/topic/normal_post_locked.gif" alt="" align="middle" /> ' . $txt[456] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? '
			<img src="' . $settings['images_url'] . '/topic/normal_post_sticky.gif" alt="" align="middle" /> ' . $txt['smf96'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? '
			<img src="' . $settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' . $txt['smf43'] : '') . '
		</td>';
    }
    echo '
		<td class="smalltext" align="right" valign="middle">
			<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '">
				<label for="jumpto">' . $txt[160] . '</label>:
				<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
					<option value="">' . $txt[251] . ':</option>';
    // Show each category - they all have an id, name, and the boards in them.
    foreach ($context['jump_to'] as $category) {
        // Show the category name with a link to the category. (index.php#id)
        echo '
					<option value="" disabled="disabled">-----------------------------</option>
					<option value="#', $category['id'], '">', $category['name'], '</option>
					<option value="" disabled="disabled">-----------------------------</option>';
        /* Now go through each board - they all have:
        			id, name, child_level (how many parents they have, basically...), and is_current. (is this the current board?) */
        foreach ($category['boards'] as $board) {
            // Show some more =='s if this is a child, so as to make it look nice.
            echo '
					<option value="?board=', $board['id'], '.0"', $board['is_current'] ? ' selected="selected"' : '', '> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>';
        }
    }
    echo '
				</select>&nbsp;
				<input type="button" value="', $txt[161], '" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \'', $scripturl, '\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" />
			</form>
		</td>
	</tr>
</table>';
}
Ejemplo n.º 21
0
function template_replies()
{
    global $context, $settings, $options, $txt, $scripturl, $modSettings;
    echo '
	<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center">
		<tr>
			<td>', theme_linktree(), '</td>
		</tr>
	</table>

	<table border="0" width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td class="middletext" valign="middle">' . $txt[139] . ': ' . $context['page_index'] . '</td>';
    if (isset($context['topics_to_mark']) && !empty($settings['show_mark_read'])) {
        $mark_read = array('markread' => array('text' => 452, 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=unreadreplies;topics=' . $context['topics_to_mark'] . ';sesc=' . $context['session_id']));
        echo '
			<td align="right" style="padding-right: 1ex;">
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						', template_button_strip($mark_read, 'bottom'), '
					</tr>
				</table>
			</td>';
    }
    echo '
		</tr>
	</table>

	<table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor">
		<tr><td>
			<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
				<tr class="titlebg">';
    if (!empty($context['topics'])) {
        echo '
					<td width="10%" colspan="2">&nbsp;</td>
					<td><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[70], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
					<td width="14%"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[109], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
					<td width="4%" align="center"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[110], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
					<td width="4%" align="center"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[301], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
					<td width="24%"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>';
    } else {
        echo '
					<td width="100%" colspan="7">' . $txt[151] . '</td>';
    }
    echo '
				</tr>';
    foreach ($context['topics'] as $topic) {
        // Seperate lock and sticky again?
        if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false) {
            $topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
        }
        if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false) {
            $topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));
        }
        echo '
				<tr>
					<td class="windowbg2" valign="middle" align="center" width="6%">
						<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" /></td>
					<td class="windowbg2" valign="middle" align="center" width="4%">
						<img src="', $topic['first_post']['icon_url'], '" alt="" align="middle" /></td>
					<td class="windowbg', $topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '3' : '', '" width="48%" valign="middle">
						', $topic['is_locked'] && !empty($settings['seperate_sticky_lock']) ? '<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" style="margin: 0;" />' : '', '
						', $topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" style="margin: 0;" />' : '', ' ', $topic['first_post']['link'], ' <a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a> <span class="smalltext">', $topic['pages'], '
						', $txt['smf88'], ' ', $topic['board']['link'], '</span></td>
					<td class="windowbg2" valign="middle" width="14%">
						', $topic['first_post']['member']['link'], '</td>
					<td class="windowbg" valign="middle" width="4%" align="center">
						', $topic['replies'], '</td>
					<td class="windowbg" valign="middle" width="4%" align="center">
						', $topic['views'], '</td>
					<td class="windowbg2" valign="middle" width="22%">
						<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" style="float: right;" /></a>
						<span class="smalltext">
								', $topic['last_post']['time'], '<br />
								', $txt[525], ' ', $topic['last_post']['member']['link'], '
						</span>
					</td>
				</tr>';
    }
    echo '
			</table>
		</td></tr>
	</table>

	<table border="0" width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td class="middletext" valign="middle">' . $txt[139] . ': ' . $context['page_index'] . '</td>';
    if (isset($context['topics_to_mark']) && !empty($settings['show_mark_read'])) {
        echo '
			<td align="right" style="padding-right: 1ex;">
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						', template_button_strip($mark_read, 'top'), '
					</tr>
				</table>
			</td>';
    }
    echo '
		</tr>
	</table><br />

	<div class="tborder"><div class="titlebg2">
		<table cellpadding="8" cellspacing="0" width="55%">
			<tr>
				<td align="left" style="padding-top: 2ex;" class="smalltext">', !empty($modSettings['enableParticipation']) ? '
					<img src="' . $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['participation_caption'] . '<br />' : '', '
					<img src="' . $settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' . $txt[457] . '<br />
					<img src="' . $settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' . $txt[454] . '<br />
					<img src="' . $settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' . $txt[455] . '
				</td>
				<td align="left" valign="top" style="padding-top: 2ex;" class="smalltext">
					<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" alt="" align="middle" /> ' . $txt[456] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? '
					<img src="' . $settings['images_url'] . '/icons/' . (!empty($settings['seperate_sticky_lock']) ? 'quick_sticky' : 'normal_post_sticky') . '.gif" alt="" align="middle" /> ' . $txt['smf96'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? '
					<img src="' . $settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' . $txt['smf43'] : '') . '
				</td>
			</tr>
		</table>
	</div></div>';
}
Ejemplo n.º 22
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.º 23
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.º 24
0
function template_replies()
{
    global $context, $settings, $options, $txt, $scripturl, $modSettings;
    echo '
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center">
	<tr>
		<td>', theme_linktree(), '</td>
	</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor">
	<tr><td>
		<div style="padding: 1px;" class="bordercolor">
			<table width="100%" cellpadding="4" cellspacing="0" border="0" class="catbg">
				<tr>
					<td valign="middle"><b>' . $txt[139] . ':</b> ' . $context['page_index'] . '</td>
					<td align="right" nowrap="nowrap" style="font-size: smaller;">';
    if (isset($context['topics_to_mark']) && !empty($settings['show_mark_read'])) {
        echo '
						<a href="' . $scripturl . '?action=markasread;sa=unreadreplies;topics=' . $context['topics_to_mark'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/markread.gif" alt="' . $txt[452] . '" border="0" />' : $txt[452]) . '</a>';
    }
    echo '
					</td>
				</tr>
			</table>
		</div>

		<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
			<tr class="titlebg">';
    if (!empty($context['topics'])) {
        echo '
				<td width="10%" colspan="2">&nbsp;</td>
				<td><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[70], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
				<td width="14%"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[109], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
				<td width="4%" align="center"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[110], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
				<td width="4%" align="center"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[301], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
				<td width="24%"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>';
    } else {
        echo '
				<td width="100%" colspan="7">' . $txt[151] . '</td>';
    }
    echo '
			</tr>';
    foreach ($context['topics'] as $topic) {
        echo '
			<tr>
				<td class="windowbg2" valign="middle" align="center" width="6%">
					<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" /></td>
				<td class="windowbg2" valign="middle" align="center" width="4%">
					<img src="', $settings[$context['icon_sources'][$topic['first_post']['icon']]], '/post/', $topic['first_post']['icon'], '.gif" alt="" border="0" align="middle" /></td>
				<td class="windowbg" valign="middle" width="48%">
					', $topic['first_post']['link'], ' <a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a> <span class="smalltext">', $topic['pages'], '</span>
					<div class="smalltext"><i>', $txt['smf88'], ' ', $topic['board']['link'], '</i></div></td>
				<td class="windowbg2" valign="middle" width="14%">
					', $topic['first_post']['member']['link'], '</td>
				<td class="windowbg" valign="middle" width="4%" align="center">
					', $topic['replies'], '</td>
				<td class="windowbg" valign="middle" width="4%" align="center">
					', $topic['views'], '</td>
				<td class="windowbg2" valign="middle" width="27%">
					<span class="smalltext">', $topic['last_post']['time'], '<br />', $txt[525], ' ', $topic['last_post']['member']['link'], '</span></td>
			</tr>';
    }
    echo '
		</table>

		<div style="padding: 1px;" class="bordercolor">
			<table width="100%" cellpadding="4" cellspacing="0" border="0" class="catbg">
				<tr>
					<td valign="middle"><b>', $txt[139], ':</b> ', $context['page_index'], '</td>
					<td align="right" nowrap="nowrap" style="font-size: smaller;">';
    if (isset($context['topics_to_mark']) && !empty($settings['show_mark_read'])) {
        echo '
						<a href="', $scripturl, '?action=markasread;sa=unreadreplies;topics=', $context['topics_to_mark'], ';sesc=', $context['session_id'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/markread.gif" alt="' . $txt[452] . '" border="0" />' : $txt[452], '</a>';
    }
    echo '
					</td>
				</tr>
			</table>
		</div>
	</td></tr>
</table>

<table cellpadding="0" cellspacing="0" width="55%">
	<tr>
		<td class="smalltext" align="left" style="padding-top: 1ex;">
			<img src="', $settings['images_url'], '/topic/my_normal_post.gif" alt="" align="middle" /> ', $txt[457], '<br />
			<img src="', $settings['images_url'], '/topic/my_hot_post.gif" alt="" align="middle" /> ', $txt[454], '<br />
			<img src="', $settings['images_url'], '/topic/my_veryhot_post.gif" alt="" align="middle" /> ', $txt[455], '
		</td>
		<td class="smalltext" align="left" valign="top" style="padding-top: 1ex;">
			<img src="', $settings['images_url'], '/topic/my_normal_post_locked.gif" alt="" align="middle" /> ', $txt[456], '<br />', $modSettings['enableStickyTopics'] == '1' ? '
			<img src="' . $settings['images_url'] . '/topic/my_normal_post_sticky.gif" alt="" align="middle" /> ' . $txt['smf96'] . '<br />' : '', $modSettings['pollMode'] == '1' ? '
			<img src="' . $settings['images_url'] . '/topic/my_normal_poll.gif" alt="" align="middle" /> ' . $txt['smf43'] : '', '
		</td>
	</tr>
</table>';
}
Ejemplo n.º 25
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.º 26
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.º 27
0
function template_results()
{
    global $context, $settings, $options, $txt, $scripturl;
    if (isset($context['did_you_mean']) || empty($context['topics'])) {
        echo '
	<div class="tborder">
		<table width="100%" cellpadding="4" cellspacing="0" border="0" class="bordercolor" style="margin-bottom: 2ex;">
			<tr class="titlebg">
				<td>', $txt['search_adjust_query'], '</td>
			</tr>
			<tr>
				<td class="windowbg">';
        // Did they make any typos or mistakes, perhaps?
        if (isset($context['did_you_mean'])) {
            echo '
					', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.<br />';
        }
        echo '
					<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
						<b>', $txt[582], ':</b><br />
						<input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' size="40" />
						<input type="submit" name="submit" value="', $txt['search_adjust_submit'], '" />

						<input type="hidden" name="searchtype" value="', !empty($context['search_params']['searchtype']) ? $context['search_params']['searchtype'] : 0, '" />
						<input type="hidden" name="userspec" value="', !empty($context['search_params']['userspec']) ? $context['search_params']['userspec'] : '', '" />
						<input type="hidden" name="show_complete" value="', !empty($context['search_params']['show_complete']) ? 1 : 0, '" />
						<input type="hidden" name="subject_only" value="', !empty($context['search_params']['subject_only']) ? 1 : 0, '" />
						<input type="hidden" name="minage" value="', !empty($context['search_params']['minage']) ? $context['search_params']['minage'] : '0', '" />
						<input type="hidden" name="maxage" value="', !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999', '" />
						<input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '" />';
        if (!empty($context['search_params']['brd'])) {
            foreach ($context['search_params']['brd'] as $board_id) {
                echo '
						<input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '" />';
            }
        }
        echo '
					</form>
				</td>
			</tr>
		</table>
	</div>';
    }
    if ($context['compact']) {
        echo '
	<div style="padding: 3px;">', theme_linktree(), '</div>
	<div class="middletext">', $txt[139], ': ', $context['page_index'], '</div>';
        // Quick moderation set to checkboxes? Oh, how fun :/.
        if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
            echo '
	<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm" style="margin: 0;">';
        }
        echo '
		<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
			<tr class="titlebg">';
        if (!empty($context['topics'])) {
            echo '
				<td width="4%"></td>
				<td width="4%"></td>
				<td width="56%">', $txt[70], '</td>
				<td width="6%" align="center">', $txt['search_relevance'], '</td>
				<td width="12%">', $txt[109], '</td>
				<td width="18%" align="center">', $txt['search_date_posted'], '</td>';
            if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
                echo '
				<td width="24" valign="middle" align="center">
						<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="check" />
				</td>';
            } elseif (!empty($options['display_quick_mod'])) {
                echo '
				<td width="4%" valign="middle" align="center"></td>';
            }
        } else {
            echo '
				<td width="100%" colspan="5">', $txt['search_no_results'], '</td>';
        }
        echo '
			</tr>';
        while ($topic = $context['get_topics']()) {
            // Work out what the class is if we remove sticky and lock info.
            if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false) {
                $topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
            }
            if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false) {
                $topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));
            }
            echo '
			<tr>
				<td class="windowbg2" valign="top" align="center" width="4%">
					<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" /></td>
				<td class="windowbg2" valign="top" align="center" width="4%">
					<img src="', $topic['first_post']['icon_url'], '" alt="" align="middle" /></td>
				<td class="windowbg', $topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '3' : '', '" valign="middle">
					', $topic['is_locked'] && !empty($settings['seperate_sticky_lock']) ? '<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" style="margin: 0;" />' : '', '
					', $topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" style="margin: 0;" /><b>' : '', $topic['first_post']['link'], $topic['is_sticky'] ? '</b>' : '', '
				<div class="smalltext"><i>', $txt['smf88'], ' ', $topic['board']['link'], '</i></div>';
            foreach ($topic['matches'] as $message) {
                echo '<br />
					<div class="quoteheader" style="margin-left: 20px;"><a href="', $scripturl, '?topic=', $topic['id'], '.msg', $message['id'], '#msg', $message['id'], '">', $message['subject_highlighted'], '</a> ', $txt[525], ' ', $message['member']['link'], '</div>';
                if ($message['body_highlighted'] != '') {
                    echo '
					<div class="quote" style="margin-left: 20px;">', $message['body_highlighted'], '</div>';
                }
            }
            echo '
				</td>
				<td class="windowbg2" valign="top" width="6%" align="center">
					', $topic['relevance'], '
				</td><td class="windowbg" valign="top" width="12%">
					', $topic['first_post']['member']['link'], '
				</td><td class="windowbg" valign="top" width="18%" align="center">
					', $topic['first_post']['time'], '
				</td>';
            if (!empty($options['display_quick_mod'])) {
                echo '
				<td class="windowbg" valign="middle" align="center" width="4%">';
                if ($options['display_quick_mod'] == 1) {
                    echo '
					<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="check" />';
                } else {
                    if ($topic['quick_mod']['remove']) {
                        echo '
					<a href="', $scripturl, '?action=quickmod;actions[', $topic['id'], ']=remove;sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_remove.gif" width="16" alt="', $txt[63], '" title="', $txt[63], '" /></a>';
                    }
                    if ($topic['quick_mod']['lock']) {
                        echo '
					<a href="', $scripturl, '?action=quickmod;actions[', $topic['id'], ']=lock;sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_lock.gif" width="16" alt="', $txt['smf279'], '" title="', $txt['smf279'], '" /></a>';
                    }
                    if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
                        echo '<br />';
                    }
                    if ($topic['quick_mod']['sticky']) {
                        echo '
					<a href="', $scripturl, '?action=quickmod;actions[', $topic['id'], ']=sticky;sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_sticky.gif" width="16" alt="', $txt['smf277'], '" title="', $txt['smf277'], '" /></a>';
                    }
                    if ($topic['quick_mod']['move']) {
                        echo '
					<a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><img src="', $settings['images_url'], '/icons/quick_move.gif" width="16" alt="', $txt[132], '" title="', $txt[132], '" /></a>';
                    }
                }
                echo '
				</td>';
            }
            echo '
			</tr>';
        }
        if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
            echo '
			<tr class="titlebg">
				<td colspan="8" align="right">
					<select name="qaction"', $context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
						<option value="">--------</option>', $context['can_remove'] ? '
						<option value="remove">' . $txt['quick_mod_remove'] . '</option>' : '', $context['can_lock'] ? '
						<option value="lock">' . $txt['quick_mod_lock'] . '</option>' : '', $context['can_sticky'] ? '
						<option value="sticky">' . $txt['quick_mod_sticky'] . '</option>' : '', $context['can_move'] ? '
						<option value="move">' . $txt['quick_mod_move'] . ': </option>' : '', $context['can_merge'] ? '
						<option value="merge">' . $txt['quick_mod_merge'] . '</option>' : '', '
						<option value="markread">', $txt['quick_mod_markread'], '</option>
					</select>';
            if ($context['can_move']) {
                echo '
					<select id="moveItTo" name="move_to" disabled="disabled">';
                foreach ($context['jump_to'] as $category) {
                    foreach ($category['boards'] as $board) {
                        if (!$board['is_current']) {
                            echo '
						<option value="', $board['id'], '"', !empty($board['selected']) ? ' selected="selected"' : '', '>', str_repeat('-', $board['child_level'] + 1), ' ', $board['name'], '</option>';
                        }
                    }
                }
                echo '
					</select>';
            }
            echo '
					<input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '" />
					<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return this.form.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" />
				</td>
			</tr>';
        }
        echo '
		</table>';
        if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
            echo '
			<input type="hidden" name="sc" value="' . $context['session_id'] . '" />
		</form>';
        }
        echo '
		<div class="middletext">', $txt[139], ': ', $context['page_index'], '</div>';
        if ($settings['linktree_inline']) {
            echo '
		<div style="padding: 3px;">', theme_linktree(), '</div>';
        }
        echo '
		<table cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td class="smalltext" align="right" valign="middle">
					<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '">
						<label for="jumpto">', $txt[160], ':</label>
						<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
							<option value="">', $txt[251], ':</option>';
        foreach ($context['jump_to'] as $category) {
            echo '
							<option value="" disabled="disabled">-----------------------------</option>
							<option value="#', $category['id'], '">', $category['name'], '</option>
							<option value="" disabled="disabled">-----------------------------</option>';
            foreach ($category['boards'] as $board) {
                echo '
							<option value="?board=', $board['id'], '.0"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>';
            }
        }
        echo '
						</select>
						&nbsp;
						<input type="button" value="', $txt[161], '" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \'', $scripturl, '\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" />
					</form>
				</td>
			</tr>
		</table>';
    } else {
        echo '
		<div style="padding: 3px;">', theme_linktree(), '</div>
		<div class="middletext">', $txt[139], ': ', $context['page_index'], '</div>';
        if (empty($context['topics'])) {
            echo '
		<table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td>
			<table border="0" width="100%" cellpadding="2" cellspacing="1" class="bordercolor"><tr class="windowbg2"><td><br />
				<b>(', $txt['search_no_results'], ')</b><br /><br />
			</td></tr></table>
		</td></tr></table>';
        }
        while ($topic = $context['get_topics']()) {
            foreach ($topic['matches'] as $message) {
                // Create buttons row.
                $quote_button = create_button('quote.gif', 145, 145, 'align="middle"');
                $reply_button = create_button('reply_sm.gif', 146, 146, 'align="middle"');
                $notify_button = create_button('notify_sm.gif', 131, 131, 'align="middle"');
                $buttonArray = array();
                if ($topic['can_reply']) {
                    $buttonArray[] = '<a href="' . $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'] . '">' . $reply_button . '</a>';
                    $buttonArray[] = '<a href="' . $scripturl . '?action=post;topic=' . $topic['id'] . '.0;quote=' . $message['id'] . '/' . $message['start'] . ';sesc=' . $context['session_id'] . '">' . $quote_button . '</a>';
                }
                if ($topic['can_mark_notify']) {
                    $buttonArray[] = '<a href="' . $scripturl . '?action=notify;topic=' . $topic['id'] . '.' . $message['start'] . '">' . $notify_button . '</a>';
                }
                echo '
			<div class="tborder">
				<table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor">
					<tr>
						<td>
							<table width="100%" cellpadding="4" cellspacing="1" border="0" class="bordercolor">
								<tr class="titlebg">
									<td>
										<div style="float: left; width: 3ex;">&nbsp;', $message['counter'], '&nbsp;</div>
										<div style="float: left;">&nbsp;', $topic['category']['link'], ' / ', $topic['board']['link'], ' / <a href="', $scripturl, '?topic=', $topic['id'], '.', $message['start'], ';topicseen#msg', $message['id'], '">', $message['subject_highlighted'], '</a></div>
										<div align="right">', $txt[30], ': ', $message['time'], '&nbsp;</div>
									</td>
								</tr><tr class="catbg">
									<td>
										<div style="float: left;">', $txt[109], ' ', $topic['first_post']['member']['link'], ', ', $txt[72], ' ', $txt[525], ' ', $message['member']['link'], '</div>
										<div align="right">', $txt['search_relevance'], ': ', $topic['relevance'], '</div>
									</td>
								</tr><tr>
									<td width="100%" valign="top" class="windowbg2">
										<div class="post">', $message['body_highlighted'], '</div>
									</td>
								</tr><tr class="windowbg">
									<td class="middletext" align="right">&nbsp;', implode($context['menu_separator'], $buttonArray), '</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</div>';
            }
        }
        echo '
			<div class="middletext">', $txt[139], ': ', $context['page_index'], '</div>';
        if ($settings['linktree_inline']) {
            echo '
			<div style="padding: 3px;">', theme_linktree(), '</div>';
        }
    }
}
Ejemplo n.º 28
0
function template_main()
{
    global $context, $settings, $options, $txt, $scripturl, $modSettings;
    // Show some statistics next to the link tree if SP1 info is off.
    echo '
<table width="100%" cellpadding="3" cellspacing="0">
	<tr>
		<td valign="bottom">', theme_linktree(), '</td>
		<td align="right">';
    if (!$settings['show_sp1_info']) {
        echo '
			', $txt[19], ': ', $context['common_stats']['total_members'], ' &nbsp;&#8226;&nbsp; ', $txt[95], ': ', $context['common_stats']['total_posts'], ' &nbsp;&#8226;&nbsp; ', $txt[64], ': ', $context['common_stats']['total_topics'], '
			', $settings['show_latest_member'] ? '<br />' . $txt[201] . ' <b>' . $context['common_stats']['latest_member']['link'] . '</b>' . $txt[581] : '';
    }
    echo '
		</td>
	</tr>
</table>';
    // Show the news fader?  (assuming there are things to show...)
    if ($settings['show_newsfader'] && !empty($context['fader_news_lines'])) {
        echo '
<div class="tborder" style="border-bottom: 0;">
	<div class="titlebg" align="center" style="padding: 5px 5px 5px 5px;">', $txt[102], '</div>
</div>
<table border="0" width="100%" cellspacing="0" cellpadding="5" class="tborder" style="border-bottom: 0;">
	<tr>
		<td class="windowbg2" valign="middle" align="center" height="60">';
        // Prepare all the javascript settings.
        echo '
			<div id="smfFadeScroller" style="width: 90%; padding: 2px;"><b>', $context['news_lines'][0], '</b></div>
			<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
				// The fading delay (in ms.)
				var smfFadeDelay = ', empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], ';
				// Fade from... what text color?  To which background color?
				var smfFadeFrom = {"r": 0, "g": 0, "b": 0}, smfFadeTo = {"r": 248, "g": 248, "b": 248};
				// Surround each item with... anything special?
				var smfFadeBefore = "<b>", smfFadeAfter = "</b>";

				if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
				{
					var foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\\da-f][\\da-f])([\\da-f][\\da-f])([\\da-f][\\da-f])/);
					smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

					var backEl = document.getElementById(\'smfFadeScroller\');
					while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
						backEl = backEl.parentNode;

					var backColor = backEl.currentStyle.backgroundColor.match(/#([\\da-f][\\da-f])([\\da-f][\\da-f])([\\da-f][\\da-f])/);
					smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
				}
				else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
				{
					var foreColor = document.defaultView.getComputedStyle(document.getElementById(\'smfFadeScroller\'), null).color.match(/rgb\\((\\d+), (\\d+), (\\d+)\\)/);
					smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

					var backEl = document.getElementById(\'smfFadeScroller\');
					while (document.defaultView.getComputedStyle(backEl, null).backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
						backEl = backEl.parentNode;

					var backColor = document.defaultView.getComputedStyle(backEl, null).backgroundColor.match(/rgb\\((\\d+), (\\d+), (\\d+)\\)/);
					smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
				}

				// List all the lines of the news for display.
				var smfFadeContent = new Array(
					"', implode('",
					"', $context['fader_news_lines']), '"
				);
			// ]]></script>
			<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/fader.js"></script>
		</td>
	</tr>
</table>';
    }
    // Show the "Board name      Topics  Posts    Last Post" header.
    echo '
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor">
	<tr class="titlebg">
		<td colspan="2">', $txt[20], '</td>
		<td width="6%" align="center">', $txt[330], '</td>
		<td width="6%" align="center">', $txt[21], '</td>
		<td width="22%" align="center">', $txt[22], '</td>
	</tr>';
    /* Each category in categories is made up of:
    		id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
    		new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down iamge),
    		and boards. (see below.) */
    foreach ($context['categories'] as $category) {
        // Show the category's name, and let them collapse it... if they feel like it.
        echo '
	<tr>
		<td colspan="5" class="catbg" height="18">';
        // If this category even can collapse, show a link to collapse it.
        if ($category['can_collapse']) {
            echo '
			<a href="', $category['collapse_href'], '">', $category['collapse_image'], '</a>';
        }
        echo '
			', $category['link'], '
		</td>
	</tr>';
        // Only if it's NOT collapsed..
        if (!$category['is_collapsed']) {
            /* Each board in each category's boards has:
            			new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
            			children (see below.), link_children (easier to use.), children_new (are they new?),
            			topics (# of), posts (# of), link, href, and last_post. (see below.) */
            foreach ($category['boards'] as $board) {
                echo '
	<tr>
		<td class="windowbg" width="6%" align="center" valign="top"><img src="', $settings['images_url'], $board['new'] ? '/on.gif" alt="' . $txt[333] . '" title="' . $txt[333] : '/off.gif" alt="' . $txt[334] . '" title="' . $txt[334], '" border="0" /></td>
		<td class="windowbg2" align="left" width="60%">
			<a name="b', $board['id'], '"></a>
			<b>', $board['link'], '</b><br />
			', $board['description'];
                // Show the "Moderators: ".  Each has name, href, link, and id. (but we're gonna use link_moderators.)
                if (!empty($board['moderators'])) {
                    echo '<i class="smalltext"><br />
			', count($board['moderators']) == 1 ? $txt[298] : $txt[299], ': ', implode(', ', $board['link_moderators']), '</i>';
                }
                // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
                if (!empty($board['children'])) {
                    // Sort the links into an array with new boards bold so it can be imploded.
                    $children = array();
                    /* Each child in each board's children has:
                    			id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
                    foreach ($board['children'] as $child) {
                        $children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
                    }
                    echo '
			<i class="smalltext"><br />
			', $txt['parent_boards'], ': ', implode(', ', $children), '</i>';
                }
                echo '
		</td>
		<td class="windowbg" valign="middle" align="center" width="6%">', $board['topics'], '</td>
		<td class="windowbg" valign="middle" align="center" width="6%">', $board['posts'], '</td>';
                /* The board's and children's 'last_post's have:
                			time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
                			link, href, subject, start (where they should go for the first unread post.),
                			and member. (which has id, name, link, href, username in it.) */
                echo '
		<td class="windowbg2" valign="middle" width="22%">
			<span class="smalltext">
				', $board['last_post']['time'], '<br />
				', $txt['smf88'], ' ', $board['last_post']['link'], '<br />
				', $txt[525], ' ', $board['last_post']['member']['link'], '
			</span>
		</td>
	</tr>';
            }
        }
    }
    // Show the "New Posts" and "No New Posts" legend.
    if ($context['user']['is_logged']) {
        echo '
	<tr class="titlebg">
		<td colspan="2" align="left">
			<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new_some.gif" alt="' . $txt[333] . '" border="0" />&nbsp;&nbsp;<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new_none.gif" alt="' . $txt[334] . '" border="0" />
		</td>
		<td colspan="3" align="right" class="smalltext">';
        // Show the mark all as read button?
        if ($settings['show_mark_read']) {
            echo '
			<a href="', $scripturl, '?action=markasread;sa=all;sesc=' . $context['session_id'] . '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/markread.gif" alt="' . $txt[452] . '" border="0" />' : $txt[452], '</a>';
        }
        echo '
		</td>
	</tr>';
    }
    echo '
</table>';
    // Here's where the "Info Center" starts...
    echo '
<br />
<br />
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
	<tr class="titlebg">
		<td align="center" colspan="2">', $txt[685], '</td>
	</tr>';
    // This is the "Recent Posts" bar.
    if (!empty($settings['number_recent_posts'])) {
        echo '
	<tr>
		<td class="catbg" colspan="2">', $txt[214], '</td>
	</tr>
	<tr>
		<td class="windowbg" width="20" valign="middle" align="center">
			<a href="', $scripturl, '?action=recent">
				<img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt[214], '" border="0" /></a>
		</td>
		<td class="windowbg2">';
        // Only show one post.
        if ($settings['number_recent_posts'] == 1) {
            // latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
            echo '
			<b><a href="', $scripturl, '?action=recent">', $txt[214], '</a></b><br />
			<span class="smalltext">
				', $txt[234], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt[235], ' (', $context['latest_post']['time'], ')<br />
			</span>';
        } elseif (!empty($context['latest_posts'])) {
            echo '
			<table width="100%" border="0">';
            /* Each post in latest_posts has:
            			board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
            			subject, short_subject (shortened with...), time, link, and href. */
            foreach ($context['latest_posts'] as $post) {
                echo '
				<tr>
					<td align="right" valign="top" nowrap="nowrap">[', $post['board']['link'], ']</td>
					<td valign="top">', $post['link'], ' ', $txt[525], ' ', $post['poster']['link'], '</td>
					<td align="right" valign="top" nowrap="nowrap">', $post['time'], '</td>
				</tr>';
            }
            echo '
			</table>';
        }
        echo '
		</td>
	</tr>';
    }
    // Show information about events, birthdays, and holidays on the calendar.
    if ($context['show_calendar']) {
        echo '
	<tr>
		<td class="catbg" colspan="2">', $context['calendar_only_today'] ? $txt['calendar47b'] : $txt['calendar47'], '</td>
	</tr><tr>
		<td class="windowbg" width="20" valign="middle" align="center">
			<a href="', $scripturl, '?action=calendar">
				<img src="', $settings['images_url'], '/icons/calendar.gif" border="0" width="20" alt="', $txt['calendar24'], '" /></a>
		</td>
		<td class="windowbg2" width="100%">
			<span class="smalltext">';
        // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
        if (!empty($context['calendar_holidays'])) {
            echo '
				<span style="color: #', $modSettings['cal_holidaycolor'], ';">', $txt['calendar5'], ' ', implode(', ', $context['calendar_holidays']), '</span><br />';
        }
        // People's birthdays.  Like mine.  And yours, I guess.  Kidding.
        if (!empty($context['calendar_birthdays'])) {
            echo '
				<span style="color: #', $modSettings['cal_bdaycolor'], ';">', $context['calendar_only_today'] ? $txt['calendar3'] : $txt['calendar3b'], '</span> ';
            /* Each member in calendar_birthdays has:
            			id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */
            foreach ($context['calendar_birthdays'] as $member) {
                echo '
				<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<b>' : '', $member['name'], $member['is_today'] ? '</b>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', ';
            }
        }
        // Events like community get-togethers.
        if (!empty($context['calendar_events'])) {
            echo '
				<span style="color: #', $modSettings['cal_eventcolor'], ';">', $context['calendar_only_today'] ? $txt['calendar4'] : $txt['calendar4b'], '</span> ';
            /* Each event in calendar_events should have:
            			title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
            foreach ($context['calendar_events'] as $event) {
                echo '
				', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<b>' . $event['title'] . '</b>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', ';
            }
            // Show a little help text to help them along ;).
            if ($context['calendar_can_edit']) {
                echo '
				(<a href="', $scripturl, '?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">', $txt['calendar_how_edit'], '</a>)';
            }
        }
        echo '
			</span>
		</td>
	</tr>';
    }
    // Show a member bar.  Not heavily ornate, but functional at least.
    if ($settings['show_member_bar']) {
        echo '
	<tr>
		<td class="catbg" colspan="2">', $txt[331], '</td>
	</tr>
	<tr>
		<td class="windowbg" width="20" valign="middle" align="center">
			', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' : '', '<img src="', $settings['images_url'], '/icons/members.gif" border="0" width="20" alt="', $txt[332], '" />', $context['show_member_list'] ? '</a>' : '', '
		</td>
		<td class="windowbg2" width="100%">
			<b>', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' . $txt[332] . '</a>' : $txt[332], '</b><br />
			<span class="smalltext">', $txt[200], '</span>
		</td>
	</tr>';
    }
    // Show YaBB SP1 style information...
    if ($settings['show_sp1_info']) {
        echo '
	<tr>
		<td class="catbg" colspan="2">', $txt[645], '</td>
	</tr>
	<tr>
		<td class="windowbg" width="20" valign="middle" align="center">
			<a href="', $scripturl, '?action=stats">
				<img src="', $settings['images_url'], '/icons/info.gif" alt="', $txt[645], '" border="0" /></a>
		</td>
		<td class="windowbg2" width="100%">
			<table border="0" width="90%"><tr>
				<td class="smalltext">
					', $txt[490], ': <b>', $context['common_stats']['total_topics'], '</b> &nbsp;&nbsp;&nbsp;&nbsp; ', $txt[489], ': <b>', $context['common_stats']['total_posts'], '</b><br />
					', !empty($context['latest_post']) ? $txt[659] . ':
					&quot;' . $context['latest_post']['link'] . '&quot;  (' . $context['latest_post']['time'] . ')<br />' : '', '
					<a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />
					<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
				</td>
				<td class="smalltext">
					', $txt[488], ': <b>', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' . $context['common_stats']['total_members'] . '</a>' : $context['common_stats']['total_members'], '</b><br />
					', $txt[656], ': <b>', $context['common_stats']['latest_member']['link'], '</b><br />';
        // If they are logged in, show their unread message count, etc..
        if ($context['user']['is_logged'] && $context['allow_pm']) {
            echo '
					', $txt['smf199'], ': <b><a href="', $scripturl, '?action=pm">', $context['user']['messages'], '</a></b> ', $txt['newmessages3'], ': <b><a href="', $scripturl, '?action=pm">', $context['user']['unread_messages'], '</a></b>';
        }
        echo '
				</td>
			</tr></table>
		</td>
	</tr>';
    }
    // "Users online" - in order of activity.
    echo '
	<tr>
		<td class="catbg" colspan="2">', $txt[158], '</td>
	</tr><tr>
		<td class="windowbg" width="20" valign="middle" align="center">
			', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt[158], '" border="0" />', $context['show_who'] ? '</a>' : '', '
		</td>
		<td class="windowbg2" width="100%">';
    if ($context['show_who']) {
        echo '
			<a href="', $scripturl, '?action=who">';
    }
    echo $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];
    // Handle hidden users and buddies.
    if (!empty($context['num_users_hidden']) || $context['show_buddies'] && !empty($context['show_buddies'])) {
        echo ' (';
        // Show the number of buddies online?
        if ($context['show_buddies']) {
            echo $context['num_buddies'], ' ', $context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies'];
        }
        // How about hidden users?
        if (!empty($context['num_users_hidden'])) {
            echo $context['show_buddies'] ? ', ' : '', $context['num_users_hidden'] . ' ' . $txt['hidden'];
        }
        echo ')';
    }
    if ($context['show_who']) {
        echo '</a>';
    }
    echo '
			<span class="smalltext">';
    // Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
    if (!empty($context['users_online'])) {
        echo '
				', $txt[140], ':<br />', implode(', ', $context['list_users_online']);
    }
    echo '
				<br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
				<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
			</span>
		</td>
	</tr>';
    // If they are logged in, but SP1 style information is off... show a personal message bar.
    if ($context['user']['is_logged'] && !$settings['show_sp1_info']) {
        echo '
	<tr>
		<td class="catbg" colspan="2">', $txt[159], '</td>
	</tr><tr>
		<td class="windowbg" width="20" valign="middle" align="center">
			', $context['allow_pm'] ? '<a href="' . $scripturl . '?action=pm">' : '', '<img src="', $settings['images_url'], '/message_sm.gif" alt="', $txt[159], '" border="0" />', $context['allow_pm'] ? '</a>' : '', '
		</td>
		<td class="windowbg2" valign="top">
			<b><a href="', $scripturl, '?action=pm">', $txt[159], '</a></b><br />
			<span class="smalltext">
				', $txt[660], ' ', $context['user']['messages'], ' ', $context['user']['messages'] == 1 ? $txt[471] : $txt[153], '.... ', $txt[661], $context['allow_pm'] ? ' <a href="' . $scripturl . '?action=pm">' . $txt[662] . '</a>' : '', ' ', $txt[663], '
			</span>
		</td>
	</tr>';
    }
    // Show the login bar. (it's only true if they are logged out anyway.)
    if ($context['show_login_bar']) {
        echo '
	<tr>
		<td class="catbg" colspan="2">
			', $txt[34], ' <a href="', $scripturl, '?action=reminder" class="smalltext">(' . $txt[315] . ')</a>
		</td>
	</tr>
	<tr>
		<td class="windowbg" width="20" align="center">
			<a href="', $scripturl, '?action=login">
				<img src="', $settings['images_url'], '/icons/login.gif" alt="', $txt[34], '" border="0" /></a>
		</td>
		<td class="windowbg2" valign="middle">
			<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
				<table border="0" cellpadding="2" cellspacing="0" align="center" width="100%"><tr>
					<td valign="middle" align="left">
						<label for="user"><b>', $txt[35], ':</b><br /><input type="text" name="user" id="user" size="15" /></label>
					</td>
					<td valign="middle" align="left">
						<label for="passwrd"><b>', $txt[36], ':</b><br /><input type="password" name="passwrd" id="passwrd" size="15" /></label>
					</td>
					<td valign="middle" align="left">
						<label for="cookielength"><b>', $txt[497], ':</b><br /><input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '" /></label>
					</td>
					<td valign="middle" align="left">
						<label for="cookieneverexp"><b>', $txt[508], ':</b><br /><input type="checkbox" name="cookieneverexp" id="cookieneverexp" checked="checked" class="check" /></label>
					</td>
					<td valign="middle" align="left">
						<input type="submit" value="', $txt[34], '" />
					</td>
				</tr></table>
			</form>
		</td>
	</tr>';
    }
    echo '
</table>';
}
Ejemplo n.º 29
0
/**
 * Used to display items below the page, like page navigation
 */
function template_pages_and_buttons_below()
{
    global $context, $txt;
    // Show the page index... "Pages: [1]".
    template_pagesection('normal_buttons', 'right');
    // Show the lower breadcrumbs.
    theme_linktree();
    if (can_see_button_strip($context['mod_buttons'])) {
        echo '
			<i class="fa fa-2x fa-bars hamburger_30" data-id="moderationbuttons"></i>';
    }
    echo '
			<div id="moderationbuttons" class="hide_30 hamburger_30_target">', template_button_strip($context['mod_buttons'], 'bottom', array('id' => 'moderationbuttons_strip')), '</div>';
    // Show the jump-to box, or actually...let Javascript do it.
    echo '
			<div id="display_jump_to">&nbsp;</div>
			<script><!-- // --><![CDATA[
				aJumpTo[aJumpTo.length] = new JumpTo({
					sContainerId: "display_jump_to",
					sJumpToTemplate: "<label class=\\"smalltext\\" for=\\"%select_id%\\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
					iCurBoardId: ', $context['current_board'], ',
					iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
					sCurBoardName: "', $context['jump_to']['board_name'], '",
					sBoardChildLevelIndicator: "&#8195;",
					sBoardPrefix: "', isBrowser('ie8') ? '&#187; ' : '&#10148; ', '",
					sCatClass: "jump_to_header",
					sCatPrefix: "",
					sGoButtonLabel: "', $txt['go'], '"
				});
			// ]]></script>';
    // Tooltips for likes
    echo '
			<script><!-- // --><![CDATA[
				$(".like_button, .unlike_button, .likes_button").SiteTooltip({hoverIntent: {sensitivity: 10, interval: 150, timeout: 50}});
			// ]]></script>';
}
Ejemplo n.º 30
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>';
}