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 "<p>"._SR_NOMATCH."</p>";
One line later after
} else {
insert the following lines:
$nothingthere++;
echo 
"<h4>".$myts->makeTboxData4Show($module->getVar('name'))."</h4>";
Look for the first appearance of:
include "include/searchform.php";
and insert the following lines before the above line:
if ($nothingthere == '1') {
    echo 
"<p>"._SR_NOMATCH."</p>";
    }
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 '<br /><a href="'.$search_url.'">'._SR_SHOWALLR.'</a></p>';
and replace with:
echo '<p><a href="'.$search_url.'">'._SR_SHOWALLR.'</a></p>';

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