From 046d70fe607ea88b9a571b417f0f7057e3062fa1 Mon Sep 17 00:00:00 2001 From: Jams H Thompson Date: Sun, 11 Feb 2007 00:24:44 +0000 Subject: pagination fixes --- list_pages.php | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'list_pages.php') diff --git a/list_pages.php b/list_pages.php index c307c2c..1181127 100644 --- a/list_pages.php +++ b/list_pages.php @@ -1,6 +1,6 @@ assign_by_ref('offset', $offset); @@ -114,25 +114,11 @@ $gContent = new BitPage(); $gBitSmarty->assign_by_ref( "gContent", $gContent ); $sort_mode = preg_replace( '/^user_/', 'creator_user_', $sort_mode ); $listpages = $gContent->getList( $offset, $max_records, $sort_mode, $find, NULL, TRUE, FALSE, FALSE, $find_author, $find_last_editor ); -// If there're more records then assign next_offset -$cant_pages = ceil($listpages["cant"] / $max_records); -$gBitSmarty->assign_by_ref('cant_pages', $cant_pages); -$gBitSmarty->assign_by_ref('pagecount', $listpages['cant']); -$gBitSmarty->assign('actual_page', 1 + ($offset / $max_records)); -if ($listpages["cant"] > ($offset + $max_records)) { - $gBitSmarty->assign('next_offset', $offset + $max_records); -} else { - $gBitSmarty->assign('next_offset', -1); -} -// If offset is > 0 then prev_offset -if ($offset > 0) { - $gBitSmarty->assign('prev_offset', $offset - $max_records); -} else { - $gBitSmarty->assign('prev_offset', -1); -} +$gContent->postGetList($listpages); + -$gBitSmarty->assign_by_ref('listpages', $listpages["data"]); -//print_r($listpages["data"]); +$gBitSmarty->assign_by_ref( 'listpages', $listpages["data"] ); +$gBitSmarty->assign_by_ref( 'listInfo', $listpages['listInfo'] ); // Display the template $gBitSystem->display( 'bitpackage:wiki/list_pages.tpl', tra( 'Wiki Pages' ) ); -- cgit v1.3