1. Создать новый all.inc.php
вставляем в него:
<? if (defined('JBCITY')) $subQuery=' AND jb_board.city_id = '.JBCITY; else $subQuery='';
$name_cat=(defined('JBLANG')&& constant('JBLANG')=='en')?'en_name_cat':'name_cat';
$result = mysql_query ("SELECT id FROM jb_board WHERE old_mess = 'old' ".$subQuery);cq();
if (@$result) $total_rows = mysql_num_rows ($result);
if (@$total_rows){if(ctype_digit(@$_GET['list']) && @$_GET['list']>0) $list=$_GET['list'];else $list=1;
$tot=($total_rows-1)/$c['count_adv_on_index'];
$total=intval($tot+1);if($list>$total) $list=$total;
$start=$list*$c['count_adv_on_index']-$c['count_adv_on_index'];
$last_add=mysql_query("SELECT jb_board.id AS board_id, jb_board.id_category, jb_board.title, jb_board.city, DATE_FORMAT(jb_board.date_add,'%d.%m.%Y') AS dateAdd, jb_board.checkbox_top, jb_board.checkbox_select, jb_board_cat.id, jb_board_cat.".$name_cat.", jb_photo.photo_name, jb_city.city_name, jb_city.en_city_name FROM jb_board RIGHT JOIN jb_board_cat ON jb_board.id_category = jb_board_cat.id LEFT JOIN jb_city ON jb_board.city_id = jb_city.id LEFT JOIN jb_photo ON jb_board.id = jb_photo.id_message WHERE old_mess = 'old' ".$subQuery." GROUP by board_id ORDER BY jb_board.checkbox_top DESC, jb_board.top_time DESC, jb_board.id DESC LIMIT ".$start.", ".$c['count_adv_on_index']); cq();
if(mysql_num_rows($last_add)){?><center><h1><?=$lang[1043]?></h1></center><?
while ($last=mysql_fetch_assoc($last_add)){ ?><div class="<?=smsclass($last['checkbox_top'],$last['checkbox_select'])?>"><div class="o1"><a class="b" title="<?=$last['title']?>" href="<?="c".$last['id_category']."-".$last['board_id']?>.html"><?=$last['title']?></a></div><div class="o2 alcenter"><? echo($last['dateAdd']==date("d.m.Y"))?$lang[531]:$last['dateAdd'];?></div><div class="o3 alcenter"><? echo(@$last['photo_name'])?"<img src=\"".$im."photo.gif\" alt=\"".$lang[200]."\" />":"<img src=\"".$im."nophoto.gif\" alt=\"nophoto\" />";?></div><div class="o4"><a class="dgray" title="<?=$last[$name_cat]?>" href="<?="c".$last['id_category']?>.html"><?=$last[$name_cat]?></a></div><div class="o5"><? if(defined('JBLANG')&& constant('JBLANG')=='en') echo $last['en_city_name']; else echo $last['city_name']; ?></div><div class="clear"></div></div><? } if ($total_rows>=$c['count_adv_on_index']){ $a="<a href=\"list-";if($list!=1)$pervpage=$a."1.html\" title=\"".$lang[174]."\"> « </a> ";if($list!=$total) $nextpage=$a.$total.".html\" title=\"".$lang[175]."\"> » </a>"; $pageleft="";$pageright=""; for($i=$c['limit_pagination_on_page'];$i>=1;$i--)if($list-$i>0)$pageleft.=$a.($list-$i).".html\">".($list-$i)."</a>"; for($i=1;$i<=$c['limit_pagination_on_page'];$i++)if($list+$i<=$total)$pageright.=$a.($list+$i).".html\">".($list+$i)."</a>"; echo "<div class=\"pagination\">".@$pervpage.@$pageleft."<b><span class=\"current\">".$list."</span></b>".@$pageright.@$nextpage."</div>";
}}}?>
сохраняем в папку inc
2. в index.php после:
else require_once("inc/cat_index.inc.php");
}
(это вывод категорий) вставляем вот это:
if (!$_GET or $_GET['list']) {
if($page <= $limit_pages_in_cache) $start_filename="list-".$page; else $start_filename="";
if(defined('JBCITY')) $page_uri="list".$start_filename."_".JBLANG.JBCITY;
else $page_uri="list".$start_filename."_".JBLANG;
define("USTITLE", $lang[1043].", ".$page." ".$lang[1006]);
if($JBSCACHE=="1" && $page <= $limit_pages_in_cache){
$flnm=$cdir.$page_uri;
ob_start();
if(!$adv_index=readData($flnm,$JBSCACHE_expire)){
require_once("all.inc.php");
$adv_index=ob_get_contents(); ob_clean();
writeData($flnm,$adv_index);
}echo $adv_index;
} else require_once("inc/all.inc.php");
}
3. Ну и в корневой .htaccess вставляем строчку:
RewriteRule ^list-([0-9]+).html$ index.php?list=$1
P.s. Кол-во выводимых на страницу отдельно в админке не выводил.Берется как и количество в категориях, Если есть необходимость управлять отдельно,можно сделать.