X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Faction-online.php;h=b8a82c357309015dcffaf32f4e606774e1aeedbc;hp=83a4079d60af37e3f18c1cc6751ff5dd2e74ad5b;hb=963e55ca1ea79e255f235e359cde9f7862191dc5;hpb=52e8a0635bd0b7c653845685c55e4e5f251375fe
diff --git a/inc/modules/guest/action-online.php b/inc/modules/guest/action-online.php
index 83a4079d60..b8a82c3573 100644
--- a/inc/modules/guest/action-online.php
+++ b/inc/modules/guest/action-online.php
@@ -32,13 +32,10 @@
************************************************************************/
// Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
-}
- elseif (!EXT_IS_ACTIVE("online"))
-{
+} elseif (!EXT_IS_ACTIVE("online")) {
// Just skip this extension
return;
}
@@ -49,15 +46,11 @@ $result_admins = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_ad
// Total visitors online
$total = SQL_NUMROWS($result_guests) + SQL_NUMROWS($result_members) + SQL_NUMROWS($result_admins);
-if ($_CONFIG['mad_counter'] < $total)
-{
+if ($_CONFIG['mad_count'] < $total) {
// Update counter
- $_CONFIG['mad_counter'] = $total;
- $_CONFIG['last_mad'] = time();
- $result_mad = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET mad_timestamp=%d, mad_count='%s' WHERE config=0 LIMIT 1",
- array($_CONFIG['last_mad'], $_CONFIG['mad_counter']), __FILE__, __LINE__);
-
- // Destroy cache
+ UPDATE_CONFIG(array("mad_timestamp", "mad_count"), array(time(), $total));
+ $_CONFIG['mad_count'] = $total;
+ $_CONFIG['last_mad'] = time();
}
// Put all values in constants for the template
@@ -68,10 +61,9 @@ define('ADMINS_ONLINE_CNT' , SQL_NUMROWS($result_admins));
// Output table
LOAD_TEMPLATE("online_now");
-if (EXT_IS_ACTIVE("active"))
-{
+if (EXT_IS_ACTIVE("active")) {
// Add link to "we were active today" page
- LOAD_TEMPLATE("guest_menu_bottom", false, "");
+ LOAD_TEMPLATE("guest_menu_bottom", false, "");
}
//