No New Posts - Only View Existing If Possible?

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
iosefl
Posts: 10
Joined: Thu Dec 23, 2010 5:53 pm

No New Posts - Only View Existing If Possible?

Post by iosefl »

Script URL: http://www.wellnessfoods.ca/simplyswitches/gbook.php
Version of script: 1.7
Hosting company: http://www.ixwebhosting.com
URL of phpinfo.php: http://wellnessfoods.ca/phpinfo.php
URL of session_test.php: http://wellnessfoods.ca/session_test.php
What terms did you try when SEARCHING for a solution:
no new posts, block guest book sign up, only view guest book
Write your message below:
Hi,
We did gather lots of guest book comments and would like to stop for a while getting new posts, but still allow visitors to view existing posts, is there a way to do this?
Thanks,
Joseph
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: No New Posts - Only View Existing If Possible?

Post by Henrie »

Hello Joseph,

It is not possible with the current GBook version without some code editing.

I had a modification made for myself for Gbook version 1.41 (check it here http://volkelloopt.nl/berichtenboek2010/gbook.php ), but not for Gbook version 1.7

As i have just upgraded the main guestbook to the new version 1.7 (check it here http://volkelloopt.nl/gbook/gbook.php ) and need to upgrade the 'Berichtenboek' too - which needs this same modification- I will try to write it this weekend and when I am finished will post it here too.

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.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: No New Posts - Only View Existing If Possible?

Post by Henrie »

Hello Joseph,

Here is how I have done it.

Read Only mode guestbook for GBook version 1.7

Open the file gbook.php for editing
Search for (lines 85-86)

Code: Select all

printSign(); 
break;
Replace it with

Code: Select all

/* Gbook readonly modification by Henrie >> disabling the sign action */ 
if ($settings['readonly'] == 1) 
{
   problem($lang['e11']); 
   break;
} 
else 
{
   printSign(); 
   break; 
} 
/* End of Gbook readonly modification by Henrie >> disabling the sign action */
Save and close the gbook.php file.

Open the file settings.php for editing
Before the /* DO NOT EDIT BELOW */ part add

Code: Select all

/* Gbook readonly modification by Henrie */ 
/* Guestbook is readonly? 1 = YES, 0 = NO */ 
$settings['readonly']=1;
Save and close the settings.php file.

Open the file overall_header.php for editing
it can be found in the templates/default folder.
Search for (lines 34-36)

Code: Select all

<a href="<?php echo $settings['website_url']; ?>"><?php echo $settings['website_title']; ?></a> |
<a href="gbook.php"><?php echo $lang['t60']; ?>
<a href="gbook.php?a=sign"><?php echo $lang['t48']; ?>
Replace it with

Code: Select all

<!-- Gbook readonly modification by Henrie >> hide the view guestbook and sign guestbook options in readonly mode -->
<a href="<?php echo $settings['website_url']; ?>"><?php echo $settings['website_title']; ?></a>
<?php
if ($settings['readonly'] != 1)
{
   echo ' |
      <a href="gbook.php">'.$lang['t60'].'</a> |
      <a href="gbook.php?a=sign">'.$lang['t48'].'</a>
   ';
}
?>
<!-- End of Gbook readonly modification by Henrie >> hide the view guestbook and sign guestbook options in readonly mode -->
Save and close the overall_header.php file.

If you want it permanently blocked for writing, you can additionally chmod the entries.txt file (or whatever you have renamed it to) to 644 (rw-r--r--)

I hope it works for you as well as it does for me.

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