【发布时间】:2012-06-17 15:25:23
【问题描述】:
我正在按照本教程http://www.jek2k.com/wp/2008/02/08/building-a-custom-skype-me-button-with-status-icon/ 在我的网站上获取透明的 Skype 按钮,以便人们可以通过单击按钮呼叫我。 Skype有自己的但是背景是白色的,http://www.skype.com/intl/en-us/tell-a-friend/get-a-skype-button/
我的代码是:
<?php
function getSkypeStatus($username) {
/*
returns:
0 - unknown
1 - offline
2 - online
3 - away
4 - not available
5 - do not disturb
6 - invisible
7 - skype me
*/
$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
echo '<img src="/skype/'.$status.'.png" alt="call '.$username.'" />';
}
// retrieves the numeric status code
//getSkypeStatus('nicolovolpato');
// displays the status icon, change to match your Skype username
getSkypeStatusIcon('myusernamehere');
?>
当我在我的网站上进行测试时,它就会出现:'call myusernamehere'。没有图片,我无法点击此处调用 myusername 来打开 Skype 和通话。
我已将图像 0-7 插入到我的根文件夹中名为 skype 的文件夹中。
谁能帮忙
【问题讨论】:
-
除了这个
getSkypeStatus函数写得很好之外:尝试从浏览器打开该网页的源代码,看看HTML是否正确。 -
你还有其他解决方案吗?