Web Directory Blog » 2011 » September

PHPLD Search Function Issue: Fixed

Posted @ September 3, 2011  |  Categorized Under: Directory News, Directory Related, Guides

It came to my attention that the search function on the directory was not working. After reports of link owners not being able to find their site via the search bar,I discovered that it was completely broken as no results came up for any keyword or term searched. I found a fix for it and it is now up and running again.

If any other phpld owners have this problem, here is the simple fix.

  • At the very end of search.php, find this code:

$pattern = array ( '/(AND[\s])+/', '/(OR[\s])+/', '/\s+/', '/`+/', '`^[^\w\d]`', '`[^`\w\d]$`' );

  • Replace it with:

$pattern = array ( '#(AND[\s])+#i', '#(OR[\s])+#i', '#[\s]+#', '#[`]+#', '#^[^\w\d]#i', '#[^`\w\d]$#i' );

Cheers!