Extension:Google Custom Search Engine

This is a very simple extension, helping you adding a Google Custom Search Engine (Google Co-op) to your MediaWiki site.

Get Google Co-op Code

 * Before you start install this extension, you need to go to http://www.google.com/coop and find the "code" section at "Control panel" (If you don't have any Custom Search Engine, you need create and config one).


 * At the "code" section, you need expand "Search box and search results code for your website" and file one wiki page in your site which you want to display the search result (I recommend filling the URL like this http://yoursite.com/wiki/yourwikiname:GoogleSearch).


 * After you finish this step, you will get two piece of "code" as the picture shown right.

MediaWiki operation
Copy the code provided by Google below the words: "Place this code in the page you'd like your search results to appear."

And paste it to program shown below between $output=' and ';//google code end here

A little confusion here! There are two pieces of code ... do we copy both of them in-between $output=' and ';//google code end here ???

Please clarify.

I copied both....now, when I search using Google, it throws me back into my Main page.

Help!

Final Steps

 * Upload the google-coop.php to your extensions/ directory, and add  to your LocalSettings.php file.
 * Go to the wiki page which you want to display the search result like (http://yoursite.com/wiki/yourwikiname:GoogleSearch), add  to this page and protect it.
 * Then use another code Google provided at the pages you want to be the entrance of the search, like adding to sidebar.
 * Done!

Site users
Please list your site here if you are using this code
 * Knowledge Without Limits

Demo

 * I don't Like Exams (MediaWiki 1.9.1)