Script URL:
Version of script:
Version of PHP:
Hosting company:
Have you searched THIS FORUM for your problem:
(if not please do before posting)
If so, what terms did you try:
Write your message below:
Love this guestbook. Its been very easy to work with and modify.
I have a request from a client that wants to add a field that each time someone signs his guestbook he wants a number assigned to it to show how many comments has been made.
Can anyone help?
Adding Number of Comments field
Hello Koxley,
To display the total number of entries you can change this code (starting at line 123 in GBook version 1.34):To this code:
I added this line
echo '<br>Total number of entries is '.$total.'.';
which shows the number of entries just below the line in which the numbers of pages is displayed.
The variable $total shows the number of entries in the entries.txt file.
Greetings,
Henrie
To display the total number of entries you can change this code (starting at line 123 in GBook version 1.34):
Code: Select all
else {
$total = count($lines);
if ($end > $total) {$end=$total;}
$pages = ceil($total/10);
echo '<p>Displaying page '.$page.' of '.$pages.'. Pages: ';
for ($i=1; $i<=$pages; $i++) {
if($i == $page) {echo "<b>$i</b>\n";}
else {echo '<a href="gbook.php?page='.$i.'">'.$i.'</a> ';}
}
}
Code: Select all
else {
$total = count($lines);
if ($end > $total) {$end=$total;}
$pages = ceil($total/10);
echo '<p>Displaying page '.$page.' of '.$pages.'. Pages: ';
for ($i=1; $i<=$pages; $i++) {
if($i == $page) {echo "<b>$i</b>\n";}
else {echo '<a href="gbook.php?page='.$i.'">'.$i.'</a> ';}
}
echo '<br>Total number of entries is '.$total.'.';
}
echo '<br>Total number of entries is '.$total.'.';
which shows the number of entries just below the line in which the numbers of pages is displayed.
The variable $total shows the number of entries in the entries.txt file.
Greetings,
Henrie