Beispiel #1
0
/**
 * @name      EosAlpha BBS
 * @copyright 2011 Alex Vie silvercircle(AT)gmail(DOT)com
 *
 * This software is a derived product, based on:
 *
 * Simple Machines Forum (SMF)
 * copyright:	2011 Simple Machines (http://www.simplemachines.org)
 * license:  	BSD, See included LICENSE.TXT for terms and conditions.
 *
 * @version 1.0pre
 */
function template_main()
{
    global $context, $txt;
    echo '
	<div id="recent" class="main_section">
		<h1 class="bigheader">', $txt['recent_posts'], '
		</h1>
		<div class="pagelinks mediumpadding">
			<span>', $context['page_index'], '</span>
		</div>
		<div class="posts_container">';
    foreach ($context['posts'] as &$post) {
        template_postbit_compact($post);
    }
    echo '
		</div>
		<div class="pagelinks mediumpadding">
			<span>', $context['page_index'], '</span>
		</div>
	</div>';
}
Beispiel #2
0
function template_results()
{
    global $context, $settings, $options, $txt, $scripturl, $message;
    if (isset($context['did_you_mean']) || empty($context['topics'])) {
        echo '
	<div id="search_results">
		<div class="cat_bar">
			<h3>
				', $txt['search_adjust_query'], '
			</h3>
		</div>
		<div class="blue_container">';
        // Did they make any typos or mistakes, perhaps?
        if (isset($context['did_you_mean'])) {
            echo '
			<p>', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.</p>';
        }
        echo '
			<form action="', $scripturl, '?action=search2" method="post" accept-charset="UTF-8">
				<strong>', $txt['search_for'], ':</strong>
				<input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40" class="input_text" />
				<input type="submit" name="submit" value="', $txt['search_adjust_submit'], '" class="button_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>
		</div>
	</div><br />';
    }
    if ($context['compact']) {
        // Quick moderation set to checkboxes? Oh, how fun :/.
        if (!empty($options['display_quick_mod'])) {
            echo '
	<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="UTF-8" name="topicForm">';
        }
        echo '
		<h1 class="bigheader">
			<span class="floatright">';
        if (!empty($options['display_quick_mod'])) {
            echo '
						<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check" />';
        }
        echo '
			</span>
			', $txt['mlist_search_results'], ':&nbsp;', $context['search_params']['search'], '
		</h1>
		<div class="pagesection">
			<span>', $txt['pages'], ': ', $context['page_index'], '</span>
		</div>';
        while ($topic = $context['get_topics']()) {
            $color_class = 'gradient_darken_down';
            echo '
			<div class="blue_container smallpadding" style="margin-bottom:10px;">
			<div class="core_posts">
				<div class="flow_auto">';
            foreach ($topic['matches'] as $message) {
                if (!empty($message['member']['avatar']['image'])) {
                    echo '
					<div class="user floatleft"><div class="avatar" style="margin-right:10px;">', $message['member']['avatar']['image'], '</div></div>';
                } else {
                    echo '
					<div class="user floatleft"><div class="avatar" style="margin:0 10px 0 0;"><a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">
					<img src="', $settings['images_url'], '/unknown.png" alt="avatar" /></a></div></div>';
                }
                echo '<div style="margin-left:90px;">';
                if (!empty($options['display_quick_mod'])) {
                    echo '
						<div class="floatright">
						<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check" />
						</div>';
                }
                echo '<strong>', $message['counter'], '. ', '<a href="', $scripturl, '?topic=', $topic['id'], '.msg', $message['id'], '#msg', $message['id'], '">', $message['subject_highlighted'], '</a> ', $txt['in'], ': ', $topic['board']['link'], '</strong><br />
				<div class="smalltext">', $txt['topic'], ' ', $txt['by'], '&nbsp;<strong>', $message['member']['link'], '</strong>,&nbsp;<em>', $message['time'], '</em>&nbsp;</div>';
                if ($message['body_highlighted'] != '') {
                    echo '<hr style="margin:2px 0;">
					<div class="smalltext">', $message['body_highlighted'], '</div>';
                }
            }
            echo '</div>
				</div>
			</div>
		</div>';
        }
        if (!empty($context['topics'])) {
            echo '
		<div class="pagesection">
			<span>', $txt['pages'], ': ', $context['page_index'], '</span>
		</div>';
        }
        if (!empty($options['display_quick_mod']) && !empty($context['topics'])) {
            echo '
			<div class="smalltext blue_container" style="padding: 4px;">
				<div class="floatright">
					<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['move_to_boards'] as $category) {
                    echo '
						<optgroup label="', $category['name'], '">';
                    foreach ($category['boards'] as $board) {
                        echo '
						<option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
                    }
                    echo '
						</optgroup>';
                }
                echo '
					</select>';
            }
            echo '
					<input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '" />
					<input type="submit" style="font-size: 0.8em;" value="', $txt['quick_mod_go'], '" onclick="return this.form.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit" />
				</div>
				<br class="clear" />
			</div>';
        }
        if (!empty($options['display_quick_mod']) && !empty($context['topics'])) {
            echo '
			<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
		</form>';
        }
    } else {
        echo '
		<div class="cat_bar">
			<h3>
				', $txt['mlist_search_results'], ':&nbsp;', $context['search_params']['search'], '
			</h3>
		</div>
		<div class="pagesection">
			<span>', $txt['pages'], ': ', $context['page_index'], '</span>
		</div>';
        if (empty($context['topics'])) {
            echo '
		<div class="blue_container">(', $txt['search_no_results'], ')</div>';
        }
        while ($topic = $context['get_topics']()) {
            foreach ($topic['matches'] as $message) {
                template_postbit_compact($message, 0);
            }
        }
        echo '
		<div class="pagesection">
			<span>', $txt['pages'], ': ', $context['page_index'], '</span>
		</div>';
    }
    // Show a jump to box for easy navigation.
    echo '
		<br class="clear" />
		<div class="smalltext righttext" id="search_jump_to">&nbsp;</div>
		<script type="text/javascript"><!-- // --><![CDATA[
			if (typeof(window.XMLHttpRequest) != "undefined")
				aJumpTo[aJumpTo.length] = new JumpTo({
					sContainerId: "search_jump_to",
					sJumpToTemplate: "<label class=\\"smalltext\\" for=\\"%select_id%\\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
					iCurBoardId: 0,
					iCurBoardChildLevel: 0,
					sCurBoardName: "', $context['jump_to']['board_name'], '",
					sBoardChildLevelIndicator: "==",
					sBoardPrefix: "=> ",
					sCatSeparator: "-----------------------------",
					sCatPrefix: "",
					sGoButtonLabel: "', $txt['quick_mod_go'], '"
				});
		// ]]></script>';
}