]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/action-online.php
Updated copyright notice as there are changes in this year
[mailer.git] / inc / modules / guest / action-online.php
index 3dd9737ab6c15ba8608c423d4937f50b21791d2f..80b71a4344e6859fde070e4361e87f8a57e1a50e 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 02/02/2004 *
- * ================                             Last change: 11/26/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 02/02/2004 *
+ * ===================                          Last change: 11/26/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : action-online.php                                *
  * $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                           *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * For more information visit: http://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 *
 
 // 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())) {
+       exit();
+} elseif ((!isExtensionActive('online')) && (!isAdmin())) {
        // Just skip this extension
        return;
+} elseif (!isBlockModeEnabled()) {
+       // Block mode detected
+       return;
 }
 
 // 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('UNIX_TIMESTAMP()', $total));
 } // END - if
 
 // Prepare content
 $content = array(
-       'guests'  => TRANSLATE_COMMA(GET_TOTAL_DATA("N", "online", "id", "is_admin", true, " AND is_member='N'")),
-       'members' => TRANSLATE_COMMA(GET_TOTAL_DATA("N", "online", "id", "is_admin", true, " AND is_member='Y'")),
-       'admins'  => TRANSLATE_COMMA(GET_TOTAL_DATA("Y", "online", "id", "is_admin", true))
+       'guests'  => countSumTotalData('N', 'online', 'id', 'is_admin', TRUE, " AND `is_member`='N'"),
+       'members' => countSumTotalData('N', 'online', 'id', 'is_admin', TRUE, " AND `is_member`='Y'"),
+       'admins'  => countSumTotalData('Y', 'online', 'id', 'is_admin', TRUE),
+       'total'   => $total
 );
 
 // Output table
-LOAD_TEMPLATE("online_now", false, $content);
+$GLOBALS['rows'] .= loadTemplate('online_now', TRUE, $content);
 
 // Add more links in this block
 runFilterChain('online_extra_links');
 
-//
+// [EOF]
 ?>