templates/de/html/ext/ext_wernis.tpl -text
templates/de/html/fatal_footer.tpl -text
templates/de/html/fatal_header.tpl -text
+templates/de/html/footer_stats.tpl -text
templates/de/html/guest/.htaccess -text
templates/de/html/guest/guest_active_none_row.tpl -text
templates/de/html/guest/guest_active_row.tpl -text
require_once("inc/libs/security_functions.php");
// Init "action" and "what"
-global $what, $action;
+global $what, $action, $startTime;
+$GLOBALS['startTime'] = microtime(true);
$GLOBALS['what'] = ""; $GLOBALS['action'] = "";
// Set module
require_once("inc/libs/security_functions.php");
// Init "action" and "what"
-global $what, $action;
+global $what, $action, $startTime;
+$GLOBALS['startTime'] = microtime(true);
$GLOBALS['what'] = ""; $GLOBALS['action'] = "";
// Set module
".MYSQL_QUERY_STRING."<br />
".$sql_string);
- // Debug output
- //* DEBUG: */ print "Query=<em>".$sql_string."</em>, affected=<b>".SQL_AFFECTEDROWS()."</b>, numrows=<b>".SQL_NUMROWS($result)."</b><br />\n";
+ // Count this query
+ if (!isset($CONFIG['sql_count'])) $CONFIG['sql_count'] = 0;
+ $CONFIG['sql_count']++;
+
+ // Debug output
+ //* DEBUG: */ print "Query=<em>".$sql_string."</em>, affected=<b>".SQL_AFFECTEDROWS()."</b>, numrows=<b>".SQL_NUMROWS($result)."</b><br />\n";
if (($CSS != "1") && ($CSS != "-1") && (DEBUG_MODE) && (DEBUG_SQL))
{
}
// Version number
-$EXT_VERSION = "0.4.0";
+$EXT_VERSION = "0.4.1";
// Auto-set extension version
if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0");
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1");
switch ($EXT_LOAD_MODE)
{
break;
case "0.4.1": // SQL queries for v0.4.1
- $SQLs[] = " ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP INDEX `status` , ADD INDEX `status` ( `status` , `max_mails` )";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP INDEX `status` , ADD INDEX `status` ( `status` , `max_mails` )";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `show_timings` ENUM ('Y','N') NOT NULL DEFAULT 'Y'";
// Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Tabellen-Schlüssel neu gesetzt.";
+ $UPDATE_NOTES = "Tabellen-Schlüssel neu gesetzt und Parsing-Zeit im Footer eingeblendet.";
break;
}
break;
$CONFIG['file_hash'] = trim($DUMMY['file_hash']);
$CONFIG['master_salt'] = trim($DUMMY['master_salt']);
$CONFIG['secret_key'] = "";
+ $CONFIG['show_timings'] = $DUMMY['show_timings'];
// Read key from secret file
if ((empty($CONFIG['file_hash'])) || (empty($CONFIG['master_salt'])) || (empty($CONFIG['pass_scramble'])))
LOAD_TEMPLATE("copyright");
}
+ // Shall we display the parsing time and number of queries?
+ if ($CONFIG['show_timings'] == "Y") {
+ // Then display it here
+ DISPLAY_PARSING_TIME_FOOTER();
+ }
+
// Load page footer
LOAD_TEMPLATE("page_footer");
// Load a template file and return it's content (only it's name; do not use ' or ")
function LOAD_TEMPLATE($template, $return=false, $content="") {
// Add more variables which you want to use in your template files
- global $DATA, $username;
+ global $DATA, $CONFIG, $username;
+
+ // Count the template load
+ if (!isset($CONFIG['num_templates'])) $CONFIG['num_templates'] = 0;
+ $CONFIG['num_templates']++;
+
+ // Init some data
$ACTION = SQL_ESCAPE($GLOBALS['action']);
$WHAT = SQL_ESCAPE($GLOBALS['what']);
$ret = "";
// Exit explicitly
exit;
}
+
+// Display parsing time and number of SQL queries in footer
+function DISPLAY_PARSING_TIME_FOOTER() {
+ global $startTime, $CONFIG;
+ $endTime = microtime(true);
+
+ // Is the timer started?
+ if (!isset($GLOBALS['startTime'])) {
+ // Abort here
+ return false;
+ }
+
+ // "Explode" both times
+ $start = explode(" ", $GLOBALS['startTime']);
+ $end = explode(" ", $endTime);
+ $runTime = $end[0] - $start[0];
+ if ($runTime < 0) $runTime = 0;
+ $runTime = TRANSLATE_COMMA($runTime);
+
+ // Prepare output
+ $content = array(
+ 'runtime' => $runTime,
+ 'numSQLs' => ($CONFIG['sql_count'] + 1),
+ 'numTemplates' => ($CONFIG['num_templates'] + 1)
+ );
+
+ // Load the template
+ LOAD_TEMPLATE("footer_stats", false, $content);
+}
+
//
//////////////////////////////////////////////
// //
define('ADMIN_USER_CONTACTED', "Das Mitglied wurde per EMail kontaktiert.");
define('ADMIN_CONTACT_USER_SUBJECT', "Nachricht vom {!MT_WORD!} {!MAIN_TITLE!}");
define('MEMBER_CANNOT_LOAD_PROFILE', "Fehler beim Laden des Mitgliederprofiles. Bitte Support benachrichten.");
+define('FOOTER_STATS_RUNTIME', "Laufzeit:");
+define('FOOTER_STATS_SQL_QUERIES', "SQL-Abfragen:");
+define('FOOTER_STATS_NUM_TEMPLATES', "Templates:");
+define('FOOTER_STATS_SECS', "Sek.");
//
?>
// Return status
return $ret;
}
+
//
?>
require_once("inc/libs/security_functions.php");
// Init "action" and "what"
-global $what, $action;
+global $what, $action, $startTime;
+$GLOBALS['startTime'] = microtime(true);
$GLOBALS['what'] = ""; $GLOBALS['action'] = "";
// Set module
require_once ("inc/libs/security_functions.php");
// Init "action" and "what"
-global $what, $action;
+global $what, $action, $startTime;
+$GLOBALS['startTime'] = microtime(true);
$CSS = 0;
$GLOBALS['what'] = ""; $GLOBALS['action'] = "";
$GLOBALS['userid'] = 0;
+
if (!empty($_GET['action'])) $GLOBALS['action'] = secureString($_GET['action']);
if (!empty($_GET['what'])) $GLOBALS['what'] = secureString($_GET['what']);
if (empty($_GET['module'])) $_GET['module'] = "index";
require_once("inc/libs/security_functions.php");
// Init "action" and "what"
-global $what, $action;
+global $what, $action, $startTime;
+$GLOBALS['startTime'] = microtime(true);
$GLOBALS['what'] = ""; $GLOBALS['action'] = "";
// Set this because we have no module in URI
--- /dev/null
+<DIV align="center">
+ <DIV id="footer_stats_block">
+ <DIV class="footer_stats_column" style="float:right; margin-right: 2px">
+ {--FOOTER_STATS_NUM_TEMPLATES--} <SPAN class="footer_stats_data">$content[numTemplates]</SPAN>
+ </DIV>
+ <DIV class="footer_stats_column" style="float: left; margin-left: 2px">
+ {--FOOTER_STATS_RUNTIME--} <SPAN class="footer_stats_data">$content[runtime]</SPAN> {--FOOTER_STATS_SECS--}
+ </DIV>
+ <DIV class="footer_stats_column" align="center">
+ {--FOOTER_STATS_SQL_QUERIES--} <SPAN class="footer_stats_data">$content[numSQLs]</SPAN>
+ </DIV>
+ </DIV>
+</DIV>
}
.theme_box {
- border : 1px solid #000000;
- border-top : 0px;
+ border : 1px solid #000000;
+ border-top : 0px;
width : 100%;
height : 70px;
- background-color : #FFFFFF;
+ background-color : #FFFFFF;
}
.theme_note {
.admin_message {
margin-bottom : 15px;
}
+
+#footer_stats_block {
+ margin-top : 5px;
+ tex-align : center;
+ border : solid 1px;
+ border-color : #000000;
+ background-color : #EEEEFF;
+ font-size : 10px;
+ vertical-align : middle;
+ width : 465px;
+ height : 22px;
+ z-index : 0;
+}
+
+.footer_stats_column {
+ z-index : 10;
+ top : 3px;
+ background-color : #FFFFFF;
+ position : relative;
+ margin : 0px;
+ width : 150px;
+ display : block;
+ border : solid 1px;
+ border-color : #000000;
+}
+
+.footer_stats_data {
+ font-weight : bold;
+}
.admin_message {
margin-bottom : 15px;
}
+
+#footer_stats_block {
+ margin-top : 5px;
+ tex-align : center;
+ border : solid 1px;
+ border-color : #AA0044;
+ background-color : #ddeedd;
+ font-size : 10px;
+ vertical-align : middle;
+ width : 465px;
+ height : 22px;
+ z-index : 0;
+}
+
+.footer_stats_column {
+ z-index : 10;
+ top : 3px;
+ background-color : #EEFFEE;
+ position : relative;
+ margin : 0px;
+ width : 150px;
+ display : block;
+ border : solid 1px;
+ border-color : #009900;
+}
+
+.footer_stats_data {
+ font-weight : bold;
+}
body {
background-color : #FFFFCC;
- color : #880000;
- font-family : Verdana, Arial, Geneva, Helvetica, sans-serif;
+ color : #880000;
+ font-family : Verdana, Arial, Geneva, Helvetica, sans-serif;
font-size : 12px;
letter-spacing : 1px;
.admin_message {
margin-bottom : 15px;
}
+
+#footer_stats_block {
+ margin-top : 5px;
+ tex-align : center;
+ border : solid 1px;
+ border-color : #880000;
+ background-color : #DDDDAA;
+ font-size : 10px;
+ vertical-align : middle;
+ width : 465px;
+ height : 22px;
+ z-index : 0;
+}
+
+.footer_stats_column {
+ z-index : 10;
+ top : 3px;
+ background-color : #FFFFCC;
+ position : relative;
+ margin : 0px;
+ width : 150px;
+ display : block;
+ border : solid 1px;
+ border-color : #880000;
+}
+
+.footer_stats_data {
+ font-weight : bold;
+}