FANDOM


MediaWiki extensions manual - list
StaffTag

Release status: stable

Implementation Parser extension
Description Creates a XML tag that displays a "@Site" sign similar to Wikia's staff
Author(s) Seth Rees (The OracleTalk)
Last version 1.1 (1/30/09)
MediaWiki >= 1.13.0
License GNU GPL
Download http://theoracle.uuuq.com/StaffTag_1-1.zip
Example theoracle.uuuq.com
Tags
@fandom
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

  1. Download the zip file
  2. Unzip and upload the stafftag.php file to the /extensions directory.
  3. Add the following line to LocalSettings.php:
require_once( $IP."/extensions/stafftag.php");

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;
}
?>

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.