4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Vraxor on November 16, 2002, 03:46:47 PM

Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Vraxor on November 16, 2002, 03:46:47 PM
Hi all,

I know that there already are many posting on this topic, but I finally succeeded in getting it to work. So this is more or less a tutorial.

This is what you have to do.

1.  Open Details.php
2. add after:
Code: [Select]
     $site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);


Add this:
Code: [Select]
   $sql = "SELECT image_name FROM ".IMAGES_TABLE." WHERE image_id = $id";
    $image_name = $site_db->query($sql);
    $sql = "SELECT user_id FROM ".IMAGES_TABLE." WHERE image_id = $id";
    $user_id = $site_db->query($sql);
   
    $recipient_name = $image_row['user_name'];
    $recipient_email = $image_row['user_email'];
    $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
   
       // Start Emailer für comments
    include(ROOT_PATH.'includes/email.php');
    $site_email = new Email();
    $site_email->set_to($recipient_email);
    $site_email->set_from($config['site_email'], $config['site_name']);
    $site_email->set_subject("Comment Posted");
    $site_email->register_vars(array(
      "user_name" => $image_row['user_name'],
      "recipient_name" => $recipient_name,
      "image_name" => $image_row['image_name'],
      "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
      "site_name" => $config['site_name'],
      "image_url" => $image_url,
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();


Make sure that you posted it before:
Code: [Select]
   }
  }
  unset($row);
  unset($spam_row);
}

//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------


3. Now you have to make a mail template called comment_email.html

put this in the comment_email.html:

Code: [Select]
Dear {user_name},

someone posted a comment on {image_name} at {site_name}.
To view the comment go to: {image_url}
Date: {comment_date}

------
Best regards, {site_name}


save this mail template in:  [ROOT]/Lang/[your_language]/email/

This should be all.

Note:
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Vraxor on November 16, 2002, 05:03:06 PM
I forgot something important.

Most of the code was provided by Tommy. He posted something about this earlier, but that was in german and I did not really understand what it was about.

Anyways, some credits belong to him too  8)

Vraxor
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Mec4D on November 16, 2002, 06:25:58 PM
Vraxor and Tommy,

thank you very much!! this is great option and this works SUPER..

one little bug is at :
Quote

3. Now you have to make a mail template called comment_mail.html

put this in the comment_mail.html:


need to: comment_email.html  other you get error in 1.7.V

Thanks Again
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Chris on November 16, 2002, 06:29:43 PM
Quote from: Mec4D

one little bug is at :
Quote

3. Now you have to make a mail template called comment_mail.html

put this in the comment_mail.html:


need to: comment_email.html  other you get error in 1.7.V

Actually it's because of this PHP line:
Code: [Select]

    $site_email->set_body("comment_email", $config['language_dir']);

So if you want to use comment_mail.html just change the php line or else use the file name comment_email.html.  I just wanted to point out its a simple little change and not due to any particular 4images version.

Way to go guys!  Nice mod.
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Mec4D on November 16, 2002, 07:04:08 PM
I have little question about the data of the comments..I posted comments under my own images 2 times and I got e-mail with the same data of posted comments : Date: 31.12.1969 19:00 no matter I asked one member that got comments with the same Date: 31.12.1969 19:00.

how I can fix this?

Thank you for your help,

Cath
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Vraxor on November 16, 2002, 07:10:32 PM
@ Mec4D:
I think you can better leave that line out, since I have the same problem. The date is incorrect, should be able to fix, but I did not find it any important.
So just remove the "Date: {comment_date}" out of the template.

About the "Comment_mail.html":  Yes, I made a type error. It should be: 'Comment_email.html", but I already changed it.

Cheers,
Vraxor
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Tommy on November 16, 2002, 09:34:36 PM
Hi Vraxor,

Thanks for the credits, but you take it by your self and the credits go back to you  :wink:

The code is right and you have make a very good tutorial about this, and it must run with the little corrections from Mec4d very good.

@Mec4d Yes, delete the line with the comment_date (in the code and in the template), it only makes problems  :wink:

But, some little cosmetic changes i will give you here -

for your line:

Code: [Select]

   $site_email->set_subject("Comment Posted");


take this line:

Code: [Select]

$site_email->set_subject($lang['send_comment_emailsubject']);


Now go to your lang/"your language"/main.php/ to the point "Comments":

After this code:

Code: [Select]

//-----------------------------------------------------
//--- Comments ----------------------------------------
//-----------------------------------------------------
.
.
.
$lang['post_comment'] = "post comment";


add this code:
Code: [Select]

$lang['send_comment_emailsubject'] = "Your picture has become a new comment";


For the text "Your picture..." write what you want, i hope in better english as mine. Thats the email subject  :wink:

For your line:

Code: [Select]

      "user_name" => $image_row['user_name'],
      "recipient_name" => $recipient_name,


take this lines:

Code: [Select]

      "user_name" => stripslashes($user_name),
      "recipient_name" => stripslashes($image_row['user_name']),


"user_name" is the name of the person who makes the comment
"recipient_name" is the name of the owner of the picture. He / She becomes this mail.

Now you can take this code in your comment_email.html

Code: [Select]

Dear {recipient_name},

{user_name} posted a comment on {image_name} at {site_name}.
To view the comment go to: {image_url}

------
Best regards, {site_name}


Everybody who has make the Mod-phpbb integration must chance this line:

Code: [Select]

     "recipient_name" => stripslashes($image_row['user_name']),


with this line:

Code: [Select]

     "recipient_name" => stripslashes($image_row['username']),


