Вход Регистрация
Файл: adultscript-2.0.3-pro/files/admin/templates/default/extend/plugins/pagination.plugin.php
Строк: 43
<?php
defined
('_VALID') or die('Restricted Access!');
function 
template_plugin_pagination($options=array(), $url$index=3$id=NULL)
{
    
$page           $options['page'];
    
$total_pages    $options['total_pages'];
    
$prev_page      $options['prev_page'];
    
$next_page      $options['next_page'];
    
$start_item     $options['start_item'];
    
$end_item       $options['end_item'];
    
$total_items    $options['total_items'];
    
$output         = array();
    
    if (
$page !== 1) {
          
$output[] = '<a href="'.page_strip($prev_page$url).'" class="butNav">&laquo; Previous</a>';
    }
    
    if (
$total_pages > (($index*2)+3) && $page >= ($index+3)) {
        
$ouput[]    = '<a href="'.page_strip(1$url).'" class="butNav"' .page_id(1$id).'>1</a>';
        
$ouput[]    = '<a href="'.page_strip(2$url).'" class="butNav"' .page_id(2$id).'>2</a>';
    }
    
    if (
$page $index+3) {
        
$output[]   = '&nbsp;...&nbsp;';
    }
    
    for (
$i=1$i<=$total_pages$i++) {
        if (
$page == $i ) {
              
$output[]    = '<a href="'.$url.'" class="butPage">'.$page.'</a>';
        } elseif ( (
$i >= ($page-$index) && $i $page) OR ($i <= ($page+$index) && $i $page) ) {
            
$output[]   = '<a href="'.page_strip($i$url).'" class="butNav"' .page_id($i$id).'>'.$i.'</a>';
        }
    }

    if (
$page < ($total_pages-6)) {
        
$output[]   = '&nbsp;...&nbsp;';
    }
    
    if (
$total_pages > (($index*2)+3) && $page <= $total_pages-($index+3)) {
        
$pre_page   = ($total_pages-2);
        
$ouput[]    = '<a href="'.page_strip($pre_page$url).'" class="butNav"' .page_id($pre_page$id).'>'.$pre_page.'</a>';
        
$pre_page   = ($total_pages-1);
        
$ouput[]    = '<a href="'.page_strip($pre_page$url).'" class="butNAv"' .page_id($pre_page$id).'>'.$pre_page.'</a>';
    }

    if (
$page !== $total_pages) {
        
$output[] = '<a href="'.page_strip($next_page$url).'" class="butNav"'.page_id($next_page$id'next_page').'>Next &raquo;</a>';
    }
    
    return 
implode("n"$output);    
}

function 
page_id($page$id=NULL$add=NULL)
{
    if (
$id) {
        return 
' id="'.$id.'_'.$page.'" ';
    }
}

function 
page_strip($page$url)
{
    if (isset(
$_GET['page'])) {
        return 
str_replace('#PAGE#''page='.$pagepreg_replace('/page=(w+)/i''#PAGE#'$url));
    } else {
        return 
$url.((strpos($url'?')) ? '&amp;' '?').'page='.$page;
    }
}
Онлайн: 1
Реклама