Author Topic: [Mod] Mail Owner of image when Comment is Posted  (Read 261228 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #105 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 ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #106 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'
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline fgallery

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • ::: F-Gallery :: Photobank :::
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #107 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 ;)
http://f-gallery.com.ua
Artistic Photography, Fashion Photography, Cities and Streets of The World, Personal Photos of Livejournal Users.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #108 on: January 23, 2006, 01:56:24 AM »
@fgallery:

That's right. Good to know you got it covered. ;)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #109 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'
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #110 on: January 23, 2006, 11:54:40 PM »
@JensF:

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

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #111 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
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #112 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:

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #113 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. ;)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #114 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...
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #115 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. ;)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #116 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....
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #117 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 ! )
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #118 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:
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #119 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: