Example #1
0
    /**
     * used in the modcente/watched_users template as a list callback
     * function
     */
    public function user_watch_post_callback($post)
    {
        global $scripturl, $context, $txt, $delete_button;
        // We'll have a delete please bob.
        if (empty($context['delete_button'])) {
            $context['delete_button'] = create_button('remove_message', 'remove');
        }
        $output_html = '
						<div>
							<div class="floatleft">
								<strong><a href="' . $scripturl . '?topic=' . $post['id_topic'] . '.' . $post['id'] . '#msg' . $post['id'] . '">' . $post['subject'] . '</a></strong> ' . $txt['mc_reportedp_by'] . ' <strong>' . $post['author_link'] . '</strong>
							</div>
							<div class="floatright">';
        if ($post['can_delete']) {
            $output_html .= '
								<a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['mc_watched_users_delete_post'] . '\');">' . $delete_button . '</a>
								<input type="checkbox" name="delete[]" value="' . $post['id'] . '" class="input_check" />';
        }
        $output_html .= '
							</div>
						</div><br />
						<div class="smalltext">
							&#171; ' . $txt['mc_watched_users_posted'] . ': ' . $post['poster_time'] . ' &#187;
						</div>
						<hr />
						' . $post['body'];
        return $output_html;
    }
Example #2
0
 public function xhtml()
 {
     global $ID;
     $ns = getNS($ID);
     list($files, $subprojects) = Projects_file::project_files($ns);
     $generated = array();
     $source = array();
     foreach ($files as $id => $file) {
         if ($file->type() == 'source') {
             $source[$id] = $file;
         } elseif ($file->type() == 'generated') {
             $generated[$id] = $file;
         }
     }
     ksort($generated);
     ksort($source);
     sort($subprojects);
     echo '<h1>Source files</h1>' . DOKU_LF;
     echo '<ul>' . DOKU_LF;
     echo '<li>' . create_button('source') . '</li>' . DOKU_LF;
     foreach ($source as $id => $file) {
         echo '<li>' . html_wikilink($id) . ': ' . download_button($id) . ', ' . delete_button($id) . '</li>' . DOKU_LF;
     }
     echo '</ul>' . DOKU_LF;
     echo '<h1>Generated files</h1>' . DOKU_LF;
     echo '<ul>' . DOKU_LF;
     echo '<li>' . create_button('generated') . '</li>' . DOKU_LF;
     foreach ($generated as $id => $file) {
         $make = make_button($id, $file->status() == PROJECTS_MADE);
         echo '<li>' . html_wikilink($id) . ': ' . download_button($id) . ', ' . delete_button($id) . ', ' . $make . '</li>' . DOKU_LF;
     }
     echo '</ul>' . DOKU_LF;
     echo '<h1>Subprojects</h1>' . DOKU_LF;
     echo '<ul>' . DOKU_LF;
     echo '<li>' . create_button($ID, 'project') . '</li>' . DOKU_LF;
     foreach ($subprojects as $sub) {
         echo '<li><a href="' . wl($sub . ':', array('do' => 'manage_files')) . '">' . noNS($sub) . '</a></li>' . DOKU_LF;
     }
     echo '</ul>' . DOKU_LF;
     if ($ns) {
         $name = getNS($ns);
         $id = $name . ':';
         if (!$name) {
             $id = '/';
             $name = '/ (root)';
         }
         echo '<h1>Parent projects</h1>' . DOKU_LF;
         echo '<ul><li><a href="' . wl($id, array('do' => 'manage_files')) . '">' . $name . '</a></li></ul>' . DOKU_LF;
     }
 }
Example #3
0
            } else {
                $PHP_OUTPUT .= 'No transactions';
            }
            $PHP_OUTPUT .= '</td><td class="right shrink">';
            $PHP_OUTPUT .= $db->getInt('amount');
            $PHP_OUTPUT .= '</td><td class="button">';
            $container['AccountNumber'] = $db->getInt('anon_id');
            $container['Password'] = $db->getField('password');
            $PHP_OUTPUT .= create_button($container, 'Access Account');
            $PHP_OUTPUT .= '</td></tr>';
        }
        $PHP_OUTPUT .= '</table></div><br /><br />';
    }
    $container = create_container('skeleton.php', 'bank_anon.php');
    $container['make'] = 'Yes';
    $PHP_OUTPUT .= create_button($container, 'Create an account');
}
if (isset($account_num)) {
    //they didnt come from the creation screen so we need to check if the pw is correct
    $db->query('SELECT *
				FROM anon_bank
				WHERE anon_id=' . $db->escapeNumber($account_num) . '
				AND game_id=' . $db->escapeNumber($player->getGameID()) . ' LIMIT 1');
    if ($db->nextRecord()) {
        if ($var['allowed'] != 'yes') {
            if ($db->getField('password') != $var['Password']) {
                create_error('Invalid password!');
            }
        }
    } else {
        create_error('This account does not exist!');
Example #4
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>';
        }
    }
}
Example #5
0
function template_showDrafts()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    echo '
		<div class="cat_bar">
			<h3 class="catbg">
				<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/message_sm.png" alt="" class="icon" />
					', $txt['drafts_show'], ' - ', $context['member']['name'], '
				</span>
			</h3>
		</div>
		<div class="pagesection" style="margin-bottom: 0;">
			<div class="pagelinks">', $context['page_index'], '</div>
		</div>';
    // Button shortcuts
    $edit_button = create_button('modify_inline.png', 'draft_edit', 'draft_edit', 'class="centericon"');
    $remove_button = create_button('delete.png', 'draft_delete', 'draft_delete', 'class="centericon"');
    // No drafts? Just show an informative message.
    if (empty($context['drafts'])) {
        echo '
		<div class="tborder windowbg2 padding centertext">
			', $txt['draft_none'], '
		</div>';
    } else {
        // For every draft to be displayed, give it its own div, and show the important details of the draft.
        foreach ($context['drafts'] as $draft) {
            echo '
			<div class="topic">
				<div class="', $draft['alternate'] == 0 ? 'windowbg2' : 'windowbg', ' core_posts">
					<div class="content">
						<div class="counter">', $draft['counter'], '</div>
						<div class="topic_details">
							<h5><strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> &nbsp; &nbsp;';
            if (!empty($draft['sticky'])) {
                echo '<img src="', $settings['images_url'], '/icons/quick_sticky.png" alt="', $txt['sticky_topic'], '" title="', $txt['sticky_topic'], '" />';
            }
            if (!empty($draft['locked'])) {
                echo '<img src="', $settings['images_url'], '/icons/quick_lock.png" alt="', $txt['locked_topic'], '" title="', $txt['locked_topic'], '" />';
            }
            echo '
							</h5>
							<span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> ', $draft['time'], '&nbsp;&#187;</span>
						</div>
						<div class="list_posts">
							', $draft['body'], '
						</div>
					</div>
					<div class="floatright">
						<ul class="reset smalltext quickbuttons">
							<li><a href="', $scripturl, '?action=post;', empty($draft['topic']['id']) ? 'board=' . $draft['board']['id'] : 'topic=' . $draft['topic']['id'], '.0;id_draft=', $draft['id_draft'], '" class="reply_button"><span>', $txt['draft_edit'], '</span></a></li>
							<li><a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';area=showdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['draft_remove'], '?\');" class="remove_button"><span>', $txt['draft_delete'], '</span></a></li>
						</ul>
					</div>
				</div>
			</div>';
        }
    }
    // Show page numbers.
    echo '
		<div class="pagesection" style="margin-bottom: 0;">
			<div class="pagelinks">', $context['page_index'], '</div>
		</div>';
}
<?php

