OpenWetWare:Administration/Customization
From OpenWetWare
Jump to navigationJump to search
Chat
- Special:Chat
- powered by phpFreeChat
Search
MySQL full-text search (3 character words)
The default minimum value is four characters. The default maximum depends on your version of MySQL. If you change either value, you must rebuild your FULLTEXT indexes.
- Procedure:
Namespaces to search by default
In LocalSettings.php:
$wgNamespacesToBeSearchedDefault = array( -1 => 0, NS_MAIN => 1, NS_USER => 0, NS_USER_TALK => 0, NS_PROJECT_TALK => 0, NS_IMAGE_TALK => 0, NS_IMAGE_TALK => 0, NS_TEMPLATE_TALK => 0, NS_HELP_TALK => 0, NS_CATEGORY_TALK => 0, 100 => 1, 102 => 1 );
Google search
Current implementation
- Based on How to add Google search to your MediaWiki Search Results Page and Google Custom Search Engine
- in includes/SpecialSearch.php:
- Find the end of the showResults( $term ) function in SpecialSearch.php. This should be around line 200 as of MW 1.9.
- Find the line above the end of this function which reads:
$wgOut->addHTML( $this->powerSearchBox( $term ) );
- Insert the following lines of code directly above the line you just found:
$wgOut->addWikiText( wfMsg( 'Googlesearchheader' ) ); $wgOut->addHTML( wfMsg( 'Googlesearch', $term ) );
- Create a page called MediaWiki:Googlesearchheader with the following content (header for search box):
===Try Google Search===
- Create a page called MediaWiki:Googlesearch with the following content (code for the search box):
<div style="margin-left: 2em"> <div style="width:130px;float:left;text-align:center;position:relative;top:-8px"><a href="http://www.google.com/" style="padding:0;background-image:none"><img src="http://www.google.com/logos/Logo_40wht.gif" alt="Google" style="border:none" /></a></div> <!-- Google CSE Search Box Begins --> <form id="searchbox_002907624540990077409:p0fud5ft4ii" action="http://openwetware.org/wiki/OpenWetWare:GoogleSearchResults"> <input type="hidden" name="cx" value="002907624540990077409:p0fud5ft4ii" /> <input name="q" type="text" size="40" value="$1" /> <input type="submit" name="sa" value="Search" /> <input type="hidden" name="cof" value="FORID:9" /> </form> <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_002907624540990077409%3Ap0fud5ft4ii"></script> <!-- Google CSE Search Box Ends -->
- Create a page called OpenWetWare:GoogleSearchResults with the following content (used to display search results):
<html> <!-- Google Search Result Snippet Begins --> <div id="results_002907624540990077409:p0fud5ft4ii"></div> <script type="text/javascript"> var googleSearchIframeName = "results_002907624540990077409:p0fud5ft4ii"; var googleSearchFormName = "searchbox_002907624540990077409:p0fud5ft4ii"; var googleSearchFrameWidth = 600; var googleSearchFrameborder = 0; var googleSearchDomain = "www.google.com"; var googleSearchPath = "/cse"; </script> <script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script> <!-- Google Search Result Snippet Ends --> </html>
Other implementations
- Google Search extension
- Google Search 2 extension
- Search at QED wiki
Miscellaneous
- Mediawiki version 1.9+
- Add the following to the MediaWiki:Monobook.css on your wiki:
body.page-Main_Page h1.firstHeading { display:none; }