From 666fde91b6d0a9863cc57e39aeff9b62947fae4f Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sun, 9 Jun 2013 17:29:38 +0200 Subject: [PATCH] adding PPS value to sidebard --- public/include/smarty_globals.inc.php | 6 ++++++ public/templates/mmcFE/global/sidebar.tpl | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index fa5c7923..d37e45cc 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -12,12 +12,18 @@ $aRoundShares = $statistics->getRoundShares(); $iCurrentActiveWorkers = $worker->getCountAllActiveWorkers(); $iCurrentPoolHashrate = $statistics->getCurrentHashrate(); $iCurrentPoolShareRate = $statistics->getCurrentShareRate(); +if ($bitcoin->can_connect() === true){ + $dDifficulty = $bitcoin->query('getdifficulty'); +} else { + $dDifficulty = 1; +} $aGlobal = array( 'slogan' => $config['website']['slogan'], 'websitename' => $config['website']['name'], 'hashrate' => $iCurrentPoolHashrate, 'sharerate' => $iCurrentPoolShareRate, + 'ppsvalue' => number_format(round(50 / (pow(2,32) * $dDifficulty) * pow(2, $config['difficulty']), 12) ,12), 'workers' => $iCurrentActiveWorkers, 'roundshares' => $aRoundShares, 'fees' => $config['fees'], diff --git a/public/templates/mmcFE/global/sidebar.tpl b/public/templates/mmcFE/global/sidebar.tpl index 21a8e0aa..05f6e00e 100644 --- a/public/templates/mmcFE/global/sidebar.tpl +++ b/public/templates/mmcFE/global/sidebar.tpl @@ -6,8 +6,17 @@
- - + + + + + + + + + + +