-<?php\r
-/************************************************************************\r
- * MXChange v0.2.1 Start: 11/26/2004 *\r
- * ================ Last change: 11/26/2004 *\r
- * *\r
- * -------------------------------------------------------------------- *\r
- * File : what-active.php *\r
- * -------------------------------------------------------------------- *\r
- * Short description : Today active members list *\r
- * -------------------------------------------------------------------- *\r
- * Kurzbeschreibung : Liste heutiger aktiver Mitglieder *\r
- * -------------------------------------------------------------------- *\r
- * *\r
- * -------------------------------------------------------------------- *\r
- * Copyright (c) 2003 - 2008 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
- elseif ((!EXT_IS_ACTIVE("active")) && (!IS_ADMIN()))\r
-{\r
- ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "active");\r
- return;\r
-}\r
-\r
-// Add description as navigation point\r
-ADD_DESCR("guest", basename(__FILE__));\r
-\r
-// The day normally starts on 00:00:00, so let's subtract current hours/minutes/seconds from current time stamp!\r
-$START = time() - date("H", time())*60*60 - date("m", time())*60 - date("s", time());\r
-\r
-// Check for members who were active only this day\r
-$ADD = "uid";\r
-if (EXT_IS_ACTIVE("nickname")) $ADD = "nickname";\r
-\r
-$result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", last_online\r
-FROM "._MYSQL_PREFIX."_user_data\r
-WHERE last_online >= %s AND status='CONFIRMED'\r
-ORDER BY last_online DESC LIMIT %s",\r
- array($START, $CONFIG['active_limit']), __FILE__, __LINE__);\r
-\r
-if (SQL_NUMROWS($result) > 0)\r
-{\r
- // At least one member was online so let's load them all\r
- $OUT = ""; $SW = 2;\r
- while(list($uid, $nick, $last) = SQL_FETCHROW($result))\r
- {\r
- $nick2 = "---";\r
- if (($nick != $uid) && (!empty($nick))) $nick2 = $nick;\r
-\r
- // Transfer data to array\r
- $content = array(\r
- 'sw' => $SW,\r
- 'uid' => $uid,\r
- 'nick' => $nick2,\r
- 'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points")),\r
- 'last' => MAKE_DATETIME($last, "2"),\r
- );\r
-\r
- // Load template\r
- $OUT .= LOAD_TEMPLATE("guest_active_row", true, $content);\r
-\r
- // Switch colors\r
- $SW = 3 - $SW;\r
- }\r
-}\r
- else\r
-{\r
- // No member was online today! :-(\r
- $OUT = LOAD_TEMPLATE("guest_active_none_row", true);\r
-}\r
-\r
-// Remember output in constant\r
-define('__ACTIVE_ROWS', $OUT);\r
-\r
-// Load template\r
-LOAD_TEMPLATE("guest_active_table");\r
-\r
-//\r
-?>\r
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 11/26/2004 *
+ * ================ Last change: 11/26/2004 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-active.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Today active members list *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Liste heutiger aktiver Mitglieder *
+ * -------------------------------------------------------------------- *
+ * *
+ * -------------------------------------------------------------------- *
+ * 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);
+}
+ elseif ((!EXT_IS_ACTIVE("active")) && (!IS_ADMIN()))
+{
+ ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "active");
+ return;
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// The day normally starts on 00:00:00, so let's subtract current hours/minutes/seconds from current time stamp!
+$START = time() - date("H", time())*60*60 - date("m", time())*60 - date("s", time());
+
+// Check for members who were active only this day
+$ADD = "uid";
+if (EXT_IS_ACTIVE("nickname")) $ADD = "nickname";
+
+$result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", last_online
+FROM "._MYSQL_PREFIX."_user_data
+WHERE last_online >= %s AND status='CONFIRMED'
+ORDER BY last_online DESC LIMIT %s",
+ array($START, $CONFIG['active_limit']), __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result) > 0)
+{
+ // At least one member was online so let's load them all
+ $OUT = ""; $SW = 2;
+ while(list($uid, $nick, $last) = SQL_FETCHROW($result))
+ {
+ $nick2 = "---";
+ if (($nick != $uid) && (!empty($nick))) $nick2 = $nick;
+
+ // Transfer data to array
+ $content = array(
+ 'sw' => $SW,
+ 'uid' => $uid,
+ 'nick' => $nick2,
+ 'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points")),
+ 'last' => MAKE_DATETIME($last, "2"),
+ );
+
+ // Load template
+ $OUT .= LOAD_TEMPLATE("guest_active_row", true, $content);
+
+ // Switch colors
+ $SW = 3 - $SW;
+ }
+}
+ else
+{
+ // No member was online today! :-(
+ $OUT = LOAD_TEMPLATE("guest_active_none_row", true);
+}
+
+// Remember output in constant
+define('__ACTIVE_ROWS', $OUT);
+
+// Load template
+LOAD_TEMPLATE("guest_active_table");
+
+//
+?>