adding pool hashrate, active workers and round shares to smarty globals

This commit is contained in:
Sebastian Grewe 2013-05-13 23:33:30 +02:00
parent 170a653f61
commit b20a2eb657

View File

@ -7,14 +7,32 @@ if (!defined('SECURITY'))
// Globally available variables // Globally available variables
$debug->append('Global smarty variables', 3); $debug->append('Global smarty variables', 3);
if (!$iRoundShares = $memcache->get('iRoundShares')) {
$debug->append('Fetching iRoundShares from database');
$iRoundShares = $share->getRoundShares();
$memcache->set('iRoundShares', $iRoundShares, 60);
}
if (!$iCurrentActiveWorkers = $memcache->get('iCurrentActiveWorkers')) {
$debug->append('Fetching iCurrentActiveWorkers from database');
$iCurrentActiveWorkers = $worker->getCountAllActiveWorkers();
$memcache->set('iCurrentActiveWorkers', $iCurrentActiveWorkers, 60);
}
if (!$iCurrentPoolHashrate = $memcache->get('iCurrentPoolHashrate')) {
$debug->append('Fetching iCurrentPoolHashrate from database');
$iCurrentPoolHashrate = $statistics->getCurrentHashrate();
$memcache->set('iCurrentPoolHashrate', $iCurrentPoolHashrate, 60);
}
$aGlobal = array( $aGlobal = array(
'userdata' => $_SESSION['USERDATA']['id'] ? $user->getUserData($_SESSION['USERDATA']['id']) : array(), 'userdata' => $_SESSION['USERDATA']['id'] ? $user->getUserData($_SESSION['USERDATA']['id']) : array(),
'slogan' => $settings->getValue('slogan'), 'slogan' => $settings->getValue('slogan'),
'websitename' => $settings->getValue('websitename'), 'websitename' => $settings->getValue('websitename'),
'ltc_usd' => $settings->getValue('btcesell'), 'ltc_usd' => $settings->getValue('btcesell'),
'hashrate' => $settings->getValue('currenthashrate'), 'hashrate' => $iCurrentPoolHashrate,
'workers' => $worker->getCountAllActiveWorkers(), 'workers' => $iCurrentActiveWorkers,
'currentroundshares' => $settings->getValue('currentroundshares'), 'currentroundshares' => $iRoundShares,
'statstime' => $settings->getValue('statstime'), 'statstime' => $settings->getValue('statstime'),
'motd' => $settings->getValue('motd'), 'motd' => $settings->getValue('motd'),
'confirmations' => $config['confirmations'] 'confirmations' => $config['confirmations']