All pastes #2052423 Raw Edit

Someone

public text v1 · immutable
#2052423 ·published 2011-05-01 03:59 UTC
rendered paste body
<?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>' : '';

	///START rateTopic code
		echo '
			<script type="text/javascript">
				 var rateTopicloader = "'.$settings['default_theme_url'].'/ratetopic/";
			</script>
			<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/ratetopic/ratetopicstyle.css" />
			<script type="text/javascript" src="'.$settings['default_theme_url'].'/ratetopic/wz_tooltip/wz_tooltip.js"></script>
			<script type="text/javascript" src="'.$settings['default_theme_url'].'/ratetopic/ratetopic.js"></script>
			';
	//END rateTopic code

	// Is this topic also a poll?
	if ($context['is_poll'])
	{
		echo '<div class="w735px centre">
		<form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '" style="padding-bottom: 5px;">
	<div class="catbg"><div class="catbg_l">', $txt['smf43'], '', $context['poll']['is_locked'] ? ' (Locked)' : '','</div><div class="catbg_r_icon">&nbsp;</div></div>
	<table width="735px" class="table" cellpadding="1" cellspacing="1">
	<tr>
		<td width="5%" valign="top" class="windowbg" style="font-size:10pt;" rowspan="2"><b>', $txt['smf21'], ':</b></td>
		<td class="windowbg" style="font-size:12px;">
			', $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'], ')';
					echo'</td></tr>';

		// Are they not allowed to vote but allowed to view the options?
		if ($context['poll']['show_results'] || !$context['allow_vote'])
		{
			echo '
			<tr class="windowbg2"><td><table cellpadding="1" cellspacing="1">';

				// Show each option with its corresponding percentage bar.
			foreach ($context['poll']['options'] as $option){
				echo '
							<tr>
								<td style="font-size:12px; 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><br />';
			// 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>] ';

			// 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>] ';

			// 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>] ';

			// 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>] ', $context['allow_poll_view'] ? ' - <b>' . $txt['smf24'] . ': ' . $context['poll']['total_votes'] . '</b>' : '', '';
		}
		// They are allowed to vote! Go to it!
		else
		{
			echo '
			<tr class="windowbg2"><td>';

			// Show a warning if they are allowed more than one option.
			if ($context['poll']['allowed_warning'])
				echo '
							', $context['poll']['allowed_warning'], '';
			echo'<table cellpadding="1" cellspacing="1">';
			// Show each option with its button - a radio likely.
			foreach ($context['poll']['options'] as $option)
				echo '
			<tr><td>', $option['vote_button'], '</td><td>', $option['option'], '</td></tr>';

			echo '</table><br />
			<input type="submit" class="oinput" value="', $txt['smf23'], '" /> '; 
			// 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>] ';

			// 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>] ';

			// 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></table>',theme_windowfoot(),'';
		echo '<input type="hidden" name="sc" value="', $context['session_id'], '" /></form></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 in_edit_mode == 1 ? modify_save(\'' . $context['session_id'] . '\') : confirm(\'' . $txt['quickmod_confirm'] . '\');">';
	
	echo '<div class="catbg"><div class="catbg_l">',$context['subject'],'</div><div class="catbg_r_icon">&nbsp;</div></div>';



	/*// Does this topic have some events linked to it?
	if (!empty($context['linked_calendar_events']))
	{
		echo '
		<tr>
				<td class="catbg" valign="middle" align="left" style="padding-left: 6px;">
						', $txt['calendar_linked_events'], '
				</td>
		</tr>
		<tr>
				<td width="5%" valign="top" class="windowbg">
						<ul>';
		foreach ($context['linked_calendar_events'] as $event)
			echo '
								<li>
									', ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: red;">*</a> ' : ''), '<b>', $event['title'], '</b>: ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
								</li>';
		echo '
						</ul>
				</td>
		</tr>';
	}
*/
	// Show the page index... "Pages: [1]".
	echo '
	<div class="content tright nbord_b">
		<div style="float: left;">
		', $txt[139], ': ', $context['page_index'], '</div>';
			$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['images_url'] . '/' . $context['user']['language'] . '/reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</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'] . ';sesc=' . $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['images_url'] . '/' . $context['user']['language'] . '/notify.gif" alt="' . $txt[131] . '" border="0" />' : $txt[131]) . '</a>';

	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'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/markunread.gif" alt="' . $txt['mark_unread'] . '" border="0" />' : $txt['mark_unread']) . '</a>';
		
	echo implode($context['menu_separator'], $buttonArray);
	if(!empty($modSettings['topbottomEnable'])){echo'<a href="#lastPost"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_down.gif" alt="' . $txt['topbottom5'] . '" border="0" /></a>';}
