View Guestbook
/*
Silentum Guestbook v2.0.2
Modified March 13, 2008
include.php copyright 2006-2008 "HyperSilence"
*/
echo "Pages:
";
$guestbook_file = "guestbook.txt";
$lines = file($guestbook_file);
$total_entries = count($lines);
if(!$_SERVER["QUERY_STRING"]) {
$page = 1;
}
else {
$page = $_GET["page"];
}
$sum = $total_entries / 50;
$floor = floor($sum);
if($sum == $floor) {
$pagenumber = $floor;
}
else {
$pagenumber = $floor + 1;
}
if($page > 1) {
echo "« ";
}
else {
echo "« ";
}
for($i = 1; $i <= $pagenumber; $i++) {
if($i == $page) {
echo $i." ";
}
else {
echo "".$i." ";
}
}
if($page < $pagenumber) {
echo "» ";
}
else {
echo " »";
}
echo "
Current entries:
"; $lines = file($guestbook_file); $total_entries = count($lines); if(!$_SERVER["QUERY_STRING"]) { $page = 1; } else { $page = $_GET["page"]; } $minimum = 50 * ($page - 1); $maximum = 50 * $page - 1; foreach($lines as $line_number => $line) { if($line_number < $minimum) {} elseif($line_number > $maximum) { break; } else { $entrynumber = $total_entries - $line_number; echo $line; } } ?>
Current entries:
"; $lines = file($guestbook_file); $total_entries = count($lines); if(!$_SERVER["QUERY_STRING"]) { $page = 1; } else { $page = $_GET["page"]; } $minimum = 50 * ($page - 1); $maximum = 50 * $page - 1; foreach($lines as $line_number => $line) { if($line_number < $minimum) {} elseif($line_number > $maximum) { break; } else { $entrynumber = $total_entries - $line_number; echo $line; } } ?>
navigate