het stukje wat in mn portal.php staat:
Code: Selecteer alles
$q = "SELECT year, hits
FROM ". $table_prefix ."stats_year
ORDER BY year ASC";
$r = $db -> sql_query($q);
while ($row = $db -> sql_fetchrow($r))
{
$year = $row['year'];
$yearhits = $row['hits'];
}
$template->assign_block_vars('total_hits_yearly', array(
'TOTAL_HITS_YEARLY' => $prev,
'YEARS' => $year,
'YEAR_HITS' => number_format($yearhits, 0)
)
);
en het stukje wat in mn portal_body.php staat:
Code: Selecteer alles
<!-- BEGIN total_hits_yearly -->
<tr>
<td align='center' valign='top' width='100%' colspan='2' class='row2'>
<span class='gensmall'>
{total_hits_yearly.TOTAL_HITS_YEARLY}
</span>
</td>
</tr>
<tr>
<td align='left' valign='top' width='50%' class='row2'>
<span class='gensmall'>
{total_hits_yearly.YEARS}
</span>
</td>
<td align='right' valign='top' width='50%' class='row2'>
<span class='gensmall'>
<b>{total_hits_yearly.YEAR_HITS}</b>
</span>
</td>
</tr>
<!-- END total_hits_yearly -->
2006 350,000
2005 632,587
nu staat er alleen
2006 350,000
of
2005 632,587
wat heb ik verkeerd gedaan?
dit was het originele stukje:
Code: Selecteer alles
$q = "SELECT year, hits
FROM ". $table_prefix ."stats_year
ORDER BY year DESC";
$r = $db -> sql_query($q);
while ($row = $db -> sql_fetchrow($r))
{
$block .=" <tr>";
$block .=" <td align='left' valign='top' width='50%' class='row2'>";
$block .=" <span class='gensmall'>";
$block .=" ". $row['year'] ."";
$block .=" </span>";
$block .=" </td>";
$block .=" <td align='right' valign='top' width='50%' class='row2'>";
$block .=" <span class='gensmall'>";
$block .=" <b>" . number_format($row['hits'], 0) . "</b>";
$block .=" </span>";
$block .=" </td>";
$block .=" </tr>";
}
$block .="</table>";