Extension:StaffTag
Jump to navigation
Jump to search
![]() | This extension stores its source code on a wiki page. Please be aware that this code may be unreviewed or maliciously altered. They may contain security holes, outdated interfaces that are no longer compatible etc. Note: No localisation updates are provided for this extension by translatewiki.net . |
StaffTag Release status: unstable |
|||
---|---|---|---|
Implementation | Parser extension | ||
Description | Creates a XML tag that displays a "@Site" sign similar to Wikia's staff | ||
Author(s) | Seth Rees (The Oracletalk) | ||
Latest version | 1.1 (2009-01-30) | ||
MediaWiki | 1.13+ | ||
License | GNU GPL | ||
Download | http://theoracle.uuuq.com/StaffTag_1-1.zip | ||
Example | theoracle.uuuq.com | ||
|
|||
Translate the StaffTag extension if it is available at translatewiki.net | |||
Check usage and version matrix. |
Introduction[edit]
This extension is made for Sysadmins who would like to have a tag similar to the Wikia's staff tag.
The tag is fully customizable, with three different variables that must be defined:
Name | Use |
$wgSTagURL
|
Used to define the url the tag links to. |
$wgSTagIMG
|
Used to define the location of the image. |
$wgSTagALT
|
Used to define the HTML <img> alt="" attribute. |
These variables are defined under the "Variables" section of stafftag.php.
Installation[edit]
- Download and place the file(s) in a directory called
StaffTag
in yourextensions/
folder.
- Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/StaffTag/StaffTag.php";
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
You may also copy the following source code and save it as stafftag.php. Then do numbers 2-3.
<?php
###################
# Syntax: <staff/>#
###################
###################
# MetaData #
###################
$wgExtensionCredits['other'][] = array(
'name' => 'StaffTag',
'author' => 'Seth Rees',
'version' => '1.0',
'url' => 'http://www.mediawiki.org/wiki/Extension:StaffTag',
'description' => 'This extension generates a tag showing the user is a member of the staff');
###################
# Extension Code #
###################
$wgExtensionFunctions[] = "wfStaffTag";
function wfStaffTag() {
global $wgParser;
$wgParser->setHook( "staff", "renderStaffTag" );
}
# The callback function for converting the input text to HTML output
function renderStaffTag( $input ) {
###################
# Varibles: #
###################
$wgSTagURL = ""; //URL the image links to
$wgSTagIMG = ""; //URL of the image
$wgSTagALT = ""; //[HTML/image/alt] attribute (text displayed if image is unavailable)
$output = '<a href="' .$wgSTagURL. '"><img src="' .$wgSTagIMG. '" alt="' .$wgSTagALT. '" /></a>';
return $output;
}
?>