further implemetation into mmcfe-ng

This commit is contained in:
Sebastian Grewe 2013-09-06 10:29:42 +02:00
parent b3ba080345
commit ab6a4f57d3
9 changed files with 39 additions and 25 deletions

View File

@ -41,6 +41,7 @@ require_once(CLASS_DIR . '/invitation.class.php');
require_once(CLASS_DIR . '/share.class.php'); require_once(CLASS_DIR . '/share.class.php');
require_once(CLASS_DIR . '/worker.class.php'); require_once(CLASS_DIR . '/worker.class.php');
require_once(CLASS_DIR . '/statistics.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 . '/transaction.class.php');
require_once(CLASS_DIR . '/notification.class.php'); require_once(CLASS_DIR . '/notification.class.php');
require_once(CLASS_DIR . '/news.class.php'); require_once(CLASS_DIR . '/news.class.php');

View File

@ -108,12 +108,19 @@ $aSettings['acl'][] = array(
'tooltip' => 'Make the pool statistics page private (users only) or public.' 'tooltip' => 'Make the pool statistics page private (users only) or public.'
); );
$aSettings['acl'][] = array( $aSettings['acl'][] = array(
'display' => 'Blcok Statistics', 'type' => 'select', 'display' => 'Block Statistics', 'type' => 'select',
'options' => array( 0 => 'Private', 1 => 'Public'), 'options' => array( 0 => 'Private', 1 => 'Public'),
'default' => 1, 'default' => 1,
'name' => 'acl_block_statistics', 'value' => $setting->getValue('acl_block_statistics'), 'name' => 'acl_block_statistics', 'value' => $setting->getValue('acl_block_statistics'),
'tooltip' => 'Make the block statistics page private (users only) or public.' '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( $aSettings['system'][] = array(
'display' => 'Disable e-mail confirmations', 'type' => 'select', 'display' => 'Disable e-mail confirmations', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ), 'options' => array( 0 => 'No', 1 => 'Yes' ),

View File

@ -6,18 +6,18 @@ if (!defined('SECURITY')) die('Hacking attempt');
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$debug->append('No cached version available, fetching from backend', 3); $debug->append('No cached version available, fetching from backend', 3);
if (@$_REQUEST['next'] && !empty($_REQUEST['tx_key'])) { if (@$_REQUEST['next'] && !empty($_REQUEST['height'])) {
$_REQUEST['tx_key'] = $roundstats->getNextBlockDesc($_REQUEST['tx_key']); $_REQUEST['height'] = $roundstats->getNextBlockDesc($_REQUEST['height']);
} else if (@$_REQUEST['prev'] && !empty($_REQUEST['tx_key'])) { } else if (@$_REQUEST['prev'] && !empty($_REQUEST['height'])) {
$_REQUEST['tx_key'] = $roundstats->getNextBlockAsc($_REQUEST['tx_key']); $_REQUEST['height'] = $roundstats->getNextBlockAsc($_REQUEST['height']);
} }
if (empty($_REQUEST['tx_key'])) { if (empty($_REQUEST['height'])) {
$iBlock = $block->getLast(); $iBlock = $block->getLast();
$iKey = $iBlock['height']; $iKey = $iBlock['height'];
$_REQUEST['tx_key'] = $iKey; $_REQUEST['height'] = $iKey;
} else { } else {
$iKey = $_REQUEST['tx_key']; $iKey = $_REQUEST['height'];
} }
$aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iKey, $user->isAdmin($_SESSION['USERDATA']['id'])); $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); $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");
}
?> ?>

View File

