1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-20 20:51:53 +02:00

Bugtracker #3557 - Hard-coded LANs in footer

This commit is contained in:
e107steved 2007-08-13 19:56:46 +00:00
parent 74b010a5b7
commit e2ce05fbbc
3 changed files with 36 additions and 18 deletions

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
| $Revision: 1.8 $
| $Date: 2007-07-12 21:34:39 $
| $Revision: 1.9 $
| $Date: 2007-08-13 19:56:35 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -243,21 +243,21 @@ class e107{
// Return a memory value formatted helpfully
function ret_memory_text($memusage)
{
$memunit = 'b';
$memunit = CORE_LAN_B;
if ($memusage > 65536)
{
$memusage = $memusage / 1024; // more than 64k, show in k
$memunit = 'kb';
$memunit = CORE_LAN_KB;
}
if ($memusage > 1024)
{ /* 1.002 mb, etc */
$memusage = $memusage / 1024;
$memunit = 'Mb';
$memunit = CORE_LAN_MB;
}
if ($memusage > 1024)
{ /* show in GB if >1GB */
$memusage = $memusage / 1024;
$memunit = 'Gb';
$memunit = CORE_LAN_GB;
}
return (number_format($memusage, ($memunit=='b'? 0 : 3)).$memunit);
}

View File

@ -4,8 +4,8 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/English.php,v $
| $Revision: 1.2 $
| $Date: 2007-05-28 18:02:47 $
| $Revision: 1.3 $
| $Date: 2007-08-13 19:56:41 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -31,6 +31,20 @@ define("CORE_LAN8", "Core Prefs Error");
define("CORE_LAN9", "Core could not restore from automatic backup. Execution halted.");
define("CORE_LAN10", "Corrupted cookie detected - logged out.");
// Footer
define("CORE_LAN11", "Render time: ");
define("CORE_LAN12", " sec (");
define("CORE_LAN13", " % of that for queries)");
define("CORE_LAN14", "%2.3f cpu sec (%2.2f%% load, %2.3f startup). Clock: ");
define("CORE_LAN15", "DB queries: ");
define("CORE_LAN16", "Memory: ");
define("CORE_LAN_B", "b");
define("CORE_LAN_KB", "kb");
define("CORE_LAN_MB", "Mb");
define("CORE_LAN_GB", "Gb");
define("CORE_LAN_TB", "Tb");
define("LAN_WARNING", "Warning!");
define("LAN_ERROR", "Error");

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_themes/templates/footer_default.php,v $
| $Revision: 1.9 $
| $Date: 2007-06-21 19:40:43 $
| $Revision: 1.10 $
| $Date: 2007-08-13 19:56:46 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -77,7 +77,8 @@ if(varset($e107_popup)!=1){
$memuse = $e107->get_memory_usage(); // Memory at end, in B/KB/MB/GB ;)
$rinfo = '';
if ( function_exists( 'getrusage' ) ) {
if ( function_exists( 'getrusage' ) )
{
$ru = getrusage();
$cpuUTime = $ru['ru_utime.tv_sec'] + ($ru['ru_utime.tv_usec'] * 1e-6);
$cpuSTime = $ru['ru_stime.tv_sec'] + ($ru['ru_stime.tv_usec'] * 1e-6);
@ -102,15 +103,18 @@ if(varset($e107_popup)!=1){
// $logname = "/home/mysite/public_html/queryspeed.log";
// $logfp = fopen($logname, 'a+'); fwrite($logfp, "$cpuTot,$cpuPct,$cpuStart,$rendertime,$db_time\n"); fclose($logfp);
if($pref['displayrendertime']){
$rinfo .= "Render time: ";
if (isset($cpuTime)) {
$rinfo .= "{$cpuTime} cpu sec ({$cpuPct}% load, {$cpuStart} startup). Clock: ";
if($pref['displayrendertime'])
{
$rinfo .= CORE_LAN11;
if (isset($cpuTime))
{
// $rinfo .= "{$cpuTime} cpu sec ({$cpuPct}% load, {$cpuStart} startup). Clock: ";
$rinfo .= sprintf(CORE_LAN14,$cpuTime,$cpuPct,$cpuStart);
}
$rinfo .= "{$rendertime} sec ({$dbPercent}% for queries). ";
$rinfo .= $rendertime.CORE_LAN_12.$dbPercent.CORE_LAN13;
}
if($pref['displaysql']){ $rinfo .= "DB queries: ".$sql -> db_QueryCount().". "; }
if(isset($pref['display_memory_usage']) && $pref['display_memory_usage']){ $rinfo .= "Memory: ".$memuse; }
if($pref['displaysql']){ $rinfo .= CORE_LAN15.$sql -> db_QueryCount().". "; }
if(isset($pref['display_memory_usage']) && $pref['display_memory_usage']){ $rinfo .= CORE_LAN16.$memuse; }
if(isset($pref['displaycacheinfo']) && $pref['displaycacheinfo']){ $rinfo .= $cachestring."."; }
if (function_exists('theme_renderinfo'))