- // Prepare data for template
- define('_BIRTHDAY', MAKE_DATETIME(mktime(0, 0, 0, $DATA[9], $DATA[8], $DATA[10]), "3"));
- define('_REFS' , $REFS);
- define('_CATS' , $CATS);
- define('_LINKS', $LINKS);
- define('_ADMIN_LINKS', MEMBER_ACTION_LINKS($uid, $DATA[14]));
- $DATA[0] = TRANSLATE_SEX($DATA[0]);
- $DATA[28] = CREATE_EMAIL_LINK($DATA[7], "user_data");
- $DATA[14] = TRANSLATE_STATUS($DATA[14]);
- $DATA[16] = MAKE_DATETIME($DATA[16], "0");
- $DATA[20] = TRANSLATE_COMMA($DATA[20]);
- if ($DATA[21] > 0) $DATA[21] = $BASE."&what=email_details&u_id=".$uid."\">".$DATA[21]."</A>";
- $DATA[22] = MAKE_DATETIME($DATA[22], "0");
- $DATA[23] = MAKE_DATETIME($DATA[23], "0");
- $DATA[24] = MAKE_DATETIME($DATA[24], "0");
- if ((empty($DATA[27])) || ($DATA[27] == $uid)) $DATA[27] = "---";
- $DATA['total'] = TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points"));
- $DATA['locked'] = TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "locked_points"));
-
- if (EXT_IS_ACTIVE("nickname")) {
- if ((empty($DATA[27])) || ($DATA[27] == $uid)) $DATA[27] = "---";
+// Init unset data
+if (!isGetRequestElementSet('letter')) { setGetRequestElement('letter', ''); }
+if (!isGetRequestElementSet('sortby')) { setGetRequestElement('sortby', 'userid'); }
+if (!isGetRequestElementSet('page')) { setGetRequestElement('page' , 1); }
+
+// Set base HTML
+$base = '[<a href="{%url=modules.php?module=admin';
+
+if (isGetRequestElementSet('userid')) {
+ // Secure the user id
+ $userid = bigintval(getRequestElement('userid'));
+
+ // Does the account exists?
+ $result_user = SQL_QUERY_ESC('SELECT
+ `userid`,
+ `country`,
+ `email`,
+ `birth_day`,
+ `birth_month`,
+ `birth_year`,
+ `last_online`,
+ `used_points`,
+ `emails_sent`,
+ `joined`,
+ `last_update`,
+ `last_profile_sent`,
+ `notified`,
+ `emails_received`,
+ `mails_confirmed`
+ ' . $moreColumns . '
+FROM
+ `{?_MYSQL_PREFIX?}_user_data`
+WHERE
+ `userid`=%s
+LIMIT 1',
+ array($userid), __FILE__, __LINE__);
+
+ // User found?
+ if (SQL_NUMROWS($result_user) == 1) {
+ // Account found
+ $content = SQL_FETCHARRAY($result_user);
+
+ // Get count/sum of refs, selected categories, unconfirmed mails
+ // @TODO Refacture these old link generation to functions
+ $content['refs'] = countSumTotalData($userid, 'refsystem', 'counter');
+ $content['cats'] = countSumTotalData($userid, 'user_cats', 'id', 'userid', TRUE);
+ $content['links'] = getTotalUnconfirmedMails($userid);
+
+ // Add links to the numbers
+ if ($content['links'] > 0) {
+ $content['links'] = $base . '&what=list_links&userid=' . $userid . '%}">' . $content['links'] . '</a>]';
+ } // END - if
+ if ($content['refs'] > 0) {
+ $content['refs'] = $base . '&what=list_refs&userid=' . $userid . '%}">{%pipe,translateComma=' . $content['refs'] . '%}</a>]';
+ } // END - if
+ if ($content['cats'] > 0) {
+ $content['cats'] = $base . '&what=list_user_cats&userid=' . $userid . '%}">{%pipe,translateComma=' . $content['cats'] . '%}</a>]';
+ } // END - if
+
+ // Calculate timestamp for birthday
+ // @TODO Refacture birth_foo to avoid uni* timetstamps as older members cannot be greeded correctly
+ $stamp = mktime(0, 0, 0, $content['birth_month'], $content['birth_day'], $content['birth_year']);
+
+ // Is this above zero?
+ if ($stamp > 0) {
+ // Then use it
+ $content['birthday'] = generateDateTime($stamp, '2');