X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-active.php;h=36dd9e4443c3749550b1238d785853462363b0e7;hp=945f6ef8a17af88517c7fda756eb44535c23dfd4;hb=a5966b77de4635f56787c2606292ac436d8c7039;hpb=9842b6f5d8bebc5c879c115d5ad2198d1455a478 diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index 945f6ef8a1..36dd9e4443 100644 --- a/inc/modules/guest/what-active.php +++ b/inc/modules/guest/what-active.php @@ -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);