Subscribe to Comments - Version 2.0.8

Version Description

Download this release

Release Info

Developer markjaquith
Plugin Icon wp plugin Subscribe to Comments
Version 2.0.8
Comparing to
See all releases

Code changes from version 2.0.7 to 2.0.8

Files changed (1) hide show
  1. subscribe-to-comments.php +17 -9
subscribe-to-comments.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Subscribe To Comments
4
- Version: 2.0.7
5
  Plugin URI: http://txfx.net/code/wordpress/subscribe-to-comments/
6
  Description: Allows readers to recieve notifications of new comments that are posted to an entry. Based on version 1 from <a href="http://scriptygoddess.com/">Scriptygoddess</a>
7
  Author: Mark Jaquith
@@ -87,10 +87,10 @@ if ( !$sg_subscribe->current_viewer_subscription_status() ) :
87
  <?php /* This is the text that is displayed for users who are NOT subscribed */ ?>
88
  <?php /* ------------------------------------------------------------------- */ ?>
89
 
90
- <form action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ?>" method="post">
91
  <input type="hidden" name="solo-comment-subscribe" value="solo-comment-subscribe" />
92
  <input type="hidden" name="postid" value="<?php echo $id; ?>" />
93
- <input type="hidden" name="ref" value="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" />
94
 
95
  <p class="solo-subscribe-to-comments">
96
  <?php _e('Subscribe without commenting', 'subscribe-to-comments'); ?>
@@ -291,9 +291,14 @@ class sg_subscribe {
291
  $this->after_manager = stripslashes($this->settings['after_manager']);
292
  }
293
 
 
 
 
 
 
294
  foreach (array('email', 'key', 'ref', 'new_email') as $var) {
295
  if ( isset($_REQUEST[$var]) && !empty($_REQUEST[$var]) )
296
- $this->{$var} = trim($_REQUEST[$var]);
297
  }
298
  if ( !$this->key )
299
  $this->key = 'unset';
@@ -639,7 +644,7 @@ class sg_subscribe {
639
  $subject = __('E-mail change confirmation', 'subscribe-to-comments');
640
  $message = sprintf(__("You are receiving this message to confirm a change of e-mail address for your subscriptions at \"%s\"\n\n", 'subscribe-to-comments'), get_bloginfo('blogname'));
641
  $message .= sprintf(__("To change your e-mail address to %s, click this link:\n\n", 'subscribe-to-comments'), $this->new_email);
642
- $message .= get_bloginfo('wpurl') . "/wp-subscription-manager.php?email=" . $this->email . "&new_email=" . $this->new_email . "&key=" . $this->generate_key($this->email . $this->new_email) . ".\n\n";
643
  $message .= __('If you did not request this action, please disregard this message.', 'subscribe-to-comments');
644
  return $this->send_mail($this->email, $subject, $message);
645
  }
@@ -651,7 +656,7 @@ class sg_subscribe {
651
  $subject = __('E-mail block confirmation', 'subscribe-to-comments');
652
  $message = sprintf(__("You are receiving this message to confirm that you no longer wish to receive e-mail comment notifications from \"%s\"\n\n", 'subscribe-to-comments'), get_bloginfo('name'));
653
  $message .= __("To cancel all future notifications for this address, click this link:\n\n", 'subscribe-to-comments');
654
- $message .= get_bloginfo('wpurl') . "/wp-subscription-manager.php?email=" . $email . "&key=" . $this->generate_key($email . 'blockrequest') . "&blockemailconfirm=true" . ".\n\n";
655
  $message .= __("If you did not request this action, please disregard this message.", 'subscribe-to-comments');
656
  return $this->send_mail($email, $subject, $message);
657
  }
