Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles
Navtab Search Box with Options (How-To-Guide)
8thos's Avatar
8thos
Join Date: Aug 2010
Posts: 772

What's up my name's Dre and I'm a Trinidadian-American from NY & FL, a USAF Veteran, work as Tech Support. Major is Film. Goals: Get a bachelor's in something, not sure yet and finish writing some books I started writing in high school. I'm not on vb

Pensacola, FL
Show Printable Version Email this Page Subscription
8thos 8thos is offline 06-25-2011, 10:00 PM

In this guide you will learn how to:
  1. Create search navtab across all skins.
  2. Remove search from navbar.
  3. Disable search box for guests.
  4. Increase rate of accidental ad clicks due to search being right above ads.
  5. Do it in under 2 minutes.







I got the Plugin PHP code by modifying both Forum Display and Group Search.

If you have a lot of traffic and don't want guests slowing down your site, you can disable search for guests.

I created the plugin using Allan's Guide:
https://vborg.vbsupport.ru/showthread.php?t=232579


1. AdminCP/Plugins & Products/Add New Plugin

2. Product: vBulletin

3. Hook Location: process_templates_complete

4. Title: Search

5. Execution Order: 5


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

Code:
// 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">
				<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>
';
}
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:

[code]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:

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>
Hit save.

You're done.
Attached Images
File Type: jpg searchgone.jpg (85.4 KB, 0 views)
File Type: jpg searchplugin.jpg (140.6 KB, 0 views)
Reply With Quote
  #2  
Old 06-26-2011, 05:06 PM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Created a product for just the plugin: https://vborg.vbsupport.ru/showthread.php?p=2213118.
Reply With Quote
Благодарность от:
kylek
  #3  
Old 04-19-2012, 07:26 PM
doctorsexy's Avatar
doctorsexy doctorsexy is offline
 
Join Date: Mar 2011
Location: earth
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That helped alot...thank you
Reply With Quote
  #4  
Old 05-18-2012, 06:41 AM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by doctorsexy View Post
That helped alot...thank you
Your welcome!
Reply With Quote
  #5  
Old 05-22-2012, 04:58 PM
jca2112's Avatar
jca2112 jca2112 is offline
 
Join Date: Sep 2007
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 8thos View Post
In this guide you will learn how to:

4. Increase rate of accidental ad clicks due to search being right above ads.
It's a violation of Google Adsense (and most any ad network) to intentionally obscure ads and more importantly, encourage any type of invalid ad clicks, directly or indirectly.

Why are you advocating this as a feature when it could get users of your mod/edit banned from their ad network(s)?
Reply With Quote
Благодарность от:
djbaxter
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:00 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04656 seconds
  • Memory Usage 2,269KB
  • Queries Executed 19 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (3)post_thanks_box_bit
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (2)postbit_attachment
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete