Difference between revisions of "Help:Google RU"
(updates to set UI/button lang to RU) |
(minor corrections) |
||
Line 40: | Line 40: | ||
</source> | </source> | ||
− | This file defines the actual search, with the most critical part being <tt>value="012451685560999373550:mwuatqsviug"</tt> which is the code Google uses to identify the specific custom search (see [http://www.google.com/cse/ http://www.google.com/cse/]). It has been modified from what is documented on the original extension website. The <tt>$output</tt> section has been replaced with the code from a Google Custom search that is defined to search only in the /Documentation/ | + | This file defines the actual search, with the most critical part being <tt>value="012451685560999373550:mwuatqsviug"</tt> which is the code Google uses to identify the specific custom search (see [http://www.google.com/cse/ http://www.google.com/cse/]). It has been modified from what is documented on the original extension website. The <tt>$output</tt> section has been replaced with the code from a Google Custom search that is defined to search only in the /Documentation/RU subpages. |
In the <tt>LocalSettings.php</tt> file, you must add: | In the <tt>LocalSettings.php</tt> file, you must add: |
Revision as of 10:53, 18 November 2010
The Google search extension in use on the OpenOffice.org Wiki is a mix and a modification of two MediaWiki extensions:
The RU modification uses the google-coop.php from the Google search extension already installed on the Wiki (no modifications or changes to this file).
The Google_RU.php file
<?php # To activate the extension, include it from your LocalSettings.php # with: include("extensions/Google_RU.php"); # # Syntax: <googleRU/> # $wgExtensionFunctions[] = "wRUGoogle"; function wRUGoogle() { global $wgParser; $wgParser->setHook( "googleRU", "renderGoogleRU" ); } # The callback function for converting the input text to HTML output function renderGoogleRU( $input ) { $output = '<!-- Search Google -->'; $output .= '<form action="http://wiki.services.openoffice.org/wiki/RU/GoogleSearch"cse-search-results">'; $output .= '<div>'; $output .= '<input type="hidden" name="cx" value="012451685560999373550:mwuatqsviug" />'; $output .= '<input type="hidden" name="cof" value="FORID:9" />'; $output .= '<input type="text" name="q" size="25" />'; $output .= '<input type="submit" name="sa" value="Поиск в Энциклопедии" />'; $output .= '</div>'; $output .= '</form>'; $output .= '<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=ru"></script>'; $output .= '<!-- Search Google -->'; return $output; }
This file defines the actual search, with the most critical part being value="012451685560999373550:mwuatqsviug" which is the code Google uses to identify the specific custom search (see http://www.google.com/cse/). It has been modified from what is documented on the original extension website. The $output section has been replaced with the code from a Google Custom search that is defined to search only in the /Documentation/RU subpages.
In the LocalSettings.php file, you must add:
include("extensions/Google/Google_RU.php");
to enable the extension.