Merge pull request #744 from obigal/pplns-stats

Pplns stats
This commit is contained in:
Sebastian Grewe 2013-10-25 00:50:16 -07:00
commit 1c2b84bb50
26 changed files with 909 additions and 105 deletions

View File

@ -46,7 +46,9 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
// We support some dynamic share targets but fall back to our fixed value
// Re-calculate after each run due to re-targets in this loop
if ($config['pplns']['shares']['type'] == 'blockavg' && $block->getBlockCount() > 0) {
$pplns_target = round($block->getAvgBlockShares($aBlock['height'], $config['pplns']['blockavg']['blockcount']));
$pplns_target = round($block->getAvgBlockShares($aBlock['height'], $config['pplns']['blockavg']['blockcount']));
} else if ($config['pplns']['shares']['type'] == 'dynamic' && $block->getBlockCount() > 0) {
$pplns_target = round($block->getAvgBlockShares($aBlock['height'], $config['pplns']['blockavg']['blockcount']) * (100 - $config['pplns']['dynamic']['percent'])/100 + $aBlock['shares'] * $config['pplns']['dynamic']['percent']/100);
} else {
$pplns_target = $config['pplns']['shares']['default'];
}
@ -66,6 +68,8 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
$config['reward_type'] == 'block' ? $dReward = $aBlock['amount'] : $dReward = $config['reward'];
$aRoundAccountShares = $share->getSharesForAccounts($iPreviousShareId, $aBlock['share_id']);
$log->logInfo('Shares: ' . $iRoundShares . "\t" . 'Height: ' . $aBlock['height'] . ' Amount: ' . $aBlock['amount'] . "\t" . 'Found by ID: ' . $aBlock['account_id']);
if ($iRoundShares >= $pplns_target) {
$log->logDebug("Matching or exceeding PPLNS target of $pplns_target with $iRoundShares");
$iMinimumShareId = $share->getMinimumShareId($pplns_target, $aBlock['share_id']);
@ -81,7 +85,7 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
foreach($aAccountShares as $key => $aData) {
$iNewRoundShares += $aData['valid'];
}
$log->logInfo('Adjusting round target to PPLNS target ' . $iNewRoundShares);
$log->logInfo('Adjusting round to PPLNS target of ' . $pplns_target . ' shares used ' . $iNewRoundShares);
$iRoundShares = $iNewRoundShares;
} else {
$log->logDebug("Not able to match PPLNS target of $pplns_target with $iRoundShares");
@ -114,6 +118,24 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
$aAccountShares[$key]['invalid'] += $aArchiveShares[$aData['username']]['invalid'];
}
}
// reverse payout
if ($config['pplns']['reverse_payout']) {
$aSharesData = NULL;
foreach($aAccountShares as $key => $aData) {
$aSharesData[$aData['username']] = $aData;
}
// Add users from archive not in current round
foreach($aArchiveShares as $key => $aArchData) {
if (!array_key_exists($aArchData['account'], $aSharesData)) {
$log->logDebug('Adding user ' . $aArchData['account'] . ' to round shares');
$log->logDebug(' valid : ' . $aArchData['valid']);
$log->logDebug(' invalid : ' . $aArchData['invalid']);
$aArchData['username'] = $aArchData['account'];
$aSharesData[$aArchData['account']] = $aArchData;
}
}
$aAccountShares = $aSharesData;
}
}
// We tried to fill up to PPLNS target, now we need to check the actual shares to properly payout users
foreach($aAccountShares as $key => $aData) {
@ -162,6 +184,19 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
$log->logError('Failed to update share statistics for ' . $aData['username']);
}
// Add PPLNS share statistics
foreach ($aAccountShares as $key => $aRoundData) {
if ($aRoundData['username'] == $aData['username']){
if (@$statistics->getIdShareStatistics($aRoundData, $aBlock['id'])){
if (!$statistics->updatePPLNSShareStatistics($aRoundData, $aBlock['id']))
$log->logError('Failed to update pplns statistics for ' . $aData['username']);
} else {
if (!$statistics->insertPPLNSShareStatistics($aRoundData, $aBlock['id']))
$log->logError('Failed to insert pplns statistics for ' . $aData['username']);
}
}
}
// Add new credit transaction
if (!$transaction->addTransaction($aData['id'], $aData['payout'], 'Credit', $aBlock['id']))
$log->logFatal('Failed to insert new Credit transaction to database for ' . $aData['username']);

View File

