本文實例講述了dedecms中英文網(wǎng)站之中英文搜索結(jié)果實現(xiàn)方法。分享給大家供大家參考。具體實現(xiàn)方法如下:
一般來說,我們使用DEDECMS制作中英文站時,需要在中文站上只搜索出中文站的內(nèi)容,而在英文站只會搜索出英文站中的內(nèi)容,此時就需要給英文站搜索欄目單獨(dú)做個模板出來,可以按以下方法來實現(xiàn).
復(fù)制plus目錄下的serach.php文件 把復(fù)制后的更名為 searche.php做為新的搜索文件.
編輯searche.php,找到此行代碼
require_once(DEDEINC."/arc.searchview.class.php");
替換為:
require_once(DEDEINC."/arc.searchviewen.class.php");
復(fù)制include目錄下的 arc.searchview.class.php文件并更名為 arc.searchviewen.class.php
編輯arc.searchviewen.class.php,找到這行代碼
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/search.htm";
改為
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/search_en.htm";
復(fù)制模板中的search.htm,并更名為search_en.htm,此時英文站的模板都已做好,找到英文站的相關(guān)搜索代碼,如下以示例:
<form action="/plus/searche.php" method="post"></p> <p><input type="hidden" name="typeid" value="26" />
其中的/plus/searche.php,用searche.php去搜索,name="typeid" value="26" 這個是指定欄目ID.
希望本文所述對大家的dedecms二次開發(fā)有所幫助。
此文由 網(wǎng)站目錄_網(wǎng)站網(wǎng)址收錄與提交入口 編輯,未經(jīng)允許不得轉(zhuǎn)載!: