View file chat_servis/top/index.php

File size: 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=\"&#x427;&#x430;&#x442;-&#x440;&#x435;&#x439;&#x442;&#x438;&#x43D;&#x433;\">
<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>&nbsp;[cid=$chid[$i]]";
print "<br/><b>&#1042;&#1089;&#1077;&#1075;&#1086;:</b> $allday[$i]";
print "<br/><b>&#1057;&#1077;&#1075;&#1086;&#1076;&#1085;&#1103; &#x445;&#x438;&#x442;&#x43E;&#x432;:</b> $today[$i]</small>";
print "<br/>";
}
if($start!=0)
{
print "<br/><a href=\"index.php?start=".($start-5)."\">&#x41D;&#x430;&#x437;&#x430;&#x434;</a>";
}
if($count1>$start+5)
{
print "<a href=\"index.php?start=".($start+5)."\"><br/>&#x414;&#x430;&#x43B;&#x435;&#x435;</a>";
}
print "<br/>";
echo "<br/><small>&#1057;&#1086;&#1088;&#1090;&#1080;&#1088;&#1086;&#1074;&#1082;&#1072;:</small><br/>";
echo"<small><a href=\"index.php?cid=".$chid."&amp;start=$start&amp;o=hi\">&gt;&gt;&gt;&#1055;&#1086; &#1087;&#1086;&#1089;&#1077;&#1097;&#1077;&#1085;&#1080;&#1103;&#1084; &#1079;&#1072; &#1076;&#1077;&#1085;&#1100;</a></small><br/>";
echo"<small><a href=\"index.php?cid=".$chid."&amp;start=$start&amp;o=a\">&gt;&gt;&gt;&#1055;&#1086; &#1074;&#1089;&#1077;&#1084; &#1087;&#1086;&#1089;&#1077;&#1097;&#1077;&#1085;&#1080;&#1103;&#1084;</a></small><br/>";
print "<br/><small><a href=\"http://elena.nsk.ru/chats/reg\">&#1057;&#1077;&#1088;&#1074;&#1080;&#1089; &#1095;&#1072;&#1090;&#1086;&#1074;</a></small><br/>";
list($msec,$sec)=explode(chr(32),microtime());
echo "<small>[".round(($sec+$msec)-$HeadTime,4)."]</small>";
ending();
mysql_close($link);
?>