Fork me on GitHub
Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
Submit a Q&A Request a Q&A Open Questions

Search

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00

Learn XOOPS Core

Local Support

Advertisement

XOOPS Code hosted on SourceForge

How do I...

Make a custom block?

Answer here!

Did you know ?

Fantastico installer can install an older version of xoops?

More details...

Random question

Hi, my provider just updated the server where I have installed xoops and now I have this error message

"XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run."

Could someone point me to the right direction to solve this problem. Thanks.

Answer here!

Recent Q&A List

Cumulus Tag Cloud

- 2 2.5 2.6 3.0 4 6 2013 Abuse adslight Android AntiHarvesting AntiMalUser AntiSpam Apple Battlefield billige Blocks Bootstrap Captcha cell cent chronolabs Clicks content CĂN demo download Dresses facebook Fat floor Food for free Gateway Guide herre Home Honeypot HP html5 Human HỘ iPhone jQuery List log Loss mobile module modules Monster new newbb news NHÀ online PARK phone PHP Prevention profile project Protector publisher Rapid RESIDENCE responsive review Rights rmcommon Room security Sentry site Smartphone Smarty Smoking Spam stem Studio support tag tags tdmcreate template The Theme themes User userlog web weight xoops Xortify XPayment ZendFramework

New Users

Registering user

# 137296

Trudy

Welcome to XOOPS!
SmartFAQ is developed by The SmartFactory (http://www.smartfactory.ca), a division of InBox Solutions (http://www.inboxsolutions.net)

Question
How do I clean up the search results page?
Answer
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>';

Requested and Answered by Anonymous on 2005/4/11 9:44:57 (4834 reads) 9 Comment(s) Print Q&A Send Q&A

The comments are owned by the author. We aren't responsible for their content.
This looks like a very useful hack, thanks for your input. I'm looking forward to trying this one. Has it been submitted for future feature requests?
Published: 2005/4/12 3:50 • Updated: 2005/4/12 3:50
Quote:
I'm looking forward to trying this one. Has it been submitted for future feature requests?


No. It seems to be, that noone (except me) was ever annoyed by the way search results were displayed.

But I will send the hack in.
Published: 2005/4/12 4:19 • Updated: 2005/4/12 4:19
Many thanks...I'm building a 'Thai fish' site that probably sets a world record for the most instances of Tiny-D. The search results would have been unusable without this hack.

Please do submit your hack !
Published: 2005/4/13 12:14 • Updated: 2005/4/13 12:15
I just applied this hack on my site - it works nicely - great stuff!

One tip however, I found the line :

if ($nothingthere == '1') {
    echo 
"<p>"._SR_NOMATCH."</p>";
    }


that you add caused the text "No matches in your query" to appear above the search form before the user has entered a search term.

I removed it and the problem went away.

Why is that line necessary? it works fine without it.

anyway, great hack - thanks for the tip!
Published: 2005/4/13 23:59 • Updated: 2005/4/13 23:59
Strange! Perhaps you made a mistake while changing the code. This:

if ($nothingthere == '1') {
    echo 
"<p>"._SR_NOMATCH."</p>";
    }


must be inserted BEFORE the first appearance of

include "include/searchform.php";


Perhaps you inserted the code BEFORE the first appearance of

include 'include/searchform.php';


There is a difference the way quotes are written.
Published: 2005/4/14 9:29 • Updated: 2005/4/14 9:29
this hack works great for us, really great hack.
Published: 2005/4/14 14:27 • Updated: 2005/4/14 14:27
I have followed all the instructions, and it works, but the module titles are all still there. This still makes the search results look a little messy.

Is there a way to clean up the search results completely, so that only the results are displayed (unless there are no results)

Also, Is there a way I can have a search box that searches both my site and Google?

Thanks for anyones help! Rob B
Published: 2005/4/25 5:26 • Updated: 2005/4/25 5:26
Again, very useful hack.

This thread appears to have died, though, before the question of module names vs. block names on the Search Results page was addressed.

Obviously, the XOOPS site itself does this--the search results show the block name, not the actual module name, of the hits. How is this done?
Published: 2005/5/18 13:26 • Updated: 2005/5/18 13:26
hOw about adding a radio button for a Whole word search? when I search for "war" I get warren beatty and schwarezenegger.
Published: 2005/6/17 23:02 • Updated: 2005/6/17 23:02