50 posts per page

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
cmarangon
Posts: 5
Joined: Thu Dec 07, 2006 2:36 pm

50 posts per page

Post by cmarangon »

How can I config PHP Guestbook to show 50 posts per page?
Klemen
Site Admin
Posts: 10114
Joined: Fri Feb 11, 2005 4:04 pm

Re: 50 posts per page

Post by Klemen »

There's no built-in way to do it currently; see if this still works (didn't test it myself):
viewtopic.php?t=2704
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
cmarangon
Posts: 5
Joined: Thu Dec 07, 2006 2:36 pm

Re: 50 posts per page

Post by cmarangon »

Hello!

It worked fine. Thank you!

I also suggest it as a new feature for the next version update :D


What I did:

Between pages 147 and 175 I executed the information provided by Klemen, available clicking in the link of the post above.
The page linked is a post by Henrie.

1) In settings.php insert the new variable.

--------------------------------------cut from here--------------------------------
/* Number of entries per page modification by Henrie */
/* Number of guestbook entries to be shown on each page */
$settings['entries_page']= 50;
--------------------------------------cut still here--------------------------------

2) In gbook.php, betwwn lines 147 and 175


$page = (isset($_REQUEST['page'])) ? intval($_REQUEST['page']) : 0;
if ($page > 0)


/* Line 147
--------------------------------------cut from here--------------------------------

/* Number of entries per page modification by Henrie */
{
$start=($page*$settings['entries_page'])-($settings['entries_page']-1);
$end=$start+($settings['entries_page']-1);
}
else
{
$page = 1;
$start = 1;
$end=$settings['entries_page'];
}

$lines = file($settings['logfile']);
$total = count($lines);

if ($total > 0)
{
if ($end > $total)
{
$end = $total;
}
$pages = ceil($total/$settings['entries_page']);
/* End of number of entries per page modification by Henrie */

/* Line 175


--------------------------------------cut till here---------------------------------

$settings['number_of_entries'] = sprintf($lang['t01'],$total,$pages);
$settings['number_of_pages'] = ($pages > 1) ? sprintf($lang['t75'],$pages) : '';
======================
Post Reply