You can view the demo (see bottom of page).
This tutorial was originally created and shared by Aditya Subawa from BloggerBelog, but before I go any further I’d just like to let you all know that this Blogger trick is not for everyone because to be able to make it work, you’re going to need a hosting site or a hosted server in which you’ll upload a PHP file. Aside from the hosting site, you’ll need to provide your own 2 sets of images for your icon: one for online status and the other to represent your offline status. Save these 2 images as “On.png” and “Off.png” (NOTE: they MUST BE in PNG(.png) format!).
Once you have both (hosting site and icons) ready, you may then continue with the tutorial’s steps:
- Copy/paste the PHP script below on a notepad
<?php
# create header image PNG
header("Content-Type: image/png");
#Checks to yahoo with curl functions in php
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL,
"http://opi.yahoo.com/online?u=YOUR_YAHOO_ID&m=s");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER,
1);
$strPage = curl_exec($cURL);
curl_close($cURL);
# If offline then the variable will be replaced with an
image file offline
if ($strPage=="YOUR_YAHOO_ID is NOT ONLINE")
{$gambar="off.png";}
# If online then the variable will be replaced with an
image file online
else
{$gambar="on.png";}
# Re-create the image
$buatgambar = imagecreatefrompng($gambar);
imagepng($buatgambar);
imagedestroy($buatgambar);
?>
2. Replace all the YOUR_YAHOO_ID with that of your own (ex. if your YM ID or email is this_is_me@yahoo.com then type in “this_is_me”)3. Save the file as “ym.php”
4. Upload all 3 files (ym.php, on.png, Off.png) on to your server or hosting site
5. Log in to your Blogger dashboard
6. Go to the ‘Design’ section and then over to ‘Layout’ page
7. Click on a ‘Add a Gadget’ button, choose ‘HTML/JavaScript’
8. Copy/paste the following:
<!– Yahoo! custom image status by www.bloggerbelog.com
–>
<a href="ymsgr:sendim?YOUR_YAHOO_ID"><img src="yourdomain-hosting.com/ym.php" title="Yahoo Custom image
by www.bloggerbelog.com" border="0" /></a>
<!– Yahoo! custom image status by
www.bloggerbelog.com.com –>
9. Replace all the necessary values (YOUR_YAHOO_ID and yourdomain- hosting.com/ym.php)10. Save the widget
Congratulations, you’re done! View your result.
0 comments:
Post a Comment