echo '
	</div>';



	// These are some cache image buttons we may want.
	$reply_button = create_button('quote.gif', 145, 'smf240', 'align="middle"');
	$modify_button = create_button('modify.gif', 66, 17, 'align="middle"');
	$remove_button = create_button('delete.gif', 121, 31, 'align="middle"');
	$split_button = create_button('split.gif', 'smf251', 'smf251', 'align="middle"');

// Time to display all the posts
	echo'<table class="table" cellpadding="1" cellspacing="1" width="100%">';
	// Get all the messages...
	while ($message = $context['get_message']())
	{
	
echo'<tr class="catbg_row"><td style="overflow: hidden;"><b><a href="' . $scripturl . '?action=profile;u=' . $message['member']['id'] . '"';
 if (!$message['member']['is_guest']){ echo'title="', $message['member']['username'], '';}
echo'">';

if (file_exists( $_SERVER{'DOCUMENT_ROOT'} . "/userimg/" . $message['member']['id'] . ".jpg"))
{

	echo '<img src="./userimg/' . $message['member']['id'] . '.jpg' . '" alt="' . $message['member']['name'] . '" />';}
else
	{echo $message['member']['name'];}

echo'</a></b></td>
<td align="right"><span style="float: left;" class="middletext">',$message['time'],'</span>';
		// 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;"><img src="',$settings['images_url'] . '/' . $context['user']['language'] . '/quote_b.gif" alt="Reply" /></a>';

		// So... quick reply is off, but they *can* reply?
		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'], '"><img src="',$settings['images_url'] . '/' . $context['user']['language'] . '/quote_b.gif" alt="Reply" /></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'], '"><img src="',$settings['images_url'] . '/' . $context['user']['language'] . '/modify_b.gif" alt="Edit" /></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], '?\');"><img src="',$settings['images_url'] . '/' . $context['user']['language'] . '/delete_b.gif" alt="Del" /></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'], '"><img src="',$settings['images_url'] . '/' . $context['user']['language'] . '/split_b.gif" alt="Split" /></a>';
					
		//Can they report the post?
		if ($context['can_report_moderator'])
			echo ' <a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '"><img src="',$settings['images_url'] . '/' . $context['user']['language'] . '/report_b.gif" alt="Report" /></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" ', empty($settings['use_tabs']) ? 'onclick="document.getElementById(\'quickmodSubmit\').style.display = \'\';"' : '', ' />';
