Login   Register  
PHP Classes
elePHPant
Icontem

File: example2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Mike Rosas  >  Webon Pgindx  >  example2.php  >  Download  
File: example2.php
Role: Example script
Content type: text/plain
Description: example2
Class: Webon Pgindx
Generate links to browse listings split in pages
Author: By
Last change:
Date: 6 years ago
Size: 1,780 bytes
 

Contents

Class file image Download
<?php


extract
($_REQUEST); // extracts my $pg var

if(!$pg$pg=1;

include_once(
"webon_pgindx.class.php");

$pager = new webon_pgindx();

$pager->epp 11;
$pager->ppv 13;

$pager->set(167);

$pager->pgindx($pg);

$values array_fill($pager->firstp$pager->lastp"?pg=%pg%");
$html $pager->get_html($values);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
body{
    margin: 10;
    font-family:tahoma,arial,verdana,sans-serif;
    font-size:62.5%;
    color:#333;
    line-height:1.8em;
    background: #ededed url(imagenes/fondo.png) top repeat-x;
}


#pager{
    widht: auto;
    height: 30px;
    padding: 5px 0 5px 5px;
    margin: 0 0 10px 0;
    border: 1px solid #ddd;
    color: #000;
}

#pager #page a{
    display: block;
    width: 20px;
    padding: 5px;
    border: 1px solid #ddd;
    color: #000;
    font-weight: bold;
    float: left;
    margin: 0 5px 0 0;
    text-align: center;
    text-decoration: none;
}

#pager #page a:hover{
    background-color: #ddd;
}

#pager #page a.on{
    display: block;
    width: 20px;
    padding: 5px;
    border: 1px solid #ddd;
    color: #eee;
    background-color: #333;
    font-weight: bold;
    float: left;
    margin: 0 5px 0 0;
    text-align: center;
    text-decoration: none;
}

pre{
    font-size: 14px;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>WebOn Page Index'er</title>
</head>

<body>
<br>
<?php 

echo $html

for(
$i=$pager->firste$i<=$pager->laste$i++){
    echo 
"Elements $i<br>";
}

echo 
"<pre>";
print_r ($pager->by_array());
echo 
"</pre>";
?>
<br>
<a href='readme.htm'>Back to readme</a>
</body>
</html>