Skype extension: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
TheBigGuy (talk | contribs)
Beta
TheBigGuy (talk | contribs)
m Formating
Line 1: Line 1:
Hopefully a collection of Skype extensions. To start off with the Skype Button. Fell free to add, edit and talk
=Skype Button=
=Skype Button=
{{extension
My first extension so sorry if there are errors. It will only get better with feedback
|name = Skype Button
|type = Parser extension
|maturity = Release
|mediawiki = 1.5.5
|version = 1.0
|update = 11-05-2006
|description = Render Skype Button showing users online status
}}

The Skype Button rendered inside MediaWiki using the simple syntax of<br/>
:"<code><nowiki><skype>user_name</skype></nowiki></code>"
<br />
<br />
<br />
<br />
<pre>
<pre>
<?php
<?php
Line 31: Line 47:
# Add the line <code>include('extensions/skype.php');</code> to the '''end''' of your LocalSettings.php file
# Add the line <code>include('extensions/skype.php');</code> to the '''end''' of your LocalSettings.php file
Now you can use the extension with ''<skype>Skype-Username</skype>'' in the wiki
Now you can use the extension with ''<skype>Skype-Username</skype>'' in the wiki

==Future==
Allow the "balloon" or "Classic" design to be used using:
*<skype>Skype-Username|style</skype>
*<skype style="style_name">Skype-Username</skype> (Beta)


==Beta==
==Beta==
{{extension
|name = Skype Button
|type = Parser extension
|maturity = Beta
|mediawiki = 1.6.5
|version = 1.1
|update = 11-05-2006
|description = Render Skype Buttons showing users online status
}}
Allow the "balloon" or "Classic" design to be used using:
:"<code><nowiki><skype style="style_name">Skype-Username</skype></nowiki></code>"
<br />
<br />
<br />
<br />
<pre>
<pre>
<?php
<?php
Line 52: Line 78:


if( !issent( $argv["style"] OR !$argv["style"] = "bigclassic" OR !$argv["style"] = "balloon" ){
if( !issent( $argv["style"] OR !$argv["style"] = "bigclassic" OR !$argv["style"] = "balloon" ){
$style = "bigclassic"
$style = "bigclassic" ;
} else {
} else {
$style = $argv["style"]
$style = $argv["style"] ;
}
}


$output = '<!-- Skype "My status" button http://www.skype.com/go/skypebuttons -->';
$output = '<!-- Skype "My status" button http://www.skype.com/go/skypebuttons -->';
$output = '<!-- MediaWiki extension http://meta.wikimedia.org/w/index.php?title=Skype_extension -->';
$output .= '<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>';
$output .= '<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>';
$output .= '<a href="skype:';
$output .= '<a href="skype:';
Line 73: Line 100:
break;
break;
}
}

$output = '<!-- end of skype button -->';


return $output;
return $output;

Revision as of 19:59, 11 May 2006

Hopefully a collection of Skype extensions. To start off with the Skype Button. Fell free to add, edit and talk

Skype Button

Template:Extension

The Skype Button rendered inside MediaWiki using the simple syntax of

"<skype>user_name</skype>"





<?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 ) {
     # $argv is an array containing any arguments passed to the extension like <example argument="foo" bar>..
     $output = '<!-- Skype "My status" button http://www.skype.com/go/skypebuttons -->';
     $output .= '<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>';
     $output .= '<a href="skype:';
     $output .= $input ;
     $output .= '?call">';
     $output .= '<img src="http://mystatus.skype.com/bigclassic/';
     $output .= $input ;
     $output .= '" style="border: none;" width="182" height="44" alt="My status" /></a>';

     return $output;
 }
?>

Installation

  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

Now you can use the extension with <skype>Skype-Username</skype> in the wiki

Beta

Template:Extension Allow the "balloon" or "Classic" design to be used using:

"<skype style="style_name">Skype-Username</skype>"





<?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 ) {
     # $argv is an array containing any arguments passed to the extension like <example argument="foo" bar>..

     if( !issent( $argv["style"] OR !$argv["style"] = "bigclassic" OR !$argv["style"] = "balloon" ){
          $style = "bigclassic" ;
     } else {
          $style = $argv["style"] ;
     }

     $output = '<!-- Skype "My status" button http://www.skype.com/go/skypebuttons -->';
     $output = '<!-- MediaWiki extension http://meta.wikimedia.org/w/index.php?title=Skype_extension -->';
     $output .= '<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>';
     $output .= '<a href="skype:';
     $output .= $input ;
     $output .= '?call">';
     $output .= '<img src="http://mystatus.skype.com/'.$style.'/';
     $output .= $input ;

     switch( $style ){
          case "balloon":
               $output .= '" style="border: none;" width="150" height="60" alt="My status" /></a>';
          break;
          case "bigclassic":
               $output .= '" style="border: none;" width="182" height="44" alt="My status" /></a>';
          break;
     }

     $output = '<!-- end of skype button -->';

     return $output;
 }
?>