From e2ce05fbbc3c8d2e1c45204d9374205f1d58f6fe Mon Sep 17 00:00:00 2001 From: e107steved Date: Mon, 13 Aug 2007 19:56:46 +0000 Subject: [PATCH] Bugtracker #3557 - Hard-coded LANs in footer --- e107_handlers/e107_class.php | 12 ++++++------ e107_languages/English/English.php | 18 ++++++++++++++++-- e107_themes/templates/footer_default.php | 24 ++++++++++++++---------- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 93c705dc3..ad7cb1abc 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -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); } diff --git a/e107_languages/English/English.php b/e107_languages/English/English.php index e7b3a9ce0..b64066f04 100644 --- a/e107_languages/English/English.php +++ b/e107_languages/English/English.php @@ -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"); diff --git a/e107_themes/templates/footer_default.php b/e107_themes/templates/footer_default.php index 483af3974..5dbf8261d 100644 --- a/e107_themes/templates/footer_default.php +++ b/e107_themes/templates/footer_default.php @@ -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'))