if (REQUEST_ISSET_GET(('status'))) {
// Set title according to the 'status'
$listHeader = getMessage(sprintf("ADMIN_LIST_STATUS_%s_ACCOUNTS", strtoupper(REQUEST_GET(('status')))));
-} elseif (REQUEST_ISSET_GET(('mode'))) {
+} elseif (REQUEST_ISSET_GET('mode')) {
// Set title according to the "mode"
- $listHeader = getMessage(sprintf("ADMIN_LIST_MODE_%s_ACCOUNTS", strtoupper(REQUEST_GET(('mode')))));
+ $listHeader = getMessage(sprintf("ADMIN_LIST_MODE_%s_ACCOUNTS", strtoupper(REQUEST_GET('mode'))));
}
// Remember it
$MORE .= ", country";
}
-// Init unset data (bad that we change $_GET here!)
-if (!REQUEST_ISSET_GET(('letter'))) { REQUEST_SET_GET('letter', getMessage('_ALL2')); }
-if (!REQUEST_ISSET_GET(('sortby'))) { REQUEST_SET_GET('sortby', 'userid'); }
+// Init unset data
+if (!REQUEST_ISSET_GET('letter')) { REQUEST_SET_GET('letter', getMessage('_ALL2')); }
+if (!REQUEST_ISSET_GET('sortby')) { REQUEST_SET_GET('sortby', 'userid'); }
if (!REQUEST_ISSET_GET('page')) { REQUEST_SET_GET('page' , '1'); }
// Set base URL
-$base = "[<a href=\"{!URL!}/modules.php?module=admin";
+$base = "[<a href=\"{?URL?}/modules.php?module=admin";
if (REQUEST_ISSET_GET('uid')) {
// Secure the user ID
$DATA = SQL_FETCHARRAY($result_user);
// Get count/sum of refs, selected categories, unconfirmed mails
- $REFS = GET_TOTAL_DATA($uid, "refsystem", "counter");
- $CATS = GET_TOTAL_DATA($uid, "user_cats", 'id', 'userid', true);
- $LINKS = GET_TOTAL_DATA($uid, "user_links", 'id', 'userid', true);
+ $REFS = GET_TOTAL_DATA($uid, 'refsystem', 'counter');
+ $CATS = GET_TOTAL_DATA($uid, 'user_cats', 'id', 'userid', true);
+ $LINKS = GET_TOTAL_DATA($uid, 'user_links', 'id', 'userid', true);
// Add links to the numbers
if ($LINKS > 0) $LINKS = $base."&what=list_links&uid=".$uid."\">".$LINKS."</a>]";
define('_LINKS', $LINKS);
define('_ADMIN_LINKS', generateMemberAdminActionLinks($uid, $DATA['status']));
$DATA['gender'] = translateGender($DATA['gender']);
- $DATA['email_link'] = generateMemberEmailLink($DATA['email'], "user_data");
+ $DATA['email_link'] = generateEmailLink($DATA['email'], 'user_data');
$DATA['status'] = translateUserStatus($DATA['status']);
$DATA['last_online'] = generateDateTime($DATA['last_online'], '0');
$DATA['used_points'] = translateComma($DATA['used_points']);
$DATA['joined'] = generateDateTime($DATA['joined'], '0');
$DATA['last_update'] = generateDateTime($DATA['last_update'], '0');
$DATA['last_profile_sent'] = generateDateTime($DATA['last_profile_sent'], '0');
- $DATA['total'] = translateComma(GET_TOTAL_DATA($uid, "user_points", "points"));
- $DATA['locked'] = translateComma(GET_TOTAL_DATA($uid, "user_points", "locked_points"));
+ $DATA['total'] = translateComma(GET_TOTAL_DATA($uid, 'user_points', 'points'));
+ $DATA['locked'] = translateComma(GET_TOTAL_DATA($uid, 'user_points', 'locked_points'));
$DATA['lock_timestamp'] = generateDateTime($DATA['lock_timestamp'], '2');
// Is the lock reason not set?
}
// Load user-details template
- LOAD_TEMPLATE("admin_user_details", false, $uid);
+ LOAD_TEMPLATE('admin_user_details', false, $uid);
} else {
// Account does not exist!
LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_MEMBER_404'), $uid));
SQL_FREERESULT($result_user);
} else {
$whereStatement = '';
- if ((REQUEST_GET('letter') != getMessage('_ALL2')) && (REQUEST_GET('letter') != getMessage('_OTHERS')) && (REQUEST_ISSET_GET(('letter')))) {
+ if ((REQUEST_GET('letter') != getMessage('_ALL2')) && (REQUEST_GET('letter') != getMessage('_OTHERS')) && (REQUEST_ISSET_GET('letter'))) {
// List only persons w
- $whereStatement = " WHERE family LIKE '".REQUEST_GET('letter')."%'";
+ $whereStatement = " WHERE family LIKE '".REQUEST_GET('letter') . "%'";
} // END - if
- if (REQUEST_GET('sortby') == "family_name") REQUEST_SET_GET('sortby', "family");
+ if (REQUEST_GET('sortby') == 'family_name') REQUEST_SET_GET('sortby', 'family');
// Parse the status or mode parameter
if (REQUEST_ISSET_GET(('status'))) {
// Start a new one
$whereStatement = sprintf(" WHERE `status`='%s'", SQL_ESCAPE(strip_tags(strtoupper(REQUEST_GET('status')))));
}
- } elseif (REQUEST_ISSET_GET(('mode'))) {
+ } elseif (REQUEST_ISSET_GET('mode')) {
// Choose what we need to list
switch (REQUEST_GET('mode')) {
case "norefs": // Users w/o refs
if (!empty($whereStatement)) {
// Add AND statement
- $whereStatement .= " AND refid=0";
+ $whereStatement .= " AND `refid`=0";
} else {
// Add WHERE statement
- $whereStatement = " WHERE refid=0";
+ $whereStatement = " WHERE `refid`=0";
}
break;
default: // Invalid list mode
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid list mode %s detected.", REQUEST_GET(('mode'))));
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid list mode %s detected.", REQUEST_GET('mode')));
break;
}
} // END = if
+ // Generate master query string
+ $sql = sprintf("SELECT `userid`, `gender`, `surname`, `family`, `email`, `REMOTE_ADDR`, `refid`, `status`, `emails_sent`, `mails_confirmed`, `emails_received`".$MORE." FROM `{!_MYSQL_PREFIX!}_user_data`".$whereStatement." ORDER BY `%s` ASC",
+ REQUEST_GET('sortby')
+ );
+
// Prepare SQL and run it
- $sql = "SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, status, emails_sent, mails_confirmed, emails_received".$MORE." FROM `{!_MYSQL_PREFIX!}_user_data`".$whereStatement." ORDER BY ".REQUEST_GET(('sortby'));
$result_master = SQL_QUERY($sql, __FILE__, __LINE__);
// Calculate page count (0.5 fixes a bug with page count)
$sql .= " LIMIT ".(REQUEST_GET('offset') * REQUEST_GET('page') - REQUEST_GET('offset')).", ".REQUEST_GET('offset');
$result = SQL_QUERY($sql, __FILE__, __LINE__);
- $result_user = SQL_QUERY("SELECT emails_sent FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED'", __FILE__, __LINE__);
+ $result_user = SQL_QUERY("SELECT `emails_sent` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED'", __FILE__, __LINE__);
$user_count = SQL_NUMROWS($result_user);
SQL_FREERESULT($result_user);
if ($content['refid'] > 0) $content['refid'] = generateUserProfileLink($content['refid']);
// Get number of unconfirmed mails
- $LINKS = GET_TOTAL_DATA($content['userid'], "user_links", 'id', 'userid', true);
+ $LINKS = GET_TOTAL_DATA($content['userid'], 'user_links', 'id', 'userid', true);
if ($LINKS > 0) $LINKS = $base."&what=list_links&uid=".$content['userid']."\">".translateComma($LINKS)."</a>]";
// Set link to sent mails if present
if (empty($content['nickname']) || $content['nickname'] == $content['userid']) $content['nickname'] = '---';
// Calculate total points
- $pointsTotal = GET_TOTAL_DATA($content['userid'], "user_points", "points") - GET_TOTAL_DATA($content['userid'], "user_data", "used_points");
+ $pointsTotal = GET_TOTAL_DATA($content['userid'], 'user_points', 'points') - GET_TOTAL_DATA($content['userid'], 'user_data', 'used_points');
// Clickrate
$clickRate = 0;
$content['sw'] = $SW;
$content['uid'] = generateUserProfileLink($content['userid']);
$content['gender'] = translateGender($content['gender']);
- $content['email'] = "[<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".$content['email']."</a>]";
+ $content['email'] = "[<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".$content['email']."</a>]";
$content['addr'] = $content['REMOTE_ADDR'];
$content['links'] = $LINKS;
$content['alinks'] = generateMemberAdminActionLinks($content['userid'], $content['status']);
$content['points'] = translateComma($pointsTotal);
$content['rate'] = translateComma($clickRate);
- $content['locked'] = translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "locked_points"));
+ $content['locked'] = translateComma(GET_TOTAL_DATA($content['userid'], 'user_points', 'locked_points'));
$content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], '2');
$content['status'] = translateUserStatus($content['status']);
+ $content['refs'] = 0;
+
+ // Get total refs
+ $refs = GET_TOTAL_DATA($content['userid'], 'refsystem', 'counter');
+ if ($refs > 0) $content['refs'] = $base."&what=list_refs&uid=".$content['userid']."\">".$refs."</a>]";
// Is the lock reason not set?
if (!isset($content['lock_reason'])) $content['lock_reason'] = '---';
}
// Load row template and switch colors
- $OUT .= LOAD_TEMPLATE("admin_list_user_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_user_row', true, $content);
$SW = 3 - $SW;
} // END - while
define('__USER_ROWS', $OUT);
// Load main template
- LOAD_TEMPLATE("admin_list_user");
+ LOAD_TEMPLATE('admin_list_user');
// Free some memory
SQL_FREERESULT($result_master);
}
}
-//
+// [EOF]
?>