X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-active.php;h=7e017196db325b43b2f6db6be0ef7b31cb47c340;hb=0f9bc55be42f9851cc87a06f3971c853a83425a7;hp=d41f722fe495d0c7665b123d1f848b94126596a4;hpb=1e2a4228e071a67a2d79e970a843e3e30476cfb8;p=mailer.git diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index d41f722fe4..7e017196db 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_TDAY, getConfig('active_limit')), __FILE__, __LINE__); +$result = SQL_QUERY("SELECT + `userid`, `".$add."`, `last_online` +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_NUMROWS($result) > 0) { +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)) { + $OUT = ''; + while (list($userid, $nick, $last) = SQL_FETCHROW($result)) { $nick2 = '---'; - if (($nick != $uid) && (!empty($nick))) $nick2 = $nick; + if (($nick != $userid) && (!empty($nick))) $nick2 = $nick; // Transfer data to array $content = array( - 'sw' => $SW, - 'uid' => $uid, - 'nick' => $nick2, - 'points' => translateComma(GET_TOTAL_DATA($uid, 'user_points', 'points') - GET_TOTAL_DATA($uid, 'user_data', 'used_points')), - 'last' => generateDateTime($last, '2'), + 'userid' => $userid, + 'nickname' => $nick2, + 'points' => (countSumTotalData($userid, 'user_points', 'points') - countSumTotalData($userid, 'user_data', 'used_points')), + 'last_online' => generateDateTime($last, 2), ); // Load template - $OUT .= LOAD_TEMPLATE('guest_active_row', true, $content); - - // Switch colors - $SW = 3 - $SW; - } + $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] ?>