If you don`t do it you have no recipient_name in your template.

When you test this mod at home (at your local server on your Pc), it is right that you become an error-messages like this: Error in email.php. You cant send on your local Pc emails  :wink: Online (on your webspace) this Mod runs correctly !!!

So I think that was all for the moment  :D
... and sorry for my english its not the best  :wink:

cu

tommy
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Mec4D on November 17, 2002, 12:10:59 AM
Vraxor and Tommy,

thank you so much..I changed already the codes and everything works perfect!

I was waiting for this module for long time and finaly you got this guys working!!!!!

Big Hugs! to both of you


Catharina
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Vraxor on November 17, 2002, 08:54:08 AM
Thanks a lot Tommy,

these last additions work great and I got a little messed up between the 2 diffent usernames ;-)

Cheers,
Vraxor
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Biggi on November 21, 2002, 01:31:20 PM
Thank you very, very much for this really helpful add-on! I just changed the codes and it works great! I'm raelly glad about it... - and I think my users feel the same...

Wishing you a happy day,

Biggi
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Biggi on December 01, 2002, 10:37:49 AM
Hi @all,

today I have a further question:

how could I manage it not only to show  the link to the comment, but further the comment itself in the e-mail? Is this possible?

Could someone show the code-changes? That would be great...

Have a nice day,

Biggi
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on December 01, 2002, 05:37:49 PM
but then, how would u know for witch picture was that coments?
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Biggi on December 01, 2002, 08:18:25 PM
I want the whole comment just in addition. The title of the image and the link should'nt be replaced. Just additional.

By the way: I'd like to change the notifies. I only need them, if a user commented, but NOT, if I answered to a comment.

My knowledge of PHP isn't good enough, so I would be glad if someone could help to realize my wishes.

Thanks,

Biggi
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Vraxor on December 01, 2002, 09:22:06 PM
HI Biggy,

I know it's not perfect right now and this results in a notify also beeing send when you post a comment on your own image. I could fix this by making an owner check in the comment system, but right now I just don't feel like coding too much and it's still too difficult for me to say it will be done in 10 minutes, in fact I don't know if I could do it at all.

About putting the comment into the mail, this might be possible. Only prob is that my PHP knowledge is too limited at the moment to say how. And right now I'm working on totally different things so I don't have time to figure it out. Maybe somebody else would like to improve the mod.

Cheers,
Vraxor
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Biggi on December 06, 2002, 04:57:38 PM
Hi Vraxor,
nevertheless I thank you for your answer. I know about the problem working on other projects and not having any time. You may say, I leased it  :wink:

Maybe some day somebody else could solve the problem...

Regards,

Biggi
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: uae on December 18, 2002, 01:08:10 PM
To have the Server Date and Time,

Add this line in your details.php

Code: [Select]
   $current_time = time();

Befor this

Code: [Select]

    include(ROOT_PATH.'includes/email.php');
    $site_email = new Email();
    $site_email->set_to($recipient_email);
    $site_email->set_from($config['site_email'], $config['site_name']);
    $site_email->set_subject("Comment Posted");
$site_email->set_subject($lang['send_comment_emailsubject']);
    $site_email->register_vars(array(
      "user_name" => $image_row['user_name'],
      "recipient_name" => $recipient_name,
      "image_name" => $image_row['image_name'],
      "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
      "site_name" => $config['site_name'],
      "image_url" => $image_url,
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();


So it should look like

Code: [Select]
           
    $current_time = time();
    include(ROOT_PATH.'includes/email.php');
    $site_email = new Email();
    $site_email->set_to($recipient_email);
    $site_email->set_from($config['site_email'], $config['site_name']);
    $site_email->set_subject("Comment Posted");
$site_email->set_subject($lang['send_comment_emailsubject']);
    $site_email->register_vars(array(
      "user_name" => $image_row['user_name'],
      "recipient_name" => $recipient_name,
      "image_name" => $image_row['image_name'],
      "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
      "site_name" => $config['site_name'],
      "image_url" => $image_url,
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();


Good Luck
Title: all works fine
Post by: HUNTER on December 18, 2002, 08:41:10 PM
but in the navigation bar i see this:

Home / Nature / Resource id #21

What is "Resource id #21"

before posting the comment nav bar looks like:

Home / Nature / TreeForest
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: HUNTER on January 03, 2003, 08:39:24 AM
anybody can help me??
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Vraxor on January 03, 2003, 09:34:13 AM
NO sorry, Hunter, I don't really understand that either, but maybe somebody else does. It aint a problem for me though.

Cheers,
Vraxor
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: HUNTER on January 03, 2003, 09:56:37 AM
ok...I will continiue waiting for someone else you can fix this, mod is really good, but buggy :(
Title: Revised
Post by: SLL on January 15, 2003, 11:06:49 PM
I've modified this nice MOD a bit... first of all, to get rid of those "Resource id #21", and second - to check, if user wants to recieve mails from admin. For this I've also added one field to User Profile, to let user choose himself, if he wans emails or not.

Code: [Select]
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------

    $recipient_name = $image_row['user_name'];
    $recipient_email = $image_row['user_email'];
    $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";

$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowemails = ($row['user_allowemails']);

if ($user_allowemails == 1) {
    $current_time = time();
    include(ROOT_PATH.'includes/email.php');
    $site_email = new Email();
    $site_email->set_to($recipient_email);
    $site_email->set_from($config['site_email'], $config['site_name']);
    $site_email->set_subject("Comment Posted");
    $site_email->register_vars(array(
      "recipient_name" => $recipient_name,
      "image_name" => $image_row['image_name'],
      "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
      "site_name" => $config['site_name'],
      "image_url" => $image_url,
    ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
}
//-------------------------------------------------------


Btw, the reason for "Resource id #" was using $image_name variable in sql query. I even removed these queries at all, because all necessary data alreary here, from the query at the very begining of page.

Add this table row to member_editprofile.html

Code: [Select]
         <tr>
            <td class="row2"><b>{lang_allow_emails}</b></td>
            <td class="row2">
              <input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
              {lang_no}</td>
          </tr>
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: HUNTER on January 16, 2003, 07:27:39 AM
Thanks for fixing, but I found in a member_profile.html some code as you type below

Code: [Select]

            <tr>
            <td class="row2"><b>{lang_allow_emails}</b></td>
            <td class="row2">
              <input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
              {lang_no}</td>
            </tr>


This is a default button for disabling recieving notifications from a admin? That already has in a user contol panel?
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: SLL on January 16, 2003, 10:43:33 AM
Quote from: HUNTER
Thanks for fixing, but I found in a member_profile.html some code as you type below


Sorry for confusion. I'm using 4blue_orange1 template, and just found out that for some reason this row was removed from template. Since you already have it in yours, you don't have to add anything..
Title: E-mail to al users who posted comments, too?
Post by: Kingofclasspix on February 07, 2003, 08:13:03 PM
Hi,

on my website, vistors often discuss in the comments.

So for me it would be very useful to have an email sent to everyone, who has posted a comment, not only to the owner of the image.

is this possible?

cya, Jörg
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Jasondavis on February 07, 2003, 10:14:43 PM
Hi for some reason the code SLL posted wont send me the email....maybe it's because I have removed the button on the user profile to disable them from picking? I would like to leave it removed from there profile but also have SLL code to work...any ideas?
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: SLL on February 07, 2003, 10:44:20 PM
Quote from: Jasondavis
I would like to leave it removed from there profile but also have SLL code to work...any ideas?

take away
Quote
if ($user_allowemails == 1) {
line and one "}" at the very bottom
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Jasondavis on February 07, 2003, 10:53:10 PM
thanks that worked, but gave me 1 more problem....the email it sent me said

{user_name}, instead of my username
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: SLL on February 07, 2003, 11:13:25 PM
That means you've modified something else in this file. Try original MOD code, which you can find in the beginning of this thread.
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Jasondavis on February 07, 2003, 11:31:13 PM
Quote from: SLL
That means you've modified something else in this file. Try original MOD code, which you can find in the beginning of this thread.


hmm confused I just started out fresh and it worked with the original code.  I then modified it and now is still doesnt insert the username...anymore ideas? Thanks

Also everything else worked fine, the
Resource id #21 is gone
it sends the email to me when I post a comment on an image i added
the image name is correct in the email and so it the date and time and everything....just wont replace {user_name} with my name which is Jason in my gallery
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: SLL on February 08, 2003, 10:43:27 AM
Change the template like this:
Quote
Dear {recipient_name}, ........
Title: thank you
Post by: Jasondavis on February 08, 2003, 10:50:44 AM
hi thank you so much it works great now
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Ernesto Taseffa on February 25, 2003, 05:43:06 PM
.
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Ernesto Taseffa on March 04, 2003, 10:46:11 AM
.
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: KleinerDrache on March 22, 2003, 11:02:58 PM
Da ich leider kein Englisch kann habe ich in diesem Thema ein wenig den Überblick verloren und würde mich freuen wenn jemand eine komplett neue Anleitung schreiben könnte.
Danke!!!

--------------------------------------------------

Since I know unfortunately no English have I in this topic a little the overview lost and if someone would be pleased a completely new guidance write could. Thanks!!!
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: SLL on March 23, 2003, 10:19:33 AM
Quote from: seffern
"Message-Id: <E18nhks-0002Fy-00@....."
Any ideas yet?


I believe this message id was added by your mail server and has nothing to do with 4images code
Title: Kommentartext und Überschrift mitsenden
Post by: Cancy on March 23, 2003, 04:58:27 PM
Um auch den Kommentar mit in der Mail anzuzeigen, habe ich das folgende so abgeändert:

Quote

   
       // Start Emailer für comments
    include(ROOT_PATH.'includes/email.php');
    $site_email = new Email();
    $site_email->set_to($recipient_email);
    $site_email->set_from($config['site_email'], $config['site_name']);
        $site_email->set_subject($lang['send_comment_emailsubject']);
    $site_email->register_vars(array(
      "user_name" => stripslashes($user_name),
            "recipient_name" => stripslashes($image_row['user_name']),
      "image_name" => $image_row['image_name'],
      "site_name" => $config['site_name'],
      "image_url" => $image_url,
      "comment_text" =>$comment_text,
      "comment_headline"=>$comment_headline,
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
    }
  }


{comment_headline}  und {comment_text} müssen jetzt nur noch in der comment_email.html eingefügt werden.
Title: Re: Kommentartext und Überschrift mitsenden
Post by: V@no on March 23, 2003, 05:00:04 PM
Quote from: Cancy
Um auch den Kommentar mit in der Mail anzuzeigen, habe ich das folgende so abgeändert:
...
{comment_headline}  und {comment_text} müssen jetzt nur noch in der comment_email.html eingefügt werden.

Nice!  :D
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: hoelzlmani on March 24, 2003, 03:12:28 PM
is it possible that only the webmaster get an email and not the owner of the picture? what must i change?
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: rustynet on March 26, 2003, 11:04:16 AM
(sorry for my english)
Maybe someone can help me,

i did integrated my 4images with invisionsboard, everythings works fine,
and i want to use this mod too.

thanks  :)
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: rustynet on March 26, 2003, 11:33:20 AM
O.K. I just did it,

anyway thank you very much.

boti :D
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Biggi on March 27, 2003, 12:28:05 AM
Hallo Cancy,
ich hab mich gerade sehr über Deine Nachricht gefreut, daß es eine Lösung für die Anzeige des Kommentares in der Mail gibt. Habe das auch gleich alles so geändert.

Leider erscheint bei mir überhaupt keine Änderung in der comment_email.html

details.php und {comment_text] in der comment_email.html sind drin. Woran könnte das liegen? Es müßte doch nun eigentlich klappen? Hast Du irgendeine Idee? Ich stehe vor einem Rätsel  :roll:

Viele Grüße, Biggi
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Cancy on March 27, 2003, 09:08:50 AM
Hm, seltsam...

Hier nochmal der komplette Block:

Quote
$sql = "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              ($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      $site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);
    $sql = "SELECT image_name FROM ".IMAGES_TABLE." WHERE image_id = $id";
    $image_name = $site_db->query($sql);
    $sql = "SELECT user_id FROM ".IMAGES_TABLE." WHERE image_id = $id";
    $user_id = $site_db->query($sql);
   
    $recipient_name = $image_row['user_name'];
    $recipient_email = $image_row['user_email'];
    $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
   
       // Start Emailer für comments
    include(ROOT_PATH.'includes/email.php');
    $site_email = new Email();
    $site_email->set_to($recipient_email);
    $site_email->set_from($config['site_email'], $config['site_name']);
        $site_email->set_subject($lang['send_comment_emailsubject']);
    $site_email->register_vars(array(
      "user_name" => stripslashes($user_name),
            "recipient_name" => stripslashes($image_row['user_name']),
      "image_name" => $image_row['image_name'],
      "site_name" => $config['site_name'],
      "image_url" => $image_url,
      "comment_text" =>$comment_text,
      "comment_headline"=>$comment_headline,
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
    }
  }
  unset($row);
  unset($spam_row);
}



und so sieht die comment_email.html bei mir aus:

Quote
Hallo {recipient_name},

{user_name} gab einen Kommentar zu deinem Bild "{image_name}" ab im {site_name}.

Kommentar:

{comment_headline}

{comment_text}

Hier kannst du den Kommentar ansehen: {image_url}

------
Mit freundlichen Grüssen,
{site_name}


Ich kann dir sonst beides (detail.php & comment_email.html) mal schicken wenn du möchtest.

Liebe Grüsse
Cancy
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Biggi on March 27, 2003, 11:22:40 PM
Juppiduppiduuuuuuuh  :D

Ich war gestern so spät etwas geistig umnachtet und habe die geänderte comment_email.html ständig ins template-Verzeichnis geladen, obwohl sie ja ins Verzeichnis lang/deutsch/email gehört :-)

Nun klappt es auch mit sämtlichen Nachbarn - äh - Kommentaren  :D

Vielen Dank nochmal für Deine Hilfsbereitschaft!

Übrigens: Deine Homepage ist toll gestaltet und es war sehr interessant, was man aus diesem Galerie-Skript machen kann!

Viele Grüße & gute Nacht,

Biggi
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Caelestis on March 28, 2003, 03:09:24 AM
any way to make it so that the user could choose wether to use this option or not?
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: SLL on March 28, 2003, 08:18:09 AM
sure. the user can select it he accepts or not mails from admin in his profile
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Caelestis on March 28, 2003, 03:03:18 PM
Quote from: SLL
sure. the user can select it he accepts or not mails from admin in his profile


If the user does this they won't recieve any e-mail sent by the admin though...
Title: Empty email
Post by: Chepe on March 29, 2003, 02:40:57 AM
Great addition but I am getting empty emails.

Anyone?

Chepe
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Biggi on March 30, 2003, 11:50:39 AM
Guten Morgen an alle,

Cancy hatte ja eine Möglichkeit geschaffen, den Text eines Kommentares gleich in der Benachrichtigungs-Email anzuzeigen. Das klappt alles wunderbar.

Nun würde ich gerne in der Benachrichtigung auch noch angezeigt haben, wie der letzte Kommentator bewertet hat. Ungefähr so:

Kommentartext hier

Bewertung: X Punkte

Kann mir bitte nochmals jemand behilflich sein? Wie könnte ich das in die Benachrichtigungsmail einbauen? Ich habe schon hin- und herprobiert, aber meine PHP-Kenntnisse reichen einfach nicht  :roll:  Ich würde mich sehr freuen, wenn jemand eine Lösung für mich hätte! Vielen Dank!

Biggi

------------------------------------------------------------------------------------

I'll try it in english:

Cancy had managed to show the whole comment-text to the owner of an image. It works fine!

Now I'd like to show the rating of the last user who commented too.  For example this way:

Comment-text here

Rating: x Points

I'd be happy if someone could post a solution for this, because I cannot manage ist by myself.  Thanks in advance!
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Biggi on March 30, 2003, 12:07:34 PM
Hat sich erledigt. Danke! Lösung poste ich gleich noch.

I've managed it. Solution followes in a few minutes...
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Biggi on March 30, 2003, 12:33:41 PM
Und hier die Lösung, wie man in der Benachrichtigungsmail zusätzlich zum Kommentar-Text auch die Bewertung des letzten Kommentators mit anzeigt:

Here's the solution:

Suche in der details.php:
Search in details.php:


Code: [Select]
"comment_text" =>$comment_text,
"comment_headline"=>$comment_headline,


Füge in der nächsten Zeile ein:
Add in next line:


Code: [Select]
"rating" => $rating,


Ergänze in der comment_email.html:
Add in comment_email.html:


Code: [Select]
Bewertung:  {rating} Punkte

oder in Englisch:

Voting:  {rating} Points


That's it.

Viele Grüße, Biggi
Title: Something I never noticed before.
Post by: lakeside on April 24, 2003, 05:04:59 AM
After adding this mod, I notice after I add a comment to a photo that on the page that comes up after adding the comment, the photo is listed as:
Resource id #29
I've never noticed this before.  If I go to a fresh image before adding a comment, it lists the photo name, but after adding a comment it lists it as
Resource id #29  the 29 can be replaced by another number depending on the image.  Anyway to fix this?
Title: Re: Something I never noticed before.
Post by: V@no on April 24, 2003, 03:26:57 PM
Quote from: lakeside
After adding this mod, I notice after I add a comment to a photo that on the page that comes up after adding the comment, the photo is listed as:
Resource id #29
I've never noticed this before.  If I go to a fresh image before adding a comment, it lists the photo name, but after adding a comment it lists it as
Resource id #29  the 29 can be replaced by another number depending on the image.  Anyway to fix this?

I think u didnt read throught the replys ;)

from the MOD code delete top four lines:
Code: [Select]
$sql = "SELECT image_name FROM ".IMAGES_TABLE." WHERE image_id = $id";
    $image_name = $site_db->query($sql);
    $sql = "SELECT user_id FROM ".IMAGES_TABLE." WHERE image_id = $id";
    $user_id = $site_db->query($sql);
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Lucifix on May 06, 2003, 06:05:09 PM
Is it possible to set that members will set if they want email notification or not?

Like in settings...?
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on May 06, 2003, 06:37:35 PM
yes ;)
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Lucifix on May 06, 2003, 06:38:19 PM
hehe V@no.... this is a tip right??? :D
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on May 06, 2003, 06:51:09 PM
ok, chose:
1. only image owners can chose receive or not emails on new posted comments
2. any registered members can "subscribe" for any images they want, to receive emails on new posted comments.

the first variant is already exist (no offical mods though), u can see it at my site ;)

the second variant is not exist (I'm not aware of), but I was thinking to make it sometimes today.
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Lucifix on May 06, 2003, 07:16:30 PM
you are right, you have this function when you want to add photo to your page. But saidly i couldn't find instruction how to install that mode  :cry:
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Lucifix on May 21, 2003, 09:05:41 AM
v@no: i saw on your page, that you can check box where you can choose between reciving notification or not (its in UPLOAD section). But where or how did you set this?
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Shard on May 27, 2003, 10:01:13 AM
I really wanna get this MOD goin' in my gallery. I had everything set up but I'd get a returned E-mail everytime some posted a comment. It said there was no recipient specified. I also noticed that in these returned E-mails the usernames weren't showing up in the Dear ______, area. I've got my gallery integrated in to PHPnuke and I think it may have something to do with some different mysql calls. What table is it pulling user_name and user_email from?
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on May 27, 2003, 10:20:12 AM
Quote from: Shard
What table is it pulling user_name and user_email from?
Whatever is specifyed in /includes/constants.php
define('USERS_TABLE' ,  blah blah);
Title: [Mod] Mail Owner of image when Comment is Posted
Post by: Shard on May 27, 2003, 03:12:21 PM
That makes sense. Will it also use the modified row names for that table that I have set in sessions.php? I mean, is it looking specifically for rows called user_name and User_email or will it go to sessions.php to pull the correct row names?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: deinsternchen on March 16, 2005, 04:06:00 PM
Halli hallo,

also ich bin ganz neu hier und irgendwie komm ich nicht klar *heul*

Also ich hab das ganze jetzt mal so geändert und auch in den richtigen Verzeichnisen abgelegt. Ich bekomme aber keine Email *heul*

Ich habe allerdings unter den Bildern den usernamen entfernt, da es ja nur meine Bilder sind. Liegt das daran??? Wenn nicht, kann mir dann bitte jemand helfen - bevor ich meinen PC zum Fenster raus werfe.

Danke schon mal im voraus.

Sternchen
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: vid_88 on March 21, 2005, 02:47:07 PM
Hm, seltsam...

Hier nochmal der komplette Block:

Quote
$sql = "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              ($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      $site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);
    $sql = "SELECT image_name FROM ".IMAGES_TABLE." WHERE image_id = $id";
    $image_name = $site_db->query($sql);
    $sql = "SELECT user_id FROM ".IMAGES_TABLE." WHERE image_id = $id";
    $user_id = $site_db->query($sql);
   
    $recipient_name = $image_row['user_name'];
    $recipient_email = $image_row['user_email'];
    $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
   
       // Start Emailer für comments
    include(ROOT_PATH.'includes/email.php');
    $site_email = new Email();
    $site_email->set_to($recipient_email);
    $site_email->set_from($config['site_email'], $config['site_name']);
        $site_email->set_subject($lang['send_comment_emailsubject']);
    $site_email->register_vars(array(
      "user_name" => stripslashes($user_name),
            "recipient_name" => stripslashes($image_row['user_name']),
      "image_name" => $image_row['image_name'],
      "site_name" => $config['site_name'],
      "image_url" => $image_url,
      "comment_text" =>$comment_text,
      "comment_headline"=>$comment_headline,
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
    }
  }
  unset($row);
  unset($spam_row);
}


und so sieht die comment_email.html bei mir aus:

Quote
Hallo {recipient_name},

{user_name} gab einen Kommentar zu deinem Bild "{image_name}" ab im {site_name}.

Kommentar:

{comment_headline}

{comment_text}

Hier kannst du den Kommentar ansehen: {image_url}

------
Mit freundlichen Grüssen,
{site_name}

Ich kann dir sonst beides (detail.php & comment_email.html) mal schicken wenn du möchtest.

Liebe Grüsse
Cancy

Can someone please translate this into English for me? This is exactly what I need!
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: flash7 on March 30, 2005, 01:46:03 PM
Hello,

I've a problem because my USERS_TABLE is on vbulletin, $image_row['user_name'] and $image_row['user_email'] don't work!
Who can I do?

Thanks
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Vraxor on March 30, 2005, 07:29:40 PM
Hey Flash7,

I have no idea how Vbulletin names these table fields, but you should look for those fields in the database and edit them in php accordingly.

So if Vbulletin has a table field like username instead of user_name, you should change $image_row['user_name'] to $image_row['username']

Same for user_email.

Hope this helps.

Cheers,
Vraxor
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: flash7 on March 30, 2005, 09:48:53 PM
Vraxor,

thank you...now work  :)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: GooSe_1977 on April 28, 2005, 01:37:54 PM
Hmm, hab das mal grad gemacht, aber irgendwie kriege ich keine e-mail ???
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Michael on May 22, 2005, 07:07:28 PM
Gibt es eine Möglichkeit, den User über neue Anmerkungen zu den Fotos zu informieren zu denen er bereits eine Anmerkung verfasst hat?
Noch besser wäre es wenn sich jeder User per Klick selber aussuchen könnte ob er eine
Benachrichtigun erhält sobald ein Kommentar zu dem ausgewählten Bild geschrieben wurde.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Is there a possibilty to inform users with e-mail if there are further comments at photos they`ve already commented.
So they can make discussions .Even better it would be if a user can choose by click at a button if he wants to be informed and by a click of a button he
could see if a new comment has been written to the photo.
I hope you understand what i mean.
Also other solutions in that way are o.k.



Gruß, Michael
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: maziggy on June 22, 2005, 05:34:33 PM
ok, chose:
1. only image owners can chose receive or not emails on new posted comments
2. any registered members can "subscribe" for any images they want, to receive emails on new posted comments.

the first variant is already exist (no offical mods though), u can see it at my site ;)

