X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-usr_online.php;h=8981ddd75a8713724b50082c5e883b062d1392f4;hb=c1671a3b6c02326b471916a28f4177c453871f51;hp=236b491fc9b73cf1d079f4d9c8e138ed8b4ec966;hpb=fff3e2abc8ffb5a086fbf0f3a7d6b9f2ff5ddaed;p=mailer.git
diff --git a/inc/modules/admin/what-usr_online.php b/inc/modules/admin/what-usr_online.php
index 236b491fc9..8981ddd75a 100644
--- a/inc/modules/admin/what-usr_online.php
+++ b/inc/modules/admin/what-usr_online.php
@@ -1,6 +1,6 @@
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'] = sprintf(getMessage('ONLINE_TIMEOUT_IS'), createFancyTime(getConfig('online_timeout')));
+
// 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);
+ loadTemplate('admin_settings_saved', false, getMessage('ONLINE_STATISTICS_DEACTIVATED'));
}
-//
+
+// [EOF]
?>