<?php
// Version: 1.1; Display
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
echo theme_linktree();
// Is this topic also a poll?
if ($context['is_poll'])
{
echo '
<h3><img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['smf43'], '</h3>
<p>
<strong>', $txt['smf21'], ':</strong> ', $context['poll']['question'];
if (!empty($context['poll']['expire_time']))
echo '(', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ': ', $context['poll']['expire_time'], ')';
echo '
</p>';
// Are they not allowed to vote but allowed to view the options?
if ($context['poll']['show_results'] || !$context['allow_vote'])
{
echo '
<div style="float: right; width: 25%; text-align: left;">';
// If they are allowed to revote - show them a link!
if ($context['allow_change_vote'])
echo '
<p style="margin: 0;"><a href="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], ';sesc=', $context['session_id'], '">', $txt['poll_change_vote'], '</a></p>';
// If we're viewing the results... maybe we want to go back and vote?
if ($context['poll']['show_results'] && $context['allow_vote'])
echo '
<p style="margin: 0;"><a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], '">', $txt['poll_return_vote'], '</a></p>';
// If they're allowed to lock the poll, show a link!
if ($context['poll']['lock'])
echo '
<p style="margin: 0;"><a href="', $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b'], '</a></p>';
// If they're allowed to edit the poll... guess what... show a link!
if ($context['poll']['edit'])
echo '
<p style="margin: 0;"><a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>';
echo '
</div>';
echo '
<table width="15%" 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>
<div style="clear: both;"></div>';
// If they're allowed to view the results of the poll, show the total vote count!
if ($context['allow_poll_view'])
echo '
<p><strong>' . $txt['smf24'] . ':</strong> ' . $context['poll']['total_votes'] . '</p>';
}
// They are allowed to vote! Go to it!
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;">';
// Show a warning if they are allowed more than one option.
if ($context['poll']['allowed_warning'])
echo '
<p>', $context['poll']['allowed_warning'], '</p>';
echo '
<div style="float: right; width: 46%; margin: 0 10px;">';
// Allowed to view the results? (without voting!)
if ($context['allow_poll_view'])
echo '
<p style="margin: 0;"><a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], ';viewResults">', $txt['smf29'], '</a>';
// Show a link for locking the poll as well...
if ($context['poll']['lock'])
echo '
<p style="margin: 0;"><a href="', $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', (!$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b']), '</a>';
// Want to edit it? Click right here......
if ($context['poll']['edit'])
echo '
<p style="margin: 0;"><a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>';
echo '
</div>
<div style="float: right; margin: 0 10px;">';
// Show each option with its button - a radio likely.
foreach ($context['poll']['options'] as $option)
echo '
', $option['vote_button'], ' ', $option['option'], ' ';
echo '
<p style="margin-top: 8px;"><input type="submit" value="', $txt['smf23'], '" /></p>
</div>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>
<div style="clear: both;"></div>';
}
}
// Does this topic have some events linked to it?
if (!empty($context['linked_calendar_events']))
{
echo '
<h3>', $txt['calendar_linked_events'], '</h3>
<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>';
}
// This is the button array for reply, send-topic, etc, here you can easily add and remove new buttons
if ($context['can_reply'])
$buttonArray[] = '<li class="reply"><a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'] . '">' . $txt[146] . '</a></li>';
if ($context['can_mark_notify'])
$buttonArray[] = '<li class="notify"><a href="' . $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '" onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');">' . $txt[131] . '</a></li>';
// 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[] = '<li class="markread"><a href="' . $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . $txt['mark_unread'] . '</a></li>';
elseif ($context['can_add_poll'])
$buttonArray[] = '<li class="newpoll"><a href="' . $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . $txt['add_poll'] . '</a></li>';
if ($context['can_send_topic'])
$buttonArray[] = '<li class="sendtopic"><a href="' . $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0">' . $txt[707] . '</a></li>';
$buttonArray[] = '<li class="print"><a href="' . $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0" target="_blank">' . $txt[465] . '</a></li>';
// Show the page index... "Pages: [1]".
echo '
<div class="pages">
', $txt[139], ': ', $context['page_index'], '
</div>
<ul class="msgmenu">
', implode($buttonArray), '
</ul>
<div class="alt"></div>';
// Show the topic information - icon, subject, etc.
echo '
<h3 id="top_subject"><img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" /> ', $context['subject'], '</h3>';
if (!empty($settings['display_who_viewing']))
{
echo '
<div id="whviewingdp">';
// Show just numbers...?
if ($settings['display_who_viewing'] == 1)
echo '
', count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19];
// Or show the actual people viewing the topic?
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'], '
</div>';
}
echo '
<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return in_edit_mode == 1 ? modify_save(\'' . $context['session_id'] . '\') : confirm(\'' . $txt['quickmod_confirm'] . '\');">';
// Time to display all the posts
echo '
<div class="dispmsg">';
// Get all the messages...
while ($message = $context['get_message']())
{
echo '
<div class="msgbody2 ', $message['alternate'] == 0 ? 'msgbg1' : 'msgbg2', '">';
// 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>' : '';
// Show information about the poster of this message.
echo '
<div class="msgleft">
<ul>
<li class="mname"><strong>', $message['member']['link'], '</strong></li>';
// 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 class="stars">', $message['member']['group_stars'], '</li>';
// Is karma display enabled? Total or +/-?
if ($modSettings['karmaMode'] == '1')
echo '
<li>', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';
elseif ($modSettings['karmaMode'] == '2')
echo '
<li>', $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'], ';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></li>';
// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
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'] ? ' ' . $message['member']['online']['text'] . '' : '', '</li>';
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
<li>', $txt[231], ': ', $message['member']['gender']['image'], '</li>';
// Show how many posts they have made.
echo '
<li class="posts">', $txt[26], ': ', $message['member']['posts'], '</li>';
// Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<li class="avatar">', $message['member']['avatar']['image'], '</li>';
// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';
// This shows the popular messaging icons.
echo '
<li>', $message['member']['icq']['link'], ' ', $message['member']['msn']['link'], ' ', $message['member']['aim']['link'], ' ', $message['member']['yim']['link'], '</li>';
// Show the profile, website, email address, and personal message buttons.
if ($settings['show_profile_buttons'])
{
echo '
<li>';
// 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>';
echo '</li>';
}
}
// Otherwise, show the guest's email.
elseif (empty($message['member']['hide_email']))
echo '
<li><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></li>';
// Done with the information about the poster... on to the post itself.
echo '
</ul>
</div>';
echo '
<div class="msgright">
<div class="msgtop">';
echo '
<ul class="postbuttons">';
// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<li><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;">' . $txt['smf240'] . '</a></li>';
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '">' . $txt['smf240'] . '</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'], ';sesc=', $context['session_id'], '">' . $txt[17] . '</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'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">' . $txt[31] . '</a></li>';
// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
<li style="margin: 0; padding: 0 0 0 10px; border: 0;"><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">' . $txt[smf251] . '</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="margin: 0; padding: 0 0 0 10px; border: 0;"><input type="checkbox" name="msgs[]" value="', $message['id'], '" class="check" ', empty($settings['use_tabs']) ? 'onclick="document.getElementById(\'quickmodSubmit\').style.display = \'\';"' : '', ' /></li>';
echo '
</ul>
<a href="', $message['href'], '"><img class="pstopicon" src="', $message['icon_url'] . '" alt="" border="0" /></a><span id="subject_', $message['id'], '"><a href="', $message['href'], '">', $message['subject'], '</a></span>';
// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
echo '
<span class="postid"><br />« <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' »</span>';
// Show the post itself, finally!
echo '
</div>
<div class="message">
<hr width="100%" size="1" class="msghr" />
<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; display: none;" onclick="modify_msg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '' , '
</div>';
// Now for the attachments, signature, ip logged, etc...
echo '
<div class="msgbottom">';
// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="attachment">';
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" />' . $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 '
</div>';
}
echo '
<div 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 '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';
echo '
</div>
<div class="report 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> ';
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>';
// Or, should we show it because this is you?
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>';
// Okay, are you at least logged in? Then we can show something about why IPs are logged...
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>';
// Otherwise, you see NOTHING!
else
echo '
', $txt[511];
echo '
</div>';
// 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 '
</div>
</div>
</div>
<div style="clear: both;"></div>';
}
echo '
</div>
<a name="lastPost"></a>';
// Show the page index... "Pages: [1]".
echo '
<div class="pages">
', $txt[139], ': ', $context['page_index'], '
</div>
<ul class="msgmenu">
', implode($buttonArray), '
</ul>
<div class="alt"></div>';
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" />', $context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" onclick="spellCheck(\\\'quickModForm\\\', \\\'message\\\');" />' : '', '<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 = \'<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" /> %subject%\';
if (window.XMLHttpRequest)
showModifyButtons();
// ]]></script>';
echo theme_linktree();
echo '
<ul class="modbuttons">
', theme_show_mod_buttons(), '
</ul>';
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'], '" />';
if (empty($settings['use_tabs']))
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
document.getElementById("quickmodSubmit").style.display = "none";
// ]]></script>';
echo '
</form>';
echo '
<div id="msgjmp">
<form action="', $scripturl, '" method="get" style="padding:0; margin: 0;">
<span class="smalltext">' . $txt[160] . ':</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 && 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>
<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>
</div>
<div class="alt"></div>';
if ($context['can_reply'] && !empty($options['display_quick_reply']))
{
echo '
<a name="quickreply"></a>
<h3><a href="javascript:swapQuickReply();"><img align="right" src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" /></a> <a href="javascript:swapQuickReply();">', $txt['quick_reply_1'], '</a></h3>
<div id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
<p>', $txt['quick_reply_2'], $context['is_locked'] ? '<br /><br /><b>' . $txt['quick_reply_warning'] . '</b>' : '', '</p>
<form action="', $scripturl, '?action=post2" method="post" 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="' . $txt['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] . '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
<input type="submit" name="preview" value="' . $txt[507] . '" onclick="return submitThisOnce(this);" 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>
</div>
<div class="alt" style="padding-bottom: 10px;"></div>';
if ($context['show_spellchecking'])
echo '
<form name="spell_form" id="spell_form" method="post" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value="" /></form>';
}
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>';
}
function theme_show_mod_buttons()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
$moderationButtons = array();
if ($context['can_move'])
$moderationButtons[] = '<li style="padding-left: 0; border: 0;"><a href="' . $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0">' . $txt[132] . '</a></li>';
if ($context['can_delete'])
$moderationButtons[] = '<li><a href="' . $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt[162] . '\');">' . $txt[63] . '</a></li>';
if ($context['can_lock'])
$moderationButtons[] = '<li><a href="' . $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . (empty($context['is_locked']) ? $txt['smf279'] : $txt['smf280']) . '</a></li>';
if ($context['can_sticky'])
$moderationButtons[] = '<li><a href="' . $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . (empty($context['is_sticky']) ? $txt['smf277'] : $txt['smf278']) . '</a></li>';
if ($context['can_merge'])
$moderationButtons[] = '<li><a href="' . $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic'] . '">' . $txt['smf252'] . '</a></li>';
if ($context['can_remove_poll'])
$moderationButtons[] = '<li><a href="' . $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . '" onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');">' . $txt['poll_remove'] . '</a></li>';
if ($context['calendar_post'])
$moderationButtons[] = '<li><a href="' . $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id'] . '">' . $txt['calendar37'] . '</a></li>';
if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
$moderationButtons[] = '<li style="border: 0px;"><a href="javascript

ocument.forms.quickModForm.submit();" id="quickmodSubmit">' . $txt['quickmod_delete_selected'] . '</a></li>';
return implode($context['menu_separator'], $moderationButtons);
}
?>