@@ -752,7 +757,6 @@ class sg_subscribe {
752
  if ( strtolower($post_author->user_email) == $email && $loggedin )
753
  return 'admin';
754
 
755
-
756
  if ( is_array($this->subscriptions_from_email($email)) )
757
  if ( in_array($post->ID, $this->email_subscriptions) ) return $email;
758
  return false;
@@ -762,10 +766,11 @@ class sg_subscribe {
762
  function manage_link($email='', $html=true, $echo=true) {
763
  $link = get_bloginfo('wpurl') . '/wp-subscription-manager.php';
764
  if ( $email != 'admin' ) {
765
- $link = add_query_arg('email', urlencode($email), $link);
766
  $link = add_query_arg('key', $this->generate_key($email), $link);
767
  }
768
- $link = add_query_arg('ref', urlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), $link);
 
769
  if ( $html )
770
  $link = htmlentities($link);
771
  if ( !$echo )
@@ -829,4 +834,7 @@ add_action('init', create_function('$a','global $sg_subscribe; if ( $_POST[\'sol
829
  $sg_subscribe->solo_subscribe($_POST[\'email\'], $_POST[\'postid\']);
830
  }')
831
  );
 
 
 
832
  ?>
1
  <?php
2
  /*
3
  Plugin Name: Subscribe To Comments
4
+ Version: 2.0.8
5
  Plugin URI: http://txfx.net/code/wordpress/subscribe-to-comments/
6
  Description: Allows readers to recieve notifications of new comments that are posted to an entry. Based on version 1 from <a href="http://scriptygoddess.com/">Scriptygoddess</a>
7
  Author: Mark Jaquith
87
  <?php /* This is the text that is displayed for users who are NOT subscribed */ ?>
88
  <?php /* ------------------------------------------------------------------- */ ?>
89
 
90
+ <form action="http://<?php echo $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI']); ?>" method="post">
91
  <input type="hidden" name="solo-comment-subscribe" value="solo-comment-subscribe" />
92
  <input type="hidden" name="postid" value="<?php echo $id; ?>" />
93
+ <input type="hidden" name="ref" value="<?php echo urlencode('http://' . $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI'])); ?>" />
94
 
95
  <p class="solo-subscribe-to-comments">
96
  <?php _e('Subscribe without commenting', 'subscribe-to-comments'); ?>
291
  $this->after_manager = stripslashes($this->settings['after_manager']);
292
  }
293
 
294
+ // version 2.0.8 -- allow plugin file to be renamed or placed in a subdirectory
295
+ if ( 'edit.php?page=subscribe-to-comments.php' == $this->form_action )
296
+ $this->form_action = 'edit.php?page=' . STC_PLUGIN_BASENAME;
297
+
298
+
299
  foreach (array('email', 'key', 'ref', 'new_email') as $var) {
300
  if ( isset($_REQUEST[$var]) && !empty($_REQUEST[$var]) )
301
+ $this->{$var} = wp_specialchars(trim($_REQUEST[$var]));
302
  }
303
  if ( !$this->key )
304
  $this->key = 'unset';
644
  $subject = __('E-mail change confirmation', 'subscribe-to-comments');
645
  $message = sprintf(__("You are receiving this message to confirm a change of e-mail address for your subscriptions at \"%s\"\n\n", 'subscribe-to-comments'), get_bloginfo('blogname'));
646
  $message .= sprintf(__("To change your e-mail address to %s, click this link:\n\n", 'subscribe-to-comments'), $this->new_email);
647
+ $message .= get_bloginfo('wpurl') . "/wp-subscription-manager.php?email=" . urlencode($this->email) . "&new_email=" . urlencode($this->new_email) . "&key=" . $this->generate_key($this->email . $this->new_email) . ".\n\n";
648
  $message .= __('If you did not request this action, please disregard this message.', 'subscribe-to-comments');
649
  return $this->send_mail($this->email, $subject, $message);
650
  }
656
  $subject = __('E-mail block confirmation', 'subscribe-to-comments');
657
  $message = sprintf(__("You are receiving this message to confirm that you no longer wish to receive e-mail comment notifications from \"%s\"\n\n", 'subscribe-to-comments'), get_bloginfo('name'));
658
  $message .= __("To cancel all future notifications for this address, click this link:\n\n", 'subscribe-to-comments');
659
+ $message .= get_bloginfo('wpurl') . "/wp-subscription-manager.php?email=" . urlencode($email) . "&key=" . $this->generate_key($email . 'blockrequest') . "&blockemailconfirm=true" . ".\n\n";
660
  $message .= __("If you did not request this action, please disregard this message.", 'subscribe-to-comments');
661
  return $this->send_mail($email, $subject, $message);
662
  }
757
  if ( strtolower($post_author->user_email) == $email && $loggedin )
758
  return 'admin';
759
 
 
760
  if ( is_array($this->subscriptions_from_email($email)) )
761
  if ( in_array($post->ID, $this->email_subscriptions) ) return $email;
762
  return false;
766
  function manage_link($email='', $html=true, $echo=true) {
767
  $link = get_bloginfo('wpurl') . '/wp-subscription-manager.php';
768
  if ( $email != 'admin' ) {
769
+ $link = add_query_arg('email', urlencode(urlencode($email)), $link);
770
  $link = add_query_arg('key', $this->generate_key($email), $link);
771
  }
772
+ $link = add_query_arg('ref', urlencode('http://' . $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI'])), $link);
773
+ $link = str_replace('+', '%2B', $link);
774
  if ( $html )
775
  $link = htmlentities($link);
776
  if ( !$echo )
834
  $sg_subscribe->solo_subscribe($_POST[\'email\'], $_POST[\'postid\']);
835
  }')
836
  );
837
+
838
+ define('STC_PLUGIN_BASENAME', plugin_basename(__FILE__));
839
+
840
  ?>