Manual:Special pages

Special pages are pages that are created by the software on demand to perform a specific function. For example, a special page might show all pages that have one or more links to an external site or it might create a form providing user submitted feedback. Special pages are located in their own namespace (Special:) and are not editable directly like other pages. Developers can also create new special pages. These pages can be user-accessible and will generally show up in the list of all special pages at Special:SpecialPages. Some special pages are only accessible to users with certain permissions and accesses. Other special pages don't show up on the special page list at all and are only used by the wiki internally.

General Information
All of the ~75 built-in special pages that come with MediaWiki are called  and are located in the   directory. Special pages created by third party developers are generally stored in the  directory in their own file or as part of a larger extension. All special pages inherit from a class called SpecialPage which is defined in. When a new special page is created, the user rights needed to access the page can be defined. These rights specify, among other things, whether the page will show up on Special:SpecialPages and whether the page is includable in other pages.

Special pages also have unique names that can be customized on a wiki. The general form is "Special:Pagename" where both "Special" and "Pagename" are customizable. The Special pseudo namespace can be translated in other languages. This translated namespace can be produced with the wikitext    , on this wiki giving "    ". The name of the special page can also be redefined in a system message, for the site language, with the generic name of the special page as the ID.

A special page may or may not allow input. For example, Special:Export allows a user to define a specific page to export by calling Special:Export/Sun. If the special page allows complex input, additional parameters will be sent to the query string component of the the URL for processing, e.g. http://www.mediawiki.org/w/index.php?title=Special:Recentchanges&days=3&limit=250.

Notes:
 * There are various ways to make special pages, but the one below is used by the bulk of official extensions, and adherence to this style is recommended. Also, be sure to include a credits block in the new special page for 'specialpage'. See $wgExtensionCredits for more details.
 * After making a new special page, be sure to add it to Category:Special page extensions so other people can find it.
 * This method is only valid for MediaWiki running on PHP5 and above. If you're using an earlier version of MediaWiki on a more-recent version of PHP, upgrade MediaWiki.
 * Special pages cannot be included within frames unless you use $wgOut->allowClickjacking;

Stephanie Lynn Spane alias Stephanie Spane and Birth Name- Stephanie Lynn PAnayiotou, Canadian singer song writer and music producer/model/actress/dancer/co producer.. born on december 9th 1981 at st catherines hospital kitchener Ontario canada.. Raised in Canada moved to Nyc and Los angeles.Europe. now Living back in canada.

Stephanie Learned beats and began playing her Grandmothers piano at a young age along with singing and dancing. www.modelmayhem.com/stephanielynnspanehttp://www.imdb.com/video/wab/vi3057320473/ http://www.isound.com/stephanie_lynn_spane/http://www.cdbaby.com/cd/stephanielynnspane

This young sexy ,spunky,erotic, hot ,provocative beautiful up and coming singer has performed at numerous nightclubs and talent shows in NYC such avalon/spirit night club..and in beverly hills aqua lounge.. people who inspired her growing up were her mother,Grandma,aunt mother/Carol/brother/aunt and father, Elvis,Eminem,Biggie,Tu-pac, Madonna,gwen Stefani,GEorge Michaels,MJ,Spic girls,duran duran,MArilyn Monroe, Elizabeth Taylor,Rita Hayworth, X-tina,Korn,Rage against the machine,Shania Twain,Nirvana,Cher,Tina Turner,Kylie, Abba. At Age 13 Stephanie's mother passed on from cancer. Since then Stephanie is living on the dreams her mother wished her to one day have. since her mother passed on at a young age Stephanie soon had to learn how to take care of herself and younger brother. She grew up with a step dad who was extremely abusive,mentally,physically,emotionally, and at age 16 Stephanie Decided to take matters in her own hands and left canada to find her real Father in Nyc. There she found opportunity to express herself through music/writing. The love and Passion come from Stephanie's first love which she writes about. There is still more material written from this artist expressing anger, fear, and hate,which will soon be coming out later this year.

Stephanie has been in a couple feature films such as 7-10 split with Tara Reid, over to the other side, and she was a dancer in Noreiga & The Neptune's music video...iyaz replay music video..Morbid a love Story..

Shes also shot with celebrity photographer Michael vincent,,.who shot with the likes of carmen electra, tila tequila, vida guerra,christine dolce.and landed in his magazine spread..landed in 2 calendars.. she shot with other numerous photographers and work and got payed to pay her bills in Los angeles when she made her move there in 2005 through 2010. she also was a back up dancer on the time warner cable series murder muzik and help co produce the show.. On November 2011 she gave birth to her daughter Isis, and also a tragedy happened short after on devember, Stephanie's Brother Loucas Joseph Panayiotou passed away in a car accident. Stephanie has 9 music albums to soon be released. She is also currently writing her autobiography life story. Stephanie Currently lives in Canada raising her daughter, but is set to start university for film,and music over the years to come.

