From 71f8c0112eb9c0630cf5c65b6b51dec3e9adcce1 Mon Sep 17 00:00:00 2001 From: kanoi Date: Fri, 20 Jun 2014 02:23:29 +1000 Subject: [PATCH] php - display 5m/1hr user hash rate stats --- pool/page.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/pool/page.php b/pool/page.php index 02258977..6bdb1b28 100644 --- a/pool/page.php +++ b/pool/page.php @@ -127,6 +127,7 @@ function pgtop($dotop, $user, $douser) $plb = '?'; $nlb = '?'; $uhr = '?GHs'; + $u1hr = ''; if ($info !== false) { $now = time(); @@ -201,6 +202,24 @@ function pgtop($dotop, $user, $douser) $uhr = (round($uhr/1000)/100).'THs'; } } + + if (isset($info['u_hashrate1hr'])) + { + $u1hr = $info['u_hashrate1hr']; + if ($u1hr == '?') + $u1hr = ''; + else + { + $u1hr /= 10000000; + if ($u1hr < 100000) + $u1hr = '/'.(round($u1hr)/100).'GHs'; + else + $u1hr = '/'.(round($u1hr/1000)/100).'THs'; + + if (substr($u1hr, -3) == substr($uhr, -3)) + $uhr = substr($uhr, 0, -3); + } + } } addscript("function jst(){document.getElementById('jst').style.visibility='hidden';}"); @@ -236,7 +255,7 @@ Pass: $top .= " $who  Hash Rate: -$uhr +$uhr$u1hr
 
";