Extension:RandomSelection

The RandomSelection extension allows for randomly-generated content inside your wiki; e.g. rotating images, random greetings, etc.

Usage
To choose between one or more options, simply place each option inside an tag, like so:

This is the first choice. This is the second choice. And so on...

From each set of tags, precisely one tag will be selected at random, and its contents shown.

If you'd like some options to be shown more often than others, you can add weight to the option tags, like so:

This option will be shown twice as often as a normal option.

By default, options have a weight of 1.

This option also has a weight of 1. Fractional portions are ignored.

Anything can be placed inside of option tags: links, images, even templates. Note, however, that template arguments will not be expanded due to 2257.

Code
The code in this page will only work in MediaWiki 1.12 and above. ([ Alternate version for 1.5 and above])

Changelog

 * Dec 10 07 -- Updated for compatibility with MW 1.12's new parser model
 * Feb 23 08 -- Minor bugfix
 * May 8 08 -- Bugfix
 * July 08 -- Use ParserFirstCallInit hook if it's available
 * 30 September 2009 -- Doxygen comments added + minor tweaks
 * 17 January 2010 -- dropped backwards compatibility with old MediaWikis as per r55838 and made the extension work under PHP 5.3+