
/********************************************************
   ICQ Status snippet
   by dutch_cze [jarda@csol-mb.net]

   v0.1 final

   Usage:
   Simply use notorious known combination for most
   snippets:
             [[IcqStatus?icq=your ICQ UIN]]

*********************************************************/

// --- Path to dir with status images ---
  $path = "http://yourdomain.tld/...";

// --- Indicator style settings ---
// [you can edit this as you wish :-)]
  $online = "<img src='".$path."/icq_online.gif' title='Online' alt='icq online' />";
  $offline = "<img src='".$path."/icq_offline.gif' title='Offline' alt='icq offline' />";
  $na = "<img src='".$path."/icq_na.gif' title='N/A' alt='icq n/a' />";

// --- Snippet code ---

$fp = fsockopen("status.icq.com", 80);
if($fp) {
 fputs($fp, "GET /online.gif?icq=".$icq."&img=5 HTTP/1.0\r\n\r\n");
 while ($line=FGetS($fp,128)) {
  if(ERegI("^Location:.*$", $line)) {
   if(ERegI("online1.gif",$line)) {
    $icq_status = $online;
   } else {
    $icq_status = $offline;
   }
  }
 }
} else {
 $icq_status = $na;
}
return $icq_status;