Constructor
You can overload the constructor to initialize your own data, but the main reason you would want to do it is to change the behavior of the SpecialPage class itself. When you call the base class constructor from your child class, the following parameters are available:


 * string  Name of the special page, as seen in links and URLs
 * string  User right required, e.g. "block" or "delete"
 * boolean  Whether the page is listed in Special:Specialpages
 * string  A global function to call at run time if your subclass doesn't override execute. By default it is constructed from $name as "wfSpecial$name".
 * string  File which is included by execute. It is also constructed from $name by default
 * boolean  Whether the special page can be included from other pages using

This initialises the OutputPage object  with the name and description of your special page. It should always be called from your execute method.

Some special pages can be included from within another page. For example, if you add to the wikitext of a page, it will insert a listing of recent changes within the existing content of the page.

Including a special page from another web page is only possible if you declared the page to be includable in the constructor. You can do this by adding the following in the  method after the parent class initialization: You can also define your special page class as extending the IncludableSpecialPage class.

The SpecialPage->including function returns a boolean value telling you what context the special page is being called from: false if it is a separate web page, and true if it is being included from within another web page. Usually you will want to strip down the presentation somewhat if the page is being included.

This is the function which your child class should overload. It passes a single parameter, usually referred to cryptically as. This parameter is the subpage component of the current title. For example, if someone follows a link to Special:MyExtension/blah,  will contain "blah".

OutputPage.php
The global variable  (of type  ) is the variable you will use the most, because it is the way to send output to the browser (no, you don't use   or  ). If you want to use it somewhere, declare the variable global:

You can inspect the OutputPage class by viewing  (indeed, all of these can be inspected), but there are a few methods you should definitely know about.

Essentially the quick and dirty substitute for. It takes your input and adds it to the buffer: no questions asked. In the below action, if  contains user-data, it could easily have XSS, evil stuff, or the spawn of Satan injected in. You're better off using escaping (such as with the php function htmlentities) or the XML builders class to build trusted output.

For most output, you should be using this function. It's a bit of a black magic function: wikitext goes in, HTML comes out, and a whole lotta arcane code and demon summonings happen in between.

What's worth noting is that the parser will view your chunks as cohesive wholes and paragraph accordingly. That is...

Will output three lists with one item each, which probably wasn't intended.

Note however, if you just want to insert a system message and have it treated like parsed wikitext, you can use code like. Example:

workaround #2
I tried the above, and found that the same problem now applied to any s in the transcluded text. This won't be a problem for a lot of extensions, but the extension I was writing was intended to show wikitext from another page as part of its functionality, so this was a problem.

The process for parsing a page which transcludes a special page seems to be this:
 * 1) Replace  with a UNIQ-QINU marker (because SpecialPage output is expected to be ready-to-output HTML)
 * 2) Replace any s with QINU markers as above
 * 3) Parse everything else from wikitext to HTML
 * 4) Replace all QINU markers with their respective stored values, in a single pass

The process for parsing a page which transcludes a non-special page, though, is apparently like this:
 * 1) Replace  or  with contents of transcluded page (because transcluded pages contain unparsed wikitext)
 * 2) Replace any s with QINU markers as above
 * 3) Parse everything else from wikitext to HTML
 * 4) Replace all QINU markers with their respective stored values, in a single pass

The problem is apparently that in the earlier case, the parsing of the SpecialPage's wiki text is lacking the final QINU decoding step (why?), so all the QINU markers are left undecoded. (This may be a leftover from using the same syntax to invoke transclusion of a wikitext page, which is just pasted straight into the host page's wikitext contents and parsed, as is used to invoke transclusion of a SpecialPage, which must not be parsed at all. Wherever the code is that decides "wait, this is a special page -- replace it with a QINU", it should be doing the extra unstripGeneral before doing the QINU substitution.)

