Subscribe2 - Version 7.0

Version Description

Download this release

Release Info

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

Code changes from version 6.5 to 7.0

ReadMe.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: MattyRob, Skippy, RavanH
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904
4
  Tags: posts, subscription, email, subscribe, notify, notification
5
- Requires at least: 2.8
6
- Tested up to: 3.2.1
7
- Stable tag: 6.5
8
 
9
  Sends a list of subscribers an email notification when new posts are published to your blog
10
 
@@ -34,9 +34,7 @@ AUTOMATIC INSTALLATION
34
  4. Configure the options to taste, including the email template and any categories which should be excluded from notification
35
  5. Click the "Tools" 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 shortcode or token:
38
- [subscribe2] or the HTML invisible <!--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 dynamic subscription information and will display all forms and messages as necessary.
41
  8. In the WordPress "Settings" area for Subscribe2 select the page name in the "Appearance" section that of the WordPress page created in step 7.
42
 
@@ -47,9 +45,7 @@ MANUAL INSTALLATION
47
  4. Configure the options to taste, including the email template and any categories which should be excluded from notification
48
  5. Click the "Tools" admin menu link, and select "Subscribers".
49
  6. Manually subscribe people as you see fit.
50
- 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 shortcode or token:
51
- [subscribe2] or the HTML invisible <!--subscribe2-->
52
- ***Ensure the token is on a line by itself and that it has a blank line above and below.***
53
  This token will automatically be replaced by dynamic subscription information and will display all forms and messages as necessary.
54
  8. In the WordPress "Settings" area for Subscribe2 select the page name in the "Appearance" section that of the WordPress page created in step 7.
55
 
@@ -70,6 +66,24 @@ No joy there? Well, if you can't find an answer to your question you can get [pa
70
 
