Subscribe2 - Version 4.5

Version Description

Download this release

Release Info

Developer MattyRob
Plugin Icon 128x128 Subscribe2
Version 4.5
Comparing to
See all releases

Code changes from version 4.3 to 4.5

ReadMe.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: MattyRob, Skippy, RavanH
3
  Donate link: http://subscribe2.wordpress.com/donate/
4
  Tags: posts, subscription, email
5
  Requires at least: 2.0.x
6
- Tested up to: 2.3.2
7
- Stable tag: 4.3
8
 
9
  Sends a list of subscribers an email notification when new posts are published to your blog
10
 
@@ -26,18 +26,17 @@ So for each new post you make, you may receive up to three emails.
26
 
27
  == Installation ==
28
 
29
- 1. Copy buttonsnap.php into your /wp-content/plugins directory.
30
- 2. Copy the entire /subscribe2/ directory into your /wp-content/plugins/ directory.
31
- 3. Activate the plugin.
32
- 4. Click the "Options" admin menu link, and select "Subscribe2".
33
- 5. Configure the options to taste, including the email template and any categories which should be excluded from notification
34
- 6. Click the "Manage" admin menu link, and select "Subscribers".
35
- 7. Manually subscribe people as you see fit.
36
- 8. Create a WordPress Page (http://codex.wordpress.org/Pages) to display the subscription form. When creating the page, you may click the "S2" button on the QuickBar to automatically insert the subscribe2 token. Or, if you prefer, you may manually insert the subscribe2 token:
37
  <!--subscribe2-->
38
  ***Ensure the token is on a line by itself and that it has a blank line above and below.***
39
  This token will automatically be replaced by the subscription form, and will display all messages as necessary.
40
- 9. In the subscribe2.php file define S2PAGE to point at your WordPress page created in step 8.
41
 
42
  == Frequently Asked Questions ==
43
 
@@ -46,7 +45,7 @@ WordPress 2.0.x will be supported until 2010. Subscribe2 will remain supported (
46
 
47
  WordPress 2.1.x and 2.2.x are supported. For the latest information visit http://subscribe2.wordpress.com. For these versions of WordPress use Subscribe2 code from the 3.x stable.
48
 
49
- Finally, WordPress 2.3 is supported. Again, for the latest information visit http://subscribe2.wordpress.com. For this versions of WordPress use Subscribe2 code from the 4.x stable.
50
 
51
  = How do I upgrade from a previous version? =
52
  If you are upgrading from any 2.1.x version of subscribe2, please delete both the /subscribe.php and /wp-content/plugins/subscribe2.php files before copying the new files into place. Your subscriber list will remain intact, and your options should be preserved. Now create a WordPress Page as described above.
@@ -65,7 +64,7 @@ Subscribe2 provides a facility to work around this restriction by sending batche
65
  define('BCCLIMIT', 0);
66
  Change the 0 to the number of allowed outgoing email recipients as set by your host.
67
 
68
- Reminder: because subscribe2 places all recipients in BCC fields, and places the blog admin in the TO field, the blog admin will receive one email per batched delivery. So if you have 90 subscribers, the blog admin should receive three post notification emails, one for eah set of 30 BCC recipients.
69
 
70
  Batches will occur for each group of message as described above. A site on Dreamhost with many public and registered subscribers could conceivably generate a lot of email for your own inbox.
71
 
@@ -78,6 +77,34 @@ Batches will occur for each group of message as described above. A site on Drea
78
 
79
  == Version History ==
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  Version 4.3 by Matthew Robinson
82
 
83
  * Fixed bug where digest emails were sent to unsubscribed users - Thanks to Mr Papa
3
  Donate link: http://subscribe2.wordpress.com/donate/
4
  Tags: posts, subscription, email
5
  Requires at least: 2.0.x
6
+ Tested up to: 2.5
7
+ Stable tag: 4.5
8
 
9
  Sends a list of subscribers an email notification when new posts are published to your blog
10
 
26
 
27
  == Installation ==
28
 
29
+ 1. Copy the entire /subscribe2/ directory into your /wp-content/plugins/ directory.
30
+ 2. Activate the plugin.
31
+ 3. Click the "Options" admin menu link, and select "Subscribe2".
32
+ 4. Configure the options to taste, including the email template and any categories which should be excluded from notification
33
+ 5. Click the "Manage" admin menu link, and select "Subscribers".
34
+ 6. Manually subscribe people as you see fit.
35
+ 7. Create a WordPress Page (http://codex.wordpress.org/Pages) to display the subscription form. When creating the page, you may click the "S2" button on the QuickBar to automatically insert the subscribe2 token. Or, if you prefer, you may manually insert the subscribe2 token:
 
36
  <!--subscribe2-->
37
  ***Ensure the token is on a line by itself and that it has a blank line above and below.***
38
  This token will automatically be replaced by the subscription form, and will display all messages as necessary.
39
+ 8. In the subscribe2.php file define S2PAGE to point at your WordPress page created in step 8.
40
 
41
  == Frequently Asked Questions ==
42
 
45
 
46
  WordPress 2.1.x and 2.2.x are supported. For the latest information visit http://subscribe2.wordpress.com. For these versions of WordPress use Subscribe2 code from the 3.x stable.
47
 
48
+ Finally, WordPress 2.3 and 2.5 are supported. Again, for the latest information visit http://subscribe2.wordpress.com. For this versions of WordPress use Subscribe2 code from the 4.x stable.
49
 
50
  = How do I upgrade from a previous version? =
51
  If you are upgrading from any 2.1.x version of subscribe2, please delete both the /subscribe.php and /wp-content/plugins/subscribe2.php files before copying the new files into place. Your subscriber list will remain intact, and your options should be preserved. Now create a WordPress Page as described above.
64
  define('BCCLIMIT', 0);
65
  Change the 0 to the number of allowed outgoing email recipients as set by your host.
66
 
67
+ Reminder: because subscribe2 places all recipients in BCC fields, and places the blog admin in the TO field, the blog admin will receive one email per batched delivery. So if you have 90 subscribers, the blog admin should receive three post notification emails, one for each set of 30 BCC recipients.
68
 
69
  Batches will occur for each group of message as described above. A site on Dreamhost with many public and registered subscribers could conceivably generate a lot of email for your own inbox.
70
 
77
 
78
  == Version History ==
79
 
80
+ Version 4.5 by Matthew Robinson
81
+
82
+ * Added Support for WordPress 2.5!
83
+ * Fixed HTML typo in admin submission message
84
+ * Fixed time display for cron jobs in Options->Subscribe2 when displayed on blogs using a time offset
85
+ * Added Debug plugin to the download package
86
+ * Improved descriptions of email template keywords in Options->Subscribe2
87
+ * Display subscribers in batches of 50 in Manage->Subscribers
88
+ * Fixed some XHTML validation errors
89
+ * Improved admin menu layout for compliance with WordPress 2.5
90
+ * Reverted to using wp_mail instead of mail to ensure proper header encoding
91
+ * Improved mail header formatting - thanks to Chris Carlson
92
+ * Add ability to skip email notification using a Custom Field (s2mail set as "no")
93
+ * Improved CSV export - thanks to Aaron Axelsen
94
+ * Added some compatibility for WPMU - thanks to Aaron Axelsen
95
+ * Added some error feedback to blog users if mails fail to send
96
+ * Moved Buttonsnap due to far to many fatal error complaints
97
+ * Added option to send notifications for Private posts
98
+ * Improved handling of notification for Password Protected Posts
99
+
100
+ Version 4.4 by Matthew Robinson
101
+
102
+ * Fixed non-substitution of TABLE keyword
103
+ * Fixed bug in usermeta update calls in unsubscribe_registered_users function
104
+ * Fixed bug in array handling in cron function that may have stopped emails sending
105
+ * Improved array handling in the Digest function
106
+ * Added an Un-installer to completely removed Subscribe2 from your WordPress install
107
+
108
  Version 4.3 by Matthew Robinson
109
 
110
  * Fixed bug where digest emails were sent to unsubscribed users - Thanks to Mr Papa
{subscribe2/include → include}/arrow_left.png RENAMED
File without changes
{subscribe2/include → include}/arrow_right.png RENAMED
File without changes
buttonsnap.php → include/buttonsnap.php RENAMED
File without changes
{subscribe2/include → include}/cross.png RENAMED
File without changes
{subscribe2/include → include}/options.php RENAMED
@@ -1,5 +1,5 @@
1
  <?php
2
- // include.php - Handles options and common functions for subscribe2
3
  // DO NOT EDIT THIS FILE AS IT IS SET BY THE OPTIONS PAGE
4
 
5
  if (!isset($this->subscribe2_options['autosub'])) {
@@ -22,6 +22,10 @@ if (!isset($this->subscribe2_options['password'])) {
22
  $this->subscribe2_options['password'] = "no";
23
  } // option for sending notifications for posts that are password protected
24
 
 
 
 
 
25
  if (!isset($this->subscribe2_options['email_freq'])) {
26
  $this->subscribe2_options['email_freq'] = "never";
27
  } // option for sending emails per-post or as a digest email on a cron schedule
1
  <?php
2
+ // include.php - Handles options for subscribe2
3
  // DO NOT EDIT THIS FILE AS IT IS SET BY THE OPTIONS PAGE
4
 
5
  if (!isset($this->subscribe2_options['autosub'])) {
22
  $this->subscribe2_options['password'] = "no";
23
  } // option for sending notifications for posts that are password protected
24
 
25
+ if (!isset($this->subscribe2_options['private'])) {
26
+ $this->subscribe2_options['private'] = "no";
27
+ } // option for sending notifications for posts that are private
28
+
29
  if (!isset($this->subscribe2_options['email_freq'])) {
30
  $this->subscribe2_options['email_freq'] = "never";
31
  } // option for sending emails per-post or as a digest email on a cron schedule
{subscribe2/include → include}/s2_button.png RENAMED
File without changes
{subscribe2/include → include}/s2_marker.png RENAMED
File without changes
{subscribe2/include → include}/spacer.gif RENAMED
File without changes
subscribe2/subscribe2.php → subscribe2.php RENAMED
@@ -3,13 +3,13 @@
3
  Plugin Name: Subscribe2
4
  Plugin URI: http://subscribe2.wordpress.com
5
  Description: Notifies an email list when new entries are posted.
6
- Version: 4.3
7
  Author: Matthew Robinson
8
  Author URI: http://subscribe2.wordpress.com
9
  */
10
 
11
  /*
12
- Copyright (C) 2006-7 Matthew Robinson
13
  Based on the Original Subscribe2 plugin by
14
  Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
15
 
@@ -41,11 +41,14 @@ define('S2PAGE', '0');
41
 
42
  // our version number. Don't touch this or any line below
43
  // unless you know exacly what you are doing
44
- define('S2VERSION', '4.3');
45
  define ('S2PATH', trailingslashit(dirname(__FILE__)));
46
 
 
 
 
47
  // use Owen's excellent ButtonSnap library
48
- require(ABSPATH . 'wp-content/plugins/buttonsnap.php');
49
 
50
  $mysubscribe2 = new s2class;
51
  $mysubscribe2->s2init();
@@ -76,6 +79,8 @@ class s2class {
76
 
77
  $this->barred_domain = "<p>" . __('Sorry, email addresses at that domain are currently barred due to spam, please use an alternative email address.', 'subscribe2') . "</p>";
78
 
 
 
79
  $this->mail_sent = "<p>" . __('Message sent!', 'subscribe2') . "</p>";
80
 
81
  $this->form = "<form method=\"post\" action=\"\">" . __('Your email:', 'subscribe2') . "&#160;<input type=\"text\" name=\"email\" value=\"\" size=\"20\" />&#160;<br /><input type=\"radio\" name=\"s2_action\" value=\"subscribe\" checked=\"checked\" /> " . __('Subscribe', 'subscribe2') . " <input type=\"radio\" name=\"s2_action\" value=\"unsubscribe\" /> " . __('Unsubscribe', 'subscribe2') . " &#160;<input type=\"submit\" value=\"" . __('Send', 'subscribe2') . "\" /></form>\r\n";
@@ -240,9 +245,9 @@ class s2class {
240
  $this->myname = $admin->display_name;
241
  $this->myemail = $admin->user_email;
242
  }
243
- $headers = "From: " . $this->myname . " <" . $this->myemail . ">\n";
244
- $headers .= "Return-Path: <" . $this->myemail . ">\n";
245
- $headers .= "Reply-To: " . $this->myemail . "\n";
246
  $headers .= "X-Mailer:PHP" . phpversion() . "\n";
247
  $headers .= "Precedence: list\nList-Id: " . get_option('blogname') . "\n";
248
 
@@ -315,10 +320,10 @@ class s2class {
315
  if ( (defined('BCCLIMIT')) && (BCCLIMIT > 0) && (isset($batch)) ) {
316
  foreach ($batch as $bcc) {
317
  $newheaders = $headers . "$bcc\r\n";
318
- @mail($this->myemail, $subject, $mailtext, $newheaders);
319
  }
320
  } else {
321
- @mail($this->myemail, $subject, $mailtext, $headers);
322
  }
323
  return;
324
  } // end mail()
@@ -328,6 +333,8 @@ class s2class {
328
  */
329
  function publish($post = 0) {
330
  if (!$post) { return $post; }
 
 
331
 
332
  // are we doing daily digests? If so, don't send anything now
333
  if ($this->subscribe2_options['email_freq'] != 'never') { return $post; }
@@ -338,6 +345,17 @@ class s2class {
338
  return $post;
339
  }
340
 
 
 
 
 
 
 
 
 
 
 
 
341
  $post_cats = wp_get_post_categories($post->ID);
342
  $post_cats_string = implode(',', $post_cats);
343
  $check = false;
@@ -358,10 +376,10 @@ class s2class {
358
  }
359
  }
360
 
361
- // is this post set in the future?
362
- if ($post->post_date > current_time('mysql')) {
363
- // bail out
364
- return $post;
365
  }
366
 
367
  // lets collect our public subscribers
@@ -495,14 +513,15 @@ class s2class {
495
 
496
  $body = str_replace("LINK", $link, $body);
497
 
498
- $mailheaders .= "From: " . $admin->display_name . " <" . $admin->user_email . ">\n";
499
- $mailheaders .= "Return-Path: <" . $admin->user_email . ">\n";
 
500
  $mailheaders .= "X-Mailer:PHP" . phpversion() . "\n";
501
  $mailheaders .= "Precedence: list\nList-Id: " . get_option('blogname') . "\n";
502
  $mailheaders .= "MIME-Version: 1.0\n";
503
  $mailheaders .= "Content-Type: text/plain; charset=\"". get_bloginfo('charset') . "\"\n";
504
 
505
- @mail($this->email, $subject, $body, $mailheaders);
506
  } // end send_confirm()
507
 
508
  /* ===== Subscriber functions ===== */
@@ -632,17 +651,6 @@ class s2class {
632
  }
633
  } //end remind()
634
 
635
- /**
636
- Export email list to CSV download
637
- */
638
- function exportcsv($emails = '') {
639
- if ('' == $emails) {return false; }
640
-
641
- $f = fopen(ABSPATH . 'wp-content/email.csv', 'w');
642
- fwrite($f, $emails);
643
- fclose($f);
644
- } //end exportcsv
645
-
646
  /**
647
  Check email is not from a barred domain
648
  */
@@ -803,7 +811,11 @@ class s2class {
803
  $AND .= "AND ($and)";
804
  }
805
 
806
- $sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . " WHERE a.meta_key='s2_subscribed'" . $AND;
 
 
 
 
807
  $result = $wpdb->get_col($sql);
808
  if ($result) {
809
  $ids = implode(',', $result);
@@ -958,13 +970,13 @@ class s2class {
958
  if (!empty($remain)) {
959
  // remove subscription to these cat IDs and update s2_subscribed
960
  foreach ($cats as $id) {
961
- delete_usermeta($user_ID, 's2_cat' . $id, "$id");
962
  }
963
  update_usermeta($user_ID, 's2_subscribed', implode(',', $remain));
964
  } else {
965
  // remove subscription to these cat IDs and update s2_subscribed to ''
966
  foreach ($cats as $id) {
967
- delete_usermeta($user_ID, 's2_cat' . $id, "$id");
968
  }
969
  update_usermeta($user_ID, 's2_subscribed', '-1');
970
  }
@@ -1022,8 +1034,15 @@ class s2class {
1022
 
1023
  $what = '';
1024
  $reminderform = false;
 
 
1025
  $urlpath = str_replace("\\","/",S2PATH);
1026
  $urlpath = trailingslashit(get_option('siteurl')) . substr($urlpath,strpos($urlpath,"wp-content/"));
 
 
 
 
 
1027
 
1028
  // was anything POSTed ?
1029
  if (isset($_POST['s2_admin'])) {
@@ -1038,16 +1057,13 @@ class s2class {
1038
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) subscribed!', 'subscribe2') . "</strong></p></div>";
1039
  } elseif ('delete' == $_POST['s2_admin']) {
1040
  $this->delete($_POST['email']);
1041
- echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . $_POST['email'] . ' ' . __('deleted!', 'subscribe2') . "</strong</p>></div>";
1042
  } elseif ('toggle' == $_POST['s2_admin']) {
1043
  $this->toggle($_POST['email']);
1044
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . $_POST['email'] . ' ' . __('status changed!', 'subscribe2') . "</strong></p></div>";
1045
  } elseif ('remind' == $_POST['s2_admin']) {
1046
  $this->remind($_POST['reminderemails']);
1047
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Reminder Email(s) Sent!','subscribe2') . "</strong></p></div>";
1048
- } elseif ('exportcsv' == $_POST['s2_admin']) {
1049
- $this->exportcsv($_POST['exportcsv']);
1050
- echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('CSV File Created in wp-content','subscribe2') . "</strong></p></div>";
1051
  } elseif ( ('register' == $_POST['s2_admin']) && ('subscribe' == $_POST['manage']) ) {
1052
  $this->subscribe_registered_users($_POST['emails'], $_POST['category']);
1053
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Subscribed!','subscribe2') . "</strong></p></div>";
@@ -1058,6 +1074,7 @@ class s2class {
1058
  }
1059
 
1060
  if (isset($_POST['what'])) {
 
1061
  if ('all' == $_POST['what']) {
1062
  $what = 'all';
1063
  $confirmed = $this->get_public();
@@ -1070,14 +1087,14 @@ class s2class {
1070
  $subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
1071
  } elseif ('confirmed' == $_POST['what']) {
1072
  $what = 'confirmed';
1073
- $confirmed = $this->get_public();
1074
  $subscribers = $confirmed;
1075
  } elseif ('unconfirmed' == $_POST['what']) {
1076
  $what = 'unconfirmed';
1077
- $unconfirmed = $this->get_public(0);
1078
  $subscribers = $unconfirmed;
1079
- if (!empty($unconfirmed)) {
1080
- $reminderemails = implode(",", $unconfirmed);
1081
  $reminderform = true;
1082
  }
1083
  } elseif (is_numeric($_POST['what'])) {
@@ -1087,6 +1104,36 @@ class s2class {
1087
  $what = 'registered';
1088
  $subscribers = $registered;
1089
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1090
  } elseif ('' == $what) {
1091
  $what = 'registered';
1092
  $subscribers = $registered;
@@ -1107,6 +1154,35 @@ class s2class {
1107
  }
1108
  if (!empty($subscribers)) {
1109
  natcasesort($subscribers);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1110
  }
1111
  // safety check for our arrays
1112
  if ('' == $confirmed) { $confirmed = array(); }
@@ -1116,38 +1192,41 @@ class s2class {
1116
  // show our form
1117
  echo "<div class=\"wrap\">";
1118
  echo "<h2>" . __('Subscribe Addresses', 'subscribe2') . "</h2>\r\n";
1119
- echo "<form method=\"post\" action=\"\">\r\n";
 
1120
  if (function_exists('wp_nonce_field')) {
1121
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1122
  }
1123
  echo __('Enter addresses, one per line or comma-seperated', 'subscribe2') . "<br />\r\n";
1124
- echo "<textarea rows=\"2\" cols=\"80\" name=\"addresses\"></textarea><br />\r\n";
1125
- echo "<span class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Subscribe', 'subscribe2') . "\"/>\r\n";
1126
- echo "<input type=\"hidden\" name=\"s2_admin\" value=\"subscribe\" /></span>";
1127
  echo "</form></div>";
1128
 
1129
  // subscriber lists
1130
  echo "<div class=\"wrap\"><h2>" . __('Subscribers', 'subscribe2') . "</h2>\r\n";
1131
-
1132
  $this->display_subscriber_dropdown($what, __('Filter', 'subscribe2'));
1133
  // show the selected subscribers
1134
  $alternate = 'alternate';
1135
  if (!empty($subscribers)) {
1136
  echo "<p align=\"center\"><b>" . __('Registered on the left, confirmed in the middle, unconfirmed on the right', 'subscribe2') . "</b></p>\r\n";
1137
- if (is_writable(ABSPATH . 'wp-content')) {
1138
- $exportcsv = implode(",", $subscribers);
1139
- echo "<form method=\"post\" action=\"\">\r\n";
1140
- if (function_exists('wp_nonce_field')) {
1141
- wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1142
- }
1143
- echo "<input type=\"hidden\" name=\"exportcsv\" value=\"$exportcsv\" />\r\n";
1144
- echo "<input type=\"hidden\" name=\"s2_admin\" value=\"exportcsv\" />\r\n";
1145
- echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Save Emails to CSV File','subscribe2') . "\" /></p>\r\n";
1146
- echo "</form>\r\n";
1147
  }
 
 
 
 
1148
  }
 
1149
  echo "<table cellpadding=\"2\" cellspacing=\"2\">";
1150
  if (!empty($subscribers)) {
 
 
 
1151
  foreach ($subscribers as $subscriber) {
1152
  echo "<tr class=\"$alternate\">";
1153
  echo "<td width=\"75%\"";
@@ -1162,7 +1241,7 @@ class s2class {
1162
  if (in_array($subscriber, $unconfirmed) || in_array($subscriber, $confirmed) ) {
1163
  echo "(" . $this->signup_date($subscriber) . ")</td>\r\n";
1164
  echo "<td width=\"5%\" align=\"center\">\r\n";
1165
- echo "<form method=\"post\" action=\"\">";
1166
  if (function_exists('wp_nonce_field')) {
1167
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1168
  }
@@ -1182,12 +1261,12 @@ class s2class {
1182
  if (function_exists('wp_nonce_field')) {
1183
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1184
  }
1185
- echo "<span class=\"delete\">\r\n";
1186
  echo "<input type=\"hidden\" name=\"email\" value=\"$subscriber\" />\r\n";
1187
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"delete\" />\r\n";
1188
  echo "<input type=\"hidden\" name=\"what\" value=\"$what\" />\r\n";
1189
- echo "<input type=\"image\" src=\"" . $urlpath . "include/cross.png\"name=\"submit\" value=\"X\" />\r\n";
1190
- echo "</span></form>";
 
1191
  }
1192
  echo "</td></tr>\r\n";
1193
  ('alternate' == $alternate) ? $alternate = '' : $alternate = 'alternate';
@@ -1196,8 +1275,9 @@ class s2class {
1196
  echo "<tr><td align=\"center\"><b>" . __('NONE', 'subscribe2') . "</b></td></tr>\r\n";
1197
  }
1198
  echo "</table>";
 
1199
  if ($reminderform) {
1200
- echo "<form method=\"post\" action=\"\">\r\n";
1201
  if (function_exists('wp_nonce_field')) {
1202
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1203
  }
@@ -1211,8 +1291,10 @@ class s2class {
1211
  //show bulk managment form
1212
  echo "<div class=\"wrap\">";
1213
  echo "<h2>" . __('Categories', 'subscribe2') . "</h2>\r\n";
 
1214
  echo __('Existing Registered Users can be automatically (un)subscribed to categories using this section.', 'subscribe2') . "<br />\r\n";
1215
  echo "<strong><em style=\"color: red\">" . __('Consider User Privacy as changes cannot be undone', 'subscribe2') . "</em></strong><br />\r\n";
 
1216
  echo "<form method=\"post\" action=\"\">\r\n";
1217
  if (function_exists('wp_nonce_field')) {
1218
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
@@ -1271,11 +1353,13 @@ class s2class {
1271
  }
1272
  $this->subscribe2_options['sender'] = $sender;
1273
 
1274
- // send email for pages and password protected posts
1275
  $pages_option = $_POST['pages'];
1276
  $this->subscribe2_options['pages']= $pages_option;
1277
  $password_option = $_POST['password'];
1278
  $this->subscribe2_options['password']= $password_option;
 
 
1279
 
1280
  // send per-post or digest emails
1281
  $email_freq = $_POST['email_freq'];
@@ -1294,7 +1378,7 @@ class s2class {
1294
  } else {
1295
  if (!wp_next_scheduled('s2_digest_cron')) {
1296
  // if we are using digest schedule the event and prime last_cron as now
1297
- $time = time() + $interval;
1298
  if ($interval < 86400) {
1299
  // Schedule CRON events occurring less than daily starting now and periodically thereafter
1300
  $timestamp = &$time;
@@ -1343,6 +1427,7 @@ class s2class {
1343
  }
1344
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"options\" />\r\n";
1345
  echo "<h2>" . __('Delivery Options', 'subscribe2') . ":</h2>\r\n";
 
1346
  echo __('Send Emails for Pages', 'subscribe2') . ': ';
1347
  echo "<input type=\"radio\" name=\"pages\" value=\"yes\"";
1348
  if ('yes' == $this->subscribe2_options['pages']) {
@@ -1365,6 +1450,17 @@ class s2class {
1365
  echo " checked=\"checked\"";
1366
  }
1367
  echo " /> " . __('No', 'subscribe2') . "<br /><br />\r\n";
 
 
 
 
 
 
 
 
 
 
 
1368
  echo __('Send Email From', 'subscribe2') . ': ';
1369
  echo "<input type=\"radio\" name=\"sender\" value=\"author\"";
1370
  if ('author' == $this->subscribe2_options['sender']) {
@@ -1380,7 +1476,9 @@ class s2class {
1380
  echo __('Send Email as Digest', 'subscribe2') . ": <br /><br />\r\n";
1381
  $this->display_digest_choices();
1382
  }
 
1383
  echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
 
1384
  echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"1\" class=\"editform\">\r\n";
1385
  echo "<tr><td>";
1386
  echo __('New Post email (must not be empty)', 'subscribe2') . ":";
@@ -1391,10 +1489,10 @@ class s2class {
1391
  echo "<dl>";
1392
  echo "<dt><b>BLOGNAME</b></dt><dd>" . get_bloginfo('name') . "</dd>\r\n";
1393
  echo "<dt><b>BLOGLINK</b></dt><dd>" . get_bloginfo('url') . "</dd>\r\n";
1394
- echo "<dt><b>TITLE</b></dt><dd>" . __("the post's title", 'subscribe2') . "</dd>\r\n";
1395
  echo "<dt><b>POST</b></dt><dd>" . __("the excerpt or the entire post<br />(<i>based on the subscriber's preferences</i>)", 'subscribe2') . "</dd>\r\n";
1396
- echo "<dt><b>TABLE</b></dt><dd>" . __("a list of post titles (for digest emails)", 'subscribe2') . "</dd>\r\n";
1397
- echo "<dt><b>PERMALINK</b></dt><dd>" . __("the post's permalink", 'subscribe2') . "</dd>\r\n";
1398
  echo "<dt><b>MYNAME</b></dt><dd>" . __("the admin or post author's name", 'subscribe2') . "</dd>\r\n";
1399
  echo "<dt><b>EMAIL</b></dt><dd>" . __("the admin or post author's email", 'subscribe2') . "</dd>\r\n";
1400
  echo "<dt><b>AUTHORNAME</b></dt><dd>" . __("the post author's name", 'subscribe2') . "</dd>\r\n";
@@ -1410,7 +1508,9 @@ class s2class {
1410
 
1411
  // excluded categories
1412
  echo "<h2>" . __('Excluded Categories', 'subscribe2') . "</h2>\r\n";
 
1413
  echo "<strong><em style=\"color: red\">" . __('Posts assigned to any Excluded Category do not generate notifications and are not included in digest notifications', 'subscribe2') . "</em></strong><br />\r\n";
 
1414
  $this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
1415
  echo "<center><input type=\"checkbox\" name=\"reg_override\" value=\"1\"";
1416
  if ('1' == $this->subscribe2_options['reg_override']) {
@@ -1420,6 +1520,7 @@ class s2class {
1420
 
1421
  // show button in QuickTags
1422
  echo "<h2>" . __('Writing Options', 'subscribe2') . "</h2>\r\n";
 
1423
  echo "<input type=\"checkbox\" name=\"show_button\" value=\"1\"";
1424
  if ('1' == $this->subscribe2_options['show_button']) {
1425
  echo " checked=\"checked\"";
@@ -1432,9 +1533,11 @@ class s2class {
1432
  echo " checked=\"checked\"";
1433
  }
1434
  echo " /> " . __('Enable Subscribe2 Widget?', 'subscribe2') . "<br /><br />\r\n";
 
1435
 
1436
  //Auto Subscription for new registrations
1437
  echo "<h2>" . __('Auto Subscribe', 'subscribe2') . "</h2>\r\n";
 
1438
  echo __('Subscribe new users registering with your blog', 'subscribe2') . ":<br />\r\n";
1439
  echo "<input type=\"radio\" name=\"autosub\" value=\"yes\"";
1440
  if ('yes' == $this->subscribe2_options['autosub']) {
@@ -1478,14 +1581,17 @@ class s2class {
1478
  echo "checked=\"checked\" ";
1479
  }
1480
  echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . " <br /><br />";
 
1481
 
1482
  //barred domains
1483
  echo "<h2>" . __('Barred Domains', 'subscribe2') . "</h2>\r\n";
 
1484
  echo __('Enter domains to bar from public subscriptions: <br /> (Use a new line for each entry and omit the "@" symbol, for example email.com)', 'subscribe2');
1485
  echo "<br />\r\n<textarea style=\"width: 98%;\" rows=\"4\" cols=\"60\" name=\"barred\">" . $this->subscribe2_options['barred'] . "</textarea>";
 
1486
 
1487
  // submit
1488
- echo "<p align=\"center\"><span class=\"submit\"><input type=\"submit\" id=\"save\" name=\"submit\" value=\"" . __('Submit', 'subscribe2') . "\" /></span></p>";
1489
  echo "</form>\r\n";
1490
  echo "</div><div class=\"wrap\">";
1491
 
@@ -1496,11 +1602,11 @@ class s2class {
1496
  if (function_exists('wp_nonce_field')) {
1497
  wp_nonce_field('subscribe2-options_subscribers' . $s2nonce);
1498
  }
1499
- echo "<p align=\"center\"><span class=\"submit\">";
1500
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"RESET\" />";
1501
  echo "<input type=\"submit\" id=\"deletepost\" name=\"submit\" value=\"" . __('RESET', 'subscribe2') .
1502
  "\" />";
1503
- echo "</span></p></form></div>\r\n";
1504
 
1505
  include(ABSPATH . 'wp-admin/admin-footer.php');
1506
  // just to be sure
@@ -1574,6 +1680,7 @@ class s2class {
1574
  echo "<div class=\"wrap\">";
1575
  echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
1576
  echo "<form method=\"post\" action=\"\">";
 
1577
  if (function_exists('wp_nonce_field')) {
1578
  wp_nonce_field('subscribe2-user_subscribers' . $s2nonce);
1579
  }
@@ -1600,7 +1707,7 @@ class s2class {
1600
  }
1601
  echo " /> " . $value . "&nbsp;&nbsp;";
1602
  }
1603
- echo "<p style=\"color: red\">" . __('Note: HTML format will always deliver the full post', 'subscribe2') . ".</p>\r\n";
1604
  echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': &nbsp;&nbsp;';
1605
  echo "<input type=\"radio\" name=\"new_category\" value=\"yes\" ";
1606
  if ('yes' == get_usermeta($user_ID, 's2_autosub')) {
@@ -1612,6 +1719,7 @@ class s2class {
1612
  echo "checked=\"checked\" ";
1613
  }
1614
  echo "/> " . __('No', 'subscribe2') . "<br /><br />";
 
1615
 
1616
  // subscribed categories
1617
  echo "<h2>" . __('Subscribed Categories', 'subscribe2') . "</h2>\r\n";
@@ -1620,6 +1728,7 @@ class s2class {
1620
  // we're doing daily digests, so just show
1621
  // subscribe / unnsubscribe
1622
  echo __('Receive daily summary of new posts?', 'subscribe2') . ': &nbsp;&nbsp;';
 
1623
  echo "<input type=\"radio\" name=\"category\" value=\"digest\" ";
1624
  if (get_usermeta($user_ID, 's2_subscribed') != '-1') {
1625
  echo "checked=\"yes\" ";
@@ -1629,8 +1738,10 @@ class s2class {
1629
  echo "checked=\"yes\" ";
1630
  }
1631
  echo "/> " . __('No', 'subscribe2');
 
1632
  }
1633
 
 
1634
  // submit
1635
  echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __("Update Preferences", 'subscribe2') . " &raquo;\" /></p>";
1636
  echo "</form></div>\r\n";
@@ -1679,16 +1790,18 @@ class s2class {
1679
  // show our form
1680
  echo "<div class=\"wrap\"><h2>" . __('Send email to all subscribers', 'subscribe2') . "</h2>\r\n";
1681
  echo "<form method=\"post\" action=\"\">\r\n";
 
1682
  if (function_exists('wp_nonce_field')) {
1683
  wp_nonce_field('subscribe2-write_subscribers' . $s2nonce);
1684
  }
1685
- echo __('Subject', 'subscribe2') . ": <input type=\"text\" size=\"69\" name=\"subject\" value=\"" . __('A message from ', 'subscribe2') . get_option('blogname') . "\" /> <br />";
1686
  echo "<textarea rows=\"12\" cols=\"75\" name=\"message\"></textarea>";
1687
- echo "<br />\r\n";
1688
  echo __('Recipients: ', 'subscribe2');
1689
  $this->display_subscriber_dropdown('registered', false, array('all'));
1690
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"mail\" />";
1691
- echo "&nbsp;&nbsp;<span class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Send', 'subscribe2') . "\" /></span>&nbsp;";
 
1692
  echo "</form></div>\r\n";
1693
  echo "<div style=\"clear: both;\"><p>&nbsp;</p></div>";
1694
 
@@ -1791,7 +1904,7 @@ class s2class {
1791
  }
1792
 
1793
  if (false !== $submit) {
1794
- echo "<form method=\"post\" action=\"\">";
1795
  }
1796
  echo "<select name=\"what\">\r\n";
1797
  foreach ($who as $whom => $display) {
@@ -1813,7 +1926,7 @@ class s2class {
1813
  }
1814
  echo "</select>";
1815
  if (false !== $submit) {
1816
- echo "<span class=\"submit\"><input type=\"submit\" value=\"$submit\" /></span></form>\r\n";
1817
  }
1818
  } // end display_subscriber_dropdown()
1819
 
@@ -1852,11 +1965,12 @@ class s2class {
1852
  if ($scheduled_time) {
1853
  echo "<p><input type=\"checkbox\" name=\"reset_cron\" /> " . __('Reset the schedule time and date for periodic email notifications', 'subscribe2') . "</p>\r\n";
1854
  $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
1855
- $now = time();
1856
  echo "<p>" . __('Current server time is', 'subscribe2') . ": \r\n";
1857
- echo "<strong>" . gmdate($datetime, $now+ (get_option('gmt_offset') * 3600)) . "</strong></p>\r\n";
1858
- echo "<p>" . __('Next email notification will be sent', 'subscribe2') . ": \r\n";
1859
- echo "<strong>" . gmdate($datetime, wp_next_scheduled('s2_digest_cron') + (get_option('gmt_offset') * 3600)) . "</strong></p>\r\n";
 
 
1860
  } else {
1861
  echo "<br />";
1862
  }
@@ -1904,7 +2018,7 @@ class s2class {
1904
  Display our form; also handles (un)subscribe requests
1905
  */
1906
  function filter($content = '') {
1907
- if ( ('' == $content) || (! preg_match('|<!--subscribe2-->|', $content)) ) { return $content; }
1908
  $this->s2form = $this->form;
1909
 
1910
  global $user_ID;
@@ -1938,10 +2052,14 @@ class s2class {
1938
  if ('1' !== $this->is_public($this->email)) {
1939
  // the user is unknown or inactive
1940
  $this->add();
1941
- $this->send_confirm('add');
1942
  // set a variable to denote that we've already run, and shouldn't run again
1943
  $this->filtered = 1; //set this to not send duplicate emails
1944
- $this->s2form = $this->confirmation_sent;
 
 
 
 
1945
  } else {
1946
  // they're already subscribed
1947
  $this->s2form = $this->already_subscribed;
@@ -1955,15 +2073,18 @@ class s2class {
1955
  $this->send_confirm('del');
1956
  // set a variable to denote that we've already run, and shouldn't run again
1957
  $this->filtered = 1;
1958
- $this->s2form = $this->confirmation_sent;
 
 
 
 
1959
  }
1960
  $this->action='unsubscribe';
1961
  }
1962
  }
1963
  }
1964
  }
1965
- $content = preg_replace('|<!--subscribe2-->|', $this->s2form, $content);
1966
- return $content;
1967
  } // end filter()
1968
 
1969
  /**
@@ -2047,6 +2168,75 @@ class s2class {
2047
  }
2048
  }
2049
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2050
  /* ===== wp-cron functions ===== */
2051
  /**
2052
  Send a daily digest of today's new posts
@@ -2055,23 +2245,23 @@ class s2class {
2055
  global $wpdb;
2056
 
2057
  // collect posts
2058
- $now = date('Y-m-d H:i:s', time());
2059
  $prev = $this->subscribe2_options['last_s2cron'];
2060
  $posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content, post_type, post_password FROM $wpdb->posts WHERE post_date >= '$prev' AND post_date < '$now' AND post_status IN ('publish', 'private') AND post_type IN ('post', 'page')");
2061
 
2062
  // update last_s2cron execution time before completing or bailing
2063
  $this->subscribe2_options['last_s2cron'] = $now;
2064
  update_option('subscribe2_options', $this->subscribe2_options);
2065
-
2066
  // do we have any posts?
2067
  if (empty($posts)) { return; }
2068
 
2069
  // if we have posts, let's prepare the digest
 
2070
  foreach ($posts as $post) {
2071
  $post_cats = wp_get_post_categories($post->ID);
2072
  $post_cats_string = implode(',', $post_cats);
2073
- $diff = array_diff($post_cats, $all_post_cats);
2074
- $all_post_cats = array_merge(array($all_post_cats), array($diff));
2075
  $check = false;
2076
  // is the current post assigned to any categories
2077
  // which should not generate a notification email?
@@ -2080,6 +2270,12 @@ class s2class {
2080
  $check = true;
2081
  }
2082
  }
 
 
 
 
 
 
2083
  // is the current post private
2084
  // and should this not generate a notification email?
2085
  if ( ($this->subscribe2_options['password'] == "no") && ($post->post_password != '') ) {
@@ -2118,17 +2314,8 @@ class s2class {
2118
  $message .= $excerpt . "\r\n\r\n";
2119
  }
2120
 
2121
- $author = get_userdata($post->post_author);
2122
- $this->authorname = $author->display_name;
2123
-
2124
- // do we send as admin, or post author?
2125
- if ('author' == $this->subscribe2_options['sender']) {
2126
- // get author details
2127
- $user =& $author;
2128
- } else {
2129
- // get admin detailts
2130
- $user = $this->get_userdata();
2131
- }
2132
  $this->myemail = $user->user_email;
2133
  $this->myname = $user->display_name;
2134
 
@@ -2141,9 +2328,9 @@ class s2class {
2141
  $registered = $this->get_registered("cats=$all_post_cats_string");
2142
  $recipients = array_merge((array)$public, (array)$registered);
2143
  $mailtext = $this->substitute(stripslashes($this->subscribe2_options['mailtext']));
2144
- $body = str_replace("TABLE", $table, $mailtext);
2145
- $body = str_replace("POST", $message, $mailtext);
2146
- $this->mail($recipients, $subject, $body);
2147
  } // end subscribe2_cron
2148
 
2149
  /* ===== Our constructor ===== */
@@ -2183,7 +2370,19 @@ class s2class {
2183
  add_filter('the_title', array(&$this, 'title_filter'));
2184
  add_filter('the_content', array(&$this, 'confirm'));
2185
  }
 
 
 
 
 
 
 
 
 
2186
 
 
 
 
2187
  //add regular actions and filters
2188
  add_action('admin_head', array(&$this, 'admin_head'));
2189
  add_action('admin_menu', array(&$this, 'admin_menu'));
@@ -2214,7 +2413,7 @@ class s2class {
2214
  add_action('pending_to_publish', array(&$this, 'publish'));
2215
  add_action('private_to_publish', array(&$this, 'publish'));
2216
  add_action('future_to_publish', array(&$this, 'publish'));
2217
- if ($this->subscribe2_options['password'] == "yes") {
2218
  add_action('new_to_private', array(&$this, 'publish'));
2219
  add_action('draft_to_private', array(&$this, 'publish'));
2220
  add_action('pending_to_private', array(&$this, 'publish'));
@@ -2225,75 +2424,8 @@ class s2class {
2225
  $this->load_strings();
2226
  } // end subscribe2()
2227
 
2228
- /* ===== ButtonSnap configuration ===== */
2229
- /**
2230
- Register our button in the QuickTags bar
2231
- */
2232
- function button_init() {
2233
- if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) return;
2234
- if ( 'true' == get_user_option('rich_editing') ) {
2235
- // Load and append our TinyMCE external plugin
2236
- add_filter('mce_plugins', array(&$this, 'mce_plugins'));
2237
- add_filter('mce_buttons', array(&$this, 'mce_buttons'));
2238
- add_action('tinymce_before_init', array(&$this, 'tinymce_before_init'));
2239
- add_action('marker_css', array(&$this, 'button_css'));
2240
- } else {
2241
- buttonsnap_separator();
2242
- buttonsnap_jsbutton(get_option('siteurl') . '/wp-content/plugins/subscribe2/include/s2_button.png', __('Subscribe2', 'subscribe2'), 's2_insert_token();');
2243
- }
2244
- }
2245
-
2246
- /**
2247
- Style a marker in the Rich Text Editor for our tag
2248
- By default, the RTE suppresses output of HTML comments, so this
2249
- places a CSS style on our token in order to make it display
2250
- */
2251
- function button_css() {
2252
- $marker_url = get_option('siteurl') . '/wp-content/plugins/subscribe2/include/s2_marker.png';
2253
- echo "
2254
- .s2_marker {
2255
- display: block;
2256
- height: 45px;
2257
- margin-top: 5px;
2258
- background-image: url({$marker_url});
2259
- background-repeat: no-repeat;
2260
- background-position: center;
2261
- }
2262
- ";
2263
- }
2264
-
2265
- // Add buttons in WordPress v2.1+, thanks to An-archos
2266
- function mce_plugins($plugins) {
2267
- array_push($plugins, '-subscribe2quicktags');
2268
- return $plugins;
2269
- }
2270
-
2271
- function mce_buttons($buttons) {
2272
- array_push($buttons, 'separator');
2273
- array_push($buttons, 'subscribe2quicktags');
2274
- return $buttons;
2275
- }
2276
-
2277
- function tinymce_before_init() {
2278
- $this->fullpath = get_option('siteurl') . '/wp-content/plugins/subscribe2/tinymce/';
2279
- echo "tinyMCE.loadPlugin('subscribe2quicktags', '" . $this->fullpath . "');\n";
2280
- }
2281
-
2282
- function s2_edit_form() {
2283
- echo "<!-- Start Subscribe2 Quicktags Javascript -->\r\n";
2284
- echo "<script type=\"text/javascript\">\r\n";
2285
- echo "//<![CDATA[\r\n";
2286
- echo "function s2_insert_token() {
2287
- buttonsnap_settext('<!--subscribe2-->');
2288
- }\r\n";
2289
- echo "//]]>\r\n";
2290
- echo "</script>\r\n";
2291
- echo "<!-- End Subscribe2 Quicktags Javascript -->\r\n";
2292
- }
2293
-
2294
  /* ===== our variables ===== */
2295
  // cache variables
2296
- var $version = '';
2297
  var $subscribe2_options = array();
2298
  var $all_public = '';
2299
  var $all_unconfirmed = '';
3
  Plugin Name: Subscribe2
4
  Plugin URI: http://subscribe2.wordpress.com
5
  Description: Notifies an email list when new entries are posted.
6
+ Version: 4.5
7
  Author: Matthew Robinson
8
  Author URI: http://subscribe2.wordpress.com
9
  */
10
 
11
  /*
12
+ Copyright (C) 2006-8 Matthew Robinson
13
  Based on the Original Subscribe2 plugin by
14
  Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
15
 
41
 
42
  // our version number. Don't touch this or any line below
43
  // unless you know exacly what you are doing
44
+ define('S2VERSION', '4.5');
45
  define ('S2PATH', trailingslashit(dirname(__FILE__)));
46
 
47
+ // Is this WordPressMU or not?
48
+ define('S2_MU', (isset($wpmu_version) || (strpos($wp_version, 'wordpress-mu') !== false)));
49
+
50
  // use Owen's excellent ButtonSnap library
51
+ require(ABSPATH . 'wp-content/plugins/subscribe2/include/buttonsnap.php');
52
 
53
  $mysubscribe2 = new s2class;
54
  $mysubscribe2->s2init();
79
 
80
  $this->barred_domain = "<p>" . __('Sorry, email addresses at that domain are currently barred due to spam, please use an alternative email address.', 'subscribe2') . "</p>";
81
 
82
+ $this->error = "<p>" . __('Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2') . "</p>";
83
+
84
  $this->mail_sent = "<p>" . __('Message sent!', 'subscribe2') . "</p>";
85
 
86
  $this->form = "<form method=\"post\" action=\"\">" . __('Your email:', 'subscribe2') . "&#160;<input type=\"text\" name=\"email\" value=\"\" size=\"20\" />&#160;<br /><input type=\"radio\" name=\"s2_action\" value=\"subscribe\" checked=\"checked\" /> " . __('Subscribe', 'subscribe2') . " <input type=\"radio\" name=\"s2_action\" value=\"unsubscribe\" /> " . __('Unsubscribe', 'subscribe2') . " &#160;<input type=\"submit\" value=\"" . __('Send', 'subscribe2') . "\" /></form>\r\n";
245
  $this->myname = $admin->display_name;
246
  $this->myemail = $admin->user_email;
247
  }
248
+ $headers = "From: \"" . $this->myname . "\" <" . $this->myemail . ">\n";
249
+ $headers .= "Return-path: <" . $this->myemail . ">\n";
250
+ $headers .= "Reply-To: \"" . $this->myname . "\" <" . $this->myemail . ">\n";
251
  $headers .= "X-Mailer:PHP" . phpversion() . "\n";
252
  $headers .= "Precedence: list\nList-Id: " . get_option('blogname') . "\n";
253
 
320
  if ( (defined('BCCLIMIT')) && (BCCLIMIT > 0) && (isset($batch)) ) {
321
  foreach ($batch as $bcc) {
322
  $newheaders = $headers . "$bcc\r\n";
323
+ @wp_mail($this->myemail, $subject, $mailtext, $newheaders);
324
  }
325
  } else {
326
+ @wp_mail($this->myemail, $subject, $mailtext, $headers);
327
  }
328
  return;
329
  } // end mail()
333
  */
334
  function publish($post = 0) {
335
  if (!$post) { return $post; }
336
+ $s2mail = get_post_meta($post->ID, 's2mail', true);
337
+ if (strtolower(trim($s2mail)) == 'no') { return $post; }
338
 
339
  // are we doing daily digests? If so, don't send anything now
340
  if ($this->subscribe2_options['email_freq'] != 'never') { return $post; }
345
  return $post;
346
  }
347
 
348
+ // is this post set in the future?
349
+ if ($post->post_date > current_time('mysql')) {
350
+ // bail out
351
+ return $post;
352
+ }
353
+
354
+ //Are we sending notifications for password protected posts?
355
+ if ( ($this->subscribe2_options['password'] == "no") && ($post->post_password != '') ) {
356
+ return $post;
357
+ }
358
+
359
  $post_cats = wp_get_post_categories($post->ID);
360
  $post_cats_string = implode(',', $post_cats);
361
  $check = false;
376
  }
377
  }
378
 
379
+ // Are we sending notifications for Private posts?
380
+ if ($this->subscribe2_options['private'] == "yes") {
381
+ // don't send notification to public users
382
+ $check = true;
383
  }
384
 
385
  // lets collect our public subscribers
513
 
514
  $body = str_replace("LINK", $link, $body);
515
 
516
+ $mailheaders .= "From: \"" . $admin->display_name . "\" <" . $admin->user_email . ">\n";
517
+ $mailheaders .= "Reply-To: \"" . $admin->display_name . "\" <" . $admin->user_email . ">\n";
518
+ $mailheaders .= "Return-path: <" . $admin->user_email . ">\n";
519
  $mailheaders .= "X-Mailer:PHP" . phpversion() . "\n";
520
  $mailheaders .= "Precedence: list\nList-Id: " . get_option('blogname') . "\n";
521
  $mailheaders .= "MIME-Version: 1.0\n";
522
  $mailheaders .= "Content-Type: text/plain; charset=\"". get_bloginfo('charset') . "\"\n";
523
 
524
+ return @wp_mail($this->email, $subject, $body, $mailheaders);
525
  } // end send_confirm()
526
 
527
  /* ===== Subscriber functions ===== */
651
  }
652
  } //end remind()
653
 
 
 
 
 
 
 
 
 
 
 
 
654
  /**
655
  Check email is not from a barred domain
656
  */
811
  $AND .= "AND ($and)";
812
  }
813
 
814
+ if ((defined(S2_MU)) && S2_MU) {
815
+ $sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . " WHERE a.meta_key='".$wpdb->prefix."capabilities'" . $AND;
816
+ } else {
817
+ $sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . " WHERE a.meta_key='s2_subscribed'" . $AND;
818
+ }
819
  $result = $wpdb->get_col($sql);
820
  if ($result) {
821
  $ids = implode(',', $result);
970
  if (!empty($remain)) {
971
  // remove subscription to these cat IDs and update s2_subscribed
972
  foreach ($cats as $id) {
973
+ delete_usermeta($user_ID, 's2_cat' . $id);
974
  }
975
  update_usermeta($user_ID, 's2_subscribed', implode(',', $remain));
976
  } else {
977
  // remove subscription to these cat IDs and update s2_subscribed to ''
978
  foreach ($cats as $id) {
979
+ delete_usermeta($user_ID, 's2_cat' . $id);
980
  }
981
  update_usermeta($user_ID, 's2_subscribed', '-1');
982
  }
1034
 
1035
  $what = '';
1036
  $reminderform = false;
1037
+ $action = remove_query_arg(array('what', 's2page'));
1038
+ $this->action = attribute_escape($action);
1039
  $urlpath = str_replace("\\","/",S2PATH);
1040
  $urlpath = trailingslashit(get_option('siteurl')) . substr($urlpath,strpos($urlpath,"wp-content/"));
1041
+ if ( isset( $_GET['s2page'] ) ) {
1042
+ $page = (int) $_GET['s2page'];
1043
+ } else {
1044
+ $page = 1;
1045
+ }
1046
 
1047
  // was anything POSTed ?
1048
  if (isset($_POST['s2_admin'])) {
1057
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) subscribed!', 'subscribe2') . "</strong></p></div>";
1058
  } elseif ('delete' == $_POST['s2_admin']) {
1059
  $this->delete($_POST['email']);
1060
+ echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . $_POST['email'] . ' ' . __('deleted!', 'subscribe2') . "</strong></p></div>";
1061
  } elseif ('toggle' == $_POST['s2_admin']) {
1062
  $this->toggle($_POST['email']);
1063
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . $_POST['email'] . ' ' . __('status changed!', 'subscribe2') . "</strong></p></div>";
1064
  } elseif ('remind' == $_POST['s2_admin']) {
1065
  $this->remind($_POST['reminderemails']);
1066
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Reminder Email(s) Sent!','subscribe2') . "</strong></p></div>";
 
 
 
1067
  } elseif ( ('register' == $_POST['s2_admin']) && ('subscribe' == $_POST['manage']) ) {
1068
  $this->subscribe_registered_users($_POST['emails'], $_POST['category']);
1069
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Subscribed!','subscribe2') . "</strong></p></div>";
1074
  }
1075
 
1076
  if (isset($_POST['what'])) {
1077
+ $page = 1;
1078
  if ('all' == $_POST['what']) {
1079
  $what = 'all';
1080
  $confirmed = $this->get_public();
1087
  $subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
1088
  } elseif ('confirmed' == $_POST['what']) {
1089
  $what = 'confirmed';
1090
+ $confirmed = $this->get_public();
1091
  $subscribers = $confirmed;
1092
  } elseif ('unconfirmed' == $_POST['what']) {
1093
  $what = 'unconfirmed';
1094
+ $unconfirmed = $this->get_public(0);
1095
  $subscribers = $unconfirmed;
1096
+ if (!empty($subscribers)) {
1097
+ $reminderemails = implode(",", $subscribers);
1098
  $reminderform = true;
1099
  }
1100
  } elseif (is_numeric($_POST['what'])) {
1104
  $what = 'registered';
1105
  $subscribers = $registered;
1106
  }
1107
+ } elseif (isset($_GET['what'])) {
1108
+ if ('all' == $_GET['what']) {
1109
+ $what = 'all';
1110
+ $confirmed = $this->get_public();
1111
+ $unconfirmed = $this->get_public(0);
1112
+ $subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$registered);
1113
+ } elseif ('public' == $_GET['what']) {
1114
+ $what = 'public';
1115
+ $confirmed = $this->get_public();
1116
+ $unconfirmed = $this->get_public(0);
1117
+ $subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
1118
+ } elseif ('confirmed' == $_GET['what']) {
1119
+ $what = 'confirmed';
1120
+ $confirmed = $this->get_public();
1121
+ $subscribers = $confirmed;
1122
+ } elseif ('unconfirmed' == $_GET['what']) {
1123
+ $what = 'unconfirmed';
1124
+ $unconfirmed = $this->get_public(0);
1125
+ $subscribers = $unconfirmed;
1126
+ if (!empty($subscribers)) {
1127
+ $reminderemails = implode(",", $subscribers);
1128
+ $reminderform = true;
1129
+ }
1130
+ } elseif (is_numeric($_GET['what'])) {
1131
+ $what = intval($_GET['what']);
1132
+ $subscribers = $this->get_registered("cats=$what");
1133
+ } elseif ('registered' == $_GET['what']) {
1134
+ $what = 'registered';
1135
+ $subscribers = $registered;
1136
+ }
1137
  } elseif ('' == $what) {
1138
  $what = 'registered';
1139
  $subscribers = $registered;
1154
  }
1155
  if (!empty($subscribers)) {
1156
  natcasesort($subscribers);
1157
+ // Displays a page number strip - adapted from code in Akismet
1158
+ $args['what'] = $what;
1159
+ $total_subscribers = count($subscribers);
1160
+ $total_pages = ceil($total_subscribers / 50);
1161
+ $strip = '';
1162
+ if ( $page > 1 ) {
1163
+ $args['s2page'] = $page - 1;
1164
+ $strip .= '<a class="prev" href="' . clean_url(add_query_arg( $args )) . '">&laquo; '. __('Previous Page', 'subscribe2') .'</a>' . "\n";
1165
+ }
1166
+ if ( $total_pages > 1 ) {
1167
+ for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) {
1168
+ if ( $page == $page_num ) {
1169
+ $strip .= "<strong>" . $page_num . "</strong>\n";
1170
+ } else {
1171
+ if ( $page_num < 3 || ( $page_num >= $page - 2 && $page_num <= $page + 2 ) || $page_num > $total_pages - 2 ) {
1172
+ $args['s2page'] = $page_num;
1173
+ $strip .= "<a class=\"page-numbers\" href=\"" . clean_url(add_query_arg($args)) . "\">" . $page_num . "</a>\n";
1174
+ $trunc = true;
1175
+ } elseif ( $trunc == true ) {
1176
+ $strip .= "...\n";
1177
+ $trunc = false;
1178
+ }
1179
+ }
1180
+ }
1181
+ }
1182
+ if ( ( $page ) * 50 < $total_subscribers ) {
1183
+ $args['s2page'] = $page + 1;
1184
+ $strip .= "<a class=\"next\" href=\"" . clean_url(add_query_arg($args)) . "\">". __('Next Page', 'subscribe2') . " &raquo;</a>\n";
1185
+ }
1186
  }
1187
  // safety check for our arrays
1188
  if ('' == $confirmed) { $confirmed = array(); }
1192
  // show our form
1193
  echo "<div class=\"wrap\">";
1194
  echo "<h2>" . __('Subscribe Addresses', 'subscribe2') . "</h2>\r\n";
1195
+ echo "<form method=\"post\" action=\"$this->action\">\r\n";
1196
+ echo "<p>";
1197
  if (function_exists('wp_nonce_field')) {
1198
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1199
  }
1200
  echo __('Enter addresses, one per line or comma-seperated', 'subscribe2') . "<br />\r\n";
1201
+ echo "<textarea rows=\"2\" cols=\"80\" name=\"addresses\"></textarea></p>\r\n";
1202
+ echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Subscribe', 'subscribe2') . "\"/>\r\n";
1203
+ echo "<input type=\"hidden\" name=\"s2_admin\" value=\"subscribe\" /></p>";
1204
  echo "</form></div>";
1205
 
1206
  // subscriber lists
1207
  echo "<div class=\"wrap\"><h2>" . __('Subscribers', 'subscribe2') . "</h2>\r\n";
1208
+ echo "<br />";
1209
  $this->display_subscriber_dropdown($what, __('Filter', 'subscribe2'));
1210
  // show the selected subscribers
1211
  $alternate = 'alternate';
1212
  if (!empty($subscribers)) {
1213
  echo "<p align=\"center\"><b>" . __('Registered on the left, confirmed in the middle, unconfirmed on the right', 'subscribe2') . "</b></p>\r\n";
1214
+ $exportcsv = implode(",", $subscribers);
1215
+ echo "<form method=\"post\" action=\"\">\r\n";
1216
+ if (function_exists('wp_nonce_field')) {
1217
+ wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
 
 
 
 
 
 
1218
  }
1219
+ echo "<input type=\"hidden\" name=\"exportcsv\" value=\"$exportcsv\" />\r\n";
1220
+ echo "<input type=\"hidden\" name=\"s2_admin\" value=\"exportcsv\" />\r\n";
1221
+ echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Save Emails to CSV File','subscribe2') . "\" /></p>\r\n";
1222
+ echo "</form>\r\n";
1223
  }
1224
+ echo "<p>" . $strip . "</p>";
1225
  echo "<table cellpadding=\"2\" cellspacing=\"2\">";
1226
  if (!empty($subscribers)) {
1227
+ $subscriber_chunks = array_chunk($subscribers, 50);
1228
+ $chunk = $page - 1;
1229
+ $subscribers = $subscriber_chunks[$chunk];
1230
  foreach ($subscribers as $subscriber) {
1231
  echo "<tr class=\"$alternate\">";
1232
  echo "<td width=\"75%\"";
1241
  if (in_array($subscriber, $unconfirmed) || in_array($subscriber, $confirmed) ) {
1242
  echo "(" . $this->signup_date($subscriber) . ")</td>\r\n";
1243
  echo "<td width=\"5%\" align=\"center\">\r\n";
1244
+ echo "<form method=\"post\" action=\"$this->action\">";
1245
  if (function_exists('wp_nonce_field')) {
1246
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1247
  }
1261
  if (function_exists('wp_nonce_field')) {
1262
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1263
  }
 
1264
  echo "<input type=\"hidden\" name=\"email\" value=\"$subscriber\" />\r\n";
1265
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"delete\" />\r\n";
1266
  echo "<input type=\"hidden\" name=\"what\" value=\"$what\" />\r\n";
1267
+ echo "<p class=\"delete\">\r\n";
1268
+ echo "<input type=\"image\" src=\"" . $urlpath . "include/cross.png\" name=\"submit\" value=\"X\" />\r\n";
1269
+ echo "</p></form>";
1270
  }
1271
  echo "</td></tr>\r\n";
1272
  ('alternate' == $alternate) ? $alternate = '' : $alternate = 'alternate';
1275
  echo "<tr><td align=\"center\"><b>" . __('NONE', 'subscribe2') . "</b></td></tr>\r\n";
1276
  }
1277
  echo "</table>";
1278
+ echo "<p>" . $strip . "</p>";
1279
  if ($reminderform) {
1280
+ echo "<form method=\"post\" action=\"$this->action\">\r\n";
1281
  if (function_exists('wp_nonce_field')) {
1282
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1283
  }
1291
  //show bulk managment form
1292
  echo "<div class=\"wrap\">";
1293
  echo "<h2>" . __('Categories', 'subscribe2') . "</h2>\r\n";
1294
+ echo "<p>";
1295
  echo __('Existing Registered Users can be automatically (un)subscribed to categories using this section.', 'subscribe2') . "<br />\r\n";
1296
  echo "<strong><em style=\"color: red\">" . __('Consider User Privacy as changes cannot be undone', 'subscribe2') . "</em></strong><br />\r\n";
1297
+ echo "</p>";
1298
  echo "<form method=\"post\" action=\"\">\r\n";
1299
  if (function_exists('wp_nonce_field')) {
1300
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1353
  }
1354
  $this->subscribe2_options['sender'] = $sender;
1355
 
1356
+ // send email for pages, private and password protected posts
1357
  $pages_option = $_POST['pages'];
1358
  $this->subscribe2_options['pages']= $pages_option;
1359
  $password_option = $_POST['password'];
1360
  $this->subscribe2_options['password']= $password_option;
1361
+ $private_option = $_POST['private'];
1362
+ $this->subscribe2_options['private'] = $private_option;
1363
 
1364
  // send per-post or digest emails
1365
  $email_freq = $_POST['email_freq'];
1378
  } else {
1379
  if (!wp_next_scheduled('s2_digest_cron')) {
1380
  // if we are using digest schedule the event and prime last_cron as now
1381
+ $time = current_time('timestamp') + $interval;
1382
  if ($interval < 86400) {
1383
  // Schedule CRON events occurring less than daily starting now and periodically thereafter
1384
  $timestamp = &$time;
1427
  }
1428
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"options\" />\r\n";
1429
  echo "<h2>" . __('Delivery Options', 'subscribe2') . ":</h2>\r\n";
1430
+ echo "<p>";
1431
  echo __('Send Emails for Pages', 'subscribe2') . ': ';
1432
  echo "<input type=\"radio\" name=\"pages\" value=\"yes\"";
1433
  if ('yes' == $this->subscribe2_options['pages']) {
1450
  echo " checked=\"checked\"";
1451
  }
1452
  echo " /> " . __('No', 'subscribe2') . "<br /><br />\r\n";
1453
+ echo __('Send Emails for Private Posts', 'subscribe2') . ': ';
1454
+ echo "<input type=\"radio\" name=\"private\" value=\"yes\"";
1455
+ if ('yes' == $this->subscribe2_options['private']) {
1456
+ echo " checked=\"checked\"";
1457
+ }
1458
+ echo " /> " . __('Yes', 'subscribe2') . " &nbsp;&nbsp;";
1459
+ echo "<input type=\"radio\" name=\"private\" value=\"no\"";
1460
+ if ('no' == $this->subscribe2_options['private']) {
1461
+ echo " checked=\"checked\"";
1462
+ }
1463
+ echo " /> " . __('No', 'subscribe2') . "<br /><br />\r\n";
1464
  echo __('Send Email From', 'subscribe2') . ': ';
1465
  echo "<input type=\"radio\" name=\"sender\" value=\"author\"";
1466
  if ('author' == $this->subscribe2_options['sender']) {
1476
  echo __('Send Email as Digest', 'subscribe2') . ": <br /><br />\r\n";
1477
  $this->display_digest_choices();
1478
  }
1479
+ echo "</p>";
1480
  echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
1481
+ echo"<br />";
1482
  echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"1\" class=\"editform\">\r\n";
1483
  echo "<tr><td>";
1484
  echo __('New Post email (must not be empty)', 'subscribe2') . ":";
1489
  echo "<dl>";
1490
  echo "<dt><b>BLOGNAME</b></dt><dd>" . get_bloginfo('name') . "</dd>\r\n";
1491
  echo "<dt><b>BLOGLINK</b></dt><dd>" . get_bloginfo('url') . "</dd>\r\n";
1492
+ echo "<dt><b>TITLE</b></dt><dd>" . __("the post's title<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
1493
  echo "<dt><b>POST</b></dt><dd>" . __("the excerpt or the entire post<br />(<i>based on the subscriber's preferences</i>)", 'subscribe2') . "</dd>\r\n";
1494
+ echo "<dt><b>TABLE</b></dt><dd>" . __("a list of post titles<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
1495
+ echo "<dt><b>PERMALINK</b></dt><dd>" . __("the post's permalink<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
1496
  echo "<dt><b>MYNAME</b></dt><dd>" . __("the admin or post author's name", 'subscribe2') . "</dd>\r\n";
1497
  echo "<dt><b>EMAIL</b></dt><dd>" . __("the admin or post author's email", 'subscribe2') . "</dd>\r\n";
1498
  echo "<dt><b>AUTHORNAME</b></dt><dd>" . __("the post author's name", 'subscribe2') . "</dd>\r\n";
1508
 
1509
  // excluded categories
1510
  echo "<h2>" . __('Excluded Categories', 'subscribe2') . "</h2>\r\n";
1511
+ echo"<p>";
1512
  echo "<strong><em style=\"color: red\">" . __('Posts assigned to any Excluded Category do not generate notifications and are not included in digest notifications', 'subscribe2') . "</em></strong><br />\r\n";
1513
+ echo"</p>";
1514
  $this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
1515
  echo "<center><input type=\"checkbox\" name=\"reg_override\" value=\"1\"";
1516
  if ('1' == $this->subscribe2_options['reg_override']) {
1520
 
1521
  // show button in QuickTags
1522
  echo "<h2>" . __('Writing Options', 'subscribe2') . "</h2>\r\n";
1523
+ echo"<p>";
1524
  echo "<input type=\"checkbox\" name=\"show_button\" value=\"1\"";
1525
  if ('1' == $this->subscribe2_options['show_button']) {
1526
  echo " checked=\"checked\"";
1533
  echo " checked=\"checked\"";
1534
  }
1535
  echo " /> " . __('Enable Subscribe2 Widget?', 'subscribe2') . "<br /><br />\r\n";
1536
+ echo"</p>";
1537
 
1538
  //Auto Subscription for new registrations
1539
  echo "<h2>" . __('Auto Subscribe', 'subscribe2') . "</h2>\r\n";
1540
+ echo"<p>";
1541
  echo __('Subscribe new users registering with your blog', 'subscribe2') . ":<br />\r\n";
1542
  echo "<input type=\"radio\" name=\"autosub\" value=\"yes\"";
1543
  if ('yes' == $this->subscribe2_options['autosub']) {
1581
  echo "checked=\"checked\" ";
1582
  }
1583
  echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . " <br /><br />";
1584
+ echo"</p>";
1585
 
1586
  //barred domains
1587
  echo "<h2>" . __('Barred Domains', 'subscribe2') . "</h2>\r\n";
1588
+ echo"<p>";
1589
  echo __('Enter domains to bar from public subscriptions: <br /> (Use a new line for each entry and omit the "@" symbol, for example email.com)', 'subscribe2');
1590
  echo "<br />\r\n<textarea style=\"width: 98%;\" rows=\"4\" cols=\"60\" name=\"barred\">" . $this->subscribe2_options['barred'] . "</textarea>";
1591
+ echo"</p>";
1592
 
1593
  // submit
1594
+ echo "<p class=\"submit\" align=\"center\"><input type=\"submit\" id=\"save\" name=\"submit\" value=\"" . __('Submit', 'subscribe2') . "\" /></p>";
1595
  echo "</form>\r\n";
1596
  echo "</div><div class=\"wrap\">";
1597
 
1602
  if (function_exists('wp_nonce_field')) {
1603
  wp_nonce_field('subscribe2-options_subscribers' . $s2nonce);
1604
  }
1605
+ echo "<p class=\"submit\" align=\"center\">";
1606
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"RESET\" />";
1607
  echo "<input type=\"submit\" id=\"deletepost\" name=\"submit\" value=\"" . __('RESET', 'subscribe2') .
1608
  "\" />";
1609
+ echo "</p></form></div>\r\n";
1610
 
1611
  include(ABSPATH . 'wp-admin/admin-footer.php');
1612
  // just to be sure
1680
  echo "<div class=\"wrap\">";
1681
  echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
1682
  echo "<form method=\"post\" action=\"\">";
1683
+ echo "<p>";
1684
  if (function_exists('wp_nonce_field')) {
1685
  wp_nonce_field('subscribe2-user_subscribers' . $s2nonce);
1686
  }
1707
  }
1708
  echo " /> " . $value . "&nbsp;&nbsp;";
1709
  }
1710
+ echo "<br /><span style=\"color: red;line-height: 300%;\">" . __('Note: HTML format will always deliver the full post', 'subscribe2') . ".</span><br />\r\n";
1711
  echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': &nbsp;&nbsp;';
1712
  echo "<input type=\"radio\" name=\"new_category\" value=\"yes\" ";
1713
  if ('yes' == get_usermeta($user_ID, 's2_autosub')) {
1719
  echo "checked=\"checked\" ";
1720
  }
1721
  echo "/> " . __('No', 'subscribe2') . "<br /><br />";
1722
+ echo "</p>";
1723
 
1724
  // subscribed categories
1725
  echo "<h2>" . __('Subscribed Categories', 'subscribe2') . "</h2>\r\n";
1728
  // we're doing daily digests, so just show
1729
  // subscribe / unnsubscribe
1730
  echo __('Receive daily summary of new posts?', 'subscribe2') . ': &nbsp;&nbsp;';
1731
+ echo "<p>";
1732
  echo "<input type=\"radio\" name=\"category\" value=\"digest\" ";
1733
  if (get_usermeta($user_ID, 's2_subscribed') != '-1') {
1734
  echo "checked=\"yes\" ";
1738
  echo "checked=\"yes\" ";
1739
  }
1740
  echo "/> " . __('No', 'subscribe2');
1741
+ echo "</p>";
1742
  }
1743
 
1744
+
1745
  // submit
1746
  echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __("Update Preferences", 'subscribe2') . " &raquo;\" /></p>";
1747
  echo "</form></div>\r\n";
1790
  // show our form
1791
  echo "<div class=\"wrap\"><h2>" . __('Send email to all subscribers', 'subscribe2') . "</h2>\r\n";
1792
  echo "<form method=\"post\" action=\"\">\r\n";
1793
+ echo "<p>";
1794
  if (function_exists('wp_nonce_field')) {
1795
  wp_nonce_field('subscribe2-write_subscribers' . $s2nonce);
1796
  }
1797
+ echo __('Subject', 'subscribe2') . ": <input type=\"text\" size=\"69\" name=\"subject\" value=\"" . __('A message from ', 'subscribe2') . get_option('blogname') . "\" /> <br /><br />";
1798
  echo "<textarea rows=\"12\" cols=\"75\" name=\"message\"></textarea>";
1799
+ echo "<br /><br />\r\n";
1800
  echo __('Recipients: ', 'subscribe2');
1801
  $this->display_subscriber_dropdown('registered', false, array('all'));
1802
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"mail\" />";
1803
+ echo "</p>";
1804
+ echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Send', 'subscribe2') . "\" /></p>";
1805
  echo "</form></div>\r\n";
1806
  echo "<div style=\"clear: both;\"><p>&nbsp;</p></div>";
1807
 
1904
  }
1905
 
1906
  if (false !== $submit) {
1907
+ echo "<form method=\"post\" action=\"$this->action\">";
1908
  }
1909
  echo "<select name=\"what\">\r\n";
1910
  foreach ($who as $whom => $display) {
1926
  }
1927
  echo "</select>";
1928
  if (false !== $submit) {
1929
+ echo "<p class=\"submit\"><input type=\"submit\" value=\"$submit\" /></p></form>\r\n";
1930
  }
1931
  } // end display_subscriber_dropdown()
1932
 
1965
  if ($scheduled_time) {
1966
  echo "<p><input type=\"checkbox\" name=\"reset_cron\" /> " . __('Reset the schedule time and date for periodic email notifications', 'subscribe2') . "</p>\r\n";
1967
  $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
 
1968
  echo "<p>" . __('Current server time is', 'subscribe2') . ": \r\n";
1969
+ echo "<strong>" . date($datetime, current_time('timestamp', 1)) . "</strong></p>\r\n";
1970
+ echo "<p>" . __('Current blog time is', 'subscribe2') . ": \r\n";
1971
+ echo "<strong>" . date($datetime, current_time('timestamp')) . "</strong></p>\r\n";
1972
+ echo "<p>" . __('Next email notification will be sent when your blog time is after', 'subscribe2') . ": \r\n";
1973
+ echo "<strong>" . date($datetime, wp_next_scheduled('s2_digest_cron')) . "</strong></p>\r\n";
1974
  } else {
1975
  echo "<br />";
1976
  }
2018
  Display our form; also handles (un)subscribe requests
2019
  */
2020
  function filter($content = '') {
2021
+ if ( ('' == $content) || (! strstr($content, '<!--subscribe2-->')) ) { return $content; }
2022
  $this->s2form = $this->form;
2023
 
2024
  global $user_ID;
2052
  if ('1' !== $this->is_public($this->email)) {
2053
  // the user is unknown or inactive
2054
  $this->add();
2055
+ $status = $this->send_confirm('add');
2056
  // set a variable to denote that we've already run, and shouldn't run again
2057
  $this->filtered = 1; //set this to not send duplicate emails
2058
+ if ($status) {
2059
+ $this->s2form = $this->confirmation_sent;
2060
+ } else {
2061
+ $this->s2form = $this->error;
2062
+ }
2063
  } else {
2064
  // they're already subscribed
2065
  $this->s2form = $this->already_subscribed;
2073
  $this->send_confirm('del');
2074
  // set a variable to denote that we've already run, and shouldn't run again
2075
  $this->filtered = 1;
2076
+ if ($status) {
2077
+ $this->s2form = $this->confirmation_sent;
2078
+ } else {
2079
+ $this->s2form = $this->error;
2080
+ }
2081
  }
2082
  $this->action='unsubscribe';
2083
  }
2084
  }
2085
  }
2086
  }
2087
+ return preg_replace('|(<p>)?(\n)*<!--subscribe2-->(\n)*(</p>)?|', $this->s2form, $content);
 
2088
  } // end filter()
2089
 
2090
  /**
2168
  }
2169
  }
2170
 
2171
+ /* ===== Write Toolbar Button Functions ===== */
2172
+
2173
+ /**
2174
+ Register our button in the QuickTags bar
2175
+ */
2176
+ function button_init() {
2177
+ if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) return;
2178
+ if ( 'true' == get_user_option('rich_editing') ) {
2179
+ global $wp_db_version;
2180
+ if ($wp_db_version >= 7098) {
2181
+ //check if we are using WordPress 2.5+
2182
+ add_filter('mce_external_plugins', array(&$this, 'mce3_plugin'));
2183
+ add_filter('mce_buttons', array(&$this, 'mce3_button'));
2184
+ } else {
2185
+ // Load and append our TinyMCE external plugin
2186
+ add_filter('mce_plugins', array(&$this, 'mce2_plugin'));
2187
+ add_filter('mce_buttons', array(&$this, 'mce2_button'));
2188
+ add_filter('tinymce_before_init', array(&$this, 'tinymce2_before_init'));
2189
+ }
2190
+ } else {
2191
+ //use buttonsnap to add button is not using RTE
2192
+ buttonsnap_separator();
2193
+ buttonsnap_jsbutton(get_option('siteurl') . '/wp-content/plugins/subscribe2/include/s2_button.png', __('Subscribe2', 'subscribe2'), 's2_insert_token();');
2194
+ }
2195
+ }
2196
+
2197
+ /**
2198
+ Add buttons for WordPress 2.5+ using built in hooks
2199
+ */
2200
+ function mce3_plugin($arr) {
2201
+ $path = get_option('siteurl') . '/wp-content/plugins/subscribe2/tinymce3/editor_plugin.js';
2202
+ $arr['subscribe2'] = $path;
2203
+ return $arr;
2204
+ }
2205
+
2206
+ function mce3_button($arr) {
2207
+ $arr[] = 'subscribe2';
2208
+ return $arr;
2209
+ }
2210
+
2211
+ // Add buttons in WordPress v2.1+, thanks to An-archos
2212
+ function mce2_plugin($plugins) {
2213
+ array_push($plugins, '-subscribe2quicktags');
2214
+ return $plugins;
2215
+ }
2216
+
2217
+ function mce2_button($buttons) {
2218
+ array_push($buttons, 'separator');
2219
+ array_push($buttons, 'subscribe2quicktags');
2220
+ return $buttons;
2221
+ }
2222
+
2223
+ function tinymce2_before_init() {
2224
+ $this->fullpath = get_option('siteurl') . '/wp-content/plugins/subscribe2/tinymce/';
2225
+ echo "tinyMCE.loadPlugin('subscribe2quicktags', '" . $this->fullpath . "');\n";
2226
+ }
2227
+
2228
+ function s2_edit_form() {
2229
+ echo "<!-- Start Subscribe2 Quicktags Javascript -->\r\n";
2230
+ echo "<script type=\"text/javascript\">\r\n";
2231
+ echo "//<![CDATA[\r\n";
2232
+ echo "function s2_insert_token() {
2233
+ buttonsnap_settext('<!--subscribe2-->');
2234
+ }\r\n";
2235
+ echo "//]]>\r\n";
2236
+ echo "</script>\r\n";
2237
+ echo "<!-- End Subscribe2 Quicktags Javascript -->\r\n";
2238
+ }
2239
+
2240
  /* ===== wp-cron functions ===== */
2241
  /**
2242
  Send a daily digest of today's new posts
2245
  global $wpdb;
2246
 
2247
  // collect posts
2248
+ $now = current_time('mysql');
2249
  $prev = $this->subscribe2_options['last_s2cron'];
2250
  $posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content, post_type, post_password FROM $wpdb->posts WHERE post_date >= '$prev' AND post_date < '$now' AND post_status IN ('publish', 'private') AND post_type IN ('post', 'page')");
2251
 
2252
  // update last_s2cron execution time before completing or bailing
2253
  $this->subscribe2_options['last_s2cron'] = $now;
2254
  update_option('subscribe2_options', $this->subscribe2_options);
2255
+
2256
  // do we have any posts?
2257
  if (empty($posts)) { return; }
2258
 
2259
  // if we have posts, let's prepare the digest
2260
+ $all_post_cats = array();
2261
  foreach ($posts as $post) {
2262
  $post_cats = wp_get_post_categories($post->ID);
2263
  $post_cats_string = implode(',', $post_cats);
2264
+ $all_post_cats = array_unique(array_merge($all_post_cats, $post_cats));
 
2265
  $check = false;
2266
  // is the current post assigned to any categories
2267
  // which should not generate a notification email?
2270
  $check = true;
2271
  }
2272
  }
2273
+ //is the current post set by the user to
2274
+ // not generate a notification email?
2275
+ $s2mail = get_post_meta($post->ID, 's2mail', true);
2276
+ if (strtolower(trim($s2mail)) == 'no') {
2277
+ $check = true;
2278
+ }
2279
  // is the current post private
2280
  // and should this not generate a notification email?
2281
  if ( ($this->subscribe2_options['password'] == "no") && ($post->post_password != '') ) {
2314
  $message .= $excerpt . "\r\n\r\n";
2315
  }
2316
 
2317
+ // get admin detailts
2318
+ $user = $this->get_userdata();
 
 
 
 
 
 
 
 
 
2319
  $this->myemail = $user->user_email;
2320
  $this->myname = $user->display_name;
2321
 
2328
  $registered = $this->get_registered("cats=$all_post_cats_string");
2329
  $recipients = array_merge((array)$public, (array)$registered);
2330
  $mailtext = $this->substitute(stripslashes($this->subscribe2_options['mailtext']));
2331
+ $mailtext = str_replace("TABLE", $table, $mailtext);
2332
+ $mailtext = str_replace("POST", $message, $mailtext);
2333
+ $this->mail($recipients, $subject, $mailtext);
2334
  } // end subscribe2_cron
2335
 
2336
  /* ===== Our constructor ===== */
2370
  add_filter('the_title', array(&$this, 'title_filter'));
2371
  add_filter('the_content', array(&$this, 'confirm'));
2372
  }
2373
+
2374
+ if ( (isset($_POST['s2_admin'])) && ('exportcsv' == $_POST['s2_admin']) ) {
2375
+ $date = date('Y-m-d');
2376
+ header('Content-Description: File Transfer');
2377
+ header("Content-type: application/octet-stream");
2378
+ header("Content-Disposition: attachment; filename=subscribe2_users_$date.csv");
2379
+ header("Pragma: no-cache");
2380
+ header("Expires: 0");
2381
+ echo $_POST['exportcsv'];
2382
 
2383
+ exit(0);
2384
+ }
2385
+
2386
  //add regular actions and filters
2387
  add_action('admin_head', array(&$this, 'admin_head'));
2388
  add_action('admin_menu', array(&$this, 'admin_menu'));
2413
  add_action('pending_to_publish', array(&$this, 'publish'));
2414
  add_action('private_to_publish', array(&$this, 'publish'));
2415
  add_action('future_to_publish', array(&$this, 'publish'));
2416
+ if ($this->subscribe2_options['private'] == "yes") {
2417
  add_action('new_to_private', array(&$this, 'publish'));
2418
  add_action('draft_to_private', array(&$this, 'publish'));
2419
  add_action('pending_to_private', array(&$this, 'publish'));
2424
  $this->load_strings();
2425
  } // end subscribe2()
2426
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2427
  /* ===== our variables ===== */
2428
  // cache variables
 
2429
  var $subscribe2_options = array();
2430
  var $all_public = '';
2431
  var $all_unconfirmed = '';
subscribe2/subscribe2.pot → subscribe2.pot RENAMED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2008-01-08 20:13+0000\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,533 +16,551 @@ msgstr ""
16
  "Content-Type: text/plain; charset=CHARSET\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
 
19
- #: subscribe2.php:63
20
  msgid "To manage your subscription options please "
21
  msgstr ""
22
 
23
- #: subscribe2.php:63
24
  msgid "login"
25
  msgstr ""
26
 
27
- #: subscribe2.php:65 subscribe2.php:67
28
  msgid "You may manage your subscription options from your "
29
  msgstr ""
30
 
31
- #: subscribe2.php:65 subscribe2.php:67
32
  msgid "profile"
33
  msgstr ""
34
 
35
- #: subscribe2.php:69
36
  msgid "A confirmation message is on its way!"
37
  msgstr ""
38
 
39
- #: subscribe2.php:71
40
  msgid "That email address is already subscribed."
41
  msgstr ""
42
 
43
- #: subscribe2.php:73
44
  msgid "That email address is not subscribed."
45
  msgstr ""
46
 
47
- #: subscribe2.php:75
48
  msgid "Sorry, but that does not look like an email address to me."
49
  msgstr ""
50
 
51
- #: subscribe2.php:77
52
  msgid ""
53
  "Sorry, email addresses at that domain are currently barred due to spam, "
54
  "please use an alternative email address."
55
  msgstr ""
56
 
57
- #: subscribe2.php:79
 
 
 
 
 
58
  msgid "Message sent!"
59
  msgstr ""
60
 
61
- #: subscribe2.php:81
62
  msgid "Your email:"
63
  msgstr ""
64
 
65
- #: subscribe2.php:81 subscribe2.php:1125 subscribe2.php:1221
66
  msgid "Subscribe"
67
  msgstr ""
68
 
69
- #: subscribe2.php:81 subscribe2.php:1222
70
  msgid "Unsubscribe"
71
  msgstr ""
72
 
73
- #: subscribe2.php:81 subscribe2.php:1691
74
  msgid "Send"
75
  msgstr ""
76
 
77
- #: subscribe2.php:84
78
  msgid "No such email address is registered."
79
  msgstr ""
80
 
81
- #: subscribe2.php:86
82
  msgid "You have successfully subscribed!"
83
  msgstr ""
84
 
85
- #: subscribe2.php:88
86
  msgid "You have successfully unsubscribed."
87
  msgstr ""
88
 
89
- #: subscribe2.php:90
90
  msgid "Please confirm your request"
91
  msgstr ""
92
 
93
- #: subscribe2.php:92
94
  msgid "Subscription Reminder"
95
  msgstr ""
96
 
97
- #: subscribe2.php:94
98
  msgid "subscribe"
99
  msgstr ""
100
 
101
- #: subscribe2.php:96
102
  msgid "unsubscribe"
103
  msgstr ""
104
 
105
- #: subscribe2.php:99
106
  msgid "Options saved!"
107
  msgstr ""
108
 
109
- #: subscribe2.php:100
110
  msgid "Options reset!"
111
  msgstr ""
112
 
113
- #: subscribe2.php:108 subscribe2.php:1130
114
  msgid "Subscribers"
115
  msgstr ""
116
 
117
- #: subscribe2.php:109
118
  msgid "Subscribe2 Options"
119
  msgstr ""
120
 
121
- #: subscribe2.php:109 subscribe2.php:2009 subscribe2.php:2242
122
  msgid "Subscribe2"
123
  msgstr ""
124
 
125
- #: subscribe2.php:111 subscribe2.php:113
126
  msgid "Subscriptions"
127
  msgstr ""
128
 
129
- #: subscribe2.php:115
130
  msgid "Mail Subscribers"
131
  msgstr ""
132
 
133
- #: subscribe2.php:138
134
  msgid "Once Weekly"
135
  msgstr ""
136
 
137
- #: subscribe2.php:687
138
  msgid "New subscriber"
139
  msgstr ""
140
 
141
- #: subscribe2.php:688
142
  msgid "subscribed to email notifications!"
143
  msgstr ""
144
 
145
- #: subscribe2.php:1038
146
  msgid "Address(es) subscribed!"
147
  msgstr ""
148
 
149
- #: subscribe2.php:1041
150
  msgid "deleted!"
151
  msgstr ""
152
 
153
- #: subscribe2.php:1044
154
  msgid "status changed!"
155
  msgstr ""
156
 
157
- #: subscribe2.php:1047
158
  msgid "Reminder Email(s) Sent!"
159
  msgstr ""
160
 
161
- #: subscribe2.php:1050
162
- msgid "CSV File Created in wp-content"
163
- msgstr ""
164
-
165
- #: subscribe2.php:1053
166
  msgid "Registered Users Subscribed!"
167
  msgstr ""
168
 
169
- #: subscribe2.php:1056
170
  msgid "Registered Users Unsubscribed!"
171
  msgstr ""
172
 
173
- #: subscribe2.php:1118
 
 
 
 
 
 
 
 
174
  msgid "Subscribe Addresses"
175
  msgstr ""
176
 
177
- #: subscribe2.php:1123
178
  msgid "Enter addresses, one per line or comma-seperated"
179
  msgstr ""
180
 
181
- #: subscribe2.php:1132
182
  msgid "Filter"
183
  msgstr ""
184
 
185
- #: subscribe2.php:1136
186
  msgid ""
187
  "Registered on the left, confirmed in the middle, unconfirmed on the right"
188
  msgstr ""
189
 
190
- #: subscribe2.php:1145
191
  msgid "Save Emails to CSV File"
192
  msgstr ""
193
 
194
- #: subscribe2.php:1196
195
  msgid "NONE"
196
  msgstr ""
197
 
198
- #: subscribe2.php:1206
199
  msgid "Send Reminder Email"
200
  msgstr ""
201
 
202
- #: subscribe2.php:1213
203
  msgid "Categories"
204
  msgstr ""
205
 
206
- #: subscribe2.php:1214
207
  msgid ""
208
  "Existing Registered Users can be automatically (un)subscribed to categories "
209
  "using this section."
210
  msgstr ""
211
 
212
- #: subscribe2.php:1215
213
  msgid "Consider User Privacy as changes cannot be undone"
214
  msgstr ""
215
 
216
- #: subscribe2.php:1220
217
  msgid "Action to perform"
218
  msgstr ""
219
 
220
- #: subscribe2.php:1225 subscribe2.php:1488
221
  msgid "Submit"
222
  msgstr ""
223
 
224
- #: subscribe2.php:1345
225
  msgid "Delivery Options"
226
  msgstr ""
227
 
228
- #: subscribe2.php:1346
229
  msgid "Send Emails for Pages"
230
  msgstr ""
231
 
232
- #: subscribe2.php:1351 subscribe2.php:1362 subscribe2.php:1459
233
- #: subscribe2.php:1609 subscribe2.php:1627
234
  msgid "Yes"
235
  msgstr ""
236
 
237
- #: subscribe2.php:1356 subscribe2.php:1367 subscribe2.php:1453
238
- #: subscribe2.php:1464 subscribe2.php:1614 subscribe2.php:1631
 
239
  msgid "No"
240
  msgstr ""
241
 
242
- #: subscribe2.php:1357
243
  msgid "Send Emails for Password Protected Posts"
244
  msgstr ""
245
 
246
- #: subscribe2.php:1368
 
 
 
 
247
  msgid "Send Email From"
248
  msgstr ""
249
 
250
- #: subscribe2.php:1373
251
  msgid "Author of the post"
252
  msgstr ""
253
 
254
- #: subscribe2.php:1378
255
  msgid "Blog Admin"
256
  msgstr ""
257
 
258
- #: subscribe2.php:1380
259
  msgid "Send Email as Digest"
260
  msgstr ""
261
 
262
- #: subscribe2.php:1383
263
  msgid "Email Templates"
264
  msgstr ""
265
 
266
- #: subscribe2.php:1386
267
  msgid "New Post email (must not be empty)"
268
  msgstr ""
269
 
270
- #: subscribe2.php:1390
271
  msgid "Message substitions"
272
  msgstr ""
273
 
274
- #: subscribe2.php:1394
275
- msgid "the post's title"
276
  msgstr ""
277
 
278
- #: subscribe2.php:1395
279
  msgid ""
280
  "the excerpt or the entire post<br />(<i>based on the subscriber's "
281
  "preferences</i>)"
282
  msgstr ""
283
 
284
- #: subscribe2.php:1396
285
- msgid "a list of post titles (for digest emails)"
286
  msgstr ""
287
 
288
- #: subscribe2.php:1397
289
- msgid "the post's permalink"
290
  msgstr ""
291
 
292
- #: subscribe2.php:1398
293
  msgid "the admin or post author's name"
294
  msgstr ""
295
 
296
- #: subscribe2.php:1399
297
  msgid "the admin or post author's email"
298
  msgstr ""
299
 
300
- #: subscribe2.php:1400
301
  msgid "the post author's name"
302
  msgstr ""
303
 
304
- #: subscribe2.php:1401
305
  msgid ""
306
  "the generated link to confirm a request<br />(<i>only used in the "
307
  "confirmation email template</i>)"
308
  msgstr ""
309
 
310
- #: subscribe2.php:1402
311
  msgid ""
312
  "Action performed by LINK in confirmation email<br />(<i>only used in the "
313
  "confirmation email template</i>)"
314
  msgstr ""
315
 
316
- #: subscribe2.php:1404
317
  msgid "Subscribe / Unsubscribe confirmation email"
318
  msgstr ""
319
 
320
- #: subscribe2.php:1407
321
  msgid "Reminder email to Unconfirmed Subscribers"
322
  msgstr ""
323
 
324
- #: subscribe2.php:1412
325
  msgid "Excluded Categories"
326
  msgstr ""
327
 
328
- #: subscribe2.php:1413
329
  msgid ""
330
  "Posts assigned to any Excluded Category do not generate notifications and "
331
  "are not included in digest notifications"
332
  msgstr ""
333
 
334
- #: subscribe2.php:1419
335
  msgid "Allow registered users to subscribe to excluded categories?"
336
  msgstr ""
337
 
338
- #: subscribe2.php:1422
339
  msgid "Writing Options"
340
  msgstr ""
341
 
342
- #: subscribe2.php:1427
343
  msgid "Show the Subscribe2 button on the Write toolbar?"
344
  msgstr ""
345
 
346
- #: subscribe2.php:1434
347
  msgid "Enable Subscribe2 Widget?"
348
  msgstr ""
349
 
350
- #: subscribe2.php:1437
351
  msgid "Auto Subscribe"
352
  msgstr ""
353
 
354
- #: subscribe2.php:1438
355
  msgid "Subscribe new users registering with your blog"
356
  msgstr ""
357
 
358
- #: subscribe2.php:1443
359
  msgid "Automatically"
360
  msgstr ""
361
 
362
- #: subscribe2.php:1448
363
  msgid "Display option on Registration Form"
364
  msgstr ""
365
 
366
- #: subscribe2.php:1454
367
  msgid "Registration Form option is checked by default"
368
  msgstr ""
369
 
370
- #: subscribe2.php:1465
371
  msgid "Auto-subscribe users to receive email as"
372
  msgstr ""
373
 
374
- #: subscribe2.php:1470 subscribe2.php:1587
375
  msgid "HTML"
376
  msgstr ""
377
 
378
- #: subscribe2.php:1475
379
  msgid "Plain Text - Full"
380
  msgstr ""
381
 
382
- #: subscribe2.php:1480
383
  msgid "Plain Text - Excerpt"
384
  msgstr ""
385
 
386
- #: subscribe2.php:1483
387
  msgid "Barred Domains"
388
  msgstr ""
389
 
390
- #: subscribe2.php:1484
391
  msgid ""
392
  "Enter domains to bar from public subscriptions: <br /> (Use a new line for "
393
  "each entry and omit the \"@\" symbol, for example email.com)"
394
  msgstr ""
395
 
396
- #: subscribe2.php:1493
397
  msgid "Reset Default"
398
  msgstr ""
399
 
400
- #: subscribe2.php:1494
401
  msgid ""
402
  "Use this to reset all options to their defaults. This <strong><em>will not</"
403
  "em></strong> modify your list of subscribers."
404
  msgstr ""
405
 
406
- #: subscribe2.php:1501
407
  msgid "RESET"
408
  msgstr ""
409
 
410
- #: subscribe2.php:1521
411
  msgid "Subscription preferences updated."
412
  msgstr ""
413
 
414
- #: subscribe2.php:1575
415
  msgid "Notification Settings"
416
  msgstr ""
417
 
418
- #: subscribe2.php:1582
419
  msgid "Receive email as"
420
  msgstr ""
421
 
422
- #: subscribe2.php:1592
423
  msgid "Plain Text"
424
  msgstr ""
425
 
426
- #: subscribe2.php:1594
427
  msgid "Email contains"
428
  msgstr ""
429
 
430
- #: subscribe2.php:1595
431
  msgid "Excerpt Only"
432
  msgstr ""
433
 
434
- #: subscribe2.php:1595
435
  msgid "Full Post"
436
  msgstr ""
437
 
438
- #: subscribe2.php:1603
439
  msgid "Note: HTML format will always deliver the full post"
440
  msgstr ""
441
 
442
- #: subscribe2.php:1604
443
  msgid "Automatically subscribe me to newly created categories"
444
  msgstr ""
445
 
446
- #: subscribe2.php:1617
447
  msgid "Subscribed Categories"
448
  msgstr ""
449
 
450
- #: subscribe2.php:1622
451
  msgid "Receive daily summary of new posts?"
452
  msgstr ""
453
 
454
- #: subscribe2.php:1635
455
  msgid "Update Preferences"
456
  msgstr ""
457
 
458
- #: subscribe2.php:1680
459
  msgid "Send email to all subscribers"
460
  msgstr ""
461
 
462
- #: subscribe2.php:1685
463
  msgid "Subject"
464
  msgstr ""
465
 
466
- #: subscribe2.php:1685
467
  msgid "A message from "
468
  msgstr ""
469
 
470
- #: subscribe2.php:1688
471
  msgid "Recipients: "
472
  msgstr ""
473
 
474
- #: subscribe2.php:1750
475
  msgid "Select / Unselect All"
476
  msgstr ""
477
 
478
- #: subscribe2.php:1763
479
  msgid "All Subscribers"
480
  msgstr ""
481
 
482
- #: subscribe2.php:1764
483
  msgid "Public Subscribers"
484
  msgstr ""
485
 
486
- #: subscribe2.php:1765
487
  msgid "Confirmed"
488
  msgstr ""
489
 
490
- #: subscribe2.php:1766
491
  msgid "Unconfirmed"
492
  msgstr ""
493
 
494
- #: subscribe2.php:1767
495
  msgid "Registered Users"
496
  msgstr ""
497
 
498
- #: subscribe2.php:1824
499
  msgid "Per Post Email"
500
  msgstr ""
501
 
502
- #: subscribe2.php:1839
503
  msgid "Send Digest Notification at"
504
  msgstr ""
505
 
506
- #: subscribe2.php:1851
507
  msgid ""
508
  "This option will work for digest notification sent daily or less frequently"
509
  msgstr ""
510
 
511
- #: subscribe2.php:1853
512
  msgid "Reset the schedule time and date for periodic email notifications"
513
  msgstr ""
514
 
515
- #: subscribe2.php:1856
516
  msgid "Current server time is"
517
  msgstr ""
518
 
519
- #: subscribe2.php:1858
520
- msgid "Next email notification will be sent"
 
 
 
 
521
  msgstr ""
522
 
523
- #: subscribe2.php:1871
524
  msgid "Check here to Subscribe to email notifications for new posts"
525
  msgstr ""
526
 
527
- #: subscribe2.php:1880
528
  msgid ""
529
  "By Registering with this blog you are also agreeing to recieve email "
530
  "notifications for new posts"
531
  msgstr ""
532
 
533
- #: subscribe2.php:1998
534
  msgid "Subscription Confirmation"
535
  msgstr ""
536
 
537
- #: subscribe2.php:2032
538
  msgid "Title:"
539
  msgstr ""
540
 
541
- #: subscribe2.php:2138
542
  msgid "Digest Email"
543
  msgstr ""
544
 
545
- #: include/options.php:55
546
  msgid ""
547
  "BLOGNAME has posted a new item, 'TITLE'\n"
548
  "\n"
@@ -558,7 +576,7 @@ msgid ""
558
  "EMAIL"
559
  msgstr ""
560
 
561
- #: include/options.php:59
562
  msgid ""
563
  "BLOGNAME has received a request to ACTION for this email address. To "
564
  "complete your request please click on the link below:\n"
@@ -571,7 +589,7 @@ msgid ""
571
  "MYNAME."
572
  msgstr ""
573
 
574
- #: include/options.php:63
575
  msgid ""
576
  "This email address was subscribed for notifications at BLOGNAME (BLOGLINK) "
577
  "but the subscription remains incomplete.\n"
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: \n"
11
+ "POT-Creation-Date: 2008-03-30 13:57+0100\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
16
  "Content-Type: text/plain; charset=CHARSET\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
 
19
+ #: subscribe2.php:66
20
  msgid "To manage your subscription options please "
21
  msgstr ""
22
 
23
+ #: subscribe2.php:66
24
  msgid "login"
25
  msgstr ""
26
 
27
+ #: subscribe2.php:68 subscribe2.php:70
28
  msgid "You may manage your subscription options from your "
29
  msgstr ""
30
 
31
+ #: subscribe2.php:68 subscribe2.php:70
32
  msgid "profile"
33
  msgstr ""
34
 
35
+ #: subscribe2.php:72
36
  msgid "A confirmation message is on its way!"
37
  msgstr ""
38
 
39
+ #: subscribe2.php:74
40
  msgid "That email address is already subscribed."
41
  msgstr ""
42
 
43
+ #: subscribe2.php:76
44
  msgid "That email address is not subscribed."
45
  msgstr ""
46
 
47
+ #: subscribe2.php:78
48
  msgid "Sorry, but that does not look like an email address to me."
49
  msgstr ""
50
 
51
+ #: subscribe2.php:80
52
  msgid ""
53
  "Sorry, email addresses at that domain are currently barred due to spam, "
54
  "please use an alternative email address."
55
  msgstr ""
56
 
57
+ #: subscribe2.php:82
58
+ msgid ""
59
+ "Sorry, there seems to be an error on the server. Please try again later."
60
+ msgstr ""
61
+
62
+ #: subscribe2.php:84
63
  msgid "Message sent!"
64
  msgstr ""
65
 
66
+ #: subscribe2.php:86
67
  msgid "Your email:"
68
  msgstr ""
69
 
70
+ #: subscribe2.php:86 subscribe2.php:1202 subscribe2.php:1303
71
  msgid "Subscribe"
72
  msgstr ""
73
 
74
+ #: subscribe2.php:86 subscribe2.php:1304
75
  msgid "Unsubscribe"
76
  msgstr ""
77
 
78
+ #: subscribe2.php:86 subscribe2.php:1804
79
  msgid "Send"
80
  msgstr ""
81
 
82
+ #: subscribe2.php:89
83
  msgid "No such email address is registered."
84
  msgstr ""
85
 
86
+ #: subscribe2.php:91
87
  msgid "You have successfully subscribed!"
88
  msgstr ""
89
 
90
+ #: subscribe2.php:93
91
  msgid "You have successfully unsubscribed."
92
  msgstr ""
93
 
94
+ #: subscribe2.php:95
95
  msgid "Please confirm your request"
96
  msgstr ""
97
 
98
+ #: subscribe2.php:97
99
  msgid "Subscription Reminder"
100
  msgstr ""
101
 
102
+ #: subscribe2.php:99
103
  msgid "subscribe"
104
  msgstr ""
105
 
106
+ #: subscribe2.php:101
107
  msgid "unsubscribe"
108
  msgstr ""
109
 
110
+ #: subscribe2.php:104
111
  msgid "Options saved!"
112
  msgstr ""
113
 
114
+ #: subscribe2.php:105
115
  msgid "Options reset!"
116
  msgstr ""
117
 
118
+ #: subscribe2.php:113 subscribe2.php:1207
119
  msgid "Subscribers"
120
  msgstr ""
121
 
122
+ #: subscribe2.php:114
123
  msgid "Subscribe2 Options"
124
  msgstr ""
125
 
126
+ #: subscribe2.php:114 subscribe2.php:2130 subscribe2.php:2193
127
  msgid "Subscribe2"
128
  msgstr ""
129
 
130
+ #: subscribe2.php:116 subscribe2.php:118
131
  msgid "Subscriptions"
132
  msgstr ""
133
 
134
+ #: subscribe2.php:120
135
  msgid "Mail Subscribers"
136
  msgstr ""
137
 
138
+ #: subscribe2.php:143
139
  msgid "Once Weekly"
140
  msgstr ""
141
 
142
+ #: subscribe2.php:695
143
  msgid "New subscriber"
144
  msgstr ""
145
 
146
+ #: subscribe2.php:696
147
  msgid "subscribed to email notifications!"
148
  msgstr ""
149
 
150
+ #: subscribe2.php:1057
151
  msgid "Address(es) subscribed!"
152
  msgstr ""
153
 
154
+ #: subscribe2.php:1060
155
  msgid "deleted!"
156
  msgstr ""
157
 
158
+ #: subscribe2.php:1063
159
  msgid "status changed!"
160
  msgstr ""
161
 
162
+ #: subscribe2.php:1066
163
  msgid "Reminder Email(s) Sent!"
164
  msgstr ""
165
 
166
+ #: subscribe2.php:1069
 
 
 
 
167
  msgid "Registered Users Subscribed!"
168
  msgstr ""
169
 
170
+ #: subscribe2.php:1072
171
  msgid "Registered Users Unsubscribed!"
172
  msgstr ""
173
 
174
+ #: subscribe2.php:1164
175
+ msgid "Previous Page"
176
+ msgstr ""
177
+
178
+ #: subscribe2.php:1184
179
+ msgid "Next Page"
180
+ msgstr ""
181
+
182
+ #: subscribe2.php:1194
183
  msgid "Subscribe Addresses"
184
  msgstr ""
185
 
186
+ #: subscribe2.php:1200
187
  msgid "Enter addresses, one per line or comma-seperated"
188
  msgstr ""
189
 
190
+ #: subscribe2.php:1209
191
  msgid "Filter"
192
  msgstr ""
193
 
194
+ #: subscribe2.php:1213
195
  msgid ""
196
  "Registered on the left, confirmed in the middle, unconfirmed on the right"
197
  msgstr ""
198
 
199
+ #: subscribe2.php:1221
200
  msgid "Save Emails to CSV File"
201
  msgstr ""
202
 
203
+ #: subscribe2.php:1275
204
  msgid "NONE"
205
  msgstr ""
206
 
207
+ #: subscribe2.php:1286
208
  msgid "Send Reminder Email"
209
  msgstr ""
210
 
211
+ #: subscribe2.php:1293
212
  msgid "Categories"
213
  msgstr ""
214
 
215
+ #: subscribe2.php:1295
216
  msgid ""
217
  "Existing Registered Users can be automatically (un)subscribed to categories "
218
  "using this section."
219
  msgstr ""
220
 
221
+ #: subscribe2.php:1296
222
  msgid "Consider User Privacy as changes cannot be undone"
223
  msgstr ""
224
 
225
+ #: subscribe2.php:1302
226
  msgid "Action to perform"
227
  msgstr ""
228
 
229
+ #: subscribe2.php:1307 subscribe2.php:1594
230
  msgid "Submit"
231
  msgstr ""
232
 
233
+ #: subscribe2.php:1429
234
  msgid "Delivery Options"
235
  msgstr ""
236
 
237
+ #: subscribe2.php:1431
238
  msgid "Send Emails for Pages"
239
  msgstr ""
240
 
241
+ #: subscribe2.php:1436 subscribe2.php:1447 subscribe2.php:1458
242
+ #: subscribe2.php:1562 subscribe2.php:1716 subscribe2.php:1736
243
  msgid "Yes"
244
  msgstr ""
245
 
246
+ #: subscribe2.php:1441 subscribe2.php:1452 subscribe2.php:1463
247
+ #: subscribe2.php:1556 subscribe2.php:1567 subscribe2.php:1721
248
+ #: subscribe2.php:1740
249
  msgid "No"
250
  msgstr ""
251
 
252
+ #: subscribe2.php:1442
253
  msgid "Send Emails for Password Protected Posts"
254
  msgstr ""
255
 
256
+ #: subscribe2.php:1453
257
+ msgid "Send Emails for Private Posts"
258
+ msgstr ""
259
+
260
+ #: subscribe2.php:1464
261
  msgid "Send Email From"
262
  msgstr ""
263
 
264
+ #: subscribe2.php:1469
265
  msgid "Author of the post"
266
  msgstr ""
267
 
268
+ #: subscribe2.php:1474
269
  msgid "Blog Admin"
270
  msgstr ""
271
 
272
+ #: subscribe2.php:1476
273
  msgid "Send Email as Digest"
274
  msgstr ""
275
 
276
+ #: subscribe2.php:1480
277
  msgid "Email Templates"
278
  msgstr ""
279
 
280
+ #: subscribe2.php:1484
281
  msgid "New Post email (must not be empty)"
282
  msgstr ""
283
 
284
+ #: subscribe2.php:1488
285
  msgid "Message substitions"
286
  msgstr ""
287
 
288
+ #: subscribe2.php:1492
289
+ msgid "the post's title<br />(<i>for per-post emails only</i>)"
290
  msgstr ""
291
 
292
+ #: subscribe2.php:1493
293
  msgid ""
294
  "the excerpt or the entire post<br />(<i>based on the subscriber's "
295
  "preferences</i>)"
296
  msgstr ""
297
 
298
+ #: subscribe2.php:1494
299
+ msgid "a list of post titles<br />(<i>for digest emails only</i>)"
300
  msgstr ""
301
 
302
+ #: subscribe2.php:1495
303
+ msgid "the post's permalink<br />(<i>for per-post emails only</i>)"
304
  msgstr ""
305
 
306
+ #: subscribe2.php:1496
307
  msgid "the admin or post author's name"
308
  msgstr ""
309
 
310
+ #: subscribe2.php:1497
311
  msgid "the admin or post author's email"
312
  msgstr ""
313
 
314
+ #: subscribe2.php:1498
315
  msgid "the post author's name"
316
  msgstr ""
317
 
318
+ #: subscribe2.php:1499
319
  msgid ""
320
  "the generated link to confirm a request<br />(<i>only used in the "
321
  "confirmation email template</i>)"
322
  msgstr ""
323
 
324
+ #: subscribe2.php:1500
325
  msgid ""
326
  "Action performed by LINK in confirmation email<br />(<i>only used in the "
327
  "confirmation email template</i>)"
328
  msgstr ""
329
 
330
+ #: subscribe2.php:1502
331
  msgid "Subscribe / Unsubscribe confirmation email"
332
  msgstr ""
333
 
334
+ #: subscribe2.php:1505
335
  msgid "Reminder email to Unconfirmed Subscribers"
336
  msgstr ""
337
 
338
+ #: subscribe2.php:1510
339
  msgid "Excluded Categories"
340
  msgstr ""
341
 
342
+ #: subscribe2.php:1512
343
  msgid ""
344
  "Posts assigned to any Excluded Category do not generate notifications and "
345
  "are not included in digest notifications"
346
  msgstr ""
347
 
348
+ #: subscribe2.php:1519
349
  msgid "Allow registered users to subscribe to excluded categories?"
350
  msgstr ""
351
 
352
+ #: subscribe2.php:1522
353
  msgid "Writing Options"
354
  msgstr ""
355
 
356
+ #: subscribe2.php:1528
357
  msgid "Show the Subscribe2 button on the Write toolbar?"
358
  msgstr ""
359
 
360
+ #: subscribe2.php:1535
361
  msgid "Enable Subscribe2 Widget?"
362
  msgstr ""
363
 
364
+ #: subscribe2.php:1539
365
  msgid "Auto Subscribe"
366
  msgstr ""
367
 
368
+ #: subscribe2.php:1541
369
  msgid "Subscribe new users registering with your blog"
370
  msgstr ""
371
 
372
+ #: subscribe2.php:1546
373
  msgid "Automatically"
374
  msgstr ""
375
 
376
+ #: subscribe2.php:1551
377
  msgid "Display option on Registration Form"
378
  msgstr ""
379
 
380
+ #: subscribe2.php:1557
381
  msgid "Registration Form option is checked by default"
382
  msgstr ""
383
 
384
+ #: subscribe2.php:1568
385
  msgid "Auto-subscribe users to receive email as"
386
  msgstr ""
387
 
388
+ #: subscribe2.php:1573 subscribe2.php:1694
389
  msgid "HTML"
390
  msgstr ""
391
 
392
+ #: subscribe2.php:1578
393
  msgid "Plain Text - Full"
394
  msgstr ""
395
 
396
+ #: subscribe2.php:1583
397
  msgid "Plain Text - Excerpt"
398
  msgstr ""
399
 
400
+ #: subscribe2.php:1587
401
  msgid "Barred Domains"
402
  msgstr ""
403
 
404
+ #: subscribe2.php:1589
405
  msgid ""
406
  "Enter domains to bar from public subscriptions: <br /> (Use a new line for "
407
  "each entry and omit the \"@\" symbol, for example email.com)"
408
  msgstr ""
409
 
410
+ #: subscribe2.php:1599
411
  msgid "Reset Default"
412
  msgstr ""
413
 
414
+ #: subscribe2.php:1600
415
  msgid ""
416
  "Use this to reset all options to their defaults. This <strong><em>will not</"
417
  "em></strong> modify your list of subscribers."
418
  msgstr ""
419
 
420
+ #: subscribe2.php:1607
421
  msgid "RESET"
422
  msgstr ""
423
 
424
+ #: subscribe2.php:1627
425
  msgid "Subscription preferences updated."
426
  msgstr ""
427
 
428
+ #: subscribe2.php:1681
429
  msgid "Notification Settings"
430
  msgstr ""
431
 
432
+ #: subscribe2.php:1689
433
  msgid "Receive email as"
434
  msgstr ""
435
 
436
+ #: subscribe2.php:1699
437
  msgid "Plain Text"
438
  msgstr ""
439
 
440
+ #: subscribe2.php:1701
441
  msgid "Email contains"
442
  msgstr ""
443
 
444
+ #: subscribe2.php:1702
445
  msgid "Excerpt Only"
446
  msgstr ""
447
 
448
+ #: subscribe2.php:1702
449
  msgid "Full Post"
450
  msgstr ""
451
 
452
+ #: subscribe2.php:1710
453
  msgid "Note: HTML format will always deliver the full post"
454
  msgstr ""
455
 
456
+ #: subscribe2.php:1711
457
  msgid "Automatically subscribe me to newly created categories"
458
  msgstr ""
459
 
460
+ #: subscribe2.php:1725
461
  msgid "Subscribed Categories"
462
  msgstr ""
463
 
464
+ #: subscribe2.php:1730
465
  msgid "Receive daily summary of new posts?"
466
  msgstr ""
467
 
468
+ #: subscribe2.php:1746
469
  msgid "Update Preferences"
470
  msgstr ""
471
 
472
+ #: subscribe2.php:1791
473
  msgid "Send email to all subscribers"
474
  msgstr ""
475
 
476
+ #: subscribe2.php:1797
477
  msgid "Subject"
478
  msgstr ""
479
 
480
+ #: subscribe2.php:1797
481
  msgid "A message from "
482
  msgstr ""
483
 
484
+ #: subscribe2.php:1800
485
  msgid "Recipients: "
486
  msgstr ""
487
 
488
+ #: subscribe2.php:1863
489
  msgid "Select / Unselect All"
490
  msgstr ""
491
 
492
+ #: subscribe2.php:1876
493
  msgid "All Subscribers"
494
  msgstr ""
495
 
496
+ #: subscribe2.php:1877
497
  msgid "Public Subscribers"
498
  msgstr ""
499
 
500
+ #: subscribe2.php:1878
501
  msgid "Confirmed"
502
  msgstr ""
503
 
504
+ #: subscribe2.php:1879
505
  msgid "Unconfirmed"
506
  msgstr ""
507
 
508
+ #: subscribe2.php:1880
509
  msgid "Registered Users"
510
  msgstr ""
511
 
512
+ #: subscribe2.php:1937
513
  msgid "Per Post Email"
514
  msgstr ""
515
 
516
+ #: subscribe2.php:1952
517
  msgid "Send Digest Notification at"
518
  msgstr ""
519
 
520
+ #: subscribe2.php:1964
521
  msgid ""
522
  "This option will work for digest notification sent daily or less frequently"
523
  msgstr ""
524
 
525
+ #: subscribe2.php:1966
526
  msgid "Reset the schedule time and date for periodic email notifications"
527
  msgstr ""
528
 
529
+ #: subscribe2.php:1968
530
  msgid "Current server time is"
531
  msgstr ""
532
 
533
+ #: subscribe2.php:1970
534
+ msgid "Current blog time is"
535
+ msgstr ""
536
+
537
+ #: subscribe2.php:1972
538
+ msgid "Next email notification will be sent when your blog time is after"
539
  msgstr ""
540
 
541
+ #: subscribe2.php:1985
542
  msgid "Check here to Subscribe to email notifications for new posts"
543
  msgstr ""
544
 
545
+ #: subscribe2.php:1994
546
  msgid ""
547
  "By Registering with this blog you are also agreeing to recieve email "
548
  "notifications for new posts"
549
  msgstr ""
550
 
551
+ #: subscribe2.php:2119
552
  msgid "Subscription Confirmation"
553
  msgstr ""
554
 
555
+ #: subscribe2.php:2153
556
  msgid "Title:"
557
  msgstr ""
558
 
559
+ #: subscribe2.php:2325
560
  msgid "Digest Email"
561
  msgstr ""
562
 
563
+ #: include/options.php:59
564
  msgid ""
565
  "BLOGNAME has posted a new item, 'TITLE'\n"
566
  "\n"
576
  "EMAIL"
577
  msgstr ""
578
 
579
+ #: include/options.php:63
580
  msgid ""
581
  "BLOGNAME has received a request to ACTION for this email address. To "
582
  "complete your request please click on the link below:\n"
589
  "MYNAME."
590
  msgstr ""
591
 
592
+ #: include/options.php:67
593
  msgid ""
594
  "This email address was subscribed for notifications at BLOGNAME (BLOGLINK) "
595
  "but the subscription remains incomplete.\n"
subscribe2debug.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Subscribe2 Debug
4
+ Plugin URI: http://subscribe2.wordpress.com
5
+ Description: Produces Debug Information for the Subscribe2 plugin.
6
+ Version: 1.0
7
+ Author: Matthew Robinson
8
+ Author URI: http://subscribe2.wordpress.com
9
+ */
10
+
11
+ /*
12
+ Copyright (C) 2006-7 Matthew Robinson
13
+
14
+ This program is free software; you can redistribute it and/or
15
+ modify it under the terms of the GNU General Public License
16
+ as published by the Free Software Foundation; either version 2
17
+ of the License, or (at your option) any later version.
18
+
19
+ This program is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ GNU General Public License for more details.
23
+
24
+ You should have received a copy of the GNU General Public License
25
+ along with this program; if not, write to the Free Software
26
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
+ http://www.gnu.org/licenses/gpl.html
28
+ */
29
+
30
+ function add_debug_page() {
31
+ add_menu_page('Subscribe2 Debug', 'Subscribe2 Debug', 1, __FILE__, 'debug_menu');
32
+ }
33
+ add_action('admin_menu', 'add_debug_page');
34
+
35
+ function debug_menu() {
36
+ global $wp_filter;
37
+ echo "<div class=\"wrap\">";
38
+ $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
39
+ echo "<p>Current Server time is: \r\n";
40
+ echo "<strong>" . gmdate($datetime, current_time('timestamp', 1)) . "</strong></p>\r\n";
41
+ echo "<p>Current Blog time is: \r\n";
42
+ echo "<strong>" . gmdate($datetime, current_time('timestamp')) . "</strong></p>\r\n";
43
+ echo "<p>Current Blog offset is: \r\n";
44
+ echo get_option('gmt_offset') . "\r\n";
45
+ echo "<pre>";
46
+ cron_jobs();
47
+ echo "</pre>";
48
+ echo "Current Subscribe 2 Options are:";
49
+ echo "<pre>";
50
+ print_r(get_option('subscribe2_options'));
51
+ echo "</pre>";
52
+ echo "</div>";
53
+ include(ABSPATH . 'wp-admin/admin-footer.php');
54
+ // just to be sure
55
+ die;
56
+ }
57
+
58
+ function cron_jobs() {
59
+ $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
60
+ $jobs = _get_cron_array();
61
+ if (empty($jobs)) {
62
+ echo "No cron jobs scheduled";
63
+ } else {
64
+ foreach ( $jobs as $job => $tasks ) {
65
+ echo "Anytime after " . gmdate($datetime,$job) . " ";
66
+ foreach ($tasks as $procname => $task) {
67
+ echo $procname . " will execute\r\n";
68
+ }
69
+ }
70
+ }
71
+ return;
72
+ }
73
+ ?>
subscribe2uninstaller.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Subscribe2 Uninstaller
4
+ Plugin URI: http://subscribe2.wordpress.com
5
+ Description: Uninstalls the Subscribe2 plugin from Manage->S2 Uninstaller.
6
+ Version: 1.0
7
+ Author: Matthew Robinson
8
+ Author URI: http://subscribe2.wordpress.com
9
+ */
10
+
11
+ /*
12
+ Copyright (C) 2006-7 Matthew Robinson
13
+
14
+ This program is free software; you can redistribute it and/or
15
+ modify it under the terms of the GNU General Public License
16
+ as published by the Free Software Foundation; either version 2
17
+ of the License, or (at your option) any later version.
18
+
19
+ This program is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ GNU General Public License for more details.
23
+
24
+ You should have received a copy of the GNU General Public License
25
+ along with this program; if not, write to the Free Software
26
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
+ http://www.gnu.org/licenses/gpl.html
28
+ */
29
+
30
+ $mys2uninst = new s2uninst;
31
+ $mys2uninst->s2uninst_init();
32
+
33
+ class s2uninst {
34
+ function manage_page() {
35
+ global $s2nonce;
36
+
37
+ if (isset($_POST['s2_uninst'])) {
38
+ check_admin_referer('s2uninst-uninstaller' . $s2nonce);
39
+ echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Subscribe2 has been uninstalled.', 's2uninst') . "</strong></p></div>\n";
40
+ $this->uninstall();
41
+ }
42
+
43
+ echo "<div class=\"wrap\">";
44
+ echo "<h2>" . __('Subscribe2 Uninstaller', 's2uninst') . "</h2>\r\n";
45
+ if (class_exists('s2class')) {
46
+ echo "<p>" . __('The Subscribe2 plugin is still active on your system. Please deactivate the plugin before completing the uninstall process.', 's2uninst') . "</p>\r\n";
47
+ echo "<p>" . __('You can deactivate the plugin by using the ', 's2uninst') . "<a href=\"" . get_option('siteurl') . "/wp-admin/plugins.php\">" . __('WordPress Plugin Page', 's2uninst') . "</a>.</p>";
48
+ echo "</div>\r\n";
49
+ include(ABSPATH . 'wp-admin/admin-footer.php');
50
+ // just to be sure
51
+ die;
52
+ } else {
53
+ echo "<form method=\"post\" action=\"\">";
54
+ if (function_exists('wp_nonce_field')) {
55
+ wp_nonce_field('s2uninst-uninstaller' . $s2nonce);
56
+ }
57
+ echo "<p>" . __('Clicking on UNINSTALL will remove the following items from your WordPress install (these were installed by Subscribe2).', 's2uninst') . "</p>\r\n";
58
+ echo "<ul>\r\n";
59
+ echo "<li>" . __('Options Table Entries', 's2uninst') . "</li>\r\n";
60
+ echo "<li>" . __('Usermeta Table Entries', 's2uninst') . "</li>\r\n";
61
+ echo "<li>" . __('Subscribe2 Table', 's2uninst') . "</li>\r\n";
62
+ echo "<li>" . __('Events Schedules by Subscribe2', 's2uninst') . "</li>\r\n";
63
+ echo "</ul>\r\n";
64
+ echo "<p align=\"center\"><span class=\"submit\">\r\n";
65
+ echo "<input type=\"hidden\" name=\"s2_uninst\" value=\"RESET\" />\r\n";
66
+ echo "<input type=\"submit\" id=\"deletepost\" name=\"submit\" value=\"" . __('UNINSTALL', 's2uninst') . "\" />\r\n";
67
+ echo "</span></p></form></div>\r\n";
68
+ include(ABSPATH . 'wp-admin/admin-footer.php');
69
+ // just to be sure
70
+ die;
71
+ }
72
+ }
73
+
74
+ function uninstall() {
75
+ global $wpdb, $table_prefix;
76
+ // get name of subscribe2 table
77
+ $this->public = $table_prefix . "subscribe2";
78
+ // delete entry from wp_options table
79
+ delete_option('subscribe2_options');
80
+ // delete legacy entry from wp-options table
81
+ delete_option('s2_future_posts');
82
+ // remove and scheduled events
83
+ wp_clear_scheduled_hook('s2_digest_cron');
84
+ // delete usermeta data for registered users
85
+ $users = $wpdb->get_col("SELECT ID FROM $wpdb->users");
86
+ if (!empty($users)) {
87
+ foreach ($users as $user) {
88
+ $cats = explode(',', get_usermeta($user, 's2_subscribed'));
89
+ if ($cats) {
90
+ foreach ($cats as $cat) {
91
+ delete_usermeta($user, "s2_cat" . $cat);
92
+ }
93
+ }
94
+ delete_usermeta($user, 's2_subscribed');
95
+ }
96
+ }
97
+ // drop the subscribe2 table
98
+ $sql = "DROP TABLE IF EXISTS `" . $this->public . "`";
99
+ mysql_query($sql);
100
+ }
101
+
102
+ function s2uninst_init() {
103
+ load_plugin_textdomain('s2uninst', 'wp-content/plugins/');
104
+ add_action('admin_menu', array(&$this, 's2uninst_page'));
105
+ }
106
+
107
+ function s2uninst_page() {
108
+ add_management_page(__('S2 Uninstaller', 's2uninst'), __('S2 Uninstaller', 's2uninst'), "manage_options", __FILE__, array(&$this, 'manage_page'));
109
+ }
110
+ }
111
+ ?>
{subscribe2/tinymce → tinymce}/editor_plugin.js RENAMED
File without changes
{subscribe2/tinymce → tinymce}/langs/en.js RENAMED
File without changes
{subscribe2/tinymce → tinymce}/langs/en_us.js RENAMED
File without changes
{subscribe2/tinymce → tinymce}/langs/nl_nl.js RENAMED
File without changes
tinymce3/css/content.css ADDED
@@ -0,0 +1 @@
 
1
+ .mceSubscribe2 {display:block;border:0;width:100%;height:12px;border-top:1px;margin-top:15px;background:#fff url(../../include/s2_marker.png) no-repeat center top;}
tinymce3/editor_plugin.js ADDED
@@ -0,0 +1 @@
 
1
+ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3(){6.1p(\'6.s.r\',{1o:3(2,f){1n k=\'<A 1m="\'+f+\'/../../G/1l.1k" z="c 1j" />\',9=\'c\',i=2.1i(\'1h\',\'<!--4-->\'),l;l=1g 1f(i.j(/[\\?\\.\\*\\[\\]\\(\\)\\{\\}\\+\\^\\$\\:]/g,3(a){h\'\\\\\'+a}),\'g\');2.1e(\'c\',3(){2.1d(\'1c\',0,k)});2.1b(\'4\',{1a:\'y x w\',19:f+\'/../G/18.17\',16:9});2.15.5(3(){2.d.14(f+"/F/8.F");7(2.E.D){2.E.D.5(3(13,o){7(o.C.q==\'p\'&&2.d.m(o.C,9))o.12=\'4\'})}});2.11.5(3(2,e){e=e.10;7(e.q===\'p\'&&2.d.m(e,9))2.Z.Y(e)});2.X.5(3(2,B,n){B.W(\'4\',n.q===\'p\'&&2.d.m(n,9))});2.V.5(3(2,o){o.8=o.8.j(l,k)});2.U.5(3(2,o){7(o.T)o.8=o.8.j(/<A[^>]+>/g,3(b){7(b.S(\'z="c\')!==-1)b=i;h b})})},R:3(){h{Q:\'y x w\',P:\'O N\',M:\'v://4.u.t\',L:\'v://4.u.t\',K:6.J+"."+6.I}}});6.H.5(\'4\',6.s.r)})();',62,88,'||ed|function|subscribe2|add|tinymce|if|content|cls||im|mceSubscribe2|dom||url||return|sep|replace|pb|pbRE|hasClass|||IMG|nodeName|Subscribe2Plugin|plugins|com|wordpress|http|Token|Subscribe2|Insert|class|img|cm|node|onResolveName|theme|css|include|PluginManager|minorVersion|majorVersion|version|infourl|authorurl|Robinson|Matthew|author|longname|getInfo|indexOf|get|onPostProcess|onBeforeSetContent|setActive|onNodeChange|select|selection|target|onClick|name|th|loadCSS|onInit|cmd|png|s2_button|image|title|addButton|mceInsertContent|execCommand|addCommand|RegExp|new|subscribe2_separator|getParam|mceItemNoResize|gif|trans|src|var|init|create'.split('|'),0,{}))
tinymce3/editor_plugin_src.js ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ tinymce.create('tinymce.plugins.Subscribe2Plugin', {
3
+ init : function(ed, url) {
4
+ var pb = '<img src="' + url + '/../../include/trans.gif" class="mceSubscribe2 mceItemNoResize" />', cls = 'mceSubscribe2', sep = ed.getParam('subscribe2_separator', '<!--subscribe2-->'), pbRE;
5
+
6
+ pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');
7
+
8
+ // Register commands
9
+ ed.addCommand('mceSubscribe2', function() {
10
+ ed.execCommand('mceInsertContent', 0, pb);
11
+ });
12
+
13
+ // Register buttons
14
+ ed.addButton('subscribe2', {title : 'Insert Subscribe2 Token', image : url + '/../include/s2_button.png', cmd : cls});
15
+
16
+ ed.onInit.add(function() {
17
+ ed.dom.loadCSS(url + "/css/content.css");
18
+
19
+ if (ed.theme.onResolveName) {
20
+ ed.theme.onResolveName.add(function(th, o) {
21
+ if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls))
22
+ o.name = 'subscribe2';
23
+ });
24
+ }
25
+ });
26
+
27
+ ed.onClick.add(function(ed, e) {
28
+ e = e.target;
29
+
30
+ if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls))
31
+ ed.selection.select(e);
32
+ });
33
+
34
+ ed.onNodeChange.add(function(ed, cm, n) {
35
+ cm.setActive('subscribe2', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls));
36
+ });
37
+
38
+ ed.onBeforeSetContent.add(function(ed, o) {
39
+ o.content = o.content.replace(pbRE, pb);
40
+ });
41
+
42
+ ed.onPostProcess.add(function(ed, o) {
43
+ if (o.get)
44
+ o.content = o.content.replace(/<img[^>]+>/g, function(im) {
45
+ if (im.indexOf('class="mceSubscribe2') !== -1)
46
+ im = sep;
47
+
48
+ return im;
49
+ });
50
+ });
51
+ },
52
+
53
+ getInfo : function() {
54
+ return {
55
+ longname : 'Insert Subscribe2 Token',
56
+ author : 'Matthew Robinson',
57
+ authorurl : 'http://subscribe2.wordpress.com',
58
+ infourl : 'http://subscribe2.wordpress.com',
59
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
60
+ };
61
+ }
62
+ });
63
+
64
+ // Register plugin
65
+ tinymce.PluginManager.add('subscribe2', tinymce.plugins.Subscribe2Plugin);
66
+ })();