A common problem when you are developing a web site with non white background color and you want to display your skype status in it, is that skype default images are not transparent .
The solution to this problem is to embed the following php code to your web site and you will be able to use your custom status images.
<?php
function getSkypeStatus($username) {
$remote_status = fopen ('http://mystatus.skype.com/'.$username.'.num', 'r');
if (!$remote_status) {
return '0';
exit;
}
while (!feof ($remote_status)) {
$value = fgets ($remote_status, 1024);
return trim($value);
}
fclose($remote_status);
}
function getSkypeStatusIcon($username) {
$status = getSkypeStatus($username);
// change the path of the icons folder to match your site default will be /images/ and image file type which is .png as default
echo '<a href="skype:'.$username.'?chat"><img src="/(images-path)'.$status.'.png" alt="chat '.$username.'" style="border: none;" />';
}
getSkypeStatusIcon('(skype-name)');
?>
You will have to follow these steps to make the code work properly:
1. Upload to your custom status images on your website server. You should name the images as “status-code.png” . The status codes skype returns are:
- 0 - unknown
- 1 - offline
- 2 - online
- 3 - away
- 4 - not available
- 5 - do not disturb
- 6 - invisible
- 7 - skype me
2. So for example you will have to name the image for online status “2.png”.
3. Change in code line 19 “(images-path)” with the path you have uploaded your custom images.
4. Change in code line 22 “(skype-name)” with your skype name.
You can download the code and images template from here.
Talk with the author via twitter @hpsaltis