Plugin Directory

Changeset 1065578


Ignore:
Timestamp:
01/12/2015 04:06:44 AM (11 years ago)
Author:
tjsantilo
Message:

name change, added notification feature

Location:
because/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • because/trunk/public/includes/class-sp_comments.php

    r1038441 r1065578  
    8282
    8383            add_action('comment_post', array( $this,'check_user_vote'));
     84
     85            add_action('comment_post', array( $this,'add_subscription'));
     86
     87            add_action('comment_post', array( $this,'notify_email'));
     88
     89           
    8490
    8591           
     
    177183            $query = "SELECT meta_key FROM $table WHERE post_id='" . $post_id . "' AND meta_value='" . $vote_val->vote_value . "'";
    178184            $ans_choice = $wpdb->get_row($query);
    179             add_comment_meta($comment_id,'test','test');   
    180185
    181186            // add vote identifier to the comment
     
    189194    }
    190195
     196    public function add_subscription($comment_id){
     197        global $wpdb;
     198
     199        if ($_POST['subscribe_comments']=="yes"){
     200           
     201            add_comment_meta($comment_id,'subscribed','yes');
     202        }
     203    }
     204
     205    public function notify_email($comment_id){
     206        $comment = get_comment($comment_id);
     207
     208        if ('0' != $comment->comment_parent){
     209            $a = get_comment_meta($comment->comment_parent,'subscribed',true);
     210           
     211            if(get_comment_meta($comment->comment_parent,'subscribed',true)=="yes"){
     212                $parent_comment = get_comment($comment->comment_parent);
     213               
     214                $message = "Someone has replied to your comment on the post: '" . get_the_title() . "'!\n\n" .
     215                "You can view the comment at the following link: " .
     216                get_post_permalink() . "#comment-" . $comment_id;
     217
     218
     219
     220                wp_mail( $parent_comment->comment_author_email, 'You have a reply to your wordpress comment!', $message );
     221
     222               
     223
     224
     225            }
     226
     227           
     228
     229        }
     230    }
    191231
    192232      /**
     
    14801520
    14811521    <input type="hidden"  name="comment" id="thecomment_field" value="socialpolling_verb" readonly="readonly" />
     1522    <input type="checkbox" name="subscribe_comments" id="subscribe_comments" value="yes">
     1523    <label for="subscribe_comments">Do you want to be emailed if someone replies to your comment?</label>
    14821524
    14831525    <?php
  • because/trunk/social-polling.php

    r1038441 r1065578  
    2121 * @link      http://www.teambecause.com
    2222
    23  * @copyright 2014 TeamBecause LLC
     23 * @copyright 2014 Conva LLC
    2424
    2525 *
     
    2727 * @wordpress-plugin
    2828
    29  * Plugin Name:       Because
    30 
    31  * Plugin URI:        www.teambecause.com
    32 
    33  * Description:       Because is a new commenting platform that increases audience engagement by providing new avenues for channelling audience discussions.
     29 * Plugin Name:       Conva
     30
     31 * Plugin URI:        www.conva.us
     32
     33 * Description:       Conva is a new commenting platform that increases audience engagement by providing new avenues for channelling audience discussions.
    3434
    3535<<<<<<< .mine
    36  * Version:           1.5.3
     36 * Version:           1.6
    3737=======
    38  * Version:           1.5.3
     38 * Version:           1.6
    3939>>>>>>> .r969865
    4040
Note: See TracChangeset for help on using the changeset viewer.