From b771920210311f2c85aefaed1845851d5c42d7e0 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 24 May 2013 15:57:14 +0200 Subject: [PATCH] adding block status page for past 30 blocks, no graphs yet --- .../include/pages/statistics/blocks.inc.php | 22 +++++++++++++++++++ public/include/pages/statistics/pool.inc.php | 4 +++- public/templates/mmcFE/global/navigation.tpl | 2 +- .../mmcFE/statistics/blocks/blocks_found.tpl | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 public/include/pages/statistics/blocks.inc.php diff --git a/public/include/pages/statistics/blocks.inc.php b/public/include/pages/statistics/blocks.inc.php new file mode 100644 index 00000000..7ba0bfdd --- /dev/null +++ b/public/include/pages/statistics/blocks.inc.php @@ -0,0 +1,22 @@ +getBlocksFound($iLimit); +$aBlockData = $aBlocksFoundData[0]; + +// Propagate content our template +$smarty->assign("BLOCKSFOUND", $aBlocksFoundData); +$smarty->assign("BLOCKLIMIT", $iLimit); + +if ($_SESSION['AUTHENTICATED']) { + $smarty->assign("CONTENT", "blocks_found.tpl"); +} else { + $smarty->assign("CONTENT", "default.tpl"); +} +?> diff --git a/public/include/pages/statistics/pool.inc.php b/public/include/pages/statistics/pool.inc.php index af0a4ebf..238b00b5 100644 --- a/public/include/pages/statistics/pool.inc.php +++ b/public/include/pages/statistics/pool.inc.php @@ -27,7 +27,8 @@ $aContributorsShares = $statistics->getTopContributors('shares', 15); $aContributorsHashes = $statistics->getTopContributors('hashes', 15); // Grab the last 10 blocks found -$aBlocksFoundData = $statistics->getBlocksFound(10); +$iLimit = 10; +$aBlocksFoundData = $statistics->getBlocksFound($iLimit); $aBlockData = $aBlocksFoundData[0]; // Estimated time to find the next block @@ -47,6 +48,7 @@ if (!empty($aBlockData)) { $smarty->assign("ESTTIME", $iEstTime); $smarty->assign("TIMESINCELAST", $dTimeSinceLast); $smarty->assign("BLOCKSFOUND", $aBlocksFoundData); +$smarty->assign("BLOCKLIMIT", $iLimit); $smarty->assign("CONTRIBSHARES", $aContributorsShares); $smarty->assign("CONTRIBHASHES", $aContributorsHashes); $smarty->assign("CURRENTBLOCK", $iBlock); diff --git a/public/templates/mmcFE/global/navigation.tpl b/public/templates/mmcFE/global/navigation.tpl index 83400cae..52b99a3f 100644 --- a/public/templates/mmcFE/global/navigation.tpl +++ b/public/templates/mmcFE/global/navigation.tpl @@ -14,7 +14,7 @@
  • Statistics
  • Getting Started
  • diff --git a/public/templates/mmcFE/statistics/blocks/blocks_found.tpl b/public/templates/mmcFE/statistics/blocks/blocks_found.tpl index a8f9686f..7f6c27bf 100644 --- a/public/templates/mmcFE/statistics/blocks/blocks_found.tpl +++ b/public/templates/mmcFE/statistics/blocks/blocks_found.tpl @@ -1,4 +1,4 @@ -{include file="global/block_header.tpl" BLOCK_HEADER="Last 10 Blocks Found" BLOCK_STYLE="clear:none;" BUTTONS=array(More)} +{include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;" BUTTONS=array(More)}