Subscribe2 - Version 3.8

Version Description

Download this release

Release Info

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

Code changes from version 4.6 to 3.8

ReadMe.txt CHANGED
@@ -1,22 +1,20 @@
1
  === Subscribe2 ===
2
- Contributors: MattyRob, Skippy, RavanH
3
  Donate link: http://subscribe2.wordpress.com/donate/
4
  Tags: posts, subscription, email
5
  Requires at least: 2.0.x
6
- Tested up to: 2.5
7
- Stable tag: 4.6
8
 
9
  Sends a list of subscribers an email notification when new posts are published to your blog
10
 
11
  == Description ==
12
 
13
- Subscribe2 provides a comprehensive subscription management system for WordPress blogs that sends email notifications to a list of subscribers when you publish new content to your blog. The plugin also handles subscription requests allowing users to publically subscribe by submitting their email address in an easy to use form or to register with your blog which enables greater flexibility for email content for the subscriber. Admins are given control over the presentation of the email notifications, can bulk manage subscriptions for users and manually send email notices to subscribers.
14
 
15
- Email Notifications can be sent on a per-post basis or periodically in a Digest email. Additionally, certain categories can be excluded from inclusion in the notification and post can be excluded on an individual basis by setting a custom field of 's2mail' to 'no'.
16
 
17
- Subscribe2 supports two classes of subscribers: the general public, and registered users of the blog. The general public may subscribe and unsubscribe. They will receive a limited email notification when new post is made or periodically (unless that post is assigned to one of the excluded categories you defined). The general public will receive a plaintext email with an excerpt of the post: either the excerpt you created when making the post, the portion of text before a <!--more--> tag (if present), or the first 55 words of the post.
18
-
19
- Registered users of the blog can elect to receive email notifications for specific categories (unless Digest email are select, then it is an opt in or out decision). The Users->Subscription menu item will allow them to select the delivery format (plaintext or HTML), amount of message (excerpt or full post), and the categories to which they want to subscribe. You, the blog owner, have the option (Options->Subscribe2) to allow registered users to subscribe to your excluded categories or not.
20
 
21
  When you post a new item, subscribe2 will generate (at least) one email for each of the following combinations of subscribers:
22
 
@@ -28,26 +26,27 @@ So for each new post you make, you may receive up to three emails.
28
 
29
  == Installation ==
30
 
