Implementation of fuzzy Search in uchome and repair of pagination bug _php tutorial

Source: Internet
Author: User
This article to give you a detailed introduction of the uchome in the implementation of fuzzy search and the repair of the page bug some specific methods, you need to know the friend can refer to this article to set.

In the default Uchome, a friend's search can not be blurred search, I do not know why, some people can not remember the full name of a friend can not find the friend in the search, which is very bad for the user experience.

After the research changes the following code can realize Uchome's fuzzy search function.

In the file cp_friend.php in source, find the following statement in the code to modify $wherearr[]:

The code is as follows Copy Code

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]} '";
}
}
}

Search for bug fixes for paging

Users found Ucenter in use if you add time to search, the list of pagination is wrong, ucenter1.5 and 1.6 have this error, do not know why the official does not solve the problem. After research, the solution is as follows:
Open the user.php under Control/admin
Find Code

The code is as follows Copy Code

$multipage = $this->page ($num, UC_PPP, $_get[' page '], ' admin.php?m=user&a=ls&srchname= '. $srchname. ' &srchregdate= '. $srchregdate);

Change it to

The code is as follows Copy Code

$multipage = $this->page ($num, UC_PPP, $_get[' page '], ' admin.php?m=user&a=ls&srchname= '. $srchname. ' &srchregdatestart= '. $srchregdatestart. ' &srchregdateend= '. $srchregdateend);

can complete the repair.

http://www.bkjia.com/PHPjc/632087.html www.bkjia.com true http://www.bkjia.com/PHPjc/632087.html techarticle This article to give you a detailed introduction of the uchome in the implementation of fuzzy search and the repair of the page bug some specific methods, you need to know the friend can refer to this article to set. In the default ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.