summaryrefslogtreecommitdiff
path: root/BitUser.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2006-09-12 20:20:26 +0000
committerChristian Fowler <spider@viovio.com>2006-09-12 20:20:26 +0000
commit8fd24e454514ded777f2fe5791a6be8f6018d2de (patch)
treec11bee4ddca61d26621777da5afe2676a8a9e090 /BitUser.php
parent45547dc46ff5efdf6fefb0759ed9e0a34525a22c (diff)
downloadusers-8fd24e454514ded777f2fe5791a6be8f6018d2de.tar.gz
users-8fd24e454514ded777f2fe5791a6be8f6018d2de.tar.bz2
users-8fd24e454514ded777f2fe5791a6be8f6018d2de.zip
add pagination to user_activity
Diffstat (limited to 'BitUser.php')
-rw-r--r--BitUser.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/BitUser.php b/BitUser.php
index 9c8bf67..8b3e5a4 100644
--- a/BitUser.php
+++ b/BitUser.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_users/BitUser.php,v 1.105 2006/09/12 19:26:48 spiderr Exp $
+ * $Header: /cvsroot/bitweaver/_bit_users/BitUser.php,v 1.106 2006/09/12 20:20:26 spiderr Exp $
*
* Lib for user administration, groups and permissions
* This lib uses pear so the constructor requieres
@@ -12,7 +12,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: BitUser.php,v 1.105 2006/09/12 19:26:48 spiderr Exp $
+ * $Id: BitUser.php,v 1.106 2006/09/12 20:20:26 spiderr Exp $
* @package users
*/
@@ -40,7 +40,7 @@ define("ACCOUNT_DISABLED", -6);
* Class that holds all information for a given user
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.105 $
+ * @version $Revision: 1.106 $
* @package users
* @subpackage BitUser
*/
@@ -1045,7 +1045,7 @@ vd( $this->mErrors );
}
/*shared*/
- function getUserActivity( $pListHash=NULL ) {
+ function getUserActivity( &$pListHash ) {
$bindVars = array();
if( empty( $pListHash['sort_mode'] ) ) {
$pListHash['sort_mode'] = 'last_get_desc';
@@ -1072,12 +1072,18 @@ vd( $this->mErrors );
FROM `".BIT_DB_PREFIX."users_cnxn` uc INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON (uc.`user_id`=uu.`user_id`)
WHERE uc.`user_id` IS NOT NULL $whereSql
ORDER BY ".$this->mDb->convert_sortmode( $pListHash['sort_mode'] );
- $result = $this->mDb->query($query, $bindVars, $pListHash['max_records'] );
+ $result = $this->mDb->query($query, $bindVars, $pListHash['max_records'], $pListHash['offset'] );
$ret = array();
while ($res = $result->fetchRow()) {
$res['users_information'] = $this->getPreference( 'users_information', 'public', $res['user_id'] );
$ret[] = $res;
}
+
+ $countSql = "SELECT COUNT( DISTINCT uc.`user_id` )
+ FROM `".BIT_DB_PREFIX."users_cnxn` uc INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON (uc.`user_id`=uu.`user_id`)
+ WHERE uc.`user_id` IS NOT NULL $whereSql";
+ $pListHash['cant'] = $this->mDb->GetOne( $countSql, $bindVars );
+ $this->postGetList( $pListHash );
return $ret;
}