Location: PHPKode > scripts > PaginationClass > paginationclass/index.php
<?php
/**
* index.php
* This is an example with just 1 template, "main" in our case.
*
* @package cls_pagination
* @author Elteto Zoltan
* @copyright Copyright GrafxSoftware (c) 2006
* @version $Id: index.php,v 1.6 2006/02/22 14:53:41 zelteto Exp $
*/

include_once("./language/en.inc.php");
include_once("./includes/cls_fast_template.php");
include_once("./includes/cls_pagination.php");

// VARIABLES:
// item would be the index in the pagination but even in the
// database filterring.
$item = (int)$_GET["item"];
// number_items is the LIMIT variable - ex: LIMIT $item,$number_items
$number_items = 15;
// $number_pages is the number of page numbers shown at one iteration
$number_pages = 6;

/**
* THIS PART IS FOR DB QUERING AND DATA DYSPLAY!!
*/
// this is a DB variable and has value based on the query we do in DB
$total_items = 100;
// Define the template
$page = new FastTemplate("./programtemplates");
$page->define(array("main" => "index_templ.html"));
// Pagination and their settings.
$pagi = new Pagination();

$pagi->setNumberItems($number_items);
$pagi->setNumberPages($number_pages);
$pagi->setType(0);
// We have only 1 temnplate "main" so we use that.
$pagi->setTemplate("main");
// This is the url we want to use in the iteration
// Please be aweare of the other get variables that need to be kept.
$pagi->setUrl("index.php?item=");

// Lets rock :)
$pagi->make($total_items, $item, $page);


// FastTemplate stuff
$page->multiple_assign("s_");
$page->multiple_assign("conf_");
$page->multiple_assign_define("LANG_");
$page->parse("BODY", array("main"));
$page->FastPrint();

$page->clear_all();

?>
Return current item: PaginationClass