Script: GBOOK
Version of script: Latest
I have a small website and i want to add the guestbook in there, but it's to big for my site, can i modify the script somewhere that i only have 5 messages on one page?
Greetz Michiel
I want Less than 10 Messages on One Page - GBOOK
-
- Posts: 3
- Joined: Wed Nov 07, 2007 3:58 pm
See these topics:
viewtopic.php?t=464
viewtopic.php?t=527
The mentioned line numbers will be different in the latest version of the guestbook script.
Greetings,
Henrie
viewtopic.php?t=464
viewtopic.php?t=527
The mentioned line numbers will be different in the latest version of the guestbook script.
Greetings,
Henrie
-
- Posts: 3
- Joined: Wed Nov 07, 2007 3:58 pm
It works almost
Yes it works, but only when i open the page, when i click on Next it goes back to 10.
This is my site:
www.happylinks.nl/gastenboek.html
My script is:
This is my site:
www.happylinks.nl/gastenboek.html
My script is:
Code: Select all
$page=gbook_isNumber($_REQUEST['page']);
if ($page>0) {
$start=($page*5)-9;$end=$start+9;
} else {
$page=1;$start=1;$end=5;
}
$lines=file($settings['logfile']);
$total = count($lines);
if ($total > 0) {
if ($end > $total) {$end=$total;}
$pages = ceil($total/5);
$prev_page = ($page-1 <= 0) ? 0 : $page-1;
$next_page = ($page+1 > $pages) ? 0 : $page+1;
echo '<p>Er zijn '.$total.' berichten op '.$pages.' pagina´s.<br />';
$gbook_nav = '';
if ($prev_page) {
$gbook_nav .= '
<a href="gbook.php?page=1"><< Eerste</a>
|
<a href="gbook.php?page='.$prev_page.'">< Terug</a>
|
';
}
for ($i=1; $i<=$pages; $i++) {
if ($i <= ($page+5) && $i >= ($page-5)) {
if($i == $page) {$gbook_nav .= ' <b>'.$i.'</b> ';}
else {$gbook_nav .= ' <a href="gbook.php?page='.$i.'">'.$i.'</a> ';}
}
}
if ($next_page) {
$gbook_nav .= '
|
<a href="gbook.php?page='.$next_page.'">Volgende ></a>
|
<a href="gbook.php?page='.$pages.'">Laatste >></a>
';
}
echo $gbook_nav;
}
echo '</p>
It should be like this
You can see yourself what the difference is.
Greetings,
Henrie
Code: Select all
$page=gbook_isNumber($_REQUEST['page']);
if ($page>0) {
$start=($page*5)-4;$end=$start+4;
} else {
$page=1;$start=1;$end=5;
}
$lines=file($settings['logfile']);
$total = count($lines);
if ($total > 0) {
if ($end > $total) {$end=$total;}
$pages = ceil($total/5);
$prev_page = ($page-1 <= 0) ? 0 : $page-1;
$next_page = ($page+1 > $pages) ? 0 : $page+1;
Greetings,
Henrie
-
- Posts: 3
- Joined: Wed Nov 07, 2007 3:58 pm
Thanks
Thanks for your quick reaction, it worked and you helped me a lot!
Michiel Westerbeek
Michiel Westerbeek