For the latest updates and support please visit http://www.nxfifteen.com/projects/skypebutton
Amoung the many improvements I have been making to my this last week I decided I would add a Skype "Call Me" style button to the side bar. The complicated part of this arose when I found I did not really care for any of the available buttons offered by Skype, so I set about coding my own custom buttons in PHP.
You see Skype provides a bunch of free custom buttons but did not want to be tied into the default Skype buttons images. For more Skype users I imagine that would be fine, and if you are looking for is a quick and dirty method of displaying your Skype online presence the visitors of your website then I would recommend looking at the Skype free custom buttons wizard. However if you're looking for more control over what you presence icons will look like then continue reading I will explain how I produced mine.
The solution I found was this great script which I then a heavily modified. Basically it is a PHP application that ties into the status codes of Skype and returns a PNG image associated with the current online status of the requested user. Because the return value is the correct PNG image is possible to incorporate the script into any HTML website be it one hosted on your own server or our external for example forums.
Like all my freeware applications and scripts you can download from here. Basically download that zip file can place a folder on your web server then just open skype.php and enter your Skype username on line 50. if you would like to change your icons all you must do is change each of the images included in the image folder maintaining the file names.
Now all you have to do is enter the URL of skype.php into any HTML image tag for e.g.
<img src="http://www.stuartanderson.eu.com/myapps/presence/skype.php" />
becomes
The grunt work of this application is performed by this function "getRemoteStatusSkype" which uses your username to Queenie Skype for numerical return value then translates it user friendly text value. The download application is formatted into an object orientated design which incorporates some more customisation and error correction, however this function will give you an idea of how I have achieved that is.
function getRemoteStatusSkype($skypeUserName) {
$statusURLskype = "http://mystatus.skype.com";
$presence_skype = Array();
$remote_status = fopen($statusURLskype.'/'.$skypeUserName.'.num', 'r');
if (!$remote_status) {
$presence_skype['showas'] = 'urlerror';
}
while (!feof ($remote_status)) {
$value = fgets ($remote_status, 1024);
$value = trim($value);
switch($value) {
case "0":
$presence_skype['showas'] = "unknown";
break;
case "1":
$presence_skype['showas'] = "offline";
break;
case "2":
$presence_skype['showas'] = "online";
break;
case "3":
$presence_skype['showas'] = "away";
break;
case "4":
$presence_skype['showas'] = "xa";
break;
case "5":
$presence_skype['showas'] = "dnd";
break;
case "6":
$presence_skype['showas'] = "forbidden";
break;
case "7":
$presence_skype['showas'] = "available";
break;
default:
$presence_skype['showas'] = "returnerror";
break;
}
}
fclose($remote_status);
return $presence_skype['showas'];
}
Update, 17th July 2010
Running in debug mode
URL: http://INSTALLURL/INSTALLDIRECTORY/
Requested Service: skype
skype Username: YOURUSERNAME
Current PHP version: 5.2.4-2ubuntu5



Your Feedback...
Hey Kevin,
Well that annoying, lest of all cause I could have swarn I checked that link before I posted this. I've now fixed the problem at least, so you can download the zip file from the link above again.
Let me know how you get on
Good afternoon MBB,
From what I've been able to find from my end it looks like there might be a problem with your copy of the source code, around line 47 of the status.php file have you made anychanges to this file?
I have updated the CustomSkypeButtons download file with a little more debugging options. For debuging this updated script will now print the full PHP version you are running. I have also included an example (Bellow the original post) of the text output by this new debug feature, incase anyone is concerned about their security.
I wrote the script in PHP Version 5 so it is possible if you are running and older version of PHP some of the code I am using is not backward compatable (This is entirly my fault not yours!). If can you install this update I will be able to see the current PHP version number you are running and update the script to work for you quite easily!
You can download the new zip file from this URL -> CustomSkypeButtons_Version-1.1.zip