summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2008-03-23 12:09:56 +0000
committerLester Caine <lester@lsces.co.uk>2008-03-23 12:09:56 +0000
commit786fb119446f7f5b611195d168b5f9551824d120 (patch)
treeb6d8319cc6beed0f13b07880ae1b173da2b1fbb1 /index.php
parentae113384d086b2c889de316eae3d3c56261bc010 (diff)
downloadusers-786fb119446f7f5b611195d168b5f9551824d120.tar.gz
users-786fb119446f7f5b611195d168b5f9551824d120.tar.bz2
users-786fb119446f7f5b611195d168b5f9551824d120.zip
Tidy user content list pagination
Diffstat (limited to 'index.php')
-rw-r--r--index.php20
1 files changed, 6 insertions, 14 deletions
diff --git a/index.php b/index.php
index 01d5641..d18b9a7 100644
--- a/index.php
+++ b/index.php
@@ -1,8 +1,8 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_users/index.php,v 1.27 2008/03/22 19:55:23 jht001 Exp $
+ * $Header: /cvsroot/bitweaver/_bit_users/index.php,v 1.28 2008/03/23 12:09:56 lsces Exp $
*
- * $Id: index.php,v 1.27 2008/03/22 19:55:23 jht001 Exp $
+ * $Id: index.php,v 1.28 2008/03/23 12:09:56 lsces Exp $
* @package users
* @subpackage functions
*/
@@ -55,38 +55,30 @@ if( !empty( $_REQUEST['home'] ) && $gQueryUser->isValid() && (( $gBitUser->hasPe
$browserTitle = $userHomeTitle;
if( $gBitUser->hasPermission( 'p_liberty_list_content' ) ) {
+
// some content specific offsets and pagination settings
if( !empty( $_REQUEST['sort_mode'] ) ) {
$content_sort_mode = $_REQUEST['sort_mode'];
- $gBitSmarty->assign( 'sort_mode', $content_sort_mode );
}
$max_content = $gBitSystem->getConfig( 'max_records' );
- $offset_content = !empty( $_REQUEST['offset'] ) ? $_REQUEST['offset'] : 0;
- $gBitSmarty->assign( 'curPage', $page = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : 1 );
- $offset_content = ( $page - 1 ) * $gBitSystem->getConfig( 'max_records' );
// set the user_id to only display content viewing user
- $_REQUEST['user_id'] = $gBitUser->mUserId;
$_REQUEST['user_id'] = $gQueryUserId;
$gBitSmarty->assign( 'user_id', $gQueryUserId);
// now that we have all the offsets, we can get the content list
include_once( LIBERTY_PKG_PATH.'get_content_list_inc.php' );
- // calculate page number
- $numPages = ceil( $contentList['cant'] / $gBitSystem->getConfig( 'max_records' ) );
- $gBitSmarty->assign( 'numPages', $numPages );
-
//$gBitSmarty->assign_by_ref('offset', $offset);
$gBitSmarty->assign( 'contentSelect', $contentSelect );
$gBitSmarty->assign( 'contentTypes', $contentTypes );
$gBitSmarty->assign( 'contentList', $contentList['data'] );
- $gBitSmarty->assign( 'contentCount', $contentList['cant'] );
// needed by pagination
- $contentList['listInfo']['parameters']['content_type_guid'] = $contentSelect;
- $contentList['listInfo']['parameters']['user_id'] = $gQueryUserId;
+ $contentList['listInfo']['ihash']['content_type_guid'] = $contentSelect;
+ $contentList['listInfo']['ihash']['user_id'] = $gQueryUserId;
+ $contentList['listInfo']['ihash']['find_objects'] = $contentList['listInfo']['find'];
$gBitSmarty->assign( 'listInfo', $contentList['listInfo'] );
$gBitSmarty->assign( 'display_content_list', 1 );