X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-active.php;h=36dd9e4443c3749550b1238d785853462363b0e7;hb=5828ff274e4c4e80f479e211f6b291452ded3620;hp=c9d0db929c11a85782e80fed115c653344c8e536;hpb=d0ab0382dd73638f0bc13a1a3d6f117ec11a203e;p=mailer.git diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index c9d0db929c..36dd9e4443 100644 --- a/inc/modules/guest/what-active.php +++ b/inc/modules/guest/what-active.php @@ -1,7 +1,7 @@ = %s AND status='CONFIRMED' -ORDER BY last_online DESC LIMIT %s", - array($START, $CONFIG['active_limit']), __FILE__, __LINE__); +// If nickname is installed the extra field is the nickname of the user +if (isExtensionActive('nickname')) { + $add = ', `nickname`'; +} // END - if -if (SQL_NUMROWS($result) > 0) -{ +// Check for members who were active only this day +$result = SQL_QUERY("SELECT + `userid``, `last_online`".$add." +FROM + `{?_MYSQL_PREFIX?}_user_data` +WHERE + `last_online` >= {?START_TDAY?} AND + `status`='CONFIRMED' +ORDER BY + `last_online` DESC +LIMIT {?active_limit?}", __FILE__, __LINE__); + +// Entries found? +if (!SQL_HASZERONUMS($result)) { // At least one member was online so let's load them all - $OUT = ""; $SW = 2; - while(list($uid, $nick, $last) = SQL_FETCHROW($result)) - { - $nick2 = "---"; - if (($nick != $uid) && (!empty($nick))) $nick2 = $nick; + $OUT = ''; + 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( - 'sw' => $SW, - 'uid' => $uid, - 'nick' => $nick2, - 'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points")), - 'last' => MAKE_DATETIME($last, "2"), - ); + // Translate comma + $content['last_online'] = generateDateTime($last, 2); // Load template - $OUT .= LOAD_TEMPLATE("guest_active_row", true, $content); - - // Switch colors - $SW = 3 - $SW; - } -} - else -{ + $OUT .= loadTemplate('guest_active_row', true, $content); + } // END - while +} else { // No member was online today! :-( - $OUT = LOAD_TEMPLATE("guest_active_none_row", true); + $OUT = loadTemplate('guest_active_none_row', true); } -// Remember output in constant -define('__ACTIVE_ROWS', $OUT); - // Load template -LOAD_TEMPLATE("guest_active_table"); +loadTemplate('guest_active_table', false, $OUT); -// +// [EOF] ?>