$alliance =& $player->getAlliance();
$template->assign('PageTopic', $alliance->getAllianceName() . ' (' . $alliance->getAllianceID() . ')');
require_once get_file_loc('menu.inc');
create_alliance_menu($alliance->getAllianceID(), $alliance->getLeaderID());
$PHP_OUTPUT .= 'Do you really want to leave this alliance?<br /><br />';
$container = create_container('alliance_leave_processing.php');
$container['action'] = 'YES';
$PHP_OUTPUT .= create_button($container, 'Yes!');
$container['action'] = 'NO';
$PHP_OUTPUT .= '&nbsp;&nbsp;&nbsp;';
$PHP_OUTPUT .= create_button($container, 'No!');
Example #7
0
function template_showPosts()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    echo '
		<div class="cat_bar">
			<h3 class="catbg">
				', !isset($context['attachments']) && empty($context['is_topics']) ? $txt['showMessages'] : (!empty($context['is_topics']) ? $txt['showTopics'] : $txt['showAttachments']), ' - ', $context['member']['name'], '
			</h3>
		</div>
		<div class="pagesection">
			<span>', $txt['pages'], ': ', $context['page_index'], '</span>
		</div>';
    // Button shortcuts
    $quote_button = create_button('quote.gif', 'reply_quote', 'quote', 'align="middle"');
    $reply_button = create_button('reply_sm.gif', 'reply', 'reply', 'align="middle"');
    $remove_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"');
    $notify_button = create_button('notify_sm.gif', 'notify_replies', 'notify', 'align="middle"');
    // Are we displaying posts or attachments?
    if (!isset($context['attachments'])) {
        // For every post to be displayed, give it its own div, and show the important details of the post.
        foreach ($context['posts'] as $post) {
            echo '
		<div class="topic">
			<div class="', $post['alternate'] == 0 ? 'windowbg2' : 'windowbg', ' core_posts">
				<span class="topslice"><span></span></span>
				<div class="content">
					<div class="topic_details">
						<h5><strong>', $post['counter'], ') <a href="', $scripturl, '?board=', $post['board']['id'], '.0">', $post['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">', $post['subject'], '</a></strong></h5>
						<span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> ', $post['time'], '&nbsp;&#187;</span>
					</div>
					<div class="post">';
            if (!$post['approved']) {
                echo '
					<div class="approve_post">
						<em>', $txt['post_awaiting_approval'], '</em>
					</div>';
            }
            echo '
					', $post['body'], '
					</div>
				</div>';
            if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete']) {
                echo '
				<hr>
				<div class="buttonlist">
					<ul>';
            }
            // If they *can* reply?
            if ($post['can_reply']) {
                echo '
						<li class="reply_button"><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span>', $txt['reply'], '</span></a></li>';
            }
            // If they *can* quote?
            if ($post['can_quote']) {
                echo '
						<li class="quote_button"><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span>', $txt['quote'], '</span></a></li>';
            }
            // Can we request notification of topics?
            if ($post['can_mark_notify']) {
                echo '
						<li class="notify_button"><a href="', $scripturl, '?action=notify;topic=', $post['topic'], '.', $post['start'], '"><span>', $txt['notify'], '</span></a></li>';
            }
            // How about... even... remove it entirely?!
            if ($post['can_delete']) {
                echo '
						<li class="remove_button"><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');"><span>', $txt['remove'], '</span></a></li>';
            }
            if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete']) {
                echo '
					</ul>
				</div>';
            }
            echo '
				<br class="clear" />
			</div>
		</div>';
        }
    } else {
        echo '
		<table border="0" width="100%" cellspacing="1" cellpadding="2" class="table_grid" align="center">
			<thead>
				<tr class="titlebg">
					<th class="first_th lefttext" scope="col" width="25%">
						<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=filename', $context['sort_direction'] == 'down' && $context['sort_order'] == 'filename' ? ';asc' : '', '">
							', $txt['show_attach_filename'], '
							', $context['sort_order'] == 'filename' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : '', '
						</a>
					</th>
					<th scope="col" width="12%">
						<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=downloads', $context['sort_direction'] == 'down' && $context['sort_order'] == 'downloads' ? ';asc' : '', '">
							', $txt['show_attach_downloads'], '
							', $context['sort_order'] == 'downloads' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : '', '
						</a>
					</th>
					<th class="lefttext" scope="col" width="30%">
						<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=subject', $context['sort_direction'] == 'down' && $context['sort_order'] == 'subject' ? ';asc' : '', '">
							', $txt['message'], '
							', $context['sort_order'] == 'subject' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : '', '
						</a>
					</th>
					<th class="last_th lefttext" scope="col">
						<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=posted', $context['sort_direction'] == 'down' && $context['sort_order'] == 'posted' ? ';asc' : '', '">
						', $txt['show_attach_posted'], '
						', $context['sort_order'] == 'posted' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : '', '
						</a>
					</th>
				</tr>
			</thead>
			<tbody>';
        // Looks like we need to do all the attachments instead!
        $alternate = false;
        foreach ($context['attachments'] as $attachment) {
            echo '
				<tr class="', $attachment['approved'] ? $alternate ? 'windowbg' : 'windowbg2' : 'approvebg', '">
					<td><a href="', $scripturl, '?action=dlattach;topic=', $attachment['topic'], '.0;attach=', $attachment['id'], '">', $attachment['filename'], '</a>', !$attachment['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : '', '
					', in_array(substr($attachment['filename'], strlen($attachment['filename']) - 4, 4), array('.jpg', '.png', '.gif')) ? '<br><img style="margin: 4px 0; border: solid 1px #ccc; width: 100%; max-width: 150px;" src="' . $scripturl . '?action=dlattach;topic=' . $attachment['topic'] . '.0;attach=' . $attachment['id'] . ';image" alt="" />' : '', '
					</td>
					<td align="center">', $attachment['downloads'], '</td>
					<td><a href="', $scripturl, '?topic=', $attachment['topic'], '.msg', $attachment['msg'], '#msg', $attachment['msg'], '" rel="nofollow">', $attachment['subject'], '</a></td>
					<td>', $attachment['posted'], '</td>
				</tr>';
            $alternate = !$alternate;
        }
        // No posts? Just end the table with a informative message.
        if (isset($context['attachments']) && empty($context['attachments']) || !isset($context['attachments']) && empty($context['posts'])) {
            echo '
				<tr>
					<td class="tborder windowbg2 padding centertext" colspan="4">
						', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
					</td>
				</tr>';
        }
        echo '
			</tbody>
		</table>';
    }
    // Show more page numbers.
    echo '
		<div class="pagesection" style="margin-bottom: 0;">
			<span>', $txt['pages'], ': ', $context['page_index'], '</span>
		</div>';
}
Example #8
0
    echo '</div>' . "\n";
}
if (!$pathfinder_records) {
    echo '<div class="alert alert-warning">';
    echo 'Sorry, no pathfinder found/available yet';
    if ($logged_in && $group == 'Librarian') {
        echo '<p>';
        echo create_button('anchor', site_url('pathfinder/add'), 'add-pathfinder', 'Add New Pathfinder', 'btn-success', '', $icon = 'plus-sign');
        echo '</p>';
    }
    echo '</div>' . "\n";
} else {
    if ($logged_in && $group == 'Librarian') {
        echo '<div class="panel panel-default">';
        echo '<div class="panel-body">';
        echo create_button('anchor', site_url('pathfinder/add'), 'add-pathfinder', 'Add New Pathfinder', 'btn-success', '', $icon = 'plus-sign');
        echo '</div>';
        echo '</div>';
    }
    $n = 1;
    foreach ($pathfinder_records as $pf) {
        ?>
<div class="panel panel-default pathfinder-panel">
  <div class="panel-heading"><h3 class="panel-title"><?php 
        echo $pf->title;
        ?>
</h3></div>
  <div class="panel-body">
    <?php 
        if ($pf->image_filename) {
            echo '<div class="pathfinder-image"><a href="' . site_url('/pathfinder/detail/' . $pf->id) . '"><img src="' . base_url('files/pathfinder/images') . '/' . $pf->image_filename . '" class="img-responsive img-thumbnail" /></a></div>';
Example #9
0
function template_main()
{
    global $context, $settings, $options, $txt, $scripturl, $modSettings;
    echo '
		<div style="padding: 3px;">', theme_linktree(), '</div>

		<table cellspacing="1" cellpadding="2" width="100%" class="bordercolor">
			<tr class="titlebg"><td style="font-size: x-large;" align="center" colspan="7">', $txt['months_titles'][$context['current_month']], ' ', $context['current_year'], '</td></tr>
			<tr>';
    // Show each day of the week.
    foreach ($context['week_days'] as $day) {
        echo '
				<td class="titlebg2" width="14%" align="center">', $txt['days'][$day], '</td>';
    }
    echo '
			</tr>';
    /* Each week in weeks contains the following:
    		days (a list of days), number (week # in the year.) */
    foreach ($context['weeks'] as $week) {
        echo '
			<tr>';
        /* Every day has the following:
        			day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?),
        			holidays, events, birthdays. (last three are lists.) */
        foreach ($week['days'] as $day) {
            // If this is today, make it a different color and show a border.
            echo '
				<td valign="top" style="height: 100px; padding: 2px;" class="', $day['is_today'] ? 'calendar_today' : 'windowbg', '">';
            // Skip it if it should be blank - it's not a day if it has no number.
            if (!empty($day['day'])) {
                // Should the day number be a link?
                if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) {
                    echo '
					<a href="', $scripturl, '?action=calendar;sa=post;month=', $context['current_month'], ';year=', $context['current_year'], ';day=', $day['day'], ';sesc=', $context['session_id'], '">', $day['day'], '</a>';
                } else {
                    echo '
					', $day['day'];
                }
                // Is this the first day of the week? (and are we showing week numbers?)
                if ($day['is_first_day']) {
                    echo '<span class="smalltext"> - ', $txt['calendar51'], ' ', $week['number'], '</span>';
                }
                // Are there any holidays?
                if (!empty($day['holidays'])) {
                    echo '
					<div class="smalltext" style="color: #', $modSettings['cal_holidaycolor'], ';">', $txt['calendar5'], ' ', implode(', ', $day['holidays']), '</div>';
                }
                // Show any birthdays...
                if (!empty($day['birthdays'])) {
                    echo '
					<div class="smalltext">
						<span style="color: #', $modSettings['cal_bdaycolor'], ';">', $txt['calendar3'], '</span> ';
                    /* Each of the birthdays has:
                    			id, name (person), age (if they have one set?), and is_last. (last in list?) */
                    foreach ($day['birthdays'] as $member) {
                        echo '
						<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
                    }
                    echo '
					</div>';
                }
                // Any special posted events?
                if (!empty($day['events'])) {
                    echo '
					<div class="smalltext">
						<span style="color: #', $modSettings['cal_eventcolor'], ';">', $txt['calendar4'], '</span>';
                    /* The events are made up of:
                    			title, href, is_last, can_edit (are they allowed to?), and modify_href. */
                    foreach ($day['events'] as $event) {
                        // If they can edit the event, show a star they can click on....
                        if ($event['can_edit']) {
                            echo '
						<a href="', $event['modify_href'], '" style="color: #FF0000;">*</a> ';
                        }
                        echo '
						', $event['link'], $event['is_last'] ? '' : ', ';
                    }
                    echo '
					</div>';
                }
            }
            echo '
				</td>';
        }
        echo '
			</tr>';
    }
    echo '
		</table>

		<form action="', $scripturl, '?action=calendar" method="post" accept-charset="', $context['character_set'], '">
			<table cellspacing="0" cellpadding="3" width="100%" class="tborder" style="border-top: 0;">
				<tr class="titlebg2">
					<td>';
    // Is there a calendar for last month to look at?
    if (isset($context['previous_calendar'])) {
        echo '
						<b><a href="', $context['previous_calendar']['href'], '">&#171; ', $txt['months_short'][$context['previous_calendar']['month']], ' ', $context['previous_calendar']['year'], '</a></b>';
    }
    echo '
					</td>
					<td align="center">';
    // Show a little "post event" button?
    if ($context['can_post']) {
        echo '
						<a href="', $scripturl, '?action=calendar;sa=post;month=', $context['current_month'], ';year=', $context['current_year'], ';sesc=', $context['session_id'], '">', create_button('calendarpe.gif', 'calendar23', 'calendar23', 'align="middle"'), '</a>';
    }
    echo '
					</td>
					<td align="center">
						<select name="month">';
    // Show a select box with all the months.
    foreach ($txt['months'] as $number => $month) {
        echo '
							<option value="', $number, '"', $number == $context['current_month'] ? ' selected="selected"' : '', '>', $month, '</option>';
    }
    echo '
						</select>&nbsp;
						<select name="year">';
    // Show a link for every year.....
    for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) {
        echo '
							<option value="', $year, '"', $year == $context['current_year'] ? ' selected="selected"' : '', '>', $year, '</option>';
    }
    echo '
						</select>&nbsp;
						<input type="submit" value="', $txt[305], '" />
					</td>
					<td align="center">';
    // Show another post button just for symmetry.
    if ($context['can_post']) {
        echo '
						<a href="', $scripturl, '?action=calendar;sa=post;month=', $context['current_month'], ';year=', $context['current_year'], ';sesc=', $context['session_id'], '">', create_button('calendarpe.gif', 'calendar23', 'calendar23', 'align="middle"'), '</a>';
    }
    echo '
					</td>
					<td align="', !$context['right_to_left'] ? 'right' : 'left', '">';
    // Is there a calendar for next month?
    if (isset($context['next_calendar'])) {
        echo '
						<b><a href="', $context['next_calendar']['href'], '">' . $txt['months_short'][$context['next_calendar']['month']] . ' ' . $context['next_calendar']['year'] . ' &#187;</a></b>';
    }
    echo '
					</td>
				</tr>
			</table>
		</form>';
}
Example #10
0
function template_showPosts()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    echo '
		<table border="0" width="85%" cellspacing="1" cellpadding="4" class="bordercolor" align="center">
			<tr class="titlebg">
				<td colspan="3" height="26">
					&nbsp;<img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" align="top" />&nbsp;', $txt['showPosts'], '
				</td>
			</tr>';
    // Only show posts if they have made some!
    if (!empty($context['posts'])) {
        // Page numbers.
        echo '
			<tr class="catbg3">
				<td colspan="3">
					', $txt[139], ': ', $context['page_index'], '
				</td>
			</tr>
		</table>';
        // Button shortcuts
        $quote_button = create_button('quote.gif', 145, 'smf240', 'align="middle"');
        $reply_button = create_button('reply_sm.gif', 146, 146, 'align="middle"');
        $remove_button = create_button('delete.gif', 121, 31, 'align="middle"');
        $notify_button = create_button('notify_sm.gif', 131, 125, 'align="middle"');
        // For every post to be displayed, give it its own subtable, and show the important details of the post.
        foreach ($context['posts'] as $post) {
            echo '
		<table border="0" width="85%" cellspacing="1" cellpadding="0" class="bordercolor" align="center">
			<tr>
				<td width="100%">
					<table border="0" width="100%" cellspacing="0" cellpadding="4" class="bordercolor" align="center">
						<tr class="titlebg2">
							<td style="padding: 0 1ex;">
								', $post['counter'], '
							</td>
							<td width="75%" class="middletext">
								&nbsp;<a href="', $scripturl, '#', $post['category']['id'], '">', $post['category']['name'], '</a> / <a href="', $scripturl, '?board=', $post['board']['id'], '.0">', $post['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">', $post['subject'], '</a>
							</td>
							<td class="middletext" align="right" style="padding: 0 1ex; white-space: nowrap;">
								', $txt[30], ': ', $post['time'], '
							</td>
						</tr>
						<tr>
							<td width="100%" height="80" colspan="3" valign="top" class="windowbg2">
								<div class="post">', $post['body'], '</div>
							</td>
						</tr>
						<tr>
							<td colspan="3" class="windowbg2" align="', !$context['right_to_left'] ? 'right' : 'left', '"><span class="middletext">';
            if ($post['can_delete']) {
                echo '
					<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';sa=showPosts;start=', $context['start'], ';delete=', $post['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">', $remove_button, '</a>';
            }
            if ($post['can_delete'] && ($post['can_mark_notify'] || $post['can_reply'])) {
                echo '
								', $context['menu_separator'];
            }
            if ($post['can_reply']) {
                echo '
					<a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '">', $reply_button, '</a>', $context['menu_separator'], '
					<a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], ';sesc=', $context['session_id'], '">', $quote_button, '</a>';
            }
            if ($post['can_reply'] && $post['can_mark_notify']) {
                echo '
								', $context['menu_separator'];
            }
            if ($post['can_mark_notify']) {
                echo '
					<a href="' . $scripturl . '?action=notify;topic=' . $post['topic'] . '.' . $post['start'] . '">' . $notify_button . '</a>';
            }
            echo '
							</span></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>';
        }
        // Show more page numbers.
        echo '
		<table border="0" width="85%" cellspacing="1" cellpadding="4" class="bordercolor" align="center">
			<tr>
				<td colspan="3" class="catbg3">
					', $txt[139], ': ', $context['page_index'], '
				</td>
			</tr>
		</table>';
    } else {
        echo '
			<tr class="windowbg2">
				<td>
					', $txt[170], '
				</td>
			</tr>
		</table>';
    }
}
Example #11
0
$template->assign('PageTopic', 'Announcements');
$PHP_OUTPUT .= '<table class="standard fullwidth">';
$PHP_OUTPUT .= '<tr><th>Time</th><th>Message</th></tr>';
if (!isset($var['view_all'])) {
    $db->query('SELECT time, login, msg
				FROM announcement
				JOIN account ON announcement.admin_id=account.account_id
				AND time > ' . $db->escapeNumber($account->getLastLogin()) . '
				ORDER BY time DESC');
} else {
    $db->query('SELECT time, login, msg
				FROM announcement
				JOIN account ON announcement.admin_id=account.account_id
				ORDER BY time DESC');
}
while ($db->nextRecord()) {
    $PHP_OUTPUT .= '<tr>';
    $PHP_OUTPUT .= '<td class="shrink top noWrap">';
    //$PHP_OUTPUT.= $db->getField('login');
    //$PHP_OUTPUT.= '<br />';
    $PHP_OUTPUT .= date(DATE_FULL_SHORT_SPLIT, $db->getField('time'));
    $PHP_OUTPUT .= '</td><td class="top">';
    $PHP_OUTPUT .= bbifyMessage($db->getField('msg'));
    $PHP_OUTPUT .= '</td></tr>';
}
$PHP_OUTPUT .= '</table><br />';
$container = create_container('login_check_processing.php');
$container['CheckType'] = 'Updates';
$PHP_OUTPUT .= create_button($container, 'Continue');
Example #12
0
}
if ($pre_size < sizeof($this_shop_sells)) {
    $special_stock = TRUE;
} else {
    $special_stock = FALSE;
}
if (sizeof($this_shop_sells) > 0) {
    if ($special_stock) {
        $PHP_OUTPUT .= 'It looks like you have access to some of our special stock.<br />';
    }
    $PHP_OUTPUT .= '<table class="standard"><tr><th>Name</th><th>Cost</th><th>Action</th></tr>';
    foreach ($this_shop_sells as $gad_id) {
        $PHP_OUTPUT .= '<tr><td>' . $rev_gad[$gad_id] . '</td><td>' . number_format($GADGETS[$rev_gad[$gad_id]]['Cost']) . '</td><td>';
        if ($THIS_PLAYER->getGadget($gad_id) !== false) {
            $PHP_OUTPUT .= 'Already Owned';
        } else {
            $link = array();
            $link['body'] = 'shop_gadget.php';
            $link['processing'] = 'shop_gadget_processing.php';
            $link['text'] = 'Buy';
            $link['loc_id'] = $var['loc_id'];
            $link['valid_for'] = -4;
            $link['gad_id'] = $gad_id;
            create_button($link, $id);
        }
        $PHP_OUTPUT .= '</td></tr>';
    }
    $PHP_OUTPUT .= '</table>';
} else {
    $PHP_OUTPUT .= 'We\'ve got nothing for you here! Get outta here!<br />';
}
Example #13
0
        $PHP_OUTPUT .= '<li>Message of the Day Read Rights</li>';
    }
    if ($db->getBoolean('planet_land')) {
        $PHP_OUTPUT .= '<li>Planet Landing Rights</li>';
    }
    $PHP_OUTPUT .= '</ul>';
    $container = create_container('alliance_treaties_processing.php', '');
    $container['alliance_id'] = $alliance->getAllianceID();
    $container['alliance_id_1'] = $db->getField('alliance_id_1');
    $container['aa'] = $db->getField('aa_access');
    $container['alliance_name'] = $temp[$db->getField('alliance_id_1')];
    $container['accept'] = true;
    $PHP_OUTPUT .= create_button($container, 'Accept');
    $container['accept'] = false;
    $PHP_OUTPUT .= '&nbsp;';
    $PHP_OUTPUT .= create_button($container, 'Reject');
    $PHP_OUTPUT .= '<br /><br />';
}
$template->assign('PageTopic', 'Offer A Treaty');
$PHP_OUTPUT .= 'Select the alliance you wish to offer a treaty.<br /><small>Note: Treaties require 24 hours to be canceled once in effect</small><br />';
$container = create_container('skeleton.php', 'alliance_treaties_processing.php');
$container['alliance_id'] = $alliance->getAllianceID();
$form = create_form($container, 'Send the Offer');
$PHP_OUTPUT .= $form['form'];
$PHP_OUTPUT .= '<select name="proposedAlliance" id="InputFields">';
foreach ($temp as $allId => $allName) {
    $PHP_OUTPUT .= '<option value="' . $allId . '">' . $allName . '</option>';
}
$PHP_OUTPUT .= '</select';
$PHP_OUTPUT .= '<br />Choose the treaty terms<br />';
$PHP_OUTPUT .= create_table();
Example #14
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
    echo '
