} // END - if
// Extra field to include is by default userid
-$add = 'userid';
+$add = '';
// If nickname is installed the extra field is the nickname of the user
-if (isExtensionActive('nickname')) $add = 'nickname';
+if (isExtensionActive('nickname')) {
+ $add = ', `nickname`';
+} // END - if
// Check for members who were active only this day
$result = SQL_QUERY("SELECT
- `userid`, `".$add."`, `last_online`
+ `userid``, `last_online`".$add."
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
if (!SQL_HASZERONUMS($result)) {
// At least one member was online so let's load them all
$OUT = '';
- while (list($userid, $nick, $last) = SQL_FETCHROW($result)) {
- $nick2 = '---';
- if (($nick != $userid) && (!empty($nick))) $nick2 = $nick;
+ while ($content = SQL_FETCHARRAY($result)) {
+ // If ext-nickname is not installed, set 'nickname' to empty
+ if (!isExtensionActive('nickname')) {
+ $content['nickname'] = '';
+ } // END - if
- // Transfer data to array
- $content = array(
- 'userid' => $userid,
- 'nickname' => $nick2,
- 'points' => getTotalPoints($userid),
- 'last_online' => generateDateTime($last, 2),
- );
+ // Translate comma
+ $content['last_online'] = generateDateTime($last, 2);
// Load template
$OUT .= loadTemplate('guest_active_row', true, $content);