سلام
دوستان براتون امروز یک تابع اماده کردم جهت نمایش وضعیت ای دی یاهو
کد ها گویای کار هست سوال داشتید بپرسید
کد PHP:
<?php
function ystatus($yid) {
$strUser = $yid;
$url = "http://mail.opi.yahoo.com/online?u=".$strUser."&m=t&t=0";
$handle = fopen ("$url", "r");
$contents = "";
do {
$data = fread($handle, 10000);
if (strlen($data) == 0) {
break;
}
// Get the output from yahoo
$contents .= $data;
} while(true);
fclose ($handle);
if ((strpos(strtoupper($contents),"NOT ONLINE") ? strpos(strtoupper($contents),"NOT ONLINE")+1 : 0)>0)
{
// If your yahoo username offline on Yahoo Messenger set variable status to OFFLINE
$strStatus = "OFFLINE";
// Add custom Offline Image
$imgStatus = "<a href=\"ymsgr:sendIM?" .$strUser ."\"><IMG SRC='/im_offline.gif' ALT='OFFLINE'><br />offline</a>";
}
else
{
// If your yahoo username Online on Yahoo Messenger set variable status to ONLINE
$strStatus = "ONLINE";
// Add Custom Online Image
$imgStatus = "<a href=\"ymsgr:sendIM?" .$strUser ."\"><IMG SRC='/im_online.gif' ALT='ONLINE'><br />Omline</a>";
}
// return your custom output
return $imgStatus;
}
?>
<html>
<head>
</head>
<body>
<?php
echo ystatus ("test id");
?>
</body>
</html>
---------- Post added at 07:43 PM ---------- Previous post was at 07:37 PM ----------
اینم بعدی
با این میتونید متن رو به عکس تبدیل کنید
کاربرد:برای نمایش رمز و ارائه متون و کد های امنیتی
کد PHP:
<?php
function strimage($str){
header ("Content-type: image/png");
$font = 4;
$width = ImageFontWidth($font) * strlen($str);
$height = ImageFontHeight($font);
$im = @ImageCreate ($width,$height);
$background_color = ImageColorAllocate ($im, 150, 250, 50); //gray background
$text_color = ImageColorAllocate ($im, 0, 0,0);//black text
ImageString ($im, $font, 0, 0, $str, $text_color);
ImagePNG ($im);
}
strimage("text_text");
?>