//搜索论坛板块范围
if (!empty($srchfid) && $srchfid != 'all') {
    foreach ($srchfid as $forum) {
        if ($forum = intval(trim($forum))) {
            $sp_fids[] = $forum;
        }
    }
    !empty($sp_fids) && $cl->setfilter('fid', $sp_fids);
}
//分页
$sp_page = isset($page) ? abs((int) $page) : 1;
$sp_page = max(1, $sp_page);
$sp_perpage = 10;
$sp_start = ($page - 1) * $sp_perpage;
$sp_total_result = 100;
$cl->setlimits($sp_start, $sp_perpage);
$res = $cl->query($sp_keyword, $sp_index);
//*	显示sphinx错误信息,用于调试
if ($cl->GetLastWarning()) {
    var_dump($res);
    die("WARNING: " . $cl->GetLastWarning() . "\n\n");
}
//*/
if (empty($res['matches'])) {
    include template('search_threads');
    exit;
}
//分页
$query_string = 'search.php?' . preg_replace('|&page=\\d+|', '', $_SERVER['QUERY_STRING']);
$multipage = multi($res['total'], $sp_perpage, $sp_page, $query_string);
//从数据获取信息