Author Topic: [MOD] PM to owner of image when Comment ist posted  (Read 61722 times)

0 Members and 1 Guest are viewing this topic.

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
[MOD] PM to owner of image when Comment ist posted
« on: October 12, 2005, 01:22:56 PM »
This is a littel Tutorial to use the PMv2 Mod (http://www.4homepages.de/forum/index.php?topic=6692.0) to inform Image owner over new Comments.

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']);

2. Add below
Code: [Select]
$sql = "SELECT 'user_id', 'image_thumb_file', 'cat_id' FROM ".IMAGES_TABLE." WHERE image_id = $id";
$user_id = $site_db->query($sql);
$user_id = $image_row['user_id'];
if ($image_row['user_id'] != $user_info['user_id']) {
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";
$image_name_url = "[url=".$image_url."]".$image_name."[/url]";

if (!empty($image_row['image_thumb_file'])) {
$cat_id = $image_row['cat_id'];
$image_thumb_file = $image_row['image_thumb_file'];
$thumb = $site_sess->url(ROOT_PATH."data/thumbnails/".$cat_id."/".$image_thumb_file);
$thumb = "[url=".$image_url."][img]".$thumb."[/img][/url]";
} else {
$thumb = "";
}

$pm_from = 0; //Hier bitte die user_id vom Absender angeben
$pm_type = 5;
$pm_bbcode = 1;
$pm_smiles = 1;
$pm_sig = "-- \n Mit freundlichen Grüßen, \n euer Picsforfree.de Team";

$pm_message = "Das folgende Bild hat ein Kommentar von ".$user_name." erhalten: \n\n [B]Bild:[/B] ".$image_name_url."\n".$thumb." \n\n [B]Überschrift:[/B] ".$comment_headline." \n [B]Kommentar:[/B] ".$comment_text."\n\n".$pm_sig;
$pm_subject = "\"".$image_name."\" hat ein Kommentar von ".$user_name." erhalten";

$sql = "INSERT INTO ".PM_TABLE."
(pm_date, pm_to, pm_from, pm_subject, pm_type, pm_text, pm_bbcode, pm_html, pm_ip, pm_smiles)
VALUES
('".time()."', $user_id, $pm_from, '".$pm_subject."', $pm_type, '".$pm_message."', $pm_bbcode, 0, '".$session_info['session_ip']."', $pm_smiles)";
$result = $site_db->query($sql);
}

Thats all... (o:
« Last Edit: January 11, 2007, 05:28:54 PM by mawenzi »

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: PM to owner of image when Comment ist posted
« Reply #1 on: October 12, 2005, 03:56:52 PM »
hi Acidgod,

bin begeistert von der Idee und der Umsetzung ... dein MOD arbeitet tadellos ...  :D

Danke mawenzi
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 mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: PM to owner of image when Comment ist posted
« Reply #2 on: October 12, 2005, 04:31:11 PM »
eine kleine Ergänzung :

wenn man in der PM gleich ein klickbares Vorschaubild (Thumbnail) mit anzeigen lassen möchte,
dann wäre nur [thumb=".$id."] hinzuzufügen,
bzw. wäre die folgende Codezeile :
Code: [Select]
$pm_message = "Das folgende Bild hat ein Kommentar von ".$user_name." erhalten: \n\n [B]Bild:[/B] [url=".$images_url."]".$image_name."[/url] \n [B]Überschrift:[/B] ".$comment_headline." \n [B]Kommentar:[/B] ".$comment_text."\n\n -- \n Mit freundlichen Grüßen, \n ";

gegen diese Codezeile auszutauschen :
Code: [Select]
$pm_message = "Das folgende Bild hat ein Kommentar von ".$user_name." erhalten: \n\n [B]Bild:[/B] [url=".$image_url."]".$image_name."[/url] \n \n [thumb=".$id."] \n\n  [B]Überschrift:[/B] ".$comment_headline." \n [B]Kommentar:[/B] ".$comment_text."\n\n -- \n Mit freundlichen Grüßen, \n ";

Nochmals ... Klasse MOD ... und danke Acidgod !

PS. der kleine Schreibfehler $images_url ... richtig : $image_url wird mit der ausgetauschten Codezeile gleich berichtigt.

mawenzi
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 Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: PM to owner of image when Comment ist posted
« Reply #3 on: October 12, 2005, 05:58:02 PM »
Also das mit dem Thumb klappt bei mir so nicht... (o:

Aber ich habe noch eine If Abfrage hinzugefügt und jetzt bekommt man keine PN wenn man seine eigenen Bilder kommentiert.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: PM to owner of image when Comment ist posted
« Reply #4 on: October 12, 2005, 06:24:48 PM »
Die Funktion [thumb=xxxx] bringt der erweiterte BB-Tag-Editor mit !
Mehr dazu kannst du hier und in den folgenden Beiträgen nachlesen.

mawenzi
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 Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: PM to owner of image when Comment ist posted
« Reply #5 on: October 12, 2005, 07:17:49 PM »
So habe die Thumbnails jetzt auch mit eingebaut ohne das man den BBCode Mod miteinbauen muss... (o:

Offline Flo2005

  • Full Member
  • ***
  • Posts: 237
  • Copy & Paste Profi :)
    • View Profile
    • snuup.de! - Bilder - Sounds - Videos - fun4FREE!
Re: PM to owner of image when Comment ist posted
« Reply #6 on: October 23, 2005, 11:32:49 PM »
I only get a pm but no email when a comment was given to a file - my email notify for pm´s is on!


by Flo2005

Project offline

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: PM to owner of image when Comment ist posted
« Reply #7 on: October 24, 2005, 09:56:34 AM »
Thats right...

I think its enought wenn the User comes back an see where is a new comment.

You also can combine this with the "eMail to owner of images..." Mod

Offline Flo2005

  • Full Member
  • ***
  • Posts: 237
  • Copy & Paste Profi :)
    • View Profile
    • snuup.de! - Bilder - Sounds - Videos - fun4FREE!
Re: PM to owner of image when Comment ist posted
« Reply #8 on: October 24, 2005, 10:01:33 AM »
Okay - that´s a good idea - thanks a lot!

Project offline

Offline Flo2005

  • Full Member
  • ***
  • Posts: 237
  • Copy & Paste Profi :)
    • View Profile
    • snuup.de! - Bilder - Sounds - Videos - fun4FREE!
Re: PM to owner of image when Comment ist posted
« Reply #9 on: October 24, 2005, 10:08:40 AM »
One thing:

Is it possible that the user can turn it on/off in the control panel when a comment is posted :?:

cya by Flo2005

Project offline

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: PM to owner of image when Comment ist posted
« Reply #10 on: October 24, 2005, 10:17:42 AM »
Not jet...
But you can use the  user_allowemails Field for this...

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: PM to owner of image when Comment ist posted
« Reply #11 on: October 24, 2005, 05:57:32 PM »
Also das mit dem Thumb klappt bei mir so nicht... (o:

Aber ich habe noch eine If Abfrage hinzugefügt und jetzt bekommt man keine PN wenn man seine eigenen Bilder kommentiert.

könntest du diese vielleicht noch posten?

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: PM to owner of image when Comment ist posted
« Reply #12 on: October 24, 2005, 06:19:40 PM »
Habe es oben gleich mit eingebaut... (o:

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: PM to owner of image when Comment ist posted
« Reply #13 on: October 25, 2005, 02:28:04 PM »
wunderbar!

hab gestern den pm mod installiert und dein script.


benutze die pm funktion von phpbb aber - die von vano (mit deinen csript) ist jetzt das nachrichtensystem - user werden nur über neu kommentierte bilder informiert :)

Offline Flo2005

  • Full Member
  • ***
  • Posts: 237
  • Copy & Paste Profi :)
    • View Profile
    • snuup.de! - Bilder - Sounds - Videos - fun4FREE!
Re: PM to owner of image when Comment ist posted
« Reply #14 on: October 26, 2005, 06:56:35 PM »
Flo:
Quote
One thing:

Is it possible that the user can turn it on/off in the control panel when a comment is posted

cya by Flo2005

--------------------------------------------------------------------------------
Acidgod:
Quote
Not jet...
But you can use the  user_allowemails Field for this...

Also man kann diese Funktion nicht mit "Emails von Administratoren erhalten" abschalten, was muss an der Emailfunktion geändert werden?

Users cannot turn off the pm function with "user_allowemails" when comment is post, what must I change to realize this?

Flo2005

Project offline