From 9e306bf06ee465aeac620986f2dd134be25b91ee Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Tue, 2 Jul 2013 09:00:01 +0200 Subject: [PATCH] Potential fix for PHP Warning This should fix #327 --- public/include/smarty_globals.inc.php | 4 +++- public/templates/mmcFE/global/header.tpl | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index a9b0fdde..ede677cb 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -18,9 +18,11 @@ if (@$_SESSION['AUTHENTICATED']) { $dDifficulty = $bitcoin->query('getdifficulty'); if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty)) $dDifficulty = $dDifficulty['proof-of-work']; - $dNetworkHashrate = $bitcoin->query('getnetworkhashps'); } } +// Always fetch this since we need for ministats header +if ($bitcoin->can_connect() === true) + $dNetworkHashrate = $bitcoin->query('getnetworkhashps'); // Fetch some data $iCurrentActiveWorkers = $worker->getCountAllActiveWorkers(); diff --git a/public/templates/mmcFE/global/header.tpl b/public/templates/mmcFE/global/header.tpl index 48ac9ebd..89670daa 100644 --- a/public/templates/mmcFE/global/header.tpl +++ b/public/templates/mmcFE/global/header.tpl @@ -5,7 +5,7 @@ {if $GLOBAL.config.price.currency}{/if} - +
  • {$GLOBAL.config.currency}/{$GLOBAL.config.price.currency}: {$GLOBAL.price|default:"n/a"|number_format:"4"}    
  • Network Hashrate: {($GLOBAL.nethashrate / 1000 / 1000 / 1000)|number_format:"3"} GH/s    
  • Network Hashrate: {($GLOBAL.nethashrate / 1000 / 1000 / 1000)|default:"0"|number_format:"3"} GH/s    
  • Pool Hashrate: {($GLOBAL.hashrate / 1000)|number_format:"3"} MH/s    
  • Pool Sharerate: {$GLOBAL.sharerate|number_format:"2"} Shares/s    
  • Pool Workers: {$GLOBAL.workers}