Browse Source

php - block stats are up to the last found block

master
kanoi 9 years ago
parent
commit
07f1a8d9d3
  1. 32
      pool/base.php
  2. 6
      pool/page_blocks.php

32
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 = '';
}

6
pool/page_blocks.php

@ -100,6 +100,8 @@ function doblocks($data, $user)
$pg .= "<td class=dr>Luck%</td>";
$pg .= "</tr>\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 .= "<tr class=$row>";
$pg .= "<td class=dl>$desc Blocks</td>";
$pg .= "<td class=dl>$age</td>";
$pg .= "<td class=dr>$age</td>";
$pg .= "<td class=dr>$diff%</td>";
$pg .= "<td class=dr>$mean%</td>";
$pg .= "<td class=dr$bg>$cdferldsp</td>";

Loading…
Cancel
Save