1024programmer PHP Solution to modify the search.php page in discuz7.2 version

Solution to modify the search.php page in discuz7.2 version

Discuz version 7.2 modifies the search.php page
Dear heroes, I now want to modify the search.php page in discuz. The search type is not the original title and full-text search. It needs to be modified to posts and users, that is, the search type matches the posts. + all posts of the keyword, and another is to search out all the posts of the user with the user + keyword. How should I modify it? Urgent! ! ! ! ! ! !

——Solution——————–
You can learn from Baidu and use keywords in special formats for word segmentation. For example, if you want to search for “user group” related topics posted by the admin user, you can enter “user:(admin) user group”, and then $keyword Perform regular expression processing to obtain the user name and keywords, and then spell SQL. You cannot simply search with “admin user group”, as this will cause great trouble in program processing.

——Solution——————–
No The code modification in 7.2 is nothing more than the files in source\module\search. Check which module your search corresponds to.

——Solution——————–
Just block a piece of code in search.php. .

// if ($allowsearch == 2 && $srchtype == ‘fulltext’) {
// periodscheck ( ‘searchbanperiods’ );
// } elseif ($ srchtype != ‘title’) {
// $srchtype = ‘title’;
// }

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/solution-to-modify-the-search-php-page-in-discuz7-2-version/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索