Tento Kod si ulozis ako novy snippet a pomenujes ho
IcqStatus
Kód: Vybrať všetko
/********************************************************
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://www.martincek.sk/icq";
// --- 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;
Jedine co musis urobit, tak skopirovat obrazky na svoj web
http://www.martincek.sk/ do zlozky "icq" a to "icq_online.gif'", "icq_offline.gif" a "icq_na.gif".
Ak budes chciet niekde v dokumente pouzit tento snippet, tak tam vlozis tento retazec:
Ten zavola snippet zisti ci si on-line (alebo iny stav) a na zaklade toho vlozi do dokumentu prislusny obrazok... that's all.