This is a quick simple method to create your own custom YM picture status.
Pictures below are just default and ordinary status from Yahoo. Let’s create our own status picture.
Enjoy!
<?
if (!function_exists(getStatusYM)) {
function getStatusYM ($yahoo_id, $user_name, $image_online, $image_offline) {
$pageurl = “http://mail.opi.yahoo.com/online?u=”.$yahoo_id.”&m=a&t=1″;
$file = @fopen($pageurl, “r”);
$read = @fread($file, 200);
$read = ereg_replace($yahoo_id, “”, $read);
if ($y = strstr ($read, “00”)) {
$online = false;
}
elseif ($y = strstr ($read, “01”)) {
$online = true;
}
@fclose ($file);
echo ‘<div align=”center”><a href=”ymsgr:sendIM?’.$yahoo_id.'”>’;
if ($online) {
echo ‘<img src=”‘.$image_online.'” border=”0″ alt=”‘ . $user_name . ‘ is online” title=”‘ . $user_name . ‘ is online” />’;
}
else {
echo ‘<img src=”‘.$image_offline.'” border=”0″ alt=”‘ . $user_name . ‘ is offline” title=”‘ . $user_name . ‘ is offline” />’;
}
echo ‘</a></div>’;
}
}
getStatusYM (“frozenade”, “Frozenade McForsaken (Webmaster)”, “images/online.png”, “images/offline.png”);
?>