]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-cache_stats.php
Updated copyright notice as there are changes in this year
[mailer.git] / inc / modules / admin / what-cache_stats.php
index 69a69481052cc7a2e02eb6f54493eccdc8869ade..735b3a3abc420a77199357ac712f27aeaf16a03c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 04/29/2005 *
- * ================                             Last change: 04/29/2005 *
+ * Mailer v0.2.1-FINAL                                Start: 04/29/2005 *
+ * ===================                          Last change: 04/29/2005 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-cache_stats.php                             *
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Statistiken fuer die Cache-Erweiterung           *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
- * 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 ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin()))
-{
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-}
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
+} // END - if
 
 // Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+addYouAreHereLink('admin', __FILE__);
 
-// Prepare data for the template
-define('__DB_HITS'   , $CONFIG['db_hits']);
-$HITS = str_repeat("&nbsp;", abs(strlen($CONFIG['db_hits']) - strlen($CONFIG['cache_hits']))).$CONFIG['cache_hits'];
-define('__CACHE_HITS', $HITS);
-define('__TOTAL_HITS', ($CONFIG['db_hits'] + $CONFIG['cache_hits']));
-define('__CACHE_PERC', TRANSLATE_COMMA(($CONFIG['cache_hits'] / __TOTAL_HITS  * 100)));
+// Activated?
+if (ifInternalStatsEnabled()) {
+       // Prepare data for the template
+       $content['total_hits'] = (getStatsEntry('db_hits') + getStatsEntry('cache_hits'));
+       $content['cache_perc'] = (getStatsEntry('cache_hits') / $content['total_hits'] * 100);
 
-// Load template
-LOAD_TEMPLATE("admin_cache_stats");
+       // Load template
+       loadTemplate('admin_cache_stats', FALSE, $content);
+} else {
+       // Deactivated, which is good for performance
+       displayMessage('{--ADMIN_CACHE_DB_STATS_DEACTIVATED--}');
+}
 
-//
+// [EOF]
 ?>