Browse Source

php - shorten long wokernames on the blocks page

master
kanoi 9 years ago
parent
commit
2c2bf879ba
  1. 13
      pool/base.php
  2. 5
      pool/page_blocks.php

13
pool/base.php

@ -233,6 +233,19 @@ function difffmt($amt)
return siprefmt($amt, 3); return siprefmt($amt, 3);
} }
# #
function dspname($name)
{
if (strlen($name) < 23)
return array(false, htmlspecialchars($name));
if (strpbrk($name, '._') === false)
return array(false, htmlspecialchars(substr($name, 0, 20)).'&hellip;');
$left = htmlspecialchars(substr($name, 0, 17));
$right = htmlspecialchars(substr($name, -3));
return array(true, $left.'&hellip;'.$right);
}
#
function emailStr($str) function emailStr($str)
{ {
$all = '/[^A-Za-z0-9_+\.@-]/'; // no space = trim $all = '/[^A-Za-z0-9_+\.@-]/'; // no space = trim

5
pool/page_blocks.php

@ -330,7 +330,10 @@ function doblocks($data, $user)
$pg .= "<td class=dr$ex>$seq</td>"; $pg .= "<td class=dr$ex>$seq</td>";
$pg .= "<td class=dl$ex>$hifld</td>"; $pg .= "<td class=dl$ex>$hifld</td>";
if ($user !== null) if ($user !== null)
$pg .= "<td class=dl$ex>".htmlspecialchars($ans['workername:'.$i]).'</td>'; {
list($abr, $nam) = dspname($ans['workername:'.$i]);
$pg .= "<td class=dl$ex>$nam</td>";
}
$pg .= "<td class=dr$ex>".btcfmt($ans['reward:'.$i]).'</td>'; $pg .= "<td class=dr$ex>".btcfmt($ans['reward:'.$i]).'</td>';
$pg .= "<td class=dl$ex>".utcd($ans['firstcreatedate:'.$i], false, false).'</td>'; $pg .= "<td class=dl$ex>".utcd($ans['firstcreatedate:'.$i], false, false).'</td>';
$pg .= "<td class=dr$ex>$tt$stat</td>"; $pg .= "<td class=dr$ex>$tt$stat</td>";

Loading…
Cancel
Save