@ -72,6 +72,7 @@ $setting->getValue('website_chaininfo_url') ? $aGlobal['website']['chaininfo']['
// ACLs // ACLs
$aGlobal['acl']['pool']['statistics'] = $setting->getValue('acl_pool_statistics'); $aGlobal['acl']['pool']['statistics'] = $setting->getValue('acl_pool_statistics');
$aGlobal['acl']['block']['statistics'] = $setting->getValue('acl_block_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 // Special calculations for PPS Values based on reward_type setting and/or available blocks
if ($config['reward_type'] != 'block') { if ($config['reward_type'] != 'block') {

View File

@ -41,6 +41,9 @@
{/if} {/if}
{if $GLOBAL.acl.block.statistics} {if $GLOBAL.acl.block.statistics}
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=blocks">Block Stats</a></li> <li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=blocks">Block Stats</a></li>
{/if}
{if $GLOBAL.acl.round.statistics}
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round">Round Stats</a></li>
{/if} {/if}
</ul> </ul>
{/if} {/if}

View File

@ -55,11 +55,7 @@ target and network difficulty and assuming a zero variance scenario.
{assign var="totalshares" value=$totalshares+$BLOCKSFOUND[block].shares} {assign var="totalshares" value=$totalshares+$BLOCKSFOUND[block].shares}
{assign var="count" value=$count+1} {assign var="count" value=$count+1}
<tr class="{cycle values="odd,even"}"> <tr class="{cycle values="odd,even"}">
{if ! $GLOBAL.website.blockexplorer.disabled} <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"><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKSFOUND[block].blockhash}" target="_blank">{$BLOCKSFOUND[block].height}</a></td>
{else}
<td class="center">{$BLOCKSFOUND[block].height}</td>
{/if}
<td class="center"> <td class="center">
{if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations} {if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font> <font color="green">Confirmed</font>

View File

@ -13,11 +13,7 @@
{assign var=rank value=1} {assign var=rank value=1}
{section block $BLOCKSFOUND} {section block $BLOCKSFOUND}
<tr class="{cycle values="odd,even"}"> <tr class="{cycle values="odd,even"}">
{if ! $GLOBAL.website.blockexplorer.disabled} <td><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round&height={$BLOCKSFOUND[block].height}">{$BLOCKSFOUND[block].height}</a></td>
<td class="center"><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKSFOUND[block].blockhash}" target="_new">{$BLOCKSFOUND[block].height}</a></td>
{else}
<td class="center">{$BLOCKSFOUND[block].height}</td>
{/if}
<td>{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td> <td>{if $BLOCKSFOUND[block].is_anonymous|default:"0" == 1}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
<td class="center">{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}</td> <td class="center">{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}</td>
<td class="right">{$BLOCKSFOUND[block].shares|number_format}</td> <td class="right">{$BLOCKSFOUND[block].shares|number_format}</td>

View File

@ -9,12 +9,16 @@
</thead> </thead>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td>Block Id</td> <td>ID</td>
<td>{$BLOCKDETAILS.id|default:"0"}</td> <td>{$BLOCKDETAILS.id|default:"0"}</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td>Heigth</td> <td>Height</td>
<td>{$BLOCKDETAILS.height|default:"0"}</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>
<tr class="odd"> <tr class="odd">
<td>Amount</td> <td>Amount</td>

View File

@ -3,10 +3,11 @@
<table width="100%" border="0" style="font-size:13px;"> <table width="100%" border="0" style="font-size:13px;">
<thead> <thead>
<tr style="background-color:#B6DAFF;"> <tr style="background-color:#B6DAFF;">
<th align="left">Rank</th> <th class="center">Rank</th>
<th align="left" scope="col">User Name</th> <th class="left" scope="col">User Name</th>
<th class="right" scope="col">Valid</th> <th class="right" scope="col">Valid</th>
<th class="right" scope="col">Invalid</th> <th class="right" scope="col">Invalid</th>
<th class="right" scope="col">Invalid %</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -14,10 +15,11 @@
{assign var=listed value=0} {assign var=listed value=0}
{section contrib $ROUNDSHARES} {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 == $ROUNDSHARES[contrib].username}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
<td>{$rank++}</td> <td class="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}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if}</td>
<td class="right">{$ROUNDSHARES[contrib].valid|number_format}</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|number_format}</td>
<td class="right">{($ROUNDSHARES[contrib].invalid / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"}</td>
</tr> </tr>
{/section} {/section}
</tbody> </tbody>