X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Faction-online.php;h=a01eb37653b35ae04bbbdca2bb6e92ca9f06d3cd;hb=d3c4fdd9bfab35389e1a5ff48f3952d527c7b4bb;hp=3745d190e41da2484f886104835f587f49c97e15;hpb=508228c85fba8448d00865b1639cb8cd7a69e457;p=mailer.git diff --git a/inc/modules/guest/action-online.php b/inc/modules/guest/action-online.php index 3745d190e4..a01eb37653 100644 --- a/inc/modules/guest/action-online.php +++ b/inc/modules/guest/action-online.php @@ -10,14 +10,14 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Wer ist wo? (KEINE Untermenues anhaengen!) * * -------------------------------------------------------------------- * - * $Revision:: 856 $ * + * $Revision:: $ * * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * * Needs to be in all Files and every File needs "svn propset * * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * - * Copyright (c) 2003 - 2008 by Roland Haeder * + * Copyright (c) 2003 - 2009 by Roland Haeder * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -38,37 +38,36 @@ // Some security stuff... if (!defined('__SECURITY')) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; - require($INC); -} elseif ((!EXT_IS_ACTIVE("online")) && (!IS_ADMIN())) { + die(); +} elseif ((!isExtensionActive('online')) && (!isAdmin())) { // Just skip this extension return; -} elseif (defined('GUESTS_ONLINE_CNT')) { - // Skip it if already executed +} elseif (!isBlockModeEnabled()) { + // Block mode detected return; } -$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__); - // Total visitors online -$total = SQL_NUMROWS($result_guests) + SQL_NUMROWS($result_members) + SQL_NUMROWS($result_admins); +$total = countSumTotalData('', 'online', 'id', 'userid', true); + if (getConfig('mad_count') < $total) { // Update counter - UPDATE_CONFIG(array("mad_timestamp", "mad_count"), array(time(), $total)); + updateConfiguration(array('mad_timestamp', 'mad_count'), array(time(), $total)); } // END - if -// Put all values in constants for the template -define('GUESTS_ONLINE_CNT' , SQL_NUMROWS($result_guests)); -define('MEMBERS_ONLINE_CNT', SQL_NUMROWS($result_members)); -define('ADMINS_ONLINE_CNT' , SQL_NUMROWS($result_admins)); +// Prepare content +$content = array( + 'guests' => translateComma(countSumTotalData('N', 'online', 'id', 'is_admin', true, " AND `is_member`='N'")), + 'members' => translateComma(countSumTotalData('N', 'online', 'id', 'is_admin', true, " AND `is_member`='Y'")), + 'admins' => translateComma(countSumTotalData('Y', 'online', 'id', 'is_admin', true)), + 'total' => translateComma($total) +); // Output table -LOAD_TEMPLATE("online_now"); +$GLOBALS['rows'] .= loadTemplate('online_now', true, $content); // Add more links in this block runFilterChain('online_extra_links'); -// +// [EOF] ?>