commit
58d230fb86
@ -196,6 +196,7 @@ class Statistics {
|
||||
$data['share_id'] = 0;
|
||||
$data['data'] = array();
|
||||
}
|
||||
$data['last_update'] = time();
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
ROUND(IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0) AS valid,
|
||||
@ -245,14 +246,12 @@ class Statistics {
|
||||
if ($data = $this->memcache->get(STATISTICS_ALL_USER_SHARES)) {
|
||||
if (array_key_exists($account_id, $data['data']))
|
||||
return $data['data'][$account_id];
|
||||
// We have no cached value, we return defaults
|
||||
return array('valid' => 0, 'invalid' => 0, 'donate_percent' => 0, 'is_anonymous' => 0);
|
||||
}
|
||||
if ($data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
|
||||
// if ($data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
ROUND(IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0) AS valid,
|
||||
ROUND(IFNULL(SUM(IF(our_result='N', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0) AS invalid
|
||||
ROUND(IFNULL(SUM(IF(our_result='Y', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0), 0) AS valid,
|
||||
ROUND(IFNULL(SUM(IF(our_result='N', IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty), 0)) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0), 0) AS invalid
|
||||
FROM " . $this->share->getTableName() . " AS s,
|
||||
" . $this->user->getTableName() . " AS u
|
||||
WHERE
|
||||
|
||||
@ -565,7 +565,7 @@ class User {
|
||||
$username_clean = strip_tags($username);
|
||||
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('sssssi', $username_clean, $password_hash, $email1, $pin_hash, $apikey_hash, $is_locked) && $stmt->execute()) {
|
||||
if (! $this->setting->getValue('accounts_confirm_email_enabled') && $is_admin != 1) {
|
||||
if (! $this->setting->getValue('accounts_confirm_email_disabled') && $is_admin != 1) {
|
||||
if ($token = $this->token->createToken('confirm_email', $stmt->insert_id)) {
|
||||
$aData['username'] = $username_clean;
|
||||
$aData['token'] = $token;
|
||||
|
||||
@ -47,7 +47,7 @@ $dNetworkHashrateAdjusted = $dNetworkHashrate / 1000 * $dNetworkHashrateModifier
|
||||
// Output JSON format
|
||||
$data = array(
|
||||
'raw' => array( 'personal' => array( 'hashrate' => $dPersonalHashrate ), 'pool' => array( 'hashrate' => $dPoolHashrate ), 'network' => array( 'hashrate' => $dNetworkHashrate / 1000 ) ),
|
||||
'personal' => array ( 'hashrate' => $dPersonalHashrateAdjusted, 'sharerate' => $dPersonalSharerate, 'shares' => $aUserRoundShares, 'balance' => $transaction->getBalance($user_id), 'estimates' => $aEstimates),
|
||||
'personal' => array ( 'hashrate' => $dPersonalHashrateAdjusted, 'sharerate' => $dPersonalSharerate, 'shares' => array('valid' => $aUserRoundShares['valid'], 'invalid' => $aUserRoundShares['invalid']), 'balance' => $transaction->getBalance($user_id), 'estimates' => $aEstimates),
|
||||
'pool' => array( 'hashrate' => $dPoolHashrateAdjusted, 'shares' => $aRoundShares ),
|
||||
'network' => array( 'hashrate' => $dNetworkHashrateAdjusted, 'difficulty' => $dDifficulty, 'block' => $iBlock ),
|
||||
);
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<tbody>
|
||||
{section name=donor loop=$DONORS}
|
||||
<tr>
|
||||
<td>{if $DONORS[donor].is_anonymous|default:"0" == 1}anonymous{else}{$DONORS[donor].username}{/if}</td>
|
||||
<td>{if $DONORS[donor].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$DONORS[donor].username}{/if}</td>
|
||||
<td class="center">{$DONORS[donor].donate_percent}</td>
|
||||
<td class="right">{$DONORS[donor].donation|number_format:"2"}</td>
|
||||
</tr>
|
||||
|
||||
@ -62,7 +62,7 @@ target and network difficulty and assuming a zero variance scenario.
|
||||
{else if $BLOCKSFOUND[block].confirmations == -1}
|
||||
<font color="red">Orphan</font>
|
||||
{else}{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left{/if}</td>
|
||||
<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 && $GLOBAL.userdata.is_admin|default:"0" == 0}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="right">{$BLOCKSFOUND[block].difficulty|number_format:"8"}</td>
|
||||
<td class="right">{$BLOCKSFOUND[block].amount|number_format:"2"}</td>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
{section block $BLOCKSFOUND}
|
||||
<tr class="{cycle values="odd,even"}">
|
||||
<td><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round&height={$BLOCKSFOUND[block].height}">{$BLOCKSFOUND[block].height}</a></td>
|
||||
<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 && $GLOBAL.userdata.is_admin|default:"0" == 0}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="right">{$BLOCKSFOUND[block].shares|number_format}</td>
|
||||
</tr>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
{math assign="estday" equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24), 3)" diff=$DIFFICULTY reward=$REWARD hashrate=$CONTRIBHASHES[contrib].hashrate}
|
||||
<tr{if $GLOBAL.userdata.username == $CONTRIBHASHES[contrib].account}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td>{$rank++}</td>
|
||||
<td>{if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if}</td>
|
||||
<td>{if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if}</td>
|
||||
<td class="right">{($CONTRIBHASHES[contrib].hashrate * $GLOBAL.hashmods.personal)|number_format:"2"}</td>
|
||||
<td class="right">{$estday|number_format:"3"}</td>
|
||||
{if $GLOBAL.config.price.currency}<td class="right">{($estday * $GLOBAL.price)|default:"n/a"|number_format:"2"}</td>{/if}
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
{section shares $CONTRIBSHARES}
|
||||
<tr{if $GLOBAL.userdata.username == $CONTRIBSHARES[shares].account}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td>{$rank++}</td>
|
||||
<td>{if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if}</td>
|
||||
<td>{if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if}</td>
|
||||
<td class="right">{$CONTRIBSHARES[shares].shares|number_format}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
{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}>
|
||||
<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 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$ROUNDSHARES[contrib].username|escape}{/if}</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 / $ROUNDSHARES[contrib].valid * 100)|number_format:"2"}</td>
|
||||
|
||||
@ -53,7 +53,7 @@ target and network difficulty and assuming a zero variance scenario.
|
||||
{else if $BLOCKSFOUND[block].confirmations == -1}
|
||||
<font color="red">Orphan</font>
|
||||
{else}{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left{/if}</td>
|
||||
<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 && $GLOBAL.userdata.is_admin|default:"0" == 0}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="right">{$BLOCKSFOUND[block].difficulty|number_format:"2"}</td>
|
||||
<td class="right">{(65536 * $BLOCKSFOUND[block].difficulty)|number_format}</td>
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
{section block $BLOCKSFOUND}
|
||||
<tr class="{cycle values="odd,even"}">
|
||||
<th><a href="{$GLOBAL.website.blockexplorer.url}{$BLOCKSFOUND[block].height}" target="_blank">{$BLOCKSFOUND[block].height}</a></th>
|
||||
<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 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
|
||||
<td>{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M"}</td>
|
||||
<td align="right">{$BLOCKSFOUND[block].shares|number_format}</td>
|
||||
</tr>
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
{if $GLOBAL.userdata.username == $CONTRIBSHARES[contrib].account}{assign var=listed value=1}{/if}
|
||||
<tr>
|
||||
<th>{$rank++}</th>
|
||||
<td>{if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if}</td>
|
||||
<td>{if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if}</td>
|
||||
<td align="right">{$CONTRIBHASHES[contrib].hashrate|number_format}</td>
|
||||
<td align="right">{$estday|number_format:"3"}</td>
|
||||
<td align="right">{($estday * $GLOBAL.price)|default:"n/a"|number_format:"2"}</td>
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
{if $GLOBAL.userdata.username == $CONTRIBSHARES[shares].account}{assign var=listed value=1}{/if}
|
||||
<tr>
|
||||
<th aign="center">{$rank++}</th>
|
||||
<td>{if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if}</td>
|
||||
<td>{if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if}</td>
|
||||
<td align="right">{$CONTRIBSHARES[shares].shares|number_format}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
|
||||
@ -9,14 +9,14 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th align="right">%<th>
|
||||
<th align="right">%</th>
|
||||
<th align="right" style="padding-right: 25px">{$GLOBAL.config.currency} Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{section name=donor loop=$DONORS}
|
||||
<tr>
|
||||
<td>{if $DONORS[donor].is_anonymous|default:"0" == 1}anonymous{else}{$DONORS[donor].username}{/if}</td>
|
||||
<td>{if $DONORS[donor].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$DONORS[donor].username}{/if}</td>
|
||||
<td align="right">{$DONORS[donor].donate_percent}</td>
|
||||
<td align="right" style="padding-right: 25px">{$DONORS[donor].donation|number_format:"2"}</td>
|
||||
</tr>
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
<span class="unconfirmed">{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left</span>
|
||||
{/if}
|
||||
</td>
|
||||
<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 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
|
||||
<td align="center">{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}</td>
|
||||
<td align="right">{$BLOCKSFOUND[block].difficulty|number_format:"2"}</td>
|
||||
<td align="right">{$BLOCKSFOUND[block].amount|number_format:"2"}</td>
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
{else}
|
||||
<td align="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 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$BLOCKSFOUND[block].finder|default:"unknown"|escape}{/if}</td>
|
||||
<td align="center">{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}</td>
|
||||
<td align="right" style="padding-right: 25px;">{$BLOCKSFOUND[block].shares|number_format}</td>
|
||||
</tr>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<tr{if $GLOBAL.userdata.username|default:"" == $CONTRIBHASHES[contrib].account}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td align="center">{$rank++}</td>
|
||||
<td align="right">{if $CONTRIBHASHES[contrib].donate_percent > 0}<i class="icon-star-empty"></i>{/if}</td>
|
||||
<td>{if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if}</td>
|
||||
<td>{if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if}</td>
|
||||
<td align="right">{$CONTRIBHASHES[contrib].hashrate|number_format}</td>
|
||||
<td align="right">{$estday|number_format:"3"}</td>
|
||||
{if $GLOBAL.config.price.currency}<td align="right" style="padding-right: 25px;">{($estday * $GLOBAL.price)|default:"n/a"|number_format:"2"}</td>{/if}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
<tr{if $GLOBAL.userdata.username|default:"" == $CONTRIBSHARES[shares].account}{assign var=listed value=1} style="background-color:#99EB99;"{else} class="{cycle values="odd,even"}"{/if}>
|
||||
<td align="center">{$rank++}</td>
|
||||
<td align="right">{if $CONTRIBSHARES[shares].donate_percent > 0}<i class="icon-star-empty"></i>{/if}</td>
|
||||
<td>{if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if}</td>
|
||||
<td>{if $CONTRIBSHARES[shares].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$CONTRIBSHARES[shares].account|escape}{/if}</td>
|
||||
<td align="right" style="padding-right: 25px;">{$CONTRIBSHARES[shares].shares|number_format}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user