add option to sort users and Characters by registration date
This commit is contained in:
parent
1578654cb1
commit
6df13cb5b4
7 changed files with 88 additions and 32 deletions
|
|
@ -568,8 +568,8 @@
|
|||
/**
|
||||
* Compare two users by their userroles.
|
||||
*
|
||||
* @param array $a Character a
|
||||
* @param array $b Character b
|
||||
* @param array $a User a
|
||||
* @param array $b User b
|
||||
* @return int Result of comparison
|
||||
*/
|
||||
private function sortUsersByRole($a, $b)
|
||||
|
|
@ -616,6 +616,24 @@
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compare two users by their registration date.
|
||||
*
|
||||
* @param array $a User a
|
||||
* @param array $b User b
|
||||
* @return int Result of comparison
|
||||
*/
|
||||
private function sortUsersByDate($a, $b)
|
||||
{
|
||||
if($a['created'] == $b['created']) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return ($a['created'] > $b['created']) ? -1 : 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue