The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Use Google Custom Search In Navbar - Step By Step Details »» | |||||||||||||||||||||||||||||||
Use Google Custom Search In Navbar - Step By Step
Developer Last Online: Jan 2016
This mod will replace vb search in navbar with google custom search.. you can still use advance search from navbar. google search provide much better result when you try to search word under 4 letters..
1. First download google.php upload in your forum root 2. Go to your AdminCP Go to Styles & Templates -> Style Manager select Style then click Create New Template rename Template to GOOGLE Paste this code in google Template : Code:
{vb:stylevar htmldoctype} <html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html"> <head> <title>{vb:raw vboptions.bbtitle}</title> {vb:raw headinclude} </head> <body> {vb:raw header} {vb:raw navbar} <div id="pagetitle"> <h1>{vb:raw pagetitle}</h1> </div> <h2 class="blockhead">Google Custom Search</h2> <div class="blockbody"> <div class="blockrow"> <div id="cse-search-results"></div> <script type="text/javascript"> var googleSearchIframeName = "cse-search-results"; var googleSearchFormName = "cse-search-box"; var googleSearchFrameWidth = 800; var googleSearchDomain = "www.google.com"; var googleSearchPath = "/cse"; </script> <script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script> </div> </div> {vb:raw footer} </body> </html> Code:
<form action="http://www.mobilephonetalk.com/google.php" id="cse-search-box"> <input type="hidden" name="cx" value="partner-pub-8038994048300561:7c8fy7cujxg" /> <input type="hidden" name="cof" value="FORID:9" /> <input type="hidden" name="ie" value="ISO-8859-1" /> <span class="textboxcontainer"><span><input type="text" value="" name="q" class="textbox" /></span></span> <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.png" name="sa" onclick="document.getElementById('navbar_search').submit;" /> </span></span> </form> <script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script> Replace partner-pub-8038994048300561:7c8fy7cujxg with your won adsense code... Download Now
Screenshots
Show Your Support
|
3 благодарности(ей) от: | ||
appsfinder, daviet, KILLERMG |
Comments |
#92
|
||||
|
||||
Recently found that the results page that is generated does not use the additional.css, so certain elements of my theme were broken.
How can I make sure the additional.css is loaded with this? |
#93
|
|||
|
|||
Quote:
|
#94
|
||||
|
||||
I delete the events, as it negatively affects the speed of loading pages.
Удаляю этот мод, так как он отрицательно влияет на скорость загрузки страниц. I should add that the site specified by the author mobilephonetalk contains unwanted software and locks the browser Google Chrome. Добавлю, что сайт указанный автором mobilephonetalk содержит нежелательное ПО и блокируется браузером Google Chrome. |
#95
|
|||
|
|||
I would have liked to keep the VBForum search box as well as this, but when I have them both, one bumps the other into the lower navigation bar.
4.2.3 Any suggestions? It probably has to do with editing the "globalsearch" class (width; 180px; ), but I sure can't figure out how to find it Code:
<div id="navbar" class="navbar"> <ul id="navtabs" class="navtabs floatcontainer<vb:if condition="$show['member'] AND $notifications_total"> notify</vb:if>"> {vb:raw template_hook.navtab_start} {vb:raw navigation} {vb:raw template_hook.navtab_end} </ul> <vb:if condition="$vboptions['enablesearches']"> <div id="globalsearch" class="globalsearch"> <!-- BEGIN GOOGLE CUSTOM SEARCH --> <form action="http://www.teambuick.com/forums/google.php" id="cse-search-box"> <input type="hidden" name="cx" value="partner-pub-5874277334279308:1253965069" /> <input type="hidden" name="cof" value="FORID:9" /> <input type="hidden" name="ie" value="ISO-8859-1" /> <span class="textboxcontainer"><span><input type="text" value="Search Reference" name="q" class="textbox" /></span></span> <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.png" name="sa" onclick="document.getElementById('navbar_search').submit;" /> </span></span> </form> <script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script> <!-- END GOOGLE CUSTOM SEARCH --> <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="Search Forums" 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)">gif<vb:else />png</vb:if>" name="submit" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/></span></span> </form> |
#96
|
||||
|
||||
Look in your "vbulletin-chrome.css" template for that class selector.
|
#97
|
|||
|
|||
Thanks for your help! I found it and played with it, but it must not be what I need
In case you or someone else can point me in the right direction, I would like the two searches to line up side by side in the navbar. I have attached an image how one search box is displacing the second one to the line below it: |
#98
|
||||
|
||||
What I do is place Google code in navbar (choose your position), leaving vBulletin's search completely intact. In this way I have two search engines with Google one preferred (GCS input form is 100% wide).
|
#99
|
|||
|
|||
Alan,
That sounds like what I am trying to do. I am just having difficulty figuring out how. When I place it in the navbar, it displaces the VB search as shown in the image. I tried placing it in the navbar_tabs template, but it displaced the last tab to the lower level. I have seen it done on other sites, but I am not figuring it out. And I have been searching all over. All I find is the same replace default search. Thanks |
#100
|
|||
|
|||
I tend to use this. It works much better.
https://vborg.vbsupport.ru/showthread.php?t=266520 |
#101
|
||||
|
||||
Quote:
I placed code in navbar template, so it isn't in navbar per se, but it is visible in every page. You can see it here: https://slobodni.net This way I still have completely working vB search and Google Custom Search available everywhere. I didn't want to change or modify vB search. And also I wanted to "force" users to use GCS as much as it is possible. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|