Example #1
0
        $total = 0;
    } elseif (is_array($res['rows'])) {
        $results = $res['rows'];
        $total = $res['metadata']['hits'];
    } else {
        $results = array();
        $total = 0;
    }
} else {
    $total = 0;
    $results = array();
}
loader_import('sitesearch.Logger');
$logger = new SiteSearchLogger();
if ($cgi->offset == 0) {
    $logger->logSearch($cgi->query, $total);
}
if ($cgi->show_types == 'yes') {
    $show_types = true;
    $data = $logger->getCurrentIndex();
    if (!$data) {
        $types = array();
    } else {
        $counts = unserialize($data->counts);
        if (!is_array($counts)) {
            $types = array();
        } else {
            loader_import('sitesearch.Filters');
            $types = array();
            foreach ($counts as $k => $c) {
                if (in_array($k, $sitesearch_allowed)) {
Example #2
0
        $total = 0;
    } elseif (is_array($res['rows'])) {
        $results = $res['rows'];
        $total = $res['metadata']['hits'];
    } else {
        $results = array();
        $total = 0;
    }
} else {
    $total = 0;
    $results = array();
}
loader_import('sitesearch.Logger');
$logger = new SiteSearchLogger();
if ($cgi->offset == 0) {
    $logger->logSearch($cgi->query, $total, date('YmdHis'), $_SERVER['REMOTE_ADDR'], $parameters['ctype'], $parameters['domains']);
}
loader_import('sitesearch.Filters');
if ($cgi->show_types == 'yes') {
    $show_types = true;
    $data = $logger->getCurrentIndex();
    if (!$data) {
        $types = array();
    } else {
        $counts = unserialize($data->counts);
        if (!is_array($counts)) {
            $types = array();
        } else {
            $types = array();
            foreach ($counts as $k => $c) {
                if (in_array($k, $sitesearch_allowed)) {