How do I clean up the search results page?

Requested and Answered by Anonymous on 2005/4/11 14:44:57

How do I clean up the search results page?

Everyone with a lot of searchable modules on his site knows this problem. For every module the name is displayed plus the information that nothing was found inside this module. Why not displaying search results a different way? Only showing links in a module where results occur? Here a how-to to remove the negative information for the modules with no results. Open xoopsroot/search and make some changes. Look for the first appearance of

include XOOPS_ROOT_PATH."/header.php";
and insert after this this line:
$nothingthere 1;
Look for the first appearance of
<h4>...
and delete the line. Two lines later delete this line:
echo "

"._SR_NOMATCH."

"
;
One line later after
} else {
insert the following lines:
$nothingthere++;
echo 
"

".$myts->makeTboxData4Show($module->getVar('name'))."

"
;
Look for the first appearance of:
include "include/searchform.php";
and insert the following lines before the above line:
if ($nothingthere == '1') {
    echo 
"

"._SR_NOMATCH."

"
;
    }
Now save the file and Voila! Now the search results page is tidied up. There is one tiny HTML-bug inside search.php. Look for line:
echo '.$search_url.'">'._SR_SHOWALLR.'

'
;
and replace with:
echo '

.$search_url.'">'._SR_SHOWALLR.'

'
;

This Q&A was found on XOOPS Web Application System : https://xoops.org/modules/smartfaq/faq.php?faqid=457