Просмотр файла rating/index.php

Размер файла: 3.71Kb
<?
include "config.php";
$query_allcount = @mysql_query("select `id` from `rate`;");
if(!$s) $s = "t";
if($s=="t") $arr = @mysql_query("select `id`,`title`,`link`,`about`,`today`,`allday`,`countdays` from `rate` where `today` > '0' order by today desc;");
if($s=="a") $arr = @mysql_query("select `id`,`title`,`link`,`about`,`today`,`allday`,`countdays` from `rate` where `today` > '0' order by allday desc;");
/*if($s=="h") $arr = @mysql_query("select `id`,`title`,`link`,`about`,`today`,`allday`,`countdays` from `rate` where today > 0 order by counthost desc;");*/
$i = @mysql_num_rows($arr);
///////////////////////////////
while ($data = @mysql_fetch_array($arr))
{
if($cid==$data['id']) $start=count($ids);
$titles[] = trim($data['title']);
$links[] = trim($data['link']);
$ids[] = trim($data['id']);
$abouts[] = trim($data['about']);
$today[] = trim($data['today']);
$allday[] = trim($data['allday']);
/*$chost[] = trim($data['counthost']);*/
$days[] = trim($data['countdays']);
}
///////////////////////////////
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
///////////////////////////////
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=\"Рейтинг Mobilka\">
<do type=\"prev\" label=\"&#x041D;&#x0430;&#x0437;&#x0430;&#x0434;\"><prev/></do> <do type=\"options\" name=\"main\" label=\"Mobilka.Us\"><go href=\"../index.php\"/></do>
<p><small>";
print '<a href="http://wapg3.playfon.ru/?ph_did=298737">Супер JAVA</a><br/><a href="http://wapm.playfon.ru/sites.php?d=298737">Лучшие мелодии</a><br/>';
};
/////////////////////////////////
function ending()
{
print "</small></p>
</card>
</wml>";
};
/////////////////////////////////
go();
print "Участвуют\r$i\rиз\r".@mysql_num_rows($query_allcount)."<br/>";
$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++)
{
$n=$i+1;
//if(5%$i!=0||$i==1) $br="<br/>";
print "$br<b>$n:<a href=\"$links[$i]\">$titles[$i]</a></b>&nbsp;<i>id=$ids[$i]</i>";
print "<br/><b>Описание:</b>\r$abouts[$i]<br/>";
print "<b>Хиты:</b>";
/*print "<br/><u>Хосты:</u> ".$chost[$i];*/
print "<br/><u>Сегодня:</u>\r".$today[$i];
print "<br/><u>Всего:</u>\r".$allday[$i];
print "<br/><u>Средне:</u>\r".round($allday[$i]/$days[$i],2)."<br/>";
}
if($start!=0)
print "<a href=\"index.php?start=".($start-5)."\">Назад</a><br/>";
if($count1>$start+5)
print "<a href=\"index.php?start=".($start+5)."\">Вперед</a><br/>";
print "<a href=\"reg.wml\">Регистрация</a><br/>";
print "<a href=\"profile.php\">Профиль</a><br/>";
print "<a href=\"code.php\">Код счетчика</a><br/>";
print "<small>Сортировка:<br/>";
/*print "<a href=\"index.php?cid=$cid&amp;s=h\">По хостам</a><br/>";*/
print "<a href=\"index.php?cid=$cid&amp;s=t\">Сегодня</a><br/>";
print "<a href=\"index.php?cid=$cid&amp;s=a\">Все посещения</a><br/>---<br/></small>";
print "<a href=\"../index.php\">На главную</a><br/>---<br/>";
print '<a href="http://wapp.ru/top/in.php?id=1218"><img src="http://wapp.ru/top/button.php?id=1218" alt="W@PP"/></a><br/>';
print '<a href="http://pslink.ru/ex/click.php?uid=217"><img src="http://pslink.ru/ex/view.php?uid=217" alt="PSLink banner"/></a><br/>';
print '<a href="http://pslink.ru/i.php?id=780"><img src="http://pslink.ru/b.php?id=780" alt="PSLink rating" /></a>';
ending();
?>