Просмотр файла chatservice/all.php

Размер файла: 2.49Kb
<?
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
include "ini.php";

list($msec,$sec)=explode(chr(32),microtime());
$HeadTime=$sec+$msec;
$link=mysql_connect ($DB_HOST, $DB_USER, $DB_PASS);
mysql_select_db($DB_NAME);



$arr=mysql_query("select * from cusers where ci>0 ;");


$i=mysql_num_rows($arr);

while ($data=@mysql_fetch_array($arr))
{
if($ci==$data['ci']) $start=count($chi);
$ci[] = $data['ci'];
$name[] = $data['link'];



}

function go()
{
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
print "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">";
print "<wml>
<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>
<card title=\"&#1063;&#1072;&#1090;&#1099;\">
<p>";
};
/////////////////////////////////
function ending()
{
print "</p>
</card>
</wml>";
};
/////////////////////////////////
go();
$count=$i;
$count1=$count;
if(empty($start))
$start=0;
$start=intval($start);
if($start<0)
$start=0;
if($count>$start+5) $count=$start+5;
$name=str_replace("http://","",$name);
for($i=$start;$i<$count;$i++)
{
$n=$i+1;





if(5%$i!=0||$i==1) $br="<br/>";


print "<small><u>$br$n.&#1063;&#1072;&#1090;:</u> <a href=\"index.php?ci=$ci[$i]\">$name[$i]</a></small><br/>
<small><u>&#1040;&#1076;&#1088;&#1077;&#1089;:</u> http://nowap.com.ru/chatsv/index.php?ci=$ci[$i]</small><br/>";

$on_count = @mysql_query("SELECT count(*) FROM `".$px.$utable."` WHERE ltime>'".intval(time()-$offline)."' and ci='$ci[$i]';");
$online = @mysql_fetch_array($on_count);
$online_count = $online['count(*)'];

$allreg_count = @mysql_query("SELECT count(*) FROM `chat_users` where ci='$ci[$i]';");
$all = @mysql_fetch_array($allreg_count);
$allcount = $all['count(*)'];

print "<small><u>&#1054;nline:</u> ".$online['count(*)']."</small><br/>";
print "<small><u>&#1056;&#1077;&#1075;:</u> ".$all['count(*)']."</small><br/>";
}

if($start!=0)
{
print "<br/><small><a href=\"all.php?start=".($start-5)."\">&#x41D;&#x430;&#x437;&#x430;&#x434;</a></small>";
}
if($count1>$start+5)
{
print "<small><a href=\"all.php?start=".($start+5)."\"><br/>&#x414;&#x430;&#x43B;&#x435;&#x435;</a></small>";
}

print "<br/><small><a href=\"addchat.wml\">&#1056;&#1077;&#1075;&#1080;&#1089;&#1090;&#1088;&#1072;&#1094;&#1080;&#1103; &#1095;&#1072;&#1090;&#1072;</a></small>";
print "<br/><small><a href=\"http://ruwap.com.ru\">ruwap.com.ru</a></small>";
ending();
mysql_close($link);
?>