MyBB Community Forums

Full Version: Search button in header
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I see that this site has Search in the header.
Im using the MyBulletin style of the theme, so how can i move the search into the header, like here at this site?

thnx in advance,
taddy1449 Smile
<form method="post" action="{$mybb->settings['bburl']}/search.php">
<input type="hidden" name="action" value="do_search" />
<input type="hidden" name="postthread" value="1" />
<input type="hidden" name="forums" value="all" />
<input type="hidden" name="showresults" value="threads" />
<input type="text" name="keywords" value="Search all forums..." onfocus="if(this.value == 'Search all forums...') { this.value = ''; }" onblur="if(this.value=='') { this.value='Search all forums...'; }" class="textbox" size="25" />
</form>

Look at that.. it even includes a spiffy little "click on/disappear message"...

You can change "search all forums..." to whatever you want. Be sure to change all 3 and they match...

If you want a submit button that will cost you extra... (pressing enter will submit the forum)
well thanks im gonna try this out Smile
and yeah beside the white bar where you type, the button is also welcome, like here at this site, is it possible?

EDIT: oo i forgot to ask, is this header template, or some else? and where in the template do i add it or replace it?
Scratch that.. Hang on..
oh boy... gonna be a minute. out of the blue I ran into a major error.

just hang tight ...
It should be:

<input type="submit" class="button" value="Go" /> added before </form>

-----

Copy over to notepad whatever template you throw that into. I have no idea why it just went haywire on me...

Maybe it's because my mouse is messed up at the moment. :/ Dodgy
You can put it anywhere.. if in the header put it after <div id="header">
You can put it anywhere.. if in the header put it after <div id="header">
See what I mean... dumb mouse always double clicks.. grr...
wow thank you so much dude! it worked! Smile now just a little extra. Can i have a custom button(made by myself)?And at the moment the search is under the header image, can i locate(move it around) it, like i want?

EDIT: and if i delete that "added before" nothing will go wrong right?coz its a little annoying...
Honestly.. no, not sure how lol.. I'm finding out how to though. Hand tight a a minute...

Smile
Ok.. it wasn't too difficult.

<input type="image" src="images/whatever.gif">

Use that instead of submit code I gave you.

Let me know if it displays weird...
I don't know what your layout is so it'd be hard to say what to do in order for it to be positioned right..

PM me a link to your forum (if it's under construction) and I'll help you out setting it up nice Smile
Oh, and no, nothing will go wrong. I realize that my mouse double clicked and selected half of the template and when I pasted I lost it all, since it replaced what I selected, and I didn't realize it... Happens once in a while :/... Pain in the butt having to re-upload a test database just to go find that template again, but whatever.. back to normal.
thanks dude, i realy appriciate it! i worked with the custom image, now i will pm you for the location of it(like u said) Smile