How to number the entries in the guestbook.

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
schimata
Posts: 4
Joined: Fri Jun 23, 2006 11:05 pm

How to number the entries in the guestbook.

Post by schimata »

Script URL:
Version of script: 1.34
Version of PHP:
Hosting company: powweb.com
Have you searched THIS FORUM for your problem: yes
(if not please do before posting)
If so, what terms did you try: number

Write your message below:

Hi,

First of all let me congratulate you for such a fabulous tool. I am wondering if I can see the total number of posts (apart from the total number of pages) on the Guestbook main page.

I currently have 1.34 version. How can I have the nubmer of entries feature on the guestbool (even better if we can just number the entries).

Thanks in advance,
Srini
schimata
Posts: 4
Joined: Fri Jun 23, 2006 11:05 pm

Post by schimata »

Hey guys...

Why is noone answering my questions.

Can we have the total number of posts in gbook or not?

Thanks,
Srini
schimata
Posts: 4
Joined: Fri Jun 23, 2006 11:05 pm

Post by schimata »

Can any one answer the question pl?

Thanks in advance,
Srini
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hi,

First of all you should upgrade to the latest version, I don't think a lot of people here have v1.34 and can't really help.

In gbook.php version 1.34 on line 124 (an in 1.41 on line 170) you have a variable called

Code: Select all

$total
. This variable contains the total number of posts, print it out to HTML wherever you want the total number of posts displayed.
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
schimata
Posts: 4
Joined: Fri Jun 23, 2006 11:05 pm

Post by schimata »

Thanks man!

That worked ($total variable)..

Your guestbook rocks!!!!!! 8) 8)

Thanks,
Srini
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hi,

You're welcome. You are invited (but in no way required) to rate GBook or even post a review at
http://php.resourceindex.com/rate?05414
and/or
http://www.hotscripts.com/Detailed/37192.html

Regards,
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
zoli400
Posts: 1
Joined: Sun Jul 16, 2006 6:46 pm

Post by zoli400 »

So open the gbook.php in an editor. Find

Code: Select all

function printEntries($lines,$start,$end)
It's about line 745. In this function after the line:

Code: Select all

$delimiter="\t";
copy this:

Code: Select all

$file = "entries.txt";
$all = count(file($file));
$all will show the number of entries ;)
After the line

Code: Select all

list($name,$from,$email,$url,$comment,$added,$isprivate,$reply)=explode($delimiter,$lines[$i]);
insert:

Code: Select all

$num = $all -  $i;
So $num is the number of the entry. Let's write it out. You can use it ex. in line

Code: Select all

<td class="upper" width="65%"><b>'.$num.'. Comments:</b></td>
And the comments will be numbered :wink:
Post Reply