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

Размер файла: 6.32Kb
<?
include "config2.php";
$topic = "BestWAP-TOP"; // -Название Топа

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 = 'h';
if($o=='h') $arr=mysql_query("select * from users order by counthost desc;");
if($o=='hi') $arr=mysql_query("select * from users order by today desc;");
if($o=='a') $arr=mysql_query("select * from users order by allday desc;");

$i=mysql_num_rows($arr);
///////////////////////////////
while ($data=@mysql_fetch_array($arr))
{
if($cid==$data['id']) $start=count($ids);
$titles[] = $data['title'];
$links[] = $data['link'];
$ids[] = $data['id'];
$abouts[] = $data['about'];
$today[] = $data['today'];
$host[] = $data['counthost'];
$online[] = $data['online'];
$allday[] = $data['allday'];
$cin[] = $data['cin'];
$allin[] = $data['allin'];
$out[] = $data['out'];
$allout[] = $data['allout'];
$arrr=mysql_query("select id from users where 1;");
$ir=mysql_num_rows($arrr);
$asr=mysql_query("select id from users where counthost>=1;");
$asir=mysql_num_rows($asr);
}

///////////////////////////////
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\">";
include "config3.php";
print "<wml>
<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>
<card title=\"$topic\">
<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;
echo"<small><a href=\"http://wap.1124.ru/partner/7628487004/game/\">&#x421;&#x443;&#x43F;&#x435;&#x440;&#x441;&#x43A;&#x438;&#x435; &#x418;&#x433;&#x440;&#x44B;-&#x425;&#x430;&#x43B;&#x44F;&#x432;&#x430;!</a></small><br/>";
echo"<small><a href=\"http://wap.1124.ru/catalog/7628487004/polyphone/\">&#x421;&#x430;&#x43C;&#x430;&#x44F; &#x41B;&#x443;&#x447;&#x448;&#x430;&#x44F; &#x41F;&#x43E;&#x43B;&#x438;&#x444;&#x43E;&#x43D;&#x438;&#x44F;!</a></small><br/><br/>";



echo"<small>0.<b><a href=\"http://wap.wapes.kz/\">WaP.WaPeS.Kz!</a></b></small><br/>";
echo"<small>C&#x443;&#x43F;&#x435;&#x440; &#x432;&#x441;&#x451; &#x434;&#x43B;&#x44F; &#x43C;&#x43E;&#x431;&#x438;&#x43B;!!KZ-&#x447;&#x430;&#x442;!!&#x441;&#x435;&#x440;&#x432;&#x438;&#x441; &#x447;&#x430;&#x442;&#x43E;&#x432; ,&#x433;&#x43E;&#x441;&#x442;&#x435;&#x432;&#x44B;&#x445;,,!!!&#x438; &#x43C;&#x43D;&#x43E;&#x433;&#x43E;&#x435; &#x434;&#x440;&#x443;&#x433;&#x43E;&#x435; !!&#x41C;&#x440;3,&#x41F;&#x43E;&#x43B;&#x438;&#x444;&#x43E;&#x43D;&#x438;&#x44F; &#x43A;&#x430;&#x440;&#x442;&#x438;&#x43D;&#x43A;&#x438;,&#x437;&#x430;&#x43A;&#x43E;&#x447;&#x430;&#x439; &#x43D;&#x430; &#x440;&#x430;&#x437;&#x43D;&#x44B;&#x435; &#x43C;&#x43E;&#x431;&#x438;&#x43B;&#x43A;&#x438;!!</small><br/><br/>";
if($count>$start+5) $count=$start+5;
for($i=$start;$i<$count;$i++)

