diff --git a/pool/base.php b/pool/base.php index 7c88113c..828454a3 100644 --- a/pool/base.php +++ b/pool/base.php @@ -34,39 +34,27 @@ function daysago($val) return ''; if ($val < 60) - $des = $val.'s'; + $des = number_format($val,0).'s'; else { - $val = round($val/6)/10; + $val = $val/60; if ($val < 60) - $des = $val.'min'; + $des = number_format($val,1).'min'; else { - $val = round($val/6)/10; + $val = $val/60; if ($val < 24) - { - $des = $val.'hr'; - if ($val != 1) - $des .= 's'; - } + $des = number_format($val,1).'hrs'; else { - $val = round($val/2.4)/10; - if ($val < 100) - { - $des = $val.'day'; - if ($val != 1) - $des .= 's'; - } + $val = $val/24; + if ($val < 43) + $des = number_format($val,1).'days'; else { - $val = round($val/0.7)/10; + $val = $val/7; if ($val < 10000) - { - $des = $val.'wk'; - if ($val != 1) - $des .= 's'; - } + $des = number_format($val,1).'wks'; else $des = ''; } diff --git a/pool/page_blocks.php b/pool/page_blocks.php index 167f2999..07a8b894 100644 --- a/pool/page_blocks.php +++ b/pool/page_blocks.php @@ -100,6 +100,8 @@ function doblocks($data, $user) $pg .= "Luck%"; $pg .= "\n"; + $since = $data['info']['lastblock']; + $count = $ans['s_rows']; for ($i = 0; $i < $count; $i++) { @@ -109,7 +111,7 @@ function doblocks($data, $user) $row = 'odd'; $desc = $ans['s_desc:'.$i]; - $age = daysago($ans['STAMP'] - $ans['s_createdate:'.$i]); + $age = daysago($since - $ans['s_createdate:'.$i]); $diff = number_format(100 * $ans['s_diffratio:'.$i], 2); $mean = number_format(100 * $ans['s_diffmean:'.$i], 2); @@ -122,7 +124,7 @@ function doblocks($data, $user) $pg .= ""; $pg .= "$desc Blocks"; - $pg .= "$age"; + $pg .= "$age"; $pg .= "$diff%"; $pg .= "$mean%"; $pg .= "$cdferldsp";