Version Description
Download this release
Release Info
Developer | MattyRob |
Plugin | Subscribe2 |
Version | 6.1 |
Comparing to | |
See all releases |
Code changes from version 6.0 to 6.1
- ReadMe.txt +32 -6
- include/widget.php +42 -16
- subscribe2.php +3737 -3701
- subscribe2.pot +227 -210
ReadMe.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_butt
|
|
4 |
Tags: posts, subscription, email, subscribe, notify, notification
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.0.1
|
7 |
-
Stable tag: 6.
|
8 |
|
9 |
Sends a list of subscribers an email notification when new posts are published to your blog
|
10 |
|
@@ -32,8 +32,8 @@ If you want to send HTML emails to Public Subscribers too then upgrade to [Subsc
|
|
32 |
4. Configure the options to taste, including the email template and any categories which should be excluded from notification
|
33 |
5. Click the "Tools" admin menu link, and select "Subscribers".
|
34 |
6. Manually subscribe people as you see fit.
|
35 |
-
7. Create a [WordPress Page](http://codex.wordpress.org/Pages) to display the subscription form. When creating the page, you may click the "S2" button on the QuickBar to automatically insert the subscribe2 token. Or, if you prefer, you may manually insert the subscribe2 token:
|
36 |
-
<!--subscribe2-->
|
37 |
***Ensure the token is on a line by itself and that it has a blank line above and below.***
|
38 |
This token will automatically be replaced by 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.
|
@@ -115,9 +115,25 @@ The simple answer is yes you can but this is not supported so you need to figure
|
|
115 |
|
116 |
Get them to register with your blog rather than using the Subscribe2 form. Additional fields would require much more intensive form processing, checking and entry into the database and since you won't then be able to easily use this information to persoanlise emails there really isn't any point in collecting this data.
|
117 |
|
118 |
-
=
|
119 |
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
= My digest email didn't send, how can I resend it? =
|
123 |
|
@@ -144,7 +160,7 @@ WordPress 2.0.x requires Subscribe2 from the 2.x stable branch. The most recent
|
|
144 |
= Why doesn't the form appear in my WordPress page? =
|
145 |
This is usually caused by one of two things. Firstly, it is possible that the form is there but because you haven't logged out of WordPress yourself you are seeing a message about managing your profile instead. Log out of WordPress and it will appear as the subscription form you are probably expecting.
|
146 |
|
147 |
-
Secondly, make sure that the token (<!--subscribe2-->) is correctly entered in your page with a blank line above and below. The easient way to do this is to deactivate the plugin, visit your WordPress page and view the source. The token should be contained in the source code of the page. If it is not there you either have not correctly entered the token or you have another plugin that is stripping the token from the page code.
|
148 |
|
149 |
== Screenshots ==
|
150 |
|
@@ -155,6 +171,16 @@ Secondly, make sure that the token (<!--subscribe2-->) is correctly entered in y
|
|
155 |
|
156 |
== Changelog ==
|
157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
= Version 6.0 by Matthew Robinson =
|
159 |
|
160 |
* Improved case sensitive SQL queries to avoid issues on some server configurations
|
4 |
Tags: posts, subscription, email, subscribe, notify, notification
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.0.1
|
7 |
+
Stable tag: 6.1
|
8 |
|
9 |
Sends a list of subscribers an email notification when new posts are published to your blog
|
10 |
|
32 |
4. Configure the options to taste, including the email template and any categories which should be excluded from notification
|
33 |
5. Click the "Tools" admin menu link, and select "Subscribers".
|
34 |
6. Manually subscribe people as you see fit.
|
35 |
+
7. Create a [WordPress Page](http://codex.wordpress.org/Pages) to display the subscription form. When creating the page, you may click the "S2" button on the QuickBar to automatically insert the subscribe2 token. Or, if you prefer, you may manually insert the subscribe2 shortcode or token:
|
36 |
+
[subscribe2] or the HTML invisible <!--subscribe2-->
|
37 |
***Ensure the token is on a line by itself and that it has a blank line above and below.***
|
38 |
This token will automatically be replaced by 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.
|
115 |
|
116 |
Get them to register with your blog rather than using the Subscribe2 form. Additional fields would require much more intensive form processing, checking and entry into the database and since you won't then be able to easily use this information to persoanlise emails there really isn't any point in collecting this data.
|
117 |
|
118 |
+
= How do I use the Subscribe2 shortcode? =
|
119 |
|
120 |
+
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.
|
121 |
+
|
122 |
+
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.
|
123 |
+
|
124 |
+
If you use the shortcode [subscribe2 hide="subscribe"] then the button for subscribing will be hidden and similarly if you use [subscribe2 hide="unsubscribe"], only button for subscribing will be shown.
|
125 |
+
|
126 |
+
The new shortcode also accepts two further attributes, these are **id** and **url**. To understand these parameters you need to understand that Subscribe2 returns a user to the default WordPress Page on your site where you use the shortcode or token however in some circumstances you may ant to override this behaviour. If you specify a WordPress page id using the id parameter or a full URL using the url parameter then the user would be returned to the alternative page.
|
127 |
+
|
128 |
+
There are many scenarios in which to use new options, but here is an example:
|
129 |
+
|
130 |
+
* Two separate WordPress pages, �Subscribe� that shows only Subscribe button, and �Unsubscibe�, that shows only Unsubscibe button. Both pages also have text that should help users in use of form.
|
131 |
+
* In the widget, show only Subscribe button and post form content to page �Subcribe�
|
132 |
+
* In the Subscribe2 email template for new post, add text �You can unsubscribe on a following page:� which is followed with link to �Unsubscribe� page
|
133 |
+
|
134 |
+
= I can't find or insert the Subscribe2 token or shortcode, help! =
|
135 |
+
|
136 |
+
If, for some reason the Subscribe2 button does not appear in your browser window try refreshing your browser and cache (Shift and Reload in Firefox). If this still fails then insert the token manually. In the Rich Text Editor (TinyMCE) make sure you switch to the "code" view and type in [subscribe2] or <!--subscribe2-->.
|
137 |
|
138 |
= My digest email didn't send, how can I resend it? =
|
139 |
|
160 |
= Why doesn't the form appear in my WordPress page? =
|
161 |
This is usually caused by one of two things. Firstly, it is possible that the form is there but because you haven't logged out of WordPress yourself you are seeing a message about managing your profile instead. Log out of WordPress and it will appear as the subscription form you are probably expecting.
|
162 |
|
163 |
+
Secondly, make sure that the token ([subscribe2] or <!--subscribe2-->) is correctly entered in your page with a blank line above and below. The easient way to do this is to deactivate the plugin, visit your WordPress page and view the source. The token should be contained in the source code of the page. If it is not there you either have not correctly entered the token or you have another plugin that is stripping the token from the page code.
|
164 |
|
165 |
== Screenshots ==
|
166 |
|
171 |
|
172 |
== Changelog ==
|
173 |
|
174 |
+
= Version 6.1 by Matthew Robinson =
|
175 |
+
|
176 |
+
* Fixed a glitch in the HTML tags in the Subscribe2 Widget that affected drag and drop functions in WordPress - thanks to Marty McOmber
|
177 |
+
* Improved detection of Multisite installs - thanks to Nada Oneal
|
178 |
+
* Fixed precontent and postcontent in the Widget to retain entered HTML tags - reported by Rob Saxe
|
179 |
+
* Fixed a few small typos in the inline code comments and email subjects
|
180 |
+
* Fixed a bug where Bulk Management changes to move all users to Plain Text Full content would result in blank settings - reported by Sean @ GetSatisfaction
|
181 |
+
* Fixed issued with TIME and AUTHORNAME keywords in digest emails - thanks to Robert @ GetSatisfaction
|
182 |
+
* Introduced a more flexible Subscribe2 shortcode - thanks to Milan for the patch code
|
183 |
+
|
184 |
= Version 6.0 by Matthew Robinson =
|
185 |
|
186 |
* Improved case sensitive SQL queries to avoid issues on some server configurations
|
include/widget.php
CHANGED
@@ -18,11 +18,19 @@ class S2_Form_widget extends WP_Widget {
|
|
18 |
$div = empty($instance['div']) ? 'search' : $instance['div'];
|
19 |
$widgetprecontent = empty($instance['widgetprecontent']) ? '' : $instance['widgetprecontent'];
|
20 |
$widgetpostcontent = empty($instance['widgetpostcontent']) ? '' : $instance['widgetpostcontent'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
echo $before_widget;
|
22 |
echo $before_title . $title . $after_title;
|
23 |
echo "<div class=\"" . $div . "\">";
|
24 |
-
|
25 |
-
$content = $mysubscribe2->filter('<!--subscribe2-->');
|
26 |
if ( !empty($widgetprecontent) ) {
|
27 |
echo $widgetprecontent;
|
28 |
}
|
@@ -41,8 +49,10 @@ class S2_Form_widget extends WP_Widget {
|
|
41 |
$instance = $old_instance;
|
42 |
$instance['title'] = strip_tags(stripslashes($new_instance['title']));
|
43 |
$instance['div'] = strip_tags(stripslashes($new_instance['div']));
|
44 |
-
$instance['widgetprecontent'] =
|
45 |
-
$instance['widgetpostcontent'] =
|
|
|
|
|
46 |
|
47 |
return $instance;
|
48 |
}
|
@@ -54,9 +64,9 @@ class S2_Form_widget extends WP_Widget {
|
|
54 |
// set some defaults, getting any old options first
|
55 |
$options = get_option('widget_subscribe2widget');
|
56 |
if ( $options === false ) {
|
57 |
-
$defaults = array('title' => 'Subscribe2', 'div' => 'search', 'widgetprecontent' => '', 'widgetpostcontent' => '');
|
58 |
} else {
|
59 |
-
$defaults = array('title' => $options['title'], 'div' => $options['div'], 'widgetprecontent' => $options['widgetprecontent'], 'widgetpostcontent' => $options['widgetpostcontent']);
|
60 |
delete_option('widget_subscribe2widget');
|
61 |
}
|
62 |
// code to obtain old settings too
|
@@ -66,17 +76,33 @@ class S2_Form_widget extends WP_Widget {
|
|
66 |
$div= htmlspecialchars($instance['div'], ENT_QUOTES);
|
67 |
$widgetprecontent = htmlspecialchars($instance['widgetprecontent'], ENT_QUOTES);
|
68 |
$widgetpostcontent = htmlspecialchars($instance['widgetpostcontent'], ENT_QUOTES);
|
|
|
|
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
echo "<
|
75 |
-
echo "<p><label for=\"" . $this->get_field_name('
|
76 |
-
echo "<input class=\"widefat\" id=\"" . $this->
|
77 |
-
echo "<p><label for=\"" . $this->get_field_name('
|
78 |
-
echo "<input class=\"widefat\" id=\"" . $this->get_field_id('
|
79 |
-
echo "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
}
|
81 |
} // End S2_Form_widget class
|
82 |
?>
|
18 |
$div = empty($instance['div']) ? 'search' : $instance['div'];
|
19 |
$widgetprecontent = empty($instance['widgetprecontent']) ? '' : $instance['widgetprecontent'];
|
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 |
+
}
|
29 |
+
$shortcode = "[subscribe2" . $hide . $postid . "]";
|
30 |
echo $before_widget;
|
31 |
echo $before_title . $title . $after_title;
|
32 |
echo "<div class=\"" . $div . "\">";
|
33 |
+
$content = do_shortcode( $shortcode );
|
|
|
34 |
if ( !empty($widgetprecontent) ) {
|
35 |
echo $widgetprecontent;
|
36 |
}
|
49 |
$instance = $old_instance;
|
50 |
$instance['title'] = strip_tags(stripslashes($new_instance['title']));
|
51 |
$instance['div'] = strip_tags(stripslashes($new_instance['div']));
|
52 |
+
$instance['widgetprecontent'] = stripslashes($new_instance['widgetprecontent']);
|
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 |
}
|
64 |
// set some defaults, getting any old options first
|
65 |
$options = get_option('widget_subscribe2widget');
|
66 |
if ( $options === false ) {
|
67 |
+
$defaults = array('title' => 'Subscribe2', 'div' => 'search', 'widgetprecontent' => '', 'widgetpostcontent' => '', 'hidebutton' => 'none', 'postto' => '');
|
68 |
} else {
|
69 |
+
$defaults = array('title' => $options['title'], 'div' => $options['div'], 'widgetprecontent' => $options['widgetprecontent'], 'widgetpostcontent' => $options['widgetpostcontent'], 'hidebutton' => $options['hidebutton'], 'postto' => $options['postto']);
|
70 |
delete_option('widget_subscribe2widget');
|
71 |
}
|
72 |
// code to obtain old settings too
|
76 |
$div= htmlspecialchars($instance['div'], ENT_QUOTES);
|
77 |
$widgetprecontent = htmlspecialchars($instance['widgetprecontent'], ENT_QUOTES);
|
78 |
$widgetpostcontent = htmlspecialchars($instance['widgetpostcontent'], ENT_QUOTES);
|
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 |
+
|
86 |
+
echo "<div>\r\n";
|
87 |
+
echo "<p><label for=\"" . $this->get_field_name('title') . "\">" . __('Title', 'subscribe2') . ":\r\n";
|
88 |
+
echo "<input class=\"widefat\" id=\"" . $this->get_field_id('title') . "\" name=\"" . $this->get_field_name('title') . "\" type=\"text\" value=\"" . $title . "\" /></label></p>\r\n";
|
89 |
+
echo "<p><label for=\"" . $this->get_field_name('div') . "\">" . __('Div class name', 'subscribe2') . ":\r\n";
|
90 |
+
echo "<input class=\"widefat\" id=\"" . $this->get_field_id('div') . "\" name=\"" . $this->get_field_name('div') . "\" type=\"text\" value=\"" . $div . "\" /></label></p>\r\n";
|
91 |
+
echo "<p><label for=\"" . $this->get_field_name('widgetprecontent') . "\">" . __('Pre-Content', 'subscribe2') . ":\r\n";
|
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";
|
100 |
+
echo "<option value=\"\">" . __('Use Subscribe2 Default', 'subscribe2') . "</option>\r\n";
|
101 |
+
global $mysubscribe2;
|
102 |
+
$mysubscribe2->pages_dropdown($postto);
|
103 |
+
echo "</select></label></p>\r\n";
|
104 |
+
}
|
105 |
+
echo "</div>\r\n";
|
106 |
}
|
107 |
} // End S2_Form_widget class
|
108 |
?>
|
subscribe2.php
CHANGED
@@ -1,3702 +1,3738 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
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.
|
7 |
-
Author: Matthew Robinson
|
8 |
-
Author URI: http://subscribe2.wordpress.com
|
9 |
-
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904
|
10 |
-
*/
|
11 |
-
|
12 |
-
/*
|
13 |
-
Copyright (C) 2006-10 Matthew Robinson
|
14 |
-
Based on the Original Subscribe2 plugin by
|
15 |
-
Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
|
16 |
-
|
17 |
-
This file is part of Subscribe2.
|
18 |
-
|
19 |
-
Subscribe2 is free software: you can redistribute it and/or modify
|
20 |
-
it under the terms of the GNU General Public License as published by
|
21 |
-
the Free Software Foundation, either version 3 of the License, or
|
22 |
-
(at your option) any later version.
|
23 |
-
|
24 |
-
Subscribe2 is distributed in the hope that it will be useful,
|
25 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
26 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
27 |
-
GNU General Public License for more details.
|
28 |
-
|
29 |
-
You should have received a copy of the GNU General Public License
|
30 |
-
along with Subscribe2. If not, see <http://www.gnu.org/licenses/>.
|
31 |
-
*/
|
32 |
-
|
33 |
-
// our version number. Don't touch this or any line below
|
34 |
-
// unless you know
|
35 |
-
define( 'S2VERSION', '6.
|
36 |
-
define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
|
37 |
-
define( 'S2DIR', plugin_basename(dirname(__FILE__)) );
|
38 |
-
|
39 |
-
// Set minimum execution time to 5 minutes - won't affect safe mode
|
40 |
-
$safe_mode = array('On', 'ON', 'on', 1);
|
41 |
-
if ( !in_array(ini_get('safe_mode'), $safe_mode) && ini_get('max_execution_time') < 300 ) {
|
42 |
-
@ini_set('max_execution_time', 300);
|
43 |
-
}
|
44 |
-
|
45 |
-
/* Include buttonsnap library by Owen Winckler */
|
46 |
-
if ( !class_exists('buttonsnap') ) {
|
47 |
-
require( WP_CONTENT_DIR . '/plugins/' . S2DIR . '/include/buttonsnap.php' );
|
48 |
-
}
|
49 |
-
|
50 |
-
$mysubscribe2 = new s2class;
|
51 |
-
$mysubscribe2->s2init();
|
52 |
-
|
53 |
-
// start our class
|
54 |
-
class s2class {
|
55 |
-
// variables and constructor are declared at the end
|
56 |
-
|
57 |
-
/**
|
58 |
-
Load all our strings
|
59 |
-
*/
|
60 |
-
function load_strings() {
|
61 |
-
// adjust the output of Subscribe2 here
|
62 |
-
|
63 |
-
$this->please_log_in = "<p>" . __('To manage your subscription options please', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-login.php\">" . __('login', 'subscribe2') . "</a>.</p>";
|
64 |
-
|
65 |
-
$this->use_profile_admin = "<p>" . __('You may manage your subscription options from your', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-admin/users.php?page=s2_users\">" . __('profile', 'subscribe2') . "</a>.</p>";
|
66 |
-
if ( $this->s2_mu === true) {
|
67 |
-
global $blog_id, $user_ID;
|
68 |
-
if ( !is_blog_user($blog_id) ) {
|
69 |
-
// if we are on multisite and the user is not a member of this blog change the link
|
70 |
-
$this->use_profile_admin = "<p><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>";
|
71 |
-
}
|
72 |
-
}
|
73 |
-
|
74 |
-
$this->use_profile_users = "<p>" . __('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>";
|
75 |
-
if ( $this->s2_mu === true) {
|
76 |
-
global $blog_id, $user_ID;
|
77 |
-
if ( !is_blog_user($blog_id) ) {
|
78 |
-
// if we are on multisite and the user is not a member of this blog change the link
|
79 |
-
$this->use_profile_users = "<p><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>";
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
$this->confirmation_sent = "<p>" . __('A confirmation message is on its way!', 'subscribe2') . "</p>";
|
84 |
-
|
85 |
-
$this->already_subscribed = "<p>" . __('That email address is already subscribed.', 'subscribe2') . "</p>";
|
86 |
-
|
87 |
-
$this->not_subscribed = "<p>" . __('That email address is not subscribed.', 'subscribe2') . "</p>";
|
88 |
-
|
89 |
-
$this->not_an_email = "<p>" . __('Sorry, but that does not look like an email address to me.', 'subscribe2') . "</p>";
|
90 |
-
|
91 |
-
$this->barred_domain = "<p>" . __('Sorry, email addresses at that domain are currently barred due to spam, please use an alternative email address.', 'subscribe2') . "</p>";
|
92 |
-
|
93 |
-
$this->error = "<p>" . __('Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2') . "</p>";
|
94 |
-
|
95 |
-
$this->no_page = "<p>" . __('You must to create a WordPress page for this plugin to work correctly.', 'subscribe2') . "<p>";
|
96 |
-
|
97 |
-
$this->mail_sent = "<p>" . __('Message sent!', 'subscribe2') . "</p>";
|
98 |
-
|
99 |
-
$this->mail_failed = "<p>" . __('Message failed! Check your settings and check with your hosting provider', 'subscribe2') . "</p>";
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
$this->
|
105 |
-
|
106 |
-
$this->
|
107 |
-
|
108 |
-
$this->
|
109 |
-
|
110 |
-
$this->
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
$
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
$
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
//
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
$
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
$
|
273 |
-
|
274 |
-
$public_subscribers
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
$string = str_replace("
|
304 |
-
$
|
305 |
-
$string = str_replace("
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
$string = str_replace("TINYLINK", $
|
313 |
-
}
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
$string = str_replace("
|
318 |
-
$string = str_replace("
|
319 |
-
$string = str_replace("
|
320 |
-
$string = str_replace("
|
321 |
-
$string = str_replace("
|
322 |
-
$string = str_replace("
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
if (
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
$mailtext = apply_filters('s2_html_email', "<html><head><title>" . $subject . "</title
|
339 |
-
}
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
$
|
344 |
-
$message =
|
345 |
-
$
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
$recipient
|
360 |
-
//
|
361 |
-
if (
|
362 |
-
|
363 |
-
|
364 |
-
@wp_mail($recipient, $subject, $mailtext, $headers
|
365 |
-
}
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
//
|
375 |
-
if ( !
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
$
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
//
|
390 |
-
if ( !
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
$
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
}
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
$
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
$header['
|
434 |
-
$header['
|
435 |
-
$header['
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
$header['Content-Type'] =
|
441 |
-
}
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
//
|
446 |
-
$header
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
$headers
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
if (
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
if ( $
|
470 |
-
|
471 |
-
//
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
$this->
|
543 |
-
|
544 |
-
$
|
545 |
-
$this->
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
// get
|
553 |
-
$user =
|
554 |
-
}
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
$this->
|
559 |
-
$this->
|
560 |
-
|
561 |
-
|
562 |
-
$
|
563 |
-
|
564 |
-
|
565 |
-
$
|
566 |
-
|
567 |
-
$
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
$
|
575 |
-
$
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
$excerpt =
|
583 |
-
|
584 |
-
|
585 |
-
$excerpt =
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
$html_excerpt =
|
602 |
-
|
603 |
-
|
604 |
-
$
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
$
|
619 |
-
$
|
620 |
-
$
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
$this->
|
627 |
-
$this->
|
628 |
-
$this->mail(array($preview), $subject, $
|
629 |
-
|
630 |
-
|
631 |
-
$
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
$this->mail($
|
643 |
-
|
644 |
-
// next we send
|
645 |
-
$this->mail($this->get_registered("cats=$post_cats_string&format=
|
646 |
-
|
647 |
-
//
|
648 |
-
$this->mail($this->get_registered("cats=$post_cats_string&format=
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
}
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
//
|
680 |
-
//
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
$
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
$body = $this->substitute(stripslashes($this->subscribe2_options['
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
$body = str_replace("ACTION", $this->
|
704 |
-
$subject = str_replace("ACTION", $this->
|
705 |
-
}
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
$wpdb->get_results(
|
766 |
-
}
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
if (
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
$
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
if (
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
$code =
|
871 |
-
$
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
$
|
895 |
-
$
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
$
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
$this->
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
$
|
923 |
-
$
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
$
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
if ( $
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
$
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
$
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
if (
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
if (
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
delete_usermeta($user_ID, 's2_excerpt');
|
1203 |
-
}
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
$
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
$
|
1226 |
-
|
1227 |
-
|
1228 |
-
$
|
1229 |
-
$
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
$
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
$
|
1258 |
-
|
1259 |
-
|
1260 |
-
$
|
1261 |
-
$
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
$
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
$wpdb->
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
update_usermeta($user_ID, $this->get_usermeta_keyname('
|
1345 |
-
}
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
$
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
$
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
$url
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
if ( '
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
$admin = get_userdata(
|
1466 |
-
}
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
$
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
}
|
1528 |
-
if ( $
|
1529 |
-
echo "<div id=\"message\" class=\"error\"><p><strong>" . __('Some emails were not processed, the following were
|
1530 |
-
}
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
} elseif ( $_POST['
|
1566 |
-
$this->
|
1567 |
-
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('
|
1568 |
-
} elseif ( $_POST['sub_categories'] && '
|
1569 |
-
$this->
|
1570 |
-
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users
|
1571 |
-
} elseif ( $_POST['
|
1572 |
-
$this->
|
1573 |
-
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('
|
1574 |
-
}
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
//
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
if ( '' == $
|
1585 |
-
|
1586 |
-
$
|
1587 |
-
$
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
$what = '
|
1602 |
-
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
|
1603 |
-
} elseif ( '
|
1604 |
-
$what = '
|
1605 |
-
$subscribers = $confirmed;
|
1606 |
-
} elseif ( '
|
1607 |
-
$what = '
|
1608 |
-
$subscribers = $
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
} elseif (
|
1617 |
-
$what = '
|
1618 |
-
$subscribers = $
|
1619 |
-
} elseif ( '
|
1620 |
-
$what = '
|
1621 |
-
$subscribers = $
|
1622 |
-
}
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
$what = '
|
1629 |
-
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
|
1630 |
-
} elseif ( '
|
1631 |
-
$what = '
|
1632 |
-
$subscribers = $confirmed;
|
1633 |
-
} elseif ( '
|
1634 |
-
$what = '
|
1635 |
-
$subscribers = $
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
} elseif (
|
1644 |
-
$what = '
|
1645 |
-
$subscribers = $
|
1646 |
-
} elseif ( '
|
1647 |
-
$what = '
|
1648 |
-
$subscribers = $
|
1649 |
-
}
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
}
|
1654 |
-
|
1655 |
-
$subscribers =
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
$
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
$strip .= "
|
1681 |
-
$trunc =
|
1682 |
-
}
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
echo "<
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
echo "<
|
1704 |
-
echo "<p
|
1705 |
-
echo "
|
1706 |
-
|
1707 |
-
|
1708 |
-
echo "
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
echo "<td width=\"25%\"
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
echo "<
|
1746 |
-
echo "<
|
1747 |
-
echo "<
|
1748 |
-
echo "<
|
1749 |
-
echo "<
|
1750 |
-
echo "<td
|
1751 |
-
echo "<
|
1752 |
-
echo "<td align=\"
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
echo "
|
1762 |
-
echo "
|
1763 |
-
echo "<td
|
1764 |
-
echo "
|
1765 |
-
|
1766 |
-
echo "<
|
1767 |
-
echo "<
|
1768 |
-
|
1769 |
-
echo "<input class=\"
|
1770 |
-
echo "
|
1771 |
-
echo "<td
|
1772 |
-
echo "
|
1773 |
-
|
1774 |
-
echo "
|
1775 |
-
echo "<
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
echo "<
|
1801 |
-
echo
|
1802 |
-
echo "<
|
1803 |
-
echo "<
|
1804 |
-
|
1805 |
-
echo "<
|
1806 |
-
|
1807 |
-
|
1808 |
-
echo "<
|
1809 |
-
|
1810 |
-
echo "<
|
1811 |
-
echo "<label><input type=\"radio\" name=\"format\" value=\"
|
1812 |
-
echo "<
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
|
1828 |
-
$
|
1829 |
-
|
1830 |
-
if
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
$
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
//
|
1866 |
-
$
|
1867 |
-
|
1868 |
-
|
1869 |
-
|
1870 |
-
$
|
1871 |
-
|
1872 |
-
|
1873 |
-
$this->subscribe2_options['
|
1874 |
-
|
1875 |
-
|
1876 |
-
$this->subscribe2_options['
|
1877 |
-
$this->subscribe2_options['
|
1878 |
-
|
1879 |
-
|
1880 |
-
$
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
$
|
1887 |
-
|
1888 |
-
|
1889 |
-
|
1890 |
-
|
1891 |
-
// if we are
|
1892 |
-
$
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
-
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
|
1903 |
-
|
1904 |
-
|
1905 |
-
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
1912 |
-
}
|
1913 |
-
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
-
|
1919 |
-
|
1920 |
-
|
1921 |
-
|
1922 |
-
|
1923 |
-
|
1924 |
-
|
1925 |
-
if ( !empty($_POST['
|
1926 |
-
$this->subscribe2_options['
|
1927 |
-
}
|
1928 |
-
if ( !empty($_POST['
|
1929 |
-
$this->subscribe2_options['
|
1930 |
-
}
|
1931 |
-
if ( !empty($_POST['
|
1932 |
-
$this->subscribe2_options['
|
1933 |
-
}
|
1934 |
-
if ( !empty($_POST['
|
1935 |
-
$this->subscribe2_options['
|
1936 |
-
}
|
1937 |
-
if ( !empty($_POST['
|
1938 |
-
$this->subscribe2_options['
|
1939 |
-
}
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
|
1949 |
-
|
1950 |
-
$this->subscribe2_options['
|
1951 |
-
|
1952 |
-
|
1953 |
-
|
1954 |
-
|
1955 |
-
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
$this->subscribe2_options['
|
1984 |
-
|
1985 |
-
|
1986 |
-
$this->subscribe2_options['
|
1987 |
-
$this->subscribe2_options['
|
1988 |
-
$this->subscribe2_options['
|
1989 |
-
|
1990 |
-
|
1991 |
-
$this->subscribe2_options['
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
2000 |
-
|
2001 |
-
echo "<
|
2002 |
-
|
2003 |
-
echo "<
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
echo "<input type=\"hidden\"
|
2011 |
-
|
2012 |
-
|
2013 |
-
echo "<
|
2014 |
-
|
2015 |
-
|
2016 |
-
echo "<
|
2017 |
-
echo
|
2018 |
-
echo "<
|
2019 |
-
echo "<a href=\"#\" onclick=\"
|
2020 |
-
echo "<
|
2021 |
-
|
2022 |
-
echo "<
|
2023 |
-
echo "<
|
2024 |
-
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
echo "
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
echo "
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
2086 |
-
|
2087 |
-
|
2088 |
-
|
2089 |
-
|
2090 |
-
|
2091 |
-
|
2092 |
-
echo
|
2093 |
-
|
2094 |
-
|
2095 |
-
|
2096 |
-
|
2097 |
-
echo "<
|
2098 |
-
|
2099 |
-
|
2100 |
-
|
2101 |
-
|
2102 |
-
|
2103 |
-
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
|
2111 |
-
|
2112 |
-
|
2113 |
-
echo "<
|
2114 |
-
echo
|
2115 |
-
echo
|
2116 |
-
echo "<
|
2117 |
-
echo "
|
2118 |
-
echo
|
2119 |
-
echo "
|
2120 |
-
echo "<
|
2121 |
-
echo "<
|
2122 |
-
echo "
|
2123 |
-
echo "<
|
2124 |
-
echo "<
|
2125 |
-
echo "<
|
2126 |
-
echo "<dt><b>
|
2127 |
-
echo "<dt><b>
|
2128 |
-
echo "<dt><b>
|
2129 |
-
echo "<dt><b>
|
2130 |
-
echo "<dt><b>
|
2131 |
-
echo "<dt><b>
|
2132 |
-
echo "<dt><b>
|
2133 |
-
echo "<dt><b>
|
2134 |
-
echo "<dt><b>
|
2135 |
-
echo "<dt><b>
|
2136 |
-
echo "<dt><b>
|
2137 |
-
echo "<dt><b>
|
2138 |
-
echo "<dt><b>
|
2139 |
-
echo "<dt><b>
|
2140 |
-
echo "<dt><b>
|
2141 |
-
echo "<dt><b>
|
2142 |
-
echo "</
|
2143 |
-
echo __('
|
2144 |
-
echo __(
|
2145 |
-
echo "
|
2146 |
-
echo
|
2147 |
-
echo "
|
2148 |
-
echo
|
2149 |
-
echo
|
2150 |
-
echo "
|
2151 |
-
echo
|
2152 |
-
echo "
|
2153 |
-
|
2154 |
-
|
2155 |
-
echo "
|
2156 |
-
|
2157 |
-
|
2158 |
-
echo"
|
2159 |
-
|
2160 |
-
echo "<
|
2161 |
-
|
2162 |
-
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
echo "
|
2168 |
-
|
2169 |
-
|
2170 |
-
|
2171 |
-
echo
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
echo "<
|
2176 |
-
|
2177 |
-
echo "
|
2178 |
-
|
2179 |
-
|
2180 |
-
echo "<
|
2181 |
-
echo "<
|
2182 |
-
|
2183 |
-
|
2184 |
-
echo "<
|
2185 |
-
|
2186 |
-
|
2187 |
-
|
2188 |
-
|
2189 |
-
|
2190 |
-
|
2191 |
-
|
2192 |
-
|
2193 |
-
|
2194 |
-
|
2195 |
-
|
2196 |
-
|
2197 |
-
|
2198 |
-
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
|
2205 |
-
|
2206 |
-
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
echo "
|
2218 |
-
|
2219 |
-
|
2220 |
-
|
2221 |
-
echo"
|
2222 |
-
echo
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
echo
|
2228 |
-
echo "<label><input type=\"radio\" name=\"autosub\" value=\"
|
2229 |
-
if ( '
|
2230 |
-
echo " checked=\"checked\"";
|
2231 |
-
}
|
2232 |
-
echo " /> " . __('
|
2233 |
-
echo "<label><input type=\"radio\" name=\"autosub\" value=\"
|
2234 |
-
if ( '
|
2235 |
-
echo " checked=\"checked\"";
|
2236 |
-
}
|
2237 |
-
echo " /> " . __('
|
2238 |
-
echo
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
echo
|
2244 |
-
echo "<label><input type=\"radio\" name=\"newreg_override\" value=\"
|
2245 |
-
if ( '
|
2246 |
-
echo " checked=\"checked\"";
|
2247 |
-
}
|
2248 |
-
echo " />" . __('
|
2249 |
-
echo
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
echo
|
2255 |
-
echo "<label><input type=\"radio\" name=\"wpregdef\" value=\"
|
2256 |
-
if ( '
|
2257 |
-
echo " checked=\"checked\"";
|
2258 |
-
}
|
2259 |
-
echo " />" . __('
|
2260 |
-
echo
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
echo
|
2266 |
-
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"
|
2267 |
-
if ( '
|
2268 |
-
echo "checked=\"checked\" ";
|
2269 |
-
}
|
2270 |
-
echo "/> " . __('HTML -
|
2271 |
-
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"
|
2272 |
-
if ( '
|
2273 |
-
echo "checked=\"checked\" ";
|
2274 |
-
}
|
2275 |
-
echo "/> " . __('
|
2276 |
-
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"
|
2277 |
-
if ( '
|
2278 |
-
echo "checked=\"checked\" ";
|
2279 |
-
}
|
2280 |
-
echo "/> " . __('Plain Text -
|
2281 |
-
echo
|
2282 |
-
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
echo
|
2287 |
-
echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"
|
2288 |
-
if ( '
|
2289 |
-
echo " checked=\"checked\"";
|
2290 |
-
}
|
2291 |
-
echo " />" . __('
|
2292 |
-
echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"
|
2293 |
-
if ( '
|
2294 |
-
echo " checked=\"checked\"";
|
2295 |
-
}
|
2296 |
-
echo " />" .__('
|
2297 |
-
echo
|
2298 |
-
|
2299 |
-
|
2300 |
-
|
2301 |
-
|
2302 |
-
echo
|
2303 |
-
echo "<label><input type=\"radio\" name=\"autosub_def\" value=\"
|
2304 |
-
if ( '
|
2305 |
-
echo " checked=\"checked\"";
|
2306 |
-
}
|
2307 |
-
echo " />" . __('
|
2308 |
-
echo"
|
2309 |
-
|
2310 |
-
|
2311 |
-
|
2312 |
-
echo"
|
2313 |
-
echo
|
2314 |
-
|
2315 |
-
|
2316 |
-
|
2317 |
-
|
2318 |
-
echo
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
|
2323 |
-
echo "<p class=\"submit\" align=\"center\">";
|
2324 |
-
|
2325 |
-
|
2326 |
-
echo "</
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
|
2341 |
-
|
2342 |
-
|
2343 |
-
|
2344 |
-
|
2345 |
-
|
2346 |
-
|
2347 |
-
|
2348 |
-
|
2349 |
-
|
2350 |
-
|
2351 |
-
|
2352 |
-
|
2353 |
-
|
2354 |
-
|
2355 |
-
|
2356 |
-
|
2357 |
-
|
2358 |
-
|
2359 |
-
|
2360 |
-
|
2361 |
-
|
2362 |
-
|
2363 |
-
|
2364 |
-
|
2365 |
-
|
2366 |
-
|
2367 |
-
|
2368 |
-
|
2369 |
-
|
2370 |
-
|
2371 |
-
|
2372 |
-
|
2373 |
-
$
|
2374 |
-
}
|
2375 |
-
|
2376 |
-
|
2377 |
-
|
2378 |
-
|
2379 |
-
|
2380 |
-
|
2381 |
-
|
2382 |
-
|
2383 |
-
|
2384 |
-
|
2385 |
-
|
2386 |
-
|
2387 |
-
|
2388 |
-
|
2389 |
-
|
2390 |
-
|
2391 |
-
|
2392 |
-
|
2393 |
-
|
2394 |
-
|
2395 |
-
|
2396 |
-
|
2397 |
-
|
2398 |
-
|
2399 |
-
|
2400 |
-
|
2401 |
-
|
2402 |
-
echo "<
|
2403 |
-
|
2404 |
-
|
2405 |
-
|
2406 |
-
}
|
2407 |
-
echo "<
|
2408 |
-
|
2409 |
-
|
2410 |
-
|
2411 |
-
|
2412 |
-
|
2413 |
-
|
2414 |
-
echo
|
2415 |
-
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"
|
2416 |
-
if ( '
|
2417 |
-
echo "checked=\"checked\" ";
|
2418 |
-
}
|
2419 |
-
echo "/> " . __('HTML -
|
2420 |
-
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"
|
2421 |
-
if ( '
|
2422 |
-
echo "checked=\"checked\" ";
|
2423 |
-
}
|
2424 |
-
echo "/> " . __('
|
2425 |
-
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"
|
2426 |
-
if ( '
|
2427 |
-
echo "checked=\"checked\" ";
|
2428 |
-
}
|
2429 |
-
echo "/> " . __('Plain Text -
|
2430 |
-
|
2431 |
-
if (
|
2432 |
-
echo
|
2433 |
-
|
2434 |
-
|
2435 |
-
|
2436 |
-
|
2437 |
-
echo
|
2438 |
-
echo "<label><input type=\"radio\" name=\"new_category\" value=\"
|
2439 |
-
if ( '
|
2440 |
-
echo "checked=\"checked\" ";
|
2441 |
-
}
|
2442 |
-
echo "/> " . __('
|
2443 |
-
echo "
|
2444 |
-
|
2445 |
-
|
2446 |
-
|
2447 |
-
|
2448 |
-
|
2449 |
-
|
2450 |
-
|
2451 |
-
|
2452 |
-
|
2453 |
-
|
2454 |
-
|
2455 |
-
|
2456 |
-
|
2457 |
-
|
2458 |
-
|
2459 |
-
|
2460 |
-
|
2461 |
-
|
2462 |
-
|
2463 |
-
|
2464 |
-
|
2465 |
-
|
2466 |
-
|
2467 |
-
|
2468 |
-
|
2469 |
-
|
2470 |
-
|
2471 |
-
|
2472 |
-
|
2473 |
-
echo "
|
2474 |
-
|
2475 |
-
|
2476 |
-
|
2477 |
-
|
2478 |
-
echo "</label
|
2479 |
-
|
2480 |
-
|
2481 |
-
|
2482 |
-
|
2483 |
-
|
2484 |
-
|
2485 |
-
|
2486 |
-
|
2487 |
-
|
2488 |
-
|
2489 |
-
|
2490 |
-
|
2491 |
-
|
2492 |
-
$
|
2493 |
-
|
2494 |
-
|
2495 |
-
|
2496 |
-
|
2497 |
-
|
2498 |
-
|
2499 |
-
|
2500 |
-
|
2501 |
-
|
2502 |
-
|
2503 |
-
|
2504 |
-
|
2505 |
-
|
2506 |
-
|
2507 |
-
|
2508 |
-
|
2509 |
-
|
2510 |
-
|
2511 |
-
|
2512 |
-
|
2513 |
-
|
2514 |
-
|
2515 |
-
|
2516 |
-
|
2517 |
-
|
2518 |
-
|
2519 |
-
|
2520 |
-
|
2521 |
-
|
2522 |
-
|
2523 |
-
|
2524 |
-
|
2525 |
-
|
2526 |
-
|
2527 |
-
|
2528 |
-
|
2529 |
-
|
2530 |
-
|
2531 |
-
|
2532 |
-
|
2533 |
-
|
2534 |
-
|
2535 |
-
|
2536 |
-
|
2537 |
-
|
2538 |
-
|
2539 |
-
|
2540 |
-
|
2541 |
-
|
2542 |
-
|
2543 |
-
|
2544 |
-
|
2545 |
-
|
2546 |
-
|
2547 |
-
|
2548 |
-
|
2549 |
-
|
2550 |
-
|
2551 |
-
|
2552 |
-
echo "
|
2553 |
-
|
2554 |
-
|
2555 |
-
|
2556 |
-
|
2557 |
-
|
2558 |
-
|
2559 |
-
|
2560 |
-
|
2561 |
-
|
2562 |
-
|
2563 |
-
|
2564 |
-
|
2565 |
-
|
2566 |
-
|
2567 |
-
|
2568 |
-
|
2569 |
-
|
2570 |
-
|
2571 |
-
|
2572 |
-
|
2573 |
-
|
2574 |
-
|
2575 |
-
|
2576 |
-
|
2577 |
-
|
2578 |
-
|
2579 |
-
|
2580 |
-
|
2581 |
-
|
2582 |
-
|
2583 |
-
|
2584 |
-
|
2585 |
-
|
2586 |
-
|
2587 |
-
|
2588 |
-
|
2589 |
-
|
2590 |
-
|
2591 |
-
|
2592 |
-
|
2593 |
-
|
2594 |
-
|
2595 |
-
|
2596 |
-
|
2597 |
-
|
2598 |
-
|
2599 |
-
|
2600 |
-
|
2601 |
-
$
|
2602 |
-
|
2603 |
-
|
2604 |
-
|
2605 |
-
$
|
2606 |
-
|
2607 |
-
$recipients = $
|
2608 |
-
}
|
2609 |
-
$
|
2610 |
-
|
2611 |
-
|
2612 |
-
|
2613 |
-
|
2614 |
-
|
2615 |
-
|
2616 |
-
|
2617 |
-
|
2618 |
-
|
2619 |
-
|
2620 |
-
|
2621 |
-
|
2622 |
-
|
2623 |
-
|
2624 |
-
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
-
|
2629 |
-
|
2630 |
-
|
2631 |
-
|
2632 |
-
|
2633 |
-
|
2634 |
-
|
2635 |
-
|
2636 |
-
|
2637 |
-
|
2638 |
-
|
2639 |
-
}
|
2640 |
-
|
2641 |
-
|
2642 |
-
|
2643 |
-
|
2644 |
-
|
2645 |
-
echo "<input type=\"
|
2646 |
-
echo "</
|
2647 |
-
echo "<
|
2648 |
-
echo "
|
2649 |
-
|
2650 |
-
|
2651 |
-
|
2652 |
-
|
2653 |
-
|
2654 |
-
|
2655 |
-
|
2656 |
-
|
2657 |
-
|
2658 |
-
|
2659 |
-
|
2660 |
-
|
2661 |
-
|
2662 |
-
|
2663 |
-
|
2664 |
-
|
2665 |
-
|
2666 |
-
|
2667 |
-
|
2668 |
-
|
2669 |
-
|
2670 |
-
|
2671 |
-
|
2672 |
-
|
2673 |
-
|
2674 |
-
|
2675 |
-
|
2676 |
-
|
2677 |
-
|
2678 |
-
|
2679 |
-
|
2680 |
-
|
2681 |
-
|
2682 |
-
|
2683 |
-
|
2684 |
-
|
2685 |
-
|
2686 |
-
|
2687 |
-
|
2688 |
-
|
2689 |
-
|
2690 |
-
|
2691 |
-
|
2692 |
-
|
2693 |
-
|
2694 |
-
|
2695 |
-
|
2696 |
-
|
2697 |
-
|
2698 |
-
|
2699 |
-
|
2700 |
-
|
2701 |
-
|
2702 |
-
|
2703 |
-
|
2704 |
-
|
2705 |
-
|
2706 |
-
|
2707 |
-
|
2708 |
-
|
2709 |
-
|
2710 |
-
|
2711 |
-
|
2712 |
-
|
2713 |
-
|
2714 |
-
|
2715 |
-
|
2716 |
-
|
2717 |
-
|
2718 |
-
|
2719 |
-
|
2720 |
-
|
2721 |
-
|
2722 |
-
|
2723 |
-
|
2724 |
-
|
2725 |
-
|
2726 |
-
|
2727 |
-
|
2728 |
-
|
2729 |
-
|
2730 |
-
|
2731 |
-
|
2732 |
-
|
2733 |
-
|
2734 |
-
|
2735 |
-
|
2736 |
-
|
2737 |
-
|
2738 |
-
$count['
|
2739 |
-
} else {
|
2740 |
-
$count['
|
2741 |
-
}
|
2742 |
-
if ( $this->s2_mu ) {
|
2743 |
-
$count['
|
2744 |
-
} else {
|
2745 |
-
$count['
|
2746 |
-
}
|
2747 |
-
|
2748 |
-
|
2749 |
-
|
2750 |
-
|
2751 |
-
|
2752 |
-
|
2753 |
-
|
2754 |
-
|
2755 |
-
|
2756 |
-
|
2757 |
-
|
2758 |
-
|
2759 |
-
|
2760 |
-
|
2761 |
-
|
2762 |
-
|
2763 |
-
|
2764 |
-
|
2765 |
-
|
2766 |
-
|
2767 |
-
|
2768 |
-
|
2769 |
-
|
2770 |
-
|
2771 |
-
|
2772 |
-
|
2773 |
-
|
2774 |
-
|
2775 |
-
|
2776 |
-
|
2777 |
-
|
2778 |
-
|
2779 |
-
|
2780 |
-
|
2781 |
-
|
2782 |
-
|
2783 |
-
|
2784 |
-
|
2785 |
-
|
2786 |
-
|
2787 |
-
|
2788 |
-
|
2789 |
-
|
2790 |
-
|
2791 |
-
|
2792 |
-
|
2793 |
-
|
2794 |
-
|
2795 |
-
|
2796 |
-
|
2797 |
-
|
2798 |
-
|
2799 |
-
|
2800 |
-
|
2801 |
-
|
2802 |
-
|
2803 |
-
|
2804 |
-
|
2805 |
-
$
|
2806 |
-
|
2807 |
-
|
2808 |
-
|
2809 |
-
|
2810 |
-
|
2811 |
-
$
|
2812 |
-
$admins =
|
2813 |
-
}
|
2814 |
-
|
2815 |
-
|
2816 |
-
|
2817 |
-
|
2818 |
-
|
2819 |
-
|
2820 |
-
|
2821 |
-
|
2822 |
-
|
2823 |
-
|
2824 |
-
|
2825 |
-
|
2826 |
-
|
2827 |
-
|
2828 |
-
|
2829 |
-
|
2830 |
-
|
2831 |
-
|
2832 |
-
|
2833 |
-
|
2834 |
-
|
2835 |
-
|
2836 |
-
|
2837 |
-
|
2838 |
-
|
2839 |
-
|
2840 |
-
$
|
2841 |
-
foreach ( $
|
2842 |
-
$
|
2843 |
-
}
|
2844 |
-
|
2845 |
-
|
2846 |
-
|
2847 |
-
|
2848 |
-
|
2849 |
-
|
2850 |
-
|
2851 |
-
|
2852 |
-
|
2853 |
-
|
2854 |
-
|
2855 |
-
|
2856 |
-
|
2857 |
-
|
2858 |
-
|
2859 |
-
|
2860 |
-
|
2861 |
-
|
2862 |
-
|
2863 |
-
|
2864 |
-
|
2865 |
-
$
|
2866 |
-
|
2867 |
-
|
2868 |
-
|
2869 |
-
|
2870 |
-
|
2871 |
-
echo "<
|
2872 |
-
|
2873 |
-
|
2874 |
-
|
2875 |
-
|
2876 |
-
|
2877 |
-
|
2878 |
-
|
2879 |
-
|
2880 |
-
|
2881 |
-
|
2882 |
-
|
2883 |
-
|
2884 |
-
|
2885 |
-
|
2886 |
-
|
2887 |
-
|
2888 |
-
|
2889 |
-
|
2890 |
-
|
2891 |
-
|
2892 |
-
|
2893 |
-
|
2894 |
-
|
2895 |
-
|
2896 |
-
|
2897 |
-
|
2898 |
-
|
2899 |
-
|
2900 |
-
|
2901 |
-
|
2902 |
-
|
2903 |
-
|
2904 |
-
|
2905 |
-
|
2906 |
-
|
2907 |
-
|
2908 |
-
|
2909 |
-
|
2910 |
-
|
2911 |
-
|
2912 |
-
|
2913 |
-
|
2914 |
-
|
2915 |
-
$subscribers = $unconfirmed;
|
2916 |
-
} elseif (
|
2917 |
-
$subscribers = $
|
2918 |
-
} elseif ( '
|
2919 |
-
$subscribers = $
|
2920 |
-
} elseif ( '
|
2921 |
-
$subscribers = $
|
2922 |
-
}
|
2923 |
-
|
2924 |
-
|
2925 |
-
|
2926 |
-
|
2927 |
-
|
2928 |
-
|
2929 |
-
|
2930 |
-
|
2931 |
-
|
2932 |
-
$exportcsv
|
2933 |
-
|
2934 |
-
foreach (
|
2935 |
-
|
2936 |
-
|
2937 |
-
|
2938 |
-
|
2939 |
-
|
2940 |
-
|
2941 |
-
|
2942 |
-
|
2943 |
-
|
2944 |
-
|
2945 |
-
$
|
2946 |
-
$
|
2947 |
-
$
|
2948 |
-
|
2949 |
-
|
2950 |
-
|
2951 |
-
|
2952 |
-
|
2953 |
-
|
2954 |
-
}
|
2955 |
-
|
2956 |
-
|
2957 |
-
|
2958 |
-
|
2959 |
-
|
2960 |
-
|
2961 |
-
|
2962 |
-
|
2963 |
-
|
2964 |
-
|
2965 |
-
|
2966 |
-
|
2967 |
-
|
2968 |
-
|
2969 |
-
|
2970 |
-
|
2971 |
-
|
2972 |
-
|
2973 |
-
|
2974 |
-
|
2975 |
-
|
2976 |
-
|
2977 |
-
|
2978 |
-
|
2979 |
-
|
2980 |
-
|
2981 |
-
|
2982 |
-
|
2983 |
-
|
2984 |
-
|
2985 |
-
|
2986 |
-
|
2987 |
-
|
2988 |
-
|
2989 |
-
|
2990 |
-
|
2991 |
-
|
2992 |
-
|
2993 |
-
|
2994 |
-
|
2995 |
-
|
2996 |
-
|
2997 |
-
|
2998 |
-
|
2999 |
-
|
3000 |
-
|
3001 |
-
|
3002 |
-
|
3003 |
-
|
3004 |
-
|
3005 |
-
|
3006 |
-
|
3007 |
-
|
3008 |
-
|
3009 |
-
|
3010 |
-
|
3011 |
-
|
3012 |
-
|
3013 |
-
|
3014 |
-
|
3015 |
-
|
3016 |
-
|
3017 |
-
|
3018 |
-
|
3019 |
-
|
3020 |
-
echo "
|
3021 |
-
echo "
|
3022 |
-
|
3023 |
-
|
3024 |
-
|
3025 |
-
|
3026 |
-
|
3027 |
-
|
3028 |
-
|
3029 |
-
|
3030 |
-
|
3031 |
-
|
3032 |
-
|
3033 |
-
|
3034 |
-
|
3035 |
-
|
3036 |
-
|
3037 |
-
|
3038 |
-
|
3039 |
-
|
3040 |
-
|
3041 |
-
|
3042 |
-
|
3043 |
-
|
3044 |
-
|
3045 |
-
|
3046 |
-
|
3047 |
-
|
3048 |
-
|
3049 |
-
|
3050 |
-
|
3051 |
-
|
3052 |
-
|
3053 |
-
|
3054 |
-
|
3055 |
-
|
3056 |
-
|
3057 |
-
|
3058 |
-
|
3059 |
-
|
3060 |
-
echo " />";
|
3061 |
-
|
3062 |
-
|
3063 |
-
|
3064 |
-
|
3065 |
-
|
3066 |
-
|
3067 |
-
|
3068 |
-
|
3069 |
-
|
3070 |
-
|
3071 |
-
|
3072 |
-
|
3073 |
-
}
|
3074 |
-
|
3075 |
-
if (
|
3076 |
-
|
3077 |
-
} else {
|
3078 |
-
|
3079 |
-
}
|
3080 |
-
|
3081 |
-
|
3082 |
-
|
3083 |
-
|
3084 |
-
|
3085 |
-
|
3086 |
-
|
3087 |
-
|
3088 |
-
|
3089 |
-
|
3090 |
-
|
3091 |
-
|
3092 |
-
|
3093 |
-
|
3094 |
-
|
3095 |
-
|
3096 |
-
|
3097 |
-
|
3098 |
-
|
3099 |
-
if
|
3100 |
-
|
3101 |
-
|
3102 |
-
|
3103 |
-
|
3104 |
-
|
3105 |
-
|
3106 |
-
|
3107 |
-
|
3108 |
-
|
3109 |
-
|
3110 |
-
|
3111 |
-
|
3112 |
-
|
3113 |
-
|
3114 |
-
|
3115 |
-
|
3116 |
-
|
3117 |
-
|
3118 |
-
|
3119 |
-
|
3120 |
-
|
3121 |
-
|
3122 |
-
|
3123 |
-
|
3124 |
-
|
3125 |
-
|
3126 |
-
|
3127 |
-
|
3128 |
-
|
3129 |
-
|
3130 |
-
|
3131 |
-
|
3132 |
-
|
3133 |
-
|
3134 |
-
|
3135 |
-
|
3136 |
-
|
3137 |
-
|
3138 |
-
|
3139 |
-
|
3140 |
-
|
3141 |
-
|
3142 |
-
|
3143 |
-
|
3144 |
-
|
3145 |
-
|
3146 |
-
|
3147 |
-
|
3148 |
-
|
3149 |
-
|
3150 |
-
|
3151 |
-
|
3152 |
-
|
3153 |
-
|
3154 |
-
|
3155 |
-
|
3156 |
-
|
3157 |
-
|
3158 |
-
|
3159 |
-
|
3160 |
-
|
3161 |
-
|
3162 |
-
|
3163 |
-
|
3164 |
-
|
3165 |
-
|
3166 |
-
|
3167 |
-
|
3168 |
-
|
3169 |
-
|
3170 |
-
|
3171 |
-
|
3172 |
-
|
3173 |
-
|
3174 |
-
|
3175 |
-
|
3176 |
-
|
3177 |
-
|
3178 |
-
|
3179 |
-
|
3180 |
-
|
3181 |
-
|
3182 |
-
|
3183 |
-
|
3184 |
-
|
3185 |
-
|
3186 |
-
|
3187 |
-
|
3188 |
-
|
3189 |
-
|
3190 |
-
} // end
|
3191 |
-
|
3192 |
-
|
3193 |
-
|
3194 |
-
|
3195 |
-
|
3196 |
-
|
3197 |
-
|
3198 |
-
|
3199 |
-
|
3200 |
-
|
3201 |
-
|
3202 |
-
|
3203 |
-
|
3204 |
-
|
3205 |
-
|
3206 |
-
|
3207 |
-
|
3208 |
-
|
3209 |
-
|
3210 |
-
|
3211 |
-
|
3212 |
-
|
3213 |
-
|
3214 |
-
|
3215 |
-
|
3216 |
-
|
3217 |
-
|
3218 |
-
|
3219 |
-
|
3220 |
-
|
3221 |
-
|
3222 |
-
|
3223 |
-
|
3224 |
-
|
3225 |
-
|
3226 |
-
|
3227 |
-
|
3228 |
-
|
3229 |
-
|
3230 |
-
|
3231 |
-
|
3232 |
-
|
3233 |
-
|
3234 |
-
|
3235 |
-
|
3236 |
-
|
3237 |
-
|
3238 |
-
|
3239 |
-
|
3240 |
-
|
3241 |
-
|
3242 |
-
|
3243 |
-
|
3244 |
-
|
3245 |
-
|
3246 |
-
|
3247 |
-
|
3248 |
-
|
3249 |
-
|
3250 |
-
|
3251 |
-
|
3252 |
-
|
3253 |
-
|
3254 |
-
|
3255 |
-
|
3256 |
-
|
3257 |
-
|
3258 |
-
|
3259 |
-
|
3260 |
-
|
3261 |
-
|
3262 |
-
|
3263 |
-
|
3264 |
-
|
3265 |
-
|
3266 |
-
|
3267 |
-
|
3268 |
-
|
3269 |
-
|
3270 |
-
|
3271 |
-
|
3272 |
-
|
3273 |
-
|
3274 |
-
|
3275 |
-
|
3276 |
-
|
3277 |
-
|
3278 |
-
|
3279 |
-
|
3280 |
-
|
3281 |
-
|
3282 |
-
|
3283 |
-
|
3284 |
-
|
3285 |
-
|
3286 |
-
|
3287 |
-
|
3288 |
-
|
3289 |
-
|
3290 |
-
|
3291 |
-
|
3292 |
-
|
3293 |
-
|
3294 |
-
|
3295 |
-
|
3296 |
-
|
3297 |
-
|
3298 |
-
|
3299 |
-
|
3300 |
-
|
3301 |
-
|
3302 |
-
|
3303 |
-
|
3304 |
-
|
3305 |
-
}
|
3306 |
-
|
3307 |
-
|
3308 |
-
|
3309 |
-
|
3310 |
-
|
3311 |
-
|
3312 |
-
|
3313 |
-
|
3314 |
-
|
3315 |
-
|
3316 |
-
|
3317 |
-
|
3318 |
-
|
3319 |
-
|
3320 |
-
|
3321 |
-
|
3322 |
-
|
3323 |
-
|
3324 |
-
|
3325 |
-
|
3326 |
-
|
3327 |
-
|
3328 |
-
|
3329 |
-
|
3330 |
-
|
3331 |
-
} // end
|
3332 |
-
|
3333 |
-
/**
|
3334 |
-
|
3335 |
-
*/
|
3336 |
-
function
|
3337 |
-
|
3338 |
-
|
3339 |
-
|
3340 |
-
|
3341 |
-
|
3342 |
-
|
3343 |
-
|
3344 |
-
|
3345 |
-
|
3346 |
-
|
3347 |
-
|
3348 |
-
|
3349 |
-
|
3350 |
-
|
3351 |
-
|
3352 |
-
|
3353 |
-
|
3354 |
-
|
3355 |
-
|
3356 |
-
|
3357 |
-
|
3358 |
-
|
3359 |
-
|
3360 |
-
|
3361 |
-
|
3362 |
-
|
3363 |
-
|
3364 |
-
|
3365 |
-
|
3366 |
-
|
3367 |
-
|
3368 |
-
|
3369 |
-
|
3370 |
-
|
3371 |
-
|
3372 |
-
|
3373 |
-
|
3374 |
-
|
3375 |
-
|
3376 |
-
|
3377 |
-
|
3378 |
-
|
3379 |
-
|
3380 |
-
|
3381 |
-
|
3382 |
-
|
3383 |
-
|
3384 |
-
|
3385 |
-
|
3386 |
-
|
3387 |
-
|
3388 |
-
|
3389 |
-
|
3390 |
-
|
3391 |
-
|
3392 |
-
|
3393 |
-
|
3394 |
-
|
3395 |
-
|
3396 |
-
|
3397 |
-
|
3398 |
-
|
3399 |
-
|
3400 |
-
|
3401 |
-
|
3402 |
-
|
3403 |
-
|
3404 |
-
|
3405 |
-
|
3406 |
-
|
3407 |
-
|
3408 |
-
|
3409 |
-
|
3410 |
-
|
3411 |
-
|
3412 |
-
|
3413 |
-
|
3414 |
-
|
3415 |
-
|
3416 |
-
|
3417 |
-
}
|
3418 |
-
|
3419 |
-
|
3420 |
-
|
3421 |
-
|
3422 |
-
|
3423 |
-
|
3424 |
-
|
3425 |
-
|
3426 |
-
|
3427 |
-
|
3428 |
-
|
3429 |
-
|
3430 |
-
|
3431 |
-
|
3432 |
-
|
3433 |
-
|
3434 |
-
|
3435 |
-
|
3436 |
-
|
3437 |
-
|
3438 |
-
|
3439 |
-
$
|
3440 |
-
|
3441 |
-
|
3442 |
-
|
3443 |
-
|
3444 |
-
|
3445 |
-
|
3446 |
-
|
3447 |
-
|
3448 |
-
|
3449 |
-
|
3450 |
-
|
3451 |
-
|
3452 |
-
|
3453 |
-
|
3454 |
-
|
3455 |
-
|
3456 |
-
|
3457 |
-
|
3458 |
-
|
3459 |
-
|
3460 |
-
|
3461 |
-
|
3462 |
-
|
3463 |
-
|
3464 |
-
|
3465 |
-
|
3466 |
-
|
3467 |
-
$
|
3468 |
-
|
3469 |
-
|
3470 |
-
|
3471 |
-
|
3472 |
-
|
3473 |
-
|
3474 |
-
|
3475 |
-
|
3476 |
-
|
3477 |
-
|
3478 |
-
|
3479 |
-
$
|
3480 |
-
|
3481 |
-
|
3482 |
-
|
3483 |
-
|
3484 |
-
|
3485 |
-
|
3486 |
-
|
3487 |
-
|
3488 |
-
|
3489 |
-
|
3490 |
-
|
3491 |
-
$
|
3492 |
-
|
3493 |
-
|
3494 |
-
|
3495 |
-
|
3496 |
-
|
3497 |
-
|
3498 |
-
|
3499 |
-
|
3500 |
-
|
3501 |
-
|
3502 |
-
|
3503 |
-
|
3504 |
-
|
3505 |
-
|
3506 |
-
|
3507 |
-
|
3508 |
-
|
3509 |
-
|
3510 |
-
|
3511 |
-
|
3512 |
-
|
3513 |
-
|
3514 |
-
|
3515 |
-
|
3516 |
-
|
3517 |
-
|
3518 |
-
|
3519 |
-
|
3520 |
-
|
3521 |
-
|
3522 |
-
|
3523 |
-
|
3524 |
-
|
3525 |
-
|
3526 |
-
|
3527 |
-
|
3528 |
-
$
|
3529 |
-
$
|
3530 |
-
|
3531 |
-
|
3532 |
-
|
3533 |
-
|
3534 |
-
|
3535 |
-
|
3536 |
-
|
3537 |
-
|
3538 |
-
|
3539 |
-
|
3540 |
-
|
3541 |
-
//
|
3542 |
-
$
|
3543 |
-
|
3544 |
-
|
3545 |
-
|
3546 |
-
|
3547 |
-
|
3548 |
-
|
3549 |
-
|
3550 |
-
|
3551 |
-
|
3552 |
-
|
3553 |
-
|
3554 |
-
|
3555 |
-
|
3556 |
-
|
3557 |
-
|
3558 |
-
|
3559 |
-
|
3560 |
-
|
3561 |
-
|
3562 |
-
|
3563 |
-
|
3564 |
-
|
3565 |
-
|
3566 |
-
|
3567 |
-
|
3568 |
-
|
3569 |
-
|
3570 |
-
|
3571 |
-
|
3572 |
-
|
3573 |
-
|
3574 |
-
|
3575 |
-
|
3576 |
-
|
3577 |
-
|
3578 |
-
|
3579 |
-
|
3580 |
-
|
3581 |
-
|
3582 |
-
|
3583 |
-
|
3584 |
-
//
|
3585 |
-
if (
|
3586 |
-
add_action('
|
3587 |
-
}
|
3588 |
-
|
3589 |
-
if
|
3590 |
-
|
3591 |
-
|
3592 |
-
|
3593 |
-
|
3594 |
-
|
3595 |
-
|
3596 |
-
|
3597 |
-
|
3598 |
-
|
3599 |
-
|
3600 |
-
|
3601 |
-
|
3602 |
-
|
3603 |
-
|
3604 |
-
|
3605 |
-
|
3606 |
-
|
3607 |
-
|
3608 |
-
|
3609 |
-
|
3610 |
-
|
3611 |
-
|
3612 |
-
|
3613 |
-
|
3614 |
-
|
3615 |
-
|
3616 |
-
|
3617 |
-
|
3618 |
-
|
3619 |
-
//
|
3620 |
-
if (
|
3621 |
-
add_action('
|
3622 |
-
}
|
3623 |
-
|
3624 |
-
|
3625 |
-
|
3626 |
-
|
3627 |
-
|
3628 |
-
|
3629 |
-
|
3630 |
-
|
3631 |
-
|
3632 |
-
|
3633 |
-
|
3634 |
-
|
3635 |
-
|
3636 |
-
|
3637 |
-
|
3638 |
-
|
3639 |
-
|
3640 |
-
|
3641 |
-
|
3642 |
-
|
3643 |
-
}
|
3644 |
-
|
3645 |
-
|
3646 |
-
|
3647 |
-
|
3648 |
-
|
3649 |
-
|
3650 |
-
|
3651 |
-
|
3652 |
-
|
3653 |
-
|
3654 |
-
|
3655 |
-
|
3656 |
-
|
3657 |
-
|
3658 |
-
|
3659 |
-
|
3660 |
-
|
3661 |
-
|
3662 |
-
|
3663 |
-
|
3664 |
-
|
3665 |
-
|
3666 |
-
|
3667 |
-
|
3668 |
-
|
3669 |
-
|
3670 |
-
|
3671 |
-
|
3672 |
-
|
3673 |
-
|
3674 |
-
|
3675 |
-
|
3676 |
-
|
3677 |
-
|
3678 |
-
|
3679 |
-
|
3680 |
-
|
3681 |
-
|
3682 |
-
|
3683 |
-
|
3684 |
-
|
3685 |
-
|
3686 |
-
|
3687 |
-
|
3688 |
-
|
3689 |
-
|
3690 |
-
|
3691 |
-
|
3692 |
-
|
3693 |
-
|
3694 |
-
|
3695 |
-
|
3696 |
-
|
3697 |
-
|
3698 |
-
var $
|
3699 |
-
var $
|
3700 |
-
var $
|
3701 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3702 |
?>
|
1 |
+
<?php
|
2 |
+
/*
|
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.1
|
7 |
+
Author: Matthew Robinson
|
8 |
+
Author URI: http://subscribe2.wordpress.com
|
9 |
+
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*
|
13 |
+
Copyright (C) 2006-10 Matthew Robinson
|
14 |
+
Based on the Original Subscribe2 plugin by
|
15 |
+
Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
|
16 |
+
|
17 |
+
This file is part of Subscribe2.
|
18 |
+
|
19 |
+
Subscribe2 is free software: you can redistribute it and/or modify
|
20 |
+
it under the terms of the GNU General Public License as published by
|
21 |
+
the Free Software Foundation, either version 3 of the License, or
|
22 |
+
(at your option) any later version.
|
23 |
+
|
24 |
+
Subscribe2 is distributed in the hope that it will be useful,
|
25 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
26 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
27 |
+
GNU General Public License for more details.
|
28 |
+
|
29 |
+
You should have received a copy of the GNU General Public License
|
30 |
+
along with Subscribe2. If not, see <http://www.gnu.org/licenses/>.
|
31 |
+
*/
|
32 |
+
|
33 |
+
// our version number. Don't touch this or any line below
|
34 |
+
// unless you know exactly what you are doing
|
35 |
+
define( 'S2VERSION', '6.1' );
|
36 |
+
define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
|
37 |
+
define( 'S2DIR', plugin_basename(dirname(__FILE__)) );
|
38 |
+
|
39 |
+
// Set minimum execution time to 5 minutes - won't affect safe mode
|
40 |
+
$safe_mode = array('On', 'ON', 'on', 1);
|
41 |
+
if ( !in_array(ini_get('safe_mode'), $safe_mode) && ini_get('max_execution_time') < 300 ) {
|
42 |
+
@ini_set('max_execution_time', 300);
|
43 |
+
}
|
44 |
+
|
45 |
+
/* Include buttonsnap library by Owen Winckler */
|
46 |
+
if ( !class_exists('buttonsnap') ) {
|
47 |
+
require( WP_CONTENT_DIR . '/plugins/' . S2DIR . '/include/buttonsnap.php' );
|
48 |
+
}
|
49 |
+
|
50 |
+
$mysubscribe2 = new s2class;
|
51 |
+
$mysubscribe2->s2init();
|
52 |
+
|
53 |
+
// start our class
|
54 |
+
class s2class {
|
55 |
+
// variables and constructor are declared at the end
|
56 |
+
|
57 |
+
/**
|
58 |
+
Load all our strings
|
59 |
+
*/
|
60 |
+
function load_strings() {
|
61 |
+
// adjust the output of Subscribe2 here
|
62 |
+
|
63 |
+
$this->please_log_in = "<p>" . __('To manage your subscription options please', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-login.php\">" . __('login', 'subscribe2') . "</a>.</p>";
|
64 |
+
|
65 |
+
$this->use_profile_admin = "<p>" . __('You may manage your subscription options from your', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-admin/users.php?page=s2_users\">" . __('profile', 'subscribe2') . "</a>.</p>";
|
66 |
+
if ( $this->s2_mu === true ) {
|
67 |
+
global $blog_id, $user_ID;
|
68 |
+
if ( !is_blog_user($blog_id) ) {
|
69 |
+
// if we are on multisite and the user is not a member of this blog change the link
|
70 |
+
$this->use_profile_admin = "<p><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>";
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
$this->use_profile_users = "<p>" . __('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>";
|
75 |
+
if ( $this->s2_mu === true ) {
|
76 |
+
global $blog_id, $user_ID;
|
77 |
+
if ( !is_blog_user($blog_id) ) {
|
78 |
+
// if we are on multisite and the user is not a member of this blog change the link
|
79 |
+
$this->use_profile_users = "<p><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>";
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
$this->confirmation_sent = "<p>" . __('A confirmation message is on its way!', 'subscribe2') . "</p>";
|
84 |
+
|
85 |
+
$this->already_subscribed = "<p>" . __('That email address is already subscribed.', 'subscribe2') . "</p>";
|
86 |
+
|
87 |
+
$this->not_subscribed = "<p>" . __('That email address is not subscribed.', 'subscribe2') . "</p>";
|
88 |
+
|
89 |
+
$this->not_an_email = "<p>" . __('Sorry, but that does not look like an email address to me.', 'subscribe2') . "</p>";
|
90 |
+
|
91 |
+
$this->barred_domain = "<p>" . __('Sorry, email addresses at that domain are currently barred due to spam, please use an alternative email address.', 'subscribe2') . "</p>";
|
92 |
+
|
93 |
+
$this->error = "<p>" . __('Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2') . "</p>";
|
94 |
+
|
95 |
+
$this->no_page = "<p>" . __('You must to create a WordPress page for this plugin to work correctly.', 'subscribe2') . "<p>";
|
96 |
+
|
97 |
+
$this->mail_sent = "<p>" . __('Message sent!', 'subscribe2') . "</p>";
|
98 |
+
|
99 |
+
$this->mail_failed = "<p>" . __('Message failed! Check your settings and check with your hosting provider', 'subscribe2') . "</p>";
|
100 |
+
|
101 |
+
// confirmation messages
|
102 |
+
$this->no_such_email = "<p>" . __('No such email address is registered.', 'subscribe2') . "</p>";
|
103 |
+
|
104 |
+
$this->added = "<p>" . __('You have successfully subscribed!', 'subscribe2') . "</p>";
|
105 |
+
|
106 |
+
$this->deleted = "<p>" . __('You have successfully unsubscribed.', 'subscribe2') . "</p>";
|
107 |
+
|
108 |
+
$this->subscribe = __('subscribe', 'subscribe2'); //ACTION replacement in subscribing confirmation email
|
109 |
+
|
110 |
+
$this->unsubscribe = __('unsubscribe', 'subscribe2'); //ACTION replacement in unsubscribing in confirmation email
|
111 |
+
|
112 |
+
// menu strings
|
113 |
+
$this->options_saved = __('Options saved!', 'subscribe2');
|
114 |
+
$this->options_reset = __('Options reset!', 'subscribe2');
|
115 |
+
} // end load_strings()
|
116 |
+
|
117 |
+
/* ===== WordPress menu registration and scripts ===== */
|
118 |
+
/**
|
119 |
+
Hook the menu
|
120 |
+
*/
|
121 |
+
function admin_menu() {
|
122 |
+
$s2management = add_management_page(__('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), "manage_options", 's2_tools', array(&$this, 'manage_menu'));
|
123 |
+
add_action("admin_print_scripts-$s2management", array(&$this, 'checkbox_form_js'));
|
124 |
+
|
125 |
+
$s2options = add_options_page(__('Subscribe2 Options', 'subscribe2'), __('Subscribe2', 'subscribe2'), "manage_options", '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 |
+
$s2user = add_users_page(__('Your Subscriptions', 'subscribe2'), __('Your Subscriptions', 'subscribe2'), "read", 's2_users', array(&$this, 'user_menu'));
|
131 |
+
add_action("admin_print_scripts-$s2user", array(&$this, 'checkbox_form_js'));
|
132 |
+
add_action("admin_print_styles-$s2user", array(&$this, 'user_admin_css'));
|
133 |
+
|
134 |
+
add_submenu_page('post-new.php', __('Mail Subscribers', 'subscribe2'), __('Mail Subscribers', 'subscribe2'), "publish_posts", 's2_posts', array(&$this, 'write_menu'));
|
135 |
+
|
136 |
+
$s2nonce = md5('subscribe2');
|
137 |
+
} // end admin_menu()
|
138 |
+
|
139 |
+
/**
|
140 |
+
Hook for Admin Drop Down Icons
|
141 |
+
*/
|
142 |
+
function ozh_s2_icon() {
|
143 |
+
return WP_CONTENT_URL . '/plugins/' . S2DIR . '/include/email_edit.png';
|
144 |
+
} // end ozh_s2_icon()
|
145 |
+
|
146 |
+
/**
|
147 |
+
Insert Javascript into admin_header
|
148 |
+
*/
|
149 |
+
function checkbox_form_js() {
|
150 |
+
wp_enqueue_script('s2_checkbox', WP_CONTENT_URL . '/plugins/' . S2DIR . '/include/s2_checkbox.js', array('jquery'), '1.0');
|
151 |
+
} //end checkbox_form_js()
|
152 |
+
|
153 |
+
function user_admin_css() {
|
154 |
+
wp_enqueue_style('s2_user_admin', WP_CONTENT_URL . '/plugins/ '. S2DIR . '/include/s2_user_admin.css', array(), '1.0');
|
155 |
+
}
|
156 |
+
|
157 |
+
function option_form_js() {
|
158 |
+
wp_enqueue_script('s2_edit', WP_CONTENT_URL . '/plugins/' . S2DIR . '/include/s2_edit.js', array('jquery'), '1.0');
|
159 |
+
} // end option_form_js()
|
160 |
+
|
161 |
+
/* ===== Install, upgrade, reset ===== */
|
162 |
+
/**
|
163 |
+
Install our table
|
164 |
+
*/
|
165 |
+
function install() {
|
166 |
+
// include upgrade-functions for maybe_create_table;
|
167 |
+
if ( !function_exists('maybe_create_table') ) {
|
168 |
+
require_once(ABSPATH . 'wp-admin/install-helper.php');
|
169 |
+
}
|
170 |
+
$date = date('Y-m-d');
|
171 |
+
$sql = "CREATE TABLE $this->public (
|
172 |
+
id int(11) NOT NULL auto_increment,
|
173 |
+
email varchar(64) NOT NULL default '',
|
174 |
+
active tinyint(1) default 0,
|
175 |
+
date DATE default '$date' NOT NULL,
|
176 |
+
ip char(64) NOT NULL default 'admin',
|
177 |
+
PRIMARY KEY (id) )";
|
178 |
+
|
179 |
+
// create the table, as needed
|
180 |
+
maybe_create_table($this->public, $sql);
|
181 |
+
|
182 |
+
// safety check if options exist and if not create them
|
183 |
+
if ( !is_array($this->subscribe2_options) ) {
|
184 |
+
$this->reset();
|
185 |
+
}
|
186 |
+
} // end install()
|
187 |
+
|
188 |
+
/**
|
189 |
+
Upgrade the database
|
190 |
+
*/
|
191 |
+
function upgrade() {
|
192 |
+
global $wpdb, $wp_version, $wpmu_version;
|
193 |
+
// include upgrade-functions for maybe_add_column;
|
194 |
+
if ( !function_exists('maybe_add_column') ) {
|
195 |
+
require_once(ABSPATH . 'wp-admin/install-helper.php');
|
196 |
+
}
|
197 |
+
$date = date('Y-m-d');
|
198 |
+
maybe_add_column($this->public, 'date', "ALTER TABLE $this->public ADD date DATE DEFAULT '$date' NOT NULL AFTER active;");
|
199 |
+
maybe_add_column($this->public, 'ip', "ALTER TABLE $this->public ADD ip char(64) DEFAULT 'admin' NOT NULL AFTER date;");
|
200 |
+
|
201 |
+
// let's take the time to check process registered users
|
202 |
+
// existing public subscribers are subscribed to all categories
|
203 |
+
$users = $this->get_all_registered('ID');
|
204 |
+
if ( !empty($users) ) {
|
205 |
+
foreach ( $users as $user ) {
|
206 |
+
$this->register($user);
|
207 |
+
}
|
208 |
+
}
|
209 |
+
// update the options table to serialized format
|
210 |
+
$old_options = $wpdb->get_col("SELECT option_name from $wpdb->options where option_name LIKE 's2%' AND option_name != 's2_future_posts'");
|
211 |
+
|
212 |
+
if ( !empty($old_options) ) {
|
213 |
+
foreach ( $old_options as $option ) {
|
214 |
+
$value = get_option($option);
|
215 |
+
$option_array = substr($option, 3);
|
216 |
+
$this->subscribe2_options[$option_array] = $value;
|
217 |
+
delete_option($option);
|
218 |
+
}
|
219 |
+
}
|
220 |
+
$this->subscribe2_options['version'] = S2VERSION;
|
221 |
+
// ensure that the options are in the database
|
222 |
+
require(S2PATH . "include/options.php");
|
223 |
+
// correct autoformat to upgrade from pre 5.6
|
224 |
+
if ( $this->subscribe2_options['autoformat'] == 'text' ) {
|
225 |
+
$this->subscribe2_options['autoformat'] = 'excerpt';
|
226 |
+
}
|
227 |
+
if ( $this->subscribe2_options['autoformat'] == 'full' ) {
|
228 |
+
$this->subscribe2_options['autoformat'] = 'post';
|
229 |
+
}
|
230 |
+
update_option('subscribe2_options', $this->subscribe2_options);
|
231 |
+
|
232 |
+
// upgrade old wpmu user meta data to new
|
233 |
+
if ( $this->s2_mu === true ) {
|
234 |
+
$this->namechange_subscribe2_widget();
|
235 |
+
// loop through all users
|
236 |
+
foreach ( $users as $user ) {
|
237 |
+
// get categories which the user is subscribed to (old ones)
|
238 |
+
$categories = get_usermeta($user, 's2_subscribed');
|
239 |
+
$categories = explode(',', $categories);
|
240 |
+
|
241 |
+
// load blogs of user (only if we need them)
|
242 |
+
$blogs = array();
|
243 |
+
if ( count($categories) > 0 && !in_array('-1', $categories) ) {
|
244 |
+
$blogs = get_blogs_of_user($user, true);
|
245 |
+
}
|
246 |
+
|
247 |
+
foreach ( $blogs as $blog_id => $blog ) {
|
248 |
+
switch_to_blog($blog_id);
|
249 |
+
|
250 |
+
$blog_categories = (array)$wpdb->get_col("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category'");
|
251 |
+
$subscribed_categories = array_intersect($categories, $blog_categories);
|
252 |
+
if ( !empty($subscribed_categories) ) {
|
253 |
+
foreach ( $subscribed_categories as $subscribed_category ) {
|
254 |
+
update_usermeta($user, $this->get_usermeta_keyname('s2_cat') . $subscribed_category, $subscribed_category);
|
255 |
+
}
|
256 |
+
update_usermeta($user, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $subscribed_categories));
|
257 |
+
}
|
258 |
+
restore_current_blog();
|
259 |
+
}
|
260 |
+
|
261 |
+
// delete old user meta keys
|
262 |
+
delete_usermeta($user, 's2_subscribed');
|
263 |
+
foreach ( $categories as $cat ) {
|
264 |
+
delete_usermeta($user, 's2_cat' . $cat);
|
265 |
+
}
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
// ensure existing public subscriber emails are all sanitized
|
270 |
+
$confirmed = $this->get_public();
|
271 |
+
$unconfirmed = $this->get_public(0);
|
272 |
+
$public_subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
|
273 |
+
|
274 |
+
foreach ( $public_subscribers as $email ) {
|
275 |
+
$new_email = $this->sanitize_email($email);
|
276 |
+
if ( $email !== $new_email ) {
|
277 |
+
$wpdb->get_results("UPDATE $this->public SET email='$new_email' WHERE CAST(email as binary)='$email'");
|
278 |
+
}
|
279 |
+
}
|
280 |
+
} // end upgrade()
|
281 |
+
|
282 |
+
/**
|
283 |
+
Reset our options
|
284 |
+
*/
|
285 |
+
function reset() {
|
286 |
+
delete_option('subscribe2_options');
|
287 |
+
wp_clear_scheduled_hook('s2_digest_cron');
|
288 |
+
unset($this->subscribe2_options);
|
289 |
+
require(S2PATH . "include/options.php");
|
290 |
+
update_option('subscribe2_options', $this->subscribe2_options);
|
291 |
+
} // end reset()
|
292 |
+
|
293 |
+
/* ===== mail handling ===== */
|
294 |
+
/**
|
295 |
+
Performs string substitutions for subscribe2 mail texts
|
296 |
+
*/
|
297 |
+
function substitute($string = '') {
|
298 |
+
if ( '' == $string ) {
|
299 |
+
return;
|
300 |
+
}
|
301 |
+
$string = str_replace("BLOGNAME", html_entity_decode(get_option('blogname'), ENT_QUOTES), $string);
|
302 |
+
$string = str_replace("BLOGLINK", get_option('home'), $string);
|
303 |
+
$string = str_replace("TITLE", stripslashes($this->post_title), $string);
|
304 |
+
$link = "<a href=\"" . $this->permalink . "\">" . $this->permalink . "</a>";
|
305 |
+
$string = str_replace("PERMALINK", $link, $string);
|
306 |
+
if ( strstr($string, "TINYLINK") ) {
|
307 |
+
$tinylink = file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode($this->permalink));
|
308 |
+
if ( $tinylink !== 'Error' || $tinylink != false ) {
|
309 |
+
$tlink = "<a href=\"" . $tinylink . "\">" . $tinylink . "</a>";
|
310 |
+
$string = str_replace("TINYLINK", $tlink, $string);
|
311 |
+
} else {
|
312 |
+
$string = str_replace("TINYLINK", $link, $string);
|
313 |
+
}
|
314 |
+
}
|
315 |
+
$string = str_replace("DATE", $this->post_date, $string);
|
316 |
+
$string = str_replace("TIME", $this->post_time, $string);
|
317 |
+
$string = str_replace("MYNAME", stripslashes($this->myname), $string);
|
318 |
+
$string = str_replace("EMAIL", $this->myemail, $string);
|
319 |
+
$string = str_replace("AUTHORNAME", stripslashes($this->authorname), $string);
|
320 |
+
$string = str_replace("CATS", $this->post_cat_names, $string);
|
321 |
+
$string = str_replace("TAGS", $this->post_tag_names, $string);
|
322 |
+
$string = str_replace("COUNT", $this->post_count, $string);
|
323 |
+
|
324 |
+
return $string;
|
325 |
+
} // end substitute()
|
326 |
+
|
327 |
+
/**
|
328 |
+
Delivers email to recipients in HTML or plaintext
|
329 |
+
*/
|
330 |
+
function mail($recipients = array(), $subject = '', $message = '', $type='text') {
|
331 |
+
if ( empty($recipients) || '' == $message ) { return; }
|
332 |
+
|
333 |
+
if ( 'html' == $type ) {
|
334 |
+
$headers = $this->headers('html');
|
335 |
+
if ( 'yes' == $this->subscribe2_options['stylesheet'] ) {
|
336 |
+
$mailtext = apply_filters('s2_html_email', "<html><head><title>" . $subject . "</title><link rel=\"stylesheet\" href=\"" . get_stylesheet_uri() . "\" type=\"text/css\" media=\"screen\" /></head><body>" . $message . "</body></html>");
|
337 |
+
} else {
|
338 |
+
$mailtext = apply_filters('s2_html_email', "<html><head><title>" . $subject . "</title></head><body>" . $message . "</body></html>");
|
339 |
+
}
|
340 |
+
} else {
|
341 |
+
$headers = $this->headers();
|
342 |
+
$message = preg_replace('|&[^a][^m][^p].{0,3};|', '', $message);
|
343 |
+
$message = preg_replace('|&|', '&', $message);
|
344 |
+
$message = wordwrap(strip_tags($message), 80, "\n");
|
345 |
+
$mailtext = apply_filters('s2_plain_email', $message);
|
346 |
+
}
|
347 |
+
|
348 |
+
// Replace any escaped html symbols in subject
|
349 |
+
$subject = html_entity_decode($subject, ENT_QUOTES);
|
350 |
+
|
351 |
+
// Construct BCC headers for sending or send individual emails
|
352 |
+
$bcc = '';
|
353 |
+
natcasesort($recipients);
|
354 |
+
if ( function_exists('wpmq_mail') || $this->subscribe2_options['bcclimit'] == 1 ) {
|
355 |
+
// BCCLimit is 1 so send individual emails
|
356 |
+
foreach ( $recipients as $recipient ) {
|
357 |
+
$recipient = trim($recipient);
|
358 |
+
// sanity check -- make sure we have a valid email
|
359 |
+
if ( !is_email($recipient) || empty($recipient) ) { continue; }
|
360 |
+
// Use the mail queue provided we are not sending a preview
|
361 |
+
if ( function_exists('wpmq_mail') && !$this->preview_email ) {
|
362 |
+
@wp_mail($recipient, $subject, $mailtext, $headers, '', 0);
|
363 |
+
} else {
|
364 |
+
@wp_mail($recipient, $subject, $mailtext, $headers);
|
365 |
+
}
|
366 |
+
}
|
367 |
+
return true;
|
368 |
+
} elseif ( $this->subscribe2_options['bcclimit'] == 0 ) {
|
369 |
+
// we're not using BCCLimit
|
370 |
+
foreach ( $recipients as $recipient ) {
|
371 |
+
$recipient = trim($recipient);
|
372 |
+
// sanity check -- make sure we have a valid email
|
373 |
+
if ( !is_email($recipient) ) { continue; }
|
374 |
+
// and NOT the sender's email, since they'll get a copy anyway
|
375 |
+
if ( !empty($recipient) && $this->myemail != $recipient ) {
|
376 |
+
('' == $bcc) ? $bcc = "Bcc: $recipient" : $bcc .= ", $recipient";
|
377 |
+
// Bcc Headers now constructed by phpmailer class
|
378 |
+
}
|
379 |
+
}
|
380 |
+
$headers .= "$bcc\n";
|
381 |
+
} else {
|
382 |
+
// we're using BCCLimit
|
383 |
+
$count = 1;
|
384 |
+
$batch = array();
|
385 |
+
foreach ( $recipients as $recipient ) {
|
386 |
+
$recipient = trim($recipient);
|
387 |
+
// sanity check -- make sure we have a valid email
|
388 |
+
if ( !is_email($recipient) ) { continue; }
|
389 |
+
// and NOT the sender's email, since they'll get a copy anyway
|
390 |
+
if ( !empty($recipient) && $this->myemail != $recipient ) {
|
391 |
+
('' == $bcc) ? $bcc = "Bcc: $recipient" : $bcc .= ", $recipient";
|
392 |
+
// Bcc Headers now constructed by phpmailer class
|
393 |
+
}
|
394 |
+
if ( $this->subscribe2_options['bcclimit'] == $count ) {
|
395 |
+
$count = 0;
|
396 |
+
$batch[] = $bcc;
|
397 |
+
$bcc = '';
|
398 |
+
}
|
399 |
+
$count++;
|
400 |
+
}
|
401 |
+
// add any partially completed batches to our batch array
|
402 |
+
if ( '' != $bcc ) {
|
403 |
+
$batch[] = $bcc;
|
404 |
+
}
|
405 |
+
}
|
406 |
+
// rewind the array, just to be safe
|
407 |
+
reset($recipients);
|
408 |
+
|
409 |
+
// actually send mail
|
410 |
+
if ( isset($batch) && !empty($batch) ) {
|
411 |
+
foreach ( $batch as $bcc ) {
|
412 |
+
$newheaders = $headers . "$bcc\n";
|
413 |
+
$status = @wp_mail($this->myemail, $subject, $mailtext, $newheaders);
|
414 |
+
}
|
415 |
+
} else {
|
416 |
+
$status = @wp_mail($this->myemail, $subject, $mailtext, $headers);
|
417 |
+
}
|
418 |
+
return $status;
|
419 |
+
} // end mail()
|
420 |
+
|
421 |
+
/**
|
422 |
+
Construct standard set of email headers
|
423 |
+
*/
|
424 |
+
function headers($type='text') {
|
425 |
+
if ( empty($this->myname) || empty($this->myemail) ) {
|
426 |
+
$admin = $this->get_userdata($this->subscribe2_options['sender']);
|
427 |
+
$this->myname = html_entity_decode($admin->display_name, ENT_QUOTES);
|
428 |
+
$this->myemail = $admin->user_email;
|
429 |
+
}
|
430 |
+
|
431 |
+
$header['From'] = $this->myname . " <" . $this->myemail . ">";
|
432 |
+
$header['Reply-To'] = $this->myname . " <" . $this->myemail . ">";
|
433 |
+
$header['Return-path'] = "<" . $this->myemail . ">";
|
434 |
+
$header['Precedence'] = "list\nList-Id: " . get_option('blogname') . "";
|
435 |
+
$header['X-Mailer'] = "PHP" . phpversion() . "";
|
436 |
+
if ( $type == 'html' ) {
|
437 |
+
// To send HTML mail, the Content-Type header must be set
|
438 |
+
$header['Content-Type'] = get_option('html_type') . "; charset=\"". get_option('blog_charset') . "\"";
|
439 |
+
} else {
|
440 |
+
$header['Content-Type'] = "text/plain; charset=\"". get_option('blog_charset') . "\"";
|
441 |
+
}
|
442 |
+
|
443 |
+
// apply header filter to allow on-the-fly amendments
|
444 |
+
$header = apply_filters('s2_email_headers', $header);
|
445 |
+
// collapse the headers using $key as the header name
|
446 |
+
foreach ( $header as $key => $value ) {
|
447 |
+
$headers[$key] = $key . ": " . $value;
|
448 |
+
}
|
449 |
+
$headers = implode("\n", $headers);
|
450 |
+
$headers .= "\n";
|
451 |
+
|
452 |
+
return $headers;
|
453 |
+
} // end headers()
|
454 |
+
|
455 |
+
/**
|
456 |
+
Sends an email notification of a new post
|
457 |
+
*/
|
458 |
+
function publish($post = 0, $preview = '') {
|
459 |
+
if ( !$post ) { return $post; }
|
460 |
+
|
461 |
+
if ( $this->s2_mu ) {
|
462 |
+
global $switched;
|
463 |
+
if ( $switched ) { return; }
|
464 |
+
}
|
465 |
+
|
466 |
+
if ( $preview == '' ) {
|
467 |
+
// we aren't sending a Preview to the current user so carry out checks
|
468 |
+
$s2mail = get_post_meta($post->ID, 's2mail', true);
|
469 |
+
if ( (isset($_POST['s2_meta_field']) && $_POST['s2_meta_field'] == 'no') || strtolower(trim($s2mail)) == 'no' ) { return $post; }
|
470 |
+
|
471 |
+
// are we doing daily digests? If so, don't send anything now
|
472 |
+
if ( $this->subscribe2_options['email_freq'] != 'never' ) { return $post; }
|
473 |
+
|
474 |
+
// is the current post of a type that should generate a notification email?
|
475 |
+
// uses s2_post_types filter to allow for custom post types in WP 3.0
|
476 |
+
if ( $this->subscribe2_options['pages'] == 'yes' ) {
|
477 |
+
$s2_post_types = array('page', 'post');
|
478 |
+
} else {
|
479 |
+
$s2_post_types = array('post');
|
480 |
+
}
|
481 |
+
$s2_post_types = apply_filters('s2_post_types', $s2_post_types);
|
482 |
+
if ( !in_array($post->post_type, $s2_post_types) ) {
|
483 |
+
return $post;
|
484 |
+
}
|
485 |
+
|
486 |
+
// is this post set in the future?
|
487 |
+
if ( $post->post_date > current_time('mysql') ) {
|
488 |
+
// bail out
|
489 |
+
return $post;
|
490 |
+
}
|
491 |
+
|
492 |
+
//Are we sending notifications for password protected posts?
|
493 |
+
if ( $this->subscribe2_options['password'] == "no" && $post->post_password != '' ) {
|
494 |
+
return $post;
|
495 |
+
}
|
496 |
+
|
497 |
+
$post_cats = wp_get_post_categories($post->ID);
|
498 |
+
$check = false;
|
499 |
+
// is the current post assigned to any categories
|
500 |
+
// which should not generate a notification email?
|
501 |
+
foreach ( explode(',', $this->subscribe2_options['exclude']) as $cat ) {
|
502 |
+
if ( in_array($cat, $post_cats) ) {
|
503 |
+
$check = true;
|
504 |
+
}
|
505 |
+
}
|
506 |
+
|
507 |
+
if ( $check ) {
|
508 |
+
// hang on -- can registered users subscribe to
|
509 |
+
// excluded categories?
|
510 |
+
if ( '0' == $this->subscribe2_options['reg_override'] ) {
|
511 |
+
// nope? okay, let's leave
|
512 |
+
return $post;
|
513 |
+
}
|
514 |
+
}
|
515 |
+
|
516 |
+
// Are we sending notifications for Private posts?
|
517 |
+
// Action is added if we are, but double check option and post status
|
518 |
+
if ( $this->subscribe2_options['private'] == "yes" && $post->post_status == 'private' ) {
|
519 |
+
// don't send notification to public users
|
520 |
+
$check = true;
|
521 |
+
}
|
522 |
+
|
523 |
+
// lets collect our subscribers
|
524 |
+
if ( !$check ) {
|
525 |
+
// if this post is assigned to an excluded
|
526 |
+
// category, or is a private post then
|
527 |
+
// don't send public subscribers a notification
|
528 |
+
$public = $this->get_public();
|
529 |
+
}
|
530 |
+
$post_cats_string = implode(',', $post_cats);
|
531 |
+
$registered = $this->get_registered("cats=$post_cats_string");
|
532 |
+
|
533 |
+
// do we have subscribers?
|
534 |
+
if ( empty($public) && empty($registered) ) {
|
535 |
+
// if not, no sense doing anything else
|
536 |
+
return $post;
|
537 |
+
}
|
538 |
+
}
|
539 |
+
|
540 |
+
// we set these class variables so that we can avoid
|
541 |
+
// passing them in function calls a little later
|
542 |
+
$this->post_title = "<a href=\"" . get_permalink($post->ID) . "\">" . html_entity_decode($post->post_title, ENT_QUOTES) . "</a>";
|
543 |
+
$this->permalink = get_permalink($post->ID);
|
544 |
+
$this->post_date = get_the_time(get_option('date_format'));
|
545 |
+
$this->post_time = get_the_time();
|
546 |
+
|
547 |
+
$author = get_userdata($post->post_author);
|
548 |
+
$this->authorname = $author->display_name;
|
549 |
+
|
550 |
+
// do we send as admin, or post author?
|
551 |
+
if ( 'author' == $this->subscribe2_options['sender'] ) {
|
552 |
+
// get author details
|
553 |
+
$user = &$author;
|
554 |
+
} else {
|
555 |
+
// get admin details
|
556 |
+
$user = $this->get_userdata($this->subscribe2_options['sender']);
|
557 |
+
}
|
558 |
+
$this->myemail = $user->user_email;
|
559 |
+
$this->myname = html_entity_decode($user->display_name, ENT_QUOTES);
|
560 |
+
|
561 |
+
$this->post_cat_names = implode(', ', wp_get_post_categories($post->ID, array('fields' => 'names')));
|
562 |
+
$this->post_tag_names = implode(', ', wp_get_post_tags($post->ID, array('fields' => 'names')));
|
563 |
+
|
564 |
+
// Get email subject
|
565 |
+
$subject = stripslashes(strip_tags($this->substitute($this->subscribe2_options['notification_subject'])));
|
566 |
+
// Get the message template
|
567 |
+
$mailtext = apply_filters('s2_email_template', $this->subscribe2_options['mailtext']);
|
568 |
+
$mailtext = stripslashes($this->substitute($mailtext));
|
569 |
+
|
570 |
+
$plaintext = $post->post_content;
|
571 |
+
if ( function_exists('strip_shortcodes') ) {
|
572 |
+
$plaintext = strip_shortcodes($plaintext);
|
573 |
+
}
|
574 |
+
$gallid = '[gallery id="' . $post->ID . '"]';
|
575 |
+
$post->post_content = str_replace('[gallery]', $gallid, $post->post_content);
|
576 |
+
$content = apply_filters('the_content', $post->post_content);
|
577 |
+
$content = str_replace("]]>", "]]>", $content);
|
578 |
+
$excerpt = $post->post_excerpt;
|
579 |
+
if ( '' == $excerpt ) {
|
580 |
+
// no excerpt, is there a <!--more--> ?
|
581 |
+
if ( false !== strpos($plaintext, '<!--more-->') ) {
|
582 |
+
list($excerpt, $more) = explode('<!--more-->', $plaintext, 2);
|
583 |
+
// strip leading and trailing whitespace
|
584 |
+
$excerpt = strip_tags($excerpt);
|
585 |
+
$excerpt = trim($excerpt);
|
586 |
+
} else {
|
587 |
+
// no <!--more-->, so grab the first 55 words
|
588 |
+
$excerpt = strip_tags($plaintext);
|
589 |
+
$words = explode(' ', $excerpt, $this->excerpt_length + 1);
|
590 |
+
if (count($words) > $this->excerpt_length) {
|
591 |
+
array_pop($words);
|
592 |
+
array_push($words, '[...]');
|
593 |
+
$excerpt = implode(' ', $words);
|
594 |
+
}
|
595 |
+
}
|
596 |
+
}
|
597 |
+
$html_excerpt = $post->post_excerpt;
|
598 |
+
if ( '' == $html_excerpt ) {
|
599 |
+
// no excerpt, is there a <!--more--> ?
|
600 |
+
if ( false !== strpos($content, '<!--more-->') ) {
|
601 |
+
list($html_excerpt, $more) = explode('<!--more-->', $content, 2);
|
602 |
+
// strip leading and trailing whitespace
|
603 |
+
$html_excerpt = balanceTags($html_excerpt);
|
604 |
+
$html_excerpt = trim($html_excerpt);
|
605 |
+
} else {
|
606 |
+
// no <!--more-->, so grab the first 55 words
|
607 |
+
$words = explode(' ', $content, $this->excerpt_length + 1);
|
608 |
+
if (count($words) > $this->excerpt_length) {
|
609 |
+
array_pop($words);
|
610 |
+
array_push($words, '[...]');
|
611 |
+
$html_excerpt = implode(' ', $words);
|
612 |
+
$html_excerpt = trim(balanceTags($html_excerpt));
|
613 |
+
}
|
614 |
+
}
|
615 |
+
}
|
616 |
+
|
617 |
+
// prepare mail body texts
|
618 |
+
$excerpt_body = str_replace("POST", $excerpt, $mailtext);
|
619 |
+
$full_body = str_replace("POST", strip_tags($plaintext), $mailtext);
|
620 |
+
$html_body = str_replace("\r\n", "<br />\r\n", $mailtext);
|
621 |
+
$html_body = str_replace("POST", $content, $html_body);
|
622 |
+
$html_excerpt_body = str_replace("\r\n", "<br />\r\n", $mailtext);
|
623 |
+
$html_excerpt_body = str_replace("POST", $html_excerpt, $html_excerpt_body);
|
624 |
+
|
625 |
+
if ( $preview != '' ) {
|
626 |
+
$this->myemail = $preview;
|
627 |
+
$this->myname = "Preview";
|
628 |
+
$this->mail(array($preview), $subject, $excerpt_body);
|
629 |
+
$this->mail(array($preview), $subject, $full_body);
|
630 |
+
$this->mail(array($preview), $subject, $html_body, 'html');
|
631 |
+
$this->mail(array($preview), $subject, $html_excerpt_body, 'html');
|
632 |
+
} else {
|
633 |
+
// first we send plaintext summary emails
|
634 |
+
$registered = $this->get_registered("cats=$post_cats_string&format=excerpt");
|
635 |
+
if ( empty($registered) ) {
|
636 |
+
$recipients = (array)$public;
|
637 |
+
} elseif ( empty($public) ) {
|
638 |
+
$recipients = (array)$registered;
|
639 |
+
} else {
|
640 |
+
$recipients = array_merge((array)$public, (array)$registered);
|
641 |
+
}
|
642 |
+
$this->mail($recipients, $subject, $excerpt_body);
|
643 |
+
|
644 |
+
// next we send plaintext full content emails
|
645 |
+
$this->mail($this->get_registered("cats=$post_cats_string&format=post"), $subject, $full_body);
|
646 |
+
|
647 |
+
// next we send html excerpt content emails
|
648 |
+
$this->mail($this->get_registered("cats=$post_cats_string&format=html_excerpt"), $subject, $html_excerpt_body, 'html');
|
649 |
+
|
650 |
+
// finally we send html full content emails
|
651 |
+
$this->mail($this->get_registered("cats=$post_cats_string&format=html"), $subject, $html_body, 'html');
|
652 |
+
}
|
653 |
+
} // end publish()
|
654 |
+
|
655 |
+
/**
|
656 |
+
Hook Subscribe2 into posts published via email
|
657 |
+
*/
|
658 |
+
function publish_phone($id) {
|
659 |
+
if ( !$id ) { return; }
|
660 |
+
|
661 |
+
$post = get_post($id);
|
662 |
+
$this->publish($post);
|
663 |
+
return $post;
|
664 |
+
} // end publish_phone()
|
665 |
+
|
666 |
+
/**
|
667 |
+
Send confirmation email to the user
|
668 |
+
*/
|
669 |
+
function send_confirm($what = '', $is_remind = false) {
|
670 |
+
if ( $this->filtered == 1 ) { return true; }
|
671 |
+
if ( !$this->email || !$what ) {
|
672 |
+
return false;
|
673 |
+
}
|
674 |
+
$id = $this->get_id($this->email);
|
675 |
+
if ( !$id ) {
|
676 |
+
return false;
|
677 |
+
}
|
678 |
+
|
679 |
+
// generate the URL "?s2=ACTION+HASH+ID"
|
680 |
+
// ACTION = 1 to subscribe, 0 to unsubscribe
|
681 |
+
// HASH = md5 hash of email address
|
682 |
+
// ID = user's ID in the subscribe2 table
|
683 |
+
// use home instead of siteurl incase index.php is not in core wordpress directory
|
684 |
+
$link = get_option('home') . "/?s2=";
|
685 |
+
|
686 |
+
if ( 'add' == $what ) {
|
687 |
+
$link .= '1';
|
688 |
+
} elseif ( 'del' == $what ) {
|
689 |
+
$link .= '0';
|
690 |
+
}
|
691 |
+
$link .= md5($this->email);
|
692 |
+
$link .= $id;
|
693 |
+
|
694 |
+
// sort the headers now so we have all substitute information
|
695 |
+
$mailheaders = $this->headers();
|
696 |
+
|
697 |
+
if ( $is_remind == true ) {
|
698 |
+
$body = $this->substitute(stripslashes($this->subscribe2_options['remind_email']));
|
699 |
+
$subject = $this->substitute(stripslashes($this->subscribe2_options['remind_subject']));
|
700 |
+
} else {
|
701 |
+
$body = $this->substitute(stripslashes($this->subscribe2_options['confirm_email']));
|
702 |
+
if ( 'add' == $what ) {
|
703 |
+
$body = str_replace("ACTION", $this->subscribe, $body);
|
704 |
+
$subject = str_replace("ACTION", $this->subscribe, $this->subscribe2_options['confirm_subject']);
|
705 |
+
} elseif ( 'del' == $what ) {
|
706 |
+
$body = str_replace("ACTION", $this->unsubscribe, $body);
|
707 |
+
$subject = str_replace("ACTION", $this->unsubscribe, $this->subscribe2_options['confirm_subject']);
|
708 |
+
}
|
709 |
+
$subject = html_entity_decode($this->substitute(stripslashes($subject)), ENT_QUOTES);
|
710 |
+
}
|
711 |
+
|
712 |
+
$body = str_replace("LINK", $link, $body);
|
713 |
+
|
714 |
+
if ( $is_remind == true && function_exists('wpmq_mail') ) {
|
715 |
+
// could be sending lots of reminders so queue them if wpmq is enabled
|
716 |
+
@wp_mail($this->email, $subject, $body, $mailheaders, '', 0);
|
717 |
+
} else {
|
718 |
+
return @wp_mail($this->email, $subject, $body, $mailheaders);
|
719 |
+
}
|
720 |
+
} // end send_confirm()
|
721 |
+
|
722 |
+
/* ===== Subscriber functions ===== */
|
723 |
+
/**
|
724 |
+
Given a public subscriber ID, returns the email address
|
725 |
+
*/
|
726 |
+
function get_email($id = 0) {
|
727 |
+
global $wpdb;
|
728 |
+
|
729 |
+
if ( !$id ) {
|
730 |
+
return false;
|
731 |
+
}
|
732 |
+
return $wpdb->get_var("SELECT email FROM $this->public WHERE id=$id");
|
733 |
+
} // end get_email()
|
734 |
+
|
735 |
+
/**
|
736 |
+
Given a public subscriber email, returns the subscriber ID
|
737 |
+
*/
|
738 |
+
function get_id($email = '') {
|
739 |
+
global $wpdb;
|
740 |
+
|
741 |
+
if ( !$email ) {
|
742 |
+
return false;
|
743 |
+
}
|
744 |
+
return $wpdb->get_var("SELECT id FROM $this->public WHERE email='$email'");
|
745 |
+
} // end get_id()
|
746 |
+
|
747 |
+
/**
|
748 |
+
Activate an public subscriber email address
|
749 |
+
If the address is not already present, it will be added
|
750 |
+
*/
|
751 |
+
function activate($email = '') {
|
752 |
+
global $wpdb;
|
753 |
+
|
754 |
+
if ( '' == $email ) {
|
755 |
+
if ( '' != $this->email ) {
|
756 |
+
$email = $this->email;
|
757 |
+
} else {
|
758 |
+
return false;
|
759 |
+
}
|
760 |
+
}
|
761 |
+
|
762 |
+
if ( false !== $this->is_public($email) ) {
|
763 |
+
$check = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE user_email='$this->email'");
|
764 |
+
if ( $check ) { return; }
|
765 |
+
$wpdb->get_results("UPDATE $this->public SET active='1', ip='$this->ip' WHERE CAST(email as binary)='$email'");
|
766 |
+
} else {
|
767 |
+
global $current_user;
|
768 |
+
$wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, ip) VALUES (%s, %d, NOW(), %s)", $email, 1, $current_user->user_login));
|
769 |
+
}
|
770 |
+
} // end activate()
|
771 |
+
|
772 |
+
/**
|
773 |
+
Add an public subscriber to the subscriber table as unconfirmed
|
774 |
+
*/
|
775 |
+
function add($email = '') {
|
776 |
+
if ( $this->filtered ==1 ) { return; }
|
777 |
+
global $wpdb;
|
778 |
+
|
779 |
+
if ( '' == $email ) {
|
780 |
+
if ( '' != $this->email ) {
|
781 |
+
$email = $this->email;
|
782 |
+
} else {
|
783 |
+
return false;
|
784 |
+
}
|
785 |
+
}
|
786 |
+
|
787 |
+
if ( !is_email($email) ) { return false; }
|
788 |
+
|
789 |
+
if ( false !== $this->is_public($email) ) {
|
790 |
+
$wpdb->get_results("UPDATE $this->public SET date=NOW() WHERE CAST(email as binary)='$email'");
|
791 |
+
} else {
|
792 |
+
$wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, ip) VALUES (%s, %d, NOW(), %s)", $email, 0, $this->ip));
|
793 |
+
}
|
794 |
+
} // end add()
|
795 |
+
|
796 |
+
/**
|
797 |
+
Remove a public subscriber user from the subscription table
|
798 |
+
*/
|
799 |
+
function delete($email = '') {
|
800 |
+
global $wpdb;
|
801 |
+
|
802 |
+
if ( '' == $email ) {
|
803 |
+
if ( '' != $this->email ) {
|
804 |
+
$email = $this->email;
|
805 |
+
} else {
|
806 |
+
return false;
|
807 |
+
}
|
808 |
+
}
|
809 |
+
|
810 |
+
if ( !is_email($email) ) { return false; }
|
811 |
+
$wpdb->get_results("DELETE FROM $this->public WHERE CAST(email as binary)='$email'");
|
812 |
+
} // end delete()
|
813 |
+
|
814 |
+
/**
|
815 |
+
Toggle a public subscriber's status
|
816 |
+
*/
|
817 |
+
function toggle($email = '') {
|
818 |
+
global $wpdb;
|
819 |
+
|
820 |
+
if ( '' == $email || ! is_email($email) ) { return false; }
|
821 |
+
|
822 |
+
// let's see if this is a public user
|
823 |
+
$status = $this->is_public($email);
|
824 |
+
if ( false === $status ) { return false; }
|
825 |
+
|
826 |
+
if ( '0' == $status ) {
|
827 |
+
$wpdb->get_results("UPDATE $this->public SET active='1' WHERE CAST(email as binary)='$email'");
|
828 |
+
} else {
|
829 |
+
$wpdb->get_results("UPDATE $this->public SET active='0' WHERE CAST(email as binary)='$email'");
|
830 |
+
}
|
831 |
+
} // end toggle()
|
832 |
+
|
833 |
+
/**
|
834 |
+
Send reminder email to unconfirmed public subscribers
|
835 |
+
*/
|
836 |
+
function remind($emails = '') {
|
837 |
+
if ( '' == $emails ) { return false; }
|
838 |
+
|
839 |
+
$recipients = explode(",", $emails);
|
840 |
+
if ( !is_array($recipients) ) { $recipients = (array)$recipients; }
|
841 |
+
foreach ( $recipients as $recipient ) {
|
842 |
+
$this->email = $recipient;
|
843 |
+
$this->send_confirm('add', true);
|
844 |
+
}
|
845 |
+
} //end remind()
|
846 |
+
|
847 |
+
/**
|
848 |
+
Check email is not from a barred domain
|
849 |
+
*/
|
850 |
+
function is_barred($email='') {
|
851 |
+
$barred_option = $this->subscribe2_options['barred'];
|
852 |
+
list($user, $domain) = split('@', $email);
|
853 |
+
$bar_check = stristr($barred_option, $domain);
|
854 |
+
|
855 |
+
if ( !empty($bar_check) ) {
|
856 |
+
return true;
|
857 |
+
} else {
|
858 |
+
return false;
|
859 |
+
}
|
860 |
+
} //end is_barred()
|
861 |
+
|
862 |
+
/**
|
863 |
+
Confirm request from the link emailed to the user and email the admin
|
864 |
+
*/
|
865 |
+
function confirm($content = '') {
|
866 |
+
global $wpdb;
|
867 |
+
|
868 |
+
if ( 1 == $this->filtered ) { return $content; }
|
869 |
+
|
870 |
+
$code = $_GET['s2'];
|
871 |
+
$action = intval(substr($code, 0, 1));
|
872 |
+
$hash = substr($code, 1, 32);
|
873 |
+
$code = str_replace($hash, '', $code);
|
874 |
+
$id = intval(substr($code, 1));
|
875 |
+
if ( $id ) {
|
876 |
+
$this->email = $this->sanitize_email($this->get_email($id));
|
877 |
+
if ( !$this->email || $hash !== md5($this->email) ) {
|
878 |
+
return $this->no_such_email;
|
879 |
+
}
|
880 |
+
} else {
|
881 |
+
return $this->no_such_email;
|
882 |
+
}
|
883 |
+
|
884 |
+
// get current status of email so messages are only sent once per emailed link
|
885 |
+
$current = $this->is_public($this->email);
|
886 |
+
|
887 |
+
if ( '1' == $action ) {
|
888 |
+
// make this subscription active
|
889 |
+
$this->message = $this->added;
|
890 |
+
if ( '1' != $current ) {
|
891 |
+
$this->ip = $_SERVER['REMOTE_ADDR'];
|
892 |
+
$this->activate();
|
893 |
+
if ( $this->subscribe2_options['admin_email'] == 'subs' || $this->subscribe2_options['admin_email'] == 'both' ) {
|
894 |
+
( '' == get_option('blogname') ) ? $subject = "" : $subject = "[" . stripslashes(get_option('blogname')) . "] ";
|
895 |
+
$subject .= __('New Subscription', 'subscribe2');
|
896 |
+
$subject = html_entity_decode($subject, ENT_QUOTES);
|
897 |
+
$message = $this->email . " " . __('subscribed to email notifications!', 'subscribe2');
|
898 |
+
$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'");
|
899 |
+
if ( empty($recipients) ) {
|
900 |
+
$role = 'administrator';
|
901 |
+
if ( !class_exists(WP_User_Search) ) {
|
902 |
+
require(ABSPATH . 'wp-admin/includes/user.php');
|
903 |
+
}
|
904 |
+
$wp_user_search = new WP_User_Search( '', '', $role);
|
905 |
+
$admins_string = implode(', ', $wp_user_search->get_results());
|
906 |
+
$sql = "SELECT user_email FROM $wpdb->users WHERE ID IN (" . $admins_string . ")";
|
907 |
+
$recipients = $wpdb->get_col($sql);
|
908 |
+
}
|
909 |
+
$headers = $this->headers();
|
910 |
+
foreach ( $recipients as $recipient ) {
|
911 |
+
@wp_mail($recipient, $subject, $message, $headers);
|
912 |
+
}
|
913 |
+
}
|
914 |
+
}
|
915 |
+
$this->filtered = 1;
|
916 |
+
} elseif ( '0' == $action ) {
|
917 |
+
// remove this subscriber
|
918 |
+
$this->message = $this->deleted;
|
919 |
+
if ( '0' != $current ) {
|
920 |
+
$this->delete();
|
921 |
+
if ( $this->subscribe2_options['admin_email'] == 'unsubs' || $this->subscribe2_options['admin_email'] == 'both' ) {
|
922 |
+
( '' == get_option('blogname') ) ? $subject = "" : $subject = "[" . stripslashes(get_option('blogname')) . "] ";
|
923 |
+
$subject .= __('New Unsubscription', 'subscribe2');
|
924 |
+
$subject = html_entity_decode($subject, ENT_QUOTES);
|
925 |
+
$message = $this->email . " " . __('unsubscribed from email notifications!', 'subscribe2');
|
926 |
+
$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'");
|
927 |
+
if ( empty($recipients) ) {
|
928 |
+
$role = 'administrator';
|
929 |
+
if ( !class_exists(WP_User_Search) ) {
|
930 |
+
require(ABSPATH . 'wp-admin/includes/user.php');
|
931 |
+
}
|
932 |
+
$wp_user_search = new WP_User_Search( '', '', $role);
|
933 |
+
$admins_string = implode(', ', $wp_user_search->get_results());
|
934 |
+
$sql = "SELECT user_email FROM $wpdb->users WHERE ID IN (" . $admins_string . ")";
|
935 |
+
$recipients = $wpdb->get_col($sql);
|
936 |
+
}
|
937 |
+
$headers = $this->headers();
|
938 |
+
foreach ( $recipients as $recipient ) {
|
939 |
+
@wp_mail($recipient, $subject, $message, $headers);
|
940 |
+
}
|
941 |
+
}
|
942 |
+
}
|
943 |
+
$this->filtered = 1;
|
944 |
+
}
|
945 |
+
|
946 |
+
if ( '' != $this->message ) {
|
947 |
+
return $this->message;
|
948 |
+
}
|
949 |
+
} // end confirm()
|
950 |
+
|
951 |
+
/**
|
952 |
+
Is the supplied email address a public subscriber?
|
953 |
+
*/
|
954 |
+
function is_public($email = '') {
|
955 |
+
global $wpdb;
|
956 |
+
|
957 |
+
if ( '' == $email ) { return false; }
|
958 |
+
|
959 |
+
// run the query and force case sensitivity
|
960 |
+
$check = $wpdb->get_var("SELECT active FROM $this->public WHERE CAST(email as binary)='$email'");
|
961 |
+
if ( '0' == $check || '1' == $check ) {
|
962 |
+
return $check;
|
963 |
+
} else {
|
964 |
+
return false;
|
965 |
+
}
|
966 |
+
} // end is_public
|
967 |
+
|
968 |
+
/**
|
969 |
+
Is the supplied email address a registered user of the blog?
|
970 |
+
*/
|
971 |
+
function is_registered($email = '') {
|
972 |
+
global $wpdb;
|
973 |
+
|
974 |
+
if ( '' == $email ) { return false; }
|
975 |
+
|
976 |
+
$check = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE user_email='$email'");
|
977 |
+
if ( $check ) {
|
978 |
+
return true;
|
979 |
+
} else {
|
980 |
+
return false;
|
981 |
+
}
|
982 |
+
} // end is_registered()
|
983 |
+
|
984 |
+
/**
|
985 |
+
Return Registered User ID from email
|
986 |
+
*/
|
987 |
+
function get_user_id($email = '') {
|
988 |
+
global $wpdb;
|
989 |
+
|
990 |
+
if ( '' == $email ) { return false; }
|
991 |
+
|
992 |
+
$id = $wpdb->get_var("SELECT id FROM $wpdb->users WHERE user_email='$email'");
|
993 |
+
|
994 |
+
return $id;
|
995 |
+
} // end get_user_id()
|
996 |
+
|
997 |
+
/**
|
998 |
+
Return an array of all the public subscribers
|
999 |
+
*/
|
1000 |
+
function get_public($confirmed = 1) {
|
1001 |
+
global $wpdb;
|
1002 |
+
if ( 1 == $confirmed ) {
|
1003 |
+
if ( '' == $this->all_public ) {
|
1004 |
+
$this->all_public = $wpdb->get_col("SELECT email FROM $this->public WHERE active='1'");
|
1005 |
+
}
|
1006 |
+
return $this->all_public;
|
1007 |
+
} else {
|
1008 |
+
if ( '' == $this->all_unconfirmed ) {
|
1009 |
+
$this->all_unconfirmed = $wpdb->get_col("SELECT email FROM $this->public WHERE active='0'");
|
1010 |
+
}
|
1011 |
+
return $this->all_unconfirmed;
|
1012 |
+
}
|
1013 |
+
} // end get_public()
|
1014 |
+
|
1015 |
+
/**
|
1016 |
+
Return an array of all subscribers
|
1017 |
+
*/
|
1018 |
+
function get_all_registered($id = '') {
|
1019 |
+
global $wpdb;
|
1020 |
+
|
1021 |
+
if ( $this->s2_mu ) {
|
1022 |
+
if ( $id ) {
|
1023 |
+
return $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
|
1024 |
+
} else {
|
1025 |
+
$result = $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
|
1026 |
+
$ids = implode(',', $result);
|
1027 |
+
return $wpdb->get_col("SELECT user_email FROM $wpdb->users WHERE ID IN ($ids)");
|
1028 |
+
}
|
1029 |
+
} else {
|
1030 |
+
if ( $id ) {
|
1031 |
+
return $wpdb->get_col("SELECT ID FROM $wpdb->users");
|
1032 |
+
} else {
|
1033 |
+
return $wpdb->get_col("SELECT user_email FROM $wpdb->users");
|
1034 |
+
}
|
1035 |
+
}
|
1036 |
+
}
|
1037 |
+
|
1038 |
+
/**
|
1039 |
+
Return an array of registered subscribers
|
1040 |
+
Collect all the registered users of the blog who are subscribed to the specified categories
|
1041 |
+
*/
|
1042 |
+
function get_registered($args = '') {
|
1043 |
+
global $wpdb;
|
1044 |
+
|
1045 |
+
$format = '';
|
1046 |
+
$cats = '';
|
1047 |
+
$subscribers = array();
|
1048 |
+
|
1049 |
+
parse_str($args, $r);
|
1050 |
+
if ( !isset($r['format']) )
|
1051 |
+
$r['format'] = 'all';
|
1052 |
+
if ( !isset($r['cats']) )
|
1053 |
+
$r['cats'] = '';
|
1054 |
+
|
1055 |
+
$JOIN = ''; $AND = '';
|
1056 |
+
// text or HTML subscribers
|
1057 |
+
if ( 'all' != $r['format'] ) {
|
1058 |
+
$JOIN .= "INNER JOIN $wpdb->usermeta AS b ON a.user_id = b.user_id ";
|
1059 |
+
$AND .= " AND b.meta_key='s2_format' AND b.meta_value=";
|
1060 |
+
if ( 'html' == $r['format'] ) {
|
1061 |
+
$AND .= "'html'";
|
1062 |
+
} elseif ( 'html_excerpt' == $r['format'] ) {
|
1063 |
+
$AND .= "'html_excerpt'";
|
1064 |
+
} elseif ( 'post' == $r['format'] ) {
|
1065 |
+
$AND .= "'post'";
|
1066 |
+
} elseif ( 'excerpt' == $r['format'] ) {
|
1067 |
+
$AND .= "'excerpt'";
|
1068 |
+
}
|
1069 |
+
}
|
1070 |
+
|
1071 |
+
// specific category subscribers
|
1072 |
+
if ( '' != $r['cats'] ) {
|
1073 |
+
$JOIN .= "INNER JOIN $wpdb->usermeta AS c ON a.user_id = c.user_id ";
|
1074 |
+
$all = '';
|
1075 |
+
foreach ( explode(',', $r['cats']) as $cat ) {
|
1076 |
+
('' == $and) ? $and = "c.meta_key='" . $this->get_usermeta_keyname('s2_cat') . "$cat'" : $and .= " OR c.meta_key='" . $this->get_usermeta_keyname('s2_cat') . "$cat'";
|
1077 |
+
}
|
1078 |
+
$AND .= " AND ($and)";
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
if ( $this->s2_mu ) {
|
1082 |
+
$sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . "WHERE a.meta_key='" . $wpdb->prefix . "capabilities'" . $AND;
|
1083 |
+
} else {
|
1084 |
+
$sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . "WHERE a.meta_key='" . $this->get_usermeta_keyname('s2_subscribed') . "'" . $AND;
|
1085 |
+
}
|
1086 |
+
$result = $wpdb->get_col($sql);
|
1087 |
+
if ( $result ) {
|
1088 |
+
$ids = implode(',', $result);
|
1089 |
+
return $wpdb->get_col("SELECT user_email FROM $wpdb->users WHERE ID IN ($ids)");
|
1090 |
+
}
|
1091 |
+
} // end get_registered()
|
1092 |
+
|
1093 |
+
/**
|
1094 |
+
Collects the signup date for all public subscribers
|
1095 |
+
*/
|
1096 |
+
function signup_date($email = '') {
|
1097 |
+
if ( '' == $email ) { return false; }
|
1098 |
+
|
1099 |
+
global $wpdb;
|
1100 |
+
if ( !empty($this->signup_dates) ) {
|
1101 |
+
return $this->signup_dates[$email];
|
1102 |
+
} else {
|
1103 |
+
$results = $wpdb->get_results("SELECT email, date FROM $this->public", ARRAY_N);
|
1104 |
+
foreach ( $results as $result ) {
|
1105 |
+
$this->signup_dates[$result[0]] = $result[1];
|
1106 |
+
}
|
1107 |
+
return $this->signup_dates[$email];
|
1108 |
+
}
|
1109 |
+
} // end signup_date()
|
1110 |
+
|
1111 |
+
/**
|
1112 |
+
Collects the ip address for all public subscribers
|
1113 |
+
*/
|
1114 |
+
function signup_ip($email = '') {
|
1115 |
+
if ( '' == $email ) {return false; }
|
1116 |
+
|
1117 |
+
global $wpdb;
|
1118 |
+
if ( !empty($this->signup_ips) ) {
|
1119 |
+
return $this->signup_ips[$email];
|
1120 |
+
} else {
|
1121 |
+
$results = $wpdb->get_results("SELECT email, ip FROM $this->public", ARRAY_N);
|
1122 |
+
foreach ( $results as $result ) {
|
1123 |
+
$this->signup_ips[$result[0]] = $result[1];
|
1124 |
+
}
|
1125 |
+
return $this->signup_ips[$email];
|
1126 |
+
}
|
1127 |
+
} // end signup_ip()
|
1128 |
+
|
1129 |
+
/**
|
1130 |
+
function to ensure email is compliant with internet messaging standards
|
1131 |
+
*/
|
1132 |
+
function sanitize_email($email) {
|
1133 |
+
if ( !is_email($email) ) { return; }
|
1134 |
+
|
1135 |
+
// ensure that domain is in lowercase as per internet email standards
|
1136 |
+
list($name, $domain) = explode('@', $email, 2);
|
1137 |
+
return $name . "@" . strtolower($domain);;
|
1138 |
+
} // end sanitize_email()
|
1139 |
+
|
1140 |
+
/**
|
1141 |
+
Create the appropriate usermeta values when a user registers
|
1142 |
+
If the registering user had previously subscribed to notifications, this function will delete them from the public subscriber list first
|
1143 |
+
*/
|
1144 |
+
function register($user_ID = 0) {
|
1145 |
+
global $wpdb;
|
1146 |
+
|
1147 |
+
if ( 0 == $user_ID ) { return $user_ID; }
|
1148 |
+
$user = get_userdata($user_ID);
|
1149 |
+
$all_cats = get_categories(array('hide_empty' => false));
|
1150 |
+
|
1151 |
+
// Are registered users are allowed to subscribe to excluded categories?
|
1152 |
+
if ( 0 == $this->subscribe2_options['reg_override'] || 'no' == $this->subscribe2_options['newreg_override'] ) {
|
1153 |
+
$exclude = explode(',', $this->subscribe2_options['exclude']);
|
1154 |
+
foreach ( $all_cats as $cat => $term_id ) {
|
1155 |
+
if ( in_array($all_cats[$cat]->term_id, $exclude) ) {
|
1156 |
+
$cat = (int)$cat;
|
1157 |
+
unset($all_cats[$cat]);
|
1158 |
+
}
|
1159 |
+
}
|
1160 |
+
}
|
1161 |
+
|
1162 |
+
foreach ( $all_cats as $cat ) {
|
1163 |
+
('' == $cats) ? $cats = "$cat->term_id" : $cats .= ",$cat->term_id";
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
if ( '' == $cats ) {
|
1167 |
+
// sanity check, might occur if all cats excluded and reg_override = 0
|
1168 |
+
return $user_ID;
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
// has this user previously signed up for email notification?
|
1172 |
+
if ( false !== $this->is_public($this->sanitize_email($user->user_email)) ) {
|
1173 |
+
// delete this user from the public table, and subscribe them to all the categories
|
1174 |
+
$this->delete($user->user_email);
|
1175 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
|
1176 |
+
foreach ( explode(',', $cats) as $cat ) {
|
1177 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat, "$cat");
|
1178 |
+
}
|
1179 |
+
update_usermeta($user_ID, 's2_format', 'excerpt');
|
1180 |
+
update_usermeta($user_ID, 's2_autosub', $this->subscribe2_options['autosub_def']);
|
1181 |
+
} else {
|
1182 |
+
// create post format entries for all users
|
1183 |
+
$check_format = get_usermeta($user_ID, 's2_format');
|
1184 |
+
if ( empty($check_format) ) {
|
1185 |
+
// ensure existing subscription options are not overwritten on upgrade
|
1186 |
+
if ( in_array($this->subscribe2_options['autoformat'], array('html', 'html_excerpt', 'post', 'excerpt')) ) {
|
1187 |
+
update_usermeta($user_ID, 's2_format', $this->subscribe2_options['autoformat']);
|
1188 |
+
} else {
|
1189 |
+
update_usermeta($user_ID, 's2_format', 'excerpt');
|
1190 |
+
}
|
1191 |
+
update_usermeta($user_ID, 's2_autosub', $this->subscribe2_options['autosub_def']);
|
1192 |
+
// if the are no existing subscriptions, create them if, by default if autosub is on
|
1193 |
+
if ( 'yes' == $this->subscribe2_options['autosub'] || ( 'wpreg' == $this->subscribe2_options['autosub'] && 'on' == $_POST['subscribe'] ) ) {
|
1194 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
|
1195 |
+
foreach ( explode(',', $cats) as $cat ) {
|
1196 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat, "$cat");
|
1197 |
+
}
|
1198 |
+
}
|
1199 |
+
} else {
|
1200 |
+
// if user is already registered update format remove 's2_excerpt' field and update 's2_format'
|
1201 |
+
if ( 'html' == $check_format ) {
|
1202 |
+
delete_usermeta($user_ID, 's2_excerpt');
|
1203 |
+
} elseif ( 'text' == $check_format ) {
|
1204 |
+
update_usermeta($user_ID, 's2_format', get_usermeta($user_ID, 's2_excerpt'));
|
1205 |
+
delete_usermeta($user_ID, 's2_excerpt');
|
1206 |
+
}
|
1207 |
+
}
|
1208 |
+
$subscribed = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
1209 |
+
if ( strstr($subscribed, '-1') ) {
|
1210 |
+
// make sure we remove '-1' from any settings
|
1211 |
+
$old_cats = explode(',', $subscribed);
|
1212 |
+
$pos = array_search('-1', $old_cats);
|
1213 |
+
unset($old_cats[$pos]);
|
1214 |
+
$cats = implode(',', $old_cats);
|
1215 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
|
1216 |
+
}
|
1217 |
+
}
|
1218 |
+
return $user_ID;
|
1219 |
+
} // end register()
|
1220 |
+
|
1221 |
+
/**
|
1222 |
+
Subscribe all registered users to category selected on Admin Manage Page
|
1223 |
+
*/
|
1224 |
+
function subscribe_registered_users($emails = '', $cats = array()) {
|
1225 |
+
if ( '' == $emails || '' == $cats ) { return false; }
|
1226 |
+
global $wpdb;
|
1227 |
+
|
1228 |
+
$useremails = explode(",", $emails);
|
1229 |
+
$useremails = implode("', '", $useremails);
|
1230 |
+
|
1231 |
+
$sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ('$useremails')";
|
1232 |
+
$user_IDs = $wpdb->get_col($sql);
|
1233 |
+
|
1234 |
+
foreach ( $user_IDs as $user_ID ) {
|
1235 |
+
$old_cats = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
1236 |
+
if ( !empty($old_cats) ) {
|
1237 |
+
$old_cats = explode(',', $old_cats);
|
1238 |
+
$newcats = array_unique(array_merge($cats, $old_cats));
|
1239 |
+
} else {
|
1240 |
+
$newcats = $cats;
|
1241 |
+
}
|
1242 |
+
if ( !empty($newcats) ) {
|
1243 |
+
// add subscription to these cat IDs
|
1244 |
+
foreach ( $newcats as $id ) {
|
1245 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, "$id");
|
1246 |
+
}
|
1247 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $newcats));
|
1248 |
+
}
|
1249 |
+
unset($newcats);
|
1250 |
+
}
|
1251 |
+
} // end subscribe_registered_users()
|
1252 |
+
|
1253 |
+
/**
|
1254 |
+
Unsubscribe all registered users to category selected on Admin Manage Page
|
1255 |
+
*/
|
1256 |
+
function unsubscribe_registered_users($emails = '', $cats = array()) {
|
1257 |
+
if ( '' == $emails || '' == $cats ) { return false; }
|
1258 |
+
global $wpdb;
|
1259 |
+
|
1260 |
+
$useremails = explode(",", $emails);
|
1261 |
+
$useremails = implode("', '", $useremails);
|
1262 |
+
|
1263 |
+
$sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ('$useremails')";
|
1264 |
+
$user_IDs = $wpdb->get_col($sql);
|
1265 |
+
|
1266 |
+
foreach ( $user_IDs as $user_ID ) {
|
1267 |
+
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
1268 |
+
$remain = array_diff($old_cats, $cats);
|
1269 |
+
if ( !empty($remain) ) {
|
1270 |
+
// remove subscription to these cat IDs and update s2_subscribed
|
1271 |
+
foreach ( $cats as $id ) {
|
1272 |
+
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
1273 |
+
}
|
1274 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $remain));
|
1275 |
+
} else {
|
1276 |
+
// remove subscription to these cat IDs and update s2_subscribed to ''
|
1277 |
+
foreach ( $cats as $id ) {
|
1278 |
+
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
1279 |
+
}
|
1280 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
1281 |
+
}
|
1282 |
+
unset($remain);
|
1283 |
+
}
|
1284 |
+
} // end unsubscribe_registered_users()
|
1285 |
+
|
1286 |
+
/**
|
1287 |
+
Handles bulk changes to email format for Registered Subscribers
|
1288 |
+
*/
|
1289 |
+
function format_change($format, $subscribers_string) {
|
1290 |
+
if ( empty($format) ) { return; }
|
1291 |
+
|
1292 |
+
global $wpdb;
|
1293 |
+
$emails ='';
|
1294 |
+
$subscribers = explode(',', $subscribers_string);
|
1295 |
+
foreach ( $subscribers as $subscriber ) {
|
1296 |
+
( '' == $emails) ? $emails = "'$subscriber'" : $emails .= ",'$subscriber'";
|
1297 |
+
}
|
1298 |
+
$ids = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_email IN ($emails)");
|
1299 |
+
$ids = implode(',', $ids);
|
1300 |
+
$sql = "UPDATE $wpdb->usermeta SET meta_value='{$format}' WHERE meta_key='s2_format' AND user_id IN ($ids)";
|
1301 |
+
$wpdb->get_results("UPDATE $wpdb->usermeta SET meta_value='{$format}' WHERE meta_key='s2_format' AND user_id IN ($ids)");
|
1302 |
+
} // end bulk_manage()
|
1303 |
+
|
1304 |
+
/**
|
1305 |
+
Handles subscriptions and unsubscriptions for different blogs on WPMU installs
|
1306 |
+
*/
|
1307 |
+
function wpmu_subscribe() {
|
1308 |
+
$redirect_to_subscriptionpage = false;
|
1309 |
+
|
1310 |
+
// subscribe to new blog
|
1311 |
+
if ( !empty($_GET['s2mu_subscribe']) ) {
|
1312 |
+
$blog_id = intval($_GET['s2mu_subscribe']);
|
1313 |
+
if ( $blog_id >= 0 ) {
|
1314 |
+
switch_to_blog($blog_id);
|
1315 |
+
|
1316 |
+
$user_ID = get_current_user_id();
|
1317 |
+
|
1318 |
+
// if user is not a user of the current blog
|
1319 |
+
if ( !is_blog_user($blog_id) ) {
|
1320 |
+
// add user to current blog as subscriber
|
1321 |
+
add_user_to_blog($blog_id, $user_ID, 'subscriber');
|
1322 |
+
// add an action hook for external manipulation of blog and user data
|
1323 |
+
do_action_ref_array('subscribe2_wpmu_subscribe', array($user_ID, $blog_id));
|
1324 |
+
}
|
1325 |
+
|
1326 |
+
// subscribe to all categories by default
|
1327 |
+
$all_cats = get_categories(array('hide_empty' => false));
|
1328 |
+
|
1329 |
+
if ( 0 == $this->subscribe2_options['reg_override'] ) {
|
1330 |
+
// registered users are not allowed to subscribe to excluded categories
|
1331 |
+
$exclude = explode(',', $this->subscribe2_options['exclude']);
|
1332 |
+
foreach ( $all_cats as $cat => $term ) {
|
1333 |
+
if ( in_array($all_cats[$cat]->term_id, $exclude) ) {
|
1334 |
+
$cat = (int)$cat;
|
1335 |
+
unset($all_cats[$cat]);
|
1336 |
+
}
|
1337 |
+
}
|
1338 |
+
}
|
1339 |
+
|
1340 |
+
$cats = array();
|
1341 |
+
foreach ( $all_cats as $cat => $term ) {
|
1342 |
+
$term_id = $term->term_id;
|
1343 |
+
$cats[] = $term_id;
|
1344 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $term_id, $term_id);
|
1345 |
+
}
|
1346 |
+
if ( empty($cats) ) {
|
1347 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
1348 |
+
} else {
|
1349 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $cats));
|
1350 |
+
}
|
1351 |
+
|
1352 |
+
// don't restore_current_blog(); -> redirect to new subscription page
|
1353 |
+
$redirect_to_subscriptionpage = true;
|
1354 |
+
}
|
1355 |
+
} elseif ( !empty($_GET['s2mu_unsubscribe']) ) {
|
1356 |
+
// unsubscribe from a blog
|
1357 |
+
$blog_id = intval($_GET['s2mu_unsubscribe']);
|
1358 |
+
if ( $blog_id >= 0 ) {
|
1359 |
+
switch_to_blog($blog_id);
|
1360 |
+
|
1361 |
+
$user_ID = get_current_user_id();
|
1362 |
+
|
1363 |
+
// delete subscription to all categories on that blog
|
1364 |
+
$cats = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
1365 |
+
$cats = explode(',', $cats);
|
1366 |
+
if ( !is_array($cats) ) {
|
1367 |
+
$cats = array($cats);
|
1368 |
+
}
|
1369 |
+
|
1370 |
+
foreach ( $cats as $id ) {
|
1371 |
+
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
1372 |
+
}
|
1373 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
1374 |
+
|
1375 |
+
// add an action hook for external manipulation of blog and user data
|
1376 |
+
do_action_ref_array('subscribe2_wpmu_unsubscribe', array($user_ID, $blog_id));
|
1377 |
+
|
1378 |
+
restore_current_blog();
|
1379 |
+
$redirect_to_subscriptionpage = true;
|
1380 |
+
}
|
1381 |
+
}
|
1382 |
+
|
1383 |
+
if ( $redirect_to_subscriptionpage == true ) {
|
1384 |
+
if ( !is_user_member_of_blog($user_ID) ) {
|
1385 |
+
$user_blogs = get_active_blog_for_user($user_ID);
|
1386 |
+
if ( is_array($user_blogs) ) {
|
1387 |
+
switch_to_blog(key($user_blogs));
|
1388 |
+
} else {
|
1389 |
+
// no longer a member of a blog
|
1390 |
+
wp_redirect(get_option('siteurl')); // redirect to front page
|
1391 |
+
exit();
|
1392 |
+
}
|
1393 |
+
}
|
1394 |
+
|
1395 |
+
// redirect to profile page
|
1396 |
+
if ( current_user_can('manage_options') ) {
|
1397 |
+
$url = get_option('siteurl') . '/wp-admin/users.php?page=s2_users';
|
1398 |
+
wp_redirect($url);
|
1399 |
+
exit();
|
1400 |
+
} else {
|
1401 |
+
$url = get_option('siteurl') . '/wp-admin/profile.php?page=s2_users';
|
1402 |
+
wp_redirect($url);
|
1403 |
+
exit();
|
1404 |
+
}
|
1405 |
+
}
|
1406 |
+
} // end wpmu_subscribe()
|
1407 |
+
|
1408 |
+
/**
|
1409 |
+
Autosubscribe registered users to newly created categories
|
1410 |
+
if registered user has selected this option
|
1411 |
+
*/
|
1412 |
+
function new_category($new_category='') {
|
1413 |
+
if ( 'no' == $this->subscribe2_options['show_autosub'] ) { return; }
|
1414 |
+
global $wpdb;
|
1415 |
+
|
1416 |
+
if ( 'yes' == $this->subscribe2_options['show_autosub'] ) {
|
1417 |
+
$sql = "SELECT DISTINCT user_id FROM $wpdb->usermeta WHERE $wpdb->usermeta.meta_key='s2_autosub' AND $wpdb->usermeta.meta_value='yes'";
|
1418 |
+
$user_IDs = $wpdb->get_col($sql);
|
1419 |
+
if ( '' == $user_IDs ) { return; }
|
1420 |
+
|
1421 |
+
foreach ( $user_IDs as $user_ID ) {
|
1422 |
+
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
1423 |
+
if ( !is_array($old_cats) ) {
|
1424 |
+
$old_cats = array($old_cats);
|
1425 |
+
}
|
1426 |
+
// add subscription to these cat IDs
|
1427 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $new_category, "$new_category");
|
1428 |
+
$newcats = array_merge($old_cats, (array)$new_category);
|
1429 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $newcats));
|
1430 |
+
}
|
1431 |
+
} elseif ( 'exclude' == $this->subscribe2_options['show_autosub'] ) {
|
1432 |
+
$excluded_cats = explode(',', $this->subscribe2_options['exclude']);
|
1433 |
+
$excluded_cats[] = $new_category;
|
1434 |
+
$this->subscribe2_options['exclude'] = implode(',', $excluded_cats);
|
1435 |
+
update_option('subscribe2_options', $this->subscribe2_options);
|
1436 |
+
}
|
1437 |
+
} // end new_category()
|
1438 |
+
|
1439 |
+
function delete_category($deleted_category='') {
|
1440 |
+
global $wpdb;
|
1441 |
+
|
1442 |
+
$sql = "SELECT DISTINCT user_id FROM $wpdb->usermeta WHERE meta_key='" . $this->get_usermeta_keyname('s2_cat') . "$deleted_category'";
|
1443 |
+
$user_IDs = $wpdb->get_col($sql);
|
1444 |
+
if ( '' == $user_IDs ) { return; }
|
1445 |
+
|
1446 |
+
foreach ( $user_IDs as $user_ID ) {
|
1447 |
+
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
1448 |
+
if ( !is_array($old_cats) ) {
|
1449 |
+
$old_cats = array($old_cats);
|
1450 |
+
}
|
1451 |
+
// add subscription to these cat IDs
|
1452 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $deleted_category, '');
|
1453 |
+
$remain = array_diff($old_cats, (array)$deleted_category);
|
1454 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $remain));
|
1455 |
+
}
|
1456 |
+
}
|
1457 |
+
|
1458 |
+
/**
|
1459 |
+
Get admin data from record 1 or first user with admin rights
|
1460 |
+
*/
|
1461 |
+
function get_userdata($admin_id) {
|
1462 |
+
global $wpdb, $userdata;
|
1463 |
+
|
1464 |
+
if ( is_numeric($admin_id) ) {
|
1465 |
+
$admin = get_userdata($admin_id);
|
1466 |
+
} elseif ( $admin_id == 'admin' ) {
|
1467 |
+
//ensure compatibility with < 4.16
|
1468 |
+
$admin = get_userdata('1');
|
1469 |
+
} else {
|
1470 |
+
$admin = &$userdata;
|
1471 |
+
}
|
1472 |
+
|
1473 |
+
// if user record is empty grab the first admin from the database
|
1474 |
+
if ( empty($admin) ) {
|
1475 |
+
$sql = "SELECT DISTINCT(ID) FROM $wpdb->users INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key='" . $wpdb->prefix . "user_level' AND $wpdb->usermeta.meta_value IN (8, 9, 10) LIMIT 1";
|
1476 |
+
$admin = get_userdata($wpdb->get_var($sql));
|
1477 |
+
}
|
1478 |
+
|
1479 |
+
// handle issues from WordPress core where user_level is not set or set low
|
1480 |
+
if ( empty($admin) ) {
|
1481 |
+
$role = 'administrator';
|
1482 |
+
if ( !class_exists(WP_User_Search) ) {
|
1483 |
+
require(ABSPATH . 'wp-admin/includes/user.php');
|
1484 |
+
}
|
1485 |
+
$wp_user_search = new WP_User_Search( '', '', $role);
|
1486 |
+
$results = $wp_user_search->get_results();
|
1487 |
+
$admin = $results[0];
|
1488 |
+
}
|
1489 |
+
|
1490 |
+
return $admin;
|
1491 |
+
} //end get_userdata()
|
1492 |
+
|
1493 |
+
/* ===== Menus ===== */
|
1494 |
+
/**
|
1495 |
+
Our management page
|
1496 |
+
*/
|
1497 |
+
function manage_menu() {
|
1498 |
+
global $wpdb, $s2nonce;
|
1499 |
+
|
1500 |
+
//Get Registered Subscribers for bulk management
|
1501 |
+
$registered = $this->get_registered();
|
1502 |
+
$all_users = $this->get_all_registered();
|
1503 |
+
|
1504 |
+
// was anything POSTed ?
|
1505 |
+
if ( isset($_POST['s2_admin']) ) {
|
1506 |
+
check_admin_referer('subscribe2-manage_subscribers' . $s2nonce);
|
1507 |
+
if ( $_POST['addresses'] ) {
|
1508 |
+
$sub_error = '';
|
1509 |
+
$unsub_error = '';
|
1510 |
+
foreach ( preg_split ("/[\s,]+/", $_POST['addresses']) as $email ) {
|
1511 |
+
$email = $this->sanitize_email($email);
|
1512 |
+
if ( is_email($email) && $_POST['subscribe'] ) {
|
1513 |
+
if ( $this->is_public($email) !== false ) {
|
1514 |
+
('' == $sub_error) ? $sub_error = "$email" : $sub_error .= ", $email";
|
1515 |
+
continue;
|
1516 |
+
}
|
1517 |
+
$this->activate($email);
|
1518 |
+
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) subscribed!', 'subscribe2') . "</strong></p></div>";
|
1519 |
+
} elseif ( is_email($email) && $_POST['unsubscribe'] ) {
|
1520 |
+
if ( $this->is_public($email) === false ) {
|
1521 |
+
('' == $unsub_error) ? $unsub_error = "$email" : $unsub_error .= ", $email";
|
1522 |
+
continue;
|
1523 |
+
}
|
1524 |
+
$this->delete($email);
|
1525 |
+
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) unsubscribed!', 'subscribe2') . "</strong></p></div>";
|
1526 |
+
}
|
1527 |
+
}
|
1528 |
+
if ( $sub_error != '' ) {
|
1529 |
+
echo "<div id=\"message\" class=\"error\"><p><strong>" . __('Some emails were not processed, the following were already subscribed' , 'subscribe2') . ":<br />$sub_error</strong></p></div>";
|
1530 |
+
}
|
1531 |
+
if ( $unsub_error != '' ) {
|
1532 |
+
echo "<div id=\"message\" class=\"error\"><p><strong>" . __('Some emails were not processed, the following were not in the database' , 'subscribe2') . ":<br />$unsub_error</strong></p></div>";
|
1533 |
+
}
|
1534 |
+
echo $message;
|
1535 |
+
$_POST['what'] = 'confirmed';
|
1536 |
+
} elseif ( $_POST['process'] ) {
|
1537 |
+
if ( $_POST['delete'] ) {
|
1538 |
+
foreach ( $_POST['delete'] as $address ) {
|
1539 |
+
$this->delete($address);
|
1540 |
+
}
|
1541 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) deleted!', 'subscribe2') . "</strong></p></div>";
|
1542 |
+
}
|
1543 |
+
if ( $_POST['confirm'] ) {
|
1544 |
+
foreach ( $_POST['confirm'] as $address ) {
|
1545 |
+
$this->toggle($this->sanitize_email($address));
|
1546 |
+
}
|
1547 |
+
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Status changed!', 'subscribe2') . "</strong></p></div>";
|
1548 |
+
}
|
1549 |
+
if ( $_POST['unconfirm'] ) {
|
1550 |
+
foreach ( $_POST['unconfirm'] as $address ) {
|
1551 |
+
$this->toggle($this->sanitize_email($address));
|
1552 |
+
}
|
1553 |
+
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Status changed!', 'subscribe2') . "</strong></p></div>";
|
1554 |
+
}
|
1555 |
+
echo $message;
|
1556 |
+
} elseif ( $_POST['searchterm'] ) {
|
1557 |
+
$confirmed = $this->get_public();
|
1558 |
+
$unconfirmed = $this->get_public(0);
|
1559 |
+
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1560 |
+
foreach ( $subscribers as $subscriber ) {
|
1561 |
+
if ( is_numeric(stripos($subscriber, $_POST['searchterm'])) ) {
|
1562 |
+
$result[] = $subscriber;
|
1563 |
+
}
|
1564 |
+
}
|
1565 |
+
} elseif ( $_POST['remind'] ) {
|
1566 |
+
$this->remind($_POST['reminderemails']);
|
1567 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Reminder Email(s) Sent!', 'subscribe2') . "</strong></p></div>";
|
1568 |
+
} elseif ( $_POST['sub_categories'] && 'subscribe' == $_POST['manage'] ) {
|
1569 |
+
$this->subscribe_registered_users($_POST['emails'], $_POST['category']);
|
1570 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Subscribed!', 'subscribe2') . "</strong></p></div>";
|
1571 |
+
} elseif ( $_POST['sub_categories'] && 'unsubscribe' == $_POST['manage'] ) {
|
1572 |
+
$this->unsubscribe_registered_users($_POST['emails'], $_POST['category']);
|
1573 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Unsubscribed!', 'subscribe2') . "</strong></p></div>";
|
1574 |
+
} elseif ( $_POST['sub_format'] ) {
|
1575 |
+
$this->format_change( $_POST['format'], $_POST['emails'] );
|
1576 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Format updated for Selected Registered Users!', 'subscribe2') . "</strong></p></div>";
|
1577 |
+
}
|
1578 |
+
}
|
1579 |
+
|
1580 |
+
//Get Public Subscribers once for filter
|
1581 |
+
$confirmed = $this->get_public();
|
1582 |
+
$unconfirmed = $this->get_public(0);
|
1583 |
+
// safety check for our arrays
|
1584 |
+
if ( '' == $confirmed ) { $confirmed = array(); }
|
1585 |
+
if ( '' == $unconfirmed ) { $unconfirmed = array(); }
|
1586 |
+
if ( '' == $registered ) { $registered = array(); }
|
1587 |
+
if ( '' == $all_users ) { $all_users = array(); }
|
1588 |
+
|
1589 |
+
$reminderform = false;
|
1590 |
+
$urlpath = str_replace("\\", "/", S2PATH);
|
1591 |
+
$urlpath = trailingslashit(get_option('siteurl')) . substr($urlpath,strpos($urlpath, "wp-content/"));
|
1592 |
+
if ( isset($_GET['s2page']) ) {
|
1593 |
+
$page = (int) $_GET['s2page'];
|
1594 |
+
} else {
|
1595 |
+
$page = 1;
|
1596 |
+
}
|
1597 |
+
|
1598 |
+
if ( isset($_POST['what']) ) {
|
1599 |
+
$page = 1;
|
1600 |
+
if ( 'all' == $_POST['what'] ) {
|
1601 |
+
$what = 'all';
|
1602 |
+
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1603 |
+
} elseif ( 'public' == $_POST['what'] ) {
|
1604 |
+
$what = 'public';
|
1605 |
+
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
|
1606 |
+
} elseif ( 'confirmed' == $_POST['what'] ) {
|
1607 |
+
$what = 'confirmed';
|
1608 |
+
$subscribers = $confirmed;
|
1609 |
+
} elseif ( 'unconfirmed' == $_POST['what'] ) {
|
1610 |
+
$what = 'unconfirmed';
|
1611 |
+
$subscribers = $unconfirmed;
|
1612 |
+
if ( !empty($subscribers) ) {
|
1613 |
+
$reminderemails = implode(",", $subscribers);
|
1614 |
+
$reminderform = true;
|
1615 |
+
}
|
1616 |
+
} elseif ( is_numeric($_POST['what']) ) {
|
1617 |
+
$what = intval($_POST['what']);
|
1618 |
+
$subscribers = $this->get_registered("cats=$what");
|
1619 |
+
} elseif ( 'registered' == $_POST['what'] ) {
|
1620 |
+
$what = 'registered';
|
1621 |
+
$subscribers = $registered;
|
1622 |
+
} elseif ( 'all_users' == $_POST['what'] ) {
|
1623 |
+
$what = 'all_users';
|
1624 |
+
$subscribers = $all_users;
|
1625 |
+
}
|
1626 |
+
} elseif ( isset($_GET['what']) ) {
|
1627 |
+
if ( 'all' == $_GET['what'] ) {
|
1628 |
+
$what = 'all';
|
1629 |
+
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1630 |
+
} elseif ( 'public' == $_GET['what'] ) {
|
1631 |
+
$what = 'public';
|
1632 |
+
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
|
1633 |
+
} elseif ( 'confirmed' == $_GET['what'] ) {
|
1634 |
+
$what = 'confirmed';
|
1635 |
+
$subscribers = $confirmed;
|
1636 |
+
} elseif ( 'unconfirmed' == $_GET['what'] ) {
|
1637 |
+
$what = 'unconfirmed';
|
1638 |
+
$subscribers = $unconfirmed;
|
1639 |
+
if ( !empty($subscribers) ) {
|
1640 |
+
$reminderemails = implode(",", $subscribers);
|
1641 |
+
$reminderform = true;
|
1642 |
+
}
|
1643 |
+
} elseif ( is_numeric($_GET['what']) ) {
|
1644 |
+
$what = intval($_GET['what']);
|
1645 |
+
$subscribers = $this->get_registered("cats=$what");
|
1646 |
+
} elseif ( 'registered' == $_GET['what'] ) {
|
1647 |
+
$what = 'registered';
|
1648 |
+
$subscribers = $registered;
|
1649 |
+
} elseif ( 'all_users' == $_GET['what'] ) {
|
1650 |
+
$what = 'all_users';
|
1651 |
+
$subscribers = $all_users;
|
1652 |
+
}
|
1653 |
+
} else {
|
1654 |
+
$what = 'all';
|
1655 |
+
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1656 |
+
}
|
1657 |
+
if ( $_POST['searchterm'] ) {
|
1658 |
+
$subscribers = &$result;
|
1659 |
+
$what = 'public';
|
1660 |
+
}
|
1661 |
+
|
1662 |
+
if ( !empty($subscribers) ) {
|
1663 |
+
natcasesort($subscribers);
|
1664 |
+
// Displays a page number strip - adapted from code in Akismet
|
1665 |
+
$args['what'] = $what;
|
1666 |
+
$total_subscribers = count($subscribers);
|
1667 |
+
$total_pages = ceil($total_subscribers / $this->subscribe2_options['entries']);
|
1668 |
+
$strip = '';
|
1669 |
+
if ( $page > 1 ) {
|
1670 |
+
$args['s2page'] = $page - 1;
|
1671 |
+
$strip .= '<a class="prev" href="' . clean_url(add_query_arg($args)) . '">« '. __('Previous Page', 'subscribe2') .'</a>' . "\n";
|
1672 |
+
}
|
1673 |
+
if ( $total_pages > 1 ) {
|
1674 |
+
for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) {
|
1675 |
+
if ( $page == $page_num ) {
|
1676 |
+
$strip .= "<strong>Page " . $page_num . "</strong>\n";
|
1677 |
+
} else {
|
1678 |
+
if ( $page_num < 3 || ( $page_num >= $page - 2 && $page_num <= $page + 2 ) || $page_num > $total_pages - 2 ) {
|
1679 |
+
$args['s2page'] = $page_num;
|
1680 |
+
$strip .= "<a class=\"page-numbers\" href=\"" . clean_url(add_query_arg($args)) . "\">" . $page_num . "</a>\n";
|
1681 |
+
$trunc = true;
|
1682 |
+
} elseif ( $trunc == true ) {
|
1683 |
+
$strip .= "...\n";
|
1684 |
+
$trunc = false;
|
1685 |
+
}
|
1686 |
+
}
|
1687 |
+
}
|
1688 |
+
}
|
1689 |
+
if ( ( $page ) * $this->subscribe2_options['entries'] < $total_subscribers ) {
|
1690 |
+
$args['s2page'] = $page + 1;
|
1691 |
+
$strip .= "<a class=\"next\" href=\"" . clean_url(add_query_arg($args)) . "\">". __('Next Page', 'subscribe2') . " »</a>\n";
|
1692 |
+
}
|
1693 |
+
}
|
1694 |
+
|
1695 |
+
// show our form
|
1696 |
+
echo "<div class=\"wrap\">";
|
1697 |
+
screen_icon();
|
1698 |
+
echo "<h2>" . __('Manage Subscribers', 'subscribe2') . "</h2>\r\n";
|
1699 |
+
echo "<form method=\"post\" action=\"\">\r\n";
|
1700 |
+
if ( function_exists('wp_nonce_field') ) {
|
1701 |
+
wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
|
1702 |
+
}
|
1703 |
+
echo "<h2>" . __('Add/Remove Subscribers', 'subscribe2') . "</h2>\r\n";
|
1704 |
+
echo "<p>" . __('Enter addresses, one per line or comma-separated', 'subscribe2') . "<br />\r\n";
|
1705 |
+
echo "<textarea rows=\"2\" cols=\"80\" name=\"addresses\"></textarea></p>\r\n";
|
1706 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" />\r\n";
|
1707 |
+
echo "<p class=\"submit\" style=\"border-top: none;\"><input type=\"submit\" class=\"button-primary\" name=\"subscribe\" value=\"" . __('Subscribe', 'subscribe2') . "\" />";
|
1708 |
+
echo " <input type=\"submit\" class=\"button-primary\" name=\"unsubscribe\" value=\"" . __('Unsubscribe', 'subscribe2') . "\" /></p>\r\n";
|
1709 |
+
|
1710 |
+
// subscriber lists
|
1711 |
+
echo "<h2>" . __('Current Subscribers', 'subscribe2') . "</h2>\r\n";
|
1712 |
+
echo "<br />";
|
1713 |
+
$this->display_subscriber_dropdown($what, __('Filter', 'subscribe2'));
|
1714 |
+
// show the selected subscribers
|
1715 |
+
$alternate = '';
|
1716 |
+
echo "<table cellpadding=\"2\" cellspacing=\"2\" width=\"100%\">";
|
1717 |
+
echo "<tr class=\"alternate\"><td width=\"50%\"><input type=\"text\" name=\"searchterm\" value=\"\" /> \r\n";
|
1718 |
+
echo "<input type=\"submit\" class=\"button-secondary\" name=\"search\" value=\"" . __('Search Subscribers', 'subscribe2') . "\" /></td>\r\n";
|
1719 |
+
if ( $reminderform ) {
|
1720 |
+
echo "<td width=\"25%\" align=\"right\"><input type=\"hidden\" name=\"reminderemails\" value=\"" . $reminderemails . "\" />\r\n";
|
1721 |
+
echo "<input type=\"submit\" class=\"button-secondary\" name=\"remind\" value=\"" . __('Send Reminder Email', 'subscribe2') . "\" /></td>\r\n";
|
1722 |
+
} else {
|
1723 |
+
echo "<td width=\"25%\"></td>";
|
1724 |
+
}
|
1725 |
+
if ( !empty($subscribers) ) {
|
1726 |
+
$exportcsv = implode(",\r\n", $subscribers);
|
1727 |
+
echo "<td width=\"25%\" align=\"right\"><input type=\"hidden\" name=\"exportcsv\" value=\"" . $what . "\" />\r\n";
|
1728 |
+
echo "<input type=\"submit\" class=\"button-secondary\" name=\"csv\" value=\"" . __('Save Emails to CSV File', 'subscribe2') . "\" /></td>\r\n";
|
1729 |
+
}
|
1730 |
+
echo "</tr></table>";
|
1731 |
+
|
1732 |
+
echo "<table class=\"widefat\" cellpadding=\"2\" cellspacing=\"2\">";
|
1733 |
+
if ( !empty($subscribers) ) {
|
1734 |
+
echo "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
|
1735 |
+
echo "<td align=\"right\">" . $strip . "</td></tr>\r\n";
|
1736 |
+
}
|
1737 |
+
if ( !empty($subscribers) ) {
|
1738 |
+
if ( is_int($this->subscribe2_options['entries']) ) {
|
1739 |
+
$subscriber_chunks = array_chunk($subscribers, $this->subscribe2_options['entries']);
|
1740 |
+
} else {
|
1741 |
+
$subscriber_chunks = array_chunk($subscribers, 25);
|
1742 |
+
}
|
1743 |
+
$chunk = $page - 1;
|
1744 |
+
$subscribers = $subscriber_chunks[$chunk];
|
1745 |
+
echo "<tr class=\"alternate\" style=\"height:1.5em;\">\r\n";
|
1746 |
+
echo "<td width=\"4%\" align=\"center\">";
|
1747 |
+
echo "<img src=\"" . $urlpath . "include/accept.png\" alt=\"<\" title=\"" . __('Confirm this email address', 'subscribe2') . "\" /></td>\r\n";
|
1748 |
+
echo "<td width=\"4%\" align=\"center\">";
|
1749 |
+
echo "<img src=\"" . $urlpath . "include/exclamation.png\" alt=\">\" title=\"" . __('Unconfirm this email address', 'subscribe2') . "\" /></td>\r\n";
|
1750 |
+
echo "<td width=\"4%\" align=\"center\">";
|
1751 |
+
echo "<img src=\"" . $urlpath . "include/cross.png\" alt=\"X\" title=\"" . __('Delete this email address', 'subscribe2') . "\" /></td><td></td></tr>\r\n";
|
1752 |
+
echo "<tr><td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"confirm_checkall\" /></td>\r\n";
|
1753 |
+
echo "<td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"unconfirm_checkall\" /></td>\r\n";
|
1754 |
+
echo "<td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"delete_checkall\" /></td>\r\n";
|
1755 |
+
echo "<td align=\"left\"><strong>" . __('Select / Unselect All', 'subscribe2') . "</strong></td></tr>\r\n";
|
1756 |
+
|
1757 |
+
foreach ( $subscribers as $subscriber ) {
|
1758 |
+
echo "<tr class=\"$alternate\" style=\"height:1.5em;\">";
|
1759 |
+
echo "<td align=\"center\">\r\n";
|
1760 |
+
if ( in_array($subscriber, $confirmed) ) {
|
1761 |
+
echo "</td><td align=\"center\">\r\n";
|
1762 |
+
echo "<input class=\"unconfirm_checkall\" title=\"" . __('Unconfirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"unconfirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
|
1763 |
+
echo "<td align=\"center\">\r\n";
|
1764 |
+
echo "<input class=\"delete_checkall\" title=\"" . __('Delete this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"delete[]\" value=\"" . $subscriber . "\" />\r\n";
|
1765 |
+
echo "</td>\r\n";
|
1766 |
+
echo "<td><span style=\"color:#006600\">√ </span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
|
1767 |
+
echo "(<span style=\"color:#006600\"><abbr title=\"" . $this->signup_ip($subscriber) . "\">" . $this->signup_date($subscriber) . "</abbr></span>)\r\n";
|
1768 |
+
} elseif ( in_array($subscriber, $unconfirmed) ) {
|
1769 |
+
echo "<input class=\"confirm_checkall\" title=\"" . __('Confirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"confirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
|
1770 |
+
echo "<td align=\"center\"></td>\r\n";
|
1771 |
+
echo "<td align=\"center\">\r\n";
|
1772 |
+
echo "<input class=\"delete_checkall\" title=\"" . __('Delete this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"delete[]\" value=\"" . $subscriber . "\" />\r\n";
|
1773 |
+
echo "</td>\r\n";
|
1774 |
+
echo "<td><span style=\"color:#FF0000\"> ! </span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
|
1775 |
+
echo "(<span style=\"color:#FF0000\"><abbr title=\"" . $this->signup_ip($subscriber) . "\">" . $this->signup_date($subscriber) . "</abbr></span>)\r\n";
|
1776 |
+
} elseif ( in_array($subscriber, $all_users) ) {
|
1777 |
+
echo "</td><td align=\"center\"></td><td align=\"center\"></td>\r\n";
|
1778 |
+
echo "<td><span style=\"color:#006600\">® </span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
|
1779 |
+
echo "(<a href=\"" . get_option('siteurl') . "/wp-admin/users.php?page=s2_users&email=" . urlencode($subscriber) . "\">" . __('edit', 'subscribe2') . "</a>)\r\n";
|
1780 |
+
}
|
1781 |
+
echo "</td></tr>\r\n";
|
1782 |
+
('alternate' == $alternate) ? $alternate = '' : $alternate = 'alternate';
|
1783 |
+
}
|
1784 |
+
} else {
|
1785 |
+
if ( $_POST['searchterm'] ) {
|
1786 |
+
echo "<tr><td align=\"center\"><b>" . __('No matching subscribers found', 'subscribe2') . "</b></td></tr>\r\n";
|
1787 |
+
} else {
|
1788 |
+
echo "<tr><td align=\"center\"><b>" . __('NONE', 'subscribe2') . "</b></td></tr>\r\n";
|
1789 |
+
}
|
1790 |
+
}
|
1791 |
+
if ( !empty($subscribers) ) {
|
1792 |
+
echo "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
|
1793 |
+
echo "<td align=\"right\">" . $strip . "</td></tr>\r\n";
|
1794 |
+
}
|
1795 |
+
echo "</table>\r\n";
|
1796 |
+
|
1797 |
+
// show bulk managment form if filtered in some Registered Users
|
1798 |
+
if ( in_array($what, array('registered', 'all_users')) || is_numeric($what) ) {
|
1799 |
+
$subscribers_string = implode(',', $subscribers);
|
1800 |
+
echo "<h2>" . __('Categories', 'subscribe2') . "</h2>\r\n";
|
1801 |
+
echo __('Preferences for Registered Users selected in the filter above can be changed using this section.', 'subscribe2') . "<br />\r\n";
|
1802 |
+
echo "<strong><em style=\"color: red\">" . __('Consider User Privacy as changes cannot be undone', 'subscribe2') . "</em></strong><br />\r\n";
|
1803 |
+
echo "<br />" . __('Action to perform', 'subscribe2') . ":\r\n";
|
1804 |
+
echo "<label><input type=\"radio\" name=\"manage\" value=\"subscribe\" checked=\"checked\" /> " . __('Subscribe', 'subscribe2') . "</label> \r\n";
|
1805 |
+
echo "<label><input type=\"radio\" name=\"manage\" value=\"unsubscribe\" /> " . __('Unsubscribe', 'subscribe2') . "</label><br /><br />\r\n";
|
1806 |
+
echo "<input type=\"hidden\" name=\"emails\" value=\"$subscribers_string\" />\r\n";
|
1807 |
+
$this->display_category_form();
|
1808 |
+
echo "<p class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"sub_categories\" value=\"" . __('Bulk Update Categories', 'subscribe2') . "\" /></p>";
|
1809 |
+
|
1810 |
+
echo "<br />" . __('Send email as', 'subscribe2') . ":\r\n";
|
1811 |
+
echo "<label><input type=\"radio\" name=\"format\" value=\"html\" /> " . __('HTML - Full', 'subscribe2') . "</label> \r\n";
|
1812 |
+
echo "<label><input type=\"radio\" name=\"format\" value=\"html_excerpt\" /> " . __('HTML - Excerpt', 'subscribe2') . "</label> \r\n";
|
1813 |
+
echo "<label><input type=\"radio\" name=\"format\" value=\"post\" /> " . __('Plain Text - Full', 'subscribe2') . "</label> \r\n";
|
1814 |
+
echo "<label><input type=\"radio\" name=\"format\" value=\"excerpt\" checked=\"checked\" /> " . __('Plain Text - Excerpt', 'subscribe2') . "</label>\r\n";
|
1815 |
+
echo "<p class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"sub_format\" value=\"" . __('Bulk Update Format', 'subscribe2') . "\" /></p>";
|
1816 |
+
}
|
1817 |
+
echo "</form></div>\r\n";
|
1818 |
+
|
1819 |
+
include(ABSPATH . 'wp-admin/admin-footer.php');
|
1820 |
+
// just to be sure
|
1821 |
+
die;
|
1822 |
+
} // end manage_menu()
|
1823 |
+
|
1824 |
+
/**
|
1825 |
+
Our options page
|
1826 |
+
*/
|
1827 |
+
function options_menu() {
|
1828 |
+
global $s2nonce, $wpdb;
|
1829 |
+
|
1830 |
+
// send error message if no WordPress page exists
|
1831 |
+
$sql = "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status='publish' LIMIT 1";
|
1832 |
+
$id = $wpdb->get_var($sql);
|
1833 |
+
if ( empty($id) ) {
|
1834 |
+
echo "<div id=\"message\" class=\"error\"><p><strong>$this->no_page</strong></p></div>";
|
1835 |
+
}
|
1836 |
+
|
1837 |
+
// was anything POSTed?
|
1838 |
+
if ( isset( $_POST['s2_admin']) ) {
|
1839 |
+
check_admin_referer('subscribe2-options_subscribers' . $s2nonce);
|
1840 |
+
if ( $_POST['reset'] ) {
|
1841 |
+
$this->reset();
|
1842 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>$this->options_reset</strong></p></div>";
|
1843 |
+
} elseif ( $_POST['preview'] ) {
|
1844 |
+
global $user_email;
|
1845 |
+
$this->preview_email = true;
|
1846 |
+
if ( 'never' == $this->subscribe2_options['email_freq'] ) {
|
1847 |
+
$post = get_posts('numberposts=1');
|
1848 |
+
$this->publish($post[0], $user_email);
|
1849 |
+
} else {
|
1850 |
+
$this->subscribe2_cron($user_email);
|
1851 |
+
}
|
1852 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Preview message(s) sent to logged in user', 'subscribe2') . "</strong></p></div>";
|
1853 |
+
} elseif ( $_POST['resend'] ) {
|
1854 |
+
$status = $this->subscribe2_cron('', 'resend');
|
1855 |
+
if ( $status === false ) {
|
1856 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('The Digest Notification email contained no post information. No email was sent', 'subscribe2') . "</strong></p></div>";
|
1857 |
+
} else {
|
1858 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Attempt made to resend the Digest Notification email', 'subscribe2') . "</strong></p></div>";
|
1859 |
+
}
|
1860 |
+
} elseif ( $_POST['submit'] ) {
|
1861 |
+
// BCClimit
|
1862 |
+
if ( is_numeric($_POST['bcc']) && $_POST['bcc'] >= 0 ) {
|
1863 |
+
$this->subscribe2_options['bcclimit'] = $_POST['bcc'];
|
1864 |
+
}
|
1865 |
+
// admin_email
|
1866 |
+
$this->subscribe2_options['admin_email'] = $_POST['admin_email'];
|
1867 |
+
|
1868 |
+
// send as author or admin?
|
1869 |
+
$sender = 'author';
|
1870 |
+
if ( is_numeric($_POST['sender']) ) {
|
1871 |
+
$sender = $_POST['sender'];
|
1872 |
+
}
|
1873 |
+
$this->subscribe2_options['sender'] = $sender;
|
1874 |
+
|
1875 |
+
// send email for pages, private and password protected posts
|
1876 |
+
$this->subscribe2_options['stylesheet'] = $_POST['stylesheet'];
|
1877 |
+
$this->subscribe2_options['pages'] = $_POST['pages'];
|
1878 |
+
$this->subscribe2_options['password'] = $_POST['password'];
|
1879 |
+
$this->subscribe2_options['private'] = $_POST['private'];
|
1880 |
+
$this->subscribe2_options['cron_order'] = $_POST['cron_order'];
|
1881 |
+
|
1882 |
+
// send per-post or digest emails
|
1883 |
+
$email_freq = $_POST['email_freq'];
|
1884 |
+
$scheduled_time = wp_next_scheduled('s2_digest_cron');
|
1885 |
+
if ( $email_freq != $this->subscribe2_options['email_freq'] || $_POST['hour'] != date('H', $scheduled_time) ) {
|
1886 |
+
$this->subscribe2_options['email_freq'] = $email_freq;
|
1887 |
+
wp_clear_scheduled_hook('s2_digest_cron');
|
1888 |
+
$scheds = (array)wp_get_schedules();
|
1889 |
+
$interval = ( isset($scheds[$email_freq]['interval']) ) ? (int) $scheds[$email_freq]['interval'] : 0;
|
1890 |
+
if ( $interval == 0 ) {
|
1891 |
+
// if we are on per-post emails remove last_cron entry
|
1892 |
+
unset($this->subscribe2_options['last_s2cron']);
|
1893 |
+
} else {
|
1894 |
+
// if we are using digest schedule the event and prime last_cron as now
|
1895 |
+
$time = time() + $interval;
|
1896 |
+
if ( $interval < 86400 ) {
|
1897 |
+
// Schedule CRON events occurring less than daily starting now and periodically thereafter
|
1898 |
+
$maybe_time = mktime($_POST['hour'], 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
1899 |
+
// is maybe_time in the future
|
1900 |
+
$offset = $maybe_time - time();
|
1901 |
+
// is maybe_time + $interval in the future
|
1902 |
+
$offset2 = ($maybe_time + $interval) - time();
|
1903 |
+
if ( $offset < 0 ) {
|
1904 |
+
if ( $offset2 < 0 ) {
|
1905 |
+
$timestamp = &$time;
|
1906 |
+
} else {
|
1907 |
+
$timestamp = $maybe_time + $interval;
|
1908 |
+
}
|
1909 |
+
} else {
|
1910 |
+
$timestamp = &$maybe_time;
|
1911 |
+
}
|
1912 |
+
} else {
|
1913 |
+
// Schedule other CRON events starting at user defined hour and periodically thereafter
|
1914 |
+
$timestamp = mktime($_POST['hour'], 0, 0, date('m', $time), date('d', $time), date('Y', $time));
|
1915 |
+
}
|
1916 |
+
wp_schedule_event($timestamp, $email_freq, 's2_digest_cron');
|
1917 |
+
if ( !isset($this->subscribe2_options['last_s2cron']) ) {
|
1918 |
+
$this->subscribe2_options['last_s2cron'] = current_time('mysql');
|
1919 |
+
}
|
1920 |
+
}
|
1921 |
+
}
|
1922 |
+
|
1923 |
+
// email subject and body templates
|
1924 |
+
// ensure that are not empty before updating
|
1925 |
+
if ( !empty($_POST['notification_subject']) ) {
|
1926 |
+
$this->subscribe2_options['notification_subject'] = $_POST['notification_subject'];
|
1927 |
+
}
|
1928 |
+
if ( !empty($_POST['mailtext']) ) {
|
1929 |
+
$this->subscribe2_options['mailtext'] = $_POST['mailtext'];
|
1930 |
+
}
|
1931 |
+
if ( !empty($_POST['confirm_subject']) ) {
|
1932 |
+
$this->subscribe2_options['confirm_subject'] = $_POST['confirm_subject'];
|
1933 |
+
}
|
1934 |
+
if ( !empty($_POST['confirm_email']) ) {
|
1935 |
+
$this->subscribe2_options['confirm_email'] = $_POST['confirm_email'];
|
1936 |
+
}
|
1937 |
+
if ( !empty($_POST['remind_subject']) ) {
|
1938 |
+
$this->subscribe2_options['remind_subject'] = $_POST['remind_subject'];
|
1939 |
+
}
|
1940 |
+
if ( !empty($_POST['remind_email']) ) {
|
1941 |
+
$this->subscribe2_options['remind_email'] = $_POST['remind_email'];
|
1942 |
+
}
|
1943 |
+
|
1944 |
+
// excluded categories
|
1945 |
+
if ( !empty($_POST['category']) ) {
|
1946 |
+
$exclude_cats = implode(',', $_POST['category']);
|
1947 |
+
} else {
|
1948 |
+
$exclude_cats = '';
|
1949 |
+
}
|
1950 |
+
$this->subscribe2_options['exclude'] = $exclude_cats;
|
1951 |
+
// allow override?
|
1952 |
+
( isset($_POST['reg_override']) ) ? $override = '1' : $override = '0';
|
1953 |
+
$this->subscribe2_options['reg_override'] = $override;
|
1954 |
+
|
1955 |
+
// default WordPress page where Subscribe2 token is placed
|
1956 |
+
if ( is_numeric($_POST['page']) && $_POST['page'] >= 0 ) {
|
1957 |
+
$this->subscribe2_options['s2page'] = $_POST['page'];
|
1958 |
+
}
|
1959 |
+
|
1960 |
+
// Number of subscriber per page
|
1961 |
+
if ( is_numeric($_POST['entries']) && $_POST['entries'] > 0 ) {
|
1962 |
+
$this->subscribe2_options['entries'] = (int)$_POST['entries'];
|
1963 |
+
}
|
1964 |
+
|
1965 |
+
// show meta link?
|
1966 |
+
( $_POST['show_meta'] == '1' ) ? $showmeta = '1' : $showmeta = '0';
|
1967 |
+
$this->subscribe2_options['show_meta'] = $showmeta;
|
1968 |
+
|
1969 |
+
// show button?
|
1970 |
+
( $_POST['show_button'] == '1' ) ? $showbutton = '1' : $showbutton = '0';
|
1971 |
+
$this->subscribe2_options['show_button'] = $showbutton;
|
1972 |
+
|
1973 |
+
// show widget in Presentation->Widgets
|
1974 |
+
( $_POST['widget'] == '1' ) ? $showwidget = '1' : $showwidget = '0';
|
1975 |
+
$this->subscribe2_options['widget'] = $showwidget;
|
1976 |
+
|
1977 |
+
// show counterwidget in Presentation->Widgets
|
1978 |
+
( $_POST['counterwidget'] == '1' ) ? $showcounterwidget = '1' : $showcounterwidget = '0';
|
1979 |
+
$this->subscribe2_options['counterwidget'] = $showcounterwidget;
|
1980 |
+
|
1981 |
+
// Subscribe2 over ride postmeta checked by default
|
1982 |
+
( $_POST['s2meta_default'] == '1' ) ? $s2meta_default = '1' : $s2meta_default = '0';
|
1983 |
+
$this->subscribe2_options['s2meta_default'] = $s2meta_default;
|
1984 |
+
|
1985 |
+
//automatic subscription
|
1986 |
+
$this->subscribe2_options['autosub'] = $_POST['autosub'];
|
1987 |
+
$this->subscribe2_options['newreg_override'] = $_POST['newreg_override'];
|
1988 |
+
$this->subscribe2_options['wpregdef'] = $_POST['wpregdef'];
|
1989 |
+
$this->subscribe2_options['autoformat'] = $_POST['autoformat'];
|
1990 |
+
$this->subscribe2_options['show_autosub'] = $_POST['show_autosub'];
|
1991 |
+
$this->subscribe2_options['autosub_def'] = $_POST['autosub_def'];
|
1992 |
+
|
1993 |
+
//barred domains
|
1994 |
+
$this->subscribe2_options['barred'] = $_POST['barred'];
|
1995 |
+
|
1996 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>$this->options_saved</strong></p></div>";
|
1997 |
+
update_option('subscribe2_options', $this->subscribe2_options);
|
1998 |
+
}
|
1999 |
+
}
|
2000 |
+
// show our form
|
2001 |
+
echo "<div class=\"wrap\">";
|
2002 |
+
screen_icon();
|
2003 |
+
echo "<h2>" . __('Subscribe2 Settings', 'subscribe2') . "</h2>\r\n";
|
2004 |
+
echo "<a href=\"http://subscribe2.wordpress.com/\">" . __('Plugin Blog', 'subscribe2') . "</a> | ";
|
2005 |
+
echo "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904\">" . __('Make a donation via PayPal', 'subscribe2') . "</a>";
|
2006 |
+
echo "<form method=\"post\" action=\"\">\r\n";
|
2007 |
+
if ( function_exists('wp_nonce_field') ) {
|
2008 |
+
wp_nonce_field('subscribe2-options_subscribers' . $s2nonce);
|
2009 |
+
}
|
2010 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"options\" />\r\n";
|
2011 |
+
echo "<input type=\"hidden\" id=\"jsbcc\" value=\"" . $this->subscribe2_options['bcclimit'] . "\" />";
|
2012 |
+
echo "<input type=\"hidden\" id=\"jspage\" value=\"" . $this->subscribe2_options['s2page'] . "\" />";
|
2013 |
+
echo "<input type=\"hidden\" id=\"jsentries\" value=\"" . $this->subscribe2_options['entries'] . "\" />";
|
2014 |
+
|
2015 |
+
// settings for outgoing emails
|
2016 |
+
echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
|
2017 |
+
echo __('Restrict the number of recipients per email to (0 for unlimited)', 'subscribe2') . ': ';
|
2018 |
+
echo "<span id=\"s2bcc_1\"><span id=\"s2bcc\" style=\"background-color: #FFFBCC\">" . $this->subscribe2_options['bcclimit'] . "</span> ";
|
2019 |
+
echo "<a href=\"#\" onclick=\"s2_show('bcc'); return false;\">" . __('Edit', 'subscribe2') . "</a></span>\n";
|
2020 |
+
echo "<span id=\"s2bcc_2\">\r\n";
|
2021 |
+
echo "<input type=\"text\" name=\"bcc\" value=\"" . $this->subscribe2_options['bcclimit'] . "\" size=\"3\" />\r\n";
|
2022 |
+
echo "<a href=\"#\" onclick=\"s2_update('bcc'); return false;\">". __('Update', 'subscribe2') . "</a>\n";
|
2023 |
+
echo "<a href=\"#\" onclick=\"s2_revert('bcc'); return false;\">". __('Revert', 'subscribe2') . "</a></span>\n";
|
2024 |
+
|
2025 |
+
echo "<br /><br />" . __('Send Admins notifications for new', 'subscribe2') . ': ';
|
2026 |
+
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"subs\"";
|
2027 |
+
if ( 'subs' == $this->subscribe2_options['admin_email'] ) {
|
2028 |
+
echo " checked=\"checked\"";
|
2029 |
+
}
|
2030 |
+
echo " /> " . __('Subscriptions', 'subscribe2') . "</label> ";
|
2031 |
+
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"unsubs\"";
|
2032 |
+
if ( 'unsubs' == $this->subscribe2_options['admin_email'] ) {
|
2033 |
+
echo " checked=\"checked\"";
|
2034 |
+
}
|
2035 |
+
echo " /> " . __('Unsubscriptions', 'subscribe2') . "</label> ";
|
2036 |
+
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"both\"";
|
2037 |
+
if ( 'both' == $this->subscribe2_options['admin_email'] ) {
|
2038 |
+
echo " checked=\"checked\"";
|
2039 |
+
}
|
2040 |
+
echo " /> " . __('Both', 'subscribe2') . "</label> ";
|
2041 |
+
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"none\"";
|
2042 |
+
if ( 'none' == $this->subscribe2_options['admin_email'] ) {
|
2043 |
+
echo " checked=\"checked\"";
|
2044 |
+
}
|
2045 |
+
echo " /> " . __('Neither', 'subscribe2') . "</label><br /><br />\r\n";
|
2046 |
+
|
2047 |
+
echo __('Include theme CSS stylesheet in HTML notifications', 'subscribe2') . ': ';
|
2048 |
+
echo "<label><input type=\"radio\" name=\"stylesheet\" value=\"yes\"";
|
2049 |
+
if ( 'yes' == $this->subscribe2_options['stylesheet'] ) {
|
2050 |
+
echo " checked=\"checked\"";
|
2051 |
+
}
|
2052 |
+
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
2053 |
+
echo "<label><input type=\"radio\" name=\"stylesheet\" value=\"no\"";
|
2054 |
+
if ( 'no' == $this->subscribe2_options['stylesheet'] ) {
|
2055 |
+
echo " checked=\"checked\"";
|
2056 |
+
}
|
2057 |
+
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2058 |
+
|
2059 |
+
echo __('Send Emails for Pages', 'subscribe2') . ': ';
|
2060 |
+
echo "<label><input type=\"radio\" name=\"pages\" value=\"yes\"";
|
2061 |
+
if ( 'yes' == $this->subscribe2_options['pages'] ) {
|
2062 |
+
echo " checked=\"checked\"";
|
2063 |
+
}
|
2064 |
+
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
2065 |
+
echo "<label><input type=\"radio\" name=\"pages\" value=\"no\"";
|
2066 |
+
if ( 'no' == $this->subscribe2_options['pages'] ) {
|
2067 |
+
echo " checked=\"checked\"";
|
2068 |
+
}
|
2069 |
+
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2070 |
+
echo __('Send Emails for Password Protected Posts', 'subscribe2') . ': ';
|
2071 |
+
echo "<label><input type=\"radio\" name=\"password\" value=\"yes\"";
|
2072 |
+
if ( 'yes' == $this->subscribe2_options['password'] ) {
|
2073 |
+
echo " checked=\"checked\"";
|
2074 |
+
}
|
2075 |
+
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
2076 |
+
echo "<label><input type=\"radio\" name=\"password\" value=\"no\"";
|
2077 |
+
if ( 'no' == $this->subscribe2_options['password'] ) {
|
2078 |
+
echo " checked=\"checked\"";
|
2079 |
+
}
|
2080 |
+
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2081 |
+
echo __('Send Emails for Private Posts', 'subscribe2') . ': ';
|
2082 |
+
echo "<label><input type=\"radio\" name=\"private\" value=\"yes\"";
|
2083 |
+
if ( 'yes' == $this->subscribe2_options['private'] ) {
|
2084 |
+
echo " checked=\"checked\"";
|
2085 |
+
}
|
2086 |
+
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
2087 |
+
echo "<label><input type=\"radio\" name=\"private\" value=\"no\"";
|
2088 |
+
if ( 'no' == $this->subscribe2_options['private'] ) {
|
2089 |
+
echo " checked=\"checked\"";
|
2090 |
+
}
|
2091 |
+
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2092 |
+
echo __('Send Email From', 'subscribe2') . ': ';
|
2093 |
+
echo "<label>\r\n";
|
2094 |
+
$this->admin_dropdown(true);
|
2095 |
+
echo "</label><br /><br />\r\n";
|
2096 |
+
if ( function_exists('wp_schedule_event') ) {
|
2097 |
+
echo __('Send Emails', 'subscribe2') . ": <br /><br />\r\n";
|
2098 |
+
$this->display_digest_choices();
|
2099 |
+
echo __('For digest notifications, date order for posts is', 'subscribe2') . ": \r\n";
|
2100 |
+
echo "<label><input type=\"radio\" name=\"cron_order\" value=\"desc\"";
|
2101 |
+
if ( 'desc' == $this->subscribe2_options['cron_order'] ) {
|
2102 |
+
echo " checked=\"checked\"";
|
2103 |
+
}
|
2104 |
+
echo " /> " . __('Descending', 'subscribe2') . "</label> ";
|
2105 |
+
echo "<label><input type=\"radio\" name=\"cron_order\" value=\"asc\"";
|
2106 |
+
if ( 'asc' == $this->subscribe2_options['cron_order'] ) {
|
2107 |
+
echo " checked=\"checked\"";
|
2108 |
+
}
|
2109 |
+
echo " /> " . __('Ascending', 'subscribe2') . "</label><br /><br />\r\n";
|
2110 |
+
}
|
2111 |
+
|
2112 |
+
// email templates
|
2113 |
+
echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
|
2114 |
+
echo"<br />";
|
2115 |
+
echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"1\" class=\"editform\">\r\n";
|
2116 |
+
echo "<tr><td>";
|
2117 |
+
echo __('New Post email (must not be empty)', 'subscribe2') . ":<br />\r\n";
|
2118 |
+
echo __('Subject Line', 'subscribe2') . ": ";
|
2119 |
+
echo "<input type=\"text\" name=\"notification_subject\" value=\"" . stripslashes($this->subscribe2_options['notification_subject']) . "\" size=\"30\" />";
|
2120 |
+
echo "<br />\r\n";
|
2121 |
+
echo "<textarea rows=\"9\" cols=\"60\" name=\"mailtext\">" . stripslashes($this->subscribe2_options['mailtext']) . "</textarea><br /><br />\r\n";
|
2122 |
+
echo "</td><td valign=\"top\" rowspan=\"3\">";
|
2123 |
+
echo "<p class=\"submit\"><input type=\"submit\" class=\"button-secondary\" name=\"preview\" value=\"" . __('Send Email Preview', 'subscribe2') . "\" /></p>\r\n";
|
2124 |
+
echo "<h3>" . __('Message substitions', 'subscribe2') . "</h3>\r\n";
|
2125 |
+
echo "<dl>";
|
2126 |
+
echo "<dt><b>BLOGNAME</b></dt><dd>" . get_option('blogname') . "</dd>\r\n";
|
2127 |
+
echo "<dt><b>BLOGLINK</b></dt><dd>" . get_option('home') . "</dd>\r\n";
|
2128 |
+
echo "<dt><b>TITLE</b></dt><dd>" . __("the post's title<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
2129 |
+
echo "<dt><b>POST</b></dt><dd>" . __("the excerpt or the entire post<br />(<i>based on the subscriber's preferences</i>)", 'subscribe2') . "</dd>\r\n";
|
2130 |
+
echo "<dt><b>POSTTIME</b></dt><dd>" . __("the excerpt of the post and the time it was posted<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
2131 |
+
echo "<dt><b>TABLE</b></dt><dd>" . __("a list of post titles<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
2132 |
+
echo "<dt><b>TABLELINKS</b></dt><dd>" . __("a list of post titles followed by links to the atricles<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
2133 |
+
echo "<dt><b>PERMALINK</b></dt><dd>" . __("the post's permalink<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
2134 |
+
echo "<dt><b>TINYLINK</b></dt><dd>" . __("the post's permalink after conversion by TinyURL<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
2135 |
+
echo "<dt><b>DATE</b></dt><dd>" . __("the date the post was made<br />(<i>for per-post emails only</i>)", "subscribe2") . "</dd>\r\n";
|
2136 |
+
echo "<dt><b>TIME</b></dt><dd>" . __("the time the post was made<br />(<i>for per-post emails only</i>)", "subscribe2") . "</dd>\r\n";
|
2137 |
+
echo "<dt><b>MYNAME</b></dt><dd>" . __("the admin or post author's name", 'subscribe2') . "</dd>\r\n";
|
2138 |
+
echo "<dt><b>EMAIL</b></dt><dd>" . __("the admin or post author's email", 'subscribe2') . "</dd>\r\n";
|
2139 |
+
echo "<dt><b>AUTHORNAME</b></dt><dd>" . __("the post author's name", 'subscribe2') . "</dd>\r\n";
|
2140 |
+
echo "<dt><b>LINK</b></dt><dd>" . __("the generated link to confirm a request<br />(<i>only used in the confirmation email template</i>)", 'subscribe2') . "</dd>\r\n";
|
2141 |
+
echo "<dt><b>ACTION</b></dt><dd>" . __("Action performed by LINK in confirmation email<br />(<i>only used in the confirmation email template</i>)", 'subscribe2') . "</dd>\r\n";
|
2142 |
+
echo "<dt><b>CATS</b></dt><dd>" . __("the post's assigned categories", 'subscribe2') . "</dd>\r\n";
|
2143 |
+
echo "<dt><b>TAGS</b></dt><dd>" . __("the post's assigned Tags", 'subscribe2') . "</dd>\r\n";
|
2144 |
+
echo "<dt><b>COUNT</b></dt><dd>" . __("the number of posts included in the digest email<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
2145 |
+
echo "</dl></td></tr><tr><td>";
|
2146 |
+
echo __('Subscribe / Unsubscribe confirmation email', 'subscribe2') . ":<br />\r\n";
|
2147 |
+
echo __('Subject Line', 'subscribe2') . ": ";
|
2148 |
+
echo "<input type=\"text\" name=\"confirm_subject\" value=\"" . stripslashes($this->subscribe2_options['confirm_subject']) . "\" size=\"30\" /><br />\r\n";
|
2149 |
+
echo "<textarea rows=\"9\" cols=\"60\" name=\"confirm_email\">" . stripslashes($this->subscribe2_options['confirm_email']) . "</textarea><br /><br />\r\n";
|
2150 |
+
echo "</td></tr><tr valign=\"top\"><td>";
|
2151 |
+
echo __('Reminder email to Unconfirmed Subscribers', 'subscribe2') . ":<br />\r\n";
|
2152 |
+
echo __('Subject Line', 'subscribe2') . ": ";
|
2153 |
+
echo "<input type=\"text\" name=\"remind_subject\" value=\"" . stripslashes($this->subscribe2_options['remind_subject']) . "\" size=\"30\" /><br />\r\n";
|
2154 |
+
echo "<textarea rows=\"9\" cols=\"60\" name=\"remind_email\">" . stripslashes($this->subscribe2_options['remind_email']) . "</textarea><br /><br />\r\n";
|
2155 |
+
echo "</td></tr></table><br />\r\n";
|
2156 |
+
|
2157 |
+
// excluded categories
|
2158 |
+
echo "<h2>" . __('Excluded Categories', 'subscribe2') . "</h2>\r\n";
|
2159 |
+
echo"<p>";
|
2160 |
+
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";
|
2161 |
+
echo"</p>";
|
2162 |
+
$this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
|
2163 |
+
echo "<center><label><input type=\"checkbox\" name=\"reg_override\" value=\"1\"";
|
2164 |
+
if ( '1' == $this->subscribe2_options['reg_override'] ) {
|
2165 |
+
echo " checked=\"checked\"";
|
2166 |
+
}
|
2167 |
+
echo " /> " . __('Allow registered users to subscribe to excluded categories?', 'subscribe2') . "</label></center><br />\r\n";
|
2168 |
+
|
2169 |
+
// Appearance options
|
2170 |
+
echo "<h2>" . __('Appearance', 'subscribe2') . "</h2>\r\n";
|
2171 |
+
echo"<p>";
|
2172 |
+
|
2173 |
+
// WordPress page ID where subscribe2 token is used
|
2174 |
+
echo __('Set default Subscribe2 page as ID', 'subscribe2') . ': ';
|
2175 |
+
echo "<select name=\"page\">\r\n";
|
2176 |
+
$this->pages_dropdown($this->subscribe2_options['s2page']);
|
2177 |
+
echo "</select>\r\n";
|
2178 |
+
|
2179 |
+
// Number of subscribers per page
|
2180 |
+
echo "<br /><br />" . __('Set the number of Subscribers displayed per page', 'subscribe2') . ': ';
|
2181 |
+
echo "<span id=\"s2entries_1\"><span id=\"s2entries\" style=\"background-color: #FFFBCC\">" . $this->subscribe2_options['entries'] . "</span> ";
|
2182 |
+
echo "<a href=\"#\" onclick=\"s2_show('entries'); return false;\">" . __('Edit', 'subscribe2') . "</a></span>\n";
|
2183 |
+
echo "<span id=\"s2entries_2\">\r\n";
|
2184 |
+
echo "<input type=\"text\" name=\"entries\" value=\"" . $this->subscribe2_options['entries'] . "\" size=\"3\" />\r\n";
|
2185 |
+
echo "<a href=\"#\" onclick=\"s2_update('entries'); return false;\">". __('Update', 'subscribe2') . "</a>\n";
|
2186 |
+
echo "<a href=\"#\" onclick=\"s2_revert('entries'); return false;\">". __('Revert', 'subscribe2') . "</a></span>\n";
|
2187 |
+
|
2188 |
+
// show link to WordPress page in meta
|
2189 |
+
echo "<br /><br /><label><input type=\"checkbox\" name=\"show_meta\" value=\"1\"";
|
2190 |
+
if ( '1' == $this->subscribe2_options['show_meta'] ) {
|
2191 |
+
echo " checked=\"checked\"";
|
2192 |
+
}
|
2193 |
+
echo " /> " . __('Show a link to your subscription page in "meta"?', 'subscribe2') . "</label><br /><br />\r\n";
|
2194 |
+
|
2195 |
+
// show QuickTag button
|
2196 |
+
echo "<label><input type=\"checkbox\" name=\"show_button\" value=\"1\"";
|
2197 |
+
if ( '1' == $this->subscribe2_options['show_button'] ) {
|
2198 |
+
echo " checked=\"checked\"";
|
2199 |
+
}
|
2200 |
+
echo " /> " . __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "</label><br /><br />\r\n";
|
2201 |
+
|
2202 |
+
// show Widget
|
2203 |
+
echo "<label><input type=\"checkbox\" name=\"widget\" value=\"1\"";
|
2204 |
+
if ( '1' == $this->subscribe2_options['widget'] ) {
|
2205 |
+
echo " checked=\"checked\"";
|
2206 |
+
}
|
2207 |
+
echo " /> " . __('Enable Subscribe2 Widget?', 'subscribe2') . "</label><br /><br />\r\n";
|
2208 |
+
|
2209 |
+
// show Counter Widget
|
2210 |
+
echo "<label><input type=\"checkbox\" name=\"counterwidget\" value=\"1\"";
|
2211 |
+
if ( '1' == $this->subscribe2_options['counterwidget'] ) {
|
2212 |
+
echo " checked=\"checked\"";
|
2213 |
+
}
|
2214 |
+
echo " /> " . __('Enable Subscribe2 Counter Widget?', 'subscribe2') . "</label><br /><br />\r\n";
|
2215 |
+
|
2216 |
+
// s2_meta checked by default
|
2217 |
+
echo "<label><input type =\"checkbox\" name=\"s2meta_default\" value=\"1\"";
|
2218 |
+
if ( "1" == $this->subscribe2_options['s2meta_default'] ) {
|
2219 |
+
echo " checked=\"checked\"";
|
2220 |
+
}
|
2221 |
+
echo " /> " . __('Disable email notifications is checked by default on authoring pages?', 'subscribe2') . "</label>\r\n";
|
2222 |
+
echo "</p>";
|
2223 |
+
|
2224 |
+
//Auto Subscription for new registrations
|
2225 |
+
echo "<h2>" . __('Auto Subscribe', 'subscribe2') . "</h2>\r\n";
|
2226 |
+
echo"<p>";
|
2227 |
+
echo __('Subscribe new users registering with your blog', 'subscribe2') . ":<br />\r\n";
|
2228 |
+
echo "<label><input type=\"radio\" name=\"autosub\" value=\"yes\"";
|
2229 |
+
if ( 'yes' == $this->subscribe2_options['autosub'] ) {
|
2230 |
+
echo " checked=\"checked\"";
|
2231 |
+
}
|
2232 |
+
echo " /> " . __('Automatically', 'subscribe2') . "</label> ";
|
2233 |
+
echo "<label><input type=\"radio\" name=\"autosub\" value=\"wpreg\"";
|
2234 |
+
if ( 'wpreg' == $this->subscribe2_options['autosub'] ) {
|
2235 |
+
echo " checked=\"checked\"";
|
2236 |
+
}
|
2237 |
+
echo " /> " . __('Display option on Registration Form', 'subscribe2') . "</label> ";
|
2238 |
+
echo "<label><input type=\"radio\" name=\"autosub\" value=\"no\"";
|
2239 |
+
if ( 'no' == $this->subscribe2_options['autosub'] ) {
|
2240 |
+
echo " checked=\"checked\"";
|
2241 |
+
}
|
2242 |
+
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2243 |
+
echo __('Auto-subscribe includes any excluded categories', 'subscribe2') . ":<br />\r\n";
|
2244 |
+
echo "<label><input type=\"radio\" name=\"newreg_override\" value=\"yes\"";
|
2245 |
+
if ( 'yes' == $this->subscribe2_options['newreg_override'] ) {
|
2246 |
+
echo " checked=\"checked\"";
|
2247 |
+
}
|
2248 |
+
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2249 |
+
echo "<label><input type=\"radio\" name=\"newreg_override\" value=\"no\"";
|
2250 |
+
if ( 'no' == $this->subscribe2_options['newreg_override'] ) {
|
2251 |
+
echo " checked=\"checked\"";
|
2252 |
+
}
|
2253 |
+
echo " />" . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2254 |
+
echo __('Registration Form option is checked by default', 'subscribe2') . ":<br />\r\n";
|
2255 |
+
echo "<label><input type=\"radio\" name=\"wpregdef\" value=\"yes\"";
|
2256 |
+
if ( 'yes' == $this->subscribe2_options['wpregdef'] ) {
|
2257 |
+
echo " checked=\"checked\"";
|
2258 |
+
}
|
2259 |
+
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2260 |
+
echo "<label><input type=\"radio\" name=\"wpregdef\" value=\"no\"";
|
2261 |
+
if ( 'no' == $this->subscribe2_options['wpregdef'] ) {
|
2262 |
+
echo " checked=\"checked\"";
|
2263 |
+
}
|
2264 |
+
echo " />" . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2265 |
+
echo __('Auto-subscribe users to receive email as', 'subscribe2') . ": <br />\r\n";
|
2266 |
+
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"html\"";
|
2267 |
+
if ( 'html' == $this->subscribe2_options['autoformat'] ) {
|
2268 |
+
echo "checked=\"checked\" ";
|
2269 |
+
}
|
2270 |
+
echo "/> " . __('HTML - Full', 'subscribe2') ."</label> ";
|
2271 |
+
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"html_excerpt\"";
|
2272 |
+
if ( 'html_excerpt' == $this->subscribe2_options['autoformat'] ) {
|
2273 |
+
echo "checked=\"checked\" ";
|
2274 |
+
}
|
2275 |
+
echo "/> " . __('HTML - Excerpt', 'subscribe2') ."</label> ";
|
2276 |
+
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"post\" ";
|
2277 |
+
if ( 'post' == $this->subscribe2_options['autoformat'] ) {
|
2278 |
+
echo "checked=\"checked\" ";
|
2279 |
+
}
|
2280 |
+
echo "/> " . __('Plain Text - Full', 'subscribe2') . "</label> ";
|
2281 |
+
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"excerpt\" ";
|
2282 |
+
if ( 'excerpt' == $this->subscribe2_options['autoformat'] ) {
|
2283 |
+
echo "checked=\"checked\" ";
|
2284 |
+
}
|
2285 |
+
echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . "</label><br /><br />";
|
2286 |
+
echo __('Registered Users have the option to auto-subscribe to new categories', 'subscribe2') . ": <br />\r\n";
|
2287 |
+
echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"yes\"";
|
2288 |
+
if ( 'yes' == $this->subscribe2_options['show_autosub'] ) {
|
2289 |
+
echo " checked=\"checked\"";
|
2290 |
+
}
|
2291 |
+
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2292 |
+
echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"no\"";
|
2293 |
+
if ( 'no' == $this->subscribe2_options['show_autosub'] ) {
|
2294 |
+
echo " checked=\"checked\"";
|
2295 |
+
}
|
2296 |
+
echo " />" . __('No', 'subscribe2') . "</label> ";
|
2297 |
+
echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"exclude\"";
|
2298 |
+
if ( 'exclude' == $this->subscribe2_options['show_autosub'] ) {
|
2299 |
+
echo " checked=\"checked\"";
|
2300 |
+
}
|
2301 |
+
echo " />" .__('New categories are immediately excluded', 'subscribe2') . "</label><br /><br />";
|
2302 |
+
echo __('Option for Registered Users to auto-subscribe to new categories is checked by default', 'subscribe2') . ": <br />\r\n";
|
2303 |
+
echo "<label><input type=\"radio\" name=\"autosub_def\" value=\"yes\"";
|
2304 |
+
if ( 'yes' == $this->subscribe2_options['autosub_def'] ) {
|
2305 |
+
echo " checked=\"checked\"";
|
2306 |
+
}
|
2307 |
+
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2308 |
+
echo "<label><input type=\"radio\" name=\"autosub_def\" value=\"no\"";
|
2309 |
+
if ( 'no' == $this->subscribe2_options['autosub_def'] ) {
|
2310 |
+
echo " checked=\"checked\"";
|
2311 |
+
}
|
2312 |
+
echo " />" . __('No', 'subscribe2');
|
2313 |
+
echo"</label></p>";
|
2314 |
+
|
2315 |
+
//barred domains
|
2316 |
+
echo "<h2>" . __('Barred Domains', 'subscribe2') . "</h2>\r\n";
|
2317 |
+
echo"<p>";
|
2318 |
+
echo __('Enter domains to bar from public subscriptions: <br /> (Use a new line for each entry and omit the "@" symbol, for example email.com)', 'subscribe2');
|
2319 |
+
echo "<br />\r\n<textarea style=\"width: 98%;\" rows=\"4\" cols=\"60\" name=\"barred\">" . $this->subscribe2_options['barred'] . "</textarea>";
|
2320 |
+
echo"</p>";
|
2321 |
+
|
2322 |
+
// submit
|
2323 |
+
echo "<p class=\"submit\" align=\"center\"><input type=\"submit\" class=\"button-primary\" name=\"submit\" value=\"" . __('Submit', 'subscribe2') . "\" /></p>";
|
2324 |
+
|
2325 |
+
// reset
|
2326 |
+
echo "<h2>" . __('Reset Default', 'subscribe2') . "</h2>\r\n";
|
2327 |
+
echo "<p>" . __('Use this to reset all options to their defaults. This <strong><em>will not</em></strong> modify your list of subscribers.', 'subscribe2') . "</p>\r\n";
|
2328 |
+
echo "<p class=\"submit\" align=\"center\">";
|
2329 |
+
echo "<input type=\"submit\" id=\"deletepost\" name=\"reset\" value=\"" . __('RESET', 'subscribe2') .
|
2330 |
+
"\" />";
|
2331 |
+
echo "</p></form></div>\r\n";
|
2332 |
+
|
2333 |
+
include(ABSPATH . 'wp-admin/admin-footer.php');
|
2334 |
+
// just to be sure
|
2335 |
+
die;
|
2336 |
+
} // end options_menu()
|
2337 |
+
|
2338 |
+
/**
|
2339 |
+
Our profile menu
|
2340 |
+
*/
|
2341 |
+
function user_menu() {
|
2342 |
+
global $user_ID, $s2nonce;
|
2343 |
+
|
2344 |
+
if ( isset($_GET['email']) ) {
|
2345 |
+
global $wpdb;
|
2346 |
+
$user_ID = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_email = '" . urldecode($_GET['email']) . "'");
|
2347 |
+
} else {
|
2348 |
+
get_currentuserinfo();
|
2349 |
+
}
|
2350 |
+
|
2351 |
+
// was anything POSTed?
|
2352 |
+
if ( isset($_POST['s2_admin']) && 'user' == $_POST['s2_admin'] ) {
|
2353 |
+
check_admin_referer('subscribe2-user_subscribers' . $s2nonce);
|
2354 |
+
|
2355 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Subscription preferences updated.', 'subscribe2') . "</strong></p></div>\n";
|
2356 |
+
update_usermeta($user_ID, 's2_format', $_POST['s2_format']);
|
2357 |
+
update_usermeta($user_ID, 's2_autosub', $_POST['new_category']);
|
2358 |
+
|
2359 |
+
$cats = $_POST['category'];
|
2360 |
+
|
2361 |
+
if ( empty($cats) || $cats == '-1' ) {
|
2362 |
+
$oldcats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
2363 |
+
if ( $oldcats ) {
|
2364 |
+
foreach ( $oldcats as $cat ) {
|
2365 |
+
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat);
|
2366 |
+
}
|
2367 |
+
}
|
2368 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
2369 |
+
} elseif ( $cats == 'digest' ) {
|
2370 |
+
$all_cats = get_categories(array('hide_empty' => false));
|
2371 |
+
foreach ( $all_cats as $cat ) {
|
2372 |
+
('' == $catids) ? $catids = "$cat->term_id" : $catids .= ",$cat->term_id";
|
2373 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat->term_id, $cat->term_id);
|
2374 |
+
}
|
2375 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $catids);
|
2376 |
+
} else {
|
2377 |
+
if ( !is_array($cats) ) {
|
2378 |
+
$cats = array($_POST['category']);
|
2379 |
+
}
|
2380 |
+
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
2381 |
+
$remove = array_diff($old_cats, $cats);
|
2382 |
+
$new = array_diff($cats, $old_cats);
|
2383 |
+
if ( !empty($remove) ) {
|
2384 |
+
// remove subscription to these cat IDs
|
2385 |
+
foreach ( $remove as $id ) {
|
2386 |
+
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
2387 |
+
}
|
2388 |
+
}
|
2389 |
+
if ( !empty($new) ) {
|
2390 |
+
// add subscription to these cat IDs
|
2391 |
+
foreach ( $new as $id ) {
|
2392 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, $id);
|
2393 |
+
}
|
2394 |
+
}
|
2395 |
+
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $cats));
|
2396 |
+
}
|
2397 |
+
}
|
2398 |
+
|
2399 |
+
// show our form
|
2400 |
+
echo "<div class=\"wrap\">";
|
2401 |
+
screen_icon();
|
2402 |
+
echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
|
2403 |
+
if ( isset($_GET['email']) ) {
|
2404 |
+
$user = get_userdata($user_ID);
|
2405 |
+
echo "<span style=\"color: red;line-height: 300%;\">" . __('Editing Subscribe2 preferences for user', 'subscribe2') . ": " . $user->display_name . "</span>";
|
2406 |
+
}
|
2407 |
+
echo "<form method=\"post\" action=\"\">";
|
2408 |
+
echo "<p>";
|
2409 |
+
if ( function_exists('wp_nonce_field') ) {
|
2410 |
+
wp_nonce_field('subscribe2-user_subscribers' . $s2nonce);
|
2411 |
+
}
|
2412 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"user\" />";
|
2413 |
+
if ( $this->subscribe2_options['email_freq'] == 'never' ) {
|
2414 |
+
echo __('Receive email as', 'subscribe2') . ": ";
|
2415 |
+
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"html\"";
|
2416 |
+
if ( 'html' == get_usermeta($user_ID, 's2_format') ) {
|
2417 |
+
echo "checked=\"checked\" ";
|
2418 |
+
}
|
2419 |
+
echo "/> " . __('HTML - Full', 'subscribe2') ."</label> ";
|
2420 |
+
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"html_excerpt\" ";
|
2421 |
+
if ( 'html_excerpt' == get_usermeta($user_ID, 's2_format') ) {
|
2422 |
+
echo "checked=\"checked\" ";
|
2423 |
+
}
|
2424 |
+
echo "/> " . __('HTML - Excerpt', 'subscribe2') . "</label> ";
|
2425 |
+
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"post\" ";
|
2426 |
+
if ( 'post' == get_usermeta($user_ID, 's2_format') ) {
|
2427 |
+
echo "checked=\"checked\" ";
|
2428 |
+
}
|
2429 |
+
echo "/> " . __('Plain Text - Full', 'subscribe2') . "</label> ";
|
2430 |
+
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"excerpt\" ";
|
2431 |
+
if ( 'excerpt' == get_usermeta($user_ID, 's2_format') ) {
|
2432 |
+
echo "checked=\"checked\" ";
|
2433 |
+
}
|
2434 |
+
echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . "</label><br /><br />\r\n";
|
2435 |
+
|
2436 |
+
if ( $this->subscribe2_options['show_autosub'] == 'yes' ) {
|
2437 |
+
echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': ';
|
2438 |
+
echo "<label><input type=\"radio\" name=\"new_category\" value=\"yes\" ";
|
2439 |
+
if ( 'yes' == get_usermeta($user_ID, 's2_autosub') ) {
|
2440 |
+
echo "checked=\"checked\" ";
|
2441 |
+
}
|
2442 |
+
echo "/> " . __('Yes', 'subscribe2') . "</label> ";
|
2443 |
+
echo "<label><input type=\"radio\" name=\"new_category\" value=\"no\" ";
|
2444 |
+
if ( 'no' == get_usermeta($user_ID, 's2_autosub') ) {
|
2445 |
+
echo "checked=\"checked\" ";
|
2446 |
+
}
|
2447 |
+
echo "/> " . __('No', 'subscribe2') . "</label>";
|
2448 |
+
echo "</p>";
|
2449 |
+
}
|
2450 |
+
|
2451 |
+
// subscribed categories
|
2452 |
+
if ( $this->s2_mu ) {
|
2453 |
+
global $blog_id;
|
2454 |
+
$subscribed = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
2455 |
+
// if we are subscribed to the current blog display an "unsubscribe" link
|
2456 |
+
if ( !empty($subscribed) ) {
|
2457 |
+
$unsubscribe_link = get_option('home') . "/wp-admin/?s2mu_unsubscribe=". $blog_id;
|
2458 |
+
echo "<p><a href=\"". $unsubscribe_link ."\" class=\"button\">" . __('Unsubscribe me from this blog', 'subscribe2') . "</a></p>";
|
2459 |
+
} else {
|
2460 |
+
// else we show a "subscribe" link
|
2461 |
+
$subscribe_link = get_option('home') . "/wp-admin/?s2mu_subscribe=". $blog_id;
|
2462 |
+
echo "<p><a href=\"". $subscribe_link ."\" class=\"button\">" . __('Subscribe to all categories', 'subscribe2') . "</a></p>";
|
2463 |
+
}
|
2464 |
+
echo "<h2>" . __('Subscribed Categories on', 'subscribe2') . " " . get_option('blogname') . " </h2>\r\n";
|
2465 |
+
} else {
|
2466 |
+
echo "<h2>" . __('Subscribed Categories', 'subscribe2') . "</h2>\r\n";
|
2467 |
+
}
|
2468 |
+
$this->display_category_form(explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'))), $this->subscribe2_options['reg_override']);
|
2469 |
+
} else {
|
2470 |
+
// we're doing daily digests, so just show
|
2471 |
+
// subscribe / unnsubscribe
|
2472 |
+
echo __('Receive periodic summaries of new posts?', 'subscribe2') . ': ';
|
2473 |
+
echo "<label>";
|
2474 |
+
echo "<input type=\"radio\" name=\"category\" value=\"digest\" ";
|
2475 |
+
if ( get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')) ) {
|
2476 |
+
echo "checked=\"checked\" ";
|
2477 |
+
}
|
2478 |
+
echo "/> " . __('Yes', 'subscribe2') . "</label> <label><input type=\"radio\" name=\"category\" value=\"-1\" ";
|
2479 |
+
if ( !get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')) ) {
|
2480 |
+
echo "checked=\"checked\" ";
|
2481 |
+
}
|
2482 |
+
echo "/> " . __('No', 'subscribe2');
|
2483 |
+
echo "</label></p>";
|
2484 |
+
}
|
2485 |
+
|
2486 |
+
// submit
|
2487 |
+
echo "<p class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"submit\" value=\"" . __("Update Preferences", 'subscribe2') . " »\" /></p>";
|
2488 |
+
echo "</form>\r\n";
|
2489 |
+
|
2490 |
+
// list of subscribed blogs on wordpress mu
|
2491 |
+
if ( $this->s2_mu && !isset($_GET['email']) ) {
|
2492 |
+
global $blog_id;
|
2493 |
+
$s2blog_id = $blog_id;
|
2494 |
+
$blogs = $this->get_mu_blog_list();
|
2495 |
+
|
2496 |
+
$blogs_subscribed = array();
|
2497 |
+
$blogs_notsubscribed = array();
|
2498 |
+
|
2499 |
+
foreach ( $blogs as $key => $blog ) {
|
2500 |
+
// switch to blog
|
2501 |
+
switch_to_blog($blog['blog_id']);
|
2502 |
+
|
2503 |
+
// check that the plugin is active on the current blog
|
2504 |
+
$current_plugins = get_option('active_plugins');
|
2505 |
+
if ( !is_array($current_plugins) ) {
|
2506 |
+
$current_plugins = (array)$current_plugins;
|
2507 |
+
}
|
2508 |
+
if ( !in_array(S2DIR . '/subscribe2.php', $current_plugins) ) {
|
2509 |
+
continue;
|
2510 |
+
}
|
2511 |
+
|
2512 |
+
// check if we're subscribed to the blog
|
2513 |
+
$subscribed = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
2514 |
+
|
2515 |
+
$blogname = get_option('blogname');
|
2516 |
+
if ( strlen($blogname) > 30 ) {
|
2517 |
+
$blog['blogname'] = wp_html_excerpt($blogname, 30) . "..";
|
2518 |
+
} else {
|
2519 |
+
$blog['blogname'] = $blogname;
|
2520 |
+
}
|
2521 |
+
$blog['description'] = get_option('blogdescription');
|
2522 |
+
$blog['blogurl'] = get_option('home');
|
2523 |
+
$blog['subscribe_page'] = get_option('home') . "/wp-admin/users.php?page=s2_users";
|
2524 |
+
|
2525 |
+
$key = strtolower($blog['blogname'] . "-" . $blog['blog_id']);
|
2526 |
+
if ( !empty($subscribed) ) {
|
2527 |
+
$blogs_subscribed[$key] = $blog;
|
2528 |
+
} else {
|
2529 |
+
$blogs_notsubscribed[$key] = $blog;
|
2530 |
+
}
|
2531 |
+
restore_current_blog();
|
2532 |
+
}
|
2533 |
+
|
2534 |
+
if ( !empty($blogs_subscribed) ) {
|
2535 |
+
ksort($blogs_subscribed);
|
2536 |
+
echo "<h2>" . __('Subscribed Blogs', 'subscribe2') . "</h2>\r\n";
|
2537 |
+
echo "<ul class=\"s2_blogs\">\r\n";
|
2538 |
+
foreach ( $blogs_subscribed as $blog ) {
|
2539 |
+
echo "<li><span class=\"name\"><a href=\"" . $blog['blogurl'] . "\" title=\"" . $blog['description'] . "\">" . $blog['blogname'] . "</a></span>\r\n";
|
2540 |
+
if ( $s2blog_id == $blog['blog_id'] ) {
|
2541 |
+
echo "<span class=\"buttons\">" . __('Viewing Settings Now', 'subscribe2') . "</span>\r\n";
|
2542 |
+
} else {
|
2543 |
+
echo "<span class=\"buttons\">";
|
2544 |
+
if ( is_blog_user($blog['blog_id']) ) {
|
2545 |
+
echo "<a href=\"". $blog['subscribe_page'] . "\">" . __('View Settings', 'subscribe2') . "</a>\r\n";
|
2546 |
+
}
|
2547 |
+
echo "<a href=\"" . $blog['blogurl'] . "/wp-admin/?s2mu_unsubscribe=" . $blog['blog_id'] . "\">" . __('Unsubscribe', 'subscribe2') . "</a></span>\r\n";
|
2548 |
+
}
|
2549 |
+
echo "<div class=\"additional_info\">" . $blog['description'] . "</div>\r\n";
|
2550 |
+
echo "</li>";
|
2551 |
+
}
|
2552 |
+
echo "</ul>\r\n";
|
2553 |
+
}
|
2554 |
+
|
2555 |
+
if ( !empty($blogs_notsubscribed) ) {
|
2556 |
+
ksort($blogs_notsubscribed);
|
2557 |
+
echo "<h2>" . __('Subscribe to new blogs', 'subscribe2') . "</h2>\r\n";
|
2558 |
+
echo "<ul class=\"s2_blogs\">";
|
2559 |
+
foreach ( $blogs_notsubscribed as $blog ) {
|
2560 |
+
echo "<li><span class=\"name\"><a href=\"" . $blog['blogurl'] . "\" title=\"" . $blog['description'] . "\">" . $blog['blogname'] . "</a></span>\r\n";
|
2561 |
+
if ( $s2blog_id == $blog['blog_id'] ) {
|
2562 |
+
echo "<span class=\"buttons\">" . __('Viewing Settings Now', 'subscribe2') . "</span>\r\n";
|
2563 |
+
} else {
|
2564 |
+
echo "<span class=\"buttons\">";
|
2565 |
+
if ( is_blog_user($blog['blog_id']) ) {
|
2566 |
+
echo "<a href=\"". $blog['subscribe_page'] . "\">" . __('View Settings', 'subscribe2') . "</a>\r\n";
|
2567 |
+
}
|
2568 |
+
echo "<a href=\"" . $blog['blogurl'] . "/wp-admin/?s2mu_subscribe=" . $blog['blog_id'] . "\">" . __('Subscribe', 'subscribe2') . "</a></span>\r\n";
|
2569 |
+
}
|
2570 |
+
echo "<div class=\"additional_info\">" . $blog['description'] . "</div>\r\n";
|
2571 |
+
echo "</li>";
|
2572 |
+
}
|
2573 |
+
echo "</ul>\r\n";
|
2574 |
+
}
|
2575 |
+
}
|
2576 |
+
|
2577 |
+
echo "</div>\r\n";
|
2578 |
+
|
2579 |
+
include(ABSPATH . 'wp-admin/admin-footer.php');
|
2580 |
+
// just to be sure
|
2581 |
+
die;
|
2582 |
+
} // end user_menu()
|
2583 |
+
|
2584 |
+
/**
|
2585 |
+
Display the Write sub-menu
|
2586 |
+
*/
|
2587 |
+
function write_menu() {
|
2588 |
+
global $wpdb, $s2nonce, $current_user;
|
2589 |
+
|
2590 |
+
// was anything POSTed?
|
2591 |
+
if ( isset($_POST['s2_admin']) && 'mail' == $_POST['s2_admin'] ) {
|
2592 |
+
check_admin_referer('subscribe2-write_subscribers' . $s2nonce);
|
2593 |
+
$subject = $this->substitute(stripslashes(strip_tags($_POST['subject'])));
|
2594 |
+
$body = $this->substitute(stripslashes($_POST['content']));
|
2595 |
+
if ( '' != $current_user->display_name || '' != $current_user->user_email ) {
|
2596 |
+
$this->myname = html_entity_decode($current_user->display_name, ENT_QUOTES);
|
2597 |
+
$this->myemail = $current_user->user_email;
|
2598 |
+
}
|
2599 |
+
if ( isset($_POST['send']) ) {
|
2600 |
+
if ( 'confirmed' == $_POST['what'] ) {
|
2601 |
+
$recipients = $this->get_public();
|
2602 |
+
} elseif ( 'unconfirmed' == $_POST['what'] ) {
|
2603 |
+
$recipients = $this->get_public(0);
|
2604 |
+
} elseif ( 'public' == $_POST['what'] ) {
|
2605 |
+
$confirmed = $this->get_public();
|
2606 |
+
$unconfirmed = $this->get_public(0);
|
2607 |
+
$recipients = array_merge((array)$confirmed, (array)$unconfirmed);
|
2608 |
+
} elseif ( is_numeric($_POST['what']) ) {
|
2609 |
+
$cat = intval($_POST['what']);
|
2610 |
+
$recipients = $this->get_registered("cats=$cat");
|
2611 |
+
} elseif ( 'all_users' == $_POST['what'] ) {
|
2612 |
+
$recipients = $this->get_all_registered();
|
2613 |
+
} else {
|
2614 |
+
$recipients = $this->get_registered();
|
2615 |
+
}
|
2616 |
+
} elseif ( isset($_POST['preview']) ) {
|
2617 |
+
global $user_email;
|
2618 |
+
$recipients[] = $user_email;
|
2619 |
+
}
|
2620 |
+
$status = $this->mail($recipients, $subject, $body, 'text');
|
2621 |
+
if ( $status ) {
|
2622 |
+
$message = $this->mail_sent;
|
2623 |
+
} else {
|
2624 |
+
global $phpmailer;
|
2625 |
+
$message = $this->mail_failed . $phpmailer->ErrorInfo;
|
2626 |
+
}
|
2627 |
+
}
|
2628 |
+
|
2629 |
+
if ( '' != $message ) {
|
2630 |
+
echo "<div id=\"message\" class=\"updated\"><strong><p>" . $message . "</p></strong></div>\r\n";
|
2631 |
+
}
|
2632 |
+
// show our form
|
2633 |
+
echo "<div class=\"wrap\">";
|
2634 |
+
screen_icon();
|
2635 |
+
echo "<h2>" . __('Send an email to subscribers', 'subscribe2') . "</h2>\r\n";
|
2636 |
+
echo "<form method=\"post\" action=\"\">\r\n";
|
2637 |
+
if ( function_exists('wp_nonce_field') ) {
|
2638 |
+
wp_nonce_field('subscribe2-write_subscribers' . $s2nonce);
|
2639 |
+
}
|
2640 |
+
if ( isset($_POST['subject']) ) {
|
2641 |
+
$subject = $_POST['subject'];
|
2642 |
+
} else {
|
2643 |
+
$subject = __('A message from', 'subscribe2') . " " . get_option('blogname');
|
2644 |
+
}
|
2645 |
+
echo "<p>" . __('Subject', 'subscribe2') . ": <input type=\"text\" size=\"69\" name=\"subject\" value=\"" . $subject . "\" /> <br /><br />";
|
2646 |
+
echo "<textarea rows=\"12\" cols=\"75\" name=\"content\">" . $body . "</textarea>";
|
2647 |
+
echo "<br /><br />\r\n";
|
2648 |
+
echo __('Recipients:', 'subscribe2') . " ";
|
2649 |
+
$this->display_subscriber_dropdown('registered', false, array('all'));
|
2650 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"mail\" />";
|
2651 |
+
echo "</p>";
|
2652 |
+
echo "<p class=\"submit\"><input type=\"submit\" class=\"button-secondary\" name=\"preview\" value=\"" . __('Preview', 'subscribe2') . "\" \><input type=\"submit\" class=\"button-primary\" name=\"send\" value=\"" . __('Send', 'subscribe2') . "\" /></p>";
|
2653 |
+
echo "</form></div>\r\n";
|
2654 |
+
echo "<div style=\"clear: both;\"><p> </p></div>";
|
2655 |
+
|
2656 |
+
include(ABSPATH . 'wp-admin/admin-footer.php');
|
2657 |
+
// just to be sure
|
2658 |
+
die;
|
2659 |
+
} // end write_menu()
|
2660 |
+
|
2661 |
+
/* ===== helper functions: forms and stuff ===== */
|
2662 |
+
/**
|
2663 |
+
Display a table of categories with checkboxes
|
2664 |
+
Optionally pre-select those categories specified
|
2665 |
+
*/
|
2666 |
+
function display_category_form($selected = array(), $override = 1) {
|
2667 |
+
global $wpdb;
|
2668 |
+
|
2669 |
+
$all_cats = get_categories(array('hide_empty' => false, 'orderby' => 'slug'));
|
2670 |
+
$exclude = explode(',', $this->subscribe2_options['exclude']);
|
2671 |
+
|
2672 |
+
if ( 0 == $override ) {
|
2673 |
+
// registered users are not allowed to subscribe to
|
2674 |
+
// excluded categories
|
2675 |
+
foreach ( $all_cats as $cat => $term_id ) {
|
2676 |
+
if ( in_array($all_cats[$cat]->term_id, $exclude) ) {
|
2677 |
+
$cat = (int)$cat;
|
2678 |
+
unset($all_cats[$cat]);
|
2679 |
+
}
|
2680 |
+
}
|
2681 |
+
}
|
2682 |
+
|
2683 |
+
$half = (count($all_cats) / 2);
|
2684 |
+
$i = 0;
|
2685 |
+
$j = 0;
|
2686 |
+
echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"5\" class=\"editform\">\r\n";
|
2687 |
+
echo "<tr><td align=\"left\" colspan=\"2\">\r\n";
|
2688 |
+
echo "<label><input type=\"checkbox\" name=\"checkall\" value=\"cat_checkall\" /> " . __('Select / Unselect All', 'subscribe2') . "</label>\r\n";
|
2689 |
+
echo "</td></tr>\r\n";
|
2690 |
+
echo "<tr valign=\"top\"><td width=\"50%\" align=\"left\">\r\n";
|
2691 |
+
foreach ( $all_cats as $cat ) {
|
2692 |
+
if ( $i >= $half && 0 == $j ){
|
2693 |
+
echo "</td><td width=\"50%\" align=\"left\">\r\n";
|
2694 |
+
$j++;
|
2695 |
+
}
|
2696 |
+
if ( 0 == $j ) {
|
2697 |
+
echo "<label><input class=\"cat_checkall\" type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
|
2698 |
+
if ( in_array($cat->term_id, $selected) ) {
|
2699 |
+
echo " checked=\"checked\"";
|
2700 |
+
}
|
2701 |
+
echo " /> <abbr title=\"" . $cat->slug . "\">" . rtrim(get_category_parents($cat->term_id, false, ' » '), ' » ') . "</abbr></label><br />\r\n";
|
2702 |
+
} else {
|
2703 |
+
echo "<label><input class=\"cat_checkall\" type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
|
2704 |
+
if ( in_array($cat->term_id, $selected) ) {
|
2705 |
+
echo " checked=\"checked\"";
|
2706 |
+
}
|
2707 |
+
echo " /> <abbr title=\"" . $cat->slug . "\">" . rtrim(get_category_parents($cat->term_id, false, ' » '), ' » ') . "</abbr></label><br />\r\n";
|
2708 |
+
}
|
2709 |
+
$i++;
|
2710 |
+
}
|
2711 |
+
echo "</td></tr>\r\n";
|
2712 |
+
echo "</table>\r\n";
|
2713 |
+
} // end display_category_form()
|
2714 |
+
|
2715 |
+
/**
|
2716 |
+
Display a drop-down form to select subscribers
|
2717 |
+
$selected is the option to select
|
2718 |
+
$submit is the text to use on the Submit button
|
2719 |
+
*/
|
2720 |
+
function display_subscriber_dropdown($selected = 'registered', $submit = '', $exclude = array()) {
|
2721 |
+
global $wpdb;
|
2722 |
+
|
2723 |
+
$who = array('all' => __('All Users and Subscribers', 'subscribe2'),
|
2724 |
+
'public' => __('Public Subscribers', 'subscribe2'),
|
2725 |
+
'confirmed' => ' ' . __('Confirmed', 'subscribe2'),
|
2726 |
+
'unconfirmed' => ' ' . __('Unconfirmed', 'subscribe2'),
|
2727 |
+
'all_users' => __('All Registered Users', 'subscribe2'),
|
2728 |
+
'registered' => __('Registered Subscribers', 'subscribe2'));
|
2729 |
+
|
2730 |
+
$all_cats = get_categories(array('hide_empty' => false));
|
2731 |
+
|
2732 |
+
// count the number of subscribers
|
2733 |
+
$count['confirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='1'");
|
2734 |
+
$count['unconfirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='0'");
|
2735 |
+
if ( in_array('unconfirmed', $exclude) ) {
|
2736 |
+
$count['public'] = $count['confirmed'];
|
2737 |
+
} elseif ( in_array('confirmed', $exclude) ) {
|
2738 |
+
$count['public'] = $count['unconfirmed'];
|
2739 |
+
} else {
|
2740 |
+
$count['public'] = ($count['confirmed'] + $count['unconfirmed']);
|
2741 |
+
}
|
2742 |
+
if ( $this->s2_mu ) {
|
2743 |
+
$count['all_users'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
|
2744 |
+
} else {
|
2745 |
+
$count['all_users'] = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
|
2746 |
+
}
|
2747 |
+
if ( $this->s2_mu ) {
|
2748 |
+
$count['registered'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities' AND meta_key='" . $this->get_usermeta_keyname('s2_subscribed') . "'");
|
2749 |
+
} else {
|
2750 |
+
$count['registered'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='" . $this->get_usermeta_keyname('s2_subscribed') . "'");
|
2751 |
+
}
|
2752 |
+
$count['all'] = ($count['confirmed'] + $count['unconfirmed'] + $count['all_users']);
|
2753 |
+
if ( $this->s2_mu ) {
|
2754 |
+
foreach ( $all_cats as $cat ) {
|
2755 |
+
$count[$cat->name] = $wpdb->get_var("SELECT COUNT(a.meta_key) FROM $wpdb->usermeta AS a INNER JOIN $wpdb->usermeta AS b ON a.user_id = b.user_id WHERE a.meta_key='" . $wpdb->prefix . "capabilities' AND b.meta_key='" . $this->get_usermeta_keyname('s2_cat') . $cat->term_id . "'");
|
2756 |
+
}
|
2757 |
+
} else {
|
2758 |
+
foreach ( $all_cats as $cat ) {
|
2759 |
+
$count[$cat->name] = $wpdb->get_var("SELECT COUNT(meta_value) FROM $wpdb->usermeta WHERE meta_key='" . $this->get_usermeta_keyname('s2_cat') . $cat->term_id . "'");
|
2760 |
+
}
|
2761 |
+
}
|
2762 |
+
|
2763 |
+
// do have actually have some subscribers?
|
2764 |
+
if ( 0 == $count['confirmed'] && 0 == $count['unconfirmed'] && 0 == $count['all_users'] ) {
|
2765 |
+
// no? bail out
|
2766 |
+
return;
|
2767 |
+
}
|
2768 |
+
|
2769 |
+
echo "<select name=\"what\">\r\n";
|
2770 |
+
foreach ( $who as $whom => $display ) {
|
2771 |
+
if ( in_array($whom, $exclude) ) { continue; }
|
2772 |
+
if ( 0 == $count[$whom] ) { continue; }
|
2773 |
+
|
2774 |
+
echo "<option value=\"" . $whom . "\"";
|
2775 |
+
if ( $whom == $selected ) { echo " selected=\"selected\" "; }
|
2776 |
+
echo ">$display (" . ($count[$whom]) . ")</option>\r\n";
|
2777 |
+
}
|
2778 |
+
|
2779 |
+
if ( $count['registered'] > 0 ) {
|
2780 |
+
foreach ( $all_cats as $cat ) {
|
2781 |
+
if ( in_array($cat->term_id, $exclude) ) { continue; }
|
2782 |
+
echo "<option value=\"" . $cat->term_id . "\"";
|
2783 |
+
if ( $cat->term_id == $selected ) { echo " selected=\"selected\" "; }
|
2784 |
+
echo "> " . $cat->name . " (" . $count[$cat->name] . ") </option>\r\n";
|
2785 |
+
}
|
2786 |
+
}
|
2787 |
+
echo "</select>";
|
2788 |
+
if ( false !== $submit ) {
|
2789 |
+
echo " <input type=\"submit\" class=\"button-secondary\" value=\"$submit\" />\r\n";
|
2790 |
+
}
|
2791 |
+
} // end display_subscriber_dropdown()
|
2792 |
+
|
2793 |
+
/**
|
2794 |
+
Display a drop down lisy of administrator level users and
|
2795 |
+
optionally include a choice for Post Author
|
2796 |
+
*/
|
2797 |
+
function admin_dropdown($inc_author = false) {
|
2798 |
+
global $wpdb;
|
2799 |
+
|
2800 |
+
$sql = "SELECT ID, display_name 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 IN (8, 9, 10)";
|
2801 |
+
$admins = $wpdb->get_results($sql);
|
2802 |
+
|
2803 |
+
// handle issues from WordPress core where user_level is not set or set low
|
2804 |
+
if ( empty($admins) ) {
|
2805 |
+
$role = 'administrator';
|
2806 |
+
if ( !class_exists(WP_User_Search) ) {
|
2807 |
+
require(ABSPATH . 'wp-admin/includes/user.php');
|
2808 |
+
}
|
2809 |
+
$wp_user_search = new WP_User_Search( '', '', $role);
|
2810 |
+
$admins_string = implode(', ', $wp_user_search->get_results());
|
2811 |
+
$sql = "SELECT ID, display_name FROM $wpdb->users WHERE ID IN (" . $admins_string . ")";
|
2812 |
+
$admins = $wpdb->get_results($sql);
|
2813 |
+
}
|
2814 |
+
|
2815 |
+
if ( $inc_author ) {
|
2816 |
+
$author[] = (object)array('ID' => 'author', 'display_name' => 'Post Author');
|
2817 |
+
$admins = array_merge($author, $admins);
|
2818 |
+
}
|
2819 |
+
|
2820 |
+
echo "<select name=\"sender\">\r\n";
|
2821 |
+
foreach ( $admins as $admin ) {
|
2822 |
+
echo "<option value=\"" . $admin->ID . "\"";
|
2823 |
+
if ( $admin->ID == $this->subscribe2_options['sender'] ) {
|
2824 |
+
echo " selected=\"selected\"";
|
2825 |
+
}
|
2826 |
+
echo ">" . $admin->display_name . "</option>\r\n";
|
2827 |
+
}
|
2828 |
+
echo "</select>\r\n";
|
2829 |
+
} // end admin_dropdown()
|
2830 |
+
|
2831 |
+
/**
|
2832 |
+
Display a dropdown of choices for digest email frequency
|
2833 |
+
and give user details of timings when event is scheduled
|
2834 |
+
*/
|
2835 |
+
function display_digest_choices() {
|
2836 |
+
global $wpdb;
|
2837 |
+
$scheduled_time = wp_next_scheduled('s2_digest_cron');
|
2838 |
+
$schedule = (array)wp_get_schedules();
|
2839 |
+
$schedule = array_merge(array('never' => array('interval' => 0, 'display' => __('For each Post', 'subscribe2'))), $schedule);
|
2840 |
+
$sort = array();
|
2841 |
+
foreach ( (array)$schedule as $key => $value ) {
|
2842 |
+
$sort[$key] = $value['interval'];
|
2843 |
+
}
|
2844 |
+
asort($sort);
|
2845 |
+
$schedule_sorted = array();
|
2846 |
+
foreach ( $sort as $key => $value ) {
|
2847 |
+
$schedule_sorted[$key] = $schedule[$key];
|
2848 |
+
}
|
2849 |
+
foreach ( $schedule_sorted as $key => $value ) {
|
2850 |
+
echo "<label><input type=\"radio\" name=\"email_freq\" value=\"" . $key . "\"";
|
2851 |
+
if ( $key == $this->subscribe2_options['email_freq'] ) {
|
2852 |
+
echo " checked=\"checked\" ";
|
2853 |
+
}
|
2854 |
+
echo " /> " . $value['display'] . "</label><br />\r\n";
|
2855 |
+
}
|
2856 |
+
echo "<br />" . __('Send Digest Notification at', 'subscribe2') . ": \r\n";
|
2857 |
+
$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');
|
2858 |
+
echo "<select name=\"hour\">\r\n";
|
2859 |
+
while ( $hour = current($hours) ) {
|
2860 |
+
echo "<option value=\"" . key($hours) . "\"";
|
2861 |
+
if ( key($hours) == date('H', $scheduled_time) && !empty($scheduled_time) ){
|
2862 |
+
echo " selected=\"selected\"";
|
2863 |
+
}
|
2864 |
+
echo ">" . $hour . "</option>\r\n";
|
2865 |
+
next($hours);
|
2866 |
+
}
|
2867 |
+
echo "</select>\r\n";
|
2868 |
+
echo "<strong><em style=\"color: red\">" . __('This option will be ignored if the time selected is not in the future in relation to the current time', 'subscribe2') . "</em></strong>\r\n";
|
2869 |
+
if ( $scheduled_time ) {
|
2870 |
+
$datetime = get_option('date_format') . ' @ ' . get_option('time_format');
|
2871 |
+
echo "<p>" . __('Current UTC time is', 'subscribe2') . ": \r\n";
|
2872 |
+
echo "<strong>" . date_i18n($datetime, false, 'gmt') . "</strong></p>\r\n";
|
2873 |
+
echo "<p>" . __('Current blog time is', 'subscribe2') . ": \r\n";
|
2874 |
+
echo "<strong>" . date_i18n($datetime) . "</strong></p>\r\n";
|
2875 |
+
echo "<p>" . __('Next email notification will be sent when your blog time is after', 'subscribe2') . ": \r\n";
|
2876 |
+
echo "<strong>" . date_i18n($datetime, $scheduled_time) . "</strong></p>\r\n";
|
2877 |
+
if ( !empty($this->subscribe2_options['previous_s2cron']) ) {
|
2878 |
+
echo "<p>" . __('Attempt to resend the last Digest Notification email', 'subscribe2') . ": ";
|
2879 |
+
echo "<input type=\"submit\" class=\"button-secondary\" name=\"resend\" value=\"" . __('Resend Digest', 'subscribe2') . "\" /></p>\r\n";
|
2880 |
+
}
|
2881 |
+
} else {
|
2882 |
+
echo "<br />";
|
2883 |
+
}
|
2884 |
+
} // end display_digest_choices()
|
2885 |
+
|
2886 |
+
/**
|
2887 |
+
Create and display a dropdown list of pages
|
2888 |
+
*/
|
2889 |
+
function pages_dropdown($s2page) {
|
2890 |
+
global $wpdb;
|
2891 |
+
$sql = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type='page' AND post_status='publish'";
|
2892 |
+
$pages = $wpdb->get_results($sql);
|
2893 |
+
|
2894 |
+
if ( empty($pages) ) { return; }
|
2895 |
+
|
2896 |
+
$option = '';
|
2897 |
+
foreach ( $pages as $page ) {
|
2898 |
+
$option .= "<option value=\"" . $page->ID . "\"";
|
2899 |
+
if ( $page->ID == $s2page ) {
|
2900 |
+
$option .= " selected=\"selected\"";
|
2901 |
+
}
|
2902 |
+
$option .= ">" . $page->post_title . "</option>\r\n";
|
2903 |
+
}
|
2904 |
+
|
2905 |
+
echo $option;
|
2906 |
+
} // end pages_dropdown()
|
2907 |
+
|
2908 |
+
/**
|
2909 |
+
Export subscriber emails and other details to CSV
|
2910 |
+
*/
|
2911 |
+
function prepare_export( $what ) {
|
2912 |
+
$confirmed = $this->get_public();
|
2913 |
+
$unconfirmed = $this->get_public(0);
|
2914 |
+
if ( 'all' == $what ) {
|
2915 |
+
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$this->get_all_registered());
|
2916 |
+
} elseif ( 'public' == $what ) {
|
2917 |
+
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
|
2918 |
+
} elseif ( 'confirmed' == $what ) {
|
2919 |
+
$subscribers = $confirmed;
|
2920 |
+
} elseif ( 'unconfirmed' == $what ) {
|
2921 |
+
$subscribers = $unconfirmed;
|
2922 |
+
} elseif ( is_numeric($what) ) {
|
2923 |
+
$subscribers = $this->get_registered("cats=$what");
|
2924 |
+
} elseif ( 'registered' == $what ) {
|
2925 |
+
$subscribers = $this->get_registered();
|
2926 |
+
} elseif ( 'all_users' == $what ) {
|
2927 |
+
$subscribers = $this->get_all_registered();
|
2928 |
+
}
|
2929 |
+
|
2930 |
+
natcasesort($subscribers);
|
2931 |
+
|
2932 |
+
$exportcsv = "User Email,User Name";
|
2933 |
+
$all_cats = get_categories(array('hide_empty' => false, 'orderby' => 'ID'));
|
2934 |
+
foreach ($all_cats as $cat) {
|
2935 |
+
$exportcsv .= "," . $cat->cat_name;
|
2936 |
+
$cat_ids[] = $cat->term_id;
|
2937 |
+
}
|
2938 |
+
$exportcsv .= "\r\n";
|
2939 |
+
|
2940 |
+
foreach ( $subscribers as $subscriber ) {
|
2941 |
+
if ( $this->is_registered($subscriber) ) {
|
2942 |
+
$user_id = $this->get_user_id( $subscriber );
|
2943 |
+
$user_info = get_userdata($user_id);
|
2944 |
+
|
2945 |
+
$cats = explode(',', get_usermeta($user_info->ID, $this->get_usermeta_keyname('s2_subscribed')));
|
2946 |
+
$subscribed_cats = '';
|
2947 |
+
foreach ( $cat_ids as $cat ) {
|
2948 |
+
(in_array($cat, $cats)) ? $subscribed_cats .= ",Yes" : $subscribed_cats .= ", No";
|
2949 |
+
}
|
2950 |
+
|
2951 |
+
$exportcsv .= $user_info->user_email . ',';
|
2952 |
+
$exportcsv .= $user_info->display_name;
|
2953 |
+
$exportcsv .= $subscribed_cats . "\r\n";
|
2954 |
+
} else {
|
2955 |
+
if ( in_array($subscriber, $confirmed) ) {
|
2956 |
+
$exportcsv .= $subscriber . ',' . __('Confirmed Public Subscriber', 'subscribe2') . "\r\n";
|
2957 |
+
} elseif ( in_array($subscriber, $unconfirmed) ) {
|
2958 |
+
$exportcsv .= $subscriber . ',' . __('Unconfirmed Public Subscriber', 'subscribe2') . "\r\n";
|
2959 |
+
}
|
2960 |
+
}
|
2961 |
+
}
|
2962 |
+
|
2963 |
+
return $exportcsv;
|
2964 |
+
} // end prepare_export()
|
2965 |
+
|
2966 |
+
/**
|
2967 |
+
Filter for usermeta table key names to adjust them if needed for WPMU blogs
|
2968 |
+
*/
|
2969 |
+
function get_usermeta_keyname($metaname) {
|
2970 |
+
global $wpdb;
|
2971 |
+
|
2972 |
+
// Is this WordPressMU or not?
|
2973 |
+
if ( $this->s2_mu === true ) {
|
2974 |
+
switch( $metaname ) {
|
2975 |
+
case 's2_subscribed':
|
2976 |
+
case 's2_cat':
|
2977 |
+
return $wpdb->prefix . $metaname;
|
2978 |
+
break;
|
2979 |
+
}
|
2980 |
+
}
|
2981 |
+
// Not MU or not a prefixed option name
|
2982 |
+
return $metaname;
|
2983 |
+
}
|
2984 |
+
|
2985 |
+
/**
|
2986 |
+
Obtain a list of current WordPress multiuser blogs
|
2987 |
+
Note this may affect performance but there is no alternative
|
2988 |
+
*/
|
2989 |
+
function get_mu_blog_list() {
|
2990 |
+
global $wpdb;
|
2991 |
+
$blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );
|
2992 |
+
|
2993 |
+
foreach ( (array) $blogs as $details ) {
|
2994 |
+
$blog_list[$details['blog_id']] = $details;
|
2995 |
+
}
|
2996 |
+
|
2997 |
+
if ( false == is_array( $blog_list ) ) {
|
2998 |
+
return array();
|
2999 |
+
}
|
3000 |
+
|
3001 |
+
return $blog_list;
|
3002 |
+
} // end get_mu_blog_list()
|
3003 |
+
|
3004 |
+
/**
|
3005 |
+
Adds a links directly to the settings page from the plugin page
|
3006 |
+
*/
|
3007 |
+
function plugin_links($links, $file) {
|
3008 |
+
if ( $file == S2DIR.'/subscribe2.php' ) {
|
3009 |
+
$links[] = "<a href='options-general.php?page=s2_settings'>" . __('Settings', 'subscribe2') . "</a>";
|
3010 |
+
$links[] = "<a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904'><b>" . __('Donate', 'subscribe2') . "</b></a>";
|
3011 |
+
}
|
3012 |
+
return $links;
|
3013 |
+
} // end plugin_links()
|
3014 |
+
|
3015 |
+
/**
|
3016 |
+
Adds information to the WordPress registration screen for new users
|
3017 |
+
*/
|
3018 |
+
function register_form() {
|
3019 |
+
if ( 'wpreg' == $this->subscribe2_options['autosub'] ) {
|
3020 |
+
echo "<p>\r\n<label>";
|
3021 |
+
echo __('Check here to Subscribe to email notifications for new posts', 'subscribe2') . ":<br />\r\n";
|
3022 |
+
echo "<input type=\"checkbox\" name=\"subscribe\"";
|
3023 |
+
if ( 'yes' == $this->subscribe2_options['wpregdef'] ) {
|
3024 |
+
echo " checked=\"checked\"";
|
3025 |
+
}
|
3026 |
+
echo " /></label>\r\n";
|
3027 |
+
echo "</p>\r\n";
|
3028 |
+
} elseif ( 'yes' == $this->subscribe2_options['autosub'] ) {
|
3029 |
+
echo "<p>\r\n<center>\r\n";
|
3030 |
+
echo __('By registering with this blog you are also agreeing to receive email notifications for new posts but you can unsubscribe at anytime', 'subscribe2') . ".<br />\r\n";
|
3031 |
+
echo "</center></p>\r\n";
|
3032 |
+
}
|
3033 |
+
}
|
3034 |
+
|
3035 |
+
/**
|
3036 |
+
Process function to add action if user selects to subscribe to posts during registration
|
3037 |
+
*/
|
3038 |
+
function register_post() {
|
3039 |
+
if ( 'on' == $_POST['subscribe'] ) {
|
3040 |
+
$user = get_userdatabylogin($_POST['user_login']);
|
3041 |
+
if ( 0 == $user->ID ) { return; }
|
3042 |
+
$this->register($user->ID);
|
3043 |
+
}
|
3044 |
+
}
|
3045 |
+
|
3046 |
+
/**
|
3047 |
+
Create meta box on write pages
|
3048 |
+
*/
|
3049 |
+
function s2_meta_init() {
|
3050 |
+
add_meta_box('subscribe2', __('Subscribe2 Notification Override', 'subscribe2' ), array(&$this, 's2_meta_box'), 'post', 'advanced');
|
3051 |
+
add_meta_box('subscribe2', __('Subscribe2 Notification Override', 'subscribe2' ), array(&$this, 's2_meta_box'), 'page', 'advanced');
|
3052 |
+
} // end s2_meta_init()
|
3053 |
+
|
3054 |
+
/**
|
3055 |
+
Meta box code for WordPress 2.5+
|
3056 |
+
*/
|
3057 |
+
function s2_meta_box() {
|
3058 |
+
global $post_ID;
|
3059 |
+
$s2mail = get_post_meta($post_ID, 's2mail', true);
|
3060 |
+
echo "<input type=\"hidden\" name=\"s2meta_nonce\" id=\"s2meta_nonce\" value=\"" . wp_create_nonce(md5(plugin_basename(__FILE__))) . "\" />";
|
3061 |
+
echo __("Check here to disable sending of an email notification for this post/page", 'subscribe2');
|
3062 |
+
echo " <input type=\"checkbox\" name=\"s2_meta_field\" value=\"no\"";
|
3063 |
+
if ( $s2mail == 'no' || ($this->subscribe2_options['s2meta_default'] == "1" && $s2mail == "") ) {
|
3064 |
+
echo " checked=\"checked\"";
|
3065 |
+
}
|
3066 |
+
echo " />";
|
3067 |
+
} // end s2_meta_box()
|
3068 |
+
|
3069 |
+
/**
|
3070 |
+
Meta box form handler
|
3071 |
+
*/
|
3072 |
+
function s2_meta_handler($post_id) {
|
3073 |
+
if ( !isset($_POST['s2meta_nonce']) || !wp_verify_nonce($_POST['s2meta_nonce'], md5(plugin_basename(__FILE__))) ) { return $post_id; }
|
3074 |
+
|
3075 |
+
if ( 'page' == $_POST['post_type'] ) {
|
3076 |
+
if ( !current_user_can('edit_page', $post_id) ) { return $post_id; }
|
3077 |
+
} else {
|
3078 |
+
if ( !current_user_can('edit_post', $post_id) ) { return $post_id; }
|
3079 |
+
}
|
3080 |
+
|
3081 |
+
if ( isset($_POST['s2_meta_field']) && $_POST['s2_meta_field'] == 'no' ) {
|
3082 |
+
update_post_meta($post_id, 's2mail', $_POST['s2_meta_field']);
|
3083 |
+
} else {
|
3084 |
+
update_post_meta($post_id, 's2mail', 'yes');
|
3085 |
+
}
|
3086 |
+
} // end s2_meta_box_handler()
|
3087 |
+
|
3088 |
+
/* ===== template and filter functions ===== */
|
3089 |
+
/**
|
3090 |
+
Display our form; also handles (un)subscribe requests
|
3091 |
+
*/
|
3092 |
+
function shortcode($atts) {
|
3093 |
+
extract(shortcode_atts(array(
|
3094 |
+
'hide' => '',
|
3095 |
+
'id' => '',
|
3096 |
+
'url' => ''
|
3097 |
+
), $atts));
|
3098 |
+
|
3099 |
+
// if a button is hidden, show only other
|
3100 |
+
if ( $hide == 'subscribe' ) {
|
3101 |
+
$this->input_form_action = "<input type=\"submit\" name=\"unsubscribe\" value=\"" . __('Unsubscribe', 'subscribe2') . "\" />";
|
3102 |
+
} elseif ( $hide == 'unsubscribe' ) {
|
3103 |
+
$this->input_form_action = "<input type=\"submit\" name=\"subscribe\" value=\"" . __('Subscribe', 'subscribe2') . "\" />";
|
3104 |
+
} else {
|
3105 |
+
// both form input actions
|
3106 |
+
$this->input_form_action = "<input type=\"submit\" name=\"subscribe\" value=\"" . __('Subscribe', 'subscribe2') . "\" /> <input type=\"submit\" name=\"unsubscribe\" value=\"" . __('Unsubscribe', 'subscribe2') . "\" />";
|
3107 |
+
}
|
3108 |
+
// if ID is provided, get permalink
|
3109 |
+
if ( $id ) {
|
3110 |
+
$url = get_permalink( $id );
|
3111 |
+
}
|
3112 |
+
// build default form
|
3113 |
+
$this->form = "<form method=\"post\" action=\"" . $url . "\"><input type=\"hidden\" name=\"ip\" value=\"" . $_SERVER['REMOTE_ADDR'] . "\" /><p>" . __('Your email:', 'subscribe2') . "<br /><input type=\"text\" name=\"email\" 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";
|
3114 |
+
$this->s2form = $this->form;
|
3115 |
+
|
3116 |
+
global $user_ID;
|
3117 |
+
get_currentuserinfo();
|
3118 |
+
if ( $user_ID ) {
|
3119 |
+
if ( current_user_can('manage_options') ) {
|
3120 |
+
$this->s2form = $this->use_profile_admin;
|
3121 |
+
} else {
|
3122 |
+
$this->s2form = $this->use_profile_users;
|
3123 |
+
}
|
3124 |
+
}
|
3125 |
+
if ( isset($_POST['subscribe']) || isset($_POST['unsubscribe']) ) {
|
3126 |
+
global $wpdb, $user_email;
|
3127 |
+
if ( !is_email($_POST['email']) ) {
|
3128 |
+
$this->s2form = $this->form . $this->not_an_email;
|
3129 |
+
} elseif ( $this->is_barred($_POST['email']) ) {
|
3130 |
+
$this->s2form = $this->form . $this->barred_domain;
|
3131 |
+
} else {
|
3132 |
+
$this->email = $this->sanitize_email($_POST['email']);
|
3133 |
+
$this->ip = $_POST['ip'];
|
3134 |
+
// does the supplied email belong to a registered user?
|
3135 |
+
$check = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE user_email = '$this->email'");
|
3136 |
+
if ( '' != $check ) {
|
3137 |
+
// this is a registered email
|
3138 |
+
$this->s2form = $this->please_log_in;
|
3139 |
+
} else {
|
3140 |
+
// this is not a registered email
|
3141 |
+
// what should we do?
|
3142 |
+
if ( isset($_POST['subscribe']) ) {
|
3143 |
+
// someone is trying to subscribe
|
3144 |
+
// lets see if they've tried to subscribe previously
|
3145 |
+
if ( '1' !== $this->is_public($this->email) ) {
|
3146 |
+
// the user is unknown or inactive
|
3147 |
+
$this->add();
|
3148 |
+
$status = $this->send_confirm('add');
|
3149 |
+
// set a variable to denote that we've already run, and shouldn't run again
|
3150 |
+
$this->filtered = 1;
|
3151 |
+
if ( $status ) {
|
3152 |
+
$this->s2form = $this->confirmation_sent;
|
3153 |
+
} else {
|
3154 |
+
$this->s2form = $this->error;
|
3155 |
+
}
|
3156 |
+
} else {
|
3157 |
+
// they're already subscribed
|
3158 |
+
$this->s2form = $this->already_subscribed;
|
3159 |
+
}
|
3160 |
+
$this->action = 'subscribe';
|
3161 |
+
} elseif ( isset($_POST['unsubscribe']) ) {
|
3162 |
+
// is this email a subscriber?
|
3163 |
+
if ( false == $this->is_public($this->email) ) {
|
3164 |
+
$this->s2form = $this->form . $this->not_subscribed;
|
3165 |
+
} else {
|
3166 |
+
$status = $this->send_confirm('del');
|
3167 |
+
// set a variable to denote that we've already run, and shouldn't run again
|
3168 |
+
$this->filtered = 1;
|
3169 |
+
if ( $status ) {
|
3170 |
+
$this->s2form = $this->confirmation_sent;
|
3171 |
+
} else {
|
3172 |
+
$this->s2form = $this->error;
|
3173 |
+
}
|
3174 |
+
}
|
3175 |
+
$this->action='unsubscribe';
|
3176 |
+
}
|
3177 |
+
}
|
3178 |
+
}
|
3179 |
+
}
|
3180 |
+
return $this->s2form;
|
3181 |
+
} // end shortcode()
|
3182 |
+
|
3183 |
+
/**
|
3184 |
+
Display form when deprecated <!--subscribe2--> is used
|
3185 |
+
*/
|
3186 |
+
function filter($content = '') {
|
3187 |
+
if ( '' == $content || !strstr($content, '<!--subscribe2-->') ) { return $content; }
|
3188 |
+
|
3189 |
+
return preg_replace('|(<p>)?(\n)*<!--subscribe2-->(\n)*(</p>)?|', do_shortcode( '[subscribe2]' ), $content);
|
3190 |
+
} // end filter()
|
3191 |
+
|
3192 |
+
/**
|
3193 |
+
Overrides the default query when handling a (un)subscription confirmation
|
3194 |
+
This is basically a trick: if the s2 variable is in the query string, just grab the first
|
3195 |
+
static page and override it's contents later with title_filter()
|
3196 |
+
*/
|
3197 |
+
function query_filter() {
|
3198 |
+
// don't interfere if we've already done our thing
|
3199 |
+
if ( 1 == $this->filtered ) { return; }
|
3200 |
+
|
3201 |
+
global $wpdb;
|
3202 |
+
|
3203 |
+
if ( 0 != $this->subscribe2_options['s2page'] ) {
|
3204 |
+
return "page_id=" . $this->subscribe2_options['s2page'];
|
3205 |
+
} else {
|
3206 |
+
$id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status='publish' LIMIT 1");
|
3207 |
+
if ( $id ) {
|
3208 |
+
return "page_id=$id";
|
3209 |
+
} else {
|
3210 |
+
return "showposts=1";
|
3211 |
+
}
|
3212 |
+
}
|
3213 |
+
} // end query_filter()
|
3214 |
+
|
3215 |
+
/**
|
3216 |
+
Overrides the page title
|
3217 |
+
*/
|
3218 |
+
function title_filter($title) {
|
3219 |
+
// don't interfere if we've already done our thing
|
3220 |
+
if ( in_the_loop() ) {
|
3221 |
+
return __('Subscription Confirmation', 'subscribe2');
|
3222 |
+
} else {
|
3223 |
+
return $title;
|
3224 |
+
}
|
3225 |
+
} // end title_filter()
|
3226 |
+
|
3227 |
+
/* ===== widget functions ===== */
|
3228 |
+
/**
|
3229 |
+
Register the form widget
|
3230 |
+
*/
|
3231 |
+
function subscribe2_widget() {
|
3232 |
+
require_once( WP_CONTENT_DIR . '/plugins/' . S2DIR . '/include/widget.php');
|
3233 |
+
register_widget('S2_Form_widget');
|
3234 |
+
} // end subscribe2_widget()
|
3235 |
+
|
3236 |
+
/**
|
3237 |
+
Register the counter widget
|
3238 |
+
*/
|
3239 |
+
function counter_widget() {
|
3240 |
+
require_once( WP_CONTENT_DIR . '/plugins/' . S2DIR . '/include/counterwidget.php');
|
3241 |
+
register_widget('S2_Counter_widget');
|
3242 |
+
} // end counter_widget()
|
3243 |
+
|
3244 |
+
/**
|
3245 |
+
Function to add js files to admin header
|
3246 |
+
*/
|
3247 |
+
function widget_s2counter_js() {
|
3248 |
+
echo '<script type="text/javascript" src="' . WP_CONTENT_URL . '/plugins/' . S2DIR . '/include/colorpicker/js/colorpicker.js"></script>' . "\r\n";
|
3249 |
+
echo "<script type=\"text/javascript\">
|
3250 |
+
jQuery(document).ready(function() {
|
3251 |
+
jQuery('.colorpickerField').focusin(function() {
|
3252 |
+
jQuery(this).ColorPickerShow();
|
3253 |
+
});
|
3254 |
+
jQuery('.colorpickerField').focusout(function() {
|
3255 |
+
jQuery(this).ColorPickerHide();
|
3256 |
+
});
|
3257 |
+
jQuery('.colorpickerField').ColorPicker({
|
3258 |
+
onSubmit: function(hsb, hex, rgb, el) {
|
3259 |
+
jQuery(el).val(hex);
|
3260 |
+
jQuery(el).ColorPickerHide();
|
3261 |
+
},
|
3262 |
+
onBeforeShow: function () {
|
3263 |
+
jQuery(this).ColorPickerSetColor(this.value);
|
3264 |
+
}
|
3265 |
+
})
|
3266 |
+
.bind('keyup', function(){
|
3267 |
+
jQuery(this).ColorPickerSetColor(this.value);
|
3268 |
+
});
|
3269 |
+
});
|
3270 |
+
</script>";
|
3271 |
+
} // end widget_s2_counter_js()
|
3272 |
+
|
3273 |
+
/**
|
3274 |
+
Function to add css files to admin header
|
3275 |
+
*/
|
3276 |
+
function widget_s2counter_css() {
|
3277 |
+
echo '<link rel="stylesheet" href="' . WP_CONTENT_URL . '/plugins/' . S2DIR . '/include/colorpicker/css/colorpicker.css" type="text/css" />' . "\r\n";
|
3278 |
+
} // end widget_s2counter_css
|
3279 |
+
|
3280 |
+
function namechange_subscribe2_widget() {
|
3281 |
+
// rename WPMU widgets without requiring user to re-enable
|
3282 |
+
global $wpdb;
|
3283 |
+
$blogs = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
|
3284 |
+
|
3285 |
+
foreach ( $blogs as $blog ) {
|
3286 |
+
switch_to_blog($blog);
|
3287 |
+
|
3288 |
+
$sidebars = get_option('sidebars_widgets');
|
3289 |
+
if ( empty($sidebars) || !is_array($sidebars) ) { return; }
|
3290 |
+
$changed = false;
|
3291 |
+
foreach ( $sidebars as $s =>$sidebar ) {
|
3292 |
+
if ( empty($sidebar) || !is_array($sidebar) ) { break; }
|
3293 |
+
foreach ( $sidebar as $w => $widget ) {
|
3294 |
+
if ( $widget == 'subscribe2widget' ) {
|
3295 |
+
$sidebars[$s][$w] = 'subscribe2';
|
3296 |
+
$changed = true;
|
3297 |
+
}
|
3298 |
+
}
|
3299 |
+
}
|
3300 |
+
if ( $changed ) {
|
3301 |
+
update_option('sidebar_widgets', $sidebars);
|
3302 |
+
}
|
3303 |
+
}
|
3304 |
+
restore_current_blog();
|
3305 |
+
} // end namechange_subscribe2_widget()
|
3306 |
+
|
3307 |
+
/**
|
3308 |
+
Add hook for Minimeta Widget plugin
|
3309 |
+
*/
|
3310 |
+
function add_minimeta() {
|
3311 |
+
if ( $this->subscribe2_options['s2page'] != 0 ) {
|
3312 |
+
echo "<li><a href=\"" . get_option('siteurl') . "/?page_id=" . $this->subscribe2_options['s2page'] . "\">" . __('[Un]Subscribe to Posts', 'subscribe2') . "</a></li>\r\n";
|
3313 |
+
}
|
3314 |
+
} // end add_minimeta()
|
3315 |
+
|
3316 |
+
/* ===== Write Toolbar Button Functions ===== */
|
3317 |
+
|
3318 |
+
/**
|
3319 |
+
Register our button in the QuickTags bar
|
3320 |
+
*/
|
3321 |
+
function button_init() {
|
3322 |
+
if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) { return; }
|
3323 |
+
if ( 'true' == get_user_option('rich_editing') ) {
|
3324 |
+
// Use WordPress 2.5+ hooks
|
3325 |
+
add_filter('mce_external_plugins', array(&$this, 'mce3_plugin'));
|
3326 |
+
add_filter('mce_buttons', array(&$this, 'mce3_button'));
|
3327 |
+
} else {
|
3328 |
+
buttonsnap_separator();
|
3329 |
+
buttonsnap_jsbutton(WP_CONTENT_URL . '/plugins/' . S2DIR . '/include/s2_button.png', __('Subscribe2', 'subscribe2'), 's2_insert_token();');
|
3330 |
+
}
|
3331 |
+
} // end button_init()
|
3332 |
+
|
3333 |
+
/**
|
3334 |
+
Add buttons for WordPress 2.5+ using built in hooks
|
3335 |
+
*/
|
3336 |
+
function mce3_plugin($arr) {
|
3337 |
+
$path = WP_CONTENT_URL . '/plugins/' . S2DIR . '/tinymce3/editor_plugin.js';
|
3338 |
+
$arr['subscribe2'] = $path;
|
3339 |
+
return $arr;
|
3340 |
+
}
|
3341 |
+
|
3342 |
+
function mce3_button($arr) {
|
3343 |
+
$arr[] = 'subscribe2';
|
3344 |
+
return $arr;
|
3345 |
+
}
|
3346 |
+
|
3347 |
+
function s2_edit_form() {
|
3348 |
+
echo "<!-- Start Subscribe2 Quicktags Javascript -->\r\n";
|
3349 |
+
echo "<script type=\"text/javascript\">\r\n";
|
3350 |
+
echo "//<![CDATA[\r\n";
|
3351 |
+
echo "function s2_insert_token() {
|
3352 |
+
buttonsnap_settext('<!--subscribe2-->');
|
3353 |
+
}\r\n";
|
3354 |
+
echo "//]]>\r\n";
|
3355 |
+
echo "</script>\r\n";
|
3356 |
+
echo "<!-- End Subscribe2 Quicktags Javascript -->\r\n";
|
3357 |
+
}
|
3358 |
+
|
3359 |
+
/* ===== wp-cron functions ===== */
|
3360 |
+
/**
|
3361 |
+
Add a weekly event to cron
|
3362 |
+
*/
|
3363 |
+
function add_weekly_sched($sched) {
|
3364 |
+
$sched['weekly'] = array('interval' => 604800, 'display' => __('Weekly', 'subscribe2'));
|
3365 |
+
return $sched;
|
3366 |
+
} // end add_weekly_sched()
|
3367 |
+
|
3368 |
+
/**
|
3369 |
+
Send a daily digest of today's new posts
|
3370 |
+
*/
|
3371 |
+
function subscribe2_cron($preview = '', $resend = '') {
|
3372 |
+
if ( defined('DOING_S2_CRON') && DOING_S2_CRON ) { return; }
|
3373 |
+
define( 'DOING_S2_CRON', true );
|
3374 |
+
global $wpdb;
|
3375 |
+
|
3376 |
+
if ( '' == $preview ) {
|
3377 |
+
// update last_s2cron execution time before completing or bailing
|
3378 |
+
$now = current_time('mysql');
|
3379 |
+
$prev = $this->subscribe2_options['last_s2cron'];
|
3380 |
+
$last = $this->subscribe2_options['previous_s2cron'];
|
3381 |
+
$this->subscribe2_options['last_s2cron'] = $now;
|
3382 |
+
$this->subscribe2_options['previous_s2cron'] = $prev;
|
3383 |
+
if ( '' == $resend ) {
|
3384 |
+
// update sending times provided this is not a resend
|
3385 |
+
update_option('subscribe2_options', $this->subscribe2_options);
|
3386 |
+
}
|
3387 |
+
|
3388 |
+
// set up SQL query based on options
|
3389 |
+
if ( $this->subscribe2_options['private'] == 'yes' ) {
|
3390 |
+
$status = "'publish', 'private'";
|
3391 |
+
} else {
|
3392 |
+
$status = "'publish'";
|
3393 |
+
}
|
3394 |
+
|
3395 |
+
// send notifications for allowed post type (defaults for posts and pages)
|
3396 |
+
// uses s2_post_types filter to allow for custom post types in WP 3.0
|
3397 |
+
if ( $this->subscribe2_options['pages'] == 'yes' ) {
|
3398 |
+
$s2_post_types = array('page', 'post');
|
3399 |
+
} else {
|
3400 |
+
$s2_post_types = array('post');
|
3401 |
+
}
|
3402 |
+
$s2_post_types = apply_filters('s2_post_types', $s2_post_types);
|
3403 |
+
foreach( $s2_post_types as $post_type ) {
|
3404 |
+
('' == $type) ? $type = "'$post_type'" : $type .= ", '$post_type'";
|
3405 |
+
}
|
3406 |
+
|
3407 |
+
// collect posts
|
3408 |
+
if ( $resend == 'resend' ) {
|
3409 |
+
if ( $this->subscribe2_options['cron_order'] == 'desc' ) {
|
3410 |
+
$posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content, post_type, post_password, post_date, post_author FROM $wpdb->posts WHERE post_date >= '$last' AND post_date < '$prev' AND post_status IN ($status) AND post_type IN ($type) ORDER BY post_date DESC");
|
3411 |
+
} else {
|
3412 |
+
$posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content, post_type, post_password, post_date, post_author FROM $wpdb->posts WHERE post_date >= '$last' AND post_date < '$prev' AND post_status IN ($status) AND post_type IN ($type) ORDER BY post_date ASC");
|
3413 |
+
}
|
3414 |
+
} else {
|
3415 |
+
if ( $this->subscribe2_options['cron_order'] == 'desc' ) {
|
3416 |
+
$posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content, post_type, post_password, post_date, post_author FROM $wpdb->posts WHERE post_date >= '$prev' AND post_date < '$now' AND post_status IN ($status) AND post_type IN ($type) ORDER BY post_date DESC");
|
3417 |
+
} else {
|
3418 |
+
$posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content, post_type, post_password, post_date, post_author FROM $wpdb->posts WHERE post_date >= '$prev' AND post_date < '$now' AND post_status IN ($status) AND post_type IN ($type) ORDER BY post_date ASC");
|
3419 |
+
}
|
3420 |
+
}
|
3421 |
+
} else {
|
3422 |
+
// we are sending a preview
|
3423 |
+
$posts = get_posts('numberposts=1');
|
3424 |
+
}
|
3425 |
+
|
3426 |
+
// do we have any posts?
|
3427 |
+
if ( empty($posts) ) { return false; }
|
3428 |
+
$this->post_count = count($posts);
|
3429 |
+
|
3430 |
+
// if we have posts, let's prepare the digest
|
3431 |
+
$datetime = get_option('date_format') . ' @ ' . get_option('time_format');
|
3432 |
+
$all_post_cats = array();
|
3433 |
+
$mailtext = apply_filters('s2_email_template', $this->subscribe2_options['mailtext']);
|
3434 |
+
$table = '';
|
3435 |
+
$tablelinks = '';
|
3436 |
+
$message_post= '';
|
3437 |
+
$message_posttime = '';
|
3438 |
+
foreach ( $posts as $post ) {
|
3439 |
+
$post_cats = wp_get_post_categories($post->ID);
|
3440 |
+
$post_cats_string = implode(',', $post_cats);
|
3441 |
+
$all_post_cats = array_unique(array_merge($all_post_cats, $post_cats));
|
3442 |
+
$check = false;
|
3443 |
+
// Pages are put into category 1 so make sure we don't exclude
|
3444 |
+
// pages if category 1 is excluded
|
3445 |
+
if ( $post->post_type != 'page' ) {
|
3446 |
+
// is the current post assigned to any categories
|
3447 |
+
// which should not generate a notification email?
|
3448 |
+
foreach ( explode(',', $this->subscribe2_options['exclude']) as $cat ) {
|
3449 |
+
if ( in_array($cat, $post_cats) ) {
|
3450 |
+
$check = true;
|
3451 |
+
}
|
3452 |
+
}
|
3453 |
+
}
|
3454 |
+
// is the current post set by the user to
|
3455 |
+
// not generate a notification email?
|
3456 |
+
$s2mail = get_post_meta($post->ID, 's2mail', true);
|
3457 |
+
if ( strtolower(trim($s2mail)) == 'no' ) {
|
3458 |
+
$check = true;
|
3459 |
+
}
|
3460 |
+
// is the current post private
|
3461 |
+
// and should this not generate a notification email?
|
3462 |
+
if ( $this->subscribe2_options['password'] == 'no' && $post->post_password != '' ) {
|
3463 |
+
$check = true;
|
3464 |
+
}
|
3465 |
+
// if this post is excluded
|
3466 |
+
// don't include it in the digest
|
3467 |
+
if ( $check ) {
|
3468 |
+
continue;
|
3469 |
+
}
|
3470 |
+
$post_title = html_entity_decode($post->post_title, ENT_QUOTES);
|
3471 |
+
('' == $table) ? $table .= "* " . $post_title : $table .= "\r\n* " . $post_title;
|
3472 |
+
('' == $tablelinks) ? $tablelinks .= "* " . $post_title : $tablelinks .= "\r\n* " . $post_title;
|
3473 |
+
$message_post .= $post_title;
|
3474 |
+
$message_posttime .= $post_title;
|
3475 |
+
if ( strstr($mailtext, "AUTHORNAME") ) {
|
3476 |
+
$author = get_userdata($post->post_author);
|
3477 |
+
if ( $author->display_name != '' ) {
|
3478 |
+
$message_post .= " (" . __('Author', 'subscribe2') . ": " . $author->display_name . ")";
|
3479 |
+
$message_posttime .= " (" . __('Author', 'subscribe2') . ": " . $author->display_name . ")";
|
3480 |
+
}
|
3481 |
+
}
|
3482 |
+
$message_post .= "\r\n";
|
3483 |
+
$message_posttime .= "\r\n";
|
3484 |
+
|
3485 |
+
$tablelinks .= "\r\n" . get_permalink($post->ID) . "\r\n";
|
3486 |
+
$message_post .= get_permalink($post->ID) . "\r\n";
|
3487 |
+
$message_posttime .= __('Posted on', 'subscribe2') . ": " . mysql2date($datetime, $post->post_date) . "\r\n";
|
3488 |
+
$message_posttime .= get_permalink($post->ID) . "\r\n";
|
3489 |
+
if ( strstr($mailtext, "CATS") ) {
|
3490 |
+
$post_cat_names = implode(', ', wp_get_post_categories($post->ID, array('fields' => 'names')));
|
3491 |
+
$message_post .= __('Posted in', 'subscribe2') . ": " . $post_cat_names . "\r\n";
|
3492 |
+
$message_posttime .= __('Posted in', 'subscribe2') . ": " . $post_cat_names . "\r\n";
|
3493 |
+
}
|
3494 |
+
if ( strstr($mailtext, "TAGS") ) {
|
3495 |
+
$post_tag_names = implode(', ', wp_get_post_tags($post->ID, array('fields' => 'names')));
|
3496 |
+
if ( $post_tag_names != '' ) {
|
3497 |
+
$message_post .= __('Tagged as', 'subscribe2') . ": " . $post_tag_names . "\r\n";
|
3498 |
+
$message_posttime .= __('Tagged as', 'subscribe2') . ": " . $post_tag_names . "\r\n";
|
3499 |
+
}
|
3500 |
+
}
|
3501 |
+
$message_post .= "\r\n";
|
3502 |
+
$message_posttime .= "\r\n";
|
3503 |
+
|
3504 |
+
$excerpt = $post->post_excerpt;
|
3505 |
+
if ( '' == $excerpt ) {
|
3506 |
+
// no excerpt, is there a <!--more--> ?
|
3507 |
+
if ( false !== strpos($post->post_content, '<!--more-->') ) {
|
3508 |
+
list($excerpt, $more) = explode('<!--more-->', $post->post_content, 2);
|
3509 |
+
$excerpt = strip_tags($excerpt);
|
3510 |
+
if ( function_exists('strip_shortcodes') ) {
|
3511 |
+
$excerpt = strip_shortcodes($excerpt);
|
3512 |
+
}
|
3513 |
+
} else {
|
3514 |
+
$excerpt = strip_tags($post->post_content);
|
3515 |
+
if ( function_exists('strip_shortcodes') ) {
|
3516 |
+
$excerpt = strip_shortcodes($excerpt);
|
3517 |
+
}
|
3518 |
+
$words = explode(' ', $excerpt, $this->excerpt_length + 1);
|
3519 |
+
if ( count($words) > $this->excerpt_length ) {
|
3520 |
+
array_pop($words);
|
3521 |
+
array_push($words, '[...]');
|
3522 |
+
$excerpt = implode(' ', $words);
|
3523 |
+
}
|
3524 |
+
}
|
3525 |
+
// strip leading and trailing whitespace
|
3526 |
+
$excerpt = trim($excerpt);
|
3527 |
+
}
|
3528 |
+
$message_post .= $excerpt . "\r\n\r\n";
|
3529 |
+
$message_posttime .= $excerpt . "\r\n\r\n";
|
3530 |
+
}
|
3531 |
+
|
3532 |
+
// we add a blank line after each post excerpt now trim white space that occurs for the last post
|
3533 |
+
$message_post = trim($message_post);
|
3534 |
+
$message_posttime = trim($message_posttime);
|
3535 |
+
|
3536 |
+
//sanity check - don't send a mail if the content is empty
|
3537 |
+
if ( !$message_post && !$message_posttime && !$table && !$tablelinks ) {
|
3538 |
+
return;
|
3539 |
+
}
|
3540 |
+
|
3541 |
+
// get admin details
|
3542 |
+
$user = $this->get_userdata($this->subscribe2_options['sender']);
|
3543 |
+
$this->myemail = $user->user_email;
|
3544 |
+
$this->myname = html_entity_decode($user->display_name, ENT_QUOTES);
|
3545 |
+
|
3546 |
+
$scheds = (array)wp_get_schedules();
|
3547 |
+
$email_freq = $this->subscribe2_options['email_freq'];
|
3548 |
+
$display = $scheds[$email_freq]['display'];
|
3549 |
+
( '' == get_option('blogname') ) ? $subject = "" : $subject = "[" . stripslashes(get_option('blogname')) . "] ";
|
3550 |
+
$subject .= $display . " " . __('Digest Email', 'subscribe2');
|
3551 |
+
$mailtext = str_replace("TABLELINKS", $tablelinks, $mailtext);
|
3552 |
+
$mailtext = str_replace("TABLE", $table, $mailtext);
|
3553 |
+
$mailtext = str_replace("POSTTIME", $message_posttime, $mailtext);
|
3554 |
+
$mailtext = str_replace("POST", $message_post, $mailtext);
|
3555 |
+
$mailtext = stripslashes($this->substitute($mailtext));
|
3556 |
+
|
3557 |
+
// prepare recipients
|
3558 |
+
if ( $preview != '' ) {
|
3559 |
+
$this->myemail = $preview;
|
3560 |
+
$this->myname = "Preview";
|
3561 |
+
$this->mail(array($preview), $subject, $mailtext);
|
3562 |
+
} else {
|
3563 |
+
$public = $this->get_public();
|
3564 |
+
$all_post_cats_string = implode(',', $all_post_cats);
|
3565 |
+
$registered = $this->get_registered("cats=$all_post_cats_string");
|
3566 |
+
$recipients = array_merge((array)$public, (array)$registered);
|
3567 |
+
$this->mail($recipients, $subject, $mailtext);
|
3568 |
+
}
|
3569 |
+
} // end subscribe2_cron
|
3570 |
+
|
3571 |
+
/* ===== Our constructor ===== */
|
3572 |
+
/**
|
3573 |
+
Subscribe2 constructor
|
3574 |
+
*/
|
3575 |
+
function s2init() {
|
3576 |
+
// load the options
|
3577 |
+
$this->subscribe2_options = get_option('subscribe2_options');
|
3578 |
+
|
3579 |
+
add_action('init', array(&$this, 'subscribe2'));
|
3580 |
+
if ( '1' == $this->subscribe2_options['show_button'] ) {
|
3581 |
+
add_action('init', array(&$this, 'button_init'));
|
3582 |
+
}
|
3583 |
+
|
3584 |
+
// add action to display widget if option is enabled
|
3585 |
+
if ( '1' == $this->subscribe2_options['widget'] ) {
|
3586 |
+
add_action('widgets_init', array(&$this, 'subscribe2_widget'));
|
3587 |
+
}
|
3588 |
+
|
3589 |
+
// add action to display counter widget if option is enabled
|
3590 |
+
if ( '1' == $this->subscribe2_options['counterwidget'] ) {
|
3591 |
+
add_action('admin_print_styles', array(&$this, 'widget_s2counter_css'), 20);
|
3592 |
+
add_action('admin_print_scripts', array(&$this, 'widget_s2counter_js'), 20);
|
3593 |
+
add_action('widgets_init', array(&$this, 'counter_widget'));
|
3594 |
+
}
|
3595 |
+
|
3596 |
+
// add action to handle WPMU subscriptions and unsubscriptions
|
3597 |
+
if ( isset($_GET['s2mu_subscribe']) || isset($_GET['s2mu_unsubscribe']) ) {
|
3598 |
+
add_action('init', array(&$this, 'wpmu_subscribe'));
|
3599 |
+
}
|
3600 |
+
} // end s2init()
|
3601 |
+
|
3602 |
+
function subscribe2() {
|
3603 |
+
global $wpdb, $table_prefix, $wp_version, $wpmu_version;
|
3604 |
+
|
3605 |
+
load_plugin_textdomain('subscribe2', 'wp-content/plugins/' . S2DIR, '/' . S2DIR);
|
3606 |
+
|
3607 |
+
// Is this WordPressMU or not?
|
3608 |
+
$this->s2_mu = false;
|
3609 |
+
if ( isset($wpmu_version) || strpos($wp_version, 'wordpress-mu') ) {
|
3610 |
+
$this->s2_mu = true;
|
3611 |
+
}
|
3612 |
+
if ( function_exists('is_multisite') && is_multisite() ) {
|
3613 |
+
$this->s2_mu = true;
|
3614 |
+
}
|
3615 |
+
|
3616 |
+
// do we need to install anything?
|
3617 |
+
$this->public = $table_prefix . "subscribe2";
|
3618 |
+
if ( $wpdb->get_var("SHOW TABLES LIKE '{$this->public}'") != $this->public ) { $this->install(); }
|
3619 |
+
//do we need to upgrade anything?
|
3620 |
+
if ( is_array($this->subscribe2_options) && $this->subscribe2_options['version'] !== S2VERSION ) {
|
3621 |
+
add_action('shutdown', array(&$this, 'upgrade'));
|
3622 |
+
}
|
3623 |
+
|
3624 |
+
if ( isset($_GET['s2']) ) {
|
3625 |
+
// someone is confirming a request
|
3626 |
+
if ( defined('DOING_S2_CONFIRM') && DOING_S2_CONFIRM ) { return; }
|
3627 |
+
define( 'DOING_S2_CONFIRM', true );
|
3628 |
+
add_filter('query_string', array(&$this, 'query_filter'));
|
3629 |
+
add_filter('the_title', array(&$this, 'title_filter'));
|
3630 |
+
add_filter('the_content', array(&$this, 'confirm'));
|
3631 |
+
}
|
3632 |
+
|
3633 |
+
if ( isset($_POST['s2_admin']) && $_POST['csv'] ) {
|
3634 |
+
$date = date('Y-m-d');
|
3635 |
+
header("Content-Description: File Transfer");
|
3636 |
+
header("Content-type: application/octet-stream");
|
3637 |
+
header("Content-Disposition: attachment; filename=subscribe2_users_$date.csv");
|
3638 |
+
header("Pragma: no-cache");
|
3639 |
+
header("Expires: 0");
|
3640 |
+
echo $this->prepare_export($_POST['exportcsv']);
|
3641 |
+
|
3642 |
+
exit(0);
|
3643 |
+
}
|
3644 |
+
|
3645 |
+
//add regular actions and filters
|
3646 |
+
add_action('admin_menu', array(&$this, 'admin_menu'));
|
3647 |
+
add_action('admin_menu', array(&$this, 's2_meta_init'));
|
3648 |
+
add_action('save_post', array(&$this, 's2_meta_handler'));
|
3649 |
+
add_action('create_category', array(&$this, 'new_category'));
|
3650 |
+
add_action('delete_category', array(&$this, 'delete_category'));
|
3651 |
+
add_shortcode('subscribe2', array(&$this, 'shortcode'));
|
3652 |
+
add_filter('the_content', array(&$this, 'filter'), 10);
|
3653 |
+
add_filter('cron_schedules', array(&$this, 'add_weekly_sched'));
|
3654 |
+
|
3655 |
+
// add actions for other plugins
|
3656 |
+
if ( '1' == $this->subscribe2_options['show_meta'] ) {
|
3657 |
+
add_action('wp_meta', array(&$this, 'add_minimeta'), 0);
|
3658 |
+
}
|
3659 |
+
// Add filters for Ozh Admin Menu
|
3660 |
+
add_filter('ozh_adminmenu_icon_s2_posts', array(&$this, 'ozh_s2_icon'));
|
3661 |
+
add_filter('ozh_adminmenu_icon_s2_users', array(&$this, 'ozh_s2_icon'));
|
3662 |
+
add_filter('ozh_adminmenu_icon_s2_tools', array(&$this, 'ozh_s2_icon'));
|
3663 |
+
add_filter('ozh_adminmenu_icon_s2_settings', array(&$this, 'ozh_s2_icon'));
|
3664 |
+
|
3665 |
+
// add action to display editor buttons if option is enabled
|
3666 |
+
if ( '1' == $this->subscribe2_options['show_button'] ) {
|
3667 |
+
add_action('edit_page_form', array(&$this, 's2_edit_form'));
|
3668 |
+
add_action('edit_form_advanced', array(&$this, 's2_edit_form'));
|
3669 |
+
}
|
3670 |
+
|
3671 |
+
// add actions for automatic subscription based on option settings
|
3672 |
+
add_action('register_form', array(&$this, 'register_form'));
|
3673 |
+
add_action('user_register', array(&$this, 'register'));
|
3674 |
+
add_action('add_user_to_blog', array(&$this, 'register'), 10, 1);
|
3675 |
+
|
3676 |
+
// add actions for processing posts based on per-post or cron email settings
|
3677 |
+
if ( $this->subscribe2_options['email_freq'] != 'never' ) {
|
3678 |
+
add_action('s2_digest_cron', array(&$this, 'subscribe2_cron'));
|
3679 |
+
} else {
|
3680 |
+
add_action('new_to_publish', array(&$this, 'publish'));
|
3681 |
+
add_action('draft_to_publish', array(&$this, 'publish'));
|
3682 |
+
add_action('pending_to_publish', array(&$this, 'publish'));
|
3683 |
+
add_action('private_to_publish', array(&$this, 'publish'));
|
3684 |
+
add_action('future_to_publish', array(&$this, 'publish'));
|
3685 |
+
if ( $this->subscribe2_options['private'] == 'yes' ) {
|
3686 |
+
add_action('new_to_private', array(&$this, 'publish'));
|
3687 |
+
add_action('draft_to_private', array(&$this, 'publish'));
|
3688 |
+
add_action('pending_to_private', array(&$this, 'publish'));
|
3689 |
+
}
|
3690 |
+
}
|
3691 |
+
|
3692 |
+
// load our strings
|
3693 |
+
$this->load_strings();
|
3694 |
+
} // end subscribe2()
|
3695 |
+
|
3696 |
+
/* ===== our variables ===== */
|
3697 |
+
// cache variables
|
3698 |
+
var $subscribe2_options = array();
|
3699 |
+
var $all_public = '';
|
3700 |
+
var $all_unconfirmed = '';
|
3701 |
+
var $excluded_cats = '';
|
3702 |
+
var $post_title = '';
|
3703 |
+
var $permalink = '';
|
3704 |
+
var $myname = '';
|
3705 |
+
var $myemail = '';
|
3706 |
+
var $signup_dates = array();
|
3707 |
+
var $filtered = 0;
|
3708 |
+
var $preview_email = false;
|
3709 |
+
|
3710 |
+
// state variables used to affect processing
|
3711 |
+
var $action = '';
|
3712 |
+
var $email = '';
|
3713 |
+
var $message = '';
|
3714 |
+
var $excerpt_length = 55;
|
3715 |
+
|
3716 |
+
// some messages
|
3717 |
+
var $please_log_in = '';
|
3718 |
+
var $use_profile_admin = '';
|
3719 |
+
var $use_profile_users = '';
|
3720 |
+
var $confirmation_sent = '';
|
3721 |
+
var $already_subscribed = '';
|
3722 |
+
var $not_subscribed ='';
|
3723 |
+
var $not_an_email = '';
|
3724 |
+
var $barred_domain = '';
|
3725 |
+
var $error = '';
|
3726 |
+
var $mail_sent = '';
|
3727 |
+
var $mail_failed = '';
|
3728 |
+
var $form = '';
|
3729 |
+
var $no_such_email = '';
|
3730 |
+
var $added = '';
|
3731 |
+
var $deleted = '';
|
3732 |
+
var $subscribe = '';
|
3733 |
+
var $unsubscribe = '';
|
3734 |
+
var $confirm_subject = '';
|
3735 |
+
var $options_saved = '';
|
3736 |
+
var $options_reset = '';
|
3737 |
+
} // end class subscribe2
|
3738 |
?>
|
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: 2010-
|
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"
|
@@ -33,8 +33,9 @@ msgstr ""
|
|
33 |
msgid "profile"
|
34 |
msgstr ""
|
35 |
|
36 |
-
#: subscribe2.php:70 subscribe2.php:79 subscribe2.php:
|
37 |
-
#: subscribe2.php:
|
|
|
38 |
msgid "Subscribe"
|
39 |
msgstr ""
|
40 |
|
@@ -82,785 +83,785 @@ msgid ""
|
|
82 |
"Message failed! Check your settings and check with your hosting provider"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: subscribe2.php:
|
86 |
-
msgid "Your email:"
|
87 |
-
msgstr ""
|
88 |
-
|
89 |
-
#: subscribe2.php:101
|
90 |
-
msgid "Enter email address..."
|
91 |
-
msgstr ""
|
92 |
-
|
93 |
-
#: subscribe2.php:101 subscribe2.php:1705 subscribe2.php:1802
|
94 |
-
#: subscribe2.php:2542
|
95 |
-
msgid "Unsubscribe"
|
96 |
-
msgstr ""
|
97 |
-
|
98 |
-
#: subscribe2.php:104
|
99 |
msgid "No such email address is registered."
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: subscribe2.php:
|
103 |
msgid "You have successfully subscribed!"
|
104 |
msgstr ""
|
105 |
|
106 |
-
#: subscribe2.php:
|
107 |
msgid "You have successfully unsubscribed."
|
108 |
msgstr ""
|
109 |
|
110 |
-
#: subscribe2.php:
|
111 |
msgid "subscribe"
|
112 |
msgstr ""
|
113 |
|
114 |
-
#: subscribe2.php:
|
115 |
msgid "unsubscribe"
|
116 |
msgstr ""
|
117 |
|
118 |
-
#: subscribe2.php:
|
119 |
msgid "Options saved!"
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: subscribe2.php:
|
123 |
msgid "Options reset!"
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: subscribe2.php:
|
127 |
msgid "Subscribers"
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: subscribe2.php:
|
131 |
msgid "Subscribe2 Options"
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: subscribe2.php:
|
135 |
msgid "Subscribe2"
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: subscribe2.php:
|
139 |
msgid "Your Subscriptions"
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: subscribe2.php:
|
143 |
msgid "Mail Subscribers"
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: subscribe2.php:
|
147 |
-
msgid "New
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: subscribe2.php:
|
151 |
msgid "subscribed to email notifications!"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: subscribe2.php:
|
155 |
msgid "New Unsubscription"
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: subscribe2.php:
|
159 |
msgid "unsubscribed from email notifications!"
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: subscribe2.php:
|
163 |
msgid "Address(es) subscribed!"
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: subscribe2.php:
|
167 |
msgid "Address(es) unsubscribed!"
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: subscribe2.php:
|
171 |
msgid "Some emails were not processed, the following were already subscribed"
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: subscribe2.php:
|
175 |
msgid "Some emails were not processed, the following were not in the database"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: subscribe2.php:
|
179 |
msgid "Address(es) deleted!"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: subscribe2.php:
|
183 |
msgid "Status changed!"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: subscribe2.php:
|
187 |
msgid "Reminder Email(s) Sent!"
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: subscribe2.php:
|
191 |
msgid "Registered Users Subscribed!"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: subscribe2.php:
|
195 |
msgid "Registered Users Unsubscribed!"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: subscribe2.php:
|
199 |
msgid "Format updated for Selected Registered Users!"
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: subscribe2.php:
|
203 |
msgid "Previous Page"
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: subscribe2.php:
|
207 |
msgid "Next Page"
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: subscribe2.php:
|
211 |
msgid "Manage Subscribers"
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: subscribe2.php:
|
215 |
msgid "Add/Remove Subscribers"
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: subscribe2.php:
|
219 |
msgid "Enter addresses, one per line or comma-separated"
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: subscribe2.php:1708
|
|
|
|
|
|
|
|
|
|
|
223 |
msgid "Current Subscribers"
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: subscribe2.php:
|
227 |
msgid "Filter"
|
228 |
msgstr ""
|
229 |
|
230 |
-
#: subscribe2.php:
|
231 |
msgid "Search Subscribers"
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: subscribe2.php:
|
235 |
msgid "Send Reminder Email"
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: subscribe2.php:
|
239 |
msgid "Save Emails to CSV File"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: subscribe2.php:
|
243 |
msgid "Process"
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: subscribe2.php:
|
247 |
msgid "Confirm this email address"
|
248 |
msgstr ""
|
249 |
|
250 |
-
#: subscribe2.php:
|
251 |
msgid "Unconfirm this email address"
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: subscribe2.php:
|
255 |
msgid "Delete this email address"
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: subscribe2.php:
|
259 |
msgid "Select / Unselect All"
|
260 |
msgstr ""
|
261 |
|
262 |
-
#: subscribe2.php:
|
263 |
msgid "edit"
|
264 |
msgstr ""
|
265 |
|
266 |
-
#: subscribe2.php:
|
267 |
msgid "No matching subscribers found"
|
268 |
msgstr ""
|
269 |
|
270 |
-
#: subscribe2.php:
|
271 |
msgid "NONE"
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: subscribe2.php:
|
275 |
msgid "Categories"
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: subscribe2.php:
|
279 |
msgid ""
|
280 |
"Preferences for Registered Users selected in the filter above can be changed "
|
281 |
"using this section."
|
282 |
msgstr ""
|
283 |
|
284 |
-
#: subscribe2.php:
|
285 |
msgid "Consider User Privacy as changes cannot be undone"
|
286 |
msgstr ""
|
287 |
|
288 |
-
#: subscribe2.php:
|
289 |
msgid "Action to perform"
|
290 |
msgstr ""
|
291 |
|
292 |
-
#: subscribe2.php:
|
293 |
msgid "Bulk Update Categories"
|
294 |
msgstr ""
|
295 |
|
296 |
-
#: subscribe2.php:
|
297 |
msgid "Send email as"
|
298 |
msgstr ""
|
299 |
|
300 |
-
#: subscribe2.php:
|
301 |
msgid "HTML - Full"
|
302 |
msgstr ""
|
303 |
|
304 |
-
#: subscribe2.php:
|
305 |
msgid "HTML - Excerpt"
|
306 |
msgstr ""
|
307 |
|
308 |
-
#: subscribe2.php:
|
309 |
msgid "Plain Text - Full"
|
310 |
msgstr ""
|
311 |
|
312 |
-
#: subscribe2.php:
|
313 |
msgid "Plain Text - Excerpt"
|
314 |
msgstr ""
|
315 |
|
316 |
-
#: subscribe2.php:
|
317 |
msgid "Bulk Update Format"
|
318 |
msgstr ""
|
319 |
|
320 |
-
#: subscribe2.php:
|
321 |
msgid "Preview message(s) sent to logged in user"
|
322 |
msgstr ""
|
323 |
|
324 |
-
#: subscribe2.php:
|
325 |
msgid ""
|
326 |
"The Digest Notification email contained no post information. No email was "
|
327 |
"sent"
|
328 |
msgstr ""
|
329 |
|
330 |
-
#: subscribe2.php:
|
331 |
msgid "Attempt made to resend the Digest Notification email"
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: subscribe2.php:
|
335 |
msgid "Subscribe2 Settings"
|
336 |
msgstr ""
|
337 |
|
338 |
-
#: subscribe2.php:
|
339 |
msgid "Plugin Blog"
|
340 |
msgstr ""
|
341 |
|
342 |
-
#: subscribe2.php:
|
343 |
msgid "Make a donation via PayPal"
|
344 |
msgstr ""
|
345 |
|
346 |
-
#: subscribe2.php:
|
347 |
msgid "Notification Settings"
|
348 |
msgstr ""
|
349 |
|
350 |
-
#: subscribe2.php:
|
351 |
msgid "Restrict the number of recipients per email to (0 for unlimited)"
|
352 |
msgstr ""
|
353 |
|
354 |
-
#: subscribe2.php:
|
355 |
msgid "Edit"
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: subscribe2.php:
|
359 |
msgid "Update"
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: subscribe2.php:
|
363 |
msgid "Revert"
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: subscribe2.php:
|
367 |
msgid "Send Admins notifications for new"
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: subscribe2.php:
|
371 |
msgid "Subscriptions"
|
372 |
msgstr ""
|
373 |
|
374 |
-
#: subscribe2.php:
|
375 |
msgid "Unsubscriptions"
|
376 |
msgstr ""
|
377 |
|
378 |
-
#: subscribe2.php:
|
379 |
msgid "Both"
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: subscribe2.php:
|
383 |
msgid "Neither"
|
384 |
msgstr ""
|
385 |
|
386 |
-
#: subscribe2.php:
|
387 |
msgid "Include theme CSS stylesheet in HTML notifications"
|
388 |
msgstr ""
|
389 |
|
390 |
-
#: subscribe2.php:
|
391 |
-
#: subscribe2.php:
|
392 |
-
#: subscribe2.php:
|
393 |
-
#: subscribe2.php:
|
394 |
msgid "Yes"
|
395 |
msgstr ""
|
396 |
|
397 |
-
#: subscribe2.php:
|
398 |
-
#: subscribe2.php:
|
399 |
-
#: subscribe2.php:
|
400 |
-
#: subscribe2.php:
|
401 |
msgid "No"
|
402 |
msgstr ""
|
403 |
|
404 |
-
#: subscribe2.php:
|
405 |
msgid "Send Emails for Pages"
|
406 |
msgstr ""
|
407 |
|
408 |
-
#: subscribe2.php:
|
409 |
msgid "Send Emails for Password Protected Posts"
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: subscribe2.php:
|
413 |
msgid "Send Emails for Private Posts"
|
414 |
msgstr ""
|
415 |
|
416 |
-
#: subscribe2.php:
|
417 |
msgid "Send Email From"
|
418 |
msgstr ""
|
419 |
|
420 |
-
#: subscribe2.php:
|
421 |
msgid "Send Emails"
|
422 |
msgstr ""
|
423 |
|
424 |
-
#: subscribe2.php:
|
425 |
msgid "For digest notifications, date order for posts is"
|
426 |
msgstr ""
|
427 |
|
428 |
-
#: subscribe2.php:
|
429 |
msgid "Descending"
|
430 |
msgstr ""
|
431 |
|
432 |
-
#: subscribe2.php:
|
433 |
msgid "Ascending"
|
434 |
msgstr ""
|
435 |
|
436 |
-
#: subscribe2.php:
|
437 |
msgid "Email Templates"
|
438 |
msgstr ""
|
439 |
|
440 |
-
#: subscribe2.php:
|
441 |
msgid "New Post email (must not be empty)"
|
442 |
msgstr ""
|
443 |
|
444 |
-
#: subscribe2.php:
|
445 |
msgid "Subject Line"
|
446 |
msgstr ""
|
447 |
|
448 |
-
#: subscribe2.php:
|
449 |
msgid "Send Email Preview"
|
450 |
msgstr ""
|
451 |
|
452 |
-
#: subscribe2.php:
|
453 |
msgid "Message substitions"
|
454 |
msgstr ""
|
455 |
|
456 |
-
#: subscribe2.php:
|
457 |
msgid "the post's title<br />(<i>for per-post emails only</i>)"
|
458 |
msgstr ""
|
459 |
|
460 |
-
#: subscribe2.php:
|
461 |
msgid ""
|
462 |
"the excerpt or the entire post<br />(<i>based on the subscriber's "
|
463 |
"preferences</i>)"
|
464 |
msgstr ""
|
465 |
|
466 |
-
#: subscribe2.php:
|
467 |
msgid ""
|
468 |
"the excerpt of the post and the time it was posted<br />(<i>for digest "
|
469 |
"emails only</i>)"
|
470 |
msgstr ""
|
471 |
|
472 |
-
#: subscribe2.php:
|
473 |
msgid "a list of post titles<br />(<i>for digest emails only</i>)"
|
474 |
msgstr ""
|
475 |
|
476 |
-
#: subscribe2.php:
|
477 |
msgid ""
|
478 |
"a list of post titles followed by links to the atricles<br />(<i>for digest "
|
479 |
"emails only</i>)"
|
480 |
msgstr ""
|
481 |
|
482 |
-
#: subscribe2.php:
|
483 |
msgid "the post's permalink<br />(<i>for per-post emails only</i>)"
|
484 |
msgstr ""
|
485 |
|
486 |
-
#: subscribe2.php:
|
487 |
msgid ""
|
488 |
"the post's permalink after conversion by TinyURL<br />(<i>for per-post "
|
489 |
"emails only</i>)"
|
490 |
msgstr ""
|
491 |
|
492 |
-
#: subscribe2.php:
|
493 |
msgid "the date the post was made<br />(<i>for per-post emails only</i>)"
|
494 |
msgstr ""
|
495 |
|
496 |
-
#: subscribe2.php:
|
497 |
msgid "the time the post was made<br />(<i>for per-post emails only</i>)"
|
498 |
msgstr ""
|
499 |
|
500 |
-
#: subscribe2.php:
|
501 |
msgid "the admin or post author's name"
|
502 |
msgstr ""
|
503 |
|
504 |
-
#: subscribe2.php:
|
505 |
msgid "the admin or post author's email"
|
506 |
msgstr ""
|
507 |
|
508 |
-
#: subscribe2.php:
|
509 |
msgid "the post author's name"
|
510 |
msgstr ""
|
511 |
|
512 |
-
#: subscribe2.php:
|
513 |
msgid ""
|
514 |
"the generated link to confirm a request<br />(<i>only used in the "
|
515 |
"confirmation email template</i>)"
|
516 |
msgstr ""
|
517 |
|
518 |
-
#: subscribe2.php:
|
519 |
msgid ""
|
520 |
"Action performed by LINK in confirmation email<br />(<i>only used in the "
|
521 |
"confirmation email template</i>)"
|
522 |
msgstr ""
|
523 |
|
524 |
-
#: subscribe2.php:
|
525 |
msgid "the post's assigned categories"
|
526 |
msgstr ""
|
527 |
|
528 |
-
#: subscribe2.php:
|
529 |
msgid "the post's assigned Tags"
|
530 |
msgstr ""
|
531 |
|
532 |
-
#: subscribe2.php:
|
533 |
msgid ""
|
534 |
"the number of posts included in the digest email<br />(<i>for digest emails "
|
535 |
"only</i>)"
|
536 |
msgstr ""
|
537 |
|
538 |
-
#: subscribe2.php:
|
539 |
msgid "Subscribe / Unsubscribe confirmation email"
|
540 |
msgstr ""
|
541 |
|
542 |
-
#: subscribe2.php:
|
543 |
msgid "Reminder email to Unconfirmed Subscribers"
|
544 |
msgstr ""
|
545 |
|
546 |
-
#: subscribe2.php:
|
547 |
msgid "Excluded Categories"
|
548 |
msgstr ""
|
549 |
|
550 |
-
#: subscribe2.php:
|
551 |
msgid ""
|
552 |
"Posts assigned to any Excluded Category do not generate notifications and "
|
553 |
"are not included in digest notifications"
|
554 |
msgstr ""
|
555 |
|
556 |
-
#: subscribe2.php:
|
557 |
msgid "Allow registered users to subscribe to excluded categories?"
|
558 |
msgstr ""
|
559 |
|
560 |
-
#: subscribe2.php:
|
561 |
msgid "Appearance"
|
562 |
msgstr ""
|
563 |
|
564 |
-
#: subscribe2.php:
|
565 |
msgid "Set default Subscribe2 page as ID"
|
566 |
msgstr ""
|
567 |
|
568 |
-
#: subscribe2.php:
|
569 |
msgid "Set the number of Subscribers displayed per page"
|
570 |
msgstr ""
|
571 |
|
572 |
-
#: subscribe2.php:
|
573 |
msgid "Show a link to your subscription page in \"meta\"?"
|
574 |
msgstr ""
|
575 |
|
576 |
-
#: subscribe2.php:
|
577 |
msgid "Show the Subscribe2 button on the Write toolbar?"
|
578 |
msgstr ""
|
579 |
|
580 |
-
#: subscribe2.php:
|
581 |
msgid "Enable Subscribe2 Widget?"
|
582 |
msgstr ""
|
583 |
|
584 |
-
#: subscribe2.php:
|
585 |
msgid "Enable Subscribe2 Counter Widget?"
|
586 |
msgstr ""
|
587 |
|
588 |
-
#: subscribe2.php:
|
589 |
msgid "Disable email notifications is checked by default on authoring pages?"
|
590 |
msgstr ""
|
591 |
|
592 |
-
#: subscribe2.php:
|
593 |
msgid "Auto Subscribe"
|
594 |
msgstr ""
|
595 |
|
596 |
-
#: subscribe2.php:
|
597 |
msgid "Subscribe new users registering with your blog"
|
598 |
msgstr ""
|
599 |
|
600 |
-
#: subscribe2.php:
|
601 |
msgid "Automatically"
|
602 |
msgstr ""
|
603 |
|
604 |
-
#: subscribe2.php:
|
605 |
msgid "Display option on Registration Form"
|
606 |
msgstr ""
|
607 |
|
608 |
-
#: subscribe2.php:
|
609 |
msgid "Auto-subscribe includes any excluded categories"
|
610 |
msgstr ""
|
611 |
|
612 |
-
#: subscribe2.php:
|
613 |
msgid "Registration Form option is checked by default"
|
614 |
msgstr ""
|
615 |
|
616 |
-
#: subscribe2.php:
|
617 |
msgid "Auto-subscribe users to receive email as"
|
618 |
msgstr ""
|
619 |
|
620 |
-
#: subscribe2.php:
|
621 |
msgid "Registered Users have the option to auto-subscribe to new categories"
|
622 |
msgstr ""
|
623 |
|
624 |
-
#: subscribe2.php:
|
625 |
msgid "New categories are immediately excluded"
|
626 |
msgstr ""
|
627 |
|
628 |
-
#: subscribe2.php:
|
629 |
msgid ""
|
630 |
"Option for Registered Users to auto-subscribe to new categories is checked "
|
631 |
"by default"
|
632 |
msgstr ""
|
633 |
|
634 |
-
#: subscribe2.php:
|
635 |
msgid "Barred Domains"
|
636 |
msgstr ""
|
637 |
|
638 |
-
#: subscribe2.php:
|
639 |
msgid ""
|
640 |
"Enter domains to bar from public subscriptions: <br /> (Use a new line for "
|
641 |
"each entry and omit the \"@\" symbol, for example email.com)"
|
642 |
msgstr ""
|
643 |
|
644 |
-
#: subscribe2.php:
|
645 |
msgid "Submit"
|
646 |
msgstr ""
|
647 |
|
648 |
-
#: subscribe2.php:
|
649 |
msgid "Reset Default"
|
650 |
msgstr ""
|
651 |
|
652 |
-
#: subscribe2.php:
|
653 |
msgid ""
|
654 |
"Use this to reset all options to their defaults. This <strong><em>will not</"
|
655 |
"em></strong> modify your list of subscribers."
|
656 |
msgstr ""
|
657 |
|
658 |
-
#: subscribe2.php:
|
659 |
msgid "RESET"
|
660 |
msgstr ""
|
661 |
|
662 |
-
#: subscribe2.php:
|
663 |
msgid "Subscription preferences updated."
|
664 |
msgstr ""
|
665 |
|
666 |
-
#: subscribe2.php:
|
667 |
msgid "Editing Subscribe2 preferences for user"
|
668 |
msgstr ""
|
669 |
|
670 |
-
#: subscribe2.php:
|
671 |
msgid "Receive email as"
|
672 |
msgstr ""
|
673 |
|
674 |
-
#: subscribe2.php:
|
675 |
msgid "Automatically subscribe me to newly created categories"
|
676 |
msgstr ""
|
677 |
|
678 |
-
#: subscribe2.php:
|
679 |
msgid "Unsubscribe me from this blog"
|
680 |
msgstr ""
|
681 |
|
682 |
-
#: subscribe2.php:
|
683 |
msgid "Subscribe to all categories"
|
684 |
msgstr ""
|
685 |
|
686 |
-
#: subscribe2.php:
|
687 |
msgid "Subscribed Categories on"
|
688 |
msgstr ""
|
689 |
|
690 |
-
#: subscribe2.php:
|
691 |
msgid "Subscribed Categories"
|
692 |
msgstr ""
|
693 |
|
694 |
-
#: subscribe2.php:
|
695 |
msgid "Receive periodic summaries of new posts?"
|
696 |
msgstr ""
|
697 |
|
698 |
-
#: subscribe2.php:
|
699 |
msgid "Update Preferences"
|
700 |
msgstr ""
|
701 |
|
702 |
-
#: subscribe2.php:
|
703 |
msgid "Subscribed Blogs"
|
704 |
msgstr ""
|
705 |
|
706 |
-
#: subscribe2.php:
|
707 |
msgid "Viewing Settings Now"
|
708 |
msgstr ""
|
709 |
|
710 |
-
#: subscribe2.php:
|
711 |
msgid "View Settings"
|
712 |
msgstr ""
|
713 |
|
714 |
-
#: subscribe2.php:
|
715 |
msgid "Subscribe to new blogs"
|
716 |
msgstr ""
|
717 |
|
718 |
-
#: subscribe2.php:
|
719 |
msgid "Send an email to subscribers"
|
720 |
msgstr ""
|
721 |
|
722 |
-
#: subscribe2.php:
|
723 |
msgid "A message from"
|
724 |
msgstr ""
|
725 |
|
726 |
-
#: subscribe2.php:
|
727 |
msgid "Subject"
|
728 |
msgstr ""
|
729 |
|
730 |
-
#: subscribe2.php:
|
731 |
msgid "Recipients:"
|
732 |
msgstr ""
|
733 |
|
734 |
-
#: subscribe2.php:
|
735 |
msgid "Preview"
|
736 |
msgstr ""
|
737 |
|
738 |
-
#: subscribe2.php:
|
739 |
msgid "Send"
|
740 |
msgstr ""
|
741 |
|
742 |
-
#: subscribe2.php:
|
743 |
msgid "All Users and Subscribers"
|
744 |
msgstr ""
|
745 |
|
746 |
-
#: subscribe2.php:
|
747 |
msgid "Public Subscribers"
|
748 |
msgstr ""
|
749 |
|
750 |
-
#: subscribe2.php:
|
751 |
msgid "Confirmed"
|
752 |
msgstr ""
|
753 |
|
754 |
-
#: subscribe2.php:
|
755 |
msgid "Unconfirmed"
|
756 |
msgstr ""
|
757 |
|
758 |
-
#: subscribe2.php:
|
759 |
msgid "All Registered Users"
|
760 |
msgstr ""
|
761 |
|
762 |
-
#: subscribe2.php:
|
763 |
msgid "Registered Subscribers"
|
764 |
msgstr ""
|
765 |
|
766 |
-
#: subscribe2.php:
|
767 |
msgid "For each Post"
|
768 |
msgstr ""
|
769 |
|
770 |
-
#: subscribe2.php:
|
771 |
msgid "Send Digest Notification at"
|
772 |
msgstr ""
|
773 |
|
774 |
-
#: subscribe2.php:
|
775 |
msgid ""
|
776 |
"This option will be ignored if the time selected is not in the future in "
|
777 |
"relation to the current time"
|
778 |
msgstr ""
|
779 |
|
780 |
-
#: subscribe2.php:
|
781 |
msgid "Current UTC time is"
|
782 |
msgstr ""
|
783 |
|
784 |
-
#: subscribe2.php:
|
785 |
msgid "Current blog time is"
|
786 |
msgstr ""
|
787 |
|
788 |
-
#: subscribe2.php:
|
789 |
msgid "Next email notification will be sent when your blog time is after"
|
790 |
msgstr ""
|
791 |
|
792 |
-
#: subscribe2.php:
|
793 |
msgid "Attempt to resend the last Digest Notification email"
|
794 |
msgstr ""
|
795 |
|
796 |
-
#: subscribe2.php:
|
797 |
msgid "Resend Digest"
|
798 |
msgstr ""
|
799 |
|
800 |
-
#: subscribe2.php:
|
801 |
msgid "Confirmed Public Subscriber"
|
802 |
msgstr ""
|
803 |
|
804 |
-
#: subscribe2.php:
|
805 |
msgid "Unconfirmed Public Subscriber"
|
806 |
msgstr ""
|
807 |
|
808 |
-
#: subscribe2.php:
|
809 |
msgid "Settings"
|
810 |
msgstr ""
|
811 |
|
812 |
-
#: subscribe2.php:
|
813 |
msgid "Donate"
|
814 |
msgstr ""
|
815 |
|
816 |
-
#: subscribe2.php:
|
817 |
msgid "Check here to Subscribe to email notifications for new posts"
|
818 |
msgstr ""
|
819 |
|
820 |
-
#: subscribe2.php:
|
821 |
msgid ""
|
822 |
"By registering with this blog you are also agreeing to receive email "
|
823 |
"notifications for new posts but you can unsubscribe at anytime"
|
824 |
msgstr ""
|
825 |
|
826 |
-
#: subscribe2.php:
|
827 |
msgid "Subscribe2 Notification Override"
|
828 |
msgstr ""
|
829 |
|
830 |
-
#: subscribe2.php:
|
831 |
msgid ""
|
832 |
"Check here to disable sending of an email notification for this post/page"
|
833 |
msgstr ""
|
834 |
|
835 |
-
#: subscribe2.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
836 |
msgid "Subscription Confirmation"
|
837 |
msgstr ""
|
838 |
|
839 |
-
#: subscribe2.php:
|
840 |
msgid "[Un]Subscribe to Posts"
|
841 |
msgstr ""
|
842 |
|
843 |
-
#: subscribe2.php:
|
844 |
msgid "Weekly"
|
845 |
msgstr ""
|
846 |
|
847 |
-
#: subscribe2.php:
|
848 |
msgid "Author"
|
849 |
msgstr ""
|
850 |
|
851 |
-
#: subscribe2.php:
|
852 |
msgid "Posted on"
|
853 |
msgstr ""
|
854 |
|
855 |
-
#: subscribe2.php:
|
856 |
msgid "Posted in"
|
857 |
msgstr ""
|
858 |
|
859 |
-
#: subscribe2.php:
|
860 |
msgid "Tagged as"
|
861 |
msgstr ""
|
862 |
|
863 |
-
#: subscribe2.php:
|
864 |
msgid "Digest Email"
|
865 |
msgstr ""
|
866 |
|
@@ -925,22 +926,38 @@ msgstr ""
|
|
925 |
msgid "Subscribe2 Widget"
|
926 |
msgstr ""
|
927 |
|
928 |
-
#: include/widget.php:
|
929 |
msgid "Title"
|
930 |
msgstr ""
|
931 |
|
932 |
-
#: include/widget.php:
|
933 |
msgid "Div class name"
|
934 |
msgstr ""
|
935 |
|
936 |
-
#: include/widget.php:
|
937 |
msgid "Pre-Content"
|
938 |
msgstr ""
|
939 |
|
940 |
-
#: include/widget.php:
|
941 |
msgid "Post-Content"
|
942 |
msgstr ""
|
943 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
944 |
#: include/counterwidget.php:7
|
945 |
msgid "Subscriber Counter widget for the Subscribe2 plugin"
|
946 |
msgstr ""
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
+
"POT-Creation-Date: 2010-10-31 21:03+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"
|
33 |
msgid "profile"
|
34 |
msgstr ""
|
35 |
|
36 |
+
#: subscribe2.php:70 subscribe2.php:79 subscribe2.php:1707 subscribe2.php:1804
|
37 |
+
#: subscribe2.php:2568 subscribe2.php:3103 subscribe2.php:3106
|
38 |
+
#: include/widget.php:96
|
39 |
msgid "Subscribe"
|
40 |
msgstr ""
|
41 |
|
83 |
"Message failed! Check your settings and check with your hosting provider"
|
84 |
msgstr ""
|
85 |
|
86 |
+
#: subscribe2.php:102
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
msgid "No such email address is registered."
|
88 |
msgstr ""
|
89 |
|
90 |
+
#: subscribe2.php:104
|
91 |
msgid "You have successfully subscribed!"
|
92 |
msgstr ""
|
93 |
|
94 |
+
#: subscribe2.php:106
|
95 |
msgid "You have successfully unsubscribed."
|
96 |
msgstr ""
|
97 |
|
98 |
+
#: subscribe2.php:108
|
99 |
msgid "subscribe"
|
100 |
msgstr ""
|
101 |
|
102 |
+
#: subscribe2.php:110
|
103 |
msgid "unsubscribe"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: subscribe2.php:113
|
107 |
msgid "Options saved!"
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: subscribe2.php:114
|
111 |
msgid "Options reset!"
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: subscribe2.php:122
|
115 |
msgid "Subscribers"
|
116 |
msgstr ""
|
117 |
|
118 |
+
#: subscribe2.php:125
|
119 |
msgid "Subscribe2 Options"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: subscribe2.php:125 subscribe2.php:3329 include/widget.php:17
|
123 |
msgid "Subscribe2"
|
124 |
msgstr ""
|
125 |
|
126 |
+
#: subscribe2.php:130
|
127 |
msgid "Your Subscriptions"
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: subscribe2.php:134
|
131 |
msgid "Mail Subscribers"
|
132 |
msgstr ""
|
133 |
|
134 |
+
#: subscribe2.php:895
|
135 |
+
msgid "New Subscription"
|
136 |
msgstr ""
|
137 |
|
138 |
+
#: subscribe2.php:897
|
139 |
msgid "subscribed to email notifications!"
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: subscribe2.php:923
|
143 |
msgid "New Unsubscription"
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: subscribe2.php:925
|
147 |
msgid "unsubscribed from email notifications!"
|
148 |
msgstr ""
|
149 |
|
150 |
+
#: subscribe2.php:1518
|
151 |
msgid "Address(es) subscribed!"
|
152 |
msgstr ""
|
153 |
|
154 |
+
#: subscribe2.php:1525
|
155 |
msgid "Address(es) unsubscribed!"
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: subscribe2.php:1529
|
159 |
msgid "Some emails were not processed, the following were already subscribed"
|
160 |
msgstr ""
|
161 |
|
162 |
+
#: subscribe2.php:1532
|
163 |
msgid "Some emails were not processed, the following were not in the database"
|
164 |
msgstr ""
|
165 |
|
166 |
+
#: subscribe2.php:1541
|
167 |
msgid "Address(es) deleted!"
|
168 |
msgstr ""
|
169 |
|
170 |
+
#: subscribe2.php:1547 subscribe2.php:1553
|
171 |
msgid "Status changed!"
|
172 |
msgstr ""
|
173 |
|
174 |
+
#: subscribe2.php:1567
|
175 |
msgid "Reminder Email(s) Sent!"
|
176 |
msgstr ""
|
177 |
|
178 |
+
#: subscribe2.php:1570
|
179 |
msgid "Registered Users Subscribed!"
|
180 |
msgstr ""
|
181 |
|
182 |
+
#: subscribe2.php:1573
|
183 |
msgid "Registered Users Unsubscribed!"
|
184 |
msgstr ""
|
185 |
|
186 |
+
#: subscribe2.php:1576
|
187 |
msgid "Format updated for Selected Registered Users!"
|
188 |
msgstr ""
|
189 |
|
190 |
+
#: subscribe2.php:1671
|
191 |
msgid "Previous Page"
|
192 |
msgstr ""
|
193 |
|
194 |
+
#: subscribe2.php:1691
|
195 |
msgid "Next Page"
|
196 |
msgstr ""
|
197 |
|
198 |
+
#: subscribe2.php:1698
|
199 |
msgid "Manage Subscribers"
|
200 |
msgstr ""
|
201 |
|
202 |
+
#: subscribe2.php:1703
|
203 |
msgid "Add/Remove Subscribers"
|
204 |
msgstr ""
|
205 |
|
206 |
+
#: subscribe2.php:1704
|
207 |
msgid "Enter addresses, one per line or comma-separated"
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: subscribe2.php:1708 subscribe2.php:1805 subscribe2.php:2547
|
211 |
+
#: subscribe2.php:3101 subscribe2.php:3106 include/widget.php:96
|
212 |
+
msgid "Unsubscribe"
|
213 |
+
msgstr ""
|
214 |
+
|
215 |
+
#: subscribe2.php:1711
|
216 |
msgid "Current Subscribers"
|
217 |
msgstr ""
|
218 |
|
219 |
+
#: subscribe2.php:1713
|
220 |
msgid "Filter"
|
221 |
msgstr ""
|
222 |
|
223 |
+
#: subscribe2.php:1718
|
224 |
msgid "Search Subscribers"
|
225 |
msgstr ""
|
226 |
|
227 |
+
#: subscribe2.php:1721
|
228 |
msgid "Send Reminder Email"
|
229 |
msgstr ""
|
230 |
|
231 |
+
#: subscribe2.php:1728
|
232 |
msgid "Save Emails to CSV File"
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: subscribe2.php:1734 subscribe2.php:1792
|
236 |
msgid "Process"
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: subscribe2.php:1747 subscribe2.php:1769
|
240 |
msgid "Confirm this email address"
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: subscribe2.php:1749 subscribe2.php:1762
|
244 |
msgid "Unconfirm this email address"
|
245 |
msgstr ""
|
246 |
|
247 |
+
#: subscribe2.php:1751 subscribe2.php:1764 subscribe2.php:1772
|
248 |
msgid "Delete this email address"
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: subscribe2.php:1755 subscribe2.php:2688
|
252 |
msgid "Select / Unselect All"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: subscribe2.php:1779
|
256 |
msgid "edit"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: subscribe2.php:1786
|
260 |
msgid "No matching subscribers found"
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: subscribe2.php:1788
|
264 |
msgid "NONE"
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: subscribe2.php:1800
|
268 |
msgid "Categories"
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: subscribe2.php:1801
|
272 |
msgid ""
|
273 |
"Preferences for Registered Users selected in the filter above can be changed "
|
274 |
"using this section."
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: subscribe2.php:1802
|
278 |
msgid "Consider User Privacy as changes cannot be undone"
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: subscribe2.php:1803
|
282 |
msgid "Action to perform"
|
283 |
msgstr ""
|
284 |
|
285 |
+
#: subscribe2.php:1808
|
286 |
msgid "Bulk Update Categories"
|
287 |
msgstr ""
|
288 |
|
289 |
+
#: subscribe2.php:1810
|
290 |
msgid "Send email as"
|
291 |
msgstr ""
|
292 |
|
293 |
+
#: subscribe2.php:1811 subscribe2.php:2270 subscribe2.php:2419
|
294 |
msgid "HTML - Full"
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: subscribe2.php:1812 subscribe2.php:2275 subscribe2.php:2424
|
298 |
msgid "HTML - Excerpt"
|
299 |
msgstr ""
|
300 |
|
301 |
+
#: subscribe2.php:1813 subscribe2.php:2280 subscribe2.php:2429
|
302 |
msgid "Plain Text - Full"
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: subscribe2.php:1814 subscribe2.php:2285 subscribe2.php:2434
|
306 |
msgid "Plain Text - Excerpt"
|
307 |
msgstr ""
|
308 |
|
309 |
+
#: subscribe2.php:1815
|
310 |
msgid "Bulk Update Format"
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: subscribe2.php:1852
|
314 |
msgid "Preview message(s) sent to logged in user"
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: subscribe2.php:1856
|
318 |
msgid ""
|
319 |
"The Digest Notification email contained no post information. No email was "
|
320 |
"sent"
|
321 |
msgstr ""
|
322 |
|
323 |
+
#: subscribe2.php:1858
|
324 |
msgid "Attempt made to resend the Digest Notification email"
|
325 |
msgstr ""
|
326 |
|
327 |
+
#: subscribe2.php:2003
|
328 |
msgid "Subscribe2 Settings"
|
329 |
msgstr ""
|
330 |
|
331 |
+
#: subscribe2.php:2004
|
332 |
msgid "Plugin Blog"
|
333 |
msgstr ""
|
334 |
|
335 |
+
#: subscribe2.php:2005
|
336 |
msgid "Make a donation via PayPal"
|
337 |
msgstr ""
|
338 |
|
339 |
+
#: subscribe2.php:2016 subscribe2.php:2402
|
340 |
msgid "Notification Settings"
|
341 |
msgstr ""
|
342 |
|
343 |
+
#: subscribe2.php:2017
|
344 |
msgid "Restrict the number of recipients per email to (0 for unlimited)"
|
345 |
msgstr ""
|
346 |
|
347 |
+
#: subscribe2.php:2019 subscribe2.php:2182
|
348 |
msgid "Edit"
|
349 |
msgstr ""
|
350 |
|
351 |
+
#: subscribe2.php:2022 subscribe2.php:2185
|
352 |
msgid "Update"
|
353 |
msgstr ""
|
354 |
|
355 |
+
#: subscribe2.php:2023 subscribe2.php:2186
|
356 |
msgid "Revert"
|
357 |
msgstr ""
|
358 |
|
359 |
+
#: subscribe2.php:2025
|
360 |
msgid "Send Admins notifications for new"
|
361 |
msgstr ""
|
362 |
|
363 |
+
#: subscribe2.php:2030
|
364 |
msgid "Subscriptions"
|
365 |
msgstr ""
|
366 |
|
367 |
+
#: subscribe2.php:2035
|
368 |
msgid "Unsubscriptions"
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: subscribe2.php:2040
|
372 |
msgid "Both"
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: subscribe2.php:2045
|
376 |
msgid "Neither"
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: subscribe2.php:2047
|
380 |
msgid "Include theme CSS stylesheet in HTML notifications"
|
381 |
msgstr ""
|
382 |
|
383 |
+
#: subscribe2.php:2052 subscribe2.php:2064 subscribe2.php:2075
|
384 |
+
#: subscribe2.php:2086 subscribe2.php:2248 subscribe2.php:2259
|
385 |
+
#: subscribe2.php:2291 subscribe2.php:2307 subscribe2.php:2442
|
386 |
+
#: subscribe2.php:2478
|
387 |
msgid "Yes"
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: subscribe2.php:2057 subscribe2.php:2069 subscribe2.php:2080
|
391 |
+
#: subscribe2.php:2091 subscribe2.php:2242 subscribe2.php:2253
|
392 |
+
#: subscribe2.php:2264 subscribe2.php:2296 subscribe2.php:2312
|
393 |
+
#: subscribe2.php:2447 subscribe2.php:2482
|
394 |
msgid "No"
|
395 |
msgstr ""
|
396 |
|
397 |
+
#: subscribe2.php:2059
|
398 |
msgid "Send Emails for Pages"
|
399 |
msgstr ""
|
400 |
|
401 |
+
#: subscribe2.php:2070
|
402 |
msgid "Send Emails for Password Protected Posts"
|
403 |
msgstr ""
|
404 |
|
405 |
+
#: subscribe2.php:2081
|
406 |
msgid "Send Emails for Private Posts"
|
407 |
msgstr ""
|
408 |
|
409 |
+
#: subscribe2.php:2092
|
410 |
msgid "Send Email From"
|
411 |
msgstr ""
|
412 |
|
413 |
+
#: subscribe2.php:2097
|
414 |
msgid "Send Emails"
|
415 |
msgstr ""
|
416 |
|
417 |
+
#: subscribe2.php:2099
|
418 |
msgid "For digest notifications, date order for posts is"
|
419 |
msgstr ""
|
420 |
|
421 |
+
#: subscribe2.php:2104
|
422 |
msgid "Descending"
|
423 |
msgstr ""
|
424 |
|
425 |
+
#: subscribe2.php:2109
|
426 |
msgid "Ascending"
|
427 |
msgstr ""
|
428 |
|
429 |
+
#: subscribe2.php:2113
|
430 |
msgid "Email Templates"
|
431 |
msgstr ""
|
432 |
|
433 |
+
#: subscribe2.php:2117
|
434 |
msgid "New Post email (must not be empty)"
|
435 |
msgstr ""
|
436 |
|
437 |
+
#: subscribe2.php:2118 subscribe2.php:2147 subscribe2.php:2152
|
438 |
msgid "Subject Line"
|
439 |
msgstr ""
|
440 |
|
441 |
+
#: subscribe2.php:2123
|
442 |
msgid "Send Email Preview"
|
443 |
msgstr ""
|
444 |
|
445 |
+
#: subscribe2.php:2124
|
446 |
msgid "Message substitions"
|
447 |
msgstr ""
|
448 |
|
449 |
+
#: subscribe2.php:2128
|
450 |
msgid "the post's title<br />(<i>for per-post emails only</i>)"
|
451 |
msgstr ""
|
452 |
|
453 |
+
#: subscribe2.php:2129
|
454 |
msgid ""
|
455 |
"the excerpt or the entire post<br />(<i>based on the subscriber's "
|
456 |
"preferences</i>)"
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: subscribe2.php:2130
|
460 |
msgid ""
|
461 |
"the excerpt of the post and the time it was posted<br />(<i>for digest "
|
462 |
"emails only</i>)"
|
463 |
msgstr ""
|
464 |
|
465 |
+
#: subscribe2.php:2131
|
466 |
msgid "a list of post titles<br />(<i>for digest emails only</i>)"
|
467 |
msgstr ""
|
468 |
|
469 |
+
#: subscribe2.php:2132
|
470 |
msgid ""
|
471 |
"a list of post titles followed by links to the atricles<br />(<i>for digest "
|
472 |
"emails only</i>)"
|
473 |
msgstr ""
|
474 |
|
475 |
+
#: subscribe2.php:2133
|
476 |
msgid "the post's permalink<br />(<i>for per-post emails only</i>)"
|
477 |
msgstr ""
|
478 |
|
479 |
+
#: subscribe2.php:2134
|
480 |
msgid ""
|
481 |
"the post's permalink after conversion by TinyURL<br />(<i>for per-post "
|
482 |
"emails only</i>)"
|
483 |
msgstr ""
|
484 |
|
485 |
+
#: subscribe2.php:2135
|
486 |
msgid "the date the post was made<br />(<i>for per-post emails only</i>)"
|
487 |
msgstr ""
|
488 |
|
489 |
+
#: subscribe2.php:2136
|
490 |
msgid "the time the post was made<br />(<i>for per-post emails only</i>)"
|
491 |
msgstr ""
|
492 |
|
493 |
+
#: subscribe2.php:2137
|
494 |
msgid "the admin or post author's name"
|
495 |
msgstr ""
|
496 |
|
497 |
+
#: subscribe2.php:2138
|
498 |
msgid "the admin or post author's email"
|
499 |
msgstr ""
|
500 |
|
501 |
+
#: subscribe2.php:2139
|
502 |
msgid "the post author's name"
|
503 |
msgstr ""
|
504 |
|
505 |
+
#: subscribe2.php:2140
|
506 |
msgid ""
|
507 |
"the generated link to confirm a request<br />(<i>only used in the "
|
508 |
"confirmation email template</i>)"
|
509 |
msgstr ""
|
510 |
|
511 |
+
#: subscribe2.php:2141
|
512 |
msgid ""
|
513 |
"Action performed by LINK in confirmation email<br />(<i>only used in the "
|
514 |
"confirmation email template</i>)"
|
515 |
msgstr ""
|
516 |
|
517 |
+
#: subscribe2.php:2142
|
518 |
msgid "the post's assigned categories"
|
519 |
msgstr ""
|
520 |
|
521 |
+
#: subscribe2.php:2143
|
522 |
msgid "the post's assigned Tags"
|
523 |
msgstr ""
|
524 |
|
525 |
+
#: subscribe2.php:2144
|
526 |
msgid ""
|
527 |
"the number of posts included in the digest email<br />(<i>for digest emails "
|
528 |
"only</i>)"
|
529 |
msgstr ""
|
530 |
|
531 |
+
#: subscribe2.php:2146
|
532 |
msgid "Subscribe / Unsubscribe confirmation email"
|
533 |
msgstr ""
|
534 |
|
535 |
+
#: subscribe2.php:2151
|
536 |
msgid "Reminder email to Unconfirmed Subscribers"
|
537 |
msgstr ""
|
538 |
|
539 |
+
#: subscribe2.php:2158
|
540 |
msgid "Excluded Categories"
|
541 |
msgstr ""
|
542 |
|
543 |
+
#: subscribe2.php:2160
|
544 |
msgid ""
|
545 |
"Posts assigned to any Excluded Category do not generate notifications and "
|
546 |
"are not included in digest notifications"
|
547 |
msgstr ""
|
548 |
|
549 |
+
#: subscribe2.php:2167
|
550 |
msgid "Allow registered users to subscribe to excluded categories?"
|
551 |
msgstr ""
|
552 |
|
553 |
+
#: subscribe2.php:2170
|
554 |
msgid "Appearance"
|
555 |
msgstr ""
|
556 |
|
557 |
+
#: subscribe2.php:2174
|
558 |
msgid "Set default Subscribe2 page as ID"
|
559 |
msgstr ""
|
560 |
|
561 |
+
#: subscribe2.php:2180
|
562 |
msgid "Set the number of Subscribers displayed per page"
|
563 |
msgstr ""
|
564 |
|
565 |
+
#: subscribe2.php:2193
|
566 |
msgid "Show a link to your subscription page in \"meta\"?"
|
567 |
msgstr ""
|
568 |
|
569 |
+
#: subscribe2.php:2200
|
570 |
msgid "Show the Subscribe2 button on the Write toolbar?"
|
571 |
msgstr ""
|
572 |
|
573 |
+
#: subscribe2.php:2207
|
574 |
msgid "Enable Subscribe2 Widget?"
|
575 |
msgstr ""
|
576 |
|
577 |
+
#: subscribe2.php:2214
|
578 |
msgid "Enable Subscribe2 Counter Widget?"
|
579 |
msgstr ""
|
580 |
|
581 |
+
#: subscribe2.php:2221
|
582 |
msgid "Disable email notifications is checked by default on authoring pages?"
|
583 |
msgstr ""
|
584 |
|
585 |
+
#: subscribe2.php:2225
|
586 |
msgid "Auto Subscribe"
|
587 |
msgstr ""
|
588 |
|
589 |
+
#: subscribe2.php:2227
|
590 |
msgid "Subscribe new users registering with your blog"
|
591 |
msgstr ""
|
592 |
|
593 |
+
#: subscribe2.php:2232
|
594 |
msgid "Automatically"
|
595 |
msgstr ""
|
596 |
|
597 |
+
#: subscribe2.php:2237
|
598 |
msgid "Display option on Registration Form"
|
599 |
msgstr ""
|
600 |
|
601 |
+
#: subscribe2.php:2243
|
602 |
msgid "Auto-subscribe includes any excluded categories"
|
603 |
msgstr ""
|
604 |
|
605 |
+
#: subscribe2.php:2254
|
606 |
msgid "Registration Form option is checked by default"
|
607 |
msgstr ""
|
608 |
|
609 |
+
#: subscribe2.php:2265
|
610 |
msgid "Auto-subscribe users to receive email as"
|
611 |
msgstr ""
|
612 |
|
613 |
+
#: subscribe2.php:2286
|
614 |
msgid "Registered Users have the option to auto-subscribe to new categories"
|
615 |
msgstr ""
|
616 |
|
617 |
+
#: subscribe2.php:2301
|
618 |
msgid "New categories are immediately excluded"
|
619 |
msgstr ""
|
620 |
|
621 |
+
#: subscribe2.php:2302
|
622 |
msgid ""
|
623 |
"Option for Registered Users to auto-subscribe to new categories is checked "
|
624 |
"by default"
|
625 |
msgstr ""
|
626 |
|
627 |
+
#: subscribe2.php:2316
|
628 |
msgid "Barred Domains"
|
629 |
msgstr ""
|
630 |
|
631 |
+
#: subscribe2.php:2318
|
632 |
msgid ""
|
633 |
"Enter domains to bar from public subscriptions: <br /> (Use a new line for "
|
634 |
"each entry and omit the \"@\" symbol, for example email.com)"
|
635 |
msgstr ""
|
636 |
|
637 |
+
#: subscribe2.php:2323
|
638 |
msgid "Submit"
|
639 |
msgstr ""
|
640 |
|
641 |
+
#: subscribe2.php:2326
|
642 |
msgid "Reset Default"
|
643 |
msgstr ""
|
644 |
|
645 |
+
#: subscribe2.php:2327
|
646 |
msgid ""
|
647 |
"Use this to reset all options to their defaults. This <strong><em>will not</"
|
648 |
"em></strong> modify your list of subscribers."
|
649 |
msgstr ""
|
650 |
|
651 |
+
#: subscribe2.php:2329
|
652 |
msgid "RESET"
|
653 |
msgstr ""
|
654 |
|
655 |
+
#: subscribe2.php:2355
|
656 |
msgid "Subscription preferences updated."
|
657 |
msgstr ""
|
658 |
|
659 |
+
#: subscribe2.php:2405
|
660 |
msgid "Editing Subscribe2 preferences for user"
|
661 |
msgstr ""
|
662 |
|
663 |
+
#: subscribe2.php:2414
|
664 |
msgid "Receive email as"
|
665 |
msgstr ""
|
666 |
|
667 |
+
#: subscribe2.php:2437
|
668 |
msgid "Automatically subscribe me to newly created categories"
|
669 |
msgstr ""
|
670 |
|
671 |
+
#: subscribe2.php:2458
|
672 |
msgid "Unsubscribe me from this blog"
|
673 |
msgstr ""
|
674 |
|
675 |
+
#: subscribe2.php:2462
|
676 |
msgid "Subscribe to all categories"
|
677 |
msgstr ""
|
678 |
|
679 |
+
#: subscribe2.php:2464
|
680 |
msgid "Subscribed Categories on"
|
681 |
msgstr ""
|
682 |
|
683 |
+
#: subscribe2.php:2466
|
684 |
msgid "Subscribed Categories"
|
685 |
msgstr ""
|
686 |
|
687 |
+
#: subscribe2.php:2472
|
688 |
msgid "Receive periodic summaries of new posts?"
|
689 |
msgstr ""
|
690 |
|
691 |
+
#: subscribe2.php:2487
|
692 |
msgid "Update Preferences"
|
693 |
msgstr ""
|
694 |
|
695 |
+
#: subscribe2.php:2536
|
696 |
msgid "Subscribed Blogs"
|
697 |
msgstr ""
|
698 |
|
699 |
+
#: subscribe2.php:2541 subscribe2.php:2562
|
700 |
msgid "Viewing Settings Now"
|
701 |
msgstr ""
|
702 |
|
703 |
+
#: subscribe2.php:2545 subscribe2.php:2566
|
704 |
msgid "View Settings"
|
705 |
msgstr ""
|
706 |
|
707 |
+
#: subscribe2.php:2557
|
708 |
msgid "Subscribe to new blogs"
|
709 |
msgstr ""
|
710 |
|
711 |
+
#: subscribe2.php:2635
|
712 |
msgid "Send an email to subscribers"
|
713 |
msgstr ""
|
714 |
|
715 |
+
#: subscribe2.php:2643
|
716 |
msgid "A message from"
|
717 |
msgstr ""
|
718 |
|
719 |
+
#: subscribe2.php:2645
|
720 |
msgid "Subject"
|
721 |
msgstr ""
|
722 |
|
723 |
+
#: subscribe2.php:2648
|
724 |
msgid "Recipients:"
|
725 |
msgstr ""
|
726 |
|
727 |
+
#: subscribe2.php:2652
|
728 |
msgid "Preview"
|
729 |
msgstr ""
|
730 |
|
731 |
+
#: subscribe2.php:2652
|
732 |
msgid "Send"
|
733 |
msgstr ""
|
734 |
|
735 |
+
#: subscribe2.php:2723
|
736 |
msgid "All Users and Subscribers"
|
737 |
msgstr ""
|
738 |
|
739 |
+
#: subscribe2.php:2724
|
740 |
msgid "Public Subscribers"
|
741 |
msgstr ""
|
742 |
|
743 |
+
#: subscribe2.php:2725
|
744 |
msgid "Confirmed"
|
745 |
msgstr ""
|
746 |
|
747 |
+
#: subscribe2.php:2726
|
748 |
msgid "Unconfirmed"
|
749 |
msgstr ""
|
750 |
|
751 |
+
#: subscribe2.php:2727
|
752 |
msgid "All Registered Users"
|
753 |
msgstr ""
|
754 |
|
755 |
+
#: subscribe2.php:2728
|
756 |
msgid "Registered Subscribers"
|
757 |
msgstr ""
|
758 |
|
759 |
+
#: subscribe2.php:2839
|
760 |
msgid "For each Post"
|
761 |
msgstr ""
|
762 |
|
763 |
+
#: subscribe2.php:2856
|
764 |
msgid "Send Digest Notification at"
|
765 |
msgstr ""
|
766 |
|
767 |
+
#: subscribe2.php:2868
|
768 |
msgid ""
|
769 |
"This option will be ignored if the time selected is not in the future in "
|
770 |
"relation to the current time"
|
771 |
msgstr ""
|
772 |
|
773 |
+
#: subscribe2.php:2871
|
774 |
msgid "Current UTC time is"
|
775 |
msgstr ""
|
776 |
|
777 |
+
#: subscribe2.php:2873
|
778 |
msgid "Current blog time is"
|
779 |
msgstr ""
|
780 |
|
781 |
+
#: subscribe2.php:2875
|
782 |
msgid "Next email notification will be sent when your blog time is after"
|
783 |
msgstr ""
|
784 |
|
785 |
+
#: subscribe2.php:2878
|
786 |
msgid "Attempt to resend the last Digest Notification email"
|
787 |
msgstr ""
|
788 |
|
789 |
+
#: subscribe2.php:2879
|
790 |
msgid "Resend Digest"
|
791 |
msgstr ""
|
792 |
|
793 |
+
#: subscribe2.php:2956
|
794 |
msgid "Confirmed Public Subscriber"
|
795 |
msgstr ""
|
796 |
|
797 |
+
#: subscribe2.php:2958
|
798 |
msgid "Unconfirmed Public Subscriber"
|
799 |
msgstr ""
|
800 |
|
801 |
+
#: subscribe2.php:3009
|
802 |
msgid "Settings"
|
803 |
msgstr ""
|
804 |
|
805 |
+
#: subscribe2.php:3010
|
806 |
msgid "Donate"
|
807 |
msgstr ""
|
808 |
|
809 |
+
#: subscribe2.php:3021
|
810 |
msgid "Check here to Subscribe to email notifications for new posts"
|
811 |
msgstr ""
|
812 |
|
813 |
+
#: subscribe2.php:3030
|
814 |
msgid ""
|
815 |
"By registering with this blog you are also agreeing to receive email "
|
816 |
"notifications for new posts but you can unsubscribe at anytime"
|
817 |
msgstr ""
|
818 |
|
819 |
+
#: subscribe2.php:3050 subscribe2.php:3051
|
820 |
msgid "Subscribe2 Notification Override"
|
821 |
msgstr ""
|
822 |
|
823 |
+
#: subscribe2.php:3061
|
824 |
msgid ""
|
825 |
"Check here to disable sending of an email notification for this post/page"
|
826 |
msgstr ""
|
827 |
|
828 |
+
#: subscribe2.php:3113
|
829 |
+
msgid "Your email:"
|
830 |
+
msgstr ""
|
831 |
+
|
832 |
+
#: subscribe2.php:3113
|
833 |
+
msgid "Enter email address..."
|
834 |
+
msgstr ""
|
835 |
+
|
836 |
+
#: subscribe2.php:3221
|
837 |
msgid "Subscription Confirmation"
|
838 |
msgstr ""
|
839 |
|
840 |
+
#: subscribe2.php:3312
|
841 |
msgid "[Un]Subscribe to Posts"
|
842 |
msgstr ""
|
843 |
|
844 |
+
#: subscribe2.php:3364
|
845 |
msgid "Weekly"
|
846 |
msgstr ""
|
847 |
|
848 |
+
#: subscribe2.php:3478 subscribe2.php:3479
|
849 |
msgid "Author"
|
850 |
msgstr ""
|
851 |
|
852 |
+
#: subscribe2.php:3487
|
853 |
msgid "Posted on"
|
854 |
msgstr ""
|
855 |
|
856 |
+
#: subscribe2.php:3491 subscribe2.php:3492
|
857 |
msgid "Posted in"
|
858 |
msgstr ""
|
859 |
|
860 |
+
#: subscribe2.php:3497 subscribe2.php:3498
|
861 |
msgid "Tagged as"
|
862 |
msgstr ""
|
863 |
|
864 |
+
#: subscribe2.php:3550
|
865 |
msgid "Digest Email"
|
866 |
msgstr ""
|
867 |
|
926 |
msgid "Subscribe2 Widget"
|
927 |
msgstr ""
|
928 |
|
929 |
+
#: include/widget.php:87
|
930 |
msgid "Title"
|
931 |
msgstr ""
|
932 |
|
933 |
+
#: include/widget.php:89
|
934 |
msgid "Div class name"
|
935 |
msgstr ""
|
936 |
|
937 |
+
#: include/widget.php:91
|
938 |
msgid "Pre-Content"
|
939 |
msgstr ""
|
940 |
|
941 |
+
#: include/widget.php:93
|
942 |
msgid "Post-Content"
|
943 |
msgstr ""
|
944 |
|
945 |
+
#: include/widget.php:95
|
946 |
+
msgid "Hide button"
|
947 |
+
msgstr ""
|
948 |
+
|
949 |
+
#: include/widget.php:96
|
950 |
+
msgid "None"
|
951 |
+
msgstr ""
|
952 |
+
|
953 |
+
#: include/widget.php:98
|
954 |
+
msgid "Post form content to page"
|
955 |
+
msgstr ""
|
956 |
+
|
957 |
+
#: include/widget.php:100
|
958 |
+
msgid "Use Subscribe2 Default"
|
959 |
+
msgstr ""
|
960 |
+
|
961 |
#: include/counterwidget.php:7
|
962 |
msgid "Subscriber Counter widget for the Subscribe2 plugin"
|
963 |
msgstr ""
|