Guestbook---more entries per page?

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Willreagan

Guestbook---more entries per page?

Post by Willreagan »

Script URL:
Version of script:
Version of PHP:
Hosting company: OCS Solutions
Have you searched THIS FORUM for your problem: Yes
(if not please do before posting)
If so, what terms did you try: Guest Book Size Adjust, and looked at all "guestbook" forum titles)

Write your message below: I am really happy with the script (THANK YOU), but wondered if there's a way to have more entries PER PAGE. In other words, can we adjust the page be longer vertically?
Thanks for your help
Will
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Yes it is possible but not yet with a setting in settings.php
To change the number of entries on a page you have to edit the gbook.php file.

Find the following code (starting at line 106):

Code: Select all

$page=gbook_isNumber($_REQUEST['page']);
if ($page>0) {
	$start=($page*10)-9;$end=$start+9;
} else {
	$page=1;$start=1;$end=10;
}
To change for example to 15 entries per page it would look like:

Code: Select all

$page=gbook_isNumber($_REQUEST['page']);
if ($page>0) {
	$start=($page*15)-14;$end=$start+14;
} else {
	$page=1;$start=1;$end=15;
}
And you should change the following code at line 124:

Code: Select all

$pages = ceil($total/10);
To change for example to 15 entries per page it would look like:

Code: Select all

$pages = ceil($total/15);
Hope this helps.

Greetings,
Henrie
Maxtor

Post by Maxtor »

Hi,

What if you wanted 25 per page? Would it be this?

Code: Select all

$page=gbook_isNumber($_REQUEST['page']);
if ($page>0) {
   $start=($page*25)-24;$end=$start+24;
} else {
   $page=1;$start=1;$end=25;
}

Code: Select all

$pages = ceil($total/25);
Thanks
Guest

Post by Guest »

Yes, that should work.

Greetings Henrie
Post Reply