Subscribe2 - Version 8.5

Version Description

Download this release

Release Info

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

Code changes from version 8.4 to 8.5

ReadMe.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: MattyRob, Skippy, RavanH
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904
4
  Tags: posts, subscription, email, subscribe, notify, notification
5
  Requires at least: 3.1
6
- Tested up to: 3.4
7
- Stable tag: 8.4
8
  License: GPL3
9
 
10
  Sends a list of subscribers an email notification when new posts are published to your blog
@@ -122,6 +122,16 @@ The pseudo-cron is WordPress is named after the cron jobs on servers. These are
122
 
123
  some reasons why your pseudo-cron may not be working are explained [here](http://wordpress.org/support/topic/296236#post-1175405). You can also try overcoming these by calling the wp-cron.php file directly and there are even [instructions](http://www.satollo.net/how-to-make-the-wordpress-cron-work) about how to set up a server cron job to do this periodically to restore WordPress pseudo-cron to a working state.
124
 
 
 
 
 
 
 
 
 
 
 
125
  = When I click on Send Preview in Settings->Susbcribe2 I get 4 emails, why =
126
 
127
  Subscribe2 supports 4 potential email formats for Susbcribers so you will get a preview for each of the different possibilities.
@@ -193,7 +203,7 @@ If you opt for the latter way look in the options table for the subscribe2_optio
193
 
194
  = I would really like Registered users to have the Subscription page themed like my site, is this possible? =
195
 
196
- Yes, it is. There is a small extension to Subscribe2 that delivers exactly this functionality. It is available from [Theme Tailors(http://stiofan.themetailors.com/store/products/tt-subscribe2-front-end-plugin/) for just $2.
197
 
198
  = How do I make use of the support for Custom Post Types =
199
 
@@ -282,7 +292,7 @@ By default Public Subscribers get plain text emails and only Registered Subscrib
282
 
283
  = Which version should I be using, I'm on WordPress x.x.x? =
284
 
285
- WordPress 3.1 and up requires Subscribe2 from the 7.x stable branch. The most recent version is hosted via [Wordpress.org](http://wordpress.org/extend/plugins/subscribe2/).
286
 
287
  WordPress 2.8 and up requires Subscribe2 from the 6.x stable branch. The most q version is [6.5](http://downloads.wordpress.org/plugin/subscribe2.6.5.zip).
288
 
@@ -299,13 +309,37 @@ Secondly, make sure that the token ([subscribe2] or <!--subscribe2-->) is correc
299
 
300
  == Screenshots ==
301
 
302
- 1. The Posts->Mail Subscribers admin page generated by the plugin.
303
- 2. The Tools->Subscribers admin page generated by the plugin.
304
- 3. The Users->Subscriptions admin page generated by the plugin.
305
- 4. The Options->Subscribe2 admin page generated by the plugin.
306
 
307
  == Changelog ==
308
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  = Version 8.4 by Matthew Robinson =
310
 
311
  * Fixed an error in the 'Send Mail' page that blocked emails from being sent
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904
4
  Tags: posts, subscription, email, subscribe, notify, notification
5
  Requires at least: 3.1
6
+ Tested up to: 3.4.2
7
+ Stable tag: 8.5
8
  License: GPL3
9
 
10
  Sends a list of subscribers an email notification when new posts are published to your blog
122
 
123
  some reasons why your pseudo-cron may not be working are explained [here](http://wordpress.org/support/topic/296236#post-1175405). You can also try overcoming these by calling the wp-cron.php file directly and there are even [instructions](http://www.satollo.net/how-to-make-the-wordpress-cron-work) about how to set up a server cron job to do this periodically to restore WordPress pseudo-cron to a working state.
124
 
125
+ = I'd like to send the Digest email but on a different interval to the ones listed. Is this possible? =
126
+
127
+ Yes, this is possible, it just requires a little bit of code. Subscribe2 uses the intervals that are currently defined in WordPress (and by any plugins that create additional intervals), so all you need to do is add to the available intervals. Use code like this and simply change the interval time (in seconds) and description.
128
+
129
+ `function add_my_new_sched($sched) {
130
+ $sched['my_new'] = array('interval' => 2419200, 'display' => 'Four Weekly');
131
+ return $sched;
132
+ }
133
+ add_filter('cron_schedules', 'add_my_new_sched');`
134
+
135
  = When I click on Send Preview in Settings->Susbcribe2 I get 4 emails, why =
136
 
137
  Subscribe2 supports 4 potential email formats for Susbcribers so you will get a preview for each of the different possibilities.
203
 
204
  = I would really like Registered users to have the Subscription page themed like my site, is this possible? =
205
 
206
+ Yes, it is. There is a small extension to Subscribe2 that delivers exactly this functionality. It is available from [Theme Tailors](http://stiofan.themetailors.com/store/products/tt-subscribe2-front-end-plugin/) for just $2.
207
 
208
  = How do I make use of the support for Custom Post Types =
209
 
292
 
293
  = Which version should I be using, I'm on WordPress x.x.x? =
294
 
295
+ WordPress 3.1 and up requires Subscribe2 from the 7.x or 8.x stable branch. The most recent version is hosted via [Wordpress.org](http://wordpress.org/extend/plugins/subscribe2/).
296
 
297
  WordPress 2.8 and up requires Subscribe2 from the 6.x stable branch. The most q version is [6.5](http://downloads.wordpress.org/plugin/subscribe2.6.5.zip).
298
 
309
 
310
  == Screenshots ==
311
 
312
+ 1. The Subsribe2->Mail Subscribers admin page generated by the plugin.
313
+ 2. The Subsribe2->Subscribers admin page generated by the plugin.
314
+ 3. The Subsribe2->Subscriptions admin page generated by the plugin.
315
+ 4. The Subsribe2->Subscribe2 admin page generated by the plugin.
316
 
317
  == Changelog ==
318
 
319
+ = Version 8.5 by Matthew Robinson =
320
+
321
+ * Fixed width of a page select drop down in the Widget settings - thanks to Balky79
322
+ * Added option to check the comment subscription box by default - proposed by Doug Lerner
323
+ * Improved off-domain error message in Settings page and address checking if Blogname is selected
324
+ * Fixed an issue on Multisite installs displaying the wrong link to profiles pages for other blog sites - thanks to MadtownLems
325
+ * Fixed an issue with Image and Shortcode replacement in the visual editor (TinyMCE) - thanks to Dave Firman
326
+ * Fixed unique IDs for 2 possible error messages in the Settings page - thanks to MadtownLems
327
+ * Fixed several HTML5 validation error in the admin pages
328
+ * Improved regex replacedment of s strike and del HTML tags in plaintext emails - thanks to jimshell
329
+ * Use wp_kses() rather than strip_tags() on email subject lines so that single angle brackets are allowed - thanks to eightize and esmi
330
+ * Allow remote definition of email address in form - thanks to orion42
331
+ * Added ability to have compulsory categories - proposed by iClimb
332
+ * Apply WordPress the_author filter to the author names to improve plugin compatibility - proposed by SpaciousMind
333
+ * Added the ability to track the post ID in the tracking Parameter field - proposed by Laga
334
+ * Protect the 's2email' post meta key - proposed by Nally123
335
+ * Strip excess white space within the Digest email when images are removed
336
+ * Add a time column to the public subscriber table for hosting provider spam policy compliance - proposed by Erik N
337
+ * Change plugin folder name to suppress update prompts for the HTML version
338
+ * Rename js files consistently with core ticket 21633
339
+ * Add width parameter to comment form text to fix issues with some themes - proposed by mharpen
340
+ * Added option to include Sticky Posts at the top of all Digest Notifications - proposed by pkhatmedia
341
+ * Fixed some Markdown errors in the ReadMe
342
+
343
  = Version 8.4 by Matthew Robinson =
344
 
345
  * Fixed an error in the 'Send Mail' page that blocked emails from being sent
admin/send_email.php CHANGED
@@ -8,7 +8,7 @@ global $wpdb, $s2nonce, $current_user;
8
  // was anything POSTed?
9
  if ( isset($_POST['s2_admin']) && 'mail' == $_POST['s2_admin'] ) {
10
  check_admin_referer('subscribe2-write_subscribers' . $s2nonce);
11
- $subject = html_entity_decode($this->substitute(stripslashes(strip_tags($_POST['subject']))), ENT_QUOTES);
12
  $body = $this->substitute(stripslashes($_POST['content']));
13
  if ( '' != $current_user->display_name || '' != $current_user->user_email ) {
14
  $this->myname = html_entity_decode($current_user->display_name, ENT_QUOTES);
@@ -55,7 +55,7 @@ if ( isset($_POST['s2_admin']) && 'mail' == $_POST['s2_admin'] ) {
55
  echo "<div class=\"wrap\">";
56
  echo "<div id=\"icon-edit\" class=\"icon32\"></div>";
57
  echo "<h2>" . __('Send an email to subscribers', 'subscribe2') . "</h2>\r\n";
58
- echo "<form method=\"post\" action=\"\">\r\n";
59
  if ( function_exists('wp_nonce_field') ) {
60
  wp_nonce_field('subscribe2-write_subscribers' . $s2nonce);
61
  }
@@ -74,7 +74,7 @@ echo __('Recipients:', 'subscribe2') . " ";
74
  $this->display_subscriber_dropdown('registered', false, array('all'));
75
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"mail\" />";
76
  echo "</p>";
77
- echo "<p class=\"submit\"><input type=\"submit\" class=\"button-secondary\" name=\"preview\" value=\"" . __('Preview', 'subscribe2') . "\" \><input type=\"submit\" class=\"button-primary\" name=\"send\" value=\"" . __('Send', 'subscribe2') . "\" /></p>";
78
  echo "</form></div>\r\n";
79
  echo "<div style=\"clear: both;\"><p>&nbsp;</p></div>";
80
 
8
  // was anything POSTed?
9
  if ( isset($_POST['s2_admin']) && 'mail' == $_POST['s2_admin'] ) {
10
  check_admin_referer('subscribe2-write_subscribers' . $s2nonce);
11
+ $subject = html_entity_decode(stripslashes(wp_kses($this->substitute($_POST['subject']), '')), ENT_QUOTES);
12
  $body = $this->substitute(stripslashes($_POST['content']));
13
  if ( '' != $current_user->display_name || '' != $current_user->user_email ) {
14
  $this->myname = html_entity_decode($current_user->display_name, ENT_QUOTES);
55
  echo "<div class=\"wrap\">";
56
  echo "<div id=\"icon-edit\" class=\"icon32\"></div>";
57
  echo "<h2>" . __('Send an email to subscribers', 'subscribe2') . "</h2>\r\n";
58
+ echo "<form method=\"post\">\r\n";
59
  if ( function_exists('wp_nonce_field') ) {
60
  wp_nonce_field('subscribe2-write_subscribers' . $s2nonce);
61
  }
74
  $this->display_subscriber_dropdown('registered', false, array('all'));
75
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"mail\" />";
76
  echo "</p>";
77
+ echo "<p class=\"submit\"><input type=\"submit\" class=\"button-secondary\" name=\"preview\" value=\"" . __('Preview', 'subscribe2') . "\" /><input type=\"submit\" class=\"button-primary\" name=\"send\" value=\"" . __('Send', 'subscribe2') . "\" /></p>";
78
  echo "</form></div>\r\n";
79
  echo "<div style=\"clear: both;\"><p>&nbsp;</p></div>";
80
 
admin/settings.php CHANGED
@@ -5,19 +5,6 @@ if ( !function_exists('add_action') ) {
5
 
6
  global $s2nonce, $wpdb, $wp_version;
7
 
8
- // send error message if no WordPress page exists
9
- $sql = "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status='publish' LIMIT 1";
10
- $id = $wpdb->get_var($sql);
11
- if ( empty($id) ) {
12
- echo "<div id=\"message\" class=\"error\"><p><strong>$this->no_page</strong></p></div>";
13
- }
14
-
15
- $sender = $this->get_userdata($this->subscribe2_options['sender']);
16
- list($user, $domain) = explode('@', $sender->user_email, 2);
17
- if ( !strstr($_SERVER['SERVER_NAME'], $domain) ) {
18
- echo "<div id=\"message\" class=\"error\"><p><strong>" . __('You appear to be sending notifications from an email address from a different domain name to your blog, this may result in failed emails', 'subscribe2') . "</strong></p></div>";
19
- }
20
-
21
  // was anything POSTed?
22
  if ( isset( $_POST['s2_admin']) ) {
23
  check_admin_referer('subscribe2-options_subscribers' . $s2nonce);
@@ -25,11 +12,12 @@ if ( isset( $_POST['s2_admin']) ) {
25
  $this->reset();
26
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>$this->options_reset</strong></p></div>";
27
  } elseif ( isset($_POST['preview']) ) {
28
- global $user_email;
29
  $this->preview_email = true;
30
  if ( 'never' == $this->subscribe2_options['email_freq'] ) {
31
- $post = get_posts('numberposts=1');
32
- $this->publish($post[0], $user_email);
 
33
  } else {
34
  $this->subscribe2_cron($user_email);
35
  }
@@ -64,6 +52,7 @@ if ( isset( $_POST['s2_admin']) ) {
64
  $this->subscribe2_options['pages'] = $_POST['pages'];
65
  $this->subscribe2_options['password'] = $_POST['password'];
66
  $this->subscribe2_options['private'] = $_POST['private'];
 
67
  $this->subscribe2_options['cron_order'] = $_POST['cron_order'];
68
  $this->subscribe2_options['tracking'] = $_POST['tracking'];
69
 
@@ -71,10 +60,6 @@ if ( isset( $_POST['s2_admin']) ) {
71
  $email_freq = $_POST['email_freq'];
72
  $scheduled_time = wp_next_scheduled('s2_digest_cron');
73
  if ( $email_freq != $this->subscribe2_options['email_freq'] || $_POST['hour'] != date('H', $scheduled_time) ) {
74
- // make sure the timezone strings are right
75
- if ( function_exists('date_default_timezone_get') && date_default_timezone_get() != get_option('timezone_string') ) {
76
- date_default_timezone_set(get_option('timezone_string'));
77
- }
78
  $this->subscribe2_options['email_freq'] = $email_freq;
79
  wp_clear_scheduled_hook('s2_digest_cron');
80
  $scheds = (array)wp_get_schedules();
@@ -86,25 +71,11 @@ if ( isset( $_POST['s2_admin']) ) {
86
  } else {
87
  // if we are using digest schedule the event and prime last_cron as now
88
  $time = time() + $interval;
89
- if ( $interval < 86400 ) {
90
- // Schedule CRON events occurring less than daily starting now and periodically thereafter
91
- $maybe_time = mktime($_POST['hour'], 0, 0, date('m', time()), date('d', time()), date('Y', time()));
92
- // is maybe_time in the future
93
- $offset = $maybe_time - time();
94
- // is maybe_time + $interval in the future
95
- $offset2 = ($maybe_time + $interval) - time();
96
- if ( $offset < 0 ) {
97
- if ( $offset2 < 0 ) {
98
- $timestamp = &$time;
99
- } else {
100
- $timestamp = $maybe_time + $interval;
101
- }
102
- } else {
103
- $timestamp = &$maybe_time;
104
- }
105
- } else {
106
- // Schedule other CRON events starting at user defined hour and periodically thereafter
107
- $timestamp = mktime($_POST['hour'], 0, 0, date('m', $time), date('d', $time), date('Y', $time));
108
  }
109
  wp_schedule_event($timestamp, $email_freq, 's2_digest_cron');
110
  if ( !isset($this->subscribe2_options['last_s2cron']) ) {
@@ -134,6 +105,15 @@ if ( isset( $_POST['s2_admin']) ) {
134
  $this->subscribe2_options['remind_email'] = $_POST['remind_email'];
135
  }
136
 
 
 
 
 
 
 
 
 
 
137
  // excluded categories
138
  if ( !empty($_POST['category']) ) {
139
  sort($_POST['category']);
@@ -196,6 +176,7 @@ if ( isset( $_POST['s2_admin']) ) {
196
  $this->subscribe2_options['show_autosub'] = $_POST['show_autosub'];
197
  $this->subscribe2_options['autosub_def'] = $_POST['autosub_def'];
198
  $this->subscribe2_options['comment_subs'] = $_POST['comment_subs'];
 
199
  $this->subscribe2_options['one_click_profile'] = $_POST['one_click_profile'];
200
 
201
  //barred domains
@@ -205,13 +186,33 @@ if ( isset( $_POST['s2_admin']) ) {
205
  update_option('subscribe2_options', $this->subscribe2_options);
206
  }
207
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  // show our form
209
  echo "<div class=\"wrap\">";
210
  echo "<div id=\"icon-options-general\" class=\"icon32\"></div>";
211
  echo "<h2>" . __('Subscribe2 Settings', 'subscribe2') . "</h2>\r\n";
212
  echo "<a href=\"http://subscribe2.wordpress.com/\">" . __('Plugin Blog', 'subscribe2') . "</a> | ";
213
  echo "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904\">" . __('Make a donation via PayPal', 'subscribe2') . "</a>";
214
- echo "<form method=\"post\" action=\"\">\r\n";
215
  if ( function_exists('wp_nonce_field') ) {
216
  wp_nonce_field('subscribe2-options_subscribers' . $s2nonce);
217
  }
@@ -271,6 +272,11 @@ echo "<label><input type=\"radio\" name=\"private\" value=\"yes\"" . checked($th
271
  echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
272
  echo "<label><input type=\"radio\" name=\"private\" value=\"no\"" . checked($this->subscribe2_options['private'], 'no', false) . " /> ";
273
  echo __('No', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
 
 
274
  echo __('Send Email From', 'subscribe2') . ': ';
275
  echo "<label>\r\n";
276
  $this->admin_dropdown(true);
@@ -286,21 +292,21 @@ if ( function_exists('wp_schedule_event') ) {
286
  }
287
  echo __('Add Tracking Parameters to the Permalink', 'subscribe2') . ": ";
288
  echo "<input type=\"text\" name=\"tracking\" value=\"" . stripslashes($this->subscribe2_options['tracking']) . "\" size=\"50\" /> ";
289
- echo "<br />" . __('eg. utm_source=subscribe2&utm_medium=email&utm_campaign=postnotify', 'subscribe2') . "<br /><br />\r\n";
290
  echo "</div>\r\n";
291
 
292
  // email templates
293
  echo "<div class=\"s2_admin\" id=\"s2_templates\">\r\n";
294
  echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
295
  echo "<br />";
296
- echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"1\" class=\"editform\">\r\n";
297
- echo "<tr><td>";
298
  echo __('New Post email (must not be empty)', 'subscribe2') . ":<br />\r\n";
299
  echo __('Subject Line', 'subscribe2') . ": ";
300
  echo "<input type=\"text\" name=\"notification_subject\" value=\"" . stripslashes($this->subscribe2_options['notification_subject']) . "\" size=\"30\" />";
301
  echo "<br />\r\n";
302
- echo "<textarea rows=\"9\" cols=\"60\" name=\"mailtext\">" . stripslashes($this->subscribe2_options['mailtext']) . "</textarea><br /><br />\r\n";
303
- echo "</td><td valign=\"top\" rowspan=\"3\">";
304
  echo "<p class=\"submit\"><input type=\"submit\" class=\"button-secondary\" name=\"preview\" value=\"" . __('Send Email Preview', 'subscribe2') . "\" /></p>\r\n";
305
  echo "<h3>" . __('Message substitutions', 'subscribe2') . "</h3>\r\n";
306
  echo "<dl>";
@@ -324,12 +330,12 @@ echo "<dt><b>{ACTION}</b></dt><dd>" . __("Action performed by LINK in confirmati
324
  echo "<dt><b>{CATS}</b></dt><dd>" . __("the post's assigned categories", 'subscribe2') . "</dd>\r\n";
325
  echo "<dt><b>{TAGS}</b></dt><dd>" . __("the post's assigned Tags", 'subscribe2') . "</dd>\r\n";
326
  echo "<dt><b>{COUNT}</b></dt><dd>" . __("the number of posts included in the digest email<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
327
- echo "</dl></td></tr><tr><td>";
328
  echo __('Subscribe / Unsubscribe confirmation email', 'subscribe2') . ":<br />\r\n";
329
  echo __('Subject Line', 'subscribe2') . ": ";
330
  echo "<input type=\"text\" name=\"confirm_subject\" value=\"" . stripslashes($this->subscribe2_options['confirm_subject']) . "\" size=\"30\" /><br />\r\n";
331
- echo "<textarea rows=\"9\" cols=\"60\" name=\"confirm_email\">" . stripslashes($this->subscribe2_options['confirm_email']) . "</textarea><br /><br />\r\n";
332
- echo "</td></tr><tr valign=\"top\"><td>";
333
  echo __('Reminder email to Unconfirmed Subscribers', 'subscribe2') . ":<br />\r\n";
334
  echo __('Subject Line', 'subscribe2') . ": ";
335
  echo "<input type=\"text\" name=\"remind_subject\" value=\"" . stripslashes($this->subscribe2_options['remind_subject']) . "\" size=\"30\" /><br />\r\n";
@@ -337,6 +343,15 @@ echo "<textarea rows=\"9\" cols=\"60\" name=\"remind_email\">" . stripslashes($t
337
  echo "</td></tr></table><br />\r\n";
338
  echo "</div>\r\n";
339
 
 
 
 
 
 
 
 
 
 
340
  // excluded categories
341
  echo "<div class=\"s2_admin\" id=\"s2_excluded_categories\">\r\n";
342
  echo "<h2>" . __('Excluded Categories', 'subscribe2') . "</h2>\r\n";
@@ -344,20 +359,22 @@ echo "<p>";
344
  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";
345
  echo "</p>";
346
  $this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
347
- echo "<center><label><input type=\"checkbox\" name=\"reg_override\" value=\"1\"" . checked($this->subscribe2_options['reg_override'], '1', false) . " /> ";
348
- echo __('Allow registered users to subscribe to excluded categories?', 'subscribe2') . "</label></center><br />\r\n";
 
349
 
350
  // excluded post formats
351
  $formats = get_theme_support('post-formats');
352
  if ( $formats !== false ) {
353
  // excluded formats
 
354
  echo "<h2>" . __('Excluded Formats', 'subscribe2') . "</h2>\r\n";
355
  echo "<p>";
356
  echo "<strong><em style=\"color: red\">" . __('Posts assigned to any Excluded Format do not generate notifications and are not included in digest notifications', 'subscribe2') . "</em></strong><br />\r\n";
357
  echo "</p>";
358
  $this->display_format_form($formats, explode(',', $this->subscribe2_options['exclude_formats']));
 
359
  }
360
- echo "</div>\r\n";
361
 
362
  // Appearance options
363
  echo "<div class=\"s2_admin\" id=\"s2_appearance_settings\">\r\n";
@@ -388,7 +405,7 @@ echo "<label><input type=\"checkbox\" name=\"show_button\" value=\"1\"" . checke
388
  echo __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "</label><br /><br />\r\n";
389
 
390
  // enable AJAX style form
391
- echo "<label><input type=\"checkbox\" name=\"ajax\" value=\"1\"" . checked($this->subscribe2_options['ajax'], '1', false) . " />";
392
  echo __('Enable AJAX style subscription form?', 'subscribe2') . "</label><br /><br />\r\n";
393
 
394
  // show Widget
@@ -454,6 +471,11 @@ echo "<label><input type=\"radio\" name=\"comment_subs\" value=\"after\"" . chec
454
  echo __('After the Comment Submit button', 'subscribe2') . "</label>&nbsp;&nbsp;";
455
  echo "<label><input type=\"radio\" name=\"comment_subs\" value=\"no\"" . checked($this->subscribe2_options['comment_subs'], 'no', false) . " /> ";
456
  echo __('No', 'subscribe2') . "</label><br /><br />";
 
 
 
 
 
457
  echo __('Show one-click subscription on profile page', 'subscribe2') . ":<br />\r\n";
458
  echo "<label><input type=\"radio\" name=\"one_click_profile\" value=\"yes\"" . checked($this->subscribe2_options['one_click_profile'], 'yes', false) . " /> ";
459
  echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
@@ -471,12 +493,12 @@ echo "</p>";
471
  echo "</div>\r\n";
472
 
473
  // submit
474
- echo "<p class=\"submit\" align=\"center\"><input type=\"submit\" class=\"button-primary\" name=\"submit\" value=\"" . __('Submit', 'subscribe2') . "\" /></p>";
475
 
476
  // reset
477
  echo "<h2>" . __('Reset Default', 'subscribe2') . "</h2>\r\n";
478
  echo "<p>" . __('Use this to reset all options to their defaults. This <strong><em>will not</em></strong> modify your list of subscribers.', 'subscribe2') . "</p>\r\n";
479
- echo "<p class=\"submit\" align=\"center\">";
480
  echo "<input type=\"submit\" id=\"deletepost\" name=\"reset\" value=\"" . __('RESET', 'subscribe2') .
481
  "\" />";
482
  echo "</p></form></div>\r\n";
5
 
6
  global $s2nonce, $wpdb, $wp_version;
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  // was anything POSTed?
9
  if ( isset( $_POST['s2_admin']) ) {
10
  check_admin_referer('subscribe2-options_subscribers' . $s2nonce);
12
  $this->reset();
13
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>$this->options_reset</strong></p></div>";
14
  } elseif ( isset($_POST['preview']) ) {
15
+ global $user_email, $post;
16
  $this->preview_email = true;
17
  if ( 'never' == $this->subscribe2_options['email_freq'] ) {
18
+ $posts = get_posts('numberposts=1');
19
+ $post = $posts[0];
20
+ $this->publish($post, $user_email);
21
  } else {
22
  $this->subscribe2_cron($user_email);
23
  }
52
  $this->subscribe2_options['pages'] = $_POST['pages'];
53
  $this->subscribe2_options['password'] = $_POST['password'];
54
  $this->subscribe2_options['private'] = $_POST['private'];
55
+ $this->subscribe2_options['stickies'] = $_POST['stickies'];
56
  $this->subscribe2_options['cron_order'] = $_POST['cron_order'];
57
  $this->subscribe2_options['tracking'] = $_POST['tracking'];
58
 
60
  $email_freq = $_POST['email_freq'];
61
  $scheduled_time = wp_next_scheduled('s2_digest_cron');
62
  if ( $email_freq != $this->subscribe2_options['email_freq'] || $_POST['hour'] != date('H', $scheduled_time) ) {
 
 
 
 
63
  $this->subscribe2_options['email_freq'] = $email_freq;
64
  wp_clear_scheduled_hook('s2_digest_cron');
65
  $scheds = (array)wp_get_schedules();
71
  } else {
72
  // if we are using digest schedule the event and prime last_cron as now
73
  $time = time() + $interval;
74
+ $timestamp = mktime($_POST['hour'], 0, 0, date('m', $time), date('d', $time), date('Y', $time));
75
+ while ($timestamp < time()) {
76
+ // if we are trying to set the time in the past increment it forward
77
+ // by the interval period until it is in the future
78
+ $timestamp += $interval;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  }
80
  wp_schedule_event($timestamp, $email_freq, 's2_digest_cron');
81
  if ( !isset($this->subscribe2_options['last_s2cron']) ) {
105
  $this->subscribe2_options['remind_email'] = $_POST['remind_email'];
106
  }
107
 
108
+ // compulsory categories
109
+ if ( !empty($_POST['compulsory']) ) {
110
+ sort($_POST['compulsory']);
111
+ $compulsory_cats = implode(',', $_POST['compulsory']);
112
+ } else {
113
+ $compulsory_cats = '';
114
+ }
115
+ $this->subscribe2_options['compulsory'] = $compulsory_cats;
116
+
117
  // excluded categories
118
  if ( !empty($_POST['category']) ) {
119
  sort($_POST['category']);
176
  $this->subscribe2_options['show_autosub'] = $_POST['show_autosub'];
177
  $this->subscribe2_options['autosub_def'] = $_POST['autosub_def'];
178
  $this->subscribe2_options['comment_subs'] = $_POST['comment_subs'];
179
+ $this->subscribe2_options['comment_def'] = $_POST['comment_def'];
180
  $this->subscribe2_options['one_click_profile'] = $_POST['one_click_profile'];
181
 
182
  //barred domains
186
  update_option('subscribe2_options', $this->subscribe2_options);
187
  }
188
  }
189
+
190
+ // send error message if no WordPress page exists
191
+ $sql = "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status='publish' LIMIT 1";
192
+ $id = $wpdb->get_var($sql);
193
+ if ( empty($id) ) {
194
+ echo "<div id=\"page_message\" class=\"error\"><p class=\"s2_error\"><strong>$this->no_page</strong></p></div>";
195
+ }
196
+
197
+ // send error message if sender email address is off-domain
198
+ if ( $this->subscribe2_options['sender'] == 'blogname' ) {
199
+ $sender = get_bloginfo('admin_email');
200
+ } else {
201
+ $userdata = $this->get_userdata($this->subscribe2_options['sender']);
202
+ $sender = $userdata->user_email;
203
+ }
204
+ list($user, $domain) = explode('@', $sender, 2);
205
+ if ( !strstr($_SERVER['SERVER_NAME'], $domain) && $this->subscribe2_options['sender'] != 'author' ) {
206
+ echo "<div id=\"sender_message\" class=\"error\"><p class=\"s2_error\"><strong>" . __('You appear to be sending notifications from an email address from a different domain name to your blog, this may result in failed emails', 'subscribe2') . "</strong></p></div>";
207
+ }
208
+
209
  // show our form
210
  echo "<div class=\"wrap\">";
211
  echo "<div id=\"icon-options-general\" class=\"icon32\"></div>";
212
  echo "<h2>" . __('Subscribe2 Settings', 'subscribe2') . "</h2>\r\n";
213
  echo "<a href=\"http://subscribe2.wordpress.com/\">" . __('Plugin Blog', 'subscribe2') . "</a> | ";
214
  echo "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904\">" . __('Make a donation via PayPal', 'subscribe2') . "</a>";
215
+ echo "<form method=\"post\">\r\n";
216
  if ( function_exists('wp_nonce_field') ) {
217
  wp_nonce_field('subscribe2-options_subscribers' . $s2nonce);
218
  }
272
  echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
273
  echo "<label><input type=\"radio\" name=\"private\" value=\"no\"" . checked($this->subscribe2_options['private'], 'no', false) . " /> ";
274
  echo __('No', 'subscribe2') . "</label><br /><br />\r\n";
275
+ echo __('Include Sticky Posts at the top of all Digest Notifications', 'subscribe2') . ': ';
276
+ echo "<label><input type=\"radio\" name=\"stickies\" value=\"yes\"" . checked($this->subscribe2_options['stickies'], 'yes', false) . " /> ";
277
+ echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
278
+ echo "<label><input type=\"radio\" name=\"stickies\" value=\"no\"" . checked($this->subscribe2_options['stickies'], 'no', false) . " /> ";
279
+ echo __('No', 'subscribe2') . "</label><br /><br />\r\n";
280
  echo __('Send Email From', 'subscribe2') . ': ';
281
  echo "<label>\r\n";
282
  $this->admin_dropdown(true);
292
  }
293
  echo __('Add Tracking Parameters to the Permalink', 'subscribe2') . ": ";
294
  echo "<input type=\"text\" name=\"tracking\" value=\"" . stripslashes($this->subscribe2_options['tracking']) . "\" size=\"50\" /> ";
295
+ echo "<br />" . __('eg. utm_source=subscribe2&amp;utm_medium=email&amp;utm_campaign=postnotify&amp;utm_id={ID}', 'subscribe2') . "<br /><br />\r\n";
296
  echo "</div>\r\n";
297
 
298
  // email templates
299
  echo "<div class=\"s2_admin\" id=\"s2_templates\">\r\n";
300
  echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
301
  echo "<br />";
302
+ echo "<table style=\"width: 100%; border-collapse: separate; border-spacing: 5px; *border-collapse: expression('separate', cellSpacing = '5px');\" class=\"editform\">\r\n";
303
+ echo "<tr><td style=\"vertical-align: top; height: 350px; min-height: 350px;\">";
304
  echo __('New Post email (must not be empty)', 'subscribe2') . ":<br />\r\n";
305
  echo __('Subject Line', 'subscribe2') . ": ";
306
  echo "<input type=\"text\" name=\"notification_subject\" value=\"" . stripslashes($this->subscribe2_options['notification_subject']) . "\" size=\"30\" />";
307
  echo "<br />\r\n";
308
+ echo "<textarea rows=\"9\" cols=\"60\" name=\"mailtext\">" . stripslashes($this->subscribe2_options['mailtext']) . "</textarea>\r\n";
309
+ echo "</td><td style=\"vertical-align: top;\" rowspan=\"3\">";
310
  echo "<p class=\"submit\"><input type=\"submit\" class=\"button-secondary\" name=\"preview\" value=\"" . __('Send Email Preview', 'subscribe2') . "\" /></p>\r\n";
311
  echo "<h3>" . __('Message substitutions', 'subscribe2') . "</h3>\r\n";
312
  echo "<dl>";
330
  echo "<dt><b>{CATS}</b></dt><dd>" . __("the post's assigned categories", 'subscribe2') . "</dd>\r\n";
331
  echo "<dt><b>{TAGS}</b></dt><dd>" . __("the post's assigned Tags", 'subscribe2') . "</dd>\r\n";
332
  echo "<dt><b>{COUNT}</b></dt><dd>" . __("the number of posts included in the digest email<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
333
+ echo "</dl></td></tr><tr><td style=\"vertical-align: top; height: 350px; min-height: 350px;\">";
334
  echo __('Subscribe / Unsubscribe confirmation email', 'subscribe2') . ":<br />\r\n";
335
  echo __('Subject Line', 'subscribe2') . ": ";
336
  echo "<input type=\"text\" name=\"confirm_subject\" value=\"" . stripslashes($this->subscribe2_options['confirm_subject']) . "\" size=\"30\" /><br />\r\n";
337
+ echo "<textarea rows=\"9\" cols=\"60\" name=\"confirm_email\">" . stripslashes($this->subscribe2_options['confirm_email']) . "</textarea>\r\n";
338
+ echo "</td></tr><tr><td style=\"vertical-align: top; height: 350px; min-height: 350px;\">";
339
  echo __('Reminder email to Unconfirmed Subscribers', 'subscribe2') . ":<br />\r\n";
340
  echo __('Subject Line', 'subscribe2') . ": ";
341
  echo "<input type=\"text\" name=\"remind_subject\" value=\"" . stripslashes($this->subscribe2_options['remind_subject']) . "\" size=\"30\" /><br />\r\n";
343
  echo "</td></tr></table><br />\r\n";
344
  echo "</div>\r\n";
345
 
346
+ // compulsory categories
347
+ echo "<div class=\"s2_admin\" id=\"s2_compulsory_categories\">\r\n";
348
+ echo "<h2>" . __('Complusory Categories', 'subscribe2') . "</h2>\r\n";
349
+ echo "<p>";
350
+ echo "<strong><em style=\"color: red\">" . __('Compulsory categories will be checked by default for Registered Subscribers', 'subscribe2') . "</em></strong><br />\r\n";
351
+ echo "</p>";
352
+ $this->display_category_form(array(), 1, explode(',', $this->subscribe2_options['compulsory']), 'compulsory');
353
+ echo "</div>\r\n";
354
+
355
  // excluded categories
356
  echo "<div class=\"s2_admin\" id=\"s2_excluded_categories\">\r\n";
357
  echo "<h2>" . __('Excluded Categories', 'subscribe2') . "</h2>\r\n";
359
  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";
360
  echo "</p>";
361
  $this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
362
+ echo "<p style=\"text-align: center;\"><label><input type=\"checkbox\" name=\"reg_override\" value=\"1\"" . checked($this->subscribe2_options['reg_override'], '1', false) . " /> ";
363
+ echo __('Allow registered users to subscribe to excluded categories?', 'subscribe2') . "</label></p><br />\r\n";
364
+ echo "</div>\r\n";
365
 
366
  // excluded post formats
367
  $formats = get_theme_support('post-formats');
368
  if ( $formats !== false ) {
369
  // excluded formats
370
+ echo "<div class=\"s2_admin\" id=\"s2_excluded_formats\">\r\n";
371
  echo "<h2>" . __('Excluded Formats', 'subscribe2') . "</h2>\r\n";
372
  echo "<p>";
373
  echo "<strong><em style=\"color: red\">" . __('Posts assigned to any Excluded Format do not generate notifications and are not included in digest notifications', 'subscribe2') . "</em></strong><br />\r\n";
374
  echo "</p>";
375
  $this->display_format_form($formats, explode(',', $this->subscribe2_options['exclude_formats']));
376
+ echo "</div>\r\n";
377
  }
 
378
 
379
  // Appearance options
380
  echo "<div class=\"s2_admin\" id=\"s2_appearance_settings\">\r\n";
405
  echo __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "</label><br /><br />\r\n";
406
 
407
  // enable AJAX style form
408
+ echo "<label><input type=\"checkbox\" name=\"ajax\" value=\"1\"" . checked($this->subscribe2_options['ajax'], '1', false) . " /> ";
409
  echo __('Enable AJAX style subscription form?', 'subscribe2') . "</label><br /><br />\r\n";
410
 
411
  // show Widget
471
  echo __('After the Comment Submit button', 'subscribe2') . "</label>&nbsp;&nbsp;";
472
  echo "<label><input type=\"radio\" name=\"comment_subs\" value=\"no\"" . checked($this->subscribe2_options['comment_subs'], 'no', false) . " /> ";
473
  echo __('No', 'subscribe2') . "</label><br /><br />";
474
+ echo __('Comment form checkbox is checked by default', 'subscrib2') . ": <br />\r\n";
475
+ echo "<label><input type=\"radio\" name=\"comment_def\" value=\"yes\"" . checked($this->subscribe2_options['comment_def'], 'yes', false) . " /> ";
476
+ echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
477
+ echo "<label><input type=\"radio\" name=\"comment_def\" value=\"no\"" . checked($this->subscribe2_options['comment_def'], 'no', false) . " /> ";
478
+ echo __('No', 'subscribe2') . "</label><br /><br />\r\n";
479
  echo __('Show one-click subscription on profile page', 'subscribe2') . ":<br />\r\n";
480
  echo "<label><input type=\"radio\" name=\"one_click_profile\" value=\"yes\"" . checked($this->subscribe2_options['one_click_profile'], 'yes', false) . " /> ";
481
  echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
493
  echo "</div>\r\n";
494
 
495
  // submit
496
+ echo "<p class=\"submit\" style=\"text-align: center\"><input type=\"submit\" class=\"button-primary\" name=\"submit\" value=\"" . __('Submit', 'subscribe2') . "\" /></p>";
497
 
498
  // reset
499
  echo "<h2>" . __('Reset Default', 'subscribe2') . "</h2>\r\n";
500
  echo "<p>" . __('Use this to reset all options to their defaults. This <strong><em>will not</em></strong> modify your list of subscribers.', 'subscribe2') . "</p>\r\n";
501
+ echo "<p class=\"submit\" style=\"text-align: center\">";
502
  echo "<input type=\"submit\" id=\"deletepost\" name=\"reset\" value=\"" . __('RESET', 'subscribe2') .
503
  "\" />";
504
  echo "</p></form></div>\r\n";
admin/subscribers.php CHANGED
@@ -80,10 +80,10 @@ if ( isset($_POST['s2_admin']) ) {
80
  $this->unsubscribe_registered_users($_POST['exportcsv'], $_POST['category']);
81
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Unsubscribed!', 'subscribe2') . "</strong></p></div>";
82
  } elseif ( isset($_POST['sub_format']) ) {
83
- $this->format_change( $_POST['format'], $_POST['exportcsv'] );
84
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Format updated for Selected Registered Users!', 'subscribe2') . "</strong></p></div>";
85
  } elseif ( isset($_POST['sub_digest']) ) {
86
- $this->digest_change( $_POST['sub_category'], $_POST['exportcsv'] );
87
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Digest Subscription updated for Selected Registered Users!', 'subscribe2') . "</strong></p></div>";
88
  }
89
  }
@@ -207,7 +207,7 @@ if ( !empty($subscribers) ) {
207
  echo "<div class=\"wrap\">";
208
  echo "<div id=\"icon-tools\" class=\"icon32\"></div>";
209
  echo "<h2>" . __('Manage Subscribers', 'subscribe2') . "</h2>\r\n";
210
- echo "<form method=\"post\" action=\"\">\r\n";
211
  if ( function_exists('wp_nonce_field') ) {
212
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
213
  }
@@ -228,28 +228,28 @@ $this->display_subscriber_dropdown($what, __('Filter', 'subscribe2'));
228
  echo "<br /><br />";
229
  // show the selected subscribers
230
  $alternate = 'alternate';
231
- echo "<table class=\"widefat\" cellpadding=\"2\" cellspacing=\"2\" width=\"100%\">";
232
  $searchterm = ( isset($_POST['searchterm']) ) ? stripslashes(esc_html($_POST['searchterm'])) : '';
233
  echo "<tr class=\"alternate\"><td colspan=\"3\"><input type=\"text\" name=\"searchterm\" value=\"" . $searchterm . "\" /></td>\r\n";
234
  echo "<td><input type=\"submit\" class=\"button-secondary\" name=\"search\" value=\"" . __('Search Subscribers', 'subscribe2') . "\" /></td>\r\n";
235
  if ( $reminderform ) {
236
- echo "<td width=\"25%\" align=\"right\"><input type=\"hidden\" name=\"reminderemails\" value=\"" . $reminderemails . "\" />\r\n";
237
  echo "<input type=\"submit\" class=\"button-secondary\" name=\"remind\" value=\"" . __('Send Reminder Email', 'subscribe2') . "\" /></td>\r\n";
238
  } else {
239
- echo "<td width=\"25%\"></td>";
240
  }
241
  if ( !empty($subscribers) ) {
242
  $exportcsv = implode(",\r\n", $subscribers);
243
- echo "<td width=\"25%\" align=\"right\"><input type=\"hidden\" name=\"exportcsv\" value=\"" . $exportcsv . "\" />\r\n";
244
  echo "<input type=\"submit\" class=\"button-secondary\" name=\"csv\" value=\"" . __('Save Emails to CSV File', 'subscribe2') . "\" /></td>\r\n";
245
  } else {
246
- echo "<td width=\"25%\"></td>";
247
  }
248
  echo "</tr>";
249
 
250
  if ( !empty($subscribers) ) {
251
- echo "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
252
- echo "<td colspan=\"3\" align=\"right\">" . $strip . "</td></tr>\r\n";
253
  }
254
  if ( !empty($subscribers) ) {
255
  if ( is_int($this->subscribe2_options['entries']) ) {
@@ -260,39 +260,39 @@ if ( !empty($subscribers) ) {
260
  $chunk = $page - 1;
261
  $subscribers = $subscriber_chunks[$chunk];
262
  echo "<tr class=\"alternate\" style=\"height:1.5em;\">\r\n";
263
- echo "<td width=\"4%\" align=\"center\">";
264
  echo "<img src=\"" . $urlpath . "include/accept.png\" alt=\"&lt;\" title=\"" . __('Confirm this email address', 'subscribe2') . "\" /></td>\r\n";
265
- echo "<td width=\"4%\" align=\"center\">";
266
  echo "<img src=\"" . $urlpath . "include/exclamation.png\" alt=\"&gt;\" title=\"" . __('Unconfirm this email address', 'subscribe2') . "\" /></td>\r\n";
267
- echo "<td width=\"4%\" align=\"center\">";
268
  echo "<img src=\"" . $urlpath . "include/cross.png\" alt=\"X\" title=\"" . __('Delete this email address', 'subscribe2') . "\" /></td><td colspan=\"3\"></td></tr>\r\n";
269
- echo "<tr class=\"\"><td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"confirm_checkall\" /></td>\r\n";
270
- echo "<td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"unconfirm_checkall\" /></td>\r\n";
271
- echo "<td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"delete_checkall\" /></td>\r\n";
272
- echo "<td colspan =\"3\" align=\"left\"><strong>" . __('Select / Unselect All', 'subscribe2') . "</strong></td></tr>\r\n";
273
 
274
  foreach ( $subscribers as $subscriber ) {
275
  echo "<tr class=\"$alternate\" style=\"height:1.5em;\">";
276
- echo "<td align=\"center\">\r\n";
277
  if ( in_array($subscriber, $confirmed) ) {
278
- echo "</td><td align=\"center\">\r\n";
279
  echo "<input class=\"unconfirm_checkall\" title=\"" . __('Unconfirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"unconfirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
280
- echo "<td align=\"center\">\r\n";
281
  echo "<input class=\"delete_checkall\" title=\"" . __('Delete this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"delete[]\" value=\"" . $subscriber . "\" />\r\n";
282
  echo "</td>\r\n";
283
  echo "<td colspan=\"3\"><span style=\"color:#006600\">&#x221A;&nbsp;&nbsp;</span><abbr title=\"" . $this->signup_ip($subscriber) . "\"><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a></abbr>\r\n";
284
  echo "(<span style=\"color:#006600\">" . $this->signup_date($subscriber) . "</span>)\r\n";
285
  } elseif ( in_array($subscriber, $unconfirmed) ) {
286
  echo "<input class=\"confirm_checkall\" title=\"" . __('Confirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"confirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
287
- echo "<td align=\"center\"></td>\r\n";
288
- echo "<td align=\"center\">\r\n";
289
  echo "<input class=\"delete_checkall\" title=\"" . __('Delete this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"delete[]\" value=\"" . $subscriber . "\" />\r\n";
290
  echo "</td>\r\n";
291
  echo "<td colspan=\"3\"><span style=\"color:#FF0000\">&nbsp;!&nbsp;&nbsp;&nbsp;</span><abbr title=\"" . $this->signup_ip($subscriber) . "\"><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a></abbr>\r\n";
292
  echo "(<span style=\"color:#FF0000\">" . $this->signup_date($subscriber) . "</span>)\r\n";
293
  } elseif ( in_array($subscriber, $all_users) ) {
294
  $user_info = get_user_by('email', $subscriber);
295
- echo "</td><td align=\"center\"></td><td align=\"center\"></td>\r\n";
296
  echo "<td colspan=\"3\"><span style=\"color:#006600\">&reg;&nbsp;&nbsp;</span><abbr title=\"" . $user_info->user_login . "\"><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a></abbr>\r\n";
297
  echo "(<a href=\"" . get_option('siteurl') . "/wp-admin/admin.php?page=s2&amp;email=" . urlencode($subscriber) . "\">" . __('edit', 'subscribe2') . "</a>)\r\n";
298
  }
@@ -301,14 +301,14 @@ if ( !empty($subscribers) ) {
301
  }
302
  } else {
303
  if ( $_POST['searchterm'] ) {
304
- echo "<tr><td colspan=\"6\" align=\"center\"><b>" . __('No matching subscribers found', 'subscribe2') . "</b></td></tr>\r\n";
305
  } else {
306
- echo "<tr><td colspan=\"6\" align=\"center\"><b>" . __('NONE', 'subscribe2') . "</b></td></tr>\r\n";
307
  }
308
  }
309
  if ( !empty($subscribers) ) {
310
- echo "<tr class=\"$alternate\"><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
311
- echo "<td colspan=\"3\" align=\"right\">" . $strip . "</td></tr>\r\n";
312
  }
313
  echo "</table>\r\n";
314
  echo "</div>\r\n";
80
  $this->unsubscribe_registered_users($_POST['exportcsv'], $_POST['category']);
81
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Unsubscribed!', 'subscribe2') . "</strong></p></div>";
82
  } elseif ( isset($_POST['sub_format']) ) {
83
+ $this->format_change( $_POST['exportcsv'], $_POST['format'] );
84
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Format updated for Selected Registered Users!', 'subscribe2') . "</strong></p></div>";
85
  } elseif ( isset($_POST['sub_digest']) ) {
86
+ $this->digest_change( $_POST['exportcsv'], $_POST['sub_category'] );
87
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Digest Subscription updated for Selected Registered Users!', 'subscribe2') . "</strong></p></div>";
88
  }
89
  }
207
  echo "<div class=\"wrap\">";
208
  echo "<div id=\"icon-tools\" class=\"icon32\"></div>";
209
  echo "<h2>" . __('Manage Subscribers', 'subscribe2') . "</h2>\r\n";
210
+ echo "<form method=\"post\">\r\n";
211
  if ( function_exists('wp_nonce_field') ) {
212
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
213
  }
228
  echo "<br /><br />";
229
  // show the selected subscribers
230
  $alternate = 'alternate';
231
+ echo "<table style=\"width: 100%; border-collapse: separate; border-spacing: 0px; *border-collapse: expression('separate', cellSpacing = '0px');\" class=\"widefat\" >";
232
  $searchterm = ( isset($_POST['searchterm']) ) ? stripslashes(esc_html($_POST['searchterm'])) : '';
233
  echo "<tr class=\"alternate\"><td colspan=\"3\"><input type=\"text\" name=\"searchterm\" value=\"" . $searchterm . "\" /></td>\r\n";
234
  echo "<td><input type=\"submit\" class=\"button-secondary\" name=\"search\" value=\"" . __('Search Subscribers', 'subscribe2') . "\" /></td>\r\n";
235
  if ( $reminderform ) {
236
+ echo "<td style=\"width: 25%; text-align: right;\"><input type=\"hidden\" name=\"reminderemails\" value=\"" . $reminderemails . "\" />\r\n";
237
  echo "<input type=\"submit\" class=\"button-secondary\" name=\"remind\" value=\"" . __('Send Reminder Email', 'subscribe2') . "\" /></td>\r\n";
238
  } else {
239
+ echo "<td style=\"width: 25%;\"></td>";
240
  }
241
  if ( !empty($subscribers) ) {
242
  $exportcsv = implode(",\r\n", $subscribers);
243
+ echo "<td style=\"width: 25%; text-align: right;\"><input type=\"hidden\" name=\"exportcsv\" value=\"" . $exportcsv . "\" />\r\n";
244
  echo "<input type=\"submit\" class=\"button-secondary\" name=\"csv\" value=\"" . __('Save Emails to CSV File', 'subscribe2') . "\" /></td>\r\n";
245
  } else {
246
+ echo "<td style=\"width: 25%;\"></td>";
247
  }
248
  echo "</tr>";
249
 
250
  if ( !empty($subscribers) ) {
251
+ echo "<tr><td colspan=\"3\" style=\"text-align: center;\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
252
+ echo "<td style=\"text-align: right;\" colspan=\"3\">" . $strip . "</td></tr>\r\n";
253
  }
254
  if ( !empty($subscribers) ) {
255
  if ( is_int($this->subscribe2_options['entries']) ) {
260
  $chunk = $page - 1;
261
  $subscribers = $subscriber_chunks[$chunk];
262
  echo "<tr class=\"alternate\" style=\"height:1.5em;\">\r\n";
263
+ echo "<td style=\"width: 4%; text-align: center;\">";
264
  echo "<img src=\"" . $urlpath . "include/accept.png\" alt=\"&lt;\" title=\"" . __('Confirm this email address', 'subscribe2') . "\" /></td>\r\n";
265
+ echo "<td style=\"width: 4%; text-align: center;\">";
266
  echo "<img src=\"" . $urlpath . "include/exclamation.png\" alt=\"&gt;\" title=\"" . __('Unconfirm this email address', 'subscribe2') . "\" /></td>\r\n";
267
+ echo "<td style=\"width: 4%; text-align: center;\">";
268
  echo "<img src=\"" . $urlpath . "include/cross.png\" alt=\"X\" title=\"" . __('Delete this email address', 'subscribe2') . "\" /></td><td colspan=\"3\"></td></tr>\r\n";
269
+ echo "<tr class=\"\"><td style=\"text-align: center;\"><input type=\"checkbox\" name=\"checkall\" value=\"confirm_checkall\" /></td>\r\n";
270
+ echo "<td style=\"text-align: center;\"><input type=\"checkbox\" name=\"checkall\" value=\"unconfirm_checkall\" /></td>\r\n";
271
+ echo "<td style=\"text-align: center;\"><input type=\"checkbox\" name=\"checkall\" value=\"delete_checkall\" /></td>\r\n";
272
+ echo "<td colspan =\"3\" style=\"text-align: left;\"><strong>" . __('Select / Unselect All', 'subscribe2') . "</strong></td></tr>\r\n";
273
 
274
  foreach ( $subscribers as $subscriber ) {
275
  echo "<tr class=\"$alternate\" style=\"height:1.5em;\">";
276
+ echo "<td style=\"text-align: center;\">\r\n";
277
  if ( in_array($subscriber, $confirmed) ) {
278
+ echo "</td><td style=\"text-align: center;\">\r\n";
279
  echo "<input class=\"unconfirm_checkall\" title=\"" . __('Unconfirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"unconfirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
280
+ echo "<td style=\"text-align: center;\">\r\n";
281
  echo "<input class=\"delete_checkall\" title=\"" . __('Delete this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"delete[]\" value=\"" . $subscriber . "\" />\r\n";
282
  echo "</td>\r\n";
283
  echo "<td colspan=\"3\"><span style=\"color:#006600\">&#x221A;&nbsp;&nbsp;</span><abbr title=\"" . $this->signup_ip($subscriber) . "\"><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a></abbr>\r\n";
284
  echo "(<span style=\"color:#006600\">" . $this->signup_date($subscriber) . "</span>)\r\n";
285
  } elseif ( in_array($subscriber, $unconfirmed) ) {
286
  echo "<input class=\"confirm_checkall\" title=\"" . __('Confirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"confirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
287
+ echo "<td style=\"text-align: center;\"></td>\r\n";
288
+ echo "<td style=\"text-align: center;\">\r\n";
289
  echo "<input class=\"delete_checkall\" title=\"" . __('Delete this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"delete[]\" value=\"" . $subscriber . "\" />\r\n";
290
  echo "</td>\r\n";
291
  echo "<td colspan=\"3\"><span style=\"color:#FF0000\">&nbsp;!&nbsp;&nbsp;&nbsp;</span><abbr title=\"" . $this->signup_ip($subscriber) . "\"><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a></abbr>\r\n";
292
  echo "(<span style=\"color:#FF0000\">" . $this->signup_date($subscriber) . "</span>)\r\n";
293
  } elseif ( in_array($subscriber, $all_users) ) {
294
  $user_info = get_user_by('email', $subscriber);
295
+ echo "</td><td style=\"text-align: center;\"></td><td style=\"text-align: center;\"></td>\r\n";
296
  echo "<td colspan=\"3\"><span style=\"color:#006600\">&reg;&nbsp;&nbsp;</span><abbr title=\"" . $user_info->user_login . "\"><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a></abbr>\r\n";
297
  echo "(<a href=\"" . get_option('siteurl') . "/wp-admin/admin.php?page=s2&amp;email=" . urlencode($subscriber) . "\">" . __('edit', 'subscribe2') . "</a>)\r\n";
298
  }
301
  }
302
  } else {
303
  if ( $_POST['searchterm'] ) {
304
+ echo "<tr><td colspan=\"6\" style=\"text-align: center;\"><b>" . __('No matching subscribers found', 'subscribe2') . "</b></td></tr>\r\n";
305
  } else {
306
+ echo "<tr><td colspan=\"6\" style=\"text-align: center;\"><b>" . __('NONE', 'subscribe2') . "</b></td></tr>\r\n";
307
  }
308
  }
309
  if ( !empty($subscribers) ) {
310
+ echo "<tr class=\"$alternate\"><td colspan=\"3\" style=\"text-align: center;\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
311
+ echo "<td colspan=\"3\" style=\"text-align: right;\">" . $strip . "</td></tr>\r\n";
312
  }
313
  echo "</table>\r\n";
314
  echo "</div>\r\n";
admin/your_subscriptions.php CHANGED
@@ -98,7 +98,7 @@ if ( isset($_GET['email']) ) {
98
  $user = get_userdata($user_ID);
99
  echo "<span style=\"color: red;line-height: 300%;\">" . __('Editing Subscribe2 preferences for user', 'subscribe2') . ": " . $user->display_name . "</span>";
100
  }
101
- echo "<form method=\"post\" action=\"\">";
102
  echo "<p>";
103
  if ( function_exists('wp_nonce_field') ) {
104
  wp_nonce_field('subscribe2-user_subscribers' . $s2nonce);
@@ -148,7 +148,7 @@ if ( $this->subscribe2_options['email_freq'] == 'never' ) {
148
  } else {
149
  echo "<h2>" . __('Subscribed Categories', 'subscribe2') . "</h2>\r\n";
150
  }
151
- $this->display_category_form(explode(',', get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true)), $this->subscribe2_options['reg_override']);
152
  } else {
153
  // we're doing daily digests, so just show
154
  // subscribe / unnsubscribe
98
  $user = get_userdata($user_ID);
99
  echo "<span style=\"color: red;line-height: 300%;\">" . __('Editing Subscribe2 preferences for user', 'subscribe2') . ": " . $user->display_name . "</span>";
100
  }
101
+ echo "<form method=\"post\">";
102
  echo "<p>";
103
  if ( function_exists('wp_nonce_field') ) {
104
  wp_nonce_field('subscribe2-user_subscribers' . $s2nonce);
148
  } else {
149
  echo "<h2>" . __('Subscribed Categories', 'subscribe2') . "</h2>\r\n";
150
  }
151
+ $this->display_category_form(explode(',', get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true)), $this->subscribe2_options['reg_override'], explode(',', $this->subscribe2_options['compulsory']));
152
  } else {
153
  // we're doing daily digests, so just show
154
  // subscribe / unnsubscribe
classes/class-s2-admin.php CHANGED
@@ -35,7 +35,7 @@ class s2_admin extends s2class {
35
  Insert Javascript and CSS into admin_header
36
  */
37
  function checkbox_form_js() {
38
- wp_register_script('s2_checkbox', S2URL . 'include/s2_checkbox' . $this->script_debug . '.js', array('jquery'), '1.1');
39
  wp_enqueue_script('s2_checkbox');
40
  } //end checkbox_form_js()
41
 
@@ -153,7 +153,7 @@ class s2_admin extends s2class {
153
  */
154
  function s2_meta_box() {
155
  global $post_ID;
156
- $s2mail = get_post_meta($post_ID, 's2mail', true);
157
  echo "<input type=\"hidden\" name=\"s2meta_nonce\" id=\"s2meta_nonce\" value=\"" . wp_create_nonce(wp_hash(plugin_basename(__FILE__))) . "\" />";
158
  echo __("Check here to disable sending of an email notification for this post/page", 'subscribe2');
159
  echo "&nbsp;&nbsp;<input type=\"checkbox\" name=\"s2_meta_field\" value=\"no\"";
@@ -176,9 +176,9 @@ class s2_admin extends s2class {
176
  }
177
 
178
  if ( isset($_POST['s2_meta_field']) && $_POST['s2_meta_field'] == 'no' ) {
179
- update_post_meta($post_id, 's2mail', $_POST['s2_meta_field']);
180
  } else {
181
- update_post_meta($post_id, 's2mail', 'yes');
182
  }
183
  } // end s2_meta_box_handler()
184
 
@@ -187,7 +187,7 @@ class s2_admin extends s2class {
187
  Display a table of categories with checkboxes
188
  Optionally pre-select those categories specified
189
  */
190
- function display_category_form($selected = array(), $override = 1) {
191
  global $wpdb;
192
 
193
  if ( $override == 0 ) {
@@ -199,14 +199,14 @@ class s2_admin extends s2class {
199
  $half = (count($all_cats) / 2);
200
  $i = 0;
201
  $j = 0;
202
- echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"5\" class=\"editform\">\r\n";
203
- echo "<tr><td align=\"left\" colspan=\"2\">\r\n";
204
- echo "<label><input type=\"checkbox\" name=\"checkall\" value=\"checkall_cat\" /> " . __('Select / Unselect All', 'subscribe2') . "</label>\r\n";
205
  echo "</td></tr>\r\n";
206
- echo "<tr valign=\"top\"><td width=\"50%\" align=\"left\">\r\n";
207
  foreach ( $all_cats as $cat ) {
208
- if ( $i >= $half && 0 == $j ){
209
- echo "</td><td width=\"50%\" align=\"left\">\r\n";
210
  $j++;
211
  }
212
  $catName = '';
@@ -220,15 +220,21 @@ class s2_admin extends s2class {
220
  $catName .= $cat->name;
221
 
222
  if ( 0 == $j ) {
223
- echo "<label><input class=\"checkall_cat\" type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
224
- if ( in_array($cat->term_id, $selected) ) {
225
- echo " checked=\"checked\"";
 
 
 
226
  }
227
  echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n";
228
  } else {
229
- echo "<label><input class=\"checkall_cat\" type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
230
- if ( in_array($cat->term_id, $selected) ) {
231
- echo " checked=\"checked\"";
 
 
 
232
  }
233
  echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n";
234
  }
@@ -245,14 +251,14 @@ class s2_admin extends s2class {
245
  $half = (count($formats[0]) / 2);
246
  $i = 0;
247
  $j = 0;
248
- echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"5\" class=\"editform\">\r\n";
249
- echo "<tr><td align=\"left\" colspan=\"2\">\r\n";
250
  echo "<label><input type=\"checkbox\" name=\"checkall\" value=\"checkall_format\" /> " . __('Select / Unselect All', 'subscribe2') . "</label>\r\n";
251
  echo "</td></tr>\r\n";
252
- echo "<tr valign=\"top\"><td width=\"50%\" align=\"left\">\r\n";
253
  foreach ( $formats[0] as $format ) {
254
- if ( $i >= $half && 0 == $j ){
255
- echo "</td><td width=\"50%\" align=\"left\">\r\n";
256
  $j++;
257
  }
258
 
@@ -285,14 +291,14 @@ class s2_admin extends s2class {
285
  $half = (count($all_authors) / 2);
286
  $i = 0;
287
  $j = 0;
288
- echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"5\" class=\"editform\">\r\n";
289
- echo "<tr><td align=\"left\" colspan=\"2\">\r\n";
290
  echo "<label><input type=\"checkbox\" name=\"checkall\" value=\"checkall_author\" /> " . __('Select / Unselect All', 'subscribe2') . "</label>\r\n";
291
  echo "</td></tr>\r\n";
292
- echo "<tr valign=\"top\"><td width=\"50%\" align=\"left\">\r\n";
293
  foreach ( $all_authors as $author ) {
294
  if ( $i >= $half && 0 == $j ) {
295
- echo "</td><td width=\"50%\" align=\"left\">\r\n";
296
  $j++;
297
  }
298
  if ( 0 == $j ) {
@@ -457,6 +463,7 @@ class s2_admin extends s2class {
457
  echo "<strong><em style=\"color: red\">" . __('The WordPress cron functions may be disabled on this server. Digest notifications may not work.', 'subscribe2') . "</em></strong><br />\r\n";
458
  }
459
  $scheduled_time = wp_next_scheduled('s2_digest_cron');
 
460
  $schedule = (array)wp_get_schedules();
461
  $schedule = array_merge(array('never' => array('interval' => 0, 'display' => __('For each Post', 'subscribe2'))), $schedule);
462
  $sort = array();
@@ -472,19 +479,18 @@ class s2_admin extends s2class {
472
  echo "<label><input type=\"radio\" name=\"email_freq\" value=\"" . $key . "\"" . checked($this->subscribe2_options['email_freq'], $key, false) . " />";
473
  echo " " . $value['display'] . "</label><br />\r\n";
474
  }
475
- echo "<br />" . __('Send Digest Notification at', 'subscribe2') . ": \r\n";
476
  $hours = array('12am', '1am', '2am', '3am', '4am', '5am', '6am', '7am', '8am', '9am', '10am', '11am', '12pm', '1pm', '2pm', '3pm', '4pm', '5pm', '6pm', '7pm', '8pm', '9pm', '10pm', '11pm');
477
  echo "<select name=\"hour\">\r\n";
478
- while ( $hour = current($hours) ) {
479
- echo "<option value=\"" . key($hours) . "\"";
480
- if ( key($hours) == date('H', $scheduled_time) && !empty($scheduled_time) ){
481
  echo " selected=\"selected\"";
482
  }
483
- echo ">" . $hour . "</option>\r\n";
484
- next($hours);
485
  }
486
  echo "</select>\r\n";
487
- echo "<strong><em style=\"color: red\">" . __('This option will be ignored if the time selected is not in the future in relation to the current time', 'subscribe2') . "</em></strong>\r\n";
488
  if ( $scheduled_time ) {
489
  $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
490
  echo "<p>" . __('Current UTC time is', 'subscribe2') . ": \r\n";
@@ -492,7 +498,7 @@ class s2_admin extends s2class {
492
  echo "<p>" . __('Current blog time is', 'subscribe2') . ": \r\n";
493
  echo "<strong>" . date_i18n($datetime) . "</strong></p>\r\n";
494
  echo "<p>" . __('Next email notification will be sent when your blog time is after', 'subscribe2') . ": \r\n";
495
- echo "<strong>" . date_i18n($datetime, $scheduled_time) . "</strong></p>\r\n";
496
  if ( !empty($this->subscribe2_options['previous_s2cron']) ) {
497
  echo "<p>" . __('Attempt to resend the last Digest Notification email', 'subscribe2') . ": ";
498
  echo "<input type=\"submit\" class=\"button-secondary\" name=\"resend\" value=\"" . __('Resend Digest', 'subscribe2') . "\" /></p>\r\n";
@@ -545,7 +551,7 @@ class s2_admin extends s2class {
545
  } else {
546
  $newcats = $cats;
547
  }
548
- if ( !empty($newcats) ) {
549
  // add subscription to these cat IDs
550
  foreach ( $newcats as $id ) {
551
  update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, $id);
@@ -572,7 +578,7 @@ class s2_admin extends s2class {
572
  foreach ( $user_IDs as $user_ID ) {
573
  $old_cats = explode(',', get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true));
574
  $remain = array_diff($old_cats, $cats);
575
- if ( !empty($remain) ) {
576
  // remove subscription to these cat IDs and update s2_subscribed
577
  foreach ( $cats as $id ) {
578
  delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
@@ -592,13 +598,13 @@ class s2_admin extends s2class {
592
  /**
593
  Handles bulk changes to email format for Registered Subscribers
594
  */
595
- function format_change($format, $subscribers_string) {
596
  if ( empty($format) ) { return; }
597
 
598
  global $wpdb;
599
- $subscribers = explode(",\r\n", $subscribers_string);
600
- $emails = implode(", ", array_map(array($this,'prepare_in_data'), $subscribers));
601
- $ids = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_email IN ($emails)");
602
  $ids = implode(',', array_map(array($this, 'prepare_in_data'), $ids));
603
  $sql = "UPDATE $wpdb->usermeta SET meta_value='{$format}' WHERE meta_key='" . $this->get_usermeta_keyname('s2_format') . "' AND user_id IN ($ids)";
604
  $wpdb->get_results($sql);
@@ -607,7 +613,7 @@ class s2_admin extends s2class {
607
  /**
608
  Handles bulk update to digest preferences
609
  */
610
- function digest_change($digest, $emails) {
611
  if ( empty($digest) ) { return; }
612
 
613
  global $wpdb;
35
  Insert Javascript and CSS into admin_header
36
  */
37
  function checkbox_form_js() {
38
+ wp_register_script('s2_checkbox', S2URL . 'include/s2_checkbox' . $this->script_debug . '.js', array('jquery'), '1.2');
39
  wp_enqueue_script('s2_checkbox');
40
  } //end checkbox_form_js()
41
 
153
  */
154
  function s2_meta_box() {
155
  global $post_ID;
156
+ $s2mail = get_post_meta($post_ID, '_s2mail', true);
157
  echo "<input type=\"hidden\" name=\"s2meta_nonce\" id=\"s2meta_nonce\" value=\"" . wp_create_nonce(wp_hash(plugin_basename(__FILE__))) . "\" />";
158
  echo __("Check here to disable sending of an email notification for this post/page", 'subscribe2');
159
  echo "&nbsp;&nbsp;<input type=\"checkbox\" name=\"s2_meta_field\" value=\"no\"";
176
  }
177
 
178
  if ( isset($_POST['s2_meta_field']) && $_POST['s2_meta_field'] == 'no' ) {
179
+ update_post_meta($post_id, '_s2mail', $_POST['s2_meta_field']);
180
  } else {
181
+ update_post_meta($post_id, '_s2mail', 'yes');
182
  }
183
  } // end s2_meta_box_handler()
184
 
187
  Display a table of categories with checkboxes
188
  Optionally pre-select those categories specified
189
  */
190
+ function display_category_form($selected = array(), $override = 1, $compulsory = array(), $name = 'category') {
191
  global $wpdb;
192
 
193
  if ( $override == 0 ) {
199
  $half = (count($all_cats) / 2);
200
  $i = 0;
201
  $j = 0;
202
+ echo "<table style=\"width: 100%; border-collapse: separate; border-spacing: 2px; *border-collapse: expression('separate', cellSpacing = '2px');\" class=\"editform\">\r\n";
203
+ echo "<tr><td style=\"text-align: left;\" colspan=\"2\">\r\n";
204
+ echo "<label><input type=\"checkbox\" name=\"checkall\" value=\"checkall_" . $name . "\" /> " . __('Select / Unselect All', 'subscribe2') . "</label>\r\n";
205
  echo "</td></tr>\r\n";
206
+ echo "<tr style=\"vertical-align: top;\"><td style=\"width: 50%; text-align: left;\">\r\n";
207
  foreach ( $all_cats as $cat ) {
208
+ if ( $i >= $half && 0 == $j ) {
209
+ echo "</td><td style=\"width: 50%; text-align: left;\">\r\n";
210
  $j++;
211
  }
212
  $catName = '';
220
  $catName .= $cat->name;
221
 
222
  if ( 0 == $j ) {
223
+ echo "<label><input class=\"checkall_" . $name . "\" type=\"checkbox\" name=\"" . $name . "[]\" value=\"" . $cat->term_id . "\"";
224
+ if ( in_array($cat->term_id, $selected) || in_array($cat->term_id, $compulsory) ) {
225
+ echo " checked=\"checked\"";
226
+ }
227
+ if ( in_array($cat->term_id, $compulsory) && $name === 'category' ) {
228
+ echo " DISABLED";
229
  }
230
  echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n";
231
  } else {
232
+ echo "<label><input class=\"checkall_" . $name . "\" type=\"checkbox\" name=\"" . $name . "[]\" value=\"" . $cat->term_id . "\"";
233
+ if ( in_array($cat->term_id, $selected) && !in_array($cat->term_id, $compulsory) ) {
234
+ echo " checked=\"checked\"";
235
+ }
236
+ if ( in_array($cat->term_id, $compulsory) ) {
237
+ echo " checked=\"checked\" DISABLED";
238
  }
239
  echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n";
240
  }
251
  $half = (count($formats[0]) / 2);
252
  $i = 0;
253
  $j = 0;
254
+ echo "<table style=\"width: 100%; border-collapse: separate; border-spacing: 2px; *border-collapse: expression('separate', cellSpacing = '2px');\" class=\"editform\">\r\n";
255
+ echo "<tr><td style=\"text-align: left;\" colspan=\"2\">\r\n";
256
  echo "<label><input type=\"checkbox\" name=\"checkall\" value=\"checkall_format\" /> " . __('Select / Unselect All', 'subscribe2') . "</label>\r\n";
257
  echo "</td></tr>\r\n";
258
+ echo "<tr style=\"vertical-align: top;\"><td style=\"width: 50%; text-align: left\">\r\n";
259
  foreach ( $formats[0] as $format ) {
260
+ if ( $i >= $half && 0 == $j ) {
261
+ echo "</td><td style=\"width: 50%; text-align: left\">\r\n";
262
  $j++;
263
  }
264
 
291
  $half = (count($all_authors) / 2);
292
  $i = 0;
293
  $j = 0;
294
+ echo "<table style=\"width: 100%; border-collapse: separate; border-spacing: 2px; *border-collapse: expression('separate', cellSpacing = '2px');\" class=\"editform\">\r\n";
295
+ echo "<tr><td style=\"text-align: left;\" colspan=\"2\">\r\n";
296
  echo "<label><input type=\"checkbox\" name=\"checkall\" value=\"checkall_author\" /> " . __('Select / Unselect All', 'subscribe2') . "</label>\r\n";
297
  echo "</td></tr>\r\n";
298
+ echo "<tr style=\"vertical-align: top;\"><td style=\"width: 50%; test-align: left;\">\r\n";
299
  foreach ( $all_authors as $author ) {
300
  if ( $i >= $half && 0 == $j ) {
301
+ echo "</td><td style=\"width: 50%; text-align: left;\">\r\n";
302
  $j++;
303
  }
304
  if ( 0 == $j ) {
463
  echo "<strong><em style=\"color: red\">" . __('The WordPress cron functions may be disabled on this server. Digest notifications may not work.', 'subscribe2') . "</em></strong><br />\r\n";
464
  }
465
  $scheduled_time = wp_next_scheduled('s2_digest_cron');
466
+ $offset = get_option('gmt_offset') * 60 * 60;
467
  $schedule = (array)wp_get_schedules();
468
  $schedule = array_merge(array('never' => array('interval' => 0, 'display' => __('For each Post', 'subscribe2'))), $schedule);
469
  $sort = array();
479
  echo "<label><input type=\"radio\" name=\"email_freq\" value=\"" . $key . "\"" . checked($this->subscribe2_options['email_freq'], $key, false) . " />";
480
  echo " " . $value['display'] . "</label><br />\r\n";
481
  }
482
+ echo "<br />" . __('Send Digest Notification at UTC', 'subscribe2') . ": \r\n";
483
  $hours = array('12am', '1am', '2am', '3am', '4am', '5am', '6am', '7am', '8am', '9am', '10am', '11am', '12pm', '1pm', '2pm', '3pm', '4pm', '5pm', '6pm', '7pm', '8pm', '9pm', '10pm', '11pm');
484
  echo "<select name=\"hour\">\r\n";
485
+ foreach ( $hours as $key => $value ) {
486
+ echo "<option value=\"" . $key . "\"";
487
+ if ( !empty($scheduled_time) && $key == date('H', $scheduled_time) ) {
488
  echo " selected=\"selected\"";
489
  }
490
+ echo ">" . $value . "</option>\r\n";
 
491
  }
492
  echo "</select>\r\n";
493
+ echo "<strong><em style=\"color: red\">" . __('Chosen time will be scheduled to a future date in relation to the current UTC time', 'subscribe2') . "</em></strong>\r\n";
494
  if ( $scheduled_time ) {
495
  $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
496
  echo "<p>" . __('Current UTC time is', 'subscribe2') . ": \r\n";
498
  echo "<p>" . __('Current blog time is', 'subscribe2') . ": \r\n";
499
  echo "<strong>" . date_i18n($datetime) . "</strong></p>\r\n";
500
  echo "<p>" . __('Next email notification will be sent when your blog time is after', 'subscribe2') . ": \r\n";
501
+ echo "<strong>" . date_i18n($datetime, $scheduled_time + $offset) . "</strong></p>\r\n";
502
  if ( !empty($this->subscribe2_options['previous_s2cron']) ) {
503
  echo "<p>" . __('Attempt to resend the last Digest Notification email', 'subscribe2') . ": ";
504
  echo "<input type=\"submit\" class=\"button-secondary\" name=\"resend\" value=\"" . __('Resend Digest', 'subscribe2') . "\" /></p>\r\n";
551
  } else {
552
  $newcats = $cats;
553
  }
554
+ if ( !empty($newcats) && $newcats !== $old_cats) {
555
  // add subscription to these cat IDs
556
  foreach ( $newcats as $id ) {
557
  update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, $id);
578
  foreach ( $user_IDs as $user_ID ) {
579
  $old_cats = explode(',', get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true));
580
  $remain = array_diff($old_cats, $cats);
581
+ if ( !empty($remain) && $remain !== $old_cats) {
582
  // remove subscription to these cat IDs and update s2_subscribed
583
  foreach ( $cats as $id ) {
584
  delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
598
  /**
599
  Handles bulk changes to email format for Registered Subscribers
600
  */
601
+ function format_change($emails, $format) {
602
  if ( empty($format) ) { return; }
603
 
604
  global $wpdb;
605
+ $useremails = explode(",\r\n", $emails);
606
+ $useremails = implode(", ", array_map(array($this,'prepare_in_data'), $useremails));
607
+ $ids = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_email IN ($useremails)");
608
  $ids = implode(',', array_map(array($this, 'prepare_in_data'), $ids));
609
  $sql = "UPDATE $wpdb->usermeta SET meta_value='{$format}' WHERE meta_key='" . $this->get_usermeta_keyname('s2_format') . "' AND user_id IN ($ids)";
610
  $wpdb->get_results($sql);
613
  /**
614
  Handles bulk update to digest preferences
615
  */
616
+ function digest_change($emails, $digest) {
617
  if ( empty($digest) ) { return; }
618
 
619
  global $wpdb;
classes/class-s2-core.php CHANGED
@@ -14,7 +14,7 @@ class s2class {
14
  global $blog_id, $user_ID;
15
  if ( !is_blog_user($blog_id) ) {
16
  // if we are on multisite and the user is not a member of this blog change the link
17
- $this->use_profile_admin = "<p class=\"s2_message\"><a href=\"" . get_option('siteurl') . "/wp-admin/?s2mu_subscribe=" . $blog_id . "\">" . __('Subscribe', 'subscribe2') . "</a> " . __('to email notifications when this blog posts new content', 'subscribe2') . ".</p>";
18
  }
19
  }
20
 
@@ -30,7 +30,7 @@ class s2class {
30
 
31
  $this->error = "<p class=\"s2_error\">" . __('Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2') . "</p>";
32
 
33
- $this->no_page = "<p class=\"s2_error\">" . __('You must to create a WordPress page for this plugin to work correctly.', 'subscribe2') . "</p>";
34
 
35
  $this->mail_sent = "<p class=\"s2_message\">" . __('Message sent!', 'subscribe2') . "</p>";
36
 
@@ -91,6 +91,7 @@ class s2class {
91
  $date = date('Y-m-d');
92
  maybe_add_column($this->public, 'date', "ALTER TABLE $this->public ADD date DATE DEFAULT '$date' NOT NULL AFTER active");
93
  maybe_add_column($this->public, 'ip', "ALTER TABLE $this->public ADD ip char(64) DEFAULT 'admin' NOT NULL AFTER date");
 
94
 
95
  // let's take the time to check process registered users
96
  // existing public subscribers are subscribed to all categories
@@ -216,6 +217,11 @@ class s2class {
216
  $wpdb->get_results($wpdb->prepare("UPDATE $this->public SET email=%s WHERE CAST(email as binary)=%s", $new_email, $email));
217
  }
218
  }
 
 
 
 
 
219
  return;
220
  } // end upgrade()
221
 
@@ -267,7 +273,7 @@ class s2class {
267
  /**
268
  Delivers email to recipients in HTML or plaintext
269
  */
270
- function mail($recipients = array(), $subject = '', $message = '', $type='text') {
271
  if ( empty($recipients) || '' == $message ) { return; }
272
 
273
  if ( 'html' == $type ) {
@@ -362,7 +368,7 @@ class s2class {
362
  /**
363
  Construct standard set of email headers
364
  */
365
- function headers($type='text') {
366
  if ( empty($this->myname) || empty($this->myemail) ) {
367
  if ( $this->subscribe2_options['sender'] == 'blogname' ) {
368
  $this->myname = html_entity_decode(get_option('blogname'), ENT_QUOTES);
@@ -415,18 +421,22 @@ class s2class {
415
  function get_tracking_link($link) {
416
  if ( empty($link) ) { return; }
417
  if ( !empty($this->subscribe2_options['tracking']) ) {
418
- $delimiter = '?';
419
- if ( strpos($link, $delimiter) > 0 ) { $delimiter = '&'; }
420
- return $link . $delimiter . $this->subscribe2_options['tracking'];
 
 
 
 
421
  } else {
422
- return $link;
423
  }
424
  } // end get_tracking_link()
425
 
426
  /**
427
  Sends an email notification of a new post
428
  */
429
- function publish($post = 0, $preview = '') {
430
  if ( !$post ) { return $post; }
431
 
432
  if ( $this->s2_mu ) {
@@ -436,7 +446,7 @@ class s2class {
436
 
437
  if ( $preview == '' ) {
438
  // we aren't sending a Preview to the current user so carry out checks
439
- $s2mail = get_post_meta($post->ID, 's2mail', true);
440
  if ( (isset($_POST['s2_meta_field']) && $_POST['s2_meta_field'] == 'no') || strtolower(trim($s2mail)) == 'no' ) { return $post; }
441
 
442
  // are we doing daily digests? If so, don't send anything now
@@ -466,8 +476,7 @@ class s2class {
466
  return $post;
467
  }
468
 
469
- $s2_taxonomies = array('category');
470
- $s2_taxonomies = apply_filters('s2_taxonomies', $s2_taxonomies);
471
  $post_cats = wp_get_object_terms($post->ID, $s2_taxonomies, array('fields' => 'ids'));
472
  $check = false;
473
  // is the current post assigned to any categories
@@ -515,8 +524,7 @@ class s2class {
515
  }
516
  } else {
517
  // make sure we prime the taxonomy variable for preview posts
518
- $s2_taxonomies = array('category');
519
- $s2_taxonomies = apply_filters('s2_taxonomies', $s2_taxonomies);
520
  }
521
 
522
  // we set these class variables so that we can avoid
@@ -527,7 +535,7 @@ class s2class {
527
  $this->post_time = get_the_time();
528
 
529
  $author = get_userdata($post->post_author);
530
- $this->authorname = $author->display_name;
531
 
532
  // do we send as admin, or post author?
533
  if ( 'author' == $this->subscribe2_options['sender'] ) {
@@ -549,7 +557,7 @@ class s2class {
549
  $this->post_tag_names = implode(', ', wp_get_post_tags($post->ID, array('fields' => 'names')));
550
 
551
  // Get email subject
552
- $subject = stripslashes(strip_tags($this->substitute($this->subscribe2_options['notification_subject'])));
553
  // Get the message template
554
  $mailtext = apply_filters('s2_email_template', $this->subscribe2_options['mailtext']);
555
  $mailtext = stripslashes($this->substitute($mailtext));
@@ -558,9 +566,9 @@ class s2class {
558
  if ( function_exists('strip_shortcodes') ) {
559
  $plaintext = strip_shortcodes($plaintext);
560
  }
561
- $plaintext = preg_replace('|<s*>(.*)<\/s>|','', $plaintext);
562
- $plaintext = preg_replace('|<strike*>(.*)<\/strike>|','', $plaintext);
563
- $plaintext = preg_replace('|<del*>(.*)<\/del>|','', $plaintext);
564
 
565
  $gallid = '[gallery id="' . $post->ID . '"';
566
  $content = str_replace('[gallery', $gallid, $post->post_content);
@@ -784,14 +792,14 @@ class s2class {
784
  if ( $confirm ) {
785
  $wpdb->get_results($wpdb->prepare("UPDATE $this->public SET active='1', ip=%s WHERE CAST(email as binary)=%s", $this->ip, $email));
786
  } else {
787
- $wpdb->get_results($wpdb->prepare("UPDATE $this->public SET date=CURDATE() WHERE CAST(email as binary)=%s", $email));
788
  }
789
  } else {
790
  if ( $confirm ) {
791
  global $current_user;
792
- $wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, ip) VALUES (%s, %d, CURDATE(), %s)", $email, 1, $current_user->user_login));
793
  } else {
794
- $wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, ip) VALUES (%s, %d, CURDATE(), %s)", $email, 0, $this->ip));
795
  }
796
  }
797
  } // end add()
@@ -842,7 +850,7 @@ class s2class {
842
  /**
843
  Check email is not from a barred domain
844
  */
845
- function is_barred($email='') {
846
  $barred_option = $this->subscribe2_options['barred'];
847
  list($user, $domain) = explode('@', $email, 2);
848
  $bar_check = stristr($barred_option, $domain);
@@ -1159,8 +1167,7 @@ class s2class {
1159
  */
1160
  function all_cats($exclude = false, $orderby = 'slug') {
1161
  $all_cats = array();
1162
- $s2_taxonomies = array('category');
1163
- $s2_taxonomies = apply_filters('s2_taxonomies', $s2_taxonomies);
1164
 
1165
  foreach( $s2_taxonomies as $taxonomy ) {
1166
  if ( taxonomy_exists($taxonomy) ) {
@@ -1301,7 +1308,7 @@ class s2class {
1301
  if ( is_user_logged_in() ) {
1302
  echo $this->profile;
1303
  } else {
1304
- echo "<label><input type=\"checkbox\" name=\"s2_comment_request\" value=\"1\" />" . __('Check here to Subscribe to notifications for new posts', 'subscribe2') . "</label>";
1305
  }
1306
  } // end s2_comment_meta_form()
1307
 
@@ -1335,7 +1342,7 @@ class s2class {
1335
  /**
1336
  Action subscribe requests made on comment forms when comments are approved
1337
  */
1338
- function comment_status($comment_ID = 0){
1339
  global $wpdb;
1340
 
1341
  // get meta data
@@ -1401,7 +1408,7 @@ class s2class {
1401
  function subscribe2_cron($preview = '', $resend = '') {
1402
  if ( defined('DOING_S2_CRON') && DOING_S2_CRON ) { return; }
1403
  define( 'DOING_S2_CRON', true );
1404
- global $wpdb;
1405
 
1406
  if ( '' == $preview ) {
1407
  // update last_s2cron execution time before completing or bailing
@@ -1453,6 +1460,14 @@ class s2class {
1453
  $posts = get_posts('numberposts=1');
1454
  }
1455
 
 
 
 
 
 
 
 
 
1456
  // do we have any posts?
1457
  if ( empty($posts) && !has_filter('s2_digest_email') ) { return false; }
1458
  $this->post_count = count($posts);
@@ -1460,14 +1475,17 @@ class s2class {
1460
  // if we have posts, let's prepare the digest
1461
  $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
1462
  $all_post_cats = array();
 
1463
  $mailtext = apply_filters('s2_email_template', $this->subscribe2_options['mailtext']);
1464
  $table = '';
1465
  $tablelinks = '';
1466
  $message_post= '';
1467
  $message_posttime = '';
1468
  foreach ( $posts as $post ) {
1469
- $s2_taxonomies = array('category');
1470
- $s2_taxonomies = apply_filters('s2_taxonomies', $s2_taxonomies);
 
 
1471
  $post_cats = wp_get_object_terms($post->ID, $s2_taxonomies, array('fields' => 'ids'));
1472
  $post_cats_string = implode(',', $post_cats);
1473
  $all_post_cats = array_unique(array_merge($all_post_cats, $post_cats));
@@ -1485,7 +1503,7 @@ class s2class {
1485
  }
1486
  // is the current post set by the user to
1487
  // not generate a notification email?
1488
- $s2mail = get_post_meta($post->ID, 's2mail', true);
1489
  if ( strtolower(trim($s2mail)) == 'no' ) {
1490
  $check = true;
1491
  }
@@ -1514,8 +1532,8 @@ class s2class {
1514
  if ( strstr($mailtext, "{AUTHORNAME}") ) {
1515
  $author = get_userdata($post->post_author);
1516
  if ( $author->display_name != '' ) {
1517
- $message_post .= " (" . __('Author', 'subscribe2') . ": " . $author->display_name . ")";
1518
- $message_posttime .= " (" . __('Author', 'subscribe2') . ": " . $author->display_name . ")";
1519
  }
1520
  }
1521
  $message_post .= "\r\n";
@@ -1574,6 +1592,8 @@ class s2class {
1574
  // remove excess white space from within $message_post and $message_posttime
1575
  $message_post = preg_replace('|[ ]+|', ' ', $message_post);
1576
  $message_posttime = preg_replace('|[ ]+|', ' ', $message_posttime);
 
 
1577
 
1578
  // apply filter to allow external content to be inserted or content manipulated
1579
  $message_post = apply_filters('s2_digest_email', $message_post, $now, $prev, $last, $this->subscribe2_options['cron_order']);
@@ -1628,7 +1648,7 @@ class s2class {
1628
  // load the options
1629
  $this->subscribe2_options = get_option('subscribe2_options');
1630
  // if SCRIPT_DEBUG is true, use dev scripts
1631
- $this->script_debug = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '.dev' : '';
1632
 
1633
  // get the WordPress release number for in code version comparisons
1634
  $tmp = explode('-', $wp_version, 2);
@@ -1636,9 +1656,6 @@ class s2class {
1636
 
1637
  load_plugin_textdomain('subscribe2', false, S2DIR);
1638
 
1639
- // load our strings
1640
- $this->load_strings();
1641
-
1642
  // Is this WordPressMU or not?
1643
  if ( isset($wpmu_version) || strpos($wp_version, 'wordpress-mu') ) {
1644
  $this->s2_mu = true;
@@ -1653,10 +1670,13 @@ class s2class {
1653
  global $s2class_multisite;
1654
  $s2class_multisite = new s2_multisite;
1655
  if ( isset($_GET['s2mu_subscribe']) || isset($_GET['s2mu_unsubscribe']) ) {
1656
- add_action('init', array(&$this, 'wpmu_subscribe'));
1657
  }
1658
  }
1659
 
 
 
 
1660
  // do we need to install anything?
1661
  $this->public = $table_prefix . "subscribe2";
1662
  if ( $wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $this->public)) != $this->public ) { $this->install(); }
14
  global $blog_id, $user_ID;
15
  if ( !is_blog_user($blog_id) ) {
16
  // if we are on multisite and the user is not a member of this blog change the link
17
+ $this->profile = "<p class=\"s2_message\"><a href=\"" . get_option('siteurl') . "/wp-admin/?s2mu_subscribe=" . $blog_id . "\">" . __('Subscribe', 'subscribe2') . "</a> " . __('to email notifications when this blog posts new content', 'subscribe2') . ".</p>";
18
  }
19
  }
20
 
30
 
31
  $this->error = "<p class=\"s2_error\">" . __('Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2') . "</p>";
32
 
33
+ $this->no_page = __('You must to create a WordPress page for this plugin to work correctly.', 'subscribe2');
34
 
35
  $this->mail_sent = "<p class=\"s2_message\">" . __('Message sent!', 'subscribe2') . "</p>";
36
 
91
  $date = date('Y-m-d');
92
  maybe_add_column($this->public, 'date', "ALTER TABLE $this->public ADD date DATE DEFAULT '$date' NOT NULL AFTER active");
93
  maybe_add_column($this->public, 'ip', "ALTER TABLE $this->public ADD ip char(64) DEFAULT 'admin' NOT NULL AFTER date");
94
+ maybe_add_column($this->public, 'time', "ALTER TABLE $this->public ADD time TIME DEFAULT '00:00:00' NOT NULL AFTER date");
95
 
96
  // let's take the time to check process registered users
97
  // existing public subscribers are subscribed to all categories
217
  $wpdb->get_results($wpdb->prepare("UPDATE $this->public SET email=%s WHERE CAST(email as binary)=%s", $new_email, $email));
218
  }
219
  }
220
+
221
+ // update postmeta field to a protected name, from version 8.5
222
+ $sql = $wpdb->prepare( "UPDATE $wpdb->postmeta SET meta_key = '_s2mail' WHERE meta_key = 's2mail'");
223
+ $wpdb->query($sql);
224
+
225
  return;
226
  } // end upgrade()
227
 
273
  /**
274
  Delivers email to recipients in HTML or plaintext
275
  */
276
+ function mail($recipients = array(), $subject = '', $message = '', $type = 'text') {
277
  if ( empty($recipients) || '' == $message ) { return; }
278
 
279
  if ( 'html' == $type ) {
368
  /**
369
  Construct standard set of email headers
370
  */
371
+ function headers($type = 'text') {
372
  if ( empty($this->myname) || empty($this->myemail) ) {
373
  if ( $this->subscribe2_options['sender'] == 'blogname' ) {
374
  $this->myname = html_entity_decode(get_option('blogname'), ENT_QUOTES);
421
  function get_tracking_link($link) {
422
  if ( empty($link) ) { return; }
423
  if ( !empty($this->subscribe2_options['tracking']) ) {
424
+ (strpos($link, '?') > 0) ? $delimiter .= '&' : $delimiter = '?';
425
+ if ( strpos($this->subscribe2_options['tracking'], "{ID}") ) {
426
+ $id = url_to_postid($link);
427
+ $tracking = str_replace("{ID}", $id, $this->subscribe2_options['tracking']);
428
+ return $link . $delimiter . $tracking;
429
+ }
430
+ return $link . $delimiter . $this->subscribe2_options['tracking'];
431
  } else {
432
+ return $link;
433
  }
434
  } // end get_tracking_link()
435
 
436
  /**
437
  Sends an email notification of a new post
438
  */
439
+ function publish($post, $preview = '') {
440
  if ( !$post ) { return $post; }
441
 
442
  if ( $this->s2_mu ) {
446
 
447
  if ( $preview == '' ) {
448
  // we aren't sending a Preview to the current user so carry out checks
449
+ $s2mail = get_post_meta($post->ID, '_s2mail', true);
450
  if ( (isset($_POST['s2_meta_field']) && $_POST['s2_meta_field'] == 'no') || strtolower(trim($s2mail)) == 'no' ) { return $post; }
451
 
452
  // are we doing daily digests? If so, don't send anything now
476
  return $post;
477
  }
478
 
479
+ $s2_taxonomies = apply_filters('s2_taxonomies', array('category'));
 
480
  $post_cats = wp_get_object_terms($post->ID, $s2_taxonomies, array('fields' => 'ids'));
481
  $check = false;
482
  // is the current post assigned to any categories
524
  }
525
  } else {
526
  // make sure we prime the taxonomy variable for preview posts
527
+ $s2_taxonomies = apply_filters('s2_taxonomies', array('category'));
 
528
  }
529
 
530
  // we set these class variables so that we can avoid
535
  $this->post_time = get_the_time();
536
 
537
  $author = get_userdata($post->post_author);
538
+ $this->authorname = html_entity_decode(apply_filters('the_author', $author->display_name), ENT_QUOTES);
539
 
540
  // do we send as admin, or post author?
541
  if ( 'author' == $this->subscribe2_options['sender'] ) {
557
  $this->post_tag_names = implode(', ', wp_get_post_tags($post->ID, array('fields' => 'names')));
558
 
559
  // Get email subject
560
+ $subject = html_entity_decode(stripslashes(wp_kses($this->substitute($this->subscribe2_options['notification_subject']), '')));
561
  // Get the message template
562
  $mailtext = apply_filters('s2_email_template', $this->subscribe2_options['mailtext']);
563
  $mailtext = stripslashes($this->substitute($mailtext));
566
  if ( function_exists('strip_shortcodes') ) {
567
  $plaintext = strip_shortcodes($plaintext);
568
  }
569
+ $plaintext = preg_replace('|<s[^>]*>(.*)<\/s>|Ui','', $plaintext);
570
+ $plaintext = preg_replace('|<strike[^>]*>(.*)<\/strike>|Ui','', $plaintext);
571
+ $plaintext = preg_replace('|<del[^>]*>(.*)<\/del>|Ui','', $plaintext);
572
 
573
  $gallid = '[gallery id="' . $post->ID . '"';
574
  $content = str_replace('[gallery', $gallid, $post->post_content);
792
  if ( $confirm ) {
793
  $wpdb->get_results($wpdb->prepare("UPDATE $this->public SET active='1', ip=%s WHERE CAST(email as binary)=%s", $this->ip, $email));
794
  } else {
795
+ $wpdb->get_results($wpdb->prepare("UPDATE $this->public SET date=CURDATE(), time=CURTIME() WHERE CAST(email as binary)=%s", $email));
796
  }
797
  } else {
798
  if ( $confirm ) {
799
  global $current_user;
800
+ $wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, time, ip) VALUES (%s, %d, CURDATE(), CURTIME(), %s)", $email, 1, $current_user->user_login));
801
  } else {
802
+ $wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, time, ip) VALUES (%s, %d, CURDATE(), CURTIME(), %s)", $email, 0, $this->ip));
803
  }
804
  }
805
  } // end add()
850
  /**
851
  Check email is not from a barred domain
852
  */
853
+ function is_barred($email = '') {
854
  $barred_option = $this->subscribe2_options['barred'];
855
  list($user, $domain) = explode('@', $email, 2);
856
  $bar_check = stristr($barred_option, $domain);
1167
  */
1168
  function all_cats($exclude = false, $orderby = 'slug') {
1169
  $all_cats = array();
1170
+ $s2_taxonomies = apply_filters('s2_taxonomies', array('category'));
 
1171
 
1172
  foreach( $s2_taxonomies as $taxonomy ) {
1173
  if ( taxonomy_exists($taxonomy) ) {
1308
  if ( is_user_logged_in() ) {
1309
  echo $this->profile;
1310
  } else {
1311
+ echo "<p style=\"width: auto;\"><label><input type=\"checkbox\" name=\"s2_comment_request\" value=\"1\" " . checked($this->subscribe2_options['comment_def'], 'yes', false) . "/>" . __('Check here to Subscribe to notifications for new posts', 'subscribe2') . "</label></p>";
1312
  }
1313
  } // end s2_comment_meta_form()
1314
 
1342
  /**
1343
  Action subscribe requests made on comment forms when comments are approved
1344
  */
1345
+ function comment_status($comment_ID = 0) {
1346
  global $wpdb;
1347
 
1348
  // get meta data
1408
  function subscribe2_cron($preview = '', $resend = '') {
1409
  if ( defined('DOING_S2_CRON') && DOING_S2_CRON ) { return; }
1410
  define( 'DOING_S2_CRON', true );
1411
+ global $wpdb, $post;
1412
 
1413
  if ( '' == $preview ) {
1414
  // update last_s2cron execution time before completing or bailing
1460
  $posts = get_posts('numberposts=1');
1461
  }
1462
 
1463
+ // Collect sticky posts if desired
1464
+ if ( $this->subscribe2_options['stickies'] == 'yes' ) {
1465
+ $stickies = get_posts(array('post__in' => get_option('sticky_posts')));
1466
+ if ( !empty($stickies) ) {
1467
+ $posts = array_merge((array)$stickies, (array)$posts);
1468
+ }
1469
+ }
1470
+
1471
  // do we have any posts?
1472
  if ( empty($posts) && !has_filter('s2_digest_email') ) { return false; }
1473
  $this->post_count = count($posts);
1475
  // if we have posts, let's prepare the digest
1476
  $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
1477
  $all_post_cats = array();
1478
+ $ids = array();
1479
  $mailtext = apply_filters('s2_email_template', $this->subscribe2_options['mailtext']);
1480
  $table = '';
1481
  $tablelinks = '';
1482
  $message_post= '';
1483
  $message_posttime = '';
1484
  foreach ( $posts as $post ) {
1485
+ // keep an array of post ids and skip if we've already done it once
1486
+ if ( in_array($post->ID, $ids) ) { continue; }
1487
+ $ids[] = $post->ID;
1488
+ $s2_taxonomies = apply_filters('s2_taxonomies', array('category'));
1489
  $post_cats = wp_get_object_terms($post->ID, $s2_taxonomies, array('fields' => 'ids'));
1490
  $post_cats_string = implode(',', $post_cats);
1491
  $all_post_cats = array_unique(array_merge($all_post_cats, $post_cats));
1503
  }
1504
  // is the current post set by the user to
1505
  // not generate a notification email?
1506
+ $s2mail = get_post_meta($post->ID, '_s2mail', true);
1507
  if ( strtolower(trim($s2mail)) == 'no' ) {
1508
  $check = true;
1509
  }
1532
  if ( strstr($mailtext, "{AUTHORNAME}") ) {
1533
  $author = get_userdata($post->post_author);
1534
  if ( $author->display_name != '' ) {
1535
+ $message_post .= " (" . __('Author', 'subscribe2') . ": " . html_entity_decode(apply_filters('the_author', $author->display_name), ENT_QUOTES) . ")";
1536
+ $message_posttime .= " (" . __('Author', 'subscribe2') . ": " . html_entity_decode(apply_filters('the_author', $author->display_name), ENT_QUOTES) . ")";
1537
  }
1538
  }
1539
  $message_post .= "\r\n";
1592
  // remove excess white space from within $message_post and $message_posttime
1593
  $message_post = preg_replace('|[ ]+|', ' ', $message_post);
1594
  $message_posttime = preg_replace('|[ ]+|', ' ', $message_posttime);
1595
+ $message_post = preg_replace("|[\r\n]{3,}|", "\r\n\r\n", $message_post);
1596
+ $message_posttime = preg_replace("|[\r\n]{3,}|", "\r\n\r\n", $message_posttime);
1597
 
1598
  // apply filter to allow external content to be inserted or content manipulated
1599
  $message_post = apply_filters('s2_digest_email', $message_post, $now, $prev, $last, $this->subscribe2_options['cron_order']);
1648
  // load the options
1649
  $this->subscribe2_options = get_option('subscribe2_options');
1650
  // if SCRIPT_DEBUG is true, use dev scripts
1651
+ $this->script_debug = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '' : '.min';
1652
 
1653
  // get the WordPress release number for in code version comparisons
1654
  $tmp = explode('-', $wp_version, 2);
1656
 
1657
  load_plugin_textdomain('subscribe2', false, S2DIR);
1658
 
 
 
 
1659
  // Is this WordPressMU or not?
1660
  if ( isset($wpmu_version) || strpos($wp_version, 'wordpress-mu') ) {
1661
  $this->s2_mu = true;
1670
  global $s2class_multisite;
1671
  $s2class_multisite = new s2_multisite;
1672
  if ( isset($_GET['s2mu_subscribe']) || isset($_GET['s2mu_unsubscribe']) ) {
1673
+ add_action('init', array(&$s2class_multisite, 'wpmu_subscribe'));
1674
  }
1675
  }
1676
 
1677
+ // load our strings
1678
+ add_action('init', array(&$this, 'load_strings'));
1679
+
1680
  // do we need to install anything?
1681
  $this->public = $table_prefix . "subscribe2";
1682
  if ( $wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $this->public)) != $this->public ) { $this->install(); }
classes/class-s2-frontend.php CHANGED
@@ -1,285 +1,297 @@
1
- <?php
2
- class s2_frontend extends s2class {
3
- /* ===== template and filter functions ===== */
4
- /**
5
- Display our form; also handles (un)subscribe requests
6
- */
7
- function shortcode($atts) {
8
- extract(shortcode_atts(array(
9
- 'hide' => '',
10
- 'id' => '',
11
- 'url' => '',
12
- 'nojs' => 'false',
13
- 'link' => '',
14
- 'size' => 20
15
- ), $atts));
16
-
17
- // if link is true return a link to the page with the ajax class
18
- if ( $link !== '' && !is_user_logged_in() ) {
19
- $this->s2form = "<a href=\"" . get_permalink($this->subscribe2_options['s2page']) . "\" class=\"s2popup\">" . $link . "</a>\r\n";
20
- return $this->s2form;
21
- }
22
-
23
- // Apply filters to button text
24
- $unsubscribe_button_value = apply_filters('s2_unsubscribe_button', __('Unsubscribe', 'subscribe2'));
25
- $subscribe_button_value = apply_filters('s2_subscribe_button', __('Subscribe', 'subscribe2'));
26
-
27
- // if a button is hidden, show only other
28
- if ( $hide == 'subscribe' ) {
29
- $this->input_form_action = "<input type=\"submit\" name=\"unsubscribe\" value=\"" . esc_attr($unsubscribe_button_value) . "\" />";
30
- } elseif ( $hide == 'unsubscribe' ) {
31
- $this->input_form_action = "<input type=\"submit\" name=\"subscribe\" value=\"" . esc_attr($subscribe_button_value) . "\" />";
32
- } else {
33
- // both form input actions
34
- $this->input_form_action = "<input type=\"submit\" name=\"subscribe\" value=\"" . esc_attr($subscribe_button_value) . "\" />&nbsp;<input type=\"submit\" name=\"unsubscribe\" value=\"" . esc_attr($unsubscribe_button_value) . "\" />";
35
- }
36
- // if ID is provided, get permalink
37
- if ( $id ) {
38
- $url = get_permalink( $id );
39
- } elseif ( $this->subscribe2_options['s2page'] > 0 ) {
40
- $url = get_permalink( $this->subscribe2_options['s2page'] );
41
- } else {
42
- $url = get_site_url();
43
- }
44
- // build default form
45
- if ( $nojs == 'true' ) {
46
- $this->form = "<form method=\"post\" action=\"" . $url . "\"><input type=\"hidden\" name=\"ip\" value=\"" . $_SERVER['REMOTE_ADDR'] . "\" /><p><label for=\"s2email\">" . __('Your email:', 'subscribe2') . "</label><br /><input type=\"text\" name=\"email\" id=\"s2email\" value=\"\" size=\"" . $size . "\" /></p><p>" . $this->input_form_action . "</p></form>";
47
- } else {
48
- $this->form = "<form method=\"post\" action=\"" . $url . "\"><input type=\"hidden\" name=\"ip\" value=\"" . $_SERVER['REMOTE_ADDR'] . "\" /><p><label for=\"s2email\">" . __('Your email:', 'subscribe2') . "</label><br /><input type=\"text\" name=\"email\" id=\"s2email\" value=\"" . __('Enter email address...', 'subscribe2') . "\" size=\"" . $size . "\" onfocus=\"if (this.value == '" . __('Enter email address...', 'subscribe2') . "') {this.value = '';}\" onblur=\"if (this.value == '') {this.value = '" . __('Enter email address...', 'subscribe2') . "';}\" /></p><p>" . $this->input_form_action . "</p></form>\r\n";
49
- }
50
- $this->s2form = $this->form;
51
-
52
- global $user_ID;
53
- get_currentuserinfo();
54
- if ( $user_ID ) {
55
- $this->s2form = $this->profile;
56
- }
57
- if ( isset($_POST['subscribe']) || isset($_POST['unsubscribe']) ) {
58
- global $wpdb, $user_email;
59
- if ( !is_email($_POST['email']) ) {
60
- $this->s2form = $this->form . $this->not_an_email;
61
- } elseif ( $this->is_barred($_POST['email']) ) {
62
- $this->s2form = $this->form . $this->barred_domain;
63
- } else {
64
- $this->email = $this->sanitize_email($_POST['email']);
65
- $this->ip = $_POST['ip'];
66
- // does the supplied email belong to a registered user?
67
- $check = $wpdb->get_var($wpdb->prepare("SELECT user_email FROM $wpdb->users WHERE user_email = %s", $this->email));
68
- if ( '' != $check ) {
69
- // this is a registered email
70
- $this->s2form = $this->please_log_in;
71
- } else {
72
- // this is not a registered email
73
- // what should we do?
74
- if ( isset($_POST['subscribe']) ) {
75
- // someone is trying to subscribe
76
- // lets see if they've tried to subscribe previously
77
- if ( '1' !== $this->is_public($this->email) ) {
78
- // the user is unknown or inactive
79
- $this->add($this->email);
80
- $status = $this->send_confirm('add');
81
- // set a variable to denote that we've already run, and shouldn't run again
82
- $this->filtered = 1;
83
- if ( $status ) {
84
- $this->s2form = $this->confirmation_sent;
85
- } else {
86
- $this->s2form = $this->error;
87
- }
88
- } else {
89
- // they're already subscribed
90
- $this->s2form = $this->already_subscribed;
91
- }
92
- $this->action = 'subscribe';
93
- } elseif ( isset($_POST['unsubscribe']) ) {
94
- // is this email a subscriber?
95
- if ( false == $this->is_public($this->email) ) {
96
- $this->s2form = $this->form . $this->not_subscribed;
97
- } else {
98
- $status = $this->send_confirm('del');
99
- // set a variable to denote that we've already run, and shouldn't run again
100
- $this->filtered = 1;
101
- if ( $status ) {
102
- $this->s2form = $this->confirmation_sent;
103
- } else {
104
- $this->s2form = $this->error;
105
- }
106
- }
107
- $this->action='unsubscribe';
108
- }
109
- }
110
- }
111
- }
112
- return $this->s2form;
113
- } // end shortcode()
114
-
115
- /**
116
- Display form when deprecated <!--subscribe2--> is used
117
- */
118
- function filter($content = '') {
119
- if ( '' == $content || !strstr($content, '<!--subscribe2-->') ) { return $content; }
120
-
121
- return preg_replace('|(<p>)?(\n)*<!--subscribe2-->(\n)*(</p>)?|', do_shortcode( '[subscribe2]' ), $content);
122
- } // end filter()
123
-
124
- /**
125
- Overrides the default query when handling a (un)subscription confirmation
126
- This is basically a trick: if the s2 variable is in the query string, just grab the first
127
- static page and override it's contents later with title_filter()
128
- */
129
- function query_filter() {
130
- // don't interfere if we've already done our thing
131
- if ( 1 == $this->filtered ) { return; }
132
-
133
- global $wpdb;
134
-
135
- if ( 0 != $this->subscribe2_options['s2page'] ) {
136
- return "page_id=" . $this->subscribe2_options['s2page'];
137
- } else {
138
- $id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status='publish' LIMIT 1");
139
- if ( $id ) {
140
- return "page_id=$id";
141
- } else {
142
- return "showposts=1";
143
- }
144
- }
145
- } // end query_filter()
146
-
147
- /**
148
- Overrides the page title
149
- */
150
- function title_filter($title) {
151
- // don't interfere if we've already done our thing
152
- if ( in_the_loop() ) {
153
- $code = $_GET['s2'];
154
- $action = intval(substr($code, 0, 1));
155
- if ( $action == '1' ) {
156
- return __('Subscription Confirmation', 'subscribe2');
157
- } else {
158
- return __('Unsubscription Confirmation', 'subscribe2');
159
- }
160
- } else {
161
- return $title;
162
- }
163
- } // end title_filter()
164
-
165
- /**
166
- Confirm request from the link emailed to the user and email the admin
167
- */
168
- function confirm($content = '') {
169
- global $wpdb;
170
-
171
- if ( 1 == $this->filtered ) { return $content; }
172
-
173
- $code = $_GET['s2'];
174
- $action = intval(substr($code, 0, 1));
175
- $hash = substr($code, 1, 32);
176
- $id = intval(substr($code, 33));
177
- if ( $id ) {
178
- $this->email = $this->sanitize_email($this->get_email($id));
179
- if ( !$this->email || $hash !== wp_hash($this->email) ) {
180
- return $this->no_such_email;
181
- }
182
- } else {
183
- return $this->no_such_email;
184
- }
185
-
186
- // get current status of email so messages are only sent once per emailed link
187
- $current = $this->is_public($this->email);
188
-
189
- if ( '1' == $action ) {
190
- // make this subscription active
191
- $this->message = $this->added;
192
- if ( '1' != $current ) {
193
- $this->ip = $_SERVER['REMOTE_ADDR'];
194
- $this->toggle($this->email);
195
- if ( $this->subscribe2_options['admin_email'] == 'subs' || $this->subscribe2_options['admin_email'] == 'both' ) {
196
- ( '' == get_option('blogname') ) ? $subject = "" : $subject = "[" . stripslashes(html_entity_decode(get_option('blogname'), ENT_QUOTES)) . "] ";
197
- $subject .= __('New Subscription', 'subscribe2');
198
- $subject = html_entity_decode($subject, ENT_QUOTES);
199
- $message = $this->email . " " . __('subscribed to email notifications!', 'subscribe2');
200
- $role = array('fields' => array('user_email'), 'role' => 'administrator');
201
- $wp_user_query = get_users( $role );
202
- foreach ($wp_user_query as $user) {
203
- $recipients[] = $user->user_email;
204
- }
205
- $headers = $this->headers();
206
- // send individual emails so we don't reveal admin emails to each other
207
- foreach ( $recipients as $recipient ) {
208
- @wp_mail($recipient, $subject, $message, $headers);
209
- }
210
- }
211
- }
212
- $this->filtered = 1;
213
- } elseif ( '0' == $action ) {
214
- // remove this subscriber
215
- $this->message = $this->deleted;
216
- if ( '0' != $current ) {
217
- $this->delete($this->email);
218
- if ( $this->subscribe2_options['admin_email'] == 'unsubs' || $this->subscribe2_options['admin_email'] == 'both' ) {
219
- ( '' == get_option('blogname') ) ? $subject = "" : $subject = "[" . stripslashes(html_entity_decode(get_option('blogname'), ENT_QUOTES)) . "] ";
220
- $subject .= __('New Unsubscription', 'subscribe2');
221
- $subject = html_entity_decode($subject, ENT_QUOTES);
222
- $message = $this->email . " " . __('unsubscribed from email notifications!', 'subscribe2');
223
- $role = array('fields' => array('user_email'), 'role' => 'administrator');
224
- $wp_user_query = get_users( $role );
225
- foreach ($wp_user_query as $user) {
226
- $recipients[] = $user->user_email;
227
- }
228
- $headers = $this->headers();
229
- // send individual emails so we don't reveal admin emails to each other
230
- foreach ( $recipients as $recipient ) {
231
- @wp_mail($recipient, $subject, $message, $headers);
232
- }
233
- }
234
- }
235
- $this->filtered = 1;
236
- }
237
-
238
- if ( '' != $this->message ) {
239
- return $this->message;
240
- }
241
- } // end confirm()
242
-
243
- /**
244
- Add hook for Minimeta Widget plugin
245
- */
246
- function add_minimeta() {
247
- if ( $this->subscribe2_options['s2page'] != 0 ) {
248
- echo "<li><a href=\"" . get_permalink($this->subscribe2_options['s2page']) . "\">" . __('[Un]Subscribe to Posts', 'subscribe2') . "</a></li>\r\n";
249
- }
250
- } // end add_minimeta()
251
-
252
- /**
253
- Add jQuery code and CSS to front pages for ajax form
254
- */
255
- function add_ajax() {
256
- // enqueue the jQuery script we need and let WordPress handle the dependencies
257
- wp_enqueue_script('jquery-ui-dialog');
258
- wp_register_style('jquery-ui-style', apply_filters('s2_jqueryui_css', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-darkness/jquery-ui.css'));
259
- wp_enqueue_style('jquery-ui-style');
260
- } // end add_ajax()
261
-
262
- /**
263
- Write Subscribe2 form js code dynamically so we can pull WordPress functions
264
- */
265
- function add_s2_ajax() {
266
- echo "<script type=\"text/javascript\">\r\n";
267
- echo "//<![CDATA[\r\n";
268
- echo "jQuery(document).ready(function() {\r\n";
269
- echo " var dialog = jQuery('<div></div>')\r\n";
270
- echo " .html('" . do_shortcode('[subscribe2 nojs="true"]') . "')\r\n";
271
- if ( $this->s2form != $this->form && !is_user_logged_in() ) {
272
- echo " .dialog({modal: true, zIndex: 10000, title: '" . __('Subscribe to this blog', 'subscribe2') . "'});\r\n";
273
- } else {
274
- echo " .dialog({autoOpen: false, modal: true, zIndex: 10000, title: '" . __('Subscribe to this blog', 'subscribe2') . "'});\r\n";
275
- }
276
- echo " jQuery('a.s2popup').click(function(){\r\n";
277
- echo " dialog.dialog('open');\r\n";
278
- echo " return false;\r\n";
279
- echo " });\r\n";
280
- echo "});\r\n";
281
- echo "//]]>\r\n";
282
- echo "</script>\r\n";
283
- } // end add_s2_ajax()
284
- }
 
 
 
 
 
 
 
 
 
 
 
 
285
  ?>
1
+ <?php
2
+ class s2_frontend extends s2class {
3
+ /* ===== template and filter functions ===== */
4
+ /**
5
+ Display our form; also handles (un)subscribe requests
6
+ */
7
+ function shortcode($atts) {
8
+ extract(shortcode_atts(array(
9
+ 'hide' => '',
10
+ 'id' => '',
11
+ 'url' => '',
12
+ 'nojs' => 'false',
13
+ 'link' => '',
14
+ 'size' => 20
15
+ ), $atts));
16
+
17
+ // if link is true return a link to the page with the ajax class
18
+ if ( $link !== '' && !is_user_logged_in() ) {
19
+ $this->s2form = "<a href=\"" . get_permalink($this->subscribe2_options['s2page']) . "\" class=\"s2popup\">" . $link . "</a>\r\n";
20
+ return $this->s2form;
21
+ }
22
+
23
+ // Apply filters to button text
24
+ $unsubscribe_button_value = apply_filters('s2_unsubscribe_button', __('Unsubscribe', 'subscribe2'));
25
+ $subscribe_button_value = apply_filters('s2_subscribe_button', __('Subscribe', 'subscribe2'));
26
+
27
+ // if a button is hidden, show only other
28
+ if ( $hide == 'subscribe' ) {
29
+ $this->input_form_action = "<input type=\"submit\" name=\"unsubscribe\" value=\"" . esc_attr($unsubscribe_button_value) . "\" />";
30
+ } elseif ( $hide == 'unsubscribe' ) {
31
+ $this->input_form_action = "<input type=\"submit\" name=\"subscribe\" value=\"" . esc_attr($subscribe_button_value) . "\" />";
32
+ } else {
33
+ // both form input actions
34
+ $this->input_form_action = "<input type=\"submit\" name=\"subscribe\" value=\"" . esc_attr($subscribe_button_value) . "\" />&nbsp;<input type=\"submit\" name=\"unsubscribe\" value=\"" . esc_attr($unsubscribe_button_value) . "\" />";
35
+ }
36
+ // if ID is provided, get permalink
37
+ if ( $id ) {
38
+ $url = get_permalink( $id );
39
+ } elseif ( $this->subscribe2_options['s2page'] > 0 ) {
40
+ $url = get_permalink( $this->subscribe2_options['s2page'] );
41
+ } else {
42
+ $url = get_site_url();
43
+ }
44
+
45
+ // allow remote setting of email in form
46
+ if ( isset($_REQUEST['email']) ) {
47
+ if ( is_email($_REQUEST['email']) ) {
48
+ $value = $this->sanitize_email($_REQUEST['email']);
49
+ }
50
+ } elseif ( $nojs == 'true' ) {
51
+ $value = '';
52
+ } else {
53
+ $value = __('Enter email address...', 'subscribe2');
54
+ }
55
+
56
+ // build default form
57
+ if ( $nojs == 'true' ) {
58
+ $this->form = "<form method=\"post\" action=\"" . $url . "\"><input type=\"hidden\" name=\"ip\" value=\"" . $_SERVER['REMOTE_ADDR'] . "\" /><p><label for=\"s2email\">" . __('Your email:', 'subscribe2') . "</label><br /><input type=\"text\" name=\"email\" id=\"s2email\" value=\"" . $value . "\" size=\"" . $size . "\" /></p><p>" . $this->input_form_action . "</p></form>";
59
+ } else {
60
+ $this->form = "<form method=\"post\" action=\"" . $url . "\"><input type=\"hidden\" name=\"ip\" value=\"" . $_SERVER['REMOTE_ADDR'] . "\" /><p><label for=\"s2email\">" . __('Your email:', 'subscribe2') . "</label><br /><input type=\"text\" name=\"email\" id=\"s2email\" value=\"" . $value . "\" size=\"" . $size . "\" onfocus=\"if (this.value == '" . __('Enter email address...', 'subscribe2') . "') {this.value = '';}\" onblur=\"if (this.value == '') {this.value = '" . __('Enter email address...', 'subscribe2') . "';}\" /></p><p>" . $this->input_form_action . "</p></form>\r\n";
61
+ }
62
+ $this->s2form = $this->form;
63
+
64
+ global $user_ID;
65
+ get_currentuserinfo();
66
+ if ( $user_ID ) {
67
+ $this->s2form = $this->profile;
68
+ }
69
+ if ( isset($_POST['subscribe']) || isset($_POST['unsubscribe']) ) {
70
+ global $wpdb, $user_email;
71
+ $this->email = $this->sanitize_email($_POST['email']);
72
+ if ( !is_email($this->email) ) {
73
+ $this->s2form = $this->form . $this->not_an_email;
74
+ } elseif ( $this->is_barred($this->email) ) {
75
+ $this->s2form = $this->form . $this->barred_domain;
76
+ } else {
77
+ $this->ip = $_POST['ip'];
78
+ // does the supplied email belong to a registered user?
79
+ $check = $wpdb->get_var($wpdb->prepare("SELECT user_email FROM $wpdb->users WHERE user_email = %s", $this->email));
80
+ if ( '' != $check ) {
81
+ // this is a registered email
82
+ $this->s2form = $this->please_log_in;
83
+ } else {
84
+ // this is not a registered email
85
+ // what should we do?
86
+ if ( isset($_POST['subscribe']) ) {
87
+ // someone is trying to subscribe
88
+ // lets see if they've tried to subscribe previously
89
+ if ( '1' !== $this->is_public($this->email) ) {
90
+ // the user is unknown or inactive
91
+ $this->add($this->email);
92
+ $status = $this->send_confirm('add');
93
+ // set a variable to denote that we've already run, and shouldn't run again
94
+ $this->filtered = 1;
95
+ if ( $status ) {
96
+ $this->s2form = $this->confirmation_sent;
97
+ } else {
98
+ $this->s2form = $this->error;
99
+ }
100
+ } else {
101
+ // they're already subscribed
102
+ $this->s2form = $this->already_subscribed;
103
+ }
104
+ $this->action = 'subscribe';
105
+ } elseif ( isset($_POST['unsubscribe']) ) {
106
+ // is this email a subscriber?
107
+ if ( false == $this->is_public($this->email) ) {
108
+ $this->s2form = $this->form . $this->not_subscribed;
109
+ } else {
110
+ $status = $this->send_confirm('del');
111
+ // set a variable to denote that we've already run, and shouldn't run again
112
+ $this->filtered = 1;
113
+ if ( $status ) {
114
+ $this->s2form = $this->confirmation_sent;
115
+ } else {
116
+ $this->s2form = $this->error;
117
+ }
118
+ }
119
+ $this->action = 'unsubscribe';
120
+ }
121
+ }
122
+ }
123
+ }
124
+ return $this->s2form;
125
+ } // end shortcode()
126
+
127
+ /**
128
+ Display form when deprecated <!--subscribe2--> is used
129
+ */
130
+ function filter($content = '') {
131
+ if ( '' == $content || !strstr($content, '<!--subscribe2-->') ) { return $content; }
132
+
133
+ return preg_replace('|(<p>)?(\n)*<!--subscribe2-->(\n)*(</p>)?|', do_shortcode( '[subscribe2]' ), $content);
134
+ } // end filter()
135
+
136
+ /**
137
+ Overrides the default query when handling a (un)subscription confirmation
138
+ This is basically a trick: if the s2 variable is in the query string, just grab the first
139
+ static page and override it's contents later with title_filter()
140
+ */
141
+ function query_filter() {
142
+ // don't interfere if we've already done our thing
143
+ if ( 1 == $this->filtered ) { return; }
144
+
145
+ global $wpdb;
146
+
147
+ if ( 0 != $this->subscribe2_options['s2page'] ) {
148
+ return "page_id=" . $this->subscribe2_options['s2page'];
149
+ } else {
150
+ $id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status='publish' LIMIT 1");
151
+ if ( $id ) {
152
+ return "page_id=$id";
153
+ } else {
154
+ return "showposts=1";
155
+ }
156
+ }
157
+ } // end query_filter()
158
+
159
+ /**
160
+ Overrides the page title
161
+ */
162
+ function title_filter($title) {
163
+ // don't interfere if we've already done our thing
164
+ if ( in_the_loop() ) {
165
+ $code = $_GET['s2'];
166
+ $action = intval(substr($code, 0, 1));
167
+ if ( $action == '1' ) {
168
+ return __('Subscription Confirmation', 'subscribe2');
169
+ } else {
170
+ return __('Unsubscription Confirmation', 'subscribe2');
171
+ }
172
+ } else {
173
+ return $title;
174
+ }
175
+ } // end title_filter()
176
+
177
+ /**
178
+ Confirm request from the link emailed to the user and email the admin
179
+ */
180
+ function confirm($content = '') {
181
+ global $wpdb;
182
+
183
+ if ( 1 == $this->filtered ) { return $content; }
184
+
185
+ $code = $_GET['s2'];
186
+ $action = intval(substr($code, 0, 1));
187
+ $hash = substr($code, 1, 32);
188
+ $id = intval(substr($code, 33));
189
+ if ( $id ) {
190
+ $this->email = $this->sanitize_email($this->get_email($id));
191
+ if ( !$this->email || $hash !== wp_hash($this->email) ) {
192
+ return $this->no_such_email;
193
+ }
194
+ } else {
195
+ return $this->no_such_email;
196
+ }
197
+
198
+ // get current status of email so messages are only sent once per emailed link
199
+ $current = $this->is_public($this->email);
200
+
201
+ if ( '1' == $action ) {
202
+ // make this subscription active
203
+ $this->message = $this->added;
204
+ if ( '1' != $current ) {
205
+ $this->ip = $_SERVER['REMOTE_ADDR'];
206
+ $this->toggle($this->email);
207
+ if ( $this->subscribe2_options['admin_email'] == 'subs' || $this->subscribe2_options['admin_email'] == 'both' ) {
208
+ ( '' == get_option('blogname') ) ? $subject = "" : $subject = "[" . stripslashes(html_entity_decode(get_option('blogname'), ENT_QUOTES)) . "] ";
209
+ $subject .= __('New Subscription', 'subscribe2');
210
+ $subject = html_entity_decode($subject, ENT_QUOTES);
211
+ $message = $this->email . " " . __('subscribed to email notifications!', 'subscribe2');
212
+ $role = array('fields' => array('user_email'), 'role' => 'administrator');
213
+ $wp_user_query = get_users( $role );
214
+ foreach ($wp_user_query as $user) {
215
+ $recipients[] = $user->user_email;
216
+ }
217
+ $headers = $this->headers();
218
+ // send individual emails so we don't reveal admin emails to each other
219
+ foreach ( $recipients as $recipient ) {
220
+ @wp_mail($recipient, $subject, $message, $headers);
221
+ }
222
+ }
223
+ }
224
+ $this->filtered = 1;
225
+ } elseif ( '0' == $action ) {
226
+ // remove this subscriber
227
+ $this->message = $this->deleted;
228
+ if ( '0' != $current ) {
229
+ $this->delete($this->email);
230
+ if ( $this->subscribe2_options['admin_email'] == 'unsubs' || $this->subscribe2_options['admin_email'] == 'both' ) {
231
+ ( '' == get_option('blogname') ) ? $subject = "" : $subject = "[" . stripslashes(html_entity_decode(get_option('blogname'), ENT_QUOTES)) . "] ";
232
+ $subject .= __('New Unsubscription', 'subscribe2');
233
+ $subject = html_entity_decode($subject, ENT_QUOTES);
234
+ $message = $this->email . " " . __('unsubscribed from email notifications!', 'subscribe2');
235
+ $role = array('fields' => array('user_email'), 'role' => 'administrator');
236
+ $wp_user_query = get_users( $role );
237
+ foreach ($wp_user_query as $user) {
238
+ $recipients[] = $user->user_email;
239
+ }
240
+ $headers = $this->headers();
241
+ // send individual emails so we don't reveal admin emails to each other
242
+ foreach ( $recipients as $recipient ) {
243
+ @wp_mail($recipient, $subject, $message, $headers);
244
+ }
245
+ }
246
+ }
247
+ $this->filtered = 1;
248
+ }
249
+
250
+ if ( '' != $this->message ) {
251
+ return $this->message;
252
+ }
253
+ } // end confirm()
254
+
255
+ /**
256
+ Add hook for Minimeta Widget plugin
257
+ */
258
+ function add_minimeta() {
259
+ if ( $this->subscribe2_options['s2page'] != 0 ) {
260
+ echo "<li><a href=\"" . get_permalink($this->subscribe2_options['s2page']) . "\">" . __('[Un]Subscribe to Posts', 'subscribe2') . "</a></li>\r\n";
261
+ }
262
+ } // end add_minimeta()
263
+
264
+ /**
265
+ Add jQuery code and CSS to front pages for ajax form
266
+ */
267
+ function add_ajax() {
268
+ // enqueue the jQuery script we need and let WordPress handle the dependencies
269
+ wp_enqueue_script('jquery-ui-dialog');
270
+ wp_register_style('jquery-ui-style', apply_filters('s2_jqueryui_css', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-darkness/jquery-ui.css'));
271
+ wp_enqueue_style('jquery-ui-style');
272
+ } // end add_ajax()
273
+
274
+ /**
275
+ Write Subscribe2 form js code dynamically so we can pull WordPress functions
276
+ */
277
+ function add_s2_ajax() {
278
+ echo "<script type=\"text/javascript\">\r\n";
279
+ echo "//<![CDATA[\r\n";
280
+ echo "jQuery(document).ready(function() {\r\n";
281
+ echo " var dialog = jQuery('<div></div>')\r\n";
282
+ echo " .html('" . do_shortcode('[subscribe2 nojs="true"]') . "')\r\n";
283
+ if ( $this->s2form != $this->form && !is_user_logged_in() ) {
284
+ echo " .dialog({modal: true, zIndex: 10000, title: '" . __('Subscribe to this blog', 'subscribe2') . "'});\r\n";
285
+ } else {
286
+ echo " .dialog({autoOpen: false, modal: true, zIndex: 10000, title: '" . __('Subscribe to this blog', 'subscribe2') . "'});\r\n";
287
+ }
288
+ echo " jQuery('a.s2popup').click(function(){\r\n";
289
+ echo " dialog.dialog('open');\r\n";
290
+ echo " return false;\r\n";
291
+ echo " });\r\n";
292
+ echo "});\r\n";
293
+ echo "//]]>\r\n";
294
+ echo "</script>\r\n";
295
+ } // end add_s2_ajax()
296
+ }
297
  ?>
classes/class-s2_multisite.php CHANGED
@@ -1,167 +1,167 @@
1
- <?php
2
- class s2_multisite {
3
- /* === WP Multisite specific functions === */
4
- /**
5
- Handles subscriptions and unsubscriptions for different blogs on WPMU installs
6
- */
7
- function wpmu_subscribe() {
8
- global $mysubscribe2;
9
- // subscribe to new blog
10
- if ( !empty($_GET['s2mu_subscribe']) ) {
11
- $sub_id = intval($_GET['s2mu_subscribe']);
12
- if ( $sub_id >= 0 ) {
13
- switch_to_blog($sub_id);
14
-
15
- $user_ID = get_current_user_id();
16
-
17
- // if user is not a user of the current blog
18
- if ( !is_blog_user($sub_id) ) {
19
- // add user to current blog as subscriber
20
- add_user_to_blog($sub_id, $user_ID, 'subscriber');
21
- // add an action hook for external manipulation of blog and user data
22
- do_action_ref_array('subscribe2_wpmu_subscribe', array($user_ID, $sub_id));
23
- }
24
-
25
- // get categories, remove excluded ones if override is off
26
- if ( 0 == $mysubscribe2->subscribe2_options['reg_override'] ) {
27
- $all_cats = $mysubscribe2->all_cats(true, 'ID');
28
- } else {
29
- $all_cats = $mysubscribe2->all_cats(false, 'ID');
30
- }
31
-
32
- $cats_string = '';
33
- foreach ( $all_cats as $cat ) {
34
- ('' == $cats_string) ? $cats_string = "$cat->term_id" : $cats_string .= ",$cat->term_id";
35
- update_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_cat') . $cat->term_id, $cat->term_id);
36
- }
37
- if ( empty($cats_string) ) {
38
- delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'));
39
- } else {
40
- update_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'), $cats_string);
41
- }
42
- }
43
- } elseif ( !empty($_GET['s2mu_unsubscribe']) ) {
44
- // unsubscribe from a blog
45
- $unsub_id = intval($_GET['s2mu_unsubscribe']);
46
- if ( $unsub_id >= 0 ) {
47
- switch_to_blog($unsub_id);
48
-
49
- $user_ID = get_current_user_id();
50
-
51
- // delete subscription to all categories on that blog
52
- $cats = get_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'), true);
53
- $cats = explode(',', $cats);
54
- if ( !is_array($cats) ) {
55
- $cats = array($cats);
56
- }
57
-
58
- foreach ( $cats as $id ) {
59
- delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_cat') . $id);
60
- }
61
- delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'));
62
-
63
- // add an action hook for external manipulation of blog and user data
64
- do_action_ref_array('subscribe2_wpmu_unsubscribe', array($user_ID, $unsub_id));
65
-
66
- restore_current_blog();
67
- }
68
- }
69
-
70
- if ( !is_user_member_of_blog($user_ID) ) {
71
- $user_blogs = get_active_blog_for_user($user_ID);
72
- if ( is_array($user_blogs) ) {
73
- switch_to_blog(key($user_blogs));
74
- } else {
75
- // no longer a member of a blog
76
- wp_redirect(get_option('siteurl')); // redirect to front page
77
- exit(0);
78
- }
79
- }
80
-
81
- // redirect to profile page
82
- $url = get_option('siteurl') . '/wp-admin/admin.php?page=s2';
83
- wp_redirect($url);
84
- exit(0);
85
- } // end wpmu_subscribe()
86
-
87
- /**
88
- Obtain a list of current WordPress multiuser blogs
89
- Note this may affect performance but there is no alternative
90
- */
91
- function get_mu_blog_list() {
92
- global $wpdb;
93
- $blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );
94
-
95
- foreach ( $blogs as $details ) {
96
- //reindex the array so the key is the same as the blog_id
97
- $blog_list[$details['blog_id']] = $details;
98
- }
99
-
100
- if ( false == is_array( $blog_list ) ) {
101
- return array();
102
- }
103
-
104
- return $blog_list;
105
- } // end get_mu_blog_list()
106
-
107
- /**
108
- Register user details when new user is added to a multisite blog
109
- */
110
- function wpmu_add_user($user_ID = 0) {
111
- global $mysubscribe2;
112
- if ( 0 == $user_ID ) { return; }
113
- if ( 'yes' == $mysubscribe2->subscribe2_options['autosub'] ) {
114
- $mysubscribe2->register($user_ID, true);
115
- } else {
116
- $mysubscribe2->register($user_ID, false);
117
- }
118
- } // end wpmu_add_user()
119
-
120
- /**
121
- Delete user details when a user is removed from a multisite blog
122
- */
123
- function wpmu_remove_user($user_ID) {
124
- global $mysubscribe2;
125
- if ( 0 == $user_ID ) { return; }
126
- delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_format'));
127
- delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_autosub'));
128
- $cats = get_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'), true);
129
- if ( !empty($cats) ) {
130
- $cats = explode(',', $cats);
131
- foreach ( $cats as $cat ) {
132
- delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_cat') . $cat);
133
- }
134
- }
135
- delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'));
136
- } // end wpmu_remove_user()
137
-
138
- /**
139
- Rename WPMU widgets on upgrade without requiring user to re-enable
140
- */
141
- function namechange_subscribe2_widget() {
142
- global $wpdb;
143
- $blogs = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
144
-
145
- foreach ( $blogs as $blog ) {
146
- switch_to_blog($blog);
147
-
148
- $sidebars = get_option('sidebars_widgets');
149
- if ( empty($sidebars) || !is_array($sidebars) ) { return; }
150
- $changed = false;
151
- foreach ( $sidebars as $s =>$sidebar ) {
152
- if ( empty($sidebar) || !is_array($sidebar) ) { break; }
153
- foreach ( $sidebar as $w => $widget ) {
154
- if ( $widget == 'subscribe2widget' ) {
155
- $sidebars[$s][$w] = 'subscribe2';
156
- $changed = true;
157
- }
158
- }
159
- }
160
- if ( $changed ) {
161
- update_option('sidebar_widgets', $sidebars);
162
- }
163
- }
164
- restore_current_blog();
165
- } // end namechange_subscribe2_widget()
166
- }
167
  ?>
1
+ <?php
2
+ class s2_multisite {
3
+ /* === WP Multisite specific functions === */
4
+ /**
5
+ Handles subscriptions and unsubscriptions for different blogs on WPMU installs
6
+ */
7
+ function wpmu_subscribe() {
8
+ global $mysubscribe2;
9
+ // subscribe to new blog
10
+ if ( !empty($_GET['s2mu_subscribe']) ) {
11
+ $sub_id = intval($_GET['s2mu_subscribe']);
12
+ if ( $sub_id >= 0 ) {
13
+ switch_to_blog($sub_id);
14
+
15
+ $user_ID = get_current_user_id();
16
+
17
+ // if user is not a user of the current blog
18
+ if ( !is_blog_user($sub_id) ) {
19
+ // add user to current blog as subscriber
20
+ add_user_to_blog($sub_id, $user_ID, 'subscriber');
21
+ // add an action hook for external manipulation of blog and user data
22
+ do_action_ref_array('subscribe2_wpmu_subscribe', array($user_ID, $sub_id));
23
+ }
24
+
25
+ // get categories, remove excluded ones if override is off
26
+ if ( 0 == $mysubscribe2->subscribe2_options['reg_override'] ) {
27
+ $all_cats = $mysubscribe2->all_cats(true, 'ID');
28
+ } else {
29
+ $all_cats = $mysubscribe2->all_cats(false, 'ID');
30
+ }
31
+
32
+ $cats_string = '';
33
+ foreach ( $all_cats as $cat ) {
34
+ ('' == $cats_string) ? $cats_string = "$cat->term_id" : $cats_string .= ",$cat->term_id";
35
+ update_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_cat') . $cat->term_id, $cat->term_id);
36
+ }
37
+ if ( empty($cats_string) ) {
38
+ delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'));
39
+ } else {
40
+ update_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'), $cats_string);
41
+ }
42
+ }
43
+ } elseif ( !empty($_GET['s2mu_unsubscribe']) ) {
44
+ // unsubscribe from a blog
45
+ $unsub_id = intval($_GET['s2mu_unsubscribe']);
46
+ if ( $unsub_id >= 0 ) {
47
+ switch_to_blog($unsub_id);
48
+
49
+ $user_ID = get_current_user_id();
50
+
51
+ // delete subscription to all categories on that blog
52
+ $cats = get_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'), true);
53
+ $cats = explode(',', $cats);
54
+ if ( !is_array($cats) ) {
55
+ $cats = array($cats);
56
+ }
57
+
58
+ foreach ( $cats as $id ) {
59
+ delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_cat') . $id);
60
+ }
61
+ delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'));
62
+
63
+ // add an action hook for external manipulation of blog and user data
64
+ do_action_ref_array('subscribe2_wpmu_unsubscribe', array($user_ID, $unsub_id));
65
+
66
+ restore_current_blog();
67
+ }
68
+ }
69
+
70
+ if ( !is_user_member_of_blog($user_ID) ) {
71
+ $user_blogs = get_active_blog_for_user($user_ID);
72
+ if ( is_array($user_blogs) ) {
73
+ switch_to_blog(key($user_blogs));
74
+ } else {
75
+ // no longer a member of a blog
76
+ wp_redirect(get_option('siteurl')); // redirect to front page
77
+ exit(0);
78
+ }
79
+ }
80
+
81
+ // redirect to profile page
82
+ $url = get_option('siteurl') . '/wp-admin/admin.php?page=s2';
83
+ wp_redirect($url);
84
+ exit(0);
85
+ } // end wpmu_subscribe()
86
+
87
+ /**
88
+ Obtain a list of current WordPress multiuser blogs
89
+ Note this may affect performance but there is no alternative
90
+ */
91
+ function get_mu_blog_list() {
92
+ global $wpdb;
93
+ $blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );
94
+
95
+ foreach ( $blogs as $details ) {
96
+ //reindex the array so the key is the same as the blog_id
97
+ $blog_list[$details['blog_id']] = $details;
98
+ }
99
+
100
+ if ( false == is_array( $blog_list ) ) {
101
+ return array();
102
+ }
103
+
104
+ return $blog_list;
105
+ } // end get_mu_blog_list()
106
+
107
+ /**
108
+ Register user details when new user is added to a multisite blog
109
+ */
110
+ function wpmu_add_user($user_ID = 0) {
111
+ global $mysubscribe2;
112
+ if ( 0 == $user_ID ) { return; }
113
+ if ( 'yes' == $mysubscribe2->subscribe2_options['autosub'] ) {
114
+ $mysubscribe2->register($user_ID, true);
115
+ } else {
116
+ $mysubscribe2->register($user_ID, false);
117
+ }
118
+ } // end wpmu_add_user()
119
+
120
+ /**
121
+ Delete user details when a user is removed from a multisite blog
122
+ */
123
+ function wpmu_remove_user($user_ID) {
124
+ global $mysubscribe2;
125
+ if ( 0 == $user_ID ) { return; }
126
+ delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_format'));
127
+ delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_autosub'));
128
+ $cats = get_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'), true);
129
+ if ( !empty($cats) ) {
130
+ $cats = explode(',', $cats);
131
+ foreach ( $cats as $cat ) {
132
+ delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_cat') . $cat);
133
+ }
134
+ }
135
+ delete_user_meta($user_ID, $mysubscribe2->get_usermeta_keyname('s2_subscribed'));
136
+ } // end wpmu_remove_user()
137
+
138
+ /**
139
+ Rename WPMU widgets on upgrade without requiring user to re-enable
140
+ */
141
+ function namechange_subscribe2_widget() {
142
+ global $wpdb;
143
+ $blogs = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
144
+
145
+ foreach ( $blogs as $blog ) {
146
+ switch_to_blog($blog);
147
+
148
+ $sidebars = get_option('sidebars_widgets');
149
+ if ( empty($sidebars) || !is_array($sidebars) ) { return; }
150
+ $changed = false;
151
+ foreach ( $sidebars as $s =>$sidebar ) {
152
+ if ( empty($sidebar) || !is_array($sidebar) ) { break; }
153
+ foreach ( $sidebar as $w => $widget ) {
154
+ if ( $widget == 'subscribe2widget' ) {
155
+ $sidebars[$s][$w] = 'subscribe2';
156
+ $changed = true;
157
+ }
158
+ }
159
+ }
160
+ if ( $changed ) {
161
+ update_option('sidebar_widgets', $sidebars);
162
+ }
163
+ }
164
+ restore_current_blog();
165
+ } // end namechange_subscribe2_widget()
166
+ }
167
  ?>
include/options.php CHANGED
@@ -30,6 +30,10 @@ if (!isset($this->subscribe2_options['comment_subs'])) {
30
  $this->subscribe2_options['comment_subs'] = "no";
31
  } // option for commenters to subscribe as public subscribers
32
 
 
 
 
 
33
  if (!isset($this->subscribe2_options['one_click_profile'])) {
34
  $this->subscribe2_options['one_click_profile'] = "no";
35
  } // option for displaying 'one-click' option on profile page
@@ -62,6 +66,10 @@ if (!isset($this->subscribe2_options['password'])) {
62
  $this->subscribe2_options['password'] = "no";
63
  } // option for sending notifications for posts that are password protected
64
 
 
 
 
 
65
  if (!isset($this->subscribe2_options['private'])) {
66
  $this->subscribe2_options['private'] = "no";
67
  } // option for sending notifications for posts that are private
@@ -74,6 +82,10 @@ if (!isset($this->subscribe2_options['cron_order'])) {
74
  $this->subscribe2_options['cron_order'] = "desc";
75
  } // option for ordering of posts in digest email
76
 
 
 
 
 
77
  if (!isset($this->subscribe2_options['exclude'])) {
78
  $this->subscribe2_options['exclude'] = "";
79
  } // option for excluded categories
30
  $this->subscribe2_options['comment_subs'] = "no";
31
  } // option for commenters to subscribe as public subscribers
32
 
33
+ if (!isset($this->subscribe2_options['comment_def'])) {
34
+ $this->subscribe2_options['comment_def'] = "no";
35
+ } // option for comments box to be checked by default
36
+
37
  if (!isset($this->subscribe2_options['one_click_profile'])) {
38
  $this->subscribe2_options['one_click_profile'] = "no";
39
  } // option for displaying 'one-click' option on profile page
66
  $this->subscribe2_options['password'] = "no";
67
  } // option for sending notifications for posts that are password protected
68
 
69
+ if (!isset($this->subscribe2_options['stickies'])) {
70
+ $this->subscribe2_options['stickies'] = "no";
71
+ } // option for including sticky posts in digest notifications
72
+
73
  if (!isset($this->subscribe2_options['private'])) {
74
  $this->subscribe2_options['private'] = "no";
75
  } // option for sending notifications for posts that are private
82
  $this->subscribe2_options['cron_order'] = "desc";
83
  } // option for ordering of posts in digest email
84
 
85
+ if (!isset($this->subscribe2_options['compulsory'])) {
86
+ $this->subscribe2_options['compulsory'] = "";
87
+ } // option for compulsory categories
88
+
89
  if (!isset($this->subscribe2_options['exclude'])) {
90
  $this->subscribe2_options['exclude'] = "";
91
  } // option for excluded categories
include/s2_button.dev.js DELETED
@@ -1,2 +0,0 @@
1
- // version 1.0 - original version for WordPress versions less than 3.3
2
- edButtons[edButtons.length] = new edButton( 'Subscribe2', 'Subscribe2', '[subscribe2]', '', '', -1 );
 
 
include/s2_button.js CHANGED
@@ -1 +1,2 @@
1
- edButtons[edButtons.length]=new edButton('Subscribe2','Subscribe2','[subscribe2]','','',-1);
 
1
+ // version 1.0 - original version for WordPress versions less than 3.3
2
+ edButtons[edButtons.length] = new edButton('Subscribe2', 'Subscribe2', '[subscribe2]', '', '', -1);
include/s2_button.min.js ADDED
@@ -0,0 +1 @@
 
1
+ edButtons[edButtons.length]=new edButton('Subscribe2','Subscribe2','[subscribe2]','','',-1);
include/s2_button2.dev.js DELETED
@@ -1,2 +0,0 @@
1
- // version 2.0 - original version for WordPress versions 3.3 and greater
2
- QTags.addButton( 'Subscribe2', 'Subscribe2', '[subscribe2]' );
 
 
include/s2_button2.js CHANGED
@@ -1 +1,2 @@
1
- QTags.addButton('Subscribe2','Subscribe2','[subscribe2]');
 
1
+ // version 2.0 - original version for WordPress versions 3.3 and greater
2
+ QTags.addButton('Subscribe2', 'Subscribe2', '[subscribe2]');
include/s2_button2.min.js ADDED
@@ -0,0 +1 @@
 
1
+ QTags.addButton('Subscribe2','Subscribe2','[subscribe2]');
include/s2_checkbox.dev.js DELETED
@@ -1,45 +0,0 @@
1
- // version 1.0 - original version
2
- // version 1.1 - Updated with function fixes and for WordPress 3.2 / jQuery 1.6
3
- jQuery(document).ready(function(){
4
- // function to check or uncheck all when 'checkall' box it toggled
5
- jQuery('input[name="checkall"]').click(function(){
6
- var checked_status = this.checked;
7
- jQuery('input[class="' + this.value + '"]').each(function(){
8
- this.checked = checked_status;
9
- });
10
- });
11
- // function to check or uncheck 'checkall' box when individual boxes are toggled
12
- jQuery('input[class^="checkall"]').click(function(){
13
- var checked_status = true;
14
- jQuery('input[class="' + this.className + '"]').each(function(){
15
- if ((this.checked == true) && (checked_status == true)){
16
- checked_status = true;
17
- } else {
18
- checked_status = false;
19
- }
20
- // jQuery 1.6.1 introduced in WordPress 3.2
21
- // following can be simplified when WordPress 3.2 is minimum requirement
22
- if (jQuery().jquery >= '1.6'){
23
- jQuery('input[value="' + this.className + '"]').prop('checked', checked_status);
24
- } else {
25
- jQuery('input[value="' + this.className + '"]').attr('checked', checked_status);
26
- }
27
- });
28
- });
29
- // function to check or uncheck 'checkall' box when page is loaded
30
- var checked_status = true;
31
- jQuery('input[class^="checkall"]').each(function(){
32
- if ((this.checked == true) && (checked_status == true)){
33
- checked_status = true;
34
- } else {
35
- checked_status = false;
36
- }
37
- // jQuery 1.6.1 introduced in WordPress 3.2
38
- // following can be simplified when WordPress 3.2 is minimum requirement
39
- if (jQuery().jquery >= '1.6'){
40
- jQuery('input[value="' + this.className + '"]').prop('checked', checked_status);
41
- } else {
42
- jQuery('input[value="' + this.className + '"]').attr('checked', checked_status);
43
- }
44
- });
45
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
include/s2_checkbox.js CHANGED
@@ -1 +1,54 @@
1
- jQuery(document).ready(function(){jQuery('input[name="checkall"]').click(function(){var checked_status=this.checked;jQuery('input[class="'+this.value+'"]').each(function(){this.checked=checked_status})});jQuery('input[class^="checkall"]').click(function(){var checked_status=true;jQuery('input[class="'+this.className+'"]').each(function(){if((this.checked==true)&&(checked_status==true)){checked_status=true}else{checked_status=false}if(jQuery().jquery>='1.6'){jQuery('input[value="'+this.className+'"]').prop('checked',checked_status)}else{jQuery('input[value="'+this.className+'"]').attr('checked',checked_status)}})});var checked_status=true;jQuery('input[class^="checkall"]').each(function(){if((this.checked==true)&&(checked_status==true)){checked_status=true}else{checked_status=false}if(jQuery().jquery>='1.6'){jQuery('input[value="'+this.className+'"]').prop('checked',checked_status)}else{jQuery('input[value="'+this.className+'"]').attr('checked',checked_status)}})});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // version 1.0 - original version
2
+ // version 1.1 - Updated with function fixes and for WordPress 3.2 / jQuery 1.6
3
+ // version 1.2 - Update to work when DISABLED is specified for changes in version 8.5
4
+ jQuery(document).ready(function () {
5
+ // function to check or uncheck all when 'checkall' box it toggled
6
+ jQuery('input[name="checkall"]').click(function () {
7
+ var checked_status = this.checked;
8
+ jQuery('input[class="' + this.value + '"]').each(function () {
9
+ if (jQuery().jquery >= '1.6') {
10
+ if (jQuery(this).prop('disabled') === false) {
11
+ this.checked = checked_status;
12
+ }
13
+ } else {
14
+ if (jQuery(this).attr('disabled') === false) {
15
+ this.checked = checked_status;
16
+ }
17
+ }
18
+ });
19
+ });
20
+ // function to check or uncheck 'checkall' box when individual boxes are toggled
21
+ jQuery('input[class^="checkall"]').click(function () {
22
+ var checked_status = true;
23
+ jQuery('input[class="' + this.className + '"]').each(function () {
24
+ if ((this.checked === true) && (checked_status === true)) {
25
+ checked_status = true;
26
+ } else {
27
+ checked_status = false;
28
+ }
29
+ // jQuery 1.6.1 introduced in WordPress 3.2
30
+ // following can be simplified when WordPress 3.2 is minimum requirement
31
+ if (jQuery().jquery >= '1.6') {
32
+ jQuery('input[value="' + this.className + '"]').prop('checked', checked_status);
33
+ } else {
34
+ jQuery('input[value="' + this.className + '"]').attr('checked', checked_status);
35
+ }
36
+ });
37
+ });
38
+ // function to check or uncheck 'checkall' box when page is loaded
39
+ var checked_status = true;
40
+ jQuery('input[class^="checkall"]').each(function () {
41
+ if ((this.checked === true) && (checked_status === true)) {
42
+ checked_status = true;
43
+ } else {
44
+ checked_status = false;
45
+ }
46
+ // jQuery 1.6.1 introduced in WordPress 3.2
47
+ // following can be simplified when WordPress 3.2 is minimum requirement
48
+ if (jQuery().jquery >= '1.6') {
49
+ jQuery('input[value="' + this.className + '"]').prop('checked', checked_status);
50
+ } else {
51
+ jQuery('input[value="' + this.className + '"]').attr('checked', checked_status);
52
+ }
53
+ });
54
+ });
include/s2_checkbox.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){jQuery('input[name="checkall"]').click(function(){var checked_status=this.checked;jQuery('input[class="'+this.value+'"]').each(function(){if(jQuery().jquery>='1.6'){if(jQuery(this).prop('disabled')===false){this.checked=checked_status}}else{if(jQuery(this).attr('disabled')===false){this.checked=checked_status}}})});jQuery('input[class^="checkall"]').click(function(){var checked_status=true;jQuery('input[class="'+this.className+'"]').each(function(){if((this.checked===true)&&(checked_status===true)){checked_status=true}else{checked_status=false}if(jQuery().jquery>='1.6'){jQuery('input[value="'+this.className+'"]').prop('checked',checked_status)}else{jQuery('input[value="'+this.className+'"]').attr('checked',checked_status)}})});var checked_status=true;jQuery('input[class^="checkall"]').each(function(){if((this.checked===true)&&(checked_status===true)){checked_status=true}else{checked_status=false}if(jQuery().jquery>='1.6'){jQuery('input[value="'+this.className+'"]').prop('checked',checked_status)}else{jQuery('input[value="'+this.className+'"]').attr('checked',checked_status)}})});
include/s2_colorpicker.dev.js DELETED
@@ -1,46 +0,0 @@
1
- // version 1.0 - original version
2
- jQuery(document).ready(function() {
3
- var version = jQuery.fn.jquery.split('.');
4
- if (parseFloat(version[1]) < 7) {
5
- // use .live as we are on jQuery prior to 1.7
6
- jQuery('.colorpickerField').live('click', function() {
7
- if ( jQuery(this).attr('id').search("__i__") === -1 ) {
8
- var picker;
9
- var field = jQuery(this).attr('id').substr(0,20);
10
- jQuery('.s2_colorpicker').hide();
11
- jQuery('.s2_colorpicker').each(function(){
12
- if ( jQuery(this).attr('id').search(field) !== -1) {
13
- picker = jQuery(this).attr('id');
14
- }
15
- });
16
- jQuery.farbtastic('#' + picker).linkTo(this);
17
- jQuery('#' + picker).slideDown();
18
- }
19
- });
20
- } else {
21
- // use .on as we are using jQuery 1.7 and up where .live is deprecated
22
- jQuery(document).on('focus', '.colorpickerField',function(){
23
- if (jQuery(this).is('.s2_initialised') || this.id.search('__i__') !== -1) {
24
- return; // exit early, already initialized or not activated
25
- }
26
- jQuery(this).addClass('s2_initialised');
27
- var picker;
28
- var field = jQuery(this).attr('id').substr(0,20);
29
- jQuery('.s2_colorpicker').each(function() {
30
- if ( jQuery(this).attr('id').search(field) !== -1) {
31
- picker = jQuery(this).attr('id');
32
- return false; // stop looping
33
- }
34
- });
35
- jQuery(this).on('focusin', function(event) {
36
- jQuery('.s2_colorpicker').hide();
37
- jQuery.farbtastic('#' + picker).linkTo(this);
38
- jQuery('#' + picker).slideDown();
39
- });
40
- jQuery(this).on('focusout', function(event) {
41
- jQuery('#' + picker).slideUp();
42
- });
43
- jQuery(this).trigger('focus'); // retrigger focus event for plugin to work
44
- });
45
- }
46
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
include/s2_colorpicker.js CHANGED
@@ -1 +1,46 @@
1
- jQuery(document).ready(function(){var version=jQuery.fn.jquery.split('.');if(parseFloat(version[1])<7){jQuery('.colorpickerField').live('click',function(){if(jQuery(this).attr('id').search("__i__")===-1){var picker;var field=jQuery(this).attr('id').substr(0,20);jQuery('.s2_colorpicker').hide();jQuery('.s2_colorpicker').each(function(){if(jQuery(this).attr('id').search(field)!==-1){picker=jQuery(this).attr('id')}});jQuery.farbtastic('#'+picker).linkTo(this);jQuery('#'+picker).slideDown()}})}else{jQuery(document).on('focus','.colorpickerField',function(){if(jQuery(this).is('.s2_initialised')||this.id.search('__i__')!==-1){return}jQuery(this).addClass('s2_initialised');var picker;var field=jQuery(this).attr('id').substr(0,20);jQuery('.s2_colorpicker').each(function(){if(jQuery(this).attr('id').search(field)!==-1){picker=jQuery(this).attr('id');return false}});jQuery(this).on('focusin',function(event){jQuery('.s2_colorpicker').hide();jQuery.farbtastic('#'+picker).linkTo(this);jQuery('#'+picker).slideDown()});jQuery(this).on('focusout',function(event){jQuery('#'+picker).slideUp()});jQuery(this).trigger('focus')})}});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // version 1.0 - original version
2
+ jQuery(document).ready(function () {
3
+ var version = jQuery.fn.jquery.split('.');
4
+ if (parseFloat(version[1]) < 7) {
5
+ // use .live as we are on jQuery prior to 1.7
6
+ jQuery('.colorpickerField').live('click', function () {
7
+ if (jQuery(this).attr('id').search("__i__") === -1) {
8
+ var picker,
9
+ field = jQuery(this).attr('id').substr(0, 20);
10
+ jQuery('.s2_colorpicker').hide();
11
+ jQuery('.s2_colorpicker').each(function () {
12
+ if (jQuery(this).attr('id').search(field) !== -1) {
13
+ picker = jQuery(this).attr('id');
14
+ }
15
+ });
16
+ jQuery.farbtastic('#' + picker).linkTo(this);
17
+ jQuery('#' + picker).slideDown();
18
+ }
19
+ });
20
+ } else {
21
+ // use .on as we are using jQuery 1.7 and up where .live is deprecated
22
+ jQuery(document).on('focus', '.colorpickerField', function () {
23
+ if (jQuery(this).is('.s2_initialised') || this.id.search('__i__') !== -1) {
24
+ return; // exit early, already initialized or not activated
25
+ }
26
+ jQuery(this).addClass('s2_initialised');
27
+ var picker,
28
+ field = jQuery(this).attr('id').substr(0, 20);
29
+ jQuery('.s2_colorpicker').each(function () {
30
+ if (jQuery(this).attr('id').search(field) !== -1) {
31
+ picker = jQuery(this).attr('id');
32
+ return false; // stop looping
33
+ }
34
+ });
35
+ jQuery(this).on('focusin', function (event) {
36
+ jQuery('.s2_colorpicker').hide();
37
+ jQuery.farbtastic('#' + picker).linkTo(this);
38
+ jQuery('#' + picker).slideDown();
39
+ });
40
+ jQuery(this).on('focusout', function (event) {
41
+ jQuery('#' + picker).slideUp();
42
+ });
43
+ jQuery(this).trigger('focus'); // retrigger focus event for plugin to work
44
+ });
45
+ }
46
+ });
include/s2_colorpicker.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){var version=jQuery.fn.jquery.split('.');if(parseFloat(version[1])<7){jQuery('.colorpickerField').live('click',function(){if(jQuery(this).attr('id').search("__i__")===-1){var picker,field=jQuery(this).attr('id').substr(0,20);jQuery('.s2_colorpicker').hide();jQuery('.s2_colorpicker').each(function(){if(jQuery(this).attr('id').search(field)!==-1){picker=jQuery(this).attr('id')}});jQuery.farbtastic('#'+picker).linkTo(this);jQuery('#'+picker).slideDown()}})}else{jQuery(document).on('focus','.colorpickerField',function(){if(jQuery(this).is('.s2_initialised')||this.id.search('__i__')!==-1){return}jQuery(this).addClass('s2_initialised');var picker,field=jQuery(this).attr('id').substr(0,20);jQuery('.s2_colorpicker').each(function(){if(jQuery(this).attr('id').search(field)!==-1){picker=jQuery(this).attr('id');return false}});jQuery(this).on('focusin',function(event){jQuery('.s2_colorpicker').hide();jQuery.farbtastic('#'+picker).linkTo(this);jQuery('#'+picker).slideDown()});jQuery(this).on('focusout',function(event){jQuery('#'+picker).slideUp()});jQuery(this).trigger('focus')})}});
include/s2_edit.dev.js DELETED
@@ -1,34 +0,0 @@
1
- jQuery(document).ready(function() {
2
- // hide our span before page loads
3
- jQuery('#s2bcc_2').hide();
4
- jQuery('#s2page_2').hide();
5
- jQuery('#s2entries_2').hide();
6
- });
7
-
8
- //show span on clicking the edit link
9
- function s2_show(id) {
10
- jQuery('#s2'+id+'_2').show();
11
- jQuery('#s2'+id+'_1').hide();
12
- return false;
13
- };
14
-
15
- // hide span on clicking the hide link
16
- function s2_hide(id) {
17
- jQuery('#s2'+id+'_1').show();
18
- jQuery('#s2'+id+'_2').hide();
19
- return false;
20
- };
21
-
22
- function s2_update(id) {
23
- var input = jQuery('input[name="'+id+'"]').val();
24
- jQuery('input[name="'+id+'"]').val(input);
25
- jQuery('#s2'+id).html(input);
26
- s2_hide(id);
27
- };
28
-
29
- function s2_revert(id) {
30
- var option = jQuery('#js'+id).val();
31
- jQuery('input[name="'+id+'"]').val(option);
32
- jQuery('#s2'+id).html(option);
33
- s2_hide(id);
34
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
include/s2_edit.js CHANGED
@@ -1 +1,35 @@
1
- jQuery(document).ready(function(){jQuery('#s2bcc_2').hide();jQuery('#s2page_2').hide();jQuery('#s2entries_2').hide()});function s2_show(id){jQuery('#s2'+id+'_2').show();jQuery('#s2'+id+'_1').hide();return false};function s2_hide(id){jQuery('#s2'+id+'_1').show();jQuery('#s2'+id+'_2').hide();return false};function s2_update(id){var input=jQuery('input[name="'+id+'"]').val();jQuery('input[name="'+id+'"]').val(input);jQuery('#s2'+id).html(input);s2_hide(id)};function s2_revert(id){var option=jQuery('#js'+id).val();jQuery('input[name="'+id+'"]').val(option);jQuery('#s2'+id).html(option);s2_hide(id)};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Version 1.0 - original version
2
+ jQuery(document).ready(function () {
3
+ // hide our span before page loads
4
+ jQuery('#s2bcc_2').hide();
5
+ jQuery('#s2page_2').hide();
6
+ jQuery('#s2entries_2').hide();
7
+ });
8
+
9
+ //show span on clicking the edit link
10
+ function s2_show(id) {
11
+ jQuery('#s2' + id + '_2').show();
12
+ jQuery('#s2' + id + '_1').hide();
13
+ return false;
14
+ }
15
+
16
+ // hide span on clicking the hide link
17
+ function s2_hide(id) {
18
+ jQuery('#s2' + id + '_1').show();
19
+ jQuery('#s2' + id + '_2').hide();
20
+ return false;
21
+ }
22
+
23
+ function s2_update(id) {
24
+ var input = jQuery('input[name="' + id + '"]').val();
25
+ jQuery('input[name="' + id + '"]').val(input);
26
+ jQuery('#s2' + id).html(input);
27
+ s2_hide(id);
28
+ }
29
+
30
+ function s2_revert(id) {
31
+ var option = jQuery('#js' + id).val();
32
+ jQuery('input[name="' + id + '"]').val(option);
33
+ jQuery('#s2' + id).html(option);
34
+ s2_hide(id);
35
+ }
include/s2_edit.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){jQuery('#s2bcc_2').hide();jQuery('#s2page_2').hide();jQuery('#s2entries_2').hide()});function s2_show(id){jQuery('#s2'+id+'_2').show();jQuery('#s2'+id+'_1').hide();return false}function s2_hide(id){jQuery('#s2'+id+'_1').show();jQuery('#s2'+id+'_2').hide();return false}function s2_update(id){var input=jQuery('input[name="'+id+'"]').val();jQuery('input[name="'+id+'"]').val(input);jQuery('#s2'+id).html(input);s2_hide(id)}function s2_revert(id){var option=jQuery('#js'+id).val();jQuery('input[name="'+id+'"]').val(option);jQuery('#s2'+id).html(option);s2_hide(id)}
include/widget.php CHANGED
@@ -108,7 +108,7 @@ class S2_Form_widget extends WP_Widget {
108
  }
109
  echo "</label></p>\r\n";
110
  echo "<p><label for=\"" . $this->get_field_name('postto') . "\">" . __('Post form content to page', 'subscribe2') . ":\r\n";
111
- echo "<select id=\"" . $this->get_field_id('postto') . "\" name=\"" . $this->get_field_name('postto') . "\">\r\n";
112
  global $mysubscribe2;
113
  echo "<option value=\"" . $mysubscribe2->subscribe2_options['s2page'] . "\">" . __('Use Subscribe2 Default', 'subscribe2') . "</option>\r\n";
114
  echo "<option value=\"home\"";
108
  }
109
  echo "</label></p>\r\n";
110
  echo "<p><label for=\"" . $this->get_field_name('postto') . "\">" . __('Post form content to page', 'subscribe2') . ":\r\n";
111
+ echo "<select class=\"widefat\" id=\"" . $this->get_field_id('postto') . "\" name=\"" . $this->get_field_name('postto') . "\">\r\n";
112
  global $mysubscribe2;
113
  echo "<option value=\"" . $mysubscribe2->subscribe2_options['s2page'] . "\">" . __('Use Subscribe2 Default', 'subscribe2') . "</option>\r\n";
114
  echo "<option value=\"home\"";
screenshot-4.png CHANGED
Binary file
subscribe2.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Subscribe2
4
  Plugin URI: http://subscribe2.wordpress.com
5
  Description: Notifies an email list when new entries are posted.
6
- Version: 8.4
7
  Author: Matthew Robinson
8
  Author URI: http://subscribe2.wordpress.com
9
  Licence: GPL3
@@ -43,7 +43,7 @@ if ( version_compare($GLOBALS['wp_version'], '3.1', '<') || !function_exists( 'a
43
 
44
  // our version number. Don't touch this or any line below
45
  // unless you know exactly what you are doing
46
- define( 'S2VERSION', '8.3' );
47
  define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
48
  define( 'S2DIR', trailingslashit(dirname(plugin_basename(__FILE__))) );
49
  define( 'S2URL', plugin_dir_url(dirname(__FILE__)) . S2DIR );
3
  Plugin Name: Subscribe2
4
  Plugin URI: http://subscribe2.wordpress.com
5
  Description: Notifies an email list when new entries are posted.
6
+ Version: 8.5
7
  Author: Matthew Robinson
8
  Author URI: http://subscribe2.wordpress.com
9
  Licence: GPL3
43
 
44
  // our version number. Don't touch this or any line below
45
  // unless you know exactly what you are doing
46
+ define( 'S2VERSION', '8.5' );
47
  define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
48
  define( 'S2DIR', trailingslashit(dirname(plugin_basename(__FILE__))) );
49
  define( 'S2URL', plugin_dir_url(dirname(__FILE__)) . S2DIR );
subscribe2.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2012-06-23 21:30+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"
@@ -49,421 +49,441 @@ msgstr ""
49
  msgid "Send"
50
  msgstr ""
51
 
52
- #: admin/settings.php:18
53
- msgid ""
54
- "You appear to be sending notifications from an email address from a "
55
- "different domain name to your blog, this may result in failed emails"
56
- msgstr ""
57
-
58
- #: admin/settings.php:36
59
  msgid "Preview message(s) sent to logged in user"
60
  msgstr ""
61
 
62
- #: admin/settings.php:40
63
  msgid ""
64
  "The Digest Notification email contained no post information. No email was "
65
  "sent"
66
  msgstr ""
67
 
68
- #: admin/settings.php:42
69
  msgid "Attempt made to resend the Digest Notification email"
70
  msgstr ""
71
 
72
- #: admin/settings.php:211
73
- msgid "Subscribe2 Settings"
 
 
74
  msgstr ""
75
 
76
  #: admin/settings.php:212
77
- msgid "Plugin Blog"
78
  msgstr ""
79
 
80
  #: admin/settings.php:213
 
 
 
 
81
  msgid "Make a donation via PayPal"
82
  msgstr ""
83
 
84
- #: admin/settings.php:225 admin/your_subscriptions.php:96
85
  msgid "Notification Settings"
86
  msgstr ""
87
 
88
- #: admin/settings.php:226
89
  msgid "Restrict the number of recipients per email to (0 for unlimited)"
90
  msgstr ""
91
 
92
- #: admin/settings.php:228 admin/settings.php:376
93
  msgid "Edit"
94
  msgstr ""
95
 
96
- #: admin/settings.php:231 admin/settings.php:379
97
  msgid "Update"
98
  msgstr ""
99
 
100
- #: admin/settings.php:232 admin/settings.php:380
101
  msgid "Revert"
102
  msgstr ""
103
 
104
- #: admin/settings.php:234
105
  msgid "Send Admins notifications for new"
106
  msgstr ""
107
 
108
- #: admin/settings.php:236
109
  msgid "Subscriptions"
110
  msgstr ""
111
 
112
- #: admin/settings.php:238
113
  msgid "Unsubscriptions"
114
  msgstr ""
115
 
116
- #: admin/settings.php:240
117
  msgid "Both"
118
  msgstr ""
119
 
120
- #: admin/settings.php:242
121
  msgid "Neither"
122
  msgstr ""
123
 
124
- #: admin/settings.php:244
125
  msgid "Include theme CSS stylesheet in HTML notifications"
126
  msgstr ""
127
 
128
- #: admin/settings.php:246 admin/settings.php:252 admin/settings.php:266
129
- #: admin/settings.php:271 admin/settings.php:421 admin/settings.php:426
130
- #: admin/settings.php:440 admin/settings.php:447 admin/settings.php:459
131
- #: admin/subscribers.php:339 admin/your_subscriptions.php:121
132
- #: admin/your_subscriptions.php:161
133
  msgid "Yes"
134
  msgstr ""
135
 
136
- #: admin/settings.php:248 admin/settings.php:254 admin/settings.php:268
137
- #: admin/settings.php:273 admin/settings.php:418 admin/settings.php:423
138
- #: admin/settings.php:428 admin/settings.php:442 admin/settings.php:449
139
- #: admin/settings.php:456 admin/settings.php:461 admin/subscribers.php:341
 
140
  #: admin/your_subscriptions.php:123 admin/your_subscriptions.php:165
141
  msgid "No"
142
  msgstr ""
143
 
144
- #: admin/settings.php:250
145
  msgid "Send Emails for Pages"
146
  msgstr ""
147
 
148
- #: admin/settings.php:258
149
  msgid ""
150
  "Subscribe2 will send email notifications for the following custom post types"
151
  msgstr ""
152
 
153
- #: admin/settings.php:264
154
  msgid "Send Emails for Password Protected Posts"
155
  msgstr ""
156
 
157
- #: admin/settings.php:269
158
  msgid "Send Emails for Private Posts"
159
  msgstr ""
160
 
161
- #: admin/settings.php:274
 
 
 
 
162
  msgid "Send Email From"
163
  msgstr ""
164
 
165
- #: admin/settings.php:279
166
  msgid "Send Emails"
167
  msgstr ""
168
 
169
- #: admin/settings.php:281
170
  msgid "For digest notifications, date order for posts is"
171
  msgstr ""
172
 
173
- #: admin/settings.php:283
174
  msgid "Descending"
175
  msgstr ""
176
 
177
- #: admin/settings.php:285
178
  msgid "Ascending"
179
  msgstr ""
180
 
181
- #: admin/settings.php:287
182
  msgid "Add Tracking Parameters to the Permalink"
183
  msgstr ""
184
 
185
- #: admin/settings.php:289
186
- msgid "eg. utm_source=subscribe2&utm_medium=email&utm_campaign=postnotify"
 
 
187
  msgstr ""
188
 
189
- #: admin/settings.php:294
190
  msgid "Email Templates"
191
  msgstr ""
192
 
193
- #: admin/settings.php:298
194
  msgid "New Post email (must not be empty)"
195
  msgstr ""
196
 
197
- #: admin/settings.php:299 admin/settings.php:329 admin/settings.php:334
198
  msgid "Subject Line"
199
  msgstr ""
200
 
201
- #: admin/settings.php:304
202
  msgid "Send Email Preview"
203
  msgstr ""
204
 
205
- #: admin/settings.php:305
206
  msgid "Message substitutions"
207
  msgstr ""
208
 
209
- #: admin/settings.php:307
210
  msgid ""
211
  "IF THE FOLLOWING KEYWORDS ARE ALSO IN YOUR POST THEY WILL BE SUBSTITUTED"
212
  msgstr ""
213
 
214
- #: admin/settings.php:310
215
  msgid "the post's title<br />(<i>for per-post emails only</i>)"
216
  msgstr ""
217
 
218
- #: admin/settings.php:311
219
  msgid ""
220
  "the excerpt or the entire post<br />(<i>based on the subscriber's "
221
  "preferences</i>)"
222
  msgstr ""
223
 
224
- #: admin/settings.php:312
225
  msgid ""
226
  "the excerpt of the post and the time it was posted<br />(<i>for digest "
227
  "emails only</i>)"
228
  msgstr ""
229
 
230
- #: admin/settings.php:313
231
  msgid "a list of post titles<br />(<i>for digest emails only</i>)"
232
  msgstr ""
233
 
234
- #: admin/settings.php:314
235
  msgid ""
236
  "a list of post titles followed by links to the atricles<br />(<i>for digest "
237
  "emails only</i>)"
238
  msgstr ""
239
 
240
- #: admin/settings.php:315
241
  msgid "the post's permalink<br />(<i>for per-post emails only</i>)"
242
  msgstr ""
243
 
244
- #: admin/settings.php:316
245
  msgid ""
246
  "the post's permalink after conversion by TinyURL<br />(<i>for per-post "
247
  "emails only</i>)"
248
  msgstr ""
249
 
250
- #: admin/settings.php:317
251
  msgid "the date the post was made<br />(<i>for per-post emails only</i>)"
252
  msgstr ""
253
 
254
- #: admin/settings.php:318
255
  msgid "the time the post was made<br />(<i>for per-post emails only</i>)"
256
  msgstr ""
257
 
258
- #: admin/settings.php:319
259
  msgid "the admin or post author's name"
260
  msgstr ""
261
 
262
- #: admin/settings.php:320
263
  msgid "the admin or post author's email"
264
  msgstr ""
265
 
266
- #: admin/settings.php:321
267
  msgid "the post author's name"
268
  msgstr ""
269
 
270
- #: admin/settings.php:322
271
  msgid ""
272
  "the generated link to confirm a request<br />(<i>only used in the "
273
  "confirmation email template</i>)"
274
  msgstr ""
275
 
276
- #: admin/settings.php:323
277
  msgid ""
278
  "Action performed by LINK in confirmation email<br />(<i>only used in the "
279
  "confirmation email template</i>)"
280
  msgstr ""
281
 
282
- #: admin/settings.php:324
283
  msgid "the post's assigned categories"
284
  msgstr ""
285
 
286
- #: admin/settings.php:325
287
  msgid "the post's assigned Tags"
288
  msgstr ""
289
 
290
- #: admin/settings.php:326
291
  msgid ""
292
  "the number of posts included in the digest email<br />(<i>for digest emails "
293
  "only</i>)"
294
  msgstr ""
295
 
296
- #: admin/settings.php:328
297
  msgid "Subscribe / Unsubscribe confirmation email"
298
  msgstr ""
299
 
300
- #: admin/settings.php:333
301
  msgid "Reminder email to Unconfirmed Subscribers"
302
  msgstr ""
303
 
304
- #: admin/settings.php:342
 
 
 
 
 
 
 
 
 
305
  msgid "Excluded Categories"
306
  msgstr ""
307
 
308
- #: admin/settings.php:344
309
  msgid ""
310
  "Posts assigned to any Excluded Category do not generate notifications and "
311
  "are not included in digest notifications"
312
  msgstr ""
313
 
314
- #: admin/settings.php:348
315
  msgid "Allow registered users to subscribe to excluded categories?"
316
  msgstr ""
317
 
318
- #: admin/settings.php:354
319
  msgid "Excluded Formats"
320
  msgstr ""
321
 
322
- #: admin/settings.php:356
323
  msgid ""
324
  "Posts assigned to any Excluded Format do not generate notifications and are "
325
  "not included in digest notifications"
326
  msgstr ""
327
 
328
- #: admin/settings.php:364
329
  msgid "Appearance"
330
  msgstr ""
331
 
332
- #: admin/settings.php:368
333
  msgid "Set default Subscribe2 page as ID"
334
  msgstr ""
335
 
336
- #: admin/settings.php:374
337
  msgid "Set the number of Subscribers displayed per page"
338
  msgstr ""
339
 
340
- #: admin/settings.php:384
341
  msgid "Show a link to your subscription page in \"meta\"?"
342
  msgstr ""
343
 
344
- #: admin/settings.php:388
345
  msgid "Show the Subscribe2 button on the Write toolbar?"
346
  msgstr ""
347
 
348
- #: admin/settings.php:392
349
  msgid "Enable AJAX style subscription form?"
350
  msgstr ""
351
 
352
- #: admin/settings.php:396
353
  msgid "Enable Subscribe2 Widget?"
354
  msgstr ""
355
 
356
- #: admin/settings.php:400
357
  msgid "Enable Subscribe2 Counter Widget?"
358
  msgstr ""
359
 
360
- #: admin/settings.php:404
361
  msgid "Disable email notifications is checked by default on authoring pages?"
362
  msgstr ""
363
 
364
- #: admin/settings.php:410
365
  msgid "Auto Subscribe"
366
  msgstr ""
367
 
368
- #: admin/settings.php:412
369
  msgid "Subscribe new users registering with your blog"
370
  msgstr ""
371
 
372
- #: admin/settings.php:414
373
  msgid "Automatically"
374
  msgstr ""
375
 
376
- #: admin/settings.php:416
377
  msgid "Display option on Registration Form"
378
  msgstr ""
379
 
380
- #: admin/settings.php:419
381
  msgid "Auto-subscribe includes any excluded categories"
382
  msgstr ""
383
 
384
- #: admin/settings.php:424
385
  msgid "Registration Form option is checked by default"
386
  msgstr ""
387
 
388
- #: admin/settings.php:429
389
  msgid "Auto-subscribe users to receive email as"
390
  msgstr ""
391
 
392
- #: admin/settings.php:431 admin/subscribers.php:329
393
  #: admin/your_subscriptions.php:110
394
  msgid "HTML - Full"
395
  msgstr ""
396
 
397
- #: admin/settings.php:433 admin/subscribers.php:330
398
  #: admin/your_subscriptions.php:112
399
  msgid "HTML - Excerpt"
400
  msgstr ""
401
 
402
- #: admin/settings.php:435 admin/subscribers.php:331
403
  #: admin/your_subscriptions.php:114
404
  msgid "Plain Text - Full"
405
  msgstr ""
406
 
407
- #: admin/settings.php:437 admin/subscribers.php:332
408
  #: admin/your_subscriptions.php:116
409
  msgid "Plain Text - Excerpt"
410
  msgstr ""
411
 
412
- #: admin/settings.php:438
413
  msgid "Registered Users have the option to auto-subscribe to new categories"
414
  msgstr ""
415
 
416
- #: admin/settings.php:444
417
  msgid "New categories are immediately excluded"
418
  msgstr ""
419
 
420
- #: admin/settings.php:445
421
  msgid ""
422
  "Option for Registered Users to auto-subscribe to new categories is checked "
423
  "by default"
424
  msgstr ""
425
 
426
- #: admin/settings.php:450
427
  msgid "Display checkbox to allow subscriptions from the comment form"
428
  msgstr ""
429
 
430
- #: admin/settings.php:452
431
  msgid "Before the Comment Submit button"
432
  msgstr ""
433
 
434
- #: admin/settings.php:454
435
  msgid "After the Comment Submit button"
436
  msgstr ""
437
 
438
- #: admin/settings.php:457
 
 
 
 
439
  msgid "Show one-click subscription on profile page"
440
  msgstr ""
441
 
442
- #: admin/settings.php:466
443
  msgid "Barred Domains"
444
  msgstr ""
445
 
446
- #: admin/settings.php:468
447
  msgid ""
448
  "Enter domains to bar from public subscriptions: <br /> (Use a new line for "
449
  "each entry and omit the \"@\" symbol, for example email.com)"
450
  msgstr ""
451
 
452
- #: admin/settings.php:474
453
  msgid "Submit"
454
  msgstr ""
455
 
456
- #: admin/settings.php:477
457
  msgid "Reset Default"
458
  msgstr ""
459
 
460
- #: admin/settings.php:478
461
  msgid ""
462
  "Use this to reset all options to their defaults. This <strong><em>will not</"
463
  "em></strong> modify your list of subscribers."
464
  msgstr ""
465
 
466
- #: admin/settings.php:480
467
  msgid "RESET"
468
  msgstr ""
469
 
@@ -580,7 +600,7 @@ msgid "Delete this email address"
580
  msgstr ""
581
 
582
  #: admin/subscribers.php:272 classes/class-s2-admin.php:204
583
- #: classes/class-s2-admin.php:250 classes/class-s2-admin.php:290
584
  msgid "Select / Unselect All"
585
  msgstr ""
586
 
@@ -739,87 +759,87 @@ msgid ""
739
  "Check here to disable sending of an email notification for this post/page"
740
  msgstr ""
741
 
742
- #: classes/class-s2-admin.php:342
743
  msgid "All Users and Subscribers"
744
  msgstr ""
745
 
746
- #: classes/class-s2-admin.php:343
747
  msgid "Public Subscribers"
748
  msgstr ""
749
 
750
- #: classes/class-s2-admin.php:344
751
  msgid "Confirmed"
752
  msgstr ""
753
 
754
- #: classes/class-s2-admin.php:345
755
  msgid "Unconfirmed"
756
  msgstr ""
757
 
758
- #: classes/class-s2-admin.php:346
759
  msgid "All Registered Users"
760
  msgstr ""
761
 
762
- #: classes/class-s2-admin.php:347
763
  msgid "Registered Subscribers"
764
  msgstr ""
765
 
766
- #: classes/class-s2-admin.php:433
767
  msgid "Post Author"
768
  msgstr ""
769
 
770
- #: classes/class-s2-admin.php:457
771
  msgid ""
772
  "The WordPress cron functions may be disabled on this server. Digest "
773
  "notifications may not work."
774
  msgstr ""
775
 
776
- #: classes/class-s2-admin.php:461
777
  msgid "For each Post"
778
  msgstr ""
779
 
780
- #: classes/class-s2-admin.php:475
781
- msgid "Send Digest Notification at"
782
  msgstr ""
783
 
784
- #: classes/class-s2-admin.php:487
785
  msgid ""
786
- "This option will be ignored if the time selected is not in the future in "
787
- "relation to the current time"
788
  msgstr ""
789
 
790
- #: classes/class-s2-admin.php:490
791
  msgid "Current UTC time is"
792
  msgstr ""
793
 
794
- #: classes/class-s2-admin.php:492
795
  msgid "Current blog time is"
796
  msgstr ""
797
 
798
- #: classes/class-s2-admin.php:494
799
  msgid "Next email notification will be sent when your blog time is after"
800
  msgstr ""
801
 
802
- #: classes/class-s2-admin.php:497
803
  msgid "Attempt to resend the last Digest Notification email"
804
  msgstr ""
805
 
806
- #: classes/class-s2-admin.php:498
807
  msgid "Resend Digest"
808
  msgstr ""
809
 
810
- #: classes/class-s2-admin.php:721
811
  msgid "Email subscription"
812
  msgstr ""
813
 
814
- #: classes/class-s2-admin.php:723
815
  msgid "Subscribe / Unsubscribe"
816
  msgstr ""
817
 
818
- #: classes/class-s2-admin.php:724
819
  msgid "Receive notifications"
820
  msgstr ""
821
 
822
- #: classes/class-s2-admin.php:725
823
  msgid ""
824
  "Check if you want to receive email notification when new posts are published"
825
  msgstr ""
@@ -912,113 +932,113 @@ msgstr ""
912
  msgid "Options reset!"
913
  msgstr ""
914
 
915
- #: classes/class-s2-core.php:635
916
  msgid "Plain Text Excerpt Preview"
917
  msgstr ""
918
 
919
- #: classes/class-s2-core.php:637
920
  msgid "Plain Text Full Preview"
921
  msgstr ""
922
 
923
- #: classes/class-s2-core.php:639
924
  msgid "HTML Excerpt Preview"
925
  msgstr ""
926
 
927
- #: classes/class-s2-core.php:641
928
  msgid "HTML Full Preview"
929
  msgstr ""
930
 
931
- #: classes/class-s2-core.php:1228
932
  msgid "Registered User"
933
  msgstr ""
934
 
935
- #: classes/class-s2-core.php:1233
936
  msgid "Confirmed Public Subscriber"
937
  msgstr ""
938
 
939
- #: classes/class-s2-core.php:1235
940
  msgid "Unconfirmed Public Subscriber"
941
  msgstr ""
942
 
943
- #: classes/class-s2-core.php:1272
944
  msgid "Check here to Subscribe to email notifications for new posts"
945
  msgstr ""
946
 
947
- #: classes/class-s2-core.php:1278
948
  msgid ""
949
  "By registering with this blog you are also agreeing to receive email "
950
  "notifications for new posts but you can unsubscribe at anytime"
951
  msgstr ""
952
 
953
- #: classes/class-s2-core.php:1304
954
  msgid "Check here to Subscribe to notifications for new posts"
955
  msgstr ""
956
 
957
- #: classes/class-s2-core.php:1394
958
  msgid "Weekly"
959
  msgstr ""
960
 
961
- #: classes/class-s2-core.php:1517 classes/class-s2-core.php:1518
962
  msgid "Author"
963
  msgstr ""
964
 
965
- #: classes/class-s2-core.php:1526
966
  msgid "Posted on"
967
  msgstr ""
968
 
969
- #: classes/class-s2-core.php:1530 classes/class-s2-core.php:1531
970
  msgid "Posted in"
971
  msgstr ""
972
 
973
- #: classes/class-s2-core.php:1536 classes/class-s2-core.php:1537
974
  msgid "Tagged as"
975
  msgstr ""
976
 
977
- #: classes/class-s2-core.php:1601
978
  msgid "Digest Email"
979
  msgstr ""
980
 
981
- #: classes/class-s2-core.php:1611
982
  msgid "Digest Preview"
983
  msgstr ""
984
 
985
- #: classes/class-s2-frontend.php:46 classes/class-s2-frontend.php:48
986
- msgid "Your email:"
987
  msgstr ""
988
 
989
- #: classes/class-s2-frontend.php:48
990
- msgid "Enter email address..."
991
  msgstr ""
992
 
993
- #: classes/class-s2-frontend.php:156
994
  msgid "Subscription Confirmation"
995
  msgstr ""
996
 
997
- #: classes/class-s2-frontend.php:158
998
  msgid "Unsubscription Confirmation"
999
  msgstr ""
1000
 
1001
- #: classes/class-s2-frontend.php:197
1002
  msgid "New Subscription"
1003
  msgstr ""
1004
 
1005
- #: classes/class-s2-frontend.php:199
1006
  msgid "subscribed to email notifications!"
1007
  msgstr ""
1008
 
1009
- #: classes/class-s2-frontend.php:220
1010
  msgid "New Unsubscription"
1011
  msgstr ""
1012
 
1013
- #: classes/class-s2-frontend.php:222
1014
  msgid "unsubscribed from email notifications!"
1015
  msgstr ""
1016
 
1017
- #: classes/class-s2-frontend.php:248
1018
  msgid "[Un]Subscribe to Posts"
1019
  msgstr ""
1020
 
1021
- #: classes/class-s2-frontend.php:272 classes/class-s2-frontend.php:274
1022
  msgid "Subscribe to this blog"
1023
  msgstr ""
1024
 
@@ -1062,7 +1082,7 @@ msgstr ""
1062
  msgid "Font"
1063
  msgstr ""
1064
 
1065
- #: include/options.php:126
1066
  msgid ""
1067
  "{BLOGNAME} has posted a new item, '{TITLE}'\n"
1068
  "\n"
@@ -1078,7 +1098,7 @@ msgid ""
1078
  "{EMAIL}"
1079
  msgstr ""
1080
 
1081
- #: include/options.php:134
1082
  msgid ""
1083
  "{BLOGNAME} has received a request to {ACTION} for this email address. To "
1084
  "complete your request please click on the link below:\n"
@@ -1091,11 +1111,11 @@ msgid ""
1091
  "{MYNAME}."
1092
  msgstr ""
1093
 
1094
- #: include/options.php:138
1095
  msgid "Please confirm your request"
1096
  msgstr ""
1097
 
1098
- #: include/options.php:142
1099
  msgid ""
1100
  "This email address was subscribed for notifications at {BLOGNAME} "
1101
  "({BLOGLINK}) but the subscription remains incomplete.\n"
@@ -1111,7 +1131,7 @@ msgid ""
1111
  "{MYNAME}"
1112
  msgstr ""
1113
 
1114
- #: include/options.php:146
1115
  msgid "Subscription Reminder"
1116
  msgstr ""
1117
 
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: \n"
11
+ "POT-Creation-Date: 2012-09-10 20:44+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"
49
  msgid "Send"
50
  msgstr ""
51
 
52
+ #: admin/settings.php:24
 
 
 
 
 
 
53
  msgid "Preview message(s) sent to logged in user"
54
  msgstr ""
55
 
56
+ #: admin/settings.php:28
57
  msgid ""
58
  "The Digest Notification email contained no post information. No email was "
59
  "sent"
60
  msgstr ""
61
 
62
+ #: admin/settings.php:30
63
  msgid "Attempt made to resend the Digest Notification email"
64
  msgstr ""
65
 
66
+ #: admin/settings.php:206
67
+ msgid ""
68
+ "You appear to be sending notifications from an email address from a "
69
+ "different domain name to your blog, this may result in failed emails"
70
  msgstr ""
71
 
72
  #: admin/settings.php:212
73
+ msgid "Subscribe2 Settings"
74
  msgstr ""
75
 
76
  #: admin/settings.php:213
77
+ msgid "Plugin Blog"
78
+ msgstr ""
79
+
80
+ #: admin/settings.php:214
81
  msgid "Make a donation via PayPal"
82
  msgstr ""
83
 
84
+ #: admin/settings.php:226 admin/your_subscriptions.php:96
85
  msgid "Notification Settings"
86
  msgstr ""
87
 
88
+ #: admin/settings.php:227
89
  msgid "Restrict the number of recipients per email to (0 for unlimited)"
90
  msgstr ""
91
 
92
+ #: admin/settings.php:229 admin/settings.php:393
93
  msgid "Edit"
94
  msgstr ""
95
 
96
+ #: admin/settings.php:232 admin/settings.php:396
97
  msgid "Update"
98
  msgstr ""
99
 
100
+ #: admin/settings.php:233 admin/settings.php:397
101
  msgid "Revert"
102
  msgstr ""
103
 
104
+ #: admin/settings.php:235
105
  msgid "Send Admins notifications for new"
106
  msgstr ""
107
 
108
+ #: admin/settings.php:237
109
  msgid "Subscriptions"
110
  msgstr ""
111
 
112
+ #: admin/settings.php:239
113
  msgid "Unsubscriptions"
114
  msgstr ""
115
 
116
+ #: admin/settings.php:241
117
  msgid "Both"
118
  msgstr ""
119
 
120
+ #: admin/settings.php:243
121
  msgid "Neither"
122
  msgstr ""
123
 
124
+ #: admin/settings.php:245
125
  msgid "Include theme CSS stylesheet in HTML notifications"
126
  msgstr ""
127
 
128
+ #: admin/settings.php:247 admin/settings.php:253 admin/settings.php:267
129
+ #: admin/settings.php:272 admin/settings.php:277 admin/settings.php:438
130
+ #: admin/settings.php:443 admin/settings.php:457 admin/settings.php:464
131
+ #: admin/settings.php:476 admin/settings.php:481 admin/subscribers.php:339
132
+ #: admin/your_subscriptions.php:121 admin/your_subscriptions.php:161
133
  msgid "Yes"
134
  msgstr ""
135
 
136
+ #: admin/settings.php:249 admin/settings.php:255 admin/settings.php:269
137
+ #: admin/settings.php:274 admin/settings.php:279 admin/settings.php:435
138
+ #: admin/settings.php:440 admin/settings.php:445 admin/settings.php:459
139
+ #: admin/settings.php:466 admin/settings.php:473 admin/settings.php:478
140
+ #: admin/settings.php:483 admin/subscribers.php:341
141
  #: admin/your_subscriptions.php:123 admin/your_subscriptions.php:165
142
  msgid "No"
143
  msgstr ""
144
 
145
+ #: admin/settings.php:251
146
  msgid "Send Emails for Pages"
147
  msgstr ""
148
 
149
+ #: admin/settings.php:259
150
  msgid ""
151
  "Subscribe2 will send email notifications for the following custom post types"
152
  msgstr ""
153
 
154
+ #: admin/settings.php:265
155
  msgid "Send Emails for Password Protected Posts"
156
  msgstr ""
157
 
158
+ #: admin/settings.php:270
159
  msgid "Send Emails for Private Posts"
160
  msgstr ""
161
 
162
+ #: admin/settings.php:275
163
+ msgid "Include Sticky Posts at the top of all Digest Notifications"
164
+ msgstr ""
165
+
166
+ #: admin/settings.php:280
167
  msgid "Send Email From"
168
  msgstr ""
169
 
170
+ #: admin/settings.php:285
171
  msgid "Send Emails"
172
  msgstr ""
173
 
174
+ #: admin/settings.php:287
175
  msgid "For digest notifications, date order for posts is"
176
  msgstr ""
177
 
178
+ #: admin/settings.php:289
179
  msgid "Descending"
180
  msgstr ""
181
 
182
+ #: admin/settings.php:291
183
  msgid "Ascending"
184
  msgstr ""
185
 
186
+ #: admin/settings.php:293
187
  msgid "Add Tracking Parameters to the Permalink"
188
  msgstr ""
189
 
190
+ #: admin/settings.php:295
191
+ msgid ""
192
+ "eg. utm_source=subscribe2&amp;utm_medium=email&amp;"
193
+ "utm_campaign=postnotify&amp;utm_id={ID}"
194
  msgstr ""
195
 
196
+ #: admin/settings.php:300
197
  msgid "Email Templates"
198
  msgstr ""
199
 
200
+ #: admin/settings.php:304
201
  msgid "New Post email (must not be empty)"
202
  msgstr ""
203
 
204
+ #: admin/settings.php:305 admin/settings.php:335 admin/settings.php:340
205
  msgid "Subject Line"
206
  msgstr ""
207
 
208
+ #: admin/settings.php:310
209
  msgid "Send Email Preview"
210
  msgstr ""
211
 
212
+ #: admin/settings.php:311
213
  msgid "Message substitutions"
214
  msgstr ""
215
 
216
+ #: admin/settings.php:313
217
  msgid ""
218
  "IF THE FOLLOWING KEYWORDS ARE ALSO IN YOUR POST THEY WILL BE SUBSTITUTED"
219
  msgstr ""
220
 
221
+ #: admin/settings.php:316
222
  msgid "the post's title<br />(<i>for per-post emails only</i>)"
223
  msgstr ""
224
 
225
+ #: admin/settings.php:317
226
  msgid ""
227
  "the excerpt or the entire post<br />(<i>based on the subscriber's "
228
  "preferences</i>)"
229
  msgstr ""
230
 
231
+ #: admin/settings.php:318
232
  msgid ""
233
  "the excerpt of the post and the time it was posted<br />(<i>for digest "
234
  "emails only</i>)"
235
  msgstr ""
236
 
237
+ #: admin/settings.php:319
238
  msgid "a list of post titles<br />(<i>for digest emails only</i>)"
239
  msgstr ""
240
 
241
+ #: admin/settings.php:320
242
  msgid ""
243
  "a list of post titles followed by links to the atricles<br />(<i>for digest "
244
  "emails only</i>)"
245
  msgstr ""
246
 
247
+ #: admin/settings.php:321
248
  msgid "the post's permalink<br />(<i>for per-post emails only</i>)"
249
  msgstr ""
250
 
251
+ #: admin/settings.php:322
252
  msgid ""
253
  "the post's permalink after conversion by TinyURL<br />(<i>for per-post "
254
  "emails only</i>)"
255
  msgstr ""
256
 
257
+ #: admin/settings.php:323
258
  msgid "the date the post was made<br />(<i>for per-post emails only</i>)"
259
  msgstr ""
260
 
261
+ #: admin/settings.php:324
262
  msgid "the time the post was made<br />(<i>for per-post emails only</i>)"
263
  msgstr ""
264
 
265
+ #: admin/settings.php:325
266
  msgid "the admin or post author's name"
267
  msgstr ""
268
 
269
+ #: admin/settings.php:326
270
  msgid "the admin or post author's email"
271
  msgstr ""
272
 
273
+ #: admin/settings.php:327
274
  msgid "the post author's name"
275
  msgstr ""
276
 
277
+ #: admin/settings.php:328
278
  msgid ""
279
  "the generated link to confirm a request<br />(<i>only used in the "
280
  "confirmation email template</i>)"
281
  msgstr ""
282
 
283
+ #: admin/settings.php:329
284
  msgid ""
285
  "Action performed by LINK in confirmation email<br />(<i>only used in the "
286
  "confirmation email template</i>)"
287
  msgstr ""
288
 
289
+ #: admin/settings.php:330
290
  msgid "the post's assigned categories"
291
  msgstr ""
292
 
293
+ #: admin/settings.php:331
294
  msgid "the post's assigned Tags"
295
  msgstr ""
296
 
297
+ #: admin/settings.php:332
298
  msgid ""
299
  "the number of posts included in the digest email<br />(<i>for digest emails "
300
  "only</i>)"
301
  msgstr ""
302
 
303
+ #: admin/settings.php:334
304
  msgid "Subscribe / Unsubscribe confirmation email"
305
  msgstr ""
306
 
307
+ #: admin/settings.php:339
308
  msgid "Reminder email to Unconfirmed Subscribers"
309
  msgstr ""
310
 
311
+ #: admin/settings.php:348
312
+ msgid "Complusory Categories"
313
+ msgstr ""
314
+
315
+ #: admin/settings.php:350
316
+ msgid ""
317
+ "Compulsory categories will be checked by default for Registered Subscribers"
318
+ msgstr ""
319
+
320
+ #: admin/settings.php:357
321
  msgid "Excluded Categories"
322
  msgstr ""
323
 
324
+ #: admin/settings.php:359
325
  msgid ""
326
  "Posts assigned to any Excluded Category do not generate notifications and "
327
  "are not included in digest notifications"
328
  msgstr ""
329
 
330
+ #: admin/settings.php:363
331
  msgid "Allow registered users to subscribe to excluded categories?"
332
  msgstr ""
333
 
334
+ #: admin/settings.php:371
335
  msgid "Excluded Formats"
336
  msgstr ""
337
 
338
+ #: admin/settings.php:373
339
  msgid ""
340
  "Posts assigned to any Excluded Format do not generate notifications and are "
341
  "not included in digest notifications"
342
  msgstr ""
343
 
344
+ #: admin/settings.php:381
345
  msgid "Appearance"
346
  msgstr ""
347
 
348
+ #: admin/settings.php:385
349
  msgid "Set default Subscribe2 page as ID"
350
  msgstr ""
351
 
352
+ #: admin/settings.php:391
353
  msgid "Set the number of Subscribers displayed per page"
354
  msgstr ""
355
 
356
+ #: admin/settings.php:401
357
  msgid "Show a link to your subscription page in \"meta\"?"
358
  msgstr ""
359
 
360
+ #: admin/settings.php:405
361
  msgid "Show the Subscribe2 button on the Write toolbar?"
362
  msgstr ""
363
 
364
+ #: admin/settings.php:409
365
  msgid "Enable AJAX style subscription form?"
366
  msgstr ""
367
 
368
+ #: admin/settings.php:413
369
  msgid "Enable Subscribe2 Widget?"
370
  msgstr ""
371
 
372
+ #: admin/settings.php:417
373
  msgid "Enable Subscribe2 Counter Widget?"
374
  msgstr ""
375
 
376
+ #: admin/settings.php:421
377
  msgid "Disable email notifications is checked by default on authoring pages?"
378
  msgstr ""
379
 
380
+ #: admin/settings.php:427
381
  msgid "Auto Subscribe"
382
  msgstr ""
383
 
384
+ #: admin/settings.php:429
385
  msgid "Subscribe new users registering with your blog"
386
  msgstr ""
387
 
388
+ #: admin/settings.php:431
389
  msgid "Automatically"
390
  msgstr ""
391
 
392
+ #: admin/settings.php:433
393
  msgid "Display option on Registration Form"
394
  msgstr ""
395
 
396
+ #: admin/settings.php:436
397
  msgid "Auto-subscribe includes any excluded categories"
398
  msgstr ""
399
 
400
+ #: admin/settings.php:441
401
  msgid "Registration Form option is checked by default"
402
  msgstr ""
403
 
404
+ #: admin/settings.php:446
405
  msgid "Auto-subscribe users to receive email as"
406
  msgstr ""
407
 
408
+ #: admin/settings.php:448 admin/subscribers.php:329
409
  #: admin/your_subscriptions.php:110
410
  msgid "HTML - Full"
411
  msgstr ""
412
 
413
+ #: admin/settings.php:450 admin/subscribers.php:330
414
  #: admin/your_subscriptions.php:112
415
  msgid "HTML - Excerpt"
416
  msgstr ""
417
 
418
+ #: admin/settings.php:452 admin/subscribers.php:331
419
  #: admin/your_subscriptions.php:114
420
  msgid "Plain Text - Full"
421
  msgstr ""
422
 
423
+ #: admin/settings.php:454 admin/subscribers.php:332
424
  #: admin/your_subscriptions.php:116
425
  msgid "Plain Text - Excerpt"
426
  msgstr ""
427
 
428
+ #: admin/settings.php:455
429
  msgid "Registered Users have the option to auto-subscribe to new categories"
430
  msgstr ""
431
 
432
+ #: admin/settings.php:461
433
  msgid "New categories are immediately excluded"
434
  msgstr ""
435
 
436
+ #: admin/settings.php:462
437
  msgid ""
438
  "Option for Registered Users to auto-subscribe to new categories is checked "
439
  "by default"
440
  msgstr ""
441
 
442
+ #: admin/settings.php:467
443
  msgid "Display checkbox to allow subscriptions from the comment form"
444
  msgstr ""
445
 
446
+ #: admin/settings.php:469
447
  msgid "Before the Comment Submit button"
448
  msgstr ""
449
 
450
+ #: admin/settings.php:471
451
  msgid "After the Comment Submit button"
452
  msgstr ""
453
 
454
+ #: admin/settings.php:474
455
+ msgid "Comment form checkbox is checked by default"
456
+ msgstr ""
457
+
458
+ #: admin/settings.php:479
459
  msgid "Show one-click subscription on profile page"
460
  msgstr ""
461
 
462
+ #: admin/settings.php:488
463
  msgid "Barred Domains"
464
  msgstr ""
465
 
466
+ #: admin/settings.php:490
467
  msgid ""
468
  "Enter domains to bar from public subscriptions: <br /> (Use a new line for "
469
  "each entry and omit the \"@\" symbol, for example email.com)"
470
  msgstr ""
471
 
472
+ #: admin/settings.php:496
473
  msgid "Submit"
474
  msgstr ""
475
 
476
+ #: admin/settings.php:499
477
  msgid "Reset Default"
478
  msgstr ""
479
 
480
+ #: admin/settings.php:500
481
  msgid ""
482
  "Use this to reset all options to their defaults. This <strong><em>will not</"
483
  "em></strong> modify your list of subscribers."
484
  msgstr ""
485
 
486
+ #: admin/settings.php:502
487
  msgid "RESET"
488
  msgstr ""
489
 
600
  msgstr ""
601
 
602
  #: admin/subscribers.php:272 classes/class-s2-admin.php:204
603
+ #: classes/class-s2-admin.php:256 classes/class-s2-admin.php:296
604
  msgid "Select / Unselect All"
605
  msgstr ""
606
 
759
  "Check here to disable sending of an email notification for this post/page"
760
  msgstr ""
761
 
762
+ #: classes/class-s2-admin.php:348
763
  msgid "All Users and Subscribers"
764
  msgstr ""
765
 
766
+ #: classes/class-s2-admin.php:349
767
  msgid "Public Subscribers"
768
  msgstr ""
769
 
770
+ #: classes/class-s2-admin.php:350
771
  msgid "Confirmed"
772
  msgstr ""
773
 
774
+ #: classes/class-s2-admin.php:351
775
  msgid "Unconfirmed"
776
  msgstr ""
777
 
778
+ #: classes/class-s2-admin.php:352
779
  msgid "All Registered Users"
780
  msgstr ""
781
 
782
+ #: classes/class-s2-admin.php:353
783
  msgid "Registered Subscribers"
784
  msgstr ""
785
 
786
+ #: classes/class-s2-admin.php:439
787
  msgid "Post Author"
788
  msgstr ""
789
 
790
+ #: classes/class-s2-admin.php:463
791
  msgid ""
792
  "The WordPress cron functions may be disabled on this server. Digest "
793
  "notifications may not work."
794
  msgstr ""
795
 
796
+ #: classes/class-s2-admin.php:468
797
  msgid "For each Post"
798
  msgstr ""
799
 
800
+ #: classes/class-s2-admin.php:482
801
+ msgid "Send Digest Notification at UTC"
802
  msgstr ""
803
 
804
+ #: classes/class-s2-admin.php:493
805
  msgid ""
806
+ "Chosen time will be scheduled to a future date in relation to the current "
807
+ "UTC time"
808
  msgstr ""
809
 
810
+ #: classes/class-s2-admin.php:496
811
  msgid "Current UTC time is"
812
  msgstr ""
813
 
814
+ #: classes/class-s2-admin.php:498
815
  msgid "Current blog time is"
816
  msgstr ""
817
 
818
+ #: classes/class-s2-admin.php:500
819
  msgid "Next email notification will be sent when your blog time is after"
820
  msgstr ""
821
 
822
+ #: classes/class-s2-admin.php:503
823
  msgid "Attempt to resend the last Digest Notification email"
824
  msgstr ""
825
 
826
+ #: classes/class-s2-admin.php:504
827
  msgid "Resend Digest"
828
  msgstr ""
829
 
830
+ #: classes/class-s2-admin.php:727
831
  msgid "Email subscription"
832
  msgstr ""
833
 
834
+ #: classes/class-s2-admin.php:729
835
  msgid "Subscribe / Unsubscribe"
836
  msgstr ""
837
 
838
+ #: classes/class-s2-admin.php:730
839
  msgid "Receive notifications"
840
  msgstr ""
841
 
842
+ #: classes/class-s2-admin.php:731
843
  msgid ""
844
  "Check if you want to receive email notification when new posts are published"
845
  msgstr ""
932
  msgid "Options reset!"
933
  msgstr ""
934
 
935
+ #: classes/class-s2-core.php:643
936
  msgid "Plain Text Excerpt Preview"
937
  msgstr ""
938
 
939
+ #: classes/class-s2-core.php:645
940
  msgid "Plain Text Full Preview"
941
  msgstr ""
942
 
943
+ #: classes/class-s2-core.php:647
944
  msgid "HTML Excerpt Preview"
945
  msgstr ""
946
 
947
+ #: classes/class-s2-core.php:649
948
  msgid "HTML Full Preview"
949
  msgstr ""
950
 
951
+ #: classes/class-s2-core.php:1235
952
  msgid "Registered User"
953
  msgstr ""
954
 
955
+ #: classes/class-s2-core.php:1240
956
  msgid "Confirmed Public Subscriber"
957
  msgstr ""
958
 
959
+ #: classes/class-s2-core.php:1242
960
  msgid "Unconfirmed Public Subscriber"
961
  msgstr ""
962
 
963
+ #: classes/class-s2-core.php:1279
964
  msgid "Check here to Subscribe to email notifications for new posts"
965
  msgstr ""
966
 
967
+ #: classes/class-s2-core.php:1285
968
  msgid ""
969
  "By registering with this blog you are also agreeing to receive email "
970
  "notifications for new posts but you can unsubscribe at anytime"
971
  msgstr ""
972
 
973
+ #: classes/class-s2-core.php:1311
974
  msgid "Check here to Subscribe to notifications for new posts"
975
  msgstr ""
976
 
977
+ #: classes/class-s2-core.php:1401
978
  msgid "Weekly"
979
  msgstr ""
980
 
981
+ #: classes/class-s2-core.php:1535 classes/class-s2-core.php:1536
982
  msgid "Author"
983
  msgstr ""
984
 
985
+ #: classes/class-s2-core.php:1544
986
  msgid "Posted on"
987
  msgstr ""
988
 
989
+ #: classes/class-s2-core.php:1548 classes/class-s2-core.php:1549
990
  msgid "Posted in"
991
  msgstr ""
992
 
993
+ #: classes/class-s2-core.php:1554 classes/class-s2-core.php:1555
994
  msgid "Tagged as"
995
  msgstr ""
996
 
997
+ #: classes/class-s2-core.php:1621
998
  msgid "Digest Email"
999
  msgstr ""
1000
 
1001
+ #: classes/class-s2-core.php:1631
1002
  msgid "Digest Preview"
1003
  msgstr ""
1004
 
1005
+ #: classes/class-s2-frontend.php:53 classes/class-s2-frontend.php:60
1006
+ msgid "Enter email address..."
1007
  msgstr ""
1008
 
1009
+ #: classes/class-s2-frontend.php:58 classes/class-s2-frontend.php:60
1010
+ msgid "Your email:"
1011
  msgstr ""
1012
 
1013
+ #: classes/class-s2-frontend.php:168
1014
  msgid "Subscription Confirmation"
1015
  msgstr ""
1016
 
1017
+ #: classes/class-s2-frontend.php:170
1018
  msgid "Unsubscription Confirmation"
1019
  msgstr ""
1020
 
1021
+ #: classes/class-s2-frontend.php:209
1022
  msgid "New Subscription"
1023
  msgstr ""
1024
 
1025
+ #: classes/class-s2-frontend.php:211
1026
  msgid "subscribed to email notifications!"
1027
  msgstr ""
1028
 
1029
+ #: classes/class-s2-frontend.php:232
1030
  msgid "New Unsubscription"
1031
  msgstr ""
1032
 
1033
+ #: classes/class-s2-frontend.php:234
1034
  msgid "unsubscribed from email notifications!"
1035
  msgstr ""
1036
 
1037
+ #: classes/class-s2-frontend.php:260
1038
  msgid "[Un]Subscribe to Posts"
1039
  msgstr ""
1040
 
1041
+ #: classes/class-s2-frontend.php:284 classes/class-s2-frontend.php:286
1042
  msgid "Subscribe to this blog"
1043
  msgstr ""
1044
 
1082
  msgid "Font"
1083
  msgstr ""
1084
 
1085
+ #: include/options.php:138
1086
  msgid ""
1087
  "{BLOGNAME} has posted a new item, '{TITLE}'\n"
1088
  "\n"
1098
  "{EMAIL}"
1099
  msgstr ""
1100
 
1101
+ #: include/options.php:146
1102
  msgid ""
1103
  "{BLOGNAME} has received a request to {ACTION} for this email address. To "
1104
  "complete your request please click on the link below:\n"
1111
  "{MYNAME}."
1112
  msgstr ""
1113
 
1114
+ #: include/options.php:150
1115
  msgid "Please confirm your request"
1116
  msgstr ""
1117
 
1118
+ #: include/options.php:154
1119
  msgid ""
1120
  "This email address was subscribed for notifications at {BLOGNAME} "
1121
  "({BLOGLINK}) but the subscription remains incomplete.\n"
1131
  "{MYNAME}"
1132
  msgstr ""
1133
 
1134
+ #: include/options.php:158
1135
  msgid "Subscription Reminder"
1136
  msgstr ""
1137
 
tinymce3/editor_plugin.dev.js DELETED
@@ -1,91 +0,0 @@
1
- (function() {
2
- tinymce.create('tinymce.plugins.Subscribe2Plugin', {
3
- init : function(ed, url) {
4
- var pb = '<img src="' + url + '/../include/spacer.gif" class="mceSubscribe2 mceItemNoResize" />',
5
- cls = 'mceSubscribe2',
6
- shortcode = '[subscribe2]',
7
- pbreplaced = [],
8
- pbRE = new RegExp(/(\[|<!--)subscribe2.*(\]|-->)/g);
9
-
10
- // Register commands
11
- ed.addCommand('mceSubscribe2', function() {
12
- ed.execCommand('mceInsertContent', 0, pb);
13
- });
14
-
15
- // Register buttons
16
- ed.addButton('subscribe2', {
17
- title : 'Insert Subscribe2 Token',
18
- image : url + '/../include/s2_button.png',
19
- cmd : cls
20
- });
21
-
22
- // load the CSS and enable it on the right class
23
- ed.onInit.add(function() {
24
- ed.dom.loadCSS(url + "/css/content.css");
25
-
26
- if (ed.theme.onResolveName) {
27
- ed.theme.onResolveName.add(function(th, o) {
28
- if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls))
29
- o.name = 'subscribe2';
30
- });
31
- }
32
- });
33
-
34
- // allow selection of the image placeholder
35
- ed.onClick.add(function(ed, e) {
36
- e = e.target;
37
-
38
- if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls))
39
- ed.selection.select(e);
40
- });
41
-
42
- // re-enable the CSS when the node changes
43
- ed.onNodeChange.add(function(ed, cm, n) {
44
- cm.setActive('subscribe2', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls));
45
- });
46
-
47
- // create an array of replaced shortcodes so we have additional parameters
48
- // then swap in the graphic
49
- ed.onBeforeSetContent.add(function(ed, o) {
50
- pbreplaced = o.content.match(pbRE);
51
- o.content = o.content.replace(pbRE, pb);
52
- });
53
-
54
- // swap back the array of shortcodes to preserve parameters
55
- // replace any other instances with the default shortcode
56
- ed.onPostProcess.add(function(ed, o) {
57
- if (o.get) {
58
- if ( pbreplaced !== null ) {
59
- for ( i = 0; i < pbreplaced.length; i++ ) {
60
- o.content = o.content.replace(/<img[^>]+>/, function(im) {
61
- if (im.indexOf('class="mceSubscribe2') !== -1) {
62
- im = pbreplaced[i];
63
- }
64
- return im;
65
- });
66
- }
67
- }
68
- o.content = o.content.replace(/<img[^>]+>/, function(im) {
69
- if (im.indexOf('class="mceSubscribe2') !== -1) {
70
- im = shortcode;
71
- }
72
- return im;
73
- });
74
- }
75
- });
76
- },
77
-
78
- getInfo : function() {
79
- return {
80
- longname : 'Insert Subscribe2 Token',
81
- author : 'Matthew Robinson',
82
- authorurl : 'http://subscribe2.wordpress.com',
83
- infourl : 'http://subscribe2.wordpress.com',
84
- version : tinymce.majorVersion + "." + tinymce.minorVersion
85
- };
86
- }
87
- });
88
-
89
- // Register plugin
90
- tinymce.PluginManager.add('subscribe2', tinymce.plugins.Subscribe2Plugin);
91
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tinymce3/editor_plugin.js CHANGED
@@ -1 +1,94 @@
1
- (function(){tinymce.create('tinymce.plugins.Subscribe2Plugin',{init:function(ed,url){var pb='<img src="'+url+'/../include/spacer.gif" class="mceSubscribe2 mceItemNoResize" />',cls='mceSubscribe2',shortcode='[subscribe2]',pbreplaced=[],pbRE=new RegExp(/(\[|<!--)subscribe2.*(\]|-->)/g);ed.addCommand('mceSubscribe2',function(){ed.execCommand('mceInsertContent',0,pb)});ed.addButton('subscribe2',{title:'Insert Subscribe2 Token',image:url+'/../include/s2_button.png',cmd:cls});ed.onInit.add(function(){ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.node.nodeName=='IMG'&&ed.dom.hasClass(o.node,cls))o.name='subscribe2'})}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='IMG'&&ed.dom.hasClass(e,cls))ed.selection.select(e)});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('subscribe2',n.nodeName==='IMG'&&ed.dom.hasClass(n,cls))});ed.onBeforeSetContent.add(function(ed,o){pbreplaced=o.content.match(pbRE);o.content=o.content.replace(pbRE,pb)});ed.onPostProcess.add(function(ed,o){if(o.get){if(pbreplaced!==null){for(i=0;i<pbreplaced.length;i++){o.content=o.content.replace(/<img[^>]+>/,function(im){if(im.indexOf('class="mceSubscribe2')!==-1){im=pbreplaced[i]}return im})}}o.content=o.content.replace(/<img[^>]+>/,function(im){if(im.indexOf('class="mceSubscribe2')!==-1){im=shortcode}return im})}})},getInfo:function(){return{longname:'Insert Subscribe2 Token',author:'Matthew Robinson',authorurl:'http://subscribe2.wordpress.com',infourl:'http://subscribe2.wordpress.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add('subscribe2',tinymce.plugins.Subscribe2Plugin)})();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function () {
2
+ tinymce.create('tinymce.plugins.Subscribe2Plugin', {
3
+ init : function (ed, url) {
4
+ var pb = '<img src="' + url + '/../include/spacer.gif" class="mceSubscribe2 mceItemNoResize" />',
5
+ cls = 'mceSubscribe2',
6
+ shortcode = '[subscribe2]',
7
+ pbreplaced = [],
8
+ pbRE = new RegExp(/(\[|<!--)subscribe2.*(\]|-->)/g);
9
+
10
+ // Register commands
11
+ ed.addCommand('mceSubscribe2', function () {
12
+ ed.execCommand('mceInsertContent', 0, pb);
13
+ });
14
+
15
+ // Register buttons
16
+ ed.addButton('subscribe2', {
17
+ title : 'Insert Subscribe2 Token',
18
+ image : url + '/../include/s2_button.png',
19
+ cmd : cls
20
+ });
21
+
22
+ // load the CSS and enable it on the right class
23
+ ed.onInit.add(function () {
24
+ ed.dom.loadCSS(url + "/css/content.css");
25
+
26
+ if (ed.theme.onResolveName) {
27
+ ed.theme.onResolveName.add(function (th, o) {
28
+ if (o.node.nodeName === 'IMG' && ed.dom.hasClass(o.node, cls)) {
29
+ o.name = 'subscribe2';
30
+ }
31
+ });
32
+ }
33
+ });
34
+
35
+ // allow selection of the image placeholder
36
+ ed.onClick.add(function (ed, e) {
37
+ e = e.target;
38
+
39
+ if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) {
40
+ ed.selection.select(e);
41
+ }
42
+ });
43
+
44
+ // re-enable the CSS when the node changes
45
+ ed.onNodeChange.add(function (ed, cm, n) {
46
+ cm.setActive('subscribe2', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls));
47
+ });
48
+
49
+ // create an array of replaced shortcodes so we have additional parameters
50
+ // then swap in the graphic
51
+ ed.onBeforeSetContent.add(function (ed, o) {
52
+ pbreplaced = o.content.match(pbRE);
53
+ o.content = o.content.replace(pbRE, pb);
54
+ });
55
+
56
+ // swap back the array of shortcodes to preserve parameters
57
+ // replace any other instances with the default shortcode
58
+ ed.onPostProcess.add(function (ed, o) {
59
+ if (o.get) {
60
+ if ( pbreplaced !== null ) {
61
+ var i;
62
+ for ( i = 0; i < pbreplaced.length; i++ ) {
63
+ o.content = o.content.replace(/<img[^>]+>/, function (im) {
64
+ if (im.indexOf('class="mceSubscribe2') !== -1) {
65
+ im = pbreplaced[i];
66
+ }
67
+ return im;
68
+ });
69
+ }
70
+ }
71
+ o.content = o.content.replace(/<img[^>]+>/g, function (im) {
72
+ if (im.indexOf('class="mceSubscribe2') !== -1) {
73
+ im = shortcode;
74
+ }
75
+ return im;
76
+ });
77
+ }
78
+ });
79
+ },
80
+
81
+ getInfo : function () {
82
+ return {
83
+ longname : 'Insert Subscribe2 Token',
84
+ author : 'Matthew Robinson',
85
+ authorurl : 'http://subscribe2.wordpress.com',
86
+ infourl : 'http://subscribe2.wordpress.com',
87
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
88
+ };
89
+ }
90
+ });
91
+
92
+ // Register plugin
93
+ tinymce.PluginManager.add('subscribe2', tinymce.plugins.Subscribe2Plugin);
94
+ })();
tinymce3/editor_plugin.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(){tinymce.create('tinymce.plugins.Subscribe2Plugin',{init:function(ed,url){var pb='<img src="'+url+'/../include/spacer.gif" class="mceSubscribe2 mceItemNoResize" />',cls='mceSubscribe2',shortcode='[subscribe2]',pbreplaced=[],pbRE=new RegExp(/(\[|<!--)subscribe2.*(\]|-->)/g);ed.addCommand('mceSubscribe2',function(){ed.execCommand('mceInsertContent',0,pb)});ed.addButton('subscribe2',{title:'Insert Subscribe2 Token',image:url+'/../include/s2_button.png',cmd:cls});ed.onInit.add(function(){ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.node.nodeName==='IMG'&&ed.dom.hasClass(o.node,cls)){o.name='subscribe2'}})}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='IMG'&&ed.dom.hasClass(e,cls)){ed.selection.select(e)}});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('subscribe2',n.nodeName==='IMG'&&ed.dom.hasClass(n,cls))});ed.onBeforeSetContent.add(function(ed,o){pbreplaced=o.content.match(pbRE);o.content=o.content.replace(pbRE,pb)});ed.onPostProcess.add(function(ed,o){if(o.get){if(pbreplaced!==null){var i;for(i=0;i<pbreplaced.length;i++){o.content=o.content.replace(/<img[^>]+>/,function(im){if(im.indexOf('class="mceSubscribe2')!==-1){im=pbreplaced[i]}return im})}}o.content=o.content.replace(/<img[^>]+>/g,function(im){if(im.indexOf('class="mceSubscribe2')!==-1){im=shortcode}return im})}})},getInfo:function(){return{longname:'Insert Subscribe2 Token',author:'Matthew Robinson',authorurl:'http://subscribe2.wordpress.com',infourl:'http://subscribe2.wordpress.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add('subscribe2',tinymce.plugins.Subscribe2Plugin)})();