Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorDani
    • CommentTimeMar 15th 2010
     
    question: I have a list of members stored in a table with id, name and email. How can I make all of the members recieve a mail when a comment has been posted? From the GUI (plog-options.php), it seems it's only possible to have one reciever, which is the admins mail.
    • CommentAuthorDani
    • CommentTimeMar 15th 2010 edited
     
    I have come one step further I think. I am editing plog-includes\plog-functions.php where I found the mail() function. I report my results later.
    • CommentAuthorDani
    • CommentTimeMar 19th 2010
     
    It finally works.

    Just one minor thing:
    $config['gallery_name'] and $config['album_name'] returns an empty string. The default plogger mail also returns an empty string, the subject for the notification mails are: "[] New Comment From Dani"
    How do I fix that so i can use album_name and gallery_name in the emails?
    •  
      CommentAuthorsidtheduck
    • CommentTimeMar 19th 2010
     
    Dani,

    Are you starting a new function? If so, you need to call:
    global $config;
    At the top of your function in order for it to register the global variable for the configuration array.
    • CommentAuthorDani
    • CommentTimeMar 19th 2010
     
    I tried to put that line to the top, but no difference. Plogger didn't even print the gallery name in the subjectfield by default! It was like "[] New Comment From Dani" from the beginning. No I haven't defined a new function.
    •  
      CommentAuthorsidtheduck
    • CommentTimeMar 19th 2010
     
    Dani,

    While looking into the large thumbnail issue, I checked your emailer script and edited a few things.

    First, $config['gallery_name'] doesn't print anything because the Gallery Name is not filled out in your Admin -> Options tab. Fill that out and it will be inserted in your email.

    Second, there is no $config['album_name'] variable. I added the necessary code to get the album data based on the picture id that the comment is posted on. Again, do a search for "//c(.)" if you want to see what I changed in your code.

    The emails should work just fine now if you check out those 2 options above.
    • CommentAuthorDani
    • CommentTimeMar 23rd 2010
     
    Thanks a lot! Excellent service!:)

    It seems I'm just starting to get a little issue with spam-comments. So if I turn on "Place New Comments Into Moderation", will the comment be placed into moderation before or after it's sending the emails? If it sends before, then it has no point to place it into moderation. Is there a ban function on plogger for spam-ip's ? On other places on my website with commentfields, I've installed a captcha script, even though I don't really like it, as it reduces people's will to comment.
    •  
      CommentAuthorsidtheduck
    • CommentTimeMar 24th 2010
     
    Dani,

    Currently the way you have it set up, it will send an email for all comments (regardless of moderation). You'd have to move the emailing code from where it is located (in the add_comment function) to the plog-admin/plog-feedback.php file where the comment is actually approved before sending out the email. Let me know if you need some help with that.
    • CommentAuthorDani
    • CommentTimeMar 25th 2010 edited
     
    .
    • CommentAuthorDani
    • CommentTimeMar 25th 2010
     
    I moved my mailingcode to plog-feedback.php and added these lines before my mailingcode:
    $picdata = get_picture_by_id($parent_id);
    $picurl = generate_url("picture", $parent_id, NULL, true);
    $albumdata = get_album_by_id($picdata['parent_album']); //c(.)

    But it seems picurl returns just "plog.php?level=picture&id=" and $albumdata['name'] is nothing.
    • CommentAuthorDani
    • CommentTimeJun 2nd 2010
     
    Hello again, I haven't been working on this issue for a while. I still can't get the variables right. In plog-feedback.php I have the following code:

    $sql_mail="SELECT SHA1(id) AS idsha1, name, email
    FROM member
    WHERE notify=2";
    $result_mail=mysql_query($sql_mail);
    $picdata = get_picture_by_id($parent_id);
    $picurl = generate_url("picture", $parent_id, NULL, true);
    $albumdata = get_album_by_id($picdata['parent_album']); //c(.)
    while($row_mail=mysql_fetch_assoc($result_mail))
    {
    $idsha1=$row_mail["idsha1"];
    $msg="$author has commented on a photo.

    You can see all the comments for this picture here: http://www.truemetal.org/cirithungol/$picurl


    Click the following link to unsubscribe: http://www.truemetal.org/cirithungol/maillist.php?action=unmail&id=$idsha1


    Cheers,
    the cirith ungol webpit admin
    http:/www.truemetal.org/cirithungol";

    mail(
    $row_mail["email"],
    "new comment - ".SmartStripSlashes($albumdata['name']),
    SmartStripSlashes($msg),
    "From: The Cirith Ungol Webpit <savx23@yahoo.no>"); //c(.)

    }


    "new comment - ".SmartStripSlashes($albumdata['name']), returns just "new comment - ", not the albumname.
    $picurl returns just "http://www.truemetal.org/cirithungol/plog.php?level=picture&id=", not the level and id.

    Can anyone help?
    • CommentAuthorDani
    • CommentTimeJun 4th 2010
     
    I found out that I need to look for the selected[] array, loop through it and get the author name based on that id. That would mean, if the site had high traffic, once in a while all users would receive a bunch of mails for each comments. Not 100% sure, but I think maybe it's a better idea to stick with the first method, and just add a secureimage to avoid too much spam.