So I just did the following -- after this line: ...I added these lines (the second one is only because the function definition for the first one recommends it): Since I have now documented this, of course, I will now find a tragic flaw with it and feel really stupid... but as long as it seems to be working, I had to note it here. (It is also important to note the problem with work-around #1.) Also, I have only tested this with MediaWiki 1.10.1. The problem still exists under MW 1.14, but this solution may or may not work. --Woozle 18:26, 9 April 2009 (UTC)

In most of the real special pages, you will rarely see  without   popping in.

is a MediaWiki internationalization (i18n) function.

An error page is shown. The arguments  and   specify keys into wfMsg, not text. An example:


 * 'error' refers to the text "Error".
 * 'badarticleerror' refers to the text "This action cannot be performed on this page.".

WebRequest.php
The WebRequest class is used to obtain information from the GET and POST arrays. Using this is recommended over directly accessing the superglobals, since the object does fun stuff like magic_quotes cleaning. The WebRequest object is accessible from extensions by including the global  in the code.

Returns a string that corresponds to the form input with the name.

Returns an int, bool, etc depending on the function called. For checkboxes for example, the function  is useful.

Returns true if a form was posted.

Database.php
MediaWiki has a load of convenience functions and wrappers for interacting with the database. It also has an interesting load balancing scheme in place. It's recommended you use these wrappers. Check out  for a complete listing of all the convenience functions, because these docs will only tell you about the non-obvious caveats. See Manual:Database access.

As this name suggests, this function gets you a reference of the database. There is no global that contains a database object.

When you call the function, you should pass it a parameter, the constant  or. Generally, you interact with the slave database when you're only performing read operations, and interact with the master when you're writing to the database. It's real easy to do, so do it, even if you only have one database.

User.php
The User class is used to represent users on the system. The global  represents the currently logged in user, and is usually what you will deal with when manipulating users.

Returns true or false depending on whether the user is allowed to do $right.

Returns true if a user is blocked.

Title.php
Title represents the name of a page in the wiki. This is useful because MediaWiki does all sorts of fun escaping and special case logic to page names, so instead of rolling your own convert title to URL function, you create a Title object with your page name, and then use  to get a URL to that page.

This method gives you the url to the page. However, in most cases you would want to use the Linker class to make links to pages.

Custom special pages
There are various ways to provide your own special pages not bundled within MediaWiki:
 * One method is to install an extension that generates a form to create or edit an article. A list of extensions currently available, can be found at Category:Special page extensions.
 * You can also write an extension which provides your own special page. Writing your own extension requires PHP coding skill and comfort with object oriented design and databases also is helpful.  You will also need to know how to use code to create and edit MediaWiki articles. For more information, please see this discussion.
 * You can also display a custom page through Javascript, in place of the default error message "Unknown special page". In MediaWiki:Common.js, check for wgPageName, then hide the MediaWiki-generated content (just appendCSS  ), and inject custom HTML  into the   or  . For an example, see w:en:User:Splarka/electrocute.js.

Setting an Extension Title
MediaWiki does not set the title of the extension, which is the developer's job. It will look for the name of the extension when Special:Specialpages is called or the special page is loaded (specifically right before the registered wfSpecial* function is called). Use $wgOut to title the extension like: $wgOut->setPagetitle("your title");

The place where the extension can be found (as specified by what is passed into the SpecialPage constructor) is the key--except that it is not capitalized because of, the internally used function that finds out the title (or, what they call description) of the special page,   the name. "ThisIsACoolSpecialPage"'s key would be "thisisacoolspecialpage."

Theoretically, getDescription can be overloaded in order to avoid interacting with the message cache but, as the source code states: "Derived classes can override this, but usually it is easier to keep the default behavior. Messages can be added at run-time--see MessageCache.php". Furthermore, this prevents the MediaWiki namespace from overloading the message, as below.

Localizing the Extension Name
So you've just installed a shiny new MediaWiki extension and realize: "Oh no, my wiki is in French, but the page is showing up as English!" Most people wouldn't care, but it's actually a quite simple task to fix (as long as the developer used the method explained on this page). No noodling around in source code. Let's say the name of the page is  and the name comes out to "List of Dirty Pages" but you want it to be (and excuse my poor French) "Liste de Pages Sales". Well, it's as simple as this:


 * 1) Navigate to MediaWiki:DirtyPages, this page may not exist, but edit it anyway
 * 2) Insert "Liste de Pages Sales" and save

And voilà (pardon the pun), the change is applied.

This is also useful for customizing the title for your wiki within your language: for instance, the developer called it "List of Dirty Pages" but you don't like that name, so you rename it "List of Pages needing Cleanup". Check out Special:Allmessages to learn more.

Also, if your extension has a large block of text that does change, like a warning, don't directly output the text. Instead, add it to the message cache and when the time comes to output the text in your code, do this:

Then this message too can be customized at MediaWiki:Dirtypageshelp.

See also Help:System message.

Restricting the page to sysops or other users with special rights
Some special pages are omitted from the special page list unless the user has particular rights, such as being a sysop. To restrict your special page similarly, set the  parameter in the constructor. The page will only be shown on the special page list if the user has the specified right. It will, however, still be directly accessible to all users using the correct URL! A typical sysop right is :

Or you can create your own right in the setup file and assign it to sysops, e.g.:

and then call the constructor with your right:

Even if you restrict your page, your extension should check that the proper right is present, because a user can still access it directly if you use the constructor to require a specific right:

Disabling Special:UserLogin and Special:UserLogout pages
In LocalSettings.php you can use the SpecialPage_initList hook to unset unwanted built-in special pages. See "making a few SpecialPages restricted" if you need conditional unsetting of special pages for example for certain user groups. The general message "You have requested an invalid special page." is shown if users try to access such unset special pages.