File size: 2.23Kb
<?php
include '../config.php';
include '../guestbook/mylib.php';
session_start();
$lang=$_GET['lang'];
$agent=$_SERVER['HTTP_USER_AGENT'];
$addr=$_SERVER['REMOTE_ADDR'];
list ($opname, $chatok) = check_op($_SERVER['REMOTE_ADDR']);
?>
<?php
if (!($conn=pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass")))
{
header("Content-type: text/vnd.wap.wml");
?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.2.dtd">
<wml>
<card id="CatalogErr" title="Ошибка">
<p align="center">
Ошибка подключения к БД<br/>
<a href="/">На главную</a>
</p>
</card>
</wml>
<?php
exit;
}
header("Content-type: text/vnd.wap.wml"); ?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.2.dtd">
<wml> <?php
print "<card id=\"Top10u\" title=\"Top10 Users\">\n";
print "<p align=\"center\">Топ10 флудеров, или пользователи, набравшие максимальное количество постов:<br/><br/>**************<br/>\n";
$res=pg_query($conn,"select id,login,posts from users where posts > 2000 and users.moder=0 order by posts desc limit 10;");
$rows=pg_numrows($res);
for ($i=0;$i<$rows;$i++) {
$id=pg_result($res,$i,0);
$login=pg_result($res,$i,1);
$posts=pg_result($res,$i,2);
print "<a href=\"/user_info.php?id=".$id."\">".($i+1).". ".$login." (".$posts.")</a><br/>\n";
}
pg_close($conn);
?>
*******<br/><br/>
<a href="/users/">Назад</a>
</p>
<?php counters(); ?>
</card>
</wml>