Home> CMS Tutorial> PHPCMS> body text

What should I do if phpcms cannot find the content?

藏色散人
Release: 2020-02-03 13:52:42
Original
2530 people have browsed it

What should I do if phpcms cannot find the content?

What should I do if phpcms cannot find the content? Phpcms v9 search results are incomplete and the content cannot be searched and the search result sorting problem

There is a problem with the Phpcms V9 result search used in the website backend. I have found the information and organized it as follows:

First Steps:

phpcms v9 search results are incomplete and the content cannot be found Solution:

Open phpcms\modules\search\index.php

Find

if(!empty($segment_q)) { $sql = “`siteid`= ‘$siteid’ AND `typeid` = ‘$typeid’ $sql_time AND MATCH (`data`) AGAINST (‘$segment_q’ IN BOOLEAN MODE)”; } else { $sql = “`siteid`= ‘$siteid’ AND `typeid` = ‘$typeid’ $sql_time AND `data` like ‘%$q%'”; }
Copy after login

Modify to

if(!empty($segment_q)) { $sql = “`siteid`= ‘$siteid’ AND `typeid` = ‘$typeid’ $sql_time AND `data` like ‘%$q%'”; } else { $sql = “`siteid`= ‘$siteid’ AND `typeid` = ‘$typeid’ $sql_time AND `data` like ‘%$q%'”; }
Copy after login

The result is that you no longer use word segmentation for keyword searches, but directly use the keywords you entered to search.

Second step:

Search results are sorted in descending order of time

Modified page: \phpcms\modules\search\index.php Only modify one line!

Search:

$data = $this->content_db->select($where, ‘*’);
Copy after login

Replace with:

$data = $this->content_db->select($where, ‘*’,”,’id desc’);
Copy after login

This way the search content can be sorted in descending order by time.

PHP Chinese website, a large number of freePHPCMS tutorials, welcome to learn online!

The above is the detailed content of What should I do if phpcms cannot find the content?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!