PHP function to create your own custom YM status

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=&#8221;.$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”);

?>

3 Responses to PHP function to create your own custom YM status

  1. adam says:

    nice one… i’ve try it and it’s works thx

  2. Nay says:

    bisa tolong di jelasin step by step nya gimana?
    mohon di email ya

  3. frozenade says:

    @Nay
    Itu code snippet mbak, jadi langsung saja diselipkan di bagian mana mau ditampilkan di halaman php/html.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: