X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fmodules%2Fguest%2Fwhat-active.php;h=dcd25e068b189920ea4873140e30def041e477cd;hb=61621983cc6d7195fcc7eab29b5f6080ff283b34;hp=c9d0db929c11a85782e80fed115c653344c8e536;hpb=75ad748a68473ace540251427a74fb781b1145e9;p=mailer.git diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index c9d0db929c..dcd25e068b 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__); +$result = sqlQuery("SELECT + `userid`, + `last_online` +FROM + `{?_MYSQL_PREFIX?}_user_data` +WHERE + `last_online` >= {?START_TDAY?} AND + `status`='CONFIRMED' + " . runFilterChain('user_exclusion_sql', ' ') . " +ORDER BY + `last_online` DESC +LIMIT {?active_limit?}", __FILE__, __LINE__); -if (SQL_NUMROWS($result) > 0) -{ +// Entries found? +if (!ifSqlHasZeroNumRows($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 = sqlFetchArray($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] ?>