Skype Extension for Wikimedia

I’m constantly championing Skype within my non-profit organization as a way to increase communication while decreasing costs. As part of our developing MediaWiki intranet I wanted to create a directory of staff members and their skype usernames. I also wanted to add buttons (http://www.skype.com/share/buttons/wizard.html) for calling, chatting, and adding skype users.

Existing skype extensions focused only on showing a users Skype status. (http://meta.wikimedia.org/wiki/Skype_extension) In true wiki style, I added my own variaton on the code to allow editors to create buttons for different skype actions.

<?php
  $wgExtensionFunctions[] = "wfskype";

function wfSkype() {
global $wgParser;
$wgParser->setHook( “skype”, “renderSkype” );
}

# The callback function for converting the input text to HTML output
function renderSkype( $input, $argv ) {

if( !isset( $argv[‘action’] ) ){
$skype_action = “call” ;
} else {
$skype_action = $argv[‘action’] ;
}

switch( $skype_action ){

case “call”:
$skype_width = 70 ;
$skype_height = 23 ;
$skype_style=”call_blue_transparent_70x23.png”;
break;

case “add”:
$skype_width = 118 ;
$skype_height = 23 ;
$skype_style=”add_blue_transparent_118x23.png”;
break;

case “chat”:
$skype_width = 97 ;
$skype_height = 23 ;
$skype_style=”chat_blue_transparent_97x23.png”;
break;

default:
$skype_action = “call” ;
$skype_width = 70 ;
$skype_height = 23 ;
$skype_style=”call_blue_transparent_70x23.png”;

}

$output = ‘<!– Skype buttons http://www.skype.com/go/skypebuttons –>’;
$output .= ‘<!– MediaWiki extension http://meta.wikimedia.org/w/&#8217;;

     $output .= 'index.php?title=Skype_extension -->';
     $output .= '     $output .= '/js/skypeCheck.js">';
     $output .= '<a href="skype:'.$input.'?'.$skype_action.'">';
     $output .= '<img src="http://download.skype.com/share/skypebuttons/';
     $output .= 'buttons/'.$skype_style.'" ' ;
     $output .= 'style="border: none; width: '.$skype_width.'px; height: '.$skype_height.'px;" alt="Skype me" /></a>';
     $output .= '<!-- end of skype button -->';

return $output;
}
?>

  1. Copy the code into a file (e.g. skype.php)
  2. Save the file in the extensions directory of your mediawiki folder
  3. Add the line include('extensions/skype.php'); to the end of your LocalSettings.php file

In any wiki post, you can add <skype action="specified_action">Skype-Username</skype> where specified_action is call, chat, or add and Skype-Username is a valid skype username.

Buttons appear as

Call me!
Add me to Skype

Chat with me

One thought on “Skype Extension for Wikimedia

  1. Eric ur knowledge sharing rocks! My coding ability unfortunately falls significantly short of urs. I am a Wikimedia user and I want to get people talking to initiate deep consultation processes, integrated dedicated communication within Wikimedia Projects. I know this is possible as I have clicked on a Skype button myself in this environment. I cant seem to get the Skype Extension working and am having a challenge getting any support. I appreciate u r busy mate, but geez i’d appreciate a hand and a bit of ur time. Skype me: b9_hummingbird_hovering

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s