史萊姆論壇

返回   史萊姆論壇 > 專業主討論區 > 論壇程式討論區
忘記密碼?
論壇說明

歡迎您來到『史萊姆論壇』 ^___^

您目前正以訪客的身份瀏覽本論壇,訪客所擁有的權限將受到限制,您可以瀏覽本論壇大部份的版區與文章,但您將無法參與任何討論或是使用私人訊息與其他會員交流。若您希望擁有完整的使用權限,請註冊成為我們的一份子,註冊的程序十分簡單、快速,而且最重要的是--註冊是完全免費的!

請點擊這裡:『註冊成為我們的一份子!』

Google 提供的廣告


 
 
主題工具 顯示模式
舊 2005-06-21, 03:01 PM   #2 (permalink)
長老會員
 
貝斯特 的頭像
榮譽勳章
UID - 90669
在線等級: 級別:1 | 在線時長:11小時 | 升級還需:1小時
註冊日期: 2003-08-06
住址: The Gates of Hell
文章: 1758
現金: 15064 金幣
資產: 5185909 金幣
預設

3.文件修改
開啟search.php
---------------------------------------------------------------------------------------
| 搜尋
---------------------------------------------------------------------------------------
// #############################################################################
// if query string is specified, check syntax and replace common syntax errors
if ($query)
{


| 後面加上
---------------------------------------------------------------------------------------
// 007pig
$oriquery = $query;



---------------------------------------------------------------------------------------
| 搜尋
---------------------------------------------------------------------------------------
if (verify_word_allowed($word))
{
// word is okay - add it to the list of NOT words to be queried
$words['NOT']["$word"] = 'NOT';
$queryWords["$word"] = &$words['NOT']["$word"];
}

| 取代為
---------------------------------------------------------------------------------------
if (verify_word_allowed($word))
{
if ($vboptions['searchposttable']) {
$words['NOT']["$word"] = 'NOT';
$queryWords["$word"] = &$words['NOT']["$word"];
} else {
foreach (sp_str($word) as $word)
{
$words['NOT']["$word"] = 'NOT';
$queryWords["$word"] = &$words['NOT']["$word"];
}
}
}

---------------------------------------------------------------------------------------
| 搜尋
---------------------------------------------------------------------------------------
if (verify_word_allowed($orBit))
{
// word is okay - add it to the list of OR words for this clause
$checkwords[] = $orBit;
}

| 取代為
---------------------------------------------------------------------------------------
if (verify_word_allowed($orBit))
{
// word is okay - add it to the list of OR words for this clause
// 007pig
if ($vboptions['searchposttable']) {
$checkwords[] = $orBit;
} else {
foreach (sp_str($orBit) as $orBit)
{
$checkwords[] = $orBit;
}
}
}
---------------------------------------------------------------------------------------
| 搜尋
---------------------------------------------------------------------------------------
// #############################################################################
// other words must be required (AND)


| 後面加上
---------------------------------------------------------------------------------------

// 007pig
if (!$vboptions['searchposttable']) {
$querysplit = implode(" ", sp_str($querysplit));
}

---------------------------------------------------------------------------------------
| 搜尋
---------------------------------------------------------------------------------------
if ($phrasequery)
{
$words = array();
$display['words'] = array(htmlspecialchars_uni('"' . $phrasequery . '"'));
$display['common'] = array();
$display['highlight'] = array(htmlspecialchars_uni($phrasequery));
$query = '"' . $query . '"';
}
else
{
foreach ($words AS $wordtype => $searchwords)
{
switch($wordtype)
{
case 'AND':
// do AND words
foreach (array_keys($searchwords) AS $word)
{
$display['words'][] = $word;
}
break;
case 'NOT':
// do NOT words
foreach (array_keys($searchwords) AS $word)
{
$display['words'][] = "</u></b>-<b><u>$word";
}
break;

case 'OR':
// do OR clauses
foreach ($searchwords AS $orClause)
{
$or = array();
foreach (array_keys($orClause) AS $orWord)
{
$or[] = $orWord;
}
$display['words'][] = implode('</u> OR <u>', $or);
}
break;

default:
// ignore COMMON words
}
}
}


| 取代為
---------------------------------------------------------------------------------------
if ($phrasequery)
{
$words = array();
$display['words'] = array(htmlspecialchars_uni('"' . $phrasequery . '"'));
$display['common'] = array();
$display['highlight'] = array(htmlspecialchars_uni($phrasequery));
$query = '"' . $query . '"';
}
else
{
// 007pig
$patterns[0] = "/\sOR\s/";
$patterns[1] = "/\s-/";
$patterns[2] = "/ /";
$replacements[0] = "|||</u>OR<u>";
$replacements[1] = "|||</u></b>-<b><u>";
$replacements[2] = "|||";

if($oriquery) $replacedwords = preg_replace($patterns, $replacements, sanitize_search_query($oriquery));
$display['words'] = explode("|||", str_replace("</u>OR<u>", "</u> OR <u>", $replacedwords));
}

---------------------------------------------------------------------------------------
| 搜尋
---------------------------------------------------------------------------------------
$getwords = $DB_site->query("
SELECT wordid, title FROM " . TABLE_PREFIX . "word
WHERE title LIKE('$queryword')
");



| 取代為
---------------------------------------------------------------------------------------

if (!$vboptions['searchposttable']) {
$getwords = $DB_site->query("
SELECT wordid, title FROM " . TABLE_PREFIX . "word
WHERE title LIKE('$queryword')
");
}

---------------------------------------------------------------------------------------
| 搜尋
---------------------------------------------------------------------------------------
if ($DB_site->num_rows($getwords))


| 取代為
---------------------------------------------------------------------------------------
if ($vboptions['searchposttable'] || $DB_site->num_rows($getwords))


---------------------------------------------------------------------------------------
貝斯特 目前離線  
送花文章: 1, 收花文章: 38 篇, 收花: 123 次
回覆時引用此帖
 



發表規則
不可以發文
不可以回覆主題
不可以上傳附加檔案
不可以編輯您的文章

論壇啟用 BB 語法
論壇啟用 表情符號
論壇啟用 [IMG] 語法
論壇禁用 HTML 語法
Trackbacks are 禁用
Pingbacks are 禁用
Refbacks are 禁用


所有時間均為台北時間。現在的時間是 03:01 PM


Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2026, Jelsoft Enterprises Ltd.


SEO by vBSEO 3.6.1