File size: 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=\"Чаты\">
<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.Чат:</u> <a href=\"index.php?ci=$ci[$i]\">$name[$i]</a></small><br/>
<small><u>Адрес:</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>Оnline:</u> ".$online['count(*)']."</small><br/>";
print "<small><u>Рег:</u> ".$all['count(*)']."</small><br/>";
}
if($start!=0)
{
print "<br/><small><a href=\"all.php?start=".($start-5)."\">Назад</a></small>";
}
if($count1>$start+5)
{
print "<small><a href=\"all.php?start=".($start+5)."\"><br/>Далее</a></small>";
}
print "<br/><small><a href=\"addchat.wml\">Регистрация чата</a></small>";
print "<br/><small><a href=\"http://ruwap.com.ru\">ruwap.com.ru</a></small>";
ending();
mysql_close($link);
?>