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

0 Members and 1 Guest are viewing this topic.

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 #120 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...
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 #121 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 ?

Offline NTH

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

Offline macwise7

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #123 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!

Offline macwise7

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #124 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

Offline NTH

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #125 on: April 01, 2006, 09:27:33 AM »
Plz help me!!!

Offline NTH

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #126 on: April 03, 2006, 11:24:33 PM »
Somebody...help me...
This is my question
Posted on: March 30, 2006, 08:00:32 PM

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #127 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?
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline NTH

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #128 on: April 04, 2006, 08:07:07 AM »
OH!
Very Good!!!
THX    8)

Offline IWS_steffen

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Kreuzfahrtschiffe gestern und heute
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #129 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

Offline paburmester

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

Offline paburmester

  • Full Member
  • ***
  • Posts: 244
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #131 on: September 25, 2006, 09:50:05 PM »
help please :roll:

Offline Flo2005

  • Full Member
  • ***
  • Posts: 237
  • Copy & Paste Profi :)
    • View Profile
    • snuup.de! - Bilder - Sounds - Videos - fun4FREE!
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #132 on: October 26, 2006, 09:13:21 PM »

Project offline

Offline qpatrick

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #133 on: November 01, 2006, 11:41:20 AM »
Mod works in 1.7.4

Offline Zyga

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [Mod] Mail Owner of image when Comment is Posted
« Reply #134 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?


« Last Edit: December 26, 2006, 12:06:42 PM by Zyga »