Merge pull request #483 from TheSerapher/issue-446

Issue 446
This commit is contained in:
Sebastian Grewe 2013-07-18 02:05:45 -07:00
commit 1cd39099ee
4 changed files with 16 additions and 8 deletions

View File

@ -246,9 +246,10 @@ $config['payout_system'] = 'prop';
$config['archive']['maxrounds'] = 10;
$config['archive']['maxage'] = 60 * 24;
// URL prefix for block searches, used for block links, default: `http://explorer.litecoin.net/search?q=`
// If empty, the block link to the block information page will be removed
$config['blockexplorer'] = 'http://explorer.litecoin.net/search?q=';
// URL prefix for block searches, used for block links, default: `http://explorer.litecoin.net/block/`
// The Blockhash is appended on the templates to this URL
// If this config is empty, the block link to the block information page will be removed
$config['blockexplorer'] = 'http://explorer.litecoin.net/block/';
// Link to blockchain information, used for difficulty link, default: `http://allchains.info`
// If empty, the difficulty link to the chain information will be removed

View File

@ -11,6 +11,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
$iBlock = $bitcoin->getblockcount();
$sBlockHash = $bitcoin->query('getblockhash', $iBlock);
} else {
$dDifficulty = 1;
$iBlock = 0;
@ -51,7 +52,13 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$smarty->assign("CONTRIBSHARES", $aContributorsShares);
$smarty->assign("CONTRIBHASHES", $aContributorsHashes);
$smarty->assign("CURRENTBLOCK", $iBlock);
count($aBlockData) > 0 ? $smarty->assign("LASTBLOCK", $aBlockData['height']) : $smarty->assign("LASTBLOCK", 0);
$smarty->assign("CURRENTBLOCKHASH", $sBlockHash);
if (count($aBlockData) > 0) {
$smarty->assign("LASTBLOCK", $aBlockData['height']);
$smarty->assign("LASTBLOCKHASH", $aBlockData['blockhash']);
} else {
$smarty->assign("LASTBLOCK", 0);
}
$smarty->assign("DIFFICULTY", $dDifficulty);
$smarty->assign("REWARD", $config['reward']);
} else {

View File

@ -22,7 +22,7 @@
{if $GLOBAL.blockexplorer}
<tr>
<td class="leftheader">Next Network Block</td>
<td><a href="{$GLOBAL.blockexplorer}{$CURRENTBLOCK + 1}" target="_new">{$CURRENTBLOCK + 1}</a> &nbsp;&nbsp;<font size="1"> (Current: <a href="{$GLOBAL.blockexplorer}{$CURRENTBLOCK}" target="_new">{$CURRENTBLOCK})</a></font></td>
<td>{$CURRENTBLOCK + 1} &nbsp;&nbsp;<font size="1"> (Current: <a href="{$GLOBAL.blockexplorer}{$CURRENTBLOCKHASH}" target="_new">{$CURRENTBLOCK})</a></font></td>
</tr>
{else}
<tr>
@ -32,7 +32,7 @@
{/if}
<tr>
<td class="leftheader">Last Block Found</td>
<td>{if $GLOBAL.blockexplorer}<a href="{$GLOBAL.blockexplorer}{$LASTBLOCK}" target="_new">{$LASTBLOCK|default:"0"}</a>{else}{$LASTBLOCK|default:"0"}{/if}</td>
<td>{if $GLOBAL.blockexplorer}<a href="{$GLOBAL.blockexplorer}{$LASTBLOCKHASH}" target="_new">{$LASTBLOCK|default:"0"}</a>{else}{$LASTBLOCK|default:"0"}{/if}</td>
</tr>
<tr>
<td class="leftheader">Current Difficulty</td>

View File

@ -27,7 +27,7 @@
{if $GLOBAL.blockexplorer}
<tr>
<td class="leftheader">Next Network Block</td>
<td><a href="{$GLOBAL.blockexplorer}{$CURRENTBLOCK + 1}" target="_new">{$CURRENTBLOCK + 1}</a> &nbsp;&nbsp;<font size="1"> (Current: <a href="{$GLOBAL.blockexplorer}{$CURRENTBLOCK}" target="_new">{$CURRENTBLOCK})</a></font></td>
<td>{$CURRENTBLOCK + 1} &nbsp;&nbsp;<font size="1"> (Current: <a href="{$GLOBAL.blockexplorer}{$CURRENTBLOCKHASH}" target="_new">{$CURRENTBLOCK})</a></font></td>
</tr>
{else}
<tr>
@ -37,7 +37,7 @@
{/if}
<tr>
<td class="leftheader">Last Block Found</td>
<td>{if $GLOBAL.blockexplorer}<a href="{$GLOBAL.blockexplorer}{$LASTBLOCK}" target="_new">{$LASTBLOCK|default:"0"}</a>{else}{$LASTBLOCK|default:"0"}{/if}</td>
<td>{if $GLOBAL.blockexplorer}<a href="{$GLOBAL.blockexplorer}{$LASTBLOCKHASH}" target="_new">{$LASTBLOCK|default:"0"}</a>{else}{$LASTBLOCK|default:"0"}{/if}</td>
</tr>
{if $GLOBAL.chaininfo}
<tr>