X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-active.php;h=96c09bd54df646e6a62c286ed7dc42c62422cf75;hb=ee3a0b42f93de7676fca549c866c1c2e6f3f0576;hp=443593282fd7162808049e08dc459e43d09a5964;hpb=7f104f6fe558bb56b4205241435a2357c2feece1;p=mailer.git diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index 443593282f..96c09bd54d 100644 --- a/inc/modules/guest/what-active.php +++ b/inc/modules/guest/what-active.php @@ -1,7 +1,7 @@ = {?START_TDAY?} AND + `status`='CONFIRMED' +ORDER BY + `last_online` DESC +LIMIT {?active_limit?}", __FILE__, __LINE__); -$result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", last_online -FROM "._MYSQL_PREFIX."_user_data -WHERE last_online >= %s AND status='CONFIRMED' -ORDER BY last_online DESC LIMIT %s", - array($START, $_CONFIG['active_limit']), __FILE__, __LINE__); - -if (SQL_NUMROWS($result) > 0) -{ +// 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($content['last_online'], '2'); // Load template - $OUT .= LOAD_TEMPLATE("guest_active_row", true, $content); - - // Switch colors - $SW = 3 - $SW; - } -} - else -{ + $OUT .= loadTemplate('guest_list_active_row', true, $content); + } // END - while +} else { // No member was online today! :-( - $OUT = LOAD_TEMPLATE("guest_active_none_row", true); + $OUT = loadTemplate('guest_list_active_row_none', true); } -// Remember output in constant -define('__ACTIVE_ROWS', $OUT); - // Load template -LOAD_TEMPLATE("guest_active_table"); +loadTemplate('guest_list_active', false, $OUT); -// +// [EOF] ?>