Exemple #1
0
            // for example "http://" is converted to http:/
            // also it cheats the paht_info and redirections, so don't redirect
            header('Location: http://' . get_server_name() . $globals['base_url'] . $globals['base_search_url'] . urlencode($_REQUEST['q']));
            die;
        }
    } elseif (isset($_REQUEST['q'])) {
        header('Location: http://' . get_server_name() . $globals['base_url']);
        die;
    }
}
$page_size = 20;
$offset = (get_current_page() - 1) * $page_size;
$globals['ads'] = true;
$globals['noindex'] = true;
$_REQUEST['q'] = stripslashes($_REQUEST['q']);
$response = sphinx_get_search_link(false, $offset, $page_size);
$search_txt = htmlspecialchars($_REQUEST['q']);
do_header(_('búsqueda de') . ' "' . $search_txt . '"');
do_banner_top();
echo '<div id="container">' . "\n";
do_sidebar();
echo '<div id="contents">';
do_tabs('main', _('búsqueda'), htmlentities($_SERVER['REQUEST_URI']));
echo '<div style="background:#FFE2C5;margin:10px 0 5px 86px;font-size:100%;text-align:right;padding:5px;">' . _('búsqueda') . ': <strong>' . $search_txt . '</strong>';
if (!empty($_REQUEST['q'])) {
    echo '&nbsp;<a href="' . $globals['base_url'] . 'rss2.php?q=' . urlencode($_REQUEST['q']) . '" rel="rss"><img src="' . $globals['base_url'] . 'img/common/feed-icon-12x12.png" alt="rss2" height="12" width="12"  style="vertical-align:top"/></a>';
}
echo '&nbsp;&nbsp;&nbsp;' . _('encontrados') . ': ' . $response['rows'] . ', ' . _('tiempo total') . ': ' . sprintf("%1.3f", $response['time']) . ' ' . _('segundos') . '</div>';
$link = new Link();
if ($response['ids']) {
    $rows = min($response['rows'], 1000);
Exemple #2
0
    $title = _('Menéame: noticias de') . ' ' . $user_login;
    $globals['show_original_link'] = false;
    $globals['redirect_feedburner'] = false;
} else {
    /////
    // All the others
    /////
    // The link_status to search
    if (!empty($_REQUEST['status'])) {
        $status = $db->escape(clean_input_string(trim($_REQUEST['status'])));
    } else {
        // By default it searches on all
        if ($_REQUEST['q']) {
            $status = 'all';
            include mnminclude . 'sphinx.php';
            $search_ids = sphinx_get_search_link(true);
            if ($search_ids['ids']) {
                $search = ' link_id in (';
                foreach ($search_ids['ids'] as $lid) {
                    $search .= $lid . ',';
                }
                $search = preg_replace('/,$/', '', $search);
                $search .= ')';
            }
        } else {
            $status = 'published';
        }
    }
    switch ($status) {
        case 'published':
            $order_field = 'link_date';