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