use new blocks table properly

This commit is contained in:
Sebastian Grewe 2013-05-12 11:37:42 +02:00
parent 2e8d475e6f
commit a6e0b98552
2 changed files with 4 additions and 4 deletions

View File

@ -30,15 +30,15 @@ $aContributorData = $contributors->fetch_all(MYSQLI_ASSOC);
$stmt->close();
// Grab the last block found
$stmt = $mysqli->prepare("SELECT n.blockNumber, n.confirms, n.timestamp FROM winning_shares w, networkBlocks n WHERE w.blockNumber = n.blockNumber ORDER BY w.blockNumber DESC LIMIT 1");
$stmt = $mysqli->prepare("SELECT id, confirmations, timestamp FROM blocks ORDER BY height DESC LIMIT 1");
$stmt->execute();
$blocks = $stmt->get_result();
$aBlockData = $blocks->fetch_array();
$stmt->close();
*/
// Grab the last 10 blocks found
$stmt = $mysqli->prepare("SELECT DISTINCT * FROM blocks ORDER BY height DESC LIMIT 10");
$stmt = $mysqli->prepare("SELECT * FROM blocks ORDER BY height DESC LIMIT 10");
$stmt->execute();
$blocksfound = $stmt->get_result();
$aBlocksFoundData = $blocksfound->fetch_all(MYSQLI_ASSOC);

View File

@ -16,7 +16,7 @@
{assign var=user value="."|explode:$BLOCKSFOUND[block].username}
<tr class="{cycle values="odd,even"}">
<td>{$BLOCKSFOUND[block].height}</td>
<td>{if $BLOCKSFOUND[block].confirmations >= 120}<font color="green">Confirmed</font>{else}<font color="orange">{$BLOCKSFOUND[block].confirms - 120} left</font>{/if}</td>
<td>{if $BLOCKSFOUND[block].confirmations >= 120}<font color="green">Confirmed</font>{else}<font color="orange">{120 - $BLOCKSFOUND[block].confirms} left</font>{/if}</td>
<td>{$user.0|default:"unknown"}</td>
<td>{$BLOCKSFOUND[block].time|date_format:"%d/%m/%Y %H:%M:%S"}</td>
<td>{$BLOCKSFOUND[block].difficulty|number_format}</td>