[pLog-svn] r4856 - in plog/branches/lifetype-1.2/class: dao dao/userdata summary/view view/admin
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Fri Feb 23 08:59:29 EST 2007
Author: oscar
Date: 2007-02-23 08:59:29 -0500 (Fri, 23 Feb 2007)
New Revision: 4856
Modified:
plog/branches/lifetype-1.2/class/dao/userdata/baseuserdataprovider.class.php
plog/branches/lifetype-1.2/class/dao/userdata/joomlauserdataprovider.class.php
plog/branches/lifetype-1.2/class/dao/userdata/lifetypeuserdataprovider.class.php
plog/branches/lifetype-1.2/class/dao/userdata/phpbb2userdataprovider.class.php
plog/branches/lifetype-1.2/class/dao/userdata/simplepostnukeuserdataprovider.class.php
plog/branches/lifetype-1.2/class/dao/userdata/vbb3userdataprovider.class.php
plog/branches/lifetype-1.2/class/dao/userdata/wbbuserdataprovider.class.php
plog/branches/lifetype-1.2/class/dao/users.class.php
plog/branches/lifetype-1.2/class/summary/view/summaryuserlistview.class.php
plog/branches/lifetype-1.2/class/view/admin/adminsiteuserslistview.class.php
Log:
Added support for specifying the order in the Users::getAllUsers() method, and applied those changes to the list of users in the summary so that they appear sorted listed with the newest one first.
Modified: plog/branches/lifetype-1.2/class/dao/userdata/baseuserdataprovider.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/userdata/baseuserdataprovider.class.php 2007-02-23 13:25:19 UTC (rev 4855)
+++ plog/branches/lifetype-1.2/class/dao/userdata/baseuserdataprovider.class.php 2007-02-23 13:59:29 UTC (rev 4856)
@@ -166,12 +166,13 @@
* Returns an array with all the users available in the database
*
* @param status
- * @param includeExtraInfo
+ * @param searchTerms
+ * @param orderBy
* @param page
* @param itemsPerPage
* @return An array containing all the users.
*/
- function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
+ function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $orderBy = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
{
}
Modified: plog/branches/lifetype-1.2/class/dao/userdata/joomlauserdataprovider.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/userdata/joomlauserdataprovider.class.php 2007-02-23 13:25:19 UTC (rev 4855)
+++ plog/branches/lifetype-1.2/class/dao/userdata/joomlauserdataprovider.class.php 2007-02-23 13:59:29 UTC (rev 4856)
@@ -288,7 +288,7 @@
* @param itemsPerPage
* @return An array containing all the users.
*/
- function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
+ function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $orderBy = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
{
$query = "SELECT * FROM ".$this->_joomladbprefix."users ORDER BY id ASC";
Modified: plog/branches/lifetype-1.2/class/dao/userdata/lifetypeuserdataprovider.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/userdata/lifetypeuserdataprovider.class.php 2007-02-23 13:25:19 UTC (rev 4855)
+++ plog/branches/lifetype-1.2/class/dao/userdata/lifetypeuserdataprovider.class.php 2007-02-23 13:59:29 UTC (rev 4856)
@@ -94,14 +94,15 @@
* Returns an array with all the users available in the database
*
* @param status
- * @param includeExtraInfo
* @param searchTerms
+ * @param orderBy
* @param page
* @param itemsPerPage
* @return An array containing all the users.
*/
function getAllUsers( $status = USER_STATUS_ALL,
- $searchTerms = "",
+ $searchTerms = "",
+ $orderBy = "",
$page = DEFAULT_PAGING_ENABLED,
$itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
{
@@ -117,15 +118,19 @@
}
if( $where != "" )
$where = "WHERE $where";
+
+ if( $orderBy == "" )
+ $orderBy = "id ASC";
- $query = "SELECT * FROM ".$this->getPrefix()."users $where ORDER BY id ASC";
+ $query = "SELECT * FROM ".$this->getPrefix()."users $where ORDER BY $orderBy";
+
$result = $this->Execute( $query, $page, $itemsPerPage );
$users = Array();
if( !$result )
return $users;
-
+
while ($row = $result->FetchRow()) {
$user = $this->mapRow( $row );
$users[] = $user;
Modified: plog/branches/lifetype-1.2/class/dao/userdata/phpbb2userdataprovider.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/userdata/phpbb2userdataprovider.class.php 2007-02-23 13:25:19 UTC (rev 4855)
+++ plog/branches/lifetype-1.2/class/dao/userdata/phpbb2userdataprovider.class.php 2007-02-23 13:59:29 UTC (rev 4856)
@@ -226,7 +226,7 @@
* @param itemsPerPage
* @return An array containing all the users.
*/
- function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
+ function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $orderBy = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
{
$query = "SELECT * FROM ".$this->_phpbbprefix."users WHERE user_id >= 0 ORDER BY user_id ASC";
Modified: plog/branches/lifetype-1.2/class/dao/userdata/simplepostnukeuserdataprovider.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/userdata/simplepostnukeuserdataprovider.class.php 2007-02-23 13:25:19 UTC (rev 4855)
+++ plog/branches/lifetype-1.2/class/dao/userdata/simplepostnukeuserdataprovider.class.php 2007-02-23 13:59:29 UTC (rev 4856)
@@ -207,7 +207,8 @@
* @return An array containing all the users.
*/
function getAllUsers( $status = USER_STATUS_ALL,
- $searchTerms = "",
+ $searchTerms = "",
+ $orderBy = "",
$page = DEFAULT_PAGING_ENABLED,
$itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
{
Modified: plog/branches/lifetype-1.2/class/dao/userdata/vbb3userdataprovider.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/userdata/vbb3userdataprovider.class.php 2007-02-23 13:25:19 UTC (rev 4855)
+++ plog/branches/lifetype-1.2/class/dao/userdata/vbb3userdataprovider.class.php 2007-02-23 13:59:29 UTC (rev 4856)
@@ -310,7 +310,7 @@
* @param itemsPerPage
* @return An array containing all the users.
*/
- function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
+ function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $orderBy = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
{
$where = "";
switch ($status)
Modified: plog/branches/lifetype-1.2/class/dao/userdata/wbbuserdataprovider.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/userdata/wbbuserdataprovider.class.php 2007-02-23 13:25:19 UTC (rev 4855)
+++ plog/branches/lifetype-1.2/class/dao/userdata/wbbuserdataprovider.class.php 2007-02-23 13:59:29 UTC (rev 4856)
@@ -230,7 +230,7 @@
* @param itemsPerPage
* @return An array containing all the users.
*/
- function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $page = DEFAULT_PAGING_ENABLED, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
+ function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $orderBy = "", $page = DEFAULT_PAGING_ENABLED, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
{
$query = "SELECT * FROM ".$this->_wbbprefix."users WHERE userid >= 0 ORDER BY userid ASC";
Modified: plog/branches/lifetype-1.2/class/dao/users.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/users.class.php 2007-02-23 13:25:19 UTC (rev 4855)
+++ plog/branches/lifetype-1.2/class/dao/users.class.php 2007-02-23 13:59:29 UTC (rev 4856)
@@ -112,14 +112,15 @@
* Returns an array with all the users available in the database
*
* @param status
- * @param includeExtraInfo
+ * @param searchTerms
+ * @param orderBy
* @param page
* @param itemsPerPage
* @return An array containing all the users.
*/
- function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
+ function getAllUsers( $status = USER_STATUS_ALL, $searchTerms = "", $orderBy = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
{
- return( $this->_provider->getAllUsers( $status, $searchTerms, $page, $itemsPerPage ));
+ return( $this->_provider->getAllUsers( $status, $searchTerms, $orderBy, $page, $itemsPerPage ));
}
/**
Modified: plog/branches/lifetype-1.2/class/summary/view/summaryuserlistview.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/summary/view/summaryuserlistview.class.php 2007-02-23 13:25:19 UTC (rev 4855)
+++ plog/branches/lifetype-1.2/class/summary/view/summaryuserlistview.class.php 2007-02-23 13:59:29 UTC (rev 4856)
@@ -37,7 +37,7 @@
// get the data itself
$users = new Users();
- $siteUsers = $users->getAllUsers( USER_STATUS_ACTIVE, "", $this->_page, $this->_numUsersPerPage );
+ $siteUsers = $users->getAllUsers( USER_STATUS_ACTIVE, "", "id desc", $this->_page, $this->_numUsersPerPage );
if( !$siteUsers ) {
// if there was an error, show the error view
Modified: plog/branches/lifetype-1.2/class/view/admin/adminsiteuserslistview.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/view/admin/adminsiteuserslistview.class.php 2007-02-23 13:25:19 UTC (rev 4855)
+++ plog/branches/lifetype-1.2/class/view/admin/adminsiteuserslistview.class.php 2007-02-23 13:59:29 UTC (rev 4856)
@@ -67,7 +67,7 @@
// get the users of the blog
$users = new Users();
- $siteUsers = $users->getAllUsers( $this->_status, $this->_searchTerms, $this->_page, DEFAULT_ITEMS_PER_PAGE );
+ $siteUsers = $users->getAllUsers( $this->_status, $this->_searchTerms, "", $this->_page, DEFAULT_ITEMS_PER_PAGE );
$numUsers = $users->getNumUsers( $this->_status, $this->_searchTerms );
// in case of problems, empty array...
More information about the pLog-svn
mailing list