Create Custom Skype Buttons
Recently we implemented Live Help for our paying customers. We based it on Skype, so our customer can call us or contact us as they are working on their websites, especially if they need instant advice. The main challenge we had was creating custom Skype Call Me buttons. You see, Skype provides a bunch of free custom buttons, but you are then tied into their default Skype buttons images. For most people that might be fine, but you also might find yourself not happy with being tied to “Call Me” buttons. So how do you get custom Skype buttons to work? The solution we found was this great script which we have slightly modified.
Basically it ties into the status codes of Skype as below
* 0 – unknown
* 1 – offline
* 2 – online
* 3 – away
* 4 – not available
* 5 – do not disturb
* 6 – invisible
* 7 – skype me
Simply create images in JPG or PNG and number them 1 thru 7 for each status. The next step is to change your username to your personal one and you are good to go. It’s that simple. Get the full script here with our notations. Make the changes you need, and save as .PHP file type. Have fun!
Print This Post

Nice code!!
But I dont have fopen on in my php.ini, last time I did this my server was hacked sometime after so I dont really want to.
I was wondering if there is any way around this.
Unfortunately this only works with fopen. We are using the Skype custom solution in a secure area. We suggest you hide the info about your php.ini file using the below in your .htaccess file. Just Google hide php.ini or read here. You should also set the appropriate CHMOD for the file…
Other issues to consider are your hosts security and the platform or CMS which you are using to host your content. We have used it on several developments with no issue, but please note we don’t take credit for the script. It was created by another party, so use it at your own risk.
after you do all this how do you get the images to actually show up in my html page
You need to include in the script where the images are located. The line you need to modify is noted in the script.
This code is brilliant, however I’ve changed about the code a little and the images do not seem to update correctly at all now.
I have one graphic with both a normal and active state in the image which are referencing each status code.
I have the image loaded as a background image in css and a transparent button overlaid so that when the user hovers their mouse it allows the graphic to switch (sliding doors css) to a hover state.
The problem is that the script does not seem to update the image code now? Any ideas? It works perfectly the normal way.
Thanks!,
Shane
<?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);
echo '
‘;
}
getSkypeStatusIcon(‘MY_USERNAME’);?>
It didn’t seem to post correctly, hopefully it will now, I’ve just pasted the piece I’ve changed.
function getSkypeStatusIcon($username) {
$status = getSkypeStatus($username);
echo '
';
}
I found my problem, I needed to make my “show my status on the web” in “preferences -> privacy”