]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-cache_stats.php
A lot CSS classes rewritten, please update all your themes.
[mailer.git] / inc / modules / admin / what-cache_stats.php
index fa39e2a5d53c83de35c962777618a0d14789aec3..cfcd33e1f1ae477ae6e59a8e5bea3ce166f1521b 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                             *
@@ -17,7 +17,8 @@
  * 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                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  ************************************************************************/
 
 // Some security stuff...
-if ((!defined('__SECURITY')) || (!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', __FILE__);
-
-// Calculate total hits
-$totalHits = (getConfig('db_hits') + getConfig('cache_hits'));
+addMenuDescription('admin', __FILE__);
 
-// Prepare data for the template
-define('__DB_HITS'   , TRANSLATE_COMMA(getConfig('db_hits')));
-define('__CACHE_HITS', TRANSLATE_COMMA(getConfig('cache_hits')));
-define('__TOTAL_HITS', TRANSLATE_COMMA($totalHits));
-define('__CACHE_PERC', TRANSLATE_COMMA((getConfig('cache_hits') / $totalHits * 100)));
+// Activated?
+if (ifStatsAreEnabled()) {
+       // Prepare data for the template
+       $content['db_hits']    = getStatsEntry('db_hits');
+       $content['cache_hits'] = getStatsEntry('cache_hits');
+       $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
+       loadTemplate('admin_settings_saved', false, '{--ADMIN_CACHE_DB_STATS_DEACTIVATED--}');
+}
 
-//
+// [EOF]
 ?>