diff --git a/public/include/classes/statistics.class.php b/public/include/classes/statistics.class.php
index 02b3f204..fcb72531 100644
--- a/public/include/classes/statistics.class.php
+++ b/public/include/classes/statistics.class.php
@@ -22,6 +22,22 @@ class Statistics extends Base {
return $this->getcache;
}
+ /**
+ * Get our first block found
+ *
+ **/
+ public function getFirstBlockFound() {
+ $this->debug->append("STA " . __METHOD__, 4);
+ if ($data = $this->memcache->get(__FUNCTION__)) return $data;
+ $stmt = $this->mysqli->prepare("
+ SELECT
+ time FROM " . $this->block->getTableName() . "
+ ORDER BY id ASC LIMIT 1");
+ if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result())
+ return $result->fetch_object()->time;
+ return false;
+ }
+
/**
* Fetch last found blocks by time
**/
@@ -44,7 +60,10 @@ class Statistics extends Base {
IFNULL(SUM(IF(confirmations = -1 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 604800 SECOND), 1, 0)), 0) AS 7DaysOrphan,
IFNULL(SUM(IF(FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 2419200 SECOND), 1, 0)), 0) AS 4WeeksTotal,
IFNULL(SUM(IF(confirmations > 0 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 2419200 SECOND), 1, 0)), 0) AS 4WeeksValid,
- IFNULL(SUM(IF(confirmations = -1 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 2419200 SECOND), 1, 0)), 0) AS 4WeeksOrphan
+ IFNULL(SUM(IF(confirmations = -1 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 2419200 SECOND), 1, 0)), 0) AS 4WeeksOrphan,
+ IFNULL(SUM(IF(FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 29030400 SECOND), 1, 0)), 0) AS 12MonthTotal,
+ IFNULL(SUM(IF(confirmations > 0 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 29030400 SECOND), 1, 0)), 0) AS 12MonthValid,
+ IFNULL(SUM(IF(confirmations = -1 AND FROM_UNIXTIME(time) >= DATE_SUB(now(), INTERVAL 29030400 SECOND), 1, 0)), 0) AS 12MonthOrphan
FROM " . $this->block->getTableName());
if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result())
return $this->memcache->setCache(__FUNCTION__, $result->fetch_assoc());
diff --git a/public/include/pages/statistics/pool.inc.php b/public/include/pages/statistics/pool.inc.php
index c53a0c05..0252f1fb 100644
--- a/public/include/pages/statistics/pool.inc.php
+++ b/public/include/pages/statistics/pool.inc.php
@@ -44,8 +44,11 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
// Past blocks found, max 4 weeks back
$iFoundBlocksByTime = $statistics->getLastBlocksbyTime();
+ $iFirstBlockFound = $statistics->getFirstBlockFound();
+ $iTimeSinceFirstBlockFound = ($now->getTimestamp() - $iFirstBlockFound);
// Propagate content our template
+ $smarty->assign("FIRSTBLOCKFOUND", $iTimeSinceFirstBlockFound);
$smarty->assign("LASTBLOCKSBYTIME", $iFoundBlocksByTime);
$smarty->assign("ESTTIME", $iEstTime);
$smarty->assign("TIMESINCELAST", $dTimeSinceLast);
diff --git a/public/templates/mmcFE/statistics/pool/default.tpl b/public/templates/mmcFE/statistics/pool/default.tpl
index 7cf67f68..57a397e6 100644
--- a/public/templates/mmcFE/statistics/pool/default.tpl
+++ b/public/templates/mmcFE/statistics/pool/default.tpl
@@ -51,32 +51,50 @@
{assign var=estshares value=(pow(2, (32 - $GLOBAL.config.target_bits)) * $DIFFICULTY) / pow(2, ($GLOBAL.config.targetdiff - 16))}
{$estshares|number_format:"0"} (done: {(100 / $estshares * $GLOBAL.roundshares.valid)|number_format:"2"} %) |
-
- | All Blocks - Found / Valid / Orphan
- | {$FOUNDALLVALID + $FOUNDALLORPHAN} / {$FOUNDALLVALID} / {$FOUNDALLORPHAN} |
-
-
- | Blocks last hour - Found / Valid / Orphan
- | {$FOUNDLASTHOURVALID + $FOUNDLASTHOURORPHAN} / {$FOUNDLASTHOURVALID} / {$FOUNDLASTHOURORPHAN} |
-
-
- | Blocks last 24 hours - Found / Valid / Orphan
- | {$FOUNDLAST24HOURSVALID + $FOUNDLAST24HOURSORPHAN} / {$FOUNDLAST24HOURSVALID} / {$FOUNDLAST24HOURSORPHAN} |
-
-
- | Blocks last 7 days - Found / Valid / Orphan
- | {$FOUNDLAST7DAYSVALID + $FOUNDLAST7DAYSORPHAN} / {$FOUNDLAST7DAYSVALID} / {$FOUNDLAST7DAYSORPHAN} |
-
-
- | Blocks last 4 weeks - Found / Valid / Orphan
- | {$FOUNDLAST4WEEKSVALID + $FOUNDLAST4WEEKSORPHAN} / {$FOUNDLAST4WEEKSVALID} / {$FOUNDLAST4WEEKSORPHAN} |
-
-
-
- | {$TIMESINCELAST|seconds_to_words} |
-
-
-
+
+
+ |
+ Est. Shares |
+ Shares found |
+ Luck |
+
+
+ | since Pool Start
+ | {($FIRSTBLOCKFOUND / $ESTTIME)|number_format:"2"} |
+ {$LASTBLOCKSBYTIME.Total} |
+ {($LASTBLOCKSBYTIME.Total / ($FIRSTBLOCKFOUND / $ESTTIME) * 100)|number_format:"2"} % |
+
+
+ | last hour
+ | {(3600 / $ESTTIME)|number_format:"2"} |
+ {$LASTBLOCKSBYTIME.1HourTotal} |
+ {($LASTBLOCKSBYTIME.1HourTotal / (3600 / $ESTTIME) * 100)|number_format:"2"} % |
+
+
+ | last day
+ | {(86400 / $ESTTIME)|number_format:"2"} |
+ {$LASTBLOCKSBYTIME.24HourTotal} |
+ {($LASTBLOCKSBYTIME.24HourTotal / (86400 / $ESTTIME) * 100)|number_format:"2"} % |
+
+
+ | last week
+ | {(604800 / $ESTTIME)|number_format:"2"} |
+ {$LASTBLOCKSBYTIME.7DaysTotal} |
+ {($LASTBLOCKSBYTIME.7DaysTotal / (604800 / $ESTTIME) * 100)|number_format:"2"} % |
+
+
+ | last month
+ | {(419200 / $ESTTIME)|number_format:"2"} |
+ {$LASTBLOCKSBYTIME.4WeeksTotal} |
+ {($LASTBLOCKSBYTIME.4WeeksTotal / (2419200 / $ESTTIME) * 100)|number_format:"2"} % |
+
+
+ | last year
+ | {(29030400 / $ESTTIME)|number_format:"2"} |
+ {$LASTBLOCKSBYTIME.12MonthTotal} |
+ {($LASTBLOCKSBYTIME.12MonthTotal / (29030400 / $ESTTIME) * 100)|number_format:"2"} % |
+
+
{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/mpos/statistics/pool/general_stats.tpl b/public/templates/mpos/statistics/pool/general_stats.tpl
index 23562594..c1649a59 100644
--- a/public/templates/mpos/statistics/pool/general_stats.tpl
+++ b/public/templates/mpos/statistics/pool/general_stats.tpl
@@ -31,15 +31,6 @@
Est. Shares this Round
| |
-
-
-
-
-
-
-
-
-
{if ! $GLOBAL.website.blockexplorer.disabled}
| Next Network Block
@@ -59,41 +50,55 @@
| Time Since Last Block
| {$TIMESINCELAST|seconds_to_words} |
+
+
+
+
+
+
+
+
|
- Found |
- Valid |
- Orphan |
+ Est. Shares |
+ Shares found |
+ Luck |
- | All Time
+ | since Pool Start
+ | {($FIRSTBLOCKFOUND / $ESTTIME)|number_format:"2"} |
{$LASTBLOCKSBYTIME.Total} |
- {$LASTBLOCKSBYTIME.TotalValid} |
- {$LASTBLOCKSBYTIME.TotalOrphan} |
+ {($LASTBLOCKSBYTIME.Total / ($FIRSTBLOCKFOUND / $ESTTIME) * 100)|number_format:"2"} % |
- | Last Hour
+ | last hour
+ | {(3600 / $ESTTIME)|number_format:"2"} |
{$LASTBLOCKSBYTIME.1HourTotal} |
- {$LASTBLOCKSBYTIME.1HourValid} |
- {$LASTBLOCKSBYTIME.1HourOrphan} |
+ {($LASTBLOCKSBYTIME.1HourTotal / (3600 / $ESTTIME) * 100)|number_format:"2"} % |
- | Last 24 Hours
+ | last day
+ | {(86400 / $ESTTIME)|number_format:"2"} |
{$LASTBLOCKSBYTIME.24HourTotal} |
- {$LASTBLOCKSBYTIME.24HourValid} |
- {$LASTBLOCKSBYTIME.24HourOrphan} |
+ {($LASTBLOCKSBYTIME.24HourTotal / (86400 / $ESTTIME) * 100)|number_format:"2"} % |
- | Last 7 Days
+ | last week
+ | {(604800 / $ESTTIME)|number_format:"2"} |
{$LASTBLOCKSBYTIME.7DaysTotal} |
- {$LASTBLOCKSBYTIME.7DaysValid} |
- {$LASTBLOCKSBYTIME.7DaysOrphan} |
+ {($LASTBLOCKSBYTIME.7DaysTotal / (604800 / $ESTTIME) * 100)|number_format:"2"} % |
- | Last 4 Weeks
+ | last month
+ | {(419200 / $ESTTIME)|number_format:"2"} |
{$LASTBLOCKSBYTIME.4WeeksTotal} |
- {$LASTBLOCKSBYTIME.4WeeksValid} |
- {$LASTBLOCKSBYTIME.4WeeksOrphan} |
+ {($LASTBLOCKSBYTIME.4WeeksTotal / (2419200 / $ESTTIME) * 100)|number_format:"2"} % |
+
+
+ | last year
+ | {(29030400 / $ESTTIME)|number_format:"2"} |
+ {$LASTBLOCKSBYTIME.12MonthTotal} |
+ {($LASTBLOCKSBYTIME.12MonthTotal / (29030400 / $ESTTIME) * 100)|number_format:"2"} % |