Page 1 of 1

How To Modify Script For My Purposes???

Posted: Mon Jun 01, 2009 3:27 pm
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 . . .

better script recommendation

Posted: Mon Jul 13, 2009 9:46 am
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.

Posted: Mon Jul 13, 2009 4:33 pm
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

Posted: Mon Jul 13, 2009 8:23 pm
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

Posted: Tue Mar 30, 2010 12:48 pm
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!).

Posted: Tue Mar 30, 2010 4:29 pm
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.

Posted: Tue Mar 30, 2010 5:05 pm
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'.

Posted: Tue Mar 30, 2010 5:24 pm
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 = '';
	}

Posted: Tue Mar 30, 2010 5:40 pm
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

Posted: Tue Mar 30, 2010 7:00 pm
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!

Posted: Tue Mar 30, 2010 7:09 pm
by Henrie
Thank you very much :D

Henrie