multi word searches now doesn't matter the order of the words

This commit is contained in:
Squidly271 2017-10-04 17:58:23 -04:00
parent 348ac9d3ac
commit 94f259aace
4 changed files with 15 additions and 9 deletions

Binary file not shown.

View File

@ -2,8 +2,8 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "community.applications">
<!ENTITY author "Andrew Zawadzki">
<!ENTITY version "2017.10.01a">
<!ENTITY md5 "f57dba2e59e6b077f4f287eed4fff296">
<!ENTITY version "2017.10.04">
<!ENTITY md5 "3cffaf87ba44fce45ef4eec5a9ad4e4e">
<!ENTITY launch "Settings/PluginSettings">
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
<!ENTITY github "Squidly271/community.applications">
@ -13,6 +13,9 @@
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;">
<CHANGES>
###2017.10.04
- Enhanced: Vastly better searching when using multiple search terms
###2017.10.01
- Fixed: Display abberration when switching from Previous Apps to Pinned Apps / ca Modules

View File

@ -45,7 +45,7 @@ $caCredits = "
<td><font color='coral'>Additional Testing</font></td>
</tr>
<tr>
<td><img src='https://forums.lime-technology.com/uploads/monthly_2017_02/kumaavatar.jpg.2c6c0e10ac6852b7f2ef0bc3c88b2299.jpg' width='48px' height='48px'></td>
<td><img src='https://forums.lime-technology.com/uploads/monthly_2017_09/59cbbf15696ec_spaceinvaderlogo.png.aacf1828fe685979ad8ea1586bfca22f.png' width='48px' height='48px'></td>
<td><strong><font color='coral'>gridrunner</font></strong></td>
<td><font color='coral'>Additional Testing</font></td>
</tr>

View File

@ -631,13 +631,16 @@ function create_ini_file($settings,$mode=false) {
# #
#######################################################
function filterMatch($filter,$searchArray) {
$filter = str_replace(" ","",$filter);
foreach ($searchArray as $search) {
if ( preg_match("#$filter#i",str_replace(" ","",$search)) ) {
return true;
}
$filterwords = explode(" ",$filter);
foreach ( $filterwords as $testfilter) {
foreach ($searchArray as $search) {
if ( preg_match("#$testfilter#i",str_replace(" ","",$search)) ) {
$foundword++;
break;
}
}
}
return false;
return ($foundword == count($filterwords));
}
###################################################################