-<?php\r
-/************************************************************************\r
- * MXChange v0.2.1 Start: 02/02/2004 *\r
- * ================ Last change: 07/13/2004 *\r
- * *\r
- * -------------------------------------------------------------------- *\r
- * File : action-online.php *\r
- * -------------------------------------------------------------------- *\r
- * Short description : Who is where? (DO NOT add sub menus!) *\r
- * -------------------------------------------------------------------- *\r
- * Kurzbeschreibung : Wer ist wo? (KEINE Untermenues anhaengen!) *\r
- * -------------------------------------------------------------------- *\r
- * *\r
- * -------------------------------------------------------------------- *\r
- * Copyright (c) 2003 - 2007 by Roland Haeder *\r
- * For more information visit: http://www.mxchange.org *\r
- * *\r
- * This program is free software; you can redistribute it and/or modify *\r
- * it under the terms of the GNU General Public License as published by *\r
- * the Free Software Foundation; either version 2 of the License, or *\r
- * (at your option) any later version. *\r
- * *\r
- * This program is distributed in the hope that it will be useful, *\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\r
- * GNU General Public License for more details. *\r
- * *\r
- * You should have received a copy of the GNU General Public License *\r
- * along with this program; if not, write to the Free Software *\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *\r
- * MA 02110-1301 USA *\r
- ************************************************************************/\r
-\r
-// Some security stuff...\r
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))\r
-{\r
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";\r
- require($INC);\r
-}\r
-\r
-// Add description as navigation point\r
-ADD_DESCR("admin", basename(__FILE__));\r
-OUTPUT_HTML ("</FONT><BR><BR>");\r
-\r
-// Count guests, members and admins\r
-$result_guests = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='N' AND is_member='N'", __FILE__, __LINE__);\r
-$result_members = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='N' AND is_member='Y'", __FILE__, __LINE__);\r
-$result_admins = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='Y'", __FILE__, __LINE__);\r
-\r
-OUTPUT_HTML("<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" width=\"170\" class=\"admin_table dashed\">\r
-<TR><TD colspan=\"5\" height=\"7\" class=\"seperator admin_title\"> </TD></TR>\r
-<TR>\r
- <TD colspan=\"3\" class=\"admin_title\" align=\"center\">\r
- <STRONG>".USER_NOW_ONLINE."</STRONG>\r
- </TD>\r
-</TR>\r
-<TR><TD colspan=\"5\" height=\"7\" class=\"seperator admin_title\"> </TD></TR>\r
-<TR>\r
- <TD width=\"85%\" class=\"top2 bottom2\" align=\"right\"><FONT class=\"medium\">".GUESTS_ONLINE.":</FONT></TD>\r
- <TD width=\"5%\" class=\"top2 bottom2\"> </TD>\r
- <TD width=\"10%\" class=\"top2 bottom2\"><B>".SQL_NUMROWS($result_guests)."</B></TD>\r
-</TR>\r
-<TR>\r
- <TD width=\"85%\" class=\"bottom2\" align=\"right\"><FONT class=\"medium\">".MEMBERS_ONLINE.":</FONT></TD>\r
- <TD width=\"5%\" class=\"bottom2\"> </TD>\r
- <TD width=\"10%\" class=\"bottom2\"><B>".SQL_NUMROWS($result_members)."</B></TD>\r
-</TR>\r
-<TR>\r
- <TD width=\"85%\" align=\"right\"><FONT class=\"medium\">".ADMINS_ONLINE.":</FONT></TD>\r
- <TD width=\"5%\"> </TD>\r
- <TD width=\"10%\"><B>".SQL_NUMROWS($result_admins)."</B></TD>\r
-</TR>\r
-</TABLE><BR>");\r
-\r
-$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__);\r
-if (SQL_NUMROWS($result) > 0)\r
-{\r
- // Load header template\r
- LOAD_TEMPLATE("admin_online_header");\r
-\r
- // List all online users\r
- $SW = 2;\r
- while (list($id, $ip, $userid, $refid, $module, $action, $what, $mem, $admin, $time) = SQL_FETCHROW($result))\r
- {\r
- if ($action == "") $action = "---";\r
- if ($what == "") $what = "---";\r
-\r
- if ($admin == "Y")\r
- {\r
- // Is an administrator\r
- $userid = _IS_ADMIN;\r
- }\r
- elseif (($mem == "N") && ($admin == "N"))\r
- {\r
- // Is a guest\r
- $userid = _IS_GUEST;\r
- }\r
- OUTPUT_HTML("<TR>\r
- <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$id."</TD>\r
- <TD align=\"center\" width=\"15%\" class=\"switch_sw".$SW." bottom right\">");\r
- if ($userid > 0)\r
- {\r
- OUTPUT_HTML("<A href=\"".URL."/modules.php?module=admin&what=list_user&u_id=".$userid."\">".$userid."</A>");\r
- }\r
- else\r
- {\r
- OUTPUT_HTML($userid);\r
- }\r
- if ($refid > 0)\r
- {\r
- $refid = "<A href=\"".URL."/modules.php?module=admin&what=list_user&u_id=".$refid."\">".$refid."</A>";\r
- }\r
- OUTPUT_HTML("</TD>\r
- <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$ip."</TD>\r
- <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$refid."</TD>\r
- <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$module."</TD>\r
- <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$action."</TD>\r
- <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$what."</TD>\r
- <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom\">".MAKE_DATETIME($time, "2")."</TD>\r
-</TR>");\r
- $SW = 3 - $SW;\r
- }\r
- OUTPUT_HTML("<TR>\r
- <TD colspan=\"8\" align=\"center\" class=\"admin_footer\">\r
- ".ONLINE_TIMEOUT_IS_1.CREATE_FANCY_TIME($CONFIG['online_timeout']).ONLINE_TIMEOUT_IS_2."\r
- </TD>\r
-</TR>\r
-</TABLE>");\r
-}\r
-//\r
-?>\r
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 02/02/2004 *
+ * ================ Last change: 07/13/2004 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : action-online.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Who is where? (DO NOT add sub menus!) *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Wer ist wo? (KEINE Untermenues anhaengen!) *
+ * -------------------------------------------------------------------- *
+ * *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
+{
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+ require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+OUTPUT_HTML ("</FONT><BR><BR>");
+
+// Count guests, members and admins
+$result_guests = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='N' AND is_member='N'", __FILE__, __LINE__);
+$result_members = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='N' AND is_member='Y'", __FILE__, __LINE__);
+$result_admins = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='Y'", __FILE__, __LINE__);
+
+OUTPUT_HTML("<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" width=\"170\" class=\"admin_table dashed\">
+<TR><TD colspan=\"5\" height=\"7\" class=\"seperator admin_title\"> </TD></TR>
+<TR>
+ <TD colspan=\"3\" class=\"admin_title\" align=\"center\">
+ <STRONG>".USER_NOW_ONLINE."</STRONG>
+ </TD>
+</TR>
+<TR><TD colspan=\"5\" height=\"7\" class=\"seperator admin_title\"> </TD></TR>
+<TR>
+ <TD width=\"85%\" class=\"top2 bottom2\" align=\"right\"><FONT class=\"medium\">".GUESTS_ONLINE.":</FONT></TD>
+ <TD width=\"5%\" class=\"top2 bottom2\"> </TD>
+ <TD width=\"10%\" class=\"top2 bottom2\"><B>".SQL_NUMROWS($result_guests)."</B></TD>
+</TR>
+<TR>
+ <TD width=\"85%\" class=\"bottom2\" align=\"right\"><FONT class=\"medium\">".MEMBERS_ONLINE.":</FONT></TD>
+ <TD width=\"5%\" class=\"bottom2\"> </TD>
+ <TD width=\"10%\" class=\"bottom2\"><B>".SQL_NUMROWS($result_members)."</B></TD>
+</TR>
+<TR>
+ <TD width=\"85%\" align=\"right\"><FONT class=\"medium\">".ADMINS_ONLINE.":</FONT></TD>
+ <TD width=\"5%\"> </TD>
+ <TD width=\"10%\"><B>".SQL_NUMROWS($result_admins)."</B></TD>
+</TR>
+</TABLE><BR>");
+
+$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)
+{
+ // Load header template
+ LOAD_TEMPLATE("admin_online_header");
+
+ // List all online users
+ $SW = 2;
+ while (list($id, $ip, $userid, $refid, $module, $action, $what, $mem, $admin, $time) = SQL_FETCHROW($result))
+ {
+ if ($action == "") $action = "---";
+ if ($what == "") $what = "---";
+
+ if ($admin == "Y")
+ {
+ // Is an administrator
+ $userid = _IS_ADMIN;
+ }
+ elseif (($mem == "N") && ($admin == "N"))
+ {
+ // Is a guest
+ $userid = _IS_GUEST;
+ }
+ OUTPUT_HTML("<TR>
+ <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$id."</TD>
+ <TD align=\"center\" width=\"15%\" class=\"switch_sw".$SW." bottom right\">");
+ if ($userid > 0)
+ {
+ OUTPUT_HTML("<A href=\"".URL."/modules.php?module=admin&what=list_user&u_id=".$userid."\">".$userid."</A>");
+ }
+ else
+ {
+ OUTPUT_HTML($userid);
+ }
+ if ($refid > 0)
+ {
+ $refid = "<A href=\"".URL."/modules.php?module=admin&what=list_user&u_id=".$refid."\">".$refid."</A>";
+ }
+ OUTPUT_HTML("</TD>
+ <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$ip."</TD>
+ <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$refid."</TD>
+ <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$module."</TD>
+ <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$action."</TD>
+ <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$what."</TD>
+ <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom\">".MAKE_DATETIME($time, "2")."</TD>
+</TR>");
+ $SW = 3 - $SW;
+ }
+ OUTPUT_HTML("<TR>
+ <TD colspan=\"8\" align=\"center\" class=\"admin_footer\">
+ ".ONLINE_TIMEOUT_IS_1.CREATE_FANCY_TIME($CONFIG['online_timeout']).ONLINE_TIMEOUT_IS_2."
+ </TD>
+</TR>
+</TABLE>");
+}
+//
+?>