phpBB 2.0.6
怕資料庫及電腦負荷過大\r
如何限制所有會員 (包括 Admin) 於搜尋文章時只可最多使用 2 個關鍵字 (即不可一直加入 AND , OR, NOT 這些導致資料庳繁忙,最多加一個,例如 123 AND 456)
謝謝指點 ^___^
[問題] 請問如何限制搜尋時輸入的關鍵字
版主: 版主管理群
http://phpbb-tw.net/phpbb/viewtopic.php?t=18300
如果只要限制關鍵字個數,改下面這段就好了。
如果只要限制關鍵字個數,改下面這段就好了。
代碼: 選擇全部
#-----[ OPEN ]------------------------------------------
#
search.php
#-----[ FIND ]------------------------------------------
#
$word_match = array();
$result_list = array();
for($i = 0; $i < count($split_search); $i++)
{
switch ( $split_search[$i] )
{
case 'and':
$current_match_type = 'and';
break;
#
#-----[ REPLACE ]---------------------------------------
#
$word_match = array();
$result_list = array();
if ( count($split_search) > [color=red]2[/color] )
{
message_die(GENERAL_MESSAGE, $lang['No_search_match']);
}
for($i = 0; $i < count($split_search); $i++)
{
switch ( $split_search[$i] )
{
case 'and':
$current_match_type = 'and';
break;
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
無限期蒸發中