X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-usr_online.php;h=dd4f51cb7d4a4f4381af410902b68cb82f5b2f86;hb=d9f35786166902b9bc3f402d4f2abeed5ae0528d;hp=a548abdf12c489003196d10c2851e4a86667e859;hpb=cca98f57dff720b174d21d071cee8303462485d7;p=mailer.git diff --git a/inc/modules/admin/what-usr_online.php b/inc/modules/admin/what-usr_online.php index a548abdf12..dd4f51cb7d 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_NUMROWS($result) > 0) { // 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 = "---"; + $OUT = ''; $SW = 2; + while ($row = SQL_FETCHARRAY($result)) { + // Fix empty action/what + if (empty($row['action'])) $row['action'] = '---'; + if (empty($row['what'])) $row['what'] = '---'; - if ($admin == "Y") - { + if ($row['is_admin'] == 'Y') { // Is an administrator - $uid = _IS_ADMIN; - } - elseif (($mem == "N") && ($admin == "N")) - { + $row['userid'] = getMessage('_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)); - } - else - { - OUTPUT_HTML($uid); - } - if ($ref > 0) - { - $ref = ADMIN_USER_PROFILE_LINK($ref); - } - OUTPUT_HTML(" - ".$ip." - ".$ref." - ".$mod." - ".$act." - ".$wht." - ".MAKE_DATETIME($time, "2")." -"); + $row['userid'] = getMessage('_IS_GUEST'); + } elseif ($row['userid'] > 0) { + // Add profile link to userid + $row['userid'] = generateUserProfileLink($row['userid']); + } // END - if + + // Is the refid set? + if ($row['refid'] > 0) { + // Add profile link to referer id + $row['refid'] = generateUserProfileLink($row['refid']); + } // END - if + + // Add more content + $row['sw'] = $SW; + $row['timestamp'] = generateDateTime($row['timestamp'], 2); + + // Load row template and switch color + $OUT .= loadTemplate('admin_list_online_row', true, $row); $SW = 3 - $SW; - } + } // END - while // Free memory SQL_FREERESULT($result); + // Remember rows and fancy time in array + $content['rows'] = $OUT; + $content['online_timeout'] = getMessage('ONLINE_TIMEOUT_IS'); + // Load footer template - define('__FANCY_ONLINE_TIMEOUT', CREATE_FANCY_TIME(getConfig('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); + loadTemplate('admin_settings_saved', false, getMessage('ONLINE_STATISTICS_DEACTIVATED')); } -// + +// [EOF] ?>