Wiki - extensions

From NoskeWiki
Jump to navigation Jump to search

About

NOTE: This page is a daughter page of: Wiki


MediaWiki extentions are typically fairly easy to install packages (collections of .php files usually, but in some cases contain sql commands too) which add functionality to your site. Here are some I have used and recommend.

Installing Extensions

During the installation of the latest MediaWiki (version 1.21.1 and above), they have a bunch of Extensions (~10) you can setup during the install by simply clicking the checkbox. Others you'll have to setup yourself by finding them at "" and following the instructions. For most of these extensions, you'll need to download a zip file, unzip it to your MediaWiki folder (eg: public_html/wiki/) and upload it. If your are lucky you can then activate it by adding one or two lines to LocalSettings.php file which reference this new folder and activate the extension.


My Favorite MediaWiki Extensions

Syntax Highlighting

SyntaxHighlight GeSHi is a very popular and nifty MediaWiki extension which allows you to instantly apply syntax highlight to sections of your code. Pretty much all languages - C#, C++, Java, PHP, Python, Fortran, SQL, XML and dozens more - are supported. This one is so popular it is an option during MediaWiki installation, however if you need to install it manually (the old way):

  • Download the latest version of SyntaxHighlight GeSHi.
  • Unzip and move the root folder to: wiki_root_dir/extension/SyntaxHighlight_GeSHi/
  • Add this line of code to LocalSettings.php:
require_once("extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");
  • Upload the "SyntaxHighlight_GeSHi" directory and "LocalSettings.php".
  • Edit a page and add the line:
<syntaxhighlight lang="php">
YOUR CODE TEXT HERE
</syntaxhighlight>


Cite.php

Cite.php is a useful MediaWiki extensions if you want to add references to articles (as often done/required in wikipedia articles) - they will appear in text like this: [1] .... then you list them all out at the bottom. Installing this is simply adding a single .php file (to the extensions directory) as you'd expect and adding this single line to LocalSettings.php:

require_once("$IP/extensions/Cite/Cite.php");


PrivatePageProtection

[1] is a MediaWiki extension which allows you to make certain pages restricted access. It's easy to setup, requires no database altercations, and once installed you can limit the privacy of a page to a group with this simple text on the page:


WARNING: MediaWiki was never designed to keep information secure, so all MediaWiki privacy extensions have a disclaimer: it's EXTREMELY unwise to keep important, confidential information on a wiki unless the wiki is on an intranet.... and even then be cautious!


ConfirmEdit

ConfirmEdit provides a number of CAPTCHA services to prevent bots from vandalizing your site. I highly recommend this if you are experiencing more spam than you can deal with (see: Wiki - combating spam).

One of several CAPTCHA options it includes is "reCAPCHA", which use to be its own separate extension. The instructions may have changed since the merge, but to install reCAPCHA I followed these instructions - this 5 minutes process requires you to signup to reCAPTCHA (free) to get public and private keys then add these lines to "LocalSettings.php":

require_once("$IP/extensions/recaptcha/ReCaptcha.php");
// Sign up for these at http://recaptcha.net/api/getkey
$recaptcha_public_key = 'THE_PUBLIC_KEY_YOU_GOT';
$recaptcha_private_key = 'THE_PRIVATE_KEY_YOU_GOT';

By default, CAPTCHAs are triggered on the following events:

  • New user registration
  • Anonymous edits that contain new external links
  • Brute-force password cracking

.... But you can change the trigger events if necessary.



Other MediaWiki Extensions

Simple Security

Simple Security is a useful MediaWiki extension which allows you to lock out users from viewing particular pages or even categories - allowing only sysop users or certain groups to read them. There are other page specific user rights extensions, but many require adding a new database table (which seems unnecessary). Simple Security does not require tampering with database, it's been around a while and met my needs. After following the instructions I added the following code to LocalSettings.php:

$wgSecurityUseDBHook = true;           # Add this to enable the experimental DB hook for stronger security
include_once("{$IP}/extensions/SimpleSecurity/SimpleSecurity.php");  # Any changes to Simple_Security vars must be added after this
$wgSecurityRenderInfo = false;          # This is neat - if true puts a little display on the top of any page with restrictions
$wgGroupPermissions['Trusted' ]['edit'] = true;   # By typing this in it actually creates the new group "Trusted"
$wgPageRestrictions['Category:Restricted']['read'] = 'Trusted';  # Creates a new category "Restricted" which only "Trusted" can read

After this, any page I want to limit to "Sysop" or "Auto registered" only I could click "protect" and the option "read" is suddenly available... and to limit to my new "Trusted" group I can just add that page to the new "Restricted" category.

WARNING: MediaWiki was never designed to keep information secure, so all MediaWiki privacy extensions have a disclaimer: it's EXTREMELY unwise to keep important, confidential information on a wiki unless the wiki is on an intranet.... and even then be cautious!


Discussion / Comments

The "Discussion" extension is one I haven't used, but looks great if you want to put an "add comments" area to any page. Another one I noticed was "Liquid Threads", but this looked a bit bulky - more like a forum interface than comments area.



My Installed Extensions

You can see what extensions are installed on wiki by going to the Special:Version page. I also keep a copy of what I had installed under:

See also


Links