Here is what to do to get this on your site my Man ....
Step 1:
Create a new template and name it "GOOGLE", make sure it's in all CAPS ! in that template add the following:
Code:
<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} - {vb:raw pagetitle}</title>
{vb:raw headinclude}
{vb:raw headinclude_bottom}
</head>
<body>
{vb:raw header}
{vb:raw navbar}
<div id="pagetitle">
<h1>{vb:raw pagetitle}</h1>
</div>
<h2 class="blockhead">Your Site's Name Custom Search Results</h2>
<div class="blockbody">
<div class="blockrow">
<div class="blockrow">
<gcse:search></gcse:search>
</div>
</div>
</div>
{vb:raw footer}
</body>
</html>
Step 2: In your "headinclude" template add the following at the very end:
Code:
<!-- google cse -->
<script>
(function() {
var cx = 'partner-pub-0000000000000000:0000000000'; ///////////////CHANGE THIS TO YOUR OWN ID ////
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<!-- / google cse -->
Step 3: In your "navbar" template locate the following :
Code:
<div id="globalsearch" class="globalsearch">
Right below that remove the following code:
Code:
<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="" 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>
and replace it with this :
Code:
<gcse:searchbox-only></gcse:searchbox-only>
<form method="get" action="http://www.yoursite.com/your-forums-path/google.php" target="_blank" class="navbar_search">
<input type="hidden" name="sitesearch" value="yoursite.com/your-forums-path/forum.php" id="pn"/>
<input type="hidden" name="domains" value="yoursite.com/your-forums-path/forum.php"/>
</form>
Then upload the following php file to your forums root:
Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'test');
define('CSRF_PROTECTION', true);
// change this depending on your filename
// ################### 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('GOOGLE',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = construct_navbits(array('' => 'yoursite.com Site Search'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'yoursite.com Custom Search';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('GOOGLE');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());
?>
In the php file above replace your site with your site's name and you should be good to go !!!!! If you have any questions feel free to ask away ...
--------------- Added [DATE]1410998655[/DATE] at [TIME]1410998655[/TIME] ---------------
Quote:
Originally Posted by tbworld
@nelson58, needs to spend a bit more time reading and asking more exacting questions. So far we are just messaging among ourselves. 
|
Yes he does, but hopefully this will help him get this done lol .....