echo'</td></tr>';
		echo '<tr class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', '"><td width="17%" valign="top">';

		// 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 '
				<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
					<tr>
						<td valign="top" style="overflow: hidden; font-size:10pt;">
							<div class="smalltext">';
 // Show avatars, images, etc.?
 if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])){
				echo '
								<div style="width: 100%;"><a href="index.php?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a></div>';}

echo'<br />';
		// 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 />';

			//START rateTopic code
			if($message['Rate_User']){
				echo '<span class="rate_show_user" title="'.$context['topic_rate'][$message['Rate_User']['id_image']]['title'].'"><img src="'.$settings['images_url'], '/post/'.$context['topic_rate'][$message['Rate_User']['id_image']]['image'].'.gif" alt="'.$context['topic_rate'][$message['Rate_User']['id_image']]['title'].'" height="16" width="16" onclick="Tip(getUserRate(\'', $message['member']['id'], '\'))"/></span><br />';
			}
			//END Rate Topic Code
			
			// Is this user allowed to modify this member's karma?
			if ($message['member']['karma']['allow']){
if(($message['member']['name']) == 'ANDMILLIONAIRE'){
echo'<a href="javascript:cornify();">[WINNER]</a>';}
else{
				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>';}
echo'
								<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" 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>' : '', '<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], ': <a href="http://www.yourewinner.com/index.php?action=profile;u=', $message['member']['id'], ';sa=showPosts">', $message['member']['posts'], '</a><br />
								<br />';

			// Show their personal text?
			if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
				echo '
								', $message['member']['blurb'], '';
		}

		// Done with the information about the poster... on to the post itself.
		echo '
							</div>
						</td></tr></table></td>
						
						<td valign="top" width="83%" height="100%" style="font-size:10pt;">
						<table width="100%" border="0" style="table-layout:fixed;"><tr><td>
							<table width="100%" border="0"><tr>
								<td valign="middle"><div id="subject_', $message['id'], '" class="middletext"><a href="', $message['href'], '"><img src="', $message['icon_url'] . '" alt="" border="0" /></a>
										<b><a href="', $message['href'], '">', $message['subject'], '</a></b></div>';


		// Show the post itself, finally!
		echo '
								</td>
							</tr></table></td></tr>
							<tr><td>
							<hr width="100%" size="1" class="hrcolor" />
<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>',$message['body'],'';

echo '</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'] . '\')" />' : '' , '';

		// Now for the attachments, signature, ip logged, etc...
		echo '</td></tr><tr>
								<td class="smalltext" width="100%">';

		// Assuming there are attachments...
		if (!empty($message['attachment']))
		{
			echo '
									<hr width="100%" size="1" class="hrcolor" />
									<div style="overflow: auto; width: 100%;">';
			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 '
									</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; <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> &#187;';
				//START Rate Topic
		echo '
			<div class="rate_it">';

		if((!$context['user']['is_guest']) && ($message['member']['id'] != $context['user']['id'])){
			echo '
				<div class="rate_bar" id="rb_'.$message['id'].'">';
				
			
				foreach($context['topic_rate'] as $rateId => $rateInfo)
				{		
					echo '
					<div class="rate_button" style="background-image: url('.$settings['images_url'], '/post/'.$rateInfo['image'].'.gif );"><a href="#" onmouseout="RateHover( false, \''.$message['id'].'\', \'\' );" onmouseover="RateHover( true, \''.$message['id'].'\', \''.$rateInfo['title'].'\' );" onclick="return sendRate( \''.$rateId.'\', \''.$message['id'].'\', \''.$context['session_id'].'\' );" class="rate_button">
					<img title="'.$rateInfo['title'].'" src="'.$settings['default_theme_url'].'/ratetopic/blank.gif" alt="'.$rateInfo['title'].'" class="rate_button" height="16" width="16" /></a></div>
					';
				}
	
			echo '<div class="rate_text" id="rbt_'.$message['id'].'"></div>
				</div>
				';
			
		}
		
		echo '<div class="rate_text_line" id="rlt_'.$message['id'].'">
		';
			foreach($message['Rate_Topic'] as $row){
				echo $row['totals'].'x<span class="rate_show" style="'.($context['browser']['is_ie']?'':'padding-top: 4px; ').'background-image: url('.$settings['images_url'], '/post/'.$context['topic_rate'][$row['id_image']]['image'].'.gif );" title="'.$context['topic_rate'][$row['id_image']]['title'].'">
				<img src="'.$settings['default_theme_url'].'/ratetopic/blank.gif" alt="'.$context['topic_rate'][$row['id_image']]['title'].'" height="16" width="16" /></span> ';
			}
		echo '</div></div><br/><br/>
			';
			
		//END Rate Topic
		echo '
								</td>
							</tr>';


		
		// Show the member's signature?
		if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
			echo '<tr><td><hr width="100%" size="1" class="hrcolor" />
							<div class="signature">', $message['member']['signature'], '</div></td></tr>';

		echo '</table></td></tr>';
	echo'<tr class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', '"><td class="smalltext">';
			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'</td><td align="right"><div style="float:left;">';
					// Don't show these things for guests.
		if (!$message['member']['is_guest'])
		{
			// This shows the popular messaging icons.
			echo '
								', $message['member']['icq']['link'], '
								', $message['member']['msn']['link'], '
								', $message['member']['aim']['link'], '
								', $message['member']['yim']['link'], '';

			// 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>';
			}
		}
		// Otherwise, show the guest's email.
		elseif (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>';
			echo'</div><a href="#top"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_up.gif" alt="' . $txt['topbottom4'] . '" border="0" /></a>';
								echo'</td></tr>';
	}
	echo'</table>';
	echo '<div class="catbg_m noind tright">';
if (!empty($settings['display_who_viewing']))
	{	echo'<div style="float: left;" class="smalltext tleft">';
		// 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'], '';
		echo'</div>';
	}
	if(($context['can_moderate_forum']))
	echo theme_show_mod_buttons();
	echo'</div>';
	// As before, build the custom button right.
	if ($context['can_add_poll'])
		$normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
	elseif ($context['user']['is_logged'] && $settings['show_mark_read'])
		$normal_buttons['custom'] = array('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'] . ';sesc=' . $context['session_id']);

	echo '
	<div class="content tright"><a name="lastPost"></a>
		<div style="float: left;">
		', $txt[139], ': ', $context['page_index'],'</div>';
			$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['images_url'] . '/' . $context['user']['language'] . '/reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</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'] . ';sesc=' . $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['images_url'] . '/' . $context['user']['language'] . '/notify.gif" alt="' . $txt[131] . '" border="0" />' : $txt[131]) . '</a>';

	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'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/markunread.gif" alt="' . $txt['mark_unread'] . '" border="0" />' : $txt['mark_unread']) . '</a>';


	echo implode($context['menu_separator'], $buttonArray);
	if(!empty($modSettings['topbottomEnable'])){echo'<a href="#top"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_up.gif" alt="' . $txt['topbottom4'] . '" border="0" /></a>';}
