- if ($LINKS > 0) $LINKS = $BASE."&what=list_links&u_id=".$uid."\">".$LINKS."</A>]";
- if ($DATA[13] > 0) $DATA[13] = str_replace(("u_id=".$uid), ("u_id=".$DATA[13]), $BASE."&what=list_user\">".$DATA[13]."</A>]");
- if (empty($DATA[17])) $DATA[17] = "---";
- if ($REFS > 0) $REFS = $BASE."&what=list_refs&u_id=".$uid."\">".$REFS."</A>]";
- if ($CATS > 0) $CATS = $BASE."&what=list_cats&u_id=".$uid."\">".$CATS."</A>]";
+// Set base URL
+$base = '[<a href="{%url=modules.php?module=admin';
+
+if (isGetRequestParameterSet('userid')) {
+ // Secure the user id
+ $userid = bigintval(getRequestParameter('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`".$MORE."
+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
+ $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>]';
+ if ($content['refs'] > 0) $content['refs'] = $base . '&what=list_refs&userid=' . $userid . '%}">{%pipe,translateComma=' . $content['refs'] . '%}</a>]';
+ if ($content['cats'] > 0) $content['cats'] = $base . '&what=list_cats&userid=' . $userid . '%}">{%pipe,translateComma=' . $content['cats'] . '%}</a>]';
+
+ // Calculate timestamp for birthday
+ $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, '3');
+ } else {
+ // Zero or below so set zero!
+ $content['birthday'] = generateDateTime(0, '3');
+ }