wellcms 搜索翻页如何启用 怎么修改

默认情况下WELLCMS搜索页面是无法翻页的

官方也不建议开启搜索翻页

不过有些用户不接受官方建议

那么可以按下面的方法进行修改开启

打开

\route\operate.php

搜索

$threadlist = well_thread_find_by_keyword($keyword_decode);

替换为

$cond = array('subject'=>array('LIKE'=>$keyword_decode));
$threadlist = well_thread__find($cond, array(), $page, $pagesize, 'tid');
$n = well_thread_count($cond);
if ($threadlist) {
$threadlist = arrlist_multisort($threadlist, 'tid', FALSE);
foreach ($threadlist as &$thread) {
well_thread_format($thread);
// 关键词标色
//$thread['subject'] = comment_highlight_keyword($thread['subject'], $keyword);
}
}
$page_url = url('operate-search-'.str_replace('_','#@#',$keyword).'-'.$range.'-{page}');
$pagination = str_replace('#@#','_',pagination($page_url, $n, $page, $pagesize));

即可强制开启

默认搜索模板支持搜索翻页

非默认模板请自行修改适配


© 版权声明
THE END
相关内容