Log in

View Full Version : how to create yahoo indicator



asoekaya
07-11-2008, 04:06 PM
Hello All....
I want to create a yahoo indicator with my own image not from yahoo default,..
i havae try it but dont work.. can some one here give me script or repair my script below..

if i create just with one ID it work, but when i use 2 ID like belloew the script just work th last ID.. the last ID only show at my website... anda the last how to create this script will show the result in center position..

thanks..


<?

/*status yahoo
Mahmudy Sayang Syafira
*/

if(ereg(basename (__FILE__), $_SERVER['PHP_SELF']))
{
header("HTTP/1.1 404 Not Found");
exit;
}

ob_start();
global $koneksi_db;

$yahooid = "mudies_05";
$yahooid1 = "mudy_dja04";

$ch = curl_init("http://opi.yahoo.com/online?u=".$yahooid."&m=t");
$ch1 = curl_init("http://opi.yahoo.com/online?u=".$yahooid1."&m=t");

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$status = curl_exec($ch,$ch1);

curl_close($ch,$ch1);
if($status == $yahooid.,$yahooid1." is NOT ONLINE"){

//tampilkan gambar offline
echo "<a href='ymsgr:sendIM?mudies_05'><img src='images/kingoff.png' border='0' alt='king Mahmudy' title='King Mahmudy' /></a>";

echo "<a href='ymsgr:sendIM?mudy_dja04'><img src='images/queenoff.png' border='0' alt='Queen Syafira' title='Queen Syafira' /></a>";
} elseif ($status == $yahooid.,$yahooid1." is ONLINE"){

//tampilkan gambar online
echo "<a href='ymsgr:sendIM?mudies_05'><img src='images/kingon.png' border='0' alt='king Mahmudy' title='King Mahmudy' /></a>";

echo "<a href='ymsgr:sendIM?mudy_dja04'><img src='images/queenon.png' border='0' alt='Queen Syafira' title='Queen Syafira' /></a>";
}

$out = ob_get_contents();
ob_end_clean();

?>

thetestingsite
07-11-2008, 04:23 PM
You should look into using curl_multi_exec (http://us.php.net/manual/en/function.curl-multi-exec.php) to execute the multiple calls.

Look at the comments on php.net's website (which I linked to above).

Hope this helps.

asoekaya
07-11-2008, 05:06 PM
thanks bro..
but iam not good in scripting.. so can someone type and repair it for me...
just post a script what you have edited...

thanks