31
- 1. Copy the entire /subscribe2/ directory into your /wp-content/plugins/ directory.
32
- 2. Activate the plugin.
33
- 3. Click the "Options" admin menu link, and select "Subscribe2".
34
- 4. Configure the options to taste, including the email template and any categories which should be excluded from notification
35
- 5. Click the "Manage" admin menu link, and select "Subscribers".
36
- 6. Manually subscribe people as you see fit.
37
- 7. Create a WordPress Page (http://codex.wordpress.org/Pages) to display the subscription form. When creating the page, you may click the "S2" button on the QuickBar to automatically insert the subscribe2 token. Or, if you prefer, you may manually insert the subscribe2 token:
 
38
  <!--subscribe2-->
39
  ***Ensure the token is on a line by itself and that it has a blank line above and below.***
40
  This token will automatically be replaced by the subscription form, and will display all messages as necessary.
41
- 8. In the subscribe2.php file define S2PAGE to point at your WordPress page created in step 8.
42
 
43
  == Frequently Asked Questions ==
44
 
45
  = Which version should I be using, I'm on WordPress x.x.x? =
46
  WordPress 2.0.x will be supported until 2010. Subscribe2 will remain supported (but not actively developed) until WordPress 2.0.x is no longer supported. For WordPress 2.0.x use the Subscribe code from the 2.x stable.
47
 
48
- WordPress 2.1.x and 2.2.x are supported. For the latest information visit http://subscribe2.wordpress.com. For these versions of WordPress use Subscribe2 code from the 3.x stable.
49
 
50
- Finally, WordPress 2.3 and 2.5 are supported. Again, for the latest information visit http://subscribe2.wordpress.com. For this versions of WordPress use Subscribe2 code from the 4.x stable.
51
 
52
  = How do I upgrade from a previous version? =
53
  If you are upgrading from any 2.1.x version of subscribe2, please delete both the /subscribe.php and /wp-content/plugins/subscribe2.php files before copying the new files into place. Your subscriber list will remain intact, and your options should be preserved. Now create a WordPress Page as described above.
@@ -66,7 +65,7 @@ Subscribe2 provides a facility to work around this restriction by sending batche
66
  define('BCCLIMIT', 0);
67
  Change the 0 to the number of allowed outgoing email recipients as set by your host.
68
 
69
- Reminder: because subscribe2 places all recipients in BCC fields, and places the blog admin in the TO field, the blog admin will receive one email per batched delivery. So if you have 90 subscribers, the blog admin should receive three post notification emails, one for each set of 30 BCC recipients.
70
 
71
  Batches will occur for each group of message as described above. A site on Dreamhost with many public and registered subscribers could conceivably generate a lot of email for your own inbox.
72
 
@@ -79,74 +78,6 @@ Batches will occur for each group of message as described above. A site on Drea
79
 
80
  == Version History ==
81
 
82
- Version 4.6 by Matthew Robinson
83
-
84
- * Fixed mis-reporting of server error when unsubscribing
85
- * Fixed fatal errors involving buttonsnap library
86
- * Improved database entry management for new subscribers
87
- * Fixed issue where Subscribe2 grabbed the first page from the database even if it wasn't published
88
- * Fixed upgrade reporting for Debug and Uninstaller plugins
89
-
90
- Version 4.5 by Matthew Robinson
91
-
92
- * Added Support for WordPress 2.5!
93
- * Fixed HTML typo in admin submission message
94
- * Fixed time display for cron jobs in Options->Subscribe2 when displayed on blogs using a time offset
95
- * Added Debug plugin to the download package
96
- * Improved descriptions of email template keywords in Options->Subscribe2
97
- * Display subscribers in batches of 50 in Manage->Subscribers
98
- * Fixed some XHTML validation errors
99
- * Improved admin menu layout for compliance with WordPress 2.5
100
- * Reverted to using wp_mail instead of mail to ensure proper header encoding
101
- * Improved mail header formatting - thanks to Chris Carlson
102
- * Add ability to skip email notification using a Custom Field (s2mail set as "no")
103
- * Improved CSV export - thanks to Aaron Axelsen
104
- * Added some compatibility for WPMU - thanks to Aaron Axelsen
105
- * Added some error feedback to blog users if mails fail to send
106
- * Moved Buttonsnap due to far to many fatal error complaints
107
- * Added option to send notifications for Private posts
108
- * Improved handling of notification for Password Protected Posts
109
-
110
- Version 4.4 by Matthew Robinson
111
-
112
- * Fixed non-substitution of TABLE keyword
113
- * Fixed bug in usermeta update calls in unsubscribe_registered_users function
114
- * Fixed bug in array handling in cron function that may have stopped emails sending
115
- * Improved array handling in the Digest function
116
- * Added an Un-installer to completely removed Subscribe2 from your WordPress install
117
-
118
- Version 4.3 by Matthew Robinson
119
-
120
- * Fixed bug where digest emails were sent to unsubscribed users - Thanks to Mr Papa
121
- * Stripped slashes from Subject when sending from Write->Mail Subscribers - Thanks to James
122
- * Ensured all admin pages created by Subscribe2 are valid XHTML 1.0 Transitional code
123
- * Added default mail templates and other missed string values to i18n files to allow easier first time translation - thanks to Kjell
124
- * Added option to set the hour for digest email notifications provided the schedule interval is one day or greater
125
- * Moved option variable declaration to ensure better caching
126
- * Fixed bug where cron tasks were not removed when options were reset
127
- * Fixed email notifications for future dated posts
128
- * Fixed QuickTag Icons and mouse-over floating text
129
-
130
- Version 4.2 by Matthew Robinson
131
-
132
- * Added translation capability to user feedback strings - thanks to Lise
133
- * Corrected some other translation strings
134
- * Fixed bug in notification emails to admins when new users subscribe
135
- * Updated default options code
136
-
137
- Version 4.1 by Matthew Robinson
138
-
139
- * Fixed sending of notifications for Pages
140
- * Fixed password protected post bug for Digest email notifications
141
- * Fixed blank email headers if admin data is not at ID 1
142
-
143
- Version 4.0 by Matthew Robinson
144
-
145
- * Compatible with WordPress 2.3
146
- * Widget Code now integrated into the main plugin and added as an option
147
- * More Options for Email Notifications
148
- * Category Lists fixed for WordPress 2.3 and now show empty categories
149
-
150
  Version 3.8 by Matthew Robinson
151
 
152
  * Fixed User Menu Settings when Digests enabled
1
  === Subscribe2 ===
2
+ Contributors: MattyRob, Skippy, Ravan
3
  Donate link: http://subscribe2.wordpress.com/donate/
4
  Tags: posts, subscription, email
5
  Requires at least: 2.0.x
6
+ Tested up to: 2.2
7
+ Stable tag: 3.8
8
 
9
  Sends a list of subscribers an email notification when new posts are published to your blog
10
 
11
  == Description ==
12
 
13
+ Subscribe2 provides a comprehensive subscription management system for WordPress blogs that sends email notifications on a per-post or periodical basis to a list of subscribers when you publish new content to your blog. The plugin also handles subscription requests allowing users to publically subscribe by submitting their email address in an easy to use form or to register with your blog which enables greater flexibility for email content for the subscriber. Admins are given control over the presentation of the email notifications, can bulk manage subscriptions for users and manually send email notices to subscribers.
14
 
15
+ Subscribe2 supports two classes of subscribers: the general public, and registered users of the blog. The general public may subscribe and unsubscribe. They will receive an email notification whenever a new post is made (unless that post is assigned to one of the excluded categories you defined). The general public will receive a plaintext email with an excerpt of the post: either the excerpt you created when making the post, the portion of text before a <!--more--> tag (if present), or the first 55 words of the post.
16
 
17
+ Registered users of the blog can elect to receive email notifications for specific categories. The Users->Subscription menu item will allow them to select the delivery format (plaintext or HTML), amount of message (excerpt or full post), and the categories to which they want to subscribe. You, the blog owner, have the option (Options->Subscribe2) to allow registered users to subscribe to your excluded categories or not.
 
 
18
 
19
  When you post a new item, subscribe2 will generate (at least) one email for each of the following combinations of subscribers:
20
 
26
 
27
  == Installation ==
28
 
29
+ 1. Copy buttonsnap.php into your /wp-content/plugins directory.
30
+ 2. Copy the entire /subscribe2/ directory into your /wp-content/plugins/ directory.
31
+ 3. Activate the plugin.
32
+ 4. Click the "Options" admin menu link, and select "Subscribe2".
33
+ 5. Configure the options to taste, including the email template and any categories which should be excluded from notification
34
+ 6. Click the "Manage" admin menu link, and select "Subscribers".
35
+ 7. Manually subscribe people as you see fit.
36
+ 8. Create a WordPress Page (http://codex.wordpress.org/Pages) to display the subscription form. When creating the page, you may click the "S2" button on the QuickBar to automatically insert the subscribe2 token. Or, if you prefer, you may manually insert the subscribe2 token:
37
  <!--subscribe2-->
38
  ***Ensure the token is on a line by itself and that it has a blank line above and below.***
39
  This token will automatically be replaced by the subscription form, and will display all messages as necessary.
40
+ 9. In the subscribe2.php file define S2PAGE to point at your WordPress page created in step 8.
41
 
42
  == Frequently Asked Questions ==
43
 
44
  = Which version should I be using, I'm on WordPress x.x.x? =
45
  WordPress 2.0.x will be supported until 2010. Subscribe2 will remain supported (but not actively developed) until WordPress 2.0.x is no longer supported. For WordPress 2.0.x use the Subscribe code from the 2.x stable.
46
 
47
+ WordPress 2.1.x and 2.2.x are also supported. For the latest information visit http://subscribe2.wordpress.com. For versions of WordPress use Subscribe2 code from the 3.x stable.
48
 
49
+ Finally, there is a development version for WordPress 2.3 but as WordPress 2.3 is not recommended for active websites you should only get this code from the branch if you are testing it.
50
 
51
  = How do I upgrade from a previous version? =
52
  If you are upgrading from any 2.1.x version of subscribe2, please delete both the /subscribe.php and /wp-content/plugins/subscribe2.php files before copying the new files into place. Your subscriber list will remain intact, and your options should be preserved. Now create a WordPress Page as described above.
65
  define('BCCLIMIT', 0);
66
  Change the 0 to the number of allowed outgoing email recipients as set by your host.
67
 
68
+ Reminder: because subscribe2 places all recipients in BCC fields, and places the blog admin in the TO field, the blog admin will receive one email per batched delivery. So if you have 90 subscribers, the blog admin should receive three post notification emails, one for eah set of 30 BCC recipients.
69
 
70
  Batches will occur for each group of message as described above. A site on Dreamhost with many public and registered subscribers could conceivably generate a lot of email for your own inbox.
71
 
78
 
79
  == Version History ==
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  Version 3.8 by Matthew Robinson
82
 
83
  * Fixed User Menu Settings when Digests enabled
include/buttonsnap.php → buttonsnap.php RENAMED
File without changes
{include → subscribe2/include}/arrow_left.png RENAMED
File without changes
{include → subscribe2/include}/arrow_right.png RENAMED
File without changes
{include → subscribe2/include}/cross.png RENAMED
File without changes
{include → subscribe2/include}/options.php RENAMED
@@ -1,5 +1,5 @@
1
  <?php
2
- // include.php - Handles options for subscribe2
3
  // DO NOT EDIT THIS FILE AS IT IS SET BY THE OPTIONS PAGE
4
 
5
  if (!isset($this->subscribe2_options['autosub'])) {
@@ -8,7 +8,7 @@ if (!isset($this->subscribe2_options['autosub'])) {
8
 
9
  if (!isset($this->subscribe2_options['wpregdef'])) {
10
  $this->subscribe2_options['wpregdef'] = "no";
11
- } // option to check registration form box by default
12
 
13
  if (!isset($this->subscribe2_options['autoformat'])) {
14
  $this->subscribe2_options['autoformat'] = "text";
@@ -22,10 +22,6 @@ if (!isset($this->subscribe2_options['password'])) {
22
  $this->subscribe2_options['password'] = "no";
23
  } // option for sending notifications for posts that are password protected
24
 
25
- if (!isset($this->subscribe2_options['private'])) {
26
- $this->subscribe2_options['private'] = "no";
27
- } // option for sending notifications for posts that are private
28
-
29
  if (!isset($this->subscribe2_options['email_freq'])) {
30
  $this->subscribe2_options['email_freq'] = "never";
31
  } // option for sending emails per-post or as a digest email on a cron schedule
@@ -47,23 +43,19 @@ if (!isset($this->subscribe2_options['show_button'])) {
47
  $this->subscribe2_options['show_button'] = "1";
48
  } // option to show Subscribe2 button on Write page
49
 
50
- if (!isset($this->subscribe2_options['widget'])) {
51
- $this->subscribe2_options['widget'] = "0";
52
- } // option to enable Subscribe2 Widget
53
-
54
  if (!isset($this->subscribe2_options['barred'])) {
55
  $this->subscribe2_options['barred'] = '';
56
  } // option containing domains barred from public registration
57
 
58
  if (!isset($this->subscribe2_options['mailtext'])) {
59
- $this->subscribe2_options['mailtext'] = __("BLOGNAME has posted a new item, 'TITLE'\n\nPOST\n\nYou may view the latest post at\nPERMALINK\n\nYou received this e-mail because you asked to be notified when new updates are posted.\nBest regards,\nMYNAME\nEMAIL", "subscribe2");
60
  } // Default notification email text
61
 
62
  if (!isset($this->subscribe2_options['confirm_email'])) {
63
- $this->subscribe2_options['confirm_email'] = __("BLOGNAME has received a request to ACTION for this email address. To complete your request please click on the link below:\n\nLINK\n\nIf you did not request this, please feel free to disregard this notice!\n\nThank you,\nMYNAME.", "subscribe2");
64
  } // Default confirmation email text
65
 
66
  if (!isset($this->subscribe2_options['remind_email'])) {
67
- $this->subscribe2_options['remind_email'] = __("This email address was subscribed for notifications at BLOGNAME (BLOGLINK) but the subscription remains incomplete.\n\nIf you wish to complete your subscription please click on the link below:\n\nLINK\n\nIf you do not wish to complete your subscription please ignore this email and your address will be removed from our database.\n\nRegards,\nMYNAME", "subscribe2");
68
  } // Default reminder email text
69
  ?>
1
  <?php
2
+ // include.php - Handles options and common functions for subscribe2
3
  // DO NOT EDIT THIS FILE AS IT IS SET BY THE OPTIONS PAGE
4
 
5
  if (!isset($this->subscribe2_options['autosub'])) {
8
 
9
  if (!isset($this->subscribe2_options['wpregdef'])) {
10
  $this->subscribe2_options['wpregdef'] = "no";
11
+ } // option to
12
 
13
  if (!isset($this->subscribe2_options['autoformat'])) {
14
  $this->subscribe2_options['autoformat'] = "text";
22
  $this->subscribe2_options['password'] = "no";
23
  } // option for sending notifications for posts that are password protected
24
 
 
 
 
 
25
  if (!isset($this->subscribe2_options['email_freq'])) {
26
  $this->subscribe2_options['email_freq'] = "never";
27
  } // option for sending emails per-post or as a digest email on a cron schedule
43
  $this->subscribe2_options['show_button'] = "1";
44
  } // option to show Subscribe2 button on Write page
45
 
 
 
 
 
46
  if (!isset($this->subscribe2_options['barred'])) {
47
  $this->subscribe2_options['barred'] = '';
48
  } // option containing domains barred from public registration
49
 
50
  if (!isset($this->subscribe2_options['mailtext'])) {
51
+ $this->subscribe2_options['mailtext'] = "BLOGNAME has posted a new item, 'TITLE'\n\nPOST\n\nYou may view the latest post at\nPERMALINK\n\nYou received this e-mail because you asked to be notified when new updates are posted.\nBest regards,\nMYNAME\nEMAIL";
52
  } // Default notification email text
53
 
54
  if (!isset($this->subscribe2_options['confirm_email'])) {
55
+ $this->subscribe2_options['confirm_email'] = "BLOGNAME has received a request to ACTION for this email address. To complete your request please click on the link below:\n\nLINK\n\nIf you did not request this, please feel free to disregard this notice!\n\nThank you,\nMYNAME.";
56
  } // Default confirmation email text
57
 
58
  if (!isset($this->subscribe2_options['remind_email'])) {
59
+ $this->subscribe2_options['remind_email'] = "This email address was subscribed for notifications at BLOGNAME (BLOGLINK) but the subscription remains incomplete.\n\nIf you wish to complete your subscription please click on the link below:\n\nLINK\n\nIf you do not wish to complete your subscription please ignore this email and your address will be removed from our database.\n\nRegards,\nMYNAME";
60
  } // Default reminder email text
61
  ?>
{include → subscribe2/include}/s2_button.png RENAMED
File without changes
{include → subscribe2/include}/s2_marker.png RENAMED
File without changes
{include → subscribe2/include}/spacer.gif RENAMED
File without changes
subscribe2.php → subscribe2/subscribe2.php RENAMED
@@ -3,13 +3,13 @@
3
  Plugin Name: Subscribe2
4
  Plugin URI: http://subscribe2.wordpress.com
5
  Description: Notifies an email list when new entries are posted.
6
- Version: 4.6
7
  Author: Matthew Robinson
8
  Author URI: http://subscribe2.wordpress.com
9
  */
10
 
11
  /*
12
- Copyright (C) 2006-8 Matthew Robinson
13
  Based on the Original Subscribe2 plugin by
14
  Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
15
 
@@ -41,16 +41,11 @@ define('S2PAGE', '0');
41
 
42
  // our version number. Don't touch this or any line below
43
  // unless you know exacly what you are doing
44
- define('S2VERSION', '4.6');
45
  define ('S2PATH', trailingslashit(dirname(__FILE__)));
46
 
47
- // Is this WordPressMU or not?
48
- define('S2_MU', (isset($wpmu_version) || (strpos($wp_version, 'wordpress-mu') !== false)));
49
-
50
  // use Owen's excellent ButtonSnap library
51
- if (!function_exists(buttonsnap_textbutton)) {
52
- require(ABSPATH . 'wp-content/plugins/subscribe2/include/buttonsnap.php');
53
- }
54
 
55
  $mysubscribe2 = new s2class;
56
  $mysubscribe2->s2init();
@@ -65,11 +60,11 @@ class s2class {
65
  function load_strings() {
66
  // adjust the output of Subscribe2 here
67
 
68
- $this->please_log_in = "<p>" . __('To manage your subscription options please ', 'subscribe2') . "<a href=\"" . get_option('siteurl') . "/wp-login.php\">" . __('login', 'subscribe2') . "</a>.</p>";
69
 
70
- $this->use_profile_admin = "<p>" . __('You may manage your subscription options from your ', 'subscribe2') . "<a href=\"" . get_option('siteurl') . "/wp-admin/users.php?page=" . plugin_basename(__FILE__) . "\">" . __('profile', 'subscribe2') . "</a>.</p>";
71
 
72
- $this->use_profile_users = "<p>" . __('You may manage your subscription options from your ', 'subscribe2') . "<a href=\"" . get_option('siteurl') . "/wp-admin/profile.php?page=" . plugin_basename(__FILE__) . "\">" . __('profile', 'subscribe2') . "</a>.</p>";
73
 
74
  $this->confirmation_sent = "<p>" . __('A confirmation message is on its way!', 'subscribe2') . "</p>";
75
 
@@ -81,8 +76,6 @@ class s2class {
81
 
82
  $this->barred_domain = "<p>" . __('Sorry, email addresses at that domain are currently barred due to spam, please use an alternative email address.', 'subscribe2') . "</p>";
83
 
84
- $this->error = "<p>" . __('Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2') . "</p>";
85
-
86
  $this->mail_sent = "<p>" . __('Message sent!', 'subscribe2') . "</p>";
87
 
88
  $this->form = "<form method=\"post\" action=\"\">" . __('Your email:', 'subscribe2') . "&#160;<input type=\"text\" name=\"email\" value=\"\" size=\"20\" />&#160;<br /><input type=\"radio\" name=\"s2_action\" value=\"subscribe\" checked=\"checked\" /> " . __('Subscribe', 'subscribe2') . " <input type=\"radio\" name=\"s2_action\" value=\"unsubscribe\" /> " . __('Unsubscribe', 'subscribe2') . " &#160;<input type=\"submit\" value=\"" . __('Send', 'subscribe2') . "\" /></form>\r\n";
@@ -114,7 +107,11 @@ class s2class {
114
  function admin_menu() {
115
  add_management_page(__('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), "manage_options", __FILE__, array(&$this, 'manage_menu'));
116
  add_options_page(__('Subscribe2 Options', 'subscribe2'), __('Subscribe2','subscribe2'), "manage_options", __FILE__, array(&$this, 'options_menu'));
117
- add_users_page(__('Subscriptions', 'subscribe2'), __('Subscriptions', 'subscribe2'), "read", __FILE__, array(&$this, 'user_menu'));
 
 
 
 
118
  add_submenu_page('post-new.php', __('Mail Subscribers','subscribe2'), __('Mail Subscribers', 'subscribe2'),"manage_options", __FILE__, array(&$this, 'write_menu'));
119
  $s2nonce = md5('subscribe2');
120
  }
@@ -149,7 +146,7 @@ class s2class {
149
  function install() {
150
  // include upgrade-functions for maybe_create_table;
151
  if (!function_exists('maybe_create_table')) {
152
- require_once(ABSPATH . 'wp-admin/install-helper.php');
153
  }
154
  $date = date('Y-m-d');
155
  $sql = "CREATE TABLE $this->public (
@@ -172,7 +169,7 @@ class s2class {
172
 
173
  // include upgrade-functions for maybe_create_table;
174
  if (!function_exists('maybe_create_table')) {
175
- require_once(ABSPATH . 'wp-admin/install-helper.php');
176
  }
177
  $date = date('Y-m-d');
178
  maybe_add_column($this->public, 'date', "ALTER TABLE `$this->public` ADD `date` DATE DEFAULT '$date' NOT NULL AFTER `active`;");
@@ -207,7 +204,6 @@ class s2class {
207
  */
208
  function reset() {
209
  delete_option('subscribe2_options');
210
- wp_clear_scheduled_hook('s2_digest_cron');
211
  unset($this->subscribe2_options);
212
  require(S2PATH . "include/options.php");
213
  update_option('subscribe2_options', $this->subscribe2_options);
@@ -239,13 +235,13 @@ class s2class {
239
 
240
  // Set sender details
241
  if ('' == $this->myname) {
242
- $admin = $this->get_userdata();
243
  $this->myname = $admin->display_name;
244
  $this->myemail = $admin->user_email;
245
  }
246
- $headers = "From: \"" . $this->myname . "\" <" . $this->myemail . ">\n";
247
- $headers .= "Return-path: <" . $this->myemail . ">\n";
248
- $headers .= "Reply-To: \"" . $this->myname . "\" <" . $this->myemail . ">\n";
249
  $headers .= "X-Mailer:PHP" . phpversion() . "\n";
250
  $headers .= "Precedence: list\nList-Id: " . get_option('blogname') . "\n";
251
 
@@ -318,10 +314,10 @@ class s2class {
318
  if ( (defined('BCCLIMIT')) && (BCCLIMIT > 0) && (isset($batch)) ) {
319
  foreach ($batch as $bcc) {
320
  $newheaders = $headers . "$bcc\r\n";
321
- @wp_mail($this->myemail, $subject, $mailtext, $newheaders);
322
  }
323
  } else {
324
- @wp_mail($this->myemail, $subject, $mailtext, $headers);
325
  }
326
  return;
327
  } // end mail()
@@ -329,32 +325,21 @@ class s2class {
329
  /**
330
  Sends an email notification of a new post
331
  */
332
- function publish($post = 0) {
333
- if (!$post) { return $post; }
334
- $s2mail = get_post_meta($post->ID, 's2mail', true);
335
- if (strtolower(trim($s2mail)) == 'no') { return $post; }
336
 
337
  // are we doing daily digests? If so, don't send anything now
338
- if ($this->subscribe2_options['email_freq'] != 'never') { return $post; }
339
 
340
- // is the current post a page
341
- // and should this not generate a notification email?
342
- if ( ($this->subscribe2_options['pages'] == 'no') && ($post->post_type == 'page') ) {
343
- return $post;
 
 
344
  }
345
 
346
- // is this post set in the future?
347
- if ($post->post_date > current_time('mysql')) {
348
- // bail out
349
- return $post;
350
- }
351
-
352
- //Are we sending notifications for password protected posts?
353
- if ( ($this->subscribe2_options['password'] == "no") && ($post->post_password != '') ) {
354
- return $post;
355
- }
356
-
357
- $post_cats = wp_get_post_categories($post->ID);
358
  $post_cats_string = implode(',', $post_cats);
359
  $check = false;
360
  // is the current post assigned to any categories
@@ -370,14 +355,19 @@ class s2class {
370
  // excluded categories?
371
  if ('0' == $this->subscribe2_options['reg_override']) {
372
  // nope? okay, let's leave
373
- return $post;
374
  }
375
  }
376
 
377
- // Are we sending notifications for Private posts?
378
- if ($this->subscribe2_options['private'] == "yes") {
379
- // don't send notification to public users
380
- $check = true;
 
 
 
 
 
381
  }
382
 
383
  // lets collect our public subscribers
@@ -393,12 +383,12 @@ class s2class {
393
  // do we have subscribers?
394
  if ( (empty($public)) && (empty($registered)) ) {
395
  // if not, no sense doing anything else
396
- return $post;
397
  }
398
  // we set these class variables so that we can avoid
399
  // passing them in function calls a little later
400
  $this->post_title = $post->post_title;
401
- $this->permalink = "<a href=\"" . get_permalink($post->ID) . "\">" . get_permalink($post->ID) . "</a>";
402
 
403
  $author = get_userdata($post->post_author);
404
  $this->authorname = $author->display_name;
@@ -409,7 +399,7 @@ class s2class {
409
  $user =& $author;
410
  } else {
411
  // get admin details
412
- $user = $this->get_userdata();
413
  }
414
  $this->myemail = $user->user_email;
415
  $this->myname = $user->display_name;
@@ -465,6 +455,27 @@ class s2class {
465
  return $id;
466
  } // end publish()
467
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  /**
469
  Send confirmation email to the user
470
  */
@@ -493,7 +504,7 @@ class s2class {
493
  $link .= md5($this->email);
494
  $link .= $id;
495
 
496
- $admin = $this->get_userdata();
497
  $this->myname = $admin->display_name;
498
 
499
  if ($is_remind == TRUE) {
@@ -511,15 +522,14 @@ class s2class {
511
 
512
  $body = str_replace("LINK", $link, $body);
513
 
514
- $mailheaders .= "From: \"" . $admin->display_name . "\" <" . $admin->user_email . ">\n";
515
- $mailheaders .= "Reply-To: \"" . $admin->display_name . "\" <" . $admin->user_email . ">\n";
516
- $mailheaders .= "Return-path: <" . $admin->user_email . ">\n";
517
  $mailheaders .= "X-Mailer:PHP" . phpversion() . "\n";
518
  $mailheaders .= "Precedence: list\nList-Id: " . get_option('blogname') . "\n";
519
  $mailheaders .= "MIME-Version: 1.0\n";
520
  $mailheaders .= "Content-Type: text/plain; charset=\"". get_bloginfo('charset') . "\"\n";
521
 
522
- return @wp_mail($this->email, $subject, $body, $mailheaders);
523
  } // end send_confirm()
524
 
525
  /* ===== Subscriber functions ===== */
@@ -638,7 +648,7 @@ class s2class {
638
  function remind($emails = '') {
639
  if ('' == $emails) { return false; }
640
 
641
- $admin = $this->get_userdata();
642
  $this->myname = $admin->display_name;
643
 
644
  $recipients = explode(",", $emails);
@@ -649,6 +659,17 @@ class s2class {
649
  }
650
  } //end remind()
651
 
 
 
 
 
 
 
 
 
 
 
 
652
  /**
653
  Check email is not from a barred domain
654
  */
@@ -691,8 +712,8 @@ class s2class {
691
  $this->activate();
692
  $this->message = $this->added;
693
  $subject = '[' . get_option('blogname') . '] ' . __('New subscriber', 'subscribe2');
694
- $message = $this->email . " " . __('subscribed to email notifications!', 'subscribe2');
695
- $recipients = $wpdb->get_col("SELECT DISTINCT(user_email) FROM $wpdb->users INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key='" . $wpdb->prefix . "user_level' AND $wpdb->usermeta.meta_value='10'");
696
  $this->mail($recipients, $subject, $message);
697
  $this->filtered = 1;
698
  } elseif ('0' == $action) {
@@ -809,11 +830,7 @@ class s2class {
809
  $AND .= "AND ($and)";
810
  }
811
 
812
- if ((defined(S2_MU)) && S2_MU) {
813
- $sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . " WHERE a.meta_key='".$wpdb->prefix."capabilities'" . $AND;
814
- } else {
815
- $sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . " WHERE a.meta_key='s2_subscribed'" . $AND;
816
- }
817
  $result = $wpdb->get_col($sql);
818
  if ($result) {
819
  $ids = implode(',', $result);
@@ -848,14 +865,14 @@ class s2class {
848
 
849
  if (0 == $user_id) { return $user_id; }
850
  $user = get_userdata($user_id);
851
- $all_cats = get_categories(array('hide_empty' => false));
852
 
853
  if (0 == $this->subscribe2_options['reg_override']) {
854
  // registered users are not allowed to subscribe to
855
  // excluded categories
856
  $exclude = explode(',', $this->subscribe2_options['exclude']);
857
- foreach ($all_cats as $cat => $term_id) {
858
- if (in_array($all_cats[$cat]->term_id, $exclude)) {
859
  $cat = (int)$cat;
860
  unset($all_cats[$cat]);
861
  }
@@ -863,7 +880,7 @@ class s2class {
863
  }
864
 
865
  foreach ($all_cats as $cat) {
866
- ('' == $cats) ? $cats = "$cat->term_id" : $cats .= ",$cat->term_id";
867
  }
868
 
869
  if ('' == $cats) {
@@ -882,30 +899,26 @@ class s2class {
882
  update_usermeta($user_id, 's2_format', 'text');
883
  update_usermeta($user_id, 's2_excerpt', 'excerpt');
884
  } else {
885
- // create post format entries for all users
886
- $check = get_usermeta($user_id, 's2_format');
887
- if (empty($check)) {
888
- if ('html' == $this->subscribe2_options['autoformat']) {
889
- update_usermeta($user_id, 's2_format', 'html');
890
- update_usermeta($user_id, 's2_excerpt', 'post');
891
- } elseif ('fulltext' == $this->subscribe2_options['autoformat']) {
892
- update_usermeta($user_id, 's2_format', 'text');
893
- update_usermeta($user_id, 's2_excerpt', 'post');
894
- } else {
895
- update_usermeta($user_id, 's2_format', 'text');
896
- update_usermeta($user_id, 's2_excerpt', 'excerpt');
897
- }
898
- }
899
- // ensure existing subscriptions are not overwritten on upgrade
900
  $check = get_usermeta($user_id, 's2_subscribed');
901
- // if the are no existing subscriptions, create them based on admin options
902
  if (empty($check)) {
903
  if ( ('yes' == $this->subscribe2_options['autosub']) || (('wpreg' == $this->subscribe2_options['autosub']) && (1 == $wpreg)) ) {
904
- // don't add entries by default if autosub is off, messes up daily digests
905
  update_usermeta($user_id, 's2_subscribed', $cats);
906
  foreach(explode(',', $cats) as $cat) {
907
  update_usermeta($user_id, 's2_cat' . $cat, "$cat");
908
  }
 
 
 
 
 
 
 
 
 
 
909
  } else {
910
  update_usermeta($user_id, 's2_subscribed', '-1');
911
  }
@@ -972,13 +985,13 @@ class s2class {
972
  if (!empty($remain)) {
973
  // remove subscription to these cat IDs and update s2_subscribed
974
  foreach ($cats as $id) {
975
- delete_usermeta($user_ID, 's2_cat' . $id);
976
  }
977
  update_usermeta($user_ID, 's2_subscribed', implode(',', $remain));
978
  } else {
979
  // remove subscription to these cat IDs and update s2_subscribed to ''
980
  foreach ($cats as $id) {
981
- delete_usermeta($user_ID, 's2_cat' . $id);
982
  }
983
  update_usermeta($user_ID, 's2_subscribed', '-1');
984
  }
@@ -1007,19 +1020,6 @@ class s2class {
1007
  update_usermeta($user_ID, 's2_subscribed', implode(',', $newcats));
1008
  }
1009
  } // end autosub_new_category
1010
-
1011
- /**
1012
- Get admin data from record 1 or first user with admin rights
1013
- */
1014
- function get_userdata() {
1015
- global $wpdb;
1016
- $admin = get_userdata(1);
1017
- if (empty($admin)) {
1018
- $sql = "SELECT DISTINCT(ID) FROM $wpdb->users INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key='" . $wpdb->prefix . "user_level' AND $wpdb->usermeta.meta_value='10' LIMIT 1";
1019
- $admin = get_userdata($wpdb->get_var($sql));
1020
- }
1021
- return $admin;
1022
- } //end get_userdata
1023
 
1024
  /* ===== Menus ===== */
1025
  /**
@@ -1036,15 +1036,8 @@ class s2class {
1036
 
1037
  $what = '';
1038
  $reminderform = false;
1039
- $action = remove_query_arg(array('what', 's2page'));
1040
- $this->action = attribute_escape($action);
1041
  $urlpath = str_replace("\\","/",S2PATH);
1042
  $urlpath = trailingslashit(get_option('siteurl')) . substr($urlpath,strpos($urlpath,"wp-content/"));
1043
- if ( isset( $_GET['s2page'] ) ) {
1044
- $page = (int) $_GET['s2page'];
1045
- } else {
1046
- $page = 1;
1047
- }
1048
 
1049
  // was anything POSTed ?
1050
  if (isset($_POST['s2_admin'])) {
@@ -1056,27 +1049,29 @@ class s2class {
1056
  }
1057
  }
1058
  $_POST['what'] = 'confirmed';
1059
- echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) subscribed!', 'subscribe2') . "</strong></p></div>";
1060
  } elseif ('delete' == $_POST['s2_admin']) {
1061
  $this->delete($_POST['email']);
1062
- echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . $_POST['email'] . ' ' . __('deleted!', 'subscribe2') . "</strong></p></div>";
1063
  } elseif ('toggle' == $_POST['s2_admin']) {
1064
  $this->toggle($_POST['email']);
1065
- echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . $_POST['email'] . ' ' . __('status changed!', 'subscribe2') . "</strong></p></div>";
1066
  } elseif ('remind' == $_POST['s2_admin']) {
1067
  $this->remind($_POST['reminderemails']);
1068
- echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Reminder Email(s) Sent!','subscribe2') . "</strong></p></div>";
 
 
 
1069
  } elseif ( ('register' == $_POST['s2_admin']) && ('subscribe' == $_POST['manage']) ) {
1070
  $this->subscribe_registered_users($_POST['emails'], $_POST['category']);
1071
- echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Subscribed!','subscribe2') . "</strong></p></div>";
1072
  } elseif ( ('register' == $_POST['s2_admin']) && ('unsubscribe' == $_POST['manage']) ) {
1073
  $this->unsubscribe_registered_users($_POST['emails'], $_POST['category']);
1074
- echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Unsubscribed!','subscribe2') . "</strong></p></div>";
1075
  }
1076
  }
1077
 
1078
  if (isset($_POST['what'])) {
1079
- $page = 1;
1080
  if ('all' == $_POST['what']) {
1081
  $what = 'all';
1082
  $confirmed = $this->get_public();
@@ -1089,14 +1084,14 @@ class s2class {
1089
  $subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
1090
  } elseif ('confirmed' == $_POST['what']) {
1091
  $what = 'confirmed';
1092
- $confirmed = $this->get_public();
1093
  $subscribers = $confirmed;
1094
  } elseif ('unconfirmed' == $_POST['what']) {
1095
  $what = 'unconfirmed';
1096
- $unconfirmed = $this->get_public(0);
1097
  $subscribers = $unconfirmed;
1098
- if (!empty($subscribers)) {
1099
- $reminderemails = implode(",", $subscribers);
1100
  $reminderform = true;
1101
  }
1102
  } elseif (is_numeric($_POST['what'])) {
@@ -1106,36 +1101,6 @@ class s2class {
1106
  $what = 'registered';
1107
  $subscribers = $registered;
1108
  }
1109
- } elseif (isset($_GET['what'])) {
1110
- if ('all' == $_GET['what']) {
1111
- $what = 'all';
1112
- $confirmed = $this->get_public();
1113
- $unconfirmed = $this->get_public(0);
1114
- $subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$registered);
1115
- } elseif ('public' == $_GET['what']) {
1116
- $what = 'public';
1117
- $confirmed = $this->get_public();
1118
- $unconfirmed = $this->get_public(0);
1119
- $subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
1120
- } elseif ('confirmed' == $_GET['what']) {
1121
- $what = 'confirmed';
1122
- $confirmed = $this->get_public();
1123
- $subscribers = $confirmed;
1124
- } elseif ('unconfirmed' == $_GET['what']) {
1125
- $what = 'unconfirmed';
1126
- $unconfirmed = $this->get_public(0);
1127
- $subscribers = $unconfirmed;
1128
- if (!empty($subscribers)) {
1129
- $reminderemails = implode(",", $subscribers);
1130
- $reminderform = true;
1131
- }
1132
- } elseif (is_numeric($_GET['what'])) {
1133
- $what = intval($_GET['what']);
1134
- $subscribers = $this->get_registered("cats=$what");
1135
- } elseif ('registered' == $_GET['what']) {
1136
- $what = 'registered';
1137
- $subscribers = $registered;
1138
- }
1139
  } elseif ('' == $what) {
1140
  $what = 'registered';
1141
  $subscribers = $registered;
@@ -1156,35 +1121,6 @@ class s2class {
1156
  }
1157
  if (!empty($subscribers)) {
1158
  natcasesort($subscribers);
1159
- // Displays a page number strip - adapted from code in Akismet
1160
- $args['what'] = $what;
1161
- $total_subscribers = count($subscribers);
1162
- $total_pages = ceil($total_subscribers / 50);
1163
- $strip = '';
1164
- if ( $page > 1 ) {
1165
- $args['s2page'] = $page - 1;
1166
- $strip .= '<a class="prev" href="' . clean_url(add_query_arg( $args )) . '">&laquo; '. __('Previous Page', 'subscribe2') .'</a>' . "\n";
1167
- }
1168
- if ( $total_pages > 1 ) {
1169
- for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) {
1170
- if ( $page == $page_num ) {
1171
- $strip .= "<strong>" . $page_num . "</strong>\n";
1172
- } else {
1173
- if ( $page_num < 3 || ( $page_num >= $page - 2 && $page_num <= $page + 2 ) || $page_num > $total_pages - 2 ) {
1174
- $args['s2page'] = $page_num;
1175
- $strip .= "<a class=\"page-numbers\" href=\"" . clean_url(add_query_arg($args)) . "\">" . $page_num . "</a>\n";
1176
- $trunc = true;
1177
- } elseif ( $trunc == true ) {
1178
- $strip .= "...\n";
1179
- $trunc = false;
1180
- }
1181
- }
1182
- }
1183
- }
1184
- if ( ( $page ) * 50 < $total_subscribers ) {
1185
- $args['s2page'] = $page + 1;
1186
- $strip .= "<a class=\"next\" href=\"" . clean_url(add_query_arg($args)) . "\">". __('Next Page', 'subscribe2') . " &raquo;</a>\n";
1187
- }
1188
  }
1189
  // safety check for our arrays
1190
  if ('' == $confirmed) { $confirmed = array(); }
@@ -1194,41 +1130,38 @@ class s2class {
1194
  // show our form
1195
  echo "<div class=\"wrap\">";
1196
  echo "<h2>" . __('Subscribe Addresses', 'subscribe2') . "</h2>\r\n";
1197
- echo "<form method=\"post\" action=\"$this->action\">\r\n";
1198
- echo "<p>";
1199
  if (function_exists('wp_nonce_field')) {
1200
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1201
  }
1202
  echo __('Enter addresses, one per line or comma-seperated', 'subscribe2') . "<br />\r\n";
1203
- echo "<textarea rows=\"2\" cols=\"80\" name=\"addresses\"></textarea></p>\r\n";
1204
- echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Subscribe', 'subscribe2') . "\"/>\r\n";
1205
- echo "<input type=\"hidden\" name=\"s2_admin\" value=\"subscribe\" /></p>";
1206
  echo "</form></div>";
1207
 
1208
  // subscriber lists
1209
  echo "<div class=\"wrap\"><h2>" . __('Subscribers', 'subscribe2') . "</h2>\r\n";
1210
- echo "<br />";
1211
  $this->display_subscriber_dropdown($what, __('Filter', 'subscribe2'));
1212
  // show the selected subscribers
1213
  $alternate = 'alternate';
1214
  if (!empty($subscribers)) {
1215
  echo "<p align=\"center\"><b>" . __('Registered on the left, confirmed in the middle, unconfirmed on the right', 'subscribe2') . "</b></p>\r\n";
1216
- $exportcsv = implode(",", $subscribers);
1217
- echo "<form method=\"post\" action=\"\">\r\n";
1218
- if (function_exists('wp_nonce_field')) {
1219
- wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
 
 
 
 
 
 
1220
  }
1221
- echo "<input type=\"hidden\" name=\"exportcsv\" value=\"$exportcsv\" />\r\n";
1222
- echo "<input type=\"hidden\" name=\"s2_admin\" value=\"exportcsv\" />\r\n";
1223
- echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Save Emails to CSV File','subscribe2') . "\" /></p>\r\n";
1224
- echo "</form>\r\n";
1225
  }
1226
- echo "<p>" . $strip . "</p>";
1227
  echo "<table cellpadding=\"2\" cellspacing=\"2\">";
1228
  if (!empty($subscribers)) {
1229
- $subscriber_chunks = array_chunk($subscribers, 50);
1230
- $chunk = $page - 1;
1231
- $subscribers = $subscriber_chunks[$chunk];
1232
  foreach ($subscribers as $subscriber) {
1233
  echo "<tr class=\"$alternate\">";
1234
  echo "<td width=\"75%\"";
@@ -1243,7 +1176,7 @@ class s2class {
1243
  if (in_array($subscriber, $unconfirmed) || in_array($subscriber, $confirmed) ) {
1244
  echo "(" . $this->signup_date($subscriber) . ")</td>\r\n";
1245
  echo "<td width=\"5%\" align=\"center\">\r\n";
1246
- echo "<form method=\"post\" action=\"$this->action\">";
1247
  if (function_exists('wp_nonce_field')) {
1248
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1249
  }
@@ -1263,12 +1196,12 @@ class s2class {
1263
  if (function_exists('wp_nonce_field')) {
1264
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1265
  }
 
1266
  echo "<input type=\"hidden\" name=\"email\" value=\"$subscriber\" />\r\n";
1267
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"delete\" />\r\n";
1268
  echo "<input type=\"hidden\" name=\"what\" value=\"$what\" />\r\n";
1269
- echo "<p class=\"delete\">\r\n";
1270
- echo "<input type=\"image\" src=\"" . $urlpath . "include/cross.png\" name=\"submit\" value=\"X\" />\r\n";
1271
- echo "</p></form>";
1272
  }
1273
  echo "</td></tr>\r\n";
1274
  ('alternate' == $alternate) ? $alternate = '' : $alternate = 'alternate';
@@ -1277,9 +1210,8 @@ class s2class {
1277
  echo "<tr><td align=\"center\"><b>" . __('NONE', 'subscribe2') . "</b></td></tr>\r\n";
1278
  }
1279
  echo "</table>";
1280
- echo "<p>" . $strip . "</p>";
1281
  if ($reminderform) {
1282
- echo "<form method=\"post\" action=\"$this->action\">\r\n";
1283
  if (function_exists('wp_nonce_field')) {
1284
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1285
  }
@@ -1293,10 +1225,8 @@ class s2class {
1293
  //show bulk managment form
1294
  echo "<div class=\"wrap\">";
1295
  echo "<h2>" . __('Categories', 'subscribe2') . "</h2>\r\n";
1296
- echo "<p>";
1297
  echo __('Existing Registered Users can be automatically (un)subscribed to categories using this section.', 'subscribe2') . "<br />\r\n";
1298
  echo "<strong><em style=\"color: red\">" . __('Consider User Privacy as changes cannot be undone', 'subscribe2') . "</em></strong><br />\r\n";
1299
- echo "</p>";
1300
  echo "<form method=\"post\" action=\"\">\r\n";
1301
  if (function_exists('wp_nonce_field')) {
1302
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
@@ -1327,7 +1257,7 @@ class s2class {
1327
  check_admin_referer('subscribe2-options_subscribers' . $s2nonce);
1328
  if ('RESET' == $_POST['s2_admin']) {
1329
  $this->reset();
1330
- echo "<div id=\"message\" class=\"updated fade\"><p><strong>$this->options_reset</strong></p></div>";
1331
  } elseif ('options' == $_POST['s2_admin']) {
1332
  // excluded categories
1333
  if (!empty($_POST['category'])) {
@@ -1344,10 +1274,6 @@ class s2class {
1344
  ($_POST['show_button'] == '1') ? $showbutton = '1' : $showbutton = '0';
1345
  $this->subscribe2_options['show_button'] = $showbutton;
1346
 
1347
- // show widget in Presentation->Widgets
1348
- ($_POST['widget'] == '1') ? $showwidget = '1' : $showwidget = '0';
1349
- $this->subscribe2_options['widget'] = $showwidget;
1350
-
1351
  // send as author or admin?
1352
  $sender = 'author';
1353
  if ('admin' == $_POST['sender']) {
@@ -1355,22 +1281,15 @@ class s2class {
1355
  }
1356
  $this->subscribe2_options['sender'] = $sender;
1357
 
1358
- // send email for pages, private and password protected posts
1359
  $pages_option = $_POST['pages'];
1360
  $this->subscribe2_options['pages']= $pages_option;
1361
  $password_option = $_POST['password'];
1362
  $this->subscribe2_options['password']= $password_option;
1363
- $private_option = $_POST['private'];
1364
- $this->subscribe2_options['private'] = $private_option;
1365
 
1366
  // send per-post or digest emails
1367
  $email_freq = $_POST['email_freq'];
1368
- if ($email_freq != $this->subscribe2_options['email_freq']) {
1369
- //ensure $timestamp is used if cron period changes
1370
- $check = true;
1371
- }
1372
  $this->subscribe2_options['email_freq'] = $email_freq;
1373
- $previous_time = wp_next_scheduled('s2_digest_cron');
1374
  wp_clear_scheduled_hook('s2_digest_cron');
1375
  $scheds = (array) wp_get_schedules();
1376
  $interval = ( isset($scheds[$email_freq]['interval']) ) ? (int) $scheds[$email_freq]['interval'] : 0;
@@ -1380,20 +1299,8 @@ class s2class {
1380
  } else {
1381
  if (!wp_next_scheduled('s2_digest_cron')) {
1382
  // if we are using digest schedule the event and prime last_cron as now
1383
- $time = current_time('timestamp') + $interval;
1384
- if ($interval < 86400) {
1385
- // Schedule CRON events occurring less than daily starting now and periodically thereafter
1386
- $timestamp = &$time;
1387
- } else {
1388
- // Schedule other CRON events starting at midnight and periodically thereafter
1389
- $timestamp = mktime($_POST['hour'], 0, 0, date('m', $time), date('d', $time), date('Y', $time));
1390
- }
1391
- if ( ('on' == $_POST['reset_cron']) || $check ) {
1392
- wp_schedule_event($timestamp, $email_freq, 's2_digest_cron');
1393
- } else {
1394
- wp_schedule_event($previous_time, $email_freq, 's2_digest_cron');
1395
- }
1396
- $now = date('Y-m-d H:i:s', $time);
1397
  $this->subscribe2_options['last_s2cron'] = $now;
1398
  }
1399
  }
@@ -1417,7 +1324,7 @@ class s2class {
1417
  //barred domains
1418
  $barred_option = $_POST['barred'];
1419
  $this->subscribe2_options['barred'] = $barred_option;
1420
- echo "<div id=\"message\" class=\"updated fade\"><p><strong>$this->options_saved</strong></p></div>";
1421
  update_option('subscribe2_options', $this->subscribe2_options);
1422
  }
1423
  }
@@ -1429,7 +1336,6 @@ class s2class {
1429
  }
1430
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"options\" />\r\n";
1431
  echo "<h2>" . __('Delivery Options', 'subscribe2') . ":</h2>\r\n";
1432
- echo "<p>";
1433
  echo __('Send Emails for Pages', 'subscribe2') . ': ';
1434
  echo "<input type=\"radio\" name=\"pages\" value=\"yes\"";
1435
  if ('yes' == $this->subscribe2_options['pages']) {
@@ -1452,17 +1358,6 @@ class s2class {
1452
  echo " checked=\"checked\"";
1453
  }
1454
  echo " /> " . __('No', 'subscribe2') . "<br /><br />\r\n";
1455
- echo __('Send Emails for Private Posts', 'subscribe2') . ': ';
1456
- echo "<input type=\"radio\" name=\"private\" value=\"yes\"";
1457
- if ('yes' == $this->subscribe2_options['private']) {
1458
- echo " checked=\"checked\"";
1459
- }
1460
- echo " /> " . __('Yes', 'subscribe2') . " &nbsp;&nbsp;";
1461
- echo "<input type=\"radio\" name=\"private\" value=\"no\"";
1462
- if ('no' == $this->subscribe2_options['private']) {
1463
- echo " checked=\"checked\"";
1464
- }
1465
- echo " /> " . __('No', 'subscribe2') . "<br /><br />\r\n";
1466
  echo __('Send Email From', 'subscribe2') . ': ';
1467
  echo "<input type=\"radio\" name=\"sender\" value=\"author\"";
1468
  if ('author' == $this->subscribe2_options['sender']) {
@@ -1477,10 +1372,9 @@ class s2class {
1477
  if (function_exists('wp_schedule_event')) {
1478
  echo __('Send Email as Digest', 'subscribe2') . ": <br /><br />\r\n";
1479
  $this->display_digest_choices();
 
1480
  }
1481
- echo "</p>";
1482
  echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
1483
- echo"<br />";
1484
  echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"1\" class=\"editform\">\r\n";
1485
  echo "<tr><td>";
1486
  echo __('New Post email (must not be empty)', 'subscribe2') . ":";
@@ -1491,10 +1385,10 @@ class s2class {
1491
  echo "<dl>";
1492
  echo "<dt><b>BLOGNAME</b></dt><dd>" . get_bloginfo('name') . "</dd>\r\n";
1493
  echo "<dt><b>BLOGLINK</b></dt><dd>" . get_bloginfo('url') . "</dd>\r\n";
1494
- echo "<dt><b>TITLE</b></dt><dd>" . __("the post's title<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
1495
  echo "<dt><b>POST</b></dt><dd>" . __("the excerpt or the entire post<br />(<i>based on the subscriber's preferences</i>)", 'subscribe2') . "</dd>\r\n";
1496
- echo "<dt><b>TABLE</b></dt><dd>" . __("a list of post titles<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
1497
- echo "<dt><b>PERMALINK</b></dt><dd>" . __("the post's permalink<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
1498
  echo "<dt><b>MYNAME</b></dt><dd>" . __("the admin or post author's name", 'subscribe2') . "</dd>\r\n";
1499
  echo "<dt><b>EMAIL</b></dt><dd>" . __("the admin or post author's email", 'subscribe2') . "</dd>\r\n";
1500
  echo "<dt><b>AUTHORNAME</b></dt><dd>" . __("the post author's name", 'subscribe2') . "</dd>\r\n";
@@ -1510,9 +1404,7 @@ class s2class {
1510
 
1511
  // excluded categories
1512
  echo "<h2>" . __('Excluded Categories', 'subscribe2') . "</h2>\r\n";
1513
- echo"<p>";
1514
  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";
1515
- echo"</p>";
1516
  $this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
1517
  echo "<center><input type=\"checkbox\" name=\"reg_override\" value=\"1\"";
1518
  if ('1' == $this->subscribe2_options['reg_override']) {
@@ -1522,24 +1414,14 @@ class s2class {
1522
 
1523
  // show button in QuickTags
1524
  echo "<h2>" . __('Writing Options', 'subscribe2') . "</h2>\r\n";
1525
- echo"<p>";
1526
  echo "<input type=\"checkbox\" name=\"show_button\" value=\"1\"";
1527
  if ('1' == $this->subscribe2_options['show_button']) {
1528
  echo " checked=\"checked\"";
1529
  }
1530
  echo " /> " . __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "<br /><br />\r\n";
1531
 
1532
- // show Widget
1533
- echo "<input type=\"checkbox\" name=\"widget\" value=\"1\"";
1534
- if ('1' == $this->subscribe2_options['widget']) {
1535
- echo " checked=\"checked\"";
1536
- }
1537
- echo " /> " . __('Enable Subscribe2 Widget?', 'subscribe2') . "<br /><br />\r\n";
1538
- echo"</p>";
1539
-
1540
  //Auto Subscription for new registrations
1541
  echo "<h2>" . __('Auto Subscribe', 'subscribe2') . "</h2>\r\n";
1542
- echo"<p>";
1543
  echo __('Subscribe new users registering with your blog', 'subscribe2') . ":<br />\r\n";
1544
  echo "<input type=\"radio\" name=\"autosub\" value=\"yes\"";
1545
  if ('yes' == $this->subscribe2_options['autosub']) {
@@ -1583,17 +1465,14 @@ class s2class {
1583
  echo "checked=\"checked\" ";
1584
  }
1585
  echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . " <br /><br />";
1586
- echo"</p>";
1587
 
1588
  //barred domains
1589
  echo "<h2>" . __('Barred Domains', 'subscribe2') . "</h2>\r\n";
1590
- echo"<p>";
1591
  echo __('Enter domains to bar from public subscriptions: <br /> (Use a new line for each entry and omit the "@" symbol, for example email.com)', 'subscribe2');
1592
  echo "<br />\r\n<textarea style=\"width: 98%;\" rows=\"4\" cols=\"60\" name=\"barred\">" . $this->subscribe2_options['barred'] . "</textarea>";
1593
- echo"</p>";
1594
 
1595
  // submit
1596
- echo "<p class=\"submit\" align=\"center\"><input type=\"submit\" id=\"save\" name=\"submit\" value=\"" . __('Submit', 'subscribe2') . "\" /></p>";
1597
  echo "</form>\r\n";
1598
  echo "</div><div class=\"wrap\">";
1599
 
@@ -1604,11 +1483,11 @@ class s2class {
1604
  if (function_exists('wp_nonce_field')) {
1605
  wp_nonce_field('subscribe2-options_subscribers' . $s2nonce);
1606
  }
1607
- echo "<p class=\"submit\" align=\"center\">";
1608
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"RESET\" />";
1609
  echo "<input type=\"submit\" id=\"deletepost\" name=\"submit\" value=\"" . __('RESET', 'subscribe2') .
1610
  "\" />";
1611
- echo "</p></form></div>\r\n";
1612
 
1613
  include(ABSPATH . 'wp-admin/admin-footer.php');
1614
  // just to be sure
@@ -1649,10 +1528,10 @@ class s2class {
1649
  }
1650
  update_usermeta($user_ID, 's2_subscribed', '-1');
1651
  } elseif ($cats == 'digest') {
1652
- $all_cats = get_categories(array('hide_empty' => false));
1653
  foreach ($all_cats as $cat) {
1654
- ('' == $catids) ? $catids = "$cat->term_id" : $catids .= ",$cat->term_id";
1655
- update_usermeta($user_ID, 's2_cat' . $cat->term_id, $cat->term_id);
1656
  }
1657
  update_usermeta($user_ID, 's2_subscribed', $catids);
1658
  } else {
@@ -1682,7 +1561,6 @@ class s2class {
1682
  echo "<div class=\"wrap\">";
1683
  echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
1684
  echo "<form method=\"post\" action=\"\">";
1685
- echo "<p>";
1686
  if (function_exists('wp_nonce_field')) {
1687
  wp_nonce_field('subscribe2-user_subscribers' . $s2nonce);
1688
  }
@@ -1709,19 +1587,18 @@ class s2class {
1709
  }
1710
  echo " /> " . $value . "&nbsp;&nbsp;";
1711
  }
1712
- echo "<br /><span style=\"color: red;line-height: 300%;\">" . __('Note: HTML format will always deliver the full post', 'subscribe2') . ".</span><br />\r\n";
1713
  echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': &nbsp;&nbsp;';
1714
  echo "<input type=\"radio\" name=\"new_category\" value=\"yes\" ";
1715
  if ('yes' == get_usermeta($user_ID, 's2_autosub')) {
1716
  echo "checked=\"checked\" ";
1717
  }
1718
- echo "/> " . __('Yes', 'subscribe2') . "&nbsp;&nbsp;";
1719
  echo "<input type=\"radio\" name=\"new_category\" value=\"no\" ";
1720
  if ('no' == get_usermeta($user_ID, 's2_autosub')) {
1721
  echo "checked=\"checked\" ";
1722
  }
1723
- echo "/> " . __('No', 'subscribe2') . "<br /><br />";
1724
- echo "</p>";
1725
 
1726
  // subscribed categories
1727
  echo "<h2>" . __('Subscribed Categories', 'subscribe2') . "</h2>\r\n";
@@ -1730,22 +1607,19 @@ class s2class {
1730
  // we're doing daily digests, so just show
1731
  // subscribe / unnsubscribe
1732
  echo __('Receive daily summary of new posts?', 'subscribe2') . ': &nbsp;&nbsp;';
1733
- echo "<p>";
1734
  echo "<input type=\"radio\" name=\"category\" value=\"digest\" ";
1735
  if (get_usermeta($user_ID, 's2_subscribed') != '-1') {
1736
  echo "checked=\"yes\" ";
1737
  }
1738
- echo "/> " . __('Yes', 'subscribe2') . "<input type=\"radio\" name=\"category\" value=\"-1\" ";
1739
  if (get_usermeta($user_ID, 's2_subscribed') == '-1') {
1740
  echo "checked=\"yes\" ";
1741
  }
1742
- echo "/> " . __('No', 'subscribe2');
1743
- echo "</p>";
1744
  }
1745
 
1746
-
1747
  // submit
1748
- echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __("Update Preferences", 'subscribe2') . " &raquo;\" /></p>";
1749
  echo "</form></div>\r\n";
1750
 
1751
  include(ABSPATH . 'wp-admin/admin-footer.php');
@@ -1780,7 +1654,7 @@ class s2class {
1780
  get_currentuserinfo();
1781
  $this->myname = $user_identity;
1782
  $this->myemail = $user_email;
1783
- $subject = stripslashes(strip_tags($_POST['subject']));
1784
  $message = stripslashes($_POST['message']);
1785
  $this->mail($recipients, $subject, $message, 'text');
1786
  $message = $this->mail_sent;
@@ -1792,18 +1666,16 @@ class s2class {
1792
  // show our form
1793
  echo "<div class=\"wrap\"><h2>" . __('Send email to all subscribers', 'subscribe2') . "</h2>\r\n";
1794
  echo "<form method=\"post\" action=\"\">\r\n";
1795
- echo "<p>";
1796
  if (function_exists('wp_nonce_field')) {
1797
  wp_nonce_field('subscribe2-write_subscribers' . $s2nonce);
1798
  }
1799
- echo __('Subject', 'subscribe2') . ": <input type=\"text\" size=\"69\" name=\"subject\" value=\"" . __('A message from ', 'subscribe2') . get_option('blogname') . "\" /> <br /><br />";
1800
  echo "<textarea rows=\"12\" cols=\"75\" name=\"message\"></textarea>";
1801
- echo "<br /><br />\r\n";
1802
  echo __('Recipients: ', 'subscribe2');
1803
  $this->display_subscriber_dropdown('registered', false, array('all'));
1804
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"mail\" />";
1805
- echo "</p>";
1806
- echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Send', 'subscribe2') . "\" /></p>";
1807
  echo "</form></div>\r\n";
1808
  echo "<div style=\"clear: both;\"><p>&nbsp;</p></div>";
1809
 
@@ -1820,14 +1692,14 @@ class s2class {
1820
  function display_category_form($selected = array(), $override = 1) {
1821
  global $wpdb;
1822
 
1823
- $all_cats = get_categories(array('hide_empty' => false));
1824
  $exclude = explode(',', $this->subscribe2_options['exclude']);
1825
 
1826
  if (0 == $override) {
1827
  // registered users are not allowed to subscribe to
1828
  // excluded categories
1829
- foreach ($all_cats as $cat => $term_id) {
1830
- if (in_array($all_cats[$cat]->term_id, $exclude)) {
1831
  $cat = (int)$cat;
1832
  unset($all_cats[$cat]);
1833
  }
@@ -1845,18 +1717,18 @@ class s2class {
1845
  $j++;
1846
  }
1847
  if (0 == $j) {
1848
- echo "<input type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
1849
- if (in_array($cat->term_id, $selected)) {
1850
  echo " checked=\"checked\" ";
1851
  }
1852
- echo " /> " . $cat->name . "<br />\r\n";
1853
  } else {
1854
 
1855
- echo "<input type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
1856
- if (in_array($cat->term_id, $selected)) {
1857
  echo " checked=\"checked\" ";
1858
  }
1859
- echo " /> " . $cat->name . "<br />\r\n";
1860
  }
1861
  $i++;
1862
  }
@@ -1881,7 +1753,7 @@ class s2class {
1881
  'unconfirmed' => ' &nbsp;&nbsp;' . __('Unconfirmed', 'subscribe2'),
1882
  'registered' => __('Registered Users', 'subscribe2'));
1883
 
1884
- $all_cats = get_categories(array('hide_empty' => false));
1885
 
1886
  // count the number of subscribers
1887
  $count['confirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='1'");
@@ -1896,7 +1768,7 @@ class s2class {
1896
  $count['registered'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='s2_subscribed'");
1897
  $count['all'] = ($count['confirmed'] + $count['unconfirmed'] + $count['registered']);
1898
  foreach ($all_cats as $cat) {
1899
- $count[$cat->name] = $wpdb->get_var("SELECT COUNT(meta_value) FROM $wpdb->usermeta WHERE meta_key='s2_cat$cat->term_id'");
1900
  }
1901
 
1902
  // do have actually have some subscribers?
@@ -1906,7 +1778,7 @@ class s2class {
1906
  }
1907
 
1908
  if (false !== $submit) {
1909
- echo "<form method=\"post\" action=\"$this->action\">";
1910
  }
1911
  echo "<select name=\"what\">\r\n";
1912
  foreach ($who as $whom => $display) {
@@ -1920,21 +1792,20 @@ class s2class {
1920
 
1921
  if ($count['registered'] > 0) {
1922
  foreach ($all_cats as $cat) {
1923
- if (in_array($cat->term_id, $exclude)) { continue; }
1924
- echo "<option value=\"" . $cat->term_id . "\"";
1925
- if ($cat->term_id == $selected) { echo " selected=\"selected\" "; }
1926
- echo "> &nbsp;&nbsp;" . $cat->name . "&nbsp;(" . $count[$cat->name] . ") </option>\r\n";
1927
  }
1928
  }
1929
  echo "</select>";
1930
  if (false !== $submit) {
1931
- echo "<p class=\"submit\"><input type=\"submit\" value=\"$submit\" /></p></form>\r\n";
1932
  }
1933
  } // end display_subscriber_dropdown()
1934
 
1935
  function display_digest_choices() {
1936
  global $wpdb;
1937
- $scheduled_time = wp_next_scheduled('s2_digest_cron');
1938
  $schedule = (array)wp_get_schedules();
1939
  $schedule = array_merge(array('never' => array('interval' => 0, 'display' => __('Per Post Email','subscribe2'))), $schedule);
1940
  $sort = array();
@@ -1951,30 +1822,13 @@ class s2class {
1951
  }
1952
  echo " /> " . $value['display'] . "<br />\r\n";
1953
  }
1954
- echo "<br />" . __('Send Digest Notification at', 'subscribe2') . ": \r\n";
1955
- $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');
1956
- echo "<select name=\"hour\">\r\n";
1957
- while ($hour = current($hours)) {
1958
- echo "<option value=\"" . key($hours) . "\"";
1959
- if (key($hours) == date('H', $scheduled_time)) {
1960
- echo " selected=\"selected\"";
1961
- }
1962
- echo ">" . $hour . "</option>\r\n";
1963
- next($hours);
1964
- }
1965
- echo "</select>\r\n";
1966
- echo "<strong><em style=\"color: red\">" . __('This option will work for digest notification sent daily or less frequently', 'subscribe2') . "</em></strong>\r\n";
1967
- if ($scheduled_time) {
1968
- echo "<p><input type=\"checkbox\" name=\"reset_cron\" /> " . __('Reset the schedule time and date for periodic email notifications', 'subscribe2') . "</p>\r\n";
1969
  $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
 
1970
  echo "<p>" . __('Current server time is', 'subscribe2') . ": \r\n";
1971
- echo "<strong>" . date($datetime, current_time('timestamp', 1)) . "</strong></p>\r\n";
1972
- echo "<p>" . __('Current blog time is', 'subscribe2') . ": \r\n";
1973
- echo "<strong>" . date($datetime, current_time('timestamp')) . "</strong></p>\r\n";
1974
- echo "<p>" . __('Next email notification will be sent when your blog time is after', 'subscribe2') . ": \r\n";
1975
- echo "<strong>" . date($datetime, wp_next_scheduled('s2_digest_cron')) . "</strong></p>\r\n";
1976
- } else {
1977
- echo "<br />";
1978
  }
1979
  } // end display_digest_choices()
1980
 
@@ -2020,7 +1874,7 @@ class s2class {
2020
  Display our form; also handles (un)subscribe requests
2021
  */
2022
  function filter($content = '') {
2023
- if ( ('' == $content) || (! strstr($content, '<!--subscribe2-->')) ) { return $content; }
2024
  $this->s2form = $this->form;
2025
 
2026
  global $user_ID;
@@ -2054,14 +1908,10 @@ class s2class {
2054
  if ('1' !== $this->is_public($this->email)) {
2055
  // the user is unknown or inactive
2056
  $this->add();
2057
- $status = $this->send_confirm('add');
2058
  // set a variable to denote that we've already run, and shouldn't run again
2059
  $this->filtered = 1; //set this to not send duplicate emails
2060
- if ($status) {
2061
- $this->s2form = $this->confirmation_sent;
2062
- } else {
2063
- $this->s2form = $this->error;
2064
- }
2065
  } else {
2066
  // they're already subscribed
2067
  $this->s2form = $this->already_subscribed;
@@ -2072,21 +1922,17 @@ class s2class {
2072
  if (false == $this->is_public($this->email)) {
2073
  $this->s2form = $this->form . $this->not_subscribed;
2074
  } else {
2075
- $status = $this->send_confirm('del');
2076
  // set a variable to denote that we've already run, and shouldn't run again
2077
  $this->filtered = 1;
2078
- if ($status) {
2079
- $this->s2form = $this->confirmation_sent;
2080
- } else {
2081
- $this->s2form = $this->error;
2082
- }
2083
  }
2084
  $this->action='unsubscribe';
2085
  }
2086
  }
2087
  }
2088
  }
2089
- return preg_replace('|(<p>)?(\n)*<!--subscribe2-->(\n)*(</p>)?|', $this->s2form, $content);
2090
  } // end filter()
2091
 
2092
  /**
@@ -2103,7 +1949,7 @@ class s2class {
2103
  if ( (defined('S2PAGE')) && (0 != S2PAGE) ) {
2104
  return "page_id=" . S2PAGE;
2105
  } else {
2106
- $id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status='publish' LIMIT 1");
2107
  if ($id) {
2108
  return "page_id=$id";
2109
  } else {
@@ -2121,124 +1967,6 @@ class s2class {
2121
  return __('Subscription Confirmation', 'subscribe2');
2122
  } // end title_filter()
2123
 
2124
- /* ===== widget functions ===== */
2125
- /**
2126
- Registers our widget so it appears with the other available
2127
- widgets and can be dragged and dropped into any active sidebars
2128
- */
2129
- function widget_subscribe2widget($args) {
2130
- extract($args);
2131
- $options = get_option('widget_subscribe2widget');
2132
- $title = empty($options['title']) ? __('Subscribe2') : $options['title'];
2133
- echo $before_widget;
2134
- echo $before_title . $title . $after_title;
2135
- echo "<div class=\"search\">";
2136
- $content = s2class::filter('<!--subscribe2-->');
2137
- echo $content;
2138
- echo "</div>";
2139
- echo $after_widget;
2140
- }
2141
-
2142
- /**
2143
- Register the optional widget control form
2144
- */
2145
- function widget_subscribe2widget_control() {
2146
- $options = $newoptions = get_option('widget_subscribe2widget');
2147
- if ($_POST["s2w-submit"]) {
2148
- $newoptions['title'] = strip_tags(stripslashes($_POST["s2w-title"]));
2149
- }
2150
- if ($options != $newoptions) {
2151
- $options = $newoptions;
2152
- update_option('widget_subscribe2widget', $options);
2153
- }
2154
- $title = htmlspecialchars($options['title'], ENT_QUOTES);
2155
- echo "<p><label for=\"s2w-title\">" . __('Title:');
2156
- echo "<input style=\"width: 250px;\" id=\"s2w-title\" name=\"s2w-title\" type=\"text\" value=\"" . $title . "\" /></label></p>";
2157
- echo "<input type=\"hidden\" id=\"s2w-submit\" name=\"s2w-submit\" value=\"1\" />";
2158
- }
2159
-
2160
- /**
2161
- Actually register the Widget into the WordPress Widget API
2162
- */
2163
- function register_subscribe2widget() {
2164
- //Check Sidebar Widget and Subscribe2 plugins are activated
2165
- if ( !function_exists('register_sidebar_widget') || !class_exists('s2class')) {
2166
- return;
2167
- } else {
2168
- register_sidebar_widget('Subscribe2Widget', array(&$this, 'widget_subscribe2widget'));
2169
- register_widget_control('Subscribe2Widget', array(&$this, 'widget_subscribe2widget_control'));
2170
- }
2171
- }
2172
-
2173
- /* ===== Write Toolbar Button Functions ===== */
2174
-
2175
- /**
2176
- Register our button in the QuickTags bar
2177
- */
2178
- function button_init() {
2179
- if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) return;
2180
- if ( 'true' == get_user_option('rich_editing') ) {
2181
- global $wp_db_version;
2182
- if ($wp_db_version >= 7098) {
2183
- //check if we are using WordPress 2.5+
2184
- add_filter('mce_external_plugins', array(&$this, 'mce3_plugin'));
2185
- add_filter('mce_buttons', array(&$this, 'mce3_button'));
2186
- } else {
2187
- // Load and append our TinyMCE external plugin
2188
- add_filter('mce_plugins', array(&$this, 'mce2_plugin'));
2189
- add_filter('mce_buttons', array(&$this, 'mce2_button'));
2190
- add_filter('tinymce_before_init', array(&$this, 'tinymce2_before_init'));
2191
- }
2192
- } else {
2193
- //use buttonsnap to add button is not using RTE
2194
- buttonsnap_separator();
2195
- buttonsnap_jsbutton(get_option('siteurl') . '/wp-content/plugins/subscribe2/include/s2_button.png', __('Subscribe2', 'subscribe2'), 's2_insert_token();');
2196
- }
2197
- }
2198
-
2199
- /**
2200
- Add buttons for WordPress 2.5+ using built in hooks
2201
- */
2202
- function mce3_plugin($arr) {
2203
- $path = get_option('siteurl') . '/wp-content/plugins/subscribe2/tinymce3/editor_plugin.js';
2204
- $arr['subscribe2'] = $path;
2205
- return $arr;
2206
- }
2207
-
2208
- function mce3_button($arr) {
2209
- $arr[] = 'subscribe2';
2210
- return $arr;
2211
- }
2212
-
2213
- // Add buttons in WordPress v2.1+, thanks to An-archos
2214
- function mce2_plugin($plugins) {
2215
- array_push($plugins, '-subscribe2quicktags');
2216
- return $plugins;
2217
- }
2218
-
2219
- function mce2_button($buttons) {
2220
- array_push($buttons, 'separator');
2221
- array_push($buttons, 'subscribe2quicktags');
2222
- return $buttons;
2223
- }
2224
-
2225
- function tinymce2_before_init() {
2226
- $this->fullpath = get_option('siteurl') . '/wp-content/plugins/subscribe2/tinymce/';
2227
- echo "tinyMCE.loadPlugin('subscribe2quicktags', '" . $this->fullpath . "');\n";
2228
- }
2229
-
2230
- function s2_edit_form() {
2231
- echo "<!-- Start Subscribe2 Quicktags Javascript -->\r\n";
2232
- echo "<script type=\"text/javascript\">\r\n";
2233
- echo "//<![CDATA[\r\n";
2234
- echo "function s2_insert_token() {
2235
- buttonsnap_settext('<!--subscribe2-->');
2236
- }\r\n";
2237
- echo "//]]>\r\n";
2238
- echo "</script>\r\n";
2239
- echo "<!-- End Subscribe2 Quicktags Javascript -->\r\n";
2240
- }
2241
-
2242
  /* ===== wp-cron functions ===== */
2243
  /**
2244
  Send a daily digest of today's new posts
@@ -2247,23 +1975,21 @@ class s2class {
2247
  global $wpdb;
2248
 
2249
  // collect posts
2250
- $now = current_time('mysql');
2251
  $prev = $this->subscribe2_options['last_s2cron'];
2252
- $posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content, post_type, post_password FROM $wpdb->posts WHERE post_date >= '$prev' AND post_date < '$now' AND post_status IN ('publish', 'private') AND post_type IN ('post', 'page')");
2253
 
2254
  // update last_s2cron execution time before completing or bailing
2255
  $this->subscribe2_options['last_s2cron'] = $now;
2256
  update_option('subscribe2_options', $this->subscribe2_options);
2257
-
2258
  // do we have any posts?
2259
  if (empty($posts)) { return; }
2260
 
2261
  // if we have posts, let's prepare the digest
2262
- $all_post_cats = array();
2263
  foreach ($posts as $post) {
2264
- $post_cats = wp_get_post_categories($post->ID);
2265
  $post_cats_string = implode(',', $post_cats);
2266
- $all_post_cats = array_unique(array_merge($all_post_cats, $post_cats));
2267
  $check = false;
2268
  // is the current post assigned to any categories
2269
  // which should not generate a notification email?
@@ -2272,22 +1998,6 @@ class s2class {
2272
  $check = true;
2273
  }
2274
  }
2275
- //is the current post set by the user to
2276
- // not generate a notification email?
2277
- $s2mail = get_post_meta($post->ID, 's2mail', true);
2278
- if (strtolower(trim($s2mail)) == 'no') {
2279
- $check = true;
2280
- }
2281
- // is the current post private
2282
- // and should this not generate a notification email?
2283
- if ( ($this->subscribe2_options['password'] == "no") && ($post->post_password != '') ) {
2284
- $check = true;
2285
- }
2286
- // is the current post a page
2287
- // and should this not generate a notification email?
2288
- if ( ($this->subscribe2_options['pages'] == 'no') && ($post->post_type == 'page') ) {
2289
- $check = true;
2290
- }
2291
  // if this post is in an excluded category,
2292
  // don't include it in the digest
2293
  if ($check) {
@@ -2316,8 +2026,17 @@ class s2class {
2316
  $message .= $excerpt . "\r\n\r\n";
2317
  }
2318
 
2319
- // get admin detailts
2320
- $user = $this->get_userdata();
 
 
 
 
 
 
 
 
 
2321
  $this->myemail = $user->user_email;
2322
  $this->myname = $user->display_name;
2323
 
@@ -2326,13 +2045,12 @@ class s2class {
2326
  $display = $scheds[$email_freq]['display'];
2327
  $subject = '[' . stripslashes(get_option('blogname')) . '] ' . $display . ' ' . __('Digest Email', 'subscribe2');
2328
  $public = $this->get_public();
2329
- $all_post_cats_string = implode(',', $all_post_cats);
2330
- $registered = $this->get_registered("cats=$all_post_cats_string");
2331
  $recipients = array_merge((array)$public, (array)$registered);
2332
  $mailtext = $this->substitute(stripslashes($this->subscribe2_options['mailtext']));
2333
- $mailtext = str_replace("TABLE", $table, $mailtext);
2334
- $mailtext = str_replace("POST", $message, $mailtext);
2335
- $this->mail($recipients, $subject, $mailtext);
2336
  } // end subscribe2_cron
2337
 
2338
  /* ===== Our constructor ===== */
@@ -2341,16 +2059,13 @@ class s2class {
2341
  */
2342
  function s2init() {
2343
  // load the options
 
2344
  $this->subscribe2_options = get_option('subscribe2_options');
2345
 
2346
  add_action('init', array(&$this, 'subscribe2'));
2347
  if ('1' == $this->subscribe2_options['show_button']) {
2348
  add_action('init', array(&$this, 'button_init'));
2349
  }
2350
- // add action to display widget if option is enabled
2351
- if ('1' == $this->subscribe2_options['widget']) {
2352
- add_action('plugins_loaded', array(&$this, 'register_subscribe2widget'));
2353
- }
2354
  }
2355
 
2356
  function subscribe2() {
@@ -2360,7 +2075,7 @@ class s2class {
2360
 
2361
  // do we need to install anything?
2362
  $this->public = $table_prefix . "subscribe2";
2363
- if (!mysql_query("DESCRIBE " . $this->public)) { $this->install(); }
2364
  //do we need to upgrade anything?
2365
  if ($this->subscribe2_options['version'] !== S2VERSION) {
2366
  add_action('shutdown', array(&$this, 'upgrade'));
@@ -2372,25 +2087,13 @@ class s2class {
2372
  add_filter('the_title', array(&$this, 'title_filter'));
2373
  add_filter('the_content', array(&$this, 'confirm'));
2374
  }
2375
-
2376
- if ( (isset($_POST['s2_admin'])) && ('exportcsv' == $_POST['s2_admin']) ) {
2377
- $date = date('Y-m-d');
2378
- header('Content-Description: File Transfer');
2379
- header("Content-type: application/octet-stream");
2380
- header("Content-Disposition: attachment; filename=subscribe2_users_$date.csv");
2381
- header("Pragma: no-cache");
2382
- header("Expires: 0");
2383
- echo $_POST['exportcsv'];
2384
 
2385
- exit(0);
2386
- }
2387
-
2388
  //add regular actions and filters
2389
  add_action('admin_head', array(&$this, 'admin_head'));
2390
  add_action('admin_menu', array(&$this, 'admin_menu'));
2391
  add_action('create_category', array(&$this, 'autosub_new_category'));
2392
  add_action('register_form', array(&$this, 'register_form'));
2393
- add_filter('the_content', array(&$this, 'filter'), 10);
2394
  add_filter('cron_schedules', array(&$this, 'add_weekly_sched'));
2395
 
2396
  // add action to display editor buttons if option is enabled
@@ -2410,25 +2113,89 @@ class s2class {
2410
  if ($this->subscribe2_options['email_freq'] != 'never') {
2411
  add_action('s2_digest_cron', array(&$this, 'subscribe2_cron'));
2412
  } else {
2413
- add_action('new_to_publish', array(&$this, 'publish'));
2414
- add_action('draft_to_publish', array(&$this, 'publish'));
2415
- add_action('pending_to_publish', array(&$this, 'publish'));
2416
- add_action('private_to_publish', array(&$this, 'publish'));
2417
- add_action('future_to_publish', array(&$this, 'publish'));
2418
- if ($this->subscribe2_options['private'] == "yes") {
2419
- add_action('new_to_private', array(&$this, 'publish'));
2420
- add_action('draft_to_private', array(&$this, 'publish'));
2421
- add_action('pending_to_private', array(&$this, 'publish'));
2422
- }
2423
  }
2424
 
2425
  // load our strings
2426
  $this->load_strings();
2427
  } // end subscribe2()
2428
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2429
  /* ===== our variables ===== */
2430
  // cache variables
2431
- var $subscribe2_options = array();
2432
  var $all_public = '';
2433
  var $all_unconfirmed = '';
2434
  var $excluded_cats = '';
3
  Plugin Name: Subscribe2
4
  Plugin URI: http://subscribe2.wordpress.com
5
  Description: Notifies an email list when new entries are posted.
6
+ Version: 3.8
7
  Author: Matthew Robinson
8
  Author URI: http://subscribe2.wordpress.com
9
  */
10
 
11
  /*
12
+ Copyright (C) 2006-7 Matthew Robinson
13
  Based on the Original Subscribe2 plugin by
14
  Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
15
 
41
 
42
  // our version number. Don't touch this or any line below
43
  // unless you know exacly what you are doing
44
+ define('S2VERSION', '3.8');
45
  define ('S2PATH', trailingslashit(dirname(__FILE__)));
46
 
 
 
 
47
  // use Owen's excellent ButtonSnap library
48
+ require(ABSPATH . 'wp-content/plugins/buttonsnap.php');
 
 
49
 
50
  $mysubscribe2 = new s2class;
51
  $mysubscribe2->s2init();
60
  function load_strings() {
61
  // adjust the output of Subscribe2 here
62
 
63
+ $this->please_log_in = "<p>" . __('To manage your subscription options please ', 'subscribe2') . "<a href=\"" . get_option('siteurl') . "/wp-login.php\">login</a>.</p>";
64
 
65
+ $this->use_profile_admin = "<p>" . __('You may manage your subscription options from your ', 'subscribe2') . "<a href=\"" . get_option('siteurl') . "/wp-admin/users.php?page=" . plugin_basename(__FILE__) . "\">profile</a>.</p>";
66
 
67
+ $this->use_profile_users = "<p>" . __('You may manage your subscription options from your ', 'subscribe2') . "<a href=\"" . get_option('siteurl') . "/wp-admin/profile.php?page=" . plugin_basename(__FILE__) . "\">profile</a>.</p>";
68
 
69
  $this->confirmation_sent = "<p>" . __('A confirmation message is on its way!', 'subscribe2') . "</p>";
70
 
76
 
77
  $this->barred_domain = "<p>" . __('Sorry, email addresses at that domain are currently barred due to spam, please use an alternative email address.', 'subscribe2') . "</p>";
78
 
 
 
79
  $this->mail_sent = "<p>" . __('Message sent!', 'subscribe2') . "</p>";
80
 
81
  $this->form = "<form method=\"post\" action=\"\">" . __('Your email:', 'subscribe2') . "&#160;<input type=\"text\" name=\"email\" value=\"\" size=\"20\" />&#160;<br /><input type=\"radio\" name=\"s2_action\" value=\"subscribe\" checked=\"checked\" /> " . __('Subscribe', 'subscribe2') . " <input type=\"radio\" name=\"s2_action\" value=\"unsubscribe\" /> " . __('Unsubscribe', 'subscribe2') . " &#160;<input type=\"submit\" value=\"" . __('Send', 'subscribe2') . "\" /></form>\r\n";
107
  function admin_menu() {
108
  add_management_page(__('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), "manage_options", __FILE__, array(&$this, 'manage_menu'));
109
  add_options_page(__('Subscribe2 Options', 'subscribe2'), __('Subscribe2','subscribe2'), "manage_options", __FILE__, array(&$this, 'options_menu'));
110
+ if (current_user_can('manage_options')) {
111
+ add_submenu_page('users.php', __('Subscriptions', 'subscribe2'), __('Subscriptions', 'subscribe2'), "read", __FILE__, array(&$this, 'user_menu'));
112
+ } else {
113
+ add_submenu_page('profile.php', __('Subscriptions', 'subscribe2'), __('Subscriptions', 'subscribe2'), "read", __FILE__, array(&$this, 'user_menu'));
114
+ }
115
  add_submenu_page('post-new.php', __('Mail Subscribers','subscribe2'), __('Mail Subscribers', 'subscribe2'),"manage_options", __FILE__, array(&$this, 'write_menu'));
116
  $s2nonce = md5('subscribe2');
117
  }
146
  function install() {
147
  // include upgrade-functions for maybe_create_table;
148
  if (!function_exists('maybe_create_table')) {
149
+ require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
150
  }
151
  $date = date('Y-m-d');
152
  $sql = "CREATE TABLE $this->public (
169
 
170
  // include upgrade-functions for maybe_create_table;
171
  if (!function_exists('maybe_create_table')) {
172
+ require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
173
  }
174
  $date = date('Y-m-d');
175
  maybe_add_column($this->public, 'date', "ALTER TABLE `$this->public` ADD `date` DATE DEFAULT '$date' NOT NULL AFTER `active`;");
204
  */
205
  function reset() {
206
  delete_option('subscribe2_options');
 
207
  unset($this->subscribe2_options);
208
  require(S2PATH . "include/options.php");
209
  update_option('subscribe2_options', $this->subscribe2_options);
235
 
236
  // Set sender details
237
  if ('' == $this->myname) {
238
+ $admin = get_userdata(1);
239
  $this->myname = $admin->display_name;
240
  $this->myemail = $admin->user_email;
241
  }
242
+ $headers = "From: " . $this->myname . " <" . $this->myemail . ">\n";
243
+ $headers .= "Return-Path: <" . $this->myemail . ">\n";
244
+ $headers .= "Reply-To: " . $this->myemail . "\n";
245
  $headers .= "X-Mailer:PHP" . phpversion() . "\n";
246
  $headers .= "Precedence: list\nList-Id: " . get_option('blogname') . "\n";
247
 
314
  if ( (defined('BCCLIMIT')) && (BCCLIMIT > 0) && (isset($batch)) ) {
315
  foreach ($batch as $bcc) {
316
  $newheaders = $headers . "$bcc\r\n";
317
+ @mail($this->myemail, $subject, $mailtext, $newheaders);
318
  }
319
  } else {
320
+ @mail($this->myemail, $subject, $mailtext, $headers);
321
  }
322
  return;
323
  } // end mail()
325
  /**
326
  Sends an email notification of a new post
327
  */
328
+ function publish($id = 0) {
329
+ if (!$id) { return $id; }
 
 
330
 
331
  // are we doing daily digests? If so, don't send anything now
332
+ if ($this->subscribe2_options['email_freq'] != 'never') { return $id; }
333
 
334
+ // we need to determine whether this is a new post, or an edit
335
+ if ($this->private) {
336
+ // this post was published from draft status
337
+ // OR is an edit of an existing post
338
+ // so send no notification
339
+ return $id;
340
  }
341
 
342
+ $post_cats = wp_get_post_cats('1', $id);
 
 
 
 
 
 
 
 
 
 
 
343
  $post_cats_string = implode(',', $post_cats);
344
  $check = false;
345
  // is the current post assigned to any categories
355
  // excluded categories?
356
  if ('0' == $this->subscribe2_options['reg_override']) {
357
  // nope? okay, let's leave
358
+ return $id;
359
  }
360
  }
361
 
362
+ global $wpdb;
363
+ $post =& get_post($id);
364
+ // is the post password protected?
365
+ if ( ($this->subscribe2_options['password'] == "no") && ($post->post_password != '') ) {return $id; }
366
+
367
+ // is this post set in the future?
368
+ if ($post->post_date > current_time('mysql')) {
369
+ // bail out
370
+ return $id;
371
  }
372
 
373
  // lets collect our public subscribers
383
  // do we have subscribers?
384
  if ( (empty($public)) && (empty($registered)) ) {
385
  // if not, no sense doing anything else
386
+ return $id;
387
  }
388
  // we set these class variables so that we can avoid
389
  // passing them in function calls a little later
390
  $this->post_title = $post->post_title;
391
+ $this->permalink = "<a href=\"" . get_permalink($id) . "\">" . get_permalink($id) . "</a>";
392
 
393
  $author = get_userdata($post->post_author);
394
  $this->authorname = $author->display_name;
399
  $user =& $author;
400
  } else {
401
  // get admin details
402
+ $user = get_userdata(1);
403
  }
404
  $this->myemail = $user->user_email;
405
  $this->myname = $user->display_name;
455
  return $id;
456
  } // end publish()
457
 
458
+ /**
459
+ Sends a notification when a draft post is published
460
+ */
461
+ function private2publish($id = 0) {
462
+ if (0 == $id) { return $id; }
463
+
464
+ $this->publish($id);
465
+ $this->private = TRUE;
466
+ return $id;
467
+ } // end private2publish()
468
+
469
+ /**
470
+ Prevents notifications from being sent when editing posts
471
+ */
472
+ function edit($id = 0) {
473
+ if (0 == $id) { return; }
474
+
475
+ $this->private = TRUE;
476
+ return $id;
477
+ }
478
+
479
  /**
480
  Send confirmation email to the user
481
  */
504
  $link .= md5($this->email);
505
  $link .= $id;
506
 
507
+ $admin = get_userdata(1);
508
  $this->myname = $admin->display_name;
509
 
510
  if ($is_remind == TRUE) {
522
 
523
  $body = str_replace("LINK", $link, $body);
524
 
525
+ $mailheaders .= "From: $admin->display_name <$admin->user_email>\n";
526
+ $mailheaders .= "Return-Path: <$admin->user_email>\n";
 
527
  $mailheaders .= "X-Mailer:PHP" . phpversion() . "\n";
528
  $mailheaders .= "Precedence: list\nList-Id: " . get_option('blogname') . "\n";
529
  $mailheaders .= "MIME-Version: 1.0\n";
530
  $mailheaders .= "Content-Type: text/plain; charset=\"". get_bloginfo('charset') . "\"\n";
531
 
532
+ @wp_mail ($this->email, $subject, $body, $mailheaders);
533
  } // end send_confirm()
534
 
535
  /* ===== Subscriber functions ===== */
648
  function remind($emails = '') {
649
  if ('' == $emails) { return false; }
650
 
651
+ $admin = get_userdata(1);
652
  $this->myname = $admin->display_name;
653
 
654
  $recipients = explode(",", $emails);
659
  }
660
  } //end remind()
661
 
662
+ /**
663
+ Export email list to CSV download
664
+ */
665
+ function exportcsv($emails = '') {
666
+ if ('' == $emails) {return false; }
667
+
668
+ $f = fopen(ABSPATH . 'wp-content/email.csv', 'w');
669
+ fwrite($f, $emails);
670
+ fclose($f);
671
+ } //end exportcsv
672
+
673
  /**
674
  Check email is not from a barred domain
675
  */
712
  $this->activate();
713
  $this->message = $this->added;
714
  $subject = '[' . get_option('blogname') . '] ' . __('New subscriber', 'subscribe2');
715
+ $message = "$this->email " . __('subscribed to email notifications!', 'subscribe2');
716
+ $recipients = $wpdb->get_col("SELECT DISTINCT(user_email) FROM $wpdb->users INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key='wp_user_level' AND $wpdb->usermeta.meta_value='10'");
717
  $this->mail($recipients, $subject, $message);
718
  $this->filtered = 1;
719
  } elseif ('0' == $action) {
830
  $AND .= "AND ($and)";
831
  }
832
 
833
+ $sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . " WHERE a.meta_key='s2_subscribed'" . $AND;
 
 
 
 
834
  $result = $wpdb->get_col($sql);
835
  if ($result) {
836
  $ids = implode(',', $result);
865
 
866
  if (0 == $user_id) { return $user_id; }
867
  $user = get_userdata($user_id);
868
+ $all_cats = get_categories('type=post&hide_empty=1&hierarchical=0');
869
 
870
  if (0 == $this->subscribe2_options['reg_override']) {
871
  // registered users are not allowed to subscribe to
872
  // excluded categories
873
  $exclude = explode(',', $this->subscribe2_options['exclude']);
874
+ foreach ($all_cats as $cat => $cat_ID) {
875
+ if (in_array($all_cats[$cat]->cat_ID, $exclude)) {
876
  $cat = (int)$cat;
877
  unset($all_cats[$cat]);
878
  }
880
  }
881
 
882
  foreach ($all_cats as $cat) {
883
+ ('' == $cats) ? $cats = "$cat->cat_ID" : $cats .= ",$cat->cat_ID";
884
  }
885
 
886
  if ('' == $cats) {
899
  update_usermeta($user_id, 's2_format', 'text');
900
  update_usermeta($user_id, 's2_excerpt', 'excerpt');
901
  } else {
902
+ // add the usermeta for new registrations, but don't subscribe them
 
 
 
 
 
 
 
 
 
 
 
 
 
 
903
  $check = get_usermeta($user_id, 's2_subscribed');
904
+ // ensure existing subscriptions are not overwritten on upgrade
905
  if (empty($check)) {
906
  if ( ('yes' == $this->subscribe2_options['autosub']) || (('wpreg' == $this->subscribe2_options['autosub']) && (1 == $wpreg)) ) {
907
+ // don't add entires by default if autosub is off, messes up daily digests
908
  update_usermeta($user_id, 's2_subscribed', $cats);
909
  foreach(explode(',', $cats) as $cat) {
910
  update_usermeta($user_id, 's2_cat' . $cat, "$cat");
911
  }
912
+ if ('html' == $this->subscribe2_options['autoformat']) {
913
+ update_usermeta($user_id, 's2_format', 'html');
914
+ update_usermeta($user_id, 's2_excerpt', 'post');
915
+ } elseif ('fulltext' == $this->subscribe2_options['autoformat']) {
916
+ update_usermeta($user_id, 's2_format', 'text');
917
+ update_usermeta($user_id, 's2_excerpt', 'post');
918
+ } else {
919
+ update_usermeta($user_id, 's2_format', 'text');
920
+ update_usermeta($user_id, 's2_excerpt', 'excerpt');
921
+ }
922
  } else {
923
  update_usermeta($user_id, 's2_subscribed', '-1');
924
  }
985
  if (!empty($remain)) {
986
  // remove subscription to these cat IDs and update s2_subscribed
987
  foreach ($cats as $id) {
988
+ delete_usermeta($user_ID, 's2_cat' . $id, "$id");
989
  }
990
  update_usermeta($user_ID, 's2_subscribed', implode(',', $remain));
991
  } else {
992
  // remove subscription to these cat IDs and update s2_subscribed to ''
993
  foreach ($cats as $id) {
994
+ delete_usermeta($user_ID, 's2_cat' . $id, "$id");
995
  }
996
  update_usermeta($user_ID, 's2_subscribed', '-1');
997
  }
1020
  update_usermeta($user_ID, 's2_subscribed', implode(',', $newcats));
1021
  }
1022
  } // end autosub_new_category
 
 
 
 
 
 
 
 
 
 
 
 
 
1023
 
1024
  /* ===== Menus ===== */
1025
  /**
1036
 
1037
  $what = '';
1038
  $reminderform = false;
 
 
1039
  $urlpath = str_replace("\\","/",S2PATH);
1040
  $urlpath = trailingslashit(get_option('siteurl')) . substr($urlpath,strpos($urlpath,"wp-content/"));
 
 
 
 
 
1041
 
1042
  // was anything POSTed ?
1043
  if (isset($_POST['s2_admin'])) {
1049
  }
1050
  }
1051
  $_POST['what'] = 'confirmed';
1052
+ echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . __('Address(es) subscribed!', 'subscribe2') . "</p></strong></div>";
1053
  } elseif ('delete' == $_POST['s2_admin']) {
1054
  $this->delete($_POST['email']);
1055
+ echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . $_POST['email'] . ' ' . __('deleted!', 'subscribe2') . "</p></strong></div>";
1056
  } elseif ('toggle' == $_POST['s2_admin']) {
1057
  $this->toggle($_POST['email']);
1058
+ echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . $_POST['email'] . ' ' . __('status changed!', 'subscribe2') . "</p></strong></div>";
1059
  } elseif ('remind' == $_POST['s2_admin']) {
1060
  $this->remind($_POST['reminderemails']);
1061
+ echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . __('Reminder Email(s) Sent!','subscribe2') . "</p></strong></div>";
1062
+ } elseif ('exportcsv' == $_POST['s2_admin']) {
1063
+ $this->exportcsv($_POST['exportcsv']);
1064
+ echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . __('CSV File Created in wp-content','subscribe2') . "</p></strong></div>";
1065
  } elseif ( ('register' == $_POST['s2_admin']) && ('subscribe' == $_POST['manage']) ) {
1066
  $this->subscribe_registered_users($_POST['emails'], $_POST['category']);
1067
+ echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . __('Registered Users Subscribed!','subscribe2') . "</p></strong></div>";
1068
  } elseif ( ('register' == $_POST['s2_admin']) && ('unsubscribe' == $_POST['manage']) ) {
1069
  $this->unsubscribe_registered_users($_POST['emails'], $_POST['category']);
1070
+ echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . __('Registered Users Unsubscribed!','subscribe2') . "</p></strong></div>";
1071
  }
1072
  }
1073
 
1074
  if (isset($_POST['what'])) {
 
1075
  if ('all' == $_POST['what']) {
1076
  $what = 'all';
1077
  $confirmed = $this->get_public();
1084
  $subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
1085
  } elseif ('confirmed' == $_POST['what']) {
1086
  $what = 'confirmed';
1087
+ $confirmed = $this->get_public();
1088
  $subscribers = $confirmed;
1089
  } elseif ('unconfirmed' == $_POST['what']) {
1090
  $what = 'unconfirmed';
1091
+ $unconfirmed = $this->get_public(0);
1092
  $subscribers = $unconfirmed;
1093
+ if (!empty($unconfirmed)) {
1094
+ $reminderemails = implode(",", $unconfirmed);
1095
  $reminderform = true;
1096
  }
1097
  } elseif (is_numeric($_POST['what'])) {
1101
  $what = 'registered';
1102
  $subscribers = $registered;
1103
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1104
  } elseif ('' == $what) {
1105
  $what = 'registered';
1106
  $subscribers = $registered;
1121
  }
1122
  if (!empty($subscribers)) {
1123
  natcasesort($subscribers);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1124
  }
1125
  // safety check for our arrays
1126
  if ('' == $confirmed) { $confirmed = array(); }
1130
  // show our form
1131
  echo "<div class=\"wrap\">";
1132
  echo "<h2>" . __('Subscribe Addresses', 'subscribe2') . "</h2>\r\n";
1133
+ echo "<form method=\"post\" action=\"\">\r\n";
 
1134
  if (function_exists('wp_nonce_field')) {
1135
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1136
  }
1137
  echo __('Enter addresses, one per line or comma-seperated', 'subscribe2') . "<br />\r\n";
1138
+ echo "<textarea rows=\"2\" cols=\"80\" name=\"addresses\"></textarea><br />\r\n";
1139
+ echo "<span class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Subscribe', 'subscribe2') . "\"/>\r\n";
1140
+ echo "<input type=\"hidden\" name=\"s2_admin\" value=\"subscribe\" /></span>";
1141
  echo "</form></div>";
1142
 
1143
  // subscriber lists
1144
  echo "<div class=\"wrap\"><h2>" . __('Subscribers', 'subscribe2') . "</h2>\r\n";
1145
+
1146
  $this->display_subscriber_dropdown($what, __('Filter', 'subscribe2'));
1147
  // show the selected subscribers
1148
  $alternate = 'alternate';
1149
  if (!empty($subscribers)) {
1150
  echo "<p align=\"center\"><b>" . __('Registered on the left, confirmed in the middle, unconfirmed on the right', 'subscribe2') . "</b></p>\r\n";
1151
+ if (is_writable(ABSPATH . 'wp-content')) {
1152
+ $exportcsv = implode(",", $subscribers);
1153
+ echo "<form method=\"post\" action=\"\">\r\n";
1154
+ if (function_exists('wp_nonce_field')) {
1155
+ wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1156
+ }
1157
+ echo "<input type=\"hidden\" name=\"exportcsv\" value=\"$exportcsv\" />\r\n";
1158
+ echo "<input type=\"hidden\" name=\"s2_admin\" value=\"exportcsv\" />\r\n";
1159
+ echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Save Emails to CSV File','subscribe2') . "\" /></p>\r\n";
1160
+ echo "</form>\r\n";
1161
  }
 
 
 
 
1162
  }
 
1163
  echo "<table cellpadding=\"2\" cellspacing=\"2\">";
1164
  if (!empty($subscribers)) {
 
 
 
1165
  foreach ($subscribers as $subscriber) {
1166
  echo "<tr class=\"$alternate\">";
1167
  echo "<td width=\"75%\"";
1176
  if (in_array($subscriber, $unconfirmed) || in_array($subscriber, $confirmed) ) {
1177
  echo "(" . $this->signup_date($subscriber) . ")</td>\r\n";
1178
  echo "<td width=\"5%\" align=\"center\">\r\n";
1179
+ echo "<form method=\"post\" action=\"\">";
1180
  if (function_exists('wp_nonce_field')) {
1181
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1182
  }
1196
  if (function_exists('wp_nonce_field')) {
1197
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1198
  }
1199
+ echo "<span class=\"delete\">\r\n";
1200
  echo "<input type=\"hidden\" name=\"email\" value=\"$subscriber\" />\r\n";
1201
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"delete\" />\r\n";
1202
  echo "<input type=\"hidden\" name=\"what\" value=\"$what\" />\r\n";
1203
+ echo "<input type=\"image\" src=\"" . $urlpath . "include/cross.png\"name=\"submit\" value=\"X\" />\r\n";
1204
+ echo "</span></form>";
 
1205
  }
1206
  echo "</td></tr>\r\n";
1207
  ('alternate' == $alternate) ? $alternate = '' : $alternate = 'alternate';
1210
  echo "<tr><td align=\"center\"><b>" . __('NONE', 'subscribe2') . "</b></td></tr>\r\n";
1211
  }
1212
  echo "</table>";
 
1213
  if ($reminderform) {
1214
+ echo "<form method=\"post\" action=\"\">\r\n";
1215
  if (function_exists('wp_nonce_field')) {
1216
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1217
  }
1225
  //show bulk managment form
1226
  echo "<div class=\"wrap\">";
1227
  echo "<h2>" . __('Categories', 'subscribe2') . "</h2>\r\n";
 
1228
  echo __('Existing Registered Users can be automatically (un)subscribed to categories using this section.', 'subscribe2') . "<br />\r\n";
1229
  echo "<strong><em style=\"color: red\">" . __('Consider User Privacy as changes cannot be undone', 'subscribe2') . "</em></strong><br />\r\n";
 
1230
  echo "<form method=\"post\" action=\"\">\r\n";
1231
  if (function_exists('wp_nonce_field')) {
1232
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1257
  check_admin_referer('subscribe2-options_subscribers' . $s2nonce);
1258
  if ('RESET' == $_POST['s2_admin']) {
1259
  $this->reset();
1260
+ echo "<div id=\"message\" class=\"updated fade\"><strong><p>$this->options_reset</p></strong></div>";
1261
  } elseif ('options' == $_POST['s2_admin']) {
1262
  // excluded categories
1263
  if (!empty($_POST['category'])) {
1274
  ($_POST['show_button'] == '1') ? $showbutton = '1' : $showbutton = '0';
1275
  $this->subscribe2_options['show_button'] = $showbutton;
1276
 
 
 
 
 
1277
  // send as author or admin?
1278
  $sender = 'author';
1279
  if ('admin' == $_POST['sender']) {
1281
  }
1282
  $this->subscribe2_options['sender'] = $sender;
1283
 
1284
+ // send email for pages and password protected posts
1285
  $pages_option = $_POST['pages'];
1286
  $this->subscribe2_options['pages']= $pages_option;
1287
  $password_option = $_POST['password'];
1288
  $this->subscribe2_options['password']= $password_option;
 
 
1289
 
1290
  // send per-post or digest emails
1291
  $email_freq = $_POST['email_freq'];
 
 
 
 
1292
  $this->subscribe2_options['email_freq'] = $email_freq;
 
1293
  wp_clear_scheduled_hook('s2_digest_cron');
1294
  $scheds = (array) wp_get_schedules();
1295
  $interval = ( isset($scheds[$email_freq]['interval']) ) ? (int) $scheds[$email_freq]['interval'] : 0;
1299
  } else {
1300
  if (!wp_next_scheduled('s2_digest_cron')) {
1301
  // if we are using digest schedule the event and prime last_cron as now
1302
+ wp_schedule_event(time() + $interval, $email_freq, 's2_digest_cron');
1303
+ $now = date('Y-m-d H:i:s', time());
 
 
 
 
 
 
 
 
 
 
 
 
1304
  $this->subscribe2_options['last_s2cron'] = $now;
1305
  }
1306
  }
1324
  //barred domains
1325
  $barred_option = $_POST['barred'];
1326
  $this->subscribe2_options['barred'] = $barred_option;
1327
+ echo "<div id=\"message\" class=\"updated fade\"><strong><p>$this->options_saved</p></strong></div>";
1328
  update_option('subscribe2_options', $this->subscribe2_options);
1329
  }
1330
  }
1336
  }
1337
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"options\" />\r\n";
1338
  echo "<h2>" . __('Delivery Options', 'subscribe2') . ":</h2>\r\n";
 
1339
  echo __('Send Emails for Pages', 'subscribe2') . ': ';
1340
  echo "<input type=\"radio\" name=\"pages\" value=\"yes\"";
1341
  if ('yes' == $this->subscribe2_options['pages']) {
1358
  echo " checked=\"checked\"";
1359
  }
1360
  echo " /> " . __('No', 'subscribe2') . "<br /><br />\r\n";
 
 
 
 
 
 
 
 
 
 
 
1361
  echo __('Send Email From', 'subscribe2') . ': ';
1362
  echo "<input type=\"radio\" name=\"sender\" value=\"author\"";
1363
  if ('author' == $this->subscribe2_options['sender']) {
1372
  if (function_exists('wp_schedule_event')) {
1373
  echo __('Send Email as Digest', 'subscribe2') . ": <br /><br />\r\n";
1374
  $this->display_digest_choices();
1375
+ echo "<br />\r\n";
1376
  }
 
1377
  echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
 
1378
  echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"1\" class=\"editform\">\r\n";
1379
  echo "<tr><td>";
1380
  echo __('New Post email (must not be empty)', 'subscribe2') . ":";
1385
  echo "<dl>";
1386
  echo "<dt><b>BLOGNAME</b></dt><dd>" . get_bloginfo('name') . "</dd>\r\n";
1387
  echo "<dt><b>BLOGLINK</b></dt><dd>" . get_bloginfo('url') . "</dd>\r\n";
1388
+ echo "<dt><b>TITLE</b></dt><dd>" . __("the post's title", 'subscribe2') . "</dd>\r\n";
1389
  echo "<dt><b>POST</b></dt><dd>" . __("the excerpt or the entire post<br />(<i>based on the subscriber's preferences</i>)", 'subscribe2') . "</dd>\r\n";
1390
+ echo "<dt><b>TABLE</b></dt><dd>" . __("a list of post titles (for digest emails)", 'subscribe2') . "</dd>\r\n";
1391
+ echo "<dt><b>PERMALINK</b></dt><dd>" . __("the post's permalink", 'subscribe2') . "</dd>\r\n";
1392
  echo "<dt><b>MYNAME</b></dt><dd>" . __("the admin or post author's name", 'subscribe2') . "</dd>\r\n";
1393
  echo "<dt><b>EMAIL</b></dt><dd>" . __("the admin or post author's email", 'subscribe2') . "</dd>\r\n";
1394
  echo "<dt><b>AUTHORNAME</b></dt><dd>" . __("the post author's name", 'subscribe2') . "</dd>\r\n";
1404
 
1405
  // excluded categories
1406
  echo "<h2>" . __('Excluded Categories', 'subscribe2') . "</h2>\r\n";
 
1407
  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";
 
1408
  $this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
1409
  echo "<center><input type=\"checkbox\" name=\"reg_override\" value=\"1\"";
1410
  if ('1' == $this->subscribe2_options['reg_override']) {
1414
 
1415
  // show button in QuickTags
1416
  echo "<h2>" . __('Writing Options', 'subscribe2') . "</h2>\r\n";
 
1417
  echo "<input type=\"checkbox\" name=\"show_button\" value=\"1\"";
1418
  if ('1' == $this->subscribe2_options['show_button']) {
1419
  echo " checked=\"checked\"";
1420
  }
1421
  echo " /> " . __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "<br /><br />\r\n";
1422
 
 
 
 
 
 
 
 
 
1423
  //Auto Subscription for new registrations
1424
  echo "<h2>" . __('Auto Subscribe', 'subscribe2') . "</h2>\r\n";
 
1425
  echo __('Subscribe new users registering with your blog', 'subscribe2') . ":<br />\r\n";
1426
  echo "<input type=\"radio\" name=\"autosub\" value=\"yes\"";
1427
  if ('yes' == $this->subscribe2_options['autosub']) {
1465
  echo "checked=\"checked\" ";
1466
  }
1467
  echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . " <br /><br />";
 
1468
 
1469
  //barred domains
1470
  echo "<h2>" . __('Barred Domains', 'subscribe2') . "</h2>\r\n";
 
1471
  echo __('Enter domains to bar from public subscriptions: <br /> (Use a new line for each entry and omit the "@" symbol, for example email.com)', 'subscribe2');
1472
  echo "<br />\r\n<textarea style=\"width: 98%;\" rows=\"4\" cols=\"60\" name=\"barred\">" . $this->subscribe2_options['barred'] . "</textarea>";
 
1473
 
1474
  // submit
1475
+ echo "<p align=\"center\"><span class=\"submit\"><input type=\"submit\" id=\"save\" name=\"submit\" value=\"" . __('Submit', 'subscribe2') . "\" /></span></p>";
1476
  echo "</form>\r\n";
1477
  echo "</div><div class=\"wrap\">";
1478
 
1483
  if (function_exists('wp_nonce_field')) {
1484
  wp_nonce_field('subscribe2-options_subscribers' . $s2nonce);
1485
  }
1486
+ echo "<p align=\"center\"><span class=\"submit\">";
1487
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"RESET\" />";
1488
  echo "<input type=\"submit\" id=\"deletepost\" name=\"submit\" value=\"" . __('RESET', 'subscribe2') .
1489
  "\" />";
1490
+ echo "</span></p></form></div>\r\n";
1491
 
1492
  include(ABSPATH . 'wp-admin/admin-footer.php');
1493
  // just to be sure
1528
  }
1529
  update_usermeta($user_ID, 's2_subscribed', '-1');
1530
  } elseif ($cats == 'digest') {
1531
+ $all_cats = get_categories('type=post&hide_empty=1&hierarchical=0');
1532
  foreach ($all_cats as $cat) {
1533
+ ('' == $catids) ? $catids = "$cat->cat_ID" : $catids .= ",$cat->cat_ID";
1534
+ update_usermeta($user_ID, 's2_cat' . $cat->cat_ID, $cat->cat_ID);
1535
  }
1536
  update_usermeta($user_ID, 's2_subscribed', $catids);
1537
  } else {
1561
  echo "<div class=\"wrap\">";
1562
  echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
1563
  echo "<form method=\"post\" action=\"\">";
 
1564
  if (function_exists('wp_nonce_field')) {
1565
  wp_nonce_field('subscribe2-user_subscribers' . $s2nonce);
1566
  }
1587
  }
1588
  echo " /> " . $value . "&nbsp;&nbsp;";
1589
  }
1590
+ echo "<p style=\"color: red\">" . __('Note: HTML format will always deliver the full post.', 'subscribe2') . "</p>\r\n";
1591
  echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': &nbsp;&nbsp;';
1592
  echo "<input type=\"radio\" name=\"new_category\" value=\"yes\" ";
1593
  if ('yes' == get_usermeta($user_ID, 's2_autosub')) {
1594
  echo "checked=\"checked\" ";
1595
  }
1596
+ echo "/> Yes &nbsp;&nbsp;";
1597
  echo "<input type=\"radio\" name=\"new_category\" value=\"no\" ";
1598
  if ('no' == get_usermeta($user_ID, 's2_autosub')) {
1599
  echo "checked=\"checked\" ";
1600
  }
1601
+ echo "/> No<br /><br />";
 
1602
 
1603
  // subscribed categories
1604
  echo "<h2>" . __('Subscribed Categories', 'subscribe2') . "</h2>\r\n";
1607
  // we're doing daily digests, so just show
1608
  // subscribe / unnsubscribe
1609
  echo __('Receive daily summary of new posts?', 'subscribe2') . ': &nbsp;&nbsp;';
 
1610
  echo "<input type=\"radio\" name=\"category\" value=\"digest\" ";
1611
  if (get_usermeta($user_ID, 's2_subscribed') != '-1') {
1612
  echo "checked=\"yes\" ";
1613
  }
1614
+ echo "/> Yes <input type=\"radio\" name=\"category\" value=\"-1\" ";
1615
  if (get_usermeta($user_ID, 's2_subscribed') == '-1') {
1616
  echo "checked=\"yes\" ";
1617
  }
1618
+ echo "/> No";
 
1619
  }
1620
 
 
1621
  // submit
1622
+ echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __("Update Preferences &raquo;", 'subscribe2') . "\" /></p>";
1623
  echo "</form></div>\r\n";
1624
 
1625
  include(ABSPATH . 'wp-admin/admin-footer.php');
1654
  get_currentuserinfo();
1655
  $this->myname = $user_identity;
1656
  $this->myemail = $user_email;
1657
+ $subject = strip_tags($_POST['subject']);
1658
  $message = stripslashes($_POST['message']);
1659
  $this->mail($recipients, $subject, $message, 'text');
1660
  $message = $this->mail_sent;
1666
  // show our form
1667
  echo "<div class=\"wrap\"><h2>" . __('Send email to all subscribers', 'subscribe2') . "</h2>\r\n";
1668
  echo "<form method=\"post\" action=\"\">\r\n";
 
1669
  if (function_exists('wp_nonce_field')) {
1670
  wp_nonce_field('subscribe2-write_subscribers' . $s2nonce);
1671
  }
1672
+ echo __('Subject', 'subscribe2') . ": <input type=\"text\" size=\"69\" name=\"subject\" value=\"" . __('A message from ', 'subscribe2') . get_option('blogname') . "\" /> <br />";
1673
  echo "<textarea rows=\"12\" cols=\"75\" name=\"message\"></textarea>";
1674
+ echo "<br />\r\n";
1675
  echo __('Recipients: ', 'subscribe2');
1676
  $this->display_subscriber_dropdown('registered', false, array('all'));
1677
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"mail\" />";
1678
+ echo "&nbsp;&nbsp;<span class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Send', 'subscribe2') . "\" /></span>&nbsp;";
 
1679
  echo "</form></div>\r\n";
1680
  echo "<div style=\"clear: both;\"><p>&nbsp;</p></div>";
1681
 
1692
  function display_category_form($selected = array(), $override = 1) {
1693
  global $wpdb;
1694
 
1695
+ $all_cats = get_categories('type=post&hide_empty=1&hierarchical=0');
1696
  $exclude = explode(',', $this->subscribe2_options['exclude']);
1697
 
1698
  if (0 == $override) {
1699
  // registered users are not allowed to subscribe to
1700
  // excluded categories
1701
+ foreach ($all_cats as $cat => $cat_ID) {
1702
+ if (in_array($all_cats[$cat]->cat_ID, $exclude)) {
1703
  $cat = (int)$cat;
1704
  unset($all_cats[$cat]);
1705
  }
1717
  $j++;
1718
  }
1719
  if (0 == $j) {
1720
+ echo "<input type=\"checkbox\" name=\"category[]\" value=\"" . $cat->cat_ID . "\"";
1721
+ if (in_array($cat->cat_ID, $selected)) {
1722
  echo " checked=\"checked\" ";
1723
  }
1724
+ echo " /> " . $cat->cat_name . "<br />\r\n";
1725
  } else {
1726
 
1727
+ echo "<input type=\"checkbox\" name=\"category[]\" value=\"" . $cat->cat_ID . "\"";
1728
+ if (in_array($cat->cat_ID, $selected)) {
1729
  echo " checked=\"checked\" ";
1730
  }
1731
+ echo " /> " . $cat->cat_name . "<br />\r\n";
1732
  }
1733
  $i++;
1734
  }
1753
  'unconfirmed' => ' &nbsp;&nbsp;' . __('Unconfirmed', 'subscribe2'),
1754
  'registered' => __('Registered Users', 'subscribe2'));
1755
 
1756
+ $all_cats = get_categories('type=post&hide_empty=1&hierarchical=0');
1757
 
1758
  // count the number of subscribers
1759
  $count['confirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='1'");
1768
  $count['registered'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='s2_subscribed'");
1769
  $count['all'] = ($count['confirmed'] + $count['unconfirmed'] + $count['registered']);
1770
  foreach ($all_cats as $cat) {
1771
+ $count[$cat->cat_name] = $wpdb->get_var("SELECT COUNT(meta_value) FROM $wpdb->usermeta WHERE meta_key='s2_cat$cat->cat_ID'");
1772
  }
1773
 
1774
  // do have actually have some subscribers?
1778
  }
1779
 
1780
  if (false !== $submit) {
1781
+ echo "<form method=\"post\" action=\"\">";
1782
  }
1783
  echo "<select name=\"what\">\r\n";
1784
  foreach ($who as $whom => $display) {
1792
 
1793
  if ($count['registered'] > 0) {
1794
  foreach ($all_cats as $cat) {
1795
+ if (in_array($cat->cat_ID, $exclude)) { continue; }
1796
+ echo "<option value=\"" . $cat->cat_ID . "\"";
1797
+ if ($cat->cat_ID == $selected) { echo " selected=\"selected\" "; }
1798
+ echo "> &nbsp;&nbsp;" . $cat->cat_name . "&nbsp;(" . $count[$cat->cat_name] . ") </option>\r\n";
1799
  }
1800
  }
1801
  echo "</select>";
1802
  if (false !== $submit) {
1803
+ echo "<span class=\"submit\"><input type=\"submit\" value=\"$submit\" /></span></form>\r\n";
1804
  }
1805
  } // end display_subscriber_dropdown()
1806
 
1807
  function display_digest_choices() {
1808
  global $wpdb;
 
1809
  $schedule = (array)wp_get_schedules();
1810
  $schedule = array_merge(array('never' => array('interval' => 0, 'display' => __('Per Post Email','subscribe2'))), $schedule);
1811
  $sort = array();
1822
  }
1823
  echo " /> " . $value['display'] . "<br />\r\n";
1824
  }
1825
+ if (wp_next_scheduled('s2_digest_cron')) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1826
  $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
1827
+ $now = time();
1828
  echo "<p>" . __('Current server time is', 'subscribe2') . ": \r\n";
1829
+ echo "<strong>" . gmdate($datetime, $now+ (get_option('gmt_offset') * 3600)) . "</strong></p>\r\n";
1830
+ echo "<p>" . __('Next email notification will be sent', 'subscribe2') . ": \r\n";
1831
+ echo "<strong>" . gmdate($datetime, wp_next_scheduled('s2_digest_cron') + (get_option('gmt_offset') * 3600)) . "</strong></p>\r\n";
 
 
 
 
1832
  }
1833
  } // end display_digest_choices()
1834
 
1874
  Display our form; also handles (un)subscribe requests
1875
  */
1876
  function filter($content = '') {
1877
+ if ( ('' == $content) || (! preg_match('|<!--subscribe2-->|', $content)) ) { return $content; }
1878
  $this->s2form = $this->form;
1879
 
1880
  global $user_ID;
1908
  if ('1' !== $this->is_public($this->email)) {
1909
  // the user is unknown or inactive
1910
  $this->add();
1911
+ $this->send_confirm('add');
1912
  // set a variable to denote that we've already run, and shouldn't run again
1913
  $this->filtered = 1; //set this to not send duplicate emails
1914
+ $this->s2form = $this->confirmation_sent;
 
 
 
 
1915
  } else {
1916
  // they're already subscribed
1917
  $this->s2form = $this->already_subscribed;
1922
  if (false == $this->is_public($this->email)) {
1923
  $this->s2form = $this->form . $this->not_subscribed;
1924
  } else {
1925
+ $this->send_confirm('del');
1926
  // set a variable to denote that we've already run, and shouldn't run again
1927
  $this->filtered = 1;
1928
+ $this->s2form = $this->confirmation_sent;
 
 
 
 
1929
  }
1930
  $this->action='unsubscribe';
1931
  }
1932
  }
1933
  }
1934
  }
1935
+ return preg_replace('|(<p>)(\n)*<!--subscribe2-->(\n)*(</p>)|', $this->s2form, $content);
1936
  } // end filter()
1937
 
1938
  /**
1949
  if ( (defined('S2PAGE')) && (0 != S2PAGE) ) {
1950
  return "page_id=" . S2PAGE;
1951
  } else {
1952
+ $id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type='page' LIMIT 1");
1953
  if ($id) {
1954
  return "page_id=$id";
1955
  } else {
1967
  return __('Subscription Confirmation', 'subscribe2');
1968
  } // end title_filter()
1969
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1970
  /* ===== wp-cron functions ===== */
1971
  /**
1972
  Send a daily digest of today's new posts
1975
  global $wpdb;
1976
 
1977
  // collect posts
1978
+ $now = date('Y-m-d H:i:s', time());
1979
  $prev = $this->subscribe2_options['last_s2cron'];
1980
+ $posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content FROM $wpdb->posts WHERE post_date >= '$prev' AND post_date < '$now' AND post_status='publish' AND post_type='post'");
1981
 
1982
  // update last_s2cron execution time before completing or bailing
1983
  $this->subscribe2_options['last_s2cron'] = $now;
1984
  update_option('subscribe2_options', $this->subscribe2_options);
1985
+
1986
  // do we have any posts?
1987
  if (empty($posts)) { return; }
1988
 
1989
  // if we have posts, let's prepare the digest
 
1990
  foreach ($posts as $post) {
1991
+ $post_cats = wp_get_post_cats('1', $post->ID);
1992
  $post_cats_string = implode(',', $post_cats);
 
1993
  $check = false;
1994
  // is the current post assigned to any categories
1995
  // which should not generate a notification email?
1998
  $check = true;
1999
  }
2000
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2001
  // if this post is in an excluded category,
2002
  // don't include it in the digest
2003
  if ($check) {
2026
  $message .= $excerpt . "\r\n\r\n";
2027
  }
2028
 
2029
+ $author = get_userdata($post->post_author);
2030
+ $this->authorname = $author->display_name;
2031
+
2032
+ // do we send as admin, or post author?
2033
+ if ('author' == $this->subscribe2_options['sender']) {
2034
+ // get author details
2035
+ $user =& $author;
2036
+ } else {
2037
+ // get admin detailts
2038
+ $user = get_userdata(1);
2039
+ }
2040
  $this->myemail = $user->user_email;
2041
  $this->myname = $user->display_name;
2042
 
2045
  $display = $scheds[$email_freq]['display'];
2046
  $subject = '[' . stripslashes(get_option('blogname')) . '] ' . $display . ' ' . __('Digest Email', 'subscribe2');
2047
  $public = $this->get_public();
2048
+ $registered = $this->get_registered();
 
2049
  $recipients = array_merge((array)$public, (array)$registered);
2050
  $mailtext = $this->substitute(stripslashes($this->subscribe2_options['mailtext']));
2051
+ $body = str_replace("TABLE", $table, $mailtext);
2052
+ $body = str_replace("POST", $message, $mailtext);
2053
+ $this->mail($recipients, $subject, $body);
2054
  } // end subscribe2_cron
2055
 
2056
  /* ===== Our constructor ===== */
2059
  */
2060
  function s2init() {
2061
  // load the options
2062
+ $this->subscribe2_options = array();
2063
  $this->subscribe2_options = get_option('subscribe2_options');
2064
 
2065
  add_action('init', array(&$this, 'subscribe2'));
2066
  if ('1' == $this->subscribe2_options['show_button']) {
2067
  add_action('init', array(&$this, 'button_init'));
2068
  }
 
 
 
 
2069
  }
2070
 
2071
  function subscribe2() {
2075
 
2076
  // do we need to install anything?
2077
  $this->public = $table_prefix . "subscribe2";
2078
+ if(!mysql_query("DESCRIBE " . $this->public)) { $this->install(); }
2079
  //do we need to upgrade anything?
2080
  if ($this->subscribe2_options['version'] !== S2VERSION) {
2081
  add_action('shutdown', array(&$this, 'upgrade'));
2087
  add_filter('the_title', array(&$this, 'title_filter'));
2088
  add_filter('the_content', array(&$this, 'confirm'));
2089
  }
 
 
 
 
 
 
 
 
 
2090
 
 
 
 
2091
  //add regular actions and filters
2092
  add_action('admin_head', array(&$this, 'admin_head'));
2093
  add_action('admin_menu', array(&$this, 'admin_menu'));
2094
  add_action('create_category', array(&$this, 'autosub_new_category'));
2095
  add_action('register_form', array(&$this, 'register_form'));
2096
+ add_filter('the_content', array(&$this, 'filter'));
2097
  add_filter('cron_schedules', array(&$this, 'add_weekly_sched'));
2098
 
2099
  // add action to display editor buttons if option is enabled
2113
  if ($this->subscribe2_options['email_freq'] != 'never') {
2114
  add_action('s2_digest_cron', array(&$this, 'subscribe2_cron'));
2115
  } else {
2116
+ add_action('publish_post', array(&$this, 'publish'));
2117
+ add_action('edit_post', array(&$this, 'edit'));
2118
+ add_action('private_to_published', array(&$this, 'private2publish'));
2119
+ }
2120
+
2121
+ // add action to email notification about pages if option is enabled
2122
+ if ($this->subscribe2_options['pages'] == 'yes') {
2123
+ add_action('publish_page', array(&$this, 'publish'));
 
 
2124
  }
2125
 
2126
  // load our strings
2127
  $this->load_strings();
2128
  } // end subscribe2()
2129
 
2130
+ /* ===== ButtonSnap configuration ===== */
2131
+ /**
2132
+ Register our button in the QuickTags bar
2133
+ */
2134
+ function button_init() {
2135
+ if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) return;
2136
+ if ( 'true' == get_user_option('rich_editing') ) {
2137
+ // Load and append our TinyMCE external plugin
2138
+ add_filter('mce_plugins', array(&$this, 'mce_plugins'));
2139
+ add_filter('mce_buttons', array(&$this, 'mce_buttons'));
2140
+ add_action('tinymce_before_init', array(&$this, 'tinymce_before_init'));
2141
+ add_action('marker_css', array(&$this, 'button_css'));
2142
+ } else {
2143
+ buttonsnap_separator();
2144
+ buttonsnap_jsbutton(get_option('siteurl') . '/wp-content/plugins/subscribe2/include/s2_button.png', __('Subscribe2', 'subscribe2'), 's2_insert_token();');
2145
+ }
2146
+ }
2147
+
2148
+ /**
2149
+ Style a marker in the Rich Text Editor for our tag
2150
+ By default, the RTE suppresses output of HTML comments, so this
2151
+ places a CSS style on our token in order to make it display
2152
+ */
2153
+ function button_css() {
2154
+ $marker_url = get_option('siteurl') . '/wp-content/plugins/subscribe2/include/s2_marker.png';
2155
+ echo "
2156
+ .s2_marker {
2157
+ display: block;
2158
+ height: 45px;
2159
+ margin-top: 5px;
2160
+ background-image: url({$marker_url});
2161
+ background-repeat: no-repeat;
2162
+ background-position: center;
2163
+ }
2164
+ ";
2165
+ }
2166
+
2167
+ // Add buttons in WordPress v2.1+, thanks to An-archos
2168
+ function mce_plugins($plugins) {
2169
+ array_push($plugins, '-subscribe2quicktags');
2170
+ return $plugins;
2171
+ }
2172
+
2173
+ function mce_buttons($buttons) {
2174
+ array_push($buttons, 'separator');
2175
+ array_push($buttons, 'subscribe2quicktags');
2176
+ return $buttons;
2177
+ }
2178
+
2179
+ function tinymce_before_init() {
2180
+ $this->fullpath = get_option('siteurl') . '/wp-content/plugins/subscribe2/tinymce/';
2181
+ echo "tinyMCE.loadPlugin('subscribe2quicktags', '" . $this->fullpath . "');\n";
2182
+ }
2183
+
2184
+ function s2_edit_form() {
2185
+ echo "<!-- Start Subscribe2 Quicktags Javascript -->\r\n";
2186
+ echo "<script type=\"text/javascript\">\r\n";
2187
+ echo "//<![CDATA[\r\n";
2188
+ echo "function s2_insert_token() {
2189
+ buttonsnap_settext('<!--subscribe2-->');
2190
+ }\r\n";
2191
+ echo "//]]>\r\n";
2192
+ echo "</script>\r\n";
2193
+ echo "<!-- End Subscribe2 Quicktags Javascript -->\r\n";
2194
+ }
2195
+
2196
  /* ===== our variables ===== */
2197
  // cache variables
2198
+ var $version = '';
2199
  var $all_public = '';
2200
  var $all_unconfirmed = '';
2201
  var $excluded_cats = '';
subscribe2.pot → subscribe2/subscribe2.pot RENAMED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2008-04-22 19:17+0100\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,591 +16,498 @@ msgstr ""
16
  "Content-Type: text/plain; charset=CHARSET\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
 
19
- #: subscribe2.php:68
20
  msgid "To manage your subscription options please "
21
  msgstr ""
22
 
23
- #: subscribe2.php:68
24
- msgid "login"
25
- msgstr ""
26
-
27
- #: subscribe2.php:70 subscribe2.php:72
28
  msgid "You may manage your subscription options from your "
29
  msgstr ""
30
 
31
- #: subscribe2.php:70 subscribe2.php:72
32
- msgid "profile"
33
- msgstr ""
34
-
35
- #: subscribe2.php:74
36
  msgid "A confirmation message is on its way!"
37
  msgstr ""
38
 
39
- #: subscribe2.php:76
40
  msgid "That email address is already subscribed."
41
  msgstr ""
42
 
43
- #: subscribe2.php:78
44
  msgid "That email address is not subscribed."
45
  msgstr ""
46
 
47
- #: subscribe2.php:80
48
  msgid "Sorry, but that does not look like an email address to me."
49
  msgstr ""
50
 
51
- #: subscribe2.php:82
52
  msgid ""
53
  "Sorry, email addresses at that domain are currently barred due to spam, "
54
  "please use an alternative email address."
55
  msgstr ""
56
 
57
- #: subscribe2.php:84
58
- msgid ""
59
- "Sorry, there seems to be an error on the server. Please try again later."
60
- msgstr ""
61
-
62
- #: subscribe2.php:86
63
  msgid "Message sent!"
64
  msgstr ""
65
 
66
- #: subscribe2.php:88
67
  msgid "Your email:"
68
  msgstr ""
69
 
70
- #: subscribe2.php:88 subscribe2.php:1204 subscribe2.php:1305
71
  msgid "Subscribe"
72
  msgstr ""
73
 
74
- #: subscribe2.php:88 subscribe2.php:1306
75
  msgid "Unsubscribe"
76
  msgstr ""
77
 
78
- #: subscribe2.php:88 subscribe2.php:1806
79
  msgid "Send"
80
  msgstr ""
81
 
82
- #: subscribe2.php:91
83
  msgid "No such email address is registered."
84
  msgstr ""
85
 
86
- #: subscribe2.php:93
87
  msgid "You have successfully subscribed!"
88
  msgstr ""
89
 
90
- #: subscribe2.php:95
91
  msgid "You have successfully unsubscribed."
92
  msgstr ""
93
 
94
- #: subscribe2.php:97
95
  msgid "Please confirm your request"
96
  msgstr ""
97
 
98
- #: subscribe2.php:99
99
  msgid "Subscription Reminder"
100
  msgstr ""
101
 
102
- #: subscribe2.php:101
103
  msgid "subscribe"
104
  msgstr ""
105
 
106
- #: subscribe2.php:103
107
  msgid "unsubscribe"
108
  msgstr ""
109
 
110
- #: subscribe2.php:106
111
  msgid "Options saved!"
112
  msgstr ""
113
 
114
- #: subscribe2.php:107
115
  msgid "Options reset!"
116
  msgstr ""
117
 
118
- #: subscribe2.php:115 subscribe2.php:1209
119
  msgid "Subscribers"
120
  msgstr ""
121
 
122
- #: subscribe2.php:116
123
  msgid "Subscribe2 Options"
124
  msgstr ""
125
 
126
- #: subscribe2.php:116 subscribe2.php:2132 subscribe2.php:2195
127
  msgid "Subscribe2"
128
  msgstr ""
129
 
130
- #: subscribe2.php:117
131
  msgid "Subscriptions"
132
  msgstr ""
133
 
134
- #: subscribe2.php:118
135
  msgid "Mail Subscribers"
136
  msgstr ""
137
 
138
- #: subscribe2.php:141
139
  msgid "Once Weekly"
140
  msgstr ""
141
 
142
- #: subscribe2.php:693
143
  msgid "New subscriber"
144
  msgstr ""
145
 
146
- #: subscribe2.php:694
147
  msgid "subscribed to email notifications!"
148
  msgstr ""
149
 
150
- #: subscribe2.php:1059
151
  msgid "Address(es) subscribed!"
152
  msgstr ""
153
 
154
- #: subscribe2.php:1062
155
  msgid "deleted!"
156
  msgstr ""
157
 
158
- #: subscribe2.php:1065
159
  msgid "status changed!"
160
  msgstr ""
161
 
162
- #: subscribe2.php:1068
163
  msgid "Reminder Email(s) Sent!"
164
  msgstr ""
165
 
166
- #: subscribe2.php:1071
167
- msgid "Registered Users Subscribed!"
168
- msgstr ""
169
-
170
- #: subscribe2.php:1074
171
- msgid "Registered Users Unsubscribed!"
172
  msgstr ""
173
 
174
- #: subscribe2.php:1166
175
- msgid "Previous Page"
176
  msgstr ""
177
 
178
- #: subscribe2.php:1186
179
- msgid "Next Page"
180
  msgstr ""
181
 
182
- #: subscribe2.php:1196
183
  msgid "Subscribe Addresses"
184
  msgstr ""
185
 
186
- #: subscribe2.php:1202
187
  msgid "Enter addresses, one per line or comma-seperated"
188
  msgstr ""
189
 
190
- #: subscribe2.php:1211
191
  msgid "Filter"
192
  msgstr ""
193
 
194
- #: subscribe2.php:1215
195
  msgid ""
196
  "Registered on the left, confirmed in the middle, unconfirmed on the right"
197
  msgstr ""
198
 
199
- #: subscribe2.php:1223
200
  msgid "Save Emails to CSV File"
201
  msgstr ""
202
 
203
- #: subscribe2.php:1277
204
  msgid "NONE"
205
  msgstr ""
206
 
207
- #: subscribe2.php:1288
208
  msgid "Send Reminder Email"
209
  msgstr ""
210
 
211
- #: subscribe2.php:1295
212
  msgid "Categories"
213
  msgstr ""
214
 
215
- #: subscribe2.php:1297
216
  msgid ""
217
  "Existing Registered Users can be automatically (un)subscribed to categories "
218
  "using this section."
219
  msgstr ""
220
 
221
- #: subscribe2.php:1298
222
  msgid "Consider User Privacy as changes cannot be undone"
223
  msgstr ""
224
 
225
- #: subscribe2.php:1304
226
  msgid "Action to perform"
227
  msgstr ""
228
 
229
- #: subscribe2.php:1309 subscribe2.php:1596
230
  msgid "Submit"
231
  msgstr ""
232
 
233
- #: subscribe2.php:1431
234
  msgid "Delivery Options"
235
  msgstr ""
236
 
237
- #: subscribe2.php:1433
238
  msgid "Send Emails for Pages"
239
  msgstr ""
240
 
241
- #: subscribe2.php:1438 subscribe2.php:1449 subscribe2.php:1460
242
- #: subscribe2.php:1564 subscribe2.php:1718 subscribe2.php:1738
243
  msgid "Yes"
244
  msgstr ""
245
 
246
- #: subscribe2.php:1443 subscribe2.php:1454 subscribe2.php:1465
247
- #: subscribe2.php:1558 subscribe2.php:1569 subscribe2.php:1723
248
- #: subscribe2.php:1742
249
  msgid "No"
250
  msgstr ""
251
 
252
- #: subscribe2.php:1444
253
  msgid "Send Emails for Password Protected Posts"
254
  msgstr ""
255
 
256
- #: subscribe2.php:1455
257
- msgid "Send Emails for Private Posts"
258
- msgstr ""
259
-
260
- #: subscribe2.php:1466
261
  msgid "Send Email From"
262
  msgstr ""
263
 
264
- #: subscribe2.php:1471
265
  msgid "Author of the post"
266
  msgstr ""
267
 
268
- #: subscribe2.php:1476
269
  msgid "Blog Admin"
270
  msgstr ""
271
 
272
- #: subscribe2.php:1478
273
  msgid "Send Email as Digest"
274
  msgstr ""
275
 
276
- #: subscribe2.php:1482
277
  msgid "Email Templates"
278
  msgstr ""
279
 
280
- #: subscribe2.php:1486
281
  msgid "New Post email (must not be empty)"
282
  msgstr ""
283
 
284
- #: subscribe2.php:1490
285
  msgid "Message substitions"
286
  msgstr ""
287
 
288
- #: subscribe2.php:1494
289
- msgid "the post's title<br />(<i>for per-post emails only</i>)"
290
  msgstr ""
291
 
292
- #: subscribe2.php:1495
293
  msgid ""
294
  "the excerpt or the entire post<br />(<i>based on the subscriber's "
295
  "preferences</i>)"
296
  msgstr ""
297
 
298
- #: subscribe2.php:1496
299
- msgid "a list of post titles<br />(<i>for digest emails only</i>)"
300
  msgstr ""
301
 
302
- #: subscribe2.php:1497
303
- msgid "the post's permalink<br />(<i>for per-post emails only</i>)"
304
  msgstr ""
305
 
306
- #: subscribe2.php:1498
307
  msgid "the admin or post author's name"
308
  msgstr ""
309
 
310
- #: subscribe2.php:1499
311
  msgid "the admin or post author's email"
312
  msgstr ""
313
 
314
- #: subscribe2.php:1500
315
  msgid "the post author's name"
316
  msgstr ""
317
 
318
- #: subscribe2.php:1501
319
  msgid ""
320
  "the generated link to confirm a request<br />(<i>only used in the "
321
  "confirmation email template</i>)"
322
  msgstr ""
323
 
324
- #: subscribe2.php:1502
325
  msgid ""
326
  "Action performed by LINK in confirmation email<br />(<i>only used in the "
327
  "confirmation email template</i>)"
328
  msgstr ""
329
 
330
- #: subscribe2.php:1504
331
  msgid "Subscribe / Unsubscribe confirmation email"
332
  msgstr ""
333
 
334
- #: subscribe2.php:1507
335
  msgid "Reminder email to Unconfirmed Subscribers"
336
  msgstr ""
337
 
338
- #: subscribe2.php:1512
339
  msgid "Excluded Categories"
340
  msgstr ""
341
 
342
- #: subscribe2.php:1514
343
  msgid ""
344
  "Posts assigned to any Excluded Category do not generate notifications and "
345
  "are not included in digest notifications"
346
  msgstr ""
347
 
348
- #: subscribe2.php:1521
349
  msgid "Allow registered users to subscribe to excluded categories?"
350
  msgstr ""
351
 
352
- #: subscribe2.php:1524
353
  msgid "Writing Options"
354
  msgstr ""
355
 
356
- #: subscribe2.php:1530
357
  msgid "Show the Subscribe2 button on the Write toolbar?"
358
  msgstr ""
359
 
360
- #: subscribe2.php:1537
361
- msgid "Enable Subscribe2 Widget?"
362
- msgstr ""
363
-
364
- #: subscribe2.php:1541
365
  msgid "Auto Subscribe"
366
  msgstr ""
367
 
368
- #: subscribe2.php:1543
369
  msgid "Subscribe new users registering with your blog"
370
  msgstr ""
371
 
372
- #: subscribe2.php:1548
373
  msgid "Automatically"
374
  msgstr ""
375
 
376
- #: subscribe2.php:1553
377
  msgid "Display option on Registration Form"
378
  msgstr ""
379
 
380
- #: subscribe2.php:1559
381
  msgid "Registration Form option is checked by default"
382
  msgstr ""
383
 
384
- #: subscribe2.php:1570
385
  msgid "Auto-subscribe users to receive email as"
386
  msgstr ""
387
 
388
- #: subscribe2.php:1575 subscribe2.php:1696
389
  msgid "HTML"
390
  msgstr ""
391
 
392
- #: subscribe2.php:1580
393
  msgid "Plain Text - Full"
394
  msgstr ""
395
 
396
- #: subscribe2.php:1585
397
  msgid "Plain Text - Excerpt"
398
  msgstr ""
399
 
400
- #: subscribe2.php:1589
401
  msgid "Barred Domains"
402
  msgstr ""
403
 
404
- #: subscribe2.php:1591
405
  msgid ""
406
  "Enter domains to bar from public subscriptions: <br /> (Use a new line for "
407
  "each entry and omit the \"@\" symbol, for example email.com)"
408
  msgstr ""
409
 
410
- #: subscribe2.php:1601
411
  msgid "Reset Default"
412
  msgstr ""
413
 
414
- #: subscribe2.php:1602
415
  msgid ""
416
  "Use this to reset all options to their defaults. This <strong><em>will not</"
417
  "em></strong> modify your list of subscribers."
418
  msgstr ""
419
 
420
- #: subscribe2.php:1609
421
  msgid "RESET"
422
  msgstr ""
423
 
424
- #: subscribe2.php:1629
425
  msgid "Subscription preferences updated."
426
  msgstr ""
427
 
428
- #: subscribe2.php:1683
429
  msgid "Notification Settings"
430
  msgstr ""
431
 
432
- #: subscribe2.php:1691
433
  msgid "Receive email as"
434
  msgstr ""
435
 
436
- #: subscribe2.php:1701
437
  msgid "Plain Text"
438
  msgstr ""
439
 
440
- #: subscribe2.php:1703
441
  msgid "Email contains"
442
  msgstr ""
443
 
444
- #: subscribe2.php:1704
445
  msgid "Excerpt Only"
446
  msgstr ""
447
 
448
- #: subscribe2.php:1704
449
  msgid "Full Post"
450
  msgstr ""
451
 
452
- #: subscribe2.php:1712
453
- msgid "Note: HTML format will always deliver the full post"
454
  msgstr ""
455
 
456
- #: subscribe2.php:1713
457
  msgid "Automatically subscribe me to newly created categories"
458
  msgstr ""
459
 
460
- #: subscribe2.php:1727
461
  msgid "Subscribed Categories"
462
  msgstr ""
463
 
464
- #: subscribe2.php:1732
465
  msgid "Receive daily summary of new posts?"
466
  msgstr ""
467
 
468
- #: subscribe2.php:1748
469
- msgid "Update Preferences"
470
  msgstr ""
471
 
472
- #: subscribe2.php:1793
473
  msgid "Send email to all subscribers"
474
  msgstr ""
475
 
476
- #: subscribe2.php:1799
477
  msgid "Subject"
478
  msgstr ""
479
 
480
- #: subscribe2.php:1799
481
  msgid "A message from "
482
  msgstr ""
483
 
484
- #: subscribe2.php:1802
485
  msgid "Recipients: "
486
  msgstr ""
487
 
488
- #: subscribe2.php:1865
489
  msgid "Select / Unselect All"
490
  msgstr ""
491
 
492
- #: subscribe2.php:1878
493
  msgid "All Subscribers"
494
  msgstr ""
495
 
496
- #: subscribe2.php:1879
497
  msgid "Public Subscribers"
498
  msgstr ""
499
 
500
- #: subscribe2.php:1880
501
  msgid "Confirmed"
502
  msgstr ""
503
 
504
- #: subscribe2.php:1881
505
  msgid "Unconfirmed"
506
  msgstr ""
507
 
508
- #: subscribe2.php:1882
509
  msgid "Registered Users"
510
  msgstr ""
511
 
512
- #: subscribe2.php:1939
513
  msgid "Per Post Email"
514
  msgstr ""
515
 
516
- #: subscribe2.php:1954
517
- msgid "Send Digest Notification at"
518
- msgstr ""
519
-
520
- #: subscribe2.php:1966
521
- msgid ""
522
- "This option will work for digest notification sent daily or less frequently"
523
- msgstr ""
524
-
525
- #: subscribe2.php:1968
526
- msgid "Reset the schedule time and date for periodic email notifications"
527
- msgstr ""
528
-
529
- #: subscribe2.php:1970
530
  msgid "Current server time is"
531
  msgstr ""
532
 
533
- #: subscribe2.php:1972
534
- msgid "Current blog time is"
535
- msgstr ""
536
-
537
- #: subscribe2.php:1974
538
- msgid "Next email notification will be sent when your blog time is after"
539
  msgstr ""
540
 
541
- #: subscribe2.php:1987
542
  msgid "Check here to Subscribe to email notifications for new posts"
543
  msgstr ""
544
 
545
- #: subscribe2.php:1996
546
  msgid ""
547
  "By Registering with this blog you are also agreeing to recieve email "
548
  "notifications for new posts"
549
  msgstr ""
550
 
551
- #: subscribe2.php:2121
552
  msgid "Subscription Confirmation"
553
  msgstr ""
554
 
555
- #: subscribe2.php:2155
556
- msgid "Title:"
557
- msgstr ""
558
-
559
- #: subscribe2.php:2327
560
  msgid "Digest Email"
561
  msgstr ""
562
-
563
- #: include/options.php:59
564
- msgid ""
565
- "BLOGNAME has posted a new item, 'TITLE'\n"
566
- "\n"
567
- "POST\n"
568
- "\n"
569
- "You may view the latest post at\n"
570
- "PERMALINK\n"
571
- "\n"
572
- "You received this e-mail because you asked to be notified when new updates "
573
- "are posted.\n"
574
- "Best regards,\n"
575
- "MYNAME\n"
576
- "EMAIL"
577
- msgstr ""
578
-
579
- #: include/options.php:63
580
- msgid ""
581
- "BLOGNAME has received a request to ACTION for this email address. To "
582
- "complete your request please click on the link below:\n"
583
- "\n"
584
- "LINK\n"
585
- "\n"
586
- "If you did not request this, please feel free to disregard this notice!\n"
587
- "\n"
588
- "Thank you,\n"
589
- "MYNAME."
590
- msgstr ""
591
-
592
- #: include/options.php:67
593
- msgid ""
594
- "This email address was subscribed for notifications at BLOGNAME (BLOGLINK) "
595
- "but the subscription remains incomplete.\n"
596
- "\n"
597
- "If you wish to complete your subscription please click on the link below:\n"
598
- "\n"
599
- "LINK\n"
600
- "\n"
601
- "If you do not wish to complete your subscription please ignore this email "
602
- "and your address will be removed from our database.\n"
603
- "\n"
604
- "Regards,\n"
605
- "MYNAME"
606
- msgstr ""
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: \n"
11
+ "POT-Creation-Date: 2007-09-13 20:45+0100\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
16
  "Content-Type: text/plain; charset=CHARSET\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
 
19
+ #: subscribe2.php:63
20
  msgid "To manage your subscription options please "
21
  msgstr ""
22
 
23
+ #: subscribe2.php:65 subscribe2.php:67
 
 
 
 
24
  msgid "You may manage your subscription options from your "
25
  msgstr ""
26
 
27
+ #: subscribe2.php:69
 
 
 
 
28
  msgid "A confirmation message is on its way!"
29
  msgstr ""
30
 
31
+ #: subscribe2.php:71
32
  msgid "That email address is already subscribed."
33
  msgstr ""
34
 
35
+ #: subscribe2.php:73
36
  msgid "That email address is not subscribed."
37
  msgstr ""
38
 
39
+ #: subscribe2.php:75
40
  msgid "Sorry, but that does not look like an email address to me."
41
  msgstr ""
42
 
43
+ #: subscribe2.php:77
44
  msgid ""
45
  "Sorry, email addresses at that domain are currently barred due to spam, "
46
  "please use an alternative email address."
47
  msgstr ""
48
 
49
+ #: subscribe2.php:79
 
 
 
 
 
50
  msgid "Message sent!"
51
  msgstr ""
52
 
53
+ #: subscribe2.php:81
54
  msgid "Your email:"
55
  msgstr ""
56
 
57
+ #: subscribe2.php:81 subscribe2.php:1139 subscribe2.php:1235
58
  msgid "Subscribe"
59
  msgstr ""
60
 
61
+ #: subscribe2.php:81 subscribe2.php:1236
62
  msgid "Unsubscribe"
63
  msgstr ""
64
 
65
+ #: subscribe2.php:81 subscribe2.php:1678
66
  msgid "Send"
67
  msgstr ""
68
 
69
+ #: subscribe2.php:84
70
  msgid "No such email address is registered."
71
  msgstr ""
72
 
73
+ #: subscribe2.php:86
74
  msgid "You have successfully subscribed!"
75
  msgstr ""
76
 
77
+ #: subscribe2.php:88
78
  msgid "You have successfully unsubscribed."
79
  msgstr ""
80
 
81
+ #: subscribe2.php:90
82
  msgid "Please confirm your request"
83
  msgstr ""
84
 
85
+ #: subscribe2.php:92
86
  msgid "Subscription Reminder"
87
  msgstr ""
88
 
89
+ #: subscribe2.php:94
90
  msgid "subscribe"
91
  msgstr ""
92
 
93
+ #: subscribe2.php:96
94
  msgid "unsubscribe"
95
  msgstr ""
96
 
97
+ #: subscribe2.php:99
98
  msgid "Options saved!"
99
  msgstr ""
100
 
101
+ #: subscribe2.php:100
102
  msgid "Options reset!"
103
  msgstr ""
104
 
105
+ #: subscribe2.php:108 subscribe2.php:1144
106
  msgid "Subscribers"
107
  msgstr ""
108
 
109
+ #: subscribe2.php:109
110
  msgid "Subscribe2 Options"
111
  msgstr ""
112
 
113
+ #: subscribe2.php:109 subscribe2.php:2144
114
  msgid "Subscribe2"
115
  msgstr ""
116
 
117
+ #: subscribe2.php:111 subscribe2.php:113
118
  msgid "Subscriptions"
119
  msgstr ""
120
 
121
+ #: subscribe2.php:115
122
  msgid "Mail Subscribers"
123
  msgstr ""
124
 
125
+ #: subscribe2.php:138
126
  msgid "Once Weekly"
127
  msgstr ""
128
 
129
+ #: subscribe2.php:714
130
  msgid "New subscriber"
131
  msgstr ""
132
 
133
+ #: subscribe2.php:715
134
  msgid "subscribed to email notifications!"
135
  msgstr ""
136
 
137
+ #: subscribe2.php:1052
138
  msgid "Address(es) subscribed!"
139
  msgstr ""
140
 
141
+ #: subscribe2.php:1055
142
  msgid "deleted!"
143
  msgstr ""
144
 
145
+ #: subscribe2.php:1058
146
  msgid "status changed!"
147
  msgstr ""
148
 
149
+ #: subscribe2.php:1061
150
  msgid "Reminder Email(s) Sent!"
151
  msgstr ""
152
 
153
+ #: subscribe2.php:1064
154
+ msgid "CSV File Created in wp-content"
 
 
 
 
155
  msgstr ""
156
 
157
+ #: subscribe2.php:1067
158
+ msgid "Registered Users Subscribed!"
159
  msgstr ""
160
 
161
+ #: subscribe2.php:1070
162
+ msgid "Registered Users Unsubscribed!"
163
  msgstr ""
164
 
165
+ #: subscribe2.php:1132
166
  msgid "Subscribe Addresses"
167
  msgstr ""
168
 
169
+ #: subscribe2.php:1137
170
  msgid "Enter addresses, one per line or comma-seperated"
171
  msgstr ""
172
 
173
+ #: subscribe2.php:1146
174
  msgid "Filter"
175
  msgstr ""
176
 
177
+ #: subscribe2.php:1150
178
  msgid ""
179
  "Registered on the left, confirmed in the middle, unconfirmed on the right"
180
  msgstr ""
181
 
182
+ #: subscribe2.php:1159
183
  msgid "Save Emails to CSV File"
184
  msgstr ""
185
 
186
+ #: subscribe2.php:1210
187
  msgid "NONE"
188
  msgstr ""
189
 
190
+ #: subscribe2.php:1220
191
  msgid "Send Reminder Email"
192
  msgstr ""
193
 
194
+ #: subscribe2.php:1227
195
  msgid "Categories"
196
  msgstr ""
197
 
198
+ #: subscribe2.php:1228
199
  msgid ""
200
  "Existing Registered Users can be automatically (un)subscribed to categories "
201
  "using this section."
202
  msgstr ""
203
 
204
+ #: subscribe2.php:1229
205
  msgid "Consider User Privacy as changes cannot be undone"
206
  msgstr ""
207
 
208
+ #: subscribe2.php:1234
209
  msgid "Action to perform"
210
  msgstr ""
211
 
212
+ #: subscribe2.php:1239 subscribe2.php:1475
213
  msgid "Submit"
214
  msgstr ""
215
 
216
+ #: subscribe2.php:1338
217
  msgid "Delivery Options"
218
  msgstr ""
219
 
220
+ #: subscribe2.php:1339
221
  msgid "Send Emails for Pages"
222
  msgstr ""
223
 
224
+ #: subscribe2.php:1344 subscribe2.php:1355 subscribe2.php:1446
 
225
  msgid "Yes"
226
  msgstr ""
227
 
228
+ #: subscribe2.php:1349 subscribe2.php:1360 subscribe2.php:1440
229
+ #: subscribe2.php:1451
 
230
  msgid "No"
231
  msgstr ""
232
 
233
+ #: subscribe2.php:1350
234
  msgid "Send Emails for Password Protected Posts"
235
  msgstr ""
236
 
237
+ #: subscribe2.php:1361
 
 
 
 
238
  msgid "Send Email From"
239
  msgstr ""
240
 
241
+ #: subscribe2.php:1366
242
  msgid "Author of the post"
243
  msgstr ""
244
 
245
+ #: subscribe2.php:1371
246
  msgid "Blog Admin"
247
  msgstr ""
248
 
249
+ #: subscribe2.php:1373
250
  msgid "Send Email as Digest"
251
  msgstr ""
252
 
253
+ #: subscribe2.php:1377
254
  msgid "Email Templates"
255
  msgstr ""
256
 
257
+ #: subscribe2.php:1380
258
  msgid "New Post email (must not be empty)"
259
  msgstr ""
260
 
261
+ #: subscribe2.php:1384
262
  msgid "Message substitions"
263
  msgstr ""
264
 
265
+ #: subscribe2.php:1388
266
+ msgid "the post's title"
267
  msgstr ""
268
 
269
+ #: subscribe2.php:1389
270
  msgid ""
271
  "the excerpt or the entire post<br />(<i>based on the subscriber's "
272
  "preferences</i>)"
273
  msgstr ""
274
 
275
+ #: subscribe2.php:1390
276
+ msgid "a list of post titles (for digest emails)"
277
  msgstr ""
278
 
279
+ #: subscribe2.php:1391
280
+ msgid "the post's permalink"
281
  msgstr ""
282
 
283
+ #: subscribe2.php:1392
284
  msgid "the admin or post author's name"
285
  msgstr ""
286
 
287
+ #: subscribe2.php:1393
288
  msgid "the admin or post author's email"
289
  msgstr ""
290
 
291
+ #: subscribe2.php:1394
292
  msgid "the post author's name"
293
  msgstr ""
294
 
295
+ #: subscribe2.php:1395
296
  msgid ""
297
  "the generated link to confirm a request<br />(<i>only used in the "
298
  "confirmation email template</i>)"
299
  msgstr ""
300
 
301
+ #: subscribe2.php:1396
302
  msgid ""
303
  "Action performed by LINK in confirmation email<br />(<i>only used in the "
304
  "confirmation email template</i>)"
305
  msgstr ""
306
 
307
+ #: subscribe2.php:1398
308
  msgid "Subscribe / Unsubscribe confirmation email"
309
  msgstr ""
310
 
311
+ #: subscribe2.php:1401
312
  msgid "Reminder email to Unconfirmed Subscribers"
313
  msgstr ""
314
 
315
+ #: subscribe2.php:1406
316
  msgid "Excluded Categories"
317
  msgstr ""
318
 
319
+ #: subscribe2.php:1407
320
  msgid ""
321
  "Posts assigned to any Excluded Category do not generate notifications and "
322
  "are not included in digest notifications"
323
  msgstr ""
324
 
325
+ #: subscribe2.php:1413
326
  msgid "Allow registered users to subscribe to excluded categories?"
327
  msgstr ""
328
 
329
+ #: subscribe2.php:1416
330
  msgid "Writing Options"
331
  msgstr ""
332
 
333
+ #: subscribe2.php:1421
334
  msgid "Show the Subscribe2 button on the Write toolbar?"
335
  msgstr ""
336
 
337
+ #: subscribe2.php:1424
 
 
 
 
338
  msgid "Auto Subscribe"
339
  msgstr ""
340
 
341
+ #: subscribe2.php:1425
342
  msgid "Subscribe new users registering with your blog"
343
  msgstr ""
344
 
345
+ #: subscribe2.php:1430
346
  msgid "Automatically"
347
  msgstr ""
348
 
349
+ #: subscribe2.php:1435
350
  msgid "Display option on Registration Form"
351
  msgstr ""
352
 
353
+ #: subscribe2.php:1441
354
  msgid "Registration Form option is checked by default"
355
  msgstr ""
356
 
357
+ #: subscribe2.php:1452
358
  msgid "Auto-subscribe users to receive email as"
359
  msgstr ""
360
 
361
+ #: subscribe2.php:1457 subscribe2.php:1574
362
  msgid "HTML"
363
  msgstr ""
364
 
365
+ #: subscribe2.php:1462
366
  msgid "Plain Text - Full"
367
  msgstr ""
368
 
369
+ #: subscribe2.php:1467
370
  msgid "Plain Text - Excerpt"
371
  msgstr ""
372
 
373
+ #: subscribe2.php:1470
374
  msgid "Barred Domains"
375
  msgstr ""
376
 
377
+ #: subscribe2.php:1471
378
  msgid ""
379
  "Enter domains to bar from public subscriptions: <br /> (Use a new line for "
380
  "each entry and omit the \"@\" symbol, for example email.com)"
381
  msgstr ""
382
 
383
+ #: subscribe2.php:1480
384
  msgid "Reset Default"
385
  msgstr ""
386
 
387
+ #: subscribe2.php:1481
388
  msgid ""
389
  "Use this to reset all options to their defaults. This <strong><em>will not</"
390
  "em></strong> modify your list of subscribers."
391
  msgstr ""
392
 
393
+ #: subscribe2.php:1488
394
  msgid "RESET"
395
  msgstr ""
396
 
397
+ #: subscribe2.php:1508
398
  msgid "Subscription preferences updated."
399
  msgstr ""
400
 
401
+ #: subscribe2.php:1562
402
  msgid "Notification Settings"
403
  msgstr ""
404
 
405
+ #: subscribe2.php:1569
406
  msgid "Receive email as"
407
  msgstr ""
408
 
409
+ #: subscribe2.php:1579
410
  msgid "Plain Text"
411
  msgstr ""
412
 
413
+ #: subscribe2.php:1581
414
  msgid "Email contains"
415
  msgstr ""
416
 
417
+ #: subscribe2.php:1582
418
  msgid "Excerpt Only"
419
  msgstr ""
420
 
421
+ #: subscribe2.php:1582
422
  msgid "Full Post"
423
  msgstr ""
424
 
425
+ #: subscribe2.php:1590
426
+ msgid "Note: HTML format will always deliver the full post."
427
  msgstr ""
428
 
429
+ #: subscribe2.php:1591
430
  msgid "Automatically subscribe me to newly created categories"
431
  msgstr ""
432
 
433
+ #: subscribe2.php:1604
434
  msgid "Subscribed Categories"
435
  msgstr ""
436
 
437
+ #: subscribe2.php:1609
438
  msgid "Receive daily summary of new posts?"
439
  msgstr ""
440
 
441
+ #: subscribe2.php:1622
442
+ msgid "Update Preferences &raquo;"
443
  msgstr ""
444
 
445
+ #: subscribe2.php:1667
446
  msgid "Send email to all subscribers"
447
  msgstr ""
448
 
449
+ #: subscribe2.php:1672
450
  msgid "Subject"
451
  msgstr ""
452
 
453
+ #: subscribe2.php:1672
454
  msgid "A message from "
455
  msgstr ""
456
 
457
+ #: subscribe2.php:1675
458
  msgid "Recipients: "
459
  msgstr ""
460
 
461
+ #: subscribe2.php:1737
462
  msgid "Select / Unselect All"
463
  msgstr ""
464
 
465
+ #: subscribe2.php:1750
466
  msgid "All Subscribers"
467
  msgstr ""
468
 
469
+ #: subscribe2.php:1751
470
  msgid "Public Subscribers"
471
  msgstr ""
472
 
473
+ #: subscribe2.php:1752
474
  msgid "Confirmed"
475
  msgstr ""
476
 
477
+ #: subscribe2.php:1753
478
  msgid "Unconfirmed"
479
  msgstr ""
480
 
481
+ #: subscribe2.php:1754
482
  msgid "Registered Users"
483
  msgstr ""
484
 
485
+ #: subscribe2.php:1810
486
  msgid "Per Post Email"
487
  msgstr ""
488
 
489
+ #: subscribe2.php:1828
 
 
 
 
 
 
 
 
 
 
 
 
 
490
  msgid "Current server time is"
491
  msgstr ""
492
 
493
+ #: subscribe2.php:1830
494
+ msgid "Next email notification will be sent"
 
 
 
 
495
  msgstr ""
496
 
497
+ #: subscribe2.php:1841
498
  msgid "Check here to Subscribe to email notifications for new posts"
499
  msgstr ""
500
 
501
+ #: subscribe2.php:1850
502
  msgid ""
503
  "By Registering with this blog you are also agreeing to recieve email "
504
  "notifications for new posts"
505
  msgstr ""
506
 
507
+ #: subscribe2.php:1967
508
  msgid "Subscription Confirmation"
509
  msgstr ""
510
 
511
+ #: subscribe2.php:2046
 
 
 
 
512
  msgid "Digest Email"
513
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{tinymce → subscribe2/tinymce}/editor_plugin.js RENAMED
@@ -13,7 +13,7 @@ var TinyMCE_Subscribe2Quicktags = {
13
  getControlHTML : function(cn) {
14
  switch (cn) {
15
  case 'subscribe2quicktags':
16
- buttons = tinyMCE.getButtonHTML('subscribe2', 'lang_subscribe2quicktags_subscribe2', '{$pluginurl}/../include/s2_button.png', 'subscribe2');
17
  return buttons;
18
  }
19
  return '';
@@ -41,10 +41,10 @@ var TinyMCE_Subscribe2Quicktags = {
41
  }
42
 
43
  alt = "Placeholder for Subscribe2 form";
44
- cssstyle = 'background:url(../wp-content/plugins/subscribe2/include/s2_marker.png) no-repeat 5px 5px;';
45
 
46
  html = ''
47
- + '<img src="../wp-content/plugins/subscribe2/include/spacer.gif" '
48
  + 'width="210px" height="25px" '
49
  + 'alt="'+alt+'" title="'+alt+'" style="'+cssstyle+'" class="mce_plugin_s2_img" />';
50
 
@@ -64,14 +64,14 @@ var TinyMCE_Subscribe2Quicktags = {
64
  // Parse all <!--subscribe2--> tags and replace them with images
65
  var startPos = 0;
66
  var alt = "Placeholder for Subscribe2 form";
67
- var cssstyle = 'background:url(../wp-content/plugins/subscribe2/include/s2_marker.png) no-repeat 5px 5px;';
68
  while ((startPos = content.indexOf('<!--subscribe2', startPos)) != -1) {
69
  var endPos = content.indexOf('-->', startPos) + 3;
70
  // Insert image
71
  var moreText = content.substring(startPos + 14, endPos - 3);
72
  var contentAfter = content.substring(endPos);
73
  content = content.substring(0, startPos);
74
- content += '<img src="../wp-content/plugins/subscribe2/include/spacer.gif" ';
75
  content += ' width="210px" height="25px" moretext="'+moreText+'" ';
76
  content += 'alt="'+alt+'" title="'+alt+'" style="'+cssstyle+'" class="mce_plugin_s2_img" />';
77
  content += contentAfter;
13
  getControlHTML : function(cn) {
14
  switch (cn) {
15
  case 'subscribe2quicktags':
16
+ buttons = tinyMCE.getButtonHTML('subscribe2', 'lang_subscribe2quicktags_subscribe2', '{$pluginurl}/../s2_button.png', 'subscribe2');
17
  return buttons;
18
  }
19
  return '';
41
  }
42
 
43
  alt = "Placeholder for Subscribe2 form";
44
+ cssstyle = 'background:url(../wp-content/plugins/subscribe2/s2_marker.png) no-repeat 5px 5px;';
45
 
46
  html = ''
47
+ + '<img src="../wp-content/plugins/subscribe2/spacer.gif" '
48
  + 'width="210px" height="25px" '
49
  + 'alt="'+alt+'" title="'+alt+'" style="'+cssstyle+'" class="mce_plugin_s2_img" />';
50
 
64
  // Parse all <!--subscribe2--> tags and replace them with images
65
  var startPos = 0;
66
  var alt = "Placeholder for Subscribe2 form";
67
+ var cssstyle = 'background:url(../wp-content/plugins/subscribe2/s2_marker.png) no-repeat 5px 5px;';
68
  while ((startPos = content.indexOf('<!--subscribe2', startPos)) != -1) {
69
  var endPos = content.indexOf('-->', startPos) + 3;
70
  // Insert image
71
  var moreText = content.substring(startPos + 14, endPos - 3);
72
  var contentAfter = content.substring(endPos);
73
  content = content.substring(0, startPos);
74
+ content += '<img src="../wp-content/plugins/subscribe2/spacer.gif" ';
75
  content += ' width="210px" height="25px" moretext="'+moreText+'" ';
76
  content += 'alt="'+alt+'" title="'+alt+'" style="'+cssstyle+'" class="mce_plugin_s2_img" />';
77
  content += contentAfter;
{tinymce → subscribe2/tinymce}/langs/en_us.js RENAMED
File without changes
{tinymce → subscribe2/tinymce}/langs/nl_nl.js RENAMED
File without changes
subscribe2debug.php DELETED
@@ -1,73 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Subscribe2 Debug
4
- Plugin URI: http://subscribe2.wordpress.com
5
- Description: Produces Debug Information for the Subscribe2 plugin.
6
- Version: 4.6
7
- Author: Matthew Robinson
8
- Author URI: http://subscribe2.wordpress.com
9
- */
10
-
11
- /*
12
- Copyright (C) 2006-7 Matthew Robinson
13
-
14
- This program is free software; you can redistribute it and/or
15
- modify it under the terms of the GNU General Public License
16
- as published by the Free Software Foundation; either version 2
17
- of the License, or (at your option) any later version.
18
-
19
- This program is distributed in the hope that it will be useful,
20
- but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- GNU General Public License for more details.
23
-
24
- You should have received a copy of the GNU General Public License
25
- along with this program; if not, write to the Free Software
26
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
- http://www.gnu.org/licenses/gpl.html
28
- */
29
-
30
- function add_debug_page() {
31
- add_menu_page('Subscribe2 Debug', 'Subscribe2 Debug', 1, __FILE__, 'debug_menu');
32
- }
33
- add_action('admin_menu', 'add_debug_page');
34
-
35
- function debug_menu() {
36
- global $wp_filter;
37
- echo "<div class=\"wrap\">";
38
- $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
39
- echo "<p>Current Server time is: \r\n";
40
- echo "<strong>" . gmdate($datetime, current_time('timestamp', 1)) . "</strong></p>\r\n";
41
- echo "<p>Current Blog time is: \r\n";
42
- echo "<strong>" . gmdate($datetime, current_time('timestamp')) . "</strong></p>\r\n";
43
- echo "<p>Current Blog offset is: \r\n";
44
- echo get_option('gmt_offset') . "\r\n";
45
- echo "<pre>";
46
- cron_jobs();
47
- echo "</pre>";
48
- echo "Current Subscribe 2 Options are:";
49
- echo "<pre>";
50
- print_r(get_option('subscribe2_options'));
51
- echo "</pre>";
52
- echo "</div>";
53
- include(ABSPATH . 'wp-admin/admin-footer.php');
54
- // just to be sure
55
- die;
56
- }
57
-
58
- function cron_jobs() {
59
- $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
60
- $jobs = _get_cron_array();
61
- if (empty($jobs)) {
62
- echo "No cron jobs scheduled";
63
- } else {
64
- foreach ( $jobs as $job => $tasks ) {
65
- echo "Anytime after " . gmdate($datetime,$job) . " ";
66
- foreach ($tasks as $procname => $task) {
67
- echo $procname . " will execute\r\n";
68
- }
69
- }
70
- }
71
- return;
72
- }
73
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
subscribe2uninstaller.php DELETED
@@ -1,111 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Subscribe2 Uninstaller
4
- Plugin URI: http://subscribe2.wordpress.com
5
- Description: Uninstalls the Subscribe2 plugin from Manage->S2 Uninstaller.
6
- Version: 4.6
7
- Author: Matthew Robinson
8
- Author URI: http://subscribe2.wordpress.com
9
- */
10
-
11
- /*
12
- Copyright (C) 2006-7 Matthew Robinson
13
-
14
- This program is free software; you can redistribute it and/or
15
- modify it under the terms of the GNU General Public License
16
- as published by the Free Software Foundation; either version 2
17
- of the License, or (at your option) any later version.
18
-
19
- This program is distributed in the hope that it will be useful,
20
- but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- GNU General Public License for more details.
23
-
24
- You should have received a copy of the GNU General Public License
25
- along with this program; if not, write to the Free Software
26
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
- http://www.gnu.org/licenses/gpl.html
28
- */
29
-
30
- $mys2uninst = new s2uninst;
31
- $mys2uninst->s2uninst_init();
32
-
33
- class s2uninst {
34
- function manage_page() {
35
- global $s2nonce;
36
-
37
- if (isset($_POST['s2_uninst'])) {
38
- check_admin_referer('s2uninst-uninstaller' . $s2nonce);
39
- echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Subscribe2 has been uninstalled.', 's2uninst') . "</strong></p></div>\n";
40
- $this->uninstall();
41
- }
42
-
43
- echo "<div class=\"wrap\">";
44
- echo "<h2>" . __('Subscribe2 Uninstaller', 's2uninst') . "</h2>\r\n";
45
- if (class_exists('s2class')) {
46
- echo "<p>" . __('The Subscribe2 plugin is still active on your system. Please deactivate the plugin before completing the uninstall process.', 's2uninst') . "</p>\r\n";
47
- echo "<p>" . __('You can deactivate the plugin by using the ', 's2uninst') . "<a href=\"" . get_option('siteurl') . "/wp-admin/plugins.php\">" . __('WordPress Plugin Page', 's2uninst') . "</a>.</p>";
48
- echo "</div>\r\n";
49
- include(ABSPATH . 'wp-admin/admin-footer.php');
50
- // just to be sure
51
- die;
52
- } else {
53
- echo "<form method=\"post\" action=\"\">";
54
- if (function_exists('wp_nonce_field')) {
55
- wp_nonce_field('s2uninst-uninstaller' . $s2nonce);
56
- }
57
- echo "<p>" . __('Clicking on UNINSTALL will remove the following items from your WordPress install (these were installed by Subscribe2).', 's2uninst') . "</p>\r\n";
58
- echo "<ul>\r\n";
59
- echo "<li>" . __('Options Table Entries', 's2uninst') . "</li>\r\n";
60
- echo "<li>" . __('Usermeta Table Entries', 's2uninst') . "</li>\r\n";
61
- echo "<li>" . __('Subscribe2 Table', 's2uninst') . "</li>\r\n";
62
- echo "<li>" . __('Events Schedules by Subscribe2', 's2uninst') . "</li>\r\n";
63
- echo "</ul>\r\n";
64
- echo "<p align=\"center\"><span class=\"submit\">\r\n";
65
- echo "<input type=\"hidden\" name=\"s2_uninst\" value=\"RESET\" />\r\n";
66
- echo "<input type=\"submit\" id=\"deletepost\" name=\"submit\" value=\"" . __('UNINSTALL', 's2uninst') . "\" />\r\n";
67
- echo "</span></p></form></div>\r\n";
68
- include(ABSPATH . 'wp-admin/admin-footer.php');
69
- // just to be sure
70
- die;
71
- }
72
- }
73
-
74
- function uninstall() {
75
- global $wpdb, $table_prefix;
76
- // get name of subscribe2 table
77
- $this->public = $table_prefix . "subscribe2";
78
- // delete entry from wp_options table
79
- delete_option('subscribe2_options');
80
- // delete legacy entry from wp-options table
81
- delete_option('s2_future_posts');
82
- // remove and scheduled events
83
- wp_clear_scheduled_hook('s2_digest_cron');
84
- // delete usermeta data for registered users
85
- $users = $wpdb->get_col("SELECT ID FROM $wpdb->users");
86
- if (!empty($users)) {
87
- foreach ($users as $user) {
88
- $cats = explode(',', get_usermeta($user, 's2_subscribed'));
89
- if ($cats) {
90
- foreach ($cats as $cat) {
91
- delete_usermeta($user, "s2_cat" . $cat);
92
- }
93
- }
94
- delete_usermeta($user, 's2_subscribed');
95
- }
96
- }
97
- // drop the subscribe2 table
98
- $sql = "DROP TABLE IF EXISTS `" . $this->public . "`";
99
- mysql_query($sql);
100
- }
101
-
102
- function s2uninst_init() {
103
- load_plugin_textdomain('s2uninst', 'wp-content/plugins/');
104
- add_action('admin_menu', array(&$this, 's2uninst_page'));
105
- }
106
-
107
- function s2uninst_page() {
108
- add_management_page(__('S2 Uninstaller', 's2uninst'), __('S2 Uninstaller', 's2uninst'), "manage_options", __FILE__, array(&$this, 'manage_page'));
109
- }
110
- }
111
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tinymce/langs/en.js DELETED
@@ -1,5 +0,0 @@
1
- // US lang variables
2
-
3
- tinyMCE.addToLang('subscribe2quicktags',{
4
- subscribe2 : 'Embed Subscribe2 token'
5
- });
 
 
 
 
 
tinymce3/css/content.css DELETED
@@ -1 +0,0 @@
1
- .mceSubscribe2 {display:block;border:0;width:100%;height:12px;border-top:1px;margin-top:15px;background:#fff url(../../include/s2_marker.png) no-repeat center top;}
 
tinymce3/editor_plugin.js DELETED
@@ -1 +0,0 @@
1
- eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3(){6.1p(\'6.s.r\',{1o:3(2,f){1n k=\'<A 1m="\'+f+\'/../../G/1l.1k" z="c 1j" />\',9=\'c\',i=2.1i(\'1h\',\'<!--4-->\'),l;l=1g 1f(i.j(/[\\?\\.\\*\\[\\]\\(\\)\\{\\}\\+\\^\\$\\:]/g,3(a){h\'\\\\\'+a}),\'g\');2.1e(\'c\',3(){2.1d(\'1c\',0,k)});2.1b(\'4\',{1a:\'y x w\',19:f+\'/../G/18.17\',16:9});2.15.5(3(){2.d.14(f+"/F/8.F");7(2.E.D){2.E.D.5(3(13,o){7(o.C.q==\'p\'&&2.d.m(o.C,9))o.12=\'4\'})}});2.11.5(3(2,e){e=e.10;7(e.q===\'p\'&&2.d.m(e,9))2.Z.Y(e)});2.X.5(3(2,B,n){B.W(\'4\',n.q===\'p\'&&2.d.m(n,9))});2.V.5(3(2,o){o.8=o.8.j(l,k)});2.U.5(3(2,o){7(o.T)o.8=o.8.j(/<A[^>]+>/g,3(b){7(b.S(\'z="c\')!==-1)b=i;h b})})},R:3(){h{Q:\'y x w\',P:\'O N\',M:\'v://4.u.t\',L:\'v://4.u.t\',K:6.J+"."+6.I}}});6.H.5(\'4\',6.s.r)})();',62,88,'||ed|function|subscribe2|add|tinymce|if|content|cls||im|mceSubscribe2|dom||url||return|sep|replace|pb|pbRE|hasClass|||IMG|nodeName|Subscribe2Plugin|plugins|com|wordpress|http|Token|Subscribe2|Insert|class|img|cm|node|onResolveName|theme|css|include|PluginManager|minorVersion|majorVersion|version|infourl|authorurl|Robinson|Matthew|author|longname|getInfo|indexOf|get|onPostProcess|onBeforeSetContent|setActive|onNodeChange|select|selection|target|onClick|name|th|loadCSS|onInit|cmd|png|s2_button|image|title|addButton|mceInsertContent|execCommand|addCommand|RegExp|new|subscribe2_separator|getParam|mceItemNoResize|gif|trans|src|var|init|create'.split('|'),0,{}))
 
tinymce3/editor_plugin_src.js DELETED
@@ -1,66 +0,0 @@
1
- (function() {
2
- tinymce.create('tinymce.plugins.Subscribe2Plugin', {
3
- init : function(ed, url) {
4
- var pb = '<img src="' + url + '/../../include/trans.gif" class="mceSubscribe2 mceItemNoResize" />', cls = 'mceSubscribe2', sep = ed.getParam('subscribe2_separator', '<!--subscribe2-->'), pbRE;
5
-
6
- pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');
7
-
8
- // Register commands
9
- ed.addCommand('mceSubscribe2', function() {
10
- ed.execCommand('mceInsertContent', 0, pb);
11
- });
12
-
13
- // Register buttons
14
- ed.addButton('subscribe2', {title : 'Insert Subscribe2 Token', image : url + '/../include/s2_button.png', cmd : cls});
15
-
16
- ed.onInit.add(function() {
17
- ed.dom.loadCSS(url + "/css/content.css");
18
-
19
- if (ed.theme.onResolveName) {
20
- ed.theme.onResolveName.add(function(th, o) {
21
- if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls))
22
- o.name = 'subscribe2';
23
- });
24
- }
25
- });
26
-
27
- ed.onClick.add(function(ed, e) {
28
- e = e.target;
29
-
30
- if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls))
31
- ed.selection.select(e);
32
- });
33
-
34
- ed.onNodeChange.add(function(ed, cm, n) {
35
- cm.setActive('subscribe2', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls));
36
- });
37
-
38
- ed.onBeforeSetContent.add(function(ed, o) {
39
- o.content = o.content.replace(pbRE, pb);
40
- });
41
-
42
- ed.onPostProcess.add(function(ed, o) {
43
- if (o.get)
44
- o.content = o.content.replace(/<img[^>]+>/g, function(im) {
45
- if (im.indexOf('class="mceSubscribe2') !== -1)
46
- im = sep;
47
-
48
- return im;
49
- });
50
- });
51
- },
52
-
53
- getInfo : function() {
54
- return {
55
- longname : 'Insert Subscribe2 Token',
56
- author : 'Matthew Robinson',
57
- authorurl : 'http://subscribe2.wordpress.com',
58
- infourl : 'http://subscribe2.wordpress.com',
59
- version : tinymce.majorVersion + "." + tinymce.minorVersion
60
- };
61
- }
62
- });
63
-
64
- // Register plugin
65
- tinymce.PluginManager.add('subscribe2', tinymce.plugins.Subscribe2Plugin);
66
- })();