Extension:MyVariables

This extension is a small example snippet of code which goes into the LocalSettings.php script, and allows the addition of new built in variables. The code snippet adds two example variables, and , which serve as examples to follow when adding others for your own use.

First we have to add all our new magic words to the MediaWiki environment. This code is based on the method described in Manual:Magic words. To add new magic words, add its name into the array on the first line, and add a case for it in the last function (wfGetCustomVariable) to calculate and return its value when it's requested. 

Testing

 * It works on all 1.6.x's
 * Works fine on 1.8.4 --Nad 05:14, 6 April 2007 (UTC)
 * Tested and working on 1.9.3 --Nad 05:08, 6 April 2007 (UTC)
 * Tested and working on 1.11.1 --DavidBiesack 16:18, 30 October 2008 (UTC)
 * Tested and working on 1.13.x --80.81.171.49 10:12, 19 November 2008 (UTC)