Make Comments optional

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
cma2007
Posts: 7
Joined: Tue Oct 23, 2012 9:28 pm

Make Comments optional

Post by cma2007 »

Script URL: http://www.bibleversusconstitution.org/ ... /gbook.php
Version of script: 1.7
Hosting company: ipower.com
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: Make comments optional; comments; remove comments;

Write your message below:

I searched 20 pages deep into the forum and maybe I missed it, but I can't figure out how to make "Comments" optional instead of required.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: Make Comments optional

Post by Henrie »

Hello cma2007,

There is no option to make comments optional.
It would not make sense to have a guestbook where someone does not leave a comment, because that is the whole idea of having a guestbook.

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.
cma2007
Posts: 7
Joined: Tue Oct 23, 2012 9:28 pm

Re: Make Comments optional

Post by cma2007 »

Thank you for your reply. I actually converted your Guestbook into a "Sign a Petition" page. The person that asked me to do this for him, asked me to allow comments, just not make them a required field. Shouldn't there be a way to do this? Your guestbook is awesome, by the way. And I do so appreciate the fact that you try to help people the way you do.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: Make Comments optional

Post by Henrie »

Hello cma2007,

I decided to describe this mod because it is not so difficult to implement.

Optional 'comments' field for GBook version 1.7

Edit file settings.php
Add

Code: Select all

/* The 'commments' field is required? 1 = YES, 0 = NO */
$settings['req_comments']=0;
Put it before /* DO NOT EDIT BELOW */
Save and close the settings.php file.

Edit file gbook.php
Search for (line 788)

Code: Select all

if (empty($comments))
and replace with

Code: Select all

if (empty($comments) && $settings['req_comments'] == 1)
Save and close the gbook.php file.

Edit file sign_form.php in your template folder
Search for (line 53)

Code: Select all

 <div class="gbook_left"><span class="gbook_entries"><b><?php echo $lang['t16']; ?></b></span></div> 
and replace with

Code: Select all

 <div class="gbook_left"><span class="gbook_entries"><?php if ($settings['req_comments'] == 1) { echo '<b>' .$lang['t16']. '<b>'; } else { echo $lang['t16']; } ?></span></div> 
Save and close the sign_form.php file.

That should be all.
Now you can control wether the comments field is required or not by setting $settings['req_comments']= in the settings.php file.

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.
cma2007
Posts: 7
Joined: Tue Oct 23, 2012 9:28 pm

Re: Make Comments optional

Post by cma2007 »

Henrie - You are one awesome fellow! Thank you. You didn't have to do that - but you helped me and I really appreciate it. The world needs more people like you.
Thanks again - Charlie
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: Make Comments optional

Post by Henrie »

Hi Charlie,

You are welcome. And btw, it is not my guestbook, but Klemen's.I am a user just like you. I changed an older version of GBook to my needs, and stuck to these forums after that.

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.
cma2007
Posts: 7
Joined: Tue Oct 23, 2012 9:28 pm

Re: Make Comments optional

Post by cma2007 »

Henrie - Works perfectly. Thanks. And thanks for filling me in on Klemen.
C
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Make Comments optional

Post by Klemen »

Yeah, Klemen is the creator, but Henrie is the one providing most support for GBook lately with Klemen being too busy :oops:

Thanks again, Henrie :D
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: Make Comments optional

Post by Henrie »

Klemen,

Are you feeling well? You talk about yourself as another person.
And I understand that you are busy with Hesk. It gets a lot of questions and still needs active development, while GBook is working very well as it is now.

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.
Post Reply