Version Description
Download this release
Release Info
Developer | MattyRob |
Plugin | Subscribe2 |
Version | 5.2 |
Comparing to | |
See all releases |
Code changes from version 5.1 to 5.2
- ReadMe.txt +90 -3
- counterwidget.php +1 -1
- subscribe2.php +551 -532
- subscribe2.pot +207 -197
ReadMe.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: MattyRob, Skippy, RavanH
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904
|
4 |
Tags: posts, subscription, email, subscribe, notify, notification
|
5 |
Requires at least: 2.0.x
|
6 |
-
Tested up to: 2.
|
7 |
-
Stable tag: 5.
|
8 |
|
9 |
Sends a list of subscribers an email notification when new posts are published to your blog
|
10 |
|
@@ -40,17 +40,91 @@ This token will automatically be replaced by dynamic subscription information an
|
|
40 |
|
41 |
== Frequently Asked Questions ==
|
42 |
|
|
|
|
|
|
|
|
|
43 |
= Where can I get help? =
|
44 |
So, you've downloaded the plugin an it isn't doing what you expect. First you should read the included documentation. There is a ReadMe.txt file and a PDF startup guide installed with the plugin.
|
45 |
|
46 |
Next you could search in the [Subscribe2 Forum](http://getsatisfaction.com/subscribe2/), the [WordPress forums](http://wordpress.org/support/) or the [Subscribe2 blog FAQs](http://subscribe2.wordpress.com/category/faq/).
|
47 |
|
48 |
-
No joy there? Well, if you can't find an answer to your question you can get [paid support](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904) by donating at least
|
49 |
|
50 |
= Where can I get more information about the plugin features? =
|
51 |
|
52 |
A comprehensive guide that covers many, if not all, of the Subscribe2 features is available to purchase from the [iAssistant](http://the-iassistant.com/subscribe2-guide/)
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
== Screenshots ==
|
55 |
|
56 |
1. The Posts->Mail Subscribers admin page generated by the plugin.
|
@@ -60,6 +134,19 @@ A comprehensive guide that covers many, if not all, of the Subscribe2 features i
|
|
60 |
|
61 |
== Changelog ==
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
= Version 5.1 by Matthew Robinson =
|
64 |
|
65 |
* Add widget options to add custom text before and a after the dynamic Subscribe2 output - thank to Lee Willis
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904
|
4 |
Tags: posts, subscription, email, subscribe, notify, notification
|
5 |
Requires at least: 2.0.x
|
6 |
+
Tested up to: 2.9
|
7 |
+
Stable tag: 5.2
|
8 |
|
9 |
Sends a list of subscribers an email notification when new posts are published to your blog
|
10 |
|
40 |
|
41 |
== Frequently Asked Questions ==
|
42 |
|
43 |
+
= I want HTML email to be the default email type =
|
44 |
+
|
45 |
+
You need to pay for the [Subscribe2 HTML version](http://wpplugins.com/plugin/46/subscribe2-html).
|
46 |
+
|
47 |
= Where can I get help? =
|
48 |
So, you've downloaded the plugin an it isn't doing what you expect. First you should read the included documentation. There is a ReadMe.txt file and a PDF startup guide installed with the plugin.
|
49 |
|
50 |
Next you could search in the [Subscribe2 Forum](http://getsatisfaction.com/subscribe2/), the [WordPress forums](http://wordpress.org/support/) or the [Subscribe2 blog FAQs](http://subscribe2.wordpress.com/category/faq/).
|
51 |
|
52 |
+
No joy there? Well, if you can't find an answer to your question you can get [paid support](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904) by donating at least 20 UK pounds to the plugin author.
|
53 |
|
54 |
= Where can I get more information about the plugin features? =
|
55 |
|
56 |
A comprehensive guide that covers many, if not all, of the Subscribe2 features is available to purchase from the [iAssistant](http://the-iassistant.com/subscribe2-guide/)
|
57 |
|
58 |
+
= Some or all email notifications fail to send, why? =
|
59 |
+
In the first instance ***check this with your hosting provider***, they have access to your server logs and will be able to tell you where and why emails are being blocked.
|
60 |
+
|
61 |
+
Some hosting providers place a restriction on the maximum number of recipients in any one email message. Some hosts simply block all emails on certain low-cost hosting plans.
|
62 |
+
|
63 |
+
Subscribe2 provides a facility to work around this restriction by sending batches of emails. To enable this feature, go to Settings->Subscribe2 and located the setting to restrict the number of recipients per email. If this is set to 30 then each outgoing email notification will only contain addresses for 30 recipients.
|
64 |
+
|
65 |
+
Reminder: because subscribe2 places all recipients in BCC fields, and places the blog admin in the TO field, the blog admin will receive one email per batched delivery. So if you have 90 subscribers, the blog admin should receive three post notification emails, one for each set of 30 BCC recipients.
|
66 |
+
|
67 |
+
Batches will occur for each group of message as described above. A site on Dreamhost with many public and registered subscribers could conceivably generate a lot of email for your own inbox.
|
68 |
+
|
69 |
+
= My host has a limit of X emails per hour / day, can I limit the way Subscribe2 sends emails? =
|
70 |
+
|
71 |
+
This is more commonly called 'throttling' or 'choking'. PHP is a scripting language and while it is technically possible to throttle emails using script it is not very efficient. It is much better in terms of speed and server overhead (CPU cycles and RAM) to throttle using a server side application.
|
72 |
+
|
73 |
+
So, Subscribe2 does not and never will offer a throtting option. To solve the problem speak to your hosting provider about changing the restrictions, move to a less restriction hosting package or change hosting providers. Alternatively, there may be another WordPress plugin that can provide this functionality.
|
74 |
+
|
75 |
+
= Why is my admin address getting emails from Subscribe2? =
|
76 |
+
|
77 |
+
This plugin sends emails to your subscribers using the BCC (Blind Cardon Copy) header in email messages. Each email is sent TO: the admin address. There may be emails for a plain text excerpt notification, palin text full text and HTML format emails and additionally if the BCCLIMIT has been set due to hosting restrictions duplicate copies of these emails will be sent to the admin address.
|
78 |
+
|
79 |
+
= I can't find my subscribers / the options / something else =
|
80 |
+
|
81 |
+
Subscribe2 creates four (4) new admin menus in the back end of WordPress.
|
82 |
+
|
83 |
+
* Posts -> Mail Subscribers : Allows users with Publish capabilities to send emails to your current subscribers
|
84 |
+
* Tools -> Subscribers : Allows you to manually (un)subscribe users by email address, displays lists of currently subscribed users and allows you to bulk subscribe Registered Users
|
85 |
+
* Users -> Subscriptions : Allows the currently logged in user to manage their own subscriptions
|
86 |
+
* Settings -> Subscribe2 : Allows administrator level users to control many aspects of the plugins operation. It should be pretty self explanatory from the notes on the screen
|
87 |
+
|
88 |
+
= I'm confused, what are all the different types of subscriber? =
|
89 |
+
|
90 |
+
There are basically only 2 types of subscriber. Public Subscribers and Registered Subscribers.
|
91 |
+
|
92 |
+
Public subscribers have provided their email address for email notification of your new posts. When they enter there address on your site they are sent an email asking them to confirm their request and added to a list of Unconfirmed Subscribers. Once they complete their request by clicking on the link in their email they will become Confirmed Subscribers.
|
93 |
+
|
94 |
+
Registered Users have registered with your WorPress blog (provided you have enabled this in the core WordPress settings). Once registered they can choose to subscribe to specific categories and can also control the type of email they get by choosing plain text in an excerpt or full post format or a full post format with HTML.
|
95 |
+
|
96 |
+
= Can I put the form elsewhere? (header, footer, sidebar without the widget) =
|
97 |
+
|
98 |
+
The simple answer is yes you can but this is not supported so you need to figure out any problems that are caused by doing this on your own. Read <a href="http://subscribe2.wordpress.com/2006/09/19/sidebar-without-a-widget/">here</a> for the basic approach.
|
99 |
+
|
100 |
+
= I'd like to be able to collect more information from users when they subscribe, can I? =
|
101 |
+
|
102 |
+
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.
|
103 |
+
|
104 |
+
= I can't find or insert the Subscribe2 token, help! =
|
105 |
+
|
106 |
+
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-->.
|
107 |
+
|
108 |
+
= Can I suggest you add X as a feature =
|
109 |
+
|
110 |
+
I'm open to suggestions but since the software is written by me for use on my site and then shared for free because others may find it useful as it comes don't expect your suggestion to be implemented unless I'll find it useful.
|
111 |
+
|
112 |
+
= I'd like to be able to send my subscribers notifications in HTML =
|
113 |
+
|
114 |
+
By default Public Subscribers get plain text emails and only Registered Subscribers can opt to receive email in HTML format. If you really want HTML for all you need to pay for the upgrade. $40US will get you the amended code and updates for 1 year.
|
115 |
+
|
116 |
+
= Which version should I be using, I'm on WordPress x.x.x? =
|
117 |
+
WordPress 2.3 and up require Subscribe2 from the 4.x stable branch. The most recent version is hosted via [Wordpress.org](http://wordpress.org/extend/plugins/subscribe2/).
|
118 |
+
|
119 |
+
WordPress 2.1.x and 2.2.x require Subscribe2 from the 3.x stable. The most recent version is [3.8](http://downloads.wordpress.org/plugin/subscribe2.3.8.zip).
|
120 |
+
|
121 |
+
WordPress 2.0.x requires Subscribe2 from the 2.x stable branch. The most recent version is [2.22](http://downloads.wordpress.org/plugin/subscribe2.2.22.zip).
|
122 |
+
|
123 |
+
= Why doesn't the form appear in my WordPress page? =
|
124 |
+
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.
|
125 |
+
|
126 |
+
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.
|
127 |
+
|
128 |
== Screenshots ==
|
129 |
|
130 |
1. The Posts->Mail Subscribers admin page generated by the plugin.
|
134 |
|
135 |
== Changelog ==
|
136 |
|
137 |
+
= Version 5.2 by Matthew Robinson =
|
138 |
+
|
139 |
+
* Added screen_icon() to each Subscribe2 admin page
|
140 |
+
* Improved addition of links to the Plugins admin page
|
141 |
+
* Improved XHTML validity of admin pages
|
142 |
+
* Improved display of category hierarchy display in the category form
|
143 |
+
* Added ability to use TAGS & CATS keywords in digest mails (position is static irrespective of keyword location)
|
144 |
+
* Use PHP variable for Subscribe2 folder to allow for easier renaming (if needed)
|
145 |
+
* Fixed a bug in TinyURL encoding introduced when links were click enabled
|
146 |
+
* Removed BurnURL from the plugin as it appears to be no longer operational
|
147 |
+
* Added urlencode to email addresses in Tools->Subscribers when editing other user preferences
|
148 |
+
* Restored several FAQs to the ReadMe file and the [WordPress.org FAQ section](http://wordpress.org/extend/plugins/subscribe2/faq/)
|
149 |
+
|
150 |
= Version 5.1 by Matthew Robinson =
|
151 |
|
152 |
* Add widget options to add custom text before and a after the dynamic Subscribe2 output - thank to Lee Willis
|
counterwidget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Subscribe2 Counter Widget
|
4 |
Plugin URI: http://subscribe2.wordpress.com
|
5 |
Description: Adds a sidebar widget to easily customize and display your Subscribe2 subscribers stats.
|
6 |
-
Version: 5.
|
7 |
Author: Matthew Robinson
|
8 |
Author URI: http://subscribe2.wordpress.com
|
9 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904
|
3 |
Plugin Name: Subscribe2 Counter Widget
|
4 |
Plugin URI: http://subscribe2.wordpress.com
|
5 |
Description: Adds a sidebar widget to easily customize and display your Subscribe2 subscribers stats.
|
6 |
+
Version: 5.2
|
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
|
subscribe2.php
CHANGED
@@ -2,8 +2,8 @@
|
|
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: 5.
|
7 |
Author: Matthew Robinson
|
8 |
Author URI: http://subscribe2.wordpress.com
|
9 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904
|
@@ -23,35 +23,36 @@ the Free Software Foundation, either version 3 of the License, or
|
|
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.
|
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.
|
31 |
*/
|
32 |
|
33 |
// our version number. Don't touch this or any line below
|
34 |
// unless you know exacly what you are doing
|
35 |
-
define('S2VERSION', '5.
|
36 |
-
define('S2PATH', trailingslashit(dirname(__FILE__)));
|
|
|
37 |
|
38 |
// Set minimum execution time to 5 minutes - won't affect safe mode
|
39 |
$safe_mode = array('On', 'ON', 'on', 1);
|
40 |
-
if (
|
41 |
@ini_set('max_execution_time', 300);
|
42 |
}
|
43 |
|
44 |
// Pre-2.6 compatibility
|
45 |
-
if (!defined('WP_CONTENT_URL')) {
|
46 |
-
define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
|
47 |
}
|
48 |
-
if (!defined('WP_CONTENT_DIR')) {
|
49 |
-
define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
|
50 |
}
|
51 |
|
52 |
/* Include buttonsnap library by Owen Winckler */
|
53 |
-
if (!class_exists('buttonsnap')) {
|
54 |
-
require(WP_CONTENT_DIR . '/plugins/
|
55 |
}
|
56 |
|
57 |
$mysubscribe2 = new s2class;
|
@@ -112,19 +113,19 @@ class s2class {
|
|
112 |
Hook the menu
|
113 |
*/
|
114 |
function admin_menu() {
|
115 |
-
$s2management = add_management_page(__('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), "
|
116 |
add_action("admin_print_scripts-$s2management", array(&$this, 'checkbox_form_js'));
|
117 |
|
118 |
-
$s2options = add_options_page(__('Subscribe2 Options', 'subscribe2'), __('Subscribe2', 'subscribe2'), "
|
119 |
add_action("admin_print_scripts-$s2options", array(&$this, 'checkbox_form_js'));
|
120 |
add_action("admin_print_scripts-$s2options", array(&$this, 'option_form_js'));
|
121 |
-
add_filter('
|
122 |
|
123 |
-
$s2user = add_users_page(__('Subscriptions', 'subscribe2'), __('Subscriptions', 'subscribe2'), "
|
124 |
add_action("admin_print_scripts-$s2user", array(&$this, 'checkbox_form_js'));
|
125 |
add_action("admin_print_styles-$s2user", array(&$this, 'user_admin_css'));
|
126 |
|
127 |
-
add_submenu_page('post-new.php', __('Mail Subscribers', 'subscribe2'), __('Mail Subscribers', 'subscribe2'), "
|
128 |
|
129 |
$s2nonce = md5('subscribe2');
|
130 |
} // end admin_menu()
|
@@ -133,22 +134,22 @@ class s2class {
|
|
133 |
Hook for Admin Drop Down Icons
|
134 |
*/
|
135 |
function ozh_s2_icon() {
|
136 |
-
return WP_CONTENT_URL . '/plugins/
|
137 |
} // end ozh_s2_icon()
|
138 |
|
139 |
/**
|
140 |
Insert Javascript into admin_header
|
141 |
*/
|
142 |
function checkbox_form_js() {
|
143 |
-
wp_enqueue_script('s2_checkbox', WP_CONTENT_URL . '/plugins/' .
|
144 |
} //end checkbox_form_js()
|
145 |
|
146 |
function user_admin_css() {
|
147 |
-
wp_enqueue_style('s2_user_admin', WP_CONTENT_URL . '/plugins/ '.
|
148 |
}
|
149 |
|
150 |
function option_form_js() {
|
151 |
-
wp_enqueue_script('s2_edit', WP_CONTENT_URL . '/plugins/' .
|
152 |
} // end option_form_js()
|
153 |
|
154 |
/* ===== Install, upgrade, reset ===== */
|
@@ -157,7 +158,7 @@ class s2class {
|
|
157 |
*/
|
158 |
function install() {
|
159 |
// include upgrade-functions for maybe_create_table;
|
160 |
-
if (!function_exists('maybe_create_table')) {
|
161 |
require_once(ABSPATH . 'wp-admin/install-helper.php');
|
162 |
}
|
163 |
$date = date('Y-m-d');
|
@@ -180,7 +181,7 @@ class s2class {
|
|
180 |
function upgrade() {
|
181 |
global $wpdb, $wp_version, $wpmu_version;
|
182 |
// include upgrade-functions for maybe_create_table;
|
183 |
-
if (!function_exists('maybe_create_table')) {
|
184 |
require_once(ABSPATH . 'wp-admin/install-helper.php');
|
185 |
}
|
186 |
$date = date('Y-m-d');
|
@@ -190,16 +191,16 @@ class s2class {
|
|
190 |
// let's take the time to check process registered users
|
191 |
// existing public subscribers are subscribed to all categories
|
192 |
$users = $this->get_all_registered('ID');
|
193 |
-
if (!empty($users)) {
|
194 |
-
foreach ($users as $user) {
|
195 |
$this->register($user);
|
196 |
}
|
197 |
}
|
198 |
// update the options table to serialized format
|
199 |
$old_options = $wpdb->get_col("SELECT option_name from $wpdb->options where option_name LIKE 's2%' AND option_name != 's2_future_posts'");
|
200 |
|
201 |
-
if (!empty($old_options)) {
|
202 |
-
foreach ($old_options as $option) {
|
203 |
$value = get_option($option);
|
204 |
$option_array = substr($option, 3);
|
205 |
$this->subscribe2_options[$option_array] = $value;
|
@@ -212,27 +213,27 @@ class s2class {
|
|
212 |
update_option('subscribe2_options', $this->subscribe2_options);
|
213 |
|
214 |
// upgrade old wpmu user meta data to new
|
215 |
-
if (
|
216 |
$this->namechange_subscribe2_widget();
|
217 |
// loop through all users
|
218 |
-
foreach ($users as $user) {
|
219 |
// get categories which the user is subscribed to (old ones)
|
220 |
$categories = get_usermeta($user, 's2_subscribed');
|
221 |
$categories = explode(',', $categories);
|
222 |
|
223 |
// load blogs of user (only if we need them)
|
224 |
$blogs = array();
|
225 |
-
if (count($categories) > 0 && !in_array('-1', $categories)) {
|
226 |
$blogs = get_blogs_of_user($user, true);
|
227 |
}
|
228 |
|
229 |
-
foreach ($blogs as $blog_id => $blog) {
|
230 |
switch_to_blog($blog_id);
|
231 |
|
232 |
$blog_categories = (array)$wpdb->get_col("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category'");
|
233 |
$subscribed_categories = array_intersect($categories, $blog_categories);
|
234 |
-
if (!empty($subscribed_categories)) {
|
235 |
-
foreach ($subscribed_categories as $subscribed_category) {
|
236 |
update_usermeta($user, $this->get_usermeta_keyname('s2_cat') . $subscribed_category, $subscribed_category);
|
237 |
}
|
238 |
update_usermeta($user, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $subscribed_categories));
|
@@ -242,7 +243,7 @@ class s2class {
|
|
242 |
|
243 |
// delete old user meta keys
|
244 |
delete_usermeta($user, 's2_subscribed');
|
245 |
-
foreach ($categories as $cat) {
|
246 |
delete_usermeta($user, 's2_cat' . $cat);
|
247 |
}
|
248 |
}
|
@@ -265,29 +266,23 @@ class s2class {
|
|
265 |
Performs string substitutions for subscribe2 mail texts
|
266 |
*/
|
267 |
function substitute($string = '') {
|
268 |
-
if ('' == $string) {
|
269 |
return;
|
270 |
}
|
271 |
$string = str_replace("BLOGNAME", get_option('blogname'), $string);
|
272 |
$string = str_replace("BLOGLINK", get_bloginfo('url'), $string);
|
273 |
$string = str_replace("TITLE", stripslashes($this->post_title), $string);
|
274 |
-
$
|
275 |
-
|
|
|
276 |
$tinylink = file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode($this->permalink));
|
277 |
-
if (
|
278 |
-
$
|
|
|
279 |
} else {
|
280 |
-
$string = str_replace("TINYLINK", $
|
281 |
}
|
282 |
}
|
283 |
-
if (strstr($string, "BURNLINK")) {
|
284 |
-
$burnlink = file_get_contents('http://burnurl.com/?url=' . urlencode($this->permalink) . '&output=plain');
|
285 |
-
if ( ($burnlink !== 'error') || ($burnlink != false) ) {
|
286 |
-
$string = str_replace("BURNLINK", $burnlink, $string);
|
287 |
-
} else {
|
288 |
-
$string = str_replace("BURNLINK", $this->permalink, $string);
|
289 |
-
}
|
290 |
-
}
|
291 |
$string = str_replace("MYNAME", stripslashes($this->myname), $string);
|
292 |
$string = str_replace("EMAIL", $this->myemail, $string);
|
293 |
$string = str_replace("AUTHORNAME", $this->authorname, $string);
|
@@ -301,11 +296,11 @@ class s2class {
|
|
301 |
Delivers email to recipients in HTML or plaintext
|
302 |
*/
|
303 |
function mail($recipients = array(), $subject = '', $message = '', $type='text') {
|
304 |
-
if (
|
305 |
|
306 |
-
if ('html' == $type) {
|
307 |
$headers = $this->headers('html');
|
308 |
-
if ('yes' == $this->subscribe2_options['stylesheet']) {
|
309 |
$mailtext = apply_filters('s2_html_email', "<html><head><title>" . $subject . "</title><link rel=\"stylesheet\" href=\"" . get_bloginfo('stylesheet_url') . "\" type=\"text/css\" media=\"screen\" /></head><body>" . $message . "</body></html>");
|
310 |
} else {
|
311 |
$mailtext = apply_filters('s2_html_email', "<html><head><title>" . $subject . "</title></head><body>" . $message . "</body></html>");
|
@@ -324,28 +319,27 @@ class s2class {
|
|
324 |
// Construct BCC headers for sending or send individual emails
|
325 |
$bcc = '';
|
326 |
natcasesort($recipients);
|
327 |
-
if (
|
328 |
// BCCLimit is 1 so send individual emails
|
329 |
-
foreach ($recipients as $recipient) {
|
330 |
$recipient = trim($recipient);
|
331 |
// sanity check -- make sure we have a valid email
|
332 |
-
if (!is_email($recipient)) { continue; }
|
333 |
-
if (function_exists('wpmq_mail')) {
|
334 |
@wp_mail($recipient, $subject, $mailtext, $headers, NULL, 0);
|
335 |
} else {
|
336 |
@wp_mail($recipient, $subject, $mailtext, $headers);
|
337 |
}
|
338 |
}
|
339 |
-
|
340 |
-
|
341 |
-
} elseif ($this->subscribe2_options['bcclimit'] == 0) {
|
342 |
// we're not using BCCLimit
|
343 |
-
foreach ($recipients as $recipient) {
|
344 |
$recipient = trim($recipient);
|
345 |
// sanity check -- make sure we have a valid email
|
346 |
-
if (!is_email($recipient)) { continue; }
|
347 |
// and NOT the sender's email, since they'll get a copy anyway
|
348 |
-
if (
|
349 |
('' == $bcc) ? $bcc = "Bcc: $recipient" : $bcc .= ", $recipient";
|
350 |
// Bcc Headers now constructed by phpmailer class
|
351 |
}
|
@@ -355,16 +349,16 @@ class s2class {
|
|
355 |
// we're using BCCLimit
|
356 |
$count = 1;
|
357 |
$batch = array();
|
358 |
-
foreach ($recipients as $recipient) {
|
359 |
$recipient = trim($recipient);
|
360 |
// sanity check -- make sure we have a valid email
|
361 |
-
if (!is_email($recipient)) { continue; }
|
362 |
// and NOT the sender's email, since they'll get a copy anyway
|
363 |
-
if (
|
364 |
('' == $bcc) ? $bcc = "Bcc: $recipient" : $bcc .= ", $recipient";
|
365 |
// Bcc Headers now constructed by phpmailer class
|
366 |
}
|
367 |
-
if ($this->subscribe2_options['bcclimit'] == $count) {
|
368 |
$count = 0;
|
369 |
$batch[] = $bcc;
|
370 |
$bcc = '';
|
@@ -372,7 +366,7 @@ class s2class {
|
|
372 |
$count++;
|
373 |
}
|
374 |
// add any partially completed batches to our batch array
|
375 |
-
if ('' != $bcc) {
|
376 |
$batch[] = $bcc;
|
377 |
}
|
378 |
}
|
@@ -380,8 +374,8 @@ class s2class {
|
|
380 |
reset($recipients);
|
381 |
|
382 |
// actually send mail
|
383 |
-
if (
|
384 |
-
foreach ($batch as $bcc) {
|
385 |
$newheaders = $headers . "$bcc\r\n";
|
386 |
$status = @wp_mail($this->myemail, $subject, $mailtext, $newheaders);
|
387 |
}
|
@@ -396,7 +390,7 @@ class s2class {
|
|
396 |
Construct standard set of email headers
|
397 |
*/
|
398 |
function headers($type='text') {
|
399 |
-
if (
|
400 |
$admin = $this->get_userdata($this->subscribe2_options['sender']);
|
401 |
$this->myname = html_entity_decode($admin->display_name, ENT_QUOTES);
|
402 |
$this->myemail = $admin->user_email;
|
@@ -408,7 +402,7 @@ class s2class {
|
|
408 |
$headers .= "Precedence: list\nList-Id: " . get_option('blogname') . "\n";
|
409 |
$headers .= "MIME-Version: 1.0\n";
|
410 |
$headers .= "X-Mailer: PHP" . phpversion() . "\n";
|
411 |
-
if ($type == 'html') {
|
412 |
// To send HTML mail, the Content-Type header must be set
|
413 |
$headers .= "Content-Type: " . get_bloginfo('html_type') . "; charset=\"". get_bloginfo('charset') . "\"\n";
|
414 |
} else {
|
@@ -422,30 +416,30 @@ class s2class {
|
|
422 |
Sends an email notification of a new post
|
423 |
*/
|
424 |
function publish($post = 0, $preview = '') {
|
425 |
-
if (!$post) { return $post; }
|
426 |
|
427 |
-
if ($preview == '') {
|
428 |
// we aren't sending a Preview to the current user so carry out checks
|
429 |
$s2mail = get_post_meta($post->ID, 's2mail', true);
|
430 |
-
if ( (isset($_POST['s2_meta_field']) &&
|
431 |
|
432 |
// are we doing daily digests? If so, don't send anything now
|
433 |
-
if ($this->subscribe2_options['email_freq'] != 'never') { return $post; }
|
434 |
|
435 |
// is the current post a page
|
436 |
// and should this not generate a notification email?
|
437 |
-
if (
|
438 |
return $post;
|
439 |
}
|
440 |
|
441 |
// is this post set in the future?
|
442 |
-
if ($post->post_date > current_time('mysql')) {
|
443 |
// bail out
|
444 |
return $post;
|
445 |
}
|
446 |
|
447 |
//Are we sending notifications for password protected posts?
|
448 |
-
if (
|
449 |
return $post;
|
450 |
}
|
451 |
|
@@ -453,16 +447,16 @@ class s2class {
|
|
453 |
$check = false;
|
454 |
// is the current post assigned to any categories
|
455 |
// which should not generate a notification email?
|
456 |
-
foreach (explode(',', $this->subscribe2_options['exclude']) as $cat) {
|
457 |
-
if (in_array($cat, $post_cats)) {
|
458 |
$check = true;
|
459 |
}
|
460 |
}
|
461 |
|
462 |
-
if ($check) {
|
463 |
// hang on -- can registered users subscribe to
|
464 |
// excluded categories?
|
465 |
-
if ('0' == $this->subscribe2_options['reg_override']) {
|
466 |
// nope? okay, let's leave
|
467 |
return $post;
|
468 |
}
|
@@ -470,13 +464,13 @@ class s2class {
|
|
470 |
|
471 |
// Are we sending notifications for Private posts?
|
472 |
// Action is added if we are, but double check option and post status
|
473 |
-
if (
|
474 |
// don't send notification to public users
|
475 |
$check = true;
|
476 |
}
|
477 |
|
478 |
// lets collect our subscribers
|
479 |
-
if (!$check) {
|
480 |
// if this post is assigned to an excluded
|
481 |
// category, or is a private post then
|
482 |
// don't send public subscribers a notification
|
@@ -486,7 +480,7 @@ class s2class {
|
|
486 |
$registered = $this->get_registered("cats=$post_cats_string");
|
487 |
|
488 |
// do we have subscribers?
|
489 |
-
if (
|
490 |
// if not, no sense doing anything else
|
491 |
return $post;
|
492 |
}
|
@@ -495,13 +489,13 @@ class s2class {
|
|
495 |
// we set these class variables so that we can avoid
|
496 |
// passing them in function calls a little later
|
497 |
$this->post_title = "<a href=\"" . get_permalink($post->ID) . "\">" . $post->post_title . "</a>";
|
498 |
-
$this->permalink =
|
499 |
|
500 |
$author = get_userdata($post->post_author);
|
501 |
$this->authorname = $author->display_name;
|
502 |
|
503 |
// do we send as admin, or post author?
|
504 |
-
if ('author' == $this->subscribe2_options['sender']) {
|
505 |
// get author details
|
506 |
$user = &$author;
|
507 |
} else {
|
@@ -521,7 +515,7 @@ class s2class {
|
|
521 |
$mailtext = stripslashes($this->substitute($mailtext));
|
522 |
|
523 |
$plaintext = $post->post_content;
|
524 |
-
if (function_exists('strip_shortcodes')) {
|
525 |
$plaintext = strip_shortcodes($plaintext);
|
526 |
}
|
527 |
$gallid = '[gallery id="' . $post->ID . '"]';
|
@@ -529,9 +523,9 @@ class s2class {
|
|
529 |
$content = apply_filters('the_content', $post->post_content);
|
530 |
$content = str_replace("]]>", "]]>", $content);
|
531 |
$excerpt = $post->post_excerpt;
|
532 |
-
if ('' == $excerpt) {
|
533 |
// no excerpt, is there a <!--more--> ?
|
534 |
-
if (false !== strpos($plaintext, '<!--more-->')) {
|
535 |
list($excerpt, $more) = explode('<!--more-->', $plaintext, 2);
|
536 |
// strip leading and trailing whitespace
|
537 |
$excerpt = strip_tags($excerpt);
|
@@ -554,7 +548,7 @@ class s2class {
|
|
554 |
$html_body = str_replace("\r\n", "<br />\r\n", $mailtext);
|
555 |
$html_body = str_replace("POST", $content, $html_body);
|
556 |
|
557 |
-
if ($preview != '') {
|
558 |
$this->myemail = $preview;
|
559 |
$this->myname = "Preview";
|
560 |
$this->mail(array($preview), $subject, $excerpt_body);
|
@@ -563,9 +557,9 @@ class s2class {
|
|
563 |
} else {
|
564 |
// first we send plaintext summary emails
|
565 |
$registered = $this->get_registered("cats=$post_cats_string&format=excerpt");
|
566 |
-
if (empty($registered)) {
|
567 |
$recipients = (array)$public;
|
568 |
-
} elseif (empty($public)) {
|
569 |
$recipients = (array)$registered;
|
570 |
} else {
|
571 |
$recipients = array_merge((array)$public, (array)$registered);
|
@@ -584,7 +578,7 @@ class s2class {
|
|
584 |
Hook Subscribe2 into posts published via email
|
585 |
*/
|
586 |
function publish_phone($id) {
|
587 |
-
if (!$id) { return; }
|
588 |
|
589 |
$post = get_post($id);
|
590 |
$this->publish($post);
|
@@ -595,12 +589,12 @@ class s2class {
|
|
595 |
Send confirmation email to the user
|
596 |
*/
|
597 |
function send_confirm($what = '', $is_remind = false) {
|
598 |
-
if ($this->filtered == 1) { return true; }
|
599 |
-
if (
|
600 |
return false;
|
601 |
}
|
602 |
$id = $this->get_id($this->email);
|
603 |
-
if (!$id) {
|
604 |
return false;
|
605 |
}
|
606 |
|
@@ -611,9 +605,9 @@ class s2class {
|
|
611 |
//use home instead of siteurl incase index.php is not in core wordpress directory
|
612 |
$link = get_option('home') . "/?s2=";
|
613 |
|
614 |
-
if ('add' == $what) {
|
615 |
$link .= '1';
|
616 |
-
} elseif ('del' == $what) {
|
617 |
$link .= '0';
|
618 |
}
|
619 |
$link .= md5($this->email);
|
@@ -622,15 +616,15 @@ class s2class {
|
|
622 |
// sort the headers now so we have all substitute information
|
623 |
$mailheaders = $this->headers();
|
624 |
|
625 |
-
if ($is_remind == true) {
|
626 |
$body = $this->substitute(stripslashes($this->subscribe2_options['remind_email']));
|
627 |
$subject = $this->substitute(stripslashes($this->subscribe2_options['remind_subject']));
|
628 |
} else {
|
629 |
$body = $this->substitute(stripslashes($this->subscribe2_options['confirm_email']));
|
630 |
-
if ('add' == $what) {
|
631 |
$body = str_replace("ACTION", $this->subscribe, $body);
|
632 |
$subject = str_replace("ACTION", $this->subscribe, $this->subscribe2_options['confirm_subject']);
|
633 |
-
} elseif ('del' == $what) {
|
634 |
$body = str_replace("ACTION", $this->unsubscribe, $body);
|
635 |
$subject = str_replace("ACTION", $this->unsubscribe, $this->subscribe2_options['confirm_subject']);
|
636 |
}
|
@@ -649,7 +643,7 @@ class s2class {
|
|
649 |
function get_email($id = 0) {
|
650 |
global $wpdb;
|
651 |
|
652 |
-
if (!$id) {
|
653 |
return false;
|
654 |
}
|
655 |
return $wpdb->get_var("SELECT email FROM $this->public WHERE id=$id");
|
@@ -661,7 +655,7 @@ class s2class {
|
|
661 |
function get_id($email = '') {
|
662 |
global $wpdb;
|
663 |
|
664 |
-
if (!$email) {
|
665 |
return false;
|
666 |
}
|
667 |
return $wpdb->get_var("SELECT id FROM $this->public WHERE email='$email'");
|
@@ -674,17 +668,17 @@ class s2class {
|
|
674 |
function activate($email = '') {
|
675 |
global $wpdb;
|
676 |
|
677 |
-
if ('' == $email) {
|
678 |
-
if ('' != $this->email) {
|
679 |
$email = $this->email;
|
680 |
} else {
|
681 |
return false;
|
682 |
}
|
683 |
}
|
684 |
|
685 |
-
if (false !== $this->is_public($email)) {
|
686 |
$check = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE user_email='$this->email'");
|
687 |
-
if ($check) { return; }
|
688 |
$wpdb->get_results("UPDATE $this->public SET active='1', ip='$this->ip' WHERE email='$email'");
|
689 |
} else {
|
690 |
global $current_user;
|
@@ -696,20 +690,20 @@ class s2class {
|
|
696 |
Add an public subscriber to the subscriber table as unconfirmed
|
697 |
*/
|
698 |
function add($email = '') {
|
699 |
-
if ($this->filtered ==1) { return; }
|
700 |
global $wpdb;
|
701 |
|
702 |
-
if ('' == $email) {
|
703 |
-
if ('' != $this->email) {
|
704 |
$email = $this->email;
|
705 |
} else {
|
706 |
return false;
|
707 |
}
|
708 |
}
|
709 |
|
710 |
-
if (!is_email($email)) { return false; }
|
711 |
|
712 |
-
if (false !== $this->is_public($email)) {
|
713 |
$wpdb->get_results("UPDATE $this->public SET date=NOW() WHERE email='$email'");
|
714 |
} else {
|
715 |
$wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, ip) VALUES (%s, %d, NOW(), %s)", $email, 0, $this->ip));
|
@@ -722,15 +716,15 @@ class s2class {
|
|
722 |
function delete($email = '') {
|
723 |
global $wpdb;
|
724 |
|
725 |
-
if ('' == $email) {
|
726 |
-
if ('' != $this->email) {
|
727 |
$email = $this->email;
|
728 |
} else {
|
729 |
return false;
|
730 |
}
|
731 |
}
|
732 |
|
733 |
-
if (!is_email($email)) { return false; }
|
734 |
$wpdb->get_results("DELETE FROM $this->public WHERE email='$email'");
|
735 |
} // end delete()
|
736 |
|
@@ -740,13 +734,13 @@ class s2class {
|
|
740 |
function toggle($email = '') {
|
741 |
global $wpdb;
|
742 |
|
743 |
-
if (
|
744 |
|
745 |
// let's see if this is a public user
|
746 |
$status = $this->is_public($email);
|
747 |
-
if (false === $status) { return false; }
|
748 |
|
749 |
-
if ('0' == $status) {
|
750 |
$wpdb->get_results("UPDATE $this->public SET active='1' WHERE email='$email'");
|
751 |
} else {
|
752 |
$wpdb->get_results("UPDATE $this->public SET active='0' WHERE email='$email'");
|
@@ -757,11 +751,11 @@ class s2class {
|
|
757 |
Send reminder email to unconfirmed public subscribers
|
758 |
*/
|
759 |
function remind($emails = '') {
|
760 |
-
if ('' == $emails) { return false; }
|
761 |
|
762 |
$recipients = explode(",", $emails);
|
763 |
-
if (!is_array($recipients)) { $recipients = (array)$recipients; }
|
764 |
-
foreach ($recipients as $recipient) {
|
765 |
$this->email = $recipient;
|
766 |
$this->send_confirm('add', true);
|
767 |
}
|
@@ -775,7 +769,7 @@ class s2class {
|
|
775 |
list($user, $domain) = split('@', $email);
|
776 |
$bar_check = stristr($barred_option, $domain);
|
777 |
|
778 |
-
if (!empty($bar_check)) {
|
779 |
return true;
|
780 |
} else {
|
781 |
return false;
|
@@ -788,16 +782,16 @@ class s2class {
|
|
788 |
function confirm($content = '') {
|
789 |
global $wpdb;
|
790 |
|
791 |
-
if (1 == $this->filtered) { return $content; }
|
792 |
|
793 |
$code = $_GET['s2'];
|
794 |
$action = intval(substr($code, 0, 1));
|
795 |
$hash = substr($code, 1, 32);
|
796 |
$code = str_replace($hash, '', $code);
|
797 |
$id = intval(substr($code, 1));
|
798 |
-
if ($id) {
|
799 |
$this->email = $this->get_email($id);
|
800 |
-
if (
|
801 |
return $this->no_such_email;
|
802 |
}
|
803 |
} else {
|
@@ -807,36 +801,36 @@ class s2class {
|
|
807 |
// get current status of email so messages are only sent once per emailed link
|
808 |
$current = $this->is_public($this->email);
|
809 |
|
810 |
-
if ('1' == $action) {
|
811 |
// make this subscription active
|
812 |
$this->message = $this->added;
|
813 |
-
if ('1' != $current) {
|
814 |
$this->ip = getenv('REMOTE_ADDR');
|
815 |
$this->activate();
|
816 |
-
if (
|
817 |
$subject = '[' . get_option('blogname') . '] ' . __('New subscription', 'subscribe2');
|
818 |
$subject = html_entity_decode($subject, ENT_QUOTES);
|
819 |
$message = $this->email . " " . __('subscribed to email notifications!', 'subscribe2');
|
820 |
$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'");
|
821 |
$headers = $this->headers();
|
822 |
-
foreach ($recipients as $recipient) {
|
823 |
@wp_mail($recipient, $subject, $message, $headers);
|
824 |
}
|
825 |
}
|
826 |
}
|
827 |
$this->filtered = 1;
|
828 |
-
} elseif ('0' == $action) {
|
829 |
// remove this subscriber
|
830 |
$this->message = $this->deleted;
|
831 |
-
if ('0' != $current) {
|
832 |
$this->delete();
|
833 |
-
if (
|
834 |
$subject = '[' . get_option('blogname') . '] ' . __('New Unsubscription', 'subscribe2');
|
835 |
$subject = html_entity_decode($subject, ENT_QUOTES);
|
836 |
$message = $this->email . " " . __('unsubscribed from email notifications!', 'subscribe2');
|
837 |
$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'");
|
838 |
$headers = $this->headers();
|
839 |
-
foreach ($recipients as $recipient) {
|
840 |
@wp_mail($recipient, $subject, $message, $headers);
|
841 |
}
|
842 |
}
|
@@ -844,7 +838,7 @@ class s2class {
|
|
844 |
$this->filtered = 1;
|
845 |
}
|
846 |
|
847 |
-
if ('' != $this->message) {
|
848 |
return $this->message;
|
849 |
}
|
850 |
} // end confirm()
|
@@ -855,10 +849,10 @@ class s2class {
|
|
855 |
function is_public($email = '') {
|
856 |
global $wpdb;
|
857 |
|
858 |
-
if ('' == $email) { return false; }
|
859 |
|
860 |
$check = $wpdb->get_var("SELECT active FROM $this->public WHERE email='$email'");
|
861 |
-
if (
|
862 |
return $check;
|
863 |
} else {
|
864 |
return false;
|
@@ -871,10 +865,10 @@ class s2class {
|
|
871 |
function is_registered($email = '') {
|
872 |
global $wpdb;
|
873 |
|
874 |
-
if ('' == $email) { return false; }
|
875 |
|
876 |
$check = $wpdb->get_var("SELECT email FROM $wpdb->users WHERE user_email='$email'");
|
877 |
-
if ($check) {
|
878 |
return true;
|
879 |
} else {
|
880 |
return false;
|
@@ -886,13 +880,13 @@ class s2class {
|
|
886 |
*/
|
887 |
function get_public($confirmed = 1) {
|
888 |
global $wpdb;
|
889 |
-
if (1 == $confirmed) {
|
890 |
-
if ('' == $this->all_public) {
|
891 |
$this->all_public = $wpdb->get_col("SELECT email FROM $this->public WHERE active='1'");
|
892 |
}
|
893 |
return $this->all_public;
|
894 |
} else {
|
895 |
-
if ('' == $this->all_unconfirmed) {
|
896 |
$this->all_unconfirmed = $wpdb->get_col("SELECT email FROM $this->public WHERE active='0'");
|
897 |
}
|
898 |
return $this->all_unconfirmed;
|
@@ -905,8 +899,8 @@ class s2class {
|
|
905 |
function get_all_registered($id = '') {
|
906 |
global $wpdb;
|
907 |
|
908 |
-
if ($this->s2_mu) {
|
909 |
-
if ($id) {
|
910 |
return $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
|
911 |
} else {
|
912 |
$result = $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
|
@@ -914,7 +908,7 @@ class s2class {
|
|
914 |
return $wpdb->get_col("SELECT user_email FROM $wpdb->users WHERE ID IN ($ids) AND user_activation_key=''");
|
915 |
}
|
916 |
} else {
|
917 |
-
if ($id) {
|
918 |
return $wpdb->get_col("SELECT ID FROM $wpdb->users");
|
919 |
} else {
|
920 |
return $wpdb->get_col("SELECT user_email FROM $wpdb->users");
|
@@ -934,42 +928,42 @@ class s2class {
|
|
934 |
$subscribers = array();
|
935 |
|
936 |
parse_str($args, $r);
|
937 |
-
if (!isset($r['format']))
|
938 |
$r['format'] = 'all';
|
939 |
-
if (!isset($r['cats']))
|
940 |
$r['cats'] = '';
|
941 |
|
942 |
$JOIN = ''; $AND = '';
|
943 |
// text or HTML subscribers
|
944 |
-
if ('all' != $r['format']) {
|
945 |
$JOIN .= "INNER JOIN $wpdb->usermeta AS b ON a.user_id = b.user_id ";
|
946 |
$AND .= " AND b.meta_key='s2_format' AND b.meta_value=";
|
947 |
-
if ('html' == $r['format']) {
|
948 |
$AND .= "'html'";
|
949 |
-
} elseif ('post' == $r['format']) {
|
950 |
$AND .= "'post'";
|
951 |
-
} elseif ('excerpt' == $r['format']) {
|
952 |
$AND .= "'excerpt'";
|
953 |
}
|
954 |
}
|
955 |
|
956 |
// specific category subscribers
|
957 |
-
if ('' != $r['cats']) {
|
958 |
$JOIN .= "INNER JOIN $wpdb->usermeta AS c ON a.user_id = c.user_id ";
|
959 |
$all = '';
|
960 |
-
foreach (explode(',', $r['cats']) as $cat) {
|
961 |
('' == $and) ? $and = "c.meta_key='" . $this->get_usermeta_keyname('s2_cat') . "$cat'" : $and .= " OR c.meta_key='" . $this->get_usermeta_keyname('s2_cat') . "$cat'";
|
962 |
}
|
963 |
$AND .= " AND ($and)";
|
964 |
}
|
965 |
|
966 |
-
if ($this->s2_mu) {
|
967 |
$sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . "WHERE a.meta_key='" . $wpdb->prefix . "capabilities'" . $AND;
|
968 |
} else {
|
969 |
$sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . "WHERE a.meta_key='" . $this->get_usermeta_keyname('s2_subscribed') . "'" . $AND;
|
970 |
}
|
971 |
$result = $wpdb->get_col($sql);
|
972 |
-
if ($result) {
|
973 |
$ids = implode(',', $result);
|
974 |
return $wpdb->get_col("SELECT user_email FROM $wpdb->users WHERE ID IN ($ids) AND user_activation_key = ''");
|
975 |
}
|
@@ -979,14 +973,14 @@ class s2class {
|
|
979 |
Collects the signup date for all public subscribers
|
980 |
*/
|
981 |
function signup_date($email = '') {
|
982 |
-
if ('' == $email) { return false; }
|
983 |
|
984 |
global $wpdb;
|
985 |
-
if (!empty($this->signup_dates)) {
|
986 |
return $this->signup_dates[$email];
|
987 |
} else {
|
988 |
$results = $wpdb->get_results("SELECT email, date FROM $this->public", ARRAY_N);
|
989 |
-
foreach ($results as $result) {
|
990 |
$this->signup_dates[$result[0]] = $result[1];
|
991 |
}
|
992 |
return $this->signup_dates[$email];
|
@@ -997,14 +991,14 @@ class s2class {
|
|
997 |
Collects the ip address for all public subscribers
|
998 |
*/
|
999 |
function signup_ip($email = '') {
|
1000 |
-
if ('' == $email) {return false; }
|
1001 |
|
1002 |
global $wpdb;
|
1003 |
-
if (!empty($this->signup_ips)) {
|
1004 |
return $this->signup_ips[$email];
|
1005 |
} else {
|
1006 |
$results = $wpdb->get_results("SELECT email, ip FROM $this->public", ARRAY_N);
|
1007 |
-
foreach ($results as $result) {
|
1008 |
$this->signup_ips[$result[0]] = $result[1];
|
1009 |
}
|
1010 |
return $this->signup_ips[$email];
|
@@ -1018,36 +1012,36 @@ class s2class {
|
|
1018 |
function register($user_ID = 0) {
|
1019 |
global $wpdb;
|
1020 |
|
1021 |
-
if (0 == $user_ID) { return $user_ID; }
|
1022 |
$user = get_userdata($user_ID);
|
1023 |
$all_cats = get_categories(array('hide_empty' => false));
|
1024 |
|
1025 |
// Are registered users are allowed to subscribe to excluded categories?
|
1026 |
-
if (
|
1027 |
$exclude = explode(',', $this->subscribe2_options['exclude']);
|
1028 |
-
foreach ($all_cats as $cat => $term_id) {
|
1029 |
-
if (in_array($all_cats[$cat]->term_id, $exclude)) {
|
1030 |
$cat = (int)$cat;
|
1031 |
unset($all_cats[$cat]);
|
1032 |
}
|
1033 |
}
|
1034 |
}
|
1035 |
|
1036 |
-
foreach ($all_cats as $cat) {
|
1037 |
('' == $cats) ? $cats = "$cat->term_id" : $cats .= ",$cat->term_id";
|
1038 |
}
|
1039 |
|
1040 |
-
if ('' == $cats) {
|
1041 |
// sanity check, might occur if all cats excluded and reg_override = 0
|
1042 |
return $user_ID;
|
1043 |
}
|
1044 |
|
1045 |
// has this user previously signed up for email notification?
|
1046 |
-
if (false !== $this->is_public($user->user_email)) {
|
1047 |
// delete this user from the public table, and subscribe them to all the categories
|
1048 |
$this->delete($user->user_email);
|
1049 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
|
1050 |
-
foreach (explode(',', $cats) as $cat) {
|
1051 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat, "$cat");
|
1052 |
}
|
1053 |
update_usermeta($user_ID, 's2_format', 'excerpt');
|
@@ -1055,34 +1049,34 @@ class s2class {
|
|
1055 |
} else {
|
1056 |
// create post format entries for all users
|
1057 |
$check_format = get_usermeta($user_ID, 's2_format');
|
1058 |
-
if (empty($check_format)) {
|
1059 |
// ensure existing subscription options are not overwritten on upgrade
|
1060 |
-
if ('html' == $this->subscribe2_options['autoformat']) {
|
1061 |
update_usermeta($user_ID, 's2_format', 'html');
|
1062 |
-
} elseif ('fulltext' == $this->subscribe2_options['autoformat']) {
|
1063 |
update_usermeta($user_ID, 's2_format', 'post');
|
1064 |
} else {
|
1065 |
update_usermeta($user_ID, 's2_format', 'excerpt');
|
1066 |
}
|
1067 |
update_usermeta($user_ID, 's2_autosub', $this->subscribe2_options['autosub_def']);
|
1068 |
// if the are no existing subscriptions, create them if, by default if autosub is on
|
1069 |
-
if (
|
1070 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
|
1071 |
-
foreach (explode(',', $cats) as $cat) {
|
1072 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat, "$cat");
|
1073 |
}
|
1074 |
}
|
1075 |
} else {
|
1076 |
// if user is already registered update format remove 's2_excerpt' field and update 's2_format'
|
1077 |
-
if ('html' == $check_format) {
|
1078 |
delete_usermeta($user_ID, 's2_excerpt');
|
1079 |
-
} elseif ('text' == $check_format) {
|
1080 |
update_usermeta($user_ID, 's2_format', get_usermeta($user_ID, 's2_excerpt'));
|
1081 |
delete_usermeta($user_ID, 's2_excerpt');
|
1082 |
}
|
1083 |
}
|
1084 |
$subscribed = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
1085 |
-
if (strstr($subscribed, '-1')) {
|
1086 |
// make sure we remove '-1' from any settings
|
1087 |
$old_cats = explode(',', $subscribed);
|
1088 |
$pos = array_search('-1', $old_cats);
|
@@ -1098,7 +1092,7 @@ class s2class {
|
|
1098 |
Subscribe all registered users to category selected on Admin Manage Page
|
1099 |
*/
|
1100 |
function subscribe_registered_users($emails = '', $cats = array()) {
|
1101 |
-
if (
|
1102 |
global $wpdb;
|
1103 |
|
1104 |
$useremails = explode(",", $emails);
|
@@ -1107,17 +1101,17 @@ class s2class {
|
|
1107 |
$sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ('$useremails')";
|
1108 |
$user_IDs = $wpdb->get_col($sql);
|
1109 |
|
1110 |
-
foreach ($user_IDs as $user_ID) {
|
1111 |
$old_cats = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
1112 |
-
if (!empty($old_cats)) {
|
1113 |
$old_cats = explode(',', $old_cats);
|
1114 |
$newcats = array_unique(array_merge($cats, $old_cats));
|
1115 |
} else {
|
1116 |
$newcats = $cats;
|
1117 |
}
|
1118 |
-
if (!empty($newcats)) {
|
1119 |
// add subscription to these cat IDs
|
1120 |
-
foreach ($newcats as $id) {
|
1121 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, "$id");
|
1122 |
}
|
1123 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $newcats));
|
@@ -1130,7 +1124,7 @@ class s2class {
|
|
1130 |
Unsubscribe all registered users to category selected on Admin Manage Page
|
1131 |
*/
|
1132 |
function unsubscribe_registered_users($emails = '', $cats = array()) {
|
1133 |
-
if (
|
1134 |
global $wpdb;
|
1135 |
|
1136 |
$useremails = explode(",", $emails);
|
@@ -1139,18 +1133,18 @@ class s2class {
|
|
1139 |
$sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ('$useremails')";
|
1140 |
$user_IDs = $wpdb->get_col($sql);
|
1141 |
|
1142 |
-
foreach ($user_IDs as $user_ID) {
|
1143 |
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
1144 |
$remain = array_diff($old_cats, $cats);
|
1145 |
-
if (!empty($remain)) {
|
1146 |
// remove subscription to these cat IDs and update s2_subscribed
|
1147 |
-
foreach ($cats as $id) {
|
1148 |
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
1149 |
}
|
1150 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $remain));
|
1151 |
} else {
|
1152 |
// remove subscription to these cat IDs and update s2_subscribed to ''
|
1153 |
-
foreach ($cats as $id) {
|
1154 |
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
1155 |
}
|
1156 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
@@ -1166,15 +1160,15 @@ class s2class {
|
|
1166 |
$redirect_to_subscriptionpage = false;
|
1167 |
|
1168 |
// subscribe to new blog
|
1169 |
-
if (!empty($_GET['s2mu_subscribe'])) {
|
1170 |
$blog_id = intval($_GET['s2mu_subscribe']);
|
1171 |
-
if ($blog_id >= 0) {
|
1172 |
switch_to_blog($blog_id);
|
1173 |
|
1174 |
$user_ID = get_current_user_id();
|
1175 |
|
1176 |
// if user is not a user of the current blog
|
1177 |
-
if (!is_blog_user($blog_id)) {
|
1178 |
// add user to current blog as subscriber
|
1179 |
add_user_to_blog($blog_id, $user_ID, 'subscriber');
|
1180 |
// add an action hook for external manipulation of blog and user data
|
@@ -1184,11 +1178,11 @@ class s2class {
|
|
1184 |
// subscribe to all categories by default
|
1185 |
$all_cats = get_categories(array('hide_empty' => false));
|
1186 |
|
1187 |
-
if (0 == $this->subscribe2_options['reg_override']) {
|
1188 |
// registered users are not allowed to subscribe to excluded categories
|
1189 |
$exclude = explode(',', $this->subscribe2_options['exclude']);
|
1190 |
-
foreach ($all_cats as $cat => $term) {
|
1191 |
-
if (in_array($all_cats[$cat]->term_id, $exclude)) {
|
1192 |
$cat = (int)$cat;
|
1193 |
unset($all_cats[$cat]);
|
1194 |
}
|
@@ -1196,12 +1190,12 @@ class s2class {
|
|
1196 |
}
|
1197 |
|
1198 |
$cats = array();
|
1199 |
-
foreach ($all_cats as $cat => $term) {
|
1200 |
$term_id = $term->term_id;
|
1201 |
$cats[] = $term_id;
|
1202 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $term_id, $term_id);
|
1203 |
}
|
1204 |
-
if (empty($cats)) {
|
1205 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
1206 |
} else {
|
1207 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $cats));
|
@@ -1210,10 +1204,10 @@ class s2class {
|
|
1210 |
// don't restore_current_blog(); -> redirect to new subscription page
|
1211 |
$redirect_to_subscriptionpage = true;
|
1212 |
}
|
1213 |
-
} elseif (!empty($_GET['s2mu_unsubscribe'])) {
|
1214 |
// unsubscribe from a blog
|
1215 |
$blog_id = intval($_GET['s2mu_unsubscribe']);
|
1216 |
-
if ($blog_id >= 0) {
|
1217 |
switch_to_blog($blog_id);
|
1218 |
|
1219 |
$user_ID = get_current_user_id();
|
@@ -1221,11 +1215,11 @@ class s2class {
|
|
1221 |
// delete subscription to all categories on that blog
|
1222 |
$cats = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
1223 |
$cats = explode(',', $cats);
|
1224 |
-
if (!is_array($cats)) {
|
1225 |
$cats = array($cats);
|
1226 |
}
|
1227 |
|
1228 |
-
foreach ($cats as $id) {
|
1229 |
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
1230 |
}
|
1231 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
@@ -1238,10 +1232,10 @@ class s2class {
|
|
1238 |
}
|
1239 |
}
|
1240 |
|
1241 |
-
if ($redirect_to_subscriptionpage == true) {
|
1242 |
-
if (!is_user_member_of_blog($user_ID)) {
|
1243 |
$user_blogs = get_active_blog_for_user($user_ID);
|
1244 |
-
if (is_array($user_blogs)) {
|
1245 |
switch_to_blog(key($user_blogs));
|
1246 |
} else {
|
1247 |
// no longer a member of a blog
|
@@ -1251,7 +1245,7 @@ class s2class {
|
|
1251 |
}
|
1252 |
|
1253 |
// redirect to profile page
|
1254 |
-
if (current_user_can('manage_options')) {
|
1255 |
$url = get_option('siteurl') . '/wp-admin/users.php?page=s2_users';
|
1256 |
wp_redirect($url);
|
1257 |
exit();
|
@@ -1268,17 +1262,17 @@ class s2class {
|
|
1268 |
if registered user has selected this option
|
1269 |
*/
|
1270 |
function new_category($new_category='') {
|
1271 |
-
if ('no' == $this->subscribe2_options['show_autosub']) { return; }
|
1272 |
global $wpdb;
|
1273 |
|
1274 |
-
if ('yes' == $this->subscribe2_options['show_autosub']) {
|
1275 |
$sql = "SELECT DISTINCT user_id FROM $wpdb->usermeta WHERE $wpdb->usermeta.meta_key='s2_autosub' AND $wpdb->usermeta.meta_value='yes'";
|
1276 |
$user_IDs = $wpdb->get_col($sql);
|
1277 |
-
if ('' == $user_IDs) { return; }
|
1278 |
|
1279 |
-
foreach ($user_IDs as $user_ID) {
|
1280 |
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
1281 |
-
if (!is_array($old_cats)) {
|
1282 |
$old_cats = array($old_cats);
|
1283 |
}
|
1284 |
// add subscription to these cat IDs
|
@@ -1286,7 +1280,7 @@ class s2class {
|
|
1286 |
$newcats = array_merge($old_cats, (array)$new_category);
|
1287 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $newcats));
|
1288 |
}
|
1289 |
-
} elseif ('exclude' == $this->subscribe2_options['show_autosub']) {
|
1290 |
$excluded_cats = explode(',', $this->subscribe2_options['exclude']);
|
1291 |
$excluded_cats[] = $new_category;
|
1292 |
$this->subscribe2_options['exclude'] = implode(',', $excluded_cats);
|
@@ -1299,11 +1293,11 @@ class s2class {
|
|
1299 |
|
1300 |
$sql = "SELECT DISTINCT user_id FROM $wpdb->usermeta WHERE meta_key='" . $this->get_usermeta_keyname('s2_cat') . "$deleted_category'";
|
1301 |
$user_IDs = $wpdb->get_col($sql);
|
1302 |
-
if ('' == $user_IDs) { return; }
|
1303 |
|
1304 |
-
foreach ($user_IDs as $user_ID) {
|
1305 |
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
1306 |
-
if (!is_array($old_cats)) {
|
1307 |
$old_cats = array($old_cats);
|
1308 |
}
|
1309 |
// add subscription to these cat IDs
|
@@ -1319,9 +1313,9 @@ class s2class {
|
|
1319 |
function get_userdata($admin_id) {
|
1320 |
global $wpdb, $userdata;
|
1321 |
|
1322 |
-
if (is_numeric($admin_id)) {
|
1323 |
$admin = get_userdata($admin_id);
|
1324 |
-
} elseif ($admin_id == 'admin') {
|
1325 |
//ensure compatibility with < 4.16
|
1326 |
$admin = get_userdata('1');
|
1327 |
} else {
|
@@ -1329,15 +1323,15 @@ class s2class {
|
|
1329 |
}
|
1330 |
|
1331 |
// if user record is empty grab the first admin from the database
|
1332 |
-
if (empty($admin)) {
|
1333 |
$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";
|
1334 |
$admin = get_userdata($wpdb->get_var($sql));
|
1335 |
}
|
1336 |
|
1337 |
// handle issues from WordPress core where user_level is not set or set low
|
1338 |
-
if (empty($admin)) {
|
1339 |
$role = 'administrator';
|
1340 |
-
if (!class_exists(WP_User_Search)) {
|
1341 |
require(ABSPATH . 'wp-admin/includes/user.php');
|
1342 |
}
|
1343 |
$wp_user_search = new WP_User_Search( '', '', $role);
|
@@ -1358,69 +1352,69 @@ class s2class {
|
|
1358 |
//Get Registered Subscribers for bulk management
|
1359 |
$registered = $this->get_registered();
|
1360 |
$all_users = $this->get_all_registered();
|
1361 |
-
if (!empty($all_users)) {
|
1362 |
$emails = implode(",", $all_users);
|
1363 |
}
|
1364 |
|
1365 |
// was anything POSTed ?
|
1366 |
-
if (isset($_POST['s2_admin'])) {
|
1367 |
check_admin_referer('subscribe2-manage_subscribers' . $s2nonce);
|
1368 |
-
if ($_POST['addresses']) {
|
1369 |
-
foreach (preg_split ("/[\s,]+/", $_POST['addresses']) as $email) {
|
1370 |
-
if (
|
1371 |
$this->activate($email);
|
1372 |
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) subscribed!', 'subscribe2') . "</strong></p></div>";
|
1373 |
-
} elseif (
|
1374 |
$this->delete($email);
|
1375 |
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) unsubscribed!', 'subscribe2') . "</strong></p></div>";
|
1376 |
}
|
1377 |
}
|
1378 |
echo $message;
|
1379 |
$_POST['what'] = 'confirmed';
|
1380 |
-
} elseif ($_POST['process']) {
|
1381 |
-
if ($_POST['delete']) {
|
1382 |
-
foreach ($_POST['delete'] as $address) {
|
1383 |
$this->delete($address);
|
1384 |
}
|
1385 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) deleted!', 'subscribe2') . "</strong></p></div>";
|
1386 |
}
|
1387 |
-
if ($_POST['confirm']) {
|
1388 |
-
foreach ($_POST['confirm'] as $address) {
|
1389 |
$this->toggle($address);
|
1390 |
}
|
1391 |
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Status changed!', 'subscribe2') . "</strong></p></div>";
|
1392 |
}
|
1393 |
-
if ($_POST['unconfirm']) {
|
1394 |
-
foreach ($_POST['unconfirm'] as $address) {
|
1395 |
$this->toggle($address);
|
1396 |
}
|
1397 |
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Status changed!', 'subscribe2') . "</strong></p></div>";
|
1398 |
}
|
1399 |
echo $message;
|
1400 |
-
} elseif ($_POST['searchterm']) {
|
1401 |
$confirmed = $this->get_public();
|
1402 |
$unconfirmed = $this->get_public(0);
|
1403 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1404 |
-
foreach ($subscribers as $subscriber) {
|
1405 |
-
if (is_numeric(stripos($subscriber, $_POST['searchterm']))) {
|
1406 |
$result[] = $subscriber;
|
1407 |
}
|
1408 |
}
|
1409 |
-
} elseif ($_POST['remind']) {
|
1410 |
$this->remind($_POST['reminderemails']);
|
1411 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Reminder Email(s) Sent!', 'subscribe2') . "</strong></p></div>";
|
1412 |
-
} elseif (
|
1413 |
$this->subscribe_registered_users($_POST['emails'], $_POST['category']);
|
1414 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Subscribed!', 'subscribe2') . "</strong></p></div>";
|
1415 |
-
} elseif (
|
1416 |
$this->unsubscribe_registered_users($_POST['emails'], $_POST['category']);
|
1417 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Unsubscribed!', 'subscribe2') . "</strong></p></div>";
|
1418 |
-
} elseif ($_POST['sub_format']) {
|
1419 |
-
if ($_POST['format'] == 'excerpt') {
|
1420 |
$wpdb->get_results("UPDATE $wpdb->usermeta SET meta_value='excerpt' WHERE meta_key='s2_format'");
|
1421 |
-
} elseif ($_POST['format'] == 'full') {
|
1422 |
$wpdb->get_results("UPDATE $wpdb->usermeta SET meta_value='post' WHERE meta_key='s2_format'");
|
1423 |
-
} elseif ($_POST['format'] == 'html') {
|
1424 |
$wpdb->get_results("UPDATE $wpdb->usermeta SET meta_value='html' WHERE meta_key='s2_format'");
|
1425 |
}
|
1426 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Format updated for Registered Users!', 'subscribe2') . "</strong></p></div>";
|
@@ -1431,72 +1425,72 @@ class s2class {
|
|
1431 |
$confirmed = $this->get_public();
|
1432 |
$unconfirmed = $this->get_public(0);
|
1433 |
// safety check for our arrays
|
1434 |
-
if ('' == $confirmed) { $confirmed = array(); }
|
1435 |
-
if ('' == $unconfirmed) { $unconfirmed = array(); }
|
1436 |
-
if ('' == $registered) { $registered = array(); }
|
1437 |
-
if ('' == $all_users) { $all_users = array(); }
|
1438 |
|
1439 |
$reminderform = false;
|
1440 |
$urlpath = str_replace("\\", "/", S2PATH);
|
1441 |
$urlpath = trailingslashit(get_option('siteurl')) . substr($urlpath,strpos($urlpath, "wp-content/"));
|
1442 |
-
if (isset($_GET['s2page'])) {
|
1443 |
$page = (int) $_GET['s2page'];
|
1444 |
} else {
|
1445 |
$page = 1;
|
1446 |
}
|
1447 |
|
1448 |
-
if (isset($_POST['what'])) {
|
1449 |
$page = 1;
|
1450 |
-
if ('all' == $_POST['what']) {
|
1451 |
$what = 'all';
|
1452 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1453 |
-
} elseif ('public' == $_POST['what']) {
|
1454 |
$what = 'public';
|
1455 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
|
1456 |
-
} elseif ('confirmed' == $_POST['what']) {
|
1457 |
$what = 'confirmed';
|
1458 |
$subscribers = $confirmed;
|
1459 |
-
} elseif ('unconfirmed' == $_POST['what']) {
|
1460 |
$what = 'unconfirmed';
|
1461 |
$subscribers = $unconfirmed;
|
1462 |
-
if (!empty($subscribers)) {
|
1463 |
$reminderemails = implode(",", $subscribers);
|
1464 |
$reminderform = true;
|
1465 |
}
|
1466 |
-
} elseif (is_numeric($_POST['what'])) {
|
1467 |
$what = intval($_POST['what']);
|
1468 |
$subscribers = $this->get_registered("cats=$what");
|
1469 |
-
} elseif ('registered' == $_POST['what']) {
|
1470 |
$what = 'registered';
|
1471 |
$subscribers = $registered;
|
1472 |
-
} elseif ('all_users' == $_POST['what']) {
|
1473 |
$what = 'all_users';
|
1474 |
$subscribers = $all_users;
|
1475 |
}
|
1476 |
-
} elseif (isset($_GET['what'])) {
|
1477 |
-
if ('all' == $_GET['what']) {
|
1478 |
$what = 'all';
|
1479 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1480 |
-
} elseif ('public' == $_GET['what']) {
|
1481 |
$what = 'public';
|
1482 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
|
1483 |
-
} elseif ('confirmed' == $_GET['what']) {
|
1484 |
$what = 'confirmed';
|
1485 |
$subscribers = $confirmed;
|
1486 |
-
} elseif ('unconfirmed' == $_GET['what']) {
|
1487 |
$what = 'unconfirmed';
|
1488 |
$subscribers = $unconfirmed;
|
1489 |
-
if (!empty($subscribers)) {
|
1490 |
$reminderemails = implode(",", $subscribers);
|
1491 |
$reminderform = true;
|
1492 |
}
|
1493 |
-
} elseif (is_numeric($_GET['what'])) {
|
1494 |
$what = intval($_GET['what']);
|
1495 |
$subscribers = $this->get_registered("cats=$what");
|
1496 |
-
} elseif ('registered' == $_GET['what']) {
|
1497 |
$what = 'registered';
|
1498 |
$subscribers = $registered;
|
1499 |
-
} elseif ('all_users' == $_GET['what']) {
|
1500 |
$what = 'all_users';
|
1501 |
$subscribers = $all_users;
|
1502 |
}
|
@@ -1504,12 +1498,12 @@ class s2class {
|
|
1504 |
$what = 'all';
|
1505 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1506 |
}
|
1507 |
-
if ($_POST['searchterm']) {
|
1508 |
$subscribers = &$result;
|
1509 |
$what = 'public';
|
1510 |
}
|
1511 |
|
1512 |
-
if (!empty($subscribers)) {
|
1513 |
natcasesort($subscribers);
|
1514 |
// Displays a page number strip - adapted from code in Akismet
|
1515 |
$args['what'] = $what;
|
@@ -1544,9 +1538,10 @@ class s2class {
|
|
1544 |
|
1545 |
// show our form
|
1546 |
echo "<div class=\"wrap\">";
|
|
|
1547 |
echo "<h2>" . __('Manage Subscribers', 'subscribe2') . "</h2>\r\n";
|
1548 |
echo "<form method=\"post\" action=\"\">\r\n";
|
1549 |
-
if (function_exists('wp_nonce_field')) {
|
1550 |
wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
|
1551 |
}
|
1552 |
echo "<h2>" . __('Add/Remove Subscribers', 'subscribe2') . "</h2>\r\n";
|
@@ -1562,12 +1557,12 @@ class s2class {
|
|
1562 |
$this->display_subscriber_dropdown($what, __('Filter', 'subscribe2'));
|
1563 |
// show the selected subscribers
|
1564 |
$alternate = '';
|
1565 |
-
if (!empty($subscribers)) {
|
1566 |
$exportcsv = implode(",\r\n", $subscribers);
|
1567 |
echo "<table cellpadding=\"2\" cellspacing=\"2\" width=\"100%\">";
|
1568 |
echo "<tr class=\"alternate\"><td width=\"50%\"><input type=\"text\" name=\"searchterm\" value=\"\" /> \r\n";
|
1569 |
echo "<input type=\"submit\" class=\"button-secondary\" name=\"search\" value=\"" . __('Search Subscribers', 'subscribe2') . "\" /></td>\r\n";
|
1570 |
-
if ($reminderform) {
|
1571 |
echo "<td width=\"25%\" align=\"right\"><input type=\"hidden\" name=\"reminderemails\" value=\"" . $reminderemails . "\" />\r\n";
|
1572 |
echo "<input type=\"submit\" class=\"button-secondary\" name=\"remind\" value=\"" . __('Send Reminder Email', 'subscribe2') . "\" /></td>\r\n";
|
1573 |
} else {
|
@@ -1579,11 +1574,11 @@ class s2class {
|
|
1579 |
}
|
1580 |
|
1581 |
echo "<table class=\"widefat\" cellpadding=\"2\" cellspacing=\"2\">";
|
1582 |
-
if (!empty($subscribers)) {
|
1583 |
echo "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
|
1584 |
echo "<td align=\"right\">" . $strip . "</td></tr>\r\n";
|
1585 |
}
|
1586 |
-
if (!empty($subscribers)) {
|
1587 |
$subscriber_chunks = array_chunk($subscribers, $this->subscribe2_options['entries']);
|
1588 |
$chunk = $page - 1;
|
1589 |
$subscribers = $subscriber_chunks[$chunk];
|
@@ -1599,10 +1594,10 @@ class s2class {
|
|
1599 |
echo "<td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"delete_checkall\" /></td>\r\n";
|
1600 |
echo "<td align=\"left\"><strong>" . __('Select / Unselect All', 'subscribe2') . "</strong></td></tr>\r\n";
|
1601 |
|
1602 |
-
foreach ($subscribers as $subscriber) {
|
1603 |
echo "<tr class=\"$alternate\" style=\"height:1.5em;\">";
|
1604 |
echo "<td align=\"center\">\r\n";
|
1605 |
-
if (in_array($subscriber, $confirmed)) {
|
1606 |
echo "</td><td align=\"center\">\r\n";
|
1607 |
echo "<input class=\"unconfirm_checkall\" title=\"" . __('Unconfirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"unconfirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
|
1608 |
echo "<td align=\"center\">\r\n";
|
@@ -1610,7 +1605,7 @@ class s2class {
|
|
1610 |
echo "</td>\r\n";
|
1611 |
echo "<td><span style=\"color:#006600\">√ </span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
|
1612 |
echo "(<span style=\"color:#006600\"><abbr title=\"" . $this->signup_ip($subscriber) . "\">" . $this->signup_date($subscriber) . "</abbr></span>)\r\n";
|
1613 |
-
} elseif (in_array($subscriber, $unconfirmed)) {
|
1614 |
echo "<input class=\"confirm_checkall\" title=\"" . __('Confirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"confirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
|
1615 |
echo "<td align=\"center\"></td>\r\n";
|
1616 |
echo "<td align=\"center\">\r\n";
|
@@ -1618,22 +1613,22 @@ class s2class {
|
|
1618 |
echo "</td>\r\n";
|
1619 |
echo "<td><span style=\"color:#FF0000\"> ! </span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
|
1620 |
echo "(<span style=\"color:#FF0000\"><abbr title=\"" . $this->signup_ip($subscriber) . "\">" . $this->signup_date($subscriber) . "</abbr></span>)\r\n";
|
1621 |
-
} elseif (in_array($subscriber, $all_users)) {
|
1622 |
echo "</td><td align=\"center\"></td><td align=\"center\"></td>\r\n";
|
1623 |
echo "<td><span style=\"color:#006600\">® </span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
|
1624 |
-
echo "(<a href=\"" . get_option('siteurl') . "/wp-admin/users.php?page=s2_users&email
|
1625 |
}
|
1626 |
echo "</td></tr>\r\n";
|
1627 |
('alternate' == $alternate) ? $alternate = '' : $alternate = 'alternate';
|
1628 |
}
|
1629 |
} else {
|
1630 |
-
if ($_POST['searchterm']) {
|
1631 |
echo "<tr><td align=\"center\"><b>" . __('No matching subscribers found', 'subscribe2') . "</b></td></tr>\r\n";
|
1632 |
} else {
|
1633 |
echo "<tr><td align=\"center\"><b>" . __('NONE', 'subscribe2') . "</b></td></tr>\r\n";
|
1634 |
}
|
1635 |
}
|
1636 |
-
if (!empty($subscribers)) {
|
1637 |
echo "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
|
1638 |
echo "<td align=\"right\">" . $strip . "</td></tr>\r\n";
|
1639 |
}
|
@@ -1670,22 +1665,22 @@ class s2class {
|
|
1670 |
global $s2nonce;
|
1671 |
|
1672 |
// was anything POSTed?
|
1673 |
-
if (isset($_POST['s2_admin'])) {
|
1674 |
check_admin_referer('subscribe2-options_subscribers' . $s2nonce);
|
1675 |
-
if ($_POST['reset']) {
|
1676 |
$this->reset();
|
1677 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>$this->options_reset</strong></p></div>";
|
1678 |
-
} elseif ($_POST['preview']) {
|
1679 |
global $user_email;
|
1680 |
-
if ('never' == $this->subscribe2_options['email_freq']) {
|
1681 |
$post = get_posts('numberposts=1');
|
1682 |
$this->publish($post[0], $user_email);
|
1683 |
} else {
|
1684 |
-
$this->subscribe2_cron($user_email);
|
1685 |
}
|
1686 |
-
} elseif ($_POST['submit']) {
|
1687 |
// BCClimit
|
1688 |
-
if (
|
1689 |
$this->subscribe2_options['bcclimit'] = $_POST['bcc'];
|
1690 |
}
|
1691 |
// admin_email
|
@@ -1693,7 +1688,7 @@ class s2class {
|
|
1693 |
|
1694 |
// send as author or admin?
|
1695 |
$sender = 'author';
|
1696 |
-
if (is_numeric($_POST['sender'])) {
|
1697 |
$sender = $_POST['sender'];
|
1698 |
}
|
1699 |
$this->subscribe2_options['sender'] = $sender;
|
@@ -1708,18 +1703,18 @@ class s2class {
|
|
1708 |
// send per-post or digest emails
|
1709 |
$email_freq = $_POST['email_freq'];
|
1710 |
$scheduled_time = wp_next_scheduled('s2_digest_cron');
|
1711 |
-
if (
|
1712 |
$this->subscribe2_options['email_freq'] = $email_freq;
|
1713 |
wp_clear_scheduled_hook('s2_digest_cron');
|
1714 |
$scheds = (array)wp_get_schedules();
|
1715 |
$interval = ( isset($scheds[$email_freq]['interval']) ) ? (int) $scheds[$email_freq]['interval'] : 0;
|
1716 |
-
if ($interval == 0) {
|
1717 |
// if we are on per-post emails remove last_cron entry
|
1718 |
unset($this->subscribe2_options['last_s2cron']);
|
1719 |
} else {
|
1720 |
// if we are using digest schedule the event and prime last_cron as now
|
1721 |
$time = time() + $interval;
|
1722 |
-
if ($interval < 86400) {
|
1723 |
// Schedule CRON events occurring less than daily starting now and periodically thereafter
|
1724 |
$timestamp = &$time;
|
1725 |
} else {
|
@@ -1727,7 +1722,7 @@ class s2class {
|
|
1727 |
$timestamp = mktime($_POST['hour'], 0, 0, date('m', $time), date('d', $time), date('Y', $time));
|
1728 |
}
|
1729 |
wp_schedule_event($timestamp, $email_freq, 's2_digest_cron');
|
1730 |
-
if (!isset($this->subscribe2_options['last_s2cron'])) {
|
1731 |
$this->subscribe2_options['last_s2cron'] = current_time('mysql');
|
1732 |
}
|
1733 |
}
|
@@ -1735,56 +1730,56 @@ class s2class {
|
|
1735 |
|
1736 |
// email subject and body templates
|
1737 |
// ensure that are not empty before updating
|
1738 |
-
if (!empty($_POST['notification_subject'])) {
|
1739 |
$this->subscribe2_options['notification_subject'] = $_POST['notification_subject'];
|
1740 |
}
|
1741 |
-
if (!empty($_POST['mailtext'])) {
|
1742 |
$this->subscribe2_options['mailtext'] = $_POST['mailtext'];
|
1743 |
}
|
1744 |
-
if (!empty($_POST['confirm_subject'])) {
|
1745 |
$this->subscribe2_options['confirm_subject'] = $_POST['confirm_subject'];
|
1746 |
}
|
1747 |
-
if (!empty($_POST['confirm_email'])) {
|
1748 |
$this->subscribe2_options['confirm_email'] = $_POST['confirm_email'];
|
1749 |
}
|
1750 |
-
if (!empty($_POST['remind_subject'])) {
|
1751 |
$this->subscribe2_options['remind_subject'] = $_POST['remind_subject'];
|
1752 |
}
|
1753 |
-
if (!empty($_POST['remind_email'])) {
|
1754 |
$this->subscribe2_options['remind_email'] = $_POST['remind_email'];
|
1755 |
}
|
1756 |
|
1757 |
// excluded categories
|
1758 |
-
if (!empty($_POST['category'])) {
|
1759 |
$exclude_cats = implode(',', $_POST['category']);
|
1760 |
} else {
|
1761 |
$exclude_cats = '';
|
1762 |
}
|
1763 |
$this->subscribe2_options['exclude'] = $exclude_cats;
|
1764 |
// allow override?
|
1765 |
-
(isset($_POST['reg_override'])) ? $override = '1' : $override = '0';
|
1766 |
$this->subscribe2_options['reg_override'] = $override;
|
1767 |
|
1768 |
// default WordPress page where Subscribe2 token is placed
|
1769 |
-
if (
|
1770 |
$this->subscribe2_options['s2page'] = $_POST['page'];
|
1771 |
}
|
1772 |
|
1773 |
// Number of subscriber per page
|
1774 |
-
if (
|
1775 |
$this->subscribe2_options['entries'] =$_POST['entries'];
|
1776 |
}
|
1777 |
|
1778 |
// show meta link?
|
1779 |
-
($_POST['show_meta'] == '1') ? $showmeta = '1' : $showmeta = '0';
|
1780 |
$this->subscribe2_options['show_meta'] = $showmeta;
|
1781 |
|
1782 |
// show button?
|
1783 |
-
($_POST['show_button'] == '1') ? $showbutton = '1' : $showbutton = '0';
|
1784 |
$this->subscribe2_options['show_button'] = $showbutton;
|
1785 |
|
1786 |
// show widget in Presentation->Widgets
|
1787 |
-
($_POST['widget'] == '1') ? $showwidget = '1' : $showwidget = '0';
|
1788 |
$this->subscribe2_options['widget'] = $showwidget;
|
1789 |
|
1790 |
//automatic subscription
|
@@ -1804,12 +1799,13 @@ class s2class {
|
|
1804 |
}
|
1805 |
// show our form
|
1806 |
echo "<div class=\"wrap\">";
|
|
|
1807 |
echo "<h2>" . __('Subscribe2 Settings', 'subscribe2') . "</h2>\r\n";
|
1808 |
echo "<a href=\"http://subscribe2.wordpress.com/\">" . __('Plugin Blog', 'subscribe2') . "</a> | ";
|
1809 |
echo "<a href=\"http://getsatisfaction.com/subscribe2/\">" . __('Support Forum', 'subscribe2') . "</a> | ";
|
1810 |
echo "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904\">" . __('Make a donation via PayPal', 'subscribe2') . "</a>";
|
1811 |
echo "<form method=\"post\" action=\"\">\r\n";
|
1812 |
-
if (function_exists('wp_nonce_field')) {
|
1813 |
wp_nonce_field('subscribe2-options_subscribers' . $s2nonce);
|
1814 |
}
|
1815 |
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"options\" />\r\n";
|
@@ -1829,68 +1825,68 @@ class s2class {
|
|
1829 |
|
1830 |
echo "<br /><br />" . __('Send Admins notifications for new', 'subscribe2') . ': ';
|
1831 |
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"subs\"";
|
1832 |
-
if ('subs' == $this->subscribe2_options['admin_email']) {
|
1833 |
echo " checked=\"checked\"";
|
1834 |
}
|
1835 |
echo " /> " . __('Subscriptions', 'subscribe2') . "</label> ";
|
1836 |
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"unsubs\"";
|
1837 |
-
if ('unsubs' == $this->subscribe2_options['admin_email']) {
|
1838 |
echo " checked=\"checked\"";
|
1839 |
}
|
1840 |
echo " /> " . __('Unsubscriptions', 'subscribe2') . "</label> ";
|
1841 |
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"both\"";
|
1842 |
-
if ('both' == $this->subscribe2_options['admin_email']) {
|
1843 |
echo " checked=\"checked\"";
|
1844 |
}
|
1845 |
echo " /> " . __('Both', 'subscribe2') . "</label> ";
|
1846 |
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"none\"";
|
1847 |
-
if ('none' == $this->subscribe2_options['admin_email']) {
|
1848 |
echo " checked=\"checked\"";
|
1849 |
}
|
1850 |
echo " /> " . __('Neither', 'subscribe2') . "</label><br /><br />\r\n";
|
1851 |
|
1852 |
echo __('Include theme CSS stylesheet in HTML notifications', 'subscribe2') . ': ';
|
1853 |
echo "<label><input type=\"radio\" name=\"stylesheet\" value=\"yes\"";
|
1854 |
-
if ('yes' == $this->subscribe2_options['stylesheet']) {
|
1855 |
echo " checked=\"checked\"";
|
1856 |
}
|
1857 |
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
1858 |
echo "<label><input type=\"radio\" name=\"stylesheet\" value=\"no\"";
|
1859 |
-
if ('no' == $this->subscribe2_options['stylesheet']) {
|
1860 |
echo " checked=\"checked\"";
|
1861 |
}
|
1862 |
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
1863 |
|
1864 |
echo __('Send Emails for Pages', 'subscribe2') . ': ';
|
1865 |
echo "<label><input type=\"radio\" name=\"pages\" value=\"yes\"";
|
1866 |
-
if ('yes' == $this->subscribe2_options['pages']) {
|
1867 |
echo " checked=\"checked\"";
|
1868 |
}
|
1869 |
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
1870 |
echo "<label><input type=\"radio\" name=\"pages\" value=\"no\"";
|
1871 |
-
if ('no' == $this->subscribe2_options['pages']) {
|
1872 |
echo " checked=\"checked\"";
|
1873 |
}
|
1874 |
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
1875 |
echo __('Send Emails for Password Protected Posts', 'subscribe2') . ': ';
|
1876 |
echo "<label><input type=\"radio\" name=\"password\" value=\"yes\"";
|
1877 |
-
if ('yes' == $this->subscribe2_options['password']) {
|
1878 |
echo " checked=\"checked\"";
|
1879 |
}
|
1880 |
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
1881 |
echo "<label><input type=\"radio\" name=\"password\" value=\"no\"";
|
1882 |
-
if ('no' == $this->subscribe2_options['password']) {
|
1883 |
echo " checked=\"checked\"";
|
1884 |
}
|
1885 |
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
1886 |
echo __('Send Emails for Private Posts', 'subscribe2') . ': ';
|
1887 |
echo "<label><input type=\"radio\" name=\"private\" value=\"yes\"";
|
1888 |
-
if ('yes' == $this->subscribe2_options['private']) {
|
1889 |
echo " checked=\"checked\"";
|
1890 |
}
|
1891 |
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
1892 |
echo "<label><input type=\"radio\" name=\"private\" value=\"no\"";
|
1893 |
-
if ('no' == $this->subscribe2_options['private']) {
|
1894 |
echo " checked=\"checked\"";
|
1895 |
}
|
1896 |
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
@@ -1898,17 +1894,17 @@ class s2class {
|
|
1898 |
echo "<label>\r\n";
|
1899 |
$this->admin_dropdown(true);
|
1900 |
echo "</label><br /><br />\r\n";
|
1901 |
-
if (function_exists('wp_schedule_event')) {
|
1902 |
echo __('Send Emails', 'subscribe2') . ": <br /><br />\r\n";
|
1903 |
$this->display_digest_choices();
|
1904 |
echo __('For digest notifications, date order for posts is', 'subscribe2') . ": \r\n";
|
1905 |
echo "<label><input type=\"radio\" name=\"cron_order\" value=\"desc\"";
|
1906 |
-
if ('desc' == $this->subscribe2_options['cron_order']) {
|
1907 |
echo " checked=\"checked\"";
|
1908 |
}
|
1909 |
echo " /> " . __('Descending', 'subscribe2') . "</label> ";
|
1910 |
echo "<label><input type=\"radio\" name=\"cron_order\" value=\"asc\"";
|
1911 |
-
if ('asc' == $this->subscribe2_options['cron_order']) {
|
1912 |
echo " checked=\"checked\"";
|
1913 |
}
|
1914 |
echo " /> " . __('Ascending', 'subscribe2') . "</label><br /><br />\r\n";
|
@@ -1936,7 +1932,6 @@ class s2class {
|
|
1936 |
echo "<dt><b>TABLE</b></dt><dd>" . __("a list of post titles<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
1937 |
echo "<dt><b>PERMALINK</b></dt><dd>" . __("the post's permalink<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
1938 |
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";
|
1939 |
-
echo "<dt><b>BURNLINK</b></dt><dd>" . __("the post's permalink after conversion by BurnURL<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
1940 |
echo "<dt><b>MYNAME</b></dt><dd>" . __("the admin or post author's name", 'subscribe2') . "</dd>\r\n";
|
1941 |
echo "<dt><b>EMAIL</b></dt><dd>" . __("the admin or post author's email", 'subscribe2') . "</dd>\r\n";
|
1942 |
echo "<dt><b>AUTHORNAME</b></dt><dd>" . __("the post author's name", 'subscribe2') . "</dd>\r\n";
|
@@ -1963,7 +1958,7 @@ class s2class {
|
|
1963 |
echo"</p>";
|
1964 |
$this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
|
1965 |
echo "<center><label><input type=\"checkbox\" name=\"reg_override\" value=\"1\"";
|
1966 |
-
if ('1' == $this->subscribe2_options['reg_override']) {
|
1967 |
echo " checked=\"checked\"";
|
1968 |
}
|
1969 |
echo " /> " . __('Allow registered users to subscribe to excluded categories?', 'subscribe2') . "</label></center><br />\r\n";
|
@@ -1992,21 +1987,21 @@ class s2class {
|
|
1992 |
|
1993 |
// show link to WordPress page in meta
|
1994 |
echo "<br /><br /><label><input type=\"checkbox\" name=\"show_meta\" value=\"1\"";
|
1995 |
-
if ('1' == $this->subscribe2_options['show_meta']) {
|
1996 |
echo " checked=\"checked\"";
|
1997 |
}
|
1998 |
echo " /> " . __('Show a link to your subscription page in "meta"?', 'subscribe2') . "</label><br /><br />\r\n";
|
1999 |
|
2000 |
// show QuickTag button
|
2001 |
echo "<label><input type=\"checkbox\" name=\"show_button\" value=\"1\"";
|
2002 |
-
if ('1' == $this->subscribe2_options['show_button']) {
|
2003 |
echo " checked=\"checked\"";
|
2004 |
}
|
2005 |
echo " /> " . __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "</label><br /><br />\r\n";
|
2006 |
|
2007 |
// show Widget
|
2008 |
echo "<label><input type=\"checkbox\" name=\"widget\" value=\"1\"";
|
2009 |
-
if ('1' == $this->subscribe2_options['widget']) {
|
2010 |
echo " checked=\"checked\"";
|
2011 |
}
|
2012 |
echo " /> " . __('Enable Subscribe2 Widget?', 'subscribe2') . "</label><br /><br />\r\n";
|
@@ -2017,82 +2012,82 @@ class s2class {
|
|
2017 |
echo"<p>";
|
2018 |
echo __('Subscribe new users registering with your blog', 'subscribe2') . ":<br />\r\n";
|
2019 |
echo "<label><input type=\"radio\" name=\"autosub\" value=\"yes\"";
|
2020 |
-
if ('yes' == $this->subscribe2_options['autosub']) {
|
2021 |
echo " checked=\"checked\"";
|
2022 |
}
|
2023 |
echo " /> " . __('Automatically', 'subscribe2') . "</label> ";
|
2024 |
echo "<label><input type=\"radio\" name=\"autosub\" value=\"wpreg\"";
|
2025 |
-
if ('wpreg' == $this->subscribe2_options['autosub']) {
|
2026 |
echo " checked=\"checked\"";
|
2027 |
}
|
2028 |
echo " /> " . __('Display option on Registration Form', 'subscribe2') . "</label> ";
|
2029 |
echo "<label><input type=\"radio\" name=\"autosub\" value=\"no\"";
|
2030 |
-
if ('no' == $this->subscribe2_options['autosub']) {
|
2031 |
echo " checked=\"checked\"";
|
2032 |
}
|
2033 |
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2034 |
echo __('Auto-subscribe includes any excluded categories', 'subscribe2') . ":<br />\r\n";
|
2035 |
echo "<label><input type=\"radio\" name=\"newreg_override\" value=\"yes\"";
|
2036 |
-
if ('yes' == $this->subscribe2_options['newreg_override']) {
|
2037 |
echo " checked=\"checked\"";
|
2038 |
}
|
2039 |
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2040 |
echo "<label><input type=\"radio\" name=\"newreg_override\" value=\"no\"";
|
2041 |
-
if ('no' == $this->subscribe2_options['newreg_override']) {
|
2042 |
echo " checked=\"checked\"";
|
2043 |
}
|
2044 |
echo " />" . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2045 |
echo __('Registration Form option is checked by default', 'subscribe2') . ":<br />\r\n";
|
2046 |
echo "<label><input type=\"radio\" name=\"wpregdef\" value=\"yes\"";
|
2047 |
-
if ('yes' == $this->subscribe2_options['wpregdef']) {
|
2048 |
echo " checked=\"checked\"";
|
2049 |
}
|
2050 |
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2051 |
echo "<label><input type=\"radio\" name=\"wpregdef\" value=\"no\"";
|
2052 |
-
if ('no' == $this->subscribe2_options['wpregdef']) {
|
2053 |
echo " checked=\"checked\"";
|
2054 |
}
|
2055 |
echo " />" . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2056 |
echo __('Auto-subscribe users to receive email as', 'subscribe2') . ": <br />\r\n";
|
2057 |
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"html\"";
|
2058 |
-
if ('html' == $this->subscribe2_options['autoformat']) {
|
2059 |
echo "checked=\"checked\" ";
|
2060 |
}
|
2061 |
echo "/> " . __('HTML', 'subscribe2') ."</label> ";
|
2062 |
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"fulltext\" ";
|
2063 |
-
if ('fulltext' == $this->subscribe2_options['autoformat']) {
|
2064 |
echo "checked=\"checked\" ";
|
2065 |
}
|
2066 |
echo "/> " . __('Plain Text - Full', 'subscribe2') . "</label> ";
|
2067 |
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"text\" ";
|
2068 |
-
if ('text' == $this->subscribe2_options['autoformat']) {
|
2069 |
echo "checked=\"checked\" ";
|
2070 |
}
|
2071 |
echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . "</label><br /><br />";
|
2072 |
echo __('Registered Users have the option to auto-subscribe to new categories', 'subscribe2') . ": <br />\r\n";
|
2073 |
echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"yes\"";
|
2074 |
-
if ('yes' == $this->subscribe2_options['show_autosub']) {
|
2075 |
echo " checked=\"checked\"";
|
2076 |
}
|
2077 |
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2078 |
echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"no\"";
|
2079 |
-
if ('no' == $this->subscribe2_options['show_autosub']) {
|
2080 |
echo " checked=\"checked\"";
|
2081 |
}
|
2082 |
echo " />" . __('No', 'subscribe2') . "</label> ";
|
2083 |
echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"exclude\"";
|
2084 |
-
if ('exclude' == $this->subscribe2_options['show_autosub']) {
|
2085 |
echo " checked=\"checked\"";
|
2086 |
}
|
2087 |
echo " />" .__('New categories are immediately excluded', 'subscribe2') . "</label><br /><br />";
|
2088 |
echo __('Option for Registered Users to auto-subscribe to new categories is checked by default', 'subscribe2') . ": <br />\r\n";
|
2089 |
echo "<label><input type=\"radio\" name=\"autosub_def\" value=\"yes\"";
|
2090 |
-
if ('yes' == $this->subscribe2_options['autosub_def']) {
|
2091 |
echo " checked=\"checked\"";
|
2092 |
}
|
2093 |
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2094 |
echo "<label><input type=\"radio\" name=\"autosub_def\" value=\"no\"";
|
2095 |
-
if ('no' == $this->subscribe2_options['autosub_def']) {
|
2096 |
echo " checked=\"checked\"";
|
2097 |
}
|
2098 |
echo " />" . __('No', 'subscribe2');
|
@@ -2127,15 +2122,15 @@ class s2class {
|
|
2127 |
function user_menu() {
|
2128 |
global $user_ID, $s2nonce;
|
2129 |
|
2130 |
-
if (isset($_GET['email'])) {
|
2131 |
global $wpdb;
|
2132 |
-
$user_ID = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_email = '" . $_GET['email'] . "'");
|
2133 |
} else {
|
2134 |
get_currentuserinfo();
|
2135 |
}
|
2136 |
|
2137 |
// was anything POSTed?
|
2138 |
-
if (
|
2139 |
check_admin_referer('subscribe2-user_subscribers' . $s2nonce);
|
2140 |
|
2141 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Subscription preferences updated.', 'subscribe2') . "</strong></p></div>\n";
|
@@ -2144,37 +2139,37 @@ class s2class {
|
|
2144 |
|
2145 |
$cats = $_POST['category'];
|
2146 |
|
2147 |
-
if (
|
2148 |
$oldcats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
2149 |
-
if ($oldcats) {
|
2150 |
-
foreach ($oldcats as $cat) {
|
2151 |
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat);
|
2152 |
}
|
2153 |
}
|
2154 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
2155 |
-
} elseif ($cats == 'digest') {
|
2156 |
$all_cats = get_categories(array('hide_empty' => false));
|
2157 |
-
foreach ($all_cats as $cat) {
|
2158 |
('' == $catids) ? $catids = "$cat->term_id" : $catids .= ",$cat->term_id";
|
2159 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat->term_id, $cat->term_id);
|
2160 |
}
|
2161 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $catids);
|
2162 |
} else {
|
2163 |
-
if (!is_array($cats)) {
|
2164 |
-
|
2165 |
}
|
2166 |
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
2167 |
$remove = array_diff($old_cats, $cats);
|
2168 |
$new = array_diff($cats, $old_cats);
|
2169 |
-
if (!empty($remove)) {
|
2170 |
// remove subscription to these cat IDs
|
2171 |
-
foreach ($remove as $id) {
|
2172 |
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
2173 |
}
|
2174 |
}
|
2175 |
-
if (!empty($new)) {
|
2176 |
// add subscription to these cat IDs
|
2177 |
-
foreach ($new as $id) {
|
2178 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, $id);
|
2179 |
}
|
2180 |
}
|
@@ -2184,56 +2179,57 @@ class s2class {
|
|
2184 |
|
2185 |
// show our form
|
2186 |
echo "<div class=\"wrap\">";
|
|
|
2187 |
echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
|
2188 |
-
if (isset($_GET['email'])) {
|
2189 |
$user = get_userdata($user_ID);
|
2190 |
echo "<span style=\"color: red;line-height: 300%;\">" . __('Editing Subscribe2 preferences for user', 'subscribe2') . ": " . $user->display_name . "</span>";
|
2191 |
}
|
2192 |
echo "<form method=\"post\" action=\"\">";
|
2193 |
echo "<p>";
|
2194 |
-
if (function_exists('wp_nonce_field')) {
|
2195 |
wp_nonce_field('subscribe2-user_subscribers' . $s2nonce);
|
2196 |
}
|
2197 |
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"user\" />";
|
2198 |
-
if ($this->subscribe2_options['email_freq'] == 'never') {
|
2199 |
echo __('Receive email as', 'subscribe2') . ": ";
|
2200 |
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"html\"";
|
2201 |
-
if ('html' == get_usermeta($user_ID, 's2_format')) {
|
2202 |
echo "checked=\"checked\" ";
|
2203 |
}
|
2204 |
echo "/> " . __('HTML', 'subscribe2') ."</label> ";
|
2205 |
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"post\" ";
|
2206 |
-
if ('post' == get_usermeta($user_ID, 's2_format')) {
|
2207 |
echo "checked=\"checked\" ";
|
2208 |
}
|
2209 |
echo "/> " . __('Plain Text - Full', 'subscribe2') . "</label> ";
|
2210 |
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"excerpt\" ";
|
2211 |
-
if ('excerpt' == get_usermeta($user_ID, 's2_format')) {
|
2212 |
echo "checked=\"checked\" ";
|
2213 |
}
|
2214 |
echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . "</label><br /><br />\r\n";
|
2215 |
|
2216 |
-
if ($this->subscribe2_options['show_autosub'] == 'yes') {
|
2217 |
echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': ';
|
2218 |
echo "<label><input type=\"radio\" name=\"new_category\" value=\"yes\" ";
|
2219 |
-
if ('yes' == get_usermeta($user_ID, 's2_autosub')) {
|
2220 |
echo "checked=\"checked\" ";
|
2221 |
}
|
2222 |
echo "/> " . __('Yes', 'subscribe2') . "</label> ";
|
2223 |
echo "<label><input type=\"radio\" name=\"new_category\" value=\"no\" ";
|
2224 |
-
if ('no' == get_usermeta($user_ID, 's2_autosub')) {
|
2225 |
echo "checked=\"checked\" ";
|
2226 |
}
|
2227 |
-
echo "/> " . __('No', 'subscribe2') . "</label
|
2228 |
echo "</p>";
|
2229 |
}
|
2230 |
|
2231 |
// subscribed categories
|
2232 |
-
if ($this->s2_mu) {
|
2233 |
global $blog_id;
|
2234 |
$subscribed = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
2235 |
// if we are subscribed to the current blog display an "unsubscribe" link
|
2236 |
-
if (!empty($subscribed)) {
|
2237 |
$unsubscribe_link = get_bloginfo('url') . "/wp-admin/?s2mu_unsubscribe=". $blog_id;
|
2238 |
echo "<p><a href=\"". $unsubscribe_link ."\" class=\"button\">" . __('Unsubscribe me from this blog', 'subscribe2') . "</a></p>";
|
2239 |
} else {
|
@@ -2250,14 +2246,14 @@ class s2class {
|
|
2250 |
// we're doing daily digests, so just show
|
2251 |
// subscribe / unnsubscribe
|
2252 |
echo __('Receive periodic summaries of new posts?', 'subscribe2') . ': ';
|
2253 |
-
echo "<
|
2254 |
echo "<input type=\"radio\" name=\"category\" value=\"digest\" ";
|
2255 |
-
if (get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'))) {
|
2256 |
-
echo "checked=\"
|
2257 |
}
|
2258 |
echo "/> " . __('Yes', 'subscribe2') . "</label> <label><input type=\"radio\" name=\"category\" value=\"-1\" ";
|
2259 |
-
if (!get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'))) {
|
2260 |
-
echo "checked=\"
|
2261 |
}
|
2262 |
echo "/> " . __('No', 'subscribe2');
|
2263 |
echo "</label></p>";
|
@@ -2268,23 +2264,24 @@ class s2class {
|
|
2268 |
echo "</form>\r\n";
|
2269 |
|
2270 |
// list of subscribed blogs on wordpress mu
|
2271 |
-
if ($this->s2_mu) {
|
2272 |
global $blog_id;
|
|
|
2273 |
$blogs = get_blog_list(0, 'all');
|
2274 |
|
2275 |
$blogs_subscribed = array();
|
2276 |
$blogs_notsubscribed = array();
|
2277 |
|
2278 |
-
foreach ($blogs as $key => $blog) {
|
2279 |
// switch to blog
|
2280 |
switch_to_blog($blog['blog_id']);
|
2281 |
|
2282 |
// check that the plugin is active on the current blog
|
2283 |
$current_plugins = get_option('active_plugins');
|
2284 |
-
if (!is_array($current_plugins)) {
|
2285 |
$current_plugins = (array)$current_plugins;
|
2286 |
}
|
2287 |
-
if (!in_array('
|
2288 |
continue;
|
2289 |
}
|
2290 |
|
@@ -2292,7 +2289,7 @@ class s2class {
|
|
2292 |
$subscribed = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
2293 |
|
2294 |
$blogname = get_bloginfo('name');
|
2295 |
-
if (strlen($blogname) > 30) {
|
2296 |
$blog['blogname'] = wp_html_excerpt($blogname, 30) . "..";
|
2297 |
} else {
|
2298 |
$blog['blogname'] = $blogname;
|
@@ -2302,7 +2299,7 @@ class s2class {
|
|
2302 |
$blog['subscribe_page'] = get_bloginfo('url') . "/wp-admin/users.php?page=s2_users";
|
2303 |
|
2304 |
$key = strtolower($blog['blogname'] . "-" . $blog['blog_id']);
|
2305 |
-
if (!empty($subscribed)) {
|
2306 |
$blogs_subscribed[$key] = $blog;
|
2307 |
} else {
|
2308 |
$blogs_notsubscribed[$key] = $blog;
|
@@ -2310,17 +2307,17 @@ class s2class {
|
|
2310 |
restore_current_blog();
|
2311 |
}
|
2312 |
|
2313 |
-
if (!empty($blogs_subscribed)) {
|
2314 |
ksort($blogs_subscribed);
|
2315 |
echo "<h2>" . __('Subscribed Blogs', 'subscribe2') . "</h2>\r\n";
|
2316 |
echo "<ul class=\"s2_blogs\">\r\n";
|
2317 |
-
foreach ($blogs_subscribed as $blog) {
|
2318 |
echo "<li><span class=\"name\"><a href=\"" . $blog['blogurl'] . "\" title=\"" . $blog['description'] . "\">" . $blog['blogname'] . "</a></span>\r\n";
|
2319 |
-
if ($
|
2320 |
echo "<span class=\"buttons\">" . __('Viewing Settings Now', 'subscribe2') . "</span>\r\n";
|
2321 |
} else {
|
2322 |
echo "<span class=\"buttons\">";
|
2323 |
-
if (is_blog_user($blog['blog_id'])) {
|
2324 |
echo "<a href=\"". $blog['subscribe_page'] . "\">" . __('View Settings', 'subscribe2') . "</a>\r\n";
|
2325 |
}
|
2326 |
echo "<a href=\"" . $blog['blogurl'] . "/wp-admin/?s2mu_unsubscribe=" . $blog['blog_id'] . "\">" . __('Unsubscribe', 'subscribe2') . "</a></span>\r\n";
|
@@ -2331,17 +2328,17 @@ class s2class {
|
|
2331 |
echo "</ul>\r\n";
|
2332 |
}
|
2333 |
|
2334 |
-
if (!empty($blogs_notsubscribed)) {
|
2335 |
ksort($blogs_notsubscribed);
|
2336 |
echo "<h2>" . __('Subscribe to new blogs', 'subscribe2') . "</h2>\r\n";
|
2337 |
echo "<ul class=\"s2_blogs\">";
|
2338 |
-
foreach ($blogs_notsubscribed as $blog) {
|
2339 |
echo "<li><span class=\"name\"><a href=\"" . $blog['blogurl'] . "\" title=\"" . $blog['description'] . "\">" . $blog['blogname'] . "</a></span>\r\n";
|
2340 |
-
if ($
|
2341 |
echo "<span class=\"buttons\">" . __('Viewing Settings Now', 'subscribe2') . "</span>\r\n";
|
2342 |
} else {
|
2343 |
echo "<span class=\"buttons\">";
|
2344 |
-
if (is_blog_user($blog['blog_id'])) {
|
2345 |
echo "<a href=\"". $blog['subscribe_page'] . "\">" . __('View Settings', 'subscribe2') . "</a>\r\n";
|
2346 |
}
|
2347 |
echo "<a href=\"" . $blog['blogurl'] . "/wp-admin/?s2mu_subscribe=" . $blog['blog_id'] . "\">" . __('Subscribe', 'subscribe2') . "</a></span>\r\n";
|
@@ -2367,32 +2364,32 @@ class s2class {
|
|
2367 |
global $wpdb, $s2nonce, $current_user;
|
2368 |
|
2369 |
// was anything POSTed?
|
2370 |
-
if (isset($_POST['s2_admin']) &&
|
2371 |
check_admin_referer('subscribe2-write_subscribers' . $s2nonce);
|
2372 |
-
if ('confirmed' == $_POST['what']) {
|
2373 |
$recipients = $this->get_public();
|
2374 |
-
} elseif ('unconfirmed' == $_POST['what']) {
|
2375 |
$recipients = $this->get_public(0);
|
2376 |
-
} elseif ('public' == $_POST['what']) {
|
2377 |
$confirmed = $this->get_public();
|
2378 |
$unconfirmed = $this->get_public(0);
|
2379 |
$recipients = array_merge((array)$confirmed, (array)$unconfirmed);
|
2380 |
-
} elseif (is_numeric($_POST['what'])) {
|
2381 |
$cat = intval($_POST['what']);
|
2382 |
$recipients = $this->get_registered("cats=$cat");
|
2383 |
-
} elseif ('all_users' == $_POST['what']) {
|
2384 |
$recipients = $this->get_all_registered();
|
2385 |
} else {
|
2386 |
$recipients = $this->get_registered();
|
2387 |
}
|
2388 |
$subject = $this->substitute(stripslashes(strip_tags($_POST['subject'])));
|
2389 |
$body = $this->substitute(stripslashes($_POST['content']));
|
2390 |
-
if (
|
2391 |
$this->myname = html_entity_decode($current_user->display_name, ENT_QUOTES);
|
2392 |
$this->myemail = $current_user->user_email;
|
2393 |
}
|
2394 |
$status = $this->mail($recipients, $subject, $body, 'text');
|
2395 |
-
if ($status) {
|
2396 |
$message = $this->mail_sent;
|
2397 |
} else {
|
2398 |
global $phpmailer;
|
@@ -2400,16 +2397,18 @@ class s2class {
|
|
2400 |
}
|
2401 |
}
|
2402 |
|
2403 |
-
if ('' != $message) {
|
2404 |
echo "<div id=\"message\" class=\"updated\"><strong><p>" . $message . "</p></strong></div>\r\n";
|
2405 |
}
|
2406 |
// show our form
|
2407 |
-
echo "<div class=\"wrap\"
|
|
|
|
|
2408 |
echo "<form method=\"post\" action=\"\">\r\n";
|
2409 |
-
if (function_exists('wp_nonce_field')) {
|
2410 |
wp_nonce_field('subscribe2-write_subscribers' . $s2nonce);
|
2411 |
}
|
2412 |
-
if (isset($_POST['subject'])) {
|
2413 |
$subject = $_POST['subject'];
|
2414 |
} else {
|
2415 |
$subject = __('A message from', 'subscribe2') . " " . get_option('blogname');
|
@@ -2441,11 +2440,11 @@ class s2class {
|
|
2441 |
$all_cats = get_categories(array('hide_empty' => false));
|
2442 |
$exclude = explode(',', $this->subscribe2_options['exclude']);
|
2443 |
|
2444 |
-
if (0 == $override) {
|
2445 |
// registered users are not allowed to subscribe to
|
2446 |
// excluded categories
|
2447 |
-
foreach ($all_cats as $cat => $term_id) {
|
2448 |
-
if (in_array($all_cats[$cat]->term_id, $exclude)) {
|
2449 |
$cat = (int)$cat;
|
2450 |
unset($all_cats[$cat]);
|
2451 |
}
|
@@ -2460,23 +2459,23 @@ class s2class {
|
|
2460 |
echo "<label><input type=\"checkbox\" name=\"checkall\" value=\"cat_checkall\" /> " . __('Select / Unselect All', 'subscribe2') . "</label>\r\n";
|
2461 |
echo "</td></tr>\r\n";
|
2462 |
echo "<tr valign=\"top\"><td width=\"50%\" align=\"left\">\r\n";
|
2463 |
-
foreach ($all_cats as $cat) {
|
2464 |
-
if (
|
2465 |
echo "</td><td width=\"50%\" align=\"left\">\r\n";
|
2466 |
$j++;
|
2467 |
}
|
2468 |
-
if (0 == $j) {
|
2469 |
echo "<label><input class=\"cat_checkall\" type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
|
2470 |
-
if (in_array($cat->term_id, $selected)) {
|
2471 |
echo " checked=\"checked\" ";
|
2472 |
}
|
2473 |
-
echo " /> <abbr title=\"" . $cat->slug . "\">" . $cat->
|
2474 |
} else {
|
2475 |
echo "<label><input class=\"cat_checkall\" type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
|
2476 |
-
if (in_array($cat->term_id, $selected)) {
|
2477 |
echo " checked=\"checked\" ";
|
2478 |
}
|
2479 |
-
echo " /> <abbr title=\"" . $cat->slug . "\">" . $cat->
|
2480 |
}
|
2481 |
$i++;
|
2482 |
}
|
@@ -2504,60 +2503,60 @@ class s2class {
|
|
2504 |
// count the number of subscribers
|
2505 |
$count['confirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='1'");
|
2506 |
$count['unconfirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='0'");
|
2507 |
-
if (in_array('unconfirmed', $exclude)) {
|
2508 |
$count['public'] = $count['confirmed'];
|
2509 |
-
} elseif (in_array('confirmed', $exclude)) {
|
2510 |
$count['public'] = $count['unconfirmed'];
|
2511 |
} else {
|
2512 |
$count['public'] = ($count['confirmed'] + $count['unconfirmed']);
|
2513 |
}
|
2514 |
-
if ($this->s2_mu) {
|
2515 |
$count['all_users'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
|
2516 |
} else {
|
2517 |
$count['all_users'] = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
|
2518 |
}
|
2519 |
-
if ($this->s2_mu) {
|
2520 |
$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') . "'");
|
2521 |
} else {
|
2522 |
$count['registered'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='" . $this->get_usermeta_keyname('s2_subscribed') . "'");
|
2523 |
}
|
2524 |
$count['all'] = ($count['confirmed'] + $count['unconfirmed'] + $count['all_users']);
|
2525 |
-
if ($this->s2_mu) {
|
2526 |
-
foreach ($all_cats as $cat) {
|
2527 |
$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 . "'");
|
2528 |
}
|
2529 |
} else {
|
2530 |
-
foreach ($all_cats as $cat) {
|
2531 |
$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 . "'");
|
2532 |
}
|
2533 |
}
|
2534 |
|
2535 |
// do have actually have some subscribers?
|
2536 |
-
if (
|
2537 |
// no? bail out
|
2538 |
return;
|
2539 |
}
|
2540 |
|
2541 |
echo "<select name=\"what\">\r\n";
|
2542 |
-
foreach ($who as $whom => $display) {
|
2543 |
-
if (in_array($whom, $exclude)) { continue; }
|
2544 |
-
if (0 == $count[$whom]) { continue; }
|
2545 |
|
2546 |
echo "<option value=\"" . $whom . "\"";
|
2547 |
-
if ($whom == $selected) { echo " selected=\"selected\" "; }
|
2548 |
echo ">$display (" . ($count[$whom]) . ")</option>\r\n";
|
2549 |
}
|
2550 |
|
2551 |
-
if ($count['registered'] > 0) {
|
2552 |
-
foreach ($all_cats as $cat) {
|
2553 |
-
if (in_array($cat->term_id, $exclude)) { continue; }
|
2554 |
echo "<option value=\"" . $cat->term_id . "\"";
|
2555 |
-
if ($cat->term_id == $selected) { echo " selected=\"selected\" "; }
|
2556 |
echo "> " . $cat->name . " (" . $count[$cat->name] . ") </option>\r\n";
|
2557 |
}
|
2558 |
}
|
2559 |
echo "</select>";
|
2560 |
-
if (false !== $submit) {
|
2561 |
echo " <input type=\"submit\" class=\"button-secondary\" value=\"$submit\" />\r\n";
|
2562 |
}
|
2563 |
} // end display_subscriber_dropdown()
|
@@ -2573,9 +2572,9 @@ class s2class {
|
|
2573 |
$admins = $wpdb->get_results($sql);
|
2574 |
|
2575 |
// handle issues from WordPress core where user_level is not set or set low
|
2576 |
-
if (empty($admins)) {
|
2577 |
$role = 'administrator';
|
2578 |
-
if (!class_exists(WP_User_Search)) {
|
2579 |
require(ABSPATH . 'wp-admin/includes/user.php');
|
2580 |
}
|
2581 |
$wp_user_search = new WP_User_Search( '', '', $role);
|
@@ -2584,15 +2583,15 @@ class s2class {
|
|
2584 |
$admins = $wpdb->get_results($sql);
|
2585 |
}
|
2586 |
|
2587 |
-
if ($inc_author) {
|
2588 |
$author[] = (object)array('ID' => 'author', 'display_name' => 'Post Author');
|
2589 |
$admins = array_merge($author, $admins);
|
2590 |
}
|
2591 |
|
2592 |
echo "<select name=\"sender\">\r\n";
|
2593 |
-
foreach ($admins as $admin) {
|
2594 |
echo "<option value=\"" . $admin->ID . "\"";
|
2595 |
-
if ($admin->ID == $this->subscribe2_options['sender']) {
|
2596 |
echo " selected=\"selected\"";
|
2597 |
}
|
2598 |
echo ">" . $admin->display_name . "</option>\r\n";
|
@@ -2610,15 +2609,17 @@ class s2class {
|
|
2610 |
$schedule = (array)wp_get_schedules();
|
2611 |
$schedule = array_merge(array('never' => array('interval' => 0, 'display' => __('For each Post', 'subscribe2'))), $schedule);
|
2612 |
$sort = array();
|
2613 |
-
foreach ((array)$schedule as $key => $value)
|
|
|
|
|
2614 |
asort($sort);
|
2615 |
$schedule_sorted = array();
|
2616 |
-
foreach ($sort as $key => $value) {
|
2617 |
$schedule_sorted[$key] = $schedule[$key];
|
2618 |
}
|
2619 |
-
foreach ($schedule_sorted as $key => $value) {
|
2620 |
echo "<label><input type=\"radio\" name=\"email_freq\" value=\"" . $key . "\"";
|
2621 |
-
if ($key == $this->subscribe2_options['email_freq']) {
|
2622 |
echo " checked=\"checked\" ";
|
2623 |
}
|
2624 |
echo " /> " . $value['display'] . "</label><br />\r\n";
|
@@ -2626,9 +2627,9 @@ class s2class {
|
|
2626 |
echo "<br />" . __('Send Digest Notification at', 'subscribe2') . ": \r\n";
|
2627 |
$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');
|
2628 |
echo "<select name=\"hour\">\r\n";
|
2629 |
-
while ($hour = current($hours)) {
|
2630 |
echo "<option value=\"" . key($hours) . "\"";
|
2631 |
-
if (
|
2632 |
echo " selected=\"selected\"";
|
2633 |
}
|
2634 |
echo ">" . $hour . "</option>\r\n";
|
@@ -2636,14 +2637,14 @@ class s2class {
|
|
2636 |
}
|
2637 |
echo "</select>\r\n";
|
2638 |
echo "<strong><em style=\"color: red\">" . __('This option will work for digest notification sent daily or less frequently', 'subscribe2') . "</em></strong>\r\n";
|
2639 |
-
if ($scheduled_time) {
|
2640 |
$datetime = get_option('date_format') . ' @ ' . get_option('time_format');
|
2641 |
echo "<p>" . __('Current UTC time is', 'subscribe2') . ": \r\n";
|
2642 |
echo "<strong>" . date_i18n($datetime, false, 'gmt') . "</strong></p>\r\n";
|
2643 |
echo "<p>" . __('Current blog time is', 'subscribe2') . ": \r\n";
|
2644 |
echo "<strong>" . date_i18n($datetime) . "</strong></p>\r\n";
|
2645 |
echo "<p>" . __('Next email notification will be sent when your blog time is after', 'subscribe2') . ": \r\n";
|
2646 |
-
echo "<strong>" . date_i18n($datetime,
|
2647 |
} else {
|
2648 |
echo "<br />";
|
2649 |
}
|
@@ -2656,8 +2657,8 @@ class s2class {
|
|
2656 |
global $wpdb, $wp_version, $wpmu_version;
|
2657 |
|
2658 |
// Is this WordPressMU or not?
|
2659 |
-
if (
|
2660 |
-
switch($metaname) {
|
2661 |
case 's2_subscribed':
|
2662 |
case 's2_cat':
|
2663 |
return $wpdb->prefix . $metaname;
|
@@ -2669,30 +2670,31 @@ class s2class {
|
|
2669 |
}
|
2670 |
|
2671 |
/**
|
2672 |
-
Adds a
|
2673 |
*/
|
2674 |
-
function
|
2675 |
-
if ($file ==
|
2676 |
-
$
|
2677 |
-
$links =
|
|
|
2678 |
}
|
2679 |
return $links;
|
2680 |
-
} // end
|
2681 |
|
2682 |
/**
|
2683 |
Adds information to the WordPress registration screen for new users
|
2684 |
*/
|
2685 |
function register_form() {
|
2686 |
-
if ('wpreg' == $this->subscribe2_options['autosub']) {
|
2687 |
echo "<p>\r\n<label>";
|
2688 |
echo __('Check here to Subscribe to email notifications for new posts') . ":<br />\r\n";
|
2689 |
echo "<input type=\"checkbox\" name=\"subscribe\"";
|
2690 |
-
if ('yes' == $this->subscribe2_options['wpregdef']) {
|
2691 |
echo " checked=\"checked\"";
|
2692 |
}
|
2693 |
echo " /></label>\r\n";
|
2694 |
echo "</p>\r\n";
|
2695 |
-
} elseif ('yes' == $this->subscribe2_options['autosub']) {
|
2696 |
echo "<p>\r\n<center>\r\n";
|
2697 |
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";
|
2698 |
echo "</center></p>\r\n";
|
@@ -2703,9 +2705,9 @@ class s2class {
|
|
2703 |
Process function to add action if user selects to subscribe to posts during registration
|
2704 |
*/
|
2705 |
function register_post() {
|
2706 |
-
if ('on' == $_POST['subscribe']) {
|
2707 |
$user = get_userdatabylogin($_POST['user_login']);
|
2708 |
-
if (0 == $user->ID) { return; }
|
2709 |
$this->register($user->ID);
|
2710 |
}
|
2711 |
}
|
@@ -2714,7 +2716,7 @@ class s2class {
|
|
2714 |
Create meta box on write pages
|
2715 |
*/
|
2716 |
function s2_meta_init() {
|
2717 |
-
if (function_exists('add_meta_box')) {
|
2718 |
add_meta_box('subscribe2', __('Subscribe2 Notification Override', 'subscribe2' ), array(&$this, 's2_meta_box'), 'post', 'advanced');
|
2719 |
add_meta_box('subscribe2', __('Subscribe2 Notification Override', 'subscribe2' ), array(&$this, 's2_meta_box'), 'page', 'advanced');
|
2720 |
} else {
|
@@ -2732,7 +2734,7 @@ class s2class {
|
|
2732 |
echo "<input type=\"hidden\" name=\"s2meta_nonce\" id=\"s2meta_nonce\" value=\"" . wp_create_nonce(md5(plugin_basename(__FILE__))) . "\" />";
|
2733 |
echo __("Check here to disable sending of an email notification for this post/page", 'subscribe2');
|
2734 |
echo " <input type=\"checkbox\" name=\"s2_meta_field\" value=\"no\"";
|
2735 |
-
if ($s2mail == 'no') {
|
2736 |
echo " checked=\"checked\"";
|
2737 |
}
|
2738 |
echo " />";
|
@@ -2754,19 +2756,19 @@ class s2class {
|
|
2754 |
Meta box form handler
|
2755 |
*/
|
2756 |
function s2_meta_handler($post_id) {
|
2757 |
-
if (
|
2758 |
|
2759 |
-
if ('page' == $_POST['post_type']) {
|
2760 |
-
if (!current_user_can('edit_page', $post_id)) { return $post_id; }
|
2761 |
} else {
|
2762 |
-
if (!current_user_can('edit_post', $post_id)) { return $post_id; }
|
2763 |
}
|
2764 |
|
2765 |
-
|
2766 |
-
|
2767 |
-
|
2768 |
-
|
2769 |
-
|
2770 |
} // end s2_meta_box_handler()
|
2771 |
|
2772 |
/* ===== template and filter functions ===== */
|
@@ -2774,45 +2776,45 @@ class s2class {
|
|
2774 |
Display our form; also handles (un)subscribe requests
|
2775 |
*/
|
2776 |
function filter($content = '') {
|
2777 |
-
if (
|
2778 |
$this->s2form = $this->form;
|
2779 |
|
2780 |
global $user_ID;
|
2781 |
get_currentuserinfo();
|
2782 |
-
if ($user_ID) {
|
2783 |
-
if (current_user_can('manage_options')) {
|
2784 |
$this->s2form = $this->use_profile_admin;
|
2785 |
} else {
|
2786 |
$this->s2form = $this->use_profile_users;
|
2787 |
}
|
2788 |
}
|
2789 |
-
if (
|
2790 |
global $wpdb, $user_email;
|
2791 |
-
if (!is_email($_POST['email'])) {
|
2792 |
$this->s2form = $this->form . $this->not_an_email;
|
2793 |
-
} elseif ($this->is_barred($_POST['email'])) {
|
2794 |
$this->s2form = $this->form . $this->barred_domain;
|
2795 |
} else {
|
2796 |
$this->email = $_POST['email'];
|
2797 |
$this->ip = $_POST['ip'];
|
2798 |
// does the supplied email belong to a registered user?
|
2799 |
$check = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE user_email = '$this->email'");
|
2800 |
-
if ('' != $check) {
|
2801 |
// this is a registered email
|
2802 |
$this->s2form = $this->please_log_in;
|
2803 |
} else {
|
2804 |
// this is not a registered email
|
2805 |
// what should we do?
|
2806 |
-
if (isset($_POST['subscribe'])) {
|
2807 |
// someone is trying to subscribe
|
2808 |
// lets see if they've tried to subscribe previously
|
2809 |
-
if ('1' !== $this->is_public($this->email)) {
|
2810 |
// the user is unknown or inactive
|
2811 |
$this->add();
|
2812 |
$status = $this->send_confirm('add');
|
2813 |
// set a variable to denote that we've already run, and shouldn't run again
|
2814 |
$this->filtered = 1;
|
2815 |
-
if ($status) {
|
2816 |
$this->s2form = $this->confirmation_sent;
|
2817 |
} else {
|
2818 |
$this->s2form = $this->error;
|
@@ -2822,15 +2824,15 @@ class s2class {
|
|
2822 |
$this->s2form = $this->already_subscribed;
|
2823 |
}
|
2824 |
$this->action = 'subscribe';
|
2825 |
-
} elseif (isset($_POST['unsubscribe'])) {
|
2826 |
// is this email a subscriber?
|
2827 |
-
if (false == $this->is_public($this->email)) {
|
2828 |
$this->s2form = $this->form . $this->not_subscribed;
|
2829 |
} else {
|
2830 |
$status = $this->send_confirm('del');
|
2831 |
// set a variable to denote that we've already run, and shouldn't run again
|
2832 |
$this->filtered = 1;
|
2833 |
-
if ($status) {
|
2834 |
$this->s2form = $this->confirmation_sent;
|
2835 |
} else {
|
2836 |
$this->s2form = $this->error;
|
@@ -2851,7 +2853,7 @@ class s2class {
|
|
2851 |
*/
|
2852 |
function query_filter() {
|
2853 |
// don't interfere if we've already done our thing
|
2854 |
-
if (1 == $this->filtered) { return; }
|
2855 |
|
2856 |
global $wpdb;
|
2857 |
|
@@ -2859,7 +2861,7 @@ class s2class {
|
|
2859 |
return "page_id=" . $this->subscribe2_options['s2page'];
|
2860 |
} else {
|
2861 |
$id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status='publish' LIMIT 1");
|
2862 |
-
if ($id) {
|
2863 |
return "page_id=$id";
|
2864 |
} else {
|
2865 |
return "showposts=1";
|
@@ -2872,7 +2874,7 @@ class s2class {
|
|
2872 |
*/
|
2873 |
function title_filter($title) {
|
2874 |
// don't interfere if we've already done our thing
|
2875 |
-
if (in_the_loop()) {
|
2876 |
return __('Subscription Confirmation', 'subscribe2');
|
2877 |
} else {
|
2878 |
return $title;
|
@@ -2895,11 +2897,11 @@ class s2class {
|
|
2895 |
echo $before_title . $title . $after_title;
|
2896 |
echo "<div class=\"" . $div . "\">";
|
2897 |
$content = s2class::filter('<!--subscribe2-->');
|
2898 |
-
if (!empty($widgetprecontent)) {
|
2899 |
echo $widgetprecontent;
|
2900 |
}
|
2901 |
echo $content;
|
2902 |
-
if (!empty($widgetpostcontent)) {
|
2903 |
echo $widgetpostcontent;
|
2904 |
}
|
2905 |
echo "</div>";
|
@@ -2911,13 +2913,13 @@ class s2class {
|
|
2911 |
*/
|
2912 |
function widget_subscribe2widget_control() {
|
2913 |
$options = $newoptions = get_option('widget_subscribe2widget');
|
2914 |
-
if ($_POST["s2w-submit"]) {
|
2915 |
$newoptions['title'] = strip_tags(stripslashes($_POST["s2w-title"]));
|
2916 |
$newoptions['div'] = sanitize_title(strip_tags(stripslashes($_POST["s2w-div"])));
|
2917 |
$newoptions['widgetprecontent'] = stripslashes($_POST["s2w-widgetprecontent"]);
|
2918 |
$newoptions['widgetpostcontent'] = stripslashes($_POST["s2w-widgetpostcontent"]);
|
2919 |
}
|
2920 |
-
if ($options != $newoptions) {
|
2921 |
$options = $newoptions;
|
2922 |
update_option('widget_subscribe2widget', $options);
|
2923 |
}
|
@@ -2941,7 +2943,7 @@ class s2class {
|
|
2941 |
*/
|
2942 |
function register_subscribe2widget() {
|
2943 |
//Check Sidebar Widget and Subscribe2 plugins are activated
|
2944 |
-
if ( !function_exists('register_sidebar_widget') || !class_exists('s2class')) {
|
2945 |
return;
|
2946 |
} else {
|
2947 |
register_sidebar_widget('Subscribe2', array(&$this, 'widget_subscribe2widget'));
|
@@ -2954,22 +2956,22 @@ class s2class {
|
|
2954 |
global $wpdb;
|
2955 |
$blogs = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
|
2956 |
|
2957 |
-
foreach ($blogs as $blog) {
|
2958 |
switch_to_blog($blog);
|
2959 |
|
2960 |
$sidebars = get_option('sidebars_widgets');
|
2961 |
-
if (
|
2962 |
$changed = false;
|
2963 |
-
foreach ($sidebars as $s =>$sidebar) {
|
2964 |
-
if (
|
2965 |
-
foreach ($sidebar as $w => $widget) {
|
2966 |
-
if ($widget == 'subscribe2widget') {
|
2967 |
$sidebars[$s][$w] = 'subscribe2';
|
2968 |
$changed = true;
|
2969 |
}
|
2970 |
}
|
2971 |
}
|
2972 |
-
if ($changed) {
|
2973 |
update_option('sidebar_widgets', $sidebars);
|
2974 |
}
|
2975 |
}
|
@@ -2980,7 +2982,7 @@ class s2class {
|
|
2980 |
Add hook for Minimeta Widget plugin
|
2981 |
*/
|
2982 |
function add_minimeta() {
|
2983 |
-
if ($this->subscribe2_options['s2page'] != 0) {
|
2984 |
echo "<li><a href=\"" . get_option('siteurl') . "/?page_id=" . $this->subscribe2_options['s2page'] . "\">" . __('[Un]Subscribe to Posts', 'subscribe2') . "</a></li>\r\n";
|
2985 |
}
|
2986 |
} // end add_minimeta()
|
@@ -2991,11 +2993,11 @@ class s2class {
|
|
2991 |
Register our button in the QuickTags bar
|
2992 |
*/
|
2993 |
function button_init() {
|
2994 |
-
if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) { return; }
|
2995 |
-
if ('true' == get_user_option('rich_editing') ) {
|
2996 |
global $wp_db_version;
|
2997 |
//check if we are using WordPress 2.5+
|
2998 |
-
if ($wp_db_version >= 7098) {
|
2999 |
// Use WordPress 2.5+ hooks
|
3000 |
add_filter('mce_external_plugins', array(&$this, 'mce3_plugin'));
|
3001 |
add_filter('mce_buttons', array(&$this, 'mce3_button'));
|
@@ -3007,7 +3009,7 @@ class s2class {
|
|
3007 |
}
|
3008 |
} else {
|
3009 |
buttonsnap_separator();
|
3010 |
-
buttonsnap_jsbutton(WP_CONTENT_URL . '/plugins/
|
3011 |
}
|
3012 |
} // end button_init()
|
3013 |
|
@@ -3015,7 +3017,7 @@ class s2class {
|
|
3015 |
Add buttons for WordPress 2.5+ using built in hooks
|
3016 |
*/
|
3017 |
function mce3_plugin($arr) {
|
3018 |
-
$path = WP_CONTENT_URL . '/plugins/
|
3019 |
$arr['subscribe2'] = $path;
|
3020 |
return $arr;
|
3021 |
}
|
@@ -3038,7 +3040,7 @@ class s2class {
|
|
3038 |
}
|
3039 |
|
3040 |
function tinymce2_before_init() {
|
3041 |
-
$this->fullpath = WP_CONTENT_URL . '/plugins/
|
3042 |
echo "tinyMCE.loadPlugin('subscribe2quicktags', '" . $this->fullpath . "');\n";
|
3043 |
}
|
3044 |
|
@@ -3067,9 +3069,11 @@ class s2class {
|
|
3067 |
Send a daily digest of today's new posts
|
3068 |
*/
|
3069 |
function subscribe2_cron($preview = '') {
|
|
|
|
|
3070 |
global $wpdb;
|
3071 |
|
3072 |
-
if ('' == $preview) {
|
3073 |
// update last_s2cron execution time before completing or bailing
|
3074 |
$now = current_time('mysql');
|
3075 |
$prev = $this->subscribe2_options['last_s2cron'];
|
@@ -3077,20 +3081,20 @@ class s2class {
|
|
3077 |
update_option('subscribe2_options', $this->subscribe2_options);
|
3078 |
|
3079 |
//set up SQL query based on options
|
3080 |
-
if ($this->subscribe2_options['private'] == 'yes' ) {
|
3081 |
$status = "'publish', 'private'";
|
3082 |
} else {
|
3083 |
$status = "'publish'";
|
3084 |
}
|
3085 |
|
3086 |
-
if ($this->subscribe2_options['page'] == 'yes' ) {
|
3087 |
-
$type
|
3088 |
} else {
|
3089 |
$type = "'post'";
|
3090 |
}
|
3091 |
|
3092 |
// collect posts
|
3093 |
-
if ($this->subscribe2_options['cron_order'] == 'desc') {
|
3094 |
$posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content, post_type, post_password, post_date 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");
|
3095 |
} else {
|
3096 |
$posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content, post_type, post_password, post_date 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");
|
@@ -3101,64 +3105,80 @@ class s2class {
|
|
3101 |
}
|
3102 |
|
3103 |
// do we have any posts?
|
3104 |
-
if (empty($posts)) { return; }
|
3105 |
|
3106 |
// if we have posts, let's prepare the digest
|
3107 |
$datetime = get_option('date_format') . ' @ ' . get_option('time_format');
|
3108 |
$all_post_cats = array();
|
|
|
3109 |
$table = '';
|
3110 |
$message_post= '';
|
3111 |
$message_posttime = '';
|
3112 |
-
foreach ($posts as $post) {
|
3113 |
$post_cats = wp_get_post_categories($post->ID);
|
3114 |
$post_cats_string = implode(',', $post_cats);
|
3115 |
$all_post_cats = array_unique(array_merge($all_post_cats, $post_cats));
|
3116 |
$check = false;
|
3117 |
// is the current post assigned to any categories
|
3118 |
// which should not generate a notification email?
|
3119 |
-
foreach (explode(',', $this->subscribe2_options['exclude']) as $cat) {
|
3120 |
-
if (in_array($cat, $post_cats)) {
|
3121 |
$check = true;
|
3122 |
}
|
3123 |
}
|
3124 |
// is the current post set by the user to
|
3125 |
// not generate a notification email?
|
3126 |
$s2mail = get_post_meta($post->ID, 's2mail', true);
|
3127 |
-
if (strtolower(trim($s2mail)) == 'no') {
|
3128 |
$check = true;
|
3129 |
}
|
3130 |
// is the current post private
|
3131 |
// and should this not generate a notification email?
|
3132 |
-
if (
|
3133 |
$check = true;
|
3134 |
}
|
3135 |
// if this post is excluded
|
3136 |
// don't include it in the digest
|
3137 |
-
if ($check) {
|
3138 |
continue;
|
3139 |
}
|
3140 |
('' == $table) ? $table = "* " . $post->post_title : $table .= "\r\n* " . $post->post_title;
|
3141 |
$message_post .= $post->post_title . "\r\n";
|
3142 |
-
$message_post .= get_permalink($post->ID) . "\r\n
|
3143 |
$message_posttime .= $post->post_title . "\r\n";
|
3144 |
$message_posttime .= __('Posted on', 'subscribe2') . ": " . mysql2date($datetime, $post->post_date) . "\r\n";
|
3145 |
-
$message_posttime .= get_permalink($post->ID) . "\r\n
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3146 |
$excerpt = $post->post_excerpt;
|
3147 |
-
if ('' == $excerpt) {
|
3148 |
// no excerpt, is there a <!--more--> ?
|
3149 |
-
|
3150 |
-
|
3151 |
-
|
3152 |
-
|
3153 |
$excerpt = strip_shortcodes($excerpt);
|
3154 |
}
|
3155 |
} else {
|
3156 |
$excerpt = strip_tags($post->post_content);
|
3157 |
-
if (function_exists('strip_shortcodes')) {
|
3158 |
$excerpt = strip_shortcodes($excerpt);
|
3159 |
}
|
3160 |
$words = explode(' ', $excerpt, $this->excerpt_length + 1);
|
3161 |
-
if (count($words) > $this->excerpt_length) {
|
3162 |
array_pop($words);
|
3163 |
array_push($words, '[...]');
|
3164 |
$excerpt = implode(' ', $words);
|
@@ -3176,7 +3196,7 @@ class s2class {
|
|
3176 |
$message_posttime = trim($message_posttime);
|
3177 |
|
3178 |
//sanity check - don't send a mail if the content is empty
|
3179 |
-
if (!$message_post && !$message_posttime && !$table) {
|
3180 |
return;
|
3181 |
}
|
3182 |
|
@@ -3189,17 +3209,16 @@ class s2class {
|
|
3189 |
$email_freq = $this->subscribe2_options['email_freq'];
|
3190 |
$display = $scheds[$email_freq]['display'];
|
3191 |
$subject = "[" . stripslashes(get_option('blogname')) . "] " . $display . " " . __('Digest Email', 'subscribe2');
|
3192 |
-
$mailtext = apply_filters('s2_email_template', $this->subscribe2_options['mailtext']);
|
3193 |
$mailtext = stripslashes($this->substitute($mailtext));
|
3194 |
$mailtext = str_replace("TABLE", $table, $mailtext);
|
3195 |
$mailtext = str_replace("POSTTIME", $message_posttime, $mailtext);
|
3196 |
$mailtext = str_replace("POST", $message_post, $mailtext);
|
3197 |
|
3198 |
// prepare recipients
|
3199 |
-
if ($preview != '') {
|
3200 |
$this->myemail = $preview;
|
3201 |
$this->myname = "Preview";
|
3202 |
-
$this->mail(array($preview), $subject, $mailtext);
|
3203 |
} else {
|
3204 |
$public = $this->get_public();
|
3205 |
$all_post_cats_string = implode(',', $all_post_cats);
|
@@ -3218,15 +3237,15 @@ class s2class {
|
|
3218 |
$this->subscribe2_options = get_option('subscribe2_options');
|
3219 |
|
3220 |
add_action('init', array(&$this, 'subscribe2'));
|
3221 |
-
if ('1' == $this->subscribe2_options['show_button']) {
|
3222 |
add_action('init', array(&$this, 'button_init'));
|
3223 |
}
|
3224 |
// add action to display widget if option is enabled
|
3225 |
-
if ('1' == $this->subscribe2_options['widget']) {
|
3226 |
add_action('plugins_loaded', array(&$this, 'register_subscribe2widget'));
|
3227 |
}
|
3228 |
// add action to handle WPMU subscriptions and unsubscriptions
|
3229 |
-
if (
|
3230 |
add_action('init', array(&$this, 'wpmu_subscribe'));
|
3231 |
}
|
3232 |
} // end s2init()
|
@@ -3234,10 +3253,10 @@ class s2class {
|
|
3234 |
function subscribe2() {
|
3235 |
global $table_prefix, $wp_version, $wpmu_version;
|
3236 |
|
3237 |
-
load_plugin_textdomain('subscribe2', 'wp-content/plugins/' .
|
3238 |
|
3239 |
// Is this WordPressMU or not?
|
3240 |
-
if (
|
3241 |
$this->s2_mu = true;
|
3242 |
} else {
|
3243 |
$this->s2_mu = false;
|
@@ -3245,20 +3264,20 @@ class s2class {
|
|
3245 |
|
3246 |
// do we need to install anything?
|
3247 |
$this->public = $table_prefix . "subscribe2";
|
3248 |
-
if (!mysql_query("DESCRIBE " . $this->public)) { $this->install(); }
|
3249 |
//do we need to upgrade anything?
|
3250 |
-
if (
|
3251 |
add_action('shutdown', array(&$this, 'upgrade'));
|
3252 |
}
|
3253 |
|
3254 |
-
if (isset($_GET['s2'])) {
|
3255 |
// someone is confirming a request
|
3256 |
add_filter('query_string', array(&$this, 'query_filter'));
|
3257 |
add_filter('the_title', array(&$this, 'title_filter'));
|
3258 |
add_filter('the_content', array(&$this, 'confirm'));
|
3259 |
}
|
3260 |
|
3261 |
-
if (
|
3262 |
$date = date('Y-m-d');
|
3263 |
header("Content-Description: File Transfer");
|
3264 |
header("Content-type: application/octet-stream");
|
@@ -3280,7 +3299,7 @@ class s2class {
|
|
3280 |
add_filter('cron_schedules', array(&$this, 'add_weekly_sched'));
|
3281 |
|
3282 |
// add actions for other plugins
|
3283 |
-
if ('1' == $this->subscribe2_options['show_meta']) {
|
3284 |
add_action('wp_meta', array(&$this, 'add_minimeta'), 0);
|
3285 |
}
|
3286 |
// Add filters for Ozh Admin Menu
|
@@ -3291,7 +3310,7 @@ class s2class {
|
|
3291 |
|
3292 |
|
3293 |
// add action to display editor buttons if option is enabled
|
3294 |
-
if ('1' == $this->subscribe2_options['show_button']) {
|
3295 |
add_action('edit_page_form', array(&$this, 's2_edit_form'));
|
3296 |
add_action('edit_form_advanced', array(&$this, 's2_edit_form'));
|
3297 |
}
|
@@ -3302,7 +3321,7 @@ class s2class {
|
|
3302 |
add_action('add_user_to_blog', array(&$this, 'register'), 10, 1);
|
3303 |
|
3304 |
// add actions for processing posts based on per-post or cron email settings
|
3305 |
-
if ($this->subscribe2_options['email_freq'] != 'never') {
|
3306 |
add_action('s2_digest_cron', array(&$this, 'subscribe2_cron'));
|
3307 |
} else {
|
3308 |
add_action('new_to_publish', array(&$this, 'publish'));
|
@@ -3311,7 +3330,7 @@ class s2class {
|
|
3311 |
add_action('private_to_publish', array(&$this, 'publish'));
|
3312 |
add_action('future_to_publish', array(&$this, 'publish'));
|
3313 |
add_action('publish_phone', array(&$this, 'publish_phone'));
|
3314 |
-
if ($this->subscribe2_options['private'] ==
|
3315 |
add_action('new_to_private', array(&$this, 'publish'));
|
3316 |
add_action('draft_to_private', array(&$this, 'publish'));
|
3317 |
add_action('pending_to_private', array(&$this, 'publish'));
|
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: 5.2
|
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
|
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 exacly what you are doing
|
35 |
+
define( 'S2VERSION', '5.2' );
|
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 |
// Pre-2.6 compatibility
|
46 |
+
if ( !defined('WP_CONTENT_URL') ) {
|
47 |
+
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content' );
|
48 |
}
|
49 |
+
if ( !defined('WP_CONTENT_DIR') ) {
|
50 |
+
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
|
51 |
}
|
52 |
|
53 |
/* Include buttonsnap library by Owen Winckler */
|
54 |
+
if ( !class_exists('buttonsnap') ) {
|
55 |
+
require( WP_CONTENT_DIR . '/plugins/' . S2DIR . '/include/buttonsnap.php' );
|
56 |
}
|
57 |
|
58 |
$mysubscribe2 = new s2class;
|
113 |
Hook the menu
|
114 |
*/
|
115 |
function admin_menu() {
|
116 |
+
$s2management = add_management_page(__('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), "level_10", 's2_tools', array(&$this, 'manage_menu'));
|
117 |
add_action("admin_print_scripts-$s2management", array(&$this, 'checkbox_form_js'));
|
118 |
|
119 |
+
$s2options = add_options_page(__('Subscribe2 Options', 'subscribe2'), __('Subscribe2', 'subscribe2'), "level_10", 's2_settings', array(&$this, 'options_menu'));
|
120 |
add_action("admin_print_scripts-$s2options", array(&$this, 'checkbox_form_js'));
|
121 |
add_action("admin_print_scripts-$s2options", array(&$this, 'option_form_js'));
|
122 |
+
add_filter('plugin_row_meta', array(&$this, 'plugin_links'), 10, 2);
|
123 |
|
124 |
+
$s2user = add_users_page(__('Subscriptions', 'subscribe2'), __('Subscriptions', 'subscribe2'), "level_0", 's2_users', array(&$this, 'user_menu'));
|
125 |
add_action("admin_print_scripts-$s2user", array(&$this, 'checkbox_form_js'));
|
126 |
add_action("admin_print_styles-$s2user", array(&$this, 'user_admin_css'));
|
127 |
|
128 |
+
add_submenu_page('post-new.php', __('Mail Subscribers', 'subscribe2'), __('Mail Subscribers', 'subscribe2'), "level_2", 's2_posts', array(&$this, 'write_menu'));
|
129 |
|
130 |
$s2nonce = md5('subscribe2');
|
131 |
} // end admin_menu()
|
134 |
Hook for Admin Drop Down Icons
|
135 |
*/
|
136 |
function ozh_s2_icon() {
|
137 |
+
return WP_CONTENT_URL . '/plugins/' . S2DIR . '/include/email_edit.png';
|
138 |
} // end ozh_s2_icon()
|
139 |
|
140 |
/**
|
141 |
Insert Javascript into admin_header
|
142 |
*/
|
143 |
function checkbox_form_js() {
|
144 |
+
wp_enqueue_script('s2_checkbox', WP_CONTENT_URL . '/plugins/' . S2DIR . '/include/s2_checkbox.js', array('jquery'), '1.0');
|
145 |
} //end checkbox_form_js()
|
146 |
|
147 |
function user_admin_css() {
|
148 |
+
wp_enqueue_style('s2_user_admin', WP_CONTENT_URL . '/plugins/ '. S2DIR . '/include/s2_user_admin.css', array(), '1.0');
|
149 |
}
|
150 |
|
151 |
function option_form_js() {
|
152 |
+
wp_enqueue_script('s2_edit', WP_CONTENT_URL . '/plugins/' . S2DIR . '/include/s2_edit.js', array('jquery'), '1.0');
|
153 |
} // end option_form_js()
|
154 |
|
155 |
/* ===== Install, upgrade, reset ===== */
|
158 |
*/
|
159 |
function install() {
|
160 |
// include upgrade-functions for maybe_create_table;
|
161 |
+
if ( !function_exists('maybe_create_table') ) {
|
162 |
require_once(ABSPATH . 'wp-admin/install-helper.php');
|
163 |
}
|
164 |
$date = date('Y-m-d');
|
181 |
function upgrade() {
|
182 |
global $wpdb, $wp_version, $wpmu_version;
|
183 |
// include upgrade-functions for maybe_create_table;
|
184 |
+
if ( !function_exists('maybe_create_table') ) {
|
185 |
require_once(ABSPATH . 'wp-admin/install-helper.php');
|
186 |
}
|
187 |
$date = date('Y-m-d');
|
191 |
// let's take the time to check process registered users
|
192 |
// existing public subscribers are subscribed to all categories
|
193 |
$users = $this->get_all_registered('ID');
|
194 |
+
if ( !empty($users) ) {
|
195 |
+
foreach ( $users as $user ) {
|
196 |
$this->register($user);
|
197 |
}
|
198 |
}
|
199 |
// update the options table to serialized format
|
200 |
$old_options = $wpdb->get_col("SELECT option_name from $wpdb->options where option_name LIKE 's2%' AND option_name != 's2_future_posts'");
|
201 |
|
202 |
+
if ( !empty($old_options) ) {
|
203 |
+
foreach ( $old_options as $option ) {
|
204 |
$value = get_option($option);
|
205 |
$option_array = substr($option, 3);
|
206 |
$this->subscribe2_options[$option_array] = $value;
|
213 |
update_option('subscribe2_options', $this->subscribe2_options);
|
214 |
|
215 |
// upgrade old wpmu user meta data to new
|
216 |
+
if ( isset($wpmu_version) || strpos($wp_version, 'wordpress-mu') ) {
|
217 |
$this->namechange_subscribe2_widget();
|
218 |
// loop through all users
|
219 |
+
foreach ( $users as $user ) {
|
220 |
// get categories which the user is subscribed to (old ones)
|
221 |
$categories = get_usermeta($user, 's2_subscribed');
|
222 |
$categories = explode(',', $categories);
|
223 |
|
224 |
// load blogs of user (only if we need them)
|
225 |
$blogs = array();
|
226 |
+
if ( count($categories) > 0 && !in_array('-1', $categories) ) {
|
227 |
$blogs = get_blogs_of_user($user, true);
|
228 |
}
|
229 |
|
230 |
+
foreach ( $blogs as $blog_id => $blog ) {
|
231 |
switch_to_blog($blog_id);
|
232 |
|
233 |
$blog_categories = (array)$wpdb->get_col("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category'");
|
234 |
$subscribed_categories = array_intersect($categories, $blog_categories);
|
235 |
+
if ( !empty($subscribed_categories) ) {
|
236 |
+
foreach ( $subscribed_categories as $subscribed_category ) {
|
237 |
update_usermeta($user, $this->get_usermeta_keyname('s2_cat') . $subscribed_category, $subscribed_category);
|
238 |
}
|
239 |
update_usermeta($user, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $subscribed_categories));
|
243 |
|
244 |
// delete old user meta keys
|
245 |
delete_usermeta($user, 's2_subscribed');
|
246 |
+
foreach ( $categories as $cat ) {
|
247 |
delete_usermeta($user, 's2_cat' . $cat);
|
248 |
}
|
249 |
}
|
266 |
Performs string substitutions for subscribe2 mail texts
|
267 |
*/
|
268 |
function substitute($string = '') {
|
269 |
+
if ( '' == $string ) {
|
270 |
return;
|
271 |
}
|
272 |
$string = str_replace("BLOGNAME", get_option('blogname'), $string);
|
273 |
$string = str_replace("BLOGLINK", get_bloginfo('url'), $string);
|
274 |
$string = str_replace("TITLE", stripslashes($this->post_title), $string);
|
275 |
+
$link = "<a href=\"" . $this->permalink . "\">" . $this->permalink . "</a>";
|
276 |
+
$string = str_replace("PERMALINK", $link, $string);
|
277 |
+
if ( strstr($string, "TINYLINK") ) {
|
278 |
$tinylink = file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode($this->permalink));
|
279 |
+
if ( $tinylink !== 'Error' || $tinylink != false ) {
|
280 |
+
$tlink = "<a href=\"" . $tinylink . "\">" . $tinylink . "</a>";
|
281 |
+
$string = str_replace("TINYLINK", $tlink, $string);
|
282 |
} else {
|
283 |
+
$string = str_replace("TINYLINK", $link, $string);
|
284 |
}
|
285 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
$string = str_replace("MYNAME", stripslashes($this->myname), $string);
|
287 |
$string = str_replace("EMAIL", $this->myemail, $string);
|
288 |
$string = str_replace("AUTHORNAME", $this->authorname, $string);
|
296 |
Delivers email to recipients in HTML or plaintext
|
297 |
*/
|
298 |
function mail($recipients = array(), $subject = '', $message = '', $type='text') {
|
299 |
+
if ( empty($recipients) || '' == $message ) { return; }
|
300 |
|
301 |
+
if ( 'html' == $type ) {
|
302 |
$headers = $this->headers('html');
|
303 |
+
if ( 'yes' == $this->subscribe2_options['stylesheet'] ) {
|
304 |
$mailtext = apply_filters('s2_html_email', "<html><head><title>" . $subject . "</title><link rel=\"stylesheet\" href=\"" . get_bloginfo('stylesheet_url') . "\" type=\"text/css\" media=\"screen\" /></head><body>" . $message . "</body></html>");
|
305 |
} else {
|
306 |
$mailtext = apply_filters('s2_html_email', "<html><head><title>" . $subject . "</title></head><body>" . $message . "</body></html>");
|
319 |
// Construct BCC headers for sending or send individual emails
|
320 |
$bcc = '';
|
321 |
natcasesort($recipients);
|
322 |
+
if ( function_exists('wpmq_mail') || $this->subscribe2_options['bcclimit'] == 1 ) {
|
323 |
// BCCLimit is 1 so send individual emails
|
324 |
+
foreach ( $recipients as $recipient ) {
|
325 |
$recipient = trim($recipient);
|
326 |
// sanity check -- make sure we have a valid email
|
327 |
+
if ( !is_email($recipient) ) { continue; }
|
328 |
+
if ( function_exists('wpmq_mail') ) {
|
329 |
@wp_mail($recipient, $subject, $mailtext, $headers, NULL, 0);
|
330 |
} else {
|
331 |
@wp_mail($recipient, $subject, $mailtext, $headers);
|
332 |
}
|
333 |
}
|
334 |
+
return;
|
335 |
+
} elseif ( $this->subscribe2_options['bcclimit'] == 0 ) {
|
|
|
336 |
// we're not using BCCLimit
|
337 |
+
foreach ( $recipients as $recipient ) {
|
338 |
$recipient = trim($recipient);
|
339 |
// sanity check -- make sure we have a valid email
|
340 |
+
if ( !is_email($recipient) ) { continue; }
|
341 |
// and NOT the sender's email, since they'll get a copy anyway
|
342 |
+
if ( !empty($recipient) && $this->myemail != $recipient ) {
|
343 |
('' == $bcc) ? $bcc = "Bcc: $recipient" : $bcc .= ", $recipient";
|
344 |
// Bcc Headers now constructed by phpmailer class
|
345 |
}
|
349 |
// we're using BCCLimit
|
350 |
$count = 1;
|
351 |
$batch = array();
|
352 |
+
foreach ( $recipients as $recipient ) {
|
353 |
$recipient = trim($recipient);
|
354 |
// sanity check -- make sure we have a valid email
|
355 |
+
if ( !is_email($recipient) ) { continue; }
|
356 |
// and NOT the sender's email, since they'll get a copy anyway
|
357 |
+
if ( !empty($recipient) && $this->myemail != $recipient ) {
|
358 |
('' == $bcc) ? $bcc = "Bcc: $recipient" : $bcc .= ", $recipient";
|
359 |
// Bcc Headers now constructed by phpmailer class
|
360 |
}
|
361 |
+
if ( $this->subscribe2_options['bcclimit'] == $count ) {
|
362 |
$count = 0;
|
363 |
$batch[] = $bcc;
|
364 |
$bcc = '';
|
366 |
$count++;
|
367 |
}
|
368 |
// add any partially completed batches to our batch array
|
369 |
+
if ( '' != $bcc ) {
|
370 |
$batch[] = $bcc;
|
371 |
}
|
372 |
}
|
374 |
reset($recipients);
|
375 |
|
376 |
// actually send mail
|
377 |
+
if ( isset($batch) && !empty($batch) ) {
|
378 |
+
foreach ( $batch as $bcc ) {
|
379 |
$newheaders = $headers . "$bcc\r\n";
|
380 |
$status = @wp_mail($this->myemail, $subject, $mailtext, $newheaders);
|
381 |
}
|
390 |
Construct standard set of email headers
|
391 |
*/
|
392 |
function headers($type='text') {
|
393 |
+
if ( empty($this->myname) || empty($this->myemail) ) {
|
394 |
$admin = $this->get_userdata($this->subscribe2_options['sender']);
|
395 |
$this->myname = html_entity_decode($admin->display_name, ENT_QUOTES);
|
396 |
$this->myemail = $admin->user_email;
|
402 |
$headers .= "Precedence: list\nList-Id: " . get_option('blogname') . "\n";
|
403 |
$headers .= "MIME-Version: 1.0\n";
|
404 |
$headers .= "X-Mailer: PHP" . phpversion() . "\n";
|
405 |
+
if ( $type == 'html' ) {
|
406 |
// To send HTML mail, the Content-Type header must be set
|
407 |
$headers .= "Content-Type: " . get_bloginfo('html_type') . "; charset=\"". get_bloginfo('charset') . "\"\n";
|
408 |
} else {
|
416 |
Sends an email notification of a new post
|
417 |
*/
|
418 |
function publish($post = 0, $preview = '') {
|
419 |
+
if ( !$post ) { return $post; }
|
420 |
|
421 |
+
if ( $preview == '' ) {
|
422 |
// we aren't sending a Preview to the current user so carry out checks
|
423 |
$s2mail = get_post_meta($post->ID, 's2mail', true);
|
424 |
+
if ( (isset($_POST['s2_meta_field']) && $_POST['s2_meta_field'] == 'no') || strtolower(trim($s2mail)) == 'no' ) { return $post; }
|
425 |
|
426 |
// are we doing daily digests? If so, don't send anything now
|
427 |
+
if ( $this->subscribe2_options['email_freq'] != 'never' ) { return $post; }
|
428 |
|
429 |
// is the current post a page
|
430 |
// and should this not generate a notification email?
|
431 |
+
if ( $this->subscribe2_options['pages'] == 'no' && $post->post_type == 'page' ) {
|
432 |
return $post;
|
433 |
}
|
434 |
|
435 |
// is this post set in the future?
|
436 |
+
if ( $post->post_date > current_time('mysql') ) {
|
437 |
// bail out
|
438 |
return $post;
|
439 |
}
|
440 |
|
441 |
//Are we sending notifications for password protected posts?
|
442 |
+
if ( $this->subscribe2_options['password'] == "no" && $post->post_password != '' ) {
|
443 |
return $post;
|
444 |
}
|
445 |
|
447 |
$check = false;
|
448 |
// is the current post assigned to any categories
|
449 |
// which should not generate a notification email?
|
450 |
+
foreach ( explode(',', $this->subscribe2_options['exclude']) as $cat ) {
|
451 |
+
if ( in_array($cat, $post_cats) ) {
|
452 |
$check = true;
|
453 |
}
|
454 |
}
|
455 |
|
456 |
+
if ( $check ) {
|
457 |
// hang on -- can registered users subscribe to
|
458 |
// excluded categories?
|
459 |
+
if ( '0' == $this->subscribe2_options['reg_override'] ) {
|
460 |
// nope? okay, let's leave
|
461 |
return $post;
|
462 |
}
|
464 |
|
465 |
// Are we sending notifications for Private posts?
|
466 |
// Action is added if we are, but double check option and post status
|
467 |
+
if ( $this->subscribe2_options['private'] == "yes" && $post->post_status == 'private' ) {
|
468 |
// don't send notification to public users
|
469 |
$check = true;
|
470 |
}
|
471 |
|
472 |
// lets collect our subscribers
|
473 |
+
if ( !$check ) {
|
474 |
// if this post is assigned to an excluded
|
475 |
// category, or is a private post then
|
476 |
// don't send public subscribers a notification
|
480 |
$registered = $this->get_registered("cats=$post_cats_string");
|
481 |
|
482 |
// do we have subscribers?
|
483 |
+
if ( empty($public) && empty($registered) ) {
|
484 |
// if not, no sense doing anything else
|
485 |
return $post;
|
486 |
}
|
489 |
// we set these class variables so that we can avoid
|
490 |
// passing them in function calls a little later
|
491 |
$this->post_title = "<a href=\"" . get_permalink($post->ID) . "\">" . $post->post_title . "</a>";
|
492 |
+
$this->permalink = get_permalink($post->ID);
|
493 |
|
494 |
$author = get_userdata($post->post_author);
|
495 |
$this->authorname = $author->display_name;
|
496 |
|
497 |
// do we send as admin, or post author?
|
498 |
+
if ( 'author' == $this->subscribe2_options['sender'] ) {
|
499 |
// get author details
|
500 |
$user = &$author;
|
501 |
} else {
|
515 |
$mailtext = stripslashes($this->substitute($mailtext));
|
516 |
|
517 |
$plaintext = $post->post_content;
|
518 |
+
if ( function_exists('strip_shortcodes') ) {
|
519 |
$plaintext = strip_shortcodes($plaintext);
|
520 |
}
|
521 |
$gallid = '[gallery id="' . $post->ID . '"]';
|
523 |
$content = apply_filters('the_content', $post->post_content);
|
524 |
$content = str_replace("]]>", "]]>", $content);
|
525 |
$excerpt = $post->post_excerpt;
|
526 |
+
if ( '' == $excerpt ) {
|
527 |
// no excerpt, is there a <!--more--> ?
|
528 |
+
if ( false !== strpos($plaintext, '<!--more-->') ) {
|
529 |
list($excerpt, $more) = explode('<!--more-->', $plaintext, 2);
|
530 |
// strip leading and trailing whitespace
|
531 |
$excerpt = strip_tags($excerpt);
|
548 |
$html_body = str_replace("\r\n", "<br />\r\n", $mailtext);
|
549 |
$html_body = str_replace("POST", $content, $html_body);
|
550 |
|
551 |
+
if ( $preview != '' ) {
|
552 |
$this->myemail = $preview;
|
553 |
$this->myname = "Preview";
|
554 |
$this->mail(array($preview), $subject, $excerpt_body);
|
557 |
} else {
|
558 |
// first we send plaintext summary emails
|
559 |
$registered = $this->get_registered("cats=$post_cats_string&format=excerpt");
|
560 |
+
if ( empty($registered) ) {
|
561 |
$recipients = (array)$public;
|
562 |
+
} elseif ( empty($public) ) {
|
563 |
$recipients = (array)$registered;
|
564 |
} else {
|
565 |
$recipients = array_merge((array)$public, (array)$registered);
|
578 |
Hook Subscribe2 into posts published via email
|
579 |
*/
|
580 |
function publish_phone($id) {
|
581 |
+
if ( !$id ) { return; }
|
582 |
|
583 |
$post = get_post($id);
|
584 |
$this->publish($post);
|
589 |
Send confirmation email to the user
|
590 |
*/
|
591 |
function send_confirm($what = '', $is_remind = false) {
|
592 |
+
if ( $this->filtered == 1 ) { return true; }
|
593 |
+
if ( !$this->email || !$what ) {
|
594 |
return false;
|
595 |
}
|
596 |
$id = $this->get_id($this->email);
|
597 |
+
if ( !$id ) {
|
598 |
return false;
|
599 |
}
|
600 |
|
605 |
//use home instead of siteurl incase index.php is not in core wordpress directory
|
606 |
$link = get_option('home') . "/?s2=";
|
607 |
|
608 |
+
if ( 'add' == $what ) {
|
609 |
$link .= '1';
|
610 |
+
} elseif ( 'del' == $what ) {
|
611 |
$link .= '0';
|
612 |
}
|
613 |
$link .= md5($this->email);
|
616 |
// sort the headers now so we have all substitute information
|
617 |
$mailheaders = $this->headers();
|
618 |
|
619 |
+
if ( $is_remind == true ) {
|
620 |
$body = $this->substitute(stripslashes($this->subscribe2_options['remind_email']));
|
621 |
$subject = $this->substitute(stripslashes($this->subscribe2_options['remind_subject']));
|
622 |
} else {
|
623 |
$body = $this->substitute(stripslashes($this->subscribe2_options['confirm_email']));
|
624 |
+
if ( 'add' == $what ) {
|
625 |
$body = str_replace("ACTION", $this->subscribe, $body);
|
626 |
$subject = str_replace("ACTION", $this->subscribe, $this->subscribe2_options['confirm_subject']);
|
627 |
+
} elseif ( 'del' == $what ) {
|
628 |
$body = str_replace("ACTION", $this->unsubscribe, $body);
|
629 |
$subject = str_replace("ACTION", $this->unsubscribe, $this->subscribe2_options['confirm_subject']);
|
630 |
}
|
643 |
function get_email($id = 0) {
|
644 |
global $wpdb;
|
645 |
|
646 |
+
if ( !$id ) {
|
647 |
return false;
|
648 |
}
|
649 |
return $wpdb->get_var("SELECT email FROM $this->public WHERE id=$id");
|
655 |
function get_id($email = '') {
|
656 |
global $wpdb;
|
657 |
|
658 |
+
if ( !$email ) {
|
659 |
return false;
|
660 |
}
|
661 |
return $wpdb->get_var("SELECT id FROM $this->public WHERE email='$email'");
|
668 |
function activate($email = '') {
|
669 |
global $wpdb;
|
670 |
|
671 |
+
if ( '' == $email ) {
|
672 |
+
if ( '' != $this->email ) {
|
673 |
$email = $this->email;
|
674 |
} else {
|
675 |
return false;
|
676 |
}
|
677 |
}
|
678 |
|
679 |
+
if ( false !== $this->is_public($email) ) {
|
680 |
$check = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE user_email='$this->email'");
|
681 |
+
if ( $check ) { return; }
|
682 |
$wpdb->get_results("UPDATE $this->public SET active='1', ip='$this->ip' WHERE email='$email'");
|
683 |
} else {
|
684 |
global $current_user;
|
690 |
Add an public subscriber to the subscriber table as unconfirmed
|
691 |
*/
|
692 |
function add($email = '') {
|
693 |
+
if ( $this->filtered ==1 ) { return; }
|
694 |
global $wpdb;
|
695 |
|
696 |
+
if ( '' == $email ) {
|
697 |
+
if ( '' != $this->email ) {
|
698 |
$email = $this->email;
|
699 |
} else {
|
700 |
return false;
|
701 |
}
|
702 |
}
|
703 |
|
704 |
+
if ( !is_email($email) ) { return false; }
|
705 |
|
706 |
+
if ( false !== $this->is_public($email) ) {
|
707 |
$wpdb->get_results("UPDATE $this->public SET date=NOW() WHERE email='$email'");
|
708 |
} else {
|
709 |
$wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, ip) VALUES (%s, %d, NOW(), %s)", $email, 0, $this->ip));
|
716 |
function delete($email = '') {
|
717 |
global $wpdb;
|
718 |
|
719 |
+
if ( '' == $email ) {
|
720 |
+
if ( '' != $this->email ) {
|
721 |
$email = $this->email;
|
722 |
} else {
|
723 |
return false;
|
724 |
}
|
725 |
}
|
726 |
|
727 |
+
if ( !is_email($email) ) { return false; }
|
728 |
$wpdb->get_results("DELETE FROM $this->public WHERE email='$email'");
|
729 |
} // end delete()
|
730 |
|
734 |
function toggle($email = '') {
|
735 |
global $wpdb;
|
736 |
|
737 |
+
if ( '' == $email || ! is_email($email) ) { return false; }
|
738 |
|
739 |
// let's see if this is a public user
|
740 |
$status = $this->is_public($email);
|
741 |
+
if ( false === $status ) { return false; }
|
742 |
|
743 |
+
if ( '0' == $status ) {
|
744 |
$wpdb->get_results("UPDATE $this->public SET active='1' WHERE email='$email'");
|
745 |
} else {
|
746 |
$wpdb->get_results("UPDATE $this->public SET active='0' WHERE email='$email'");
|
751 |
Send reminder email to unconfirmed public subscribers
|
752 |
*/
|
753 |
function remind($emails = '') {
|
754 |
+
if ( '' == $emails ) { return false; }
|
755 |
|
756 |
$recipients = explode(",", $emails);
|
757 |
+
if ( !is_array($recipients) ) { $recipients = (array)$recipients; }
|
758 |
+
foreach ( $recipients as $recipient ) {
|
759 |
$this->email = $recipient;
|
760 |
$this->send_confirm('add', true);
|
761 |
}
|
769 |
list($user, $domain) = split('@', $email);
|
770 |
$bar_check = stristr($barred_option, $domain);
|
771 |
|
772 |
+
if ( !empty($bar_check) ) {
|
773 |
return true;
|
774 |
} else {
|
775 |
return false;
|
782 |
function confirm($content = '') {
|
783 |
global $wpdb;
|
784 |
|
785 |
+
if ( 1 == $this->filtered ) { return $content; }
|
786 |
|
787 |
$code = $_GET['s2'];
|
788 |
$action = intval(substr($code, 0, 1));
|
789 |
$hash = substr($code, 1, 32);
|
790 |
$code = str_replace($hash, '', $code);
|
791 |
$id = intval(substr($code, 1));
|
792 |
+
if ( $id ) {
|
793 |
$this->email = $this->get_email($id);
|
794 |
+
if ( !$this->email || $hash !== md5($this->email) ) {
|
795 |
return $this->no_such_email;
|
796 |
}
|
797 |
} else {
|
801 |
// get current status of email so messages are only sent once per emailed link
|
802 |
$current = $this->is_public($this->email);
|
803 |
|
804 |
+
if ( '1' == $action ) {
|
805 |
// make this subscription active
|
806 |
$this->message = $this->added;
|
807 |
+
if ( '1' != $current ) {
|
808 |
$this->ip = getenv('REMOTE_ADDR');
|
809 |
$this->activate();
|
810 |
+
if ( $this->subscribe2_options['admin_email'] == 'subs' || $this->subscribe2_options['admin_email'] == 'both' ) {
|
811 |
$subject = '[' . get_option('blogname') . '] ' . __('New subscription', 'subscribe2');
|
812 |
$subject = html_entity_decode($subject, ENT_QUOTES);
|
813 |
$message = $this->email . " " . __('subscribed to email notifications!', 'subscribe2');
|
814 |
$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'");
|
815 |
$headers = $this->headers();
|
816 |
+
foreach ( $recipients as $recipient ) {
|
817 |
@wp_mail($recipient, $subject, $message, $headers);
|
818 |
}
|
819 |
}
|
820 |
}
|
821 |
$this->filtered = 1;
|
822 |
+
} elseif ( '0' == $action ) {
|
823 |
// remove this subscriber
|
824 |
$this->message = $this->deleted;
|
825 |
+
if ( '0' != $current ) {
|
826 |
$this->delete();
|
827 |
+
if ( $this->subscribe2_options['admin_email'] == 'unsubs' || $this->subscribe2_options['admin_email'] == 'both' ) {
|
828 |
$subject = '[' . get_option('blogname') . '] ' . __('New Unsubscription', 'subscribe2');
|
829 |
$subject = html_entity_decode($subject, ENT_QUOTES);
|
830 |
$message = $this->email . " " . __('unsubscribed from email notifications!', 'subscribe2');
|
831 |
$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'");
|
832 |
$headers = $this->headers();
|
833 |
+
foreach ( $recipients as $recipient ) {
|
834 |
@wp_mail($recipient, $subject, $message, $headers);
|
835 |
}
|
836 |
}
|
838 |
$this->filtered = 1;
|
839 |
}
|
840 |
|
841 |
+
if ( '' != $this->message ) {
|
842 |
return $this->message;
|
843 |
}
|
844 |
} // end confirm()
|
849 |
function is_public($email = '') {
|
850 |
global $wpdb;
|
851 |
|
852 |
+
if ( '' == $email ) { return false; }
|
853 |
|
854 |
$check = $wpdb->get_var("SELECT active FROM $this->public WHERE email='$email'");
|
855 |
+
if ( '0' == $check || '1' == $check ) {
|
856 |
return $check;
|
857 |
} else {
|
858 |
return false;
|
865 |
function is_registered($email = '') {
|
866 |
global $wpdb;
|
867 |
|
868 |
+
if ( '' == $email ) { return false; }
|
869 |
|
870 |
$check = $wpdb->get_var("SELECT email FROM $wpdb->users WHERE user_email='$email'");
|
871 |
+
if ( $check ) {
|
872 |
return true;
|
873 |
} else {
|
874 |
return false;
|
880 |
*/
|
881 |
function get_public($confirmed = 1) {
|
882 |
global $wpdb;
|
883 |
+
if ( 1 == $confirmed ) {
|
884 |
+
if ( '' == $this->all_public ) {
|
885 |
$this->all_public = $wpdb->get_col("SELECT email FROM $this->public WHERE active='1'");
|
886 |
}
|
887 |
return $this->all_public;
|
888 |
} else {
|
889 |
+
if ( '' == $this->all_unconfirmed ) {
|
890 |
$this->all_unconfirmed = $wpdb->get_col("SELECT email FROM $this->public WHERE active='0'");
|
891 |
}
|
892 |
return $this->all_unconfirmed;
|
899 |
function get_all_registered($id = '') {
|
900 |
global $wpdb;
|
901 |
|
902 |
+
if ( $this->s2_mu ) {
|
903 |
+
if ( $id ) {
|
904 |
return $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
|
905 |
} else {
|
906 |
$result = $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
|
908 |
return $wpdb->get_col("SELECT user_email FROM $wpdb->users WHERE ID IN ($ids) AND user_activation_key=''");
|
909 |
}
|
910 |
} else {
|
911 |
+
if ( $id ) {
|
912 |
return $wpdb->get_col("SELECT ID FROM $wpdb->users");
|
913 |
} else {
|
914 |
return $wpdb->get_col("SELECT user_email FROM $wpdb->users");
|
928 |
$subscribers = array();
|
929 |
|
930 |
parse_str($args, $r);
|
931 |
+
if ( !isset($r['format']) )
|
932 |
$r['format'] = 'all';
|
933 |
+
if ( !isset($r['cats']) )
|
934 |
$r['cats'] = '';
|
935 |
|
936 |
$JOIN = ''; $AND = '';
|
937 |
// text or HTML subscribers
|
938 |
+
if ( 'all' != $r['format'] ) {
|
939 |
$JOIN .= "INNER JOIN $wpdb->usermeta AS b ON a.user_id = b.user_id ";
|
940 |
$AND .= " AND b.meta_key='s2_format' AND b.meta_value=";
|
941 |
+
if ( 'html' == $r['format'] ) {
|
942 |
$AND .= "'html'";
|
943 |
+
} elseif ( 'post' == $r['format'] ) {
|
944 |
$AND .= "'post'";
|
945 |
+
} elseif ( 'excerpt' == $r['format'] ) {
|
946 |
$AND .= "'excerpt'";
|
947 |
}
|
948 |
}
|
949 |
|
950 |
// specific category subscribers
|
951 |
+
if ( '' != $r['cats'] ) {
|
952 |
$JOIN .= "INNER JOIN $wpdb->usermeta AS c ON a.user_id = c.user_id ";
|
953 |
$all = '';
|
954 |
+
foreach ( explode(',', $r['cats']) as $cat ) {
|
955 |
('' == $and) ? $and = "c.meta_key='" . $this->get_usermeta_keyname('s2_cat') . "$cat'" : $and .= " OR c.meta_key='" . $this->get_usermeta_keyname('s2_cat') . "$cat'";
|
956 |
}
|
957 |
$AND .= " AND ($and)";
|
958 |
}
|
959 |
|
960 |
+
if ( $this->s2_mu ) {
|
961 |
$sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . "WHERE a.meta_key='" . $wpdb->prefix . "capabilities'" . $AND;
|
962 |
} else {
|
963 |
$sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . "WHERE a.meta_key='" . $this->get_usermeta_keyname('s2_subscribed') . "'" . $AND;
|
964 |
}
|
965 |
$result = $wpdb->get_col($sql);
|
966 |
+
if ( $result ) {
|
967 |
$ids = implode(',', $result);
|
968 |
return $wpdb->get_col("SELECT user_email FROM $wpdb->users WHERE ID IN ($ids) AND user_activation_key = ''");
|
969 |
}
|
973 |
Collects the signup date for all public subscribers
|
974 |
*/
|
975 |
function signup_date($email = '') {
|
976 |
+
if ( '' == $email ) { return false; }
|
977 |
|
978 |
global $wpdb;
|
979 |
+
if ( !empty($this->signup_dates) ) {
|
980 |
return $this->signup_dates[$email];
|
981 |
} else {
|
982 |
$results = $wpdb->get_results("SELECT email, date FROM $this->public", ARRAY_N);
|
983 |
+
foreach ( $results as $result ) {
|
984 |
$this->signup_dates[$result[0]] = $result[1];
|
985 |
}
|
986 |
return $this->signup_dates[$email];
|
991 |
Collects the ip address for all public subscribers
|
992 |
*/
|
993 |
function signup_ip($email = '') {
|
994 |
+
if ( '' == $email ) {return false; }
|
995 |
|
996 |
global $wpdb;
|
997 |
+
if ( !empty($this->signup_ips) ) {
|
998 |
return $this->signup_ips[$email];
|
999 |
} else {
|
1000 |
$results = $wpdb->get_results("SELECT email, ip FROM $this->public", ARRAY_N);
|
1001 |
+
foreach ( $results as $result ) {
|
1002 |
$this->signup_ips[$result[0]] = $result[1];
|
1003 |
}
|
1004 |
return $this->signup_ips[$email];
|
1012 |
function register($user_ID = 0) {
|
1013 |
global $wpdb;
|
1014 |
|
1015 |
+
if ( 0 == $user_ID ) { return $user_ID; }
|
1016 |
$user = get_userdata($user_ID);
|
1017 |
$all_cats = get_categories(array('hide_empty' => false));
|
1018 |
|
1019 |
// Are registered users are allowed to subscribe to excluded categories?
|
1020 |
+
if ( 0 == $this->subscribe2_options['reg_override'] || 'no' == $this->subscribe2_options['newreg_override'] ) {
|
1021 |
$exclude = explode(',', $this->subscribe2_options['exclude']);
|
1022 |
+
foreach ( $all_cats as $cat => $term_id ) {
|
1023 |
+
if ( in_array($all_cats[$cat]->term_id, $exclude) ) {
|
1024 |
$cat = (int)$cat;
|
1025 |
unset($all_cats[$cat]);
|
1026 |
}
|
1027 |
}
|
1028 |
}
|
1029 |
|
1030 |
+
foreach ( $all_cats as $cat ) {
|
1031 |
('' == $cats) ? $cats = "$cat->term_id" : $cats .= ",$cat->term_id";
|
1032 |
}
|
1033 |
|
1034 |
+
if ( '' == $cats ) {
|
1035 |
// sanity check, might occur if all cats excluded and reg_override = 0
|
1036 |
return $user_ID;
|
1037 |
}
|
1038 |
|
1039 |
// has this user previously signed up for email notification?
|
1040 |
+
if ( false !== $this->is_public($user->user_email) ) {
|
1041 |
// delete this user from the public table, and subscribe them to all the categories
|
1042 |
$this->delete($user->user_email);
|
1043 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
|
1044 |
+
foreach ( explode(',', $cats) as $cat ) {
|
1045 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat, "$cat");
|
1046 |
}
|
1047 |
update_usermeta($user_ID, 's2_format', 'excerpt');
|
1049 |
} else {
|
1050 |
// create post format entries for all users
|
1051 |
$check_format = get_usermeta($user_ID, 's2_format');
|
1052 |
+
if ( empty($check_format) ) {
|
1053 |
// ensure existing subscription options are not overwritten on upgrade
|
1054 |
+
if ( 'html' == $this->subscribe2_options['autoformat'] ) {
|
1055 |
update_usermeta($user_ID, 's2_format', 'html');
|
1056 |
+
} elseif ( 'fulltext' == $this->subscribe2_options['autoformat'] ) {
|
1057 |
update_usermeta($user_ID, 's2_format', 'post');
|
1058 |
} else {
|
1059 |
update_usermeta($user_ID, 's2_format', 'excerpt');
|
1060 |
}
|
1061 |
update_usermeta($user_ID, 's2_autosub', $this->subscribe2_options['autosub_def']);
|
1062 |
// if the are no existing subscriptions, create them if, by default if autosub is on
|
1063 |
+
if ( 'yes' == $this->subscribe2_options['autosub'] || ( 'wpreg' == $this->subscribe2_options['autosub'] && 'on' == $_POST['subscribe'] ) ) {
|
1064 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $cats);
|
1065 |
+
foreach ( explode(',', $cats) as $cat ) {
|
1066 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat, "$cat");
|
1067 |
}
|
1068 |
}
|
1069 |
} else {
|
1070 |
// if user is already registered update format remove 's2_excerpt' field and update 's2_format'
|
1071 |
+
if ( 'html' == $check_format ) {
|
1072 |
delete_usermeta($user_ID, 's2_excerpt');
|
1073 |
+
} elseif ( 'text' == $check_format ) {
|
1074 |
update_usermeta($user_ID, 's2_format', get_usermeta($user_ID, 's2_excerpt'));
|
1075 |
delete_usermeta($user_ID, 's2_excerpt');
|
1076 |
}
|
1077 |
}
|
1078 |
$subscribed = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
1079 |
+
if ( strstr($subscribed, '-1') ) {
|
1080 |
// make sure we remove '-1' from any settings
|
1081 |
$old_cats = explode(',', $subscribed);
|
1082 |
$pos = array_search('-1', $old_cats);
|
1092 |
Subscribe all registered users to category selected on Admin Manage Page
|
1093 |
*/
|
1094 |
function subscribe_registered_users($emails = '', $cats = array()) {
|
1095 |
+
if ( '' == $emails || '' == $cats ) { return false; }
|
1096 |
global $wpdb;
|
1097 |
|
1098 |
$useremails = explode(",", $emails);
|
1101 |
$sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ('$useremails')";
|
1102 |
$user_IDs = $wpdb->get_col($sql);
|
1103 |
|
1104 |
+
foreach ( $user_IDs as $user_ID ) {
|
1105 |
$old_cats = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
1106 |
+
if ( !empty($old_cats) ) {
|
1107 |
$old_cats = explode(',', $old_cats);
|
1108 |
$newcats = array_unique(array_merge($cats, $old_cats));
|
1109 |
} else {
|
1110 |
$newcats = $cats;
|
1111 |
}
|
1112 |
+
if ( !empty($newcats) ) {
|
1113 |
// add subscription to these cat IDs
|
1114 |
+
foreach ( $newcats as $id ) {
|
1115 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, "$id");
|
1116 |
}
|
1117 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $newcats));
|
1124 |
Unsubscribe all registered users to category selected on Admin Manage Page
|
1125 |
*/
|
1126 |
function unsubscribe_registered_users($emails = '', $cats = array()) {
|
1127 |
+
if ( '' == $emails || '' == $cats ) { return false; }
|
1128 |
global $wpdb;
|
1129 |
|
1130 |
$useremails = explode(",", $emails);
|
1133 |
$sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ('$useremails')";
|
1134 |
$user_IDs = $wpdb->get_col($sql);
|
1135 |
|
1136 |
+
foreach ( $user_IDs as $user_ID ) {
|
1137 |
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
1138 |
$remain = array_diff($old_cats, $cats);
|
1139 |
+
if ( !empty($remain) ) {
|
1140 |
// remove subscription to these cat IDs and update s2_subscribed
|
1141 |
+
foreach ( $cats as $id ) {
|
1142 |
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
1143 |
}
|
1144 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $remain));
|
1145 |
} else {
|
1146 |
// remove subscription to these cat IDs and update s2_subscribed to ''
|
1147 |
+
foreach ( $cats as $id ) {
|
1148 |
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
1149 |
}
|
1150 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
1160 |
$redirect_to_subscriptionpage = false;
|
1161 |
|
1162 |
// subscribe to new blog
|
1163 |
+
if ( !empty($_GET['s2mu_subscribe']) ) {
|
1164 |
$blog_id = intval($_GET['s2mu_subscribe']);
|
1165 |
+
if ( $blog_id >= 0 ) {
|
1166 |
switch_to_blog($blog_id);
|
1167 |
|
1168 |
$user_ID = get_current_user_id();
|
1169 |
|
1170 |
// if user is not a user of the current blog
|
1171 |
+
if ( !is_blog_user($blog_id) ) {
|
1172 |
// add user to current blog as subscriber
|
1173 |
add_user_to_blog($blog_id, $user_ID, 'subscriber');
|
1174 |
// add an action hook for external manipulation of blog and user data
|
1178 |
// subscribe to all categories by default
|
1179 |
$all_cats = get_categories(array('hide_empty' => false));
|
1180 |
|
1181 |
+
if ( 0 == $this->subscribe2_options['reg_override'] ) {
|
1182 |
// registered users are not allowed to subscribe to excluded categories
|
1183 |
$exclude = explode(',', $this->subscribe2_options['exclude']);
|
1184 |
+
foreach ( $all_cats as $cat => $term ) {
|
1185 |
+
if ( in_array($all_cats[$cat]->term_id, $exclude) ) {
|
1186 |
$cat = (int)$cat;
|
1187 |
unset($all_cats[$cat]);
|
1188 |
}
|
1190 |
}
|
1191 |
|
1192 |
$cats = array();
|
1193 |
+
foreach ( $all_cats as $cat => $term ) {
|
1194 |
$term_id = $term->term_id;
|
1195 |
$cats[] = $term_id;
|
1196 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $term_id, $term_id);
|
1197 |
}
|
1198 |
+
if ( empty($cats) ) {
|
1199 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
1200 |
} else {
|
1201 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $cats));
|
1204 |
// don't restore_current_blog(); -> redirect to new subscription page
|
1205 |
$redirect_to_subscriptionpage = true;
|
1206 |
}
|
1207 |
+
} elseif ( !empty($_GET['s2mu_unsubscribe']) ) {
|
1208 |
// unsubscribe from a blog
|
1209 |
$blog_id = intval($_GET['s2mu_unsubscribe']);
|
1210 |
+
if ( $blog_id >= 0 ) {
|
1211 |
switch_to_blog($blog_id);
|
1212 |
|
1213 |
$user_ID = get_current_user_id();
|
1215 |
// delete subscription to all categories on that blog
|
1216 |
$cats = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
1217 |
$cats = explode(',', $cats);
|
1218 |
+
if ( !is_array($cats) ) {
|
1219 |
$cats = array($cats);
|
1220 |
}
|
1221 |
|
1222 |
+
foreach ( $cats as $id ) {
|
1223 |
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
1224 |
}
|
1225 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
1232 |
}
|
1233 |
}
|
1234 |
|
1235 |
+
if ( $redirect_to_subscriptionpage == true ) {
|
1236 |
+
if ( !is_user_member_of_blog($user_ID) ) {
|
1237 |
$user_blogs = get_active_blog_for_user($user_ID);
|
1238 |
+
if ( is_array($user_blogs) ) {
|
1239 |
switch_to_blog(key($user_blogs));
|
1240 |
} else {
|
1241 |
// no longer a member of a blog
|
1245 |
}
|
1246 |
|
1247 |
// redirect to profile page
|
1248 |
+
if ( current_user_can('manage_options') ) {
|
1249 |
$url = get_option('siteurl') . '/wp-admin/users.php?page=s2_users';
|
1250 |
wp_redirect($url);
|
1251 |
exit();
|
1262 |
if registered user has selected this option
|
1263 |
*/
|
1264 |
function new_category($new_category='') {
|
1265 |
+
if ( 'no' == $this->subscribe2_options['show_autosub'] ) { return; }
|
1266 |
global $wpdb;
|
1267 |
|
1268 |
+
if ( 'yes' == $this->subscribe2_options['show_autosub'] ) {
|
1269 |
$sql = "SELECT DISTINCT user_id FROM $wpdb->usermeta WHERE $wpdb->usermeta.meta_key='s2_autosub' AND $wpdb->usermeta.meta_value='yes'";
|
1270 |
$user_IDs = $wpdb->get_col($sql);
|
1271 |
+
if ( '' == $user_IDs ) { return; }
|
1272 |
|
1273 |
+
foreach ( $user_IDs as $user_ID ) {
|
1274 |
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
1275 |
+
if ( !is_array($old_cats) ) {
|
1276 |
$old_cats = array($old_cats);
|
1277 |
}
|
1278 |
// add subscription to these cat IDs
|
1280 |
$newcats = array_merge($old_cats, (array)$new_category);
|
1281 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), implode(',', $newcats));
|
1282 |
}
|
1283 |
+
} elseif ( 'exclude' == $this->subscribe2_options['show_autosub'] ) {
|
1284 |
$excluded_cats = explode(',', $this->subscribe2_options['exclude']);
|
1285 |
$excluded_cats[] = $new_category;
|
1286 |
$this->subscribe2_options['exclude'] = implode(',', $excluded_cats);
|
1293 |
|
1294 |
$sql = "SELECT DISTINCT user_id FROM $wpdb->usermeta WHERE meta_key='" . $this->get_usermeta_keyname('s2_cat') . "$deleted_category'";
|
1295 |
$user_IDs = $wpdb->get_col($sql);
|
1296 |
+
if ( '' == $user_IDs ) { return; }
|
1297 |
|
1298 |
+
foreach ( $user_IDs as $user_ID ) {
|
1299 |
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
1300 |
+
if ( !is_array($old_cats) ) {
|
1301 |
$old_cats = array($old_cats);
|
1302 |
}
|
1303 |
// add subscription to these cat IDs
|
1313 |
function get_userdata($admin_id) {
|
1314 |
global $wpdb, $userdata;
|
1315 |
|
1316 |
+
if ( is_numeric($admin_id) ) {
|
1317 |
$admin = get_userdata($admin_id);
|
1318 |
+
} elseif ( $admin_id == 'admin' ) {
|
1319 |
//ensure compatibility with < 4.16
|
1320 |
$admin = get_userdata('1');
|
1321 |
} else {
|
1323 |
}
|
1324 |
|
1325 |
// if user record is empty grab the first admin from the database
|
1326 |
+
if ( empty($admin) ) {
|
1327 |
$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";
|
1328 |
$admin = get_userdata($wpdb->get_var($sql));
|
1329 |
}
|
1330 |
|
1331 |
// handle issues from WordPress core where user_level is not set or set low
|
1332 |
+
if ( empty($admin) ) {
|
1333 |
$role = 'administrator';
|
1334 |
+
if ( !class_exists(WP_User_Search) ) {
|
1335 |
require(ABSPATH . 'wp-admin/includes/user.php');
|
1336 |
}
|
1337 |
$wp_user_search = new WP_User_Search( '', '', $role);
|
1352 |
//Get Registered Subscribers for bulk management
|
1353 |
$registered = $this->get_registered();
|
1354 |
$all_users = $this->get_all_registered();
|
1355 |
+
if ( !empty($all_users) ) {
|
1356 |
$emails = implode(",", $all_users);
|
1357 |
}
|
1358 |
|
1359 |
// was anything POSTed ?
|
1360 |
+
if ( isset($_POST['s2_admin']) ) {
|
1361 |
check_admin_referer('subscribe2-manage_subscribers' . $s2nonce);
|
1362 |
+
if ( $_POST['addresses'] ) {
|
1363 |
+
foreach ( preg_split ("/[\s,]+/", $_POST['addresses']) as $email ) {
|
1364 |
+
if ( is_email($email) && $_POST['subscribe'] ) {
|
1365 |
$this->activate($email);
|
1366 |
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) subscribed!', 'subscribe2') . "</strong></p></div>";
|
1367 |
+
} elseif ( is_email($email) && $_POST['unsubscribe'] ) {
|
1368 |
$this->delete($email);
|
1369 |
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) unsubscribed!', 'subscribe2') . "</strong></p></div>";
|
1370 |
}
|
1371 |
}
|
1372 |
echo $message;
|
1373 |
$_POST['what'] = 'confirmed';
|
1374 |
+
} elseif ( $_POST['process'] ) {
|
1375 |
+
if ( $_POST['delete'] ) {
|
1376 |
+
foreach ( $_POST['delete'] as $address ) {
|
1377 |
$this->delete($address);
|
1378 |
}
|
1379 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) deleted!', 'subscribe2') . "</strong></p></div>";
|
1380 |
}
|
1381 |
+
if ( $_POST['confirm'] ) {
|
1382 |
+
foreach ( $_POST['confirm'] as $address ) {
|
1383 |
$this->toggle($address);
|
1384 |
}
|
1385 |
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Status changed!', 'subscribe2') . "</strong></p></div>";
|
1386 |
}
|
1387 |
+
if ( $_POST['unconfirm'] ) {
|
1388 |
+
foreach ( $_POST['unconfirm'] as $address ) {
|
1389 |
$this->toggle($address);
|
1390 |
}
|
1391 |
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Status changed!', 'subscribe2') . "</strong></p></div>";
|
1392 |
}
|
1393 |
echo $message;
|
1394 |
+
} elseif ( $_POST['searchterm'] ) {
|
1395 |
$confirmed = $this->get_public();
|
1396 |
$unconfirmed = $this->get_public(0);
|
1397 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1398 |
+
foreach ( $subscribers as $subscriber ) {
|
1399 |
+
if ( is_numeric(stripos($subscriber, $_POST['searchterm'])) ) {
|
1400 |
$result[] = $subscriber;
|
1401 |
}
|
1402 |
}
|
1403 |
+
} elseif ( $_POST['remind'] ) {
|
1404 |
$this->remind($_POST['reminderemails']);
|
1405 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Reminder Email(s) Sent!', 'subscribe2') . "</strong></p></div>";
|
1406 |
+
} elseif ( $_POST['sub_categories'] && 'subscribe' == $_POST['manage'] ) {
|
1407 |
$this->subscribe_registered_users($_POST['emails'], $_POST['category']);
|
1408 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Subscribed!', 'subscribe2') . "</strong></p></div>";
|
1409 |
+
} elseif ( $_POST['sub_categories'] && 'unsubscribe' == $_POST['manage'] ) {
|
1410 |
$this->unsubscribe_registered_users($_POST['emails'], $_POST['category']);
|
1411 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Registered Users Unsubscribed!', 'subscribe2') . "</strong></p></div>";
|
1412 |
+
} elseif ( $_POST['sub_format'] ) {
|
1413 |
+
if ( $_POST['format'] == 'excerpt' ) {
|
1414 |
$wpdb->get_results("UPDATE $wpdb->usermeta SET meta_value='excerpt' WHERE meta_key='s2_format'");
|
1415 |
+
} elseif ( $_POST['format'] == 'full' ) {
|
1416 |
$wpdb->get_results("UPDATE $wpdb->usermeta SET meta_value='post' WHERE meta_key='s2_format'");
|
1417 |
+
} elseif ( $_POST['format'] == 'html' ) {
|
1418 |
$wpdb->get_results("UPDATE $wpdb->usermeta SET meta_value='html' WHERE meta_key='s2_format'");
|
1419 |
}
|
1420 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Format updated for Registered Users!', 'subscribe2') . "</strong></p></div>";
|
1425 |
$confirmed = $this->get_public();
|
1426 |
$unconfirmed = $this->get_public(0);
|
1427 |
// safety check for our arrays
|
1428 |
+
if ( '' == $confirmed ) { $confirmed = array(); }
|
1429 |
+
if ( '' == $unconfirmed ) { $unconfirmed = array(); }
|
1430 |
+
if ( '' == $registered ) { $registered = array(); }
|
1431 |
+
if ( '' == $all_users ) { $all_users = array(); }
|
1432 |
|
1433 |
$reminderform = false;
|
1434 |
$urlpath = str_replace("\\", "/", S2PATH);
|
1435 |
$urlpath = trailingslashit(get_option('siteurl')) . substr($urlpath,strpos($urlpath, "wp-content/"));
|
1436 |
+
if ( isset($_GET['s2page']) ) {
|
1437 |
$page = (int) $_GET['s2page'];
|
1438 |
} else {
|
1439 |
$page = 1;
|
1440 |
}
|
1441 |
|
1442 |
+
if ( isset($_POST['what']) ) {
|
1443 |
$page = 1;
|
1444 |
+
if ( 'all' == $_POST['what'] ) {
|
1445 |
$what = 'all';
|
1446 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1447 |
+
} elseif ( 'public' == $_POST['what'] ) {
|
1448 |
$what = 'public';
|
1449 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
|
1450 |
+
} elseif ( 'confirmed' == $_POST['what'] ) {
|
1451 |
$what = 'confirmed';
|
1452 |
$subscribers = $confirmed;
|
1453 |
+
} elseif ( 'unconfirmed' == $_POST['what'] ) {
|
1454 |
$what = 'unconfirmed';
|
1455 |
$subscribers = $unconfirmed;
|
1456 |
+
if ( !empty($subscribers) ) {
|
1457 |
$reminderemails = implode(",", $subscribers);
|
1458 |
$reminderform = true;
|
1459 |
}
|
1460 |
+
} elseif ( is_numeric($_POST['what']) ) {
|
1461 |
$what = intval($_POST['what']);
|
1462 |
$subscribers = $this->get_registered("cats=$what");
|
1463 |
+
} elseif ( 'registered' == $_POST['what'] ) {
|
1464 |
$what = 'registered';
|
1465 |
$subscribers = $registered;
|
1466 |
+
} elseif ( 'all_users' == $_POST['what'] ) {
|
1467 |
$what = 'all_users';
|
1468 |
$subscribers = $all_users;
|
1469 |
}
|
1470 |
+
} elseif ( isset($_GET['what']) ) {
|
1471 |
+
if ( 'all' == $_GET['what'] ) {
|
1472 |
$what = 'all';
|
1473 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1474 |
+
} elseif ( 'public' == $_GET['what'] ) {
|
1475 |
$what = 'public';
|
1476 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
|
1477 |
+
} elseif ( 'confirmed' == $_GET['what'] ) {
|
1478 |
$what = 'confirmed';
|
1479 |
$subscribers = $confirmed;
|
1480 |
+
} elseif ( 'unconfirmed' == $_GET['what'] ) {
|
1481 |
$what = 'unconfirmed';
|
1482 |
$subscribers = $unconfirmed;
|
1483 |
+
if ( !empty($subscribers) ) {
|
1484 |
$reminderemails = implode(",", $subscribers);
|
1485 |
$reminderform = true;
|
1486 |
}
|
1487 |
+
} elseif ( is_numeric($_GET['what']) ) {
|
1488 |
$what = intval($_GET['what']);
|
1489 |
$subscribers = $this->get_registered("cats=$what");
|
1490 |
+
} elseif ( 'registered' == $_GET['what'] ) {
|
1491 |
$what = 'registered';
|
1492 |
$subscribers = $registered;
|
1493 |
+
} elseif ( 'all_users' == $_GET['what'] ) {
|
1494 |
$what = 'all_users';
|
1495 |
$subscribers = $all_users;
|
1496 |
}
|
1498 |
$what = 'all';
|
1499 |
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$all_users);
|
1500 |
}
|
1501 |
+
if ( $_POST['searchterm'] ) {
|
1502 |
$subscribers = &$result;
|
1503 |
$what = 'public';
|
1504 |
}
|
1505 |
|
1506 |
+
if ( !empty($subscribers) ) {
|
1507 |
natcasesort($subscribers);
|
1508 |
// Displays a page number strip - adapted from code in Akismet
|
1509 |
$args['what'] = $what;
|
1538 |
|
1539 |
// show our form
|
1540 |
echo "<div class=\"wrap\">";
|
1541 |
+
screen_icon();
|
1542 |
echo "<h2>" . __('Manage Subscribers', 'subscribe2') . "</h2>\r\n";
|
1543 |
echo "<form method=\"post\" action=\"\">\r\n";
|
1544 |
+
if ( function_exists('wp_nonce_field') ) {
|
1545 |
wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
|
1546 |
}
|
1547 |
echo "<h2>" . __('Add/Remove Subscribers', 'subscribe2') . "</h2>\r\n";
|
1557 |
$this->display_subscriber_dropdown($what, __('Filter', 'subscribe2'));
|
1558 |
// show the selected subscribers
|
1559 |
$alternate = '';
|
1560 |
+
if ( !empty($subscribers) ) {
|
1561 |
$exportcsv = implode(",\r\n", $subscribers);
|
1562 |
echo "<table cellpadding=\"2\" cellspacing=\"2\" width=\"100%\">";
|
1563 |
echo "<tr class=\"alternate\"><td width=\"50%\"><input type=\"text\" name=\"searchterm\" value=\"\" /> \r\n";
|
1564 |
echo "<input type=\"submit\" class=\"button-secondary\" name=\"search\" value=\"" . __('Search Subscribers', 'subscribe2') . "\" /></td>\r\n";
|
1565 |
+
if ( $reminderform ) {
|
1566 |
echo "<td width=\"25%\" align=\"right\"><input type=\"hidden\" name=\"reminderemails\" value=\"" . $reminderemails . "\" />\r\n";
|
1567 |
echo "<input type=\"submit\" class=\"button-secondary\" name=\"remind\" value=\"" . __('Send Reminder Email', 'subscribe2') . "\" /></td>\r\n";
|
1568 |
} else {
|
1574 |
}
|
1575 |
|
1576 |
echo "<table class=\"widefat\" cellpadding=\"2\" cellspacing=\"2\">";
|
1577 |
+
if ( !empty($subscribers) ) {
|
1578 |
echo "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
|
1579 |
echo "<td align=\"right\">" . $strip . "</td></tr>\r\n";
|
1580 |
}
|
1581 |
+
if ( !empty($subscribers) ) {
|
1582 |
$subscriber_chunks = array_chunk($subscribers, $this->subscribe2_options['entries']);
|
1583 |
$chunk = $page - 1;
|
1584 |
$subscribers = $subscriber_chunks[$chunk];
|
1594 |
echo "<td align=\"center\"><input type=\"checkbox\" name=\"checkall\" value=\"delete_checkall\" /></td>\r\n";
|
1595 |
echo "<td align=\"left\"><strong>" . __('Select / Unselect All', 'subscribe2') . "</strong></td></tr>\r\n";
|
1596 |
|
1597 |
+
foreach ( $subscribers as $subscriber ) {
|
1598 |
echo "<tr class=\"$alternate\" style=\"height:1.5em;\">";
|
1599 |
echo "<td align=\"center\">\r\n";
|
1600 |
+
if ( in_array($subscriber, $confirmed) ) {
|
1601 |
echo "</td><td align=\"center\">\r\n";
|
1602 |
echo "<input class=\"unconfirm_checkall\" title=\"" . __('Unconfirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"unconfirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
|
1603 |
echo "<td align=\"center\">\r\n";
|
1605 |
echo "</td>\r\n";
|
1606 |
echo "<td><span style=\"color:#006600\">√ </span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
|
1607 |
echo "(<span style=\"color:#006600\"><abbr title=\"" . $this->signup_ip($subscriber) . "\">" . $this->signup_date($subscriber) . "</abbr></span>)\r\n";
|
1608 |
+
} elseif ( in_array($subscriber, $unconfirmed) ) {
|
1609 |
echo "<input class=\"confirm_checkall\" title=\"" . __('Confirm this email address', 'subscribe2') . "\" type=\"checkbox\" name=\"confirm[]\" value=\"" . $subscriber . "\" /></td>\r\n";
|
1610 |
echo "<td align=\"center\"></td>\r\n";
|
1611 |
echo "<td align=\"center\">\r\n";
|
1613 |
echo "</td>\r\n";
|
1614 |
echo "<td><span style=\"color:#FF0000\"> ! </span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
|
1615 |
echo "(<span style=\"color:#FF0000\"><abbr title=\"" . $this->signup_ip($subscriber) . "\">" . $this->signup_date($subscriber) . "</abbr></span>)\r\n";
|
1616 |
+
} elseif ( in_array($subscriber, $all_users) ) {
|
1617 |
echo "</td><td align=\"center\"></td><td align=\"center\"></td>\r\n";
|
1618 |
echo "<td><span style=\"color:#006600\">® </span><a href=\"mailto:" . $subscriber . "\">" . $subscriber . "</a>\r\n";
|
1619 |
+
echo "(<a href=\"" . get_option('siteurl') . "/wp-admin/users.php?page=s2_users&email=" . urlencode($subscriber) . "\">" . __('edit', 'subscribe2') . "</a>)\r\n";
|
1620 |
}
|
1621 |
echo "</td></tr>\r\n";
|
1622 |
('alternate' == $alternate) ? $alternate = '' : $alternate = 'alternate';
|
1623 |
}
|
1624 |
} else {
|
1625 |
+
if ( $_POST['searchterm'] ) {
|
1626 |
echo "<tr><td align=\"center\"><b>" . __('No matching subscribers found', 'subscribe2') . "</b></td></tr>\r\n";
|
1627 |
} else {
|
1628 |
echo "<tr><td align=\"center\"><b>" . __('NONE', 'subscribe2') . "</b></td></tr>\r\n";
|
1629 |
}
|
1630 |
}
|
1631 |
+
if ( !empty($subscribers) ) {
|
1632 |
echo "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" class=\"button-secondary\" name=\"process\" value=\"" . __('Process', 'subscribe2') . "\" /></td>\r\n";
|
1633 |
echo "<td align=\"right\">" . $strip . "</td></tr>\r\n";
|
1634 |
}
|
1665 |
global $s2nonce;
|
1666 |
|
1667 |
// was anything POSTed?
|
1668 |
+
if ( isset( $_POST['s2_admin']) ) {
|
1669 |
check_admin_referer('subscribe2-options_subscribers' . $s2nonce);
|
1670 |
+
if ( $_POST['reset'] ) {
|
1671 |
$this->reset();
|
1672 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>$this->options_reset</strong></p></div>";
|
1673 |
+
} elseif ( $_POST['preview'] ) {
|
1674 |
global $user_email;
|
1675 |
+
if ( 'never' == $this->subscribe2_options['email_freq'] ) {
|
1676 |
$post = get_posts('numberposts=1');
|
1677 |
$this->publish($post[0], $user_email);
|
1678 |
} else {
|
1679 |
+
$this->subscribe2_cron($user_email);
|
1680 |
}
|
1681 |
+
} elseif ( $_POST['submit'] ) {
|
1682 |
// BCClimit
|
1683 |
+
if ( is_numeric($_POST['bcc']) && $_POST['bcc'] >= 0 ) {
|
1684 |
$this->subscribe2_options['bcclimit'] = $_POST['bcc'];
|
1685 |
}
|
1686 |
// admin_email
|
1688 |
|
1689 |
// send as author or admin?
|
1690 |
$sender = 'author';
|
1691 |
+
if ( is_numeric($_POST['sender']) ) {
|
1692 |
$sender = $_POST['sender'];
|
1693 |
}
|
1694 |
$this->subscribe2_options['sender'] = $sender;
|
1703 |
// send per-post or digest emails
|
1704 |
$email_freq = $_POST['email_freq'];
|
1705 |
$scheduled_time = wp_next_scheduled('s2_digest_cron');
|
1706 |
+
if ( $email_freq != $this->subscribe2_options['email_freq'] || $_POST['hour'] != date('H', $scheduled_time) ) {
|
1707 |
$this->subscribe2_options['email_freq'] = $email_freq;
|
1708 |
wp_clear_scheduled_hook('s2_digest_cron');
|
1709 |
$scheds = (array)wp_get_schedules();
|
1710 |
$interval = ( isset($scheds[$email_freq]['interval']) ) ? (int) $scheds[$email_freq]['interval'] : 0;
|
1711 |
+
if ( $interval == 0 ) {
|
1712 |
// if we are on per-post emails remove last_cron entry
|
1713 |
unset($this->subscribe2_options['last_s2cron']);
|
1714 |
} else {
|
1715 |
// if we are using digest schedule the event and prime last_cron as now
|
1716 |
$time = time() + $interval;
|
1717 |
+
if ( $interval < 86400 ) {
|
1718 |
// Schedule CRON events occurring less than daily starting now and periodically thereafter
|
1719 |
$timestamp = &$time;
|
1720 |
} else {
|
1722 |
$timestamp = mktime($_POST['hour'], 0, 0, date('m', $time), date('d', $time), date('Y', $time));
|
1723 |
}
|
1724 |
wp_schedule_event($timestamp, $email_freq, 's2_digest_cron');
|
1725 |
+
if ( !isset($this->subscribe2_options['last_s2cron']) ) {
|
1726 |
$this->subscribe2_options['last_s2cron'] = current_time('mysql');
|
1727 |
}
|
1728 |
}
|
1730 |
|
1731 |
// email subject and body templates
|
1732 |
// ensure that are not empty before updating
|
1733 |
+
if ( !empty($_POST['notification_subject']) ) {
|
1734 |
$this->subscribe2_options['notification_subject'] = $_POST['notification_subject'];
|
1735 |
}
|
1736 |
+
if ( !empty($_POST['mailtext']) ) {
|
1737 |
$this->subscribe2_options['mailtext'] = $_POST['mailtext'];
|
1738 |
}
|
1739 |
+
if ( !empty($_POST['confirm_subject']) ) {
|
1740 |
$this->subscribe2_options['confirm_subject'] = $_POST['confirm_subject'];
|
1741 |
}
|
1742 |
+
if ( !empty($_POST['confirm_email']) ) {
|
1743 |
$this->subscribe2_options['confirm_email'] = $_POST['confirm_email'];
|
1744 |
}
|
1745 |
+
if ( !empty($_POST['remind_subject']) ) {
|
1746 |
$this->subscribe2_options['remind_subject'] = $_POST['remind_subject'];
|
1747 |
}
|
1748 |
+
if ( !empty($_POST['remind_email']) ) {
|
1749 |
$this->subscribe2_options['remind_email'] = $_POST['remind_email'];
|
1750 |
}
|
1751 |
|
1752 |
// excluded categories
|
1753 |
+
if ( !empty($_POST['category']) ) {
|
1754 |
$exclude_cats = implode(',', $_POST['category']);
|
1755 |
} else {
|
1756 |
$exclude_cats = '';
|
1757 |
}
|
1758 |
$this->subscribe2_options['exclude'] = $exclude_cats;
|
1759 |
// allow override?
|
1760 |
+
( isset($_POST['reg_override']) ) ? $override = '1' : $override = '0';
|
1761 |
$this->subscribe2_options['reg_override'] = $override;
|
1762 |
|
1763 |
// default WordPress page where Subscribe2 token is placed
|
1764 |
+
if ( is_numeric($_POST['page']) && $_POST['page'] >= 0 ) {
|
1765 |
$this->subscribe2_options['s2page'] = $_POST['page'];
|
1766 |
}
|
1767 |
|
1768 |
// Number of subscriber per page
|
1769 |
+
if ( is_numeric($_POST['entries']) && $_POST['entries'] > 0 ) {
|
1770 |
$this->subscribe2_options['entries'] =$_POST['entries'];
|
1771 |
}
|
1772 |
|
1773 |
// show meta link?
|
1774 |
+
( $_POST['show_meta'] == '1' ) ? $showmeta = '1' : $showmeta = '0';
|
1775 |
$this->subscribe2_options['show_meta'] = $showmeta;
|
1776 |
|
1777 |
// show button?
|
1778 |
+
( $_POST['show_button'] == '1' ) ? $showbutton = '1' : $showbutton = '0';
|
1779 |
$this->subscribe2_options['show_button'] = $showbutton;
|
1780 |
|
1781 |
// show widget in Presentation->Widgets
|
1782 |
+
( $_POST['widget'] == '1' ) ? $showwidget = '1' : $showwidget = '0';
|
1783 |
$this->subscribe2_options['widget'] = $showwidget;
|
1784 |
|
1785 |
//automatic subscription
|
1799 |
}
|
1800 |
// show our form
|
1801 |
echo "<div class=\"wrap\">";
|
1802 |
+
screen_icon();
|
1803 |
echo "<h2>" . __('Subscribe2 Settings', 'subscribe2') . "</h2>\r\n";
|
1804 |
echo "<a href=\"http://subscribe2.wordpress.com/\">" . __('Plugin Blog', 'subscribe2') . "</a> | ";
|
1805 |
echo "<a href=\"http://getsatisfaction.com/subscribe2/\">" . __('Support Forum', 'subscribe2') . "</a> | ";
|
1806 |
echo "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904\">" . __('Make a donation via PayPal', 'subscribe2') . "</a>";
|
1807 |
echo "<form method=\"post\" action=\"\">\r\n";
|
1808 |
+
if ( function_exists('wp_nonce_field') ) {
|
1809 |
wp_nonce_field('subscribe2-options_subscribers' . $s2nonce);
|
1810 |
}
|
1811 |
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"options\" />\r\n";
|
1825 |
|
1826 |
echo "<br /><br />" . __('Send Admins notifications for new', 'subscribe2') . ': ';
|
1827 |
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"subs\"";
|
1828 |
+
if ( 'subs' == $this->subscribe2_options['admin_email'] ) {
|
1829 |
echo " checked=\"checked\"";
|
1830 |
}
|
1831 |
echo " /> " . __('Subscriptions', 'subscribe2') . "</label> ";
|
1832 |
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"unsubs\"";
|
1833 |
+
if ( 'unsubs' == $this->subscribe2_options['admin_email'] ) {
|
1834 |
echo " checked=\"checked\"";
|
1835 |
}
|
1836 |
echo " /> " . __('Unsubscriptions', 'subscribe2') . "</label> ";
|
1837 |
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"both\"";
|
1838 |
+
if ( 'both' == $this->subscribe2_options['admin_email'] ) {
|
1839 |
echo " checked=\"checked\"";
|
1840 |
}
|
1841 |
echo " /> " . __('Both', 'subscribe2') . "</label> ";
|
1842 |
echo "<label><input type=\"radio\" name=\"admin_email\" value=\"none\"";
|
1843 |
+
if ( 'none' == $this->subscribe2_options['admin_email'] ) {
|
1844 |
echo " checked=\"checked\"";
|
1845 |
}
|
1846 |
echo " /> " . __('Neither', 'subscribe2') . "</label><br /><br />\r\n";
|
1847 |
|
1848 |
echo __('Include theme CSS stylesheet in HTML notifications', 'subscribe2') . ': ';
|
1849 |
echo "<label><input type=\"radio\" name=\"stylesheet\" value=\"yes\"";
|
1850 |
+
if ( 'yes' == $this->subscribe2_options['stylesheet'] ) {
|
1851 |
echo " checked=\"checked\"";
|
1852 |
}
|
1853 |
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
1854 |
echo "<label><input type=\"radio\" name=\"stylesheet\" value=\"no\"";
|
1855 |
+
if ( 'no' == $this->subscribe2_options['stylesheet'] ) {
|
1856 |
echo " checked=\"checked\"";
|
1857 |
}
|
1858 |
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
1859 |
|
1860 |
echo __('Send Emails for Pages', 'subscribe2') . ': ';
|
1861 |
echo "<label><input type=\"radio\" name=\"pages\" value=\"yes\"";
|
1862 |
+
if ( 'yes' == $this->subscribe2_options['pages'] ) {
|
1863 |
echo " checked=\"checked\"";
|
1864 |
}
|
1865 |
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
1866 |
echo "<label><input type=\"radio\" name=\"pages\" value=\"no\"";
|
1867 |
+
if ( 'no' == $this->subscribe2_options['pages'] ) {
|
1868 |
echo " checked=\"checked\"";
|
1869 |
}
|
1870 |
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
1871 |
echo __('Send Emails for Password Protected Posts', 'subscribe2') . ': ';
|
1872 |
echo "<label><input type=\"radio\" name=\"password\" value=\"yes\"";
|
1873 |
+
if ( 'yes' == $this->subscribe2_options['password'] ) {
|
1874 |
echo " checked=\"checked\"";
|
1875 |
}
|
1876 |
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
1877 |
echo "<label><input type=\"radio\" name=\"password\" value=\"no\"";
|
1878 |
+
if ( 'no' == $this->subscribe2_options['password'] ) {
|
1879 |
echo " checked=\"checked\"";
|
1880 |
}
|
1881 |
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
1882 |
echo __('Send Emails for Private Posts', 'subscribe2') . ': ';
|
1883 |
echo "<label><input type=\"radio\" name=\"private\" value=\"yes\"";
|
1884 |
+
if ( 'yes' == $this->subscribe2_options['private'] ) {
|
1885 |
echo " checked=\"checked\"";
|
1886 |
}
|
1887 |
echo " /> " . __('Yes', 'subscribe2') . "</label> ";
|
1888 |
echo "<label><input type=\"radio\" name=\"private\" value=\"no\"";
|
1889 |
+
if ( 'no' == $this->subscribe2_options['private'] ) {
|
1890 |
echo " checked=\"checked\"";
|
1891 |
}
|
1892 |
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
1894 |
echo "<label>\r\n";
|
1895 |
$this->admin_dropdown(true);
|
1896 |
echo "</label><br /><br />\r\n";
|
1897 |
+
if ( function_exists('wp_schedule_event') ) {
|
1898 |
echo __('Send Emails', 'subscribe2') . ": <br /><br />\r\n";
|
1899 |
$this->display_digest_choices();
|
1900 |
echo __('For digest notifications, date order for posts is', 'subscribe2') . ": \r\n";
|
1901 |
echo "<label><input type=\"radio\" name=\"cron_order\" value=\"desc\"";
|
1902 |
+
if ( 'desc' == $this->subscribe2_options['cron_order'] ) {
|
1903 |
echo " checked=\"checked\"";
|
1904 |
}
|
1905 |
echo " /> " . __('Descending', 'subscribe2') . "</label> ";
|
1906 |
echo "<label><input type=\"radio\" name=\"cron_order\" value=\"asc\"";
|
1907 |
+
if ( 'asc' == $this->subscribe2_options['cron_order'] ) {
|
1908 |
echo " checked=\"checked\"";
|
1909 |
}
|
1910 |
echo " /> " . __('Ascending', 'subscribe2') . "</label><br /><br />\r\n";
|
1932 |
echo "<dt><b>TABLE</b></dt><dd>" . __("a list of post titles<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
1933 |
echo "<dt><b>PERMALINK</b></dt><dd>" . __("the post's permalink<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
|
1934 |
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";
|
|
|
1935 |
echo "<dt><b>MYNAME</b></dt><dd>" . __("the admin or post author's name", 'subscribe2') . "</dd>\r\n";
|
1936 |
echo "<dt><b>EMAIL</b></dt><dd>" . __("the admin or post author's email", 'subscribe2') . "</dd>\r\n";
|
1937 |
echo "<dt><b>AUTHORNAME</b></dt><dd>" . __("the post author's name", 'subscribe2') . "</dd>\r\n";
|
1958 |
echo"</p>";
|
1959 |
$this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
|
1960 |
echo "<center><label><input type=\"checkbox\" name=\"reg_override\" value=\"1\"";
|
1961 |
+
if ( '1' == $this->subscribe2_options['reg_override'] ) {
|
1962 |
echo " checked=\"checked\"";
|
1963 |
}
|
1964 |
echo " /> " . __('Allow registered users to subscribe to excluded categories?', 'subscribe2') . "</label></center><br />\r\n";
|
1987 |
|
1988 |
// show link to WordPress page in meta
|
1989 |
echo "<br /><br /><label><input type=\"checkbox\" name=\"show_meta\" value=\"1\"";
|
1990 |
+
if ( '1' == $this->subscribe2_options['show_meta'] ) {
|
1991 |
echo " checked=\"checked\"";
|
1992 |
}
|
1993 |
echo " /> " . __('Show a link to your subscription page in "meta"?', 'subscribe2') . "</label><br /><br />\r\n";
|
1994 |
|
1995 |
// show QuickTag button
|
1996 |
echo "<label><input type=\"checkbox\" name=\"show_button\" value=\"1\"";
|
1997 |
+
if ( '1' == $this->subscribe2_options['show_button'] ) {
|
1998 |
echo " checked=\"checked\"";
|
1999 |
}
|
2000 |
echo " /> " . __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "</label><br /><br />\r\n";
|
2001 |
|
2002 |
// show Widget
|
2003 |
echo "<label><input type=\"checkbox\" name=\"widget\" value=\"1\"";
|
2004 |
+
if ( '1' == $this->subscribe2_options['widget'] ) {
|
2005 |
echo " checked=\"checked\"";
|
2006 |
}
|
2007 |
echo " /> " . __('Enable Subscribe2 Widget?', 'subscribe2') . "</label><br /><br />\r\n";
|
2012 |
echo"<p>";
|
2013 |
echo __('Subscribe new users registering with your blog', 'subscribe2') . ":<br />\r\n";
|
2014 |
echo "<label><input type=\"radio\" name=\"autosub\" value=\"yes\"";
|
2015 |
+
if ( 'yes' == $this->subscribe2_options['autosub'] ) {
|
2016 |
echo " checked=\"checked\"";
|
2017 |
}
|
2018 |
echo " /> " . __('Automatically', 'subscribe2') . "</label> ";
|
2019 |
echo "<label><input type=\"radio\" name=\"autosub\" value=\"wpreg\"";
|
2020 |
+
if ( 'wpreg' == $this->subscribe2_options['autosub'] ) {
|
2021 |
echo " checked=\"checked\"";
|
2022 |
}
|
2023 |
echo " /> " . __('Display option on Registration Form', 'subscribe2') . "</label> ";
|
2024 |
echo "<label><input type=\"radio\" name=\"autosub\" value=\"no\"";
|
2025 |
+
if ( 'no' == $this->subscribe2_options['autosub'] ) {
|
2026 |
echo " checked=\"checked\"";
|
2027 |
}
|
2028 |
echo " /> " . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2029 |
echo __('Auto-subscribe includes any excluded categories', 'subscribe2') . ":<br />\r\n";
|
2030 |
echo "<label><input type=\"radio\" name=\"newreg_override\" value=\"yes\"";
|
2031 |
+
if ( 'yes' == $this->subscribe2_options['newreg_override'] ) {
|
2032 |
echo " checked=\"checked\"";
|
2033 |
}
|
2034 |
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2035 |
echo "<label><input type=\"radio\" name=\"newreg_override\" value=\"no\"";
|
2036 |
+
if ( 'no' == $this->subscribe2_options['newreg_override'] ) {
|
2037 |
echo " checked=\"checked\"";
|
2038 |
}
|
2039 |
echo " />" . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2040 |
echo __('Registration Form option is checked by default', 'subscribe2') . ":<br />\r\n";
|
2041 |
echo "<label><input type=\"radio\" name=\"wpregdef\" value=\"yes\"";
|
2042 |
+
if ( 'yes' == $this->subscribe2_options['wpregdef'] ) {
|
2043 |
echo " checked=\"checked\"";
|
2044 |
}
|
2045 |
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2046 |
echo "<label><input type=\"radio\" name=\"wpregdef\" value=\"no\"";
|
2047 |
+
if ( 'no' == $this->subscribe2_options['wpregdef'] ) {
|
2048 |
echo " checked=\"checked\"";
|
2049 |
}
|
2050 |
echo " />" . __('No', 'subscribe2') . "</label><br /><br />\r\n";
|
2051 |
echo __('Auto-subscribe users to receive email as', 'subscribe2') . ": <br />\r\n";
|
2052 |
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"html\"";
|
2053 |
+
if ( 'html' == $this->subscribe2_options['autoformat'] ) {
|
2054 |
echo "checked=\"checked\" ";
|
2055 |
}
|
2056 |
echo "/> " . __('HTML', 'subscribe2') ."</label> ";
|
2057 |
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"fulltext\" ";
|
2058 |
+
if ( 'fulltext' == $this->subscribe2_options['autoformat'] ) {
|
2059 |
echo "checked=\"checked\" ";
|
2060 |
}
|
2061 |
echo "/> " . __('Plain Text - Full', 'subscribe2') . "</label> ";
|
2062 |
echo "<label><input type=\"radio\" name=\"autoformat\" value=\"text\" ";
|
2063 |
+
if ( 'text' == $this->subscribe2_options['autoformat'] ) {
|
2064 |
echo "checked=\"checked\" ";
|
2065 |
}
|
2066 |
echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . "</label><br /><br />";
|
2067 |
echo __('Registered Users have the option to auto-subscribe to new categories', 'subscribe2') . ": <br />\r\n";
|
2068 |
echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"yes\"";
|
2069 |
+
if ( 'yes' == $this->subscribe2_options['show_autosub'] ) {
|
2070 |
echo " checked=\"checked\"";
|
2071 |
}
|
2072 |
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2073 |
echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"no\"";
|
2074 |
+
if ( 'no' == $this->subscribe2_options['show_autosub'] ) {
|
2075 |
echo " checked=\"checked\"";
|
2076 |
}
|
2077 |
echo " />" . __('No', 'subscribe2') . "</label> ";
|
2078 |
echo "<label><input type=\"radio\" name=\"show_autosub\" value=\"exclude\"";
|
2079 |
+
if ( 'exclude' == $this->subscribe2_options['show_autosub'] ) {
|
2080 |
echo " checked=\"checked\"";
|
2081 |
}
|
2082 |
echo " />" .__('New categories are immediately excluded', 'subscribe2') . "</label><br /><br />";
|
2083 |
echo __('Option for Registered Users to auto-subscribe to new categories is checked by default', 'subscribe2') . ": <br />\r\n";
|
2084 |
echo "<label><input type=\"radio\" name=\"autosub_def\" value=\"yes\"";
|
2085 |
+
if ( 'yes' == $this->subscribe2_options['autosub_def'] ) {
|
2086 |
echo " checked=\"checked\"";
|
2087 |
}
|
2088 |
echo " />" . __('Yes', 'subscribe2') . "</label> ";
|
2089 |
echo "<label><input type=\"radio\" name=\"autosub_def\" value=\"no\"";
|
2090 |
+
if ( 'no' == $this->subscribe2_options['autosub_def'] ) {
|
2091 |
echo " checked=\"checked\"";
|
2092 |
}
|
2093 |
echo " />" . __('No', 'subscribe2');
|
2122 |
function user_menu() {
|
2123 |
global $user_ID, $s2nonce;
|
2124 |
|
2125 |
+
if ( isset($_GET['email']) ) {
|
2126 |
global $wpdb;
|
2127 |
+
$user_ID = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_email = '" . urldecode($_GET['email']) . "'");
|
2128 |
} else {
|
2129 |
get_currentuserinfo();
|
2130 |
}
|
2131 |
|
2132 |
// was anything POSTed?
|
2133 |
+
if ( isset($_POST['s2_admin']) && 'user' == $_POST['s2_admin'] ) {
|
2134 |
check_admin_referer('subscribe2-user_subscribers' . $s2nonce);
|
2135 |
|
2136 |
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Subscription preferences updated.', 'subscribe2') . "</strong></p></div>\n";
|
2139 |
|
2140 |
$cats = $_POST['category'];
|
2141 |
|
2142 |
+
if ( empty($cats) || $cats == '-1' ) {
|
2143 |
$oldcats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
2144 |
+
if ( $oldcats ) {
|
2145 |
+
foreach ( $oldcats as $cat ) {
|
2146 |
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat);
|
2147 |
}
|
2148 |
}
|
2149 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), '');
|
2150 |
+
} elseif ( $cats == 'digest' ) {
|
2151 |
$all_cats = get_categories(array('hide_empty' => false));
|
2152 |
+
foreach ( $all_cats as $cat ) {
|
2153 |
('' == $catids) ? $catids = "$cat->term_id" : $catids .= ",$cat->term_id";
|
2154 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $cat->term_id, $cat->term_id);
|
2155 |
}
|
2156 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'), $catids);
|
2157 |
} else {
|
2158 |
+
if ( !is_array($cats) ) {
|
2159 |
+
$cats = array($_POST['category']);
|
2160 |
}
|
2161 |
$old_cats = explode(',', get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')));
|
2162 |
$remove = array_diff($old_cats, $cats);
|
2163 |
$new = array_diff($cats, $old_cats);
|
2164 |
+
if ( !empty($remove) ) {
|
2165 |
// remove subscription to these cat IDs
|
2166 |
+
foreach ( $remove as $id ) {
|
2167 |
delete_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id);
|
2168 |
}
|
2169 |
}
|
2170 |
+
if ( !empty($new) ) {
|
2171 |
// add subscription to these cat IDs
|
2172 |
+
foreach ( $new as $id ) {
|
2173 |
update_usermeta($user_ID, $this->get_usermeta_keyname('s2_cat') . $id, $id);
|
2174 |
}
|
2175 |
}
|
2179 |
|
2180 |
// show our form
|
2181 |
echo "<div class=\"wrap\">";
|
2182 |
+
screen_icon();
|
2183 |
echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
|
2184 |
+
if ( isset($_GET['email']) ) {
|
2185 |
$user = get_userdata($user_ID);
|
2186 |
echo "<span style=\"color: red;line-height: 300%;\">" . __('Editing Subscribe2 preferences for user', 'subscribe2') . ": " . $user->display_name . "</span>";
|
2187 |
}
|
2188 |
echo "<form method=\"post\" action=\"\">";
|
2189 |
echo "<p>";
|
2190 |
+
if ( function_exists('wp_nonce_field') ) {
|
2191 |
wp_nonce_field('subscribe2-user_subscribers' . $s2nonce);
|
2192 |
}
|
2193 |
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"user\" />";
|
2194 |
+
if ( $this->subscribe2_options['email_freq'] == 'never' ) {
|
2195 |
echo __('Receive email as', 'subscribe2') . ": ";
|
2196 |
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"html\"";
|
2197 |
+
if ( 'html' == get_usermeta($user_ID, 's2_format') ) {
|
2198 |
echo "checked=\"checked\" ";
|
2199 |
}
|
2200 |
echo "/> " . __('HTML', 'subscribe2') ."</label> ";
|
2201 |
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"post\" ";
|
2202 |
+
if ( 'post' == get_usermeta($user_ID, 's2_format') ) {
|
2203 |
echo "checked=\"checked\" ";
|
2204 |
}
|
2205 |
echo "/> " . __('Plain Text - Full', 'subscribe2') . "</label> ";
|
2206 |
echo "<label><input type=\"radio\" name=\"s2_format\" value=\"excerpt\" ";
|
2207 |
+
if ( 'excerpt' == get_usermeta($user_ID, 's2_format') ) {
|
2208 |
echo "checked=\"checked\" ";
|
2209 |
}
|
2210 |
echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . "</label><br /><br />\r\n";
|
2211 |
|
2212 |
+
if ( $this->subscribe2_options['show_autosub'] == 'yes' ) {
|
2213 |
echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': ';
|
2214 |
echo "<label><input type=\"radio\" name=\"new_category\" value=\"yes\" ";
|
2215 |
+
if ( 'yes' == get_usermeta($user_ID, 's2_autosub') ) {
|
2216 |
echo "checked=\"checked\" ";
|
2217 |
}
|
2218 |
echo "/> " . __('Yes', 'subscribe2') . "</label> ";
|
2219 |
echo "<label><input type=\"radio\" name=\"new_category\" value=\"no\" ";
|
2220 |
+
if ( 'no' == get_usermeta($user_ID, 's2_autosub') ) {
|
2221 |
echo "checked=\"checked\" ";
|
2222 |
}
|
2223 |
+
echo "/> " . __('No', 'subscribe2') . "</label>";
|
2224 |
echo "</p>";
|
2225 |
}
|
2226 |
|
2227 |
// subscribed categories
|
2228 |
+
if ( $this->s2_mu ) {
|
2229 |
global $blog_id;
|
2230 |
$subscribed = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
2231 |
// if we are subscribed to the current blog display an "unsubscribe" link
|
2232 |
+
if ( !empty($subscribed) ) {
|
2233 |
$unsubscribe_link = get_bloginfo('url') . "/wp-admin/?s2mu_unsubscribe=". $blog_id;
|
2234 |
echo "<p><a href=\"". $unsubscribe_link ."\" class=\"button\">" . __('Unsubscribe me from this blog', 'subscribe2') . "</a></p>";
|
2235 |
} else {
|
2246 |
// we're doing daily digests, so just show
|
2247 |
// subscribe / unnsubscribe
|
2248 |
echo __('Receive periodic summaries of new posts?', 'subscribe2') . ': ';
|
2249 |
+
echo "<label>";
|
2250 |
echo "<input type=\"radio\" name=\"category\" value=\"digest\" ";
|
2251 |
+
if ( get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')) ) {
|
2252 |
+
echo "checked=\"checked\" ";
|
2253 |
}
|
2254 |
echo "/> " . __('Yes', 'subscribe2') . "</label> <label><input type=\"radio\" name=\"category\" value=\"-1\" ";
|
2255 |
+
if ( !get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed')) ) {
|
2256 |
+
echo "checked=\"checked\" ";
|
2257 |
}
|
2258 |
echo "/> " . __('No', 'subscribe2');
|
2259 |
echo "</label></p>";
|
2264 |
echo "</form>\r\n";
|
2265 |
|
2266 |
// list of subscribed blogs on wordpress mu
|
2267 |
+
if ( $this->s2_mu && !isset($_GET['email']) ) {
|
2268 |
global $blog_id;
|
2269 |
+
$s2blog_id = $blog_id;
|
2270 |
$blogs = get_blog_list(0, 'all');
|
2271 |
|
2272 |
$blogs_subscribed = array();
|
2273 |
$blogs_notsubscribed = array();
|
2274 |
|
2275 |
+
foreach ( $blogs as $key => $blog ) {
|
2276 |
// switch to blog
|
2277 |
switch_to_blog($blog['blog_id']);
|
2278 |
|
2279 |
// check that the plugin is active on the current blog
|
2280 |
$current_plugins = get_option('active_plugins');
|
2281 |
+
if ( !is_array($current_plugins) ) {
|
2282 |
$current_plugins = (array)$current_plugins;
|
2283 |
}
|
2284 |
+
if ( !in_array(S2DIR . '/subscribe2.php', $current_plugins) ) {
|
2285 |
continue;
|
2286 |
}
|
2287 |
|
2289 |
$subscribed = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
|
2290 |
|
2291 |
$blogname = get_bloginfo('name');
|
2292 |
+
if ( strlen($blogname) > 30 ) {
|
2293 |
$blog['blogname'] = wp_html_excerpt($blogname, 30) . "..";
|
2294 |
} else {
|
2295 |
$blog['blogname'] = $blogname;
|
2299 |
$blog['subscribe_page'] = get_bloginfo('url') . "/wp-admin/users.php?page=s2_users";
|
2300 |
|
2301 |
$key = strtolower($blog['blogname'] . "-" . $blog['blog_id']);
|
2302 |
+
if ( !empty($subscribed) ) {
|
2303 |
$blogs_subscribed[$key] = $blog;
|
2304 |
} else {
|
2305 |
$blogs_notsubscribed[$key] = $blog;
|
2307 |
restore_current_blog();
|
2308 |
}
|
2309 |
|
2310 |
+
if ( !empty($blogs_subscribed) ) {
|
2311 |
ksort($blogs_subscribed);
|
2312 |
echo "<h2>" . __('Subscribed Blogs', 'subscribe2') . "</h2>\r\n";
|
2313 |
echo "<ul class=\"s2_blogs\">\r\n";
|
2314 |
+
foreach ( $blogs_subscribed as $blog ) {
|
2315 |
echo "<li><span class=\"name\"><a href=\"" . $blog['blogurl'] . "\" title=\"" . $blog['description'] . "\">" . $blog['blogname'] . "</a></span>\r\n";
|
2316 |
+
if ( $s2blog_id == $blog['blog_id'] ) {
|
2317 |
echo "<span class=\"buttons\">" . __('Viewing Settings Now', 'subscribe2') . "</span>\r\n";
|
2318 |
} else {
|
2319 |
echo "<span class=\"buttons\">";
|
2320 |
+
if ( is_blog_user($blog['blog_id']) ) {
|
2321 |
echo "<a href=\"". $blog['subscribe_page'] . "\">" . __('View Settings', 'subscribe2') . "</a>\r\n";
|
2322 |
}
|
2323 |
echo "<a href=\"" . $blog['blogurl'] . "/wp-admin/?s2mu_unsubscribe=" . $blog['blog_id'] . "\">" . __('Unsubscribe', 'subscribe2') . "</a></span>\r\n";
|
2328 |
echo "</ul>\r\n";
|
2329 |
}
|
2330 |
|
2331 |
+
if ( !empty($blogs_notsubscribed) ) {
|
2332 |
ksort($blogs_notsubscribed);
|
2333 |
echo "<h2>" . __('Subscribe to new blogs', 'subscribe2') . "</h2>\r\n";
|
2334 |
echo "<ul class=\"s2_blogs\">";
|
2335 |
+
foreach ( $blogs_notsubscribed as $blog ) {
|
2336 |
echo "<li><span class=\"name\"><a href=\"" . $blog['blogurl'] . "\" title=\"" . $blog['description'] . "\">" . $blog['blogname'] . "</a></span>\r\n";
|
2337 |
+
if ( $s2blog_id == $blog['blog_id'] ) {
|
2338 |
echo "<span class=\"buttons\">" . __('Viewing Settings Now', 'subscribe2') . "</span>\r\n";
|
2339 |
} else {
|
2340 |
echo "<span class=\"buttons\">";
|
2341 |
+
if ( is_blog_user($blog['blog_id']) ) {
|
2342 |
echo "<a href=\"". $blog['subscribe_page'] . "\">" . __('View Settings', 'subscribe2') . "</a>\r\n";
|
2343 |
}
|
2344 |
echo "<a href=\"" . $blog['blogurl'] . "/wp-admin/?s2mu_subscribe=" . $blog['blog_id'] . "\">" . __('Subscribe', 'subscribe2') . "</a></span>\r\n";
|
2364 |
global $wpdb, $s2nonce, $current_user;
|
2365 |
|
2366 |
// was anything POSTed?
|
2367 |
+
if ( isset($_POST['s2_admin']) && 'mail' == $_POST['s2_admin'] ) {
|
2368 |
check_admin_referer('subscribe2-write_subscribers' . $s2nonce);
|
2369 |
+
if ( 'confirmed' == $_POST['what'] ) {
|
2370 |
$recipients = $this->get_public();
|
2371 |
+
} elseif ( 'unconfirmed' == $_POST['what'] ) {
|
2372 |
$recipients = $this->get_public(0);
|
2373 |
+
} elseif ( 'public' == $_POST['what'] ) {
|
2374 |
$confirmed = $this->get_public();
|
2375 |
$unconfirmed = $this->get_public(0);
|
2376 |
$recipients = array_merge((array)$confirmed, (array)$unconfirmed);
|
2377 |
+
} elseif ( is_numeric($_POST['what']) ) {
|
2378 |
$cat = intval($_POST['what']);
|
2379 |
$recipients = $this->get_registered("cats=$cat");
|
2380 |
+
} elseif ( 'all_users' == $_POST['what'] ) {
|
2381 |
$recipients = $this->get_all_registered();
|
2382 |
} else {
|
2383 |
$recipients = $this->get_registered();
|
2384 |
}
|
2385 |
$subject = $this->substitute(stripslashes(strip_tags($_POST['subject'])));
|
2386 |
$body = $this->substitute(stripslashes($_POST['content']));
|
2387 |
+
if ( '' != $current_user->display_name || '' != $current_user->user_email ) {
|
2388 |
$this->myname = html_entity_decode($current_user->display_name, ENT_QUOTES);
|
2389 |
$this->myemail = $current_user->user_email;
|
2390 |
}
|
2391 |
$status = $this->mail($recipients, $subject, $body, 'text');
|
2392 |
+
if ( $status ) {
|
2393 |
$message = $this->mail_sent;
|
2394 |
} else {
|
2395 |
global $phpmailer;
|
2397 |
}
|
2398 |
}
|
2399 |
|
2400 |
+
if ( '' != $message ) {
|
2401 |
echo "<div id=\"message\" class=\"updated\"><strong><p>" . $message . "</p></strong></div>\r\n";
|
2402 |
}
|
2403 |
// show our form
|
2404 |
+
echo "<div class=\"wrap\">";
|
2405 |
+
screen_icon();
|
2406 |
+
echo "<h2>" . __('Send an email to subscribers', 'subscribe2') . "</h2>\r\n";
|
2407 |
echo "<form method=\"post\" action=\"\">\r\n";
|
2408 |
+
if ( function_exists('wp_nonce_field') ) {
|
2409 |
wp_nonce_field('subscribe2-write_subscribers' . $s2nonce);
|
2410 |
}
|
2411 |
+
if ( isset($_POST['subject']) ) {
|
2412 |
$subject = $_POST['subject'];
|
2413 |
} else {
|
2414 |
$subject = __('A message from', 'subscribe2') . " " . get_option('blogname');
|
2440 |
$all_cats = get_categories(array('hide_empty' => false));
|
2441 |
$exclude = explode(',', $this->subscribe2_options['exclude']);
|
2442 |
|
2443 |
+
if ( 0 == $override ) {
|
2444 |
// registered users are not allowed to subscribe to
|
2445 |
// excluded categories
|
2446 |
+
foreach ( $all_cats as $cat => $term_id ) {
|
2447 |
+
if ( in_array($all_cats[$cat]->term_id, $exclude) ) {
|
2448 |
$cat = (int)$cat;
|
2449 |
unset($all_cats[$cat]);
|
2450 |
}
|
2459 |
echo "<label><input type=\"checkbox\" name=\"checkall\" value=\"cat_checkall\" /> " . __('Select / Unselect All', 'subscribe2') . "</label>\r\n";
|
2460 |
echo "</td></tr>\r\n";
|
2461 |
echo "<tr valign=\"top\"><td width=\"50%\" align=\"left\">\r\n";
|
2462 |
+
foreach ( $all_cats as $cat ) {
|
2463 |
+
if ( $i >= $half && 0 == $j ){
|
2464 |
echo "</td><td width=\"50%\" align=\"left\">\r\n";
|
2465 |
$j++;
|
2466 |
}
|
2467 |
+
if ( 0 == $j ) {
|
2468 |
echo "<label><input class=\"cat_checkall\" type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
|
2469 |
+
if ( in_array($cat->term_id, $selected) ) {
|
2470 |
echo " checked=\"checked\" ";
|
2471 |
}
|
2472 |
+
echo " /> <abbr title=\"" . $cat->slug . "\">" . trim(get_category_parents($cat->term_id, false, ' » '), ' » ') . "</abbr></label><br />\r\n";
|
2473 |
} else {
|
2474 |
echo "<label><input class=\"cat_checkall\" type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
|
2475 |
+
if ( in_array($cat->term_id, $selected) ) {
|
2476 |
echo " checked=\"checked\" ";
|
2477 |
}
|
2478 |
+
echo " /> <abbr title=\"" . $cat->slug . "\">" . trim(get_category_parents($cat->term_id, false, ' » '), ' » ') . "</abbr></label><br />\r\n";
|
2479 |
}
|
2480 |
$i++;
|
2481 |
}
|
2503 |
// count the number of subscribers
|
2504 |
$count['confirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='1'");
|
2505 |
$count['unconfirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='0'");
|
2506 |
+
if ( in_array('unconfirmed', $exclude) ) {
|
2507 |
$count['public'] = $count['confirmed'];
|
2508 |
+
} elseif ( in_array('confirmed', $exclude) ) {
|
2509 |
$count['public'] = $count['unconfirmed'];
|
2510 |
} else {
|
2511 |
$count['public'] = ($count['confirmed'] + $count['unconfirmed']);
|
2512 |
}
|
2513 |
+
if ( $this->s2_mu ) {
|
2514 |
$count['all_users'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
|
2515 |
} else {
|
2516 |
$count['all_users'] = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
|
2517 |
}
|
2518 |
+
if ( $this->s2_mu ) {
|
2519 |
$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') . "'");
|
2520 |
} else {
|
2521 |
$count['registered'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='" . $this->get_usermeta_keyname('s2_subscribed') . "'");
|
2522 |
}
|
2523 |
$count['all'] = ($count['confirmed'] + $count['unconfirmed'] + $count['all_users']);
|
2524 |
+
if ( $this->s2_mu ) {
|
2525 |
+
foreach ( $all_cats as $cat ) {
|
2526 |
$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 . "'");
|
2527 |
}
|
2528 |
} else {
|
2529 |
+
foreach ( $all_cats as $cat ) {
|
2530 |
$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 . "'");
|
2531 |
}
|
2532 |
}
|
2533 |
|
2534 |
// do have actually have some subscribers?
|
2535 |
+
if ( 0 == $count['confirmed'] && 0 == $count['unconfirmed'] && 0 == $count['all_users'] ) {
|
2536 |
// no? bail out
|
2537 |
return;
|
2538 |
}
|
2539 |
|
2540 |
echo "<select name=\"what\">\r\n";
|
2541 |
+
foreach ( $who as $whom => $display ) {
|
2542 |
+
if ( in_array($whom, $exclude) ) { continue; }
|
2543 |
+
if ( 0 == $count[$whom] ) { continue; }
|
2544 |
|
2545 |
echo "<option value=\"" . $whom . "\"";
|
2546 |
+
if ( $whom == $selected ) { echo " selected=\"selected\" "; }
|
2547 |
echo ">$display (" . ($count[$whom]) . ")</option>\r\n";
|
2548 |
}
|
2549 |
|
2550 |
+
if ( $count['registered'] > 0 ) {
|
2551 |
+
foreach ( $all_cats as $cat ) {
|
2552 |
+
if ( in_array($cat->term_id, $exclude) ) { continue; }
|
2553 |
echo "<option value=\"" . $cat->term_id . "\"";
|
2554 |
+
if ( $cat->term_id == $selected ) { echo " selected=\"selected\" "; }
|
2555 |
echo "> " . $cat->name . " (" . $count[$cat->name] . ") </option>\r\n";
|
2556 |
}
|
2557 |
}
|
2558 |
echo "</select>";
|
2559 |
+
if ( false !== $submit ) {
|
2560 |
echo " <input type=\"submit\" class=\"button-secondary\" value=\"$submit\" />\r\n";
|
2561 |
}
|
2562 |
} // end display_subscriber_dropdown()
|
2572 |
$admins = $wpdb->get_results($sql);
|
2573 |
|
2574 |
// handle issues from WordPress core where user_level is not set or set low
|
2575 |
+
if ( empty($admins) ) {
|
2576 |
$role = 'administrator';
|
2577 |
+
if ( !class_exists(WP_User_Search) ) {
|
2578 |
require(ABSPATH . 'wp-admin/includes/user.php');
|
2579 |
}
|
2580 |
$wp_user_search = new WP_User_Search( '', '', $role);
|
2583 |
$admins = $wpdb->get_results($sql);
|
2584 |
}
|
2585 |
|
2586 |
+
if ( $inc_author ) {
|
2587 |
$author[] = (object)array('ID' => 'author', 'display_name' => 'Post Author');
|
2588 |
$admins = array_merge($author, $admins);
|
2589 |
}
|
2590 |
|
2591 |
echo "<select name=\"sender\">\r\n";
|
2592 |
+
foreach ( $admins as $admin ) {
|
2593 |
echo "<option value=\"" . $admin->ID . "\"";
|
2594 |
+
if ( $admin->ID == $this->subscribe2_options['sender'] ) {
|
2595 |
echo " selected=\"selected\"";
|
2596 |
}
|
2597 |
echo ">" . $admin->display_name . "</option>\r\n";
|
2609 |
$schedule = (array)wp_get_schedules();
|
2610 |
$schedule = array_merge(array('never' => array('interval' => 0, 'display' => __('For each Post', 'subscribe2'))), $schedule);
|
2611 |
$sort = array();
|
2612 |
+
foreach ( (array)$schedule as $key => $value ) {
|
2613 |
+
$sort[$key] = $value['interval'];
|
2614 |
+
}
|
2615 |
asort($sort);
|
2616 |
$schedule_sorted = array();
|
2617 |
+
foreach ( $sort as $key => $value ) {
|
2618 |
$schedule_sorted[$key] = $schedule[$key];
|
2619 |
}
|
2620 |
+
foreach ( $schedule_sorted as $key => $value ) {
|
2621 |
echo "<label><input type=\"radio\" name=\"email_freq\" value=\"" . $key . "\"";
|
2622 |
+
if ( $key == $this->subscribe2_options['email_freq'] ) {
|
2623 |
echo " checked=\"checked\" ";
|
2624 |
}
|
2625 |
echo " /> " . $value['display'] . "</label><br />\r\n";
|
2627 |
echo "<br />" . __('Send Digest Notification at', 'subscribe2') . ": \r\n";
|
2628 |
$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');
|
2629 |
echo "<select name=\"hour\">\r\n";
|
2630 |
+
while ( $hour = current($hours) ) {
|
2631 |
echo "<option value=\"" . key($hours) . "\"";
|
2632 |
+
if ( key($hours) == date('H', $scheduled_time) && !empty($scheduled_time) ){
|
2633 |
echo " selected=\"selected\"";
|
2634 |
}
|
2635 |
echo ">" . $hour . "</option>\r\n";
|
2637 |
}
|
2638 |
echo "</select>\r\n";
|
2639 |
echo "<strong><em style=\"color: red\">" . __('This option will work for digest notification sent daily or less frequently', 'subscribe2') . "</em></strong>\r\n";
|
2640 |
+
if ( $scheduled_time ) {
|
2641 |
$datetime = get_option('date_format') . ' @ ' . get_option('time_format');
|
2642 |
echo "<p>" . __('Current UTC time is', 'subscribe2') . ": \r\n";
|
2643 |
echo "<strong>" . date_i18n($datetime, false, 'gmt') . "</strong></p>\r\n";
|
2644 |
echo "<p>" . __('Current blog time is', 'subscribe2') . ": \r\n";
|
2645 |
echo "<strong>" . date_i18n($datetime) . "</strong></p>\r\n";
|
2646 |
echo "<p>" . __('Next email notification will be sent when your blog time is after', 'subscribe2') . ": \r\n";
|
2647 |
+
echo "<strong>" . date_i18n($datetime, $scheduled_time) . "</strong></p>\r\n";
|
2648 |
} else {
|
2649 |
echo "<br />";
|
2650 |
}
|
2657 |
global $wpdb, $wp_version, $wpmu_version;
|
2658 |
|
2659 |
// Is this WordPressMU or not?
|
2660 |
+
if ( isset($wpmu_version) || strpos($wp_version, 'wordpress-mu') ) {
|
2661 |
+
switch( $metaname ) {
|
2662 |
case 's2_subscribed':
|
2663 |
case 's2_cat':
|
2664 |
return $wpdb->prefix . $metaname;
|
2670 |
}
|
2671 |
|
2672 |
/**
|
2673 |
+
Adds a links directly to the settings page from the plugin page
|
2674 |
*/
|
2675 |
+
function plugin_links($links, $file) {
|
2676 |
+
if ( $file == S2DIR.'/subscribe2.php' ) {
|
2677 |
+
$links[] = "<a href='options-general.php?page=s2_settings'>" . __('Settings', 'subscribe2') . "</a>";
|
2678 |
+
$links[] = "<a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904'><b>" . __('Donate', 'subscribe2') . "</b></a>";
|
2679 |
+
$links[] = "<a href='http://getsatisfaction.com/subscribe2'>" . __('Forum', 'subscribe2') . "</a>";
|
2680 |
}
|
2681 |
return $links;
|
2682 |
+
} // end plugin_links()
|
2683 |
|
2684 |
/**
|
2685 |
Adds information to the WordPress registration screen for new users
|
2686 |
*/
|
2687 |
function register_form() {
|
2688 |
+
if ( 'wpreg' == $this->subscribe2_options['autosub'] ) {
|
2689 |
echo "<p>\r\n<label>";
|
2690 |
echo __('Check here to Subscribe to email notifications for new posts') . ":<br />\r\n";
|
2691 |
echo "<input type=\"checkbox\" name=\"subscribe\"";
|
2692 |
+
if ( 'yes' == $this->subscribe2_options['wpregdef'] ) {
|
2693 |
echo " checked=\"checked\"";
|
2694 |
}
|
2695 |
echo " /></label>\r\n";
|
2696 |
echo "</p>\r\n";
|
2697 |
+
} elseif ( 'yes' == $this->subscribe2_options['autosub'] ) {
|
2698 |
echo "<p>\r\n<center>\r\n";
|
2699 |
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";
|
2700 |
echo "</center></p>\r\n";
|
2705 |
Process function to add action if user selects to subscribe to posts during registration
|
2706 |
*/
|
2707 |
function register_post() {
|
2708 |
+
if ( 'on' == $_POST['subscribe'] ) {
|
2709 |
$user = get_userdatabylogin($_POST['user_login']);
|
2710 |
+
if ( 0 == $user->ID ) { return; }
|
2711 |
$this->register($user->ID);
|
2712 |
}
|
2713 |
}
|
2716 |
Create meta box on write pages
|
2717 |
*/
|
2718 |
function s2_meta_init() {
|
2719 |
+
if ( function_exists('add_meta_box') ) {
|
2720 |
add_meta_box('subscribe2', __('Subscribe2 Notification Override', 'subscribe2' ), array(&$this, 's2_meta_box'), 'post', 'advanced');
|
2721 |
add_meta_box('subscribe2', __('Subscribe2 Notification Override', 'subscribe2' ), array(&$this, 's2_meta_box'), 'page', 'advanced');
|
2722 |
} else {
|
2734 |
echo "<input type=\"hidden\" name=\"s2meta_nonce\" id=\"s2meta_nonce\" value=\"" . wp_create_nonce(md5(plugin_basename(__FILE__))) . "\" />";
|
2735 |
echo __("Check here to disable sending of an email notification for this post/page", 'subscribe2');
|
2736 |
echo " <input type=\"checkbox\" name=\"s2_meta_field\" value=\"no\"";
|
2737 |
+
if ( $s2mail == 'no' ) {
|
2738 |
echo " checked=\"checked\"";
|
2739 |
}
|
2740 |
echo " />";
|
2756 |
Meta box form handler
|
2757 |
*/
|
2758 |
function s2_meta_handler($post_id) {
|
2759 |
+
if ( !isset($_POST['s2meta_nonce']) || !wp_verify_nonce($_POST['s2meta_nonce'], md5(plugin_basename(__FILE__))) ) { return $post_id; }
|
2760 |
|
2761 |
+
if ( 'page' == $_POST['post_type'] ) {
|
2762 |
+
if ( !current_user_can('edit_page', $post_id) ) { return $post_id; }
|
2763 |
} else {
|
2764 |
+
if ( !current_user_can('edit_post', $post_id) ) { return $post_id; }
|
2765 |
}
|
2766 |
|
2767 |
+
if ( isset($_POST['s2_meta_field']) && $_POST['s2_meta_field'] == 'no' ) {
|
2768 |
+
update_post_meta($post_id, 's2mail', $_POST['s2_meta_field']);
|
2769 |
+
} else {
|
2770 |
+
delete_post_meta($post_id, 's2mail');
|
2771 |
+
}
|
2772 |
} // end s2_meta_box_handler()
|
2773 |
|
2774 |
/* ===== template and filter functions ===== */
|
2776 |
Display our form; also handles (un)subscribe requests
|
2777 |
*/
|
2778 |
function filter($content = '') {
|
2779 |
+
if ( '' == $content || !strstr($content, '<!--subscribe2-->') ) { return $content; }
|
2780 |
$this->s2form = $this->form;
|
2781 |
|
2782 |
global $user_ID;
|
2783 |
get_currentuserinfo();
|
2784 |
+
if ( $user_ID ) {
|
2785 |
+
if ( current_user_can('manage_options') ) {
|
2786 |
$this->s2form = $this->use_profile_admin;
|
2787 |
} else {
|
2788 |
$this->s2form = $this->use_profile_users;
|
2789 |
}
|
2790 |
}
|
2791 |
+
if ( isset($_POST['subscribe']) || isset($_POST['unsubscribe']) ) {
|
2792 |
global $wpdb, $user_email;
|
2793 |
+
if ( !is_email($_POST['email']) ) {
|
2794 |
$this->s2form = $this->form . $this->not_an_email;
|
2795 |
+
} elseif ( $this->is_barred($_POST['email']) ) {
|
2796 |
$this->s2form = $this->form . $this->barred_domain;
|
2797 |
} else {
|
2798 |
$this->email = $_POST['email'];
|
2799 |
$this->ip = $_POST['ip'];
|
2800 |
// does the supplied email belong to a registered user?
|
2801 |
$check = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE user_email = '$this->email'");
|
2802 |
+
if ( '' != $check ) {
|
2803 |
// this is a registered email
|
2804 |
$this->s2form = $this->please_log_in;
|
2805 |
} else {
|
2806 |
// this is not a registered email
|
2807 |
// what should we do?
|
2808 |
+
if ( isset($_POST['subscribe']) ) {
|
2809 |
// someone is trying to subscribe
|
2810 |
// lets see if they've tried to subscribe previously
|
2811 |
+
if ( '1' !== $this->is_public($this->email) ) {
|
2812 |
// the user is unknown or inactive
|
2813 |
$this->add();
|
2814 |
$status = $this->send_confirm('add');
|
2815 |
// set a variable to denote that we've already run, and shouldn't run again
|
2816 |
$this->filtered = 1;
|
2817 |
+
if ( $status ) {
|
2818 |
$this->s2form = $this->confirmation_sent;
|
2819 |
} else {
|
2820 |
$this->s2form = $this->error;
|
2824 |
$this->s2form = $this->already_subscribed;
|
2825 |
}
|
2826 |
$this->action = 'subscribe';
|
2827 |
+
} elseif ( isset($_POST['unsubscribe']) ) {
|
2828 |
// is this email a subscriber?
|
2829 |
+
if ( false == $this->is_public($this->email) ) {
|
2830 |
$this->s2form = $this->form . $this->not_subscribed;
|
2831 |
} else {
|
2832 |
$status = $this->send_confirm('del');
|
2833 |
// set a variable to denote that we've already run, and shouldn't run again
|
2834 |
$this->filtered = 1;
|
2835 |
+
if ( $status ) {
|
2836 |
$this->s2form = $this->confirmation_sent;
|
2837 |
} else {
|
2838 |
$this->s2form = $this->error;
|
2853 |
*/
|
2854 |
function query_filter() {
|
2855 |
// don't interfere if we've already done our thing
|
2856 |
+
if ( 1 == $this->filtered ) { return; }
|
2857 |
|
2858 |
global $wpdb;
|
2859 |
|
2861 |
return "page_id=" . $this->subscribe2_options['s2page'];
|
2862 |
} else {
|
2863 |
$id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status='publish' LIMIT 1");
|
2864 |
+
if ( $id ) {
|
2865 |
return "page_id=$id";
|
2866 |
} else {
|
2867 |
return "showposts=1";
|
2874 |
*/
|
2875 |
function title_filter($title) {
|
2876 |
// don't interfere if we've already done our thing
|
2877 |
+
if ( in_the_loop() ) {
|
2878 |
return __('Subscription Confirmation', 'subscribe2');
|
2879 |
} else {
|
2880 |
return $title;
|
2897 |
echo $before_title . $title . $after_title;
|
2898 |
echo "<div class=\"" . $div . "\">";
|
2899 |
$content = s2class::filter('<!--subscribe2-->');
|
2900 |
+
if ( !empty($widgetprecontent) ) {
|
2901 |
echo $widgetprecontent;
|
2902 |
}
|
2903 |
echo $content;
|
2904 |
+
if ( !empty($widgetpostcontent) ) {
|
2905 |
echo $widgetpostcontent;
|
2906 |
}
|
2907 |
echo "</div>";
|
2913 |
*/
|
2914 |
function widget_subscribe2widget_control() {
|
2915 |
$options = $newoptions = get_option('widget_subscribe2widget');
|
2916 |
+
if ( $_POST["s2w-submit"] ) {
|
2917 |
$newoptions['title'] = strip_tags(stripslashes($_POST["s2w-title"]));
|
2918 |
$newoptions['div'] = sanitize_title(strip_tags(stripslashes($_POST["s2w-div"])));
|
2919 |
$newoptions['widgetprecontent'] = stripslashes($_POST["s2w-widgetprecontent"]);
|
2920 |
$newoptions['widgetpostcontent'] = stripslashes($_POST["s2w-widgetpostcontent"]);
|
2921 |
}
|
2922 |
+
if ( $options != $newoptions ) {
|
2923 |
$options = $newoptions;
|
2924 |
update_option('widget_subscribe2widget', $options);
|
2925 |
}
|
2943 |
*/
|
2944 |
function register_subscribe2widget() {
|
2945 |
//Check Sidebar Widget and Subscribe2 plugins are activated
|
2946 |
+
if ( !function_exists('register_sidebar_widget') || !class_exists('s2class') ) {
|
2947 |
return;
|
2948 |
} else {
|
2949 |
register_sidebar_widget('Subscribe2', array(&$this, 'widget_subscribe2widget'));
|
2956 |
global $wpdb;
|
2957 |
$blogs = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
|
2958 |
|
2959 |
+
foreach ( $blogs as $blog ) {
|
2960 |
switch_to_blog($blog);
|
2961 |
|
2962 |
$sidebars = get_option('sidebars_widgets');
|
2963 |
+
if ( empty($sidebars) || !is_array($sidebars) ) { return; }
|
2964 |
$changed = false;
|
2965 |
+
foreach ( $sidebars as $s =>$sidebar ) {
|
2966 |
+
if ( empty($sidebar) || !is_array($sidebar) ) { break; }
|
2967 |
+
foreach ( $sidebar as $w => $widget ) {
|
2968 |
+
if ( $widget == 'subscribe2widget' ) {
|
2969 |
$sidebars[$s][$w] = 'subscribe2';
|
2970 |
$changed = true;
|
2971 |
}
|
2972 |
}
|
2973 |
}
|
2974 |
+
if ( $changed ) {
|
2975 |
update_option('sidebar_widgets', $sidebars);
|
2976 |
}
|
2977 |
}
|
2982 |
Add hook for Minimeta Widget plugin
|
2983 |
*/
|
2984 |
function add_minimeta() {
|
2985 |
+
if ( $this->subscribe2_options['s2page'] != 0 ) {
|
2986 |
echo "<li><a href=\"" . get_option('siteurl') . "/?page_id=" . $this->subscribe2_options['s2page'] . "\">" . __('[Un]Subscribe to Posts', 'subscribe2') . "</a></li>\r\n";
|
2987 |
}
|
2988 |
} // end add_minimeta()
|
2993 |
Register our button in the QuickTags bar
|
2994 |
*/
|
2995 |
function button_init() {
|
2996 |
+
if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) { return; }
|
2997 |
+
if ( 'true' == get_user_option('rich_editing') ) {
|
2998 |
global $wp_db_version;
|
2999 |
//check if we are using WordPress 2.5+
|
3000 |
+
if ( $wp_db_version >= 7098 ) {
|
3001 |
// Use WordPress 2.5+ hooks
|
3002 |
add_filter('mce_external_plugins', array(&$this, 'mce3_plugin'));
|
3003 |
add_filter('mce_buttons', array(&$this, 'mce3_button'));
|
3009 |
}
|
3010 |
} else {
|
3011 |
buttonsnap_separator();
|
3012 |
+
buttonsnap_jsbutton(WP_CONTENT_URL . '/plugins/' . S2DIR . '/include/s2_button.png', __('Subscribe2', 'subscribe2'), 's2_insert_token();');
|
3013 |
}
|
3014 |
} // end button_init()
|
3015 |
|
3017 |
Add buttons for WordPress 2.5+ using built in hooks
|
3018 |
*/
|
3019 |
function mce3_plugin($arr) {
|
3020 |
+
$path = WP_CONTENT_URL . '/plugins/' . S2DIR . '/tinymce3/editor_plugin.js';
|
3021 |
$arr['subscribe2'] = $path;
|
3022 |
return $arr;
|
3023 |
}
|
3040 |
}
|
3041 |
|
3042 |
function tinymce2_before_init() {
|
3043 |
+
$this->fullpath = WP_CONTENT_URL . '/plugins/' . S2DIR . '/tinymce/';
|
3044 |
echo "tinyMCE.loadPlugin('subscribe2quicktags', '" . $this->fullpath . "');\n";
|
3045 |
}
|
3046 |
|
3069 |
Send a daily digest of today's new posts
|
3070 |
*/
|
3071 |
function subscribe2_cron($preview = '') {
|
3072 |
+
if ( defined(S2_CRON) && S2_CRON ) { return; }
|
3073 |
+
define( S2_CRON, true );
|
3074 |
global $wpdb;
|
3075 |
|
3076 |
+
if ( '' == $preview ) {
|
3077 |
// update last_s2cron execution time before completing or bailing
|
3078 |
$now = current_time('mysql');
|
3079 |
$prev = $this->subscribe2_options['last_s2cron'];
|
3081 |
update_option('subscribe2_options', $this->subscribe2_options);
|
3082 |
|
3083 |
//set up SQL query based on options
|
3084 |
+
if ( $this->subscribe2_options['private'] == 'yes' ) {
|
3085 |
$status = "'publish', 'private'";
|
3086 |
} else {
|
3087 |
$status = "'publish'";
|
3088 |
}
|
3089 |
|
3090 |
+
if ( $this->subscribe2_options['page'] == 'yes' ) {
|
3091 |
+
$type = "'post', 'page'";
|
3092 |
} else {
|
3093 |
$type = "'post'";
|
3094 |
}
|
3095 |
|
3096 |
// collect posts
|
3097 |
+
if ( $this->subscribe2_options['cron_order'] == 'desc' ) {
|
3098 |
$posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content, post_type, post_password, post_date 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");
|
3099 |
} else {
|
3100 |
$posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content, post_type, post_password, post_date 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");
|
3105 |
}
|
3106 |
|
3107 |
// do we have any posts?
|
3108 |
+
if ( empty($posts) ) { return; }
|
3109 |
|
3110 |
// if we have posts, let's prepare the digest
|
3111 |
$datetime = get_option('date_format') . ' @ ' . get_option('time_format');
|
3112 |
$all_post_cats = array();
|
3113 |
+
$mailtext = apply_filters('s2_email_template', $this->subscribe2_options['mailtext']);
|
3114 |
$table = '';
|
3115 |
$message_post= '';
|
3116 |
$message_posttime = '';
|
3117 |
+
foreach ( $posts as $post ) {
|
3118 |
$post_cats = wp_get_post_categories($post->ID);
|
3119 |
$post_cats_string = implode(',', $post_cats);
|
3120 |
$all_post_cats = array_unique(array_merge($all_post_cats, $post_cats));
|
3121 |
$check = false;
|
3122 |
// is the current post assigned to any categories
|
3123 |
// which should not generate a notification email?
|
3124 |
+
foreach ( explode(',', $this->subscribe2_options['exclude']) as $cat ) {
|
3125 |
+
if ( in_array($cat, $post_cats) ) {
|
3126 |
$check = true;
|
3127 |
}
|
3128 |
}
|
3129 |
// is the current post set by the user to
|
3130 |
// not generate a notification email?
|
3131 |
$s2mail = get_post_meta($post->ID, 's2mail', true);
|
3132 |
+
if ( strtolower(trim($s2mail)) == 'no' ) {
|
3133 |
$check = true;
|
3134 |
}
|
3135 |
// is the current post private
|
3136 |
// and should this not generate a notification email?
|
3137 |
+
if ( $this->subscribe2_options['password'] == 'no' && $post->post_password != '' ) {
|
3138 |
$check = true;
|
3139 |
}
|
3140 |
// if this post is excluded
|
3141 |
// don't include it in the digest
|
3142 |
+
if ( $check ) {
|
3143 |
continue;
|
3144 |
}
|
3145 |
('' == $table) ? $table = "* " . $post->post_title : $table .= "\r\n* " . $post->post_title;
|
3146 |
$message_post .= $post->post_title . "\r\n";
|
3147 |
+
$message_post .= get_permalink($post->ID) . "\r\n";
|
3148 |
$message_posttime .= $post->post_title . "\r\n";
|
3149 |
$message_posttime .= __('Posted on', 'subscribe2') . ": " . mysql2date($datetime, $post->post_date) . "\r\n";
|
3150 |
+
$message_posttime .= get_permalink($post->ID) . "\r\n";
|
3151 |
+
if ( strstr($mailtext, "CATS")) {
|
3152 |
+
$post_cat_names = implode(', ', wp_get_post_categories($post->ID, array('fields' => 'names')));
|
3153 |
+
$message_post .= __('Posted in', 'subscribe2') . ": " . $post_cat_names . "\r\n";
|
3154 |
+
$message_posttime .= __('Posted in', 'subscribe2') . ": " . $post_cat_names . "\r\n";
|
3155 |
+
}
|
3156 |
+
if ( strstr($mailtext, "TAGS")) {
|
3157 |
+
$post_tag_names = implode(', ', wp_get_post_tags($post->ID, array('fields' => 'names')));
|
3158 |
+
if ( $post_tag_names != '' ) {
|
3159 |
+
$message_post .= __('Tagged as', 'subscribe2') . ": " . $post_tag_names . "\r\n";
|
3160 |
+
$message_posttime .= __('Tagged as', 'subscribe2') . ": " . $post_tag_names . "\r\n";
|
3161 |
+
}
|
3162 |
+
}
|
3163 |
+
$message_post .= "\r\n";
|
3164 |
+
$message_posttime .= "\r\n";
|
3165 |
+
|
3166 |
$excerpt = $post->post_excerpt;
|
3167 |
+
if ( '' == $excerpt ) {
|
3168 |
// no excerpt, is there a <!--more--> ?
|
3169 |
+
if ( false !== strpos($post->post_content, '<!--more-->') ) {
|
3170 |
+
list($excerpt, $more) = explode('<!--more-->', $post->post_content, 2);
|
3171 |
+
$excerpt = strip_tags($excerpt);
|
3172 |
+
if ( function_exists('strip_shortcodes') ) {
|
3173 |
$excerpt = strip_shortcodes($excerpt);
|
3174 |
}
|
3175 |
} else {
|
3176 |
$excerpt = strip_tags($post->post_content);
|
3177 |
+
if ( function_exists('strip_shortcodes') ) {
|
3178 |
$excerpt = strip_shortcodes($excerpt);
|
3179 |
}
|
3180 |
$words = explode(' ', $excerpt, $this->excerpt_length + 1);
|
3181 |
+
if ( count($words) > $this->excerpt_length ) {
|
3182 |
array_pop($words);
|
3183 |
array_push($words, '[...]');
|
3184 |
$excerpt = implode(' ', $words);
|
3196 |
$message_posttime = trim($message_posttime);
|
3197 |
|
3198 |
//sanity check - don't send a mail if the content is empty
|
3199 |
+
if ( !$message_post && !$message_posttime && !$table ) {
|
3200 |
return;
|
3201 |
}
|
3202 |
|
3209 |
$email_freq = $this->subscribe2_options['email_freq'];
|
3210 |
$display = $scheds[$email_freq]['display'];
|
3211 |
$subject = "[" . stripslashes(get_option('blogname')) . "] " . $display . " " . __('Digest Email', 'subscribe2');
|
|
|
3212 |
$mailtext = stripslashes($this->substitute($mailtext));
|
3213 |
$mailtext = str_replace("TABLE", $table, $mailtext);
|
3214 |
$mailtext = str_replace("POSTTIME", $message_posttime, $mailtext);
|
3215 |
$mailtext = str_replace("POST", $message_post, $mailtext);
|
3216 |
|
3217 |
// prepare recipients
|
3218 |
+
if ( $preview != '' ) {
|
3219 |
$this->myemail = $preview;
|
3220 |
$this->myname = "Preview";
|
3221 |
+
$this->mail(array($preview), $subject, $mailtext);
|
3222 |
} else {
|
3223 |
$public = $this->get_public();
|
3224 |
$all_post_cats_string = implode(',', $all_post_cats);
|
3237 |
$this->subscribe2_options = get_option('subscribe2_options');
|
3238 |
|
3239 |
add_action('init', array(&$this, 'subscribe2'));
|
3240 |
+
if ( '1' == $this->subscribe2_options['show_button'] ) {
|
3241 |
add_action('init', array(&$this, 'button_init'));
|
3242 |
}
|
3243 |
// add action to display widget if option is enabled
|
3244 |
+
if ( '1' == $this->subscribe2_options['widget'] ) {
|
3245 |
add_action('plugins_loaded', array(&$this, 'register_subscribe2widget'));
|
3246 |
}
|
3247 |
// add action to handle WPMU subscriptions and unsubscriptions
|
3248 |
+
if ( isset($_GET['s2mu_subscribe']) || isset($_GET['s2mu_unsubscribe']) ) {
|
3249 |
add_action('init', array(&$this, 'wpmu_subscribe'));
|
3250 |
}
|
3251 |
} // end s2init()
|
3253 |
function subscribe2() {
|
3254 |
global $table_prefix, $wp_version, $wpmu_version;
|
3255 |
|
3256 |
+
load_plugin_textdomain('subscribe2', 'wp-content/plugins/' . S2DIR, S2DIR);
|
3257 |
|
3258 |
// Is this WordPressMU or not?
|
3259 |
+
if ( isset($wpmu_version) || strpos($wp_version, 'wordpress-mu') ) {
|
3260 |
$this->s2_mu = true;
|
3261 |
} else {
|
3262 |
$this->s2_mu = false;
|
3264 |
|
3265 |
// do we need to install anything?
|
3266 |
$this->public = $table_prefix . "subscribe2";
|
3267 |
+
if ( !mysql_query("DESCRIBE " . $this->public) ) { $this->install(); }
|
3268 |
//do we need to upgrade anything?
|
3269 |
+
if ( is_array($this->subscribe2_options) && $this->subscribe2_options['version'] !== S2VERSION ) {
|
3270 |
add_action('shutdown', array(&$this, 'upgrade'));
|
3271 |
}
|
3272 |
|
3273 |
+
if ( isset($_GET['s2']) ) {
|
3274 |
// someone is confirming a request
|
3275 |
add_filter('query_string', array(&$this, 'query_filter'));
|
3276 |
add_filter('the_title', array(&$this, 'title_filter'));
|
3277 |
add_filter('the_content', array(&$this, 'confirm'));
|
3278 |
}
|
3279 |
|
3280 |
+
if ( isset($_POST['s2_admin']) && $_POST['csv'] ) {
|
3281 |
$date = date('Y-m-d');
|
3282 |
header("Content-Description: File Transfer");
|
3283 |
header("Content-type: application/octet-stream");
|
3299 |
add_filter('cron_schedules', array(&$this, 'add_weekly_sched'));
|
3300 |
|
3301 |
// add actions for other plugins
|
3302 |
+
if ( '1' == $this->subscribe2_options['show_meta'] ) {
|
3303 |
add_action('wp_meta', array(&$this, 'add_minimeta'), 0);
|
3304 |
}
|
3305 |
// Add filters for Ozh Admin Menu
|
3310 |
|
3311 |
|
3312 |
// add action to display editor buttons if option is enabled
|
3313 |
+
if ( '1' == $this->subscribe2_options['show_button'] ) {
|
3314 |
add_action('edit_page_form', array(&$this, 's2_edit_form'));
|
3315 |
add_action('edit_form_advanced', array(&$this, 's2_edit_form'));
|
3316 |
}
|
3321 |
add_action('add_user_to_blog', array(&$this, 'register'), 10, 1);
|
3322 |
|
3323 |
// add actions for processing posts based on per-post or cron email settings
|
3324 |
+
if ( $this->subscribe2_options['email_freq'] != 'never' ) {
|
3325 |
add_action('s2_digest_cron', array(&$this, 'subscribe2_cron'));
|
3326 |
} else {
|
3327 |
add_action('new_to_publish', array(&$this, 'publish'));
|
3330 |
add_action('private_to_publish', array(&$this, 'publish'));
|
3331 |
add_action('future_to_publish', array(&$this, 'publish'));
|
3332 |
add_action('publish_phone', array(&$this, 'publish_phone'));
|
3333 |
+
if ( $this->subscribe2_options['private'] == 'yes' ) {
|
3334 |
add_action('new_to_private', array(&$this, 'publish'));
|
3335 |
add_action('draft_to_private', array(&$this, 'publish'));
|
3336 |
add_action('pending_to_private', array(&$this, 'publish'));
|
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: 2009-
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -16,773 +16,783 @@ msgstr ""
|
|
16 |
"Content-Type: text/plain; charset=CHARSET\n"
|
17 |
"Content-Transfer-Encoding: 8bit\n"
|
18 |
|
19 |
-
#: subscribe2.php:
|
20 |
msgid "To manage your subscription options please"
|
21 |
msgstr ""
|
22 |
|
23 |
-
#: subscribe2.php:
|
24 |
msgid "login"
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: subscribe2.php:
|
28 |
msgid "You may manage your subscription options from your"
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: subscribe2.php:
|
32 |
msgid "profile"
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: subscribe2.php:
|
36 |
msgid "A confirmation message is on its way!"
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: subscribe2.php:
|
40 |
msgid "That email address is already subscribed."
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: subscribe2.php:
|
44 |
msgid "That email address is not subscribed."
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: subscribe2.php:
|
48 |
msgid "Sorry, but that does not look like an email address to me."
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: subscribe2.php:
|
52 |
msgid ""
|
53 |
"Sorry, email addresses at that domain are currently barred due to spam, "
|
54 |
"please use an alternative email address."
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: subscribe2.php:
|
58 |
msgid ""
|
59 |
"Sorry, there seems to be an error on the server. Please try again later."
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: subscribe2.php:
|
63 |
msgid "Message sent!"
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: subscribe2.php:
|
67 |
msgid ""
|
68 |
"Message failed! Check your settings and check with your hosting provider"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: subscribe2.php:
|
72 |
msgid "Your email:"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: subscribe2.php:
|
76 |
msgid "Enter email address..."
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: subscribe2.php:
|
80 |
-
#: subscribe2.php:
|
81 |
msgid "Subscribe"
|
82 |
msgstr ""
|
83 |
|
84 |
-
#: subscribe2.php:
|
85 |
-
#: subscribe2.php:
|
86 |
msgid "Unsubscribe"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: subscribe2.php:
|
90 |
msgid "No such email address is registered."
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: subscribe2.php:
|
94 |
msgid "You have successfully subscribed!"
|
95 |
msgstr ""
|
96 |
|
97 |
-
#: subscribe2.php:
|
98 |
msgid "You have successfully unsubscribed."
|
99 |
msgstr ""
|
100 |
|
101 |
-
#: subscribe2.php:
|
102 |
msgid "subscribe"
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: subscribe2.php:
|
106 |
msgid "unsubscribe"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: subscribe2.php:
|
110 |
msgid "Options saved!"
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: subscribe2.php:
|
114 |
msgid "Options reset!"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: subscribe2.php:
|
118 |
msgid "Subscribers"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: subscribe2.php:
|
122 |
msgid "Subscribe2 Options"
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: subscribe2.php:
|
126 |
msgid "Subscribe2"
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: subscribe2.php:
|
130 |
msgid "Subscriptions"
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: subscribe2.php:
|
134 |
msgid "Mail Subscribers"
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: subscribe2.php:
|
138 |
msgid "New subscription"
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: subscribe2.php:
|
142 |
msgid "subscribed to email notifications!"
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: subscribe2.php:
|
146 |
msgid "New Unsubscription"
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: subscribe2.php:
|
150 |
msgid "unsubscribed from email notifications!"
|
151 |
msgstr ""
|
152 |
|
153 |
-
#: subscribe2.php:
|
154 |
msgid "Address(es) subscribed!"
|
155 |
msgstr ""
|
156 |
|
157 |
-
#: subscribe2.php:
|
158 |
msgid "Address(es) unsubscribed!"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: subscribe2.php:
|
162 |
msgid "Address(es) deleted!"
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: subscribe2.php:
|
166 |
msgid "Status changed!"
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: subscribe2.php:
|
170 |
msgid "Reminder Email(s) Sent!"
|
171 |
msgstr ""
|
172 |
|
173 |
-
#: subscribe2.php:
|
174 |
msgid "Registered Users Subscribed!"
|
175 |
msgstr ""
|
176 |
|
177 |
-
#: subscribe2.php:
|
178 |
msgid "Registered Users Unsubscribed!"
|
179 |
msgstr ""
|
180 |
|
181 |
-
#: subscribe2.php:
|
182 |
msgid "Format updated for Registered Users!"
|
183 |
msgstr ""
|
184 |
|
185 |
-
#: subscribe2.php:
|
186 |
msgid "Previous Page"
|
187 |
msgstr ""
|
188 |
|
189 |
-
#: subscribe2.php:
|
190 |
msgid "Next Page"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: subscribe2.php:
|
194 |
msgid "Manage Subscribers"
|
195 |
msgstr ""
|
196 |
|
197 |
-
#: subscribe2.php:
|
198 |
msgid "Add/Remove Subscribers"
|
199 |
msgstr ""
|
200 |
|
201 |
-
#: subscribe2.php:
|
202 |
msgid "Enter addresses, one per line or comma-separated"
|
203 |
msgstr ""
|
204 |
|
205 |
-
#: subscribe2.php:
|
206 |
msgid "Current Subscribers"
|
207 |
msgstr ""
|
208 |
|
209 |
-
#: subscribe2.php:
|
210 |
msgid "Filter"
|
211 |
msgstr ""
|
212 |
|
213 |
-
#: subscribe2.php:
|
214 |
msgid "Search Subscribers"
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: subscribe2.php:
|
218 |
msgid "Send Reminder Email"
|
219 |
msgstr ""
|
220 |
|
221 |
-
#: subscribe2.php:
|
222 |
msgid "Save Emails to CSV File"
|
223 |
msgstr ""
|
224 |
|
225 |
-
#: subscribe2.php:
|
226 |
msgid "Process"
|
227 |
msgstr ""
|
228 |
|
229 |
-
#: subscribe2.php:
|
230 |
msgid "Confirm this email address"
|
231 |
msgstr ""
|
232 |
|
233 |
-
#: subscribe2.php:
|
234 |
msgid "Unconfirm this email address"
|
235 |
msgstr ""
|
236 |
|
237 |
-
#: subscribe2.php:
|
238 |
msgid "Delete this email address"
|
239 |
msgstr ""
|
240 |
|
241 |
-
#: subscribe2.php:
|
242 |
msgid "Select / Unselect All"
|
243 |
msgstr ""
|
244 |
|
245 |
-
#: subscribe2.php:
|
246 |
msgid "edit"
|
247 |
msgstr ""
|
248 |
|
249 |
-
#: subscribe2.php:
|
250 |
msgid "No matching subscribers found"
|
251 |
msgstr ""
|
252 |
|
253 |
-
#: subscribe2.php:
|
254 |
msgid "NONE"
|
255 |
msgstr ""
|
256 |
|
257 |
-
#: subscribe2.php:
|
258 |
msgid "Categories"
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: subscribe2.php:
|
262 |
msgid ""
|
263 |
"Preferences for all existing Registered Users can be changed using this "
|
264 |
"section."
|
265 |
msgstr ""
|
266 |
|
267 |
-
#: subscribe2.php:
|
268 |
msgid "Consider User Privacy as changes cannot be undone"
|
269 |
msgstr ""
|
270 |
|
271 |
-
#: subscribe2.php:
|
272 |
msgid "Action to perform"
|
273 |
msgstr ""
|
274 |
|
275 |
-
#: subscribe2.php:
|
276 |
msgid "Bulk Update Categories"
|
277 |
msgstr ""
|
278 |
|
279 |
-
#: subscribe2.php:
|
280 |
msgid "Send email as"
|
281 |
msgstr ""
|
282 |
|
283 |
-
#: subscribe2.php:
|
284 |
msgid "Plain Text - Excerpt"
|
285 |
msgstr ""
|
286 |
|
287 |
-
#: subscribe2.php:
|
288 |
msgid "Plain Text - Full"
|
289 |
msgstr ""
|
290 |
|
291 |
-
#: subscribe2.php:
|
292 |
msgid "HTML"
|
293 |
msgstr ""
|
294 |
|
295 |
-
#: subscribe2.php:
|
296 |
msgid "Bulk Update Format"
|
297 |
msgstr ""
|
298 |
|
299 |
-
#: subscribe2.php:
|
300 |
msgid "Subscribe2 Settings"
|
301 |
msgstr ""
|
302 |
|
303 |
-
#: subscribe2.php:
|
304 |
msgid "Plugin Blog"
|
305 |
msgstr ""
|
306 |
|
307 |
-
#: subscribe2.php:
|
308 |
msgid "Support Forum"
|
309 |
msgstr ""
|
310 |
|
311 |
-
#: subscribe2.php:
|
312 |
msgid "Make a donation via PayPal"
|
313 |
msgstr ""
|
314 |
|
315 |
-
#: subscribe2.php:
|
316 |
msgid "Notification Settings"
|
317 |
msgstr ""
|
318 |
|
319 |
-
#: subscribe2.php:
|
320 |
msgid "Restrict the number of recipients per email to (0 for unlimited)"
|
321 |
msgstr ""
|
322 |
|
323 |
-
#: subscribe2.php:
|
324 |
msgid "Edit"
|
325 |
msgstr ""
|
326 |
|
327 |
-
#: subscribe2.php:
|
328 |
msgid "Update"
|
329 |
msgstr ""
|
330 |
|
331 |
-
#: subscribe2.php:
|
332 |
msgid "Revert"
|
333 |
msgstr ""
|
334 |
|
335 |
-
#: subscribe2.php:
|
336 |
msgid "Send Admins notifications for new"
|
337 |
msgstr ""
|
338 |
|
339 |
-
#: subscribe2.php:
|
340 |
msgid "Unsubscriptions"
|
341 |
msgstr ""
|
342 |
|
343 |
-
#: subscribe2.php:
|
344 |
msgid "Both"
|
345 |
msgstr ""
|
346 |
|
347 |
-
#: subscribe2.php:
|
348 |
msgid "Neither"
|
349 |
msgstr ""
|
350 |
|
351 |
-
#: subscribe2.php:
|
352 |
msgid "Include theme CSS stylesheet in HTML notifications"
|
353 |
msgstr ""
|
354 |
|
355 |
-
#: subscribe2.php:
|
356 |
-
#: subscribe2.php:
|
357 |
-
#: subscribe2.php:
|
358 |
-
#: subscribe2.php:
|
359 |
msgid "Yes"
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: subscribe2.php:
|
363 |
-
#: subscribe2.php:
|
364 |
-
#: subscribe2.php:
|
365 |
-
#: subscribe2.php:
|
366 |
msgid "No"
|
367 |
msgstr ""
|
368 |
|
369 |
-
#: subscribe2.php:
|
370 |
msgid "Send Emails for Pages"
|
371 |
msgstr ""
|
372 |
|
373 |
-
#: subscribe2.php:
|
374 |
msgid "Send Emails for Password Protected Posts"
|
375 |
msgstr ""
|
376 |
|
377 |
-
#: subscribe2.php:
|
378 |
msgid "Send Emails for Private Posts"
|
379 |
msgstr ""
|
380 |
|
381 |
-
#: subscribe2.php:
|
382 |
msgid "Send Email From"
|
383 |
msgstr ""
|
384 |
|
385 |
-
#: subscribe2.php:
|
386 |
msgid "Send Emails"
|
387 |
msgstr ""
|
388 |
|
389 |
-
#: subscribe2.php:
|
390 |
msgid "For digest notifications, date order for posts is"
|
391 |
msgstr ""
|
392 |
|
393 |
-
#: subscribe2.php:
|
394 |
msgid "Descending"
|
395 |
msgstr ""
|
396 |
|
397 |
-
#: subscribe2.php:
|
398 |
msgid "Ascending"
|
399 |
msgstr ""
|
400 |
|
401 |
-
#: subscribe2.php:
|
402 |
msgid "Email Templates"
|
403 |
msgstr ""
|
404 |
|
405 |
-
#: subscribe2.php:
|
406 |
msgid "New Post email (must not be empty)"
|
407 |
msgstr ""
|
408 |
|
409 |
-
#: subscribe2.php:
|
410 |
msgid "Subject Line"
|
411 |
msgstr ""
|
412 |
|
413 |
-
#: subscribe2.php:
|
414 |
msgid "Send Email Preview"
|
415 |
msgstr ""
|
416 |
|
417 |
-
#: subscribe2.php:
|
418 |
msgid "Message substitions"
|
419 |
msgstr ""
|
420 |
|
421 |
-
#: subscribe2.php:
|
422 |
msgid "the post's title<br />(<i>for per-post emails only</i>)"
|
423 |
msgstr ""
|
424 |
|
425 |
-
#: subscribe2.php:
|
426 |
msgid ""
|
427 |
"the excerpt or the entire post<br />(<i>based on the subscriber's "
|
428 |
"preferences</i>)"
|
429 |
msgstr ""
|
430 |
|
431 |
-
#: subscribe2.php:
|
432 |
msgid ""
|
433 |
"the excerpt of the post and the time it was posted<br />(<i>for digest "
|
434 |
"emails only</i>)"
|
435 |
msgstr ""
|
436 |
|
437 |
-
#: subscribe2.php:
|
438 |
msgid "a list of post titles<br />(<i>for digest emails only</i>)"
|
439 |
msgstr ""
|
440 |
|
441 |
-
#: subscribe2.php:
|
442 |
msgid "the post's permalink<br />(<i>for per-post emails only</i>)"
|
443 |
msgstr ""
|
444 |
|
445 |
-
#: subscribe2.php:
|
446 |
msgid ""
|
447 |
"the post's permalink after conversion by TinyURL<br />(<i>for per-post "
|
448 |
"emails only</i>)"
|
449 |
msgstr ""
|
450 |
|
451 |
-
#: subscribe2.php:
|
452 |
-
msgid ""
|
453 |
-
"the post's permalink after conversion by BurnURL<br />(<i>for per-post "
|
454 |
-
"emails only</i>)"
|
455 |
-
msgstr ""
|
456 |
-
|
457 |
-
#: subscribe2.php:1940
|
458 |
msgid "the admin or post author's name"
|
459 |
msgstr ""
|
460 |
|
461 |
-
#: subscribe2.php:
|
462 |
msgid "the admin or post author's email"
|
463 |
msgstr ""
|
464 |
|
465 |
-
#: subscribe2.php:
|
466 |
msgid "the post author's name"
|
467 |
msgstr ""
|
468 |
|
469 |
-
#: subscribe2.php:
|
470 |
msgid ""
|
471 |
"the generated link to confirm a request<br />(<i>only used in the "
|
472 |
"confirmation email template</i>)"
|
473 |
msgstr ""
|
474 |
|
475 |
-
#: subscribe2.php:
|
476 |
msgid ""
|
477 |
"Action performed by LINK in confirmation email<br />(<i>only used in the "
|
478 |
"confirmation email template</i>)"
|
479 |
msgstr ""
|
480 |
|
481 |
-
#: subscribe2.php:
|
482 |
msgid "the post's assigned categories"
|
483 |
msgstr ""
|
484 |
|
485 |
-
#: subscribe2.php:
|
486 |
msgid "the post's assigned Tags"
|
487 |
msgstr ""
|
488 |
|
489 |
-
#: subscribe2.php:
|
490 |
msgid "Subscribe / Unsubscribe confirmation email"
|
491 |
msgstr ""
|
492 |
|
493 |
-
#: subscribe2.php:
|
494 |
msgid "Reminder email to Unconfirmed Subscribers"
|
495 |
msgstr ""
|
496 |
|
497 |
-
#: subscribe2.php:
|
498 |
msgid "Excluded Categories"
|
499 |
msgstr ""
|
500 |
|
501 |
-
#: subscribe2.php:
|
502 |
msgid ""
|
503 |
"Posts assigned to any Excluded Category do not generate notifications and "
|
504 |
"are not included in digest notifications"
|
505 |
msgstr ""
|
506 |
|
507 |
-
#: subscribe2.php:
|
508 |
msgid "Allow registered users to subscribe to excluded categories?"
|
509 |
msgstr ""
|
510 |
|
511 |
-
#: subscribe2.php:
|
512 |
msgid "Appearance"
|
513 |
msgstr ""
|
514 |
|
515 |
-
#: subscribe2.php:
|
516 |
msgid "Set default Subscribe2 page as ID"
|
517 |
msgstr ""
|
518 |
|
519 |
-
#: subscribe2.php:
|
520 |
msgid "Set the number of Subscribers displayed per page"
|
521 |
msgstr ""
|
522 |
|
523 |
-
#: subscribe2.php:
|
524 |
msgid "Show a link to your subscription page in \"meta\"?"
|
525 |
msgstr ""
|
526 |
|
527 |
-
#: subscribe2.php:
|
528 |
msgid "Show the Subscribe2 button on the Write toolbar?"
|
529 |
msgstr ""
|
530 |
|
531 |
-
#: subscribe2.php:
|
532 |
msgid "Enable Subscribe2 Widget?"
|
533 |
msgstr ""
|
534 |
|
535 |
-
#: subscribe2.php:
|
536 |
msgid "Auto Subscribe"
|
537 |
msgstr ""
|
538 |
|
539 |
-
#: subscribe2.php:
|
540 |
msgid "Subscribe new users registering with your blog"
|
541 |
msgstr ""
|
542 |
|
543 |
-
#: subscribe2.php:
|
544 |
msgid "Automatically"
|
545 |
msgstr ""
|
546 |
|
547 |
-
#: subscribe2.php:
|
548 |
msgid "Display option on Registration Form"
|
549 |
msgstr ""
|
550 |
|
551 |
-
#: subscribe2.php:
|
552 |
msgid "Auto-subscribe includes any excluded categories"
|
553 |
msgstr ""
|
554 |
|
555 |
-
#: subscribe2.php:
|
556 |
msgid "Registration Form option is checked by default"
|
557 |
msgstr ""
|
558 |
|
559 |
-
#: subscribe2.php:
|
560 |
msgid "Auto-subscribe users to receive email as"
|
561 |
msgstr ""
|
562 |
|
563 |
-
#: subscribe2.php:
|
564 |
msgid "Registered Users have the option to auto-subscribe to new categories"
|
565 |
msgstr ""
|
566 |
|
567 |
-
#: subscribe2.php:
|
568 |
msgid "New categories are immediately excluded"
|
569 |
msgstr ""
|
570 |
|
571 |
-
#: subscribe2.php:
|
572 |
msgid ""
|
573 |
"Option for Registered Users to auto-subscribe to new categories is checked "
|
574 |
"by default"
|
575 |
msgstr ""
|
576 |
|
577 |
-
#: subscribe2.php:
|
578 |
msgid "Barred Domains"
|
579 |
msgstr ""
|
580 |
|
581 |
-
#: subscribe2.php:
|
582 |
msgid ""
|
583 |
"Enter domains to bar from public subscriptions: <br /> (Use a new line for "
|
584 |
"each entry and omit the \"@\" symbol, for example email.com)"
|
585 |
msgstr ""
|
586 |
|
587 |
-
#: subscribe2.php:
|
588 |
msgid "Submit"
|
589 |
msgstr ""
|
590 |
|
591 |
-
#: subscribe2.php:
|
592 |
msgid "Reset Default"
|
593 |
msgstr ""
|
594 |
|
595 |
-
#: subscribe2.php:
|
596 |
msgid ""
|
597 |
"Use this to reset all options to their defaults. This <strong><em>will not</"
|
598 |
"em></strong> modify your list of subscribers."
|
599 |
msgstr ""
|
600 |
|
601 |
-
#: subscribe2.php:
|
602 |
msgid "RESET"
|
603 |
msgstr ""
|
604 |
|
605 |
-
#: subscribe2.php:
|
606 |
msgid "Subscription preferences updated."
|
607 |
msgstr ""
|
608 |
|
609 |
-
#: subscribe2.php:
|
610 |
msgid "Editing Subscribe2 preferences for user"
|
611 |
msgstr ""
|
612 |
|
613 |
-
#: subscribe2.php:
|
614 |
msgid "Receive email as"
|
615 |
msgstr ""
|
616 |
|
617 |
-
#: subscribe2.php:
|
618 |
msgid "Automatically subscribe me to newly created categories"
|
619 |
msgstr ""
|
620 |
|
621 |
-
#: subscribe2.php:
|
622 |
msgid "Unsubscribe me from this blog"
|
623 |
msgstr ""
|
624 |
|
625 |
-
#: subscribe2.php:
|
626 |
msgid "Subscribe to all categories"
|
627 |
msgstr ""
|
628 |
|
629 |
-
#: subscribe2.php:
|
630 |
msgid "Subscribed Categories on"
|
631 |
msgstr ""
|
632 |
|
633 |
-
#: subscribe2.php:
|
634 |
msgid "Subscribed Categories"
|
635 |
msgstr ""
|
636 |
|
637 |
-
#: subscribe2.php:
|
638 |
msgid "Receive periodic summaries of new posts?"
|
639 |
msgstr ""
|
640 |
|
641 |
-
#: subscribe2.php:
|
642 |
msgid "Update Preferences"
|
643 |
msgstr ""
|
644 |
|
645 |
-
#: subscribe2.php:
|
646 |
msgid "Subscribed Blogs"
|
647 |
msgstr ""
|
648 |
|
649 |
-
#: subscribe2.php:
|
650 |
msgid "Viewing Settings Now"
|
651 |
msgstr ""
|
652 |
|
653 |
-
#: subscribe2.php:
|
654 |
msgid "View Settings"
|
655 |
msgstr ""
|
656 |
|
657 |
-
#: subscribe2.php:
|
658 |
msgid "Subscribe to new blogs"
|
659 |
msgstr ""
|
660 |
|
661 |
-
#: subscribe2.php:
|
662 |
msgid "Send an email to subscribers"
|
663 |
msgstr ""
|
664 |
|
665 |
-
#: subscribe2.php:
|
666 |
msgid "A message from"
|
667 |
msgstr ""
|
668 |
|
669 |
-
#: subscribe2.php:
|
670 |
msgid "Subject"
|
671 |
msgstr ""
|
672 |
|
673 |
-
#: subscribe2.php:
|
674 |
msgid "Recipients:"
|
675 |
msgstr ""
|
676 |
|
677 |
-
#: subscribe2.php:
|
678 |
msgid "Send"
|
679 |
msgstr ""
|
680 |
|
681 |
-
#: subscribe2.php:
|
682 |
msgid "All Users and Subscribers"
|
683 |
msgstr ""
|
684 |
|
685 |
-
#: subscribe2.php:
|
686 |
msgid "Public Subscribers"
|
687 |
msgstr ""
|
688 |
|
689 |
-
#: subscribe2.php:
|
690 |
msgid "Confirmed"
|
691 |
msgstr ""
|
692 |
|
693 |
-
#: subscribe2.php:
|
694 |
msgid "Unconfirmed"
|
695 |
msgstr ""
|
696 |
|
697 |
-
#: subscribe2.php:
|
698 |
msgid "All Registered Users"
|
699 |
msgstr ""
|
700 |
|
701 |
-
#: subscribe2.php:
|
702 |
msgid "Registered Subscribers"
|
703 |
msgstr ""
|
704 |
|
705 |
-
#: subscribe2.php:
|
706 |
msgid "For each Post"
|
707 |
msgstr ""
|
708 |
|
709 |
-
#: subscribe2.php:
|
710 |
msgid "Send Digest Notification at"
|
711 |
msgstr ""
|
712 |
|
713 |
-
#: subscribe2.php:
|
714 |
msgid ""
|
715 |
"This option will work for digest notification sent daily or less frequently"
|
716 |
msgstr ""
|
717 |
|
718 |
-
#: subscribe2.php:
|
719 |
msgid "Current UTC time is"
|
720 |
msgstr ""
|
721 |
|
722 |
-
#: subscribe2.php:
|
723 |
msgid "Current blog time is"
|
724 |
msgstr ""
|
725 |
|
726 |
-
#: subscribe2.php:
|
727 |
msgid "Next email notification will be sent when your blog time is after"
|
728 |
msgstr ""
|
729 |
|
730 |
-
#: subscribe2.php:
|
731 |
msgid "Settings"
|
732 |
msgstr ""
|
733 |
|
734 |
-
#: subscribe2.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
735 |
msgid "Check here to Subscribe to email notifications for new posts"
|
736 |
msgstr ""
|
737 |
|
738 |
-
#: subscribe2.php:
|
739 |
msgid ""
|
740 |
"By registering with this blog you are also agreeing to receive email "
|
741 |
"notifications for new posts but you can unsubscribe at anytime"
|
742 |
msgstr ""
|
743 |
|
744 |
-
#: subscribe2.php:
|
745 |
msgid "Subscribe2 Notification Override"
|
746 |
msgstr ""
|
747 |
|
748 |
-
#: subscribe2.php:
|
749 |
msgid ""
|
750 |
"Check here to disable sending of an email notification for this post/page"
|
751 |
msgstr ""
|
752 |
|
753 |
-
#: subscribe2.php:
|
754 |
msgid "Subscription Confirmation"
|
755 |
msgstr ""
|
756 |
|
757 |
-
#: subscribe2.php:
|
758 |
msgid "Title"
|
759 |
msgstr ""
|
760 |
|
761 |
-
#: subscribe2.php:
|
762 |
msgid "Div class name"
|
763 |
msgstr ""
|
764 |
|
765 |
-
#: subscribe2.php:
|
766 |
msgid "Pre-Content"
|
767 |
msgstr ""
|
768 |
|
769 |
-
#: subscribe2.php:
|
770 |
msgid "Post-Content"
|
771 |
msgstr ""
|
772 |
|
773 |
-
#: subscribe2.php:
|
774 |
msgid "[Un]Subscribe to Posts"
|
775 |
msgstr ""
|
776 |
|
777 |
-
#: subscribe2.php:
|
778 |
msgid "Weekly"
|
779 |
msgstr ""
|
780 |
|
781 |
-
#: subscribe2.php:
|
782 |
msgid "Posted on"
|
783 |
msgstr ""
|
784 |
|
785 |
-
#: subscribe2.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
786 |
msgid "Digest Email"
|
787 |
msgstr ""
|
788 |
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
+
"POT-Creation-Date: 2009-12-19 20:30+0000\n"
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
16 |
"Content-Type: text/plain; charset=CHARSET\n"
|
17 |
"Content-Transfer-Encoding: 8bit\n"
|
18 |
|
19 |
+
#: subscribe2.php:71
|
20 |
msgid "To manage your subscription options please"
|
21 |
msgstr ""
|
22 |
|
23 |
+
#: subscribe2.php:71
|
24 |
msgid "login"
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: subscribe2.php:73 subscribe2.php:75
|
28 |
msgid "You may manage your subscription options from your"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: subscribe2.php:73 subscribe2.php:75
|
32 |
msgid "profile"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: subscribe2.php:77
|
36 |
msgid "A confirmation message is on its way!"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: subscribe2.php:79
|
40 |
msgid "That email address is already subscribed."
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: subscribe2.php:81
|
44 |
msgid "That email address is not subscribed."
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: subscribe2.php:83
|
48 |
msgid "Sorry, but that does not look like an email address to me."
|
49 |
msgstr ""
|
50 |
|
51 |
+
#: subscribe2.php:85
|
52 |
msgid ""
|
53 |
"Sorry, email addresses at that domain are currently barred due to spam, "
|
54 |
"please use an alternative email address."
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: subscribe2.php:87
|
58 |
msgid ""
|
59 |
"Sorry, there seems to be an error on the server. Please try again later."
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: subscribe2.php:89
|
63 |
msgid "Message sent!"
|
64 |
msgstr ""
|
65 |
|
66 |
+
#: subscribe2.php:91
|
67 |
msgid ""
|
68 |
"Message failed! Check your settings and check with your hosting provider"
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: subscribe2.php:93
|
72 |
msgid "Your email:"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: subscribe2.php:93
|
76 |
msgid "Enter email address..."
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: subscribe2.php:93 subscribe2.php:1551 subscribe2.php:1643
|
80 |
+
#: subscribe2.php:2344
|
81 |
msgid "Subscribe"
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: subscribe2.php:93 subscribe2.php:1552 subscribe2.php:1644
|
85 |
+
#: subscribe2.php:2323
|
86 |
msgid "Unsubscribe"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: subscribe2.php:96
|
90 |
msgid "No such email address is registered."
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: subscribe2.php:98
|
94 |
msgid "You have successfully subscribed!"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: subscribe2.php:100
|
98 |
msgid "You have successfully unsubscribed."
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: subscribe2.php:102
|
102 |
msgid "subscribe"
|
103 |
msgstr ""
|
104 |
|
105 |
+
#: subscribe2.php:104
|
106 |
msgid "unsubscribe"
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: subscribe2.php:107
|
110 |
msgid "Options saved!"
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: subscribe2.php:108
|
114 |
msgid "Options reset!"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: subscribe2.php:116
|
118 |
msgid "Subscribers"
|
119 |
msgstr ""
|
120 |
|
121 |
+
#: subscribe2.php:119
|
122 |
msgid "Subscribe2 Options"
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: subscribe2.php:119 subscribe2.php:2892 subscribe2.php:3012
|
126 |
msgid "Subscribe2"
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: subscribe2.php:124 subscribe2.php:1831
|
130 |
msgid "Subscriptions"
|
131 |
msgstr ""
|
132 |
|
133 |
+
#: subscribe2.php:128
|
134 |
msgid "Mail Subscribers"
|
135 |
msgstr ""
|
136 |
|
137 |
+
#: subscribe2.php:811
|
138 |
msgid "New subscription"
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: subscribe2.php:813
|
142 |
msgid "subscribed to email notifications!"
|
143 |
msgstr ""
|
144 |
|
145 |
+
#: subscribe2.php:828
|
146 |
msgid "New Unsubscription"
|
147 |
msgstr ""
|
148 |
|
149 |
+
#: subscribe2.php:830
|
150 |
msgid "unsubscribed from email notifications!"
|
151 |
msgstr ""
|
152 |
|
153 |
+
#: subscribe2.php:1366
|
154 |
msgid "Address(es) subscribed!"
|
155 |
msgstr ""
|
156 |
|
157 |
+
#: subscribe2.php:1369
|
158 |
msgid "Address(es) unsubscribed!"
|
159 |
msgstr ""
|
160 |
|
161 |
+
#: subscribe2.php:1379
|
162 |
msgid "Address(es) deleted!"
|
163 |
msgstr ""
|
164 |
|
165 |
+
#: subscribe2.php:1385 subscribe2.php:1391
|
166 |
msgid "Status changed!"
|
167 |
msgstr ""
|
168 |
|
169 |
+
#: subscribe2.php:1405
|
170 |
msgid "Reminder Email(s) Sent!"
|
171 |
msgstr ""
|
172 |
|
173 |
+
#: subscribe2.php:1408
|
174 |
msgid "Registered Users Subscribed!"
|
175 |
msgstr ""
|
176 |
|
177 |
+
#: subscribe2.php:1411
|
178 |
msgid "Registered Users Unsubscribed!"
|
179 |
msgstr ""
|
180 |
|
181 |
+
#: subscribe2.php:1420
|
182 |
msgid "Format updated for Registered Users!"
|
183 |
msgstr ""
|
184 |
|
185 |
+
#: subscribe2.php:1515
|
186 |
msgid "Previous Page"
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: subscribe2.php:1535
|
190 |
msgid "Next Page"
|
191 |
msgstr ""
|
192 |
|
193 |
+
#: subscribe2.php:1542
|
194 |
msgid "Manage Subscribers"
|
195 |
msgstr ""
|
196 |
|
197 |
+
#: subscribe2.php:1547
|
198 |
msgid "Add/Remove Subscribers"
|
199 |
msgstr ""
|
200 |
|
201 |
+
#: subscribe2.php:1548
|
202 |
msgid "Enter addresses, one per line or comma-separated"
|
203 |
msgstr ""
|
204 |
|
205 |
+
#: subscribe2.php:1555
|
206 |
msgid "Current Subscribers"
|
207 |
msgstr ""
|
208 |
|
209 |
+
#: subscribe2.php:1557
|
210 |
msgid "Filter"
|
211 |
msgstr ""
|
212 |
|
213 |
+
#: subscribe2.php:1564
|
214 |
msgid "Search Subscribers"
|
215 |
msgstr ""
|
216 |
|
217 |
+
#: subscribe2.php:1567
|
218 |
msgid "Send Reminder Email"
|
219 |
msgstr ""
|
220 |
|
221 |
+
#: subscribe2.php:1572
|
222 |
msgid "Save Emails to CSV File"
|
223 |
msgstr ""
|
224 |
|
225 |
+
#: subscribe2.php:1578 subscribe2.php:1632
|
226 |
msgid "Process"
|
227 |
msgstr ""
|
228 |
|
229 |
+
#: subscribe2.php:1587 subscribe2.php:1609
|
230 |
msgid "Confirm this email address"
|
231 |
msgstr ""
|
232 |
|
233 |
+
#: subscribe2.php:1589 subscribe2.php:1602
|
234 |
msgid "Unconfirm this email address"
|
235 |
msgstr ""
|
236 |
|
237 |
+
#: subscribe2.php:1591 subscribe2.php:1604 subscribe2.php:1612
|
238 |
msgid "Delete this email address"
|
239 |
msgstr ""
|
240 |
|
241 |
+
#: subscribe2.php:1595 subscribe2.php:2459
|
242 |
msgid "Select / Unselect All"
|
243 |
msgstr ""
|
244 |
|
245 |
+
#: subscribe2.php:1619
|
246 |
msgid "edit"
|
247 |
msgstr ""
|
248 |
|
249 |
+
#: subscribe2.php:1626
|
250 |
msgid "No matching subscribers found"
|
251 |
msgstr ""
|
252 |
|
253 |
+
#: subscribe2.php:1628
|
254 |
msgid "NONE"
|
255 |
msgstr ""
|
256 |
|
257 |
+
#: subscribe2.php:1638
|
258 |
msgid "Categories"
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: subscribe2.php:1639
|
262 |
msgid ""
|
263 |
"Preferences for all existing Registered Users can be changed using this "
|
264 |
"section."
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: subscribe2.php:1640
|
268 |
msgid "Consider User Privacy as changes cannot be undone"
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: subscribe2.php:1642
|
272 |
msgid "Action to perform"
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: subscribe2.php:1647
|
276 |
msgid "Bulk Update Categories"
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: subscribe2.php:1649
|
280 |
msgid "Send email as"
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: subscribe2.php:1650 subscribe2.php:2066 subscribe2.php:2210
|
284 |
msgid "Plain Text - Excerpt"
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: subscribe2.php:1651 subscribe2.php:2061 subscribe2.php:2205
|
288 |
msgid "Plain Text - Full"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: subscribe2.php:1652 subscribe2.php:2056 subscribe2.php:2200
|
292 |
msgid "HTML"
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: subscribe2.php:1653
|
296 |
msgid "Bulk Update Format"
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: subscribe2.php:1803
|
300 |
msgid "Subscribe2 Settings"
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: subscribe2.php:1804
|
304 |
msgid "Plugin Blog"
|
305 |
msgstr ""
|
306 |
|
307 |
+
#: subscribe2.php:1805
|
308 |
msgid "Support Forum"
|
309 |
msgstr ""
|
310 |
|
311 |
+
#: subscribe2.php:1806
|
312 |
msgid "Make a donation via PayPal"
|
313 |
msgstr ""
|
314 |
|
315 |
+
#: subscribe2.php:1817 subscribe2.php:2183
|
316 |
msgid "Notification Settings"
|
317 |
msgstr ""
|
318 |
|
319 |
+
#: subscribe2.php:1818
|
320 |
msgid "Restrict the number of recipients per email to (0 for unlimited)"
|
321 |
msgstr ""
|
322 |
|
323 |
+
#: subscribe2.php:1820 subscribe2.php:1973 subscribe2.php:1982
|
324 |
msgid "Edit"
|
325 |
msgstr ""
|
326 |
|
327 |
+
#: subscribe2.php:1823 subscribe2.php:1976 subscribe2.php:1985
|
328 |
msgid "Update"
|
329 |
msgstr ""
|
330 |
|
331 |
+
#: subscribe2.php:1824 subscribe2.php:1977 subscribe2.php:1986
|
332 |
msgid "Revert"
|
333 |
msgstr ""
|
334 |
|
335 |
+
#: subscribe2.php:1826
|
336 |
msgid "Send Admins notifications for new"
|
337 |
msgstr ""
|
338 |
|
339 |
+
#: subscribe2.php:1836
|
340 |
msgid "Unsubscriptions"
|
341 |
msgstr ""
|
342 |
|
343 |
+
#: subscribe2.php:1841
|
344 |
msgid "Both"
|
345 |
msgstr ""
|
346 |
|
347 |
+
#: subscribe2.php:1846
|
348 |
msgid "Neither"
|
349 |
msgstr ""
|
350 |
|
351 |
+
#: subscribe2.php:1848
|
352 |
msgid "Include theme CSS stylesheet in HTML notifications"
|
353 |
msgstr ""
|
354 |
|
355 |
+
#: subscribe2.php:1853 subscribe2.php:1865 subscribe2.php:1876
|
356 |
+
#: subscribe2.php:1887 subscribe2.php:2034 subscribe2.php:2045
|
357 |
+
#: subscribe2.php:2072 subscribe2.php:2088 subscribe2.php:2218
|
358 |
+
#: subscribe2.php:2254
|
359 |
msgid "Yes"
|
360 |
msgstr ""
|
361 |
|
362 |
+
#: subscribe2.php:1858 subscribe2.php:1870 subscribe2.php:1881
|
363 |
+
#: subscribe2.php:1892 subscribe2.php:2028 subscribe2.php:2039
|
364 |
+
#: subscribe2.php:2050 subscribe2.php:2077 subscribe2.php:2093
|
365 |
+
#: subscribe2.php:2223 subscribe2.php:2258
|
366 |
msgid "No"
|
367 |
msgstr ""
|
368 |
|
369 |
+
#: subscribe2.php:1860
|
370 |
msgid "Send Emails for Pages"
|
371 |
msgstr ""
|
372 |
|
373 |
+
#: subscribe2.php:1871
|
374 |
msgid "Send Emails for Password Protected Posts"
|
375 |
msgstr ""
|
376 |
|
377 |
+
#: subscribe2.php:1882
|
378 |
msgid "Send Emails for Private Posts"
|
379 |
msgstr ""
|
380 |
|
381 |
+
#: subscribe2.php:1893
|
382 |
msgid "Send Email From"
|
383 |
msgstr ""
|
384 |
|
385 |
+
#: subscribe2.php:1898
|
386 |
msgid "Send Emails"
|
387 |
msgstr ""
|
388 |
|
389 |
+
#: subscribe2.php:1900
|
390 |
msgid "For digest notifications, date order for posts is"
|
391 |
msgstr ""
|
392 |
|
393 |
+
#: subscribe2.php:1905
|
394 |
msgid "Descending"
|
395 |
msgstr ""
|
396 |
|
397 |
+
#: subscribe2.php:1910
|
398 |
msgid "Ascending"
|
399 |
msgstr ""
|
400 |
|
401 |
+
#: subscribe2.php:1914
|
402 |
msgid "Email Templates"
|
403 |
msgstr ""
|
404 |
|
405 |
+
#: subscribe2.php:1918
|
406 |
msgid "New Post email (must not be empty)"
|
407 |
msgstr ""
|
408 |
|
409 |
+
#: subscribe2.php:1919 subscribe2.php:1944 subscribe2.php:1949
|
410 |
msgid "Subject Line"
|
411 |
msgstr ""
|
412 |
|
413 |
+
#: subscribe2.php:1924
|
414 |
msgid "Send Email Preview"
|
415 |
msgstr ""
|
416 |
|
417 |
+
#: subscribe2.php:1925
|
418 |
msgid "Message substitions"
|
419 |
msgstr ""
|
420 |
|
421 |
+
#: subscribe2.php:1929
|
422 |
msgid "the post's title<br />(<i>for per-post emails only</i>)"
|
423 |
msgstr ""
|
424 |
|
425 |
+
#: subscribe2.php:1930
|
426 |
msgid ""
|
427 |
"the excerpt or the entire post<br />(<i>based on the subscriber's "
|
428 |
"preferences</i>)"
|
429 |
msgstr ""
|
430 |
|
431 |
+
#: subscribe2.php:1931
|
432 |
msgid ""
|
433 |
"the excerpt of the post and the time it was posted<br />(<i>for digest "
|
434 |
"emails only</i>)"
|
435 |
msgstr ""
|
436 |
|
437 |
+
#: subscribe2.php:1932
|
438 |
msgid "a list of post titles<br />(<i>for digest emails only</i>)"
|
439 |
msgstr ""
|
440 |
|
441 |
+
#: subscribe2.php:1933
|
442 |
msgid "the post's permalink<br />(<i>for per-post emails only</i>)"
|
443 |
msgstr ""
|
444 |
|
445 |
+
#: subscribe2.php:1934
|
446 |
msgid ""
|
447 |
"the post's permalink after conversion by TinyURL<br />(<i>for per-post "
|
448 |
"emails only</i>)"
|
449 |
msgstr ""
|
450 |
|
451 |
+
#: subscribe2.php:1935
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
msgid "the admin or post author's name"
|
453 |
msgstr ""
|
454 |
|
455 |
+
#: subscribe2.php:1936
|
456 |
msgid "the admin or post author's email"
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: subscribe2.php:1937
|
460 |
msgid "the post author's name"
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: subscribe2.php:1938
|
464 |
msgid ""
|
465 |
"the generated link to confirm a request<br />(<i>only used in the "
|
466 |
"confirmation email template</i>)"
|
467 |
msgstr ""
|
468 |
|
469 |
+
#: subscribe2.php:1939
|
470 |
msgid ""
|
471 |
"Action performed by LINK in confirmation email<br />(<i>only used in the "
|
472 |
"confirmation email template</i>)"
|
473 |
msgstr ""
|
474 |
|
475 |
+
#: subscribe2.php:1940
|
476 |
msgid "the post's assigned categories"
|
477 |
msgstr ""
|
478 |
|
479 |
+
#: subscribe2.php:1941
|
480 |
msgid "the post's assigned Tags"
|
481 |
msgstr ""
|
482 |
|
483 |
+
#: subscribe2.php:1943
|
484 |
msgid "Subscribe / Unsubscribe confirmation email"
|
485 |
msgstr ""
|
486 |
|
487 |
+
#: subscribe2.php:1948
|
488 |
msgid "Reminder email to Unconfirmed Subscribers"
|
489 |
msgstr ""
|
490 |
|
491 |
+
#: subscribe2.php:1955
|
492 |
msgid "Excluded Categories"
|
493 |
msgstr ""
|
494 |
|
495 |
+
#: subscribe2.php:1957
|
496 |
msgid ""
|
497 |
"Posts assigned to any Excluded Category do not generate notifications and "
|
498 |
"are not included in digest notifications"
|
499 |
msgstr ""
|
500 |
|
501 |
+
#: subscribe2.php:1964
|
502 |
msgid "Allow registered users to subscribe to excluded categories?"
|
503 |
msgstr ""
|
504 |
|
505 |
+
#: subscribe2.php:1967
|
506 |
msgid "Appearance"
|
507 |
msgstr ""
|
508 |
|
509 |
+
#: subscribe2.php:1971
|
510 |
msgid "Set default Subscribe2 page as ID"
|
511 |
msgstr ""
|
512 |
|
513 |
+
#: subscribe2.php:1980
|
514 |
msgid "Set the number of Subscribers displayed per page"
|
515 |
msgstr ""
|
516 |
|
517 |
+
#: subscribe2.php:1993
|
518 |
msgid "Show a link to your subscription page in \"meta\"?"
|
519 |
msgstr ""
|
520 |
|
521 |
+
#: subscribe2.php:2000
|
522 |
msgid "Show the Subscribe2 button on the Write toolbar?"
|
523 |
msgstr ""
|
524 |
|
525 |
+
#: subscribe2.php:2007
|
526 |
msgid "Enable Subscribe2 Widget?"
|
527 |
msgstr ""
|
528 |
|
529 |
+
#: subscribe2.php:2011
|
530 |
msgid "Auto Subscribe"
|
531 |
msgstr ""
|
532 |
|
533 |
+
#: subscribe2.php:2013
|
534 |
msgid "Subscribe new users registering with your blog"
|
535 |
msgstr ""
|
536 |
|
537 |
+
#: subscribe2.php:2018
|
538 |
msgid "Automatically"
|
539 |
msgstr ""
|
540 |
|
541 |
+
#: subscribe2.php:2023
|
542 |
msgid "Display option on Registration Form"
|
543 |
msgstr ""
|
544 |
|
545 |
+
#: subscribe2.php:2029
|
546 |
msgid "Auto-subscribe includes any excluded categories"
|
547 |
msgstr ""
|
548 |
|
549 |
+
#: subscribe2.php:2040
|
550 |
msgid "Registration Form option is checked by default"
|
551 |
msgstr ""
|
552 |
|
553 |
+
#: subscribe2.php:2051
|
554 |
msgid "Auto-subscribe users to receive email as"
|
555 |
msgstr ""
|
556 |
|
557 |
+
#: subscribe2.php:2067
|
558 |
msgid "Registered Users have the option to auto-subscribe to new categories"
|
559 |
msgstr ""
|
560 |
|
561 |
+
#: subscribe2.php:2082
|
562 |
msgid "New categories are immediately excluded"
|
563 |
msgstr ""
|
564 |
|
565 |
+
#: subscribe2.php:2083
|
566 |
msgid ""
|
567 |
"Option for Registered Users to auto-subscribe to new categories is checked "
|
568 |
"by default"
|
569 |
msgstr ""
|
570 |
|
571 |
+
#: subscribe2.php:2097
|
572 |
msgid "Barred Domains"
|
573 |
msgstr ""
|
574 |
|
575 |
+
#: subscribe2.php:2099
|
576 |
msgid ""
|
577 |
"Enter domains to bar from public subscriptions: <br /> (Use a new line for "
|
578 |
"each entry and omit the \"@\" symbol, for example email.com)"
|
579 |
msgstr ""
|
580 |
|
581 |
+
#: subscribe2.php:2104
|
582 |
msgid "Submit"
|
583 |
msgstr ""
|
584 |
|
585 |
+
#: subscribe2.php:2107
|
586 |
msgid "Reset Default"
|
587 |
msgstr ""
|
588 |
|
589 |
+
#: subscribe2.php:2108
|
590 |
msgid ""
|
591 |
"Use this to reset all options to their defaults. This <strong><em>will not</"
|
592 |
"em></strong> modify your list of subscribers."
|
593 |
msgstr ""
|
594 |
|
595 |
+
#: subscribe2.php:2110
|
596 |
msgid "RESET"
|
597 |
msgstr ""
|
598 |
|
599 |
+
#: subscribe2.php:2136
|
600 |
msgid "Subscription preferences updated."
|
601 |
msgstr ""
|
602 |
|
603 |
+
#: subscribe2.php:2186
|
604 |
msgid "Editing Subscribe2 preferences for user"
|
605 |
msgstr ""
|
606 |
|
607 |
+
#: subscribe2.php:2195
|
608 |
msgid "Receive email as"
|
609 |
msgstr ""
|
610 |
|
611 |
+
#: subscribe2.php:2213
|
612 |
msgid "Automatically subscribe me to newly created categories"
|
613 |
msgstr ""
|
614 |
|
615 |
+
#: subscribe2.php:2234
|
616 |
msgid "Unsubscribe me from this blog"
|
617 |
msgstr ""
|
618 |
|
619 |
+
#: subscribe2.php:2238
|
620 |
msgid "Subscribe to all categories"
|
621 |
msgstr ""
|
622 |
|
623 |
+
#: subscribe2.php:2240
|
624 |
msgid "Subscribed Categories on"
|
625 |
msgstr ""
|
626 |
|
627 |
+
#: subscribe2.php:2242
|
628 |
msgid "Subscribed Categories"
|
629 |
msgstr ""
|
630 |
|
631 |
+
#: subscribe2.php:2248
|
632 |
msgid "Receive periodic summaries of new posts?"
|
633 |
msgstr ""
|
634 |
|
635 |
+
#: subscribe2.php:2263
|
636 |
msgid "Update Preferences"
|
637 |
msgstr ""
|
638 |
|
639 |
+
#: subscribe2.php:2312
|
640 |
msgid "Subscribed Blogs"
|
641 |
msgstr ""
|
642 |
|
643 |
+
#: subscribe2.php:2317 subscribe2.php:2338
|
644 |
msgid "Viewing Settings Now"
|
645 |
msgstr ""
|
646 |
|
647 |
+
#: subscribe2.php:2321 subscribe2.php:2342
|
648 |
msgid "View Settings"
|
649 |
msgstr ""
|
650 |
|
651 |
+
#: subscribe2.php:2333
|
652 |
msgid "Subscribe to new blogs"
|
653 |
msgstr ""
|
654 |
|
655 |
+
#: subscribe2.php:2406
|
656 |
msgid "Send an email to subscribers"
|
657 |
msgstr ""
|
658 |
|
659 |
+
#: subscribe2.php:2414
|
660 |
msgid "A message from"
|
661 |
msgstr ""
|
662 |
|
663 |
+
#: subscribe2.php:2416
|
664 |
msgid "Subject"
|
665 |
msgstr ""
|
666 |
|
667 |
+
#: subscribe2.php:2419
|
668 |
msgid "Recipients:"
|
669 |
msgstr ""
|
670 |
|
671 |
+
#: subscribe2.php:2423
|
672 |
msgid "Send"
|
673 |
msgstr ""
|
674 |
|
675 |
+
#: subscribe2.php:2494
|
676 |
msgid "All Users and Subscribers"
|
677 |
msgstr ""
|
678 |
|
679 |
+
#: subscribe2.php:2495
|
680 |
msgid "Public Subscribers"
|
681 |
msgstr ""
|
682 |
|
683 |
+
#: subscribe2.php:2496
|
684 |
msgid "Confirmed"
|
685 |
msgstr ""
|
686 |
|
687 |
+
#: subscribe2.php:2497
|
688 |
msgid "Unconfirmed"
|
689 |
msgstr ""
|
690 |
|
691 |
+
#: subscribe2.php:2498
|
692 |
msgid "All Registered Users"
|
693 |
msgstr ""
|
694 |
|
695 |
+
#: subscribe2.php:2499
|
696 |
msgid "Registered Subscribers"
|
697 |
msgstr ""
|
698 |
|
699 |
+
#: subscribe2.php:2610
|
700 |
msgid "For each Post"
|
701 |
msgstr ""
|
702 |
|
703 |
+
#: subscribe2.php:2627
|
704 |
msgid "Send Digest Notification at"
|
705 |
msgstr ""
|
706 |
|
707 |
+
#: subscribe2.php:2639
|
708 |
msgid ""
|
709 |
"This option will work for digest notification sent daily or less frequently"
|
710 |
msgstr ""
|
711 |
|
712 |
+
#: subscribe2.php:2642
|
713 |
msgid "Current UTC time is"
|
714 |
msgstr ""
|
715 |
|
716 |
+
#: subscribe2.php:2644
|
717 |
msgid "Current blog time is"
|
718 |
msgstr ""
|
719 |
|
720 |
+
#: subscribe2.php:2646
|
721 |
msgid "Next email notification will be sent when your blog time is after"
|
722 |
msgstr ""
|
723 |
|
724 |
+
#: subscribe2.php:2677
|
725 |
msgid "Settings"
|
726 |
msgstr ""
|
727 |
|
728 |
+
#: subscribe2.php:2678
|
729 |
+
msgid "Donate"
|
730 |
+
msgstr ""
|
731 |
+
|
732 |
+
#: subscribe2.php:2679
|
733 |
+
msgid "Forum"
|
734 |
+
msgstr ""
|
735 |
+
|
736 |
+
#: subscribe2.php:2690
|
737 |
msgid "Check here to Subscribe to email notifications for new posts"
|
738 |
msgstr ""
|
739 |
|
740 |
+
#: subscribe2.php:2699
|
741 |
msgid ""
|
742 |
"By registering with this blog you are also agreeing to receive email "
|
743 |
"notifications for new posts but you can unsubscribe at anytime"
|
744 |
msgstr ""
|
745 |
|
746 |
+
#: subscribe2.php:2720 subscribe2.php:2721 subscribe2.php:2749
|
747 |
msgid "Subscribe2 Notification Override"
|
748 |
msgstr ""
|
749 |
|
750 |
+
#: subscribe2.php:2735
|
751 |
msgid ""
|
752 |
"Check here to disable sending of an email notification for this post/page"
|
753 |
msgstr ""
|
754 |
|
755 |
+
#: subscribe2.php:2878
|
756 |
msgid "Subscription Confirmation"
|
757 |
msgstr ""
|
758 |
|
759 |
+
#: subscribe2.php:2930
|
760 |
msgid "Title"
|
761 |
msgstr ""
|
762 |
|
763 |
+
#: subscribe2.php:2932
|
764 |
msgid "Div class name"
|
765 |
msgstr ""
|
766 |
|
767 |
+
#: subscribe2.php:2934
|
768 |
msgid "Pre-Content"
|
769 |
msgstr ""
|
770 |
|
771 |
+
#: subscribe2.php:2936
|
772 |
msgid "Post-Content"
|
773 |
msgstr ""
|
774 |
|
775 |
+
#: subscribe2.php:2986
|
776 |
msgid "[Un]Subscribe to Posts"
|
777 |
msgstr ""
|
778 |
|
779 |
+
#: subscribe2.php:3064
|
780 |
msgid "Weekly"
|
781 |
msgstr ""
|
782 |
|
783 |
+
#: subscribe2.php:3149
|
784 |
msgid "Posted on"
|
785 |
msgstr ""
|
786 |
|
787 |
+
#: subscribe2.php:3153 subscribe2.php:3154
|
788 |
+
msgid "Posted in"
|
789 |
+
msgstr ""
|
790 |
+
|
791 |
+
#: subscribe2.php:3159 subscribe2.php:3160
|
792 |
+
msgid "Tagged as"
|
793 |
+
msgstr ""
|
794 |
+
|
795 |
+
#: subscribe2.php:3211
|
796 |
msgid "Digest Email"
|
797 |
msgstr ""
|
798 |
|