PDA

View Full Version : Mini Mods - Navtab Search Box with Options


8thos
06-25-2011, 10:00 PM
Create search navtab across all skins, remove search from navbar, disable search box for guests, increase rate of accidental ad clicks due to search being right above ads.


https://vborg.vbsupport.ru/attachment.php?attachmentid=130410&stc=1&d=1309067185


Plugin PHP Code:
The code in green is where you can disable search for guests.
The code in red is where you can move the template hook per Allan's Guide (https://vborg.vbsupport.ru/showthread.php?t=232579).


// change $allowguests from 'true' to 'false' if you do NOT want guests to see the gallery menu

$allowguests = false;

/******** NO EDITS below here! ************/
/******************************************/

if ($show['member'] OR $allowguests)
{
global $vbphrase, $vbulletin, $bbuserinfo;
$sess = $vbulletin->session->vars['sessionurl_q'];
$template_hook['navbar_after_community'] .= '
<li class="popupmenu nohovermenu forumsearch menusearch" id="forumsearch">


etc...


To remove search from the navbar:

AdminCP/Styles and Templates/ Style Manager / Edit Templates / Navigation and Breadcrumb Templates / navbar

In navbar delete the following code:

<vb:if condition="$vboptions['enablesearches']">
<div id="globalsearch" class="globalsearch">
<form action="search.php?{vb:raw session.sessionurl}do=process" method="post" id="navbar_search" class="navbar_search">
<vb:comment><input type="hidden" name="s" value="{vb:raw session.sessionurl}" /></vb:comment>
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="do" value="process" />
<span class="textboxcontainer"><span><input type="text" value="" name="query" class="textbox" tabindex="99"/></span></span>
<span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search<vb:if condition="$stylevar['textdirection'] == 'rtl'">_rtl</vb:if>.<vb:if condition="(is_browser('ie') AND !is_browser('ie', 7) AND !is_browser('ie', 8))">gif<vb:else />png</vb:if>" name="submit" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/></span></span>
</form>
<ul class="navbar_advanced_search">
<li><a href="search.php{vb:raw session.sessionurl_q}" accesskey="4">{vb:rawphrase advanced_search}</a></li>
</ul>
</div>
</vb:if>


Read this article if you want to create the plugin yourself: https://vborg.vbsupport.ru/showthread.php?t=265810

I'll add another product later that disables the search bar in navtab for you.

AttalaEA
06-27-2011, 04:59 PM
Hello, Please I would Like to know how do i change the font colors of show posts and advance search because it doesn't appear properly?

See attachment.

Thanks

130456

8thos
06-27-2011, 05:30 PM
Hello, Please I would Like to know how do i change the font colors of show posts and advance search because it doesn't appear properly?

See attachment.

Thanks

130456I have attached a version 1.5 to the first post that has the font changed to white.

If you do not want white font, please take a look at the pic attachments. They show where and how to change the colors of Show Threads, Show Posts and Advanced Search.

https://vborg.vbsupport.ru/attachment.php?attachmentid=130458&stc=1&d=1309199321

https://vborg.vbsupport.ru/attachment.php?attachmentid=130459&stc=1&d=1309199321

AttalaEA
06-28-2011, 03:25 AM
Thank You Octavius for your kind and amazing support. :)

8thos
06-28-2011, 04:13 AM
Thank You Octavius for your kind and amazing support. :)
Thanks but I haven't figured out how to remove the default Search button through use of a product yet. I will later. I also had to go back and edit the 'how to remove default search box' code.

kylek
06-03-2012, 11:39 PM
Looks like it is not working now in 4.2.0 unless I have overlooked something.

dr1
07-22-2012, 10:00 AM
Looks like it is not working now in 4.2.0 unless I have overlooked something.

Any update on getting this working 4.2.0 ?

Nirjonadda
07-22-2012, 10:29 AM
I'll add another product later that disables the search bar in navtab for you.

Need mod remove Advanced Search Bar without manual template edit, is it possible to just flat out remover the search bar from the forum navbar?

bzcomputers
08-22-2012, 07:50 PM
Would like to use this on 4.2 but can't get it to work. Also how would I move it to be placed on the far right of the navbar row?

bhantugh
08-27-2012, 06:09 PM
any update why this does not work with 4.2? thanks

Leica.Robbiani
08-30-2012, 01:59 PM
Hi there,

here's the way I did it on 4.2.0:

in template "navbar_tabs" find:

{vb:raw template_hook.navbar_after_links}
below add:

<li class="popupmenu nohovermenu forumsearch menusearch" id="forumsearch">
<h6><a href="javascript://" class="popupctrl">Search</a></h6>
<form action="search.php?do=process" method="get">
<ul class="popupbody popuphover">
<li><input type="text" class="searchbox" name="query" value="Search..." tabindex="1" /></li>
<li class="formsubmit">
<input type="submit" class="button" value="Search" tabindex="2" />
</li>
<li class="formsubmit">
<div class="submitoptions">
<label><input type="radio" name="showposts" value="0" checked="checked" /> Show Threads</label>
<label><input type="radio" name="showposts" value="1" /> Show Posts</label>
</div>
<div class="advancedsearchlink"><a href="search.php?">Advanced Search</a></div>

</li>
</ul>
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="do" value="process" />
<input type="hidden" name="contenttype" value="vBForum_Post" />
<input type="hidden" name="exactname" value="1" />
</form>
</li>
In template "navbar" find:

<ul class="navbar_advanced_search">
<li><a href="search.php{vb:raw session.sessionurl_q}" accesskey="4">{vb:rawphrase advanced_search}</a></li>
{vb:raw template_hook.navbar_advanced_search}
</ul>
Delete it.

Best regards

L.R.

bzcomputers
08-30-2012, 04:11 PM
This solution above (Post #11) did not work for me - didn't show any Search link on NavBar.

Edit: the above code worked for me when added to template "navbar_tabs_enhanced" using vB 4.2 PL2

Any easy way to get this moved to the far right of the navbar?

bhantugh
08-30-2012, 06:55 PM
thanks. I've decided to go back to v4.1

Leica.Robbiani
08-30-2012, 07:18 PM
Hi there,

Any easy way to get this moved to the far right of the navbar?
Do I understand right, you like just a replacemnt for the Advanced Search link?

You can do that:

In template "navbar" find:

<li><a href="search.php{vb:raw session.sessionurl_q}" accesskey="4">{vb:rawphrase advanced_search}</a></li>

Replace this with the code for the searchbox.

Best regards

L.R.

Ende1
02-27-2016, 06:15 PM
is there any way to edit the normal search

from this

https://vborg.vbsupport.ru/external/2016/02/7.png

to this

https://vborg.vbsupport.ru/external/2016/02/8.png

with the code which was posted above? i don't want to use it with the navtab. i want to modify the regular search

Ende1
02-29-2016, 10:10 PM
like this

https://vborg.vbsupport.ru/external/2016/02/1.gif

Ende1
05-15-2016, 06:49 PM
Can someone help me with this please