summaryrefslogtreecommitdiff
path: root/list_pages.php
diff options
context:
space:
mode:
authorJams H Thompson <jht001@users.sourceforge.net>2007-02-11 00:24:44 +0000
committerJams H Thompson <jht001@users.sourceforge.net>2007-02-11 00:24:44 +0000
commit046d70fe607ea88b9a571b417f0f7057e3062fa1 (patch)
tree1ce1cc58668a41b1f60d08f5165a644a01f4040f /list_pages.php
parent949edceb36ab437ced617f498428ef6f7e358051 (diff)
downloadwiki-046d70fe607ea88b9a571b417f0f7057e3062fa1.tar.gz
wiki-046d70fe607ea88b9a571b417f0f7057e3062fa1.tar.bz2
wiki-046d70fe607ea88b9a571b417f0f7057e3062fa1.zip
pagination fixes
Diffstat (limited to 'list_pages.php')
-rw-r--r--list_pages.php30
1 files changed, 8 insertions, 22 deletions
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 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_wiki/list_pages.php,v 1.13 2007/01/29 05:42:11 jht001 Exp $
+ * $Header: /cvsroot/bitweaver/_bit_wiki/list_pages.php,v 1.14 2007/02/11 00:24:44 jht001 Exp $
*
* Copyright (c) 2004 bitweaver.org
* Copyright (c) 2003 tikwiki.org
@@ -8,7 +8,7 @@
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: list_pages.php,v 1.13 2007/01/29 05:42:11 jht001 Exp $
+ * $Id: list_pages.php,v 1.14 2007/02/11 00:24:44 jht001 Exp $
* @package wiki
* @subpackage functions
*/
@@ -86,8 +86,8 @@ if (!isset($_REQUEST["offset"])) {
} else {
$offset = $_REQUEST["offset"];
}
-if (isset($_REQUEST['page'])) {
- $page = &$_REQUEST['page'];
+if (isset($_REQUEST['list_page'])) {
+ $page = &$_REQUEST['list_page'];
$offset = ($page - 1) * $max_records;
}
$gBitSmarty->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' ) );