if ($_GET['offset']) { $offset = $_GET['offset']; } else { $offset = 0; }
// query voor het tellen van de records
$query = "SELECT * FROM `gastenboek`;";
$result = mysql_query ($query);
$totaal = mysql_numrows ($result);
$aantal = 10;
// query voor het ophalen van de entries
$query = "SELECT * FROM `gastenboek` ORDER BY `gastenboek_id` DESC LIMIT ".$offset.", ".$aantal.";";
$result = mysql_query ($query);
$num = mysql_numrows ($result);
for ($t = 0; $t < $num; $t++) {
$naam = mysql_result ($result, $t, "naam");
$plaats = mysql_result ($result, $t, "plaats");
$bericht = mysql_result ($result, $t, "bericht");
$date_added = mysql_result ($result, $t, "date_added");
$time_added = mysql_result ($result, $t, "time_added");
$date_added = convertDate ($date_added);
$bericht = convertText ($bericht);
$bericht = convertSmilie ($bericht, "website");
$naam = ucfirst (strtolower ($naam));
?>
Door: echo $naam; ?> ( echo $date_added; ?> om echo $time_added; ?>) |
echo $bericht; ?> |
if ($plaats != "") {
?>
Plaats: echo $plaats; ?> |
}
?>
|
|
}
?>
if ($offset != 0) { echo ''; } ?> |
$total = $totaal / $aantal;
$total++;
for ($t = 1; $t < $total; $t++) {
// voor elk ding ...
if (($offset / $aantal) == ($t-1)) {
// als de offset gelijk staat aan het nummer ofzow ...
echo "$t";
} else {
// als het niet zo is
echo '' . $t . '';
}
if (($t+1) < $total) {
// als het niet laatste nummer is
echo ", ";
}
}
?> |
if ($offset + $aantal < $totaal) { echo ''; } ?> |
|