$sqlsortkey = NULL;
$textlib = textlib_get_instance();
+/// Calculate the SQL sortkey to be used by the SQL statements later
+ switch ( $sortkey ) {
+ case "CREATION":
+ $sqlsortkey = "timecreated";
+ break;
+ case "UPDATE":
+ $sqlsortkey = "timemodified";
+ break;
+ case "FIRSTNAME":
+ $sqlsortkey = "firstname";
+ break;
+ case "LASTNAME":
+ $sqlsortkey = "lastname";
+ break;
+ }
+ $sqlsortorder = $sortorder;
+
/// Pivot is the field that set the break by groups (category, initial, author name, etc)
/// fullpivot indicate if the whole pivot should be compared agasint the db or just the first letter
/// printpivot indicate if the pivot should be printed or not
- switch ( $sortkey ) {
- case "CREATION":
- $sqlsortkey = "timecreated";
- break;
-
- case "UPDATE":
- $sqlsortkey = "timemodified";
- break;
- }
- $sqlsortorder = $sortorder;
-
$fullpivot = 1;
$userid = '';
$where = '';
- if ( $sqlsortkey == 'FIRSTNAME' ) {
+ if ( $sqlsortkey == 'firstname' ) {
$usernamefield = sql_fullname('u.firstname' , 'u.lastname');
} else {
$usernamefield = sql_fullname('u.lastname' , 'u.firstname');