Adding Google Custom Search on MyBB

posted Jul 5, 2011, 2:41 AM by magic stone
1. Create your Adsense search unit. Follow the wizard until you come across the following screenies.

Choose "Open results within my site"
Put the following URL in the box: ""
Continue following the wizard. Save the unit. You shall a page like this:

2. Enter the Adsense "Search Box Code" anywhere you want in the template. e.g. i've put it in the Sidebox on this site.

3. Create a new template called "adsenseresults"(without quotes) in the AdminCP and put the following codes in it. Enter your Adsense "Search Results Code" in it.

<title>{$mybb->settings['bbname']} - Results</title>

<- Enter the adsense "Search Results Code" here ->


4. Create a file called "results.php" and add the contents below in it. Upload the file to your server to where you specified in step 1 i.e.





"\$adsenseresults = \"".$templates->get("adsenseresults")."\";"); 



5. You're done