add_comment.php : How mail the IP-Address?

rakso

Joined: 2003-07-31
Posts: 141
Posted: Wed, 2004-01-21 21:26

hello,

which modifications must I do that Gallery will mail me the IP (at best - the complete HTTP_POST_VARS) when a comment is posted?

That will be very nice!

Thanks vor help

 
maenito

Joined: 2004-02-15
Posts: 1
Posted: Sun, 2004-02-15 03:28

hi,

I don't know what version you have, I have 1.4.1 and I did this modification:

1) Open file add_comment.php

2) Change this code:

Quote:
if (isset($save)) {
if (!empty($commenter_name) && !empty($comment_text)) {
$comment_text = removeTags($comment_text);
$commenter_name = removeTags($commenter_name);
$IPNumber = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$gallery->album->addComment($id, stripslashes($comment_text), $IPNumber, $commenter_name);
$gallery->album->save();
emailComments($id, $comment_text, $commenter_name);
$contenidocomentario= $commenter_name . " " . $IPNumber;
dismissAndReload();
return;
} else {

3) for this

Quote:
if (isset($save)) {
if (!empty($commenter_name) && !empty($comment_text)) {
$comment_text = removeTags($comment_text);
$commenter_name = removeTags($commenter_name);
$IPNumber = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$gallery->album->addComment($id, stripslashes($comment_text), $IPNumber, $commenter_name);
$gallery->album->save();
emailComments($id, $comment_text, $commenter_name);
mail("email_to","Subject", $IPNumber, "From: email_from");
$contenidocomentario= $commenter_name . " " . $IPNumber;
dismissAndReload();
return;
} else {

I expect this can help you.

Maenito

 
rakso

Joined: 2003-07-31
Posts: 141
Posted: Mon, 2004-02-16 13:36

Hi,

thanks for your reply.

Ive tryd it, but it don´t work out.

The solution seems to be very staright-forward.. but i dont know why it not work out.

I´ve updated to Gallery 1.4.2

 
ksk35

Joined: 2008-11-06
Posts: 1
Posted: Thu, 2008-11-06 20:16

U sure that works?