the second variant is not exist (I'm not aware of), but I was thinking to make it sometimes today.

I'm highly interested in those two functions. Is there a solution available in the meantime ?

Thanks, Martin
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: marod0er on June 24, 2005, 08:48:19 PM
This is a great MOD for people with much material belonging to people who sends in stuff! Like me! :D
Thanks
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Pitt on July 06, 2005, 04:31:03 PM
Code: [Select]
Nun würde ich gerne in der Benachrichtigung auch noch angezeigt haben, wie der letzte Kommentator bewertet hat. Ungefähr so:

Kommentartext hier

Bewertung: X Punkte

Das funzt aber so nicht, denn Bewertung und Kommentar lassen sich ja nicht zusammen absenden, sondern geht ohne einen zusätzlich Hack nur einzeln...
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: KSB-JiMbO on July 15, 2005, 12:28:52 PM
Hi,

THX very nice MOD!!  :mrgreen:
Is there any possibility to send the email and a pm via postnuke?
Would be great...

Greetz and THX,
JiMbO
Title: Re: Revised
Post by: JensF on July 22, 2005, 12:23:34 AM
I've modified this nice MOD a bit... first of all, to get rid of those "Resource id #21", and second - to check, if user wants to recieve mails from admin. For this I've also added one field to User Profile, to let user choose himself, if he wans emails or not.

Code: [Select]
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------

    $recipient_name = $image_row['user_name'];
    $recipient_email = $image_row['user_email'];
    $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";

$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowemails = ($row['user_allowemails']);

if ($user_allowemails == 1) {
    $current_time = time();
    include(ROOT_PATH.'includes/email.php');
    $site_email = new Email();
    $site_email->set_to($recipient_email);
    $site_email->set_from($config['site_email'], $config['site_name']);
    $site_email->set_subject("Comment Posted");
    $site_email->register_vars(array(
      "recipient_name" => $recipient_name,
      "image_name" => $image_row['image_name'],
      "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
      "site_name" => $config['site_name'],
      "image_url" => $image_url,
    ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
}
//-------------------------------------------------------

Btw, the reason for "Resource id #" was using $image_name variable in sql query. I even removed these queries at all, because all necessary data alreary here, from the query at the very begining of page.

Add this table row to member_editprofile.html

Code: [Select]
         <tr>
            <td class="row2"><b>{lang_allow_emails}</b></td>
            <td class="row2">
              <input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
              {lang_no}</td>
          </tr>

Hello,

i have put in this Code. But now i have user_allowemails Code in my file to become Mails from Admin yes or no.

Now i have change the Code. I have change all user_allowemails to user_allowmailcomments and i have made a table in .users called user_allowmailcomments .

My new code is this one

Details.php

Code: [Select]
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------

   $recipient_name = $image_row['user_name'];
   $recipient_email = $image_row['user_email'];
   $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";

$sql = "SELECT user_allowmailcomments FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowmailcomments = ($row['user_allowmailcomments']);

if ($user_allowmailcomments == 1) {
   $current_time = time();
   include(ROOT_PATH.'includes/email.php');
   $site_email = new Email();
   $site_email->set_to($recipient_email);
   $site_email->set_from($config['site_email'], $config['site_name']);
   $site_email->set_subject("Kommentar geschrieben - Coment Posted");
   $site_email->register_vars(array(
     "recipient_name" => $recipient_name,
     "image_name" => $image_row['image_name'],
     "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
     "site_name" => $config['site_name'],
     "image_url" => $image_url,
   ));
   $site_email->set_body("comment_email", $config['language_dir']);
   $site_email->send_email();
}
//-------------------------------------------------------

and in member_editprofile.htm this

Code: [Select]
<tr>
           <td class="row2"><b>{lang_user_allowmailcomments}</b></td>
           <td class="row2">
             <input type="radio" name="user_allowmailcomments" value="1"{user_allowmailcomments_yes} />
             {lang_yes}&nbsp;&nbsp;&nbsp;
             <input type="radio" name="user_allowmailcomments" value="0"{user_allowmailcomments_no} />
             {lang_no}</td>
         </tr>

But now i see this a i can´t save...

(http://www.terraristik-galerie.de/sonstiges/yesno.gif)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: CEGRAPHIX on July 25, 2005, 12:27:50 AM
uh k......i'm gonna cry...or scream...whichever feels better...lol

i un get it....

i added info to details.php and uploaded the comment_email.html template....but....I STILL dont get emails when i test out comments on my own images....

it's supposed to email me even if I comment on myown photo right?

any ideas as to why i wouldnt get the email *i've tried using a different email address also*
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Toasti on August 24, 2005, 01:12:09 PM
ich habe noch ein weiteres problem: 
nun werden bei mir jeweils mit einem abgegebenen kommentar zwei gleiche kommentare unter dem bild ausgegeben. 
 
was ist da zu tun?


====== translate in bad english :-( =======
I still have another problem: 
now, two same commentaries becomes form spent with me with a submitted commentary under him/it in each case. 
 
what is to be done there?


the part of my details.php:
Code: [Select]
//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------
$error = 0;
if ($action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
  $id = intval($HTTP_POST_VARS[URL_ID]);
  $sql = "SELECT cat_id, image_allow_comments
          FROM ".IMAGES_TABLE."
          WHERE image_id = $id";
  $row = $site_db->query_firstrow($sql);

  if ($row['image_allow_comments'] == 0 || !check_permission("auth_postcomment", $row['cat_id']) || !$row) {
    $msg = $lang['comments_deactivated'];
  }
  else {
    $user_name = un_htmlspecialchars(trim($HTTP_POST_VARS['user_name']));
    $comment_headline = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
    $comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));

    // Flood Check
    $sql = "SELECT comment_ip, comment_date
            FROM ".COMMENTS_TABLE."
            WHERE image_id = $id
            ORDER BY comment_date DESC
            LIMIT 1";
    $spam_row = $site_db->query_firstrow($sql);
    $spamtime = $spam_row['comment_date'] + 180;

    if ($session_info['session_ip'] == $spam_row['comment_ip'] && time() <= $spamtime && $user_info['user_level'] != ADMIN)  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['spamming'];
      $error = 1;
    }

    $user_name_field = get_user_table_field("", "user_name");
    if (!empty($user_name_field)) {
      if ($site_db->not_empty("SELECT $user_name_field FROM ".USERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("", "user_id")." <> '".$user_info['user_id']."'")) {
        $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
        $error = 1;
      }
    }
    if ($user_name == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
      $error = 1;
    }
    if ($comment_headline == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['headline_required'];
      $error = 1;
    }
    if ($comment_text == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['comment_required'];
      $error = 1;
    }

    if (!$error)  {
      $sql = "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              ($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      $site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);
 $sql = "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              ($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      $site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);
   
    $recipient_name = $image_row['user_name'];
    $recipient_email = $image_row['user_email'];
    $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
   
       // Start Emailer für comments
    include(ROOT_PATH.'includes/email.php');
    $site_email = new Email();
    $site_email->set_to($recipient_email);
$site_email->set_subject("Neuer Kommentar");
    $site_email->set_from($config['site_email'], $config['site_name']);
   
    $site_email->register_vars(array(
      "user_name" => stripslashes($user_name),
            "recipient_name" => stripslashes($image_row['user_name']),
      "image_name" => $image_row['image_name'],
      "site_name" => $config['site_name'],
      "image_url" => $image_url,
      "comment_text" =>$comment_text,
      "comment_headline"=>$comment_headline,
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
    }
  }
  unset($row);
  unset($spam_row);
}
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Toasti on August 25, 2005, 01:27:06 PM
keiner eine idee?

vielleicht nochmal etwas ausführlicher:
wenn  ich den mod so einbaue und dann einen kommentar schreibe, erscheint dieser doppelt unter dem bild.
email, etc klappt alles wunderbar.


no one an idea? 
 
maybe again somewhat more detailed: 
if I install the mod so and then write a commentary, this appears doubly under him/it forms. 
email, etc turns wonderfully all.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Xyu BAM on August 25, 2005, 02:56:23 PM
did u install this mod?
http://www.4homepages.de/forum/index.php?topic=7294.0
if so, it has a bug in the installation instructions, which causes double comments.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Toasti on August 25, 2005, 03:08:00 PM
no i don't.
i have only install this mail owner mod on the galleryversion 1.7
with the original details.php => i have no problems
with the new details.php (see my code on page 5) => have double comments under a picture and a email

i search in this forum for double comments, but nobody have this problem ???

Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Toasti on August 26, 2005, 02:45:15 PM
forgot it... 
a double line was responsible  :lol:
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Nasser on October 27, 2005, 11:46:52 AM
great MOD thank you
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: MadeInUSSR on December 13, 2005, 11:53:28 AM
I have changed deatils.php and created comment_email.html then I tested it by posting comments. but nothing works..  e-mails were not recieved.. what to do?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on December 13, 2005, 02:41:49 PM
is you email system works ok? can you send emails via ACP and via members email page?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: MadeInUSSR on December 14, 2005, 06:01:28 AM
 :oops: strange today it worked (may be because I used fresh brain).. anyway thanx for good MOD
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: fgallery on January 21, 2006, 02:03:29 AM
Why admins do not receive comments for their images?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 21, 2006, 02:10:36 AM
[EDITED]

It turns out the $site_sess string is not needed from the $image_links since the SESSIONID is clearly not necessary. ;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on January 21, 2006, 04:36:50 AM
Why admins do not receive comments for their images?
Only admins? have you tested it with regular member(s) or more then one admin account with VALID email address?

[ Unrelated to the question above ] but did found some things unusual :
No, its not. Why would you need attach sessionid into emails?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 21, 2006, 04:39:41 AM
Ok V@no. I bolded what I modified above.  :roll:
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on January 21, 2006, 04:47:25 AM
Ok V@no. I bolded what I modified above. :roll:
I saw the difference, and my responce above is the same as the following:
Quote
Why would you need attach sessionid into emails?
Your changes do exactly that - ensure that sessionid attached to the url if no cookies used.
The query changes is just....c'mon! what next? tabulation corrections? :roll:
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 21, 2006, 04:50:04 AM
Quote

your changes do exactly that - ensure that sessionid attached to the url if no cookies used.
The query changes is just....c'mon! what next? tabulation corrections?


Then if you did noticed the difference, it is clairly you did not see the very first post on this topic since I only modified the $image_link in order to be used with $site_sess and simply made a slight modification to the SQL statements. The rest was made by the author himself.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on January 21, 2006, 04:54:52 AM
I only modified the $image_link in order to be used with $site_sess
THAT IS MY POINT!!!
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 21, 2006, 05:01:12 AM
Well, I do not see ANYWHERE ABOVE that you were talking about the $image_link. You only, as usual, questionned my modification without any specifics.  :?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on January 21, 2006, 05:05:34 AM
So, you are a robot! or a bot? You dont understand if one tells you a clue, and not pointing directly to the issue...very narrow minded...

whatever. Just be quiet, please.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: fgallery on January 21, 2006, 06:56:49 PM
Why admins do not receive comments for their images?
Only admins? have you tested it with regular member(s) or more then one admin account with VALID email address?
Nevermind V@no I've found the problem.
Now another question to the MOD'S author:
Can I disable notification on comments made by myself?
I mean I don't want to receive my own comments.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on January 21, 2006, 07:15:09 PM
I'd suggest you using this code instead:
http://www.4homepages.de/forum/index.php?topic=2705.msg14792#msg14792
then replace
Code: [Select]
if ($user_allowemails == 1) {with:
Code: [Select]
if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: fgallery on January 22, 2006, 01:43:07 AM
I'd suggest you using this code instead:
http://www.4homepages.de/forum/index.php?topic=2705.msg14792#msg14792
then replace
Code: [Select]
if ($user_allowemails == 1) {with:
Code: [Select]
if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
Wow V@no! It works!
Thank you.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: fgallery on January 22, 2006, 02:51:32 AM
[EDITED]
All right I've made all corrections specified above & below (till this reply (http://www.4homepages.de/forum/index.php?topic=2705.msg58214#msg58214")) and the final code was (it works  :wink: ):
Code: [Select]
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
   $recipient_name = $image_row['user_name'];
   $recipient_email = $image_row['user_email'];
   $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;

   $sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
   $result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);
   $user_allowemails = ($row['user_allowemails']);

   if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
   include(ROOT_PATH.'includes/email.php');
   $site_email = new Email();
   $site_email->set_to($recipient_email);
   $site_email->set_from($config['site_email'], $config['site_name']);
   $site_email->set_subject($lang['send_comment_emailsubject']);
   $site_email->register_vars(array(
     "user_name" => stripslashes($user_name),
     "recipient_name" => stripslashes($image_row['user_name']),
     "image_name" => $image_row['image_name'],
     "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
     "site_name" => $config['site_name'],
     "image_url" => $image_url,
     "comment_text" =>(stripslashes($comment_text)),
     "comment_headline"=>(stripslashes($comment_headline)),
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
    }
    }
  }
 unset($row);
 unset($spam_row);
}

Don't forget to add:
Code: [Select]
$lang['send_comment_emailsubject'] = "COMMENT_NOTIFICATION_SUBJECT_HERE";
to /lang/language/main.php

PS.It will also disable sending you your own comments.

Perhaps I'd be useful for someone ...
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 22, 2006, 03:00:42 AM
@fgallery:

Looks good. However, these two lines :

Quote

$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";

$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";


could also simply be stated like this :

Quote

$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;

$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;


;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: fgallery on January 22, 2006, 03:05:05 AM
@fgallery:

Looks good. However, these two lines :

Quote

$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";

$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";


could also simply be stated like this :

Quote

$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;

$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;


;)
Does it make any difference?
Sorry, I'm not a coder :)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 22, 2006, 03:10:49 AM
@fgallery:

Well, if you compare both of these quotes, you can see there are more " with your strings.

Example :

Quote

URL_IMAGE_ID."=".$id."";


when it could simply be :

Quote

URL_IMAGE_ID."=".$id;


since there are no beginning with == > "  < == after the "= (equality) ". ;)

As for :

Quote

".get_user_table_field("", "user_name")."


Yes, there is since the user_name field is not an additional user field but a core field from the USERS_TABLE. ;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: fgallery on January 22, 2006, 03:21:31 AM
I've upadated my full code, thanks!

PS.I thought your corrections would also fix this problem:
If I write for e.g. testin' in Hedline and/or Comment I'll receive it as testin\'
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 22, 2006, 03:23:15 AM
Quote

If I write for e.g. testin' in Hedline and/or Comment I'll receive it as testin\'


In your codings, make sure that the related query $HTTP_POST_VARS contains the stripslashes module with it. ;)

If you're not sure where exacly this line might be in the code (and if the code itself is NOT too big) please post it here as I will take a look at it. ;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 22, 2006, 03:26:44 AM
Update :

I found it. You're probably talking about this line :

Quote

"comment_headline"=>$comment_headline,


change it to :

Code: [Select]

"comment_headline"=>(stripslashes($comment_headline)),


;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: fgallery on January 22, 2006, 03:32:05 AM
Update :

I found it. You're probably talking about this line :

Quote

"comment_headline"=>$comment_headline,


change it to :

Code: [Select]

"comment_headline"=>(stripslashes($comment_headline)),


;)
I guess I should do the same with 'comment_text'.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 22, 2006, 03:34:26 AM
Quote

I guess I should do the same with 'comment_text'.


Precisely. 8)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: JensF on January 22, 2006, 09:39:54 PM
[EDITED]
All right I've made all corrections specified above & below (till this reply (http://www.4homepages.de/forum/index.php?topic=2705.msg58214#msg58214")) and the final code was (it works  :wink: ):
Code: [Select]
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
   $recipient_name = $image_row['user_name'];
   $recipient_email = $image_row['user_email'];
   $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;

   $sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
   $result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);
   $user_allowemails = ($row['user_allowemails']);

   if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
   include(ROOT_PATH.'includes/email.php');
   $site_email = new Email();
   $site_email->set_to($recipient_email);
   $site_email->set_from($config['site_email'], $config['site_name']);
   $site_email->set_subject($lang['send_comment_emailsubject']);
   $site_email->register_vars(array(
     "user_name" => stripslashes($user_name),
     "recipient_name" => stripslashes($image_row['user_name']),
     "image_name" => $image_row['image_name'],
     "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
     "site_name" => $config['site_name'],
     "image_url" => $image_url,
     "comment_text" =>(stripslashes($comment_text)),
     "comment_headline"=>(stripslashes($comment_headline)),
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
    }
    }
  }
 unset($row);
 unset($spam_row);
}

Don't forget to add:
Code: [Select]
$lang['send_comment_emailsubject'] = "COMMENT_NOTIFICATION_SUBJECT_HERE";
to /lang/language/main.php

PS.It will also disable sending you your own comments.

Perhaps I'd be useful for someone ...

What do this??? Mail at new comments on/off???
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on January 22, 2006, 10:39:01 PM
No, it ensures that you wont receive email when you post a comment to your own images and that only people who choosed to receive email from administrators will get notifyed. (if they choosed not to receive emails from admin, they wont receive emails about new comments either)

P.S. thinking again, yes, its kind of on/off switch ;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: JensF on January 23, 2006, 01:21:44 AM
OK :)

and now for a dummy...

When i insert this in my details.php

Quote
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------

then i turn on/off mail by new comments for my own pics with the Receive emails from administrators Function and when i comment my own pic i don´t become a mail????

What is with other comments from other users. When i write a comment to a pic from an other user i become a mail when another one write a comment, too???

and why this

Quote
$lang['send_comment_emailsubject'] = "COMMENT_NOTIFICATION_SUBJECT_HERE";

i have insert this in my main.php but see nothing ???

Sorry for this stupid questions but i don´t understand this big topic...

*EDIT*

When i write a comment i become this error message

Code: [Select]
DB Error: Bad SQL Query: SELECT user_allowemails FROM bildergalerie_users WHERE user_name = JensF
Unknown column 'JensF' in 'where clause'
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: fgallery on January 23, 2006, 01:44:14 AM
@JensF

1)Open details.php and find:
Code: [Select]
     $site_db->query($sql);
     $commentid = $site_db->get_insert_id();
     update_comment_count($id, $user_info['user_id']);

