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’;
// }