@ -56,20 +56,51 @@ class RoundStats {
return false;
}
/**
* search for block height
**/
public function searchForBlockHeight($iHeight=0) {
$stmt = $this->mysqli->prepare("
SELECT height
FROM $this->tableBlocks
WHERE height >= ?
ORDER BY height ASC
LIMIT 1");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_object()->height;
return false;
}
/**
* get next block for stats paging
**/
public function getNextBlockForStats($iHeight=0, $limit=10) {
$stmt = $this->mysqli->prepare("
SELECT MAX(x.height) AS height
FROM (SELECT height FROM $this->tableBlocks
WHERE height >= ?
ORDER BY height ASC LIMIT ?) AS x");
if ($this->checkStmt($stmt) && $stmt->bind_param("ii", $iHeight, $limit) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_object()->height;
return false;
}
/**
* Get details for block height
* @param height int Block Height
* @return data array Block information from DB
**/
public function getDetailsForBlockHeight($iHeight=0, $isAdmin=0) {
public function getDetailsForBlockHeight($iHeight=0) {
$stmt = $this->mysqli->prepare("
SELECT
b.id, height, blockhash, amount, confirmations, difficulty, FROM_UNIXTIME(time) as time, shares,
IF(a.is_anonymous, IF( ? , a.username, 'anonymous'), a.username) AS finder
IF(a.is_anonymous, 'anonymous', a.username) AS finder,
ROUND((difficulty * 65535) / POW(2, (" . $this->config['difficulty'] . " -16)), 0) AS estshares,
(time - (SELECT time FROM $this->tableBlocks WHERE height < ? ORDER BY height DESC LIMIT 1)) AS round_time
FROM $this->tableBlocks as b
LEFT JOIN $this->tableUsers AS a ON b.account_id = a.id
WHERE b.height = ? LIMIT 1");
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $isAdmin, $iHeight) && $stmt->execute() && $result = $stmt->get_result())
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $iHeight, $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_assoc();
return false;
}
@ -79,10 +110,11 @@ class RoundStats {
* @param height int Block Height
* @return data array Block information from DB
**/
public function getRoundStatsForAccounts($iHeight=0, $isAdmin=0) {
public function getRoundStatsForAccounts($iHeight=0) {
$stmt = $this->mysqli->prepare("
SELECT
IF(a.is_anonymous, IF( ? , a.username, 'anonymous'), a.username) AS username,
a.username,
a.is_anonymous,
s.valid,
s.invalid
FROM $this->tableStats AS s
@ -92,30 +124,71 @@ class RoundStats {
GROUP BY username ASC
ORDER BY valid DESC
");
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $isAdmin, $iHeight) && $stmt->execute() && $result = $stmt->get_result())
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_all(MYSQLI_ASSOC);
return false;
}
/**
* Get pplns statistics for round block height
* @param height int Block Height
* @return data array Block information from DB
**/
public function getPPLNSRoundStatsForAccounts($iHeight=0) {
$stmt = $this->mysqli->prepare("
SELECT
a.username,
a.is_anonymous,
s.pplns_valid,
s.pplns_invalid
FROM $this->tableStats AS s
LEFT JOIN $this->tableBlocks AS b ON s.block_id = b.id
LEFT JOIN $this->tableUsers AS a ON a.id = s.account_id
WHERE b.height = ?
GROUP BY username ASC
ORDER BY pplns_valid DESC
");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_all(MYSQLI_ASSOC);
return false;
}
/**
* Get total valid pplns shares for block height
**/
public function getPPLNSRoundShares($iHeight=0) {
$stmt = $this->mysqli->prepare("
SELECT
SUM(s.pplns_valid) AS pplns_valid
FROM $this->tableStats AS s
LEFT JOIN $this->tableBlocks AS b ON s.block_id = b.id
WHERE b.height = ?
");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_object()->pplns_valid;
return false;
}
/**
* Get all transactions for round block height for admin
* @param height int Block Height
* @return data array Block round transactions
**/
public function getAllRoundTransactions($iHeight=0, $admin) {
public function getAllRoundTransactions($iHeight=0) {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("
SELECT
t.id AS id,
IF(a.is_anonymous, IF( ? , a.username, 'anonymous'), a.username) AS username,
a.username AS username,
a.is_anonymous,
t.type AS type,
t.amount AS amount
FROM $this->tableTrans AS t
LEFT JOIN $this->tableBlocks AS b ON t.block_id = b.id
LEFT JOIN $this->tableUsers AS a ON t.account_id = a.id
WHERE b.height = ?
ORDER BY id ASC");
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $admin, $iHeight) && $stmt->execute() && $result = $stmt->get_result())
WHERE b.height = ? AND t.type = 'Credit'
ORDER BY amount DESC");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_all(MYSQLI_ASSOC);
$this->debug->append('Unable to fetch transactions');
return false;

View File

@ -77,6 +77,32 @@ class Statistics {
return false;
}
/**
* Get our last $limit blocks found by height
* @param limit int Last limit blocks
* @return array
**/
public function getBlocksFoundHeight($iHeight=0, $limit=10) {
$this->debug->append("STA " . __METHOD__, 4);
if ($data = $this->memcache->get(__FUNCTION__ . $iHeight . $limit)) return $data;
$stmt = $this->mysqli->prepare("
SELECT
b.*,
a.username AS finder,
a.is_anonymous AS is_anonymous,
ROUND((difficulty * 65535) / POW(2, (" . $this->config['difficulty'] . " -16)), 0) AS estshares
FROM " . $this->block->getTableName() . " AS b
LEFT JOIN " . $this->user->getTableName() . " AS a
ON b.account_id = a.id
WHERE b.height <= ?
ORDER BY height DESC LIMIT ?");
if ($this->checkStmt($stmt) && $stmt->bind_param("ii", $iHeight, $limit) && $stmt->execute() && $result = $stmt->get_result())
return $this->memcache->setCache(__FUNCTION__ . $iHeight . $limit, $result->fetch_all(MYSQLI_ASSOC), 5);
// Catchall
$this->debug->append("Failed to find blocks:" . $this->mysqli->error);
return false;
}
/**
* Currently the only function writing to the database
* Stored per block user statistics of valid and invalid shares
@ -93,6 +119,44 @@ class Statistics {
return false;
}
/**
* update user statistics of valid and invalid pplns shares
**/
public function updatePPLNSShareStatistics($aStats, $iBlockId) {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("
UPDATE $this->table SET pplns_valid = ?, pplns_invalid = ? WHERE account_id = ? AND block_id = ?");
if ($this->checkStmt($stmt) && $stmt->bind_param('iiii', $aStats['valid'], $aStats['invalid'], $aStats['id'], $iBlockId) && $stmt->execute()) return true;
// Catchall
$this->debug->append("Failed to update pplns share stats: " . $this->mysqli->error);
return false;
}
/**
* insert user statistics of valid and invalid pplns shares "rbpplns"
**/
public function insertPPLNSShareStatistics($aStats, $iBlockId) {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("INSERT INTO $this->table (account_id, valid, invalid, pplns_valid, pplns_invalid, block_id) VALUES (?, 0, 0, ?, ?, ?)");
if ($this->checkStmt($stmt) && $stmt->bind_param('iiii', $aStats['id'], $aStats['valid'], $aStats['invalid'], $iBlockId) && $stmt->execute()) return true;
// Catchall
$this->debug->append("Failed to insert pplns share stats: " . $this->mysqli->error);
return false;
}
/**
* Fetch the share ID from stats for rbpplns
**/
function getIdShareStatistics($aStats, $iBlockId) {
$stmt = $this->mysqli->prepare("
SELECT id AS id FROM $this->table
WHERE account_id = ? AND block_id = ?
");
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $aStats['id'], $iBlockId) && $stmt->execute() && $result = $stmt->get_result())
return $result->fetch_object()->id;
return false;
}
/**
* Get our current pool hashrate for the past 10 minutes across both
* shares and shares_archive table
@ -245,12 +309,14 @@ class Statistics {
if ($data = $this->memcache->get(STATISTICS_ALL_USER_SHARES)) {
if (array_key_exists($account_id, $data['data']))
return $data['data'][$account_id];
// We have no cached value, we return defaults
return array('valid' => 0, 'invalid' => 0, 'donate_percent' => 0, 'is_anonymous' => 0);
}
// if ($data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
if ($data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
$stmt = $this->mysqli->prepare("
SELECT
ROUND(IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0), 0) AS valid,
ROUND(IFNULL(SUM(IF(our_result='N', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0), 0) AS invalid
ROUND(IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0) AS valid,
ROUND(IFNULL(SUM(IF(our_result='N', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0) AS invalid
FROM " . $this->share->getTableName() . " AS s,
" . $this->user->getTableName() . " AS u
WHERE

View File

@ -123,6 +123,13 @@ $aSettings['statistics'][] = array(
'name' => 'statistics_block_count', 'value' => $setting->getValue('statistics_block_count'),
'tooltip' => 'Blocks to fetch for the block statistics page.'
);
$aSettings['statistics'][] = array(
'display' => 'Show block average', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'statistics_show_block_average', 'value' => $setting->getValue('show_block_average'),
'tooltip' => 'Show block average in block statistics page.'
);
$aSettings['statistics'][] = array(
'display' => 'Pool Hashrate Modifier', 'type' => 'select',
'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s' ),
@ -165,13 +172,6 @@ $aSettings['acl'][] = array(
'name' => 'acl_round_statistics', 'value' => $setting->getValue('acl_round_statistics'),
'tooltip' => 'Make the round statistics page private (users only) or public.'
);
$aSettings['acl'][] = array(
'display' => 'Round Transactions', 'type' => 'select',
'options' => array( 0 => 'Admins', 1 => 'Public'),
'default' => 0,
'name' => 'acl_round_transactions', 'value' => $setting->getValue('acl_round_transactions'),
'tooltip' => 'Display all transactions regardless of admin status.'
);
$aSettings['system'][] = array(
'display' => 'Disable e-mail confirmations', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),

View File

@ -231,9 +231,20 @@ $config['fees'] = 0;
* type = `blockavg`
* blockcount = 10
**/
/**
* $config['pplns']['shares']['type'] = 'dynamic';
* Dynamic target adjustment allows the blockavg target to adjust faster to share counts
* while still tracking round share averages by using a percentage of the current round shares
* to alter the pplns blockavg target this is useful with the nature of many alt coins low and fast
* adjusting difficulties and quick round times
* reverse_payout is useful to even out payouts for fast round times when even steady miners
* are missing share submissions for the current round
**/
$config['pplns']['shares']['default'] = 4000000;
$config['pplns']['shares']['type'] = 'blockavg';
$config['pplns']['blockavg']['blockcount'] = 10;
$config['pplns']['reverse_payout'] = false; // add user shares from archive even if user not in current round
$config['pplns']['dynamic']['percent'] = 30; // percentage of round shares factored into block average when using dynamic type
// Pool target difficulty as set in pushpoold configuration file
// Please also read this for stratum: https://github.com/TheSerapher/php-mpos/wiki/FAQ

View File

@ -8,11 +8,71 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$debug->append('No cached version available, fetching from backend', 3);
// Grab the last blocks found
$setting->getValue('statistics_block_count') ? $iLimit = $setting->getValue('statistics_block_count') : $iLimit = 20;
$aBlocksFoundData = $statistics->getBlocksFound($iLimit);
if (@$_REQUEST['limit'] && !empty($_REQUEST['limit']) && is_numeric($_REQUEST['limit'])) {
$iLimit = $_REQUEST['limit'];
if ( $iLimit > 40 )
$iLimit = 40;
}
$iHeight = 0;
if (@$_REQUEST['next'] && !empty($_REQUEST['height']) && is_numeric($_REQUEST['height'])) {
$iHeight = @$roundstats->getNextBlockForStats($_REQUEST['height'], $iLimit);
if (!$iHeight) {
$iBlock = $block->getLast();
$iHeight = $iBlock['height'];
}
} else if (@$_REQUEST['prev'] && !empty($_REQUEST['height']) && is_numeric($_REQUEST['height'])) {
$iHeight = $_REQUEST['height'];
} else if (empty($_REQUEST['height'])) {
$aBlock = $block->getLast();
$iHeight = $aBlock['height'];
}
$test = false;
if (@$_REQUEST['test'] && $user->isAdmin($_SESSION['USERDATA']['id'])) {
$test = true;
$count = 10;
$percent = 30;
if (@$_REQUEST['count'] && is_numeric($_REQUEST['count']))
$count = $_REQUEST['count'];
if (@$_REQUEST['percent'] && is_numeric($_REQUEST['percent']))
$percent = $_REQUEST['percent'];
}
$aBlocksFoundData = $statistics->getBlocksFoundHeight($iHeight, $iLimit);
$use_average = false;
if ($config['payout_system'] == 'pplns') {
foreach($aBlocksFoundData as $key => $aData) {
$aBlocksFoundData[$key]['pplns_shares'] = $roundstats->getPPLNSRoundShares($aData['height']);
if ($setting->getValue('statistics_show_block_average') && !$test) {
$aBlocksFoundData[$key]['block_avg'] = round($block->getAvgBlockShares($aData['height'], $config['pplns']['blockavg']['blockcount']));
$use_average = true;
}
}
} else if ($config['payout_system'] == 'prop' || $config['payout_system'] == 'pps') {
if ($setting->getValue('statistics_show_block_average') && !$test) {
foreach($aBlocksFoundData as $key => $aData) {
$aBlocksFoundData[$key]['block_avg'] = round($block->getAvgBlockShares($aData['height'], $config['pplns']['blockavg']['blockcount']));
$use_average = true;
}
}
}
// show test data in graph
if ($test) {
$use_average = true;
foreach($aBlocksFoundData as $key => $aData) {
if ($_REQUEST['test'] == 1) {
$aBlocksFoundData[$key]['block_avg'] = round($block->getAvgBlockShares($aData['height'], $count));
} else if ($_REQUEST['test'] == 2) {
$aBlocksFoundData[$key]['block_avg'] = round($block->getAvgBlockShares($aData['height'], $count) * (100 - $percent) / 100 + $aData['shares'] * $percent / 100);
}
}
}
//var_dump($aBlocksFoundData);
// Propagate content our template
$smarty->assign("BLOCKSFOUND", $aBlocksFoundData);
$smarty->assign("BLOCKLIMIT", $iLimit);
$smarty->assign("USEBLOCKAVERAGE", $use_average);
} else {
$debug->append('Using cached page', 3);
}

View File

@ -6,32 +6,58 @@ if (!defined('SECURITY')) die('Hacking attempt');
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$debug->append('No cached version available, fetching from backend', 3);
if (@$_REQUEST['next'] && !empty($_REQUEST['height'])) {
$iKey = $roundstats->getNextBlock($_REQUEST['height']);
} else if (@$_REQUEST['prev'] && !empty($_REQUEST['height'])) {
$iKey = $roundstats->getPreviousBlock($_REQUEST['height']);
} else {
if (empty($_REQUEST['height'])) {
$iBlock = $block->getLast();
$iKey = $iBlock['height'];
} else {
$iKey = $_REQUEST['height'];
}
if (@$_REQUEST['search']) {
$_REQUEST['height'] = $roundstats->searchForBlockHeight($_REQUEST['search']);
}
$aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iKey, $user->isAdmin(@$_SESSION['USERDATA']['id']));
$aRoundShareStats = $roundstats->getRoundStatsForAccounts($iKey, $user->isAdmin(@$_SESSION['USERDATA']['id']));
if ($user->isAdmin(@$_SESSION['USERDATA']['id']) || $setting->getValue('acl_round_transactions')) {
$aUserRoundTransactions = $roundstats->getAllRoundTransactions($iKey, @$_SESSION['USERDATA']['id']);
if (@$_REQUEST['next'] && !empty($_REQUEST['height'])) {
$iHeight = @$roundstats->getNextBlock($_REQUEST['height']);
if (!$iHeight) {
$iBlock = $block->getLast();
$iHeight = $iBlock['height'];
}
} else if (@$_REQUEST['prev'] && !empty($_REQUEST['height'])) {
$iHeight = $roundstats->getPreviousBlock($_REQUEST['height']);
} else if (empty($_REQUEST['height'])) {
$iBlock = $block->getLast();
$iHeight = $iBlock['height'];
} else {
$aUserRoundTransactions = $roundstats->getUserRoundTransactions($iKey, @$_SESSION['USERDATA']['id']);
$iHeight = $_REQUEST['height'];
}
$_REQUEST['height'] = $iHeight;
$iPPLNSShares = 0;
$aSharesData = array();
$aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iHeight);
$aRoundShareStats = $roundstats->getRoundStatsForAccounts($iHeight);
if ($config['payout_system'] == 'pplns') {
$aUserRoundTransactions = $roundstats->getAllRoundTransactions($iHeight);
foreach($aRoundShareStats as $key => $aData) {
$aSharesData[$aData['username']] = $aData;
}
$aPPLNSRoundShares = $roundstats->getPPLNSRoundStatsForAccounts($iHeight);
foreach($aPPLNSRoundShares as $key => $aData) {
$iPPLNSShares += $aData['pplns_valid'];
}
$block_avg = $block->getAvgBlockShares($iHeight, $config['pplns']['blockavg']['blockcount']);
} else if ($config['payout_system'] == 'prop') {
$aUserRoundTransactions = $roundstats->getAllRoundTransactions($iHeight);
}
// Propagate content our template
$smarty->assign('BLOCKDETAILS', $aDetailsForBlockHeight);
$smarty->assign('ROUNDSHARES', $aRoundShareStats);
$smarty->assign("ROUNDTRANSACTIONS", $aUserRoundTransactions);
if ($config['payout_system'] == 'pplns') {
$smarty->assign('SHARESDATA', $aSharesData);
$smarty->assign('PPLNSROUNDSHARES', $aPPLNSRoundShares);
$smarty->assign("PPLNSSHARES", $iPPLNSShares);
$smarty->assign("BLOCKAVGCOUNT", $config['pplns']['blockavg']['blockcount']);
$smarty->assign("BLOCKAVERAGE", $block_avg );
$smarty->assign("ROUNDTRANSACTIONS", $aUserRoundTransactions);
} else if ($config['payout_system'] == 'prop') {
$smarty->assign("ROUNDTRANSACTIONS", $aUserRoundTransactions);
}
} else {
$debug->append('Using cached page', 3);
}

View File

@ -21,13 +21,38 @@
<td>{$BLOCKSFOUND[block].shares}</td>
{/section}
</tr>
{if $GLOBAL.config.payout_system == 'pplns'}<tr>
<th scope="row">PPLNS</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].pplns_shares}</td>
{/section}
</tr>{/if}
{if $USEBLOCKAVERAGE}<tr>
<th scope="row">Average</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].block_avg}</td>
{/section}
</tr>{/if}
</tbody>
</table>
<center><br>
<p style="padding-left:30px; padding-redight:30px; font-size:10px;">
The graph above illustrates N shares to find a block vs. E Shares expected to find a block based on
target and network difficulty and assuming a zero variance scenario.
</p></center>
</p>
<table align="left" width="100%" border="0" style="font-size:13px;">
<tbody>
<tr>
<td class="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > ($BLOCKLIMIT - 1)}{$BLOCKSFOUND[$BLOCKLIMIT - 1].height}{/if}&prev=1"><img src="{$PATH}/images/prev.png" /></a>
</td>
<td class="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > 0}{$BLOCKSFOUND[0].height}{/if}&next=1"><img src="{$PATH}/images/next.png" /></i></a>
</td>
</tr>
</tbody>
</table>
</center>
{include file="global/block_footer.tpl"}
{include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;"}
@ -42,6 +67,7 @@ target and network difficulty and assuming a zero variance scenario.
<th class="right">Difficulty</th>
<th class="right">Amount</th>
<th class="right">Expected Shares</th>
{if $GLOBAL.config.payout_system == 'pplns'}<th class="right">PPLNS Shares</th>{/if}
<th class="right">Actual Shares</th>
<th class="right">Percentage</th>
</tr>
@ -51,9 +77,11 @@ target and network difficulty and assuming a zero variance scenario.
{assign var=totalexpectedshares value=0}
{assign var=totalshares value=0}
{assign var=totalpercentage value=0}
{assign var=pplnsshares value=0}
{section block $BLOCKSFOUND}
{assign var="totalshares" value=$totalshares+$BLOCKSFOUND[block].shares}
{assign var="count" value=$count+1}
{if $GLOBAL.config.payout_system == 'pplns'}{assign var="pplnsshares" value=$pplnsshares+$BLOCKSFOUND[block].pplns_shares}{/if}
<tr class="{cycle values="odd,even"}">
<td class="center"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round&height={$BLOCKSFOUND[block].height}">{$BLOCKSFOUND[block].height}</a></td>
<td class="center">
@ -70,6 +98,7 @@ target and network difficulty and assuming a zero variance scenario.
{$BLOCKSFOUND[block].estshares|number_format}
{assign var="totalexpectedshares" value=$totalexpectedshares+$BLOCKSFOUND[block].estshares}
</td>
{if $GLOBAL.config.payout_system == 'pplns'}<td class="right">{$BLOCKSFOUND[block].pplns_shares|number_format}</td>{/if}
<td class="right">{$BLOCKSFOUND[block].shares|number_format}</td>
<td class="right">
{math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares estshares=$BLOCKSFOUND[block].estshares}
@ -82,6 +111,7 @@ target and network difficulty and assuming a zero variance scenario.
<tr>
<td colspan="6" class="right"><b>Totals</b></td>
<td class="right">{$totalexpectedshares|number_format}</td>
{if $GLOBAL.config.payout_system == 'pplns'}<td class="right">{$pplnsshares|number_format}</td>{/if}
<td class="right">{$totalshares|number_format}</td>
<td class="right"><font color="{if (($totalpercentage / $count) <= 100)}green{else}red{/if}">{($totalpercentage / $count)|number_format:"2"}</font>
</tr>

View File

@ -1,16 +1,24 @@
{include file="global/block_header.tpl" ALIGN="left" BLOCK_STYLE="width: 100%" BLOCK_HEADER="Block Stats" STYLE="padding-left:5px;padding-right:5px;"}
<table align="left" width="100%" border="0" style="font-size:13px;"><tbody><tr><td class="left">
<table align="left" width="100%" border="0" style="font-size:13px;"><tbody>
<tr>
<td class="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><img src="{$PATH}/images/prev.png" /></a>
</td>
<td class="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><img src="{$PATH}/images/next.png" /></a>
</td>
</tr>
<tr><td class="left">
<table align="left" width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th align="left">Name</th>
<th scope="col">Value</th>
<th scope="col" colspan="2">Block Round Statistics</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>ID</td>
<td>{$BLOCKDETAILS.id|default:"0"}</td>
<td>{$BLOCKDETAILS.id|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Height</td>
@ -26,7 +34,12 @@
</tr>
<tr class="even">
<td>Confirmations</td>
<td>{$BLOCKDETAILS.confirmations|default:"0"}</td>
<td>{if $BLOCKDETAILS.confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKDETAILS.confirmations == -1}
<font color="red">Orphan</font>
{else if $BLOCKDETAILS.confirmations == 0}0
{else}{($GLOBAL.confirmations - $BLOCKDETAILS.confirmations)|default:"0"} left{/if}</td>
</tr>
<tr class="odd">
<td>Difficulty</td>
@ -38,7 +51,7 @@
</tr>
<tr class="odd">
<td>Shares</td>
<td>{$BLOCKDETAILS.shares|default:"0"}</td>
<td>{$BLOCKDETAILS.shares|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Finder</td>
@ -47,19 +60,12 @@
</tbody>
</table></td>
<td class="right">
<form action="{$smarty.server.PHP_SELF}" method="POST" id='height'>
<form action="{$smarty.server.PHP_SELF}" method="POST" id='search'>
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="text" class="pin" name="height" value="{$smarty.request.height|default:"%"}">
<input type="text" class="pin" name="search" value="{$smarty.request.height|default:"%"}">
<input type="submit" class="submit small" value="Search">
</form></td></tr>
<tr>
<td class="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><img src="{$PATH}/images/prev.png" /></a>
</td>
<td class="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><img src="{$PATH}/images/next.png" /></a>
</td>
</tr>
</tbody></table>
{include file="global/block_footer.tpl"}

View File

@ -1,9 +1,14 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Round Statistics" BLOCK_STYLE="clear:none;"}
{include file="statistics/round/block_stats.tpl"}
{include file="statistics/round/round_transactions.tpl"}
{include file="statistics/round/round_shares.tpl"}
{if $GLOBAL.config.payout_system == 'pplns'}
{include file="statistics/round/pplns_block_stats.tpl"}
{include file="statistics/round/round_shares.tpl"}
{include file="statistics/round/pplns_round_shares.tpl"}
{include file="statistics/round/pplns_transactions.tpl"}
{else}
{include file="statistics/round/block_stats.tpl"}
{include file="statistics/round/round_shares.tpl"}
{include file="statistics/round/round_transactions.tpl"}
{/if}
{include file="global/block_footer.tpl"}

View File

@ -0,0 +1,118 @@
{include file="global/block_header.tpl" ALIGN="left" BLOCK_STYLE="width: 100%" BLOCK_HEADER="Block Stats" STYLE="padding-left:5px;padding-right:5px;"}
<br>
<center>
<form action="{$smarty.server.PHP_SELF}" method="POST" id='search'>
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="text" class="pin" name="search" value="{$smarty.request.height|default:"%"}">
<input type="submit" class="submit small" value="Search">
</form>
</center>
<table align="left" width="100%" border="0" style="font-size:13px;"><tbody>
<tr>
<td class="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><img src="{$PATH}/images/prev.png" /></a>
</td>
<td class="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><img src="{$PATH}/images/next.png" /></a>
</td>
</tr>
<tr><td class="left">
<table align="left" width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th scope="col" colspan="2">Block Round Statistics</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>ID</td>
<td>{$BLOCKDETAILS.id|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Height</td>
{if ! $GLOBAL.website.blockexplorer.disabled}
<td><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKDETAILS.blockhash}" target="_new">{$BLOCKDETAILS.height}</a></td>
{else}
<td>{$BLOCKDETAILS.height}</td>
{/if}
</tr>
<tr class="odd">
<td>Amount</td>
<td>{$BLOCKDETAILS.amount|default:"0"}</td>
</tr>
<tr class="even">
<td>Confirmations</td>
<td>{if $BLOCKDETAILS.confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKDETAILS.confirmations == -1}
<font color="red">Orphan</font>
{else if $BLOCKDETAILS.confirmations == 0}0
{else}{($GLOBAL.confirmations - $BLOCKDETAILS.confirmations)|default:"0"} left{/if}</td>
</tr>
</tr>
<tr class="odd">
<td>Difficulty</td>
<td>{$BLOCKDETAILS.difficulty|default:"0"}</td>
</tr>
<tr class="even">
<td>Time</td>
<td>{$BLOCKDETAILS.time|default:"0"}</td>
</tr>
<tr class="odd">
<td>Shares</td>
<td>{$BLOCKDETAILS.shares|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Finder</td>
<td>{$BLOCKDETAILS.finder|default:"0"}</td>
</tr>
</tbody>
</table></td>
{assign var=percentage value=0}
{assign var=percentage1 value=0}
{assign var=percentage2 value=0}
<td class="left"><table align="left" width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th scope="col" colspan="2">PPLNS Round Statistics</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>PPLNS Shares</td>
<td>{$PPLNSSHARES|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Estimated Shares</td>
<td>{$BLOCKDETAILS.estshares|number_format|default:"0"}</td>
</tr>
<tr class="odd">
<td>Target Variance</td>
<td>{if $PPLNSSHARES > 0}{math assign="percentage" equation=(($BLOCKDETAILS.estshares / $PPLNSSHARES) * 100)}{/if}<font color="{if ($percentage >= 100)}green{else}red{/if}">{$percentage|number_format:"2"} %</font></td>
</tr>
<tr class="even">
<td>Block Average</td>
<td>{$BLOCKAVERAGE|number_format:"0"|default:"0"}</td>
</tr>
<tr class="odd">
<td>Average Efficiency</td>
<td>{if $BLOCKAVERAGE > 0 && $BLOCKDETAILS.estshares > 0}{math assign="percentage2" equation=(($BLOCKDETAILS.estshares / $BLOCKAVERAGE) * 100)}{/if}<font color="{if ($percentage2 >= 100)}green{else}red{/if}">{$percentage2|number_format:"2"} %</font></td>
</tr>
<tr class="even">
<td>Target Rounds</td>
<td>{$BLOCKAVGCOUNT|number_format:"0"|default:"0"}</td>
</tr>
<tr class="odd">
<td>Seconds This Round</td>
<td>{$BLOCKDETAILS.round_time|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Round Variance</td>
<td>{if $PPLNSSHARES > 0}{math assign="percentage1" equation=(($BLOCKDETAILS.shares / $PPLNSSHARES) * 100)}{/if}<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"} %</font></td>
</tr>
</tbody>
</table></td></tr>
</tbody></table>
{include file="global/block_footer.tpl"}

View File

@ -0,0 +1,29 @@
{include file="global/block_header.tpl" ALIGN="right" BLOCK_HEADER="PPLNS Round Shares" }
<center>
<table width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th class="center">Rank</th>
<th class="left" scope="col">User Name</th>
<th class="right" scope="col">Valid</th>
<th class="right" scope="col">Invalid</th>
<th class="right" scope="col">Invalid %</th>
</tr>
</thead>
<tbody>
{assign var=rank value=1}
{assign var=listed value=0}
{section contrib $PPLNSROUNDSHARES}
<tr{if $GLOBAL.userdata.username|default:"" == $PPLNSROUNDSHARES[contrib].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td class="center">{$rank++}</td>
<td>{if $PPLNSROUNDSHARES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$PPLNSROUNDSHARES[contrib].username|escape}{/if}</td>
<td class="right">{$PPLNSROUNDSHARES[contrib].pplns_valid|number_format}</td>
<td class="right">{$PPLNSROUNDSHARES[contrib].pplns_invalid|number_format}</td>
<td class="right">{if $PPLNSROUNDSHARES[contrib].pplns_invalid > 0 && $PPLNSROUNDSHARES[contrib].pplns_valid > 0}{($PPLNSROUNDSHARES[contrib].pplns_invalid / $PPLNSROUNDSHARES[contrib].pplns_valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
</tr>
{/section}
</tbody>
</table>
</center>
{include file="global/block_footer.tpl"}

View File

@ -0,0 +1,34 @@
{include file="global/block_header.tpl" ALIGN="left" BLOCK_STYLE="width: 100%" BLOCK_HEADER="Round Transactions"}
<center>
<table width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th scope="col">User Name</th>
<th class="right" scope="col">Round Shares</th>
<th class="right" scope="col">Round %</th>
<th class="right" scope="col">PPLNS Shares</th>
<th class="right" scope="col">PPLNS Round %</th>
<th class="right" scope="col">Variance</th>
<th class="right" scope="col">Amount</th>
</tr>
</thead>
<tbody>
{assign var=percentage1 value=0}
{section txs $ROUNDTRANSACTIONS}
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
<td class="right">{$SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid|number_format}</td>
<td class="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 }{(( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid)|number_format:"2"}{else}0.00{/if}</td>
<td class="right">{$PPLNSROUNDSHARES[txs].pplns_valid|number_format|default:"0"}</td>
<td class="right">{if $PPLNSROUNDSHARES[txs].pplns_valid > 0 }{(( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)|number_format:"2"|default:"0"}{else}0{/if}</td>
<td class="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 && $PPLNSROUNDSHARES[txs].pplns_valid > 0}{math assign="percentage1" equation=(100 / ((( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid) / (( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)))}{else if $PPLNSROUNDSHARES[txs].pplns_valid == 0}{assign var=percentage1 value=0}{else}{assign var=percentage1 value=100}{/if}
<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"}</font></b></td>
<td class="right">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
{assign var=percentage1 value=0}
</tr>
{/section}
</tbody>
</table>
</center>
{include file="global/block_footer.tpl"}

View File

@ -12,17 +12,17 @@
</thead>
<tbody>
{assign var=rank value=1}
{assign var=listed value=0}
{section contrib $ROUNDSHARES}
<tr{if $GLOBAL.userdata.username == $ROUNDSHARES[contrib].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDSHARES[contrib].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td class="center">{$rank++}</td>
<td>{if $ROUNDSHARES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if}</td>
<td class="right">{$ROUNDSHARES[contrib].valid|number_format}</td>
<td class="right">{$ROUNDSHARES[contrib].invalid|number_format}</td>
<td class="right">{($ROUNDSHARES[contrib].invalid / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"}</td>
<td class="right">{if $ROUNDSHARES[contrib].invalid > 0 }{($ROUNDSHARES[contrib].invalid / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
</tr>
{/section}
</tbody>
</table>
</center>
{include file="global/block_footer.tpl"}

View File

@ -3,18 +3,18 @@
<table width="100%" border="0" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th align="left">Tx Id</th>
<th scope="col">User Name</th>
<th scope="col">Type</th>
<th class="right" scope="col">Round %</th>
<th class="right" scope="col">Amount</th>
</tr>
</thead>
<tbody>
{section txs $ROUNDTRANSACTIONS}
<tr class="{cycle values="odd,even"}">
<td>{$ROUNDTRANSACTIONS[txs].id|default:"0"}</td>
<td>{$ROUNDTRANSACTIONS[txs].username|escape}</td>
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
<td class="right">{$ROUNDTRANSACTIONS[txs].type|default:""}</td>
<td class="right">{(( 100 / $BLOCKDETAILS.shares) * $ROUNDSHARES[txs].valid)|number_format:"2"}</td>
<td class="right">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
</tr>
{/section}
@ -22,3 +22,4 @@
</table>
</center>
{include file="global/block_footer.tpl"}

View File

@ -22,6 +22,30 @@
<td>{$BLOCKSFOUND[block].shares}</td>
{/section}
</tr>
{if $GLOBAL.config.payout_system == 'pplns'}<tr>
<th scope="row">PPLNS</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].pplns_shares}</td>
{/section}
</tr>{/if}
{if $USEBLOCKAVERAGE}<tr>
<th scope="row">Average</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].block_avg}</td>
{/section}
</tr>{/if}
</tbody>
</table>
<table class="tablesorter">
<tbody>
<tr>
<td align="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > ($BLOCKLIMIT - 1)}{$BLOCKSFOUND[$BLOCKLIMIT - 1].height}{/if}&prev=1"><i class="icon-left-open"></i></a>
</td>
<td align="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > 0}{$BLOCKSFOUND[0].height}{/if}&next=1"><i class="icon-right-open"></i></a>
</td>
</tr>
</tbody>
</table>
<footer>
@ -44,6 +68,7 @@
<th align="right">Difficulty</th>
<th align="right">Amount</th>
<th align="right">Expected Shares</th>
{if $GLOBAL.config.payout_system == 'pplns'}<th align="right">PPLNS Shares</th>{/if}
<th align="right">Actual Shares</th>
<th align="right" style="padding-right: 25px;">Percentage</th>
</tr>
@ -53,9 +78,11 @@
{assign var=totalexpectedshares value=0}
{assign var=totalshares value=0}
{assign var=totalpercentage value=0}
{assign var=pplnsshares value=0}
{section block $BLOCKSFOUND}
{assign var="totalshares" value=$totalshares+$BLOCKSFOUND[block].shares}
{assign var="count" value=$count+1}
{if $GLOBAL.config.payout_system == 'pplns'}{assign var="pplnsshares" value=$pplnsshares+$BLOCKSFOUND[block].pplns_shares}{/if}
<tr class="{cycle values="odd,even"}">
{if ! $GLOBAL.website.blockexplorer.disabled}
<td align="center"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round&height={$BLOCKSFOUND[block].height}">{$BLOCKSFOUND[block].height}</a></td>
@ -80,6 +107,7 @@
{assign var="totalexpectedshares" value=$totalexpectedshares+$estshares}
{$estshares|number_format}
</td>
{if $GLOBAL.config.payout_system == 'pplns'}<td align="right">{$BLOCKSFOUND[block].pplns_shares|number_format}</td>{/if}
<td align="right">{$BLOCKSFOUND[block].shares|number_format}</td>
<td align="right" style="padding-right: 25px;">
{math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares estshares=$estshares}
@ -91,8 +119,9 @@
<tr>
<td colspan="6" align="right"><b>Totals</b></td>
<td align="right">{$totalexpectedshares|number_format}</td>
{if $GLOBAL.config.payout_system == 'pplns'}<td align="right">{$pplnsshares|number_format}</td>{/if}
<td align="right">{$totalshares|number_format}</td>
<td align="right" style="padding-right: 25px;">{if $count > 0}<font color="{if (($totalpercentage / $count) <= 100)}green{else}red{/if}">{($totalpercentage / $count)|number_format:"2"}</font>{else}0{/if}</td>
<td align="right" style="padding-right: 25px;">{if $count > 0}<font color="{if (($totalshares / $totalexpectedshares * 100) <= 100)}green{else}red{/if}">{($totalshares / $totalexpectedshares * 100)|number_format:"2"}</font>{else}0{/if}</td>
</tr>
</tbody>
</table>

View File

@ -3,46 +3,39 @@
<table class="tablesorter">
<tbody>
<tr>
<td class="left">
<td align="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><i class="icon-left-open"></i></a>
</td>
<td class="right">
<td colspan="7" align="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><i class="icon-right-open"></i></a>
</td>
</tr>
<tr class="odd">
<td>ID</td>
<td>{$BLOCKDETAILS.id|default:"0"}</td>
</tr>
<tr class="even">
<td>{$BLOCKDETAILS.id|number_format:"0"|default:"0"}</td>
<td>Height</td>
{if ! $GLOBAL.website.blockexplorer.disabled}
<td><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKDETAILS.blockhash}" target="_new">{$BLOCKDETAILS.height}</a></td>
<td><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKDETAILS.blockhash}" target="_new">{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</a></td>
{else}
<td>{$BLOCKDETAILS.height}</td>
<td>{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</td>
{/if}
</tr>
<tr class="odd">
<td>Amount</td>
<td>{$BLOCKDETAILS.amount|default:"0"}</td>
<td>{$BLOCKDETAILS.amount|number_format|default:"0"}</td>
<td>Confirmations</td>
<td>{if $BLOCKDETAILS.confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKDETAILS.confirmations == -1}
<font color="red">Orphan</font>
{else if $BLOCKDETAILS.confirmations == 0}0
{else}{($GLOBAL.confirmations - $BLOCKDETAILS.confirmations)|default:"0"} left{/if}</td>
</tr>
<tr class="even">
<td>Confirmations</td>
<td>{$BLOCKDETAILS.confirmations|default:"0"}</td>
</tr>
<tr class="odd">
<td>Difficulty</td>
<td>{$BLOCKDETAILS.difficulty|default:"0"}</td>
</tr>
<tr class="even">
<td>Time</td>
<td>{$BLOCKDETAILS.time|default:"0"}</td>
</tr>
<tr class="odd">
<td>Shares</td>
<td>{$BLOCKDETAILS.shares|default:"0"}</td>
</tr>
<tr class="even">
<td>{$BLOCKDETAILS.shares|number_format:"0"|default:"0"}</td>
<td>Finder</td>
<td>{$BLOCKDETAILS.finder|default:"0"}</td>
</tr>
@ -50,10 +43,10 @@
</table>
<footer>
<div class="submit_link">
<form action="{$smarty.server.PHP_SELF}" method="POST" id='height'>
<form action="{$smarty.server.PHP_SELF}" method="POST" id='search'>
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="text" class="pin" name="height" value="{$smarty.request.height|default:"%"}">
<input type="text" class="pin" name="search" value="{$smarty.request.height|default:"%"}">
<input type="submit" value="Search" class="alt_btn">
</form>
</div>

View File

@ -1,3 +1,13 @@
{include file="statistics/round/block_stats.tpl"}
{include file="statistics/round/round_transactions.tpl"}
{include file="statistics/round/round_shares.tpl"}
{if $GLOBAL.config.payout_system == 'pplns'}
{include file="statistics/round/pplns_block_stats.tpl"}
{include file="statistics/round/pplns_transactions.tpl"}
{include file="statistics/round/round_shares.tpl"}
{include file="statistics/round/pplns_round_shares.tpl"}
{else if $GLOBAL.config.payout_system == 'prop'}
{include file="statistics/round/block_stats.tpl"}
{include file="statistics/round/round_shares.tpl"}
{include file="statistics/round/round_transactions.tpl"}
{else}
{include file="statistics/round/block_stats.tpl"}
{include file="statistics/round/round_shares.tpl"}
{/if}

View File

@ -0,0 +1,95 @@
<article class="module width_full">
<header><h3>Round Statistics</h3></header>
<table class="tablesorter">
<tbody>
<tr>
<td align="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><i class="icon-left-open"></i></a>
</td>
<td align="right" colspan="4">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><i class="icon-right-open"></i></a>
</td>
</tr>
</tbody>
</table>
<table class="tablesorter">
<tbody>
<thead>
<tr>
<th align="center" colspan="2">Block Statistics</th>
<th align="center" colspan="2">PPLNS Round Statistics</th>
</tr>
</thead>
<tr class="odd">
<td>ID</td>
<td>{$BLOCKDETAILS.id|number_format:"0"|default:"0"}</td>
<td>PPLNS Shares</td>
<td>{$PPLNSSHARES|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Height</td>
{if ! $GLOBAL.website.blockexplorer.disabled}
<td><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKDETAILS.blockhash}" target="_new">{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</a></td>
{else}
<td>{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</td>
{/if}
<td>Estimated Shares</td>
<td>{$BLOCKDETAILS.estshares|number_format|default:"0"}</td>
</tr>
<tr class="odd">
<td>Amount</td>
<td>{$BLOCKDETAILS.amount|default:"0"}</td>
<td>Target Variance</td>
{assign var=percentage value=0}
{assign var=percentage1 value=0}
{assign var=percentage2 value=0}
<td>{if $PPLNSSHARES > 0}{math assign="percentage" equation=(($BLOCKDETAILS.estshares / $PPLNSSHARES) * 100)}{/if}<font color="{if ($percentage >= 100)}green{else}red{/if}">{$percentage|number_format:"2"} %</font></td>
</tr>
<tr class="even">
<td>Confirmations</td>
<td>{if $BLOCKDETAILS.confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKDETAILS.confirmations == -1}
<font color="red">Orphan</font>
{else if $BLOCKDETAILS.confirmations == 0}0
{else}{($GLOBAL.confirmations - $BLOCKDETAILS.confirmations)|default:"0"} left{/if}</td>
<td>Block Average</td>
<td>{$BLOCKAVERAGE|number_format:"0"|default:"0"}</td>
</tr>
<tr class="odd">
<td>Difficulty</td>
<td>{$BLOCKDETAILS.difficulty|default:"0"}</td>
<td>Average Efficiency</td>
<td>{if $BLOCKAVERAGE > 0 && $BLOCKDETAILS.estshares > 0}{math assign="percentage2" equation=(($BLOCKDETAILS.estshares / $BLOCKAVERAGE) * 100)}{/if}<font color="{if ($percentage2 >= 100)}green{else}red{/if}">{$percentage2|number_format:"2"} %</font></td>
</tr>
<tr class="even">
<td>Time</td>
<td>{$BLOCKDETAILS.time|default:"0"}</td>
<td>Target Rounds</td>
<td>{$BLOCKAVGCOUNT|number_format:"0"|default:"0"}</td>
</tr>
<tr class="odd">
<td>Shares</td>
<td>{$BLOCKDETAILS.shares|number_format:"0"|default:"0"}</td>
<td>Seconds This Round</td>
<td>{$BLOCKDETAILS.round_time|number_format:"0"|default:"0"}</td>
</tr>
<tr class="even">
<td>Finder</td>
<td>{$BLOCKDETAILS.finder|default:"0"}</td>
<td>Round Variance</td>
<td>{if $PPLNSSHARES > 0}{math assign="percentage1" equation=(($BLOCKDETAILS.shares / $PPLNSSHARES) * 100)}{/if}<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"} %</font></td>
</tr>
</tbody>
</table>
<footer>
<div class="submit_link">
<form action="{$smarty.server.PHP_SELF}" method="POST" id='search'>
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="text" class="pin" name="search" value="{$smarty.request.height|default:"%"}">
<input type="submit" value="Search" class="alt_btn">
</form>
</div>
</footer>
</article>

View File

@ -0,0 +1,84 @@
<article class="module width_full">
<header><h3>Block Statistics</h3></header>
<table class="tablesorter">
<tbody>
<tr>
<td align="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&prev=1"><i class="icon-left-open"></i></a>
</td>
<td align="right" colspan="4">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={$BLOCKDETAILS.height}&next=1"><i class="icon-right-open"></i></a>
</td>
</tr>
</tbody>
</table>
<table class="tablesorter">
<tbody>
<thead>
<tr>
<th align="center" colspan="4">Block Statistics</th>
<th align="center" colspan="4">PPLNS Round Statistics</th>
</tr>
</thead>
<tr class="odd">
<td>ID</td>
<td>{$BLOCKDETAILS.id|number_format:"0"|default:"0"}</td>
<td>Height</td>
{if ! $GLOBAL.website.blockexplorer.disabled}
<td><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKDETAILS.blockhash}" target="_new">{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</a></td>
{else}
<td>{$BLOCKDETAILS.height|number_format:"0"|default:"0"}</td>
{/if}
<td>PPLNS Shares</td>
<td>{$PPLNSSHARES|number_format:"0"|default:"0"}</td>
<td>Estimated Shares</td>
<td>{$BLOCKDETAILS.estshares|number_format|default:"0"}</td>
</tr>
<tr class="odd">
<td>Amount</td>
<td>{$BLOCKDETAILS.amount|default:"0"}</td>
<td>Confirmations</td>
<td>{if $BLOCKDETAILS.confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKDETAILS.confirmations == -1}
<font color="red">Orphan</font>
{else if $BLOCKDETAILS.confirmations == 0}0
{else}{($GLOBAL.confirmations - $BLOCKDETAILS.confirmations)|default:"0"} left{/if}</td>
<td>Block Average</td>
<td>{$BLOCKAVERAGE|number_format:"0"|default:"0"}</td>
<td>Average Efficiency</td>
<td>{math assign="percentage2" equation=(($BLOCKDETAILS.estshares / $BLOCKAVERAGE) * 100)}<font color="{if ($percentage2 >= 100)}green{else}red{/if}">{$percentage2|number_format:"2"} %</font></td>
</tr>
<tr class="odd">
<td>Difficulty</td>
<td>{$BLOCKDETAILS.difficulty|default:"0"}</td>
<td>Time</td>
<td>{$BLOCKDETAILS.time|default:"0"}</td>
<td>Target Rounds</td>
<td>{$BLOCKAVGCOUNT|number_format:"0"|default:"0"}</td>
<td>Target Variance</td>
<td>{math assign="percentage" equation=(($BLOCKDETAILS.estshares / $PPLNSSHARES) * 100)}<font color="{if ($percentage >= 100)}green{else}red{/if}">{$percentage|number_format:"2"} %</font></td>
</tr>
<tr class="odd">
<td>Shares</td>
<td>{$BLOCKDETAILS.shares|number_format:"0"|default:"0"}</td>
<td>Finder</td>
<td>{$BLOCKDETAILS.finder|default:"0"}</td>
<td>Seconds This Round</td>
<td>{$BLOCKDETAILS.round_time|number_format:"0"|default:"0"}</td>
<td>Round Variance</td>
<td>{math assign="percentage1" equation=(($BLOCKDETAILS.shares / $PPLNSSHARES) * 100)}<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"} %</font></td>
</tr>
</tbody>
</table>
<footer>
<div class="submit_link">
<form action="{$smarty.server.PHP_SELF}" method="POST" id='search'>
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="text" class="pin" name="search" value="{$smarty.request.height|default:"%"}">
<input type="submit" value="Search" class="alt_btn">
</form>
</div>
</footer>
</article>

View File

@ -0,0 +1,26 @@
<article class="module width_half">
<header><h3>PPLNS Round Shares</h3></header>
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th align="center">Rank</th>
<th align="left" >User Name</th>
<th align="right" >Valid</th>
<th align="right" >Invalid</th>
<th align="right" style="padding-right: 25px;">Invalid %</th>
</tr>
</thead>
<tbody>
{assign var=rank value=1}
{section contrib $PPLNSROUNDSHARES}
<tr{if $GLOBAL.userdata.username|default:"" == $PPLNSROUNDSHARES[contrib].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td align="center">{$rank++}</td>
<td>{if $PPLNSROUNDSHARES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$PPLNSROUNDSHARES[contrib].username|escape}{/if}</td>
<td align="right">{$PPLNSROUNDSHARES[contrib].pplns_valid|number_format}</td>
<td align="right">{$PPLNSROUNDSHARES[contrib].pplns_invalid|number_format}</td>
<td align="right" style="padding-right: 25px;">{if $PPLNSROUNDSHARES[contrib].pplns_invalid > 0 && $PPLNSROUNDSHARES[contrib].pplns_valid > 0}{($PPLNSROUNDSHARES[contrib].pplns_invalid / $PPLNSROUNDSHARES[contrib].pplns_valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
</tr>
{/section}
</tbody>
</table>
</article>

View File

@ -0,0 +1,32 @@
<article class="module width_full">
<header><h3>Round Transactions</h3></header>
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th >User Name</th>
<th align="right">Round Shares</th>
<th align="right">Round %</th>
<th align="right">PPLNS Shares</th>
<th align="right">PPLNS Round %</th>
<th align="right">Variance</th>
<th align="right" style="padding-right: 25px;">Amount</th>
</tr>
</thead>
<tbody>
{assign var=percentage1 value=0}
{section txs $ROUNDTRANSACTIONS}
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
<td align="right">{$SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid|number_format}</td>
<td align="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 }{(( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid)|number_format:"2"}{else}0.00{/if}</td>
<td align="right">{$PPLNSROUNDSHARES[txs].pplns_valid|number_format|default:"0"}</td>
<td align="right">{if $PPLNSROUNDSHARES[txs].pplns_valid > 0 }{(( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)|number_format:"2"|default:"0"}{else}0{/if}</td>
<td align="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 && $PPLNSROUNDSHARES[txs].pplns_valid > 0}{math assign="percentage1" equation=(100 / ((( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid) / (( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)))}{else if $PPLNSROUNDSHARES[txs].pplns_valid == 0}{assign var=percentage1 value=0}{else}{assign var=percentage1 value=100}{/if}
<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"}</font></b></td>
<td align="right" style="padding-right: 25px;">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
{assign var=percentage1 value=0}
</tr>
{/section}
</tbody>
</table>
</article>

View File

@ -0,0 +1,39 @@
<article class="module width_full">
<header><h3>Round Statistics</h3></header>
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th >User Name</th>
<th align="right">Round Valid</th>
<th align="right">Invalid</th>
<th align="right">Invalid %</th>
<th align="right">Round %</th>
<th align="right">PPLNS Valid</th>
<th align="right">Invalid</th>
<th align="right">Invalid %</th>
<th align="right">PPLNS Round %</th>
<th align="right">Variance</th>
<th align="right" style="padding-right: 25px;">Amount</th>
</tr>
</thead>
<tbody>
{section txs $ROUNDTRANSACTIONS}
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
<td align="right">{$SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid|number_format}</td>
<td align="right">{$SHARESDATA[$ROUNDTRANSACTIONS[txs].username].invalid|number_format}</td>
<td align="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].invalid > 0 }{($SHARESDATA[$ROUNDTRANSACTIONS[txs].username].invalid / $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
<td align="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 }{(( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid)|number_format:"2"}{else}0.00{/if}</td>
<td align="right">{$PPLNSROUNDSHARES[txs].pplns_valid|number_format}</td>
<td align="right">{$PPLNSROUNDSHARES[txs].pplns_invalid|number_format}</td>
<td align="right">{if $PPLNSROUNDSHARES[txs].pplns_invalid > 0 }{($PPLNSROUNDSHARES[txs].pplns_invalid / $PPLNSROUNDSHARES[txs].pplns_valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
<td align="right">{(( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)|number_format:"2"}</td>
<td align="right">{if $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid > 0 }{math assign="percentage1" equation=(100 / ((( 100 / $BLOCKDETAILS.shares) * $SHARESDATA[$ROUNDTRANSACTIONS[txs].username].valid) / (( 100 / $PPLNSSHARES) * $PPLNSROUNDSHARES[txs].pplns_valid)))}{else if $PPLNSROUNDSHARES[txs].pplns_valid == 0}{assign var=percentage1 value=0}{else}{assign var=percentage1 value=100}{/if}
<font color="{if ($percentage1 >= 100)}green{else}red{/if}">{$percentage1|number_format:"2"}</font></b></td>
<td align="right" style="padding-right: 25px;">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
{assign var=percentage1 value=0}
</tr>
{/section}
</tbody>
</table>
</article>

View File

@ -16,10 +16,10 @@
{section contrib $ROUNDSHARES}
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDSHARES[contrib].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td align="center">{$rank++}</td>
<td>{if $ROUNDSHARES[contrib].is_anonymous|default:"0" == 1}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if}</td>
<td>{if $ROUNDSHARES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if}</td>
<td align="right">{$ROUNDSHARES[contrib].valid|number_format}</td>
<td align="right">{$ROUNDSHARES[contrib].invalid|number_format}</td>
<td align="right" style="padding-right: 25px;">{($ROUNDSHARES[contrib].invalid / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"}</td>
<td align="right" style="padding-right: 25px;">{if $ROUNDSHARES[contrib].invalid > 0 }{($ROUNDSHARES[contrib].invalid / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"|default:"0"}{else}0.00{/if}</td>
</tr>
{/section}
</tbody>

View File

@ -3,18 +3,18 @@
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th align="center">TX #</th>
<th>User Name</th>
<th align="center">Type</th>
<th align="right" scope="col">Round %</th>
<th align="right" style="padding-right: 25px;">Amount</th>
</tr>
</thead>
<tbody>
{section txs $ROUNDTRANSACTIONS}
<tr class="{cycle values="odd,even"}">
<td align="center">{$ROUNDTRANSACTIONS[txs].id|default:"0"}</td>
<td>{$ROUNDTRANSACTIONS[txs].username|escape}</td>
<tr{if $GLOBAL.userdata.username|default:"" == $ROUNDTRANSACTIONS[txs].username} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{if $ROUNDTRANSACTIONS[txs].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDTRANSACTIONS[txs].username|escape}{/if}</td>
<td align="center">{$ROUNDTRANSACTIONS[txs].type|default:""}</td>
<td align="right">{(( 100 / $BLOCKDETAILS.shares) * $ROUNDSHARES[txs].valid)|default:"0"|number_format:"2"}</td>
<td align="right" style="padding-right: 25px;">{$ROUNDTRANSACTIONS[txs].amount|default:"0"|number_format:"8"}</td>
</tr>
{/section}

View File

@ -0,0 +1,2 @@
ALTER TABLE `statistics_shares` ADD `pplns_valid` int(11) NOT NULL AFTER `invalid` ;
ALTER TABLE `statistics_shares` ADD `pplns_invalid` int(11) NOT NULL DEFAULT 0 AFTER `pplns_valid` ;