Размер файла: 2.98Kb
<?php
Error_Reporting(E_ALL & ~E_NOTICE); /////////////// игнорируем ошибки
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
include "../conf.inc.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);
if(!$o) $o = 'hi';
if($o=='hi') $arr=mysql_query("select * from cusers order by today desc;");
if($o=='a') $arr=mysql_query("select * from cusers order by allday desc;");
$i=mysql_num_rows($arr);
///////////////////////////////
while ($data=@mysql_fetch_array($arr))
{
if($cid==$data['cid']) $start=count($chid);
$chid[] = $data['cid'];
$name[] = $data['link'];
$today[] = $data['today'];
$allday[] = $data['allday'];
}
///////////////////////////////
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>$br$n.<b><a href=\"http://elena.nsk.ru/chats/?cid=$chid[$i]\">$name[$i]</a></b> [cid=$chid[$i]]";
print "<br/><b>Всего:</b> $allday[$i]";
print "<br/><b>Сегодня хитов:</b> $today[$i]</small>";
print "<br/>";
}
if($start!=0)
{
print "<br/><a href=\"index.php?start=".($start-5)."\">Назад</a>";
}
if($count1>$start+5)
{
print "<a href=\"index.php?start=".($start+5)."\"><br/>Далее</a>";
}
print "<br/>";
echo "<br/><small>Сортировка:</small><br/>";
echo"<small><a href=\"index.php?cid=".$chid."&start=$start&o=hi\">>>>По посещениям за день</a></small><br/>";
echo"<small><a href=\"index.php?cid=".$chid."&start=$start&o=a\">>>>По всем посещениям</a></small><br/>";
print "<br/><small><a href=\"http://elena.nsk.ru/chats/reg\">Сервис чатов</a></small><br/>";
list($msec,$sec)=explode(chr(32),microtime());
echo "<small>[".round(($sec+$msec)-$HeadTime,4)."]</small>";
ending();
mysql_close($link);
?>