Comments Page "Number of Entries" lost

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
cAdams
Posts: 40
Joined: Thu Sep 15, 2011 10:52 pm

Comments Page "Number of Entries" lost

Post by cAdams »

Version of script: 1.7

Since making several modifications to my guestbook with Henrie's assistance, i've now noticed the Number of Entries has disappeared from the top of my comments page.

I've also searched the forum for the answer as encouraged but after reading over the four pages that came up with 'number of entries' in the search box, they only answered changing the number of entries to the comments page, hence my question: how do i restore the number of entries at the top of my comments page?
To All UALs (Unreliable Arrogant Liars), Go Play On The Motorway
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Comments Page "Number of Entries" lost

Post by Klemen »

You're probably missing this code in the "overal_header.php" template file:

Code: Select all

                <span class="gbook_entries_top"><?php echo $settings['number_of_entries']; ?> <?php echo $settings['number_of_pages']; ?></span>
				<br class="clear" />
                <?php echo $settings['pages_top']; ?>
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
cAdams
Posts: 40
Joined: Thu Sep 15, 2011 10:52 pm

Re: Comments Page "Number of Entries" lost

Post by cAdams »

Klemen wrote:You're probably missing this code in the "overal_header.php" template file:

Code: Select all

                <span class="gbook_entries_top"><?php echo $settings['number_of_entries']; ?> <?php echo $settings['number_of_pages']; ?></span>
				<br class="clear" />
                <?php echo $settings['pages_top']; ?>
checked the overall_header.php and all the code is there Klemen
To All UALs (Unreliable Arrogant Liars), Go Play On The Motorway
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Comments Page "Number of Entries" lost

Post by Klemen »

Try deleting this from your settings file and see if you get any error messages in the guestbook:

Code: Select all

ini_set('display_errors', 0);
ini_set('log_errors', 1);
Instead paste this code in the settings file

Code: Select all

error_reporting(E_ALL);
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
cAdams
Posts: 40
Joined: Thu Sep 15, 2011 10:52 pm

Re: Comments Page "Number of Entries" lost

Post by cAdams »

deleting and replacing that code came up with the following errors:

Notice: Undefined index: number_of_guestbook_entries in /home/vhosts/cmafit.co.cc/CMA Fotography/GuestBook/templates/default/overall_header.php on line 44

Notice: Undefined offset: 9 in /home/vhosts/cmafit.co.cc/CMA Fotography/GuestBook/gbook.php on line 1095

yet line 44 of the overall_header reads: <span class="gbook_entries_top"><?php echo $settings['number_of_guestbook_entries']; ?> <?php echo $settings['number_of_pages']; ?></span>


and line 1095 of gbook.php: ';
To All UALs (Unreliable Arrogant Liars), Go Play On The Motorway
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Comments Page "Number of Entries" lost

Post by Klemen »

I'm not sure how modified your guestbook is, but you will need to find the issue within your code. Most likely $settings isn't set as global within a function of yours. Before calling the template file within gbook.php try adding

Code: Select all

global $settings, $lang; 
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
cAdams
Posts: 40
Joined: Thu Sep 15, 2011 10:52 pm

Re: Comments Page "Number of Entries" lost

Post by cAdams »

sorry Klemen but i'm a virgin phper who was ran over by a car so some things needs to be spelt out to me now. pls clarify where to add global $settings, $lang;, to the overall_header or the settings.php???
To All UALs (Unreliable Arrogant Liars), Go Play On The Motorway
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Comments Page "Number of Entries" lost

Post by Klemen »

Open gbook.php and find

Code: Select all

require_once($settings['tpl_path'].'overall_header.php');
Just ABOVE that code you should have

Code: Select all

global $settings, $lang; 
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
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: Comments Page "Number of Entries" lost

Post by Henrie »

cAdams,

You should make a backup of the file you are working on to change before making any changes. Name it filename.php.bak1 or so.
And keep that one for backup in case a changed file is not working anymore after your changes. You can than copy back the backup file and overwrite the changed file and try again.

It is impossible for us to see the changes you made because php files are processed by your server so we can only see the output and have to guess what is wrong with the code.
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
cAdams
Posts: 40
Joined: Thu Sep 15, 2011 10:52 pm

Re: Comments Page "Number of Entries" lost

Post by cAdams »

i do have that code above require_once($settings['tpl_path'].'overall_header.php'); Klemen

i also always keep the originals files i work on Henrie so i may need to ftp the original gbook.php and re-do all the modifications from scratch :(
To All UALs (Unreliable Arrogant Liars), Go Play On The Motorway
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: Comments Page "Number of Entries" lost

Post by Henrie »

cAdams wrote:i also always keep the originals files i work on Henrie so i may need to ftp the original gbook.php and re-do all the modifications from scratch :(
I mean after a small change that is working, backup your file before making the next change. So that you do not have to start all over again.
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Comments Page "Number of Entries" lost

Post by Klemen »

In that case the problem is hidden somewhere in your customizations and not something we can "guess" as we have no idea how your file looks like.
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
Post Reply