die ziet er als volgt uit:
www.website.nl/categorienaam.html
Dit is de pagina die dan ingeladen wordt:
<?php
$rubriek = addslashes($_GET["rubriek"]);
$rubriekm = strtolower(str_replace('_',' ',$rubriek));
$sqlrub = "SELECT * FROM rubrieken WHERE rubriek = '$rubriekm'";
$resrub = mysql_query($sqlrub);
$rowrub = mysql_fetch_array($resrub);
if($rowrub['titel'] != "")
{
echo'
<img class="top" src="/images/largeTop.jpg" alt="" width="567" height="2" />
<div class="largeTitle">
<h1>'. $rowrub['titel'] .'</h1></div>
<div id="maincontent">
<div class="dottedLine"></div>
<p><h2 style="font-size:14px; color: #000000; font-weight:normal; text-align:left;">'. $rowrub['omschrijving'] .'</h2></p>
</div>
<img class="bottom" src="/images/largeBottom.jpg" alt="" width="567" height="2" />
';
}
$nopic = "/images/nopic.png";
$res = mysql_query("SELECT * FROM instellingen");
while ($obj = mysql_fetch_object($res)) {
$items = $obj->items;
}
$pnr = $_GET['p'];
$hoe = $_GET['hoe'];
if (is_numeric($pnr) && $pnr !== "1") {
$reken1 = (($items*$pnr) - $items);
$reken2 = $items;
} else {
$reken1 =0;
$reken2 =$items;
}
$sort1 = "id";
$hoe = "ASC";
$p ="lIMIT ".$reken1.",".$reken2;
$sql = " SELECT c.*, r.rubriek as rubriek FROM csvfeed c
inner join rubrieken r on c.rubriek = r.id
WHERE r.rubriek = '$rubrieks' ORDER BY $sort1 $hoe $p";
$res = mysql_query($sql);
if (mysql_num_rows($res) >= 1)
{
echo"<div id=\"koopjes\">";
while ($row = mysql_fetch_array($res))
{
$string = '' . $row[description] . '';
$string = str_replace('<br />',' - ',$string);
$string = str_replace('<div>','',$string);
$string = str_replace('</div>','',$string);
$string1 = '' . $row[name] . '';
$string1 = ucfirst(str_replace('-',' ',$string1));
$strc = strtolower(str_replace(' ','_',$row['rubriek']));
$array = array('<', '>', '\\', '/', '=', '!', ',', '?', '.', '%');
$strc = str_replace($array, "", $strc);
$strn = strtolower(str_replace(' ','_',$row['seoname']));
$strv = strtolower(str_replace(' ','_',$row['volgnummer']));
echo "<div class=\"koopje\">
<div class=\"koopjesTitle\"><h2>" . chopstring( $string1, 20 ) . "</h2> </div>
<div class=\"priceBulletin\">";
echo"€ " . $row['price'] ."";
echo"</div>";
echo"<div class=\"koopjesText\">";
echo"<div class=\"koopjesTextImg\">";
if($row['imagesurl'] != "")
{
echo "<a href=\"" . $Website . "/".$strc."/".$strn."".$strv.".html\"><img src=\"" . $row['imagesurl'] . "\" alt=\"" . chopstring( $string1, 100 ) . "\"></a>";
}
else
{
echo "<a href=\"" . $Website . "/".$strc."/".$strn."".$strv.".html\"><img src=" . $nopic ." alt=\"" . chopstring( $string1, 100 ) . "\"></a>";
}
echo"</div>";
echo "<p>" . chopstring( $string, 90 ) . "</p>
<div id=btnDetails><a href=\"" . $Website . "/".$strc."/".$strd."/".$strn."".$strv.".html\" title=\"" . $row['name'] ."\">Details</a></div>
</div>
</div>";
}
echo"</div>";
}
if($rowrub['titel'] != "")
{
echo'
<img class="top" src="/images/largeTop.jpg" alt="" width="567" height="2" />
<div id="maincontent">
<p><h3 style="font-size:14px; color: #000000; font-weight:normal; text-align:left;">'. $rowrub['omschrijving'] .'</h3></p>
</div>
<img class="bottom" src="/images/largeBottom.jpg" alt="" width="567" height="2" />
';
}
echo "<div id=nummering>";
$query = mysql_query(" SELECT c.id FROM csvfeed c
inner join rubrieken r on c.rubriek = r.id
WHERE r.rubriek = '$rubrieks'");
$aantal = mysql_num_rows($query);
$aantal2 = ceil($aantal / $items);
if ($_GET['p'] != 0 && $_GET['p'] != 1) {
$special = 1;
echo "<a href=\"?p=".($_GET['p'] - 1)."\"> «« <b>Vorige</b></a> | ";
}
$done1 = 0;
for ($i = 1; $i < ($aantal2 + 1); $i++)
{
$huidig = $_GET["p"];
$begin = $huidig-2;
$eind = $huidig+7;
$obj = $i + 1;
if($obj < $begin && $done1 == 0)
{
echo "<a href=?p=1>1</a> ... | ";
$done1 = 1;
}
if($i >= $begin && $i <= $eind && $obj > $begin)
{
if($i == $huidig)
{
echo"<a href=\"?p=".$i."\"><b>".$i."</b></a> | ";
}
else
{
echo"<a href=\"?p=".$i."\">".$i."</a> | ";
}
}
$last = $i;
}
if($last > $eind)
{
echo "... <a href=?p=$last>$last</a> ";
}
if (isset($_GET['p']))
{
$volgende = $_GET['p'] + 1;
} else
{
$volgende = 2;
}
if ($volgende <= $last) {
echo "<a href=\"?p=".$volgende."\"> <b>Volgende</b> »» </a>";
}
echo "</div>";
echo "<br clear=all />";
?>