How To Modify Script For My Purposes???

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
SkyHawk
Posts: 1
Joined: Mon Jun 01, 2009 3:09 pm

How To Modify Script For My Purposes???

Post by SkyHawk »

Script URL:pgh.creativevpcom/gb16/gbook.php
Version of script:1.6
Hosting company:1 and 1.com
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

I know absolutely nothing about PHP, but I am starting to learn it.

In the mean time, I have need for a Feedback type of form to be used for "Reviews" that will post to my website.

I have looked around and it appears that no one has put a form like this together so I found this guestbook script and it pretty much has the output that I am looking for. The problem is that I don't want a guestbook.

Is there anyone here that would be willing to help me modify the script to suit my needs?

All I am looking for is something that asks for Member Name, Date of Review, Restaurant Name and a place for the review. Pretty basic stuff.

With this guestbook script, it works perfectly (pretty much) for what I need. The exception is that I have no idea how to get rid of or around the required email address. I would like to get rid of the email thing and in it's place have the Restaurant name. I have been able to make some minor changes without really changing the script, but I have no clue as to how to get rid of the email and add Restaurant Name.

Anyone have any idea as to how I can do this? If not, anyone know of a feedback type form that might work instead?

Until I get this resolved, my site is sitting in limbo.

My thanks for any help with this . . .
puniksem
Posts: 47
Joined: Thu Nov 01, 2007 12:25 pm

better script recommendation

Post by puniksem »

Perhaps this would serve your needs better

http://www.phpjunkyard.com/php-message-board.php

instead of a guestbook, try the message board script.
World's shortest poem: We, see.
DC
Posts: 138
Joined: Sun Dec 09, 2007 9:28 am

Post by DC »

I have never actually played with this GB but I think the GB would be better then the MB for what he is trying to do as the way it works and lays out seems to be more of what he's looking for, I wouldn't think that should be a big deal just small mods, maybe I will take a quick peak at the GB later ...

As I have moded many PHPJunkyard scripts in the past for various custom usages.

DC
To Code Or Not To Code That Is The Question?

Was my post of any help to you? if so please do [url=http://www.clickcraft.net/slice_donations.php][b]Buy Me A Slice[/b][/url] ...
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello SkyHawk,

I saw your message at the day you posted it but was too busy at work at that time and forgot it afterwards :oops:

But the postings today was the right reminder. So here it goes.

Open language.inc.php and change:

Code: Select all

$lang['t20']='E-mail:';
to

Code: Select all

$lang['t20']='Restaurant:';
and

Code: Select all

$lang['t52']='<b>Your e-mail:</b>';
to

Code: Select all

$lang['t52']='Restaurant name:';
Open settings.php and set:

Code: Select all

$settings['hide_emails']=0;
Open gbook.php and change:
I start with the highest line numbers, so the will stay correct:
Line 982 and line 539 change:

Code: Select all

        echo $lang['t20'].' <a href="mailto:'.$email.'" class="smaller">'.$email.'</a>';
to

Code: Select all

        echo $lang['t20'].' '.$email.'';
Lines 715-717 change

Code: Select all

$v['email']=htmlspecialchars($_POST['email']);
if (strlen($v['email']) > 0 && !(preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$v['email']))) {$v['email']='INVALID';}
$v['email']=str_replace($char,$repl,$v['email']);
to

Code: Select all

$v['email'] = '';
I hope this is what you wanted. If not, feel free to ask again.

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.
iarsnoo
Posts: 5
Joined: Fri Mar 19, 2010 11:26 am

Post by iarsnoo »

I've just installed the guestbook script and am delighted with it. The clearly written instructions and this forum have been a great help. My thanks to Klemen, Henrie, and those who have contributed to this forum.

It's not clear if SkyHawk (above) appreciated Henrie's help, but I certainly did.

I've been trying to adapt what Henrie said to change the 'Your web site' field to a 'Subject' field. I've made the changes to language.inc.php and these work fine. But I'm afraid I'm lost when it comes to making changes to guestbook.php. I'd also like to remove the pre-inserted 'http://' from the field.

Any help will be much appreciated (and acknowledged!).
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hi,

Glad you like it.

Try finding and deleting this code from the gbook.php file:

Code: Select all

$url=$url ? $url : 'http://';
That should do the trick.
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
iarsnoo
Posts: 5
Joined: Fri Mar 19, 2010 11:26 am

Post by iarsnoo »

Many thanks, Klemen. That's the 'http://' gone. But when I try to submit a comment with an entry in the former 'Your web site' (now 'Subject') field, I'm still getting 'Enter a valid website address or leave it empty'.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Delete these lines from gbook.php and see if it works:

Code: Select all

	if ($url=='INVALID')
	{
        $error_buffer .= $lang['e05'].'<br class="clear" />';
        $url = '';
	}
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

Post by Henrie »

Hello iarsnoo and Klemen,

I see Klemen already answered the question while I was eating my dinner

I looked at it and following needs to be changed also

Delete lines 723-727

Code: Select all

	    if ($v['url'] == 'http://' || $v['url'] == 'https://') {$v['url'] = '';}
	    elseif (strlen($v['url']) > 0 && !(preg_match("/(http(s)?:\/\/+[\w\-]+\.[\w\-]+)/i",$v['url'])))
        {
        	$v['url'] = 'INVALID';
        }
You should also change line 1114

Code: Select all

$url = '<a href="'.$url.'" class="gbook_submitted" '.$settings['target'].' rel="nofollow">'.$url.'</a>';
to

Code: Select all

$url = $url;
And your visitors should also not use spamwords in the 'former url' field as it is also counted for the Junkmark spam filter.

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.
iarsnoo
Posts: 5
Joined: Fri Mar 19, 2010 11:26 am

Post by iarsnoo »

Gentlemen,

I followed your instructions, and everything works brilliantly. Thank you both very much for your help with this. I hope your advice on this will help others too.

Have bought you both a drink!
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Thank you very much :D

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