Accoording to google only 100 people use search on my site a day on average. That's pretty bad, IMO.
What have some of you done to increase visibility of the vBulletin search?
This is a discussion on Making vBulletin search more prominent within the General Discussion forums, part of the vBulletin SEO Discussion category; Accoording to google only 100 people use search on my site a day on average. That's pretty bad, IMO. What ...
Accoording to google only 100 people use search on my site a day on average. That's pretty bad, IMO.
What have some of you done to increase visibility of the vBulletin search?
search is my 14th most visited page according to analytics, and just 100 pages shy of my pm stats.
so, i'd say its visible enough?
Last edited by Brian Cummiskey; 12-01-2009 at 01:21 AM.
Hello guys there is a method to implement the custom search of google on the default search.php page of vbulletin?
I use it for guests only to keep loads down and maybe earn a couple bucks on the side. (Well, it's more like a couple cents :( )
step 1)
alter search_forms template. here's my compelte template.
basically, you make a new if condition for guests and include the google code, else the default template:
The highlighted code comes from google's search and requires your adsense pub ID, so log into adsense and create a new search unit. you'll get similar code. just plug in your pub id, etc
The part in blue needs to be a custom made page. This acts as the 'wrapper' for the search results.Code:$stylevar[htmldoctype] <html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> $headinclude <title>$vboptions[bbtitle] - <if condition="$show['searchthread']">$vbphrase[search_thread]<else />$vbphrase[search_forums]</if></title> $tag_cloud_headinclude </head> <body> $header $navbar <if condition="is_member_of($vbulletin->userinfo, 1,4)"> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="tcat">Search</td> </tr> <tr> <td class="alt1" style="text-align: center;"> <div id="guestbar">Welcome, Guest! Please <a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a> or Login:<br /> <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])"> <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script> <label for="navbar_username">$vbphrase[username]</label><input type="text" name="vb_login_username" size="10" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /> <label for="navbar_password">$vbphrase[password]</label><input type="password" name="vb_login_password" size="10" /> <input type="hidden" name="cookieuser" value="1" /><input type="submit" class="button" value="$vbphrase[log_in]" title="$vbphrase[enter_username_to_login_or_register]" /> <input type="hidden" name="s" value="$session[sessionhash]" /> <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" /> <input type="hidden" name="do" value="login" /> <input type="hidden" name="vb_login_md5password" /> <input type="hidden" name="vb_login_md5password_utf" /> </form> <p>Members have access to more features, better search, and see fewer ads! It's free, what are you waiting for?</p> </div> <br /> <br /> <style type="text/css"> @import url(http://www.google.com/cse/api/branding.css); </style> <div class="cse-branding-bottom"> <div class="cse-branding-form"> <form action="http://yourdomain/forums/guestsearch.php" id="cse-search-box"> <div> <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxxxxxx" /> <input type="hidden" name="cof" value="xxxxxxxxxx" /> <input type="hidden" name="ie" value="ISO-8859-1" /> <input type="text" name="q" size="31" /> <input type="submit" name="sa" value="Search" /> </div> </form> </div> <div class="cse-branding-logo"> <img src="http://www.google.com/images/poweredby_transparent/poweredby_FFFFFF.gif" alt="Google" /> </div> <div class="cse-branding-text"> Custom Search </div> </div> <br /> <br /> </td> </tr> </table> <else /> PUT THE REST OF THE CODE FOR THE 'GUTS' OF THE DEFAULT TEMPLATE HERE, STARTING WITH: <if condition="$show['errors']"> AND ENDING WITH: <if condition="$tag_cloud"> <div style="margin-top:20px">$tag_cloud</div> </if> </if> $footer </body> </html>
It's a simple php script that does nothing more than call the 'skin' and a new custom search template.
guestsearch.php
Finally, add the new template:Code:<?php // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'guestsearch'); define('CSRF_PROTECTION', true); // ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array( ); // get special data templates from the datastore $specialtemplates = array( ); // pre-cache templates used by all actions $globaltemplates = array( 'guestsearch', ); // pre-cache templates used by specific actions $actiontemplates = array( ); // ######################### REQUIRE BACK-END ############################ require_once('./global.php'); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $navbits = array(); $navbits[$parent] = 'Search YOUR DOMAIN'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); eval('print_output("' . fetch_template('guestsearch') . '");'); ?>
Again, most of this code comes directly from google.... so be sure to replace it with yours as given from the adsense setup.
template name: guestsearch
and i made a custom class called "searchres" so i could style the block.Code:$stylevar[htmldoctype] <html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> $headinclude <title>$vboptions[bbtitle] - $vbphrase[search_forums]</title> </head> <body> $header $navbar <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="tcat">Search Results</td> </tr> <tr> <td class="searchres"> <br /> <div id="guestbar"> Welcome, Guest! <br /> Members have access to more features, <b>better search</b>, and see fewer ads! It's free, what are you waiting for? Please <a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a> or Login:<br /> <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])"> <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script> <label for="navbar_username">$vbphrase[username]</label><input type="text" name="vb_login_username" size="10" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /> <label for="navbar_password">$vbphrase[password]</label><input type="password" name="vb_login_password" size="10" /> <input type="hidden" name="cookieuser" value="1" /><input type="submit" class="button" value="$vbphrase[log_in]" title="$vbphrase[enter_username_to_login_or_register]" /> <input type="hidden" name="s" value="$session[sessionhash]" /> <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" /> <input type="hidden" name="do" value="login" /> <input type="hidden" name="vb_login_md5password" /> <input type="hidden" name="vb_login_md5password_utf" /> </form> </div> <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> </td> </tr> </table> $footer </body> </html>
just add to the final custom CSS block in edit main css: (and change colors to match your skin if necessary)
that's it.Code:.searchres { background: #fff; padding: 10px; margin: 0; }
also note, you may need to alter your groups in the first step
<if condition="is_member_of($vbulletin->userinfo, 1,4)">
1 and 4 are my unregistered and awaiting email conf groups.
Thanks Brian it work fine
Last edited by meonet; 11-12-2008 at 09:12 AM.
Typical, you think of an idea and Brian already has it sorted.
Thanks for a great tip and walk through![]()
Someone have already converted this modification for vb4?
It should be the same thing with the exception of changing <if to <vb:if
Brian Cummiskey / Crawlability Inc.
vBSEO 3.6.0 GOLD Released!
Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!
I think that the name of this template "search_forms" has been changed.
You need to convert all variables inside the template mockup Brian supplied with vBulletin 4 variable usage.
Mert Gökçeimam / Crawlability Inc.
vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!
Twitter:@Depkac
Personal Blog : Mert Gökçeimam
search_common is the new template name for search_forms
Brian Cummiskey / Crawlability Inc.
vBSEO 3.6.0 GOLD Released!
Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!
Ok thanks Brian i will try to edit it.
It doesn't work, seems that the code is different.
I will add this to my ever-growing list to do. :X
Brian Cummiskey / Crawlability Inc.
vBSEO 3.6.0 GOLD Released!
Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!