User:Egingell/Uber Sidebar
Description
edit- Add dynamic content to the sidebar. This is not really an extension, it's more of a replacement.
Change Log
edit- Special pages produced an error when attempting to fetch the User's Sidebar. This has been fixed.
Features
edit- Dynamic User Links
- Pulls sidebar formatted data from User:{username}/Sidebar and adds it to the sidebar.
- Namespace Based Links
- Pulls sidebar formatted data from MediaWiki:Sidebar{namespace number} and adds it to the sidebar.
- Category Links
- Adds "Category" section complete with links to the article's categories.
- Category Page Links
- Adds "Sub Categories", "Articles in Category", and "Images in Category" sections complete with their respective content.
- Sorting
- Sorts sections alphabetically (leaving the first section always first).
- Sorts links alphabetically.
- Conditionals
- use the following to create conditionals base on permissions in $wgGroupPermissions:
- Note: Quotation marks (") in {section header or target}(|{text}) will kill the statement. Use MediaWiki:{msg} whenever you need to use them.
- use the following to create conditionals base on permissions in $wgGroupPermissions:
*(*) if ? ({permission type}) "{section header or target}(|{text})" ?
example (only show a link to MediaWiki:Sidebar if the user can edit the interface):
** if ? (editinterface) "MediaWiki:Sidebar|Sidebar" ?
Instructions
edit- Edit includes/Skin.php
Change
<?php
if ( ! defined( 'MEDIAWIKI' ) )
die( 1 );
to
<?php
if ( ! defined( 'MEDIAWIKI' ) )
die( 1 );
// Use a modded version of the Skin class
if (is_file('includes/LocalSkin.php')) {
$localSkin = 'includes/LocalSkin.php';
} else if (is_file('LocalSkin.php')) {
$localSkin = 'LocalSkin.php';
}
if ($localSkin) {
require_once($localSkin);
return;
}
- Create a new file called LocalSkin.php and place it in either the "includes" directory or in the top level directory (next to LocalSettings.php).
- Copy and paste the entire contents of my LocalSkin.php into your LocalSkin.php and save.
- Note: Might be easier just to "edit" the page and Ctrl-A/Ctrl-C the edit box which is why I put it in a separate page (User:Egingell/Uber_Sidebar/LocalSkin.php).
See Also
editKnown IssueseditThere are no known issues at this time. --Egingell (talk) 12:42, 4 August 2007 (UTC) |