You can say a big 'Thank you' to jmcreis, who was ready to pay to put this modification to the top on my to-do list
Replace my first modification with the following code:
$result = cpg_db_query("SELECT filename, title, owner_id FROM {$CONFIG['TABLE_PICTURES']} WHERE pid = $pid LIMIT 1");
$picture = cpg_db_fetch_rowset($result);
mysql_free_result($result);
if ($picture[0]['owner_id'] != USER_ID) {
$user_id_array[] = $picture[0]['owner_id'];
}
$result = cpg_db_query("SELECT author_id FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid = $pid AND author_id != 0");
while ($row = mysql_fetch_assoc($result)) {
if ($row['author_id'] != USER_ID) {
$user_id_array[] = $row['author_id'];
}
}
mysql_free_result($result);
if (count($user_id_array)) {
global $cpg_udb;
$title = $picture[0]['title'] ? $picture[0]['title'] : $picture[0]['filename'];
$mail_body = "Your picture '$title' has received a new comment. You can see it at " . ' ' . $CONFIG['ecards_more_pic_target'] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . $redirect;
$result = cpg_db_query("SELECT ".$cpg_udb->field['email']." AS user_email FROM ".$cpg_udb->usertable." WHERE ".$cpg_udb->field['user_id']." IN (".implode(', ', $user_id_array).")");
while ($row = mysql_fetch_assoc($result)) {
cpg_mail($row['user_email'], $lang_db_input_php['email_comment_subject'], make_clickable($mail_body));
}
mysql_free_result($result);
}
Hello Andre...
First, I am totally new to coppermine and have version 1.5.12 installed...What a phenomenal program. It solved all my photography club needs...!
Secondly, it has been hours spent trying to find a current thread related to sending the owner of a photo an e-mail, after someone makes a commetn on his image...So I am grateful I found this and hopes it is my solution.
Thirdly, I am new to this Forum and hope I am not posting this inquery in the wrong area...If so I apologize in advance.
After reading these threads, it appears that this e-mail notification code has been finalized and resolved, and the person who uploads an image receives an email stating that a comment has been made on his image...?
If so, and if I understand your instructions, I have to locate a file named
db_input.php somewhere on my external server and add the last, modified code you supplied...? Do I simply insert the above code in a new line, after I find the initial code...?
What exactly does this final code do...(1) Notify the original author that a comment has been made and (2) notify the person who made the comment that a comment had been made...?
You can see my site here:
http://www.grooppa.com/coppermine/index.php?cat=0 Thanks so much in advance...Respectfully...Christoph