PDA

View Full Version : Contact Form


Birdie
02-10-2005, 05:52 PM
Hello;

Is it possible to change the information contained in the contact form when it gets mailed to you? I would like the information to include the posters email address and website.

I've tried poking around but don't know where the code is for this. Any help appreciated.

Cheers,
Birdie

Zlato
02-10-2005, 06:06 PM
Hi Birdie,
you can find what you're searching in the Index php search for this (line 590 or 592): // ################################################## ########################################//
// EMAIL NOTE ON COMMENTS
// ################################################## ########################################//
if($cfgrow['commentemail'] == "yes") {
if($_GET['x'] == "save_comment") {
$admin_email = $cfgrow['email'];
$comment_name = clean($_POST['name']);
$comment_image_id = $_POST['parent_id'];
$comment_message = clean($_POST['message']);

$link_to_comment = $cfgrow['siteurl']."?showimage=$comment_image_id";

$subject = "Pixelpost - New Comment Made";
$sent_date = date("Y-m-d");
$sent_time = date("H:i");
$body = "Hello,\r\n
A new comment has been made at your photoblog.
$link_to_comment

The Comment is
----------------------------------------------------------------------
$comment_message
by $comment_name
----------------------------------------------------------------------
Email Sent by pixelpost
";

$headers = "To: admin <$admin_email>\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "From: PIXELPOST <$admin_email>\r\n";
mail($recipient_email,$subject,$body,$headers);
}

In bold is that you receive by mail..

Hope this had help you.

Regards

Birdie
02-10-2005, 06:33 PM
Thank you.

I changed the code to:
// EMAIL NOTE ON COMMENTS
// ################################################## ########################################//
if($cfgrow['commentemail'] == "yes") {
if($_GET['x'] == "save_comment") {
$admin_email = $cfgrow['email'];
$comment_name = clean($_POST['name']);
$comment_image_id = $_POST['parent_id'];
$comment_message = clean($_POST['message']);
$comment_url = clean($_POST['url']);
$comment_email = clean($_POST['usemail']);
$link_to_comment = $cfgrow['siteurl']."?showimage=$comment_image_id";

$subject = "Pixelpost - New Comment Made";
$sent_date = date("Y-m-d");
$sent_time = date("H:i");
$body = "Hello,\r\n
A new comment has been made at your photoblog.
$link_to_comment

The Comment is
----------------------------------------------------------------------
$comment_message
by $comment_name
$comment_url
$comment_email
----------------------------------------------------------------------
Email Sent by pixelpost
";

$headers = "To: admin <$admin_email>\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "From: Uncommon Depth <$admin_email>\r\n";
mail($recipient_email,$subject,$body,$headers);
}
} // commentemail yes

I'm still not getting the email portion showing up though, so I must need to be making some changes elsewhere. I do have the email input area added to the comments template. I am fairly new working with php, so I'm guessing there must be a little blurb of code that needs to be placed somewhere else.

This isn't hugely important, but it would be nice to be able to reply to some of the people who post comments.

andy
02-10-2005, 06:38 PM
In the line:

$headers .= "From: Uncommon Depth <$admin_email>\r\n";

change the $admin_email variable to $comment_email.

That is what I did on my photoblog. I still made the email field optional. If a person doesn't want to leave their email, then I default it back to $admin_email.

Hope that helps.

Birdie
02-10-2005, 06:39 PM
Got It! :D

Line 609

if(($parent_id != "") and ($message != "")) {
$query = "insert into ".$pixelpost_db_prefix."comments(id,parent_id,datetime,ip,message,name,url ,usemail,)
VALUES('NULL','$parent_id','$datetime','$ip','$mes sage','$name','$url','usemail',)";
$result = mysql_query($query);
}

I added the usemail fields.

Thanks for the help. Hope this will be useful for others now!

Cheers,
Birdie