Page 1 of 1

Comments Page "Number of Entries" lost

Posted: Sat Oct 15, 2011 8:50 am
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?

Re: Comments Page "Number of Entries" lost

Posted: Sat Oct 15, 2011 9:10 am
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']; ?>

Re: Comments Page "Number of Entries" lost

Posted: Sat Oct 15, 2011 10:04 am
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

Re: Comments Page "Number of Entries" lost

Posted: Sat Oct 15, 2011 2:26 pm
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);

Re: Comments Page "Number of Entries" lost

Posted: Sat Oct 15, 2011 8:44 pm
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: ';

Re: Comments Page "Number of Entries" lost

Posted: Sat Oct 15, 2011 9:18 pm
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; 

Re: Comments Page "Number of Entries" lost

Posted: Sat Oct 15, 2011 10:01 pm
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???

Re: Comments Page "Number of Entries" lost

Posted: Sun Oct 16, 2011 9:08 am
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; 

Re: Comments Page "Number of Entries" lost

Posted: Sun Oct 16, 2011 11:41 am
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.

Re: Comments Page "Number of Entries" lost

Posted: Mon Oct 17, 2011 12:38 am
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 :(

Re: Comments Page "Number of Entries" lost

Posted: Mon Oct 17, 2011 5:27 am
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.

Re: Comments Page "Number of Entries" lost

Posted: Mon Oct 17, 2011 1:08 pm
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.