<div>', theme_linktree(), '</div>';
    // Is this topic also a poll?
    if ($context['is_poll']) {
        echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
	<tr>
		<td class="titlebg" 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="bottom" /> ', $txt['smf43'], '
		</td>
	</tr>
	<tr>
		<td width="5%" valign="top" class="windowbg"><b>', $txt['smf21'], ':</b></td>
		<td class="windowbg">
			', $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'], ';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 '
							', $option['vote_button'], ' ', $option['option'], '<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" style="padding-top: 0; margin-bottom: 3ex;">
		<tr>
				<td class="titlebg" 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>
</table>';
    }
    // Build the normal button array.
    $normal_buttons = array('reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']), 'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => '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'] . ';sesc=' . $context['session_id']), 'custom' => array(), 'send' => array('test' => 'can_send_topic', 'text' => 707, 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0'), 'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'));
    // Special case for the custom one.
    if ($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']);
    } elseif ($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']);
    } else {
        unset($normal_buttons['custom']);
    }
    // Show the page index... "Pages: [1]".
    echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td class="middletext" valign="bottom" style="padding-bottom: 4px;">', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><b>' . $txt['topbottom5'] . '</b></a>' : '', '</td>
		<td align="right" style="padding-right: 1ex;">
			<div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], '</div>
			<table cellpadding="0" cellspacing="0">
				<tr>
					', template_button_strip($normal_buttons, 'bottom'), '
				</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="catbg3">
				<td valign="middle" width="2%" style="padding-left: 6px;">
						<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
				</td>
				<td width="13%"> ', $txt[29], '</td>
				<td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
						', $txt[118], ': ', $context['subject'], ' &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
				</td>
		</tr>';
    if (!empty($settings['display_who_viewing'])) {
        echo '
		<tr>
				<td colspan="3" 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>
		</tr>';
    }
    echo '
</table>';
    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'] . '\');">';
    // 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 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 width="100%" cellpadding="3" cellspacing="0" border="0">
			<tr><td class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', '">';
        // 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;">
							<b>', $message['member']['link'], '</b>
							<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'], ';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" 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], ': ', $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 '
								<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 />';
            }
            // This shows the popular messaging icons.
            echo '
								', $message['member']['icq']['link'], '
								', $message['member']['msn']['link'], '
								', $message['member']['aim']['link'], '
								', $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[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 '
							</div>
						</td>
						<td valign="top" width="85%" height="100%">
							<table width="100%" border="0"><tr>
								<td valign="middle"><a href="', $message['href'], '"><img src="', $message['icon_url'] . '" alt="" border="0" /></a></td>
								<td 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 '
									<div class="smalltext">&#171; <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' &#187;</div></td>
								<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" 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;">', $reply_button, '</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'], '">', $reply_button, '</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'], '">', $modify_button, '</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], '?\');">', $remove_button, '</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'], '">', $split_button, '</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 = \'\';"' : '', ' />';
        }
        // 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; display: none;" 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" 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: 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;';
        }
        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['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 '
	<tr><td style="padding: 0 0 1px 0;"></td></tr>
</table>
<a name="lastPost"></a>';
    // 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 '
<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', true), '
				</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" style="margin-bottom: 1ex;">
		<tr>';
    if ($settings['linktree_inline']) {
        echo '
				<td valign="top">', theme_linktree(), '</td> ';
    }
    echo '
				<td valign="top" align="', !$context['right_to_left'] ? 'right' : 'left', '" class="nav"> ', $context['previous_next'], '</td>
		</tr>
</table>';
    $mod_buttons = array('move' => array('test' => 'can_move', 'text' => 132, 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'), 'delete' => array('test' => 'can_delete', 'text' => 63, 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt[162] . '\');"', 'url' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']), 'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'smf279' : 'smf280', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']), 'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_sticky']) ? 'smf277' : 'smf278', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']), 'merge' => array('test' => 'can_merge', 'text' => 'smf252', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']), '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']), 'calendar' => array('test' => 'calendar_post', 'text' => 'calendar37', 'image' => 'linktocal.gif', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']));
    if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
        $mod_buttons[] = array('text' => 'quickmod_delete_selected', 'image' => 'delete_selected.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" id="quickmodSubmit"', 'url' => 'javascript:document.quickModForm.submit();');
    }
    echo '
	<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 1ex;">
		<tr>
			', template_button_strip($mod_buttons, 'bottom'), '
		</tr>
	</table>';
    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 class="tborder"><div class="titlebg2" style="padding: 4px;" align="', !$context['right_to_left'] ? 'right' : 'left', '">
	<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" style="padding:0; margin: 0;">
		<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>
</div></div>';
    echo '<br />';
    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="+" 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" 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="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\');" tabindex="5"/>';
        }
        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>';
    }
}
Example #15
0
/**
 *
 * @param
 *        	compound array $buttons
 * @param array $options        	
 * @return string
 */
function create_button_bar($buttons, $type = "list", $options = NULL)
{
    $id = "";
    $selection = "";
    $class = "";
    if ($options) {
        if (array_key_exists("id", $options)) {
            $id = sprintf("id='%s'", $options["id"]);
        }
        if (array_key_exists("selection", $options)) {
            $selection = $options["selection"];
        }
        if (array_key_exists("class", $options)) {
            $class = $options["class"];
        }
    }
    $button_list = array();
    // the "selection" option indicates the page in the interface. Currently as
    // indicated by the uri->segment(1)
    foreach ($buttons as $button) {
        $button_list[] = create_button($button);
    }
    if ($type == "list") {
        $contents = implode("</li><li>", $button_list);
        $template = "<ul class='button-list'><li>{$contents}</li></ul>";
        $output = sprintf("<div class='btn-group %s'  %s>%s</div>", $class, $id, $template);
    } elseif ($type == "toolbar") {
        $contents = implode("", $button_list);
        // $template = "<ul class='button-list'><li>$contents</li></ul>";
        $output = sprintf("<div class='btn-group %s'  %s>%s</div>", $class, $id, $contents);
    }
    return $output;
}
Example #16
0
function UnapprovedAttachments()
{
    global $txt, $scripturl, $context, $user_info, $sourcedir, $backend_subdir;
    $context['page_title'] = $txt['mc_unapproved_attachments'];
    // Once again, permissions are king!
    $approve_boards = boardsAllowedTo('approve_posts');
    if ($approve_boards == array(0)) {
        $approve_query = '';
    } elseif (!empty($approve_boards)) {
        $approve_query = ' AND m.id_board IN (' . implode(',', $approve_boards) . ')';
    } else {
        $approve_query = ' AND 0';
    }
    // Get together the array of things to act on, if any.
    $attachments = array();
    if (isset($_GET['approve'])) {
        $attachments[] = (int) $_GET['approve'];
    } elseif (isset($_GET['delete'])) {
        $attachments[] = (int) $_GET['delete'];
    } elseif (isset($_POST['item'])) {
        foreach ($_POST['item'] as $item) {
            $attachments[] = (int) $item;
        }
    }
    // Are we approving or deleting?
    if (isset($_GET['approve']) || isset($_POST['do']) && $_POST['do'] == 'approve') {
        $curAction = 'approve';
    } elseif (isset($_GET['delete']) || isset($_POST['do']) && $_POST['do'] == 'delete') {
        $curAction = 'delete';
    }
    // Something to do, let's do it!
    if (!empty($attachments) && isset($curAction)) {
        checkSession('request');
        // This will be handy.
        require_once $sourcedir . '/lib/Subs-ManageAttachments.php';
        // Confirm the attachments are eligible for changing!
        $request = smf_db_query('
			SELECT a.id_attach
			FROM {db_prefix}attachments AS a
				INNER JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_msg)
				LEFT JOIN {db_prefix}boards AS b ON (m.id_board = b.id_board)
			WHERE a.id_attach IN ({array_int:attachments})
				AND a.approved = {int:not_approved}
				AND a.attachment_type = {int:attachment_type}
				AND {query_see_board}
				' . $approve_query, array('attachments' => $attachments, 'not_approved' => 0, 'attachment_type' => 0));
        $attachments = array();
        while ($row = mysql_fetch_assoc($request)) {
            $attachments[] = $row['id_attach'];
        }
        mysql_free_result($request);
        // Assuming it wasn't all like, proper illegal, we can do the approving.
        if (!empty($attachments)) {
            if ($curAction == 'approve') {
                ApproveAttachments($attachments);
            } else {
                removeAttachments(array('id_attach' => $attachments));
            }
        }
    }
    // How many unapproved attachments in total?
    $request = smf_db_query('
		SELECT COUNT(*)
		FROM {db_prefix}attachments AS a
			INNER JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_msg)
			INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board)
		WHERE a.approved = {int:not_approved}
			AND a.attachment_type = {int:attachment_type}
			AND {query_see_board}
			' . $approve_query, array('not_approved' => 0, 'attachment_type' => 0));
    list($context['total_unapproved_attachments']) = mysql_fetch_row($request);
    mysql_free_result($request);
    $context['page_index'] = constructPageIndex($scripturl . '?action=moderate;area=attachmod;sa=attachments', $_GET['start'], $context['total_unapproved_attachments'], 10);
    $context['start'] = $_GET['start'];
    // Get all unapproved attachments.
    $request = smf_db_query('
		SELECT a.id_attach, a.filename, a.size, m.id_msg, m.id_topic, m.id_board, m.subject, m.body, m.id_member,
			IFNULL(mem.real_name, m.poster_name) AS poster_name, m.poster_time,
			t.id_member_started, t.id_first_msg, b.name AS board_name, c.id_cat, c.name AS cat_name
		FROM {db_prefix}attachments AS a
			INNER JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_msg)
			INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
			INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board)
			LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
			LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
		WHERE a.approved = {int:not_approved}
			AND a.attachment_type = {int:attachment_type}
			AND {query_see_board}
			' . $approve_query . '
		LIMIT ' . $context['start'] . ', 10', array('not_approved' => 0, 'attachment_type' => 0));
    $context['unapproved_items'] = array();
    for ($i = 1; $row = mysql_fetch_assoc($request); $i++) {
        $context['unapproved_items'][] = array('id' => $row['id_attach'], 'alternate' => $i % 2, 'filename' => $row['filename'], 'size' => round($row['size'] / 1024, 2), 'time' => timeformat($row['poster_time']), 'poster' => array('id' => $row['id_member'], 'name' => $row['poster_name'], 'link' => $row['id_member'] ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>' : $row['poster_name'], 'href' => $scripturl . '?action=profile;u=' . $row['id_member']), 'message' => array('id' => $row['id_msg'], 'subject' => $row['subject'], 'body' => parse_bbc($row['body']), 'time' => timeformat($row['poster_time']), 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg']), 'topic' => array('id' => $row['id_topic']), 'board' => array('id' => $row['id_board'], 'name' => $row['board_name']), 'category' => array('id' => $row['id_cat'], 'name' => $row['cat_name']));
    }
    mysql_free_result($request);
    EoS_Smarty::loadTemplate('modcenter/modcenter_base');
    EoS_Smarty::getConfigInstance()->registerHookTemplate('modcenter_content_area', 'modcenter/unapproved_attachments');
    // The ever popular approve button, with the massively unpopular delete.
    $context['approve_button'] = create_button('approve', 'approve');
    $context['remove_button'] = create_button('remove_message', 'remove');
}
Example #17
0
<?php

