MyBB Community Forums

Full Version: replacing mybb search with google custom search
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello,

I've decided that I wanted to replace the mybb search with the google custom search, but am wondering if someone could show me how to accomplish what I'm trying to do.

basically, I like where the default mybb search is located on my forum:
http://www.pazrt.com/forum/

when you click 'search' it pops up the fast search which I also like and want to keep, but I want to include the google custom search inside that fast search and remove the 'advanced' search button.

this is the code google gave me for their search:
<div id="cse" style="width: 100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
  google.load('search', '1', {language : 'en'});
  google.setOnLoadCallback(function() {
    var customSearchControl = new google.search.CustomSearchControl('001838828447415403791:qy0vuj0slqq');
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    customSearchControl.draw('cse');
  }, true);
</script>
<link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" />

and here's the tutorial for the fast search:
http://community.mybb.com/thread-48277.html
I went to your site url, tested the search and you managed to get it working, great job!
Note that people will only be able to search for things that have been indexed by Google, recent content won't come up.
use this first http://community.mybb.com/thread-46423.html
and then, after submit to Google wait few hours.
I use those custom, and update within few hours.