예제 #1
0
파일: mobile.php 프로젝트: leowmjw/twfy
        $DATA->set_page_metadata($this_page, 'rss', 'search/rss/?s=' . urlencode($searchstring));
        $PAGE->page_start_mobile();
        $PAGE->stripe_start();
        $PAGE->search_form();
        $o = get_http_var('o');
        $args = array('s' => $searchstring, 'p' => $pagenum, 'num' => get_http_var('num'), 'pop' => get_http_var('pop'), 'o' => $o == 'd' || $o == 'r' ? $o : 'd');
        $LIST = new HANSARDLIST();
        if ($args['s']) {
            $db = $LIST->db;
            find_members($args);
        }
        $LIST->display('search', $args);
        if ($args['s']) {
            find_constituency($args);
            #        find_users($args);
            find_glossary_items($args);
            #        find_comments($args);
        }
    }
} else {
    // No search term. Display help.
    $this_page = 'search_help';
    $PAGE->page_start_mobile();
    $PAGE->stripe_start();
    include INCLUDESPATH . 'easyparliament/staticpages/search_help.php';
}
/*
$PAGE->stripe_end(array (
	array(
		'type'		=> 'include',
		'content'	=> 'search_links'
예제 #2
0
function search_normal($searchstring)
{
    global $PAGE, $DATA, $this_page, $SEARCHENGINE;
    $SEARCHENGINE = new SEARCHENGINE($searchstring);
    $qd = $SEARCHENGINE->valid ? $SEARCHENGINE->query_description_short() : $searchstring;
    $pagetitle = 'Search for ' . $qd;
    $pagenum = get_http_var('p');
    if (!is_numeric($pagenum)) {
        $pagenum = 1;
    }
    if ($pagenum > 1) {
        $pagetitle .= ", page {$pagenum}";
    }
    $DATA->set_page_metadata($this_page, 'title', $pagetitle);
    $DATA->set_page_metadata($this_page, 'rss', 'search/rss/?s=' . urlencode($searchstring));
    if ($pagenum == 1) {
        # Allow indexing of first page of search results
        $DATA->set_page_metadata($this_page, 'robots', '');
    }
    $PAGE->page_start();
    $PAGE->stripe_start();
    $PAGE->search_form($searchstring);
    $o = get_http_var('o');
    $args = array('s' => $searchstring, 'p' => $pagenum, 'num' => get_http_var('num'), 'pop' => get_http_var('pop'), 'o' => $o == 'd' || $o == 'r' || $o == 'o' ? $o : 'd');
    if ($pagenum == 1 && $args['s'] && !preg_match('#[a-z]+:[a-z0-9]+#', $args['s'])) {
        find_members($args['s']);
        find_constituency($args);
        find_glossary_items($args);
    }
    if (!defined('FRONT_END_SEARCH') || !FRONT_END_SEARCH) {
        print '<p>Apologies, search has been turned off currently for performance reasons.</p>';
    }
    if (!$SEARCHENGINE->valid) {
        $PAGE->error_message($SEARCHENGINE->error);
    } else {
        $LIST = new HANSARDLIST();
        $LIST->display('search', $args);
    }
}