Login   Register  
PHP Classes
elePHPant
Icontem

File: example1.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  >  example1.php  >  Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: example1
Class: Webon Pgindx
Generate links to browse listings split in pages
Author: By
Last change:
Date: 2008-07-15 12:38
Size: 1,702 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();

// i will use the default pre-configure

$pager->set(234);

$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

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