Page 1 of 2 1 2 LastLast
Results 1 to 15 of 18

Making vBulletin search more prominent

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

  1. #1
    Senior Member
    Real Name
    John
    Join Date
    Dec 2005
    Posts
    691
    Liked
    17 times

    Making vBulletin search more prominent

    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?

  2. #2
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    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.

  3. #3
    Senior Member
    Real Name
    Alex
    Join Date
    Mar 2007
    Location
    Italy
    Posts
    508
    Liked
    0 times
    Hello guys there is a method to implement the custom search of google on the default search.php page of vbulletin?

  4. #4
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    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

    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 = '';" />&nbsp;&nbsp;<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>
    The part in blue needs to be a custom made page. This acts as the 'wrapper' for the search results.

    It's a simple php script that does nothing more than call the 'skin' and a new custom search template.


    guestsearch.php

    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') . '");');
    
    ?>
    Finally, add the new template:

    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

    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 = '';" />&nbsp;&nbsp;<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>
    and i made a custom class called "searchres" so i could style the block.

    just add to the final custom CSS block in edit main css: (and change colors to match your skin if necessary)

    Code:
    .searchres { 
    background: #fff;
    padding: 10px;
    margin: 0;
    }
    that's it.

  5. #5
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    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.

  6. #6
    Senior Member
    Real Name
    Alex
    Join Date
    Mar 2007
    Location
    Italy
    Posts
    508
    Liked
    0 times
    Thanks Brian it work fine
    Last edited by meonet; 11-12-2008 at 09:12 AM.

  7. #7
    Senior Member Lee G's Avatar
    Real Name
    Lee
    Join Date
    Sep 2006
    Location
    Costa Blanca
    Posts
    683
    Liked
    40 times
    Blog Entries
    4
    Typical, you think of an idea and Brian already has it sorted.

    Thanks for a great tip and walk through

  8. #8
    Senior Member
    Real Name
    Alex
    Join Date
    Mar 2007
    Location
    Italy
    Posts
    508
    Liked
    0 times
    Someone have already converted this modification for vb4?

  9. #9
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,778
    Liked
    648 times
    Blog Entries
    2
    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!


  10. #10
    Senior Member
    Real Name
    Alex
    Join Date
    Mar 2007
    Location
    Italy
    Posts
    508
    Liked
    0 times
    I think that the name of this template "search_forms" has been changed.

  11. #11
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    22,362
    Liked
    541 times
    Blog Entries
    4
    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

  12. #12
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,778
    Liked
    648 times
    Blog Entries
    2
    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!


  13. #13
    Senior Member
    Real Name
    Alex
    Join Date
    Mar 2007
    Location
    Italy
    Posts
    508
    Liked
    0 times
    Ok thanks Brian i will try to edit it.

  14. #14
    Senior Member
    Real Name
    Alex
    Join Date
    Mar 2007
    Location
    Italy
    Posts
    508
    Liked
    0 times
    It doesn't work, seems that the code is different.

  15. #15
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,778
    Liked
    648 times
    Blog Entries
    2
    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!


Page 1 of 2 1 2 LastLast

Similar Threads

  1. Google Analytics "Site Search" with vBulletin search
    By PeterNRG in forum Off-Topic & Chit Chat
    Replies: 43
    Last Post: 11-28-2010, 01:45 AM
  2. Replies: 2
    Last Post: 10-09-2008, 02:14 PM
  3. Replies: 6
    Last Post: 03-28-2006, 01:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •