phpcms v9搜索功能怎么做-PHPCMS

资源魔 43 0

phpcms v9搜寻性能怎样做?phpcmsV9 全站搜寻性能若何完成

给各人分享一下若何运用搜寻性能吧,

1. 起首, 模块->全站搜寻->增加搜寻分类,增加搜寻分类,此时天生的ID为typeid

6276da69b896991eecad177e8f77897.png

2. 增加form表单,此时的typeid即为上图的id,siteid为站点的id

<form method="get" action="{APP_PATH}index.php" target="_blank">
   <td width="">搜寻:</td>
   <td width="">
     <input type="text" name="q" id="q" value="" class="inputCom" style="width:196px; height:22px; line-height:22px;">
     <input type="hidden" name="m" value="search"/>
     <input type="hidden" name="c" value="index"/>
     <input type="hidden" name="a" value="init"/>
     <input type="hidden" name="typeid" value="{$typeid}" id="typeid"/>
     <input type="hidden" name="siteid" value="{$siteid}" id="siteid"/>
   </td>
   <td width=""><input type="image" src="{IMG_PATH}sousuo.jpg" border="0" class="sousuo" id="search_btn"></td>
</form>

3.修正搜寻页面 phpcms\templates\default\search\list.html

{pc:get sql="SELECT * FROM `表名` where title like '%$q%' order by id DESC " num="10" page="$page" return="data"}
    {loop $data $r}
    <tr>
       <td width="500" align="left" style="margin-top:2px; ">· <a href="{$r[url]}" title="{$r[title]}" class="centerTitle" style="text-decoration:none" >{$r[title]}</a></td>
       <td width="200" align="right" style="color:#FF6600;margin-top:2px;">{date('Y-m-d',$r[inputtime])}</td>
    </tr>
    {/loop}
    {if empty($data)}未找到后果{/if}
    <div class="pages">{$pages}</div>
{/pc}

此时,搜寻页面就能够了。

PHP中文网,年夜量的收费PHPCMS教程,欢送正在线学习!

以上就是phpcms v9搜寻性能怎样做的具体内容,更多请存眷资源魔其它相干文章!

标签: phpcms phpcms教程 phpcms技巧 php问题解决

抱歉,评论功能暂时关闭!