Page 1 of 1

PageLite - PHP Pagination Pagination System

Posted: Thu Nov 06, 2008 2:41 pm
by ioan1k
Heres a pagination system I wrote, I use it personally within the Zend Framework.
I am in the process of implementing a Plugin System and a database query builder ( still will keep the PHP only support but simply build a SQL query based off the information given and return it )

Tell me what you think and some possiable improvements

Description

PageLite is a extremely light weight, portable and simple to use
pagiation system.

It is built using strict OOP technology and standards and runs
completely based off of PHP code, which means it does not require a connection to a database to run.

It supports both mod_rewrite and regular style links.

PageLite is compatible with any and all Data storing method
wether it is a MySQL Server or a old-skool flat-file datastore
PageLite can built a pagination for it.

Pagelite only requires 3 lines of code to run ( 2 lines if you use php's autoload function ) and will build and return
information that you can put into your information query retrieval method.

The goal of PageLite is to provide a simple, easy to use and powerful
pagiation system for everyone and a flexiable and extendable system
for advanced users.

PageLite once run will automatically build a default page set configuration, and only requries two parameters to run the total number of items that are being seperated into pages and the URL link for the pages.
PageLite will build and return a complete Pagination with forward, backwards, next, backward jumping, forward jumping, first, and last page links.
Pagelites ouput processing method is completely customizable and can be manipulated to display the page results in any desired format, allowing you to make a customized look and feel to your class.

Pagelite is independent and can support an unlimited number of pagination outputs on a page with advanced option settings and new instances of the class.

PageLite does not support any kind of DB connection methods, it does however provide all information that is required to sort results such as the Start and Limit numbers for SQL Queries

Main File

Code: Select all

<?php
 
/*
 *******************************************************
 *   PageLite Pagiation System                         #
 *******************************************************
 *
 * PageLite is a extremely light weight, portable and simple to use
 * pagiation system.
 *
 * It is built using strict OOP technology and standards and runs
 * completely based off of PHP code, which means there is no
 * Database communication required.
 *
 * PageLite is compatiable with any and all Data storing method
 * wether it is a MySQL Server or a old-skool flat-file datastore
 * PageLite can built a pagination for it.
 *
 * Pagelite only requires 2 lines of code to run and will build and return
 * information that you can put into your information query retrieval method.
 *
 * The goal of PageLite is to provide a simple, easy to use and powerful
 * pagiation system for everyone and a flexiable and extendable system
 * for advanced users
 *
 * If you would like to thank me for pageLite shoot me an email.
 *
 * Have Fun and happy coding!
 *
 * @copyright Copyright (c) Nickolas Whiting, 2008
 * @license GNU/GPL
 * @author Nickolas Whiting <nwhiting@xstudiosinc.com>
 * @version 1.0
 *
 * @todo Intergrate Plugin System
 */
 
class Page_Lite
{
    /*
     * Total Number of items that are being sorted by the SQL Query
     *
     * @access protected
     */
 
    protected $_totalItems = null;
 
    /*
     * Url Link that will be used for pagination
     *
     * @access protected
     */
 
    protected $_pagiUrl = null;
 
    /*
     * Total Number of items per page
     *
     * @access protected
     */
 
    protected $_perPage = 10;
 
    /*
     * Total Number of lines to display half on each side of current page
     *
     * @access protected
     */
 
    protected $_range = 5;
 
    /*
     * Use mod_rewrite style links
     *
     * @access protected
     */
 
    protected $_rewrite = false;
 
    /*
     * Use page Jumping links ( 3, 7, 13, 25 )
     *
     * @access protected
     */
 
    protected $_pageJump = true;
 
    /*
     * Total Number of jumps to perform per side
     *
     * @access protected
     */
 
    protected $_jumpCount = 5;
 
    /*
     * Calculation number for a jump link ( currentPageLink * number = jumpLink)
     *
     * Lower numbers are recommended for foward jumping Anything over 1.25 will cause the links to jump
     * at a very high rate
     *
     * @access protected
     */
 
    protected $_jumpCalcFoward = 1.15;
 
    /*
     * Calculation number for a jump link ( currentPageLink * number = jumpLink)
     *
     * Lower numbers are not recommended for backwards jumping Anything under 1.25 will cause the links allmost to completely not jump
     *
     * @access protected
     */
 
    protected $_jumpCalcBackward = 1.25;
 
    /*
     * GET Variable that the current page number is stored in
     *
     * @access protected
     */
 
    protected $_pageIdentifer = 'page';
 
    /*
     * Automatically extract the page number based on the pageIdenitifer
     *
     * @access protected
     */
 
    protected $_useAutoIdentifier = true;
 
    /*
     * Total Number of pages based on totalItems / perPage
     *
     * @access public
     */
 
    public $totalPages = null;
 
    /*
     * Styleization Array
     *
     * @access public
     * @static
     */
 
    public static $styleArray = array(
                                      'start'         => '',
                                      'end'           => '',
                                      'first_start'   => '',
                                      'first_end'     => '',
                                      'last_start'    => '',
                                      'last_end'      => '',
                                      'current_start' => '',
                                      'current_end'   => '',
                                      'link_start'    => '',
                                      'link_end'      => '',
                                      'next_start'    => '',
                                      'next_end'      => '',
                                      'prev_start'    => '',
                                      'prev_end'      => ''
                                      );
 
    /*
     * Current Page
     *
     * @access protected
     */
 
    public $currentPage = null;
 
    /*
     * Option to show the link to the first page results
     *
     * @access protected
     */
 
    protected $_displayLinkFirst = true;
 
    /*
     * Option to show link for the previous page results
     *
     * @access protected
     */
 
    protected $_displayLinkPrev = true;
 
    /*
     * Option to show the link to the last page results
     *
     * @access protected
     */
 
    protected $_displayLinkLast = true;
 
    /*
     * Option to show the link to the next page results
     *
     * @access protected
     */
 
    protected $_displayLinkNext = true;
 
    /*
     * Text to be displayed for page 1 link
     *
     * @access protected
     */
 
    public $linkPageOne = '[&laquo;]';
 
    /*
     * Text to be displayed for prev page link
     *
     * @access protected
     */
 
    public $linkPagePrev = '&laquo;';
 
    /*
     * Text to be displayed for Last page link
     *
     * @access protected
     */
 
    public $linkPageLast = '[&raquo;]';
 
    /*
     * Text to be displayed for next page link
     *
     * @access protected
     */
 
    public $linkPageNext = '&raquo;';
 
    /*
     * Constructor
     *
     * Set the total number of items and the pageURL, also check for pageIdentifier and try and get current page number
     * if not set
     *
     * @access protected
     */
 
    public function __construct($totalItems, $pagiUrl)
    {
        $this->setTotalItems($totalItems);
 
        $this->setPageUrl($pagiUrl);
    }
 
    /*
     * Sets option to display 1st page link
     */
 
    public function setDisplayLinkFirst($flag)
    {
        $this->_displayLinkFirst = $flag;
    }
 
    /*
     * Sets option to display Prev Page link
     */
 
    public function setDisplayLinkPrev($str)
    {
        $this->_displayLinkPrev = $str;
    }
 
    /*
     * Sets option to display Last page link
     */
 
    public function setDisplayLinkLast($flag)
    {
        $this->_displayLinkLast = $flag;
    }
 
    /*
     * Sets option to display Next page link
     */
 
    public function setDisplayLinkNext($str)
    {
        $this->_displayLinkNext = $flag;
    }
 
    /*
     * Sets text that will be displayed for 1st page link
     */
 
    public function setLinkFirst($str)
    {
        $this->linkPageOne = $str;
    }
 
    /*
     * Sets text that will be displayed for next page link
     */
 
    public function setLinkNext($str)
    {
        $this->linkPageNext = $str;
    }
 
    /*
     * Sets text that will be displayed for last page link
     */
 
    public function setLinkLast($str)
    {
        $this->linkPageLast = $str;
    }
 
    /*
     * Sets text that will be displayed for prev page link
     */
 
    public function setLinkPrev($str)
    {
        $this->linkPagePrev = $str;
    }
 
    /*
     * Sets the pageIdentifier
     *
     * @access protected
     */
 
    public function setIdentifier($str)
    {
        $this->_pageIdentifer = $str;
    }
 
    /*
     * Sets the current Page
     *
     * @access protected
     */
 
    public function setCurrentPage($int)
    {
        $this->currentPage = $int;
    }
 
    /*
     * Register the AutoIdentifier on|off
     *
     * @access protected
     */
 
    public function setAutoIdentifier($flag)
    {
        $this->_useAutoIdentifier = $flag;
    }
 
    /*
     * Sets the style that will be used to parse out the pagination
     *
     * @access public
     */
 
    public function setStyleArray($style)
    {
        $this->styleArray = $style;
    }
 
 
    /*
     * Checks and returns if the page number
     *
     * @access public
     */
 
    public function getCurrentPage()
    {
        // Check if auto identify is disabled if so we dont worry if the page count is correct
        if ( $this->_useAutoIdentifier == false )
        {
            return $this->currentPage;
        }
        else
        {
 
            if ($_GET[$this->_pageIdentifer])
            {
                $this->currentPage = (int) $_GET[$this->_pageIdentifer];
 
                return (int) $_GET[$this->_pageIdentifer];
            }
            else
            {
                $this->currentPage = 1;
                return 1;
            }
        }
    }
 
    /*
     * Set the page range
     * @access public
     */
 
    public function setRange($count)
    {
        $this->_range = $count;
    }
 
    /*
     * Sets the number of jump Links
     * @access public
     */
 
    public function setPageJumpCount($count)
    {
        $this->_jumpCount = $count;
    }
 
    /*
     * Set page jumping on|off
     * @access public
     */
 
    public function setPageJump($flag)
    {
        $this->_pageJump = $flag;
    }
 
    /*
     * Sets the use of mod_rewrite style links
     * @access public
     */
 
    public function setRewrite($flag)
    {
        $this->_rewrite = $flag;
    }
 
    /*
     * Sets the total number of items
     *
     * @access public
     */
 
    public function setTotalItems($int)
    {
        $this->_totalItems = $int;
    }
 
    /*
     * Sets the Jump Forward Calculator
     *
     * @access public
     */
 
    public function setJumpCalForward($int)
    {
        $this->_jumpCalcFoward = $int;
    }
 
    /*
     * Sets the Jump Forward Calculator
     *
     * @access public
     */
 
    public function setJumpCalBackward($int)
    {
        $this->_jumpCalcBackward = $int;
    }
 
    /*
     * Sets the pageUrl
     *
     * @access public
     */
 
    public function setPageUrl($url)
    {
        $this->_pagiUrl = $url;
    }
 
    /*
     * Sets the number of items per page
     *
     * @access public
     */
 
    public function setPerPage($int)
    {
        $this->_perPage = $int;
    }
 
    /*
     * Returns the number of items that are displayed per page
     *
     * @access public
     */
 
    public function getPerPage()
    {
        return $this->_perPage;
    }
 
    public function getStart()
    {
        return ($this->getCurrentPage() == 1) ? 0 : $this->getCurrentPage() * $this->getPerPage();
    }
 
    /*
     * Calculates the total number of pages based on the totalItems and Perpage
     *
     * @access public
     */
 
    public function calculatePageTotal()
    {
        return $this->totalPages = floor( ($this->_totalItems) / ($this->_perPage) );
    }
 
    /*
     * Returns the total number of pages
     *
     * @access public
     * @return int
     */
 
    public function getTotalPages()
    {
        return $this->calculatePageTotal();
    }
 
    /*
     * Build the pagination
     *
     * @access public
     * @return string
     */
 
    public function build()
    {
 
        $return = '';
 
        $back = '';
 
        // Figure out the total number of pages. Always round up <!-- s:) --><img src=\"{SMILIES_PATH}/icon_smile.gif\" alt=\":)\" title=\"Smile\" /><!-- s:) -->>
        $totalPages = $this->getTotalPages();
 
        $range = ceil($this->_range / 2);
 
        $jumpRange = ceil($this->_jumpCount / 2);
 
        $return .= $this->styleArray['start'];
 
        $currentPage = $this->getCurrentPage();
 
        if ($this->_rewrite == true)
        {
            $append = '/';
        }
        elseif ( strpos($this->_pagiUrl, '?') === false )
        {
            $append = '?'.$this->_pageIdentifer.'=';
        }
        else
        {
            $append = '&'.$this->_pageIdentifer.'=';
        }
 
        if ($currentPage != 1 && $this->_displayLinkFirst == true)
        {
            $return .= $this->styleArray['first_start'].' <a href="'.$this->_pagiUrl.$append.'1" title="Go to page 1  of '.$totalPages.'">'.$this->linkPageOne.'</a>'.$this->styleArray['first_end'];
        }
 
        if ($currentPage > 1 && $this->_displayLinkPrev == true)
        {
            $prev = ($currentPage - 1);
            $return .= $this->styleArray['prev_start'].'  <a href="'.$this->_pagiUrl.$append.$prev.'" title="Go to page '.$prev.' of '.$totalPages.'">'.$this->linkPagePrev.'</a>  '.$this->styleArray['prev_end'];
        }
 
        // Build Backward Links
        for ($i = 1; $i <= $range; $i++)
        {
            $p = $currentPage - $i;
            if ($p > 0)
            {
                $back .= $p.',';
            }
        }
 
        $lastBack = $currentPage - $range - 1;
 
        // Backwards Jumps!
 
        // 1.2 Update
        // When jumping backwards we need to use floor....not ceil.....
 
        if ($lastBack > 2 && $this->_pageJump == true)
        {
            for ($i = 1; $i <= $jumpRange; $i++)
            {
 
                $lastBack = floor($lastBack / $this->_jumpCalcBackward);
 
                if ($lastBack >= 2)
                {
                    $back .= $lastBack . ',';
                }
            }
        }
 
        $back = strrev($back);
 
        $backJump = explode(',', $back);
 
 
        foreach ($backJump as $rev)
        {
            if( $rev != null )
            {
                $rev = strrev($rev);
                $return .= $this->styleArray['link_start'].'  <a href="'.$this->_pagiUrl.$append.$rev.'" title="Go to page '.$rev.' of '.$totalPages.'">'.$rev.'</a> '.$this->styleArray['link_end'];
            }
        }
 
        $return .=  $this->styleArray['current_start'].''.$currentPage.'</span> '.$this->styleArray['current_end'];
 
 
        for ($i = 1; $i <= $range; $i++)
        {
 
            $p = $currentPage + $i;
            if($p <= $totalPages)
            {
                $return .= $this->styleArray['link_start'].' <a href="'.$this->_pagiUrl.$append.$p.'" title="Go to page '.$p.' of '.$totalPages.'">'.$p.'</a> '.$this->styleArray['link_end'];
            }
        }
 
        $lastPage = $currentPage + $range;
 
        if ($this->_pageJump == true)
        {
            for ($i = 1; $i <= $jumpRange; $i++)
            {
                $lastPage = ceil($lastPage * $this->_jumpCalcFoward);
 
                if ($lastPage <= $totalPages)
                {
 
                    $return .= $this->styleArray['link_start'].' <a href="'.$this->_pagiUrl.$append.$lastPage.'" title="Go to page '.$lastPage.' of '.$totalPages.'">'.$lastPage.'</a> '.$this->styleArray['link_end'];
                }
            }
        }
 
        // Build Next Link
        if ($currentPage < $totalPages && $totalPages != '0' && $this->_displayLinkNext == true)
        {
            $next = $currentPage + 1;
            $return .= $this->styleArray['next_start'].' <a href="'.$this->_pagiUrl.$append.$next.'" title="Go to page '.$next.' of '.$totalPages.'">'.$this->linkPageNext.'</a> '.$this->styleArray['next_end'];
        }
 
        if ($currentPage != $totalPages && $totalPages != '0' && $this->_displayLinkLast == true)
        {
            $return .= $this->styleArray['last_start'].'<a href="'.$this->_pagiUrl.$append.$totalPages.'" title="Go to page '.$totalPages.' of '.$totalPages.'">'.$this->linkPageLast.'</a>'.$this->styleArray['last_end'];
        }
 
        $return .= $this->styleArray['end'];
 
        return  $return;
    }
}
 
 
?>
Example

Code: Select all

<style>
.pagination
{
    font-size: 13px;
    font-family: Georgia;
    color: #000;
}
 
.pagination a
{
    text-decoration: none;
}
</style>
<?php
 
require 'backups/pagelite.php';
 
// Simple Usage
$pageLite = new Page_Lite(50, 'example.php');
 
echo 'Simple Output <br />';
echo $pageLite->build();
 
// Advanced Usage
 
$pageLiteAdv = new Page_Lite(75, 'example.php');
 
// Config Options
$pageLiteAdv->setAutoIdentifier(true);
$pageLiteAdv->setIdentifier('p');
$pageLiteAdv->setPerPage(1);
$pageLiteAdv->setPageJumpCount(10);
$pageLiteAdv->setRange(5);
//$pageLiteAdv->setCurrentPage('125');
$pageLiteAdv->setStyleArray(array(
                                  'start' => '<div class="pagination">',
                                  'end'   => '<br /> You are current on page '.$pageLiteAdv->getCurrentPage().' of '.$pageLiteAdv->getTotalPages().'</div>',
                                  'first_start' => '<em>',
                                  'first_end' => '</em>',
                                  'current_start' => ' { <b>',
                                  'current_end' => '</b> } ',
                                  'next_start' => '<em>',
                                  'next_end' => '</em>',
                                  'prev_start' => '<span style="text-decoration: underline;">',
                                  'prev_end' => '</span>',
                                  'link_start' => ' [ ',
                                  'link_end' => ' ] ',
                                  'last_start' => '<em>',
                                  'last_end' => '</em>',));
$pageLiteAdv->setLinkFirst('Page 1');
$pageLiteAdv->setLinkLast('Go to Page '.$pageLiteAdv->getTotalPages());
$pageLiteAdv->setLinkPrev('Prev');
$pageLiteAdv->setDisplayLinkNext(false);
$pageLiteAdv->setDisplayLinkPrev(false);
 
 
echo '<br /><br />
Advanced Output <br />';
 
echo $pageLiteAdv->build();
 
// Example Database com with PageLite
$start = $pageLiteAdv->getStart();
$limit = $pageLiteAdv->getPerPage();
 
?>
 
Adv Results
Page 1 [ 4 ] [ 6 ] [ 8 ] [ 11 ] [ 14 ] [ 19 ] [ 20 ] [ 21 ] { 22 } [ 23 ] [ 24 ] [ 25 ] [ 29 ] [ 34 ] [ 40 ] [ 46 ] [ 53 ] Go to Page 75
You are current on page 22 of 75

Re: PageLite - PHP Pagination Pagination System

Posted: Thu Nov 06, 2008 4:40 pm
by ioan1k
Here is another example code with adv config.

Code: Select all

 
// Advanced Usage
 
$pageLiteAdv = new Page_Lite(10000, 'example.php');
 
// Config Options
$pageLiteAdv->setAutoIdentifier(true);
$pageLiteAdv->setIdentifier('p');
$pageLiteAdv->setPerPage(1);
$pageLiteAdv->setPageJump(true);
$pageLiteAdv->setPageJumpCount(75);
$pageLiteAdv->setJumpCalForward(1.10);
$pageLiteAdv->setJumpCalBackward(1.20);
$pageLiteAdv->setRange(10);
//$pageLiteAdv->setCurrentPage('125');
$pageLiteAdv->setStyleArray(array(
                                  'start' => '<div class="pagination">',
                                  'end'   => '<br /> Page '.$pageLiteAdv->getCurrentPage().' of '.$pageLiteAdv->getTotalPages().'</div>',
                                  'first_start' => '',
                                  'first_end' => ' ... ',
                                  'current_start' => ' [ ',
                                  'current_end' => ' ] ',
                                  'next_start' => '',
                                  'next_end' => ' ... ',
                                  'prev_start' => ' ... ',
                                  'prev_end' => '',
                                  'link_start' => '',
                                  'link_end' => '',
                                  'last_start' => '',
                                  'last_end' => '',));
$pageLiteAdv->setLinkFirst('Page 1');
$pageLiteAdv->setLinkFirst('Start');
$pageLiteAdv->setLinkLast('End');
$pageLiteAdv->setLinkNext('');
$pageLiteAdv->setDisplayLinkPrev('');
 
echo $pageLiteAdv->build();
 
Outputs
Start ... 8 10 12 15 18 22 27 33 40 48 58 70 85 103 124 149 179 215 258 310 373 448 538 646 776 932 1119 1343 1612 1935 2322 2787 3345 4015 4819 5783 6940 8328 9995 9996 9997 9998 9999 [ 10000 ]
Page 10000 of 10000


Source Output

Code: Select all

[size=50]
<div class="pagination"> 
<a href="example.php?p=1" title="Go to page 1  of 10000">Start</a> ...   
<a href="example.php?p=8" title="Go to page 8 of 10000">8</a>   
<a href="example.php?p=10" title="Go to page 10 of 10000">10</a>   
<a href="example.php?p=12" title="Go to page 12 of 10000">12</a>   
<a href="example.php?p=15" title="Go to page 15 of 10000">15</a>  
 <a href="example.php?p=18" title="Go to page 18 of 10000">18</a>   
<a href="example.php?p=22" title="Go to page 22 of 10000">22</a>   
<a href="example.php?p=27" title="Go to page 27 of 10000">27</a>   
<a href="example.php?p=33" title="Go to page 33 of 10000">33</a>   
<a href="example.php?p=40" title="Go to page 40 of 10000">40</a>   
<a href="example.php?p=48" title="Go to page 48 of 10000">48</a>   
<a href="example.php?p=58" title="Go to page 58 of 10000">58</a>   
<a href="example.php?p=70" title="Go to page 70 of 10000">70</a>   
<a href="example.php?p=85" title="Go to page 85 of 10000">85</a>   
<a href="example.php?p=103" title="Go to page 103 of 10000">103</a> 
  <a href="example.php?p=124" title="Go to page 124 of 10000">124</a>  
 <a href="example.php?p=149" title="Go to page 149 of 10000">149</a>  
 <a href="example.php?p=179" title="Go to page 179 of 10000">179</a>  
 <a href="example.php?p=215" title="Go to page 215 of 10000">215</a>  
 <a href="example.php?p=258" title="Go to page 258 of 10000">258</a>  
 <a href="example.php?p=310" title="Go to page 310 of 10000">310</a>  
 <a href="example.php?p=373" title="Go to page 373 of 10000">373</a>   
<a href="example.php?p=448" title="Go to page 448 of 10000">448</a>  
 <a href="example.php?p=538" title="Go to page 538 of 10000">538</a> 
  <a href="example.php?p=646" title="Go to page 646 of 10000">646</a> 
  <a href="example.php?p=776" title="Go to page 776 of 10000">776</a>  
 <a href="example.php?p=932" title="Go to page 932 of 10000">932</a>   
<a href="example.php?p=1119" title="Go to page 1119 of 10000">1119</a>  
 <a href="example.php?p=1343" title="Go to page 1343 of 10000">1343</a> 
  <a href="example.php?p=1612" title="Go to page 1612 of 10000">1612</a>  
 <a href="example.php?p=1935" title="Go to page 1935 of 10000">1935</a>  
 <a href="example.php?p=2322" title="Go to page 2322 of 10000">2322</a> 
  <a href="example.php?p=2787" title="Go to page 2787 of 10000">2787</a>
   <a href="example.php?p=3345" title="Go to page 3345 of 10000">3345</a> 
  <a href="example.php?p=4015" title="Go to page 4015 of 10000">4015</a>  
 <a href="example.php?p=4819" title="Go to page 4819 of 10000">4819</a>   
<a href="example.php?p=5783" title="Go to page 5783 of 10000">5783</a>   
<a href="example.php?p=6940" title="Go to page 6940 of 10000">6940</a>  
 <a href="example.php?p=8328" title="Go to page 8328 of 10000">8328</a> 
  <a href="example.php?p=9995" title="Go to page 9995 of 10000">9995</a>
   <a href="example.php?p=9996" title="Go to page 9996 of 10000">9996</a>
   <a href="example.php?p=9997" title="Go to page 9997 of 10000">9997</a> 
  <a href="example.php?p=9998" title="Go to page 9998 of 10000">9998</a>  
 <a href="example.php?p=9999" title="Go to page 9999 of 10000">9999</a>  [ 10000</span>  ] 
<br /> Page 10000 of 10000</div>[/size]
 

Re: PageLite - PHP Pagination Pagination System

Posted: Sat Jan 10, 2009 11:00 am
by jason.carter
Thanks! Thats great!

Is there any quick way to limit the number of pages in the site.
Example if there are 100 pages then it will show
1.....100 (this can be too many pages numbers for the user)

Is it easy to change as
1, 2, 3, 4, 5, 6, 7, 8, 9, 10 More

When More is clicked it will show
from 11 to 20 etc

Re: PageLite - PHP Pagination Pagination System

Posted: Sat Jan 10, 2009 4:33 pm
by ioan1k
Yes that is very simple.....

I take it that would say you are on page 1.

You would set the Range to 10