<?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 *
* 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' , translateComma(getConfig('db_hits')));
-define('__CACHE_HITS', translateComma(getConfig('cache_hits')));
-define('__TOTAL_HITS', translateComma($totalHits));
-define('__CACHE_PERC', translateComma((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]
?>