Размер файла: 2.05Kb
<?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://wep.org.ru/";
//¬ ббЁў бЁ¬ў®«®ў
function print_data($where_data,$page)
{
global $utable;
//Ґб«Ё бва Ёж Ґ ¤ , в® ® а ў г«о, ®вбзҐв б ЇҐаў®© бва Ёжл
if(empty($page)) $page=0;
//§ Їа®б ўЎ®а Ё¤ Ё§ в Ў«Ёжл Є ⥣®аЁЁ Є в «®Ј
$query=mysql_query("SELECT id FROM users where category='$where_data' and 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 category='$where_data' and 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=\"katalog.php?where=$where_data&page=$page_number\">[".($i+1)."]</a></small>";
} else {
print "<small><b>[".($i+1)."]</b></small>";
}
}
print "<small><br/>:::::<br/><a href=\"index.php\">К разделам</a><br/><img src=\"http://c.waplog.net/ru/6095.cnt\" alt=\"waplog\"/><br/></small>";
}
?>