]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-active.php
Some more code-cleanups:
[mailer.git] / inc / modules / guest / what-active.php
index 945f6ef8a17af88517c7fda756eb44535c23dfd4..36dd9e4443c3749550b1238d785853462363b0e7 100644 (file)
@@ -49,14 +49,16 @@ if ((!isExtensionActive('active')) && (!isAdmin())) {
 } // 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
@@ -70,17 +72,14 @@ LIMIT {?active_limit?}", __FILE__, __LINE__);
 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);