Merge pull request #828 from TheSerapher/optimize-blockstats

[IMPROVED] Block statistics
This commit is contained in:
Sebastian Grewe 2013-11-07 00:16:13 -08:00
commit 3a120c4709
9 changed files with 247 additions and 225 deletions

View File

@ -25,35 +25,29 @@ class Statistics extends Base {
/**
* Fetch last found blocks by time
**/
function getLastValidBlocksbyTime($aTimeFrame) {
function getLastBlocksbyTime() {
$this->debug->append("STA " . __METHOD__, 4);
if ($data = $this->memcache->get(__FUNCTION__ . $aTimeFrame)) return $data;
$date = new DateTime();
$actualTime = $date->getTimestamp();
$aTimeDiff = $actualTime - $aTimeFrame;
if ($aTimeFrame == 0) $aTimeDiff = 0;
if ($data = $this->memcache->get(__FUNCTION__)) return $data;
$stmt = $this->mysqli->prepare("
SELECT COUNT(id) AS count FROM " . $this->block->getTableName() . "
WHERE confirmations > 0
AND time >= ?");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $aTimeDiff) && $stmt->execute() && $result = $stmt->get_result())
return $this->memcache->setCache(__FUNCTION__ . $aTimeFrame, $result->fetch_object()->count);
return $this->sqlError();
}
function getLastOrphanBlocksbyTime($aTimeFrame) {
$this->debug->append("STA " . __METHOD__, 4);
if ($data = $this->memcache->get(__FUNCTION__ . $aTimeFrame)) return $data;
$date = new DateTime();
$actualTime = $date->getTimestamp();
$aTimeDiff = $actualTime - $aTimeFrame;
if ($aTimeFrame == 0) $aTimeDiff = 0;
$stmt = $this->mysqli->prepare("
SELECT COUNT(id) AS count FROM " . $this->block->getTableName() . "
WHERE confirmations = -1
AND time >= ?");
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $aTimeDiff) && $stmt->execute() && $result = $stmt->get_result())
return $this->memcache->setCache(__FUNCTION__ . $aTimeFrame, $result->fetch_object()->count);
SELECT
COUNT(id) AS Total,
IFNULL(SUM(IF(confirmations > 0, 1, 0)), 0) AS TotalValid,
IFNULL(SUM(IF(confirmations = -1, 1, 0)), 0) AS TotalOrphan,
IFNULL(SUM(IF(FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 3600 SECOND), 1, 0)), 0) AS 1HourTotal,
IFNULL(SUM(IF(confirmations > 0 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 3600 SECOND), 1, 0)), 0) AS 1HourValid,
IFNULL(SUM(IF(confirmations = -1 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 3600 SECOND), 1, 0)), 0) AS 1HourOrphan,
IFNULL(SUM(IF(FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 86400 SECOND), 1, 0)), 0) AS 24HourTotal,
IFNULL(SUM(IF(confirmations > 0 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 86400 SECOND), 1, 0)), 0) AS 24HourValid,
IFNULL(SUM(IF(confirmations = -1 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 86400 SECOND), 1, 0)), 0) AS 24HourOrphan,
IFNULL(SUM(IF(FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 604800 SECOND), 1, 0)), 0) AS 7DaysTotal,
IFNULL(SUM(IF(confirmations > 0 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 604800 SECOND), 1, 0)), 0) AS 7DaysValid,
IFNULL(SUM(IF(confirmations = -1 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 604800 SECOND), 1, 0)), 0) AS 7DaysOrphan,
IFNULL(SUM(IF(FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 2419200 SECOND), 1, 0)), 0) AS 4WeeksTotal,
IFNULL(SUM(IF(confirmations > 0 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 2419200 SECOND), 1, 0)), 0) AS 4WeeksValid,
IFNULL(SUM(IF(confirmations = -1 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 2419200 SECOND), 1, 0)), 0) AS 4WeeksOrphan
FROM " . $this->block->getTableName());
if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result())
return $this->memcache->setCache(__FUNCTION__, $result->fetch_assoc());
return $this->sqlError();
}

View File

@ -72,7 +72,11 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$iHours = 24;
$aPoolStatistics = $statistics->getPoolStatsHours($iHours);
// Past blocks found, max 4 weeks back
$iFoundBlocksByTime = $statistics->getLastBlocksbyTime();
// Propagate content our template
$smarty->assign("LASTBLOCKSBYTIME", $iFoundBlocksByTime);
$smarty->assign("BLOCKSFOUND", $aBlocksFoundData);
$smarty->assign("BLOCKLIMIT", $iLimit);
$smarty->assign("USEBLOCKAVERAGE", $use_average);

View File

@ -42,35 +42,11 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$dTimeSinceLast = 0;
}
$iFoundLastValid = $statistics->getLastValidBlocksbyTime(0);
$iFoundLastHourValid = $statistics->getLastValidBlocksbyTime(3600);
$iFoundLastDayValid = $statistics->getLastValidBlocksbyTime(86400);
$iFoundLastWeekValid = $statistics->getLastValidBlocksbyTime(604800);
$iFoundLastMonthValid = $statistics->getLastValidBlocksbyTime(2419200);
$iFoundLastOrphan = $statistics->getLastOrphanBlocksbyTime(0);
$iFoundLastHourOrphan = $statistics->getLastOrphanBlocksbyTime(3600);
$iFoundLastDayOrphan = $statistics->getLastOrphanBlocksbyTime(86400);
$iFoundLastWeekOrphan = $statistics->getLastOrphanBlocksbyTime(604800);
$iFoundLastMonthOrphan = $statistics->getLastOrphanBlocksbyTime(2419200);
// Past blocks found, max 4 weeks back
$iFoundBlocksByTime = $statistics->getLastBlocksbyTime();
// Propagate content our template
$smarty->assign("FOUNDALLVALID", $iFoundLastValid);
$smarty->assign("FOUNDLASTHOURVALID", $iFoundLastHourValid);
$smarty->assign("FOUNDLAST24HOURSVALID", $iFoundLastDayValid);
$smarty->assign("FOUNDLAST7DAYSVALID", $iFoundLastWeekValid);
$smarty->assign("FOUNDLAST4WEEKSVALID", $iFoundLastMonthValid);
$smarty->assign("FOUNDALLORPHAN", $iFoundLastOrphan);
$smarty->assign("FOUNDLASTHOURORPHAN", $iFoundLastHourOrphan);
$smarty->assign("FOUNDLAST24HOURSORPHAN", $iFoundLastDayOrphan);
$smarty->assign("FOUNDLAST7DAYSORPHAN", $iFoundLastWeekOrphan);
$smarty->assign("FOUNDLAST4WEEKSORPHAN", $iFoundLastMonthOrphan);
$smarty->assign("ESTTIME", $iEstTime);
$smarty->assign("LASTBLOCKSBYTIME", $iFoundBlocksByTime);
$smarty->assign("ESTTIME", $iEstTime);
$smarty->assign("TIMESINCELAST", $dTimeSinceLast);
$smarty->assign("BLOCKSFOUND", $aBlocksFoundData);

View File

@ -0,0 +1,45 @@
<article class="module width_half">
<header><h3>Block Overview</h3></header>
<table width="100%" class="tablesorter" cellspacing="0">
<thead>
<tr>
<th align="left"></th>
<th align="center">Found</th>
<th align="center">Valid</th>
<th align="center">Orphan</th>
</tr>
</thead>
<tbody>
<tr>
<th align="left" style="padding-left: 15px">All Time</td>
<td align="center">{$LASTBLOCKSBYTIME.Total}</td>
<td align="center">{$LASTBLOCKSBYTIME.TotalValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.TotalOrphan}</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last Hour</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourOrphan}</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last 24 Hours</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourOrphan}</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last 7 Days</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysOrphan}</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last 4 Weeks</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksOrphan}</td>
</tr>
</tbody>
</table>
</article>

View File

@ -0,0 +1,45 @@
<article class="module width_full">
<header><h3>Block Shares</h3></header>
<table width="70%" class="visualize" rel="line">
<caption>Block Shares</caption>
<thead>
<tr>
{section block $BLOCKSFOUND step=-1}
<th scope="col">{$BLOCKSFOUND[block].height}</th>
{/section}
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Expected</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].estshares}</td>
{/section}
</tr>
<tr>
<th scope="row">Actual</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].shares|default:"0"}</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>
<footer>
<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>
</footer>
</article>

View File

@ -0,0 +1,40 @@
<article class="module width_half">
<header><h3>Last 24 hour totals</h3></header>
<table class="tablesorter" cellspacing="0">
<thead>
<tr style="background-color:#B6DAFF;">
<th align="center">Blocks Found</th>
<th align="center">Rewards</th>
<th align="center">Avg Difficulty</th>
<th align="center">Expected Shares</th>
<th align="center">Actual Shares</th>
<th align="center" style="padding-right: 25px;">Percentage</th>
</tr>
</thead>
<tbody>
{assign var=percentage1 value=0}
<tr>
<td align="center">{$POOLSTATS.count|number_format:"0"}</td>
<td align="center">{$POOLSTATS.rewards|number_format:"4"}</td>
<td align="center">{$POOLSTATS.average|number_format:"4"}</td>
<td align="center">{$POOLSTATS.expected|number_format:"0"}</td>
<td align="center">{$POOLSTATS.shares|number_format:"0"}</td>
<td align="center" style="padding-right: 25px;">{if $POOLSTATS.shares > 0}{math assign="percentage1" equation="shares1 / estshares1 * 100" shares1=$POOLSTATS.shares estshares1=$POOLSTATS.expected}{/if}
<font color="{if ($percentage1 <= 100)}green{else}red{/if}">{$percentage1|number_format:"2"}</font></b></td>
</tr>
</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>
</article>

View File

@ -0,0 +1,70 @@
<article class="module width_full">
<header><h3>Last {$BLOCKLIMIT} Blocks Found</h3></header>
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th align="center">Block</th>
<th align="center">Validity</th>
<th>Finder</th>
<th align="center">Time</th>
<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>
</thead>
<tbody>
{assign var=count value=0}
{assign var=totalexpectedshares value=0}
{assign var=totalshares 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>
{else}
<td align="center">{$BLOCKSFOUND[block].height}</td>
{/if}
<td align="center">
{if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations}
<span class="confirmed">Confirmed</span>
{else if $BLOCKSFOUND[block].confirmations == -1}
<span class="orphan">Orphan</span>
{else}
<span class="unconfirmed">{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left</span>
{/if}
</td>
<td>{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
<td align="center">{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}</td>
<td align="right">{$BLOCKSFOUND[block].difficulty|number_format:"2"}</td>
<td align="right">{$BLOCKSFOUND[block].amount|number_format:"2"}</td>
<td align="right">
{assign var="totalexpectedshares" value=$totalexpectedshares+$BLOCKSFOUND[block].estshares}
{$BLOCKSFOUND[block].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|default:"0" estshares=$BLOCKSFOUND[block].estshares}
<font color="{if ($percentage <= 100)}green{else}red{/if}">{$percentage|number_format:"2"}</font>
</td>
</tr>
{/section}
<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 (($totalshares / $totalexpectedshares * 100) <= 100)}green{else}red{/if}">{($totalshares / $totalexpectedshares * 100)|number_format:"2"}</font>{else}0{/if}</td>
</tr>
</tbody>
</table>
<footer>
{if $GLOBAL.config.payout_system != 'pps'}<ul><li>Note: Round Earnings are not credited until <font color="orange">{$GLOBAL.confirmations}</font> confirms.</li></ul>{/if}
</footer>
</article>

View File

@ -1,156 +1,4 @@
<article class="module width_full">
<header><h3>Block Share Overview</h3></header>
<table width="70%" class="visualize" rel="line">
<caption>Block Shares</caption>
<thead>
<tr>
{section block $BLOCKSFOUND step=-1}
<th scope="col">{$BLOCKSFOUND[block].height}</th>
{/section}
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Expected</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].estshares}</td>
{/section}
</tr>
<tr>
<th scope="row">Actual</th>
{section block $BLOCKSFOUND step=-1}
<td>{$BLOCKSFOUND[block].shares|default:"0"}</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>
<br>
<header><h3>Last 24 hour totals</h3></header>
<table class="tablesorter" cellspacing="0">
<thead>
<tr style="background-color:#B6DAFF;">
<th align="center">Blocks Found</th>
<th align="center">Rewards</th>
<th align="center">Avg Difficulty</th>
<th align="center">Expected Shares</th>
<th align="center">Actual Shares</th>
<th align="center" style="padding-right: 25px;">Percentage</th>
</tr>
</thead>
<tbody>
{assign var=percentage1 value=0}
<tr>
<td align="center">{$POOLSTATS.count|number_format:"0"}</td>
<td align="center">{$POOLSTATS.rewards|number_format:"4"}</td>
<td align="center">{$POOLSTATS.average|number_format:"4"}</td>
<td align="center">{$POOLSTATS.expected|number_format:"0"}</td>
<td align="center">{$POOLSTATS.shares|number_format:"0"}</td>
<td align="center" style="padding-right: 25px;">{if $POOLSTATS.shares > 0}{math assign="percentage1" equation="shares1 / estshares1 * 100" shares1=$POOLSTATS.shares estshares1=$POOLSTATS.expected}{/if}
<font color="{if ($percentage1 <= 100)}green{else}red{/if}">{$percentage1|number_format:"2"}</font></b></td>
</tr>
</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>
<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>
</footer>
</article>
<article class="module width_full">
<header><h3>Last {$BLOCKLIMIT} Blocks Found</h3></header>
<table class="tablesorter" cellspacing="0">
<thead>
<tr>
<th align="center">Block</th>
<th align="center">Validity</th>
<th>Finder</th>
<th align="center">Time</th>
<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>
</thead>
<tbody>
{assign var=count value=0}
{assign var=totalexpectedshares value=0}
{assign var=totalshares 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>
{else}
<td align="center">{$BLOCKSFOUND[block].height}</td>
{/if}
<td align="center">
{if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations}
<span class="confirmed">Confirmed</span>
{else if $BLOCKSFOUND[block].confirmations == -1}
<span class="orphan">Orphan</span>
{else}
<span class="unconfirmed">{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left</span>
{/if}
</td>
<td>{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
<td align="center">{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}</td>
<td align="right">{$BLOCKSFOUND[block].difficulty|number_format:"2"}</td>
<td align="right">{$BLOCKSFOUND[block].amount|number_format:"2"}</td>
<td align="right">
{assign var="totalexpectedshares" value=$totalexpectedshares+$BLOCKSFOUND[block].estshares}
{$BLOCKSFOUND[block].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|default:"0" estshares=$BLOCKSFOUND[block].estshares}
<font color="{if ($percentage <= 100)}green{else}red{/if}">{$percentage|number_format:"2"}</font>
</td>
</tr>
{/section}
<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 (($totalshares / $totalexpectedshares * 100) <= 100)}green{else}red{/if}">{($totalshares / $totalexpectedshares * 100)|number_format:"2"}</font>{else}0{/if}</td>
</tr>
</tbody>
</table>
<footer>
{if $GLOBAL.config.payout_system != 'pps'}<ul><li>Note: Round Earnings are not credited until <font color="orange">{$GLOBAL.confirmations}</font> confirms.</li></ul>{/if}
</footer>
</article>
{include file="statistics/blocks/block_overview_time.tpl"}
{include file="statistics/blocks/block_shares_time.tpl"}
{include file="statistics/blocks/block_shares_graph.tpl"}
{include file="statistics/blocks/blocks_found_details.tpl"}

View File

@ -67,33 +67,33 @@
</tr>
<tr>
<th align="left">All Time</td>
<td align="center">{$FOUNDALLVALID + $FOUNDALLORPHAN}</td>
<td align="center">{$FOUNDALLVALID}</td>
<td align="center">{$FOUNDALLORPHAN}</td>
<td align="center">{$LASTBLOCKSBYTIME.Total}</td>
<td align="center">{$LASTBLOCKSBYTIME.TotalValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.TotalOrphan}</td>
</tr>
<tr>
<th align="left">Last Hour</td>
<td align="center">{$FOUNDLASTHOURVALID + $FOUNDLASTHOURORPHAN}</td>
<td align="center">{$FOUNDLASTHOURVALID}</td>
<td align="center">{$FOUNDLASTHOURORPHAN}</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourOrphan}</td>
</tr>
<tr>
<th align="left">Last 24 Hours</td>
<td align="center">{$FOUNDLAST24HOURSVALID + $FOUNDLAST24HOURSORPHAN}
<td align="center">{$FOUNDLAST24HOURSVALID}</td>
<td align="center">{$FOUNDLAST24HOURSORPHAN}</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourOrphan}</td>
</tr>
<tr>
<th align="left">Last 7 Days</td>
<td align="center">{$FOUNDLAST7DAYSVALID + $FOUNDLAST7DAYSORPHAN}</td>
<td align="center">{$FOUNDLAST7DAYSVALID}</td>
<td align="center">{$FOUNDLAST7DAYSORPHAN}</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysOrphan}</td>
</tr>
<tr>
<th align="left">Last 4 Weeks</td>
<td align="center">{$FOUNDLAST4WEEKSVALID + $FOUNDLAST4WEEKSORPHAN}</td>
<td align="center">{$FOUNDLAST4WEEKSVALID}</td>
<td align="center">{$FOUNDLAST4WEEKSORPHAN}</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksOrphan}</td>
</tr>
</tbody>
</table>