echo '
	</div>',theme_windowfoot(),'';

	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>';

	if ($context['show_spellchecking'])
		echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/spellcheck.js"></script>';

	if (empty($settings['use_tabs']))
		echo '
	<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
		document.getElementById("quickmodSubmit").style.display = "none";
	// ]]></script>';
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', ';

	if (window.XMLHttpRequest)
		showModifyButtons();
// ]]></script>';
	echo '<br />';

	if ($context['can_reply'] && !empty($options['display_quick_reply']))
	{
		echo '
<a name="quickreply"></a>
<form action="', $scripturl, '?action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
<div class="centre w735px"><div class="catbg"><div class="catbg_l"><a href="javascript:swapQuickReply();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" /> ', $txt['quick_reply_1'], '</a></div><div class="catbg_r">&nbsp;</div></div>
	<table class="table" cellpadding="1" cellspacing="1" width="100%" id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '><tr class="windowbg"><td align="center">
				<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'], '" />';

if(($context['is_locked'])){echo'<span class="error">' . $txt['quick_reply_warning'] . '</span><br />';}
echo'

				<textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea><br />';
if(($context['can_lock'])){
echo'<input type="hidden" name="lock" value="0" /><label for="check_lock"><input type="checkbox" name="lock" id="check_lock"' . ($context['is_locked'] ? ' checked="checked"' : '') . ' value="1" class="check" />',$txt['quickpost_lock'],'</label>';}

if(($context['can_sticky'])){echo' <input type="hidden" name="sticky" value="0" /><label for="check_sticky"><input type="checkbox" name="sticky" id="check_sticky"' . ($context['is_sticky'] ? ' checked="checked"' : '') . ' value="1" class="check" />',$txt['quickpost_sticky'],'</label>';}

echo'

			  <input type="hidden" name="sc" value="' . $context['session_id'] . '" />
				<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />';
echo'			</td></tr><tr class="headbg"><td align="center"><input class="oinput" type="submit" name="post" value="' . $txt[105] . '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
				<input class="oinput" type="submit" name="preview" value="' . $txt[507] . '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" />';
		if ($context['show_spellchecking'])
			echo '
				<input type="button" class="oinput"value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="5"/>';
echo'</td></tr></table>',theme_windowfoot(),'</div></form>';
	}
//Jumpbox
echo'
	<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" style="padding:0; margin: 0;">
	<table width="100%"><tr><td align="right">
		<span class="smalltext">' . $txt[160] . ':</span>
		<select class="winput" 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;" class="oinput" />
		</td></tr></table>
	</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[] = '<a href="' . $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_move.gif" alt="' . $txt[132] . '" border="0" />' : $txt[132]) . '</a>';
	if ($context['can_delete'])
		$moderationButtons[] = '<a href="' . $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt[162] . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_rem.gif" alt="' . $txt[63] . '" border="0" />' : $txt[63]) . '</a>';
	if ($context['can_lock'])
		$moderationButtons[] = '<a href="' . $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_lock.gif" alt="' . (empty($context['is_locked']) ? $txt['smf279'] : $txt['smf280']) . '" border="0" />' : (empty($context['is_locked']) ? $txt['smf279'] : $txt['smf280'])) . '</a>';
	if ($context['can_sticky'])
		$moderationButtons[] = '<a href="' . $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_sticky.gif" alt="' . (empty($context['is_sticky']) ? $txt['smf277'] : $txt['smf278']) . '" border="0" />' : (empty($context['is_sticky']) ? $txt['smf277'] : $txt['smf278'])) . '</a>';
	if ($context['can_merge'])
		$moderationButtons[] = '<a href="' . $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic'] . '" >' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/merge.gif" alt="' . $txt['smf252'] . '" border="0" />' : $txt['smf252']) . '</a>';
	if ($context['can_remove_poll'])
		$moderationButtons[] = '<a href="' . $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . '" onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_remove_poll.gif" alt="' . $txt['poll_remove'] . '" border="0" />' : $txt['poll_remove']) . '</a>';

	if ($context['calendar_post'])
		$moderationButtons[] = '<a href="' . $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/linktocal.gif" alt="' . $txt['calendar37'] . '" border="0" />' : $txt['calendar37']) . '</a>';

	if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
		$moderationButtons[] = $settings['use_image_buttons'] ? '<input type="image" style="vertical-align: middle;" name="submit" id="quickmodSubmit" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete_selected.gif" alt="' . $txt['quickmod_delete_selected'] . '" />' : '<a href="javascript:document.forms.quickModForm.submit();" id="quickmodSubmit">' . $txt['quickmod_delete_selected'] . '</a>';
	return implode($context['menu_separator'], $moderationButtons);

}

?>