This article will introduce to you in detail some specific methods of implementing fuzzy search and fixing paging bugs in uhome. Friends who need to know more can refer to this article to set up.
In the default uchome, the search for friends cannot be fuzzy search. For some reason, some people cannot remember the full name of a friend and cannot find the friend through the search. This is very bad for the user experience.
After research and changing the following code, the fuzzy search function of uhome can be realized.
Find the following code in the cp_friend.php file in the source and modify the statement in $wherearr[] as follows:
代码如下 | 复制代码 |
if($searchkey = stripsearchkey($_GET['searchkey'])) { $wherearr[] = "(s.name like '%"."$searchkey"."%' OR s.username like '%"."$searchkey"."%')"; } else { foreach (array('uid','username','name','videostatus','avatar') as $value) { if($_GET[$value]) { $wherearr[] = "s.$value='{$_GET[$value]}'"; } } } |
Fixing of search paging bug
During use, I found that if user search for ucenter takes more time to search, the paging in the list is wrong. Both ucenter1.5 and 1.6 have this error. I don’t know why the official does not solve this problem. After research, the solution is as follows:
Open user.php under control/admin
Find the code
The code is as follows
|
Copy code
|
||||
|
The code is as follows
|
Copy code |