为 EMLOG 添加全局搜索  0    2 
EMLGO 搜索只是搜索文章标题,并没有搜索文章内容
在论坛看到有的人需要,确实也很简单(一两行代码就可以解决),所以就把代码贴上来
需要改的文件:include/controller/search_controller.php

找到

 $sqlSegment = "and title like '%{$keyword}%' order by date desc";
修改为:
$sqlSegment = "and (title like '%{$keyword}%' or content like '%{$keyword}%')  order by date desc";

然后你就可以尽情的 体验 EMLOG 全局搜索 带来的乐趣了

注:以上代码 以 EMLOG 5.3 为例


原文地址:http://gouji.org/2014/06/289.html

0
0
回复 ( 0 )