Open main menu


MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: stable
Implementation Tag
Description Creates a StumbleUpon button.
Author(s) Piotr Zuk (zukotalk)
Latest version 1.0.0 (2011-08-11)
MediaWiki 1.16
License GNU public License
Download MediawikiExtStumbleUponButton_zip or
this page
Example C++Book reference
Translate the StumbleUponButton extension if it is available at
Check usage and version matrix.


What can this extension do?Edit

Allows you to very simply include StumbleUpon button in five customized versions.


With the tag <stumbleuponbutton></stumbleuponbutton>

  • Version 1: <stumbleuponbutton style="1"></stumbleuponbutton> (without counting box)


  • Version 2: <stumbleuponbutton style="2"></stumbleuponbutton> (with horizontal counting box)


  • Version 3: <stumbleuponbutton style="3"></stumbleuponbutton> (with vertical counting box)


  • Version 4: <stumbleuponbutton style="4"></stumbleuponbutton> (big icon)


  • Version 5: <stumbleuponbutton style="5"></stumbleuponbutton> (small icon)


Default version = 2 (with horizontal counting box)

Download instructionsEdit

You can download the php file from MediawikiExtStumbleUponButton_zip or copy and paste the code below to the file: $IP/extensions/StumbleUponButton/StumbleUponButton.php. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.


To install this extension, add the following to LocalSettings.php:



/* Wiki StumbleUponButton MediaWiki extension
** Installation Instructions:
$wgExtensionFunctions[] = "stumbleuponbuttonExtension";
function stumbleuponbuttonExtension() {
   global $wgParser;
   global $versions_stumbleuponbutton;
   $wgParser->setHook( "stumbleuponbutton", "renderStumbleUponButton" );
   $versions_stumbleuponbutton = array();
   $versions_stumbleuponbutton[1] = '<script src=""></script>';
   $versions_stumbleuponbutton[2] = '<script src=""></script>';
   $versions_stumbleuponbutton[3] = '<script src=""></script>';
   $versions_stumbleuponbutton[4] = '<script src=""></script>';
   $versions_stumbleuponbutton[5] = '<script src=""></script>';

function renderStumbleUponButton( $input, $argv ) {
   global $versions_stumbleuponbutton;   
   $style= @$argv['style'];
   if (is_numeric($style)) {
	   $version = $style;
	   if (!$versions_stumbleuponbutton[$version]) {
		   $version = 1;              
   } else {              
	   $version = 1;           
   $output = $form;
   return $output;
$wgExtensionCredits['parserhook'][] = array(
      'name' => 'Wiki StumbleUponButton',
      'version' => '1.0.0',
      'author' => 'Piotr Zuk',
      'url' => '',
      'description' => 'Mediawiki StumbleUponButton Extension'