protected function rejoin()
 {
     $prompt_post = new Prompt_Post($this->post_id);
     if ($prompt_post->is_subscribed($this->user_id)) {
         return;
     }
     $prompt_post->subscribe($this->user_id);
     Prompt_Subscription_Mailing::send_rejoin_notification($this->user_id, $prompt_post);
     return;
 }
 public static function after_form()
 {
     if (!Prompt_Core::$options->get('enable_comment_delivery') or empty(self::$prompt_post)) {
         return;
     }
     $current_user = Prompt_User_Handling::current_user();
     if (!$current_user or !self::$prompt_post->is_subscribed($current_user->ID)) {
         return;
     }
     echo html('div class="prompt-unsubscribe"', html('div class=".loading-indicator" style="display: none;"', html('img', array('src' => path_join(Prompt_Core::$url_path, 'media/ajax-loader.gif')))), html('p', __('You are subscribed to new comments on this post.', 'Postmatic')), scbForms::input(array('type' => 'submit', 'name' => self::UNSUBSCRIBE_ACTION, 'value' => __('Unsubscribe', 'Postmatic'))));
 }
Example #3
0
 /**
  * Handle unsubscribe requests from the comment form.
  */
 public static function action_wp_ajax_prompt_comment_unsubscribe()
 {
     if (!wp_verify_nonce($_POST['nonce'], self::AJAX_NONCE)) {
         wp_die(-1);
     }
     $post_id = absint($_POST['post_id']);
     if (!$post_id) {
         wp_die(0);
     }
     $current_user = Prompt_User_Handling::current_user();
     $prompt_post = new Prompt_Post($post_id);
     if (!$current_user or !$prompt_post->is_subscribed($current_user->ID)) {
         wp_die(0);
     }
     $prompt_post->unsubscribe($current_user->ID);
     _e('You have unsubscribed.', 'Postmatic');
     wp_die();
 }