71
  A comprehensive guide that covers many, if not all, of the Subscribe2 features is available to purchase from the [My WP Works](http://mywpworks.com/store/subscribe2-ebook/)
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  = Some or all email notifications fail to send, why? =
74
  In the first instance ***check this with your hosting provider***, they have access to your server logs and will be able to tell you where and why emails are being blocked.
75
 
@@ -105,12 +119,14 @@ This plugin sends emails to your subscribers using the BCC (Blind Carbon Copy) h
105
 
106
  = I can't find my subscribers / the options / something else =
107
 
108
- Subscribe2 creates four (4) new admin menus in the back end of WordPress.
109
 
110
- * Posts -> Mail Subscribers : Allows users with Publish capabilities to send emails to your current subscribers
111
- * Tools -> Subscribers : Allows you to manually (un)subscribe users by email address, displays lists of currently subscribed users and allows you to bulk subscribe Registered Users
112
- * Users -> Subscriptions : Allows the currently logged in user to manage their own subscriptions
113
- * Settings -> Subscribe2 : Allows administrator level users to control many aspects of the plugins operation. It should be pretty self explanatory from the notes on the screen
 
 
114
 
115
  = I'm confused, what are all the different types of subscriber? =
116
 
@@ -132,7 +148,7 @@ Get them to register with your blog rather than using the Subscribe2 form. Addit
132
 
133
  = How do I use the Subscribe2 shortcode? =
134
 
135
- In version 6.1 of Subscribe2 the new standard WordPress shortcode [subscribe2] was introduced. By default, it behaves same as old Subscribe2 token, <--subscribe2-->, which means that it will show the same Subscribe2 output in your chosen page in WordPress or in the Widget.
136
 
137
  But it also has advanced options, which are related to form. The default form contains two buttons for subscribing and unsubscribing. You may, for example, only want form that handles unsubscribing, so the shortcode accepts a **hide** parameter to hide one of the buttons.
138
 
@@ -160,22 +176,78 @@ If you opt for the latter way look in the options table for the subscribe2_optio
160
 
161
  In a plugin file for your site or perhaps functions.php in your theme add the following code where 'my_post_type' is change to the name of your custom post type.
162
 
163
- function my_post_types($types) {
164
  $types[] = 'my_post_type';
165
  return $types;
166
  }
167
- add_filter('s2_post_types', 'my_post_types');
168
 
169
  = How can I make use of the support for Custom Taxonomies =
170
 
171
  In a plugin file for your site or perhaps functions.php in your theme add the following code where 'my_
172
  taxonomy_type' is change to the name of your custom taxonomy type.
173
 
174
- function my_taxonomy_types($taxonomies) {
175
  $taxonomies[] = 'my_taxonomy_type';
176
  return $taxonomies;
177
  }
178
- add_filter('s2_taxonomies', 'my_taxonomy_types');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
 
180
  = Can I suggest you add X as a feature =
181
 
@@ -187,7 +259,9 @@ By default Public Subscribers get plain text emails and only Registered Subscrib
187
 
188
  = Which version should I be using, I'm on WordPress x.x.x? =
189
 
190
- WordPress 2.8 and up requires Subscribe2 from the 6.x stable branch. The most recent version is hosted via [Wordpress.org](http://wordpress.org/extend/plugins/subscribe2/).
 
 
191
 
192
  WordPress 2.3.x through to 2.7.x require Subscribe2 from the 4.x or 5.x stable branch. The most recent version is [5.9](http://downloads.wordpress.org/plugin/subscribe2.5.9.zip).
193
 
@@ -209,6 +283,25 @@ Secondly, make sure that the token ([subscribe2] or <!--subscribe2-->) is correc
209
 
210
  == Changelog ==
211
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  = Version 6.5 by Matthew Robinson =
213
 
214
  * Fix for Multisite / MU detection for WordPress versions prior to 3.0
2
  Contributors: MattyRob, Skippy, RavanH
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904
4
  Tags: posts, subscription, email, subscribe, notify, notification
5
+ Requires at least: 3.1
6
+ Tested up to: 3.3
7
+ Stable tag: 7.0
8
 
9
  Sends a list of subscribers an email notification when new posts are published to your blog
10
 
34
  4. Configure the options to taste, including the email template and any categories which should be excluded from notification
35
  5. Click the "Tools" 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 shortcode or token: [subscribe2] or the HTML invisible `<!--subscribe2-->` ***Ensure the token is on a line by itself and that it has a blank line above and below.***
 
 
38
  This token will automatically be replaced by dynamic subscription information and will display all forms and messages as necessary.
39
  8. In the WordPress "Settings" area for Subscribe2 select the page name in the "Appearance" section that of the WordPress page created in step 7.
40
 
45
  4. Configure the options to taste, including the email template and any categories which should be excluded from notification
46
  5. Click the "Tools" admin menu link, and select "Subscribers".
47
  6. Manually subscribe people as you see fit.
48
+ 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 shortcode or token: [subscribe2] or the HTML invisible `<!--subscribe2-->` ***Ensure the token is on a line by itself and that it has a blank line above and below.***
 
 
49
  This token will automatically be replaced by dynamic subscription information and will display all forms and messages as necessary.
50
  8. In the WordPress "Settings" area for Subscribe2 select the page name in the "Appearance" section that of the WordPress page created in step 7.
51
 
66
 
67
  A comprehensive guide that covers many, if not all, of the Subscribe2 features is available to purchase from the [My WP Works](http://mywpworks.com/store/subscribe2-ebook/)
68
 
69
+ = Sending post notifications or email with Subscribe2 =
70
+
71
+ Subscribe2 sends an email at the very moment the post is published. Since Subscribe2 sends live mail with no un-do, it's important to use the Preview function in WordPress to make sure the post has been edited to perfection *before* moving it from Draft to Published mode.
72
+
73
+ Mail is sent when a post is published - it will not be re-sent if you Update the post later. If you need to send a mailing a second time (e.g. during testing), switch the post to Draft mode, then re-publish it.
74
+
75
+ You can also manually send emails to groups of your subscribers using the Send Email page that the plugin creates in the WordPress administration area.
76
+
77
+ = Where can I find the HTML and CSS templates? =
78
+
79
+ While the template field in Settings | Subscribe2 does not display HTML by default, feel free to add HTML to it as needed. You can insert references to static images for use as banners, wrap sections of the template in divs or other elements, or do whatever you like.
80
+
81
+ There is no need to include HTML header data or body tags - just focus on the HTML content, in conjunction with the template tags documented on the settings page.
82
+
83
+ Subscribe2 does not maintain a separate stylesheet for the emails it generates. Instead, it uses the CSS of your currently active WordPress theme. If you need new/custom styles specific to your newsletter that aren't included in your theme stylesheet, try adding elements such as div id="newsletter_sidebar" to your HTML, with corresponding #newsletter_sidebar rules in your stylesheet.
84
+
85
+ Note that if you ever change your site theme, you'll need to copy these additions over to the new theme's stylesheet. To avoid this problem, consider placing a custom CSS file on your server outside of your theme directory, and link to it from the template, thus overriding the active theme styles permanently.
86
+
87
  = Some or all email notifications fail to send, why? =
88
  In the first instance ***check this with your hosting provider***, they have access to your server logs and will be able to tell you where and why emails are being blocked.
89
 
119
 
120
  = I can't find my subscribers / the options / something else =
121
 
122
+ Subscribe2 creates four (4) new admin menus in the back end of WordPress. These are all under the top level menu header **Subscribe2**.
123
 
124
+ * Your Subscriptions : Allows the currently logged in user to manage their own subscriptions
125
+ * Subscribers : Allows you to manually (un)subscribe users by email address, displays lists of currently subscribed users and allows you to bulk subscribe Registered Users
126
+ * Settings : Allows administrator level users to control many aspects of the plugins operation. It should be pretty self explanatory from the notes on the screen
127
+ * Send Mail : Allows users with Publish capabilities to send emails to your current subscribers
128
+
129
+ **Note:** In versions of the plugin prior to version 7.0 the menus are under the WordPress system at Posts -> Mail Subscribers, Tools -> Subscribers, Users -> Subscriptions and Settings -> Subscribe2.
130
 
131
  = I'm confused, what are all the different types of subscriber? =
132
 
148
 
149
  = How do I use the Subscribe2 shortcode? =
150
 
151
+ In version 6.1 of Subscribe2 the new standard WordPress shortcode [subscribe2] was introduced. By default, it behaves same as old Subscribe2 token, `<--subscribe2-->`, which means that it will show the same Subscribe2 output in your chosen page in WordPress or in the Widget.
152
 
153
  But it also has advanced options, which are related to form. The default form contains two buttons for subscribing and unsubscribing. You may, for example, only want form that handles unsubscribing, so the shortcode accepts a **hide** parameter to hide one of the buttons.
154
 
176
 
177
  In a plugin file for your site or perhaps functions.php in your theme add the following code where 'my_post_type' is change to the name of your custom post type.
178
 
179
+ `function my_post_types($types) {
180
  $types[] = 'my_post_type';
181
  return $types;
182
  }
183
+ add_filter('s2_post_types', 'my_post_types');`
184
 
185
  = How can I make use of the support for Custom Taxonomies =
186
 
187
  In a plugin file for your site or perhaps functions.php in your theme add the following code where 'my_
188
  taxonomy_type' is change to the name of your custom taxonomy type.
189
 
190
+ `function my_taxonomy_types($taxonomies) {
191
  $taxonomies[] = 'my_taxonomy_type';
192
  return $taxonomies;
193
  }
194
+ add_filter('s2_taxonomies', 'my_taxonomy_types');`
195
+
196
+ = How do I make use of the new option to AJAXify the form? =
197
+
198
+ The first thing you will need to do is visit the options page and enable the AJAX setting where it says "Enable AJAX style subscription form?", this will load the necessary javascript onto your WordPress site.
199
+
200
+ Next you need to decide if you want the link to be on a WordPress page or in your Sidebar with the Widget.
201
+
202
+ For a WordPress page you use the normal Subscribe2 token but add a 'link' parameter with the text you'd like your users to click, so something like:
203
+
204
+ `[subscribe2 link="Click Here to Subscribe"]`
205
+
206
+ For Sidebar users, visit the Widgets page and look in the Subscribe2 Widget, there is a new option at the bottom called "Show as link". If you choose this a link will be placed in your sidebar that displays the form when clicked.
207
+
208
+ In either case, if your end users have javascript disabled in their browser the link will sinply take them through to the subscription page you are recommended to create at step 7 of the install instructions.
209
+
210
+ The final thing to mention is the styling of the form. The CSS taken from the jQuery-UI libraries and there are several to choose from. I quite link darkness-ui and that is the styling used by default. But what if you want to change this?
211
+
212
+ Well, you need to write a little code and provide a link to the Google API or Microsoft CDN hosted CSS theme you prefer. The example below changes the theme from ui-darkness to ui-lightness. More choice are detailed on the [jQuery release blog](http://blog.jqueryui.com/2011/08/jquery-ui-1-8-16/) where the them names are listed and linked to the address you'll need.
213
+
214
+ `function custom_ajax_css() {
215
+ return "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css";
216
+ }
217
+ add_filter('s2_jqueryui_css', 'custom_ajax_css');`
218
+
219
+ = I want to change the kinds of users who can access the Subscribe2 menus. Is that possible? =
220
+
221
+ Yes, it is possible with a little bit for code either in a custom plugin or your functions.php file in your theme. You use the add_filter() command that is part of WordPress to change the [capability](http://codex.wordpress.org/Roles_and_Capabilities#Capabilities) that allows access to each of the Subscribe2 menus.
222
+
223
+ `function s2_admin_changes( $capability, $menu ) {
224
+ // $capability is the core WordPress capability to allow admin page access
225
+ // $menu is the title of the page:
226
+ // 'user' for access to personal subscription settings
227
+ // 'manage' to allow access to the user management screen
228
+ // 'settings' to allow access to the plugin settings
229
+ // 'send' for access to the Send Email page
230
+
231
+ // identify the menu you are changing capability for first
232
+ // then return a new capability
233
+ if ( $menu == 'send' ) {
234
+ return 'read';
235
+ }
236
+
237
+ return $capability;
238
+ }
239
+
240
+ add_filter('s2_capability', 's2_admin_changes', 10, 2);`
241
+
242
+ = I want to change the email subject, how do I do that? =
243
+
244
+ You can change the email subject with the 's2_email_subject' filter. Something like this:
245
+
246
+ `function s2_subject_changes($subject) {
247
+ return "This is my preferred email subject";
248
+ }
249
+
250
+ add_filter('s2_email_subject', 's2_subject_changes');`
251
 
252
  = Can I suggest you add X as a feature =
253
 
259
 
260
  = Which version should I be using, I'm on WordPress x.x.x? =
261
 
262
+ WordPress 3.1 and up requres Subscribe2 from the 7.x stable branch. The most recent version is hosted via [Wordpress.org](http://wordpress.org/extend/plugins/subscribe2/).
263
+
264
+ WordPress 2.8 and up requires Subscribe2 from the 6.x stable branch. The most recenet version is [6.5](http://downloads.wordpress.org/plugin/subscribe2.6.5.zip).
265
 
266
  WordPress 2.3.x through to 2.7.x require Subscribe2 from the 4.x or 5.x stable branch. The most recent version is [5.9](http://downloads.wordpress.org/plugin/subscribe2.5.9.zip).
267
 
283
 
284
  == Changelog ==
285
 
286
+ = Version 7.0 by Matthew Robinson =
287
+
288
+ * NOTE Subscribe2 now requires WordPress 3.1 or higher
289
+ * Implemented top level menu to make Subscribe2 menu access easier
290
+ * Introduced the ability to add UTM Tracking parameters to email links - Thanks to Sander de Boer
291
+ * Introduced Opt-out by Author for Registered Users (on sites where there is more than one author)
292
+ * Improved table layout code on user management page
293
+ * Make use of core checked() function to save code space
294
+ * Show user name for Registered Users when mouse is hovered over email address in Subscribe2->Subscribers
295
+ * Move IP address display on hover from date of signup to email address for Public Subscribers so consistent with above change
296
+ * Introduced the 's2_capability' filter to allow API amendments to page access for different user capabilities
297
+ * Added support to exclude 'post formats' from generating emails provided 'post formats' are supported by the current active theme
298
+ * Implemented use of core WordPress functions to place the authoring button shortcuts, removed reliance on buttonsnap.php so this library is now dropped
299
+ * Implement use of wp_register_scripts() function
300
+ * Display custom post types added using the API in the Settings page as confirmation things are working
301
+ * Added two missed strings to the translation domain and corrected a typo - thanks to Stig Ulfsby
302
+ * Added a filter for the outgoing email subject line
303
+ * Added an option to AJAXify the form, read the FAQs for how to use this new feature
304
+
305
  = Version 6.5 by Matthew Robinson =
306
 
307
  * Fix for Multisite / MU detection for WordPress versions prior to 3.0
include/buttonsnap.php DELETED
@@ -1,446 +0,0 @@
1
- <?php
2
- /*******************************************************************************
3
- BUTTONSNAP CLASS LIBRARY By Owen Winkler
4
- http://asymptomatic.net
5
- WordPress Downloads are at http://redalt.com/downloads
6
- Version: 1.3.2
7
- Updated get_settings() to get_option() as former is deprecated - Matthew Robinson August 2011
8
- *******************************************************************************/
9
-
10
- if (!class_exists('buttonsnap')) :
11
- class buttonsnap
12
- {
13
- var $script_output = false;
14
- var $buttons = array('post'=>array(),'page'=>array(),'any'=>array());
15
- var $markers = array();
16
-
17
- function sink_hooks()
18
- {
19
- add_action('edit_form_advanced', array(&$this, 'edit_form_advanced'));
20
- add_action('edit_page_form', array(&$this, 'edit_page_form'));
21
- add_filter('mce_plugins', array(&$this, 'mce_plugins'));
22
- }
23
-
24
- function go_solo()
25
- {
26
- $dispatch = isset($_POST['buttonsnapdispatch']) ? $_POST['buttonsnapdispatch'] : @$_GET['buttonsnapdispatch'];
27
- if($dispatch != '') {
28
- auth_redirect();
29
- $selection = isset($_POST['selection']) ? $_POST['selection'] : @$_GET['selection'];
30
- $selection = apply_filters($dispatch, $selection);
31
- die($selection);
32
- }
33
- if(isset($_GET['docss'])) {
34
- auth_redirect();
35
- do_action('marker_css');
36
- die();
37
- }
38
- }
39
-
40
- function edit_form_advanced()
41
- {
42
- if (!$this->script_output) {
43
- $this->output_script('post');
44
- $this->script_output = true;
45
- }
46
- }
47
-
48
- function edit_page_form()
49
- {
50
- if (!$this->script_output) {
51
- $this->output_script('page');
52
- $this->script_output = true;
53
- }
54
- }
55
-
56
- function mce_plugins($plugins)
57
- {
58
- if (count($this->markers) > 0) {
59
-
60
- echo "var buttonsnap_markers = new Array(\n";
61
- $comma = '';
62
- foreach ($this->markers as $k => $v) {
63
- echo "{$comma}\"{$k}\"";
64
- $comma = "\n,";
65
- }
66
- echo "\n);\n";
67
- echo "var buttonsnap_classes = new Array(\n";
68
- $comma = '';
69
- foreach ($this->markers as $k => $v) {
70
- echo "{$comma}\"{$v}\"";
71
- $comma = "\n,";
72
- }
73
- echo "\n);\n";
74
-
75
- ?>
76
-
77
- function TinyMCE_buttonsnap_initInstance(inst) {
78
- tinyMCE.importCSS(inst.getDoc(), "<?php echo $this->plugin_uri(); ?>?docss=true");
79
- }
80
-
81
- function TinyMCE_buttonsnap_parseAttributes(attribute_string) {
82
- var attributeName = "";
83
- var attributeValue = "";
84
- var withInName;
85
- var withInValue;
86
- var attributes = new Array();
87
- var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');
88
- var titleText = tinyMCE.getLang('lang_buttonsnap_more');
89
- var titleTextPage = tinyMCE.getLang('lang_buttonsnap_page');
90
-
91
- if (attribute_string == null || attribute_string.length < 2)
92
- return null;
93
-
94
- withInName = withInValue = false;
95
-
96
- for (var i=0; i<attribute_string.length; i++) {
97
- var chr = attribute_string.charAt(i);
98
-
99
- if ((chr == '"' || chr == "'") && !withInValue)
100
- withInValue = true;
101
- else if ((chr == '"' || chr == "'") && withInValue) {
102
- withInValue = false;
103
-
104
- var pos = attributeName.lastIndexOf(' ');
105
- if (pos != -1)
106
- attributeName = attributeName.substring(pos+1);
107
-
108
- attributes[attributeName.toLowerCase()] = attributeValue.substring(1).toLowerCase();
109
-
110
- attributeName = "";
111
- attributeValue = "";
112
- } else if (!whiteSpaceRegExp.test(chr) && !withInName && !withInValue)
113
- withInName = true;
114
-
115
- if (chr == '=' && withInName)
116
- withInName = false;
117
-
118
- if (withInName)
119
- attributeName += chr;
120
-
121
- if (withInValue)
122
- attributeValue += chr;
123
- }
124
-
125
- return attributes;
126
- }
127
-
128
- function TinyMCE_buttonsnap_cleanup(type, content) {
129
- switch (type) {
130
- case "initial_editor_insert":
131
- content = TinyMCE_buttonsnap_cleanup("insert_to_editor", content);
132
- alert('foo');
133
-
134
- break;
135
-
136
- case "insert_to_editor":
137
- var startPos = 0;
138
-
139
- for(z=0;z<buttonsnap_markers.length;z++) {
140
- var startPos = 0;
141
- while ((startPos = content.indexOf('<!--' + buttonsnap_markers[z] + '-->', startPos)) != -1) {
142
- // Insert image
143
- var contentAfter = content.substring(startPos + 7 + buttonsnap_markers[z].length);
144
- content = content.substring(0, startPos);
145
- content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ';
146
- content += ' width="100%" height="10px" ';
147
- content += 'alt="" class="' + buttonsnap_classes[z] + '" />';
148
- content += contentAfter;
149
-
150
- startPos++;
151
- }
152
- }
153
- break;
154
-
155
- case "get_from_editor":
156
- var startPos = -1;
157
- while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
158
- var endPos = content.indexOf('/>', startPos);
159
- var attribs = TinyMCE_buttonsnap_parseAttributes(content.substring(startPos + 4, endPos));
160
-
161
- for(z=0;z<buttonsnap_classes.length;z++) {
162
- if (attribs['class'] == buttonsnap_classes[z]) {
163
- endPos += 2;
164
-
165
- var embedHTML = '<!--' + buttonsnap_markers[z] + '-->';
166
-
167
- // Insert embed/object chunk
168
- chunkBefore = content.substring(0, startPos);
169
- chunkAfter = content.substring(endPos);
170
- content = chunkBefore + embedHTML + chunkAfter;
171
- break;
172
- }
173
- }
174
- }
175
- break;
176
- }
177
-
178
- return content;
179
- }
180
-
181
- <?php
182
- $plugins[] = 'buttonsnap';
183
- }
184
- return $plugins;
185
- }
186
-
187
- function output_script($type = 'any')
188
- {
189
- echo '<script type="text/javascript">
190
- var buttonsnap_request_uri = "' . $this->plugin_uri() . '";
191
- var buttonsnap_wproot = "' . get_option('siteurl') . '";
192
- </script>' . "\n";
193
- echo <<< ENDSCRIPT
194
-
195
- <script type="text/javascript">
196
- addLoadEvent(function () { window.setTimeout('buttonsnap_addbuttons()',1000); });
197
- var buttonsnap_mozilla = document.getElementById&&!document.all;
198
- function buttonsnap_safeclick(e)
199
- {
200
- if(!buttonsnap_mozilla) {
201
- e.returnValue = false;
202
- e.cancelBubble = true;
203
- }
204
- }
205
- function buttonsnap_addEvent( obj, type, fn )
206
- {
207
- if (obj.addEventListener)
208
- obj.addEventListener( type, fn, false );
209
- else if (obj.attachEvent)
210
- {
211
- obj["e"+type+fn] = fn;
212
- obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
213
- obj.attachEvent( "on"+type, obj[type+fn] );
214
- }
215
- }
216
- function buttonsnap_newbutton(src, alt) {
217
- if(window.tinyMCE) {
218
- var anchor = document.createElement('A');
219
- anchor.setAttribute('href', 'javascript:;');
220
- anchor.setAttribute('title', alt);
221
- var newimage = document.createElement('IMG');
222
- newimage.setAttribute('src', src);
223
- newimage.setAttribute('alt', alt);
224
- newimage.setAttribute('class', 'mceButtonNormal');
225
- buttonsnap_addEvent(newimage, 'mouseover', function() {tinyMCE.switchClass(this,'mceButtonOver');});
226
- buttonsnap_addEvent(newimage, 'mouseout', function() {tinyMCE.switchClass(this,'mceButtonNormal');}); //restoreClass(this)
227
- buttonsnap_addEvent(newimage, 'mousedown', function() {tinyMCE.restoreAndSwitchClass(this,'mceButtonDown');});
228
- anchor.appendChild(newimage);
229
- brs = mcetoolbar.getElementsByTagName('BR');
230
- if(brs.length > 0)
231
- mcetoolbar.insertBefore(anchor, brs[0]);
232
- else
233
- mcetoolbar.appendChild(anchor);
234
- }
235
- else if(window.qttoolbar)
236
- {
237
- var anchor = document.createElement('input');
238
- anchor.type = 'button';
239
- anchor.value = alt;
240
- anchor.className = 'ed_button';
241
- anchor.title = alt;
242
- anchor.id = 'ed_' + alt;
243
- qttoolbar.appendChild(anchor);
244
- }
245
- return anchor;
246
- }
247
- function buttonsnap_newseparator() {
248
- if(window.tinyMCE) {
249
- var sep = document.createElement('IMG');
250
-
251
- sep.setAttribute('src', buttonsnap_wproot + '/wp-includes/js/tinymce/themes/advanced/images/spacer.gif');
252
- sep.className = 'mceSeparatorLine';
253
- sep.setAttribute('class', 'mceSeparatorLine');
254
- sep.setAttribute('height', '16');
255
- sep.setAttribute('width', '1');
256
- brs = mcetoolbar.getElementsByTagName('BR');
257
- if(brs.length > 0)
258
- mcetoolbar.insertBefore(sep, brs[0]);
259
- else
260
- mcetoolbar.appendChild(sep);
261
- }
262
- }
263
- function buttonsnap_settext(text) {
264
- if(window.tinyMCE) {
265
- window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, text);
266
- tinyMCE.execCommand("mceCleanup");
267
- } else {
268
- edInsertContent(edCanvas, text);
269
- }
270
- }
271
- function buttonsnap_ajax(dispatch) {
272
- if(window.tinyMCE) {
273
- selection = tinyMCE.getInstanceById('content').getSelectedText();
274
- }
275
- else {
276
- if (document.selection) {
277
- document.getElementById('content').focus();
278
- sel = document.selection.createRange();
279
- if (sel.text.length > 0) {
280
- selection = sel.text;
281
- }
282
- else {
283
- selection = '';
284
- }
285
- }
286
- else {
287
- selection = '';
288
- }
289
- }
290
-
291
- var ajax = new sack(buttonsnap_request_uri);
292
- ajax.setVar('buttonsnapdispatch', dispatch);
293
- ajax.setVar('selection', selection);
294
- ajax.onCompletion = function () {buttonsnap_settext(this.response);};
295
- ajax.runAJAX();
296
- }
297
- var mcetoolbar;
298
- var qttoolbar = document.getElementById("ed_toolbar");
299
- function buttonsnap_addbuttons () {
300
- if(window.tinyMCE) {
301
- try {
302
- var edit = document.getElementById(window.tinyMCE.getEditorId('content'));
303
- for(table = edit;table.tagName != 'TABLE';table = table.parentNode);
304
- mcetoolbar = table.rows[0].firstChild;
305
- }
306
- catch(e) {
307
- setTimeout('buttonsnap_addbuttons()', 5000);
308
- return;
309
- }
310
- }
311
- try {
312
- ENDSCRIPT;
313
-
314
- switch($type) {
315
- case 'any':
316
- $this->buttons['any'] = array_merge($this->buttons['post'], $this->buttons['page'], $this->buttons['any']);
317
- break;
318
- default:
319
- $this->buttons[$type] = array_merge($this->buttons[$type], $this->buttons['any']);
320
- }
321
- $usebuttons = $this->buttons[$type];
322
-
323
- foreach ($usebuttons as $button) {
324
- if($button['type'] == 'separator') {
325
- echo "buttonsnap_newseparator();\n";
326
- }
327
- else {
328
- echo "newbtn = buttonsnap_newbutton('{$button['src']}', '{$button['alt']}');\n";
329
- switch($button['type']) {
330
- case 'text':
331
- echo "buttonsnap_addEvent(newbtn, 'click', function(e) {buttonsnap_settext(\"{$button['text']}\");buttonsnap_safeclick(e);});\n";
332
- break;
333
- case 'js':
334
- echo "buttonsnap_addEvent(newbtn, 'click', function(e) {" . $button['js'] . "buttonsnap_safeclick(e);});\n";
335
- break;
336
- case 'ajax':
337
- echo "buttonsnap_addEvent(newbtn, 'click', function(e) {buttonsnap_ajax(\"{$button['hook']}\");buttonsnap_safeclick(e);});\n";
338
- break;
339
- default:
340
- echo "buttonsnap_addEvent(newbtn, 'click', function(e) {alert(\"The :{$button->type}: button is an invalid type\");buttonsnap_safeclick(e);});\n";
341
- }
342
- }
343
- }
344
- echo <<< MORESCRIPT
345
- }
346
- catch(e) {
347
- setTimeout('buttonsnap_addbuttons()', 5000);
348
- }
349
- }
350
- </script>
351
-
352
- MORESCRIPT;
353
- }
354
-
355
- function textbutton($imgsrc, $alttext, $inserted, $type="any")
356
- {
357
- $this->buttons[$type][] = array('type'=>'text', 'src'=>$imgsrc, 'alt'=>$alttext, 'text'=>$inserted);
358
- return $this->buttons;
359
- }
360
-
361
- function jsbutton($imgsrc, $alttext, $js, $type="any")
362
- {
363
- $this->buttons[$type][] = array('type'=>'js', 'src'=>$imgsrc, 'alt'=>$alttext, 'js'=>$js);
364
- return $this->buttons;
365
- }
366
-
367
- function ajaxbutton($imgsrc, $alttext, $hook, $type="any")
368
- {
369
- $this->buttons[$type][] = array('type'=>'ajax', 'src'=>$imgsrc, 'alt'=>$alttext, 'hook'=>$hook);
370
- return $this->buttons;
371
- }
372
-
373
- function separator($type="any")
374
- {
375
- $this->buttons[$type][] = array('type'=>'separator');
376
- return $this->buttons;
377
- }
378
-
379
- function register_marker($marker, $cssclass)
380
- {
381
- $this->markers[$marker] = $cssclass;
382
- }
383
-
384
- function basename($src='')
385
- {
386
- if($src == '') $src = __FILE__;
387
- $name = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', $src);
388
- return str_replace('\\', '/', $name);
389
- }
390
-
391
- function plugin_uri($src = '')
392
- {
393
- return get_option('siteurl') . '/wp-content/plugins/' . $this->basename($src);
394
- }
395
-
396
- function include_up($filename) {
397
- $c=0;
398
- while(!is_file($filename)) {
399
- $filename = '../' . $filename;
400
- $c++;
401
- if($c==30) {
402
- echo 'Could not find ' . basename($filename) . '.'; return '';
403
- }
404
- }
405
- return $filename;
406
- }
407
-
408
- function debug($foo)
409
- {
410
- $args = func_get_args();
411
- echo "<pre style=\"background-color:#ffeeee;border:1px solid red;\">";
412
- foreach($args as $arg1)
413
- {
414
- echo htmlentities(print_r($arg1, 1)) . "<br/>";
415
- }
416
- echo "</pre>";
417
- }
418
- }
419
- $buttonsnap = new buttonsnap();
420
- function buttonsnap_textbutton($imgsrc, $alttext, $inserted, $type="any") { global $buttonsnap; return $buttonsnap->textbutton($imgsrc, $alttext, $inserted, $type);}
421
- function buttonsnap_jsbutton($imgsrc, $alttext, $js, $type="any") { global $buttonsnap; return $buttonsnap->jsbutton($imgsrc, $alttext, $js, $type);}
422
- function buttonsnap_ajaxbutton($imgsrc, $alttext, $hook, $type="any") { global $buttonsnap; return $buttonsnap->ajaxbutton($imgsrc, $alttext, $hook, $type);}
423
- function buttonsnap_separator($type="any") { global $buttonsnap; return $buttonsnap->separator($type);}
424
-
425
- function buttonsnap_textbutton_post($imgsrc, $alttext, $inserted) { global $buttonsnap; return $buttonsnap->textbutton($imgsrc, $alttext, $inserted, 'post');}
426
- function buttonsnap_jsbutton_post($imgsrc, $alttext, $js) { global $buttonsnap; return $buttonsnap->jsbutton($imgsrc, $alttext, $js, 'post');}
427
- function buttonsnap_ajaxbutton_post($imgsrc, $alttext, $hook) { global $buttonsnap; return $buttonsnap->ajaxbutton($imgsrc, $alttext, $hook, 'post');}
428
- function buttonsnap_separator_post() { global $buttonsnap; return $buttonsnap->separator('post');}
429
-
430
- function buttonsnap_textbutton_page($imgsrc, $alttext, $inserted) { global $buttonsnap; return $buttonsnap->textbutton($imgsrc, $alttext, $inserted, 'page');}
431
- function buttonsnap_jsbutton_page($imgsrc, $alttext, $js) { global $buttonsnap; return $buttonsnap->jsbutton($imgsrc, $alttext, $js, 'page');}
432
- function buttonsnap_ajaxbutton_page($imgsrc, $alttext, $hook) { global $buttonsnap; return $buttonsnap->ajaxbutton($imgsrc, $alttext, $hook, 'page');}
433
- function buttonsnap_separator_page() { global $buttonsnap; return $buttonsnap->separator('page');}
434
-
435
- function buttonsnap_dirname($src = '') {global $buttonsnap; return dirname($buttonsnap->plugin_uri($src));}
436
- function buttonsnap_register_marker($marker, $cssclass) {global $buttonsnap; return $buttonsnap->register_marker($marker, $cssclass);}
437
- endif;
438
- if (!defined('ABSPATH')) {
439
- require_once($buttonsnap->include_up('wp-config.php'));
440
- $buttonsnap->go_solo();
441
- }
442
- else {
443
- $buttonsnap->sink_hooks();
444
- }
445
-
446
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
include/counterwidget.php CHANGED
@@ -79,7 +79,7 @@ class S2_Counter_widget extends WP_Widget {
79
  echo "<label>\r\n";
80
  echo "<input type=\"text\" name=\"" . $this->get_field_name('s2w_bg') . "\" id=\"" . $this->get_field_id('s2w_bg') . "\" maxlength=\"6\" value=\"" . $s2w_bg . "\" class=\"colorpickerField\" style=\"width:60px;\" /> " . __('Body', 'subscribe2') . "</label><br />\r\n";
81
  echo "<label>\r\n";
82
- echo "<input type=\"text\" name=\"" . $this->get_field_name('s2w_fg') . "\" id=\"" . $this->get_field_id('s2w_fg') . "\" maxlength=\"6\" value=\"" . $s2w_fg . "\" class=\"colorpickerField\" style=\"width:60px;\" /> " . __('Text', 'subsribe2') . "</label><br />\r\n";
83
  echo "</fieldset>";
84
 
85
  echo "<fieldset>\r\n";
79
  echo "<label>\r\n";
80
  echo "<input type=\"text\" name=\"" . $this->get_field_name('s2w_bg') . "\" id=\"" . $this->get_field_id('s2w_bg') . "\" maxlength=\"6\" value=\"" . $s2w_bg . "\" class=\"colorpickerField\" style=\"width:60px;\" /> " . __('Body', 'subscribe2') . "</label><br />\r\n";
81
  echo "<label>\r\n";
82
+ echo "<input type=\"text\" name=\"" . $this->get_field_name('s2w_fg') . "\" id=\"" . $this->get_field_id('s2w_fg') . "\" maxlength=\"6\" value=\"" . $s2w_fg . "\" class=\"colorpickerField\" style=\"width:60px;\" /> " . __('Text', 'subscribe2') . "</label><br />\r\n";
83
  echo "</fieldset>";
84
 
85
  echo "<fieldset>\r\n";
include/options.php CHANGED
@@ -38,6 +38,10 @@ if (!isset($this->subscribe2_options['admin_email'])) {
38
  $this->subscribe2_options['admin_email'] = "subs";
39
  } // option for sending new subscriber notifications to admins
40
 
 
 
 
 
41
  if(!isset($this->subscribe2_options['s2page'])) {
42
  $this->subscribe2_options['s2page'] = 0;
43
  } // option for default WordPress page for Subscribe2 to use
@@ -86,6 +90,10 @@ if (!isset($this->subscribe2_options['show_button'])) {
86
  $this->subscribe2_options['show_button'] = "1";
87
  } // option to show Subscribe2 button on Write page
88
 
 
 
 
 
89
  if (!isset($this->subscribe2_options['widget'])) {
90
  $this->subscribe2_options['widget'] = "0";
91
  } // option to enable Subscribe2 Widget
@@ -103,30 +111,34 @@ if (!isset($this->subscribe2_options['entries'])) {
103
  } // option for the number of subscribers displayed on each page
104
 
105
  if (!isset($this->subscribe2_options['barred'])) {
106
- $this->subscribe2_options['barred'] = '';
107
  } // option containing domains barred from public registration
108
 
 
 
 
 
109
  if (!isset($this->subscribe2_options['mailtext'])) {
110
- $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");
111
  } // Default notification email text
112
 
113
  if (!isset($this->subscribe2_options['notification_subject'])) {
114
- $this->subscribe2_options['notification_subject'] = "[BLOGNAME] TITLE";
115
  } // Default notification email subject
116
 
117
  if (!isset($this->subscribe2_options['confirm_email'])) {
118
- $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");
119
  } // Default confirmation email text
120
 
121
  if (!isset($this->subscribe2_options['confirm_subject'])) {
122
- $this->subscribe2_options['confirm_subject'] = "[BLOGNAME] " . __('Please confirm your request', 'subscribe2');
123
  } // Default confirmation email subject
124
 
125
  if (!isset($this->subscribe2_options['remind_email'])) {
126
- $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");
127
  } // Default reminder email text
128
 
129
  if (!isset($this->subscribe2_options['remind_subject'])) {
130
- $this->subscribe2_options['remind_subject'] = "[BLOGNAME] " . __('Subscription Reminder', 'subscribe2');;
131
  } // Default reminder email subject
132
  ?>
38
  $this->subscribe2_options['admin_email'] = "subs";
39
  } // option for sending new subscriber notifications to admins
40
 
41
+ if (!isset($this->subscribe2_options['tracking'])) {
42
+ $this->subscribe2_options['tracking'] = "";
43
+ } // option for tracking
44
+
45
  if(!isset($this->subscribe2_options['s2page'])) {
46
  $this->subscribe2_options['s2page'] = 0;
47
  } // option for default WordPress page for Subscribe2 to use
90
  $this->subscribe2_options['show_button'] = "1";
91
  } // option to show Subscribe2 button on Write page
92
 
93
+ if (!isset($this->subscribe2_options['ajax'])) {
94
+ $this->subscribe2_options['ajax'] ) = "0";
95
+ } // option to enable an AJAX style form
96
+
97
  if (!isset($this->subscribe2_options['widget'])) {
98
  $this->subscribe2_options['widget'] = "0";
99
  } // option to enable Subscribe2 Widget
111
  } // option for the number of subscribers displayed on each page
112
 
113
  if (!isset($this->subscribe2_options['barred'])) {
114
+ $this->subscribe2_options['barred'] = "";
115
  } // option containing domains barred from public registration
116
 
117
+ if (!isset($this->subscribe2_options['exclude_formats'])) {
118
+ $this->subscribe2_options['exclude_formats'] = "";
119
+ } // option for excluding post formats as supported by the current theme
120
+
121
  if (!isset($this->subscribe2_options['mailtext'])) {
122
+ $this->subscribe2_options['mailtext'] = __("{BLOGNAME} has posted a new item, '{TITLE}'\n\n{POST}\n\nYou may view the latest post at\n{PERMALINK}\n\nYou received this e-mail because you asked to be notified when new updates are posted.\nBest regards,\n{MYNAME}\n{EMAIL}", "subscribe2");
123
  } // Default notification email text
124
 
125
  if (!isset($this->subscribe2_options['notification_subject'])) {
126
+ $this->subscribe2_options['notification_subject'] = "[{BLOGNAME}] TITLE";
127
  } // Default notification email subject
128
 
129
  if (!isset($this->subscribe2_options['confirm_email'])) {
130
+ $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\n{LINK}\n\nIf you did not request this, please feel free to disregard this notice!\n\nThank you,\n{MYNAME}.", "subscribe2");
131
  } // Default confirmation email text
132
 
133
  if (!isset($this->subscribe2_options['confirm_subject'])) {
134
+ $this->subscribe2_options['confirm_subject'] = "[{BLOGNAME}] " . __('Please confirm your request', 'subscribe2');
135
  } // Default confirmation email subject
136
 
137
  if (!isset($this->subscribe2_options['remind_email'])) {
138
+ $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\n{LINK}\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,\n{MYNAME}", "subscribe2");
139
  } // Default reminder email text
140
 
141
  if (!isset($this->subscribe2_options['remind_subject'])) {
142
+ $this->subscribe2_options['remind_subject'] = "[{BLOGNAME}] " . __('Subscription Reminder', 'subscribe2');;
143
  } // Default reminder email subject
144
  ?>
include/s2_button.js ADDED
@@ -0,0 +1 @@
 
1
+ edButtons[edButtons.length] = new edButton( 'Subscribe2', 'Subscribe2', '[subscribe2]', '', '', -1 );
include/spacer.gif DELETED
Binary file
include/widget.php CHANGED
@@ -6,9 +6,9 @@ class S2_Form_widget extends WP_Widget {
6
  function S2_Form_widget() {
7
  $widget_ops = array('classname' => 's2_form_widget', 'description' => __('Sidebar Widget for Subscribe2', 'subscribe2') );
8
  $control_ops = array('width' => 250, 'height' => 300);
9
- $this->WP_Widget('s2_form_widget', __('Subscribe2 Widget'), $widget_ops, $control_ops);
10
  }
11
-
12
  /**
13
  Displays the Widget
14
  */
@@ -20,9 +20,13 @@ class S2_Form_widget extends WP_Widget {
20
  $widgetpostcontent = empty($instance['widgetpostcontent']) ? '' : $instance['widgetpostcontent'];
21
  $hidebutton = empty($instance['hidebutton']) ? 'none' : $instance['hidebutton'];
22
  $postto = empty($instance['postto']) ? '' : $instance['postto'];
 
23
  if ( $hidebutton == 'subscribe' || $hidebutton == 'unsubscribe' ) {
24
  $hide = " hide=\"" . $hidebutton . "\"";
 
 
25
  }
 
26
  if ( $postto ) {
27
  $postid = " id=\"" . $postto . "\"";
28
  }
@@ -41,7 +45,7 @@ class S2_Form_widget extends WP_Widget {
41
  echo "</div>";
42
  echo $after_widget;
43
  }
44
-
45
  /**
46
  Saves the widgets settings.
47
  */
@@ -53,10 +57,10 @@ class S2_Form_widget extends WP_Widget {
53
  $instance['widgetpostcontent'] = stripslashes($new_instance['widgetpostcontent']);
54
  $instance['hidebutton'] = strip_tags(stripslashes($new_instance['hidebutton']));
55
  $instance['postto'] = stripslashes($new_instance['postto']);
56
-
57
  return $instance;
58
  }
59
-
60
  /**
61
  Creates the edit form for the widget.
62
  */
@@ -71,7 +75,7 @@ class S2_Form_widget extends WP_Widget {
71
  }
72
  // code to obtain old settings too
73
  $instance = wp_parse_args( (array) $instance, $defaults);
74
-
75
  $title = htmlspecialchars($instance['title'], ENT_QUOTES);
76
  $div= htmlspecialchars($instance['div'], ENT_QUOTES);
77
  $widgetprecontent = htmlspecialchars($instance['widgetprecontent'], ENT_QUOTES);
@@ -79,7 +83,7 @@ class S2_Form_widget extends WP_Widget {
79
  $hidebutton = htmlspecialchars($instance['hidebutton'], ENT_QUOTES);
80
  $postto = htmlspecialchars($instance['postto'], ENT_QUOTES);
81
 
82
- global $wpdb;
83
  $sql = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type='page' AND post_status='publish'";
84
  $pages = $wpdb->get_results($sql);
85
 
@@ -92,8 +96,12 @@ class S2_Form_widget extends WP_Widget {
92
  echo "<textarea class=\"widefat\" id=\"" . $this->get_field_name('widgetprecontent') . "\" name=\"" . $this->get_field_name('widgetprecontent') . "\" rows=\"2\" cols=\"25\">" . $widgetprecontent . "</textarea></label></p>\r\n";
93
  echo "<p><label for=\"" . $this->get_field_name('widgetpostcontent') . "\">" . __('Post-Content', 'subscribe2') . ":\r\n";
94
  echo "<textarea class=\"widefat\" id=\"" . $this->get_field_id('widgetpostcontent') . "\" name=\"" . $this->get_field_name('widgetpostcontent') . "\" rows=\"2\" cols=\"25\">" . $widgetpostcontent . "</textarea></label></p>\r\n";
95
- echo "<p><label for=\"" . $this->get_field_name('hidebutton') . "\">" . __('Hide button', 'subscribe2') . ":<br />\r\n";
96
- echo "<input name=\"" . $this->get_field_name('hidebutton') . "\" type=\"radio\" value=\"none\"". checked('none', $hidebutton, false) . "/>" . __('None', 'subscribe2') . "<br /><input name=\"" . $this->get_field_name('hidebutton') . "\" type=\"radio\" value=\"subscribe\"". checked('subscribe', $hidebutton, false) . "/>" . __('Subscribe', 'subscribe2') . "<br /><input name=\"" . $this->get_field_name('hidebutton') . "\" type=\"radio\" value=\"unsubscribe\"". checked('unsubscribe', $hidebutton, false) . "/>" . __('Unsubscribe', 'subscribe2') . "</label></p>\r\n";
 
 
 
 
97
  if ( !empty($pages) ) {
98
  echo "<p><label for=\"" . $this->get_field_name('postto') . "\">" . __('Post form content to page', 'subscribe2') . ":\r\n";
99
  echo "<select id=\"" . $this->get_field_id('postto') . "\" name=\"" . $this->get_field_name('postto') . "\">\r\n";
6
  function S2_Form_widget() {
7
  $widget_ops = array('classname' => 's2_form_widget', 'description' => __('Sidebar Widget for Subscribe2', 'subscribe2') );
8
  $control_ops = array('width' => 250, 'height' => 300);
9
+ $this->WP_Widget('s2_form_widget', __('Subscribe2 Widget', 'subscribe2'), $widget_ops, $control_ops);
10
  }
11
+
12
  /**
13
  Displays the Widget
14
  */
20
  $widgetpostcontent = empty($instance['widgetpostcontent']) ? '' : $instance['widgetpostcontent'];
21
  $hidebutton = empty($instance['hidebutton']) ? 'none' : $instance['hidebutton'];
22
  $postto = empty($instance['postto']) ? '' : $instance['postto'];
23
+ $hide = '';
24
  if ( $hidebutton == 'subscribe' || $hidebutton == 'unsubscribe' ) {
25
  $hide = " hide=\"" . $hidebutton . "\"";
26
+ } elseif ( $hidebutton == 'link' ) {
27
+ $hide = " link=\"" . __('(Un)Subscribe to Posts', 'subscribe2') . "\"";
28
  }
29
+ $postid = '';
30
  if ( $postto ) {
31
  $postid = " id=\"" . $postto . "\"";
32
  }
45
  echo "</div>";
46
  echo $after_widget;
47
  }
48
+
49
  /**
50
  Saves the widgets settings.
51
  */
57
  $instance['widgetpostcontent'] = stripslashes($new_instance['widgetpostcontent']);
58
  $instance['hidebutton'] = strip_tags(stripslashes($new_instance['hidebutton']));
59
  $instance['postto'] = stripslashes($new_instance['postto']);
60
+
61
  return $instance;
62
  }
63
+
64
  /**
65
  Creates the edit form for the widget.
66
  */
75
  }
76
  // code to obtain old settings too
77
  $instance = wp_parse_args( (array) $instance, $defaults);
78
+
79
  $title = htmlspecialchars($instance['title'], ENT_QUOTES);
80
  $div= htmlspecialchars($instance['div'], ENT_QUOTES);
81
  $widgetprecontent = htmlspecialchars($instance['widgetprecontent'], ENT_QUOTES);
83
  $hidebutton = htmlspecialchars($instance['hidebutton'], ENT_QUOTES);
84
  $postto = htmlspecialchars($instance['postto'], ENT_QUOTES);
85
 
86
+ global $wpdb, $mysubscribe2;
87
  $sql = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type='page' AND post_status='publish'";
88
  $pages = $wpdb->get_results($sql);
89
 
96
  echo "<textarea class=\"widefat\" id=\"" . $this->get_field_name('widgetprecontent') . "\" name=\"" . $this->get_field_name('widgetprecontent') . "\" rows=\"2\" cols=\"25\">" . $widgetprecontent . "</textarea></label></p>\r\n";
97
  echo "<p><label for=\"" . $this->get_field_name('widgetpostcontent') . "\">" . __('Post-Content', 'subscribe2') . ":\r\n";
98
  echo "<textarea class=\"widefat\" id=\"" . $this->get_field_id('widgetpostcontent') . "\" name=\"" . $this->get_field_name('widgetpostcontent') . "\" rows=\"2\" cols=\"25\">" . $widgetpostcontent . "</textarea></label></p>\r\n";
99
+ echo "<p><label for=\"" . $this->get_field_name('hidebutton') . "\">" . __('Display options', 'subscribe2') . ":<br />\r\n";
100
+ echo "<input name=\"" . $this->get_field_name('hidebutton') . "\" type=\"radio\" value=\"none\"". checked('none', $hidebutton, false) . "/>" . __('Show complete form', 'subscribe2') . "<br /><input name=\"" . $this->get_field_name('hidebutton') . "\" type=\"radio\" value=\"subscribe\"". checked('subscribe', $hidebutton, false) . "/>" . __('Hide Subscribe button', 'subscribe2') . "<br /><input name=\"" . $this->get_field_name('hidebutton') . "\" type=\"radio\" value=\"unsubscribe\"". checked('unsubscribe', $hidebutton, false) . "/>" . __('Hide Unsubscribe button', 'subscribe2');
101
+ if ( '1' == $mysubscribe2->subscribe2_options['ajax'] ) {
102
+ echo "<br /><input name=\"" . $this->get_field_name('hidebutton') . "\" type=\"radio\" value=\"link\"". checked('link', $hidebutton, false) . "/>" . __('Show as link', 'subscribe2');
103
+ }
104
+ echo "</label></p>\r\n";
105
  if ( !empty($pages) ) {
106
  echo "<p><label for=\"" . $this->get_field_name('postto') . "\">" . __('Post form content to page', 'subscribe2') . ":\r\n";
107
  echo "<select id=\"" . $this->get_field_id('postto') . "\" name=\"" . $this->get_field_name('postto') . "\">\r\n";
subscribe2.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Subscribe2
4
  Plugin URI: http://subscribe2.wordpress.com
5
  Description: Notifies an email list when new entries are posted.
6
- Version: 6.5
7
  Author: Matthew Robinson
8
  Author URI: http://subscribe2.wordpress.com
9
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904
@@ -31,37 +31,25 @@ along with Subscribe2. If not, see <http://www.gnu.org/licenses/>.
31
  */
32
 
33
  global $wp_version;
34
- if ( version_compare($wp_version, '2.8', '<') ) {
35
- // Subscribe2 needs WordPress 2.8 or above, exit if not on a compatible version
36
- $exit_msg = sprintf(__('This version of Subscribe2 requires WordPress 2.8 or greater. Please update %1$s or use an older version of %2$s.', 'subscribe2'), '<a href="http://codex.wordpress.org/Updating_WordPress">Wordpress</a>', '<a href="http://wordpress.org/extend/plugins/subscribe2/download/">Subscribe2</a>');
37
  exit($exit_msg);
38
  }
39
- if ( version_compare($wp_version, '3.0', '<') ) {
40
- global $wpmu_version;
41
- if ( isset($wpmu_version) || strpos($wp_version, 'wordpress-mu') ) {
42
- // Subscribe2 needs WordPress MultiSite 3.0 or above, exit if not on a compatible version
43
- $exit_msg = sprintf(__('This version of Subscribe2 requires WordPress Multisite 3.0 or greater. Please update %1$s or use an older version of %2$s.', 'subscribe2'), '<a href="http://codex.wordpress.org/Updating_WordPress">Wordpress</a>', '<a href="http://wordpress.org/extend/plugins/subscribe2/download/">Subscribe2</a>');
44
- }
45
- }
46
 
47
  // our version number. Don't touch this or any line below
48
  // unless you know exactly what you are doing
49
- define( 'S2VERSION', '6.5' );
50
  define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
51
- define( 'S2DIR', trailingslashit(plugin_basename(dirname(__FILE__))) );
52
  define( 'S2URL', plugin_dir_url(dirname(__FILE__)) . S2DIR );
53
 
54
- // Set minimum execution time to 5 minutes - won't affect safe mode
55
  $safe_mode = array('On', 'ON', 'on', 1);
56
  if ( !in_array(ini_get('safe_mode'), $safe_mode) && ini_get('max_execution_time') < 300 ) {
57
  @ini_set('max_execution_time', 300);
58
  }
59
 
60
- /* Include buttonsnap library by Owen Winckler */
61
- if ( !class_exists('buttonsnap') ) {
62
- require( S2PATH . 'include/buttonsnap.php' );
63
- }
64
-
65
  $mysubscribe2 = new s2class;
66
  $mysubscribe2->s2init();
67
 
@@ -77,7 +65,7 @@ class s2class {
77
 
78
  $this->please_log_in = "<p class=\"s2_message\">" . __('To manage your subscription options please', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-login.php\">" . __('login', 'subscribe2') . "</a>.</p>";
79
 
80
- $this->use_profile_admin = "<p class=\"s2_message\">" . __('You may manage your subscription options from your', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-admin/users.php?page=s2_users\">" . __('profile', 'subscribe2') . "</a>.</p>";
81
  if ( $this->s2_mu === true ) {
82
  global $blog_id, $user_ID;
83
  if ( !is_blog_user($blog_id) ) {
@@ -86,15 +74,6 @@ class s2class {
86
  }
87
  }
88
 
89
- $this->use_profile_users = "<p class=\"s2_message\">" . __('You may manage your subscription options from your', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-admin/profile.php?page=s2_users\">" . __('profile', 'subscribe2') . "</a>.</p>";
90
- if ( $this->s2_mu === true ) {
91
- global $blog_id, $user_ID;
92
- if ( !is_blog_user($blog_id) ) {
93
- // if we are on multisite and the user is not a member of this blog change the link
94
- $this->use_profile_users = "<p class=\"s2_message\"><a href=\"" . get_option('siteurl') . "/wp-admin/?s2mu_subscribe=" . $blog_id . "\">" . __('Subscribe', 'subscribe2') . "</a> " . __('to email notifications when this blog posts new content', 'subscribe2') . ".</p>";
95
- }
96
- }
97
-
98
  $this->confirmation_sent = "<p class=\"s2_message\">" . __('A confirmation message is on its way!', 'subscribe2') . "</p>";
99
 
100
  $this->already_subscribed = "<p class=\"s2_error\">" . __('That email address is already subscribed.', 'subscribe2') . "</p>";
@@ -107,7 +86,7 @@ class s2class {
107
 
108
  $this->error = "<p class=\"s2_error\">" . __('Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2') . "</p>";
109
 
110
- $this->no_page = "<p class=\"s2_error\">" . __('You must to create a WordPress page for this plugin to work correctly.', 'subscribe2') . "<p>";
111
 
112
  $this->mail_sent = "<p class=\"s2_message\">" . __('Message sent!', 'subscribe2') . "</p>";
113
 
@@ -134,19 +113,21 @@ class s2class {
134
  Hook the menu
135
  */
136
  function admin_menu() {
137
- $s2management = add_management_page(__('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), "manage_options", 's2_tools', array(&$this, 'manage_menu'));
 
 
 
 
 
 
138
  add_action("admin_print_scripts-$s2management", array(&$this, 'checkbox_form_js'));
139
 
140
- $s2options = add_options_page(__('Subscribe2 Options', 'subscribe2'), __('Subscribe2', 'subscribe2'), "manage_options", 's2_settings', array(&$this, 'options_menu'));
141
  add_action("admin_print_scripts-$s2options", array(&$this, 'checkbox_form_js'));
142
  add_action("admin_print_scripts-$s2options", array(&$this, 'option_form_js'));
143
  add_filter('plugin_row_meta', array(&$this, 'plugin_links'), 10, 2);
144
 
145
- $s2user = add_users_page(__('Your Subscriptions', 'subscribe2'), __('Your Subscriptions', 'subscribe2'), "read", 's2_users', array(&$this, 'user_menu'));
146
- add_action("admin_print_scripts-$s2user", array(&$this, 'checkbox_form_js'));
147
- add_action("admin_print_styles-$s2user", array(&$this, 'user_admin_css'));
148
-
149
- add_submenu_page('post-new.php', __('Mail Subscribers', 'subscribe2'), __('Mail Subscribers', 'subscribe2'), "publish_posts", 's2_posts', array(&$this, 'write_menu'));
150
 
151
  $s2nonce = md5('subscribe2');
152
  } // end admin_menu()
@@ -162,15 +143,18 @@ class s2class {
162
  Insert Javascript and CSS into admin_header
163
  */
164
  function checkbox_form_js() {
165
- wp_enqueue_script('s2_checkbox', S2URL . 'include/s2_checkbox' . $this->script_debug . '.js', array('jquery'), '1.1');
 
166
  } //end checkbox_form_js()
167
 
168
  function user_admin_css() {
169
- wp_enqueue_style('s2_user_admin', S2URL . 'include/s2_user_admin.css', array(), '1.0');
 
170
  } // end user_admin_css()
171
 
172
  function option_form_js() {
173
- wp_enqueue_script('s2_edit', S2URL . 'include/s2_edit' . $this->script_debug . '.js', array('jquery'), '1.0');
 
174
  } // end option_form_js()
175
 
176
  /* ===== Install, upgrade, reset ===== */
@@ -218,25 +202,29 @@ class s2class {
218
  $users = $this->get_all_registered('ID');
219
  if ( !empty($users) ) {
220
  foreach ( $users as $user_ID ) {
221
- $check_format = $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'));
222
  // if user is already registered update format remove 's2_excerpt' field and update 's2_format'
223
  if ( 'html' == $check_format ) {
224
- $this->delete_user_meta($user_ID, 's2_excerpt');
225
  } elseif ( 'text' == $check_format ) {
226
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), $this->get_user_meta($user_ID, 's2_excerpt'), true);
227
- $this->delete_user_meta($user_ID, 's2_excerpt');
228
  } elseif ( empty($check_format) ) {
229
  // no prior settings so create them
230
  $this->register($user_ID);
231
  }
232
- $subscribed = $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
233
  if ( strstr($subscribed, '-1') ) {
234
  // make sure we remove '-1' from any settings
235
  $old_cats = explode(',', $subscribed);
236
  $pos = array_search('-1', $old_cats);
237
  unset($old_cats[$pos]);
238
  $cats = implode(',', $old_cats);
239
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
 
 
 
 
240
  }
241
  }
242
  }
@@ -280,10 +268,10 @@ class s2class {
280
  // loop through all users
281
  foreach ( $users as $user_ID ) {
282
  // get categories which the user is subscribed to (old ones)
283
- $categories = $this->get_user_meta($user_ID, 's2_subscribed');
284
  $categories = explode(',', $categories);
285
- $format = $this->get_user_meta($user_ID, 's2_format');
286
- $autosub = $this->get_user_meta($user_ID, 's2_autosub');
287
 
288
  // load blogs of user (only if we need them)
289
  $blogs = array();
@@ -298,25 +286,25 @@ class s2class {
298
  $subscribed_categories = array_intersect($categories, $blog_categories);
299
  if ( !empty($subscribed_categories) ) {
300
  foreach ( $subscribed_categories as $subscribed_category ) {
301
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $subscribed_category, $subscribed_category);
302
  }
303
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $subscribed_categories));
304
  }
305
  if ( !empty($format) ) {
306
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), $format);
307
  }
308
  if ( !empty($autosub) ) {
309
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), $autosub);
310
  }
311
  restore_current_blog();
312
  }
313
 
314
  // delete old user meta keys
315
- $this->delete_user_meta($user_ID, 's2_subscribed');
316
- $this->delete_user_meta($user_ID, 's2_format');
317
- $this->delete_user_meta($user_ID, 's2_autosub');
318
  foreach ( $categories as $cat ) {
319
- $this->delete_user_meta($user_ID, 's2_cat' . $cat);
320
  }
321
  }
322
  }
@@ -357,10 +345,10 @@ class s2class {
357
  $string = str_replace("{BLOGNAME}", html_entity_decode(get_option('blogname'), ENT_QUOTES), $string);
358
  $string = str_replace("{BLOGLINK}", get_option('home'), $string);
359
  $string = str_replace("{TITLE}", stripslashes($this->post_title), $string);
360
- $link = "<a href=\"" . $this->permalink . "\">" . $this->permalink . "</a>";
361
  $string = str_replace("{PERMALINK}", $link, $string);
362
  if ( strstr($string, "{TINYLINK}") ) {
363
- $tinylink = file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode($this->permalink));
364
  if ( $tinylink !== 'Error' || $tinylink != false ) {
365
  $tlink = "<a href=\"" . $tinylink . "\">" . $tinylink . "</a>";
366
  $string = str_replace("{TINYLINK}", $tlink, $string);
@@ -401,8 +389,9 @@ class s2class {
401
  $mailtext = apply_filters('s2_plain_email', $message);
402
  }
403
 
404
- // Replace any escaped html symbols in subject
405
  $subject = html_entity_decode($subject, ENT_QUOTES);
 
406
 
407
  // Construct BCC headers for sending or send individual emails
408
  $bcc = '';
@@ -513,6 +502,19 @@ class s2class {
513
  return $headers;
514
  } // end headers()
515
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516
  /**
517
  Sends an email notification of a new post
518
  */
@@ -544,17 +546,18 @@ class s2class {
544
  return $post;
545
  }
546
 
547
- // is this post set in the future?
548
- if ( $post->post_date > current_time('mysql') ) {
549
- // bail out
550
- return $post;
551
- }
552
-
553
- //Are we sending notifications for password protected posts?
554
  if ( $this->subscribe2_options['password'] == "no" && $post->post_password != '' ) {
555
  return $post;
556
  }
557
 
 
 
 
 
 
 
 
558
  $post_cats = wp_get_post_categories($post->ID);
559
  $check = false;
560
  // is the current post assigned to any categories
@@ -955,26 +958,14 @@ class s2class {
955
  $message = $this->email . " " . __('subscribed to email notifications!', 'subscribe2');
956
  $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'");
957
  if ( empty($recipients) ) {
958
- global $wp_version;
959
- if ( version_compare($wp_version, '3.1', '<') ) {
960
- // WordPress version is less than 3.1, use WP_User_Search class
961
- if ( !class_exists(WP_User_Search) ) {
962
- require(ABSPATH . 'wp-admin/includes/user.php');
963
- $wp_user_query = new WP_User_Search( '', '', 'administrator');
964
- $admins_string = implode(', ', $wp_user_query->get_results());
965
- $sql = "SELECT ID, display_name FROM $wpdb->users WHERE ID IN (" . $admins_string . ")";
966
- $recipients = $wpdb->get_results($sql);
967
- }
968
- } else {
969
- // WordPress version is 3.1 or greater, use WP_User_Query class
970
- $role = array('fields' => array('user_email'), 'role' => 'administrator');
971
- $wp_user_query = get_users( $role );
972
- foreach ($wp_user_query as $user) {
973
- $recipients[] = $user->user_email;
974
- }
975
  }
976
  }
977
  $headers = $this->headers();
 
978
  foreach ( $recipients as $recipient ) {
979
  @wp_mail($recipient, $subject, $message, $headers);
980
  }
@@ -993,23 +984,10 @@ class s2class {
993
  $message = $this->email . " " . __('unsubscribed from email notifications!', 'subscribe2');
994
  $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'");
995
  if ( empty($recipients) ) {
996
- global $wp_version;
997
- if ( version_compare($wp_version, '3.1', '<') ) {
998
- // WordPress version is less than 3.1, use WP_User_Search class
999
- if ( !class_exists(WP_User_Search) ) {
1000
- require(ABSPATH . 'wp-admin/includes/user.php');
1001
- $wp_user_query = new WP_User_Search( '', '', 'administrator');
1002
- $admins_string = implode(', ', $wp_user_query->get_results());
1003
- $sql = "SELECT ID, display_name FROM $wpdb->users WHERE ID IN (" . $admins_string . ")";
1004
- $recipients = $wpdb->get_results($sql);
1005
- }
1006
- } else {
1007
- // WordPress version is 3.1 or greater, use WP_User_Query class
1008
- $role = array('fields' => array('user_email'), 'role' => 'administrator');
1009
- $wp_user_query = get_users( $role );
1010
- foreach ($wp_user_query as $user) {
1011
- $recipients[] = $user->user_email;
1012
- }
1013
  }
1014
  }
1015
  $headers = $this->headers();
@@ -1092,21 +1070,36 @@ class s2class {
1092
  } // end get_public()
1093
 
1094
  /**
1095
- Return an array of all subscribers
1096
  */
1097
- function get_all_registered($id = '') {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1098
  global $wpdb;
1099
 
1100
  if ( $this->s2_mu ) {
1101
- if ( $id ) {
1102
  return $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
1103
  } else {
1104
- $result = $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
1105
- $ids = implode(',', $result);
1106
- return $wpdb->get_col("SELECT user_email FROM $wpdb->users WHERE ID IN ($ids)");
1107
  }
1108
  } else {
1109
- if ( $id ) {
1110
  return $wpdb->get_col("SELECT ID FROM $wpdb->users");
1111
  } else {
1112
  return $wpdb->get_col("SELECT user_email FROM $wpdb->users");
@@ -1123,6 +1116,7 @@ class s2class {
1123
 
1124
  $format = '';
1125
  $cats = '';
 
1126
  $subscribers = array();
1127
 
1128
  parse_str($args, $r);
@@ -1130,6 +1124,8 @@ class s2class {
1130
  $r['format'] = 'all';
1131
  if ( !isset($r['cats']) )
1132
  $r['cats'] = '';
 
 
1133
 
1134
  $JOIN = ''; $AND = '';
1135
  // text or HTML subscribers
@@ -1157,6 +1153,12 @@ class s2class {
1157
  $AND .= " AND ($and)";
1158
  }
1159
 
 
 
 
 
 
 
1160
  if ( $this->s2_mu ) {
1161
  $sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . "WHERE a.meta_key='" . $wpdb->prefix . "capabilities'" . $AND;
1162
  } else {
@@ -1212,14 +1214,14 @@ class s2class {
1212
  } // end signup_ip()
1213
 
1214
  /**
1215
- function to ensure email is compliant with internet messaging standards
1216
  */
1217
  function sanitize_email($email) {
1218
  if ( !is_email($email) ) { return; }
1219
 
1220
  // ensure that domain is in lowercase as per internet email standards
1221
  list($name, $domain) = explode('@', $email, 2);
1222
- return $name . "@" . strtolower($domain);;
1223
  } // end sanitize_email()
1224
 
1225
  /**
@@ -1253,25 +1255,25 @@ class s2class {
1253
  if ( false !== $this->is_public($this->sanitize_email($user->user_email)) ) {
1254
  // delete this user from the public table, and subscribe them to all the categories
1255
  $this->delete($user->user_email);
1256
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
1257
  foreach ( explode(',', $cats) as $cat ) {
1258
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat, "$cat");
1259
  }
1260
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), 'excerpt');
1261
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), $this->subscribe2_options['autosub_def']);
1262
  } else {
1263
  // create post format entries for all users
1264
  if ( in_array($this->subscribe2_options['autoformat'], array('html', 'html_excerpt', 'post', 'excerpt')) ) {
1265
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), $this->subscribe2_options['autoformat']);
1266
  } else {
1267
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), 'excerpt');
1268
  }
1269
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), $this->subscribe2_options['autosub_def']);
1270
  // if the are no existing subscriptions, create them if we have consent
1271
  if ( true === $consent ) {
1272
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
1273
  foreach ( explode(',', $cats) as $cat ) {
1274
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat, "$cat");
1275
  }
1276
  }
1277
  }
@@ -1292,7 +1294,7 @@ class s2class {
1292
  $user_IDs = $wpdb->get_col($sql);
1293
 
1294
  foreach ( $user_IDs as $user_ID ) {
1295
- $old_cats = $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
1296
  if ( !empty($old_cats) ) {
1297
  $old_cats = explode(',', $old_cats);
1298
  $newcats = array_unique(array_merge($cats, $old_cats));
@@ -1302,9 +1304,9 @@ class s2class {
1302
  if ( !empty($newcats) ) {
1303
  // add subscription to these cat IDs
1304
  foreach ( $newcats as $id ) {
1305
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, "$id");
1306
  }
1307
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $newcats));
1308
  }
1309
  unset($newcats);
1310
  }
@@ -1318,26 +1320,26 @@ class s2class {
1318
  global $wpdb;
1319
 
1320
  $useremails = explode(",", $emails);
1321
- $useremails = implode("', '", $useremails);
1322
 
1323
- $sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ('$useremails')";
1324
  $user_IDs = $wpdb->get_col($sql);
1325
 
1326
  foreach ( $user_IDs as $user_ID ) {
1327
- $old_cats = explode(',', $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
1328
  $remain = array_diff($old_cats, $cats);
1329
  if ( !empty($remain) ) {
1330
  // remove subscription to these cat IDs and update s2_subscribed
1331
  foreach ( $cats as $id ) {
1332
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
1333
  }
1334
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $remain));
1335
  } else {
1336
  // remove subscription to these cat IDs and update s2_subscribed to ''
1337
  foreach ( $cats as $id ) {
1338
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
1339
  }
1340
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
1341
  }
1342
  unset($remain);
1343
  }
@@ -1350,11 +1352,8 @@ class s2class {
1350
  if ( empty($format) ) { return; }
1351
 
1352
  global $wpdb;
1353
- $emails ='';
1354
  $subscribers = explode(',', $subscribers_string);
1355
- foreach ( $subscribers as $subscriber ) {
1356
- ( '' == $emails) ? $emails = "'$subscriber'" : $emails .= ",'$subscriber'";
1357
- }
1358
  $ids = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_email IN ($emails)");
1359
  $ids = implode(',', $ids);
1360
  $sql = "UPDATE $wpdb->usermeta SET meta_value='{$format}' WHERE meta_key='" . $this->get_usermeta_keyname('s2_format') . "' AND user_id IN ($ids)";
@@ -1369,9 +1368,9 @@ class s2class {
1369
 
1370
  global $wpdb;
1371
  $useremails = explode(",", $emails);
1372
- $useremails = implode("', '", $useremails);
1373
 
1374
- $sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ('$useremails')";
1375
  $user_IDs = $wpdb->get_col($sql);
1376
 
1377
  if ( $digest == 'digest' ) {
@@ -1389,17 +1388,17 @@ class s2class {
1389
 
1390
  foreach ( $user_IDs as $user_ID ) {
1391
  foreach ( $all_cats as $cat ) {
1392
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat->term_id, $cat->term_id);
1393
  }
1394
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats_string);
1395
  }
1396
  } elseif ( $digest == '-1' ) {
1397
  foreach ( $user_IDs as $user_ID ) {
1398
- $cats = explode(',', $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
1399
  foreach ( $cats as $id ) {
1400
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
1401
  }
1402
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
1403
  }
1404
  }
1405
  } // end digest_change()
@@ -1434,12 +1433,12 @@ class s2class {
1434
  $cats_string = '';
1435
  foreach ( $all_cats as $cat ) {
1436
  ('' == $cats_string) ? $cats_string = "$cat->term_id" : $cats_string .= ",$cat->term_id";
1437
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat->term_id, $cat->term_id);
1438
  }
1439
  if ( empty($cats_string) ) {
1440
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
1441
  } else {
1442
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats_string);
1443
  }
1444
  }
1445
  } elseif ( !empty($_GET['s2mu_unsubscribe']) ) {
@@ -1451,16 +1450,16 @@ class s2class {
1451
  $user_ID = get_current_user_id();
1452
 
1453
  // delete subscription to all categories on that blog
1454
- $cats = $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
1455
  $cats = explode(',', $cats);
1456
  if ( !is_array($cats) ) {
1457
  $cats = array($cats);
1458
  }
1459
 
1460
  foreach ( $cats as $id ) {
1461
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
1462
  }
1463
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
1464
 
1465
  // add an action hook for external manipulation of blog and user data
1466
  do_action_ref_array('subscribe2_wpmu_unsubscribe', array($user_ID, $unsub_id));
@@ -1492,101 +1491,6 @@ class s2class {
1492
  }
1493
  } // end wpmu_subscribe()
1494
 
1495
- /**
1496
- Filter the usermeta function to allow backwards compatibility to WordPress 2.8 and 2.9
1497
- WordPress 3.0 replaced all *_usermeta() functions with *_user_meta counterparts
1498
- */
1499
- function get_user_meta($user_ID, $keyname) {
1500
- global $wp_version;
1501
- if ( version_compare($wp_version, '3.0', '<') ) {
1502
- // WordPress version is less than 3.0, use get_usermeta
1503
- $user_meta = get_usermeta($user_ID, $keyname);
1504
- } else {
1505
- $user_meta = get_user_meta($user_ID, $keyname, true);
1506
- }
1507
-
1508
- return $user_meta;
1509
- } // end get_user_meta()
1510
-
1511
- function update_user_meta($user_ID, $keyname, $value) {
1512
- global $wp_version;
1513
- if ( version_compare($wp_version, '3.0', '<') ) {
1514
- // WordPress version is less than 3.0, use update_usermeta
1515
- $user_meta = update_usermeta($user_ID, $keyname, $value);
1516
- } else {
1517
- $user_meta = update_user_meta($user_ID, $keyname, $value);
1518
- }
1519
-
1520
- return $user_meta;
1521
- } // end update_user_meta()
1522
-
1523
- function delete_user_meta($user_ID, $keyname) {
1524
- global $wp_version;
1525
- if ( version_compare($wp_version, '3.0', '<') ) {
1526
- // WordPress version is less than 3.0, use delete_usermeta
1527
- $user_meta = delete_usermeta($user_ID, $keyname);
1528
- } else {
1529
- $user_meta = delete_user_meta($user_ID, $keyname);
1530
- }
1531
-
1532
- return $user_meta;
1533
- } // end delete_user_meta()
1534
-
1535
- /**
1536
- Get objects parents
1537
- Uses get_ancestors in WordPress 3.1+ and copies this function in lower versions
1538
- Can be dropped and calls substituted when Subscribe2 requires WordPress 3.1+
1539
- */
1540
- function get_parents($object_id = 0, $object_type = '') {
1541
- if ( function_exists('get_ancestors') ) {
1542
- return get_ancestors($object_id, $object_type);
1543
- } else {
1544
- // code copied directly from wp-includes/taxonomy.php
1545
- // get_ancestors() function
1546
- $object_id = (int) $object_id;
1547
-
1548
- $ancestors = array();
1549
-
1550
- if ( empty( $object_id ) ) {
1551
- return apply_filters('get_ancestors', $ancestors, $object_id, $object_type);
1552
- }
1553
-
1554
- if ( is_taxonomy_hierarchical( $object_type ) ) {
1555
- $term = get_term($object_id, $object_type);
1556
- while ( ! is_wp_error($term) && ! empty( $term->parent ) && ! in_array( $term->parent, $ancestors ) ) {
1557
- $ancestors[] = (int) $term->parent;
1558
- $term = get_term($term->parent, $object_type);
1559
- }
1560
- } elseif ( null !== get_post_type_object( $object_type ) ) {
1561
- $object = get_post($object_id);
1562
- if ( ! is_wp_error( $object ) && isset( $object->ancestors ) && is_array( $object->ancestors ) )
1563
- $ancestors = $object->ancestors;
1564
- else {
1565
- while ( ! is_wp_error($object) && ! empty( $object->post_parent ) && ! in_array( $object->post_parent, $ancestors ) ) {
1566
- $ancestors[] = (int) $object->post_parent;
1567
- $object = get_post($object->post_parent);
1568
- }
1569
- }
1570
- }
1571
-
1572
- return apply_filters('get_ancestors', $ancestors, $object_id, $object_type);
1573
- }
1574
- } // end get_parents()
1575
-
1576
- /**
1577
- Check if taxonomy exists
1578
- Uses taxonomy_exists in WordPress 3.0+ and copies this function in lower versions
1579
- Can be dropped and calls substituted when Subscribe2 requires WordPress 3.0+
1580
- */
1581
- function s2_taxonomy_exists($taxonomy) {
1582
- if ( function_exists('taxonomy_exists') ) {
1583
- return taxonomy_exists($taxonomy);
1584
- } else {
1585
- global $wp_taxonomies;
1586
- return isset( $wp_taxonomies[$taxonomy] );
1587
- }
1588
- } // end s2_taxonomy_exists()
1589
-
1590
  /**
1591
  Autosubscribe registered users to newly created categories
1592
  if registered user has selected this option
@@ -1607,7 +1511,7 @@ class s2class {
1607
  if ( '' == $user_IDs ) { return; }
1608
 
1609
  foreach ( $user_IDs as $user_ID ) {
1610
- $old_cats = $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
1611
  if ( empty($old_cats) ) {
1612
  $newcats = (array)$new_category;
1613
  } else {
@@ -1615,8 +1519,8 @@ class s2class {
1615
  $newcats = array_merge($old_cats, (array)$new_category);
1616
  }
1617
  // add subscription to these cat IDs
1618
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $new_category, "$new_category");
1619
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $newcats));
1620
  }
1621
  } elseif ( 'exclude' == $this->subscribe2_options['show_autosub'] ) {
1622
  $excluded_cats = explode(',', $this->subscribe2_options['exclude']);
@@ -1638,14 +1542,14 @@ class s2class {
1638
  if ( '' == $user_IDs ) { return; }
1639
 
1640
  foreach ( $user_IDs as $user_ID ) {
1641
- $old_cats = explode(',', $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
1642
  if ( !is_array($old_cats) ) {
1643
  $old_cats = array($old_cats);
1644
  }
1645
  // add subscription to these cat IDs
1646
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $deleted_category);
1647
  $remain = array_diff($old_cats, (array)$deleted_category);
1648
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $remain));
1649
  }
1650
  } // end delete_category()
1651
 
@@ -1672,23 +1576,10 @@ class s2class {
1672
 
1673
  // handle issues from WordPress core where user_level is not set or set low
1674
  if ( empty($admin) ) {
1675
- global $wp_version;
1676
- if ( version_compare($wp_version, '3.1', '<') ) {
1677
- // WordPress version is less than 3.1, use WP_User_Search class
1678
- if ( !class_exists(WP_User_Search) ) {
1679
- require(ABSPATH . 'wp-admin/includes/user.php');
1680
- $wp_user_query = new WP_User_Search( '', '', 'administrator');
1681
- $admins_string = implode(', ', $wp_user_query->get_results());
1682
- $sql = "SELECT ID, display_name FROM $wpdb->users WHERE ID IN (" . $admins_string . ")";
1683
- $admin = $wpdb->get_results($sql);
1684
- }
1685
- } else {
1686
- // WordPress version is 3.1 or greater, use WP_User_Query class
1687
- $role = array('role' => 'administrator');
1688
- $wp_user_query = get_users( $role );
1689
- foreach ($wp_user_query as $user) {
1690
- $admin[] = $user;
1691
- }
1692
  }
1693
  $admin = $admin[0];
1694
  }
@@ -1903,7 +1794,7 @@ class s2class {
1903
 
1904
  // show our form
1905
  echo "<div class=\"wrap\">";
1906
- screen_icon();
1907
  echo "<h2>" . __('Manage Subscribers', 'subscribe2') . "</h2>\r\n";
1908
  echo "<form method=\"post\" action=\"\">\r\n";
1909
  if ( function_exists('wp_nonce_field') ) {
@@ -1920,12 +1811,13 @@ class s2class {
1920
  echo "<h2>" . __('Current Subscribers', 'subscribe2') . "</h2>\r\n";
1921
  echo "<br />";
1922
  $this->display_subscriber_dropdown($what, __('Filter', 'subscribe2'));
 
1923
  // show the selected subscribers
1924
- $alternate = '';
1925
- echo "<table cellpadding=\"2\" cellspacing=\"2\" width=\"100%\">";
1926
  $searchterm = ( $_POST['searchterm'] ) ? $_POST['searchterm'] : '';
1927
- echo "<tr class=\"alternate\"><td width=\"50%\"><input type=\"text\" name=\"searchterm\" value=\"" . $searchterm . "\" />&nbsp;\r\n";
1928
- echo "<input type=\"submit\" class=\"button-secondary\" name=\"search\" value=\"" . __('Search Subscribers', 'subscribe2') . "\" /></td>\r\n";
1929
  if ( $reminderform ) {
1930
  echo "<td width=\"25%\" align=\"right\"><input type=\"hidden\" name=\"reminderemails\" value=\"" . $reminderemails . "\" />\r\n";
1931
  echo "<input type=\"submit\" class=\"button-secondary\" name=\"remind\" value=\"" . __('Send Reminder Email', 'subscribe2') . "\" /></td>\r\n";
@@ -1936,13 +1828,14 @@ class s2class {
1936
  $exportcsv = implode(",\r\n", $subscribers);
1937
  echo "<td width=\"25%\" align=\"right\"><input type=\"hidden\" name=\"exportcsv\" value=\"" . $what . "\" />\r\n";
1938
  echo "<input type=\"submit\" class=\"button-secondary\" name=\"csv\" value=\"" . __('Save Emails to CSV File', 'subscribe2') . "\" /></td>\r\n";
 
 
1939
  }
1940
- echo "</tr></table>";
1941
 
1942
- echo "<table class=\"widefat\" cellpadding=\"2\" cellspacing=\"2\">";
1943
  if ( !empty($subscribers) ) {
1944
  echo "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
1945
- echo "<td align=\"right\">" . $strip . "</td></tr>\r\n";
1946
  }
1947
  if ( !empty($subscribers) ) {
1948
  if ( is_int($this->subscribe2_options['entries']) ) {
@@ -1958,11 +1851,11 @@ class s2class {
1958
  echo "<td width=\"4%\" align=\"center\">";
1959
  echo "<img src=\"" . $urlpath . "include/exclamation.png\" alt=\"&gt;\" title=\"" . __('Unconfirm this email address', 'subscribe2') . "\" /></td>\r\n";
1960
  echo "<td width=\"4%\" align=\"center\">";
1961
- echo "<img src=\"" . $urlpath . "include/cross.png\" alt=\"X\" title=\"" . __('Delete this email address', 'subscribe2') . "\" /></td><td></td></tr>\r\n";
1962
- echo "<tr><td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"confirm_checkall\" /></td>\r\n";
1963
  echo "<td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"unconfirm_checkall\" /></td>\r\n";
1964
  echo "<td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"delete_checkall\" /></td>\r\n";
1965
- echo "<td align=\"left\"><strong>" . __('Select / Unselect All', 'subscribe2') . "</strong></td></tr>\r\n";
1966
 
1967
  foreach ( $subscribers as $subscriber ) {
1968
  echo "<tr class=\"$alternate\" style=\"height:1.5em;\">";
@@ -1973,20 +1866,21 @@ class s2class {
1973
  echo "<td align=\"center\">\r\n";
1974
  echo "<input class=\"delete_checkall\" title=\"" . __('Delete this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"delete[]\" value=\"" . $subscriber . "\" />\r\n";
1975
  echo "</td>\r\n";
1976
- echo "<td><span style=\"color:#006600\">&#x221A;&nbsp;&nbsp;</span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
1977
- echo "(<span style=\"color:#006600\"><abbr title=\"" . $this->signup_ip($subscriber) . "\">" . $this->signup_date($subscriber) . "</abbr></span>)\r\n";
1978
  } elseif ( in_array($subscriber, $unconfirmed) ) {
1979
  echo "<input class=\"confirm_checkall\" title=\"" . __('Confirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"confirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
1980
  echo "<td align=\"center\"></td>\r\n";
1981
  echo "<td align=\"center\">\r\n";
1982
  echo "<input class=\"delete_checkall\" title=\"" . __('Delete this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"delete[]\" value=\"" . $subscriber . "\" />\r\n";
1983
  echo "</td>\r\n";
1984
- echo "<td><span style=\"color:#FF0000\">&nbsp;!&nbsp;&nbsp;&nbsp;</span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
1985
- echo "(<span style=\"color:#FF0000\"><abbr title=\"" . $this->signup_ip($subscriber) . "\">" . $this->signup_date($subscriber) . "</abbr></span>)\r\n";
1986
  } elseif ( in_array($subscriber, $all_users) ) {
 
1987
  echo "</td><td align=\"center\"></td><td align=\"center\"></td>\r\n";
1988
- echo "<td><span style=\"color:#006600\">&reg;&nbsp;&nbsp;</span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
1989
- echo "(<a href=\"" . get_option('siteurl') . "/wp-admin/users.php?page=s2_users&amp;email=" . urlencode($subscriber) . "\">" . __('edit', 'subscribe2') . "</a>)\r\n";
1990
  }
1991
  echo "</td></tr>\r\n";
1992
  ('alternate' == $alternate) ? $alternate = '' : $alternate = 'alternate';
@@ -1999,8 +1893,8 @@ class s2class {
1999
  }
2000
  }
2001
  if ( !empty($subscribers) ) {
2002
- echo "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
2003
- echo "<td align=\"right\">" . $strip . "</td></tr>\r\n";
2004
  }
2005
  echo "</table>\r\n";
2006
 
@@ -2103,6 +1997,7 @@ class s2class {
2103
  $this->subscribe2_options['password'] = $_POST['password'];
2104
  $this->subscribe2_options['private'] = $_POST['private'];
2105
  $this->subscribe2_options['cron_order'] = $_POST['cron_order'];
 
2106
 
2107
  // send per-post or digest emails
2108
  $email_freq = $_POST['email_freq'];
@@ -2183,6 +2078,14 @@ class s2class {
2183
  ( isset($_POST['reg_override']) ) ? $override = '1' : $override = '0';
2184
  $this->subscribe2_options['reg_override'] = $override;
2185
 
 
 
 
 
 
 
 
 
2186
  // default WordPress page where Subscribe2 token is placed
2187
  if ( is_numeric($_POST['page']) && $_POST['page'] >= 0 ) {
2188
  $this->subscribe2_options['s2page'] = $_POST['page'];
@@ -2201,6 +2104,10 @@ class s2class {
2201
  ( $_POST['show_button'] == '1' ) ? $showbutton = '1' : $showbutton = '0';
2202
  $this->subscribe2_options['show_button'] = $showbutton;
2203
 
 
 
 
 
2204
  // show widget in Presentation->Widgets
2205
  ( $_POST['widget'] == '1' ) ? $showwidget = '1' : $showwidget = '0';
2206
  $this->subscribe2_options['widget'] = $showwidget;
@@ -2231,7 +2138,7 @@ class s2class {
2231
  }
2232
  // show our form
2233
  echo "<div class=\"wrap\">";
2234
- screen_icon();
2235
  echo "<h2>" . __('Subscribe2 Settings', 'subscribe2') . "</h2>\r\n";
2236
  echo "<a href=\"http://subscribe2.wordpress.com/\">" . __('Plugin Blog', 'subscribe2') . "</a> | ";
2237
  echo "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904\">" . __('Make a donation via PayPal', 'subscribe2') . "</a>";
@@ -2255,72 +2162,45 @@ class s2class {
2255
  echo "<a href=\"#\" onclick=\"s2_revert('bcc'); return false;\">". __('Revert', 'subscribe2') . "</a></span>\n";
2256
 
2257
  echo "<br /><br />" . __('Send Admins notifications for new', 'subscribe2') . ': ';
2258
- echo "<label><input type=\"radio\" name=\"admin_email\" value=\"subs\"";
2259
- if ( 'subs' == $this->subscribe2_options['admin_email'] ) {
2260
- echo " checked=\"checked\"";
2261
- }
2262
- echo " /> " . __('Subscriptions', 'subscribe2') . "</label>&nbsp;&nbsp;";
2263
- echo "<label><input type=\"radio\" name=\"admin_email\" value=\"unsubs\"";
2264
- if ( 'unsubs' == $this->subscribe2_options['admin_email'] ) {
2265
- echo " checked=\"checked\"";
2266
- }
2267
- echo " /> " . __('Unsubscriptions', 'subscribe2') . "</label>&nbsp;&nbsp;";
2268
- echo "<label><input type=\"radio\" name=\"admin_email\" value=\"both\"";
2269
- if ( 'both' == $this->subscribe2_options['admin_email'] ) {
2270
- echo " checked=\"checked\"";
2271
- }
2272
- echo " /> " . __('Both', 'subscribe2') . "</label>&nbsp;&nbsp;";
2273
- echo "<label><input type=\"radio\" name=\"admin_email\" value=\"none\"";
2274
- if ( 'none' == $this->subscribe2_options['admin_email'] ) {
2275
- echo " checked=\"checked\"";
2276
- }
2277
- echo " /> " . __('Neither', 'subscribe2') . "</label><br /><br />\r\n";
2278
 
2279
  echo __('Include theme CSS stylesheet in HTML notifications', 'subscribe2') . ': ';
2280
- echo "<label><input type=\"radio\" name=\"stylesheet\" value=\"yes\"";
2281
- if ( 'yes' == $this->subscribe2_options['stylesheet'] ) {
2282
- echo " checked=\"checked\"";
2283
- }
2284
- echo " /> " . __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2285
- echo "<label><input type=\"radio\" name=\"stylesheet\" value=\"no\"";
2286
- if ( 'no' == $this->subscribe2_options['stylesheet'] ) {
2287
- echo " checked=\"checked\"";
2288
- }
2289
- echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
2290
 
2291
  echo __('Send Emails for Pages', 'subscribe2') . ': ';
2292
- echo "<label><input type=\"radio\" name=\"pages\" value=\"yes\"";
2293
- if ( 'yes' == $this->subscribe2_options['pages'] ) {
2294
- echo " checked=\"checked\"";
2295
- }
2296
- echo " /> " . __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2297
- echo "<label><input type=\"radio\" name=\"pages\" value=\"no\"";
2298
- if ( 'no' == $this->subscribe2_options['pages'] ) {
2299
- echo " checked=\"checked\"";
 
 
 
 
2300
  }
2301
- echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
2302
  echo __('Send Emails for Password Protected Posts', 'subscribe2') . ': ';
2303
- echo "<label><input type=\"radio\" name=\"password\" value=\"yes\"";
2304
- if ( 'yes' == $this->subscribe2_options['password'] ) {
2305
- echo " checked=\"checked\"";
2306
- }
2307
- echo " /> " . __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2308
- echo "<label><input type=\"radio\" name=\"password\" value=\"no\"";
2309
- if ( 'no' == $this->subscribe2_options['password'] ) {
2310
- echo " checked=\"checked\"";
2311
- }
2312
- echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
2313
  echo __('Send Emails for Private Posts', 'subscribe2') . ': ';
2314
- echo "<label><input type=\"radio\" name=\"private\" value=\"yes\"";
2315
- if ( 'yes' == $this->subscribe2_options['private'] ) {
2316
- echo " checked=\"checked\"";
2317
- }
2318
- echo " /> " . __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2319
- echo "<label><input type=\"radio\" name=\"private\" value=\"no\"";
2320
- if ( 'no' == $this->subscribe2_options['private'] ) {
2321
- echo " checked=\"checked\"";
2322
- }
2323
- echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
2324
  echo __('Send Email From', 'subscribe2') . ': ';
2325
  echo "<label>\r\n";
2326
  $this->admin_dropdown(true);
@@ -2329,17 +2209,14 @@ class s2class {
2329
  echo __('Send Emails', 'subscribe2') . ": <br /><br />\r\n";
2330
  $this->display_digest_choices();
2331
  echo __('For digest notifications, date order for posts is', 'subscribe2') . ": \r\n";
2332
- echo "<label><input type=\"radio\" name=\"cron_order\" value=\"desc\"";
2333
- if ( 'desc' == $this->subscribe2_options['cron_order'] ) {
2334
- echo " checked=\"checked\"";
2335
- }
2336
- echo " /> " . __('Descending', 'subscribe2') . "</label>&nbsp;&nbsp;";
2337
- echo "<label><input type=\"radio\" name=\"cron_order\" value=\"asc\"";
2338
- if ( 'asc' == $this->subscribe2_options['cron_order'] ) {
2339
- echo " checked=\"checked\"";
2340
- }
2341
- echo " /> " . __('Ascending', 'subscribe2') . "</label><br /><br />\r\n";
2342
  }
 
 
 
2343
 
2344
  // email templates
2345
  echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
@@ -2389,15 +2266,22 @@ class s2class {
2389
 
2390
  // excluded categories
2391
  echo "<h2>" . __('Excluded Categories', 'subscribe2') . "</h2>\r\n";
2392
- echo"<p>";
2393
  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";
2394
- echo"</p>";
2395
  $this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
2396
- echo "<center><label><input type=\"checkbox\" name=\"reg_override\" value=\"1\"";
2397
- if ( '1' == $this->subscribe2_options['reg_override'] ) {
2398
- echo " checked=\"checked\"";
 
 
 
 
 
 
 
 
2399
  }
2400
- echo " /> " . __('Allow registered users to subscribe to excluded categories?', 'subscribe2') . "</label></center><br />\r\n";
2401
 
2402
  // Appearance options
2403
  echo "<h2>" . __('Appearance', 'subscribe2') . "</h2>\r\n";
@@ -2419,152 +2303,80 @@ class s2class {
2419
  echo "<a href=\"#\" onclick=\"s2_revert('entries'); return false;\">". __('Revert', 'subscribe2') . "</a></span>\n";
2420
 
2421
  // show link to WordPress page in meta
2422
- echo "<br /><br /><label><input type=\"checkbox\" name=\"show_meta\" value=\"1\"";
2423
- if ( '1' == $this->subscribe2_options['show_meta'] ) {
2424
- echo " checked=\"checked\"";
2425
- }
2426
- echo " /> " . __('Show a link to your subscription page in "meta"?', 'subscribe2') . "</label><br /><br />\r\n";
2427
 
2428
  // show QuickTag button
2429
- echo "<label><input type=\"checkbox\" name=\"show_button\" value=\"1\"";
2430
- if ( '1' == $this->subscribe2_options['show_button'] ) {
2431
- echo " checked=\"checked\"";
2432
- }
2433
- echo " /> " . __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "</label><br /><br />\r\n";
 
2434
 
2435
  // show Widget
2436
- echo "<label><input type=\"checkbox\" name=\"widget\" value=\"1\"";
2437
- if ( '1' == $this->subscribe2_options['widget'] ) {
2438
- echo " checked=\"checked\"";
2439
- }
2440
- echo " /> " . __('Enable Subscribe2 Widget?', 'subscribe2') . "</label><br /><br />\r\n";
2441
 
2442
  // show Counter Widget
2443
- echo "<label><input type=\"checkbox\" name=\"counterwidget\" value=\"1\"";
2444
- if ( '1' == $this->subscribe2_options['counterwidget'] ) {
2445
- echo " checked=\"checked\"";
2446
- }
2447
- echo " /> " . __('Enable Subscribe2 Counter Widget?', 'subscribe2') . "</label><br /><br />\r\n";
2448
 
2449
  // s2_meta checked by default
2450
- echo "<label><input type =\"checkbox\" name=\"s2meta_default\" value=\"1\"";
2451
- if ( "1" == $this->subscribe2_options['s2meta_default'] ) {
2452
- echo " checked=\"checked\"";
2453
- }
2454
- echo " /> " . __('Disable email notifications is checked by default on authoring pages?', 'subscribe2') . "</label>\r\n";
2455
  echo "</p>";
2456
 
2457
  //Auto Subscription for new registrations
2458
  echo "<h2>" . __('Auto Subscribe', 'subscribe2') . "</h2>\r\n";
2459
  echo"<p>";
2460
  echo __('Subscribe new users registering with your blog', 'subscribe2') . ":<br />\r\n";
2461
- echo "<label><input type=\"radio\" name=\"autosub\" value=\"yes\"";
2462
- if ( 'yes' == $this->subscribe2_options['autosub'] ) {
2463
- echo " checked=\"checked\"";
2464
- }
2465
- echo " /> " . __('Automatically', 'subscribe2') . "</label>&nbsp;&nbsp;";
2466
- echo "<label><input type=\"radio\" name=\"autosub\" value=\"wpreg\"";
2467
- if ( 'wpreg' == $this->subscribe2_options['autosub'] ) {
2468
- echo " checked=\"checked\"";
2469
- }
2470
- echo " /> " . __('Display option on Registration Form', 'subscribe2') . "</label>&nbsp;&nbsp;";
2471
- echo "<label><input type=\"radio\" name=\"autosub\" value=\"no\"";
2472
- if ( 'no' == $this->subscribe2_options['autosub'] ) {
2473
- echo " checked=\"checked\"";
2474
- }
2475
- echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
2476
  echo __('Auto-subscribe includes any excluded categories', 'subscribe2') . ":<br />\r\n";
2477
- echo "<label><input type=\"radio\" name=\"newreg_override\" value=\"yes\"";
2478
- if ( 'yes' == $this->subscribe2_options['newreg_override'] ) {
2479
- echo " checked=\"checked\"";
2480
- }
2481
- echo " /> " . __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2482
- echo "<label><input type=\"radio\" name=\"newreg_override\" value=\"no\"";
2483
- if ( 'no' == $this->subscribe2_options['newreg_override'] ) {
2484
- echo " checked=\"checked\"";
2485
- }
2486
- echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
2487
  echo __('Registration Form option is checked by default', 'subscribe2') . ":<br />\r\n";
2488
- echo "<label><input type=\"radio\" name=\"wpregdef\" value=\"yes\"";
2489
- if ( 'yes' == $this->subscribe2_options['wpregdef'] ) {
2490
- echo " checked=\"checked\"";
2491
- }
2492
- echo " /> " . __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2493
- echo "<label><input type=\"radio\" name=\"wpregdef\" value=\"no\"";
2494
- if ( 'no' == $this->subscribe2_options['wpregdef'] ) {
2495
- echo " checked=\"checked\"";
2496
- }
2497
- echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
2498
  echo __('Auto-subscribe users to receive email as', 'subscribe2') . ": <br />\r\n";
2499
- echo "<label><input type=\"radio\" name=\"autoformat\" value=\"html\"";
2500
- if ( 'html' == $this->subscribe2_options['autoformat'] ) {
2501
- echo "checked=\"checked\" ";
2502
- }
2503
- echo "/> " . __('HTML - Full', 'subscribe2') ."</label>&nbsp;&nbsp;";
2504
- echo "<label><input type=\"radio\" name=\"autoformat\" value=\"html_excerpt\"";
2505
- if ( 'html_excerpt' == $this->subscribe2_options['autoformat'] ) {
2506
- echo "checked=\"checked\" ";
2507
- }
2508
- echo "/> " . __('HTML - Excerpt', 'subscribe2') ."</label>&nbsp;&nbsp;";
2509
- echo "<label><input type=\"radio\" name=\"autoformat\" value=\"post\" ";
2510
- if ( 'post' == $this->subscribe2_options['autoformat'] ) {
2511
- echo "checked=\"checked\" ";
2512
- }
2513
- echo "/> " . __('Plain Text - Full', 'subscribe2') . "</label>&nbsp;&nbsp;";
2514
- echo "<label><input type=\"radio\" name=\"autoformat\" value=\"excerpt\" ";
2515
- if ( 'excerpt' == $this->subscribe2_options['autoformat'] ) {
2516
- echo "checked=\"checked\" ";
2517
- }
2518
- echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . "</label><br /><br />";
2519
  echo __('Registered Users have the option to auto-subscribe to new categories', 'subscribe2') . ": <br />\r\n";
2520
- echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"yes\"";
2521
- if ( 'yes' == $this->subscribe2_options['show_autosub'] ) {
2522
- echo " checked=\"checked\"";
2523
- }
2524
- echo " /> " . __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2525
- echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"no\"";
2526
- if ( 'no' == $this->subscribe2_options['show_autosub'] ) {
2527
- echo " checked=\"checked\"";
2528
- }
2529
- echo " /> " . __('No', 'subscribe2') . "</label>&nbsp;&nbsp;";
2530
- echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"exclude\"";
2531
- if ( 'exclude' == $this->subscribe2_options['show_autosub'] ) {
2532
- echo " checked=\"checked\"";
2533
- }
2534
- echo " /> " .__('New categories are immediately excluded', 'subscribe2') . "</label><br /><br />";
2535
  echo __('Option for Registered Users to auto-subscribe to new categories is checked by default', 'subscribe2') . ": <br />\r\n";
2536
- echo "<label><input type=\"radio\" name=\"autosub_def\" value=\"yes\"";
2537
- if ( 'yes' == $this->subscribe2_options['autosub_def'] ) {
2538
- echo " checked=\"checked\"";
2539
- }
2540
- echo " /> " . __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2541
- echo "<label><input type=\"radio\" name=\"autosub_def\" value=\"no\"";
2542
- if ( 'no' == $this->subscribe2_options['autosub_def'] ) {
2543
- echo " checked=\"checked\"";
2544
- }
2545
- echo " /> " . __('No', 'subscribe2');
2546
- if ( version_compare($wp_version, '2.9', '>') ) {
2547
- // comment meta was introduced in WP2.9, don't display this if we are on a lower version
2548
- echo"</label><br /><br />";
2549
- echo __('Display checkbox to allow subscriptions from the comment form', 'subscribe2') . ": <br />\r\n";
2550
- if ( version_compare($wp_version, '3.0', '>') ) {
2551
- echo "<label><input type=\"radio\" name=\"comment_subs\" value=\"before\"";
2552
- if ( 'before' == $this->subscribe2_options['comment_subs'] ) {
2553
- echo " checked=\"checked\"";
2554
- }
2555
- echo " /> " . __('Before the Comment Submit button', 'subscribe2') . "</label>&nbsp;&nbsp;";
2556
- }
2557
- echo "<label><input type=\"radio\" name=\"comment_subs\" value=\"after\"";
2558
- if ( 'after' == $this->subscribe2_options['comment_subs'] ) {
2559
- echo " checked=\"checked\"";
2560
- }
2561
- echo " /> " . __('After the Comment Submit button', 'subscribe2') . "</label>&nbsp;&nbsp;";
2562
- echo "<label><input type=\"radio\" name=\"comment_subs\" value=\"no\"";
2563
- if ( 'no' == $this->subscribe2_options['comment_subs'] ) {
2564
- echo " checked=\"checked\"";
2565
- }
2566
- echo " /> " . __('No', 'subscribe2');
2567
- }
2568
  echo"</label></p>";
2569
 
2570
  //barred domains
@@ -2608,67 +2420,76 @@ class s2class {
2608
  check_admin_referer('subscribe2-user_subscribers' . $s2nonce);
2609
 
2610
  if ( isset($_POST['s2_format']) ) {
2611
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), $_POST['s2_format']);
2612
  } else {
2613
  // value has not been set so use default
2614
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), 'excerpt');
2615
  }
2616
  if ( isset($_POST['new_category']) ) {
2617
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), $_POST['new_category']);
2618
  } else {
2619
  // value has not been passed so use Settings defaults
2620
  if ( $this->subscribe2_options['show_autosub'] == 'yes' && $this->subscribe2_options['autosub_def'] == 'yes' ) {
2621
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), 'yes');
2622
  } else {
2623
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), 'no');
2624
  }
2625
  }
2626
 
2627
  $cats = $_POST['category'];
2628
 
2629
  if ( empty($cats) || $cats == '-1' ) {
2630
- $oldcats = explode(',', $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
2631
  if ( $oldcats ) {
2632
  foreach ( $oldcats as $cat ) {
2633
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat);
2634
  }
2635
  }
2636
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
2637
  } elseif ( $cats == 'digest' ) {
2638
  $all_cats = $this->all_cats(false, 'ID');
2639
  foreach ( $all_cats as $cat ) {
2640
  ('' == $catids) ? $catids = "$cat->term_id" : $catids .= ",$cat->term_id";
2641
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat->term_id, $cat->term_id);
2642
  }
2643
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $catids);
2644
  } else {
2645
  if ( !is_array($cats) ) {
2646
  $cats = (array)$_POST['category'];
2647
  }
2648
  sort($cats);
2649
- $old_cats = explode(',', $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
2650
  $remove = array_diff($old_cats, $cats);
2651
  $new = array_diff($cats, $old_cats);
2652
  if ( !empty($remove) ) {
2653
  // remove subscription to these cat IDs
2654
  foreach ( $remove as $id ) {
2655
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
2656
  }
2657
  }
2658
  if ( !empty($new) ) {
2659
  // add subscription to these cat IDs
2660
  foreach ( $new as $id ) {
2661
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, $id);
2662
  }
2663
  }
2664
- $this->update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $cats));
2665
  }
 
 
 
 
 
 
 
 
 
2666
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Subscription preferences updated.', 'subscribe2') . "</strong></p></div>\n";
2667
  }
2668
 
2669
  // show our form
2670
  echo "<div class=\"wrap\">";
2671
- screen_icon();
2672
  echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
2673
  if ( isset($_GET['email']) ) {
2674
  $user = get_userdata($user_ID);
@@ -2682,46 +2503,28 @@ class s2class {
2682
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"user\" />";
2683
  if ( $this->subscribe2_options['email_freq'] == 'never' ) {
2684
  echo __('Receive email as', 'subscribe2') . ": &nbsp;&nbsp;";
2685
- echo "<label><input type=\"radio\" name=\"s2_format\" value=\"html\"";
2686
- if ( 'html' == $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_format')) ) {
2687
- echo "checked=\"checked\" ";
2688
- }
2689
- echo "/> " . __('HTML - Full', 'subscribe2') ."</label>&nbsp;&nbsp;";
2690
- echo "<label><input type=\"radio\" name=\"s2_format\" value=\"html_excerpt\" ";
2691
- if ( 'html_excerpt' == $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_format')) ) {
2692
- echo "checked=\"checked\" ";
2693
- }
2694
- echo "/> " . __('HTML - Excerpt', 'subscribe2') . "</label>&nbsp;&nbsp;";
2695
- echo "<label><input type=\"radio\" name=\"s2_format\" value=\"post\" ";
2696
- if ( 'post' == $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_format')) ) {
2697
- echo "checked=\"checked\" ";
2698
- }
2699
- echo "/> " . __('Plain Text - Full', 'subscribe2') . "</label>&nbsp;&nbsp;";
2700
- echo "<label><input type=\"radio\" name=\"s2_format\" value=\"excerpt\" ";
2701
- if ( 'excerpt' == $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_format')) ) {
2702
- echo "checked=\"checked\" ";
2703
- }
2704
- echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . "</label><br /><br />\r\n";
2705
 
2706
  if ( $this->subscribe2_options['show_autosub'] == 'yes' ) {
2707
  echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': &nbsp;&nbsp;';
2708
- echo "<label><input type=\"radio\" name=\"new_category\" value=\"yes\" ";
2709
- if ( 'yes' == $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub')) ) {
2710
- echo "checked=\"checked\" ";
2711
- }
2712
- echo "/> " . __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2713
- echo "<label><input type=\"radio\" name=\"new_category\" value=\"no\" ";
2714
- if ( 'no' == $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub')) ) {
2715
- echo "checked=\"checked\" ";
2716
- }
2717
- echo "/> " . __('No', 'subscribe2') . "</label>";
2718
  echo "</p>";
2719
  }
2720
 
2721
  // subscribed categories
2722
  if ( $this->s2_mu ) {
2723
  global $blog_id;
2724
- $subscribed = $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
2725
  // if we are subscribed to the current blog display an "unsubscribe" link
2726
  if ( !empty($subscribed) ) {
2727
  $unsubscribe_link = esc_url( add_query_arg('s2mu_unsubscribe', $blog_id) );
@@ -2735,24 +2538,29 @@ class s2class {
2735
  } else {
2736
  echo "<h2>" . __('Subscribed Categories', 'subscribe2') . "</h2>\r\n";
2737
  }
2738
- $this->display_category_form(explode(',', $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'))), $this->subscribe2_options['reg_override']);
2739
  } else {
2740
  // we're doing daily digests, so just show
2741
  // subscribe / unnsubscribe
2742
  echo __('Receive periodic summaries of new posts?', 'subscribe2') . ': &nbsp;&nbsp;';
2743
  echo "<label>";
2744
- echo "<input type=\"radio\" name=\"category\" value=\"digest\" ";
2745
- if ( $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed')) ) {
2746
- echo "checked=\"checked\" ";
2747
  }
2748
- echo "/> " . __('Yes', 'subscribe2') . "</label> <label><input type=\"radio\" name=\"category\" value=\"-1\" ";
2749
- if ( !$this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed')) ) {
2750
- echo "checked=\"checked\" ";
2751
  }
2752
- echo "/> " . __('No', 'subscribe2');
2753
  echo "</label></p>";
2754
  }
2755
 
 
 
 
 
 
2756
  // submit
2757
  echo "<p class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"submit\" value=\"" . __("Update Preferences", 'subscribe2') . " &raquo;\" /></p>";
2758
  echo "</form>\r\n";
@@ -2781,7 +2589,7 @@ class s2class {
2781
  }
2782
 
2783
  // check if we're subscribed to the blog
2784
- $subscribed = $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
2785
 
2786
  $blogname = get_option('blogname');
2787
  if ( strlen($blogname) > 30 ) {
@@ -2900,7 +2708,7 @@ class s2class {
2900
 
2901
  // show our form
2902
  echo "<div class=\"wrap\">";
2903
- screen_icon();
2904
  echo "<h2>" . __('Send an email to subscribers', 'subscribe2') . "</h2>\r\n";
2905
  echo "<form method=\"post\" action=\"\">\r\n";
2906
  if ( function_exists('wp_nonce_field') ) {
@@ -2940,7 +2748,7 @@ class s2class {
2940
  $s2_taxonomies = apply_filters('s2_taxonomies', $s2_taxonomies);
2941
 
2942
  foreach( $s2_taxonomies as $taxonomy ) {
2943
- if ( $this->s2_taxonomy_exists($taxonomy) ) {
2944
  $all_cats = array_merge($all_cats, get_categories(array('hide_empty' => false, 'orderby' => $orderby, 'taxonomy' => $taxonomy)));
2945
  }
2946
  }
@@ -2989,7 +2797,7 @@ class s2class {
2989
  $j++;
2990
  }
2991
  $catName = '';
2992
- $parents = array_reverse( $this->get_parents($cat->term_id, $cat->taxonomy) );
2993
  if ( $parents ) {
2994
  foreach ( $parents as $parent ) {
2995
  $parent = get_term($parent, $cat->taxonomy);
@@ -3017,6 +2825,82 @@ class s2class {
3017
  echo "</table>\r\n";
3018
  } // end display_category_form()
3019
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3020
  /**
3021
  Display a drop-down form to select subscribers
3022
  $selected is the option to select
@@ -3107,28 +2991,15 @@ class s2class {
3107
 
3108
  // handle issues from WordPress core where user_level is not set or set low
3109
  if ( empty($admins) ) {
3110
- global $wp_version;
3111
- if ( version_compare($wp_version, '3.1', '<') ) {
3112
- // WordPress version is less than 3.1, use WP_User_Search class
3113
- if ( !class_exists(WP_User_Search) ) {
3114
- require(ABSPATH . 'wp-admin/includes/user.php');
3115
- $wp_user_query = new WP_User_Search( '', '', 'administrator');
3116
- $admins_string = implode(', ', $wp_user_query->get_results());
3117
- $sql = "SELECT ID, display_name FROM $wpdb->users WHERE ID IN (" . $admins_string . ")";
3118
- $admins = $wpdb->get_results($sql);
3119
- }
3120
- } else {
3121
- // WordPress version is 3.1 or greater, use WP_User_Query class
3122
- $args = array('fields' => array('ID', 'display_name'), 'role' => 'administrator');
3123
- $wp_user_query = get_users( $args );
3124
- foreach ($wp_user_query as $user) {
3125
- $admins[] = $user;
3126
- }
3127
  }
3128
  }
3129
 
3130
  if ( $inc_author ) {
3131
- $author[] = (object)array('ID' => 'author', 'display_name' => 'Post Author');
3132
  $author[] = (object)array('ID' => 'blogname', 'display_name' => html_entity_decode(get_option('blogname'), ENT_QUOTES));
3133
  $admins = array_merge($author, $admins);
3134
  }
@@ -3163,11 +3034,8 @@ class s2class {
3163
  $schedule_sorted[$key] = $schedule[$key];
3164
  }
3165
  foreach ( $schedule_sorted as $key => $value ) {
3166
- echo "<label><input type=\"radio\" name=\"email_freq\" value=\"" . $key . "\"";
3167
- if ( $key == $this->subscribe2_options['email_freq'] ) {
3168
- echo " checked=\"checked\" ";
3169
- }
3170
- echo " /> " . $value['display'] . "</label><br />\r\n";
3171
  }
3172
  echo "<br />" . __('Send Digest Notification at', 'subscribe2') . ": \r\n";
3173
  $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');
@@ -3259,7 +3127,7 @@ class s2class {
3259
  $user_ID = $this->get_user_id( $subscriber );
3260
  $user_info = get_userdata($user_ID);
3261
 
3262
- $cats = explode(',', $this->get_user_meta($user_info->ID, $this->get_usermeta_keyname('s2_subscribed')));
3263
  $subscribed_cats = '';
3264
  foreach ( $cat_ids as $cat ) {
3265
  (in_array($cat, $cats)) ? $subscribed_cats .= ",Yes" : $subscribed_cats .= ",No";
@@ -3293,6 +3161,7 @@ class s2class {
3293
  case 's2_cat':
3294
  case 's2_format':
3295
  case 's2_autosub':
 
3296
  return $wpdb->prefix . $metaname;
3297
  break;
3298
  }
@@ -3326,7 +3195,7 @@ class s2class {
3326
  */
3327
  function plugin_links($links, $file) {
3328
  if ( $file == S2DIR.'subscribe2.php' ) {
3329
- $links[] = "<a href='options-general.php?page=s2_settings'>" . __('Settings', 'subscribe2') . "</a>";
3330
  $links[] = "<a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904'><b>" . __('Donate', 'subscribe2') . "</b></a>";
3331
  }
3332
  return $links;
@@ -3340,11 +3209,8 @@ class s2class {
3340
  if ( 'wpreg' == $this->subscribe2_options['autosub'] ) {
3341
  echo "<p>\r\n<label>";
3342
  echo __('Check here to Subscribe to email notifications for new posts', 'subscribe2') . ":<br />\r\n";
3343
- echo "<input type=\"checkbox\" name=\"reg_subscribe\"";
3344
- if ( 'yes' == $this->subscribe2_options['wpregdef'] ) {
3345
- echo " checked=\"checked\"";
3346
- }
3347
- echo " /></label>\r\n";
3348
  echo "</p>\r\n";
3349
  } elseif ( 'yes' == $this->subscribe2_options['autosub'] ) {
3350
  echo "<p>\r\n<center>\r\n";
@@ -3383,16 +3249,16 @@ class s2class {
3383
  */
3384
  function wpmu_remove_user($user_ID) {
3385
  if ( 0 == $user_ID ) { return; }
3386
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'));
3387
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'));
3388
- $cats = $this->get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
3389
  if ( !empty($cats) ) {
3390
  $cats = explode(',', $cats);
3391
  foreach ( $cats as $cat ) {
3392
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat);
3393
  }
3394
  }
3395
- $this->delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
3396
  } // end wpmu_remove_user()
3397
 
3398
  /**
@@ -3404,7 +3270,7 @@ class s2class {
3404
  } // end s2_meta_init()
3405
 
3406
  /**
3407
- Meta box code for WordPress 2.5+
3408
  */
3409
  function s2_meta_box() {
3410
  global $post_ID;
@@ -3443,7 +3309,7 @@ class s2class {
3443
  */
3444
  function s2_comment_meta_form() {
3445
  if ( is_user_logged_in() ) {
3446
- echo $this->use_profile_admin;
3447
  } else {
3448
  echo "<label><input type=\"checkbox\" name=\"s2_comment_request\" value=\"1\" />" . __('Check here to Subscribe to notifications for new posts', 'subscribe2') . "</label>";
3449
  }
@@ -3503,9 +3369,17 @@ class s2class {
3503
  extract(shortcode_atts(array(
3504
  'hide' => '',
3505
  'id' => '',
3506
- 'url' => ''
 
 
3507
  ), $atts));
3508
 
 
 
 
 
 
 
3509
  // if a button is hidden, show only other
3510
  if ( $hide == 'subscribe' ) {
3511
  $this->input_form_action = "<input type=\"submit\" name=\"unsubscribe\" value=\"" . __('Unsubscribe', 'subscribe2') . "\" />";
@@ -3520,17 +3394,17 @@ class s2class {
3520
  $url = get_permalink( $id );
3521
  }
3522
  // build default form
3523
- $this->form = "<form method=\"post\" action=\"" . $url . "\"><input type=\"hidden\" name=\"ip\" value=\"" . $_SERVER['REMOTE_ADDR'] . "\" /><p><label for=\"s2email\">" . __('Your email:', 'subscribe2') . "</label><br /><input type=\"text\" name=\"email\" id=\"s2email\" value=\"" . __('Enter email address...', 'subscribe2') . "\" size=\"20\" onfocus=\"if (this.value == '" . __('Enter email address...', 'subscribe2') . "') {this.value = '';}\" onblur=\"if (this.value == '') {this.value = '" . __('Enter email address...', 'subscribe2') . "';}\" /></p><p>" . $this->input_form_action . "</p></form>\r\n";
 
 
 
 
3524
  $this->s2form = $this->form;
3525
 
3526
  global $user_ID;
3527
  get_currentuserinfo();
3528
  if ( $user_ID ) {
3529
- if ( current_user_can('manage_options') ) {
3530
- $this->s2form = $this->use_profile_admin;
3531
- } else {
3532
- $this->s2form = $this->use_profile_users;
3533
- }
3534
  }
3535
  if ( isset($_POST['subscribe']) || isset($_POST['unsubscribe']) ) {
3536
  global $wpdb, $user_email;
@@ -3657,9 +3531,12 @@ class s2class {
3657
  function widget_s2counter_css_and_js() {
3658
  // ensure we only add colorpicker js to widgets page
3659
  if ( stripos($_SERVER['REQUEST_URI'], 'widgets.php' ) !== false ) {
3660
- wp_enqueue_style('colorpicker', S2URL . 'include/colorpicker/css/colorpicker.css', '', '20090523'); // colorpicker css
3661
- wp_enqueue_script('colorpicker_js', S2URL . 'include/colorpicker/js/colorpicker' . $this->script_debug . '.js', array('jquery'), '20090523'); // colorpicker js
3662
- wp_enqueue_script('s2_colorpicker', S2URL . 'include/s2_colorpicker' . $this->script_debug . '.js', array('colorpicker_js'), '1.3'); //my js
 
 
 
3663
  }
3664
  } // end widget_s2_counter_css_and_js()
3665
 
@@ -3697,28 +3574,62 @@ class s2class {
3697
  */
3698
  function add_minimeta() {
3699
  if ( $this->subscribe2_options['s2page'] != 0 ) {
3700
- echo "<li><a href=\"" . get_option('siteurl') . "/?page_id=" . $this->subscribe2_options['s2page'] . "\">" . __('[Un]Subscribe to Posts', 'subscribe2') . "</a></li>\r\n";
3701
  }
3702
  } // end add_minimeta()
3703
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3704
  /* ===== Write Toolbar Button Functions ===== */
3705
  /**
3706
  Register our button in the QuickTags bar
3707
  */
3708
  function button_init() {
 
 
3709
  if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) { return; }
3710
  if ( 'true' == get_user_option('rich_editing') ) {
3711
- // Use WordPress 2.5+ hooks
3712
  add_filter('mce_external_plugins', array(&$this, 'mce3_plugin'));
3713
  add_filter('mce_buttons', array(&$this, 'mce3_button'));
3714
  } else {
3715
- buttonsnap_separator();
3716
- buttonsnap_jsbutton(S2URL . 'include/s2_button.png', __('Subscribe2', 'subscribe2'), 's2_insert_token();');
3717
  }
3718
  } // end button_init()
3719
 
3720
  /**
3721
- Add buttons for WordPress 2.5+ using built in hooks
3722
  */
3723
  function mce3_plugin($arr) {
3724
  $path = S2URL . 'tinymce3/editor_plugin.js';
@@ -3731,18 +3642,6 @@ class s2class {
3731
  return $arr;
3732
  } // end mce3_button()
3733
 
3734
- function s2_edit_form() {
3735
- echo "<!-- Start Subscribe2 Quicktags Javascript -->\r\n";
3736
- echo "<script type=\"text/javascript\">\r\n";
3737
- echo "//<![CDATA[\r\n";
3738
- echo "function s2_insert_token() {
3739
- buttonsnap_settext('[subscribe2]');
3740
- }\r\n";
3741
- echo "//]]>\r\n";
3742
- echo "</script>\r\n";
3743
- echo "<!-- End Subscribe2 Quicktags Javascript -->\r\n";
3744
- } // end s2_edit_form()
3745
-
3746
  /* ===== wp-cron functions ===== */
3747
  /**
3748
  Add a weekly event to cron
@@ -3849,6 +3748,13 @@ class s2class {
3849
  if ( $this->subscribe2_options['password'] == 'no' && $post->post_password != '' ) {
3850
  $check = true;
3851
  }
 
 
 
 
 
 
 
3852
  // if this post is excluded
3853
  // don't include it in the digest
3854
  if ( $check ) {
@@ -3869,10 +3775,10 @@ class s2class {
3869
  $message_post .= "\r\n";
3870
  $message_posttime .= "\r\n";
3871
 
3872
- $tablelinks .= "\r\n" . get_permalink($post->ID) . "\r\n";
3873
- $message_post .= get_permalink($post->ID) . "\r\n";
3874
  $message_posttime .= __('Posted on', 'subscribe2') . ": " . mysql2date($datetime, $post->post_date) . "\r\n";
3875
- $message_posttime .= get_permalink($post->ID) . "\r\n";
3876
  if ( strstr($mailtext, "{CATS}") ) {
3877
  $post_cat_names = implode(', ', wp_get_post_categories($post->ID, array('fields' => 'names')));
3878
  $message_post .= __('Posted in', 'subscribe2') . ": " . $post_cat_names . "\r\n";
@@ -3976,7 +3882,7 @@ class s2class {
3976
 
3977
  add_action('init', array(&$this, 'subscribe2'));
3978
  if ( '1' == $this->subscribe2_options['show_button'] ) {
3979
- add_action('init', array(&$this, 'button_init'));
3980
  }
3981
 
3982
  // add action to display widget if option is enabled
@@ -3999,7 +3905,7 @@ class s2class {
3999
  function subscribe2() {
4000
  global $wpdb, $table_prefix, $wp_version, $wpmu_version;
4001
 
4002
- load_plugin_textdomain('subscribe2', 'wp-content/plugins/' . S2DIR, '/' . S2DIR);
4003
 
4004
  // Is this WordPressMU or not?
4005
  $this->s2_mu = false;
@@ -4053,6 +3959,12 @@ class s2class {
4053
  add_action('wp_meta', array(&$this, 'add_minimeta'), 0);
4054
  }
4055
 
 
 
 
 
 
 
4056
  // Add filters for Ozh Admin Menu
4057
  if ( function_exists('wp_ozh_adminmenu') ) {
4058
  add_filter('ozh_adminmenu_icon_s2_posts', array(&$this, 'ozh_s2_icon'));
@@ -4061,12 +3973,6 @@ class s2class {
4061
  add_filter('ozh_adminmenu_icon_s2_settings', array(&$this, 'ozh_s2_icon'));
4062
  }
4063
 
4064
- // add action to display editor buttons if option is enabled
4065
- if ( '1' == $this->subscribe2_options['show_button'] ) {
4066
- add_action('edit_page_form', array(&$this, 's2_edit_form'));
4067
- add_action('edit_form_advanced', array(&$this, 's2_edit_form'));
4068
- }
4069
-
4070
  // add actions for automatic subscription based on option settings
4071
  add_action('register_form', array(&$this, 'register_form'));
4072
  add_action('user_register', array(&$this, 'register_post'));
@@ -4111,9 +4017,12 @@ class s2class {
4111
  var $subscribe2_options = array();
4112
  var $all_public = '';
4113
  var $all_unconfirmed = '';
 
4114
  var $excluded_cats = '';
4115
  var $post_title = '';
4116
  var $permalink = '';
 
 
4117
  var $myname = '';
4118
  var $myemail = '';
4119
  var $signup_dates = array();
@@ -4128,8 +4037,7 @@ class s2class {
4128
 
4129
  // some messages
4130
  var $please_log_in = '';
4131
- var $use_profile_admin = '';
4132
- var $use_profile_users = '';
4133
  var $confirmation_sent = '';
4134
  var $already_subscribed = '';
4135
  var $not_subscribed ='';
3
  Plugin Name: Subscribe2
4
  Plugin URI: http://subscribe2.wordpress.com
5
  Description: Notifies an email list when new entries are posted.
6
+ Version: 7.0
7
  Author: Matthew Robinson
8
  Author URI: http://subscribe2.wordpress.com
9
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904
31
  */
32
 
33
  global $wp_version;
34
+ if ( version_compare($wp_version, '3.1', '<') ) {
35
+ // Subscribe2 needs WordPress 3.1 or above, exit if not on a compatible version
36
+ $exit_msg = sprintf(__('This version of Subscribe2 requires WordPress 3.1 or greater. Please update %1$s or use an older version of %2$s.', 'subscribe2'), '<a href="http://codex.wordpress.org/Updating_WordPress">Wordpress</a>', '<a href="http://wordpress.org/extend/plugins/subscribe2/download/">Subscribe2</a>');
37
  exit($exit_msg);
38
  }
 
 
 
 
 
 
 
39
 
40
  // our version number. Don't touch this or any line below
41
  // unless you know exactly what you are doing
42
+ define( 'S2VERSION', '7.0' );
43
  define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
44
+ define( 'S2DIR', trailingslashit(dirname(plugin_basename(__FILE__))) );
45
  define( 'S2URL', plugin_dir_url(dirname(__FILE__)) . S2DIR );
46
 
47
+ // Set maximum execution time to 5 minutes - won't affect safe mode
48
  $safe_mode = array('On', 'ON', 'on', 1);
49
  if ( !in_array(ini_get('safe_mode'), $safe_mode) && ini_get('max_execution_time') < 300 ) {
50
  @ini_set('max_execution_time', 300);
51
  }
52
 
 
 
 
 
 
53
  $mysubscribe2 = new s2class;
54
  $mysubscribe2->s2init();
55
 
65
 
66
  $this->please_log_in = "<p class=\"s2_message\">" . __('To manage your subscription options please', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-login.php\">" . __('login', 'subscribe2') . "</a>.</p>";
67
 
68
+ $this->profile = "<p class=\"s2_message\">" . __('You may manage your subscription options from your', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-admin/admin.php?page=s2\">" . __('profile', 'subscribe2') . "</a>.</p>";
69
  if ( $this->s2_mu === true ) {
70
  global $blog_id, $user_ID;
71
  if ( !is_blog_user($blog_id) ) {
74
  }
75
  }
76
 
 
 
 
 
 
 
 
 
 
77
  $this->confirmation_sent = "<p class=\"s2_message\">" . __('A confirmation message is on its way!', 'subscribe2') . "</p>";
78
 
79
  $this->already_subscribed = "<p class=\"s2_error\">" . __('That email address is already subscribed.', 'subscribe2') . "</p>";
86
 
87
  $this->error = "<p class=\"s2_error\">" . __('Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2') . "</p>";
88
 
89
+ $this->no_page = "<p class=\"s2_error\">" . __('You must to create a WordPress page for this plugin to work correctly.', 'subscribe2') . "</p>";
90
 
91
  $this->mail_sent = "<p class=\"s2_message\">" . __('Message sent!', 'subscribe2') . "</p>";
92
 
113
  Hook the menu
114
  */
115
  function admin_menu() {
116
+ add_menu_page (__('Subscribe2', 'subscribe2'), __('Subscribe2', 'subscribe2'), apply_filters('s2_capability', "read", 'user'), 's2', NULL, S2URL . 'include/email_edit.png');
117
+
118
+ $s2user = add_submenu_page('s2', __('Your Subscriptions', 'subscribe2'), __('Your Subscriptions', 'subscribe2'), apply_filters('s2_capability', "read", 'user'), 's2', array(&$this, 'user_menu'), S2URL . 'include/email_edit.png');
119
+ add_action("admin_print_scripts-$s2user", array(&$this, 'checkbox_form_js'));
120
+ add_action("admin_print_styles-$s2user", array(&$this, 'user_admin_css'));
121
+
122
+ $s2management = add_submenu_page('s2', __('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'manage'), 's2_tools', array(&$this, 'manage_menu'));
123
  add_action("admin_print_scripts-$s2management", array(&$this, 'checkbox_form_js'));
124
 
125
+ $s2options = add_submenu_page('s2', __('Settings', 'subscribe2'), __('Settings', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'settings'), 's2_settings', array(&$this, 'options_menu'));
126
  add_action("admin_print_scripts-$s2options", array(&$this, 'checkbox_form_js'));
127
  add_action("admin_print_scripts-$s2options", array(&$this, 'option_form_js'));
128
  add_filter('plugin_row_meta', array(&$this, 'plugin_links'), 10, 2);
129
 
130
+ add_submenu_page('s2', __('Send Email', 'subscribe2'), __('Send Email', 'subscribe2'), apply_filters('s2_capability', "publish_posts", 'send'), 's2_posts', array(&$this, 'write_menu'));
 
 
 
 
131
 
132
  $s2nonce = md5('subscribe2');
133
  } // end admin_menu()
143
  Insert Javascript and CSS into admin_header
144
  */
145
  function checkbox_form_js() {
146
+ wp_register_script('s2_checkbox', S2URL . 'include/s2_checkbox' . $this->script_debug . '.js', array('jquery'), '1.1');
147
+ wp_enqueue_script('s2_checkbox');
148
  } //end checkbox_form_js()
149
 
150
  function user_admin_css() {
151
+ wp_register_style('s2_user_admin', S2URL . 'include/s2_user_admin.css', array(), '1.0');
152
+ wp_enqueue_script('s2_user_admin');
153
  } // end user_admin_css()
154
 
155
  function option_form_js() {
156
+ wp_register_script('s2_edit', S2URL . 'include/s2_edit' . $this->script_debug . '.js', array('jquery'), '1.0');
157
+ wp_enqueue_script('s2_edit');
158
  } // end option_form_js()
159
 
160
  /* ===== Install, upgrade, reset ===== */
202
  $users = $this->get_all_registered('ID');
203
  if ( !empty($users) ) {
204
  foreach ( $users as $user_ID ) {
205
+ $check_format = get_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), true);
206
  // if user is already registered update format remove 's2_excerpt' field and update 's2_format'
207
  if ( 'html' == $check_format ) {
208
+ delete_user_meta($user_ID, 's2_excerpt');
209
  } elseif ( 'text' == $check_format ) {
210
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), get_user_meta($user_ID, 's2_excerpt'));
211
+ delete_user_meta($user_ID, 's2_excerpt');
212
  } elseif ( empty($check_format) ) {
213
  // no prior settings so create them
214
  $this->register($user_ID);
215
  }
216
+ $subscribed = get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true);
217
  if ( strstr($subscribed, '-1') ) {
218
  // make sure we remove '-1' from any settings
219
  $old_cats = explode(',', $subscribed);
220
  $pos = array_search('-1', $old_cats);
221
  unset($old_cats[$pos]);
222
  $cats = implode(',', $old_cats);
223
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
224
+ }
225
+ $check_authors = get_user_meta($user_ID, $this->get_usermeta_keyname('s2_authors'), true);
226
+ if ( empty($check_authors) ) {
227
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_authors'), '');
228
  }
229
  }
230
  }
268
  // loop through all users
269
  foreach ( $users as $user_ID ) {
270
  // get categories which the user is subscribed to (old ones)
271
+ $categories = get_user_meta($user_ID, 's2_subscribed', true);
272
  $categories = explode(',', $categories);
273
+ $format = get_user_meta($user_ID, 's2_format', true);
274
+ $autosub = get_user_meta($user_ID, 's2_autosub', true);
275
 
276
  // load blogs of user (only if we need them)
277
  $blogs = array();
286
  $subscribed_categories = array_intersect($categories, $blog_categories);
287
  if ( !empty($subscribed_categories) ) {
288
  foreach ( $subscribed_categories as $subscribed_category ) {
289
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $subscribed_category, $subscribed_category);
290
  }
291
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $subscribed_categories));
292
  }
293
  if ( !empty($format) ) {
294
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), $format);
295
  }
296
  if ( !empty($autosub) ) {
297
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), $autosub);
298
  }
299
  restore_current_blog();
300
  }
301
 
302
  // delete old user meta keys
303
+ delete_user_meta($user_ID, 's2_subscribed');
304
+ delete_user_meta($user_ID, 's2_format');
305
+ delete_user_meta($user_ID, 's2_autosub');
306
  foreach ( $categories as $cat ) {
307
+ delete_user_meta($user_ID, 's2_cat' . $cat);
308
  }
309
  }
310
  }
345
  $string = str_replace("{BLOGNAME}", html_entity_decode(get_option('blogname'), ENT_QUOTES), $string);
346
  $string = str_replace("{BLOGLINK}", get_option('home'), $string);
347
  $string = str_replace("{TITLE}", stripslashes($this->post_title), $string);
348
+ $link = "<a href=\"" . $this->get_tracking_link($this->permalink) . "\">" . $this->get_tracking_link($this->permalink) . "</a>";
349
  $string = str_replace("{PERMALINK}", $link, $string);
350
  if ( strstr($string, "{TINYLINK}") ) {
351
+ $tinylink = file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode($this->get_tracking_link($this->permalink)));
352
  if ( $tinylink !== 'Error' || $tinylink != false ) {
353
  $tlink = "<a href=\"" . $tinylink . "\">" . $tinylink . "</a>";
354
  $string = str_replace("{TINYLINK}", $tlink, $string);
389
  $mailtext = apply_filters('s2_plain_email', $message);
390
  }
391
 
392
+ // Replace any escaped html symbols in subject then apply filter
393
  $subject = html_entity_decode($subject, ENT_QUOTES);
394
+ $subject = apply_filters('s2_email_subject', $subject);
395
 
396
  // Construct BCC headers for sending or send individual emails
397
  $bcc = '';
502
  return $headers;
503
  } // end headers()
504
 
505
+ /**
506
+ Function to add UTM tracking details to links
507
+ */
508
+ function get_tracking_link($link) {
509
+ if ( !empty($this->subscribe2_options['tracking']) ) {
510
+ $delimiter = '?';
511
+ if ( strpos($link, $delimiter) > 0 ) { $delimiter = '&'; }
512
+ return $link . $delimiter . $this->subscribe2_options['tracking'];
513
+ } else {
514
+ return $link;
515
+ }
516
+ } // end get_tracking_link()
517
+
518
  /**
519
  Sends an email notification of a new post
520
  */
546
  return $post;
547
  }
548
 
549
+ // Are we sending notifications for password protected posts?
 
 
 
 
 
 
550
  if ( $this->subscribe2_options['password'] == "no" && $post->post_password != '' ) {
551
  return $post;
552
  }
553
 
554
+ // Is the post assigned to a format for which we should not be sending posts
555
+ $post_format = get_post_format($post->ID);
556
+ $excluded_formats = explode(',', $this->subscribe2_options['exclude_formats']);
557
+ if ( $post_format !== false && in_array($post_format, $excluded_formats) ) {
558
+ return $post;
559
+ }
560
+
561
  $post_cats = wp_get_post_categories($post->ID);
562
  $check = false;
563
  // is the current post assigned to any categories
958
  $message = $this->email . " " . __('subscribed to email notifications!', 'subscribe2');
959
  $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'");
960
  if ( empty($recipients) ) {
961
+ $role = array('fields' => array('user_email'), 'role' => 'administrator');
962
+ $wp_user_query = get_users( $role );
963
+ foreach ($wp_user_query as $user) {
964
+ $recipients[] = $user->user_email;
 
 
 
 
 
 
 
 
 
 
 
 
 
965
  }
966
  }
967
  $headers = $this->headers();
968
+ // send individual emails so we don't reveal admin emails to each other
969
  foreach ( $recipients as $recipient ) {
970
  @wp_mail($recipient, $subject, $message, $headers);
971
  }
984
  $message = $this->email . " " . __('unsubscribed from email notifications!', 'subscribe2');
985
  $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'");
986
  if ( empty($recipients) ) {
987
+ $role = array('fields' => array('user_email'), 'role' => 'administrator');
988
+ $wp_user_query = get_users( $role );
989
+ foreach ($wp_user_query as $user) {
990
+ $recipients[] = $user->user_email;
 
 
 
 
 
 
 
 
 
 
 
 
 
991
  }
992
  }
993
  $headers = $this->headers();
1070
  } // end get_public()
1071
 
1072
  /**
1073
+ Collect an array of all author level users and above
1074
  */
1075
+ function get_authors() {
1076
+ if ( '' == $this->all_authors ) {
1077
+ $role = array('fields' => array('ID', 'display_name'), 'role' => 'administrator');
1078
+ $administrators = get_users( $role );
1079
+ $role = array('fields' => array('ID', 'display_name'), 'role' => 'editor');
1080
+ $editors = get_users( $role );
1081
+ $role = array('fields' => array('ID', 'display_name'), 'role' => 'author');
1082
+ $authors = get_users( $role );
1083
+
1084
+ $this->all_authors = array_merge($administrators, $editors, $authors);
1085
+ }
1086
+ return $this->all_authors;
1087
+ } // end get_authors()
1088
+
1089
+ /**
1090
+ Return an array of all subscribers emails or IDs
1091
+ */
1092
+ function get_all_registered($return = 'email') {
1093
  global $wpdb;
1094
 
1095
  if ( $this->s2_mu ) {
1096
+ if ( $return === 'ID' ) {
1097
  return $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
1098
  } else {
1099
+ return $wpdb->get_col("SELECT a.user_email FROM $wpdb->users AS a INNER JOIN $wpdb->usermeta AS b ON a.ID = b.user_id WHERE b.meta_key='" . $wpdb->prefix . "capabilities'");
 
 
1100
  }
1101
  } else {
1102
+ if ( $return === 'ID' ) {
1103
  return $wpdb->get_col("SELECT ID FROM $wpdb->users");
1104
  } else {
1105
  return $wpdb->get_col("SELECT user_email FROM $wpdb->users");
1116
 
1117
  $format = '';
1118
  $cats = '';
1119
+ $authors = '';
1120
  $subscribers = array();
1121
 
1122
  parse_str($args, $r);
1124
  $r['format'] = 'all';
1125
  if ( !isset($r['cats']) )
1126
  $r['cats'] = '';
1127
+ if ( !isset($r['author']) )
1128
+ $r['author'] = '';
1129
 
1130
  $JOIN = ''; $AND = '';
1131
  // text or HTML subscribers
1153
  $AND .= " AND ($and)";
1154
  }
1155
 
1156
+ // specific authors
1157
+ if ( '' != $r['author'] ) {
1158
+ $JOIN .= "INNER JOIN $wpdb->usermeta AS d ON a.user_id = d.user_id ";
1159
+ $AND .= " AND (d.meta_key='" . $this->get_usermeta_keyname('s2_authors') . " AND NOT FIND_IN_SET(" . $r['author'] . ", d.meta_value))";
1160
+ }
1161
+
1162
  if ( $this->s2_mu ) {
1163
  $sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . "WHERE a.meta_key='" . $wpdb->prefix . "capabilities'" . $AND;
1164
  } else {
1214
  } // end signup_ip()
1215
 
1216
  /**
1217
+ Function to ensure email is compliant with internet messaging standards
1218
  */
1219
  function sanitize_email($email) {
1220
  if ( !is_email($email) ) { return; }
1221
 
1222
  // ensure that domain is in lowercase as per internet email standards
1223
  list($name, $domain) = explode('@', $email, 2);
1224
+ return $name . "@" . strtolower($domain);
1225
  } // end sanitize_email()
1226
 
1227
  /**
1255
  if ( false !== $this->is_public($this->sanitize_email($user->user_email)) ) {
1256
  // delete this user from the public table, and subscribe them to all the categories
1257
  $this->delete($user->user_email);
1258
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
1259
  foreach ( explode(',', $cats) as $cat ) {
1260
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat, $cat);
1261
  }
1262
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), 'excerpt');
1263
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), $this->subscribe2_options['autosub_def']);
1264
  } else {
1265
  // create post format entries for all users
1266
  if ( in_array($this->subscribe2_options['autoformat'], array('html', 'html_excerpt', 'post', 'excerpt')) ) {
1267
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), $this->subscribe2_options['autoformat']);
1268
  } else {
1269
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), 'excerpt');
1270
  }
1271
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), $this->subscribe2_options['autosub_def']);
1272
  // if the are no existing subscriptions, create them if we have consent
1273
  if ( true === $consent ) {
1274
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
1275
  foreach ( explode(',', $cats) as $cat ) {
1276
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat, $cat);
1277
  }
1278
  }
1279
  }
1294
  $user_IDs = $wpdb->get_col($sql);
1295
 
1296
  foreach ( $user_IDs as $user_ID ) {
1297
+ $old_cats = get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true);
1298
  if ( !empty($old_cats) ) {
1299
  $old_cats = explode(',', $old_cats);
1300
  $newcats = array_unique(array_merge($cats, $old_cats));
1304
  if ( !empty($newcats) ) {
1305
  // add subscription to these cat IDs
1306
  foreach ( $newcats as $id ) {
1307
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, $id);
1308
  }
1309
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $newcats));
1310
  }
1311
  unset($newcats);
1312
  }
1320
  global $wpdb;
1321
 
1322
  $useremails = explode(",", $emails);
1323
+ $useremails = "'" . implode("', '", $useremails) . "'";
1324
 
1325
+ $sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ($useremails)";
1326
  $user_IDs = $wpdb->get_col($sql);
1327
 
1328
  foreach ( $user_IDs as $user_ID ) {
1329
+ $old_cats = explode(',', get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true));
1330
  $remain = array_diff($old_cats, $cats);
1331
  if ( !empty($remain) ) {
1332
  // remove subscription to these cat IDs and update s2_subscribed
1333
  foreach ( $cats as $id ) {
1334
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
1335
  }
1336
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $remain));
1337
  } else {
1338
  // remove subscription to these cat IDs and update s2_subscribed to ''
1339
  foreach ( $cats as $id ) {
1340
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
1341
  }
1342
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
1343
  }
1344
  unset($remain);
1345
  }
1352
  if ( empty($format) ) { return; }
1353
 
1354
  global $wpdb;
 
1355
  $subscribers = explode(',', $subscribers_string);
1356
+ $emails = "'" . implode("', '", $subscribers) . "'";
 
 
1357
  $ids = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_email IN ($emails)");
1358
  $ids = implode(',', $ids);
1359
  $sql = "UPDATE $wpdb->usermeta SET meta_value='{$format}' WHERE meta_key='" . $this->get_usermeta_keyname('s2_format') . "' AND user_id IN ($ids)";
1368
 
1369
  global $wpdb;
1370
  $useremails = explode(",", $emails);
1371
+ $useremails = "'" . implode("', '", $useremails) . "'";
1372
 
1373
+ $sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ($useremails)";
1374
  $user_IDs = $wpdb->get_col($sql);
1375
 
1376
  if ( $digest == 'digest' ) {
1388
 
1389
  foreach ( $user_IDs as $user_ID ) {
1390
  foreach ( $all_cats as $cat ) {
1391
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat->term_id, $cat->term_id);
1392
  }
1393
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats_string);
1394
  }
1395
  } elseif ( $digest == '-1' ) {
1396
  foreach ( $user_IDs as $user_ID ) {
1397
+ $cats = explode(',', get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true));
1398
  foreach ( $cats as $id ) {
1399
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
1400
  }
1401
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
1402
  }
1403
  }
1404
  } // end digest_change()
1433
  $cats_string = '';
1434
  foreach ( $all_cats as $cat ) {
1435
  ('' == $cats_string) ? $cats_string = "$cat->term_id" : $cats_string .= ",$cat->term_id";
1436
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat->term_id, $cat->term_id);
1437
  }
1438
  if ( empty($cats_string) ) {
1439
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
1440
  } else {
1441
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats_string);
1442
  }
1443
  }
1444
  } elseif ( !empty($_GET['s2mu_unsubscribe']) ) {
1450
  $user_ID = get_current_user_id();
1451
 
1452
  // delete subscription to all categories on that blog
1453
+ $cats = get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true);
1454
  $cats = explode(',', $cats);
1455
  if ( !is_array($cats) ) {
1456
  $cats = array($cats);
1457
  }
1458
 
1459
  foreach ( $cats as $id ) {
1460
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
1461
  }
1462
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
1463
 
1464
  // add an action hook for external manipulation of blog and user data
1465
  do_action_ref_array('subscribe2_wpmu_unsubscribe', array($user_ID, $unsub_id));
1491
  }
1492
  } // end wpmu_subscribe()
1493
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1494
  /**
1495
  Autosubscribe registered users to newly created categories
1496
  if registered user has selected this option
1511
  if ( '' == $user_IDs ) { return; }
1512
 
1513
  foreach ( $user_IDs as $user_ID ) {
1514
+ $old_cats = get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true);
1515
  if ( empty($old_cats) ) {
1516
  $newcats = (array)$new_category;
1517
  } else {
1519
  $newcats = array_merge($old_cats, (array)$new_category);
1520
  }
1521
  // add subscription to these cat IDs
1522
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $new_category, $new_category);
1523
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $newcats));
1524
  }
1525
  } elseif ( 'exclude' == $this->subscribe2_options['show_autosub'] ) {
1526
  $excluded_cats = explode(',', $this->subscribe2_options['exclude']);
1542
  if ( '' == $user_IDs ) { return; }
1543
 
1544
  foreach ( $user_IDs as $user_ID ) {
1545
+ $old_cats = explode(',', get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true));
1546
  if ( !is_array($old_cats) ) {
1547
  $old_cats = array($old_cats);
1548
  }
1549
  // add subscription to these cat IDs
1550
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $deleted_category);
1551
  $remain = array_diff($old_cats, (array)$deleted_category);
1552
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $remain));
1553
  }
1554
  } // end delete_category()
1555
 
1576
 
1577
  // handle issues from WordPress core where user_level is not set or set low
1578
  if ( empty($admin) ) {
1579
+ $role = array('role' => 'administrator');
1580
+ $wp_user_query = get_users( $role );
1581
+ foreach ($wp_user_query as $user) {
1582
+ $admin[] = $user;
 
 
 
 
 
 
 
 
 
 
 
 
 
1583
  }
1584
  $admin = $admin[0];
1585
  }
1794
 
1795
  // show our form
1796
  echo "<div class=\"wrap\">";
1797
+ echo "<div id=\"icon-tools\" class=\"icon32\"></div>";
1798
  echo "<h2>" . __('Manage Subscribers', 'subscribe2') . "</h2>\r\n";
1799
  echo "<form method=\"post\" action=\"\">\r\n";
1800
  if ( function_exists('wp_nonce_field') ) {
1811
  echo "<h2>" . __('Current Subscribers', 'subscribe2') . "</h2>\r\n";
1812
  echo "<br />";
1813
  $this->display_subscriber_dropdown($what, __('Filter', 'subscribe2'));
1814
+ echo "<br /><br />";
1815
  // show the selected subscribers
1816
+ $alternate = 'alternate';
1817
+ echo "<table class=\"widefat\" cellpadding=\"2\" cellspacing=\"2\" width=\"100%\">";
1818
  $searchterm = ( $_POST['searchterm'] ) ? $_POST['searchterm'] : '';
1819
+ echo "<tr class=\"alternate\"><td colspan=\"3\"><input type=\"text\" name=\"searchterm\" value=\"" . $searchterm . "\" /></td>\r\n";
1820
+ echo "<td><input type=\"submit\" class=\"button-secondary\" name=\"search\" value=\"" . __('Search Subscribers', 'subscribe2') . "\" /></td>\r\n";
1821
  if ( $reminderform ) {
1822
  echo "<td width=\"25%\" align=\"right\"><input type=\"hidden\" name=\"reminderemails\" value=\"" . $reminderemails . "\" />\r\n";
1823
  echo "<input type=\"submit\" class=\"button-secondary\" name=\"remind\" value=\"" . __('Send Reminder Email', 'subscribe2') . "\" /></td>\r\n";
1828
  $exportcsv = implode(",\r\n", $subscribers);
1829
  echo "<td width=\"25%\" align=\"right\"><input type=\"hidden\" name=\"exportcsv\" value=\"" . $what . "\" />\r\n";
1830
  echo "<input type=\"submit\" class=\"button-secondary\" name=\"csv\" value=\"" . __('Save Emails to CSV File', 'subscribe2') . "\" /></td>\r\n";
1831
+ } else {
1832
+ echo "<td width=\"25%\"></td>";
1833
  }
1834
+ echo "</tr>";
1835
 
 
1836
  if ( !empty($subscribers) ) {
1837
  echo "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
1838
+ echo "<td colspan=\"3\" align=\"right\">" . $strip . "</td></tr>\r\n";
1839
  }
1840
  if ( !empty($subscribers) ) {
1841
  if ( is_int($this->subscribe2_options['entries']) ) {
1851
  echo "<td width=\"4%\" align=\"center\">";
1852
  echo "<img src=\"" . $urlpath . "include/exclamation.png\" alt=\"&gt;\" title=\"" . __('Unconfirm this email address', 'subscribe2') . "\" /></td>\r\n";
1853
  echo "<td width=\"4%\" align=\"center\">";
1854
+ echo "<img src=\"" . $urlpath . "include/cross.png\" alt=\"X\" title=\"" . __('Delete this email address', 'subscribe2') . "\" /></td><td colspan=\"3\"></td></tr>\r\n";
1855
+ echo "<tr class=\"\"><td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"confirm_checkall\" /></td>\r\n";
1856
  echo "<td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"unconfirm_checkall\" /></td>\r\n";
1857
  echo "<td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"delete_checkall\" /></td>\r\n";
1858
+ echo "<td colspan =\"3\" align=\"left\"><strong>" . __('Select / Unselect All', 'subscribe2') . "</strong></td></tr>\r\n";
1859
 
1860
  foreach ( $subscribers as $subscriber ) {
1861
  echo "<tr class=\"$alternate\" style=\"height:1.5em;\">";
1866
  echo "<td align=\"center\">\r\n";
1867
  echo "<input class=\"delete_checkall\" title=\"" . __('Delete this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"delete[]\" value=\"" . $subscriber . "\" />\r\n";
1868
  echo "</td>\r\n";
1869
+ echo "<td colspan=\"3\"><span style=\"color:#006600\">&#x221A;&nbsp;&nbsp;</span><abbr title=\"" . $this->signup_ip($subscriber) . "\"><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a></abbr>\r\n";
1870
+ echo "(<span style=\"color:#006600\">" . $this->signup_date($subscriber) . "</span>)\r\n";
1871
  } elseif ( in_array($subscriber, $unconfirmed) ) {
1872
  echo "<input class=\"confirm_checkall\" title=\"" . __('Confirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"confirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
1873
  echo "<td align=\"center\"></td>\r\n";
1874
  echo "<td align=\"center\">\r\n";
1875
  echo "<input class=\"delete_checkall\" title=\"" . __('Delete this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"delete[]\" value=\"" . $subscriber . "\" />\r\n";
1876
  echo "</td>\r\n";
1877
+ echo "<td colspan=\"3\"><span style=\"color:#FF0000\">&nbsp;!&nbsp;&nbsp;&nbsp;</span><abbr title=\"" . $this->signup_ip($subscriber) . "\"><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a></abbr>\r\n";
1878
+ echo "(<span style=\"color:#FF0000\">" . $this->signup_date($subscriber) . "</span>)\r\n";
1879
  } elseif ( in_array($subscriber, $all_users) ) {
1880
+ $user_info = get_user_by('email', $subscriber);
1881
  echo "</td><td align=\"center\"></td><td align=\"center\"></td>\r\n";
1882
+ echo "<td colspan=\"3\"><span style=\"color:#006600\">&reg;&nbsp;&nbsp;</span><abbr title=\"" . $user_info->user_login . "\"><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a></abbr>\r\n";
1883
+ echo "(<a href=\"" . get_option('siteurl') . "/wp-admin/admin.php?page=s2&amp;email=" . urlencode($subscriber) . "\">" . __('edit', 'subscribe2') . "</a>)\r\n";
1884
  }
1885
  echo "</td></tr>\r\n";
1886
  ('alternate' == $alternate) ? $alternate = '' : $alternate = 'alternate';
1893
  }
1894
  }
1895
  if ( !empty($subscribers) ) {
1896
+ echo "<tr class=\"$alternate\"><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
1897
+ echo "<td colspan=\"3\" align=\"right\">" . $strip . "</td></tr>\r\n";
1898
  }
1899
  echo "</table>\r\n";
1900
 
1997
  $this->subscribe2_options['password'] = $_POST['password'];
1998
  $this->subscribe2_options['private'] = $_POST['private'];
1999
  $this->subscribe2_options['cron_order'] = $_POST['cron_order'];
2000
+ $this->subscribe2_options['tracking'] = $_POST['tracking'];
2001
 
2002
  // send per-post or digest emails
2003
  $email_freq = $_POST['email_freq'];
2078
  ( isset($_POST['reg_override']) ) ? $override = '1' : $override = '0';
2079
  $this->subscribe2_options['reg_override'] = $override;
2080
 
2081
+ // excluded formats
2082
+ if ( !empty($_POST['format']) ) {
2083
+ $exclude_formats = implode(',', $_POST['format']);
2084
+ } else {
2085
+ $exclude_formats = '';
2086
+ }
2087
+ $this->subscribe2_options['exclude_formats'] = $exclude_formats;
2088
+
2089
  // default WordPress page where Subscribe2 token is placed
2090
  if ( is_numeric($_POST['page']) && $_POST['page'] >= 0 ) {
2091
  $this->subscribe2_options['s2page'] = $_POST['page'];
2104
  ( $_POST['show_button'] == '1' ) ? $showbutton = '1' : $showbutton = '0';
2105
  $this->subscribe2_options['show_button'] = $showbutton;
2106
 
2107
+ // enable AJAX style form
2108
+ ( $_POST['ajax'] == '1' ) ? $ajax = '1' : $ajax = '0';
2109
+ $this->subscribe2_options['ajax'] = $ajax;
2110
+
2111
  // show widget in Presentation->Widgets
2112
  ( $_POST['widget'] == '1' ) ? $showwidget = '1' : $showwidget = '0';
2113
  $this->subscribe2_options['widget'] = $showwidget;
2138
  }
2139
  // show our form
2140
  echo "<div class=\"wrap\">";
2141
+ echo "<div id=\"icon-options-general\" class=\"icon32\"></div>";
2142
  echo "<h2>" . __('Subscribe2 Settings', 'subscribe2') . "</h2>\r\n";
2143
  echo "<a href=\"http://subscribe2.wordpress.com/\">" . __('Plugin Blog', 'subscribe2') . "</a> | ";
2144
  echo "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904\">" . __('Make a donation via PayPal', 'subscribe2') . "</a>";
2162
  echo "<a href=\"#\" onclick=\"s2_revert('bcc'); return false;\">". __('Revert', 'subscribe2') . "</a></span>\n";
2163
 
2164
  echo "<br /><br />" . __('Send Admins notifications for new', 'subscribe2') . ': ';
2165
+ echo "<label><input type=\"radio\" name=\"admin_email\" value=\"subs\"" . checked($this->subscribe2_options['admin_email'], 'subs', false) . " />\r\n";
2166
+ echo __('Subscriptions', 'subscribe2') . "</label>&nbsp;&nbsp;";
2167
+ echo "<label><input type=\"radio\" name=\"admin_email\" value=\"unsubs\"" . checked($this->subscribe2_options['admin_email'], 'unsubs', false) . " />\r\n";
2168
+ echo __('Unsubscriptions', 'subscribe2') . "</label>&nbsp;&nbsp;";
2169
+ echo "<label><input type=\"radio\" name=\"admin_email\" value=\"both\"" . checked($this->subscribe2_options['admin_email'], 'both', false) . " />\r\n";
2170
+ echo __('Both', 'subscribe2') . "</label>&nbsp;&nbsp;";
2171
+ echo "<label><input type=\"radio\" name=\"admin_email\" value=\"none\"" . checked($this->subscribe2_options['admin_email'], 'none', false) . " />\r\n";
2172
+ echo __('Neither', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
 
 
 
 
 
 
 
 
 
2173
 
2174
  echo __('Include theme CSS stylesheet in HTML notifications', 'subscribe2') . ': ';
2175
+ echo "<label><input type=\"radio\" name=\"stylesheet\" value=\"yes\"" . checked($this->subscribe2_options['stylesheet'], 'yes', false) . " /> ";
2176
+ echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2177
+ echo "<label><input type=\"radio\" name=\"stylesheet\" value=\"no\"" . checked($this->subscribe2_options['stylesheet'], 'no', false) . " /> ";
2178
+ echo __('No', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
 
 
 
2179
 
2180
  echo __('Send Emails for Pages', 'subscribe2') . ': ';
2181
+ echo "<label><input type=\"radio\" name=\"pages\" value=\"yes\"" . checked($this->subscribe2_options['pages'], 'yes', false) . " /> ";
2182
+ echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2183
+ echo "<label><input type=\"radio\" name=\"pages\" value=\"no\"" . checked($this->subscribe2_options['pages'], 'no', false) . " /> ";
2184
+ echo __('No', 'subscribe2') . "</label><br /><br />\r\n";
2185
+ $s2_post_types = apply_filters('s2_post_types', NULL);
2186
+ if ( !empty($s2_post_types) ) {
2187
+ $types = '';
2188
+ echo __('Subscribe2 will send email notifications for the following custom post types', 'subscribe2') . ': <strong>';
2189
+ foreach ($s2_post_types as $type) {
2190
+ ('' == $types) ? $types = ucwords($type) : $types .= ", " . ucwords($type);
2191
+ }
2192
+ echo $types . "</strong><br /><br />\r\n";
2193
  }
 
2194
  echo __('Send Emails for Password Protected Posts', 'subscribe2') . ': ';
2195
+ echo "<label><input type=\"radio\" name=\"password\" value=\"yes\"" . checked($this->subscribe2_options['password'], 'yes', false) . " /> ";
2196
+ echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2197
+ echo "<label><input type=\"radio\" name=\"password\" value=\"no\"" . checked($this->subscribe2_options['password'], 'no', false) . " /> ";
2198
+ echo __('No', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
 
 
 
2199
  echo __('Send Emails for Private Posts', 'subscribe2') . ': ';
2200
+ echo "<label><input type=\"radio\" name=\"private\" value=\"yes\"" . checked($this->subscribe2_options['private'], 'yes', false) . " /> ";
2201
+ echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2202
+ echo "<label><input type=\"radio\" name=\"private\" value=\"no\"" . checked($this->subscribe2_options['private'], 'no', false) . " /> ";
2203
+ echo __('No', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
 
 
 
2204
  echo __('Send Email From', 'subscribe2') . ': ';
2205
  echo "<label>\r\n";
2206
  $this->admin_dropdown(true);
2209
  echo __('Send Emails', 'subscribe2') . ": <br /><br />\r\n";
2210
  $this->display_digest_choices();
2211
  echo __('For digest notifications, date order for posts is', 'subscribe2') . ": \r\n";
2212
+ echo "<label><input type=\"radio\" name=\"cron_order\" value=\"desc\"" . checked($this->subscribe2_options['cron_order'], 'desc', false) . " /> ";
2213
+ echo __('Descending', 'subscribe2') . "</label>&nbsp;&nbsp;";
2214
+ echo "<label><input type=\"radio\" name=\"cron_order\" value=\"asc\"" . checked($this->subscribe2_options['cron_order'], 'asc', false) . " /> ";
2215
+ echo __('Ascending', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
 
 
 
2216
  }
2217
+ echo __('Add Tracking Parameters to the Permalink', 'subscribe2') . ": ";
2218
+ echo "<input type=\"text\" name=\"tracking\" value=\"" . stripslashes($this->subscribe2_options['tracking']) . "\" size=\"50\" /> ";
2219
+ echo "<br />" . __('eg. utm_source=subscribe2&utm_medium=email&utm_campaign=postnotify', 'subscribe2') . "<br /><br />\r\n";
2220
 
2221
  // email templates
2222
  echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
2266
 
2267
  // excluded categories
2268
  echo "<h2>" . __('Excluded Categories', 'subscribe2') . "</h2>\r\n";
2269
+ echo "<p>";
2270
  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";
2271
+ echo "</p>";
2272
  $this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
2273
+ echo "<center><label><input type=\"checkbox\" name=\"reg_override\" value=\"1\"" . checked($this->subscribe2_options['reg_override'], '1', false) . " /> ";
2274
+ echo __('Allow registered users to subscribe to excluded categories?', 'subscribe2') . "</label></center><br />\r\n";
2275
+
2276
+ $formats = get_theme_support('post-formats');
2277
+ if ( $formats !== false ) {
2278
+ // excluded formats
2279
+ echo "<h2>" . __('Excluded Formats', 'subscribe2') . "</h2>\r\n";
2280
+ echo "<p>";
2281
+ echo "<strong><em style=\"color: red\">" . __('Posts assigned to any Excluded Format do not generate notifications and are not included in digest notifications', 'subscribe2') . "</em></strong><br />\r\n";
2282
+ echo "</p>";
2283
+ $this->display_format_form($formats, explode(',', $this->subscribe2_options['exclude_formats']));
2284
  }
 
2285
 
2286
  // Appearance options
2287
  echo "<h2>" . __('Appearance', 'subscribe2') . "</h2>\r\n";
2303
  echo "<a href=\"#\" onclick=\"s2_revert('entries'); return false;\">". __('Revert', 'subscribe2') . "</a></span>\n";
2304
 
2305
  // show link to WordPress page in meta
2306
+ echo "<br /><br /><label><input type=\"checkbox\" name=\"show_meta\" value=\"1\"" . checked($this->subscribe2_options['show_meta'], '1', false) . " /> ";
2307
+ echo __('Show a link to your subscription page in "meta"?', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
2308
 
2309
  // show QuickTag button
2310
+ echo "<label><input type=\"checkbox\" name=\"show_button\" value=\"1\"" . checked($this->subscribe2_options['show_button'], '1', false) . " /> ";
2311
+ echo __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "</label><br /><br />\r\n";
2312
+
2313
+ // enable AJAX style form
2314
+ echo "<label><input type=\"checkbox\" name=\"ajax\" value=\"1\"" . checked($this->subscribe2_options['ajax'], '1', false) . " />";
2315
+ echo __('Enable AJAX style subscription form?', 'subscribe2') . "</label><br /><br />\r\n";
2316
 
2317
  // show Widget
2318
+ echo "<label><input type=\"checkbox\" name=\"widget\" value=\"1\"" . checked($this->subscribe2_options['widget'], '1', false) . " /> ";
2319
+ echo __('Enable Subscribe2 Widget?', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
2320
 
2321
  // show Counter Widget
2322
+ echo "<label><input type=\"checkbox\" name=\"counterwidget\" value=\"1\"" . checked($this->subscribe2_options['counterwidget'], '1', false) . " /> ";
2323
+ echo __('Enable Subscribe2 Counter Widget?', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
2324
 
2325
  // s2_meta checked by default
2326
+ echo "<label><input type =\"checkbox\" name=\"s2meta_default\" value=\"1\"" . checked($this->subscribe2_options['s2meta_default'], '1', false) . " /> ";
2327
+ echo __('Disable email notifications is checked by default on authoring pages?', 'subscribe2') . "</label>\r\n";
 
 
 
2328
  echo "</p>";
2329
 
2330
  //Auto Subscription for new registrations
2331
  echo "<h2>" . __('Auto Subscribe', 'subscribe2') . "</h2>\r\n";
2332
  echo"<p>";
2333
  echo __('Subscribe new users registering with your blog', 'subscribe2') . ":<br />\r\n";
2334
+ echo "<label><input type=\"radio\" name=\"autosub\" value=\"yes\"" . checked($this->subscribe2_options['autosub'], 'yes', false) . " /> ";
2335
+ echo __('Automatically', 'subscribe2') . "</label>&nbsp;&nbsp;";
2336
+ echo "<label><input type=\"radio\" name=\"autosub\" value=\"wpreg\"" . checked($this->subscribe2_options['autosub'], 'wpreg', false) . " /> ";
2337
+ echo __('Display option on Registration Form', 'subscribe2') . "</label>&nbsp;&nbsp;";
2338
+ echo "<label><input type=\"radio\" name=\"autosub\" value=\"no\"" . checked($this->subscribe2_options['autosub'], 'no', false) . " /> ";
2339
+ echo __('No', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
 
 
 
 
 
 
2340
  echo __('Auto-subscribe includes any excluded categories', 'subscribe2') . ":<br />\r\n";
2341
+ echo "<label><input type=\"radio\" name=\"newreg_override\" value=\"yes\"" . checked($this->subscribe2_options['newreg_override'], 'yes', false) . " /> ";
2342
+ echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2343
+ echo "<label><input type=\"radio\" name=\"newreg_override\" value=\"no\"" . checked($this->subscribe2_options['newreg_override'], 'no', false) . " /> ";
2344
+ echo __('No', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
 
 
 
2345
  echo __('Registration Form option is checked by default', 'subscribe2') . ":<br />\r\n";
2346
+ echo "<label><input type=\"radio\" name=\"wpregdef\" value=\"yes\"" . checked($this->subscribe2_options['wpregdef'], 'yes', false) . " /> ";
2347
+ echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2348
+ echo "<label><input type=\"radio\" name=\"wpregdef\" value=\"no\"" . checked($this->subscribe2_options['wpregdef'], 'no', false) . " /> ";
2349
+ echo __('No', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
 
 
 
2350
  echo __('Auto-subscribe users to receive email as', 'subscribe2') . ": <br />\r\n";
2351
+ echo "<label><input type=\"radio\" name=\"autoformat\" value=\"html\"" . checked($this->subscribe2_options['autoformat'], 'html', false) . " /> ";
2352
+ echo __('HTML - Full', 'subscribe2') ."</label>&nbsp;&nbsp;";
2353
+ echo "<label><input type=\"radio\" name=\"autoformat\" value=\"html_excerpt\"" . checked($this->subscribe2_options['autoformat'], 'html_excerpt', false) . " /> ";
2354
+ echo __('HTML - Excerpt', 'subscribe2') ."</label>&nbsp;&nbsp;";
2355
+ echo "<label><input type=\"radio\" name=\"autoformat\" value=\"post\"" . checked($this->subscribe2_options['autoformat'], 'post', false) . " /> ";
2356
+ echo __('Plain Text - Full', 'subscribe2') . "</label>&nbsp;&nbsp;";
2357
+ echo "<label><input type=\"radio\" name=\"autoformat\" value=\"excerpt\"" . checked($this->subscribe2_options['autoformat'], 'excerpt', false) . " /> ";
2358
+ echo __('Plain Text - Excerpt', 'subscribe2') . "</label><br /><br />";
 
 
 
 
 
 
 
 
 
 
 
 
2359
  echo __('Registered Users have the option to auto-subscribe to new categories', 'subscribe2') . ": <br />\r\n";
2360
+ echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"yes\"" . checked($this->subscribe2_options['show_autosub'], 'yes', false) . " /> ";
2361
+ echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2362
+ echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"no\"" . checked($this->subscribe2_options['show_autosub'], 'no', false) . " /> ";
2363
+ echo __('No', 'subscribe2') . "</label>&nbsp;&nbsp;";
2364
+ echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"exclude\"" . checked($this->subscribe2_options['show_autosub'], 'exclude', false) . " /> ";
2365
+ echo __('New categories are immediately excluded', 'subscribe2') . "</label><br /><br />";
 
 
 
 
 
 
 
 
 
2366
  echo __('Option for Registered Users to auto-subscribe to new categories is checked by default', 'subscribe2') . ": <br />\r\n";
2367
+ echo "<label><input type=\"radio\" name=\"autosub_def\" value=\"yes\"" . checked($this->subscribe2_options['autosub_def'], 'yes', false) . " /> ";
2368
+ echo __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2369
+ echo "<label><input type=\"radio\" name=\"autosub_def\" value=\"no\"" . checked($this->subscribe2_options['autosub_def'], 'no', false) . " /> ";
2370
+ echo __('No', 'subscribe2') . "</label><br /><br />";
2371
+ echo __('Display checkbox to allow subscriptions from the comment form', 'subscribe2') . ": <br />\r\n";
2372
+ if ( version_compare($wp_version, '3.0', '>') ) {
2373
+ echo "<label><input type=\"radio\" name=\"comment_subs\" value=\"before\"" . checked($this->subscribe2_options['comment_subs'], 'before', false) . " /> ";
2374
+ echo __('Before the Comment Submit button', 'subscribe2') . "</label>&nbsp;&nbsp;";
2375
+ }
2376
+ echo "<label><input type=\"radio\" name=\"comment_subs\" value=\"after\"" . checked($this->subscribe2_options['comment_subs'], 'after', false) . " /> ";
2377
+ echo __('After the Comment Submit button', 'subscribe2') . "</label>&nbsp;&nbsp;";
2378
+ echo "<label><input type=\"radio\" name=\"comment_subs\" value=\"no\"" . checked($this->subscribe2_options['comment_subs'], 'no', false) . " /> ";
2379
+ echo __('No', 'subscribe2');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2380
  echo"</label></p>";
2381
 
2382
  //barred domains
2420
  check_admin_referer('subscribe2-user_subscribers' . $s2nonce);
2421
 
2422
  if ( isset($_POST['s2_format']) ) {
2423
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), $_POST['s2_format']);
2424
  } else {
2425
  // value has not been set so use default
2426
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), 'excerpt');
2427
  }
2428
  if ( isset($_POST['new_category']) ) {
2429
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), $_POST['new_category']);
2430
  } else {
2431
  // value has not been passed so use Settings defaults
2432
  if ( $this->subscribe2_options['show_autosub'] == 'yes' && $this->subscribe2_options['autosub_def'] == 'yes' ) {
2433
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), 'yes');
2434
  } else {
2435
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), 'no');
2436
  }
2437
  }
2438
 
2439
  $cats = $_POST['category'];
2440
 
2441
  if ( empty($cats) || $cats == '-1' ) {
2442
+ $oldcats = explode(',', get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true));
2443
  if ( $oldcats ) {
2444
  foreach ( $oldcats as $cat ) {
2445
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat);
2446
  }
2447
  }
2448
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
2449
  } elseif ( $cats == 'digest' ) {
2450
  $all_cats = $this->all_cats(false, 'ID');
2451
  foreach ( $all_cats as $cat ) {
2452
  ('' == $catids) ? $catids = "$cat->term_id" : $catids .= ",$cat->term_id";
2453
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat->term_id, $cat->term_id);
2454
  }
2455
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $catids);
2456
  } else {
2457
  if ( !is_array($cats) ) {
2458
  $cats = (array)$_POST['category'];
2459
  }
2460
  sort($cats);
2461
+ $old_cats = explode(',', get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true));
2462
  $remove = array_diff($old_cats, $cats);
2463
  $new = array_diff($cats, $old_cats);
2464
  if ( !empty($remove) ) {
2465
  // remove subscription to these cat IDs
2466
  foreach ( $remove as $id ) {
2467
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
2468
  }
2469
  }
2470
  if ( !empty($new) ) {
2471
  // add subscription to these cat IDs
2472
  foreach ( $new as $id ) {
2473
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, $id);
2474
  }
2475
  }
2476
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $cats));
2477
  }
2478
+
2479
+ $authors = $_POST['author'];
2480
+ if ( is_array($authors) ) {
2481
+ $authors = implode(',', $authors);
2482
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_authors'), $authors);
2483
+ } elseif ( empty($authors) ) {
2484
+ update_user_meta($user_ID, $this->get_usermeta_keyname('s2_authors'), '');
2485
+ }
2486
+
2487
  echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Subscription preferences updated.', 'subscribe2') . "</strong></p></div>\n";
2488
  }
2489
 
2490
  // show our form
2491
  echo "<div class=\"wrap\">";
2492
+ echo "<div id=\"icon-users\" class=\"icon32\"></div>";
2493
  echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
2494
  if ( isset($_GET['email']) ) {
2495
  $user = get_userdata($user_ID);
2503
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"user\" />";
2504
  if ( $this->subscribe2_options['email_freq'] == 'never' ) {
2505
  echo __('Receive email as', 'subscribe2') . ": &nbsp;&nbsp;";
2506
+ echo "<label><input type=\"radio\" name=\"s2_format\" value=\"html\"" . checked(get_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), true), 'html', false) . " />";
2507
+ echo " " . __('HTML - Full', 'subscribe2') ."</label>&nbsp;&nbsp;";
2508
+ echo "<label><input type=\"radio\" name=\"s2_format\" value=\"html_excerpt\"" . checked(get_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), true), 'html_excerpt', false) . " />";
2509
+ echo " " . __('HTML - Excerpt', 'subscribe2') . "</label>&nbsp;&nbsp;";
2510
+ echo "<label><input type=\"radio\" name=\"s2_format\" value=\"post\"" . checked(get_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), true), 'post', false) . " />";
2511
+ echo " " . __('Plain Text - Full', 'subscribe2') . "</label>&nbsp;&nbsp;";
2512
+ echo "<label><input type=\"radio\" name=\"s2_format\" value=\"excerpt\"" . checked(get_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'), true), 'excerpt', false) . " />";
2513
+ echo " " . __('Plain Text - Excerpt', 'subscribe2') . "</label><br /><br />\r\n";
 
 
 
 
 
 
 
 
 
 
 
 
2514
 
2515
  if ( $this->subscribe2_options['show_autosub'] == 'yes' ) {
2516
  echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': &nbsp;&nbsp;';
2517
+ echo "<label><input type=\"radio\" name=\"new_category\" value=\"yes\"" . checked(get_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), true), 'yes', false) . " />";
2518
+ echo " " . __('Yes', 'subscribe2') . "</label>&nbsp;&nbsp;";
2519
+ echo "<label><input type=\"radio\" name=\"new_category\" value=\"no\"" . checked(get_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'), true), 'no', false) . " />";
2520
+ echo " " . __('No', 'subscribe2') . "</label>";
 
 
 
 
 
 
2521
  echo "</p>";
2522
  }
2523
 
2524
  // subscribed categories
2525
  if ( $this->s2_mu ) {
2526
  global $blog_id;
2527
+ $subscribed = get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true);
2528
  // if we are subscribed to the current blog display an "unsubscribe" link
2529
  if ( !empty($subscribed) ) {
2530
  $unsubscribe_link = esc_url( add_query_arg('s2mu_unsubscribe', $blog_id) );
2538
  } else {
2539
  echo "<h2>" . __('Subscribed Categories', 'subscribe2') . "</h2>\r\n";
2540
  }
2541
+ $this->display_category_form(explode(',', get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true)), $this->subscribe2_options['reg_override']);
2542
  } else {
2543
  // we're doing daily digests, so just show
2544
  // subscribe / unnsubscribe
2545
  echo __('Receive periodic summaries of new posts?', 'subscribe2') . ': &nbsp;&nbsp;';
2546
  echo "<label>";
2547
+ echo "<input type=\"radio\" name=\"category\" value=\"digest\"";
2548
+ if ( get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true) ) {
2549
+ echo " checked=\"checked\"";
2550
  }
2551
+ echo " /> " . __('Yes', 'subscribe2') . "</label> <label><input type=\"radio\" name=\"category\" value=\"-1\" ";
2552
+ if ( !get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true) ) {
2553
+ echo " checked=\"checked\"";
2554
  }
2555
+ echo " /> " . __('No', 'subscribe2');
2556
  echo "</label></p>";
2557
  }
2558
 
2559
+ if ( count($this->get_authors()) > 1 ) {
2560
+ echo "<h2>" . __('Do not send notifications for post made by these authors', 'subscribe2') . "</h2>\r\n";
2561
+ $this->display_author_form(explode(',', get_user_meta($user_ID, $this->get_usermeta_keyname('s2_authors'), true)));
2562
+ }
2563
+
2564
  // submit
2565
  echo "<p class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"submit\" value=\"" . __("Update Preferences", 'subscribe2') . " &raquo;\" /></p>";
2566
  echo "</form>\r\n";
2589
  }
2590
 
2591
  // check if we're subscribed to the blog
2592
+ $subscribed = get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true);
2593
 
2594
  $blogname = get_option('blogname');
2595
  if ( strlen($blogname) > 30 ) {
2708
 
2709
  // show our form
2710
  echo "<div class=\"wrap\">";
2711
+ echo "<div id=\"icon-edit\" class=\"icon32\"></div>";
2712
  echo "<h2>" . __('Send an email to subscribers', 'subscribe2') . "</h2>\r\n";
2713
  echo "<form method=\"post\" action=\"\">\r\n";
2714
  if ( function_exists('wp_nonce_field') ) {
2748
  $s2_taxonomies = apply_filters('s2_taxonomies', $s2_taxonomies);
2749
 
2750
  foreach( $s2_taxonomies as $taxonomy ) {
2751
+ if ( taxonomy_exists($taxonomy) ) {
2752
  $all_cats = array_merge($all_cats, get_categories(array('hide_empty' => false, 'orderby' => $orderby, 'taxonomy' => $taxonomy)));
2753
  }
2754
  }
2797
  $j++;
2798
  }
2799
  $catName = '';
2800
+ $parents = array_reverse( get_ancestors($cat->term_id, $cat->taxonomy) );
2801
  if ( $parents ) {
2802
  foreach ( $parents as $parent ) {
2803
  $parent = get_term($parent, $cat->taxonomy);
2825
  echo "</table>\r\n";
2826
  } // end display_category_form()
2827
 
2828
+ /**
2829
+ Display a table of post formats supported by the currently active theme
2830
+ */
2831
+ function display_format_form($formats, $selected = array()) {
2832
+ $half = (count($formats[0]) / 2);
2833
+ $i = 0;
2834
+ $j = 0;
2835
+ echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"5\" class=\"editform\">\r\n";
2836
+ echo "<tr><td align=\"left\" colspan=\"2\">\r\n";
2837
+ echo "<label><input type=\"checkbox\" name=\"checkall\" value=\"checkall_format\" /> " . __('Select / Unselect All', 'subscribe2') . "</label>\r\n";
2838
+ echo "</td></tr>\r\n";
2839
+ echo "<tr valign=\"top\"><td width=\"50%\" align=\"left\">\r\n";
2840
+ foreach ( $formats[0] as $format ) {
2841
+ if ( $i >= $half && 0 == $j ){
2842
+ echo "</td><td width=\"50%\" align=\"left\">\r\n";
2843
+ $j++;
2844
+ }
2845
+
2846
+ if ( 0 == $j ) {
2847
+ echo "<label><input class=\"checkall_format\" type=\"checkbox\" name=\"format[]\" value=\"" . $format . "\"";
2848
+ if ( in_array($format, $selected) ) {
2849
+ echo " checked=\"checked\"";
2850
+ }
2851
+ echo " /> " . ucwords($format) . "</label><br />\r\n";
2852
+ } else {
2853
+ echo "<label><input class=\"checkall_format\" type=\"checkbox\" name=\"format[]\" value=\"" . $format . "\"";
2854
+ if ( in_array($format, $selected) ) {
2855
+ echo " checked=\"checked\"";
2856
+ }
2857
+ echo " /> " . ucwords($format) . "</label><br />\r\n";
2858
+ }
2859
+ $i++;
2860
+ }
2861
+ echo "</td></tr>\r\n";
2862
+ echo "</table>\r\n";
2863
+ } // end display_format_form()
2864
+
2865
+ /**
2866
+ Display a table of authors with checkboxes
2867
+ Optionally pre-select those authors specified
2868
+ */
2869
+ function display_author_form($selected = array()) {
2870
+ $all_authors = $this->get_authors();
2871
+
2872
+ $half = (count($all_authors) / 2);
2873
+ $i = 0;
2874
+ $j = 0;
2875
+ echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"5\" class=\"editform\">\r\n";
2876
+ echo "<tr><td align=\"left\" colspan=\"2\">\r\n";
2877
+ echo "<label><input type=\"checkbox\" name=\"checkall\" value=\"checkall_author\" /> " . __('Select / Unselect All', 'subscribe2') . "</label>\r\n";
2878
+ echo "</td></tr>\r\n";
2879
+ echo "<tr valign=\"top\"><td width=\"50%\" align=\"left\">\r\n";
2880
+ foreach ( $all_authors as $author ) {
2881
+ if ( $i >= $half && 0 == $j ) {
2882
+ echo "</td><td width=\"50%\" align=\"left\">\r\n";
2883
+ $j++;
2884
+ }
2885
+ if ( 0 == $j ) {
2886
+ echo "<label><input class=\"checkall_author\" type=\"checkbox\" name=\"author[]\" value=\"" . $author->ID . "\"";
2887
+ if ( in_array($author->ID, $selected) ) {
2888
+ echo " checked=\"checked\"";
2889
+ }
2890
+ echo " /> " . $author->display_name . "</label><br />\r\n";
2891
+ } else {
2892
+ echo "<label><input class=\"checkall_author\" type=\"checkbox\" name=\"author[]\" value=\"" . $author->ID . "\"";
2893
+ if ( in_array($author->ID, $selected) ) {
2894
+ echo " checked=\"checked\"";
2895
+ }
2896
+ echo " /> " . $author->display_name . "</label><br />\r\n";
2897
+ $i++;
2898
+ }
2899
+ }
2900
+ echo "</td></tr>\r\n";
2901
+ echo "</table>\r\n";
2902
+ } // end display_author_form()
2903
+
2904
  /**
2905
  Display a drop-down form to select subscribers
2906
  $selected is the option to select
2991
 
2992
  // handle issues from WordPress core where user_level is not set or set low
2993
  if ( empty($admins) ) {
2994
+ $args = array('fields' => array('ID', 'display_name'), 'role' => 'administrator');
2995
+ $wp_user_query = get_users( $args );
2996
+ foreach ($wp_user_query as $user) {
2997
+ $admins[] = $user;
 
 
 
 
 
 
 
 
 
 
 
 
 
2998
  }
2999
  }
3000
 
3001
  if ( $inc_author ) {
3002
+ $author[] = (object)array('ID' => 'author', 'display_name' => __('Post Author', 'subscribe2'));
3003
  $author[] = (object)array('ID' => 'blogname', 'display_name' => html_entity_decode(get_option('blogname'), ENT_QUOTES));
3004
  $admins = array_merge($author, $admins);
3005
  }
3034
  $schedule_sorted[$key] = $schedule[$key];
3035
  }
3036
  foreach ( $schedule_sorted as $key => $value ) {
3037
+ echo "<label><input type=\"radio\" name=\"email_freq\" value=\"" . $key . "\"" . checked($this->subscribe2_options['email_freq'], $key, false) . " />";
3038
+ echo " " . $value['display'] . "</label><br />\r\n";
 
 
 
3039
  }
3040
  echo "<br />" . __('Send Digest Notification at', 'subscribe2') . ": \r\n";
3041
  $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');
3127
  $user_ID = $this->get_user_id( $subscriber );
3128
  $user_info = get_userdata($user_ID);
3129
 
3130
+ $cats = explode(',', get_user_meta($user_info->ID, $this->get_usermeta_keyname('s2_subscribed'), true));
3131
  $subscribed_cats = '';
3132
  foreach ( $cat_ids as $cat ) {
3133
  (in_array($cat, $cats)) ? $subscribed_cats .= ",Yes" : $subscribed_cats .= ",No";
3161
  case 's2_cat':
3162
  case 's2_format':
3163
  case 's2_autosub':
3164
+ case 's2_authors':
3165
  return $wpdb->prefix . $metaname;
3166
  break;
3167
  }
3195
  */
3196
  function plugin_links($links, $file) {
3197
  if ( $file == S2DIR.'subscribe2.php' ) {
3198
+ $links[] = "<a href='admin.php?page=s2_settings'>" . __('Settings', 'subscribe2') . "</a>";
3199
  $links[] = "<a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904'><b>" . __('Donate', 'subscribe2') . "</b></a>";
3200
  }
3201
  return $links;
3209
  if ( 'wpreg' == $this->subscribe2_options['autosub'] ) {
3210
  echo "<p>\r\n<label>";
3211
  echo __('Check here to Subscribe to email notifications for new posts', 'subscribe2') . ":<br />\r\n";
3212
+ echo "<input type=\"checkbox\" name=\"reg_subscribe\"" . checked($this->subscribe2_options['wpregdef'], 'yes', false) . " />";
3213
+ echo "</label>\r\n";
 
 
 
3214
  echo "</p>\r\n";
3215
  } elseif ( 'yes' == $this->subscribe2_options['autosub'] ) {
3216
  echo "<p>\r\n<center>\r\n";
3249
  */
3250
  function wpmu_remove_user($user_ID) {
3251
  if ( 0 == $user_ID ) { return; }
3252
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_format'));
3253
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_autosub'));
3254
+ $cats = get_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), true);
3255
  if ( !empty($cats) ) {
3256
  $cats = explode(',', $cats);
3257
  foreach ( $cats as $cat ) {
3258
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat);
3259
  }
3260
  }
3261
+ delete_user_meta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
3262
  } // end wpmu_remove_user()
3263
 
3264
  /**
3270
  } // end s2_meta_init()
3271
 
3272
  /**
3273
+ Meta box code
3274
  */
3275
  function s2_meta_box() {
3276
  global $post_ID;
3309
  */
3310
  function s2_comment_meta_form() {
3311
  if ( is_user_logged_in() ) {
3312
+ echo $this->profile;
3313
  } else {
3314
  echo "<label><input type=\"checkbox\" name=\"s2_comment_request\" value=\"1\" />" . __('Check here to Subscribe to notifications for new posts', 'subscribe2') . "</label>";
3315
  }
3369
  extract(shortcode_atts(array(
3370
  'hide' => '',
3371
  'id' => '',
3372
+ 'url' => '',
3373
+ 'nojs' => 'false',
3374
+ 'link' => ''
3375
  ), $atts));
3376
 
3377
+ // if link is true return a link to the page with the ajax class
3378
+ if ( $link !== '' && !is_user_logged_in() ) {
3379
+ $this->s2form = "<a href=\"" . get_permalink($this->subscribe2_options['s2page']) . "\" class=\"s2popup\">" . $link . "</a>\r\n";
3380
+ return $this->s2form;
3381
+ }
3382
+
3383
  // if a button is hidden, show only other
3384
  if ( $hide == 'subscribe' ) {
3385
  $this->input_form_action = "<input type=\"submit\" name=\"unsubscribe\" value=\"" . __('Unsubscribe', 'subscribe2') . "\" />";
3394
  $url = get_permalink( $id );
3395
  }
3396
  // build default form
3397
+ if ( $nojs == 'true' ) {
3398
+ $this->form = "<form method=\"post\" action=\"" . $url . "\"><input type=\"hidden\" name=\"ip\" value=\"" . $_SERVER['REMOTE_ADDR'] . "\" /><p><label for=\"s2email\">" . __('Your email:', 'subscribe2') . "</label><br /><input type=\"text\" name=\"email\" id=\"s2email\" value=\"\" size=\"20\" /></p><p>" . $this->input_form_action . "</p></form>";
3399
+ } else {
3400
+ $this->form = "<form method=\"post\" action=\"" . $url . "\"><input type=\"hidden\" name=\"ip\" value=\"" . $_SERVER['REMOTE_ADDR'] . "\" /><p><label for=\"s2email\">" . __('Your email:', 'subscribe2') . "</label><br /><input type=\"text\" name=\"email\" id=\"s2email\" value=\"" . __('Enter email address...', 'subscribe2') . "\" size=\"20\" onfocus=\"if (this.value == '" . __('Enter email address...', 'subscribe2') . "') {this.value = '';}\" onblur=\"if (this.value == '') {this.value = '" . __('Enter email address...', 'subscribe2') . "';}\" /></p><p>" . $this->input_form_action . "</p></form>\r\n";
3401
+ }
3402
  $this->s2form = $this->form;
3403
 
3404
  global $user_ID;
3405
  get_currentuserinfo();
3406
  if ( $user_ID ) {
3407
+ $this->s2form = $this->profile;
 
 
 
 
3408
  }
3409
  if ( isset($_POST['subscribe']) || isset($_POST['unsubscribe']) ) {
3410
  global $wpdb, $user_email;
3531
  function widget_s2counter_css_and_js() {
3532
  // ensure we only add colorpicker js to widgets page
3533
  if ( stripos($_SERVER['REQUEST_URI'], 'widgets.php' ) !== false ) {
3534
+ wp_register_style('colorpicker', S2URL . 'include/colorpicker/css/colorpicker.css', '', '20090523'); // colorpicker css
3535
+ wp_register_script('colorpicker_js', S2URL . 'include/colorpicker/js/colorpicker' . $this->script_debug . '.js', array('jquery'), '20090523'); // colorpicker js
3536
+ wp_register_script('s2_colorpicker', S2URL . 'include/s2_colorpicker' . $this->script_debug . '.js', array('colorpicker_js'), '1.3'); //my js
3537
+ wp_enqueue_style('colorpicker');
3538
+ wp_enqueue_script('colorpicker_js');
3539
+ wp_enqueue_script('s2_colorpicker');
3540
  }
3541
  } // end widget_s2_counter_css_and_js()
3542
 
3574
  */
3575
  function add_minimeta() {
3576
  if ( $this->subscribe2_options['s2page'] != 0 ) {
3577
+ echo "<li><a href=\"" . get_permalink($this->subscribe2_options['s2page']) . "\">" . __('[Un]Subscribe to Posts', 'subscribe2') . "</a></li>\r\n";
3578
  }
3579
  } // end add_minimeta()
3580
 
3581
+ /**
3582
+ Add jQuery code and CSS to front pages for ajax form
3583
+ */
3584
+ function add_ajax() {
3585
+ // enqueue the jQuery script we need and let WordPress handle the dependencies
3586
+ wp_enqueue_script('jquery-ui-dialog');
3587
+ wp_register_style('jquery-ui-style', apply_filters('s2_jqueryui_css', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-darkness/jquery-ui.css'));
3588
+ wp_enqueue_style('jquery-ui-style');
3589
+ } // end add_ajax()
3590
+
3591
+ /**
3592
+ Write Subscribe2 form js code dynamically so we can pull WordPress functions
3593
+ */
3594
+ function add_s2_ajax() {
3595
+ echo "<script type=\"text/javascript\">\r\n";
3596
+ echo "//<![CDATA[\r\n";
3597
+ echo "jQuery(document).ready(function() {\r\n";
3598
+ echo " var dialog = jQuery('<div></div>')\r\n";
3599
+ echo " .html('" . do_shortcode('[subscribe2 nojs="true"]') . "')\r\n";
3600
+ if ( $this->s2form != $this->form && !is_user_logged_in() ) {
3601
+ echo " .dialog({modal: true, zIndex: 10000, title: '" . __('Subscribe to this blog', 'subscribe2') . "'});\r\n";
3602
+ } else {
3603
+ echo " .dialog({autoOpen: false, modal: true, zIndex: 10000, title: '" . __('Subscribe to this blog', 'subscribe2') . "'});\r\n";
3604
+ }
3605
+ echo " jQuery('a.s2popup').click(function(){\r\n";
3606
+ echo " dialog.dialog('open');\r\n";
3607
+ echo " return false;\r\n";
3608
+ echo " });\r\n";
3609
+ echo "});\r\n";
3610
+ echo "//]]>\r\n";
3611
+ echo "</script>\r\n";
3612
+ } // end add_s2_ajax()
3613
+
3614
  /* ===== Write Toolbar Button Functions ===== */
3615
  /**
3616
  Register our button in the QuickTags bar
3617
  */
3618
  function button_init() {
3619
+ global $pagenow;
3620
+ if ( !in_array($pagenow, array('post-new.php', 'post.php', 'page-new.php', 'page.php')) ) { return; }
3621
  if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) { return; }
3622
  if ( 'true' == get_user_option('rich_editing') ) {
3623
+ // Hook into the rich text editor
3624
  add_filter('mce_external_plugins', array(&$this, 'mce3_plugin'));
3625
  add_filter('mce_buttons', array(&$this, 'mce3_button'));
3626
  } else {
3627
+ wp_enqueue_script('subscribe2_button', S2URL . 'include/s2_button.js', array('quicktags') );
 
3628
  }
3629
  } // end button_init()
3630
 
3631
  /**
3632
+ Add buttons for Rich Text Editor
3633
  */
3634
  function mce3_plugin($arr) {
3635
  $path = S2URL . 'tinymce3/editor_plugin.js';
3642
  return $arr;
3643
  } // end mce3_button()
3644
 
 
 
 
 
 
 
 
 
 
 
 
 
3645
  /* ===== wp-cron functions ===== */
3646
  /**
3647
  Add a weekly event to cron
3748
  if ( $this->subscribe2_options['password'] == 'no' && $post->post_password != '' ) {
3749
  $check = true;
3750
  }
3751
+ // is the post assigned a format that should
3752
+ // not be included in the notification email?
3753
+ $post_format = get_post_format($post->ID);
3754
+ $excluded_formats = explode(',', $this->subscribe2_options['exclude_formats']);
3755
+ if ( $post_format !== false && in_array($post_format, $excluded_formats) ) {
3756
+ $check = true;
3757
+ }
3758
  // if this post is excluded
3759
  // don't include it in the digest
3760
  if ( $check ) {
3775
  $message_post .= "\r\n";
3776
  $message_posttime .= "\r\n";
3777
 
3778
+ $tablelinks .= "\r\n" . $this->get_tracking_link(get_permalink($post->ID)) . "\r\n";
3779
+ $message_post .= $this->get_tracking_link(get_permalink($post->ID)) . "\r\n";
3780
  $message_posttime .= __('Posted on', 'subscribe2') . ": " . mysql2date($datetime, $post->post_date) . "\r\n";
3781
+ $message_posttime .= $this->get_tracking_link(get_permalink($post->ID)) . "\r\n";
3782
  if ( strstr($mailtext, "{CATS}") ) {
3783
  $post_cat_names = implode(', ', wp_get_post_categories($post->ID, array('fields' => 'names')));
3784
  $message_post .= __('Posted in', 'subscribe2') . ": " . $post_cat_names . "\r\n";
3882
 
3883
  add_action('init', array(&$this, 'subscribe2'));
3884
  if ( '1' == $this->subscribe2_options['show_button'] ) {
3885
+ add_action('admin_init', array(&$this, 'button_init'));
3886
  }
3887
 
3888
  // add action to display widget if option is enabled
3905
  function subscribe2() {
3906
  global $wpdb, $table_prefix, $wp_version, $wpmu_version;
3907
 
3908
+ load_plugin_textdomain('subscribe2', false, S2DIR);
3909
 
3910
  // Is this WordPressMU or not?
3911
  $this->s2_mu = false;
3959
  add_action('wp_meta', array(&$this, 'add_minimeta'), 0);
3960
  }
3961
 
3962
+ // add actions for ajax form if enabled
3963
+ if ( '1' == $this->subscribe2_options['ajax'] ) {
3964
+ add_action('wp_enqueue_scripts', array(&$this, 'add_ajax'));
3965
+ add_action('wp_head', array(&$this, 'add_s2_ajax'));
3966
+ }
3967
+
3968
  // Add filters for Ozh Admin Menu
3969
  if ( function_exists('wp_ozh_adminmenu') ) {
3970
  add_filter('ozh_adminmenu_icon_s2_posts', array(&$this, 'ozh_s2_icon'));
3973
  add_filter('ozh_adminmenu_icon_s2_settings', array(&$this, 'ozh_s2_icon'));
3974
  }
3975
 
 
 
 
 
 
 
3976
  // add actions for automatic subscription based on option settings
3977
  add_action('register_form', array(&$this, 'register_form'));
3978
  add_action('user_register', array(&$this, 'register_post'));
4017
  var $subscribe2_options = array();
4018
  var $all_public = '';
4019
  var $all_unconfirmed = '';
4020
+ var $all_authors = '';
4021
  var $excluded_cats = '';
4022
  var $post_title = '';
4023
  var $permalink = '';
4024
+ var $post_date = '';
4025
+ var $post_time = '';
4026
  var $myname = '';
4027
  var $myemail = '';
4028
  var $signup_dates = array();
4037
 
4038
  // some messages
4039
  var $please_log_in = '';
4040
+ var $profile = '';
 
4041
  var $confirmation_sent = '';
4042
  var $already_subscribed = '';
4043
  var $not_subscribed ='';
subscribe2.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2011-09-08 20:28+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"
@@ -20,969 +20,997 @@ msgstr ""
20
  #: subscribe2.php:36
21
  #, php-format
22
  msgid ""
23
- "This version of Subscribe2 requires WordPress 2.8 or greater. Please update "
24
  "%1$s or use an older version of %2$s."
25
  msgstr ""
26
 
27
- #: subscribe2.php:43
28
- #, php-format
29
- msgid ""
30
- "This version of Subscribe2 requires WordPress Multisite 3.0 or greater. "
31
- "Please update %1$s or use an older version of %2$s."
32
- msgstr ""
33
-
34
- #: subscribe2.php:78
35
  msgid "To manage your subscription options please"
36
  msgstr ""
37
 
38
- #: subscribe2.php:78
39
  msgid "login"
40
  msgstr ""
41
 
42
- #: subscribe2.php:80 subscribe2.php:89
43
  msgid "You may manage your subscription options from your"
44
  msgstr ""
45
 
46
- #: subscribe2.php:80 subscribe2.php:89
47
  msgid "profile"
48
  msgstr ""
49
 
50
- #: subscribe2.php:85 subscribe2.php:94 subscribe2.php:1916 subscribe2.php:2015
51
- #: subscribe2.php:2839 subscribe2.php:3513 subscribe2.php:3516
52
- #: include/widget.php:96
53
  msgid "Subscribe"
54
  msgstr ""
55
 
56
- #: subscribe2.php:85 subscribe2.php:94
57
  msgid "to email notifications when this blog posts new content"
58
  msgstr ""
59
 
60
- #: subscribe2.php:98
61
  msgid "A confirmation message is on its way!"
62
  msgstr ""
63
 
64
- #: subscribe2.php:100
65
  msgid "That email address is already subscribed."
66
  msgstr ""
67
 
68
- #: subscribe2.php:102
69
  msgid "That email address is not subscribed."
70
  msgstr ""
71
 
72
- #: subscribe2.php:104
73
  msgid "Sorry, but that does not look like an email address to me."
74
  msgstr ""
75
 
76
- #: subscribe2.php:106
77
  msgid ""
78
  "Sorry, email addresses at that domain are currently barred due to spam, "
79
  "please use an alternative email address."
80
  msgstr ""
81
 
82
- #: subscribe2.php:108
83
  msgid ""
84
  "Sorry, there seems to be an error on the server. Please try again later."
85
  msgstr ""
86
 
87
- #: subscribe2.php:110
88
  msgid "You must to create a WordPress page for this plugin to work correctly."
89
  msgstr ""
90
 
91
- #: subscribe2.php:112
92
  msgid "Message sent!"
93
  msgstr ""
94
 
95
- #: subscribe2.php:114
96
  msgid ""
97
  "Message failed! Check your settings and check with your hosting provider"
98
  msgstr ""
99
 
100
- #: subscribe2.php:117
101
  msgid "No such email address is registered."
102
  msgstr ""
103
 
104
- #: subscribe2.php:119
105
  msgid "You have successfully subscribed!"
106
  msgstr ""
107
 
108
- #: subscribe2.php:121
109
  msgid "You have successfully unsubscribed."
110
  msgstr ""
111
 
112
- #: subscribe2.php:123
113
  msgid "subscribe"
114
  msgstr ""
115
 
116
- #: subscribe2.php:125
117
  msgid "unsubscribe"
118
  msgstr ""
119
 
120
- #: subscribe2.php:128
121
  msgid "Options saved!"
122
  msgstr ""
123
 
124
- #: subscribe2.php:129
125
  msgid "Options reset!"
126
  msgstr ""
127
 
128
- #: subscribe2.php:137
129
- msgid "Subscribers"
130
  msgstr ""
131
 
132
- #: subscribe2.php:140
133
- msgid "Subscribe2 Options"
134
  msgstr ""
135
 
136
- #: subscribe2.php:140 subscribe2.php:3716 include/widget.php:17
137
- msgid "Subscribe2"
138
  msgstr ""
139
 
140
- #: subscribe2.php:145
141
- msgid "Your Subscriptions"
142
  msgstr ""
143
 
144
- #: subscribe2.php:149
145
- msgid "Mail Subscribers"
146
  msgstr ""
147
 
148
- #: subscribe2.php:695
149
  msgid "Plain Text Excerpt Preview"
150
  msgstr ""
151
 
152
- #: subscribe2.php:697
153
  msgid "Plain Text Full Preview"
154
  msgstr ""
155
 
156
- #: subscribe2.php:699
157
  msgid "HTML Excerpt Preview"
158
  msgstr ""
159
 
160
- #: subscribe2.php:701
161
  msgid "HTML Full Preview"
162
  msgstr ""
163
 
164
- #: subscribe2.php:953
165
  msgid "New Subscription"
166
  msgstr ""
167
 
168
- #: subscribe2.php:955
169
  msgid "subscribed to email notifications!"
170
  msgstr ""
171
 
172
- #: subscribe2.php:991
173
  msgid "New Unsubscription"
174
  msgstr ""
175
 
176
- #: subscribe2.php:993
177
  msgid "unsubscribed from email notifications!"
178
  msgstr ""
179
 
180
- #: subscribe2.php:1724
181
  msgid "Address(es) subscribed!"
182
  msgstr ""
183
 
184
- #: subscribe2.php:1731
185
  msgid "Address(es) unsubscribed!"
186
  msgstr ""
187
 
188
- #: subscribe2.php:1735
189
  msgid "Some emails were not processed, the following were already subscribed"
190
  msgstr ""
191
 
192
- #: subscribe2.php:1738
193
  msgid "Some emails were not processed, the following were not in the database"
194
  msgstr ""
195
 
196
- #: subscribe2.php:1747
197
  msgid "Address(es) deleted!"
198
  msgstr ""
199
 
200
- #: subscribe2.php:1753 subscribe2.php:1759
201
  msgid "Status changed!"
202
  msgstr ""
203
 
204
- #: subscribe2.php:1773
205
  msgid "Reminder Email(s) Sent!"
206
  msgstr ""
207
 
208
- #: subscribe2.php:1776
209
  msgid "Registered Users Subscribed!"
210
  msgstr ""
211
 
212
- #: subscribe2.php:1779
213
  msgid "Registered Users Unsubscribed!"
214
  msgstr ""
215
 
216
- #: subscribe2.php:1782
217
  msgid "Format updated for Selected Registered Users!"
218
  msgstr ""
219
 
220
- #: subscribe2.php:1785
221
  msgid "Digest Subscription updated for Selected Registered Users!"
222
  msgstr ""
223
 
224
- #: subscribe2.php:1880
225
  msgid "Previous Page"
226
  msgstr ""
227
 
228
- #: subscribe2.php:1900
229
  msgid "Next Page"
230
  msgstr ""
231
 
232
- #: subscribe2.php:1907
233
  msgid "Manage Subscribers"
234
  msgstr ""
235
 
236
- #: subscribe2.php:1912
237
  msgid "Add/Remove Subscribers"
238
  msgstr ""
239
 
240
- #: subscribe2.php:1913
241
  msgid "Enter addresses, one per line or comma-separated"
242
  msgstr ""
243
 
244
- #: subscribe2.php:1917 subscribe2.php:2016 subscribe2.php:2818
245
- #: subscribe2.php:3511 subscribe2.php:3516 include/widget.php:96
246
  msgid "Unsubscribe"
247
  msgstr ""
248
 
249
- #: subscribe2.php:1920
250
  msgid "Current Subscribers"
251
  msgstr ""
252
 
253
- #: subscribe2.php:1922
254
  msgid "Filter"
255
  msgstr ""
256
 
257
- #: subscribe2.php:1928
258
  msgid "Search Subscribers"
259
  msgstr ""
260
 
261
- #: subscribe2.php:1931
262
  msgid "Send Reminder Email"
263
  msgstr ""
264
 
265
- #: subscribe2.php:1938
266
  msgid "Save Emails to CSV File"
267
  msgstr ""
268
 
269
- #: subscribe2.php:1944 subscribe2.php:2002
270
  msgid "Process"
271
  msgstr ""
272
 
273
- #: subscribe2.php:1957 subscribe2.php:1979
274
  msgid "Confirm this email address"
275
  msgstr ""
276
 
277
- #: subscribe2.php:1959 subscribe2.php:1972
278
  msgid "Unconfirm this email address"
279
  msgstr ""
280
 
281
- #: subscribe2.php:1961 subscribe2.php:1974 subscribe2.php:1982
282
  msgid "Delete this email address"
283
  msgstr ""
284
 
285
- #: subscribe2.php:1965 subscribe2.php:2983
 
286
  msgid "Select / Unselect All"
287
  msgstr ""
288
 
289
- #: subscribe2.php:1989
290
  msgid "edit"
291
  msgstr ""
292
 
293
- #: subscribe2.php:1996
294
  msgid "No matching subscribers found"
295
  msgstr ""
296
 
297
- #: subscribe2.php:1998
298
  msgid "NONE"
299
  msgstr ""
300
 
301
- #: subscribe2.php:2010
302
  msgid "Bulk Management"
303
  msgstr ""
304
 
305
- #: subscribe2.php:2012 subscribe2.php:2028
306
  msgid ""
307
  "Preferences for Registered Users selected in the filter above can be changed "
308
  "using this section."
309
  msgstr ""
310
 
311
- #: subscribe2.php:2013 subscribe2.php:2029
312
  msgid "Consider User Privacy as changes cannot be undone"
313
  msgstr ""
314
 
315
- #: subscribe2.php:2014
316
  msgid "Action to perform"
317
  msgstr ""
318
 
319
- #: subscribe2.php:2019
320
  msgid "Bulk Update Categories"
321
  msgstr ""
322
 
323
- #: subscribe2.php:2021
324
  msgid "Send email as"
325
  msgstr ""
326
 
327
- #: subscribe2.php:2022 subscribe2.php:2503 subscribe2.php:2689
328
  msgid "HTML - Full"
329
  msgstr ""
330
 
331
- #: subscribe2.php:2023 subscribe2.php:2508 subscribe2.php:2694
332
  msgid "HTML - Excerpt"
333
  msgstr ""
334
 
335
- #: subscribe2.php:2024 subscribe2.php:2513 subscribe2.php:2699
336
  msgid "Plain Text - Full"
337
  msgstr ""
338
 
339
- #: subscribe2.php:2025 subscribe2.php:2518 subscribe2.php:2704
340
  msgid "Plain Text - Excerpt"
341
  msgstr ""
342
 
343
- #: subscribe2.php:2026
344
  msgid "Bulk Update Format"
345
  msgstr ""
346
 
347
- #: subscribe2.php:2030
348
  msgid "Subscribe Selected Users to recieve a periodic digest notification"
349
  msgstr ""
350
 
351
- #: subscribe2.php:2032 subscribe2.php:2284 subscribe2.php:2296
352
- #: subscribe2.php:2307 subscribe2.php:2318 subscribe2.php:2481
353
- #: subscribe2.php:2492 subscribe2.php:2524 subscribe2.php:2540
354
- #: subscribe2.php:2712 subscribe2.php:2748
355
  msgid "Yes"
356
  msgstr ""
357
 
358
- #: subscribe2.php:2034 subscribe2.php:2289 subscribe2.php:2301
359
- #: subscribe2.php:2312 subscribe2.php:2323 subscribe2.php:2475
360
- #: subscribe2.php:2486 subscribe2.php:2497 subscribe2.php:2529
361
- #: subscribe2.php:2545 subscribe2.php:2566 subscribe2.php:2717
362
- #: subscribe2.php:2752
363
  msgid "No"
364
  msgstr ""
365
 
366
- #: subscribe2.php:2036
367
  msgid "Bulk Update Digest Subscription"
368
  msgstr ""
369
 
370
- #: subscribe2.php:2074
371
  msgid "Preview message(s) sent to logged in user"
372
  msgstr ""
373
 
374
- #: subscribe2.php:2078
375
  msgid ""
376
  "The Digest Notification email contained no post information. No email was "
377
  "sent"
378
  msgstr ""
379
 
380
- #: subscribe2.php:2080
381
  msgid "Attempt made to resend the Digest Notification email"
382
  msgstr ""
383
 
384
- #: subscribe2.php:2235
385
  msgid "Subscribe2 Settings"
386
  msgstr ""
387
 
388
- #: subscribe2.php:2236
389
  msgid "Plugin Blog"
390
  msgstr ""
391
 
392
- #: subscribe2.php:2237
393
  msgid "Make a donation via PayPal"
394
  msgstr ""
395
 
396
- #: subscribe2.php:2248 subscribe2.php:2672
397
  msgid "Notification Settings"
398
  msgstr ""
399
 
400
- #: subscribe2.php:2249
401
  msgid "Restrict the number of recipients per email to (0 for unlimited)"
402
  msgstr ""
403
 
404
- #: subscribe2.php:2251 subscribe2.php:2415
405
  msgid "Edit"
406
  msgstr ""
407
 
408
- #: subscribe2.php:2254 subscribe2.php:2418
409
  msgid "Update"
410
  msgstr ""
411
 
412
- #: subscribe2.php:2255 subscribe2.php:2419
413
  msgid "Revert"
414
  msgstr ""
415
 
416
- #: subscribe2.php:2257
417
  msgid "Send Admins notifications for new"
418
  msgstr ""
419
 
420
- #: subscribe2.php:2262
421
  msgid "Subscriptions"
422
  msgstr ""
423
 
424
- #: subscribe2.php:2267
425
  msgid "Unsubscriptions"
426
  msgstr ""
427
 
428
- #: subscribe2.php:2272
429
  msgid "Both"
430
  msgstr ""
431
 
432
- #: subscribe2.php:2277
433
  msgid "Neither"
434
  msgstr ""
435
 
436
- #: subscribe2.php:2279
437
  msgid "Include theme CSS stylesheet in HTML notifications"
438
  msgstr ""
439
 
440
- #: subscribe2.php:2291
441
  msgid "Send Emails for Pages"
442
  msgstr ""
443
 
444
- #: subscribe2.php:2302
 
 
 
 
 
445
  msgid "Send Emails for Password Protected Posts"
446
  msgstr ""
447
 
448
- #: subscribe2.php:2313
449
  msgid "Send Emails for Private Posts"
450
  msgstr ""
451
 
452
- #: subscribe2.php:2324
453
  msgid "Send Email From"
454
  msgstr ""
455
 
456
- #: subscribe2.php:2329
457
  msgid "Send Emails"
458
  msgstr ""
459
 
460
- #: subscribe2.php:2331
461
  msgid "For digest notifications, date order for posts is"
462
  msgstr ""
463
 
464
- #: subscribe2.php:2336
465
  msgid "Descending"
466
  msgstr ""
467
 
468
- #: subscribe2.php:2341
469
  msgid "Ascending"
470
  msgstr ""
471
 
472
- #: subscribe2.php:2345
 
 
 
 
 
 
 
 
473
  msgid "Email Templates"
474
  msgstr ""
475
 
476
- #: subscribe2.php:2349
477
  msgid "New Post email (must not be empty)"
478
  msgstr ""
479
 
480
- #: subscribe2.php:2350 subscribe2.php:2380 subscribe2.php:2385
481
  msgid "Subject Line"
482
  msgstr ""
483
 
484
- #: subscribe2.php:2355
485
  msgid "Send Email Preview"
486
  msgstr ""
487
 
488
- #: subscribe2.php:2356
489
  msgid "Message substitutions"
490
  msgstr ""
491
 
492
- #: subscribe2.php:2358
493
  msgid ""
494
  "IF THE FOLLOWING KEYWORDS ARE ALSO IN YOUR POST THEY WILL BE SUBSTITUTED"
495
  msgstr ""
496
 
497
- #: subscribe2.php:2361
498
  msgid "the post's title<br />(<i>for per-post emails only</i>)"
499
  msgstr ""
500
 
501
- #: subscribe2.php:2362
502
  msgid ""
503
  "the excerpt or the entire post<br />(<i>based on the subscriber's "
504
  "preferences</i>)"
505
  msgstr ""
506
 
507
- #: subscribe2.php:2363
508
  msgid ""
509
  "the excerpt of the post and the time it was posted<br />(<i>for digest "
510
  "emails only</i>)"
511
  msgstr ""
512
 
513
- #: subscribe2.php:2364
514
  msgid "a list of post titles<br />(<i>for digest emails only</i>)"
515
  msgstr ""
516
 
517
- #: subscribe2.php:2365
518
  msgid ""
519
  "a list of post titles followed by links to the atricles<br />(<i>for digest "
520
  "emails only</i>)"
521
  msgstr ""
522
 
523
- #: subscribe2.php:2366
524
  msgid "the post's permalink<br />(<i>for per-post emails only</i>)"
525
  msgstr ""
526
 
527
- #: subscribe2.php:2367
528
  msgid ""
529
  "the post's permalink after conversion by TinyURL<br />(<i>for per-post "
530
  "emails only</i>)"
531
  msgstr ""
532
 
533
- #: subscribe2.php:2368
534
  msgid "the date the post was made<br />(<i>for per-post emails only</i>)"
535
  msgstr ""
536
 
537
- #: subscribe2.php:2369
538
  msgid "the time the post was made<br />(<i>for per-post emails only</i>)"
539
  msgstr ""
540
 
541
- #: subscribe2.php:2370
542
  msgid "the admin or post author's name"
543
  msgstr ""
544
 
545
- #: subscribe2.php:2371
546
  msgid "the admin or post author's email"
547
  msgstr ""
548
 
549
- #: subscribe2.php:2372
550
  msgid "the post author's name"
551
  msgstr ""
552
 
553
- #: subscribe2.php:2373
554
  msgid ""
555
  "the generated link to confirm a request<br />(<i>only used in the "
556
  "confirmation email template</i>)"
557
  msgstr ""
558
 
559
- #: subscribe2.php:2374
560
  msgid ""
561
  "Action performed by LINK in confirmation email<br />(<i>only used in the "
562
  "confirmation email template</i>)"
563
  msgstr ""
564
 
565
- #: subscribe2.php:2375
566
  msgid "the post's assigned categories"
567
  msgstr ""
568
 
569
- #: subscribe2.php:2376
570
  msgid "the post's assigned Tags"
571
  msgstr ""
572
 
573
- #: subscribe2.php:2377
574
  msgid ""
575
  "the number of posts included in the digest email<br />(<i>for digest emails "
576
  "only</i>)"
577
  msgstr ""
578
 
579
- #: subscribe2.php:2379
580
  msgid "Subscribe / Unsubscribe confirmation email"
581
  msgstr ""
582
 
583
- #: subscribe2.php:2384
584
  msgid "Reminder email to Unconfirmed Subscribers"
585
  msgstr ""
586
 
587
- #: subscribe2.php:2391
588
  msgid "Excluded Categories"
589
  msgstr ""
590
 
591
- #: subscribe2.php:2393
592
  msgid ""
593
  "Posts assigned to any Excluded Category do not generate notifications and "
594
  "are not included in digest notifications"
595
  msgstr ""
596
 
597
- #: subscribe2.php:2400
598
  msgid "Allow registered users to subscribe to excluded categories?"
599
  msgstr ""
600
 
601
- #: subscribe2.php:2403
 
 
 
 
 
 
 
 
 
 
602
  msgid "Appearance"
603
  msgstr ""
604
 
605
- #: subscribe2.php:2407
606
  msgid "Set default Subscribe2 page as ID"
607
  msgstr ""
608
 
609
- #: subscribe2.php:2413
610
  msgid "Set the number of Subscribers displayed per page"
611
  msgstr ""
612
 
613
- #: subscribe2.php:2426
614
  msgid "Show a link to your subscription page in \"meta\"?"
615
  msgstr ""
616
 
617
- #: subscribe2.php:2433
618
  msgid "Show the Subscribe2 button on the Write toolbar?"
619
  msgstr ""
620
 
621
- #: subscribe2.php:2440
 
 
 
 
622
  msgid "Enable Subscribe2 Widget?"
623
  msgstr ""
624
 
625
- #: subscribe2.php:2447
626
  msgid "Enable Subscribe2 Counter Widget?"
627
  msgstr ""
628
 
629
- #: subscribe2.php:2454
630
  msgid "Disable email notifications is checked by default on authoring pages?"
631
  msgstr ""
632
 
633
- #: subscribe2.php:2458
634
  msgid "Auto Subscribe"
635
  msgstr ""
636
 
637
- #: subscribe2.php:2460
638
  msgid "Subscribe new users registering with your blog"
639
  msgstr ""
640
 
641
- #: subscribe2.php:2465
642
  msgid "Automatically"
643
  msgstr ""
644
 
645
- #: subscribe2.php:2470
646
  msgid "Display option on Registration Form"
647
  msgstr ""
648
 
649
- #: subscribe2.php:2476
650
  msgid "Auto-subscribe includes any excluded categories"
651
  msgstr ""
652
 
653
- #: subscribe2.php:2487
654
  msgid "Registration Form option is checked by default"
655
  msgstr ""
656
 
657
- #: subscribe2.php:2498
658
  msgid "Auto-subscribe users to receive email as"
659
  msgstr ""
660
 
661
- #: subscribe2.php:2519
662
  msgid "Registered Users have the option to auto-subscribe to new categories"
663
  msgstr ""
664
 
665
- #: subscribe2.php:2534
666
  msgid "New categories are immediately excluded"
667
  msgstr ""
668
 
669
- #: subscribe2.php:2535
670
  msgid ""
671
  "Option for Registered Users to auto-subscribe to new categories is checked "
672
  "by default"
673
  msgstr ""
674
 
675
- #: subscribe2.php:2549
676
  msgid "Display checkbox to allow subscriptions from the comment form"
677
  msgstr ""
678
 
679
- #: subscribe2.php:2555
680
  msgid "Before the Comment Submit button"
681
  msgstr ""
682
 
683
- #: subscribe2.php:2561
684
  msgid "After the Comment Submit button"
685
  msgstr ""
686
 
687
- #: subscribe2.php:2571
688
  msgid "Barred Domains"
689
  msgstr ""
690
 
691
- #: subscribe2.php:2573
692
  msgid ""
693
  "Enter domains to bar from public subscriptions: <br /> (Use a new line for "
694
  "each entry and omit the \"@\" symbol, for example email.com)"
695
  msgstr ""
696
 
697
- #: subscribe2.php:2578
698
  msgid "Submit"
699
  msgstr ""
700
 
701
- #: subscribe2.php:2581
702
  msgid "Reset Default"
703
  msgstr ""
704
 
705
- #: subscribe2.php:2582
706
  msgid ""
707
  "Use this to reset all options to their defaults. This <strong><em>will not</"
708
  "em></strong> modify your list of subscribers."
709
  msgstr ""
710
 
711
- #: subscribe2.php:2584
712
  msgid "RESET"
713
  msgstr ""
714
 
715
- #: subscribe2.php:2666
716
  msgid "Subscription preferences updated."
717
  msgstr ""
718
 
719
- #: subscribe2.php:2675
720
  msgid "Editing Subscribe2 preferences for user"
721
  msgstr ""
722
 
723
- #: subscribe2.php:2684
724
  msgid "Receive email as"
725
  msgstr ""
726
 
727
- #: subscribe2.php:2707
728
  msgid "Automatically subscribe me to newly created categories"
729
  msgstr ""
730
 
731
- #: subscribe2.php:2728
732
  msgid "Unsubscribe me from this blog"
733
  msgstr ""
734
 
735
- #: subscribe2.php:2732
736
  msgid "Subscribe to all categories"
737
  msgstr ""
738
 
739
- #: subscribe2.php:2734
740
  msgid "Subscribed Categories on"
741
  msgstr ""
742
 
743
- #: subscribe2.php:2736
744
  msgid "Subscribed Categories"
745
  msgstr ""
746
 
747
- #: subscribe2.php:2742
748
  msgid "Receive periodic summaries of new posts?"
749
  msgstr ""
750
 
751
- #: subscribe2.php:2757
 
 
 
 
752
  msgid "Update Preferences"
753
  msgstr ""
754
 
755
- #: subscribe2.php:2807
756
  msgid "Subscribed Blogs"
757
  msgstr ""
758
 
759
- #: subscribe2.php:2812 subscribe2.php:2833
760
  msgid "Viewing Settings Now"
761
  msgstr ""
762
 
763
- #: subscribe2.php:2816 subscribe2.php:2837
764
  msgid "View Settings"
765
  msgstr ""
766
 
767
- #: subscribe2.php:2828
768
  msgid "Subscribe to new blogs"
769
  msgstr ""
770
 
771
- #: subscribe2.php:2904
772
  msgid "Send an email to subscribers"
773
  msgstr ""
774
 
775
- #: subscribe2.php:2912
776
  msgid "A message from"
777
  msgstr ""
778
 
779
- #: subscribe2.php:2917
780
  msgid "Subject"
781
  msgstr ""
782
 
783
- #: subscribe2.php:2920
784
  msgid "Recipients:"
785
  msgstr ""
786
 
787
- #: subscribe2.php:2924
788
  msgid "Preview"
789
  msgstr ""
790
 
791
- #: subscribe2.php:2924
792
  msgid "Send"
793
  msgstr ""
794
 
795
- #: subscribe2.php:3028
796
  msgid "All Users and Subscribers"
797
  msgstr ""
798
 
799
- #: subscribe2.php:3029
800
  msgid "Public Subscribers"
801
  msgstr ""
802
 
803
- #: subscribe2.php:3030
804
  msgid "Confirmed"
805
  msgstr ""
806
 
807
- #: subscribe2.php:3031
808
  msgid "Unconfirmed"
809
  msgstr ""
810
 
811
- #: subscribe2.php:3032
812
  msgid "All Registered Users"
813
  msgstr ""
814
 
815
- #: subscribe2.php:3033
816
  msgid "Registered Subscribers"
817
  msgstr ""
818
 
819
- #: subscribe2.php:3155
 
 
 
 
820
  msgid "For each Post"
821
  msgstr ""
822
 
823
- #: subscribe2.php:3172
824
  msgid "Send Digest Notification at"
825
  msgstr ""
826
 
827
- #: subscribe2.php:3184
828
  msgid ""
829
  "This option will be ignored if the time selected is not in the future in "
830
  "relation to the current time"
831
  msgstr ""
832
 
833
- #: subscribe2.php:3187
834
  msgid "Current UTC time is"
835
  msgstr ""
836
 
837
- #: subscribe2.php:3189
838
  msgid "Current blog time is"
839
  msgstr ""
840
 
841
- #: subscribe2.php:3191
842
  msgid "Next email notification will be sent when your blog time is after"
843
  msgstr ""
844
 
845
- #: subscribe2.php:3194
846
  msgid "Attempt to resend the last Digest Notification email"
847
  msgstr ""
848
 
849
- #: subscribe2.php:3195
850
  msgid "Resend Digest"
851
  msgstr ""
852
 
853
- #: subscribe2.php:3273
854
  msgid "Confirmed Public Subscriber"
855
  msgstr ""
856
 
857
- #: subscribe2.php:3275
858
  msgid "Unconfirmed Public Subscriber"
859
  msgstr ""
860
 
861
- #: subscribe2.php:3329
862
- msgid "Settings"
863
- msgstr ""
864
-
865
- #: subscribe2.php:3330
866
  msgid "Donate"
867
  msgstr ""
868
 
869
- #: subscribe2.php:3342
870
  msgid "Check here to Subscribe to email notifications for new posts"
871
  msgstr ""
872
 
873
- #: subscribe2.php:3351
874
  msgid ""
875
  "By registering with this blog you are also agreeing to receive email "
876
  "notifications for new posts but you can unsubscribe at anytime"
877
  msgstr ""
878
 
879
- #: subscribe2.php:3402 subscribe2.php:3403
880
  msgid "Subscribe2 Notification Override"
881
  msgstr ""
882
 
883
- #: subscribe2.php:3413
884
  msgid ""
885
  "Check here to disable sending of an email notification for this post/page"
886
  msgstr ""
887
 
888
- #: subscribe2.php:3448
889
  msgid "Check here to Subscribe to notifications for new posts"
890
  msgstr ""
891
 
892
- #: subscribe2.php:3523
893
  msgid "Your email:"
894
  msgstr ""
895
 
896
- #: subscribe2.php:3523
897
  msgid "Enter email address..."
898
  msgstr ""
899
 
900
- #: subscribe2.php:3631
901
  msgid "Subscription Confirmation"
902
  msgstr ""
903
 
904
- #: subscribe2.php:3700
905
  msgid "[Un]Subscribe to Posts"
906
  msgstr ""
907
 
908
- #: subscribe2.php:3751
 
 
 
 
909
  msgid "Weekly"
910
  msgstr ""
911
 
912
- #: subscribe2.php:3865 subscribe2.php:3866
913
  msgid "Author"
914
  msgstr ""
915
 
916
- #: subscribe2.php:3874
917
  msgid "Posted on"
918
  msgstr ""
919
 
920
- #: subscribe2.php:3878 subscribe2.php:3879
921
  msgid "Posted in"
922
  msgstr ""
923
 
924
- #: subscribe2.php:3884 subscribe2.php:3885
925
  msgid "Tagged as"
926
  msgstr ""
927
 
928
- #: subscribe2.php:3946
929
  msgid "Digest Email"
930
  msgstr ""
931
 
932
- #: subscribe2.php:3956
933
  msgid "Digest Preview"
934
  msgstr ""
935
 
936
- #: include/options.php:110
937
  msgid ""
938
- "BLOGNAME has posted a new item, 'TITLE'\n"
939
  "\n"
940
- "POST\n"
941
  "\n"
942
  "You may view the latest post at\n"
943
- "PERMALINK\n"
944
  "\n"
945
  "You received this e-mail because you asked to be notified when new updates "
946
  "are posted.\n"
947
  "Best regards,\n"
948
- "MYNAME\n"
949
- "EMAIL"
950
  msgstr ""
951
 
952
- #: include/options.php:118
953
  msgid ""
954
- "BLOGNAME has received a request to ACTION for this email address. To "
955
  "complete your request please click on the link below:\n"
956
  "\n"
957
- "LINK\n"
958
  "\n"
959
  "If you did not request this, please feel free to disregard this notice!\n"
960
  "\n"
961
  "Thank you,\n"
962
- "MYNAME."
963
  msgstr ""
964
 
965
- #: include/options.php:122
966
  msgid "Please confirm your request"
967
  msgstr ""
968
 
969
- #: include/options.php:126
970
  msgid ""
971
- "This email address was subscribed for notifications at BLOGNAME (BLOGLINK) "
972
- "but the subscription remains incomplete.\n"
973
  "\n"
974
  "If you wish to complete your subscription please click on the link below:\n"
975
  "\n"
976
- "LINK\n"
977
  "\n"
978
  "If you do not wish to complete your subscription please ignore this email "
979
  "and your address will be removed from our database.\n"
980
  "\n"
981
  "Regards,\n"
982
- "MYNAME"
983
  msgstr ""
984
 
985
- #: include/options.php:130
986
  msgid "Subscription Reminder"
987
  msgstr ""
988
 
@@ -994,35 +1022,51 @@ msgstr ""
994
  msgid "Subscribe2 Widget"
995
  msgstr ""
996
 
997
- #: include/widget.php:87
 
 
 
 
998
  msgid "Title"
999
  msgstr ""
1000
 
1001
- #: include/widget.php:89
1002
  msgid "Div class name"
1003
  msgstr ""
1004
 
1005
- #: include/widget.php:91
1006
  msgid "Pre-Content"
1007
  msgstr ""
1008
 
1009
- #: include/widget.php:93
1010
  msgid "Post-Content"
1011
  msgstr ""
1012
 
1013
- #: include/widget.php:95
1014
- msgid "Hide button"
1015
  msgstr ""
1016
 
1017
- #: include/widget.php:96
1018
- msgid "None"
1019
  msgstr ""
1020
 
1021
- #: include/widget.php:98
1022
- msgid "Post form content to page"
1023
  msgstr ""
1024
 
1025
  #: include/widget.php:100
 
 
 
 
 
 
 
 
 
 
 
 
1026
  msgid "Use Subscribe2 Default"
1027
  msgstr ""
1028
 
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: \n"
11
+ "POT-Creation-Date: 2011-12-14 18:44+0000\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
20
  #: subscribe2.php:36
21
  #, php-format
22
  msgid ""
23
+ "This version of Subscribe2 requires WordPress 3.1 or greater. Please update "
24
  "%1$s or use an older version of %2$s."
25
  msgstr ""
26
 
27
+ #: subscribe2.php:66
 
 
 
 
 
 
 
28
  msgid "To manage your subscription options please"
29
  msgstr ""
30
 
31
+ #: subscribe2.php:66
32
  msgid "login"
33
  msgstr ""
34
 
35
+ #: subscribe2.php:68
36
  msgid "You may manage your subscription options from your"
37
  msgstr ""
38
 
39
+ #: subscribe2.php:68
40
  msgid "profile"
41
  msgstr ""
42
 
43
+ #: subscribe2.php:73 subscribe2.php:1807 subscribe2.php:1909
44
+ #: subscribe2.php:2647 subscribe2.php:3387 subscribe2.php:3390
 
45
  msgid "Subscribe"
46
  msgstr ""
47
 
48
+ #: subscribe2.php:73
49
  msgid "to email notifications when this blog posts new content"
50
  msgstr ""
51
 
52
+ #: subscribe2.php:77
53
  msgid "A confirmation message is on its way!"
54
  msgstr ""
55
 
56
+ #: subscribe2.php:79
57
  msgid "That email address is already subscribed."
58
  msgstr ""
59
 
60
+ #: subscribe2.php:81
61
  msgid "That email address is not subscribed."
62
  msgstr ""
63
 
64
+ #: subscribe2.php:83
65
  msgid "Sorry, but that does not look like an email address to me."
66
  msgstr ""
67
 
68
+ #: subscribe2.php:85
69
  msgid ""
70
  "Sorry, email addresses at that domain are currently barred due to spam, "
71
  "please use an alternative email address."
72
  msgstr ""
73
 
74
+ #: subscribe2.php:87
75
  msgid ""
76
  "Sorry, there seems to be an error on the server. Please try again later."
77
  msgstr ""
78
 
79
+ #: subscribe2.php:89
80
  msgid "You must to create a WordPress page for this plugin to work correctly."
81
  msgstr ""
82
 
83
+ #: subscribe2.php:91
84
  msgid "Message sent!"
85
  msgstr ""
86
 
87
+ #: subscribe2.php:93
88
  msgid ""
89
  "Message failed! Check your settings and check with your hosting provider"
90
  msgstr ""
91
 
92
+ #: subscribe2.php:96
93
  msgid "No such email address is registered."
94
  msgstr ""
95
 
96
+ #: subscribe2.php:98
97
  msgid "You have successfully subscribed!"
98
  msgstr ""
99
 
100
+ #: subscribe2.php:100
101
  msgid "You have successfully unsubscribed."
102
  msgstr ""
103
 
104
+ #: subscribe2.php:102
105
  msgid "subscribe"
106
  msgstr ""
107
 
108
+ #: subscribe2.php:104
109
  msgid "unsubscribe"
110
  msgstr ""
111
 
112
+ #: subscribe2.php:107
113
  msgid "Options saved!"
114
  msgstr ""
115
 
116
+ #: subscribe2.php:108
117
  msgid "Options reset!"
118
  msgstr ""
119
 
120
+ #: subscribe2.php:116 include/widget.php:17
121
+ msgid "Subscribe2"
122
  msgstr ""
123
 
124
+ #: subscribe2.php:118
125
+ msgid "Your Subscriptions"
126
  msgstr ""
127
 
128
+ #: subscribe2.php:122
129
+ msgid "Subscribers"
130
  msgstr ""
131
 
132
+ #: subscribe2.php:125 subscribe2.php:3198
133
+ msgid "Settings"
134
  msgstr ""
135
 
136
+ #: subscribe2.php:130
137
+ msgid "Send Email"
138
  msgstr ""
139
 
140
+ #: subscribe2.php:698
141
  msgid "Plain Text Excerpt Preview"
142
  msgstr ""
143
 
144
+ #: subscribe2.php:700
145
  msgid "Plain Text Full Preview"
146
  msgstr ""
147
 
148
+ #: subscribe2.php:702
149
  msgid "HTML Excerpt Preview"
150
  msgstr ""
151
 
152
+ #: subscribe2.php:704
153
  msgid "HTML Full Preview"
154
  msgstr ""
155
 
156
+ #: subscribe2.php:956
157
  msgid "New Subscription"
158
  msgstr ""
159
 
160
+ #: subscribe2.php:958
161
  msgid "subscribed to email notifications!"
162
  msgstr ""
163
 
164
+ #: subscribe2.php:982
165
  msgid "New Unsubscription"
166
  msgstr ""
167
 
168
+ #: subscribe2.php:984
169
  msgid "unsubscribed from email notifications!"
170
  msgstr ""
171
 
172
+ #: subscribe2.php:1615
173
  msgid "Address(es) subscribed!"
174
  msgstr ""
175
 
176
+ #: subscribe2.php:1622
177
  msgid "Address(es) unsubscribed!"
178
  msgstr ""
179
 
180
+ #: subscribe2.php:1626
181
  msgid "Some emails were not processed, the following were already subscribed"
182
  msgstr ""
183
 
184
+ #: subscribe2.php:1629
185
  msgid "Some emails were not processed, the following were not in the database"
186
  msgstr ""
187
 
188
+ #: subscribe2.php:1638
189
  msgid "Address(es) deleted!"
190
  msgstr ""
191
 
192
+ #: subscribe2.php:1644 subscribe2.php:1650
193
  msgid "Status changed!"
194
  msgstr ""
195
 
196
+ #: subscribe2.php:1664
197
  msgid "Reminder Email(s) Sent!"
198
  msgstr ""
199
 
200
+ #: subscribe2.php:1667
201
  msgid "Registered Users Subscribed!"
202
  msgstr ""
203
 
204
+ #: subscribe2.php:1670
205
  msgid "Registered Users Unsubscribed!"
206
  msgstr ""
207
 
208
+ #: subscribe2.php:1673
209
  msgid "Format updated for Selected Registered Users!"
210
  msgstr ""
211
 
212
+ #: subscribe2.php:1676
213
  msgid "Digest Subscription updated for Selected Registered Users!"
214
  msgstr ""
215
 
216
+ #: subscribe2.php:1771
217
  msgid "Previous Page"
218
  msgstr ""
219
 
220
+ #: subscribe2.php:1791
221
  msgid "Next Page"
222
  msgstr ""
223
 
224
+ #: subscribe2.php:1798
225
  msgid "Manage Subscribers"
226
  msgstr ""
227
 
228
+ #: subscribe2.php:1803
229
  msgid "Add/Remove Subscribers"
230
  msgstr ""
231
 
232
+ #: subscribe2.php:1804
233
  msgid "Enter addresses, one per line or comma-separated"
234
  msgstr ""
235
 
236
+ #: subscribe2.php:1808 subscribe2.php:1910 subscribe2.php:2626
237
+ #: subscribe2.php:3385 subscribe2.php:3390
238
  msgid "Unsubscribe"
239
  msgstr ""
240
 
241
+ #: subscribe2.php:1811
242
  msgid "Current Subscribers"
243
  msgstr ""
244
 
245
+ #: subscribe2.php:1813
246
  msgid "Filter"
247
  msgstr ""
248
 
249
+ #: subscribe2.php:1820
250
  msgid "Search Subscribers"
251
  msgstr ""
252
 
253
+ #: subscribe2.php:1823
254
  msgid "Send Reminder Email"
255
  msgstr ""
256
 
257
+ #: subscribe2.php:1830
258
  msgid "Save Emails to CSV File"
259
  msgstr ""
260
 
261
+ #: subscribe2.php:1837 subscribe2.php:1896
262
  msgid "Process"
263
  msgstr ""
264
 
265
+ #: subscribe2.php:1850 subscribe2.php:1872
266
  msgid "Confirm this email address"
267
  msgstr ""
268
 
269
+ #: subscribe2.php:1852 subscribe2.php:1865
270
  msgid "Unconfirm this email address"
271
  msgstr ""
272
 
273
+ #: subscribe2.php:1854 subscribe2.php:1867 subscribe2.php:1875
274
  msgid "Delete this email address"
275
  msgstr ""
276
 
277
+ #: subscribe2.php:1858 subscribe2.php:2791 subscribe2.php:2837
278
+ #: subscribe2.php:2877
279
  msgid "Select / Unselect All"
280
  msgstr ""
281
 
282
+ #: subscribe2.php:1883
283
  msgid "edit"
284
  msgstr ""
285
 
286
+ #: subscribe2.php:1890
287
  msgid "No matching subscribers found"
288
  msgstr ""
289
 
290
+ #: subscribe2.php:1892
291
  msgid "NONE"
292
  msgstr ""
293
 
294
+ #: subscribe2.php:1904
295
  msgid "Bulk Management"
296
  msgstr ""
297
 
298
+ #: subscribe2.php:1906 subscribe2.php:1922
299
  msgid ""
300
  "Preferences for Registered Users selected in the filter above can be changed "
301
  "using this section."
302
  msgstr ""
303
 
304
+ #: subscribe2.php:1907 subscribe2.php:1923
305
  msgid "Consider User Privacy as changes cannot be undone"
306
  msgstr ""
307
 
308
+ #: subscribe2.php:1908
309
  msgid "Action to perform"
310
  msgstr ""
311
 
312
+ #: subscribe2.php:1913
313
  msgid "Bulk Update Categories"
314
  msgstr ""
315
 
316
+ #: subscribe2.php:1915
317
  msgid "Send email as"
318
  msgstr ""
319
 
320
+ #: subscribe2.php:1916 subscribe2.php:2352 subscribe2.php:2507
321
  msgid "HTML - Full"
322
  msgstr ""
323
 
324
+ #: subscribe2.php:1917 subscribe2.php:2354 subscribe2.php:2509
325
  msgid "HTML - Excerpt"
326
  msgstr ""
327
 
328
+ #: subscribe2.php:1918 subscribe2.php:2356 subscribe2.php:2511
329
  msgid "Plain Text - Full"
330
  msgstr ""
331
 
332
+ #: subscribe2.php:1919 subscribe2.php:2358 subscribe2.php:2513
333
  msgid "Plain Text - Excerpt"
334
  msgstr ""
335
 
336
+ #: subscribe2.php:1920
337
  msgid "Bulk Update Format"
338
  msgstr ""
339
 
340
+ #: subscribe2.php:1924
341
  msgid "Subscribe Selected Users to recieve a periodic digest notification"
342
  msgstr ""
343
 
344
+ #: subscribe2.php:1926 subscribe2.php:2176 subscribe2.php:2182
345
+ #: subscribe2.php:2196 subscribe2.php:2201 subscribe2.php:2342
346
+ #: subscribe2.php:2347 subscribe2.php:2361 subscribe2.php:2368
347
+ #: subscribe2.php:2518 subscribe2.php:2551
348
  msgid "Yes"
349
  msgstr ""
350
 
351
+ #: subscribe2.php:1928 subscribe2.php:2178 subscribe2.php:2184
352
+ #: subscribe2.php:2198 subscribe2.php:2203 subscribe2.php:2339
353
+ #: subscribe2.php:2344 subscribe2.php:2349 subscribe2.php:2363
354
+ #: subscribe2.php:2370 subscribe2.php:2379 subscribe2.php:2520
355
+ #: subscribe2.php:2555
356
  msgid "No"
357
  msgstr ""
358
 
359
+ #: subscribe2.php:1930
360
  msgid "Bulk Update Digest Subscription"
361
  msgstr ""
362
 
363
+ #: subscribe2.php:1968
364
  msgid "Preview message(s) sent to logged in user"
365
  msgstr ""
366
 
367
+ #: subscribe2.php:1972
368
  msgid ""
369
  "The Digest Notification email contained no post information. No email was "
370
  "sent"
371
  msgstr ""
372
 
373
+ #: subscribe2.php:1974
374
  msgid "Attempt made to resend the Digest Notification email"
375
  msgstr ""
376
 
377
+ #: subscribe2.php:2142
378
  msgid "Subscribe2 Settings"
379
  msgstr ""
380
 
381
+ #: subscribe2.php:2143
382
  msgid "Plugin Blog"
383
  msgstr ""
384
 
385
+ #: subscribe2.php:2144
386
  msgid "Make a donation via PayPal"
387
  msgstr ""
388
 
389
+ #: subscribe2.php:2155 subscribe2.php:2493
390
  msgid "Notification Settings"
391
  msgstr ""
392
 
393
+ #: subscribe2.php:2156
394
  msgid "Restrict the number of recipients per email to (0 for unlimited)"
395
  msgstr ""
396
 
397
+ #: subscribe2.php:2158 subscribe2.php:2299
398
  msgid "Edit"
399
  msgstr ""
400
 
401
+ #: subscribe2.php:2161 subscribe2.php:2302
402
  msgid "Update"
403
  msgstr ""
404
 
405
+ #: subscribe2.php:2162 subscribe2.php:2303
406
  msgid "Revert"
407
  msgstr ""
408
 
409
+ #: subscribe2.php:2164
410
  msgid "Send Admins notifications for new"
411
  msgstr ""
412
 
413
+ #: subscribe2.php:2166
414
  msgid "Subscriptions"
415
  msgstr ""
416
 
417
+ #: subscribe2.php:2168
418
  msgid "Unsubscriptions"
419
  msgstr ""
420
 
421
+ #: subscribe2.php:2170
422
  msgid "Both"
423
  msgstr ""
424
 
425
+ #: subscribe2.php:2172
426
  msgid "Neither"
427
  msgstr ""
428
 
429
+ #: subscribe2.php:2174
430
  msgid "Include theme CSS stylesheet in HTML notifications"
431
  msgstr ""
432
 
433
+ #: subscribe2.php:2180
434
  msgid "Send Emails for Pages"
435
  msgstr ""
436
 
437
+ #: subscribe2.php:2188
438
+ msgid ""
439
+ "Subscribe2 will send email notifications for the following custom post types"
440
+ msgstr ""
441
+
442
+ #: subscribe2.php:2194
443
  msgid "Send Emails for Password Protected Posts"
444
  msgstr ""
445
 
446
+ #: subscribe2.php:2199
447
  msgid "Send Emails for Private Posts"
448
  msgstr ""
449
 
450
+ #: subscribe2.php:2204
451
  msgid "Send Email From"
452
  msgstr ""
453
 
454
+ #: subscribe2.php:2209
455
  msgid "Send Emails"
456
  msgstr ""
457
 
458
+ #: subscribe2.php:2211
459
  msgid "For digest notifications, date order for posts is"
460
  msgstr ""
461
 
462
+ #: subscribe2.php:2213
463
  msgid "Descending"
464
  msgstr ""
465
 
466
+ #: subscribe2.php:2215
467
  msgid "Ascending"
468
  msgstr ""
469
 
470
+ #: subscribe2.php:2217
471
+ msgid "Add Tracking Parameters to the Permalink"
472
+ msgstr ""
473
+
474
+ #: subscribe2.php:2219
475
+ msgid "eg. utm_source=subscribe2&utm_medium=email&utm_campaign=postnotify"
476
+ msgstr ""
477
+
478
+ #: subscribe2.php:2222
479
  msgid "Email Templates"
480
  msgstr ""
481
 
482
+ #: subscribe2.php:2226
483
  msgid "New Post email (must not be empty)"
484
  msgstr ""
485
 
486
+ #: subscribe2.php:2227 subscribe2.php:2257 subscribe2.php:2262
487
  msgid "Subject Line"
488
  msgstr ""
489
 
490
+ #: subscribe2.php:2232
491
  msgid "Send Email Preview"
492
  msgstr ""
493
 
494
+ #: subscribe2.php:2233
495
  msgid "Message substitutions"
496
  msgstr ""
497
 
498
+ #: subscribe2.php:2235
499
  msgid ""
500
  "IF THE FOLLOWING KEYWORDS ARE ALSO IN YOUR POST THEY WILL BE SUBSTITUTED"
501
  msgstr ""
502
 
503
+ #: subscribe2.php:2238
504
  msgid "the post's title<br />(<i>for per-post emails only</i>)"
505
  msgstr ""
506
 
507
+ #: subscribe2.php:2239
508
  msgid ""
509
  "the excerpt or the entire post<br />(<i>based on the subscriber's "
510
  "preferences</i>)"
511
  msgstr ""
512
 
513
+ #: subscribe2.php:2240
514
  msgid ""
515
  "the excerpt of the post and the time it was posted<br />(<i>for digest "
516
  "emails only</i>)"
517
  msgstr ""
518
 
519
+ #: subscribe2.php:2241
520
  msgid "a list of post titles<br />(<i>for digest emails only</i>)"
521
  msgstr ""
522
 
523
+ #: subscribe2.php:2242
524
  msgid ""
525
  "a list of post titles followed by links to the atricles<br />(<i>for digest "
526
  "emails only</i>)"
527
  msgstr ""
528
 
529
+ #: subscribe2.php:2243
530
  msgid "the post's permalink<br />(<i>for per-post emails only</i>)"
531
  msgstr ""
532
 
533
+ #: subscribe2.php:2244
534
  msgid ""
535
  "the post's permalink after conversion by TinyURL<br />(<i>for per-post "
536
  "emails only</i>)"
537
  msgstr ""
538
 
539
+ #: subscribe2.php:2245
540
  msgid "the date the post was made<br />(<i>for per-post emails only</i>)"
541
  msgstr ""
542
 
543
+ #: subscribe2.php:2246
544
  msgid "the time the post was made<br />(<i>for per-post emails only</i>)"
545
  msgstr ""
546
 
547
+ #: subscribe2.php:2247
548
  msgid "the admin or post author's name"
549
  msgstr ""
550
 
551
+ #: subscribe2.php:2248
552
  msgid "the admin or post author's email"
553
  msgstr ""
554
 
555
+ #: subscribe2.php:2249
556
  msgid "the post author's name"
557
  msgstr ""
558
 
559
+ #: subscribe2.php:2250
560
  msgid ""
561
  "the generated link to confirm a request<br />(<i>only used in the "
562
  "confirmation email template</i>)"
563
  msgstr ""
564
 
565
+ #: subscribe2.php:2251
566
  msgid ""
567
  "Action performed by LINK in confirmation email<br />(<i>only used in the "
568
  "confirmation email template</i>)"
569
  msgstr ""
570
 
571
+ #: subscribe2.php:2252
572
  msgid "the post's assigned categories"
573
  msgstr ""
574
 
575
+ #: subscribe2.php:2253
576
  msgid "the post's assigned Tags"
577
  msgstr ""
578
 
579
+ #: subscribe2.php:2254
580
  msgid ""
581
  "the number of posts included in the digest email<br />(<i>for digest emails "
582
  "only</i>)"
583
  msgstr ""
584
 
585
+ #: subscribe2.php:2256
586
  msgid "Subscribe / Unsubscribe confirmation email"
587
  msgstr ""
588
 
589
+ #: subscribe2.php:2261
590
  msgid "Reminder email to Unconfirmed Subscribers"
591
  msgstr ""
592
 
593
+ #: subscribe2.php:2268
594
  msgid "Excluded Categories"
595
  msgstr ""
596
 
597
+ #: subscribe2.php:2270
598
  msgid ""
599
  "Posts assigned to any Excluded Category do not generate notifications and "
600
  "are not included in digest notifications"
601
  msgstr ""
602
 
603
+ #: subscribe2.php:2274
604
  msgid "Allow registered users to subscribe to excluded categories?"
605
  msgstr ""
606
 
607
+ #: subscribe2.php:2279
608
+ msgid "Excluded Formats"
609
+ msgstr ""
610
+
611
+ #: subscribe2.php:2281
612
+ msgid ""
613
+ "Posts assigned to any Excluded Format do not generate notifications and are "
614
+ "not included in digest notifications"
615
+ msgstr ""
616
+
617
+ #: subscribe2.php:2287
618
  msgid "Appearance"
619
  msgstr ""
620
 
621
+ #: subscribe2.php:2291
622
  msgid "Set default Subscribe2 page as ID"
623
  msgstr ""
624
 
625
+ #: subscribe2.php:2297
626
  msgid "Set the number of Subscribers displayed per page"
627
  msgstr ""
628
 
629
+ #: subscribe2.php:2307
630
  msgid "Show a link to your subscription page in \"meta\"?"
631
  msgstr ""
632
 
633
+ #: subscribe2.php:2311
634
  msgid "Show the Subscribe2 button on the Write toolbar?"
635
  msgstr ""
636
 
637
+ #: subscribe2.php:2315
638
+ msgid "Enable AJAX style subscription form?"
639
+ msgstr ""
640
+
641
+ #: subscribe2.php:2319
642
  msgid "Enable Subscribe2 Widget?"
643
  msgstr ""
644
 
645
+ #: subscribe2.php:2323
646
  msgid "Enable Subscribe2 Counter Widget?"
647
  msgstr ""
648
 
649
+ #: subscribe2.php:2327
650
  msgid "Disable email notifications is checked by default on authoring pages?"
651
  msgstr ""
652
 
653
+ #: subscribe2.php:2331
654
  msgid "Auto Subscribe"
655
  msgstr ""
656
 
657
+ #: subscribe2.php:2333
658
  msgid "Subscribe new users registering with your blog"
659
  msgstr ""
660
 
661
+ #: subscribe2.php:2335
662
  msgid "Automatically"
663
  msgstr ""
664
 
665
+ #: subscribe2.php:2337
666
  msgid "Display option on Registration Form"
667
  msgstr ""
668
 
669
+ #: subscribe2.php:2340
670
  msgid "Auto-subscribe includes any excluded categories"
671
  msgstr ""
672
 
673
+ #: subscribe2.php:2345
674
  msgid "Registration Form option is checked by default"
675
  msgstr ""
676
 
677
+ #: subscribe2.php:2350
678
  msgid "Auto-subscribe users to receive email as"
679
  msgstr ""
680
 
681
+ #: subscribe2.php:2359
682
  msgid "Registered Users have the option to auto-subscribe to new categories"
683
  msgstr ""
684
 
685
+ #: subscribe2.php:2365
686
  msgid "New categories are immediately excluded"
687
  msgstr ""
688
 
689
+ #: subscribe2.php:2366
690
  msgid ""
691
  "Option for Registered Users to auto-subscribe to new categories is checked "
692
  "by default"
693
  msgstr ""
694
 
695
+ #: subscribe2.php:2371
696
  msgid "Display checkbox to allow subscriptions from the comment form"
697
  msgstr ""
698
 
699
+ #: subscribe2.php:2374
700
  msgid "Before the Comment Submit button"
701
  msgstr ""
702
 
703
+ #: subscribe2.php:2377
704
  msgid "After the Comment Submit button"
705
  msgstr ""
706
 
707
+ #: subscribe2.php:2383
708
  msgid "Barred Domains"
709
  msgstr ""
710
 
711
+ #: subscribe2.php:2385
712
  msgid ""
713
  "Enter domains to bar from public subscriptions: <br /> (Use a new line for "
714
  "each entry and omit the \"@\" symbol, for example email.com)"
715
  msgstr ""
716
 
717
+ #: subscribe2.php:2390
718
  msgid "Submit"
719
  msgstr ""
720
 
721
+ #: subscribe2.php:2393
722
  msgid "Reset Default"
723
  msgstr ""
724
 
725
+ #: subscribe2.php:2394
726
  msgid ""
727
  "Use this to reset all options to their defaults. This <strong><em>will not</"
728
  "em></strong> modify your list of subscribers."
729
  msgstr ""
730
 
731
+ #: subscribe2.php:2396
732
  msgid "RESET"
733
  msgstr ""
734
 
735
+ #: subscribe2.php:2487
736
  msgid "Subscription preferences updated."
737
  msgstr ""
738
 
739
+ #: subscribe2.php:2496
740
  msgid "Editing Subscribe2 preferences for user"
741
  msgstr ""
742
 
743
+ #: subscribe2.php:2505
744
  msgid "Receive email as"
745
  msgstr ""
746
 
747
+ #: subscribe2.php:2516
748
  msgid "Automatically subscribe me to newly created categories"
749
  msgstr ""
750
 
751
+ #: subscribe2.php:2531
752
  msgid "Unsubscribe me from this blog"
753
  msgstr ""
754
 
755
+ #: subscribe2.php:2535
756
  msgid "Subscribe to all categories"
757
  msgstr ""
758
 
759
+ #: subscribe2.php:2537
760
  msgid "Subscribed Categories on"
761
  msgstr ""
762
 
763
+ #: subscribe2.php:2539
764
  msgid "Subscribed Categories"
765
  msgstr ""
766
 
767
+ #: subscribe2.php:2545
768
  msgid "Receive periodic summaries of new posts?"
769
  msgstr ""
770
 
771
+ #: subscribe2.php:2560
772
+ msgid "Do not send notifications for post made by these authors"
773
+ msgstr ""
774
+
775
+ #: subscribe2.php:2565
776
  msgid "Update Preferences"
777
  msgstr ""
778
 
779
+ #: subscribe2.php:2615
780
  msgid "Subscribed Blogs"
781
  msgstr ""
782
 
783
+ #: subscribe2.php:2620 subscribe2.php:2641
784
  msgid "Viewing Settings Now"
785
  msgstr ""
786
 
787
+ #: subscribe2.php:2624 subscribe2.php:2645
788
  msgid "View Settings"
789
  msgstr ""
790
 
791
+ #: subscribe2.php:2636
792
  msgid "Subscribe to new blogs"
793
  msgstr ""
794
 
795
+ #: subscribe2.php:2712
796
  msgid "Send an email to subscribers"
797
  msgstr ""
798
 
799
+ #: subscribe2.php:2720
800
  msgid "A message from"
801
  msgstr ""
802
 
803
+ #: subscribe2.php:2725
804
  msgid "Subject"
805
  msgstr ""
806
 
807
+ #: subscribe2.php:2728
808
  msgid "Recipients:"
809
  msgstr ""
810
 
811
+ #: subscribe2.php:2732
812
  msgid "Preview"
813
  msgstr ""
814
 
815
+ #: subscribe2.php:2732
816
  msgid "Send"
817
  msgstr ""
818
 
819
+ #: subscribe2.php:2912
820
  msgid "All Users and Subscribers"
821
  msgstr ""
822
 
823
+ #: subscribe2.php:2913
824
  msgid "Public Subscribers"
825
  msgstr ""
826
 
827
+ #: subscribe2.php:2914
828
  msgid "Confirmed"
829
  msgstr ""
830
 
831
+ #: subscribe2.php:2915
832
  msgid "Unconfirmed"
833
  msgstr ""
834
 
835
+ #: subscribe2.php:2916
836
  msgid "All Registered Users"
837
  msgstr ""
838
 
839
+ #: subscribe2.php:2917
840
  msgid "Registered Subscribers"
841
  msgstr ""
842
 
843
+ #: subscribe2.php:3002
844
+ msgid "Post Author"
845
+ msgstr ""
846
+
847
+ #: subscribe2.php:3026
848
  msgid "For each Post"
849
  msgstr ""
850
 
851
+ #: subscribe2.php:3040
852
  msgid "Send Digest Notification at"
853
  msgstr ""
854
 
855
+ #: subscribe2.php:3052
856
  msgid ""
857
  "This option will be ignored if the time selected is not in the future in "
858
  "relation to the current time"
859
  msgstr ""
860
 
861
+ #: subscribe2.php:3055
862
  msgid "Current UTC time is"
863
  msgstr ""
864
 
865
+ #: subscribe2.php:3057
866
  msgid "Current blog time is"
867
  msgstr ""
868
 
869
+ #: subscribe2.php:3059
870
  msgid "Next email notification will be sent when your blog time is after"
871
  msgstr ""
872
 
873
+ #: subscribe2.php:3062
874
  msgid "Attempt to resend the last Digest Notification email"
875
  msgstr ""
876
 
877
+ #: subscribe2.php:3063
878
  msgid "Resend Digest"
879
  msgstr ""
880
 
881
+ #: subscribe2.php:3141
882
  msgid "Confirmed Public Subscriber"
883
  msgstr ""
884
 
885
+ #: subscribe2.php:3143
886
  msgid "Unconfirmed Public Subscriber"
887
  msgstr ""
888
 
889
+ #: subscribe2.php:3199
 
 
 
 
890
  msgid "Donate"
891
  msgstr ""
892
 
893
+ #: subscribe2.php:3211
894
  msgid "Check here to Subscribe to email notifications for new posts"
895
  msgstr ""
896
 
897
+ #: subscribe2.php:3217
898
  msgid ""
899
  "By registering with this blog you are also agreeing to receive email "
900
  "notifications for new posts but you can unsubscribe at anytime"
901
  msgstr ""
902
 
903
+ #: subscribe2.php:3268 subscribe2.php:3269
904
  msgid "Subscribe2 Notification Override"
905
  msgstr ""
906
 
907
+ #: subscribe2.php:3279
908
  msgid ""
909
  "Check here to disable sending of an email notification for this post/page"
910
  msgstr ""
911
 
912
+ #: subscribe2.php:3314
913
  msgid "Check here to Subscribe to notifications for new posts"
914
  msgstr ""
915
 
916
+ #: subscribe2.php:3398 subscribe2.php:3400
917
  msgid "Your email:"
918
  msgstr ""
919
 
920
+ #: subscribe2.php:3400
921
  msgid "Enter email address..."
922
  msgstr ""
923
 
924
+ #: subscribe2.php:3505
925
  msgid "Subscription Confirmation"
926
  msgstr ""
927
 
928
+ #: subscribe2.php:3577
929
  msgid "[Un]Subscribe to Posts"
930
  msgstr ""
931
 
932
+ #: subscribe2.php:3601 subscribe2.php:3603
933
+ msgid "Subscribe to this blog"
934
+ msgstr ""
935
+
936
+ #: subscribe2.php:3650
937
  msgid "Weekly"
938
  msgstr ""
939
 
940
+ #: subscribe2.php:3771 subscribe2.php:3772
941
  msgid "Author"
942
  msgstr ""
943
 
944
+ #: subscribe2.php:3780
945
  msgid "Posted on"
946
  msgstr ""
947
 
948
+ #: subscribe2.php:3784 subscribe2.php:3785
949
  msgid "Posted in"
950
  msgstr ""
951
 
952
+ #: subscribe2.php:3790 subscribe2.php:3791
953
  msgid "Tagged as"
954
  msgstr ""
955
 
956
+ #: subscribe2.php:3852
957
  msgid "Digest Email"
958
  msgstr ""
959
 
960
+ #: subscribe2.php:3862
961
  msgid "Digest Preview"
962
  msgstr ""
963
 
964
+ #: include/options.php:122
965
  msgid ""
966
+ "{BLOGNAME} has posted a new item, '{TITLE}'\n"
967
  "\n"
968
+ "{POST}\n"
969
  "\n"
970
  "You may view the latest post at\n"
971
+ "{PERMALINK}\n"
972
  "\n"
973
  "You received this e-mail because you asked to be notified when new updates "
974
  "are posted.\n"
975
  "Best regards,\n"
976
+ "{MYNAME}\n"
977
+ "{EMAIL}"
978
  msgstr ""
979
 
980
+ #: include/options.php:130
981
  msgid ""
982
+ "{BLOGNAME} has received a request to {ACTION} for this email address. To "
983
  "complete your request please click on the link below:\n"
984
  "\n"
985
+ "{LINK}\n"
986
  "\n"
987
  "If you did not request this, please feel free to disregard this notice!\n"
988
  "\n"
989
  "Thank you,\n"
990
+ "{MYNAME}."
991
  msgstr ""
992
 
993
+ #: include/options.php:134
994
  msgid "Please confirm your request"
995
  msgstr ""
996
 
997
+ #: include/options.php:138
998
  msgid ""
999
+ "This email address was subscribed for notifications at {BLOGNAME} "
1000
+ "({BLOGLINK}) but the subscription remains incomplete.\n"
1001
  "\n"
1002
  "If you wish to complete your subscription please click on the link below:\n"
1003
  "\n"
1004
+ "{LINK}\n"
1005
  "\n"
1006
  "If you do not wish to complete your subscription please ignore this email "
1007
  "and your address will be removed from our database.\n"
1008
  "\n"
1009
  "Regards,\n"
1010
+ "{MYNAME}"
1011
  msgstr ""
1012
 
1013
+ #: include/options.php:142
1014
  msgid "Subscription Reminder"
1015
  msgstr ""
1016
 
1022
  msgid "Subscribe2 Widget"
1023
  msgstr ""
1024
 
1025
+ #: include/widget.php:27
1026
+ msgid "(Un)Subscribe to Posts"
1027
+ msgstr ""
1028
+
1029
+ #: include/widget.php:91
1030
  msgid "Title"
1031
  msgstr ""
1032
 
1033
+ #: include/widget.php:93
1034
  msgid "Div class name"
1035
  msgstr ""
1036
 
1037
+ #: include/widget.php:95
1038
  msgid "Pre-Content"
1039
  msgstr ""
1040
 
1041
+ #: include/widget.php:97
1042
  msgid "Post-Content"
1043
  msgstr ""
1044
 
1045
+ #: include/widget.php:99
1046
+ msgid "Display options"
1047
  msgstr ""
1048
 
1049
+ #: include/widget.php:100
1050
+ msgid "Show complete form"
1051
  msgstr ""
1052
 
1053
+ #: include/widget.php:100
1054
+ msgid "Hide Subscribe button"
1055
  msgstr ""
1056
 
1057
  #: include/widget.php:100
1058
+ msgid "Hide Unsubscribe button"
1059
+ msgstr ""
1060
+
1061
+ #: include/widget.php:102
1062
+ msgid "Show as link"
1063
+ msgstr ""
1064
+
1065
+ #: include/widget.php:106
1066
+ msgid "Post form content to page"
1067
+ msgstr ""
1068
+
1069
+ #: include/widget.php:108
1070
  msgid "Use Subscribe2 Default"
1071
  msgstr ""
1072
 
tinymce3/editor_plugin.js CHANGED
@@ -1 +1 @@
1
- (function(){tinymce.create('tinymce.plugins.Subscribe2Plugin',{init:function(ed,url){var pb='<img src="'+url+'/../../include/trans.gif" class="mceSubscribe2 mceItemNoResize" />',cls='mceSubscribe2',sep=ed.getParam('subscribe2_separator','<!--subscribe2-->'),pbRE;pbRE=new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return'\\'+a}),'g');ed.addCommand('mceSubscribe2',function(){ed.execCommand('mceInsertContent',0,pb)});ed.addButton('subscribe2',{title:'Insert Subscribe2 Token',image:url+'/../include/s2_button.png',cmd:cls});ed.onInit.add(function(){ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.node.nodeName=='IMG'&&ed.dom.hasClass(o.node,cls))o.name='subscribe2'})}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='IMG'&&ed.dom.hasClass(e,cls))ed.selection.select(e)});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('subscribe2',n.nodeName==='IMG'&&ed.dom.hasClass(n,cls))});ed.onBeforeSetContent.add(function(ed,o){o.content=o.content.replace(pbRE,pb)});ed.onPostProcess.add(function(ed,o){if(o.get)o.content=o.content.replace(/<img[^>]+>/g,function(im){if(im.indexOf('class="mceSubscribe2')!==-1)im=sep;return im})})},getInfo:function(){return{longname:'Insert Subscribe2 Token',author:'Matthew Robinson',authorurl:'http://subscribe2.wordpress.com',infourl:'http://subscribe2.wordpress.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add('subscribe2',tinymce.plugins.Subscribe2Plugin)})();
1
+ (function(){tinymce.create('tinymce.plugins.Subscribe2Plugin',{init:function(ed,url){var pb='<img src="'+url+'/../../include/trans.gif" class="mceSubscribe2 mceItemNoResize" />',cls='mceSubscribe2',sep=ed.getParam('subscribe2_separator','[subscribe2]'),pbRE;pbRE=new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return'\\'+a}),'g');ed.addCommand('mceSubscribe2',function(){ed.execCommand('mceInsertContent',0,pb)});ed.addButton('subscribe2',{title:'Insert Subscribe2 Token',image:url+'/../include/s2_button.png',cmd:cls});ed.onInit.add(function(){ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.node.nodeName=='IMG'&&ed.dom.hasClass(o.node,cls))o.name='subscribe2'})}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='IMG'&&ed.dom.hasClass(e,cls))ed.selection.select(e)});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('subscribe2',n.nodeName==='IMG'&&ed.dom.hasClass(n,cls))});ed.onBeforeSetContent.add(function(ed,o){o.content=o.content.replace(pbRE,pb)});ed.onPostProcess.add(function(ed,o){if(o.get)o.content=o.content.replace(/<img[^>]+>/g,function(im){if(im.indexOf('class="mceSubscribe2')!==-1)im=sep;return im})})},getInfo:function(){return{longname:'Insert Subscribe2 Token',author:'Matthew Robinson',authorurl:'http://subscribe2.wordpress.com',infourl:'http://subscribe2.wordpress.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add('subscribe2',tinymce.plugins.Subscribe2Plugin)})();
tinymce3/editor_plugin_src.js CHANGED
@@ -3,7 +3,7 @@
3
  init : function(ed, url) {
4
  var pb = '<img src="' + url + '/../../include/trans.gif" class="mceSubscribe2 mceItemNoResize" />',
5
  cls = 'mceSubscribe2',
6
- sep = ed.getParam('subscribe2_separator', '<!--subscribe2-->'),
7
  pbRE;
8
 
9
  pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {
3
  init : function(ed, url) {
4
  var pb = '<img src="' + url + '/../../include/trans.gif" class="mceSubscribe2 mceItemNoResize" />',
5
  cls = 'mceSubscribe2',
6
+ sep = ed.getParam('subscribe2_separator', '[subscribe2]'),
7
  pbRE;
8
 
9
  pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {