Forums

change Subscribe2 plugin (7 posts)

  1. courtneyelizabeth
    Member
    Posted 4 years ago #

    Hi!

    I'm using the Subscribe2 plugin and I was wondering if there was a way that I can run a query that

    1) adds a commenter's email to the subscription automatically *no email sent*.

    2) checks to make sure it's not already added

    now i was thinking that I could use the query that is used when admin adds a subscriber from the admin panel ....but I'm not sure WHERE to put it in the comment add function...

  2. courtneyelizabeth
    Member
    Posted 4 years ago #

    any help? thanks in advance!

  3. courtneyelizabeth
    Member
    Posted 4 years ago #

    *whimper*

  4. skippy
    Member
    Posted 4 years ago #

    You didn't even wait an hour before bumping. These kinds of feature requests are not life threatening, and as such we'll get to them when it's convenient for us. Be patient. Do not bump.

    You could create a new plugin, using portions of subscribe2, and registered against a comment action hook (comment_post might be a good one).

    Try this completely untested plugin. No support will be provided. You're on your own if you use it.

    <?php
    /*
    Plugin Name: s2_auto_sub
    Plugin URI: http://www.skippy.net/blog/
    Description: Automatically adds commenters to the subscribe2 list of recipients
    Version: 1.0
    Author: Scott Merrill
    Author URI: http://www.skippy.net/blog/
    */

    do_action('comment_post', 's2_auto_sub');

    function s2_auto_sub($comment_id = 0) {
    if (0 == $comment_id) return;
    $email = $wpdb->get_var("SELECT comment_author_email FROM $wpdb->comments WHERE comment_id = $comment_id");
    if ('' == $email) { return $comment_id; }
    if (is_email($email)) {
    if (! $wpdb->get_var("SELECT id FROM $s2_table WHERE email='$email'")) {
    $wpdb->query("INSERT INTO $s2_table (email, active) VALUES ('$email', '1')");
    } // if !
    } // if is_email
    } // end s2_auto_sub
    }

  5. courtneyelizabeth
    Member
    Posted 4 years ago #

    I actually posted it 7 days BEFORE i decided to bump.....

    and thanks, i'll test it out.

  6. skippy
    Member
    Posted 4 years ago #

    You are correct. I misread the timestamp. Please accept my apologies.

  7. courtneyelizabeth
    Member
    Posted 4 years ago #

    it didnt work...but thanks though Skippy...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags