X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-usr_online.php;h=97672830303fbd5bd93214ebe6f6253c24de9c89;hp=3a2a30b51f281d420d6de49caf0034160d653fb8;hb=db0c6702086eea2c44d0aae1702dc2e77a0afc4e;hpb=307a4e11763f0914e73dc756b219356e1c29ab25 diff --git a/inc/modules/admin/what-usr_online.php b/inc/modules/admin/what-usr_online.php index 3a2a30b51f..9767283030 100644 --- a/inc/modules/admin/what-usr_online.php +++ b/inc/modules/admin/what-usr_online.php @@ -1,7 +1,7 @@ 0) - { - // Load header template - LOAD_TEMPLATE("admin_online_header"); - + $result = SQL_QUERY("SELECT `id`, `ip`, `userid`, `refid`, `module`, `action`, `what`, `is_member`, `is_admin`, `timestamp` FROM `{?_MYSQL_PREFIX?}_online` ORDER by `timestamp` DESC", + __FILE__, __LINE__); + if (!SQL_HASZERONUMS($result)) { // List all online users - $SW = 2; - while (list($id, $ip, $uid, $ref, $mod, $act, $wht, $mem, $admin, $time) = SQL_FETCHROW($result)) - { - if (empty($act)) $act = "---"; - if (empty($wht)) $wht = "---"; - - if ($admin == "Y") - { + $OUT = ''; + while ($row = SQL_FETCHARRAY($result)) { + if ($row['is_admin'] == 'Y') { // Is an administrator - $uid = _IS_ADMIN; - } - elseif (($mem == "N") && ($admin == "N")) - { + $row['userid'] = '{--_IS_ADMIN--}'; + } elseif (($row['is_member'] != 'Y') && ($row['is_admin'] != 'Y')) { // Is a guest - $uid = _IS_GUEST; - } - OUTPUT_HTML(" - ".$id." - "); - if ($uid > 0) - { - OUTPUT_HTML(ADMIN_USER_PROFILE_LINK($uid)); + $row['userid'] = '{--_IS_GUEST--}'; + } elseif (isValidUserId($row['userid'])) { + // Add profile link to userid + $row['userid'] = generateUserProfileLink($row['userid']); } - else - { - OUTPUT_HTML($uid); - } - if ($ref > 0) - { - $ref = ADMIN_USER_PROFILE_LINK($ref); - } - OUTPUT_HTML(" - ".$ip." - ".$ref." - ".$mod." - ".$act." - ".$wht." - ".MAKE_DATETIME($time, "2")." -"); - $SW = 3 - $SW; - } + + // Add more content + $row['timestamp'] = generateDateTime($row['timestamp'], 2); + + // Load row template and switch color + $OUT .= loadTemplate('admin_list_online_row', true, $row); + } // END - while // Free memory SQL_FREERESULT($result); + // Remember rows and fancy time in array + $content['rows'] = $OUT; + // Load footer template - define('__FANCY_ONLINE_TIMEOUT', CREATE_FANCY_TIME($_CONFIG['online_timeout'])); - LOAD_TEMPLATE("admin_online_footer"); - } -} - else -{ + loadTemplate('admin_list_online', false, $content); + } // END - if +} else { // Online statistics deactivated! - LOAD_TEMPLATE("admin_settings_saved", false, ONLINE_STATISTICS_DEACTIVATED); + displayMessage('{--ONLINE_STATISTICS_DEACTIVATED--}'); } -// + +// [EOF] ?>