Размер файла: 3.29Kb
<?
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
require ("db.php");
$arr = mysql_query("select * from top where today>0 order by today desc;");
$i = mysql_num_rows($arr);
while ($data = mysql_fetch_array($arr))
{
if($id == $data['id'])
$start = count($ids);
$title[] = $data['title'];
$link[] = $data['link'];
$ids[] = $data['id'];
$opis[] = $data['opis'];
$today[] = $data['today'];
$all[] = $data['all'];
$cin[] = $data['cin'];
$out[] = $data['out'];
$tops = $data['tops'];
}
function go()
{
print "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml>
<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>
<card title=\"AmLet - top\">";
$H1=date("H",time())+1;
$i=date("i",time());
$s=date("s",time());
$time=date("$H1:i:s",time());
print "<p align=\"center\">
<small><small>$time</small></small></p>";
print "<p align=\"left\">";
$query_allcount = @mysql_query("select `id` from `top`;");
$result = mysql_query("select * from `top` where today>0 order by today desc");
$v = @mysql_num_rows($result);
if($v==0){print "<small>На данный момент в топе пусто :))</small><br/>";}else{
print "<small><b>Участвуют $v из ".@mysql_num_rows($query_allcount)."</b></small><br/>";}
};
function ending()
{
print "</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;
for($i=$start;$i<$count;$i++)
{
$tops=$i+1;
@mysql_query("UPDATE `top` SET `tops` = '$tops' WHERE `id` ='$ids[$i]' LIMIT 1 ;");
print "<small><b>$tops::</b></small>
<small><a href=\"info.php?id=$ids[$i]\">[i]</a></small>
<small>||<a href=\"out.php?id=$ids[$i]\">$title[$i]</a></small><br/>";
print "<small><u>Описание:</u> $opis[$i]</small><br/>
<small><u>Сегодня:</u> $today[$i]</small><br/>
<small><u>Всего:</u> $all[$i]</small><br/>
<small><u>Из топа:</u> $out[$i]</small><br/>
<small><u>В топ:</u> $cin[$i]</small><br/>
<small><b>:::::</b></small><br/>";}
if($start!=0)
{
print "<br/><small><a href=\"index.php?start=".($start-5)."\">Пред.5</a></small>";
}
if($count1>$start+5)
{
print "<br/><small><a href=\"index.php?start=".($start+5)."\">Cлед.5</a></small>";
}
print "<br/><small><a href=\"enter.php\">Профиль</a></small><br/>";
print "<small><a href=\"reg.wml\">Регистрация</a></small><br/>";
print "<small><a href=\"../index.php\">amlet.com.ru</a></small><br/>";
print "<a href=\"http://amlet.com.ru/top/in.php?id=1\"><img src=\"http://amlet.com.ru/top/c.php?id=1\" alt=\"AmLet\"/></a>";
print "</p>";
ending();
@mysql_close();
?>