MyBB Community Forums

Full Version: Change the code for the "search" function, where and how?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I have up and running on my blog my new super duper Google search which allows me to search the blog AND the forum.
What I would like to do now is to do away with the default "search" functionality (which I never really liked much...) on my forum and add instead a link to the "combined" search.

I am not clear which file to edit (the theme's, the default's or what?).
Also, I would like to comment out the existing line of code (just in case...) and add the new one.

I thought it would have been straightforward, but alas notSad For some reason I cannot remove the existing "search" box. That is probably because I am trying to edit the wrong file... at the moment I working on the theme's header.

TIA
You are in the right place. To remove the search link from the header this is the code you need to either comment it out or remove it:

<li><a href="{$mybb->settings['bburl']}/search.php"><img src="{$theme['imgdir']}/toplinks/search.gif" alt="" title="" />{$lang->toplinks_search}</a></li>

Whereas to remove the search page completely, remove the search.php file as well from your forum root.
Hi borbole,

thanks for your reply. So I was in the right place and got the right line of code... that's something, I suppose Big Grin.
However when I try to comment that line out, the box does not disappear... quite the opposite... instead I get stray characters (like * or /, depending on what I was using to comment the code out) and the box stays there. I MUST be doing somethign daft (but I am NOT a php person Smile )

Besides, must I remove search.php from the root? I thought I could simply remove the code that calls it, and then I wouldn't see it anymore (the new file has a different name anyway).

Thanks again,

A.
PHP comments won't work. You either need to remove the line or use HTML comments.

<!-- <li><a href="{$mybb->settings['bburl']}/search.php"><img src="{$theme['imgdir']}/toplinks/search.gif" alt="" title="" />{$lang->toplinks_search}</a></li> -->
That worked a treat. Thanks a lot Smile