Let's say I search my site for Julius... and get this result.
... more
Didn't find what you're looking for?
Search "Julius" on:
Web Links (0 Search Results)
Encyclopedia (0 Search Results)
Google
Google Groups
How would I go about adding other options to this more searchs.. for instance..
Web Links
Encyclopedia
Gallery
Forum
News
Comments
Topics
I think the search should search the entire site and someone has probably already tweaked it like that..
Any ideas.
Gary
oaklid Corporal
Joined: May 30, 2003
Posts: 56
Posted:
Mon Jun 09, 2003 3:27 am
YOu could go in and edit the code for the Search module (modules/Search/index.php) to add more modules.
Down near the bottom of the file there are several $mod bits. Look for
Code:
if (is_active("Downloads")) {
$dcnt = sql_num_rows(sql_query("select * from ".$prefix."_downloads
_downloads WHERE title LIKE '%$query%' OR description LIKE '%$query%'", $dbi),
$dbi);
$mod1 = "<li> <a href=\"modules.php?name=Downloads&d_op=search&
amp;query=$query\">"._DOWNLOADS."</a> ($dcnt "._SEARCHRESULTS.")";
}
What this says is if this site has an active download module, run the query and show the number of results and put the number of results, along with a link to the download module, in a variable called $mod1.
A few lines down the page, the $mod variables are output on the page (just above the Google stuff)
Right now there are three $mod in the file: Downloads, Web Links and Encyclopedia. But other modules are searchable and you should be able to tweak the code to include them as new $mod.
However you can't just substitute one module name for another, as each one seems to implement searching a little differently. Which means you'll have to dig around in teh code of each one to figure out how to format the query string.
Me? I'm not patient enough to do that. I've just bunged on some links to the search pages for the modules, ala
Code:
You can also:<br><a href="modules.php?name=Journal&file=search&disp=showsearch">
Search Journals</a><br>
<a href="modules.php?name=Forums&file=search">
Search Forums</a>
This method doesn't pass the query along, which is lazy and unkind to the users, but I have a deadline for launch and maybe I'll go fix it later. Maybe...
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum