示例#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, $settings, $options, $txt, $scripturl, $modSettings;
    echo '
	<form action="', $scripturl, '?action=search2" method="post" accept-charset="UTF-8" name="searchform" id="searchform">
		<div class="bigheader">';
    if (isset($modSettings['search_index']) && $modSettings['search_index'] == 'sphinx') {
        echo '<div class="floatright">
					Powered by: <a href="http://sphinxsearch.com"><img src="', $settings['images_url'], '/theme/sphinx.jpg" alt="sphinxlogo" style="vertical-align:middle;" /></a>
					</div>';
    }
    echo '<span class="ie6_header floatleft">', $txt['set_parameters'], '</span>
			<div class="clear"></div>
		</div>
		<div class="blue_container">';
    if (!empty($context['search_errors'])) {
        echo '
		<p id="search_error" class="error">', implode('<br />', $context['search_errors']['messages']), '</p>';
    }
    // Simple Search?
    if ($context['simple_search']) {
        echo '
		<fieldset id="simple_search">
			<div>
				<div id="search_term_input">
					<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" />
					', $context['require_verification'] ? '' : '&nbsp;<input type="submit" name="submit" value="' . $txt['search'] . '" class="button_submit" />
				</div>';
        if (empty($modSettings['search_simple_fulltext'])) {
            echo '
				<p class="smalltext">', $txt['search_example'], '</p>';
        }
        if ($context['require_verification']) {
            echo '
				<div class="verification>
					<strong>', $txt['search_visual_verification_label'], ':</strong>
					<br />', template_control_verification($context['visual_verification_id'], 'all'), '<br />
					<input id="submit" type="submit" name="submit" value="' . $txt['search'] . '" class="button_submit" />
				</div>';
        }
        echo '
				<a href="', $scripturl, '?action=search;advanced" onclick="this.href += \';search=\' + escape(document.forms.searchform.search.value);">', $txt['search_advanced'], '</a>
				<input type="hidden" name="advanced" value="0" />
			</div>
			<span class="lowerframe"><span></span></span>
		</fieldset>';
    } else {
        echo '
		<fieldset id="advanced_search">
			<div>
				<input type="hidden" name="advanced" value="1" />
				<span class="enhanced">
					<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" />
					<script type="text/javascript"><!-- // --><![CDATA[
						function initSearch()
						{
							if (document.forms.searchform.search.value.indexOf("%u") != -1)
								document.forms.searchform.search.value = unescape(document.forms.searchform.search.value);
						}
						createEventListener(window);
						window.addEventListener("load", initSearch, false);
					// ]]></script>
					<select name="searchtype">
						<option value="1"', empty($context['search_params']['searchtype']) ? ' selected="selected"' : '', '>', $txt['all_words'], '</option>
						<option value="2"', !empty($context['search_params']['searchtype']) ? ' selected="selected"' : '', '>', $txt['any_words'], '</option>
					</select>
				</span>';
        if (empty($modSettings['search_simple_fulltext'])) {
            echo '
				<em class="smalltext">', $txt['search_example'], '</em>';
        }
        echo '
				<dl id="search_options">
					<dt>', $txt['by_user'], ':</dt>
					<dd><input id="userspec" type="text" name="userspec" value="', empty($context['search_params']['userspec']) ? '*' : $context['search_params']['userspec'], '" size="40" class="input_text" /></dd>
					<dt>', $txt['search_order'], ':</dt>
					<dd>
						<select id="sort" name="sort">
							<option value="relevance|desc">', $txt['search_orderby_relevant_first'], '</option>
							<option value="num_replies|desc">', $txt['search_orderby_large_first'], '</option>
							<option value="num_replies|asc">', $txt['search_orderby_small_first'], '</option>
							<option value="id_msg|desc">', $txt['search_orderby_recent_first'], '</option>
							<option value="id_msg|asc">', $txt['search_orderby_old_first'], '</option>
						</select>
					</dd>
					<dt class="options">', $txt['search_options'], ':</dt>
					<dd class="options">
						<label for="show_complete"><input type="checkbox" name="show_complete" id="show_complete" value="1"', !empty($context['search_params']['show_complete']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['search_show_complete_messages'], '</label><br />
						<label for="subject_only"><input type="checkbox" name="subject_only" id="subject_only" value="1"', !empty($context['search_params']['subject_only']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['search_subject_only'], '</label>
					</dd>
					<dt class="between">', $txt['search_post_age'], ': </dt>
					<dd>', $txt['search_between'], ' <input type="text" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="4" class="input_text" />&nbsp;', $txt['search_and'], '&nbsp;<input type="text" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="4" class="input_text" /> ', $txt['days_word'], '</dd>
				</dl>';
        // Require an image to be typed to save spamming?
        if ($context['require_verification']) {
            echo '
				<p>
					<strong>', $txt['verification'], ':</strong>
					', template_control_verification($context['visual_verification_id'], 'all'), '
				</p>';
        }
        // If $context['search_params']['topic'] is set, that means we're searching just one topic.
        if (!empty($context['search_params']['topic'])) {
            echo '
				<p>', $txt['search_specific_topic'], ' &quot;', $context['search_topic']['link'], '&quot;.</p>
				<input type="hidden" name="topic" value="', $context['search_topic']['id'], '" />';
        }
        echo '
			</div>
		</fieldset>';
        if (empty($context['search_params']['topic'])) {
            $collapser = array('id' => 'search_boards', 'title' => $txt['choose_board'], 'bodyclass' => 'flat_container');
            template_create_collapsible_container($collapser);
            echo '
		<fieldset class="flow_hidden">
			<div>
				<div class="flow_auto" id="searchBoardsExpand">';
            template_boardlisting('brd');
            echo '
		</div>
		<br class="clear" />';
            echo '
		<div class="padding">
			<input type="checkbox" name="all" id="check_all" value=""', $context['boards_check_all'] ? ' checked="checked"' : '', ' onclick="invertAll(this, this.form, \'brd\');" class="input_check floatleft" />
			<label for="check_all" class="floatleft">', $txt['check_all'], '</label>
		</div>
		<br class="clear" />
		</div>
		</fieldset>';
            echo '
		</div>';
        }
    }
    echo '
	<input style="margin-top:5px;" type="submit" name="submit" value="', $txt['search'], '" class="button_submit floatright" />
	<div class="clear"></div>
	</div>
	</form>

	<script type="text/javascript"><!-- // --><![CDATA[
		function selectBoards(ids)
		{
			var toggle = true;

			for (i = 0; i < ids.length; i++)
				toggle = toggle & document.forms.searchform["brd" + ids[i]].checked;

			for (i = 0; i < ids.length; i++)
				document.forms.searchform["brd" + ids[i]].checked = !toggle;
		}

		function expandCollapseBoards()
		{
			$("#searchBoardsExpand").toggle();
			$("#expandBoardsIcon").attr("src", smf_images_url + ($("#searchBoardsExpand").is(":visible") ? "/collapse.gif" : "/expand.gif"));
		}';
    echo '
	// ]]></script>';
}
示例#2
0
function template_ignoreboards()
{
    global $context, $txt, $settings, $scripturl;
    // The main containing header.
    echo '
	<script type="text/javascript"><!-- // --><![CDATA[
		function selectBoards(ids)
		{
			var toggle = true;

			for (i = 0; i < ids.length; i++)
				toggle = toggle & document.forms.creator["ignore_brd" + ids[i]].checked;

			for (i = 0; i < ids.length; i++)
				document.forms.creator["ignore_brd" + ids[i]].checked = !toggle;
		}
	// ]]></script>

	<form action="', $scripturl, '?action=profile;area=ignoreboards;save" method="post" accept-charset="UTF-8" name="creator" id="creator">
		<div class="cat_bar2">
			<h3>
				<span class="ie6_header floatleft">', $txt['ignoreboards'], '</span>
			</h3>
		</div>
		<div class="orange_container smalltext cleantop norounded gradient_darken_down mediumpadding">', $txt['ignoreboards_info'], '</div>
		<br>
		<div class="blue_container">
			<div class="content flow_hidden">';
    template_boardlisting('ignore_brd');
    // Show the standard "Save Settings" profile button.
    template_profile_save();
    echo '
			</div>
		</div>
	</form>
	<br />';
}