Extension:Woopra

The Woopra extension adds the needed javascript to your Mediawiki skin so it can be tracked by Woopra Live Stats software. You have your site registered on the Woopra site to get a unique key number for your site so tracking can take place.

Install is simple. Create a php file and place the code in a PHP file. In LocalSettings.php be sure to include the file. Set the define to your unique key.

Code
 'Woopra Live Stats Tracking',	'author' => array( 'Shane'),	'version' => '1.0.0',	'url' => 'http://www.mediawiki.org/wiki/Extension:Woopra',	'description' => 'Allows the Woopra Live Tracking Software work for your MediaWiki Installation', );

/* Insert your unique Woopra Site Key into this field. */ define('WOOPRA_SITEKEY', '');

$wgHooks['BeforePageDisplay'][] = 'fnWoopraJavascript';

function fnWoopraJavascript($out) {	global $wgUser;

$html .= "\r\n"; $html .= "woopra_id = '". WOOPRA_SITEKEY. "';\r\n";

if ($wgUser->mId) {		$html .= "var woopra_array = new Array;\r\n"; $html .= "woopra_array['name'] = '". $wgUser->mRealName. "';\r\n"; $html .= "woopra_array['Email'] = '". $wgUser->mEmail. "';\r\n"; // Add custom tracking code here! }	$html .= " \r\n"; $html .= " ";

$out->addScript($html); return true; }

?>