Add after:
Code: [Select]
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
   $recipient_name = $image_row['user_name'];
   $recipient_email = $image_row['user_email'];
   $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;

   $sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
   $result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);
   $user_allowemails = ($row['user_allowemails']);

   if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
   include(ROOT_PATH.'includes/email.php');
   $site_email = new Email();
   $site_email->set_to($recipient_email);
   $site_email->set_from($config['site_email'], $config['site_name']);
   $site_email->set_subject($lang['send_comment_emailsubject']);
   $site_email->register_vars(array(
     "user_name" => stripslashes($user_name),
     "recipient_name" => stripslashes($image_row['user_name']),
     "image_name" => $image_row['image_name'],
     "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
     "site_name" => $config['site_name'],
     "image_url" => $image_url,
     "comment_text" =>(stripslashes($comment_text)),
     "comment_headline"=>(stripslashes($comment_headline)),
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
    }

Be sure to add this before:
Code: [Select]
   }
 }
 unset($row);
 unset($spam_row);
}

//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------

2)Create file called comment_email.html, put this code into the file:
Code: [Select]
Dear {recipient_name},

{user_name} posted a comment on {image_name} at {site_name}.
To view the comment go to: {image_url}

------
Best regards, {site_name}
Upload comment_email.html to /lang/language/email/.

3)Open /lang/language/main.php and find:
Code: [Select]
$lang['post_comment'] = "post comment";

Add after:
Code: [Select]
$lang['send_comment_emailsubject'] = "COMMENT_NOTIFICATION_SUBJECT_HERE";
Replace COMMENT_NOTIFICATION_SUBJECT_HERE to whatever you want to appear in mail subject.

4)Open /templates/template/member_editprofile.html & add this code to the right place.
Code: [Select]
         <tr>
           <td class="row2"><b>{lang_allow_emails}</b></td>
           <td class="row2">
             <input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
             {lang_yes}&nbsp;&nbsp;&nbsp;
             <input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
             {lang_no}</td>
         </tr>
This switch will allow users to enable or disable comments notification.

I can translate this instruction into deutsch but I hope it's clear enough ;)

@Vraxor
Perhaps you could update install instructions and delete all confusing comments ;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 23, 2006, 01:56:24 AM
@fgallery:

That's right. Good to know you got it covered. ;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: JensF on January 23, 2006, 11:50:04 PM
Thanks fgallery but i become this error when i write a comment

Code: [Select]
DB Error: Bad SQL Query: SELECT user_allowemails FROM bildergalerie_users WHERE user_name = JensF
Unknown column 'JensF' in 'where clause'
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 23, 2006, 11:54:40 PM
@JensF:

I might be wrong but it seems to me you're using mySQL 5 right ? ;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: JensF on January 23, 2006, 11:58:27 PM
@JensF:

I might be wrong but it seems to me you're using mySQL 5 right ? ;)

Yes, i´m using 4.1.15-Debian_0.dotdeb.0-log. Is there a problem with it???

*EDIT*

you have edit your post :D
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 24, 2006, 12:01:40 AM
Quote

Yes, i´m using 4.1.15-Debian_0.dotdeb.0-log. Is there a problem with it???


According to me - no. If you did installed the patches from the troubleshooting section of the forum and did applied the steps correctly, there shouldn't be anymore problems left. ;)

Quote

*EDIT*

you have edit your post Very Happy


Doh ! too slow.  :oops:
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 24, 2006, 12:08:53 AM
Update:

I just noticed I might of made a slight mistake.

To be sure,

replace this line :

Quote

$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;


with this one :

Code: [Select]

$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = '".$recipient_name."'";


Then, test your action again to see if the SQL error message is gone. ;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: JensF on January 24, 2006, 12:18:29 AM
Sorry, when i do this changes i become ablank page when i click on an image...

Quote
If you did installed the patches from the troubleshooting section of the forum and did applied the steps correctly, there shouldn't be anymore problems left

Which one you mean. I have take a look and i thing i have installed all the important fixes...
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 24, 2006, 12:34:00 AM
Quote

Sorry, when i do this changes i become ablank page when i click on an image...


Fixed from the post above. Try it now. ;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: JensF on January 24, 2006, 01:20:15 AM
Hi,

thanks for this. Now it works. No error message, User becomes Mail (or not ;) ).... Great!!!

But i have hope that all User become a Mail to the image they have write a comment....but its now for the owner... IT´S OK !!!!

But a little Problem i have found..I don´t now is it a problem with this Mod...

Now when i send a Newsletter (same function allowemail) every user become get 2 newsletters (2 mails)....bevor this mod the users become get one of them....
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: mawenzi on January 24, 2006, 01:35:00 AM
@JensF
become = werden (nicht bekommen)
get = erhalten
ich frag mich schon warum deine User mit diesem MOD jetzt alle Newsletter werden ...  :mrgreen:
nichts für ungut ... ist nur ein spaßiger Tipp !
(P.S. die neue Forenübersicht für die index.php folgt noch ! )
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: JensF on January 24, 2006, 01:41:56 AM
@JensF
become = werden (nicht bekommen)
get = erhalten
ich frag mich schon warum deine User mit diesem MOD jetzt alle Newsletter werden ...  :mrgreen:
nichts für ungut ... ist nur ein spaßiger Tipp !
(P.S. die neue Forenübersicht für die index.php folgt noch ! )


Naja, wie man in meiner Signatur ja sehen kann

Quote
-> Sorry for my bad English <-

bin ich nicht so gut im englischen aber bisher bin ich immer damit durchgekommen  8)

Das mit der Forenübersicht wäre klasse...Danke schonmal.

P.S. Hab meinen Beitrag geändert  :roll:
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 24, 2006, 01:58:39 AM
Quote

Hi,

thanks for this. Now it works. No error message, User becomes Mail (or not Wink ).... Great!!!


Outstanding. My sincere apologize for this error.

Quote

Now when i send a Newsletter (same function allowemail) every user become get 2 newsletters (2 mails)....bevor this mod the users become get one of them....


I can't say on this one, I do not have the newsletter MOD installed ... was it ever completed after all ? After I checked from a specific topic, the MOD wasn't completed ...

Quote

@JensF
become = werden (nicht bekommen)
get = erhalten
ich frag mich schon warum deine User mit diesem MOD jetzt alle Newsletter werden ...  Mr. Green
nichts für ungut ... ist nur ein spaßiger Tipp !
(P.S. die neue Forenübersicht für die index.php folgt noch ! )


Weeeeee ! finally someone who takes care to make grammar corrections on this forum. :lol:
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: JensF on January 24, 2006, 09:46:27 AM
Quote
I can't say on this one, I do not have the newsletter MOD installed ... was it ever completed after all ? After I checked from a specific topic, the MOD wasn't completed ...

I mean the normal send eMail function from the galery...
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: TheOracle on January 25, 2006, 12:43:19 AM
And when you do not send any e-mails from the newsletter, but elsewhere on 4images, does it send twice or they all send twice ?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: NTH on March 30, 2006, 08:00:32 PM
Hi!
Plz help me.
This is my problem:

When the gallery send the mail owner, this image link appear.
http://myhost.com:81/details.php?image_id=3838

How can I may be take the 81 port?
I'd like this link to image link the mail:
http://myhost.com/details.php?image_id=3838
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: macwise7 on March 31, 2006, 09:23:28 PM
Ok, Jensf, I am going to need a little assistance here.  I tried to modify my code so that the user could choose whether or not he would accept email when a new comment is made, instead of just choosing whether or not to accept email from admin.  It seems to be working ok, but with my lack of knowledge in PHP, I cannot seem to get the option to display right in the member_editprofile.html file.  When I load up the members control panel page, I can see the radio buttons, but I cannot see the text that states what the buttons are for.  Also, even though I select the yes button, when I click on save, and the page reloads, it states at the top that my profile was updated, but the radio buttons are now both blank.  I did add the table to mysql for called user_allowmailcomments.  It was set to tinyint with a value/length of 1.  I am completely beside myself trying to understand why the text doesn't show up.

Here is my code:

member_editprofile.html:
Code: [Select]
         <tr> 
           <td class="head1"><b>{lang_allowmailcomments}</b></td>
           <td class="head1">
             <input type="radio" name="user_allowmailcomments" value="1"{user_allowmailcomments_yes} />
             {lang_yes}&nbsp;&nbsp;&nbsp;
             <input type="radio" name="user_allowmailcomments" value="0"{user_allowmailcomments_no} />
             {lang_no}</td>
          </tr>

lang/english/main.php:
Code: [Select]
$lang['allowmailcomments'] = "Email me:";

and details.php:
Code: [Select]
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
   $recipient_name = $image_row['user_name'];
   $recipient_email = $image_row['user_email'];
   $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;

   $sql = "SELECT user_allowmailcomments FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = '".$recipient_name."'";
