Configure so sign_form is above comments on load?

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Debbie64
Posts: 5
Joined: Tue Mar 09, 2010 8:01 pm

Configure so sign_form is above comments on load?

Post by Debbie64 »

Script URL: http://www.carmelvalleynews.net/gbook/gbook.php
Version of script:1.7
Hosting company:godaddy
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

First, great script. I'm setting it up for a client and I've got it styled nicely, but she would like to see the actual comment submission form load above the comments - everything self contained on one page.

So, I did some creative tweaking/coding and created a 2 column table in overall_header, placed the gbook header in the left column and did a php include of the sign_form in the right column. A few adjustments to the style sheet and the comments were flowing just below the form and header image and it looked great (I was doing this on my development machine, not the actual site.)

The only issue seemed to be a lot of undefined variables coming from sign_form.php.

I know that all those variables are being defined somewhere, settings.php? gbook.php? - but I'm not sure how to make this work in the configuration my client wants.

Is the configuration possible (header image on the left, sign_form on the right and comments below) and can you help with the undefined variables? If necessary, I can redo the malfunctioning configuration and upload so it's visible.

Amending this to say, I configured again and uploaded and there are no undefined variable errors, however the security image info is missing, and it is not taking the info I put in. I submit and it brings up the sign_form below, indicating I should fill in the required fields and then it accepts it. Just FYI, while I continue to work on it... If anyone is following along... :)

Thank you!

Debbie
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello Debbie,

I tried to find a solution for you, but basically GBook was not designed to be displayed this way. I had the same result as you or I ended up with other problems.

As I think this would be a major change in the guestbook I think this will be outside of the scope that Klemen provides in the forum, but maybe he proves me wrong.
So unless someone else is able to help you, I think you are on yourself on solving this problem. Sorry :(

Greetings,
Henrie
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.
Debbie64
Posts: 5
Joined: Tue Mar 09, 2010 8:01 pm

Post by Debbie64 »

Thank you very much for trying. I appreciate it. It seems like it's just so close - but I just don't know quite enough about php to fix it. I may noodle around with it some more and see if I can figure it out. If by some miracle - lol - I do, I will post back here with a solution.

Thanks again,
Debbie
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Doing this presents two problems: you need to enable sessions for all pages and make sure header/footer and sign form aren't printed out more than once.

I haven't had a chance to test it, but you can see if this works:

1. BACKUP exiting files

2. Remove lines 58,59:

Code: Select all

if ($a=='sign' || $a=='add')
{
and the closing } at line 67

2. In the line that starts with

function printSign

add this before the closing ) :
,$printHeaders=1

3. A few lines further down within the same function, change

Code: Select all

printTopHTML();
require($settings['tpl_path'].'sign_form.php');
printDownHTML();
to this:

Code: Select all

    if ($printHeaders)
    {
	    printTopHTML();
	    require($settings['tpl_path'].'sign_form.php');
	    printDownHTML();
    }
    else
    {
		require($settings['tpl_path'].'sign_form.php');
    }
4. Find the very first

printTopHTML();

within the code (around line 214) and add this below:

Code: Select all

printSign('','','','','','','','','',0);
5. Save and test.

Hope I didn't forget anything. Let us know how it goes.
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
Debbie64
Posts: 5
Joined: Tue Mar 09, 2010 8:01 pm

Post by Debbie64 »

You rock! :wink: I'm going to try that. I'll post back if it works.

Thanks so much!

Debbie
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

I tried it on my localhost testserver and it works for me there.

Greetings,
Henrie
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.
Debbie64
Posts: 5
Joined: Tue Mar 09, 2010 8:01 pm

Post by Debbie64 »

Yes - it worked for me too! Thank you both very much.

As long as I've got you here, I'm still trying to get a flash menu to display in the header.txt. I put the swfobject script in the head tags of the overall_header and I'm using absolute urls.

When you right click in the space where the menu should be (at the top to the right of the logo), it displays the flash context menu of Zoom, Quality, Settings, etc.) but nothing else. I've got it testing on my own site here where you can look at the code: http://www.montereybaydesign.com/gbook/gbook.php

If you have any ideas about this, I'd appreciate it!

Thanks so much, again,

Debbie
Henrie wrote:I tried it on my localhost testserver and it works for me there.

Greetings,
Henrie
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

I know absolutely very little about Adobe Flash
But I know it does not show me the menu. I use Firefox and i get the message Content on this page requires a newer version of Adobe Flash Player. But i already have the newest version 10.0.45.2 installed while your source code asks for <param name="swfversion" value="9.0.45.0">
But this is not a forum for helping you with Flash (although I would help you if I could)

But are you sure it is a working swf file you have uploaded? I have downloade RainbowHeader.swf and when i open it in Flashplayer it just shows me a white screen like nothing is loaded.

Greetings,
Henrie
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.
Debbie64
Posts: 5
Joined: Tue Mar 09, 2010 8:01 pm

Post by Debbie64 »

OK, I finally got it - the flash file along with the xml files that go with it HATED not being located in the same directory as the header.txt. I added them into that directory, changed all the urls to just the file name and it all loaded up fine. :)

http://www.montereybaydesign.com/gbook/gbook.php

Unfortunately, I just realized - this would really require me to have multiple versions of the menu, so I'm probably going to wind up not using it. ! After all that. LOL.

Still, got the guestbook just the way the client wants it with those other changes...

Thanks again, very much for all the help,

Debbie
Post Reply