Adding Yahoo Messenger status icons to websites is fairly easy and straightforward, it doesn't even need any programming language to customize them. By this time, i have gathered 25 different status messages that can be used to display while the user is online or offline on Yahoo Messenger.
Using OPI from yahoo, we will be able to detect whether a user is online. For example my Yahoo Id is 'tildemark', use the following address to know if i am online on Yahoo Messenger: http://opi.yahoo.com/online?u=tildemark
obviously the query string u=tells OPI to check for any user having a Yahoo Id of tildemark. The script then returns a status graphics "online" and "not online".
To add this on any website, we therefore use the syntax: (you will need to replace YahooID with your corresponding ID)
The code above will display a cute smiley face icon if your online and a gray icon if your offline. Below is a table of the 25 possible icons to customize your Yahoo Messenger online status.
Styles are from numbers 0 - 25.
To display an icon with the style number 2, we use this syntax in HTML:
What if we would like to create our own status image? Using the code above, there will be no way we could that without the use of a programming language. Another helpful option to our query string allows us to choose to display graphics or by a mere status message saying "ONLINE" and "NOT ONLINE" using 'm'. Adding that option to our query string we get:
Since we need to compare things we will set 'm' to 'a' because it will be hard to compare things in graphics, although its possible but comparing string is way easier.
Furthermore, notice that when using 'm=a' and setting 't=0' gives us the text status and setting 'm=a' and 't=1' gives us a numeric status. Things got more easier for us now. whenever the status returns '00' it means the YahooID is offline, and its '01' the YahooID is online.
Here is a PHP class for yahoo status, we will just add more features to it while we progress but for now it will just check for online status.
3: * @version 1
4: * @package Miscelaneous
5: * @copyright Copyright (C) 2009 www.tildemark.com. All rights reserved.