summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authormatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-05-23 18:58:26 +0200
committermatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-05-23 18:58:26 +0200
commita39955b0135f89ef41e583346fd459934a652025 (patch)
treeeb682c076666a08ddff95b654f79b64d07b814b7 /inc/html.php
parenta2021ad8be2c99855e491f4a6c368687425daf06 (diff)
downloadrpg-a39955b0135f89ef41e583346fd459934a652025.tar.gz
rpg-a39955b0135f89ef41e583346fd459934a652025.tar.bz2
history navigation buttons
This patch adds a 'next' and a 'previous' button to the history page. They make it possible to see more than one page of history data. darcs-hash:20050523165826-7ef76-77a2c21e8b172200f169e0aea8441e8b100ab278.gz
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php29
1 files changed, 26 insertions, 3 deletions
diff --git a/inc/html.php b/inc/html.php
index 370754c52..c9b1539f1 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -447,14 +447,22 @@ function html_revisions(){
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function html_recent(){
+function html_recent($first=0){
global $conf;
global $lang;
- $recents = getRecents(0,true);
+ $recents = getRecents(-1,true);
+
+ if($first >= count($recents)) $first = 0;
+ $last = $first + $conf['recent'];
+ if ($last > count($recents))
+ $last = count($recents);
print p_locale_xhtml('recent');
print '<ul>';
- foreach(array_keys($recents) as $id){
+
+ $keys = array_keys($recents);
+ for ($n=$first; $n < $last; $n++){
+ $id = $keys[$n];
$date = date($conf['dformat'],$recents[$id]['date']);
print '<li>';
@@ -482,6 +490,21 @@ function html_recent(){
print '</li>';
}
print '</ul>';
+
+ print '<div class="pagenav">';
+ if ($first > 0) {
+ $first -= $conf['recent'];
+ if ($first < 0) $first = 0;
+ print '<div class="pagenav-prev">';
+ print html_btn('prevpage','',"p",array('do' => 'recent', 'first' => $first));
+ print '</div>';
+ }
+ if ($last < count($recents)) {
+ print '<div class="pagenav-next">';
+ print html_btn('nextpage','',"n",array('do' => 'recent', 'first' => $last));
+ print '</div>';
+ }
+ print '</div>';
}
/**