7
This is what I have done
I signed up to this
Google Custom SearchAfter configuring the Google Custom Search it gives you some code to use, first thing I did was placed this code in a custom block. You will see the block and how it looks with a search field
<!-- Google CSE Search Box Begins -->
<form action="http://www.ozms.org/gsearch.php" id="cse-search-box">
<div>
<input type="hidden" name="cx" value="partner-pub-xxxxxxx:xxx-xxx" />
<input type="hidden" name="cof" value="FORID:11" />
<input type="hidden" name="ie" value="ISO-8859-1" />
<input type="text" name="q" size="15" />
<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?=en"></script>
<!-- Google CSE Search Box Ends -->
Then I get this code and place it in this file saved in the root of my site
gsearch.php
<?php
if (file_exists("mainfile.php")) {
include("mainfile.php");
}
elseif(file_exists("../mainfile.php")) {
include("../mainfile.php");
}
else {
include("../../mainfile.php");
}
include(XOOPS_ROOT_PATH . "/header.php");
$xoopsTpl->assign('xoops_showrblock', 0); // 1 display right blocks
$xoopsTpl->assign('xoops_showlblock', 1); // 1 display right blocks
?>
<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.au";
var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
<?php
include(XOOPS_ROOT_PATH . "/footer.php");
?>
It's a bit of stuffing about but it works well.
You can see it
here!:o)