phpcms后台搜索功能内容敏感词搜索

1,修改文件 /phpcms/modules/content/templates/content_list.tpl.php。

打开文件大约在50行添加:

代码如下:

<option value='4' <?php if($_GET['searchtype']==4) echo 'selected';?>>内容</option>

2,在修改文件 phpcms/modules/content/content.php。

打开文件大约在90行添加:

代码如下:

            elseif($searchtype==4){
                $searchtype = $type_array[$searchtype];
                $keyword = strip_tags(trim($_GET['keyword']));
                $where = "id in(select id from ".$this->db->db_tablepre.$this->db->model[$modelid]        
                ['tablename']."_data where `content` like '%".$keyword."%')";
                }

3,效果如图:

posted @ 2019-04-11 13:23  Chervehong  阅读(383)  评论(0编辑  收藏  举报