WordPress.org

Plugin Directory

Changeset 468784


Ignore:
Timestamp:
11/28/11 22:01:47 (6 years ago)
Author:
ollybenson
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ob-page-numbers/trunk/index.php

    r467693 r468784  
    44Plugin URI: http://code.olib.co.uk 
    55Description: A simple paging navigation plugin for users and search engines. Instead of next and previous page it shows numbers and arrows. Settings available.. 
    6 Version: 1.1 
     6Version: 1.1.1 
    77Author: Olly Benson, Jens Törnell 
    88Author URI: http://code.olib.co.uk 
     
    5151 
    5252    $min_page = $current_page - floor(intval($limitPages)/2); // works out the lowest page number to be displayed 
     53    $limitPages = (intval($limitPages)-1); 
    5354    if ($min_page<1) $min_page=1; 
    54     $max_page = $min_page + intval($limitPages); // words out the highest page number to be displayed 
     55    $max_page = $min_page + $limitPages; // words out the highest page number to be displayed 
    5556    if ($max_page>$total_pages) $max_page=$total_pages; 
    56     if ($max_page==$total_pages && $max_page>$limitPages) $min_page= ($max_page-intval($limitPages)); // changes min_page if max is last page 
     57    if ($max_page==$total_pages && $max_page>$limitPages) $min_page= ($max_page-$limitPages); // changes min_page if max is last page 
    5758 
    5859    $pagingString = "<div id='wp_page_numbers'><ul>"; // builds output 
     
    7374 
    7475    // displays lowest to highest page 
    75     for($i=$min_page; $i<$max_page; $i++)  
     76    for($i=$min_page; $i<=$max_page; $i++)  
    7677        $pagingString.= ($current_page == $i) ?  
    7778            sprintf("<li class='active_page'><a>%u</a></li>\n",$i) :     
Note: See TracChangeset for help on using the changeset viewer.