Examples of PaginateIt Usage

Flickr

< Prev 1 2 3 4 5 6 7 Next >
<div class="flickr">
    <?php
    $PaginateIt =& new PaginateIt();
    $PaginateIt->SetItemsPerPage(10); // items to display on each page
    $PaginateIt->SetItemCount(200); // number of total items
    $PaginateIt->SetPaginationMode('Slide');
    echo $PaginateIt->GetPageLinks('{p:&lt; Prev} {links:7: } {n:Next &gt;}');
    ?>
</div>
.flickr { float: left; clear: both; font-family: Arial; font-size: 1.1em;}
.flickr a,
.flickr span { float: left; margin-right: 0.1em; padding: 0.2em 0.5em; color: #06c; text-decoration: none; background-color: #fff; border: 1px solid #ddd;}
.flickr a:hover { color: #fff; background-color: #0063DC; border-color: #036;}
.flickr span { color: #999; border: 1px solid #ddd;}
.flickr span.paginateit_back,
.flickr span.paginateit_next { color: #aaa; border-width: 0;}
.flickr a.paginateit_back,
.flickr span.paginateit_back { margin-right: 20px;}
.flickr a.paginateit_next,
.flickr span.paginateit_next {     margin-left: 20px;}
.flickr .paginateit_current { color: #ff0084; font-size: 1.1em; font-weight: bold; background-color: transparent; border-width: 0;}

digg

« Previous 1 2 3 4 5 Next »
<div class="digg">
    <?php
    $PaginateIt =& new PaginateIt();
    $PaginateIt->SetItemsPerPage(10); // items to display on each page
    $PaginateIt->SetItemCount(200); // number of total items
    $PaginateIt->SetPaginationMode('Slide');
    echo $PaginateIt->GetPageLinks('{p:&laquo; Previous} {links:5: } {n:Next &raquo;}');
    ?>
</div>
.digg { float: left; clear: both; font-family: Arial;}
.digg a,
.digg span { float: left; margin-right: 0.1em; padding: 0.2em 0.5em; text-decoration: none; color: #06c; background-color: #fff; border: 1px solid #9aafe5;}
.digg a:hover { border-color: #2e6ab1;}
.digg span { color: #999; border: 1px solid #ddd;}
.digg .paginateit_current { font-weight: bold; color: #fff; background-color: #2e6ab1; border: 1px solid #2e6ab1;}
.digg a.paginateit_back,
.digg a.paginateit_next { font-weight: bold; color: #06c;}

vBulletin

Page 1 of 20:
< 1 2 3 4 5 >
<div class="vbulletin">
    <?php
    $PaginateIt = new PaginateIt();
    $PaginateIt->SetItemsPerPage(10); // items to display on each page
    $PaginateIt->SetItemCount(200); // number of total items
    $PaginateIt->SetPaginationMode('Slide');
    echo $PaginateIt->GetPageLinks('<div class="page_summary">Page {c} of {t}:</div>{p:&lt;} {links:5: } {n:&gt;}');
    ?>
</div>
.vbulletin { float: left; clear: both; padding: 1px 0 1px 1px; font-family: Verdana, Arial, sans-serif; background-color: #d1d1e1; border: 1px solid #0b198c;}
.vbulletin a,
.vbulletin span,
.vbulletin a.paginateit_back,
.vbulletin a.paginateit_next { float: left; padding: 0 .4em 1px .4em; color: #0b198c; line-height: 1.6em; text-decoration: none; background-color: #f5f5ff; border-right: 1px solid #d1d1e1;}
.vbulletin a:hover { color: #ff0000;}
.vbulletin span.paginateit_back,
.vbulletin span.paginateit_next { color: #999; border-right: 1px solid #ddd;}
.vbulletin .paginateit_current { color: #000; font-weight: bold; background-color: #e1e4f2;}
.vbulletin .page_summary { float: left; padding: 0 .4em 1px .4em; color: #fff; line-height: 1.6em; background-color: #738fbf; border-right: 1px solid #d1d1e1;}

Slide Mode

First « Back 12345 Next » Last
<div class="paginateit">
    <?php
    $PaginateIt =& new PaginateIt();
    $PaginateIt->SetItemsPerPage(10); // items to display on each page
    $PaginateIt->SetItemCount(200); // number of total items
    $PaginateIt->SetPaginationMode('Slide');
    echo $PaginateIt->GetPageLinks('{f:First} {p:&laquo; Back} {links:5: &bull; } {n:Next &raquo;} {l:Last}');
    ?>
</div>

Jump Mode

First « Back 12345 Next » Last
<div class="paginateit">
    <?php
    $PaginateIt =& new PaginateIt();
    $PaginateIt->SetItemsPerPage(10); // items to display on each page
    $PaginateIt->SetItemCount(200); // number of total items
    $PaginateIt->SetPaginationMode('Jump');
    echo $PaginateIt->GetPageLinks('{f:First} {p:&laquo; Back} {links:5: &bull; } {n:Next &raquo;} {l:Last}');
    ?>
</div>

Skip Mode

First « Back 12345 Next » Last
<div class="paginateit">
    <?php
    $PaginateIt =& new PaginateIt();
    $PaginateIt->SetItemsPerPage(10); // items to display on each page
    $PaginateIt->SetItemCount(200); // number of total items
    $PaginateIt->SetPaginationMode('Skip');
    echo $PaginateIt->GetPageLinks('{f:First} {p:&laquo; Back} {links:5: &bull; } {n:Next &raquo;} {l:Last}');
    ?>
</div>

Paginate An Array

Array
(
    [0] => a
)
First « Back 12345 Next » Last
<div class="paginateit">
    <?php
    $array = range('a','z'); // a random array
    
    $PaginateIt =& new PaginateIt();
    $PaginateIt->SetItemsPerPage(1); // items to display on each page
    $PaginateIt->SetItemCount(count($array)); // number of items in the array
    $PaginateIt->SetPaginationMode('slide');
    
    $collection = $PaginateIt->GetCurrentCollection($array); // returns the part of the array to display on the page
    echo '<pre>'; print_r($collection); echo '</pre>';
    
    echo $PaginateIt->GetPageLinks('{f:First} {p:&laquo; Back} {links:5: &bull; } {n:Next &raquo;} {l:Last}');
    ?>
</div>