diff --git a/public/include/autoloader.inc.php b/public/include/autoloader.inc.php index 35ce807e..d86245fb 100644 --- a/public/include/autoloader.inc.php +++ b/public/include/autoloader.inc.php @@ -41,6 +41,7 @@ require_once(CLASS_DIR . '/invitation.class.php'); require_once(CLASS_DIR . '/share.class.php'); require_once(CLASS_DIR . '/worker.class.php'); require_once(CLASS_DIR . '/statistics.class.php'); +require_once(CLASS_DIR . '/roundstats.class.php'); require_once(CLASS_DIR . '/transaction.class.php'); require_once(CLASS_DIR . '/notification.class.php'); require_once(CLASS_DIR . '/news.class.php'); diff --git a/public/include/config/admin_settings.inc.php b/public/include/config/admin_settings.inc.php index f3b68cd8..3342ef49 100644 --- a/public/include/config/admin_settings.inc.php +++ b/public/include/config/admin_settings.inc.php @@ -108,12 +108,19 @@ $aSettings['acl'][] = array( 'tooltip' => 'Make the pool statistics page private (users only) or public.' ); $aSettings['acl'][] = array( - 'display' => 'Blcok Statistics', 'type' => 'select', + 'display' => 'Block Statistics', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public'), 'default' => 1, 'name' => 'acl_block_statistics', 'value' => $setting->getValue('acl_block_statistics'), 'tooltip' => 'Make the block statistics page private (users only) or public.' ); +$aSettings['acl'][] = array( + 'display' => 'Round Statistics', 'type' => 'select', + 'options' => array( 0 => 'Private', 1 => 'Public'), + 'default' => 1, + 'name' => 'acl_round_statistics', 'value' => $setting->getValue('acl_round_statistics'), + 'tooltip' => 'Make the round statistics page private (users only) or public.' +); $aSettings['system'][] = array( 'display' => 'Disable e-mail confirmations', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), diff --git a/public/include/pages/statistics/round.inc.php b/public/include/pages/statistics/round.inc.php index 06b3b8f5..b4d138e1 100644 --- a/public/include/pages/statistics/round.inc.php +++ b/public/include/pages/statistics/round.inc.php @@ -6,18 +6,18 @@ 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['tx_key'])) { - $_REQUEST['tx_key'] = $roundstats->getNextBlockDesc($_REQUEST['tx_key']); -} else if (@$_REQUEST['prev'] && !empty($_REQUEST['tx_key'])) { - $_REQUEST['tx_key'] = $roundstats->getNextBlockAsc($_REQUEST['tx_key']); +if (@$_REQUEST['next'] && !empty($_REQUEST['height'])) { + $_REQUEST['height'] = $roundstats->getNextBlockDesc($_REQUEST['height']); +} else if (@$_REQUEST['prev'] && !empty($_REQUEST['height'])) { + $_REQUEST['height'] = $roundstats->getNextBlockAsc($_REQUEST['height']); } -if (empty($_REQUEST['tx_key'])) { +if (empty($_REQUEST['height'])) { $iBlock = $block->getLast(); $iKey = $iBlock['height']; - $_REQUEST['tx_key'] = $iKey; + $_REQUEST['height'] = $iKey; } else { - $iKey = $_REQUEST['tx_key']; + $iKey = $_REQUEST['height']; } $aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iKey, $user->isAdmin($_SESSION['USERDATA']['id'])); @@ -37,5 +37,9 @@ if ($user->isAdmin($_SESSION['USERDATA']['id'])) { $debug->append('Using cached page', 3); } -$smarty->assign("CONTENT", "default.tpl"); +if ($setting->getValue('acl_round_statistics')) { + $smarty->assign("CONTENT", "default.tpl"); +} else if ($user->isAuthenticated()) { + $smarty->assign("CONTENT", "default.tpl"); +} ?> diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index af2805b8..d457ee4e 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -72,6 +72,7 @@ $setting->getValue('website_chaininfo_url') ? $aGlobal['website']['chaininfo'][' // ACLs $aGlobal['acl']['pool']['statistics'] = $setting->getValue('acl_pool_statistics'); $aGlobal['acl']['block']['statistics'] = $setting->getValue('acl_block_statistics'); +$aGlobal['acl']['round']['statistics'] = $setting->getValue('acl_round_statistics'); // Special calculations for PPS Values based on reward_type setting and/or available blocks if ($config['reward_type'] != 'block') { diff --git a/public/templates/mmcFE/global/navigation.tpl b/public/templates/mmcFE/global/navigation.tpl index 75db64ce..c7f762e9 100644 --- a/public/templates/mmcFE/global/navigation.tpl +++ b/public/templates/mmcFE/global/navigation.tpl @@ -41,6 +41,9 @@ {/if} {if $GLOBAL.acl.block.statistics}
  • Block Stats
  • + {/if} + {if $GLOBAL.acl.round.statistics} +
  • Round Stats
  • {/if} {/if} diff --git a/public/templates/mmcFE/statistics/blocks/default.tpl b/public/templates/mmcFE/statistics/blocks/default.tpl index 6596647f..2bf8e85c 100644 --- a/public/templates/mmcFE/statistics/blocks/default.tpl +++ b/public/templates/mmcFE/statistics/blocks/default.tpl @@ -55,11 +55,7 @@ target and network difficulty and assuming a zero variance scenario. {assign var="totalshares" value=$totalshares+$BLOCKSFOUND[block].shares} {assign var="count" value=$count+1} - {if ! $GLOBAL.website.blockexplorer.disabled} - {$BLOCKSFOUND[block].height} - {else} - {$BLOCKSFOUND[block].height} - {/if} + {$BLOCKSFOUND[block].height} {if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations} Confirmed diff --git a/public/templates/mmcFE/statistics/blocks/small_table.tpl b/public/templates/mmcFE/statistics/blocks/small_table.tpl index e826fd3a..0c1760ff 100644 --- a/public/templates/mmcFE/statistics/blocks/small_table.tpl +++ b/public/templates/mmcFE/statistics/blocks/small_table.tpl @@ -13,11 +13,7 @@ {assign var=rank value=1} {section block $BLOCKSFOUND} - {if ! $GLOBAL.website.blockexplorer.disabled} - {$BLOCKSFOUND[block].height} - {else} - {$BLOCKSFOUND[block].height} - {/if} + {$BLOCKSFOUND[block].height} {if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if} {$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"} {$BLOCKSFOUND[block].shares|number_format} diff --git a/public/templates/mmcFE/statistics/round/block_stats.tpl b/public/templates/mmcFE/statistics/round/block_stats.tpl index 40081671..5943e421 100644 --- a/public/templates/mmcFE/statistics/round/block_stats.tpl +++ b/public/templates/mmcFE/statistics/round/block_stats.tpl @@ -9,12 +9,16 @@ - Block Id + ID {$BLOCKDETAILS.id|default:"0"} - Heigth - {$BLOCKDETAILS.height|default:"0"} + Height + {if ! $GLOBAL.website.blockexplorer.disabled} + {$BLOCKDETAILS.height} + {else} + {$BLOCKDETAILS.height} + {/if} Amount diff --git a/public/templates/mmcFE/statistics/round/round_shares.tpl b/public/templates/mmcFE/statistics/round/round_shares.tpl index db1083d2..919aed8e 100644 --- a/public/templates/mmcFE/statistics/round/round_shares.tpl +++ b/public/templates/mmcFE/statistics/round/round_shares.tpl @@ -3,10 +3,11 @@ - - + + + @@ -14,10 +15,11 @@ {assign var=listed value=0} {section contrib $ROUNDSHARES} - + + {/section}
    RankUser NameRankUser Name Valid InvalidInvalid %
    {$rank++}{$rank++} {if $ROUNDSHARES[contrib].is_anonymous|default:"0" == 1}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if} {$ROUNDSHARES[contrib].valid|number_format} {$ROUNDSHARES[contrib].invalid|number_format}{($ROUNDSHARES[contrib].invalid / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"}