User:LarryEitel/MSN Messenger

Blue Glass Arrow.svg MediaWiki-2020-logo.svg
This page should be moved to MediaWiki.org.
Please do not move the page by hand. It will be imported by a MediaWiki.org administrator with the full edit history. In the meantime, you may continue to edit the page as normal.

<msn> Online Status TagEdit

Users can just insert a tag like <msn>YourMessengerUserNameHere</msn> into any wiki page and will show a MSN status icon WITH a link for the user to click to dial.

Click here for our usage notes.

<?php
  $wgExtensionFunctions[] = "wfMSN";
 
 function wfMSN() {
     global $wgParser;
     $wgParser->setHook( "msn", "renderMSN" );
 }
 
 # The callback function for converting the input text to HTML output
 function renderMSN( $input, $argv ) {
     # $argv is an array containing any arguments passed to the extension like <example argument="foo" bar>..


	$usernameParts = explode( ',', $input);
	$username = '';
	
	for($i = 0; $i < sizeof($usernameParts ); $i++) {
		$username .= trim($usernameParts [$i]);
	}

     $output = '<A HREF="http://www.funnyweb.dk:8080/message/msn/' . $username . '">' . 
		'<IMG SRC="http://www.funnyweb.dk:8080/msn/' . $username . '/' . 
		'onurl=www.funnyweb.dk/osi/iconset1/msnonline.gif/' . 
		'offurl=www.funnyweb.dk/osi/iconset1/msnoffline.gif/' . 
		'unknownurl=www.funnyweb.dk/osi/iconset1/msnunknown.gif" ALT="MSN Instant Messenger Online Status Indicator - If Online, click to IM."></A>';
		
     return $output;
 }
?>