$result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);
   $user_allowmailcomments = ($row['user_allowmailcomments']);

   if ($image_row['user_id'] != $user_info['user_id'] && $user_allowmailcomments == 1) {
   $current_time = time();
   include(ROOT_PATH.'includes/email.php');
   $site_email = new Email();
   $site_email->set_to($recipient_email);
   $site_email->set_from($config['site_email'], $config['site_name']);
   $site_email->set_subject($lang['send_comment_emailsubject']);
   $site_email->register_vars(array(
     "user_name" => stripslashes($user_name),
     "recipient_name" => stripslashes($image_row['user_name']),
     "image_name" => $image_row['image_name'],
     "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
     "site_name" => $config['site_name'],
     "image_url" => $image_url,
     "comment_text" =>(stripslashes($comment_text)),
     "comment_headline"=>(stripslashes($comment_headline)),
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
    }
//---------------------------------------------------- 

I don't have a lot of knowledge with php, but from what I can tell, nothing seems out of line compared with the "allow_emailcomments" section just above this one.  I have tried renaming the variables every which way, and can't get the text to show up, nor the radio buttons to show the selected option.  Please help!

Thanks, and thanks everyone for the great mod!
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: macwise7 on March 31, 2006, 10:04:38 PM
Vano,

I saw on your site that you have an option for users when they upload their images to check a box so they can receive comments on their images.  Can you share how you did this, and is there an option for the image owner to change this later on for a particular image, i.e. can they turn on notification for one image, and turn it off for another image at the same time?

Thanks
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: NTH on April 01, 2006, 09:27:33 AM
Plz help me!!!
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: NTH on April 03, 2006, 11:24:33 PM
Somebody...help me...
This is my question
Posted on: March 30, 2006, 08:00:32 PM
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: IcEcReaM on April 03, 2006, 11:40:44 PM
link to your gallery?

did you defined your script url in constants.php?
define('SCRIPT_URL', 'http://www.yourdomain.com/4images');

is port 81 correct if browsing through the gallery?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: NTH on April 04, 2006, 08:07:07 AM
OH!
Very Good!!!
THX    8)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: IWS_steffen on April 17, 2006, 06:44:14 PM
Hallo

cooler MOD. Ich bekomme nur immer diese Fehlermeldung. Woran kann das liegen.

DB Error: Bad SQL Query: SELECT user_allowmailcomments FROM maritim_users WHERE user_name = 'Steffen'
Unknown column 'user_allowmailcomments' in 'field list'

Hat jemand eine Idee?

Gruß Steffen
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: paburmester on September 22, 2006, 03:03:04 PM
** sorry my bad english  **

Hi, how can I use this MOD to my private gallery, Im the only registered user so only me will received the email. But I want to know how can I received this notifications with the name of my guest that he fiils on the "post commentary" form of every photo, and if its posible can he choose if they want to received notifications of new comments.
Can some body help me?
Thanks!
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: paburmester on September 25, 2006, 09:50:05 PM
help please :roll:
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Flo2005 on October 26, 2006, 09:13:21 PM
Please read my little idea http://www.4homepages.de/forum/index.php?topic=15216.0
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: qpatrick on November 01, 2006, 11:41:20 AM
Mod works in 1.7.4
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Zyga on December 26, 2006, 11:24:34 AM
Quote from: macwise7
I don't have a lot of knowledge with php, but from what I can tell, nothing seems out of line compared with the "allow_emailcomments" section just above this one.  I have tried renaming the variables every which way, and can't get the text to show up, nor the radio buttons to show the selected option.  Please help!

Thanks, and thanks everyone for the great mod!

In db_field_definitions.php
on the end just before ?> add

Code: [Select]
$additional_user_fields['user_allowmailcomments'] = array($lang['user_allowmailcomments'], "radio", 0);
in the member.php
find
Code: [Select]
//--- Show Profileand several lines later
Code: [Select]
$site_template->register_vars(array(on the end of list add
Code: [Select]
"lang_allowmailcomments" => $lang['allowmailcomments']

Now find
Code: [Select]
//--- Edit Profilein this section find (it could be little different than mine) and add this red marked fragment
Quote
    $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', user_sex = '$user_gender' ,user_allowmailcomments = '$user_allowmailcomments' , ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql."
            WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];
    $site_db->query($sql);


find
Code: [Select]
$user_allowemails = $user_info['user_allowemails'];add
Code: [Select]
$user_allowmailcomments = $user_info['user_allowmailcomments'];

find
Code: [Select]
  }
  if ($user_allowemails == 1) {
    $user_allowemails_yes = " checked=\"checked\"";
    $user_allowemails_no = "";
  }
  else {
    $user_allowemails_yes = "";
    $user_allowemails_no = " checked=\"checked\"";
  }

add
Code: [Select]
    if ($user_allowemails == 1) {
      $user_allowmailcomments_yes = " checked=\"checked\"";
      $user_allowmailcomments_no = "";
    }
    else {
      $user_allowmailcomments_yes = "";
      $user_allowmailcomments_no = " checked=\"checked\"";
  }

now it should works

---------------------------------

and little correction for SEO - short link system (works with seom mod instaled wersion where links looks like http://sitename.com/img329)


Find
Code: [Select]
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;
change it to

Quote
  //SEO $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;
$image_url = $script_url."/img".$id;

---------------


Where can I setup a subject of email?


Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: impss on January 05, 2007, 07:47:37 PM
ok, chose:
1. only image owners can chose receive or not emails on new posted comments
2. any registered members can "subscribe" for any images they want, to receive emails on new posted comments.

the first variant is already exist (no offical mods though), u can see it at my site ;)

the second variant is not exist (I'm not aware of), but I was thinking to make it sometimes today.

V@no or Anybody,

was the  > 2. any registered members can "subscribe" for any images they want, to receive emails on new posted comments

figured out?

anyone have or can make this mod?

Thanks
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Alonso on April 29, 2007, 09:46:27 PM
Ich hab das jetzt gemacht wie auf Seite 1 beschrieben.
Aber ich bekomm das nicht hin das die User die Funktion im Member Bereich deaktivieren können.

Könnte mir das vieleicht nochmal jemand kurz posten ?

Wäre mir echt geholfen Danke
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: ccsakuweb on May 12, 2007, 10:27:13 PM
Hi ! I don't understand why but my users and i don't receive any notification. I have PM installed and I receive notifications from the site about new pm but not about a new comment.   My gallery don't have any error, i use 1.7.3 version. The url: http://www.myart.es could someone help me please?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: k1lljoy on May 22, 2007, 01:11:27 AM
The same problem.. Istalled this MOD, everything seemed to be ok, but notification emails do not come to the post-authors  :(
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: CosmoPhobia on August 16, 2007, 10:32:10 PM
Mod dont work with 1.7.4.
Site details.php dont loading, blank white page is shown.

Any solutions ?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: thunderstrike on August 16, 2007, 10:43:50 PM
Quote
Any solutions ?

Set error_reporting from global.php (E_ALL). Is say if blank page on MOD ?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: CosmoPhobia on August 16, 2007, 11:06:23 PM
Sorry, dont unterstand. Can you explain ? What i have to change in the global.php ?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: thunderstrike on August 17, 2007, 12:09:52 AM
In global.php file,

change:

Quote
error_reporting(E_ERROR | E_WARNING | E_PARSE);

for:

Quote
//error_reporting(E_ERROR | E_WARNING | E_PARSE);
error_reporting(E_ALL);

2 - Try MOD to see blank page.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: CosmoPhobia on August 17, 2007, 09:03:52 AM

2 - Try MOD to see blank page.

Dont know what you mean with this ? I dont wanna see a blank page, i would like to work this mod.

Sorry for my bad english, im german...
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: thunderstrike on August 17, 2007, 10:27:52 AM
Quote
I dont wanna see a blank page, i would like to work this mod.

Ok so try instruction.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: ntr on August 17, 2007, 10:34:58 AM
will this work with 1.7.4?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: thunderstrike on August 17, 2007, 10:37:28 AM
Yes.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: CosmoPhobia on August 19, 2007, 08:35:58 PM
Sry, intruction doesn´t work. I´ve a blank page again, when i go on details.
I´ve changed

error_reporting(E_ERROR | E_WARNING | E_PARSE);

to

//error_reporting(E_ERROR | E_WARNING | E_PARSE);
error_reporting(E_ALL);

in global.php, without an effect.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: thunderstrike on August 20, 2007, 12:24:58 AM
Is say host web error log from cPanel ?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: CosmoPhobia on August 20, 2007, 01:22:13 AM
Is say host web error log from cPanel ?
Don´t know what you mean with this ! !
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: thunderstrike on August 20, 2007, 03:50:10 AM
Examp:

http://www.cyclone-hosting.net/images/cpanel.png

Analysis and log files - > error log.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: vipersgarden on August 28, 2007, 03:48:45 PM
Ich habe das MOD installiert und es funktioniert wunderbar!

Aber ich habe ein kleines Problem!
Ich habe für die verschiedenen User verschiedene Sprachen zur Auswahl.
Wenn ich jetzt auf z.B. Französisch stelle und dann einen Kommentar poste, bekomme ich eine mail mit französischem (natürlich von mir in den {lang, french, email, comment_email} vorgegebenen) Text.
Hab ich was überlesen oder gibt es hier noch keine Lösung?
Super wäre, wenn der Bildeigentümer diese mail in der von ihm eingestellten Sprache erhalten würde und nicht in der Sprache des Absenders!

I´ve installed this MOD and it works perfect!

But there is a little problem!
I have different languages, which could be joined by users.
When I set now to French and post a comment, I will get an email with French text (this one I´ve written within {lang, french, email, comment_email}, not the text posted.
Do I have overread something or is there no resolution at the time?
It would be good, if the image owner would get the email in his language and not in the language of the comment poster!

Thx
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: vipersgarden on August 28, 2007, 04:59:54 PM
....... und hier sind die Texte in verschiedenen Sprachen (falls sie jemand braucht). Nur "Friends of Vipersgarden" gegen Euren Galerie Namen austauschen.:
...... and here are the texts (if somebody will need them). Just change "Friends of Vipersgarden" to your gallery name:

in Italian:
Code: [Select]
Caro {recipient_name},
 
{user_name} ha inviato un commento alla tua immagine: "{image_name}", nella galleria dell'utente "Friends of VipersGarden".
 
{comment_headline}:
 
{comment_text}
 
Per leggere il commento clicca qui: {image_url}
 
------
Saluti, {site_name}

in French:
Code: [Select]
Bonjour {recipient_name},
 

{user_name} a ajouté(e) un commentaire sur votre image: "{image_name}", dans la galérie d'images {Friends of VipersGarden}.
 

{comment_headline}:
 

{comment_text}
 

Pour lire le commentaire suivez ce lien: {image_url}
 

------
Cordialement, {site_name}

in Deutsch:
Code: [Select]
Lieber {recipient_name},

{user_name} hat ein Kommentar zu Deinem Bild: "{image_name}" bei Friends of VipersGarden Benutzer-Bildergalerie abgegeben.

{comment_headline}:

{comment_text}

Hier kannst Du es lesen: {image_url}

------
Mit freundlichen Grüßen, {site_name}

and in English:
Code: [Select]
Dear {recipient_name},

{user_name} posted a comment on your image: "{image_name}", at Friends of VipersGarden - User gallery.

{comment_headline}:

{comment_text}

To view the comment go to: {image_url}

------
Best regards, {site_name}

mit freundlichen Grüßen
Kind regardes

Mario
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: vipersgarden on September 05, 2007, 02:22:31 PM
Ich glaube, dass ein derartiges MOD für alle, die ihre Galerie multilingual betreiben von grossem Nutzen wäre !!

Ich habe jetzt in der Datenbank unter "4images_users" ein Feld "user_language" eingerichtet.
Und in den template.html (member_editprofile.html, member_profile.html und register_form) die entsprechenden Felder ergänzt.
Funktioniert alles wunderbar!

I´m sure, a MOD like this would be very usefull for all, having their gallery multilingual.

I´ve made within the database a new field "user_language" and also made fields in the template.html files (member_editprofile.html, member_profile.html and register_form).
Works fine!

(http://vipersgarden.at/4images/test/language.jpg)

Jetzt müßte nur noch bei Versendung einer e-mail die Sprache des Empfängers (z.B. bei posting eines Kommentars, mails vom Admin, usw.) aus der Datenbank ausgelesen werden und die mail in der entsprechenden Sprache versandt werden.
Es ist ja ziemlich uninteressant, wenn z.B. ein Benutzer mit französischer Spracheinstellung ein Kommentar zu einem Bild postet und der kroatische Bildeigentümer dann die mail (nur den Text in der lang/email) in französisch erhält!
Aber wie geht das ????????

Now the script should look in the database for the language of the recipient and the mail should be sent in this language.
It´s not very good, when, for example, user choosen french is posting a comment to an image and the croatian imageowner gets this mail (only the text from lang/email) in french!
Sounds pretty simple! But how it works ?????

Thanks
Mario
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: thunderstrike on September 05, 2007, 02:33:33 PM
Quote
Now the script should look in the database for the language of the recipient and the mail should be sent in this language.
It´s not very good, when, for example, user choosen french is posting a comment to an image and the croatian imageowner gets this mail (only the text from lang/email) in french!
Sounds pretty simple! But how it works ?????

Can try this:

http://www.4homepages.de/forum/index.php?topic=6749.0

can use [english][french] - all install lang in folder lang with tag foreach text (and email text) you like. ;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: P.Sterni on January 28, 2008, 11:11:39 PM
Hallo Leute,

irgendwie habe ich hier keinen Durchblick mehr. 
Da ich kein englisch kann, würde ich mich riesig freuen wenn mir jemand den Vollständigen Script mal zumailen könnte.


Gruß
Peter
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: honda2000 on March 20, 2008, 11:52:42 AM
hi, dem schließe ich mich an:
es muss ja nur einmal zusammenhängend sein, und vor allem für V 1.7.6 kompertiebel

denn dort gibts kein:
Code: [Select]
$site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);

nur:

Code: [Select]
$site_db->query($sql);
}

//-----------------------------------------------------
//---Clickstream---------------------------------------
//-----------------------------------------------------

fügt man es dazwischen ein, bleibt die details.php beim Aufruf leer

...und wie der letzte Poster geschrieben hat, überschlagen sich in diesem Thread die Ereignisse

schöner wäre, eine normale Anleitung, angepasst an Version 1.7.6

dann würde der MOD auch funktionieren (für mein Mini-Anspruch)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: fritz_der_zweite on April 06, 2008, 08:53:59 PM
Würde dies auch begrüßen.
Blicke bei dem langen Thread auch nicht mehr durch, wie der genue Mod aktuell am besten für die neue Version 1.7.6 auszusehen hat   :?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Neo1 on May 16, 2008, 10:51:57 PM
Hallo,

leider funktionierte meine Galerie (v.1.7.) nach dem Umzug auf einen neuen Server nicht mehr richtig. Ich habe dann den Fehler gefunden ...es lag an der neuen PHP version ..in dem Fall PHP Version 5.1.6

Ich habe nun alle Probleme damit http://www.4homepages.de/forum/index.php?topic=10184.15 beheben können allerdings bleibt diese Mod, die leider nicht funktioniert. Es werden keine Mails mehr versendet. Kann mir vielleicht jemand helfen? Der Code ist noch original wie auf Seite 1 dieses Threads.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Daniel on July 29, 2008, 06:39:15 PM
Also ich habe

      $site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);

in 1.7.6

Habe es gerade mit dem Code von Seite1 in 1.7.6 geprüft; Geht alles wunderbar...

Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Sunny C. on August 02, 2008, 12:09:17 AM
Hallo,

ich verwende dieses hier: http://www.4homepages.de/forum/index.php?topic=2705.msg58205#msg58205
Doch leider kommt keine Mail an!?

Das Kommentar erscheint auf der Seite aber oben steht ein Fehler:
Quote
An unexpected error occured. Please try again later.

details.php
Code: [Select]
<?php
$action 
$HTTP_GET_VARS['action'];

if  (
$action == 'calendarprint') {
$main_template 'calendar';
}
else {
$main_template 'details';
}

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

if (!
$image_id) {
    
redirect($url);
}

$additional_sql "";
if (!empty(
$additional_user_fields)) {
  foreach (
$additional_user_fields as $key => $val) {
    
$additional_sql .= ", u.".$key;
  }
}
if (!empty(
$additional_image_fields)) {
  foreach (
$additional_image_fields as $key => $val) {
    
$additional_sql .= ", i.".$key;
  }
}

$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_id = 
$image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
$image_row $site_db->query_firstrow($sql);
$cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;
$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 0;

if (!
check_permission("auth_viewcat"$cat_id) || !check_permission("auth_viewimage"$cat_id) || !$image_row) {
  
redirect($url);
}

$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" get_random_image($cat_id);
$site_template->register_vars("random_cat_image"$random_cat_image);
unset(
$random_cat_image);

//################################ Start MOD Ajax Slideshow/Diashow ##############################
$max_length_image_name 65;
$max_length_image_description 55;
$ajax_slideshow_view 0;

  
$ajax_slideshow "<script type=\"text/javascript\" src=\"templates/".$config['template_dir']."/js/diashow.js\"></script>\n";
  
$ajax_slideshow .= "<script type=\"text/javascript\">\n<!-- \n";
  
$ajax_slideshow .= "var viewer = new PhotoViewer();\n";
  
$ajax_slideshow .= "viewer.setSlideDuration(".$config['ajax_slideshowviewer_setSlideDuration'].");\n";
  
$ajax_slideshow .= "viewer.disablePanning();\n";
  
$ajax_slideshow .= "viewer.disableAutoPlay();\n";
  
$ajax_slideshow .= "viewer.".$config['ajax_slideshowviewer_Fading']."Fading();\n";
  
$ajax_slideshow .= "viewer.setBackgroundColor('".$config['ajax_slideshowviewer_setBackgroundColor']."');\n";
  
$ajax_slideshow .= "viewer.setBorderWidth(".$config['ajax_slideshowviewer_setBorderWidth'].");\n";
  
$ajax_slideshow .= "viewer.setFontSize(".$config['ajax_slideshowviewer_setFontSize'].");\n";
  
$ajax_slideshow .= "viewer.".$config['ajax_slideshowviewer_Shade']."Shade();\n";
  
$ajax_slideshow .= "viewer.setShadeColor('".$config['ajax_slideshowviewer_setShadeColor']."');\n";
  
$ajax_slideshow .= "viewer.setShadeOpacity('".$config['ajax_slideshowviewer_setShadeOpacity']."');\n";
  
$ajax_slideshow .= "viewer.".$config['ajax_slideshowviewer_Loop']."Loop();\n";
  
$ajax_slideshow .= "viewer.setOnClickEvent(viewer.close);\n";
  
$ajax_slideshow .= "viewer.disableToolbar();\n";
  
$count 0;
  
$bgcounter 0;

   
$ext get_file_extension($image_row['image_media_file']);
   
$config['ajax_slideshowviewer_Types_array'] = explode(","$config['ajax_slideshowviewer_Types']);
   if (
in_array($ext$config['ajax_slideshowviewer_Types_array'])) {
   
$ajax_slideshow_view 1;
   
show_image($image_row);
   
$image_name_short = (isset($image_row['image_name']) && strlen($image_row['image_name']) > $max_length_image_name) ? substr(format_text(stripslashes($image_row['image_name']), 2), 0$max_length_image_name)."..." format_text(stripslashes($image_row['image_name']), 2);
   
$image_name_short str_replace("\r","",$image_name_short);
   
$image_name_short str_replace("\n","",$image_name_short);
   
$image_name_short str_replace("<br>","",$image_name_short);
   
$image_name_short str_replace("<br />","",$image_name_short);
   
$image_name_short str_replace("'","",$image_name_short);
   
$image_name_short str_replace("&lt;","<",$image_name_short);
   
$image_name_short str_replace("&gt;",">",$image_name_short);
   
$image_name_short stripslashes($image_name_short);
   
$image_name_short "".$lang['image_name'].$image_name_short";

   if (
$config['ajax_slideshowviewer_description'] == "enable") {
   
$image_description_short = (isset($image_row['image_description']) && strlen($image_row['image_description']) > $max_length_image_description) ? substr(format_text(stripslashes($image_row['image_description']), 101), 0$max_length_image_description)."..." format_text(stripslashes($image_row['image_description']), 101);
   
$image_description_short str_replace("\r","",$image_description_short);
   
$image_description_short str_replace("\n","",$image_description_short);
   
$image_description_short str_replace("<br>","",$image_description_short);
   
$image_description_short str_replace("<br />","",$image_description_short);
   
$image_description_short str_replace("'","",$image_description_short);
   
$image_description_short str_replace("&lt;","<",$image_description_short);
   
$image_description_short str_replace("&gt;",">",$image_description_short);
   
$image_description_short stripslashes($image_description_short);

   if (
$image_description_short == "")  {
   
$image_description_short "&nbsp;";
   } else {
    
$image_description_short "<br>".$lang['description'].$image_description_short";
   }
   }
   else {
   
$image_description_short "&nbsp;";
   }
   
$ajax_slideshow .= "viewer.add('".MEDIA_DIR."/".$image_row['cat_id']."/".$image_row['image_media_file']."', '".$image_description_short."', '".$image_name_short."');\n";
   }

  if (
$count 0)  {
    
$leftover = ($config['image_cells'] - $count);
  }
  
$ajax_slideshow .= "//-->\n</script>\n";

if (
$user_info['user_level'] == GUEST && $config['ajax_slideshowviewer_Show'] == "1" && $ajax_slideshow_view == "1") {
  
$ajax_slideshow_button "<img src=\"".get_gallery_image("diashow_off.gif")."\" border=\"0\" alt=\"\" />";
  
$site_template->register_vars(array(
  
"ajax_slideshow_button" => $ajax_slideshow_button
  
));
}
elseif (
$user_info['user_level'] != GUEST && $config['ajax_slideshowviewer_Show'] == "1" && $ajax_slideshow_view == "1" || $config['ajax_slideshowviewer_Show'] == "2" && $ajax_slideshow_view == "1") {
  
$ajax_slideshow_button "<a href=\"javascript:void(viewer.show(0))\"><img src=\"".get_gallery_image("diashow.gif")."\" border=\"0\" alt=\"\" /></a>";
  
$site_template->register_vars(array(
  
"ajax_slideshow" => $ajax_slideshow,
  
"ajax_slideshow_button" => $ajax_slideshow_button
  
));
}
else {
  
$site_template->register_vars(array(
  
"ajax_slideshow" => "",
  
"ajax_slideshow_button" => "",
));
}
unset(
$ajax_slideshow);
//################################ End MOD Ajax Slideshow/Diashow ##############################

//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------
$image_allow_comments = (check_permission("auth_readcomment"$cat_id)) ? $image_row['image_allow_comments'] : 0;
$image_name format_text($image_row['image_name'], 2);
//----------------------------------------------------- 
//--- Image Terms ------------------------------------- 
//----------------------------------------------------- 
if ($action == "terms") { 
  
terms_add($cat_id, (($image_row['terms']) ? $image_id "")); 

$terms 0
if (!
terms_check($cat_id, (($image_row['terms']) ? $image_row "")) && $action != "terms"

  if (
$image_row['terms']) 
  { 
    
$terms_agreement = ($lang['terms_agreement'][$image_row['terms_msg']]) ? $lang['terms_agreement'][$image_row['terms_msg']] : $lang['terms_agreement'][0]; 
  } 
  else 
  { 
    
$terms_agreement = ($lang['terms_agreement'][$cat_cache[$cat_id]['terms_msg']]) ? $lang['terms_agreement'][$cat_cache[$cat_id]['terms_msg']] : $lang['terms_agreement'][0]; 
  } 
  
$site_template->register_vars(array( 
    
"url_home" => $site_sess->url(ROOT_PATH."index.php"), 
    
"lang_terms" => $lang['terms'], 
    
"mode" => $mode,
    
"lang_terms_agreement" => $terms_agreement
    
"lang_agree" => $lang['agree'], 
    
"lang_agree_not" => $lang['agree_not'
  )); 
  
$terms $site_template->parse_template("terms"); 

$site_template->register_vars(array( 
    
"show_terms" => $terms
    
"no_terms" => ($terms) ? 
)); 
//--- End Image Terms ------------------------------------- 
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
$lightbox_id = (isset($HTTP_POST_VARS['lightbox_id']) && $HTTP_POST_VARS['lightbox_id']) ? $HTTP_POST_VARS['lightbox_id'] : ((isset($HTTP_GET_VARS['lightbox_id']) && $HTTP_GET_VARS['lightbox_id']) ? $HTTP_GET_VARS['lightbox_id'] : 0);
show_image($image_row$mode.(($lightbox_id) ? "&lightbox_id=".$lightbox_id ""), 01);
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/

//--- Start mod: pin images -----------------------------
$image_pin_allow $image_row['image_pin_allow'];
$ext get_file_extension($image_row['image_media_file']);
$allow_filetypes = array('jpg','jpeg','JPG','JPEG','gif','bmp','png');
if (
in_array($ext$allow_filetypes) && $image_pin_allow == '1') {
$image_pin_allow '1'; } else {
$image_pin_allow '0';
}
//--- End mod: pin images -------------------------------

$in_mode 0;

$sql "";
if (
$mode == "lightbox") {
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  
$ids $user_info['lightbox_image_ids'];
  if (
$lightbox_id)
  {
    
$sql "SELECT l.lightbox_id, l.lightbox_name, l.lightbox_private, l.lightbox_image_ids, l.user_id, u.user_name, u.user_lightbox_private
            FROM "
.LIGHTBOXES_TABLE." l
            LEFT JOIN "
.USERS_TABLE." u ON u.user_id = l.user_id
            WHERE l.lightbox_id = '"
.$lightbox_id."'";
    if (
$row $site_db->query_firstrow($sql))
    {
      
$ids = (!$row['lightbox_private'] && $row['user_lightbox_private'] && $config['lightbox_share'] || $user_info['user_level'] == ADMIN ) ? $row['lightbox_image_ids'] : "";//$user_info['lightbox_image_ids'];
      
$lightbox_name $row['lightbox_name']." (".$row['user_name'].")";
    }
    else
    {
      
$lightbox_name "";
    }
  }
  else
  {
    
$lightbox_name $user_info['lightboxes'][$user_info['user_lightbox']]['name'];
  }
  
$txt_clickstream $lang['lightbox'].(($lightbox_name) ? " - ".$lightbox_name "");
  if (!empty(
$ids)) {
    
$image_id_sql str_replace(" "", "trim($ids));
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/
    
$sql "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
            FROM "
.IMAGES_TABLE."
            WHERE image_active = 1 AND image_id IN (
$image_id_sql) AND (cat_id NOT IN (".get_auth_cat_sql("auth_viewimage""NOTIN").", ".get_auth_cat_sql("auth_viewcat""NOTIN")."))
            ORDER BY "
.$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
    
$in_mode 1;
  }
}
elseif (
$mode == "search") {
  if (!isset(
$session_info['searchid']) || empty($session_info['searchid'])) {
    
$session_info['search_id'] = $site_sess->get_session_var("search_id");
  }

  if (!empty(
$session_info['search_id'])) {
    
$search_id unserialize($session_info['search_id']);
  }

  
$sql_where_query "";

  if (!empty(
$search_id['image_ids'])) {
    
$sql_where_query .= "AND image_id IN (".$search_id['image_ids'].") ";
  }

  if (!empty(
$search_id['user_ids'])) {
    
$sql_where_query .= "AND user_id IN (".$search_id['user_ids'].") ";
  }

  if (!empty(
$search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
    
$new_cutoff time() - 60 60 24 $config['new_cutoff'];
    
$sql_where_query .= "AND image_date >= $new_cutoff ";
  }

  if (!empty(
$search_id['search_cat']) && $search_id['search_cat'] != 0) {
    
$cat_id_sql 0;
    if (
check_permission("auth_viewcat"$search_id['search_cat'])) {
      
$sub_cat_ids get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
      
$cat_id_sql .= ", ".$search_id['search_cat'];
      if (!empty(
$sub_cat_ids[$search_id['search_cat']])) {
        foreach (
$sub_cat_ids[$search_id['search_cat']] as $val) {
          if (
check_permission("auth_viewcat"$val)) {
            
$cat_id_sql .= ", ".$val;
          }
        }
      }
    }
    
$cat_id_sql $cat_id_sql !== "AND cat_id IN ($cat_id_sql)" "";
  }
  else {
    
$cat_id_sql get_auth_cat_sql("auth_viewcat""NOTIN");
    
$cat_id_sql $cat_id_sql !== "AND cat_id NOT IN (".$cat_id_sql.")" "";
  }

  if (!empty(
$sql_where_query)) {
    
$sql "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
            FROM "
.IMAGES_TABLE."
            WHERE image_active = 1
            
$sql_where_query
            
$cat_id_sql
            ORDER BY "
.$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
    
$in_mode 1;
  }
}
if (!
$in_mode || empty($sql)) {
  
$sql "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
          FROM "
.IMAGES_TABLE."
          WHERE image_active = 1 AND cat_id = 
$cat_id
          ORDER BY "
.$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
}
$result $site_db->query($sql);

$image_id_cache = array();
$next_prev_cache = array();
$break 0;
$prev_id 0;
while(
$row $site_db->fetch_array($result)) {
  
$image_id_cache[] = $row['image_id'];
  
$next_prev_cache[$row['image_id']] = $row;
  if (
$break) {
    break;
  }
  if (
$prev_id == $image_id) {
    
$break 1;
  }
  
$prev_id $row['image_id'];
}
$site_db->free_result();

if (!
function_exists("array_search")) {
  function 
array_search($needle$haystack) {
    
$match false;
    foreach (
$haystack as $key => $value) {
      if (
$value == $needle) {
        
$match $key;
      }
    }
    return 
$match;
  }
}

$act_key array_search($image_id$image_id_cache);
$next_image_id = (isset($image_id_cache[$act_key 1])) ? $image_id_cache[$act_key 1] : 0;
$prev_image_id = (isset($image_id_cache[$act_key 1])) ? $image_id_cache[$act_key 1] : 0;
unset(
$image_id_cache);

// Get next and previous image
if (!empty($next_prev_cache[$next_image_id])) {
  
$next_image_name format_text($next_prev_cache[$next_image_id]['image_name'], 2);
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  
$next_image_url $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&amp;mode=".$mode.(($lightbox_id) ? "&lightbox_id=".$lightbox_id "") : ""));
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/
  
if (!get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media"$next_prev_cache[$next_image_id]['cat_id'], 00)) {
    
$next_image_file ICON_PATH."/404.gif";
  }
  else {
    
$next_image_file get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media"$next_prev_cache[$next_image_id]['cat_id'], 01);
  }
  if (!
get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb"$next_prev_cache[$next_image_id]['cat_id'], 00)) {
    
$next_thumb_file ICON_PATH."/".get_file_extension($next_prev_cache[$next_image_id]['image_media_file']).".gif";
  }
  else {
    
$next_thumb_file get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb"$next_prev_cache[$next_image_id]['cat_id'], 01);
  }
}
else {
  
$next_image_name REPLACE_EMPTY;
  
$next_image_url REPLACE_EMPTY;
  
$next_image_file REPLACE_EMPTY;
  
$next_thumb_file REPLACE_EMPTY;
}

if (!empty(
$next_prev_cache[$prev_image_id])) {
  
$prev_image_name format_text($next_prev_cache[$prev_image_id]['image_name'], 2);
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  
$prev_image_url $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&amp;mode=".$mode.(($lightbox_id) ? "&lightbox_id=".$lightbox_id "") : ""));
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/
  
if (!get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media"$next_prev_cache[$prev_image_id]['cat_id'], 00)) {
    
$prev_image_file ICON_PATH."/404.gif";
  }
  else {
    
$prev_image_file get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media"$next_prev_cache[$prev_image_id]['cat_id'], 01);
  }
  if (!
get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb"$next_prev_cache[$prev_image_id]['cat_id'], 00)) {
    
$prev_thumb_file ICON_PATH."/".get_file_extension($next_prev_cache[$prev_image_id]['image_media_file']).".gif";
  }
  else {
    
$prev_thumb_file get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb"$next_prev_cache[$prev_image_id]['cat_id'], 01);
  }
}
else {
  
$prev_image_name REPLACE_EMPTY;
  
$prev_image_url REPLACE_EMPTY;
  
$prev_image_file REPLACE_EMPTY;
  
$prev_thumb_file REPLACE_EMPTY;
}

$site_template->register_vars(array(
  
"next_image_id" => $next_image_id,
  
"next_image_name" => $next_image_name,
  
"next_image_url" => $next_image_url,
  
"next_image_file" => $next_image_file,
  
"next_thumb_file" => $next_thumb_file,
  
"prev_image_id" => $prev_image_id,
  
"prev_image_name" => $prev_image_name,
  
"prev_image_url" => $prev_image_url,
  
"prev_image_file" => $prev_image_file,
  
"prev_thumb_file" => $prev_thumb_file
));
unset(
$next_prev_cache);

//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------
$error 0;
if (
$action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
  
$id intval($HTTP_POST_VARS[URL_ID]);
  
$sql "SELECT cat_id, image_allow_comments
          FROM "
.IMAGES_TABLE."
          WHERE image_id = 
$id";
  
$row $site_db->query_firstrow($sql);

  if (
$row['image_allow_comments'] == || !check_permission("auth_postcomment"$row['cat_id']) || !$row) {
    
$msg $lang['comments_deactivated'];
  }
  else {
    
$user_name un_htmlspecialchars(trim($HTTP_POST_VARS['user_name']));
    
$comment_headline un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
    
$comment_text un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));

    
$captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";

    
// Flood Check
if ($id != "2"){   //added for latest news mod 
    
$sql "SELECT comment_ip, comment_date 
            FROM "
.COMMENTS_TABLE."  
            WHERE image_id = 
$id  
            ORDER BY comment_date DESC  
            LIMIT 1"

    
$spam_row $site_db->query_firstrow($sql); 
    
$spamtime $spam_row['comment_date'] + 180

    if (
$session_info['session_ip'] == $spam_row['comment_ip'] && time() <= $spamtime && $user_info['user_level'] != ADMIN)  { 
      
$msg .= (($msg != "") ? "" "").$lang['spamming']; 
      
$error 1
    }
  }

    
$user_name_field get_user_table_field("""user_name");
    if (!empty(
$user_name_field)) {
      if (
$site_db->not_empty("SELECT $user_name_field FROM ".USERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("""user_id")." <> '".$user_info['user_id']."'")) {
        
$msg .= (($msg != "") ? "<br />" "").$lang['username_exists'];
        
$error 1;
      }
    }
    if (
$user_name == "")  {
      
$msg .= (($msg != "") ? "<br />" "").$lang['name_required'];
      
$error 1;
    }
    if (
$comment_headline == "")  {
      
$msg .= (($msg != "") ? "<br />" "").$lang['headline_required'];
      
$error 1;
    }
    if (
$comment_text == "")  {
      
$msg .= (($msg != "") ? "<br />" "").$lang['comment_required'];
      
$error 1;
    }

    if (
$captcha_enable_comments && !captcha_validate($captcha)) {
      
$msg .= (($msg != "") ? "<br />" "").$lang['captcha_required'];
      
$error 1;
    }

    if (!
$error)  {
      
$sql "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              (
$id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      
$site_db->query($sql);
      
$commentid $site_db->get_insert_id();
      
update_comment_count($id$user_info['user_id']);
      
$msg $lang['comment_success'];
//-----------------------------------------------------
// Start Emailer for comments
//----------------------------------------------------- 
   
$recipient_name $image_row['user_name'];
   
$recipient_email $image_row['user_email'];
   
$image_url $script_url."/details.php?".URL_IMAGE_ID."=".$id;

   
$sql "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("""user_name")." = ".$recipient_name;
   
$result $site_db->query($sql);
   
$row $site_db->fetch_array($result);
   
$user_allowemails = ($row['user_allowemails']);

   if (
$image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
   include(
ROOT_PATH.'includes/email.php'); 
   
$site_email = new Email(); 
   
$site_email->set_to($recipient_email); 
   
$site_email->set_from($config['site_email'], $config['site_name']); 
   
$site_email->set_subject($lang['send_comment_emailsubject']);
   
$site_email->register_vars(array( 
     
"user_name" => stripslashes($user_name), 
     
"recipient_name" => stripslashes($image_row['user_name']),
     
"image_name" => $image_row['image_name'], 
     
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time), 
     
"site_name" => $config['site_name'],
     
"image_url" => $image_url,
     
"comment_text" =>(stripslashes($comment_text)),
     
"comment_headline"=>(stripslashes($comment_headline)),
          )); 
    
$site_email->set_body("comment_email"$config['language_dir']); 
    
$site_email->send_email();
    }
    }
  }
 unset(
$row);
 unset(
$spam_row);
}

//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
if ($image_allow_comments == 1) {
  
$site_template->register_vars(array(
      
"has_rss"   => true,
      
"rss_title" => "RSS Feed: ".$image_name." (".str_replace(':'''$lang['comments']).")",
      
"rss_url"   => $script_url."/rss.php?action=comments&amp;".URL_IMAGE_ID."=".$image_id
  
));$sql "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.""user_level").get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email").get_user_table_field(", u.""user_showemail").get_user_table_field(", u.""user_invisible").get_user_table_field(", u.""user_joindate").get_user_table_field(", u.""user_lastaction").get_user_table_field(", u.""user_comments").get_user_table_field(", u.""user_homepage").get_user_table_field(", u.""user_icq").", u.userpic 
          FROM "
.COMMENTS_TABLE." c
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          WHERE c.image_id = 
$image_id
          ORDER BY c.comment_date ASC"
;
  
$result $site_db->query($sql);

  
$comment_row = array();
  while (
$row $site_db->fetch_array($result)) {
    
$comment_row[] = $row;
  }
  
$site_db->free_result($result);
  
$num_comments sizeof($comment_row);

  if (!
$num_comments) {
    
$comments "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments']."</td></tr>";
  }
  else {
    
$comments "";
    
$bgcounter 0;
    for (
$i 0$i $num_comments$i++) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;

      
$comment_user_email "";
      
$comment_user_email_save "";
      
$comment_user_mailform_link "";
      
$comment_user_email_button "";
      
$comment_user_homepage_button "";
  $comment_user_ckopf_button format_text($comment_row[$i][$user_table_fields['user_ckopf']]);
      
$comment_user_icq_button "";
      
$comment_user_profile_button "";
      
$comment_user_status_img REPLACE_EMPTY;
      
$comment_user_name format_text($comment_row[$i]['comment_user_name'], 2);
      
$comment_user_info $lang['userlevel_guest'];

      
$comment_user_id $comment_row[$i]['user_id'];
  $user_row_comment get_user_info($comment_user_id);

      if (isset(
$comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
        
$comment_user_name format_text($comment_row[$i][$user_table_fields['user_name']], 2);

        
$comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/"$comment_user_id$url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id);
        
$comment_user_profile_button "<a href=\"".$comment_user_profile_link."\"><img src=\"".get_gallery_image("profile.gif")."\" border=\"0\" alt=\"".$comment_user_name."\" /></a>";

        
$comment_user_status_img = ($comment_row[$i][$user_table_fields['user_lastaction']] >= (time() - 300) && ((isset($comment_row[$i][$user_table_fields['user_invisible']]) && $comment_row[$i][$user_table_fields['user_invisible']] == 0) || $user_info['user_level'] == ADMIN)) ? "<img src=\"".get_gallery_image("user_online.gif")."\" border=\"0\" alt=\"Online\" />" "<img src=\"".get_gallery_image("user_offline.gif")."\" border=\"0\" alt=\"Offline\" />";

        
$comment_user_homepage = (isset($comment_row[$i][$user_table_fields['user_homepage']])) ? format_url($comment_row[$i][$user_table_fields['user_homepage']]) : "";
        if (!empty(
$comment_user_homepage)) {
          
$comment_user_homepage_button "<a href=\"".$comment_user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$comment_user_homepage."\" /></a>";
        }

        
$comment_user_icq = (isset($comment_row[$i][$user_table_fields['user_icq']])) ? format_text($comment_row[$i][$user_table_fields['user_icq']]) : "";
        if (!empty(
$comment_user_icq)) {
          
$comment_user_icq_button "<a href=\"http://www.icq.com/people/about_me.php?uin=".$comment_user_icq."\" target=\"_blank\"><img src=\"http://status.icq.com/online.gif?icq=".$comment_user_icq."&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"".$comment_user_icq."\" /></a>";
        }

        if (!empty(
$comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || (isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1))) {
          
$comment_user_email format_text($comment_row[$i][$user_table_fields['user_email']]);
          
$comment_user_email_save format_text(str_replace("@"" at "$comment_row[$i][$user_table_fields['user_email']]));
          if (!empty(
$url_mailform)) {
            
$comment_user_mailform_link $site_sess->url(preg_replace("/{user_id}/"$comment_user_id$url_mailform));
          }
          else {
            
$comment_user_mailform_link $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$comment_user_id);
          }
          
$comment_user_email_button "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
        }

//---[MOD] BUDDY  V.1.0.0 beta ------------
//----2007 by eMagix for 4images gallery --
//----------- START CODE  -----------------

 if (($user_info['user_level'] != GUEST) && ($user_info['user_id'] != $comment_user_id)) {
    $buddy_url $self_url;
    $buddy_url .= (!empty($mode)) ? ((strpos($buddy_url'?') !== false) ? "&amp;" "?")."mode=".$mode "";
    $buddy_url .= strpos($buddy_url'?') !== false "&amp;" "?";

    
    // IF USER ALREADY A BUDDY SHOW ALREADY BUDDY TEXT
    $buddy_status check_buddy($comment_user_id);
    if ($buddy_status == 1) {
      $buddy_button $lang['user_buddy_yes'];
    }
    // IF USER REQUEST PENDING SHOW PENDING TEXT
    elseif ($buddy_status == 0) {
      $buddy_button $lang['user_buddy_pending'];
    }
// IF NOT YET BUDDY SHOW BUTTON
    elseif ($buddy_status == -1) {
      $buddy_url .= "action=addbuddy&amp;id=".$comment_user_id."";
      $buddy_button "<a href=\"".$site_sess->url($buddy_url)."\"><img src=\"".get_gallery_image("buddy_no.gif")."\" border=\"0\" alt=\"\" /></a>";
    }


  }
  else {
  // BUDDY BUTTON DISABLED
    $buddy_button "<img src=\"".get_gallery_image("buddy_off.gif")."\" border=\"0\" alt=\"\" />";
  }
//----------- END CODE  -----------------


        
if (!isset($comment_row[$i][$user_table_fields['user_level']]) || (isset($comment_row[$i][$user_table_fields['user_level']]) && $comment_row[$i][$user_table_fields['user_level']] == USER)) {
          
$comment_user_info $lang['userlevel_user'];
        }
        elseif (
$comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
          
$comment_user_info $lang['userlevel_admin'];
        }

        
$comment_user_info .= "<br />";
        
$comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
        
$comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
      }

      
$comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";
  
///// Nuevo tipo de usuarios /////
      /* ******* Antes ******** 
      $admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }
      // ******* Ahora *********
      */
      
$admin_links "";
      if (
$user_info['user_level'] == ADMIN || ($user_info['user_level'] == MODERADOR && $user_info['user_moderador_comentarios'] == 1)) {
      
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif (
$is_image_owner) {
        
$admin_links .= ($config['user_edit_comments'] != 1) ? "" "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        
$admin_links .= ($config['user_delete_comments'] != 1) ? "" "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }
      
///// Fin nuevo tipo de usuario /////
  
// Mod PM Start
     
if ($user_info['user_level'] > GUEST && $user_info['user_pm_ban'] == 0) {
     
$comment_user_pm "<a href=\"".$site_sess->url(ROOT_PATH."pm.php?action=quote&mode=comment&id=".$comment_row[$i]['comment_id']."&user_id=".$comment_row[$i]['user_id']."&username=".$comment_row[$i]['user_name'])."\" /><img src=\"".get_gallery_image("pm.gif")."\" border=\"0\" alt=\"".$lang['pm_user_pm_alt']."\" /></a>";
     } elseif (
$user_info['user_level'] == GUEST){
     
$comment_user_pm "<img src=\"".get_gallery_image("pm.gif")."\" border=\"0\" alt=\"".$lang['pm_hinweis']."\" />";
     }else {
     
$comment_user_pm "";
     }
// Mod PM END

      
$site_template->register_vars(array(
        
"comment_id" => $comment_row[$i]['comment_id'],
"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row_comment['user_avatar'] == "") ? "blank.gif" $user_row_comment['user_avatar'])."\" name=\"icons\" border=\"0\" hspace=\"15\" alt=\"\">" "",
// Mod PM Start
        
"comment_user_pm" => $comment_user_pm,
// Mod PM Start
        
"comment_user_id" => $comment_user_id,
        
"comment_user_status_img" => $comment_user_status_img,
        
"comment_user_name" => $comment_user_name,
        
"comment_user_info" => $comment_user_info,
        
"comment_user_profile_button" => $comment_user_profile_button,
        
"comment_user_email" => $comment_user_email,
        
"comment_user_email_save" => $comment_user_email_save,
        
"comment_user_mailform_link" => $comment_user_mailform_link,
"comment_user_ckopf_button" => $comment_user_ckopf_button,
        
"comment_user_email_button" => $comment_user_email_button,
        
"comment_user_homepage_button" => $comment_user_homepage_button,
        
"comment_user_icq_button" => $comment_user_icq_button,
        
"comment_user_ip" => $comment_user_ip,
"comment_userpic" => ($config['userpic'] && $comment_row[$i]['userpic']) ? ROOT_PATH."data/userpic/".$comment_row[$i]['userpic'] : "",
// Mod PM Start
        
"comment_headline" => format_text($comment_row[$i]['comment_headline'], 0$config['wordwrap_comments'], 00), 
        
"comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
// Mod PM End 
        
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
"buddy_button" => $buddy_button,  // BUDDY MOD BY EMAGIX
        
"row_bg_number" => $row_bg_number,
        
"admin_links" => $admin_links
      
));
      
$comments .= $site_template->parse_template("comment_bit");
    } 
// end while
  
//end else
  
$site_template->register_vars("comments"$comments);
  unset(
$comments);

  
//-----------------------------------------------------
  //--- BBCode & Form -----------------------------------
  //-----------------------------------------------------
  
$allow_posting check_permission("auth_postcomment"$cat_id);
  
$bbcode "";
  if (
$config['bb_comments'] == && $allow_posting) {
    
$site_template->register_vars(array(
      
"lang_bbcode" => $lang['bbcode'],
      
"lang_tag_prompt" => $lang['tag_prompt'],
      
"lang_link_text_prompt" => $lang['link_text_prompt'],
      
"lang_link_url_prompt" => $lang['link_url_prompt'],
      
"lang_link_email_prompt" => $lang['link_email_prompt'],
      
"lang_list_type_prompt" => $lang['list_type_prompt'],
      
"lang_list_item_prompt" => $lang['list_item_prompt'],
    ));
    
$bbcode $site_template->parse_template("bbcode");
  }

  if (!
$allow_posting) {
    
$comment_form "";
  }
  else {
    
$user_name = (isset($HTTP_POST_VARS['user_name']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['user_name'])), 2) : (($user_info['user_level'] != GUEST) ? format_text($user_info['user_name'], 2) : "");
    
$comment_headline = (isset($HTTP_POST_VARS['comment_headline']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_headline'])), 2) : "";
    
$comment_text = (isset($HTTP_POST_VARS['comment_text']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_text'])), 2) : "";

    
$site_template->register_vars(array(
      
"bbcode" => $bbcode,
      
"user_name" => $user_name,
      
"comment_headline" => $comment_headline,
      
"comment_text" => $comment_text,
      
"lang_post_comment" => $lang['post_comment'],
      
"lang_name" => $lang['name'],
      
"lang_headline" => $lang['headline'],
      
"lang_comment" => $lang['comment'],
      
"lang_captcha" => $lang['captcha'],
      
"lang_captcha_desc" => $lang['captcha_desc'],
      
"captcha_comments" => (bool)$captcha_enable_comments
    
));
    
$comment_form $site_template->parse_template("comment_form");
  }
  
$site_template->register_vars("comment_form"$comment_form);
  unset(
$comment_form);
// end if allow_comments

// Admin Links
///// Nuevo tipo de usuarios /////
/* ******* Antes ******** 
// Admin Links
$admin_links = "";
if ($user_info['user_level'] == ADMIN) {
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif ($is_image_owner) {
  $admin_links .= ($config['user_edit_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= ($config['user_delete_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
}
// ******* Ahora *********
*/
$admin_links "";
if (
$user_info['user_level'] == ADMIN || ($user_info['user_level'] == MODERADOR && $user_info['user_moderador_imagenes'] == 1)) {
        
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
  
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif (
$is_image_owner) {
  
$admin_links .= ($config['user_edit_image'] != 1) ? "" "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a>&nbsp;";
  
$admin_links .= ($config['user_delete_image'] != 1) ? "" "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
}
///// Fin nuevo tipo de usuario /////
$site_template->register_vars("admin_links"$admin_links);

// Update Hits
if ($user_info['user_level'] != ADMIN) {
  
$sql "UPDATE ".IMAGES_TABLE."
          SET image_hits = image_hits + 1
          WHERE image_id = 
$image_id";
  
$site_db->query($sql);
}

//-----------------------------------------------------
//---Clickstream---------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];

if (
$mode == "lightbox" && $in_mode) {
  
$page_url "";
 if (
preg_match("/".URL_PAGE."=([0-9]+)/"$url$regs)) {
    if (!empty(
$regs[1]) && $regs[1] != 1) {
      
$page_url "?".URL_PAGE."=".$regs[1];
    }
  }
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
  
$page_url .= ($lightbox_id) ? (($page_url) ? "&" "?")."lightbox_id=".$lightbox_id "";
  
$clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php".$page_url)."\" class=\"clickstream\">".$txt_clickstream."</a>".$config['category_separator'];
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/
}
elseif (
$mode == "search" && $in_mode) {
  
$page_url "";
  if (
preg_match("/".URL_PAGE."=([0-9]+)/"$url$regs)) {
    if (!empty(
$regs[1]) && $regs[1] != 1) {
      
$page_url "&amp;".URL_PAGE."=".$regs[1];
    }
  }
  
$clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."search.php?show_result=1".$page_url)."\" class=\"clickstream\">".$lang['search']."</a>".$config['category_separator'];
}
else {
  
$clickstream .= get_category_path($cat_id1).$config['category_separator'];
}
$clickstream .= $image_name."</span>";

//######################################### Start MOD: Calendar Print #####################################################
  
if ($user_info['user_level'] >= USER) {
  
$calendar_print_button_popup "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$image_row['image_id']."&action=calendarprint")."\" onclick=\"opendetailwindow()\" target=\"detailwindow\"><img src=\"".get_gallery_image("calendar_print_on.gif")."\" border=\"0\" /></a>";
   } else {
  
$calendar_print_button_popup " <img src=\"".get_gallery_image("calendar_print_off.gif")."\" border=\"0\" alt=\"\" />";
   }
//########################################## End MOD: Calendar Print  #####################################################

//-----------------------------------------------------
//--- Start mod: pin images ---------------------------
//-----------------------------------------------------
if (($config['pin_image_show'] == 'yes' && $image_pin_allow == '1') || ($config['pin_image_show'] == 'yes1' && $user_info['user_level'] >= USER && $image_pin_allow == '1') || ($config['pin_image_show'] == 'yes2' && $user_info['user_level'] >= USER && $image_pin_allow == '1') || ($config['pin_image_show'] == 'yes3' && $user_info['user_level'] == ADMIN && $image_pin_allow == '1') || ($config['pin_image_show'] == 'yes4' && $user_info['user_level'] == ADMIN && $image_pin_allow == '1')) {
$pin_image_show '1';
$pin_image_show_info '1';
$pin_image_show_access '1';
} elseif (
$config['pin_image_show'] == 'yes1' && $user_info['user_level'] == GUEST && $image_pin_allow == '1') {
$pin_image_show '1';
$pin_image_show_info '1';
$pin_image_show_access '0';
} elseif (
$config['pin_image_show'] == 'yes2' && $user_info['user_level'] == GUEST && $image_pin_allow == '1') {
$pin_image_show '0';
$pin_image_show_info '1';
$pin_image_show_access '0';
} elseif (
$config['pin_image_show'] == 'yes3' && $user_info['user_level'] != ADMIN && $image_pin_allow == '1') {
$pin_image_show '1';
$pin_image_show_info '0';
$pin_image_show_access '0';
} elseif (
$config['pin_image_show'] == 'yes4' && $user_info['user_level'] >= USER && $image_pin_allow == '1') {
$pin_image_show '1';
$pin_image_show_info '0';
$pin_image_show_access '0';
} else {
$pin_image_show '0';
$pin_image_show_info '0';
$pin_image_show_access '0';
}

if (
$config['pin_image_smilie'] == && $config['pin_image_captcha'] == 0) {
$pin_window_height '280';
}
elseif (
$config['pin_image_smilie'] == && $config['pin_image_captcha'] == 0) {
$pin_window_height '320';
}
elseif (
$config['pin_image_smilie'] == && $config['pin_image_captcha'] == 1) {
$pin_window_height '510';
}

if (
$config['pin_image_show'] == 'yes' || $config['pin_image_show'] == 'yes1' || $config['pin_image_show'] == 'yes2' || $config['pin_image_show'] == 'yes3' || $config['pin_image_show'] == 'yes4') {
$sql "SELECT * FROM ".PIN_TABLE."
        WHERE pin_image_id = 
$image_id
        ORDER BY pin_id DESC"
;
        
$result=mysql_query($sql);

 
$pin_image "\n";
 
$pin_image .= "<div id=\"image_content\">\n";
 
$pin_image .= "<div class=pgdiv>\n";
 for (
$i=0$i<mysql_num_rows($result); $i++) {
 
mysql_data_seek ($result$i);
 
$row mysql_fetch_row($result);
 
$pin_id=$row[0];
 
$pin_image_id=$row[1];
 
$pin_user_id=$row[2];
 
$pin_user_name=$row[3];
 
$pin_art=$row[4];
 
$pin_col=$row[5];
 
$pin_headline=$row[6];
 
$pin_text=$row[7];
 
$pin_date format_date($config['date_format']." ".$config['time_format'],$row[9]);
 
$pin_x=$row[10];
 
$pin_y=$row[11];

// ---- Start Admin Pin Links --------------------------------------------------
$admin_pin_links "";
if (
$user_info['user_level'] == ADMIN) {
  
$admin_pin_links .= "<a href='admin/pins.php?action=editpin&pin_id=".$pin_id."' target='_blank'>(Edit)</a>&nbsp;";
  
$admin_pin_links .= "<a href='admin/pins.php?action=removepin&pin_id=".$pin_id."' target='_blank'>(Delete)</a>";
}
// ---- END Admin Pin Links ----------------------------------------------------
// ---- Start replace smilie codes ---------------------------------------------
if ($config['pin_image_smilie'] != 0) {
  
$search_smilie  = array("#)""#-D""#(""#-o""#?#""#?""#-)""#-x""#-p""#-*""#*-(""#3-(""#roll#""#wink#""#-|""#o""#3-)""#lol#""LOL""#!#""#idea#");
  
$replace_smilie = array("smile""biggrin""sad""eek""question""confused""cool""mad""razz""redface""cry""evil""rolleyes""wink""neutral""surprised""twisted""lol""lol""exclaim""idea");
  for(
$smile=0;$smile<count($search_smilie);$smile++) {
  
$pin_headline str_replace($search_smilie[$smile],"<img src='".TEMPLATE_PATH."/smilies/icon_".$replace_smilie[$smile].".gif'>",$pin_headline);
  
$pin_text str_replace($search_smilie[$smile],"<img src='".TEMPLATE_PATH."/smilies/icon_".$replace_smilie[$smile].".gif'>",$pin_text);
  }
}
// ---- End replace smilie codes -----------------------------------------------
// ---- Start pin text Umbruch -------------------------------------------------
 
$pin_text wordwrap($pin_text17"\n"TRUE);
// ---- END pin text Umbruch ---------------------------------------------------
 
if ($pin_user_id != -1) {
 
$pin_image .= "<a style=\"cursor:pointer;\"><img src=\"".TEMPLATE_PATH."/images/pin/pin".$pin_art.".png\" border=\"0\" style=\"position:absolute; left:".($pin_x-($config['pin_position_x']))."; top:".($pin_y-($config['pin_position_y'])).";\" title=\"header=[".$pin_headline."] body=[".$pin_text."<p><small>".$lang['pin_from']."<br /><a href='member.php?action=showprofile&user_id=".$pin_user_id."'><u>".$pin_user_name."</u></a><br />(".$pin_date.")".$admin_pin_links."</small></p>] fade=[on] fadespeed=[0.06] requireclick=[off] singleclickstop=[on] doubleclickstop=[off]\"></a>\n";
 }
 else {
 
$pin_image .= "<a style=\"cursor:pointer;\"><img src=\"".TEMPLATE_PATH."/images/pin/pin".$pin_art.".png\" border=\"0\" style=\"position:absolute; left:".($pin_x-($config['pin_position_x']))."; top:".($pin_y-($config['pin_position_y'])).";\" title=\"header=[".$pin_headline."] body=[".$pin_text."<p><small>".$lang['pin_from']."<br />".$pin_user_name."<br />(".$pin_date.")".$admin_pin_links."</small></p>] fade=[on] fadespeed=[0.06] requireclick=[off] singleclickstop=[on] doubleclickstop=[off]\"></a>\n";
 }
}
 
$pin_image .= "<script src=\"".TEMPLATE_PATH."/pin_images.js\"></script> \n";
 
$pin_image .= "</div>\n";
 
$pin_image .= "</div>\n";
}
$site_template->register_vars(array(
  
"pin_image" => $pin_image,
  
"pin_window_height" => $pin_window_height,
  
"pin_image_show" => $pin_image_show,
  
"lang_pin_info" => $lang['pin_info'],
  
"pin_image_show_info" => $pin_image_show_info,
  
"lang_pin_info_access" => $lang['pin_info_access'],
  
"pin_image_show_access" => $pin_image_show_access,
  
"url_pin_images" => $site_sess->url(ROOT_PATH."pin_images.php?pin=1"),
  
"lang_pin_post" => $lang['pin_post']
));
unset(
$pin_image);
//-----------------------------------------------------
//--- End mod: pin images -----------------------------
//-----------------------------------------------------

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream,
//######################################### Start MOD: Calendar Print  #####################################################
  
"calendar_print_button_popup" => $calendar_print_button_popup,
  
"lang_calendar_image_tip" => $lang['calendar_image_tip'],
  
"lang_calendar_help" => $lang['calendar_help'],
  
"lang_calendar_paper_tip" => $lang['calendar_paper_tip'],
  
"lang_calendar_select_mounth_tip" => $lang['calendar_select_mounth_tip'],
  
"lang_calendar_remind_tip" => $lang['calendar_remind_tip'],
  
"lang_calendar_print_tip_1" => $lang['calendar_print_tip_1'],
  
"lang_calendar_print_tip_2" => $lang['calendar_print_tip_2'],
//########################################### End MOD: Calendar Print  #####################################################
  
"lang_category" => $lang['category'],
  
"lang_added_by" => $lang['added_by'],
  
"lang_description" => $lang['description'],
  
"lang_keywords" => $lang['keywords'],
  
"lang_date" => $lang['date'],
  
"lang_hits" => $lang['hits'],
  
"lang_downloads" => $lang['downloads'],
  
"lang_rating" => $lang['rating'],
  
"lang_votes" => $lang['votes'],
  
"lang_author" => $lang['author'],
  
"lang_comment" => $lang['comment'],
  
"lang_prev_image" => $lang['prev_image'],
  
"lang_next_image" => $lang['next_image'],
  
"lang_file_size" => $lang['file_size']
));

$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>


Edit: Es kommt einfach keine Mail an! Was ist denn da falsch gelaufen?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: redlich on November 21, 2008, 07:43:25 PM
Works perfect  :D

I got email from the past

Date: 01.01.1970 01:00   8O
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: bergblume on December 11, 2008, 07:54:40 PM
vraxor, thank you very much!!
works perfect! good job!!!  :thumbup: :thumbup:
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: gborislav on December 14, 2008, 02:57:33 AM
Hi to all.

Why admins do not receive comments for their images?
I'm using 1.7.4

Thanks.

UPDATE : Fix it . Thanks
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on December 14, 2008, 09:02:03 AM
Maybe admin's email is wrong?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: SunnyUK on December 30, 2008, 02:27:58 PM
Nice mod. Thank you very much.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: theskyboy on January 11, 2009, 12:25:08 AM
Hi There

I have installed this MOD, however the e- mails are turning out like this:

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0
Arial;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 Dear
\{user_name\},\par
\par
someone posted a comment on \{image_name\} at \{site_name\}.\par
To view the comment go to: \{image_url\}\par
Date: \{comment_date\}\par
\par
Best regards, \{site_name\}\par
}

I am using 1.7.6

Best wishes,

Nick
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: bfarber on January 22, 2009, 12:43:07 AM
There are obviously a lot of sharp people in here but I have a simple question.  Most of the mods I have reviewed carry on in response for an extensive length with multiple postings on corrections.  Is this mod with all changes and corrections listed in any one place?  This is a great idea and I am sure it works as well as the suggested modifications to the MOD.
It would probably take less than 15 minutes to add this mod but not when you have to run back and forth and read all the postings and clarifications or corrections or am I reading the comments wrong?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on January 22, 2009, 01:39:27 AM
Hello and welcome to 4images forum.

Unfortunately you are probably reading it right...at least in this particular case. Most recent mods are getting updated in the original instructions as fixes posted in the comments.
In this particular case it seems to be the author no longer active on this forum and you probably need go through the comments to get the whole mod...
However if you feel so generous, you could collect the needed changes and we'll gladly update the original instructions for future users ;)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Apfelkomplott on March 27, 2009, 03:27:09 PM
Hallo zusammen.
Ich bekomme diesen MOD nicht ans laufen mit 4images 1.7.6 und dem Iceberg Template - in der Detailansicht wird nur noch eine weiße Seite ausgegeben. Warum nur? Das wäre der erste MOD, Konflikte dürften keine bestehen.

------
Hi there.
For some reason I don't know I can't get this MOD running with 4images 1.7.6 and the Iceberg template - in details page only a white page ist printed. But why? It's the first MOD, conflicts should not be there.
 
:oops:
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Sunny C. on May 31, 2009, 01:15:38 AM
Mod ist in 1.7.7 eingebaut, bekomme aber keine Mail ?

-----

   
Did the modification in version 1.7.7 tested. But I receive no e-mail. Would that someone, perhaps to version 1.7.7 rewrite?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Sunny C. on June 23, 2009, 01:23:58 PM
I Used this Code:
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
   $recipient_name = $image_row['user_name'];
   $recipient_email = $image_row['user_email'];
   $image_url = $script_url."/img".$id;

   $sql = "SELECT user_allowmailcomments FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = '".$recipient_name."'";
$result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);
   $user_allowmailcomments = ($row['user_allowmailcomments']);

   if ($image_row['user_id'] != $user_info['user_id'] && $user_allowmailcomments == 1) {
   $current_time = time();
   include(ROOT_PATH.'includes/email.php');
   $site_email = new Email();
   $site_email->set_to($recipient_email);
   $site_email->set_from($config['site_email'], $config['site_name']);
   $site_email->set_subject($lang['send_comment_emailsubject']);
   $site_email->register_vars(array(
     "user_name" => stripslashes($user_name),
     "recipient_name" => stripslashes($image_row['user_name']),
     "image_name" => $image_row['image_name'],
     "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
     "site_name" => $config['site_name'],
     "image_url" => $image_url,
     "comment_text" =>(stripslashes($comment_text)),
     "comment_headline"=>(stripslashes($comment_headline)),
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
    }
//---------------------------------------------------- 

If someone writes a comment, the following error:
An unexpected error occured. Please try again later.
There is also no e-mail!
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on June 23, 2009, 03:15:29 PM
And what kind of error shows when posted as admin?
also that message is covered in our error messages section An unexpected error occured. Please try again later (http://www.4homepages.de/forum/index.php?topic=24177.0).
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Frank Götze on June 23, 2009, 03:17:03 PM
Hi Benny,

der Mod funktioniert bei mir ohne Probleme in der 1.77. Kontrolliere bitte mal deine Userverwaltung und die hinterlegte E- Mailadresse.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Sunny C. on June 23, 2009, 10:39:29 PM
And what kind of error shows when posted as admin?
also that message is covered in our error messages section An unexpected error occured. Please try again later (http://www.4homepages.de/forum/index.php?topic=24177.0).

This
Quote
Bad SQL Query: SELECT user_allowmailcomments FROM 4images_users WHERE user_name = 'Benny'
Unknown column 'user_allowmailcomments' in 'field list'

If the administrator saves a comment, then no errors and there will be no e-mail sent!

Hi Benny,

der Mod funktioniert bei mir ohne Probleme in der 1.77. Kontrolliere bitte mal deine Userverwaltung und die hinterlegte E- Mailadresse.

Was meinst du mit der Userverwaltung?
Und es ist meine E-Mail Adresse hinterlegt zu 100% korrekt ist, habe ich auch schon nachgesehen!
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on June 24, 2009, 01:35:32 AM
user_allowmailcomments is not part of this mod...you'll need add that field into 4images_users table manually. add it as TINYINT(1) :
Code: (MySQL Query (phpmyadmin)) [Select]
ALTER TABLE `4images_users` ADD `user_allowmailcomments` TINYINT( 1 ) NOT NULL ;
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Sunny C. on June 24, 2009, 10:45:57 AM
Thanks Vano,
but there is still no e-mail. There is simply no e-mail sent!
   
Hi Vano, would you have this code may take a look? I think in the code does not error.

      $site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);
      $msg = $lang['comment_success'];
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
   $recipient_name = $image_row['user_name'];
   $recipient_email = $image_row['user_email'];
   $image_url = $script_url."/img".$id;

   $sql = "SELECT user_allowmailcomments FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = '".$recipient_name."'";
$result = $site_db->query($sql);
   $row = $site_db->fetch_array($result);
   $user_allowmailcomments = ($row['user_allowmailcomments']);

   if ($image_row['user_id'] != $user_info['user_id'] && $user_allowmailcomments == 1) {
   $current_time = time();
   include(ROOT_PATH.'includes/email.php');
   $site_email = new Email();
   $site_email->set_to($recipient_email);
   $site_email->set_from($config['site_email'], $config['site_name']);
   $site_email->set_subject($lang['send_comment_emailsubject']);
   $site_email->register_vars(array(
     "user_name" => stripslashes($user_name),
     "recipient_name" => stripslashes($image_row['user_name']),
     "image_name" => $image_row['image_name'],
     "comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
     "site_name" => $config['site_name'],
     "image_url" => $image_url,
     "comment_text" =>(stripslashes($comment_text)),
     "comment_headline"=>(stripslashes($comment_headline)),
          ));
    $site_email->set_body("comment_email", $config['language_dir']);
    $site_email->send_email();
    }
//---------------------------------------------------- 
    }
  }
  unset($row);
  unset($spam_row);
}

//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: Sunny C. on June 28, 2009, 02:17:38 PM
Please help me  :(
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: daymos on August 23, 2009, 12:11:12 AM
Hi All.
I don't receive any comment_mail.

Code: [Select]
#
193.43.222.3 - - [22/Aug/2009:14:26:14 -0700] "POST /ajaxcomments.php?l=ukrainian&js&commentbg=1&l=ukrainian HTTP/1.1" 200 1409 "http://xxx.com/img653.htm?l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#
193.43.222.3 - - [22/Aug/2009:14:26:35 -0700] "GET /admin/email.php?action=emailusers&l=ukrainian HTTP/1.1" 200 5281 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
193.43.222.3 - - [22/Aug/2009:14:26:35 -0700] "GET /admin/email.php?action=emailusers&l=ukrainian HTTP/1.1" 200 5281 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#
193.43.222.3 - - [22/Aug/2009:14:26:40 -0700] "GET /admin/settings.php?action=modifysettings&l=ukrainian HTTP/1.1" 200 5538 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#
193.43.222.3 - - [22/Aug/2009:14:26:40 -0700] "GET /admin/settings.php?action=modifysettings&l=ukrainian HTTP/1.1" 200 5538 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#
193.43.222.3 - - [22/Aug/2009:14:26:46 -0700] "GET /admin/email.php?action=emailusers&l=ukrainian HTTP/1.1" 200 5281 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#
193.43.222.3 - - [22/Aug/2009:14:26:47 -0700] "GET /admin/email.php?action=emailusers&l=ukrainian HTTP/1.1" 200 5281 "http://xxx.com/admin/index.php?action=nav&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"

But when I sent email from ACP
Code: [Select]
#
193.43.222.3 - - [22/Aug/2009:14:38:58 -0700] "POST /admin/email.php?l=ukrainian HTTP/1.1" 200 1446 "http://xxx.com/admin/email.php?action=emailusers&l=ukrainian" "Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 WebMoney Advisor"
#

What's wrong?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: webbug on September 10, 2009, 03:36:34 PM
Hi to all.

Why admins do not receive comments for their images?
I'm using 1.7.4

Thanks.

UPDATE : Fix it . Thanks

I have the same issue.  My email address is set correctly.

Do I need to set anything related to mail? like SMTP, its off at the moment.
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on September 10, 2009, 03:47:10 PM
can you send/receive any kind of emails from your 4images?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: webbug on September 10, 2009, 04:00:04 PM
can you send/receive any kind of emails from your 4images?

Thanks for the hint V@no, I'm using admin and the email was set in the settings but not under the user settings.

Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: arabcine on September 28, 2009, 11:44:18 PM
thanks for this mod but how i can set Character set in commant_email ?
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: k1lljoy on February 16, 2010, 02:31:59 AM
Yep, the same thing - the mail is not sent... while all the other site letters are sent and received fine (account activation emails, new uploads notifiers for admins etc)
 :(
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: MrAndrew on May 14, 2010, 04:49:01 PM
I`ve installed MOD [Ajax comments....], e-mail is not sending to users...


THIS MOD NOT WOKING WITH INSTALLED [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21)

When i deleted this mod, it works perfectly...

Thanks for this important mod
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: zakaria666 on September 08, 2010, 05:40:52 PM
yep, doesnt work. i got AJAX commenting is well. Its a shame 50% of good MODS come from users and the other 50% from admins


 :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry:
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: V@no on September 09, 2010, 12:42:11 AM
Re: [MOD] AJAX Comments / Comments Rating v1.0.4 (2009-12-21) (http://www.4homepages.de/forum/index.php?topic=23866.msg149347#msg149347)
Title: Re: [Mod] Mail Owner of image when Comment is Posted
Post by: surferboy on October 31, 2010, 05:33:33 AM
Using v1.7.7

Pleased to report this MOD does work.

Note: did not work when a user posted on an admin-uploaded image but did work when one user commented on another user's uploaded image.

Hit me up if you want to see my files.

- Brian