From 52570011532be12aee42dc02628dc8d33e958bd3 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 6 Sep 2013 14:55:44 +0200 Subject: [PATCH 1/3] fixing blockhash in round block details --- public/include/classes/roundstats.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/include/classes/roundstats.class.php b/public/include/classes/roundstats.class.php index d93cca43..8af22cbf 100644 --- a/public/include/classes/roundstats.class.php +++ b/public/include/classes/roundstats.class.php @@ -31,10 +31,10 @@ class RoundStats { **/ public function getNextBlock($iHeight=0) { $stmt = $this->mysqli->prepare(" - SELECT height + SELECT height FROM $this->tableBlocks WHERE height > ? - ORDER BY height ASC + ORDER BY height ASC LIMIT 1"); if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result()) return $result->fetch_object()->height; @@ -46,10 +46,10 @@ class RoundStats { **/ public function getPreviousBlock($iHeight=0) { $stmt = $this->mysqli->prepare(" - SELECT height + SELECT height FROM $this->tableBlocks WHERE height < ? - ORDER BY height DESC + ORDER BY height DESC LIMIT 1"); if ($this->checkStmt($stmt) && $stmt->bind_param('i', $iHeight) && $stmt->execute() && $result = $stmt->get_result()) return $result->fetch_object()->height; @@ -64,7 +64,7 @@ class RoundStats { public function getDetailsForBlockHeight($iHeight=0, $isAdmin=0) { $stmt = $this->mysqli->prepare(" SELECT - b.id, height, amount, confirmations, difficulty, FROM_UNIXTIME(time) as time, shares, + b.id, height, blockhash, amount, confirmations, difficulty, FROM_UNIXTIME(time) as time, shares, IF(a.is_anonymous, IF( ? , a.username, 'anonymous'), a.username) AS finder FROM $this->tableBlocks as b LEFT JOIN $this->tableUsers AS a ON b.account_id = a.id From bc7e5111779b807fcf165530e72be88ad8c7d341 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 6 Sep 2013 15:00:47 +0200 Subject: [PATCH 2/3] removing debug echos --- public/include/classes/user.class.php | 1 - public/include/pages/statistics/round.inc.php | 1 - 2 files changed, 2 deletions(-) diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index e012505a..dc0c71b7 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -201,7 +201,6 @@ class User { return $result->fetch_all(MYSQLI_ASSOC); } $this->debug->append("Unable to fetch users with AP set"); - echo $this->mysqli->error; return false; } diff --git a/public/include/pages/statistics/round.inc.php b/public/include/pages/statistics/round.inc.php index b6e40a3a..869dbb72 100644 --- a/public/include/pages/statistics/round.inc.php +++ b/public/include/pages/statistics/round.inc.php @@ -19,7 +19,6 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $iKey = $_REQUEST['height']; } } - echo $iKey; $aDetailsForBlockHeight = $roundstats->getDetailsForBlockHeight($iKey, $user->isAdmin($_SESSION['USERDATA']['id'])); $aRoundShareStats = $roundstats->getRoundStatsForAccounts($iKey, $user->isAdmin($_SESSION['USERDATA']['id'])); From 8ae36844f12d4ed4bf0456855b43ae84291f5f9c Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sat, 7 Sep 2013 20:53:28 +0200 Subject: [PATCH 3/3] fixing some PHP warnings --- public/include/config/admin_settings.inc.php | 2 ++ public/templates/mmcFE/account/edit/default.tpl | 2 +- public/templates/mmcFE/account/qrcode/default.tpl | 2 +- public/templates/mmcFE/statistics/blocks/default.tpl | 2 ++ public/templates/mmcFE/statistics/default.tpl | 2 +- public/templates/mmcFE/statistics/pool/authenticated.tpl | 2 +- 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/include/config/admin_settings.inc.php b/public/include/config/admin_settings.inc.php index 3342ef49..69b55e75 100644 --- a/public/include/config/admin_settings.inc.php +++ b/public/include/config/admin_settings.inc.php @@ -77,6 +77,7 @@ $aSettings['website'][] = array( $aSettings['website'][] = array( 'display' => 'Disable Blockexplorer', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), + 'default' => 0, 'name' => 'website_blockexplorer_disabled', 'value' => $setting->getValue('website_blockexplorer_disabled'), 'tooltip' => 'Enabled or disable the blockexplorer URL feature. Will remove any links using the blockexplorer URL.' ); @@ -90,6 +91,7 @@ $aSettings['website'][] = array( $aSettings['website'][] = array( 'display' => 'Disable Chaininfo', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), + 'default' => 0, 'name' => 'website_chaininfo_disabled', 'value' => $setting->getValue('website_chaininfo_disabled'), 'tooltip' => 'Enabled or disable the chainfo URL feature. Will remove any links using the chaininfo URL.' ); diff --git a/public/templates/mmcFE/account/edit/default.tpl b/public/templates/mmcFE/account/edit/default.tpl index 0a3e523d..e548da34 100644 --- a/public/templates/mmcFE/account/edit/default.tpl +++ b/public/templates/mmcFE/account/edit/default.tpl @@ -6,7 +6,7 @@ - {if !$GLOBAL.config.website.api.disabled}{/if} + {if !$GLOBAL.website.api.disabled}{/if} diff --git a/public/templates/mmcFE/account/qrcode/default.tpl b/public/templates/mmcFE/account/qrcode/default.tpl index 2656314e..c185a4b4 100644 --- a/public/templates/mmcFE/account/qrcode/default.tpl +++ b/public/templates/mmcFE/account/qrcode/default.tpl @@ -1,4 +1,4 @@ -{if !$GLOBAL.config.website.api.disabled} +{if !$GLOBAL.website.api.disabled} {include file="global/block_header.tpl" BLOCK_HEADER="API String"}

This code will allow you to import the full API string into your mobile application.

diff --git a/public/templates/mmcFE/statistics/blocks/default.tpl b/public/templates/mmcFE/statistics/blocks/default.tpl index 2bf8e85c..596ccfe9 100644 --- a/public/templates/mmcFE/statistics/blocks/default.tpl +++ b/public/templates/mmcFE/statistics/blocks/default.tpl @@ -79,12 +79,14 @@ target and network difficulty and assuming a zero variance scenario. {/section} + {if $count > 0} + {/if}
Username: {$GLOBAL.userdata.username|escape}
User Id: {$GLOBAL.userdata.id}
API Key: {$GLOBAL.userdata.api_key}
API Key: {$GLOBAL.userdata.api_key}
E-Mail:
Payment Address:
Donation %: [donation amount in percent (example: 0.5)]
Totals {$totalexpectedshares|number_format} {$totalshares|number_format} {($totalpercentage / $count)|number_format:"2"}
diff --git a/public/templates/mmcFE/statistics/default.tpl b/public/templates/mmcFE/statistics/default.tpl index 59603d94..5fa45522 100644 --- a/public/templates/mmcFE/statistics/default.tpl +++ b/public/templates/mmcFE/statistics/default.tpl @@ -19,5 +19,5 @@ -{if !$GLOBAL.config.website.api.disabled}
  • These stats are also available in JSON format HERE
  • {/if} +{if !$GLOBAL.website.api.disabled}
  • These stats are also available in JSON format HERE
  • {/if} {include file="global/block_footer.tpl"} diff --git a/public/templates/mmcFE/statistics/pool/authenticated.tpl b/public/templates/mmcFE/statistics/pool/authenticated.tpl index 6189ef78..b19848db 100644 --- a/public/templates/mmcFE/statistics/pool/authenticated.tpl +++ b/public/templates/mmcFE/statistics/pool/authenticated.tpl @@ -32,7 +32,7 @@ {/if} Last Block Found - {if $GLOBAL.website.blockexplorer.url}{$LASTBLOCK|default:"0"}{else}{$LASTBLOCK|default:"0"}{/if} + {if $GLOBAL.website.blockexplorer.url}{$LASTBLOCK|default:"0"}{else}{$LASTBLOCK|default:"0"}{/if} Current Difficulty