Browse Source

php - add a public blocks page

master
kanoi 10 years ago
parent
commit
ad6f642129
  1. 8
      pool/page_blocks.php
  2. 15
      pool/page_pblocks.php
  3. 3
      pool/prime.php

8
pool/page_blocks.php

@ -44,11 +44,15 @@ function doblocks($data, $user)
$pg = '<h1>Blocks</h1>';
if ($user === null)
$ans = getBlocks('Anon');
else
$ans = getBlocks($user);
$pg .= "<table callpadding=0 cellspacing=0 border=0>\n";
$pg .= "<tr class=title>";
$pg .= "<td class=dl>Height</td>";
if ($user !== null)
$pg .= "<td class=dl>Who</td>";
$pg .= "<td class=dr>Reward</td>";
$pg .= "<td class=dc>When</td>";
@ -119,6 +123,7 @@ function doblocks($data, $user)
$pg .= "<tr class=$row>";
$pg .= "<td class=dl$ex>$hifld</td>";
if ($user !== null)
$pg .= "<td class=dl$ex>".htmlspecialchars($ans['workername:'.$i]).'</td>';
$pg .= "<td class=dr$ex>".btcfmt($ans['reward:'.$i]).'</td>';
$pg .= "<td class=dl$ex>".gmdate('Y-m-d H:i:s+00', $ans['firstcreatedate:'.$i]).'</td>';
@ -141,6 +146,9 @@ function doblocks($data, $user)
$bg = " bgcolor=$bg";
$pg .= "<tr class=$row>";
if ($user === null)
$pg .= "<td class=dl colspan=5></td>";
else
$pg .= "<td class=dl colspan=6></td>";
$pg .= "<td class=dr$bg>".$bpct.'</td>';
$pg .= "</tr>\n";

15
pool/page_pblocks.php

@ -0,0 +1,15 @@
<?php
#
include_once('page_blocks.php');
#
function dopblocks($data, $user)
{
return doblocks($data, null);
}
#
function show_pblocks($page, $menu, $name, $user)
{
gopage(NULL, 'dopblocks', $page, $menu, $name, $user);
}
#
?>

3
pool/prime.php

@ -34,6 +34,9 @@ function process($p, $user, $menu)
function def_menu()
{
$dmenu = array('Home' => array('Home' => ''),
'Pool' => array(
'Blocks' => 'pblocks'
),
'gap' => array( # options not shown
'API' => 'api'),
'Help' => array('Help' => 'help',

Loading…
Cancel
Save