$results = $var['results'];
$PHP_OUTPUT .= $results[0];
$PHP_OUTPUT .= '<br /><img src="images/planetAttack.jpg" alt="Planet Attack" title="Planet Attack"><br />';
$PHP_OUTPUT .= $results[1];
$PHP_OUTPUT .= '<br />';
if ($var['continue'] && !isset($var['override_death'])) {
    $container = array();
    $container['url'] = 'planet_attack_processing.php';
    $PHP_OUTPUT .= '<div align="center">';
    $PHP_OUTPUT .= create_button($container, 'Continue Attack');
    $PHP_OUTPUT .= '</div>';
} else {
    $PHP_OUTPUT .= '<div align="center"><h2>The battle has ended!</h2><br />';
    $container = array();
    $container['url'] = 'skeleton.php';
    $container['body'] = 'current_sector.php';
    $PHP_OUTPUT .= create_button($container, 'Current Sector');
    $PHP_OUTPUT .= '</div>';
}
Example #18
0
    $PHP_OUTPUT .= '<big>Here are the updates that have gone live since your last visit, enjoy!</big><br/><br/>';
}
$db2 = new SmrMySqlDatabase();
$db->query('SELECT *
			FROM version
			WHERE went_live > ' . (isset($var['Since']) ? $db->escapeNumber($var['Since']) : '0') . '
			ORDER BY version_id DESC');
while ($db->nextRecord()) {
    $version_id = $db->getInt('version_id');
    $version = $db->getInt('major_version') . '.' . $db->getInt('minor_version') . '.' . $db->getInt('patch_level');
    $went_live = $db->getInt('went_live');
    // get human readable format for date
    if ($went_live > 0) {
        $went_live = date(DATE_FULL_SHORT, $went_live);
    } else {
        $went_live = 'never';
    }
    $PHP_OUTPUT .= '<b><small>' . $version . ' (' . $went_live . '):</small></b>';
    $PHP_OUTPUT .= '<ul>';
    $db2->query('SELECT *
				FROM changelog
				WHERE version_id = ' . $db2->escapeNumber($version_id) . '
				ORDER BY changelog_id');
    while ($db2->nextRecord()) {
        $PHP_OUTPUT .= '<li>' . $db2->getField('change_title') . '<br /><small>' . $db2->getField('change_message') . '</small></li>';
    }
    $PHP_OUTPUT .= '</ul><br />';
    if (isset($var['Since'])) {
        $PHP_OUTPUT .= create_button(create_container('logged_in.php'), 'Continue');
    }
}
Example #19
0
function template_manual_intro()
{
    global $context, $settings, $options, $txt, $scripturl, $modSettings;
    echo '

	<p>', $txt['manual_index_you_have_arrived_part1'], '<a href="http://www.simplemachines.org/">', $txt['manual_index_you_have_arrived_link_site0'], '</a>', $txt['manual_index_you_have_arrived_part2'], '<a href="', $scripturl, '?action=help;page=index#board">', $txt['manual_index_you_have_arrived_link_site0_board'], '</a>', $txt['manual_index_you_have_arrived_part3'], '</p>
	<p>', $txt['manual_index_guest_permit_read_part1'], '<a href="', $scripturl, '?action=help;page=registering">', $txt['manual_index_guest_permit_read_link_registering'], '</a>', $txt['manual_index_guest_permit_read_part2'], '</p>
	<ol>
		<li><a href="', $scripturl, '?action=help;page=index#main">', $txt['manual_index_main_menu'], '</a></li>
		<li><a href="', $scripturl, '?action=help;page=index#board">', $txt['manual_index_sec_board_index'], '</a></li>
		<li><a href="', $scripturl, '?action=help;page=index#message">', $txt['manual_index_sec_msg_index'], '</a></li>
		<li><a href="', $scripturl, '?action=help;page=index#topic">', $txt['manual_index_sec_topic'], '</a></li>
	</ol>
	<h2 id="main">', $txt['manual_index_main_menu'], '</h2>
	<p>', $txt['manual_index_suppossing_guest'], '</p>
	<ul>
		<li>', $txt['manual_index_home_desc_part1'], '<a href="', $scripturl, '?action=help;page=index#board">', $txt['manual_index_home_desc_link_board'], '</a>', $txt['manual_index_home_desc_part2'], '</li>
		<li>', $txt['manual_index_help_desc'], '</li>
		<li>', $txt['manual_index_search_desc_part1'], '<a href="', $scripturl, '?action=help;page=searching">', $txt['manual_index_search_desc_link_searching'], '</a>', $txt['manual_index_search_desc_part2'], '</li>
		<li>', $txt['manual_index_calendar_desc_part1'], '<a href="', $scripturl, '?action=help;page=post#calendar">', $txt['manual_index_calendar_desc_link_posting_calendar'], '</a>', $txt['manual_index_calendar_desc_part2'], '</li>
		<li>', $txt['manual_index_login_desc_part1'], '<a href="', $scripturl, '?action=help;page=loginout">', $txt['manual_index_login_desc_link_loginout'], '</a>', $txt['manual_index_login_desc_part2'], '</li>
		<li>', $txt['manual_index_register_desc_part1'], '<a href="', $scripturl, '?action=help;page=registering">', $txt['manual_index_register_desc_link_registering'], '</a>', $txt['manual_index_register_desc_part2'], '</li>
	</ul>
	<p>', $txt['manual_index_once_registered'], '</p>
	<ul>
		<li>', $txt['manual_index_home_reg'], '</li>
		<li>', $txt['manual_index_help_reg'], '</li>
		<li>', $txt['manual_index_search_reg'], '</li>
		<li>', $txt['manual_index_profile_reg_part1'], '<a href="', $scripturl, '?action=help;page=profile">', $txt['manual_index_profile_reg_link_profile'], '</a>', $txt['manual_index_profile_reg_part2'], '</li>
		<li>', $txt['manual_index_calendar_reg'], '</li>
		<li>', $txt['manual_index_logout_reg_part1'], '<a href="', $scripturl, '?action=help;page=loginout#logout">', $txt['manual_index_logout_reg_link_loginout_logout'], '</a>', $txt['manual_index_logout_reg_part2'], '</li>
	</ul>
	<p>', $txt['manual_index_forum_admins_note_presentation'], '</p>
	<h2 id="board">', $txt['manual_index_sec_board_index'], '</h2>
	<p>', $txt['manual_index_sec_board_index_def'], '</p>
	<div style="border: solid 1px;">
		<div style="padding: 2px 30px;">
			<table width="100%" cellpadding="3" cellspacing="0">
				<tr>
					<td valign="bottom"><span class="nav"><img src="', $settings['images_url'], '/icons/folder_open.gif" alt="+" border="0" />&nbsp; <b><a href="', $scripturl, '?action=help;page=index#board" class="nav">', $txt['manual_index_forum_name'], '</a></b></span></td>
				</tr>
			</table><script language="JavaScript1.2" type="text/javascript">
//<![CDATA[
			var collapseExpand = false;
			function collapseExpandCategory()
			{
					document.getElementById("collapseArrow").src = smf_images_url + "/" + (collapseExpand ? "collapse.gif" : "expand.gif");
					document.getElementById("collapseArrow").alt = collapseExpand ? "-" : "+";
					document.getElementById("collapseCategory").style.display = collapseExpand ? "" : "none";
					collapseExpand = !collapseExpand;
			}
			function markBoardRead()
			{
					document.getElementById("board-new-or-not").src = smf_images_url + "/" + "off.gif";
					document.getElementById("board-new-or-not").alt = "', $txt['manual_index_no_new'], '";
			}
//]]>
</script>
			<div class="tborder">
				<table border="0" width="100%" cellspacing="1" cellpadding="5">
					<tr>
						<td colspan="4" class="catbg" height="18"><a href="javascript:collapseExpandCategory();"><img src="', $settings['images_url'], '/collapse.gif" alt="-" border="0" id="collapseArrow" name="collapseArrow" /></a>&nbsp; <a href="javascript:collapseExpandCategory();" class="board">', $txt['manual_index_cat_name'], '</a></td>
					</tr>
					<tr id="collapseCategory" class="windowbg2">
						<td class="windowbg" width="6%" align="center" valign="top"><img src="', $settings['images_url'], '/on.gif" id="board-new-or-not" alt="', $txt['manual_index_new_posts'], '" name="board-new-or-not" /></td>
						<td align="left" class="windowbg"><b><a href="', $scripturl, '?action=help;page=index#message" class="board">', $txt['manual_index_board_name'], '</a></b><br />
						', $txt['manual_index_board_desc'], '</td>
						<td class="windowbg" valign="middle" align="center" style="width: 12ex;"><span class="smalltext">', $txt['manual_index_topics_posts'], '</span></td>
						<td class="smalltext" valign="middle" width="22%" class="windowbg">', $txt['manual_index_date_time'], '</td>
					</tr>
				</table>
			</div>';
    // This changes dependant on theme really...
    $mark_read_button = array('markread' => array('text' => 452, 'image' => 'markread.gif', 'lang' => true, 'url' => 'javascript:markBoardRead();'));
    if (!empty($settings['use_tabs'])) {
        echo '
		<table border="0" width="100%" cellspacing="0" cellpadding="5">
			<tr>
				<td align="', !$context['right_to_left'] ? 'left' : 'right', '" class="smalltext">
					<img src="' . $settings['images_url'] . '/new_some.gif" alt="" align="middle" /> ', $txt['manual_index_new_posts'], '
					<img src="' . $settings['images_url'] . '/new_none.gif" alt="" align="middle" style="margin-left: 4ex;" /> ', $txt['manual_index_no_new'], '
				</td>
				<td align="', !$context['right_to_left'] ? 'right' : 'left', '">
					<table cellpadding="0" cellspacing="0" border="0" style="position: relative; top: -5px;">
						<tr>
							', template_button_strip($mark_read_button, 'top', false, 'align="right" class="smalltext"'), '
						</tr>
					</table>
				</td>
			</tr>
		</table>';
    } else {
        echo '
			<br />
			<div class="tborder" style="padding: 3px;">
				<table border="0" width="100%" cellspacing="0" cellpadding="5">
					<tr class="titlebg">
						<td align="left" class="smalltext">';
        // To back support the classic theme we do a little hack here...
        if (file_exists($settings['theme_dir'] . '/images/' . $context['user']['language'] . '/new_some.gif')) {
            echo '
				<img src="', $settings['images_url'], '/', $context['user']['language'], '/new_some.gif" alt="', $txt['manual_index_new_posts'], '" border="0" />&nbsp;&nbsp;<img src="', $settings['images_url'], '/', $context['user']['language'], '/new_none.gif" alt="', $txt['manual_index_no_new'], '" border="0" />';
        } else {
            echo '
				<img src="', $settings['images_url'], '/new_some.gif" alt="" align="middle" />&nbsp; ', $txt['manual_index_new_posts'], '<img src="', $settings['images_url'], '/new_none.gif" alt="" align="middle" style="margin-left: 4ex;" />&nbsp; ', $txt['manual_index_no_new'];
        }
        echo '
						</td>
						', template_button_strip($mark_read_button, 'top', false, 'align="right" class="smalltext"'), '
					</tr>
				</table>
			</div><br />';
    }
    echo '
		</div>
	</div><br />
		<ul>
		<li>', $txt['manual_index_f_name'], '</li>
		<li>', $txt['manual_index_cat'], '</li>
		<li>', $txt['manual_index_b_name_part1'], '<a href="', $scripturl, '?action=help;page=index#message">', $txt['manual_index_b_name_link_message'], '</a>', $txt['manual_index_b_name_part2'], '</li>
		<li>', $txt['manual_index_b_desc'], '</li>
		<li>', $txt['manual_index_n_no_n_posts'], '</li>
		<li>', $txt['manual_index_m_read'], '</li>
	</ul>
	<h2 id="message">', $txt['manual_index_sec_msg_index'], '</h2>
	<p>', $txt['manual_index_sec_msg_index_def'], '</p>
	<div style="border: solid 1px;">
		<div style="padding: 2px 30px;">
			<script language="JavaScript1.2" type="text/javascript">
//<![CDATA[
			var currentSort = false;
			function sortLastPost()
			{
					document.getElementById("sort-arrow").src = smf_images_url + "/" + (currentSort ? "sort_down.gif" : "sort_up.gif");
					document.getElementById("sort-arrow").alt = "";
					currentSort = !currentSort;
			}
			function markMessageRead()
			{
					document.getElementById("message-new-or-not").style.display = "none";
			}
//]]>
</script>
			<table width="100%" cellpadding="3" cellspacing="0">
				<tr>
					<td><span class="nav"><img src="', $settings['images_url'], '/icons/folder_open.gif" alt="+" border="0" />&nbsp; <b><a href="', $scripturl, '?action=help;page=index#board" class="nav">', $txt['manual_index_forum_name'], '</a></b><br />
					<img src="', $settings['images_url'], '/icons/linktree_side.gif" alt="|-" border="0" /> <img src="', $settings['images_url'], '/icons/folder_open.gif" alt="+" border="0" />&nbsp; <b><a href="', $scripturl, '?action=help;page=index#board" class="nav">', $txt['manual_index_cat_name'], '</a></b><br />
					<img src="', $settings['images_url'], '/icons/linktree_main.gif" alt="| " border="0" /> <img src="', $settings['images_url'], '/icons/linktree_side.gif" alt="|-" border="0" /> <img src="', $settings['images_url'], '/icons/folder_open.gif" alt="+" border="0" />&nbsp; <b><a href="', $scripturl, '?action=help;page=index#message" class="nav">', $txt['manual_index_board_name'], '</a></b></span></td>
				</tr>
			</table>';
    // Create the buttons we need here...
    $mindex_buttons = array('markmread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => 'javascript:markMessageRead();'), 'notify' => array('text' => 'manual_index_notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['manual_index_ru_sure_notify'] . '\');"', 'url' => $scripturl . '?action=help;page=index#message'), 'topic' => array('text' => 'manual_index_start_new', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=help;page=post#newtopic'), 'poll' => array('text' => 'manual_index_new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=help;page=post#newpoll'));
    if (!empty($settings['use_tabs'])) {
        echo '
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td class="middletext">', $txt['manual_index_pages'], ': [<b>1</b>]</td>
					<td align="right" style="padding-right: 1ex;">
						<table cellpadding="0" cellspacing="0">
							<tr>
								', template_button_strip($mindex_buttons, 'bottom'), '
							</tr>
						</table>
					</td>
				</tr>
			</table>';
    } else {
        echo '
			<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="margin-bottom: 1ex;">
				<tr>
					<td align="left" class="catbg" width="100%" height="30">
						<table cellpadding="3" cellspacing="0" width="100%">
							<tr>
								<td><b>', $txt['manual_index_pages'], ':</b> [<b>1</b>]</td>
								', template_button_strip($mindex_buttons, 'bottom', false, 'align="right" nowrap="nowrap" style="font-size: smaller;"'), '
							</tr>
						</table>
					</td>
				</tr>
			</table>';
    }
    echo '
			<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
				<tr class="titlebg">
					<td width="9%" colspan="2"></td>
					<td><a href="', $scripturl, '?action=help;page=index#message">', $txt['manual_index_subject'], '</a></td>
					<td width="14%"><a href="', $scripturl, '?action=help;page=index#message">', $txt['manual_index_started_by'], '</a></td>
					<td width="4%" align="center"><a href="', $scripturl, '?action=help;page=index#message">', $txt['manual_index_replies'], '</a></td>
					<td width="4%" align="center"><a href="', $scripturl, '?action=help;page=index#message">', $txt['manual_index_views'], '</a></td>
					<td width="22%"><a href="javascript:sortLastPost();">', $txt['manual_index_last_post'], ' &nbsp; <img id="sort-arrow" src="', $settings['images_url'], '/sort_down.gif" alt="" border="0" name="sort-arrow" /></a></td>
				</tr>
				<tr>
					<td class="windowbg2" valign="middle" align="center" width="5%"><img src="', $settings['images_url'], '/topic/my_normal_poll.gif" alt="" /></td>
					<td class="windowbg2" valign="middle" align="center" width="4%"><img src="', $settings['images_url'], '/post/xx.gif" alt="" align="middle" /></td>
					<td class="windowbg" valign="middle"><a href="', $scripturl, '?action=help;page=index#topic" class="board">', $txt['manual_index_topic_subject'], '</a> <a href="', $scripturl, '?action=help;page=index#topic"><img id="message-new-or-not" src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" border="0" alt="', $txt['manual_index_new'], '" name="message-new-or-not" /></a></td>
					<td class="windowbg2" valign="middle" width="14%"><a href="', $scripturl, '?action=help;page=profile" class="board">', $txt['manual_index_topic_starter'], '</a></td>
					<td class="windowbg" valign="middle" width="4%" align="center">0</td>
					<td class="windowbg" valign="middle" width="4%" align="center">0</td>
					<td class="windowbg2" valign="middle" width="22%"><span class="smalltext">', $txt['manual_index_last_poster'], '</span></td>
				</tr>
			</table>';
    if (!empty($settings['use_tabs'])) {
        echo '
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td class="middletext">', $txt['manual_index_pages'], ': [<b>1</b>]</td>
					<td align="right" style="padding-right: 1ex;">
						<table cellpadding="0" cellspacing="0">
							<tr>
								', template_button_strip($mindex_buttons, 'top'), '
							</tr>
						</table>
					</td>
				</tr>
			</table>';
    } else {
        echo '
			<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="margin-top: 1ex;">
				<tr>
					<td align="left" class="catbg" width="100%" height="30">
						<table cellpadding="3" cellspacing="0" width="100%">
							<tr>
								<td><b>', $txt['manual_index_pages'], ':</b> [<b>1</b>]</td>
								', template_button_strip($mindex_buttons, 'bottom', false, 'align="right" nowrap="nowrap" style="font-size: smaller;"'), '
							</tr>
						</table>
					</td>
				</tr>
			</table>';
    }
    echo '
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td class="smalltext" align="left" style="padding-top: 1ex;"><img src="', $settings['images_url'], '/topic/my_normal_post.gif" alt="" align="middle" />&nbsp; ', $txt['manual_index_normal_post'], '<br />
					<img src="', $settings['images_url'], '/topic/normal_post.gif" alt="" align="middle" />&nbsp; ', $txt['manual_index_normal_topic'], '<br />
					<img src="', $settings['images_url'], '/topic/hot_post.gif" alt="" align="middle" />&nbsp; ', $txt['manual_index_hot_post'], '<br />
					<img src="', $settings['images_url'], '/topic/veryhot_post.gif" alt="" align="middle" />&nbsp; ', $txt['manual_index_very_hot_post'], '</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" />&nbsp; ', $txt['manual_index_locked'], '<br />
					<img src="', $settings['images_url'], '/topic/normal_post_sticky.gif" alt="" align="middle" />&nbsp; ', $txt['manual_index_sticky'], '<br />
					<img src="', $settings['images_url'], '/topic/normal_poll.gif" alt="" align="middle" />&nbsp; ', $txt['manual_index_poll'], '</td>
					<td class="smalltext" align="right" valign="middle">
						<form action="', $scripturl, '?action=help;page=index" method="get" accept-charset="', $context['character_set'], '">
							<label for="jumpto">', $txt['manual_index_jump_to'], '</label>: <select name="jumpto" id="jumpto" onchange="if (this.options[this.selectedIndex].value) window.location.href=\'', $scripturl, '?action=help;page=index\' + this.options[this.selectedIndex].value;">
								<option value="">
									', $txt['manual_index_destination'], ':
								</option>
								<option value="">
									-----------------------------
								</option>
								<option value="#board">
									', $txt['manual_index_cat_name'], '
								</option>
								<option value="">
									-----------------------------
								</option>
								<option value="#message">
									=&gt; ', $txt['manual_index_board_name'], '
								</option>
								<option value="#message">
									=&gt; ', $txt['manual_index_another_board'], '
								</option>
							</select>&nbsp; <input type="button" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \'', $scripturl, '?action=help;page=index\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" value="', $txt['manual_index_go'], '" />
						</form>
					</td>
				</tr>
			</table><br />
		</div>
	</div><br />
	<ul>
		<li>', $txt['manual_index_nav_tree'], '</li>
		<li>', $txt['manual_index_page_number'], '</li>
		<li>', $txt['manual_index_mark_read_button'], '</li>
		<li>', $txt['manual_index_notify_button'], '</li>
		<li>', $txt['manual_index_new_topic_poll_button_part1'], '<a href="', $scripturl, '?action=help;page=post">', $txt['manual_index_new_topic_poll_button_link_posting'], '</a>', $txt['manual_index_new_topic_poll_button_part2'], '</li>
		<li>', $txt['manual_index_subject_replies_etc'], '</li>
		<li>', $txt['manual_index_topic_icons'], '</li>
		<li>', $txt['manual_index_post_icons'], '</li>
		<li>', $txt['manual_index_topic_subject_links_part1'], '<a href="', $scripturl, '?action=help;page=index#topic">', $txt['manual_index_topic_subject_links_link_topic'], '</a>', $txt['manual_index_topic_subject_links_part2'], '</li>
		<li>', $txt['manual_index_where_topic_part1'], '<a href="', $scripturl, '?action=help;page=profile">', $txt['manual_index_where_topic_link_profile'], '</a>', $txt['manual_index_where_topic_part2'], '</li>
		<li>', $txt['manual_index_jump_to_menu'], '</li>
	</ul>
	<h2 id="topic">', $txt['manual_index_sec_topic'], '</h2>
	<p>', $txt['manual_index_ref_thread'], '</p>';
    // The buttons...
    $display_buttons = array('reply' => array('text' => 'manual_index_reply', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=help;page=post#reply'), 'notify' => array('text' => 'manual_index_notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['manual_index_ru_sure_enable_notify'] . '\');"', 'url' => $scripturl . '?action=help;page=post#topic'), 'markunread' => array('text' => 'manual_index_mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=help;page=post#topic'), 'sendtopic' => array('text' => 'manual_index_send_topic', 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=help;page=post#topic'), 'print' => array('text' => 'manual_index_print', 'image' => 'print.gif', 'lang' => true, 'url' => $scripturl . '?action=help;page=post#topic'));
    echo '
	<div style="border: solid 1px;">
		<div style="padding: 2px 30px;">
			<table width="100%" cellpadding="3" cellspacing="0">
				<tr>
					<td valign="bottom"><span class="nav"><img src="', $settings['images_url'], '/icons/folder_open.gif" alt="+" border="0" />&nbsp; <b><a href="', $scripturl, '?action=help;page=index#board" class="nav">', $txt['manual_index_forum_name'], '</a></b><br />
					<img src="', $settings['images_url'], '/icons/linktree_side.gif" alt="|-" border="0" /> <img src="', $settings['images_url'], '/icons/folder_open.gif" alt="+" border="0" />&nbsp; <b><a href="', $scripturl, '?action=help;page=index#board" class="nav">', $txt['manual_index_cat_name'], '</a></b><br />
					<img src="', $settings['images_url'], '/icons/linktree_main.gif" alt="| " border="0" /> <img src="', $settings['images_url'], '/icons/linktree_side.gif" alt="|-" border="0" /> <img src="', $settings['images_url'], '/icons/folder_open.gif" alt="+" border="0" />&nbsp; <b><a href="', $scripturl, '?action=help;page=index#message" class="nav">', $txt['manual_index_board_name'], '</a></b><br />
					<img src="', $settings['images_url'], '/icons/linktree_main.gif" alt="| " border="0" /> <img src="', $settings['images_url'], '/icons/linktree_main.gif" alt="| " border="0" /> <img src="', $settings['images_url'], '/icons/linktree_side.gif" alt="|-" border="0" /> <img src="', $settings['images_url'], '/icons/folder_open.gif" alt="+" border="0" />&nbsp; <b><a href="', $scripturl, '?action=help;page=index#topic" class="nav">', $txt['manual_index_topic_subject'], '</a></b></span></td>
				</tr>
			</table>';
    if (!empty($settings['use_tabs'])) {
        echo '
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td class="middletext" valign="bottom" style="padding-bottom: 4px;"><b>', $txt['manual_index_pages'], ':</b> [<b>1</b>]</td>
					<td align="right" style="padding-right: 1ex;">
						<table cellpadding="0" cellspacing="0">
							<tr>
								', template_button_strip($display_buttons, 'bottom'), '
							</tr>
						</table>
					</td>
				</tr>
			</table>';
    } else {
        echo '
			<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="margin-bottom: 1ex;">
				<tr>
					<td align="left" class="catbg" width="100%" height="35">
						<table cellpadding="3" cellspacing="0" width="100%">
							<tr>
								<td><b>', $txt['manual_index_pages'], ':</b> [<b>1</b>]</td>
								', template_button_strip($display_buttons, 'bottom', false, 'align="right" style="font-size: smaller;"'), '
							</tr>
						</table>
					</td>
				</tr>
			</table>';
    }
    echo '
			<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;">
				<tr class="catbg3">
					<td valign="middle" align="left" width="2%" style="padding-left: 6px;"><img src="', $settings['images_url'], '/topic/normal_post.gif" alt="" align="middle" /></td>
					<td width="13%">', $txt['manual_index_author'], '</td>
					<td valign="middle" align="left" width="85%" style="padding-left: 6px;">', $txt['manual_index_topic'], ': ', $txt['manual_index_topic_subject'], ' &nbsp;(', $txt['manual_index_read_x_times'], ')</td>
				</tr>
			</table>
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="bordercolor">
				<tr>
					<td style="padding: 1px;">
						<table cellpadding="3" cellspacing="0" border="0" width="100%">
							<tr>
								<td class="windowbg">
									<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
										<tr>
											<td valign="top" width="15%" rowspan="2" style="overflow: hidden;"><b><a href="', $scripturl, '?action=help;page=profile" class="board" title="', $txt['manual_index_view_author_profile'], '">', $txt['manual_index_author'], '</a></b><br />
											<span class="smalltext">', $txt['manual_index_member_group'], '<br />
											', $txt['manual_index_post_group'], '<br />
											<img src="', $settings['images_url'], '/star.gif" alt="*" border="0" /><br />
											', $txt['manual_index_post_count'], '<br />
											<br />
											<br />
											<br />
											<a href="', $scripturl, '?action=help;page=profile" title="', $txt['manual_index_view_profile'], '"><img src="', $settings['images_url'], '/icons/profile_sm.gif" border="0" alt="', $txt['manual_index_view_profile'], '" /></a> <a href="mailto:author@some.address" title="', $txt['manual_index_email'], '"><img src="', $settings['images_url'], '/email_sm.gif" border="0" alt="', $txt['manual_index_email'], '" /></a> <a href="', $scripturl, '?action=help;page=pm" title="', $txt['manual_index_personal_msg'], '"><img src="', $settings['images_url'], '/im_off.gif" border="0" alt="', $txt['manual_index_personal_msg'], '" /></a></span></td>
											<td valign="top" width="85%" height="100%">
												<table width="100%" border="0">
													<tr>
														<td width="20" align="left" valign="middle"><a href="index.php?topic=2.msg2#msg2"><img src="', $settings['images_url'], '/post/xx.gif" alt="" border="0" /></a></td>
														<td align="left" valign="middle">
															<b><a href="', $scripturl, '?action=help;page=index#topic" class="board">', $txt['manual_index_topic_subject'], '</a></b>
															<div class="smalltext">
																&laquo; ', $txt['manual_index_post_date_time'], ' &raquo;
															</div>
														</td>
														<td align="right" valign="bottom" height="20" style="font-size: smaller;"><a href="', $scripturl, '?action=help;page=post#quote">', create_button('quote.gif', 'manual_index_reply_quote', 'smf240', 'align="middle"'), '</a></td>
													</tr>
												</table>
												<hr width="100%" size="1" class="hrcolor" />
												<div style="overflow: auto; width: 100%;">
													', $txt['manual_index_topic_text'], '&nbsp;<img src="', $modSettings['smileys_url'], '/', $context['user']['smiley_set'], '/smiley.gif" border="0" alt="', $txt['manual_index_smiley'], '" />
												</div>
											</td>
										</tr>
										<tr>
											<td valign="bottom" class="smalltext">
												<table width="100%" border="0" style="table-layout: fixed;">
													<tr>
														<td align="right" valign="bottom" class="smalltext"><a href="', $scripturl, '?action=help;page=index#topic" class="board" style="font-size: x-small;">', $txt['manual_index_report_to_mod'], '</a>&nbsp;&nbsp; <img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />&nbsp; ', $txt['manual_index_logged'], '</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table><a name="lastPost" id="lastPost"></a>';
    if (!empty($settings['use_tabs'])) {
        echo '
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td class="middletext"><b>', $txt['manual_index_pages'], ':</b> [<b>1</b>]</td>
					<td align="right" style="padding-right: 1ex;">
						<table cellpadding="0" cellspacing="0">
							<tr>
								', template_button_strip($display_buttons, 'top', false), '
							</tr>
						</table>
					</td>
				</tr>
			</table>';
    } else {
        echo '
			<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="margin-top: 1ex;">
				<tr>
					<td align="left" class="catbg" width="100%" height="30">
						<table cellpadding="3" cellspacing="0" width="100%">
							<tr>
								<td><b>', $txt['manual_index_pages'], ':</b> [<b>1</b>]</td>
								', template_button_strip($display_buttons, 'top', false, 'align="right" style="font-size: smaller;"'), '
							</tr>
						</table>
					</td>
				</tr>
			</table>';
    }
    echo '
			<div style="padding-top: 4px; padding-bottom: 4px;"></div>
			<div align="right" style="float: right; margin-bottom: 1ex;">
				<form action="', $scripturl, '?action=help;page=index" method="get" accept-charset="', $context['character_set'], '">
					<label for="jump2">', $txt['manual_index_jump_to'], '</label>: <select name="jump2" id="jump2" onchange="if (this.options[this.selectedIndex].value) window.location.href=\'', $scripturl, '?action=help;page=index\' + this.options[this.selectedIndex].value;">
						<option value="">
							', $txt['manual_index_destination'], ':
						</option>
						<option value="">
							-----------------------------
						</option>
						<option value="#board">
							', $txt['manual_index_cat_name'], '
						</option>
						<option value="">
							-----------------------------
						</option>
						<option value="#message">
							=&gt; ', $txt['manual_index_board_name'], '
						</option>
						<option value="#message">
							=&gt; ', $txt['manual_index_another_board'], '
						</option>
					</select>&nbsp; <input type="button" onclick="if (this.form.jump2.options[this.form.jump2.selectedIndex].value) window.location.href = \'', $scripturl, '?action=help;page=index\' + this.form.jump2.options[this.form.jump2.selectedIndex].value;" value="', $txt['manual_index_go'], '" />
				</form>
			</div><br />
			<br clear="all" />
		</div>
	</div><br />
	<ul>
		<li>', $txt['manual_index_navigation_tree'], '</li>
		<li>', $txt['manual_index_prev_next'], '</li>
		<li>', $txt['manual_index_page_no_link'], '</li>
		<li>', $txt['manual_index_reply_button_part1'], '<a href="', $scripturl, '?action=help;page=post#reply">', $txt['manual_index_reply_button_link_posting_reply'], '</a>', $txt['manual_index_reply_button_part2'], '</li>
		<li>', $txt['manual_index_notify_button_enables'], '</li>
		<li>', $txt['manual_index_mark_unread_button'], '</li>
		<li>', $txt['manual_index_send_topic_button'], '</li>
		<li>', $txt['manual_index_print_button'], '</li>
		<li>', $txt['manual_index_author_name_link_part1'], '<a href="', $scripturl, '?action=help;page=profile">', $txt['manual_index_author_name_link_link_profile'], '</a></li>
		<li>', $txt['manual_index_author_details'], '</li>
		<li>', $txt['manual_index_topic_subject_links_start'], '</li>
		<li>', $txt['manual_index_quote_button_part1'], '<a href="', $scripturl, '?action=help;page=post#quote">', $txt['manual_index_quote_button_link_posting_quote'], '</a>', $txt['manual_index_quote_button_part2'], '</li>
		<li>', $txt['manual_index_modify_delete_part1'], '<a href="', $scripturl, '?action=help;page=post#modify">', $txt['manual_index_modify_delete_link_posting_modify'], '</a>', $txt['manual_index_modify_delete_part2'], '</li>
		<li>', $txt['manual_index_report_to_moderator'], '</li>
		<li>', $txt['manual_index_logged_IP'], '</li>
		<li>', $txt['manual_index_jump_to_menu_provides'], '</li>
	</ul>';
}
Example #20
0
<?php

if (!isset($var['alliance_id'])) {
    SmrSession::updateVar('alliance_id', $player->getAllianceID());
}
$alliance =& SmrAlliance::getAlliance($var['alliance_id'], $player->getGameID());
Globals::canAccessPage('AllianceMOTD', $player, array('AllianceID' => $alliance->getAllianceID()));
$template->assign('PageTopic', $alliance->getAllianceName() . ' (' . $alliance->getAllianceID() . ')');
require_once get_file_loc('menu.inc');
create_alliance_menu($alliance->getAllianceID(), $alliance->getLeaderID());
$PHP_OUTPUT .= '<div align="center">';
if ($alliance->hasImageURL()) {
    $PHP_OUTPUT .= '<img class="alliance" src="' . $alliance->getImageURL() . '" alt="' . htmlspecialchars($alliance->getAllianceName()) . ' Banner"><br /><br />';
}
$PHP_OUTPUT .= '<span class="yellow">Message from your leader</span><br /><br />';
$PHP_OUTPUT .= bbifyMessage($alliance->getMotD());
$role_id = $player->getAllianceRole($alliance->getAllianceID());
$db->query('SELECT * FROM alliance_has_roles WHERE alliance_id = ' . $db->escapeNumber($player->getAllianceID()) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND role_id = ' . $db->escapeNumber($role_id));
$db->nextRecord();
if ($db->getBoolean('change_mod') || $db->getBoolean('change_pass')) {
    $PHP_OUTPUT .= '<br /><br />';
    $container = create_container('skeleton.php', 'alliance_stat.php');
    $container['alliance_id'] = $alliance->getAllianceID();
    $PHP_OUTPUT .= create_button($container, 'Edit');
}
$PHP_OUTPUT .= '</div>';
Example #21
0
function get_jumpgate($sid)
{
    global $uid;
    global $map_info;
    if (!in_array($sid, $map_info->get_possible_scan_systems()) && !in_array($sid, $map_info->get_all_fleet_scans())) {
        return false;
    }
    // BUTTON Definitionen
    $buttonShape = "button_circle_30x30_shadow";
    $system_info = $map_info->get_system($sid);
    $j_pid = get_pid_of_jumpgate($sid);
    // pid des jumpgates
    $j_uname = get_name_by_uid($j_uid);
    // name des jumpgatebesitzers
    $sth = mysql_query("select prod_id from jumpgates where pid='{$j_pid}'");
    if (!$sth || mysql_num_rows($sth) == 0) {
        return 0;
    }
    list($j_prodid) = mysql_fetch_row($sth);
    $j_prodname = get_name_by_prod_id($j_prodid);
    $j_pic = PIC_ROOT . get_pic($j_prodid);
    // Ok, Buttons kreieren und in $new_button[] speichern
    $new_button = array();
    $new_button[] = create_button($buttonShape, "button_face_info", "alert('not yet implemented')", 0, "show info");
    $new_header = create_header($j_pic, "Jumpgate in " . $system_info["name"], "", "", "");
    // Button in das Header Tag einfügen
    for ($i = 0; $i < sizeof($new_button); $i++) {
        $new_header .= $new_button[$i];
    }
    $new_header .= "</SR_HEAD>";
    echo "newItemBox\n";
    // nötig um zu ermitteln wie der inhalt behnadelt werden soll!
    echo $new_header;
}
Example #22
0
function template_merge()
{
    global $context, $settings, $options, $txt, $scripturl;
    echo '
		<form action="' . $scripturl . '?action=mergetopics;from=' . $context['origin_topic'] . ';targetboard=' . $context['target_board'] . ';board=' . $context['current_board'] . '.0" method="post" accept-charset="', $context['character_set'], '">
			<table border="0" width="540" cellspacing="1" class="bordercolor" cellpadding="4" align="center">
				<tr class="catbg3">
					<td>' . $txt['smf252'] . '</td>
				</tr>
				<tr>
					<td class="windowbg">' . $txt['smf276'] . '</td>
				</tr>
				<tr>
					<td colspan="2" class="titlebg">
						<table cellpadding="0" cellspacing="0" border="0"><tr>
							<td><b>' . $txt[139] . ':</b> ' . $context['page_index'] . '</td>
						</tr></table>
					</td>
				</tr>
				<tr>
					<td class="windowbg" valign="middle" align="center">
						<table border="0">
							<tr>
								<td align="right"><br /><b>' . $txt['smf266'] . ':</b> <br /></td>
								<td align="left"><input type="hidden" name="from" value="' . $context['origin_topic'] . '" /><br />' . $context['origin_subject'] . '</td>
							</tr><tr>';
    if (!empty($context['boards']) && count($context['boards']) > 1) {
        echo '
								<td align="right"><br /><b>' . $txt['smf267'] . ':</b></td>
								<td align="left">
									<br />
									<select name="targetboard" onchange="this.form.submit();">';
        foreach ($context['boards'] as $board) {
            echo '
										<option value="', $board['id'], '"', $board['id'] == $context['target_board'] ? ' selected="selected"' : '', '>', $board['category'], ' - ', $board['name'], '</option>';
        }
        echo '
									</select> <noscript><input type="submit" value="', $txt[462], '" /></noscript>
								</td>';
    }
    echo '
							</tr><tr>
								<td align="right" valign="top"><br /><b>' . $txt['smf269'] . ':</b></td>
								<td align="left" style="white-space: nowrap;">
									<br />
									<table>';
    $merge_button = create_button('merge.gif', 'smf252', '');
    foreach ($context['topics'] as $topic) {
        echo '
										<tr>
											<td valign="bottom">
												<a href="' . $scripturl . '?action=mergetopics;sa=options;board=' . $context['current_board'] . '.0;from=' . $context['origin_topic'] . ';to=' . $topic['id'] . ';sesc=' . $context['session_id'] . '">' . $merge_button . '</a>&nbsp;
											</td>
											<td valign="middle" style="white-space: nowrap;">
												<a href="' . $scripturl . '?topic=' . $topic['id'] . '.0" target="_blank">' . $topic['subject'] . '</a> ' . $txt[109] . ' ' . $topic['poster']['link'] . '
											</td>
										</tr>';
    }
    echo '
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="2" class="titlebg">
						<table cellpadding="0" cellspacing="0" border="0"><tr>
							<td><b>' . $txt[139] . ':</b> ' . $context['page_index'] . '</td>
						</tr></table>
					</td>
				</tr>
			</table>
		</form>';
}
function template_search_results()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    // This splits broadly into two types of template... complete results first.
    if (!empty($context['search_params']['show_complete'])) {
        echo '
		<table border="0" width="100%" align="center" cellpadding="3" cellspacing="1" class="bordercolor">
			<tr class="titlebg">
				<td colspan="3">', $txt['pm_search_results'], '</td>
			</tr>
			<tr class="catbg" height="30">
				<td colspan="3"><strong>', $txt['pages'], ':</strong> ', $context['page_index'], '</td>
			</tr>
		</table>';
    } else {
        echo '
		<table border="0" width="100%" align="center" cellpadding="3" cellspacing="1" class="bordercolor">
			<tr class="titlebg">
				<td colspan="3">', $txt['pm_search_results'], '</td>
			</tr>
			<tr class="catbg">
				<td colspan="3"><strong>', $txt['pages'], ':</strong> ', $context['page_index'], '</td>
			</tr>
			<tr class="titlebg">
				<td width="30%">', $txt['date'], '</td>
				<td width="50%">', $txt['subject'], '</td>
				<td width="20%">', $txt['from'], '</td>
			</tr>';
    }
    $alternate = true;
    // Print each message out...
    foreach ($context['personal_messages'] as $message) {
        // We showing it all?
        if (!empty($context['search_params']['show_complete'])) {
            // !!! This still needs to be made pretty.
            echo '
		<br />
		<table width="100%" align="center" cellpadding="3" cellspacing="1" border="0" class="bordercolor">
			<tr class="titlebg">
				<td align="left">
					<div class="floatleft">
					', $message['counter'], '&nbsp;&nbsp;<a href="', $message['href'], '">', $message['subject'], '</a>
					</div>
					<div class="floatright">
						', $txt['search_on'], ': ', $message['time'], '
					</div>
				</td>
			</tr>
			<tr class="catbg">
				<td>', $txt['from'], ': ', $message['member']['link'], ', ', $txt['to'], ': ';
            // Show the recipients.
            // !!! This doesn't deal with the sent item searching quite right for bcc.
            if (!empty($message['recipients']['to'])) {
                echo implode(', ', $message['recipients']['to']);
            } elseif ($context['folder'] != 'sent') {
                echo '(', $txt['pm_undisclosed_recipients'], ')';
            }
            echo '
				</td>
			</tr>
			<tr class="windowbg2" valign="top">
				<td>', $message['body'], '</td>
			</tr>
			<tr class="windowbg">
				<td align="right" class="middletext">';
            if ($context['can_send_pm']) {
                $quote_button = create_button('quote.gif', 'reply_quote', 'reply_quote', 'align="middle"');
                $reply_button = create_button('im_reply.gif', 'reply', 'reply', 'align="middle"');
                // You can only reply if they are not a guest...
                if (!$message['member']['is_guest']) {
                    echo '
							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], '
							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator'];
                } else {
                    echo '
							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator'];
                }
            }
            echo '
				</td>
			</tr>
		</table>';
        } else {
            // !!! No context at all of the search?
            echo '
			<tr class="', $alternate ? 'windowbg' : 'windowbg2', '" valign="top">
				<td>', $message['time'], '</td>
				<td>', $message['link'], '</td>
				<td>', $message['member']['link'], '</td>
			</tr>';
        }
        $alternate = !$alternate;
    }
    // Finish off the page...
    if (!empty($context['search_params']['show_complete'])) {
        // No results?
        if (empty($context['personal_messages'])) {
            echo '
		<table width="100%" align="center" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-width: 0 1px 1px 1px;">
			<tr class="windowbg">
				<td align="center">', $txt['pm_search_none_found'], '</td>
			</tr>
		</table>';
        } else {
            echo '
		<br />';
        }
        echo '
		<table width="100%" align="center" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-width: 0 1px 1px 1px;">
			<tr class="catbg" height="30">
				<td colspan="3"><strong>', $txt['pages'], ':</strong> ', $context['page_index'], '</td>
			</tr>
		</table>';
    } else {
        if (empty($context['personal_messages'])) {
            echo '
			<tr class="windowbg2">
				<td colspan="3" align="center">', $txt['pm_search_none_found'], '</td>
			</tr>';
        }
        echo '
			<tr class="catbg">
				<td colspan="3"><strong>', $txt['pages'], ':</strong> ', $context['page_index'], '</td>
			</tr>
		</table>';
    }
}
Example #24
0
$results = $var['results'];
$PHP_OUTPUT .= $results[0];
$PHP_OUTPUT .= '<br /><img src="images/portAttack.jpg" width="480px" height="330px" alt="Port Attack" title="Port Attack"><br />';
$PHP_OUTPUT .= $results[1];
$PHP_OUTPUT .= '<br />';
if ($var['continue'] && !isset($var['override_death'])) {
    $container = array();
    $container['url'] = 'port_attack_processing_new.php';
    $PHP_OUTPUT .= '<div align="center">';
    $PHP_OUTPUT .= create_button($container, 'Continue Attack');
    $PHP_OUTPUT .= '</div>';
} elseif (isset($var['override_death'])) {
    $PHP_OUTPUT .= '<div align="center"><h2>The battle has ended!</h2><br />';
    $container = array();
    $container['url'] = 'skeleton.php';
    $container['body'] = 'current_sector.php';
    $PHP_OUTPUT .= create_button($container, 'Current Sector');
} else {
    $PHP_OUTPUT .= '<div align="center"><h2>The battle has ended!</h2><br />';
    $container = array();
    $container['url'] = 'skeleton.php';
    $container['body'] = 'current_sector.php';
    $PHP_OUTPUT .= create_button($container, 'Current Sector');
    $PHP_OUTPUT .= '&nbsp;';
    //we can now claim
    $PHP_OUTPUT .= create_button(create_container('port_claim_processing.php', ''), 'Claim this port for your race');
    $PHP_OUTPUT .= '&nbsp;';
    $PHP_OUTPUT .= create_button(create_container('skeleton.php', 'port_loot.php'), 'Loot the port');
    $PHP_OUTPUT .= '</div>';
}
/**
 * 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>';
}
Example #26
0
function print_button($target, $name, $value)
{
    echo create_button($target, $name, $value);
}
Example #27
0
function template_merge()
{
    global $context, $txt, $scripturl;
    echo '
		<div id="merge_topics">
			<div class="cat_bar">
				<h3>', $txt['merge'], '</h3>
			</div>
			<div class="orange_container cleantop">
				', $txt['merge_desc'], '
			</div>
			<br>
			<div class="blue_container">
				<div class="content">
					<dl class="settings merge_topic">
						<dt>
							<strong>', $txt['topic_to_merge'], ':</strong>
						</dt>
						<dd>
							', $context['origin_subject'], '
						</dd>';
    if (!empty($context['boards']) && count($context['boards']) > 1) {
        echo '
						<dt>
							<strong>', $txt['target_board'], ':</strong>
						</dt>
						<dd>
							<form action="' . $scripturl . '?action=mergetopics;from=' . $context['origin_topic'] . ';targetboard=' . $context['target_board'] . ';board=' . $context['current_board'] . '.0" method="post" accept-charset="UTF-8">
								<input type="hidden" name="from" value="' . $context['origin_topic'] . '" />
								<select name="targetboard" onchange="this.form.submit();">';
        foreach ($context['boards'] as $board) {
            echo '
									<option value="', $board['id'], '"', $board['id'] == $context['target_board'] ? ' selected="selected"' : '', '>', $board['category'], ' - ', $board['name'], '</option>';
        }
        echo '
								</select>
								<input type="submit" value="', $txt['go'], '" class="button_submit" />
							</form>
						</dd>';
    }
    echo '
					</dl>
					<hr class="hrcolor" />
					<dl class="settings merge_topic">
						<dt>
							<strong>', $txt['merge_to_topic_id'], ': </strong>
						</dt>
						<dd>
							<form action="', $scripturl, '?action=mergetopics;sa=options" method="post" accept-charset="UTF-8">
								<input type="hidden" name="topics[]" value="', $context['origin_topic'], '" />
								<input type="text" name="topics[]" class="input_text" />
								<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
								<input type="submit" value="', $txt['merge'], '" class="button_submit" />
							</form>
						</dd>';
    echo '
					</dl>
				</div>
			</div><br />
			<div class="cat_bar">
				<h3>', $txt['target_topic'], '</h3>
			</div>
			<div class="pagesection">
				<strong>', $txt['pages'], ':</strong> ', $context['page_index'], '
			</div>
			<div class="blue_container">
				<div class="content">
					<ul class="reset merge_topics">';
    $merge_button = create_button('merge', 'merge');
    foreach ($context['topics'] as $topic) {
        echo '
						<li class="clear smallpadding">
							<a href="', $scripturl, '?action=mergetopics;sa=options;board=', $context['current_board'], '.0;from=', $context['origin_topic'], ';to=', $topic['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $merge_button, '</a>&nbsp;
							<a href="', $scripturl, '?topic=', $topic['id'], '.0" target="_blank" class="new_win">', $topic['subject'], '</a> ', $txt['started_by'], ' ', $topic['poster']['link'], '
						</li>
						';
    }
    echo '
					</ul>
				</div>
			</div>
			<div class="pagesection">
				<strong>', $txt['pages'], ':</strong> ', $context['page_index'], '
			</div>
		</div>
	<br class="clear" />';
}
function template_search_results()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    echo '
		<div class="cat_bar">
			<h3 class="catbg">', $txt['pm_search_results'], '</h3>
		</div>
		<div class="pagesection">
			<strong>', $txt['pages'], ':</strong> ', $context['page_index'], '
		</div>';
    // complete results ?
    if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
        echo '
	<table width="100%" class="table_grid">
	<thead>
		<tr class="catbg">
			<th class="lefttext first_th" width="30%">', $txt['date'], '</th>
			<th class="lefttext" width="50%">', $txt['subject'], '</th>
			<th class="lefttext last_th" width="20%">', $txt['from'], '</th>
		</tr>
	</thead>
	<tbody>';
    }
    $alternate = true;
    // Print each message out...
    foreach ($context['personal_messages'] as $message) {
        // We showing it all?
        if (!empty($context['search_params']['show_complete'])) {
            echo '
			<div class="title_bar">
				<h3 class="titlebg">
					<span class="floatright">', $txt['search_on'], ': ', $message['time'], '</span>
					<span class="floatleft">', $message['counter'], '&nbsp;&nbsp;<a href="', $message['href'], '">', $message['subject'], '</a></span>
				</h3>
			</div>
			<div class="cat_bar">
				<h3 class="catbg">', $txt['from'], ': ', $message['member']['link'], ', ', $txt['to'], ': ';
            // Show the recipients.
            // !!! This doesn't deal with the sent item searching quite right for bcc.
            if (!empty($message['recipients']['to'])) {
                echo implode(', ', $message['recipients']['to']);
            } elseif ($context['folder'] != 'sent') {
                echo '(', $txt['pm_undisclosed_recipients'], ')';
            }
            echo '
				</h3>
			</div>
			<div class="windowbg', $alternate ? '2' : '', '">
				<span class="topslice"><span></span></span>
				<div class="content">
					', $message['body'], '
					<p class="pm_reply righttext middletext">';
            if ($context['can_send_pm']) {
                $quote_button = create_button('quote.gif', 'reply_quote', 'reply_quote', 'align="middle"');
                $reply_button = create_button('im_reply.gif', 'reply', 'reply', 'align="middle"');
                // You can only reply if they are not a guest...
                if (!$message['member']['is_guest']) {
                    echo '
								<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], '
								<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator'];
                } else {
                    echo '
								<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator'];
                }
            }
            echo '
					</p>
				</div>
				<span class="botslice"><span></span></span>
			</div>';
        } else {
            // !!! No context at all of the search?
            echo '
			<tr class="', $alternate ? 'windowbg' : 'windowbg2', '" valign="top">
				<td>', $message['time'], '</td>
				<td>', $message['link'], '</td>
				<td>', $message['member']['link'], '</td>
			</tr>';
        }
        $alternate = !$alternate;
    }
    // Finish off the page...
    if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
        echo '
		</tbody>
		</table>';
    }
    // No results?
    if (empty($context['personal_messages'])) {
        echo '
		<div class="windowbg">
			<span class="topslice"><span></span></span>
			<div class="content">
				<p class="centertext">', $txt['pm_search_none_found'], '</p>
			</div>
			<span class="botslice"><span></span></span>
		</div>';
    }
    echo '
		<div class="pagesection">
			<strong>', $txt['pages'], ':</strong> ', $context['page_index'], '
		</div>';
}
Example #29
0
function template_arcade_game_highscore()
{
    global $scripturl, $txt, $context, $settings;
    if (isset($context['arcade']['submit'])) {
        if ($context['arcade']['submit'] == 'newscore') {
            $score =& $context['arcade']['new_score'];
            echo '
	<div class="cat_bar">
		<h3 class="catbg">
			', $txt['arcade_submit_score'], '
		</h3>
	</div>
	<div class="windowbg2">
		<span class="topslice"><span></span></span>
		<div style="padding: 0 0.5em">';
            // No permission to save
            if (!$score['saved']) {
                echo '
			<div>
				', $txt[$score['error']], '<br />
				<strong>', $txt['arcade_score'], ':</strong> ', $score['score'], '
			</div>';
            } else {
                echo '
			<div>
				', $txt['arcade_score_saved'], '<br />
				<strong>', $txt['arcade_score'], ':</strong> ', $score['score'], '<br />';
                if ($score['is_new_champion']) {
                    echo '
				', $txt['arcade_you_are_now_champion'], '<br />';
                } elseif ($score['is_personal_best']) {
                    echo '
				', $txt['arcade_this_is_your_best'], '<br />';
                }
                if ($score['can_comment']) {
                    echo '
			</div>
			<div>
				<form action="', $scripturl, '?action=arcade;sa=highscore;game=', $context['game']['id'], ';score=', $score['id'], '" method="post">
					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
					<input type="text" id="new_comment" name="new_comment" style="width: 95%;" />
					<input class="button_submit" type="submit" name="csave" value="', $txt['arcade_save'], '" />
				</form>
			</div>';
                }
            }
            echo '
		</div>
		<span class="botslice"><span></span></span>
	</div>
	<br />';
        } elseif ($context['arcade']['submit'] == 'askname') {
            echo '
	<div class="cat_bar">
		<h3 class="catbg">
			', $txt['arcade_submit_score'], '
		</h3>
	</div>
	<div class="windowbg2">
		<span class="topslice"><span></span></span>
		<div style="padding: 0 0.5em">
			<form action="', $scripturl, '?action=arcade;sa=save" method="post">
				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
				<input type="text" name="name" style="width: 95%;" />
				<input class="button_submit" type="submit" value="', $txt['arcade_save'], '" />
			</form>
		</div>
	</div><br />';
        }
    }
    echo '
	<form name="score" action="', $scripturl, '?action=arcade;sa=highscore" method="post">
		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
		<input type="hidden" name="game" value="', $context['game']['id'], '" />
		<div class="cat_bar">
			<h3 class="catbg">
				', $txt['arcade_highscores'], '
			</h3>
		</div>
		<div class="pagesection">
			<div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><b>' . $txt['go_down'] . '</b></a>' : '', '</div>
			', template_button_strip($context['arcade']['buttons'], 'right'), '
		</div>
		<div class="score_table">
			<table cellspacing="0" class="table_grid">
				<thead>
					<tr class="catbg">';
    // Is there games?
    if (!empty($context['arcade']['scores'])) {
        echo '
						<th scope="col" class="first_th" width="5">', $txt['arcade_position'], '</th>
						<th scope="col">', $txt['arcade_member'], '</th>
						<th scope="col"> ', $txt['arcade_comment'], '</th>
						<th scope="col" class="', !$context['arcade']['can_admin_arcade'] ? ' last_th' : '', '">', $txt['arcade_score'], '</th>';
        if ($context['arcade']['can_admin_arcade']) {
            echo '
						<th scope="col" class="last_th" align="center" width="15"><input type="checkbox" onclick="invertAll(this, this.form, \'scores[]\');" class="check" /></th>';
        }
    } else {
        echo '
						<th scope="col" class="first_th" width="8%">&nbsp;</th>
						<th class="smalltext" colspan="', !$context['arcade']['can_admin_arcade'] ? '2' : '3', '"><strong>', $txt['arcade_no_scores'], '</strong></th>
						<th scope="col" class="last_th" width="8%">&nbsp;</th>';
    }
    echo '
					</tr>
				</thead>
				<tbody>';
    $edit_button = create_button('modify.gif', 'arcade_edit', '', 'title="' . $txt['arcade_edit'] . '"');
    foreach ($context['arcade']['scores'] as $score) {
        $div_con = addslashes(sprintf($txt['arcade_when'], $score['time'], duration_format($score['duration'])));
        echo '
					<tr class="', $score['own'] ? 'windowbg3' : 'windowbg', '"', !empty($score['highlight']) ? ' style="font-weight: bold;"' : '', ' onmouseover="arcadeBox(\'', $div_con, '\')" onmousemove="arcadeBoxMove(event)" onmouseout="arcadeBox(\'\')">
						<td class="windowbg2" align="center">', $score['position'], '</td>
						<td>', $score['member']['link'], '</td>
						<td width="300" class="windowbg2">';
        if ($score['can_edit'] && empty($score['edit'])) {
            echo '
							<div id="comment', $score['id'], '" class="floatleft">
								', $score['comment'], '
							</div>
							<div id="edit', $score['id'], '" class="floatleft" style="display: none;">
								<input type="text" id="c', $score['id'], '" value="', $score['raw_comment'], '" style="width: 95%;"  />
								<input type="button" onclick="arcadeCommentEdit(', $score['id'], ', ', $context['game']['id'], ', 1); return false;" name="csave" value="', $txt['arcade_save'], '" />
							</div>
							<a id="editlink', $score['id'], '" onclick="arcadeCommentEdit(', $score['id'], ', ', $context['game']['id'], ', 0); return false;" href="', $scripturl, '?action=arcade;sa=highscore;game=', $context['game']['id'], ';edit;score=', $score['id'], '" class="floatright">', $edit_button, '</a>';
        } elseif ($score['can_edit'] && !empty($score['edit'])) {
            echo '
							<input type="hidden" name="score" value="', $score['id'], '" />
							<input type="text" name="new_comment" id="c', $score['id'], '" value="', $score['raw_comment'], '" style="width: 95%;" />
							<input class="button_submit" type="submit" name="csave" value="', $txt['arcade_save'], '" />';
        } else {
            echo $score['comment'];
        }
        echo '
						</td>
						<td align="center">', $score['score'], '</td>';
        if ($context['arcade']['can_admin_arcade']) {
            echo '
						<td class="windowbg2" align="center"><input type="checkbox" name="scores[]" value="', $score['id'], '" class="check" /></td>';
        }
        echo '
					</tr>';
    }
    echo '
			</tbody>';
    if ($context['arcade']['can_admin_arcade']) {
        echo '
			<tfoot>
				<tr class="titlebg">
					<td colspan="', $context['arcade']['can_admin_arcade'] ? '6' : '5', '" align="right">
						<select name="qaction">
							<option value="">--------</option>
							<option value="delete">', $txt['arcade_delete_selected'], '</option>
						</select>
						<input value="', $txt['go'], '" onclick="return document.forms.score.qaction.value != \'\' && confirm(\'', $txt['arcade_are_you_sure'], '\');" class="button_submit" type="submit" />
					</td>
				</tr>
			</tfoot>';
    }
    echo '
			</table>
		</div>
	</form>';
}
Example #30
0
function template_arcade_game_highscore()
{
    global $scripturl, $txt, $context, $settings, $arcSettings;
    $game =& $context['arcade']['game'];
    echo '<div >
	<table class="bordercolor" border="0" cellpadding="4" cellspacing="1" width="100%">';
    if (isset($context['arcade']['new_score'])) {
        $score =& $context['arcade']['new_score'];
        $ratecode = '';
        $rating = $context['arcade']['game']['rating'];
        if ($context['arcade']['can_rate']) {
            // Can rate
            for ($i = 1; $i <= 5; $i++) {
                if ($i <= $rating) {
                    $ratecode .= '<a href="' . $scripturl . '?action=arcade;sa=rate;game=' . $context['arcade']['game']['id'] . ';rate=' . $i . ';sesc=' . $context['session_id'] . '" onclick="arcade_rate(' . $i . ', ' . $context['arcade']['game']['id'] . '); return false;"><img id="imgrate' . $i . '" src="' . $settings['images_url'] . '/arc_icons/star.gif" alt="*" /></a>';
                } else {
                    $ratecode .= '<a href="' . $scripturl . '?action=arcade;sa=rate;game=' . $context['arcade']['game']['id'] . ';rate=' . $i . ';sesc=' . $context['session_id'] . '" onclick="arcade_rate(' . $i . ', ' . $context['arcade']['game']['id'] . '); return false;"><img id="imgrate' . $i . '" src="' . $settings['images_url'] . '/arc_icons/star2.gif" alt="*" /></a>';
                }
            }
        } else {
            // Can't rate
            $ratecode = str_repeat('<img src="' . $settings['images_url'] . '/arc_icons/star.gif" alt="*" />', $rating);
            $ratecode .= str_repeat('<img src="' . $settings['images_url'] . '/arc_icons/star2.gif" alt="*" />', 5 - $rating);
        }
        echo '
		<tr class="titlebg">
				<td colspan="5">', $txt['arcade_submit_score'], ' ', $game['name'], '</td>
		</tr>
		<tr class="windowbg">
			<td colspan="3" style="text-align: center;">
				<table align="center">
					<tr>
						<td align="center">
						', $context['arcade']['game']['thumbnail'] != '' ? '<div><a href="' . $scripturl . '?action=arcade;sa=play;game=' . $context['arcade']['game']['id'] . '"><img src="' . $context['arcade']['game']['thumbnail'] . '" alt="icon" title="' . $txt['arcade_play'] . ' ' . $game['name'] . '"/></a></div>' : '', '
						</td>
					</tr>
					<tr>
						<td align="center">', $txt['arcade_rate_game'], ' ', $game['name'], ' ', $ratecode, '</td>
					</tr>';
        // Favorite link (if can favorite)
        if ($context['arcade']['can_favorite']) {
            echo '
						<tr>
							<td align="center">
							<a href="', $context['arcade']['game']['url']['favorite'], '" onclick="arcade_favorite(', $context['arcade']['game']['id'], '); return false;">', !$context['arcade']['game']['isFavorite'] ? '' . $txt['arcade_add_favorites'] . ' <img id="favgame' . $context['arcade']['game']['id'] . '" src="' . $settings['images_url'] . '/arc_icons/favorite.gif" alt="' . $txt['arcade_add_favorites'] . '" />' : '' . $txt['arcade_remove_favorite'] . ' <img id="favgame' . $context['arcade']['game']['id'] . '" src="' . $settings['images_url'] . '/arc_icons/favorite2.gif" alt="' . $txt['arcade_remove_favorite'] . '" />', '</a>
							</td>
						</tr>';
        }
        echo '
					<tr>
						<td align="center"><a href="' . $scripturl . '?action=arcade;sa=play;game=' . $context['arcade']['game']['id'] . '">', $txt['arcade_play_again'], '</a></td>
					</tr>
					<tr>
						<td align="center"><a href="javascript:popup(\'' . $game['url']['pop'] . '\',\'' . $game['flash']['width'] . '\',\'' . $game['flash']['height'] . '\')" >' . $txt['arcade_popup'] . '</a></td>
					</tr
					<tr>
						<td align="center"><a href="' . $scripturl . '?action=arcade">', $txt['arcade_play_other'], '</a></td>
					</tr>
				</table>
			</td>
			<td colspan="2" style="text-align: center;">';
        if ($context['arcade']['game']['isChampion']) {
            echo '
				<div>
				<strong>', $txt['arcade_champion'], ':</strong> ', $context['arcade']['game']['champion']['memberLink'], ' - ', $context['arcade']['game']['champion']['score'], '&nbsp;&nbsp;&nbsp;&nbsp;';
        }
        if ($context['arcade']['game']['isPersonalBest']) {
            echo '
				<strong>', $txt['arcade_personal_best'], ':</strong> ', $context['arcade']['game']['personalBest'], '
				</div>';
        }
        if (!$score['saved']) {
            // No permission to save
            echo '<br />
					<div><strong>', $txt['arcade_txt_your'], $txt['arcade_score'], ':</strong> ', $score['score'], '<br /><br />
					', $txt[$score['error']], '<br /> </div>';
        } else {
            echo '<br />
					<div><strong>', $txt['arcade_txt_your'], $txt['arcade_score'], ':</strong> ', $score['score'], '<br /><br />
					', $txt['arcade_score_saved'], '<br /> </div>';
            if ($score['is_new_champion']) {
                echo '
						<div>', $txt['arcade_you_are_now_champion'], '</div>';
            } elseif ($score['is_personal_best']) {
                echo '
						<div>', $txt['arcade_this_is_your_best'], '</div>';
            }
            if ($score['can_comment']) {
                echo '
						<div id="edit', $score['id'], '">
							<form action="', $scripturl, '?action=arcade;sa=comment;game=', $game['id'], ';score=', $score['id'], '" onsubmit="arcadeCommentEdit(', $score['id'], ', ', $game['id'], ', 1); return false;" method="post">
								<input type="text" id="c', $score['id'], '" name="comment" style="width: 95%;" />
								<input type="submit" value="', $txt['arcade_save'], '" />
							</form>
						</div>';
            }
        }
        if ($arcSettings['arcadePostTopic'] != 0) {
            echo '<div><br /><a href="', $scripturl, '?topic=', $game['topic_id'], '">', $txt['arcade_topic_talk2'], ' ', $game['name'], ' here</a></div>';
        }
        echo '</td>
		</tr>';
    }
    if (count($context['arcade']['scores']) > 0) {
        if (!isset($context['arcade']['new_score'])) {
            $ratecode = '';
            $rating = $context['arcade']['game']['rating'];
            if ($context['arcade']['can_rate']) {
                // Can rate
                for ($i = 1; $i <= 5; $i++) {
                    if ($i <= $rating) {
                        $ratecode .= '<a href="' . $scripturl . '?action=arcade;sa=rate;game=' . $context['arcade']['game']['id'] . ';rate=' . $i . ';sesc=' . $context['session_id'] . '" onclick="arcade_rate(' . $i . ', ' . $context['arcade']['game']['id'] . '); return false;"><img id="imgrate' . $i . '" src="' . $settings['images_url'] . '/arc_icons/star.gif" alt="*" /></a>';
                    } else {
                        $ratecode .= '<a href="' . $scripturl . '?action=arcade;sa=rate;game=' . $context['arcade']['game']['id'] . ';rate=' . $i . ';sesc=' . $context['session_id'] . '" onclick="arcade_rate(' . $i . ', ' . $context['arcade']['game']['id'] . '); return false;"><img id="imgrate' . $i . '" src="' . $settings['images_url'] . '/arc_icons/star2.gif" alt="*" /></a>';
                    }
                }
            } else {
                // Can't rate
                $ratecode = str_repeat('<img src="' . $settings['images_url'] . '/arc_icons/star.gif" alt="*" />', $rating);
                $ratecode .= str_repeat('<img src="' . $settings['images_url'] . '/arc_icons/star2.gif" alt="*" />', 5 - $rating);
            }
            echo '
		<tr class="windowbg">
			<td align="center" colspan="5">
					<table align="center">
						<tr>
							<td align="center">
							', $context['arcade']['game']['thumbnail'] != '' ? '<div><a href="' . $scripturl . '?action=arcade;sa=play;game=' . $context['arcade']['game']['id'] . '"><img src="' . $context['arcade']['game']['thumbnail'] . '" alt="icon" title="' . $txt['arcade_play'] . ' ' . $game['name'] . '"/></a></div>' : '', '
							</td>
						</tr>
						<tr>
							<td align="center">', $txt['arcade_rate_game'], ' ', $game['name'], ' ', $ratecode, '</td>
						</tr>';
            // Favorite link (if can favorite)
            if ($context['arcade']['can_favorite']) {
                echo '
						<tr>
							<td align="center">
							<a href="', $context['arcade']['game']['url']['favorite'], '" onclick="arcade_favorite(', $context['arcade']['game']['id'], '); return false;">', !$context['arcade']['game']['isFavorite'] ? '' . $txt['arcade_add_favorites'] . ' <img id="favgame' . $context['arcade']['game']['id'] . '" src="' . $settings['images_url'] . '/arc_icons/favorite.gif" alt="' . $txt['arcade_add_favorites'] . '" />' : '' . $txt['arcade_remove_favorite'] . ' <img id="favgame' . $context['arcade']['game']['id'] . '" src="' . $settings['images_url'] . '/arc_icons/favorite2.gif" alt="' . $txt['arcade_remove_favorite'] . '" />', '</a>
							</td>
						</tr>';
            }
            echo '
						<tr>
							<td align="center"><a href="' . $scripturl . '?action=arcade;sa=play;game=' . $context['arcade']['game']['id'] . '">', $txt['arcade_play'], ' ', $game['name'], '</a></td>
						</tr>
						<tr>
							<td align="center"><a href="javascript:popup(\'' . $game['url']['pop'] . '\',\'' . $game['flash']['width'] . '\',\'' . $game['flash']['height'] . '\')" >', $txt['arcade_popup'], '</a></td>
						</tr>
					</table>
				</td>
			</tr>';
        }
        echo '
			<tr class="titlebg">
				<td colspan="5" height="25px" class="smalltext">', $txt['arcade_highscores'], ' ', isset($context['arcade']['pageIndex']) ? ' ' . $context['arcade']['pageIndex'] : '', '</td>
			</tr>
			<tr class="catbg3">
				<td width="50px">', $txt['arcade_position'], '</td>
				<td width="150px">', $txt['arcade_member'], '</td>
				<td width="50px">', $txt['arcade_score'], '</td>
				<td width="250px">', $txt['arcade_time'], '</td>
				<td>', $txt['arcade_comment'], '</td>
			</tr>';
        $button['edit'] = create_button('modify.gif', 'arcade_edit', '', 'title="' . $txt['arcade_edit'] . '"');
        $button['delete'] = create_button('delete.gif', 'arcade_delete_score', '', 'title="' . $txt['arcade_delete_score'] . '"');
        foreach ($context['arcade']['scores'] as $score) {
            echo '
			<tr class="', $score['own'] ? 'windowbg3' : 'windowbg', '"', $score['highlight'] ? ' style="font-weight: bold;"' : '', '>
				<td class="windowbg2" align="center">', $score['position'], '</td>
				<td>', $score['memberLink'], '</td>
				<td  class="windowbg2">', $score['score'], '</td>
				<td width="300" align="center">', $score['time'], '</td>
				<td class="windowbg2">
					<div id="comment', $score['id'], '" style="float: left; ', $score['edit'] && $score['can_edit'] ? 'display: none;' : '', '">', $score['comment'], '</div>';
            if ($score['can_edit']) {
                echo '
							<div id="edit', $score['id'], '" style="float: left; ', $score['edit'] ? '' : 'display: none;', ' width: 90%;">
								<form action="', $scripturl, '?action=arcade;sa=comment;game=', $game['id'], '" method="post" name="score_edit', $score['id'], '" onsubmit="arcadeCommentEdit(', $score['id'], ', ', $game['id'], '); return false;">
									<input type="hidden" name="score" value="', $score['id'], '" />
									<input type="text" name="comment" id="c', $score['id'], '" value="', $score['raw_comment'], '" style="width: 95%;" />
								</form>
							</div>';
            }
            // Buttons
            if ($score['can_edit'] || $context['arcade']['show_editor']) {
                echo '<div style="float: right">';
                // Edit
                if ($score['can_edit']) {
                    echo '<a onclick="arcadeCommentEdit(', $score['id'], ', ', $game['id'], ', 0); return false;" href="', $scripturl, '?action=arcade;sa=highscore;game=', $game['id'], ';edit;score=', $score['id'], '">', $button['edit'], '</a>';
                }
                // Delete
                if ($context['arcade']['show_editor']) {
                    echo '<a onclick="return confirm(\'', $txt['arcade_really_delete'], '\');" href="', $scripturl, '?action=arcade;sa=highscore;game=', $game['id'], ';delete;score=', $score['id'], ';sesc=', $context['session_id'], '">', $button['delete'], '</a>';
                }
                echo '</div>';
            }
            echo '</td>
				</tr>';
        }
        echo '
				<tr class="catbg3">
					<td>', $txt['arcade_position'], '</td>
					<td>', $txt['arcade_member'], '</td>
					<td>', $txt['arcade_score'], '</td>
					<td>', $txt['arcade_time'], '</td>
					<td>', $txt['arcade_comment'], '</td>
				</tr>';
    } else {
        // No one has played this game
        echo '
			<tr class="windowbg">
				<td align="center" class="catbg3"><b>', $txt['arcade_no_scores'], '</b></td>
			</tr>';
    }
    echo '<tr class="titlebg">
					<td colspan="5" class="smalltext" height="25px">', $txt['arcade_highscores'], ' ', isset($context['arcade']['pageIndex']) ? ' ' . $context['arcade']['pageIndex'] : '', '</td>
				</tr>
			</table>
		</div>';
}