Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications

Reply
 
Thread Tools
Google Search In Navbar Details »»
Google Search In Navbar
Version: 1.00, by SuperTaz SuperTaz is offline
Developer Last Online: Mar 2022 Show Printable Version Email this Page

Category: Add-On Releases - Version: 3.8.x Rating:
Released: 09-04-2009 Last Update: 09-06-2009 Installs: 25
Template Edits
Re-useable Code  
No support by the author.

/*================================================= =====================*\
|| ################################################## ################## ||
|| # Google Search In Navbar
|| # Version 1.00
|| # Author: Warden
|| # This mod may only be used from vbulletin.org
|| # DO NOT display this mod on any other modification site without my permission
|| # You can alter this code and re-display it here on vbulletin.org
|| ################################################## ################## ||
\*================================================ ======================*/

Description: This mod adds the Google Search to your navbar.

Install: Less than 1 minute.

Instructions:

1. Go to www.google.com/adsense and click on Adsense For Search and create a Search for your site. All you will need is your PUB ID and your site URL.

2. Find:

Code:
<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
Directly below that add:

Code:
<!-- Google Search ------------------>
<td class="alt2">
<DIV ALIGN=RIGHT>
<form action="YOUR SITE HERE" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-PUB ID HERE:afpnnc-ej87" />
    <input type="hidden" name="cof" value="FORID:10" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" name="q" size="50" />
    <input type="submit" name="sa" value="Search" />
  </div>
</form>

<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script>
</DIV>
</td>
<!-- Google Search ------------------>
Now paste this code on a page where you would like your results to appear:

Code:
<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>
Enter your site URL where it says "YOUR SITE HERE" (blue code).
Enter your PUB ID where it says "PUB ID HERE" in the code (red code).

Click Save and all Done. Refresh.

If you want support, click INSTALL!

Download Now

File Type: txt gsearch.txt (1.5 KB, 171 views)

Screenshots

File Type: png gsearch.PNG (6.5 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 11-21-2009, 06:28 AM
SuperTaz's Avatar
SuperTaz SuperTaz is offline
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 744
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jeweetog View Post
Hi,

Where did you (warden-b-) posted the search results in your forum?

I want it on the forum home page, but without the forums visible, just the nav bar and the users info.
I created a separate html page for admins and registered users on my site.

If you want it on a separate page, you will have to create another page and input the code into the new page.
Reply With Quote
  #33  
Old 11-21-2009, 09:23 AM
Jeweetog Jeweetog is offline
 
Join Date: Sep 2009
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Warden-B- View Post
I created a separate html page for admins and registered users on my site.

If you want it on a separate page, you will have to create another page and input the code into the new page.

Can i have those pages too please?
Reply With Quote
  #34  
Old 11-21-2009, 07:19 PM
SuperTaz's Avatar
SuperTaz SuperTaz is offline
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 744
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jeweetog View Post
Can i have those pages too please?
Sorry, I can not give out the pages I made for my site.

I see two options for you:

a. Make a separate html page
b. Make a .php file
c. or both
Reply With Quote
  #35  
Old 11-21-2009, 09:17 PM
GTX2 GTX2 is offline
 
Join Date: May 2006
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by joyboy2001 View Post
Thanks, but I think this is not the answer I was looking for ...
I get the results on the results page alright ... My question was, since navbar appears on all pages, and the code has been changed in the navbar template, how come the search box comes up only on forumhome and not on any other pages where the navbar appears ?
100% working, created a custom template page to display search results...
but....

Same question here, i have the search box on forum home only, can't understand why the search box doesn't show on every forum page.....
any tip?

Thanks
Reply With Quote
  #36  
Old 11-21-2009, 09:23 PM
GTX2 GTX2 is offline
 
Join Date: May 2006
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Found the solution for my last question: just add the code after the </if> below and just before the next </td>




I have another question for you, maybe dumb one:

My partner ID for search is something like: partner-pub-XXXXXXXXXXXXXX
When checking the code, i see there something after: partner-pub-XXXXXXXXXXXXXX:afpnnc-ej87..
what means the red color code? Should i use the one provided in my adsense account? or yours ":afpnnc-ej87" ?
Reply With Quote
  #37  
Old 11-21-2009, 09:38 PM
GTX2 GTX2 is offline
 
Join Date: May 2006
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Pvtiste View Post
Hello,

Thanks for sharing !
I have a little problem, when I put ? ? it doesn't works

Try this:

Instead of:
Code:
<input type="hidden" name="ie" value="UTF-8" />
use:
Code:
<input type="hidden" name="ie" value="ISO-8859-1" />


This should solve problem
Reply With Quote
  #38  
Old 11-22-2009, 09:14 AM
Jeweetog Jeweetog is offline
 
Join Date: Sep 2009
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Warden-B- View Post
Sorry, I can not give out the pages I made for my site.

I see two options for you:

a. Make a separate html page
b. Make a .php file
c. or both

I made a custom forum home page, the only thing i removed from visibility are the forums. How can i implement that? Where do i put the file and make the file visible to the forum's internal functions and stuff?
Reply With Quote
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 03:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07111 seconds
  • Memory Usage 2,309KB
  • Queries Executed 23 (?)
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
  • (5)bbcode_code
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (2)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete