From a7cda8fedc7a5da6964abed16e9a860a07aa5b0f Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 Nov 2013 15:27:39 +0100 Subject: [PATCH] [TEMPLATE] block stats in mmcfe --- .../include/pages/statistics/blocks.inc.php | 3 +- .../statistics/blocks/block_overview_time.tpl | 64 +++++++ .../statistics/blocks/block_shares_graph.tpl | 58 +++++++ .../statistics/blocks/block_shares_time.tpl | 27 +++ .../blocks/blocks_found_details.tpl | 30 ++++ .../mmcFE/statistics/blocks/default.tpl | 160 +----------------- 6 files changed, 184 insertions(+), 158 deletions(-) create mode 100644 public/templates/mmcFE/statistics/blocks/block_overview_time.tpl create mode 100644 public/templates/mmcFE/statistics/blocks/block_shares_graph.tpl create mode 100644 public/templates/mmcFE/statistics/blocks/block_shares_time.tpl create mode 100644 public/templates/mmcFE/statistics/blocks/blocks_found_details.tpl diff --git a/public/include/pages/statistics/blocks.inc.php b/public/include/pages/statistics/blocks.inc.php index ef697dc7..cf812792 100644 --- a/public/include/pages/statistics/blocks.inc.php +++ b/public/include/pages/statistics/blocks.inc.php @@ -70,10 +70,9 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { } $iHours = 24; - $now = new DateTime( "now" ); $aPoolStatistics = $statistics->getPoolStatsHours($iHours); $iFirstBlockFound = $statistics->getFirstBlockFound(); - $iTimeSinceFirstBlockFound = ($now->getTimestamp() - $iFirstBlockFound); + $iTimeSinceFirstBlockFound = (time() - $iFirstBlockFound); // Past blocks found, max 4 weeks back $iFoundBlocksByTime = $statistics->getLastBlocksbyTime(); diff --git a/public/templates/mmcFE/statistics/blocks/block_overview_time.tpl b/public/templates/mmcFE/statistics/blocks/block_overview_time.tpl new file mode 100644 index 00000000..b91ee837 --- /dev/null +++ b/public/templates/mmcFE/statistics/blocks/block_overview_time.tpl @@ -0,0 +1,64 @@ +{include file="global/block_header.tpl" BLOCK_HEADER="Block Shares" BLOCK_STYLE="clear:none;"} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Gen Est.FoundValidOrphanRate Est.
All Time + {($FIRSTBLOCKFOUND / $COINGENTIME|default:"150")|number_format:"0"}{$LASTBLOCKSBYTIME.Total}{$LASTBLOCKSBYTIME.TotalValid}{$LASTBLOCKSBYTIME.TotalOrphan}{($LASTBLOCKSBYTIME.Total|default:"0.00" / ($FIRSTBLOCKFOUND / $COINGENTIME|default:"150") * 100)|number_format:"2"} %
Last Hour + {(3600 / $COINGENTIME|default:"150")}{$LASTBLOCKSBYTIME.1HourTotal}{$LASTBLOCKSBYTIME.1HourValid}{$LASTBLOCKSBYTIME.1HourOrphan}{($LASTBLOCKSBYTIME.1HourTotal|default:"0.00" / (3600 / $COINGENTIME|default:"150") * 100)|number_format:"2"} %
Last 24 Hours + {(86400 / $COINGENTIME|default:"150")}{$LASTBLOCKSBYTIME.24HourTotal}{$LASTBLOCKSBYTIME.24HourValid}{$LASTBLOCKSBYTIME.24HourOrphan}{($LASTBLOCKSBYTIME.24HourTotal|default:"0.00" / (86400 / $COINGENTIME|default:"150") * 100)|number_format:"2"} %
Last 7 Days + {(604800 / $COINGENTIME|default:"150")}{$LASTBLOCKSBYTIME.7DaysTotal}{$LASTBLOCKSBYTIME.7DaysValid}{$LASTBLOCKSBYTIME.7DaysOrphan}{($LASTBLOCKSBYTIME.7DaysTotal|default:"0.00" / (604800 / $COINGENTIME|default:"150") * 100)|number_format:"2"} %
Last 4 Weeks + {(2419200 / $COINGENTIME|default:"150")}{$LASTBLOCKSBYTIME.4WeeksTotal}{$LASTBLOCKSBYTIME.4WeeksValid}{$LASTBLOCKSBYTIME.4WeeksOrphan}{($LASTBLOCKSBYTIME.4WeeksTotal|default:"0.00" / (2419200 / $COINGENTIME|default:"150") * 100)|number_format:"2"} %
Last 12 Month + {(29030400 / $COINGENTIME|default:"150")}{$LASTBLOCKSBYTIME.12MonthTotal}{$LASTBLOCKSBYTIME.12MonthValid}{$LASTBLOCKSBYTIME.12MonthOrphan}{($LASTBLOCKSBYTIME.12MonthTotal|default:"0.00" / (29030400 / $COINGENTIME|default:"150") * 100)|number_format:"2"} %
+{include file="global/block_footer.tpl"} \ No newline at end of file diff --git a/public/templates/mmcFE/statistics/blocks/block_shares_graph.tpl b/public/templates/mmcFE/statistics/blocks/block_shares_graph.tpl new file mode 100644 index 00000000..4f161b38 --- /dev/null +++ b/public/templates/mmcFE/statistics/blocks/block_shares_graph.tpl @@ -0,0 +1,58 @@ +{include file="global/block_header.tpl" BLOCK_HEADER="Block Shares" BLOCK_STYLE="clear:none;"} +
+ + + + +{section block $BLOCKSFOUND step=-1} + +{/section} + + + + + +{section block $BLOCKSFOUND step=-1} + +{/section} + + + +{section block $BLOCKSFOUND step=-1} + +{/section} + + {if $GLOBAL.config.payout_system == 'pplns'} + +{section block $BLOCKSFOUND step=-1} + +{/section} + {/if} + {if $USEBLOCKAVERAGE} + +{section block $BLOCKSFOUND step=-1} + +{/section} + {/if} + +
Block Shares
{$BLOCKSFOUND[block].height}
Expected{$BLOCKSFOUND[block].estshares}
Actual{$BLOCKSFOUND[block].shares}
PPLNS{$BLOCKSFOUND[block].pplns_shares}
Average{$BLOCKSFOUND[block].block_avg}
+ + + + + + + + +
+ + + +
+

