查看單個文章
舊 2005-06-21, 03:03 PM   #3 (permalink)
貝斯特 帥哥
長老會員
 
貝斯特 的頭像
榮譽勳章
UID - 90669
在線等級: 級別:1 | 在線時長:11小時 | 升級還需:1小時
註冊日期: 2003-08-06
住址: The Gates of Hell
文章: 1758
現金: 15064 金幣
資產: 5185909 金幣
預設

| 搜尋
---------------------------------------------------------------------------------------
// found some results for current word
$wordids = array();
while ($getword = $DB_site->fetch_array($getwords))
{
$wordids[] = $getword['wordid'];
}
// query post ids for current word...
// if $titleonly is specified, also get the value of postindex.intitle
$postmatches = $DB_site->query("
SELECT postid" . iif($titleonly, ', intitle') . iif($sortby == 'rank', ", score AS origscore,
CASE intitle
WHEN 1 THEN score + $vboptions[posttitlescore]
WHEN 2 THEN score + $vboptions[posttitlescore] + $vboptions[threadtitlescore]
ELSE score
END AS score") . "
FROM " . TABLE_PREFIX . "postindex
WHERE wordid IN(" . implode(',', $wordids) . ")
");


| 取代為
---------------------------------------------------------------------------------------
// query post ids for current word...
// if $titleonly is specified, also get the value of postindex.intitle
if (!$vboptions['searchposttable']) {
// found some results for current word
$wordids = array();
while ($getword = $DB_site->fetch_array($getwords))
{
$wordids[] = $getword['wordid'];
}
$postmatches = $DB_site->query("
SELECT postid" . iif($titleonly, ', intitle') . iif($sortby == 'rank', ", score AS origscore,
CASE intitle
WHEN 1 THEN score + $vboptions[posttitlescore]
WHEN 2 THEN score + $vboptions[posttitlescore] + $vboptions[threadtitlescore]
ELSE score
END AS score") . "
FROM " . TABLE_PREFIX . "postindex
WHERE wordid IN(" . implode(',', $wordids) . ")
");
} else {
$postmatches = $DB_site->query("
SELECT postid
FROM " . TABLE_PREFIX . "post
WHERE title LIKE '%$word%'" . iif($titleonly == 0, " OR pagetext LIKE '%$word%'")
);
}

---------------------------------------------------------------------------------------
| 搜尋
---------------------------------------------------------------------------------------
// #############################################################################
// get highlight words (part 2);
foreach ($display['highlight'] AS $key => $word)
{
if (!isset($queryWords["$word"]))
{
unset($display['highlight']["$key"]);
}
}
__________________

給自己看也給所有需要這些話鼓勵的人看!

認真不一定會得到美好的結果,但是不認真就一定沒有

想要有什麼結果,就秉持你的雙手
放手去做
總比什麼都沒付出最後失敗了才嘆氣來的好吧
沒努力的人.沒有資格說放棄
努力過的人.更要有勇氣繼續努力下去
貝斯特 目前離線  
送花文章: 1, 收花文章: 38 篇, 收花: 123 次
回覆時引用此帖