I already create class for create image like do you want it.
1)You must create folder images then put your image that will be show for your Yahoo Messeger. You must crete 2 image that the image signing your Yahoo Messeger online and offline. Please put your image in folder images. Example offline-smile.png for offline signing and online-smile.png for online signing.
2) Put yahoo.php for call this image.
yahoo.php like below
<?
class ymstatus{
public function ym_status($id_ym,$filename_suffix){
$fileinfo = pathinfo($filename_suffix);
$extension = $fileinfo['extension'];
if($extension == 'jpg') {
$extension = 'jpeg';
}
$yahoo_url = "http://opi.yahoo.com/online?u=".$id_ym."&m=a&t=1";
if (ini_get('allow_url_fopen')) {
error_reporting(0);
$yahoo = file_get_contents($yahoo_url);
} elseif(function_exists('curl_init')) {
$ch = curl_init($yahoo_url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_HEADER, 0);
$yahoo = curl_exec($ch);
curl_close($ch);
}
$yahoo = trim($yahoo);
if(empty($yahoo)) {
$imgsrc = "./images/offline-" . $filename_suffix;
} elseif($yahoo == "01") {
$imgsrc = "./images/online-" . $filename_suffix;
} elseif($yahoo == "00") {
$imgsrc = "./images/offline-" . $filename_suffix;
} else {
$imgsrc = "./images/offline-" . $filename_suffix;
}
header("Content-type: image/".$extension);
readfile($imgsrc);
}
}
$ymstatus = new ymstatus();
echo $ymstatus->ym_status('phpeverywhere','smile2.png');
?>
3) you must call this yahoo.php like below for appear images yahoo like do you want it.
<a href="ymsgr:sendim?phpeverywhere" title="phpeverywhere"><img src="yahoo.php" alt="" border="0" /></a>
Monday, October 13, 2008
Create Yahoo! Messenger Image with Own Image
POSTED BY
Oriol
AT
2:45 PM
Subscribe to:
Post Comments (Atom)
0 Comments:
Post a Comment