if a filter is two words, combine the two words into one if there is no match on the separates and search again
parent
3d6054a30c
commit
dd7f3136f2
Binary file not shown.
|
@ -1126,7 +1126,7 @@ case 'get_content':
|
|||
if ( $category && ! preg_match($category,$template['Category'])) { continue; }
|
||||
|
||||
if ($filter) {
|
||||
if (preg_match("#$filter#i", $template['Name']) || preg_match("#$filter#i", $template['Author']) || preg_match("#$filter#i", $template['Description']) || preg_match("#$filter#i", $template['RepoName'])) {
|
||||
if ( filterMatch($filter,array($template['Name'],$template['Author'],$template['Description'],$template['RepoName'])) ) {
|
||||
$template['Description'] = highlight($filter, $template['Description']);
|
||||
$template['Author'] = highlight($filter, $template['Author']);
|
||||
$template['Name'] = highlight($filter, $template['Name']);
|
||||
|
|
|
@ -612,6 +612,29 @@ function create_ini_file($settings,$mode=false) {
|
|||
return $iniFile;
|
||||
}
|
||||
|
||||
#######################################################
|
||||
# #
|
||||
# Function used to determine if a search term matches #
|
||||
# #
|
||||
#######################################################
|
||||
function filterMatch($filter,$searchArray) {
|
||||
foreach ($searchArray as $search) {
|
||||
if ( preg_match("#$filter#i",$search) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if ( strpos($filter," ") ) {
|
||||
$filter = str_replace(" ","",$filter);
|
||||
foreach ($searchArray as $search) {
|
||||
if ( preg_match("#$filter#i",$search) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
############################################################################
|
||||
# #
|
||||
# Function to convert a template's associative tags to static numeric tags #
|
||||
|
|
Loading…
Reference in New Issue