dit is echt een vreemde fout. Kijk zelf maar wat je krijgt: http://jeffro.no-ip.info/webshop/articlesv2.php
Het gaat om de .paginanummer.
code:
<?PHP
CLASS Webshop {
function Articledisplay(){
global $tpl;
$tpl->newBlock("articledisplay");
if(is_numeric($_GET['max'])) $max = $_GET['max'];
if(is_numeric($_GET['start'])) $start = $_GET['start'];
if (empty($max)) $max = 5;
if (empty($start)) $start = 0;
$end = $start + $max;
$prev = $start - $max;
$next = $end;
$query = mysql_query("SELECT * FROM Articles, Genres WHERE Articles.GenreID = Genres.GenreID ORDER BY Articles.Name DESC LIMIT $max OFFSET $start") or die (mysql_error());
$num = mysql_num_rows($query);
if (empty($num))
{
$tpl->newBlock("error");
}
else
{
while ($Rij = mysql_fetch_array($query)){
{
$tpl->assign(array("picture" => "$Rij[Picture]","description" => "$Rij[Description]","gname" => "$Rij[Gname]","name" => "$Rij[Name]"));
$tpl->newBlock("articles");
}
echo ("");
}
if ($prev >= '0')
{
$tpl->assign(array("phpself" => "$PHP_SELF","prev" => "$prev","max" => "$max"));
$tpl->newBlock("previous");
} else {
$tpl->newBlock("previous2");
}
$count = mysql_fetch_row(mysql_query("SELECT count(*) FROM Articles"));
$thispage = ceil($start/$max+1);
if ($count[0] > $max)
{
$total = ceil($count[0]/$max);
for($i=0;$i<$total;$i++)
{
$number = $i+1;
$start = $i*$max;
if ($thispage == $number)
{
$tpl->assign(array("phpself" => "$PHP_SELF","prev" => "$prev","max" => ".$max.","start" => ".$start.","number" => ".$number."));
$tpl->newBlock("numbers");
} else {
$tpl->assign(array("phpself" => "$PHP_SELF","prev" => "$prev","max" => ".$max.","start" => ".$start.","number" => ".$number."));
$tpl->newBlock("numbers2");
}
}
}
if ($count[0] > $next)
{
$tpl->assign(array("phpself" => "$PHP_SELF","prev" => "$prev","max" => "$max"));
$tpl->newBlock("next");
} else {
$tpl->newBlock("next2 ");
}
echo "</p>\n";
}
}
}
?>
<!-- START BLOCK : error -->
<p>Onbekende fout opgetreden</p>
<!-- END BLOCK : error -->
<!-- START BLOCK : articledisplay -->
<!-- START BLOCK : articles -->
<TABLE>
<tr>
<td><img width=150 height=150 src='{picture}' border='0' align='left' title='' alt='{description}' style='border:0px solid black;'><br></td>
<td><br><br><b>Genre:</b> {gname}<br>
<b>Article name:</b> {name}<br>
<b>Article description:</b> {description}<BR><BR></td>
</tr>
</TABLE>
<!-- END BLOCK : articles -->
<p>
<!-- START BLOCK : previous -->
[<a href="{phpself}?start={prev}&max={max}">Previous</a>]
<!-- END BLOCK : previous -->
<!-- START BLOCK : previous2 -->
[Previous]
<!-- END BLOCK : previous2 -->
<!-- START BLOCK : numbers -->
<strong>[<a href="{phpself}?start={start}&max={max}">{number}</a>]</strong>
<!-- END BLOCK : numbers -->
<!-- START BLOCK : numbers2 -->
<a href="{phpself}?start={start}&max={$max}">{number}</a>
<!-- END BLOCK : numbers2 -->
<!-- START BLOCK : next -->
[<a href="{phpself}?start={next}&max={max}">Next</a>]
<!-- END BLOCK : next -->
<!-- START BLOCK : next2 -->
[Next]
<!-- END BLOCK : next2 -->
<!-- END BLOCK : articledisplay -->
2.487 views