{
$n=$i+1;


if(5%$i!=0||$i==1) $br="<br/>";

if ($ids[$i]==$cid){

print "<b>$br$n.<a href=\"out.php?id=$ids[$i]\">$titles[$i]</a>&nbsp;</b>";}
else {
print "<small>$br$n.<b><a href=\"out.php?id=$ids[$i]\">$titles[$i]</a></b>&nbsp;</small>";}
include "config3.php";
if ($adm==$password) { print "<b><small><a href=\"delete.php?id=$ids[$i]&amp;adm=$password\">+</a></small></b>";}
print "<small><br/> $abouts[$i]<br/></small>";
print "<small>[<a href=\"inf.php?sid=$ids[$i]\">&#x421;&#x442;&#x430;&#x442;&#x438;&#x441;&#x442;&#x438;&#x43A;&#x430;</a>]</small>";
print "<small><br/>&#x421;&#x435;&#x433;&#x43E;&#x434;&#x43D;&#x44F;: &#x425;&#x43E;&#x441;&#x442;&#x44B;:$host[$i], &#x425;&#x438;&#x442;&#x44B;:$today[$i]</small>";
print "<small><br/>&#x412;&#x441;&#x435;&#x433;&#x43E;:$allday[$i]</small>";
print "<small><br/><b>&#x41F;&#x435;&#x440;&#x435;&#x445;&#x43E;&#x434;&#x44B;:</b></small><br/>";
print "<small>&#x421;&#x435;&#x433;&#x43E;&#x434;&#x43D;&#x44F;: &#x43F;&#x440;&#x438;&#x448;&#x43B;&#x43E;:$cin[$i], &#x443;&#x448;&#x43B;&#x43E;:$out[$i]<br/>
&#x412;&#x441;&#x435;&#x433;&#x43E;:  &#x43F;&#x440;&#x438;&#x448;&#x43B;&#x43E;:$allin[$i], &#x443;&#x448;&#x43B;&#x43E;:$allout[$i]</small>";
print "<br/>";
}
if($start!=0)
{
print "<br/><small><a href=\"top.php?start=".($start-5)."&amp;adm=$adm\">&#x41D;&#x430;&#x437;&#x430;&#x434;</a></small>";
}
if($count1>$start+5)
{
print "<small><a href=\"top.php?start=".($start+5)."&amp;adm=$adm\"><br/>&#x414;&#x430;&#x43B;&#x435;&#x435;</a></small>";
}

print "<small>";
print "<br/>";
print "<br/>&#x420;&#x435;&#x433;&#x438;&#x441;&#x442;&#x440;&#x430;&#x446;&#x438;&#x439;: ".$ir."<br/>";
print "&#x410;&#x43A;&#x442;&#x438;&#x432;&#x43D;&#x44B;&#x445;: ".$asir."";
print "<br/><br/><a href=\"reg.wml\">Регистрация</a>";
print "</small>";
print "<small>";
echo "<br/><br/>Сортировка:<br/>";
echo"<a href=\"top.php?cid=".$cid."&amp;start=$start&amp;o=h&amp;adm=$adm\">&gt;&gt;&gt;По хостам</a><br/>";
echo"<a href=\"top.php?cid=".$cid."&amp;start=$start&amp;o=hi&amp;adm=$adm\">&gt;&gt;&gt;По посещениям за день</a><br/>";
echo"<a href=\"top.php?cid=".$cid."&amp;start=$start&amp;o=a&amp;adm=$adm\">&gt;&gt;&gt;По всем посещениям</a><br/><br/>";

print "&#x41F;&#x43E;&#x437;&#x438;&#x446;&#x438;&#x44F; N^<br/>";
print "</small>";
print "<input type=\"text\" name=\"start\" maxlength=\"2\" emptyok=\"true\"/>";
print "<br/><anchor title=\"go\"><small>&#x41F;&#x435;&#x440;&#x435;&#x439;&#x442;&#x438;...</small><go href=\"index.php\" method=\"post\">";
print "<postfield name=\"start\" value=\"$(start)\"/>";
print "</go></anchor>";
print "<small>";
print "<br/><br/><a href=\"reg.wml\">Регистрация</a>";
print "<br/><a href=\"pro.php\">&#x41F;&#x440;&#x43E;&#x444;&#x438;&#x43B;&#x44C;</a>";
print "</small>";
include "config3.php";
print "<br/><a href=\"$sait\">&#169; $name</a><br/>";
print '<img src="http://top.wab.ru/count.php?id=15771" alt="WaPeS!"/><br/>';
print '<img src="http://top.wapes.kz/count.php?id=2" alt="WaPeS!"/><br/>';

list($msec,$sec)=explode(chr(32),microtime());
//echo "<small>[".round(($sec+$msec)-$HeadTime,4)."]</small>";
ending();
mysql_close($link);
?>