+

+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. +

+
+{include file="global/block_footer.tpl"} \ No newline at end of file diff --git a/public/templates/mmcFE/statistics/blocks/block_shares_time.tpl b/public/templates/mmcFE/statistics/blocks/block_shares_time.tpl new file mode 100644 index 00000000..229facf9 --- /dev/null +++ b/public/templates/mmcFE/statistics/blocks/block_shares_time.tpl @@ -0,0 +1,27 @@ +{include file="global/block_header.tpl" BLOCK_HEADER="Block Shares" BLOCK_STYLE="clear:none;"} +

Last 24 hour totals

+ + + + + + + + + + + + + {assign var=percentage1 value=0} + + + + + + + + + +
Blocks FoundRewardsAvg DifficultyExpected SharesActual SharesPercentage
{$POOLSTATS.count|number_format:"0"}{$POOLSTATS.rewards|number_format:"4"}{$POOLSTATS.average|number_format:"4"}{$POOLSTATS.expected|number_format:"0"}{$POOLSTATS.shares|number_format:"0"}{if $POOLSTATS.shares > 0}{math assign="percentage1" equation="shares1 / estshares1 * 100" shares1=$POOLSTATS.shares estshares1=$POOLSTATS.expected}{/if} + {$percentage1|number_format:"2"}
+{include file="global/block_footer.tpl"} diff --git a/public/templates/mmcFE/statistics/blocks/blocks_found_details.tpl b/public/templates/mmcFE/statistics/blocks/blocks_found_details.tpl new file mode 100644 index 00000000..b9431854 --- /dev/null +++ b/public/templates/mmcFE/statistics/blocks/blocks_found_details.tpl @@ -0,0 +1,30 @@ +{include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;"} +
+ + + + + + + + + + +{assign var=rank value=1} +{section block $BLOCKSFOUND} + + + + + + +{/section} + +
BlockFinderTimeActual Shares
{$BLOCKSFOUND[block].height}{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}{$BLOCKSFOUND[block].shares|number_format}
+
+{if $GLOBAL.config.payout_system != 'pps'} + +{/if} +{include file="global/block_footer.tpl"} diff --git a/public/templates/mmcFE/statistics/blocks/default.tpl b/public/templates/mmcFE/statistics/blocks/default.tpl index 28fdd3d6..54264453 100644 --- a/public/templates/mmcFE/statistics/blocks/default.tpl +++ b/public/templates/mmcFE/statistics/blocks/default.tpl @@ -1,156 +1,4 @@ -{include file="global/block_header.tpl" BLOCK_HEADER="Block Shares" BLOCK_STYLE="clear:none;"} - - - - -{section block $BLOCKSFOUND step=-1} - -{/section} - - - - - -{section block $BLOCKSFOUND step=-1} - -{/section} - - - -{section block $BLOCKSFOUND step=-1} - -{/section} - - {if $GLOBAL.config.payout_system == 'pplns'} - -{section block $BLOCKSFOUND step=-1} - -{/section} - {/if} - {if $USEBLOCKAVERAGE} - -{section block $BLOCKSFOUND step=-1} - -{/section} - {/if} - -
Block Shares
{$BLOCKSFOUND[block].height}
Expected{$BLOCKSFOUND[block].estshares}
Actual{$BLOCKSFOUND[block].shares}
PPLNS{$BLOCKSFOUND[block].pplns_shares}
Average{$BLOCKSFOUND[block].block_avg}
-

-

-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. -

- - - - - - - - - - - - - - - - - {assign var=percentage1 value=0} - - - - - - - - - -
Last 24 hour totals
Blocks FoundRewardsAvg DifficultyExpected SharesActual SharesPercentage
{$POOLSTATS.count|number_format:"0"}{$POOLSTATS.rewards|number_format:"4"}{$POOLSTATS.average|number_format:"4"}{$POOLSTATS.expected|number_format:"0"}{$POOLSTATS.shares|number_format:"0"}{if $POOLSTATS.shares > 0}{math assign="percentage1" equation="shares1 / estshares1 * 100" shares1=$POOLSTATS.shares estshares1=$POOLSTATS.expected}{/if} - {$percentage1|number_format:"2"}
- - - - - - - - -
- - - -
-
-{include file="global/block_footer.tpl"} - -{include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;"} -
- - - - - - - - - - - {if $GLOBAL.config.payout_system == 'pplns'}{/if} - - - - - -{assign var=count value=0} -{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} - - - - - - - - - {if $GLOBAL.config.payout_system == 'pplns'}{/if} - - - -{/section} - {if $count > 0} - - - - {if $GLOBAL.config.payout_system == 'pplns'}{/if} - - - {/if} - -
BlockValidityFinderTimeDifficultyAmountExpected SharesPPLNS SharesActual SharesPercentage
{$BLOCKSFOUND[block].height} - {if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations} - Confirmed - {else if $BLOCKSFOUND[block].confirmations == -1} - Orphan - {else}{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left{/if}{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}{$BLOCKSFOUND[block].difficulty|number_format:"8"}{$BLOCKSFOUND[block].amount|number_format:"2"} - {$BLOCKSFOUND[block].estshares|number_format} - {assign var="totalexpectedshares" value=$totalexpectedshares+$BLOCKSFOUND[block].estshares} - {$BLOCKSFOUND[block].pplns_shares|number_format}{$BLOCKSFOUND[block].shares|number_format} - {math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares estshares=$BLOCKSFOUND[block].estshares} - {assign var="totalpercentage" value=$totalpercentage+$percentage} - {$percentage|number_format:"2"} -
Totals{$totalexpectedshares|number_format}{$pplnsshares|number_format}{$totalshares|number_format}{($totalpercentage / $count)|number_format:"2"} -
-
-{if $GLOBAL.config.payout_system != 'pps'} - -{/if} -{include file="global/block_footer.tpl"} +{include file="statistics/blocks/block_shares_graph.tpl"} +{include file="statistics/blocks/block_overview_time.tpl"} +{include file="statistics/blocks/block_shares_time.tpl"} +{include file="statistics/blocks/blocks_found_details.tpl"} \ No newline at end of file