$link = 'forum.php?id=' . htmlspecialchars($_GET['id']) . '&page={nr}';
?>
<table cellspacing="0" width="100%">
    <thead>
        <tr>
        <th align="left">Subject</th>
        <th class="center">Autor</th>
        <th class="center">Replies</th>
        <th>Date</th>
        </tr>
    </thead>
<tfoot>
    <tr>
    <td colspan="5">
        <span>Showing <?php 
echo $nav->info('{start} - {end} of {total}');
?>
 threads</span>
        <?php 
echo $nav->first(' <a href="' . $link . '">First</a> ', ' <strong>First</strong> ');
echo $nav->previous(' <a href="' . $link . '">&laquo;</a> ', ' <strong>&laquo;</strong> ');
echo $nav->numbers(' <a href="' . $link . '">{nr}</a> ', ' <strong>{nr}</strong> ');
echo $nav->next(' <a href="' . $link . '">&raquo;</a> ', ' <strong>&raquo;</strong> ');
echo $nav->last(' <a href="' . $link . '">Last</a> ', ' <strong>Last</strong> ');
?>
        </td>
    </tr>
</tfoot>
<tbody>
<?php 
foreach ($topics as $topic) {
<?php

include 'config.php';
$max = 6;
$select = "SELECT * FROM test";
$query1 = mysql_query($select) or die(mysql_error());
$total = mysql_num_rows($query1);
$nav = new Pagination($max, $total);
$nav->page = $_GET['p'];
$query2 = mysql_query($select . " LIMIT " . $nav->start() . "," . $max) or die(mysql_error());
while ($item = mysql_fetch_object($query2)) {
    echo $item->id . ' - <b>' . $item->name . '</b><br />';
}
$nav->url = 'alloptions.php?p=';
echo $nav->first(' <a href="{url}{nr}"><<</a> | ', ' << | ');
echo $nav->previous(' <a href="{url}{nr}">Previous</a> | ', ' Previous | ');
echo $nav->numbers(' <a href="{url}{nr}">{nr}</a> | ', ' <b>{nr}</b> | ');
echo $nav->next(' <a href="{url}{nr}">Next</a> | ', ' Next | ');
echo $nav->last(' <a href="{url}{nr}">>></a> | ', ' >> | ');
echo $nav->info('Result {start} to {end} of {total} - ');
echo $nav->info('Page {page} of {pages} ');
Esempio n. 3
0
<?php

include 'config.php';
$max = 6;
$select = "SELECT * FROM test";
$query1 = mysql_query($select) or die(mysql_error());
$total = mysql_num_rows($query1);
$nav = new Pagination($max, $total);
$query2 = mysql_query($select . " LIMIT " . $nav->start() . "," . $max) or die(mysql_error());
while ($item = mysql_fetch_object($query2)) {
    echo $item->id . ' - <b>' . $item->name . '</b><br />';
}
$link = 'dutch.php?p=';
//echo $nav->first(' <a href="'.$link.'{nr}">First</a> | ');
echo $nav->previous(' <a href="' . $link . '{nr}">Vorige</a> | ');
echo $nav->numbers(' <a href="' . $link . '{nr}">{nr}</a> | ', ' <b>{nr}</b> | ');
echo $nav->next(' <a href="' . $link . '{nr}">Volgende</a> | ');
//echo $nav->last(' <a href="'.$link.'{nr}">Last</a>');
echo $nav->info('Pagina {page} van de {pages} ');
	margin-left:10px;
	text-decoration:none;
	background-color:#F5F5F5;
	color:#D7D7D7;
	cursor:default;
}
#embed {
padding-top:7px;
}
</style>

Note: This CSS design is freely available here:<a href="http://www.thewebhelp.com/css/pagination-style-template/">Pagination Style Template</a><br />
And does not belong to me. All credit for the design goes to this author.<br />
<br />
<?php 
include 'config.php';
$max = 6;
$select = "SELECT * FROM test";
$query1 = mysql_query($select) or die(mysql_error());
$total = mysql_num_rows($query1);
$nav = new Pagination($max, $total);
$query2 = mysql_query($select . " LIMIT " . $nav->start() . "," . $max) or die(mysql_error());
while ($item = mysql_fetch_object($query2)) {
    echo $item->id . ' - <b>' . $item->name . '</b><br />';
}
$link = 'customdesign.php?p=';
echo '<div id="tnt_pagination">';
echo $nav->first('<a href="' . $link . '{nr}">First</a>') . $nav->previous('<a href="' . $link . '{nr}">&laquo; prev</a>');
echo $nav->numbers('<a href="' . $link . '{nr}">{nr}</a>', '<span class="active_tnt_link">{nr}</span>');
echo $nav->next('<a href="' . $link . '{nr}">Next &raquo;</a>') . $nav->last('<a href="' . $link . '{nr}">Last</a>') . $nav->info('<br /><div id="embed"><span class="active_tnt_link">Result {start} to {end} of {total}</span>') . $nav->info('<span class="active_tnt_link">Page {page} of {pages}</span></div>');
echo '</div>';