Well I finally got around the JS errors over at Google - no idea why I appeared to be the only one affected.
Anhow I now have it set up and I'd like to thank Dave-ahfb for the mod and also SemperFideles for making it a little easier to understand. :up:
For my set up I wanted my registered users to be able to use the VB search plus the advanced search but I wanted to restrict guests to the Google site search only - I figure every little bit helps when it comes to reducing server load.
For anyone who would like the same configuration, once you have your Google site search working properly, here's the template conditional I used in my navbar:
find:
Code:
<form action="search.php?do=process" method="post" id="navbar_search" class="navbar_search">
<input type="hidden" name="s" value="{vb:raw session.sessionurl}" />
<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.png" 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>
replace it with:
Code:
<!-- Start Conditional Google Search Box -->
<vb:if condition="is_member_of($bbuserinfo, 1,3,4,22,49)">
<form action="http://www.YOUR/URL/TO/google.php" id="cse-search-box">
<input type="hidden" name="cx" value="partner-pub-XXXXXXXXXXXXXXXX:XXXXXXXXXXX" />
<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>
<ul class="navbar_advanced_search">
<li><a href="search.php{vb:raw session.sessionurl_q}" accesskey="4">{vb:rawphrase advanced_search}</a></li>
<vb:else />
<form action="search.php?do=process" method="post" id="navbar_search" class="navbar_search">
<input type="hidden" name="s" value="{vb:raw session.sessionurl}" />
<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.png" 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>
</vb:if>
<!-- End Conditional Google Search Box -->
making sure you change the red text above to suit your system.
Finally go to your usergroup manager and disable search for the usergroups you have listed in the conditional above and you're done.
Mike