Victor77
У меня в lib.php в этих строках несколько иной код. Вот код функции Print_Paginator
CODE:function Print_Paginator($total,$get,$per,$links,&$first,$dots = FALSE) {
global $fm,$current_page;
$p = $fm->_Intval('p');
///////////////////
$total_pages = ceil($total/$per);
$current_page = ($p <= 0)? 1:(($p<=$total_pages) ? $p:$total_pages);
$first = ($current_page <= 1) ? 0 : ($current_page-1)*$per;
////////////////
$paginator = '<b>Страниц</b> ('.$total_pages.'): ';
$pagesarray = array();
$pos = floor($links/2);
$links = $pos*2+1;
$go_start = $go_finish = "";
if ($total_pages > $links) {
$go_start = ($current_page - $pos <= 1) ? '':' <a href="'.sprintf($get,'1').'" title="В начало">В начало</a> ';
$go_finish = ($current_page + $pos >= $total_pages) ? '':' <a href="'.sprintf($get,$total_pages).'" title="В конец">В конец</a> ';
}
$prev = ($current_page == 1)?'':'<a href="'.sprintf($get,($current_page-1)).'" title="Предыдущая страница">«</a> ';
$next = ($current_page == $total_pages)?'':' <a href="'.sprintf($get,($current_page+1)).'" title="Следующая страница">»</a>';
$dots_start = NULL; $dots_finish = NULL;
if ($dots === TRUE && $total_pages > $links){
$dots_start = ($current_page - $pos <= 1) ? '':'... ';
$dots_finish = ($current_page + $pos >= $total_pages) ? '':' ...';
}
$start_links =
($total_pages > $links) ? (
($current_page - $pos <= 1) ? 1 : (
($current_page + $pos >= $total_pages) ? $total_pages - $pos*2 : $current_page - $pos
)
) : 1;
$finish_links =
($total_pages > $links) ? (
($current_page + $pos >= $total_pages) ? $total_pages : (
($current_page - $pos <= 1) ? $links : $current_page + $pos
)
) : $total_pages;
for ($i=$start_links; $i<=$finish_links; $i++){
$start = ($i-1)*$per+1;
$pagesarray[] = ($i != $current_page)?'<a href="'.sprintf($get,$i).'">'.$i.'</a>':'<span class="curentpage">['.$i.']</span>';
}
$paginator .= $go_start.$prev.$dots_start;
$paginator .= implode(" ",$pagesarray);
$paginator .= $dots_finish.$next.$go_finish;
return $paginator;
}
Файл от 30.07.2007 28Kb
Сборка FM 1.0 Beta за 05.11.2007(Отредактировано автором: 19 Марта, 2008 - 17:23:59) |