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

Размер файла: 1.43Kb
<?php
include 'db.php';
mysql_connect($DB_HOST,$DB_USER,$DB_PASS) or die (mysql_error());
mysql_select_db($DB_NAME);
$index="../index.php";
$site="http://guwap.org/kat/"; 
function print_data($where_data,$page)
{
global $utable;
if(empty($page)) $page=0;
$query=mysql_query("SELECT id FROM users where counter>0;");
$num_of_rows=mysql_num_rows($query);
$total_mat_number=$num_of_rows;
$mat_per_page=5;
$total_pages=ceil($total_mat_number/$mat_per_page);
$print = mysql_query("select * from users where counter>0 order by counter desc limit ".$page.",".($page+$mat_per_page).";");
while($data=mysql_fetch_array($print))
{
$ix++;
print "<small><a href=\"out.php?link=".$data['link']."\">$ix.".$data['title']."</a>(id=".$data['id'].")<br/>[".$data['link']."]<br/>";
print "".$data['about']."<br/>";
print "<u>В каталог:</u> ".$data['counter']."<br/>";
print "<u>Из каталога:</u>";
print " ".$data['outcounter']."";
print "<br/>:::::</small><br/>";
}
for ($i=0; $i<$total_pages; $i++){
$page_number=$i*$mat_per_page;
if ($page_number!=$page) {
print "<small><a href=\"kat.php?best=best&amp;page=$page_number\">[".($i+1)."]</a></small>";
} else {
print "<small><b>[".($i+1)."]</b></small>";
}
}
print "<small><br/>:::::<br/><a href=\"index.php\">&#x041A; &#x0440;&#x0430;&#x0437;&#x0434;&#x0435;&#x043B;&#x0430;&#x043C;</a><br/><img src=\"http://c.waplog.net/ru/6095.cnt\" alt=\"waplog\"/><br/></small>"; 
}
?>