Subscribe2 - Version 4.0

Version Description

Download this release

Release Info

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

Code changes from version 3.7 to 4.0

ReadMe.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: MattyRob, Skippy, Ravan
3
  Donate link: http://subscribe2.wordpress.com/donate/
4
  Tags: posts, subscription, email
5
  Requires at least: 2.0.x
6
- Tested up to: 2.2
7
- Stable tag: 3.7
8
 
9
  Sends a list of subscribers an email notification when new posts are published to your blog
10
 
@@ -44,9 +44,9 @@ This token will automatically be replaced by the subscription form, and will dis
44
  = Which version should I be using, I'm on WordPress x.x.x? =
45
  WordPress 2.0.x will be supported until 2010. Subscribe2 will remain supported (but not actively developed) until WordPress 2.0.x is no longer supported. For WordPress 2.0.x use the Subscribe code from the 2.x stable.
46
 
47
- WordPress 2.1.x and 2.2.x are also supported. For the latest information visit http://subscribe2.wordpress.com. For versions of WordPress use Subscribe2 code from the 3.x stable.
48
 
49
- Finally, there is a development version for WordPress 2.3 but as WordPress 2.3 is not recommended for active websites you should only get this code from the branch if you are testing it.
50
 
51
  = How do I upgrade from a previous version? =
52
  If you are upgrading from any 2.1.x version of subscribe2, please delete both the /subscribe.php and /wp-content/plugins/subscribe2.php files before copying the new files into place. Your subscriber list will remain intact, and your options should be preserved. Now create a WordPress Page as described above.
@@ -78,6 +78,19 @@ Batches will occur for each group of message as described above. A site on Drea
78
 
79
  == Version History ==
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  Version 3.7 by Matthew Robinson
82
 
83
  * Change from deprecated get_settings -> get_option
@@ -134,6 +147,12 @@ Version 3.0 by Matthew Robinson
134
 
135
  * Updated for WordPress 2.1 Branch
136
 
 
 
 
 
 
 
137
  Version 2.21 by Matthew Robinson
138
 
139
  * Change from deprecated get_settings -> get_option
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.3
7
+ Stable tag: 4.0
8
 
9
  Sends a list of subscribers an email notification when new posts are published to your blog
10
 
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 supported. For the latest information visit http://subscribe2.wordpress.com. For these versions of WordPress use Subscribe2 code from the 3.x stable.
48
 
49
+ Finally, WordPress 2.3 is supported. Again, for the latest information visit http://subscribe2.wordpress.com. For this versions of WordPress use Subscribe2 code from the 4.x stable.
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.
78
 
79
  == Version History ==
80
 
81
+ Version 4.0 by Matthew Robinson
82
+
83
+ * Compatible with WordPress 2.3
84
+ * Widget Code now integrated into the main plugin and added as an option
85
+ * More Options for Email Notifications
86
+ * Category Lists fixed for WordPress 2.3 and now show empty categories
87
+
88
+ Version 3.8 by Matthew Robinson
89
+
90
+ * Fixed User Menu Settings when Digests enabled
91
+ * Changed Registered Subscribers to Registered Users in drop down to avoid confusion
92
+ * Minor code revisions for admin menu layout
93
+
94
  Version 3.7 by Matthew Robinson
95
 
96
  * Change from deprecated get_settings -> get_option
147
 
148
  * Updated for WordPress 2.1 Branch
149
 
150
+ Version 2.22 by Matthew Robinson
151
+
152
+ * Fixed User Menu Settings when Digests enabled
153
+ * Changed Registered Subscribers to Registered Users in drop down to avoid confusion
154
+ * Minor code revisions for admin menu layout
155
+
156
  Version 2.21 by Matthew Robinson
157
 
158
  * Change from deprecated get_settings -> get_option
subscribe2/subscribe2.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  Plugin Name: Subscribe2
4
  Plugin URI: http://subscribe2.wordpress.com
5
- Description: Notifies an email list when new entries are posted. Tested with WordPress 2.1.x and 2.2.x.
6
- Version: 3.7
7
  Author: Matthew Robinson
8
  Author URI: http://subscribe2.wordpress.com
9
  */
@@ -41,7 +41,7 @@ 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', '3.7');
45
  define ('S2PATH', trailingslashit(dirname(__FILE__)));
46
 
47
  // use Owen's excellent ButtonSnap library
@@ -146,7 +146,7 @@ class s2class {
146
  function install() {
147
  // include upgrade-functions for maybe_create_table;
148
  if (!function_exists('maybe_create_table')) {
149
- require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
150
  }
151
  $date = date('Y-m-d');
152
  $sql = "CREATE TABLE $this->public (
@@ -169,7 +169,7 @@ class s2class {
169
 
170
  // include upgrade-functions for maybe_create_table;
171
  if (!function_exists('maybe_create_table')) {
172
- require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
173
  }
174
  $date = date('Y-m-d');
175
  maybe_add_column($this->public, 'date', "ALTER TABLE `$this->public` ADD `date` DATE DEFAULT '$date' NOT NULL AFTER `active`;");
@@ -217,13 +217,13 @@ class s2class {
217
  if ('' == $string) {
218
  return;
219
  }
220
- $string = str_replace('BLOGNAME', get_option('blogname'), $string);
221
- $string = str_replace('BLOGLINK', get_bloginfo('url'), $string);
222
- $string = str_replace('TITLE', stripslashes($this->post_title), $string);
223
- $string = str_replace('PERMALINK', $this->permalink, $string);
224
- $string = str_replace('MYNAME', stripslashes($this->myname), $string);
225
- $string = str_replace('EMAIL', $this->myemail, $string);
226
- $string = str_replace('AUTHORNAME', $this->authorname, $string);
227
  return $string;
228
  } // end substitute()
229
 
@@ -260,8 +260,7 @@ class s2class {
260
 
261
  // BCC all recipients
262
  $bcc = '';
263
- if ( (defined('BCCLIMIT') && (BCCLIMIT > 0) ) &&
264
- (count($recipients) > BCCLIMIT) ) {
265
  // we're on Dreamhost, and have more than 30 susbcribers
266
  $count = 1;
267
  $batch = array();
@@ -326,21 +325,21 @@ class s2class {
326
  /**
327
  Sends an email notification of a new post
328
  */
329
- function publish($id = 0) {
330
- if (!$id) { return $id; }
331
 
332
  // are we doing daily digests? If so, don't send anything now
333
- if ($this->subscribe2_options['email_freq'] != 'never') { return $id; }
334
 
335
  // we need to determine whether this is a new post, or an edit
336
  if ($this->private) {
337
  // this post was published from draft status
338
  // OR is an edit of an existing post
339
  // so send no notification
340
- return $id;
341
  }
342
 
343
- $post_cats = wp_get_post_cats('1', $id);
344
  $post_cats_string = implode(',', $post_cats);
345
  $check = false;
346
  // is the current post assigned to any categories
@@ -356,19 +355,14 @@ class s2class {
356
  // excluded categories?
357
  if ('0' == $this->subscribe2_options['reg_override']) {
358
  // nope? okay, let's leave
359
- return $id;
360
  }
361
  }
362
 
363
- global $wpdb;
364
- $post =& get_post($id);
365
- // is the post password protected?
366
- if ( ($this->subscribe2_options['password'] == "no") && ($post->post_password != '') ) {return $id; }
367
-
368
  // is this post set in the future?
369
  if ($post->post_date > current_time('mysql')) {
370
  // bail out
371
- return $id;
372
  }
373
 
374
  // lets collect our public subscribers
@@ -384,12 +378,12 @@ class s2class {
384
  // do we have subscribers?
385
  if ( (empty($public)) && (empty($registered)) ) {
386
  // if not, no sense doing anything else
387
- return $id;
388
  }
389
  // we set these class variables so that we can avoid
390
  // passing them in function calls a little later
391
  $this->post_title = $post->post_title;
392
- $this->permalink = "<a href=\"" . get_permalink($id) . "\">" . get_permalink($id) . "</a>";
393
 
394
  $author = get_userdata($post->post_author);
395
  $this->authorname = $author->display_name;
@@ -411,7 +405,7 @@ class s2class {
411
 
412
  $plaintext = $post->post_content;
413
  $content = apply_filters('the_content', $post->post_content);
414
- $content = str_replace(']]>', ']]&gt', $content);
415
  $excerpt = $post->post_excerpt;
416
  if ('' == $excerpt) {
417
  // no excerpt, is there a <!--more--> ?
@@ -434,7 +428,7 @@ class s2class {
434
  }
435
 
436
  // first we send plaintext summary emails
437
- $body = str_replace('POST', $excerpt, $mailtext);
438
  $registered = $this->get_registered("cats=$post_cats_string&format=text&amount=excerpt");
439
  if (empty($registered)) {
440
  $recipients = (array)$public;
@@ -446,37 +440,16 @@ class s2class {
446
  }
447
  $this->mail($recipients, $subject, $body);
448
  // next we send plaintext full content emails
449
- $body = str_replace('POST', strip_tags($plaintext), $mailtext);
450
  $this->mail($this->get_registered("cats=$post_cats_string&format=text&amount=post"), $subject, $body);
451
  // finally we send html full content emails
452
  $body = str_replace("\r\n", "<br />\r\n", $mailtext);
453
- $body = str_replace('POST', $content, $body);
454
  $this->mail($this->get_registered("cats=$post_cats_string&format=html"), $subject, $body, 'html');
455
 
456
  return $id;
457
  } // end publish()
458
 
459
- /**
460
- Sends a notification when a draft post is published
461
- */
462
- function private2publish($id = 0) {
463
- if (0 == $id) { return $id; }
464
-
465
- $this->publish($id);
466
- $this->private = TRUE;
467
- return $id;
468
- } // end private2publish()
469
-
470
- /**
471
- Prevents notifications from being sent when editing posts
472
- */
473
- function edit($id = 0) {
474
- if (0 == $id) { return; }
475
-
476
- $this->private = TRUE;
477
- return $id;
478
- }
479
-
480
  /**
481
  Send confirmation email to the user
482
  */
@@ -494,7 +467,8 @@ class s2class {
494
  // ACTION = 1 to subscribe, 0 to unsubscribe
495
  // HASH = md5 hash of email address
496
  // ID = user's ID in the subscribe2 table
497
- $link = get_option('siteurl') . "/?s2=";
 
498
 
499
  if ('add' == $what) {
500
  $link .= '1';
@@ -865,14 +839,14 @@ class s2class {
865
 
866
  if (0 == $user_id) { return $user_id; }
867
  $user = get_userdata($user_id);
868
- $all_cats = get_categories('type=post&hide_empty=1&hierarchical=0');
869
 
870
  if (0 == $this->subscribe2_options['reg_override']) {
871
  // registered users are not allowed to subscribe to
872
  // excluded categories
873
  $exclude = explode(',', $this->subscribe2_options['exclude']);
874
- foreach ($all_cats as $cat => $cat_ID) {
875
- if (in_array($all_cats[$cat]->cat_ID, $exclude)) {
876
  $cat = (int)$cat;
877
  unset($all_cats[$cat]);
878
  }
@@ -880,7 +854,7 @@ class s2class {
880
  }
881
 
882
  foreach ($all_cats as $cat) {
883
- ('' == $cats) ? $cats = "$cat->cat_ID" : $cats .= ",$cat->cat_ID";
884
  }
885
 
886
  if ('' == $cats) {
@@ -1134,10 +1108,10 @@ class s2class {
1134
  if (function_exists('wp_nonce_field')) {
1135
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1136
  }
1137
- echo "<p style=\"align:left\">" . __('Enter addresses, one per line or comma-seperated', 'subscribe2') . "<br />\r\n";
1138
- echo "<input type=\"hidden\" name=\"s2_admin\" value=\"subscribe\" />";
1139
- echo "<textarea rows=\"2\" cols=\"80\" name=\"addresses\"></textarea>";
1140
- echo "<br /><span class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Subscribe', 'subscribe2') . "\"/></span>";
1141
  echo "</form></div>";
1142
 
1143
  // subscriber lists
@@ -1147,7 +1121,7 @@ class s2class {
1147
  // show the selected subscribers
1148
  $alternate = 'alternate';
1149
  if (!empty($subscribers)) {
1150
- echo "<p align=\"center\"><b>" . __('Registered on the left, confirmed in the middle, unconfirmed on the right', 'subscribe2') . "</b></p>";
1151
  if (is_writable(ABSPATH . 'wp-content')) {
1152
  $exportcsv = implode(",", $subscribers);
1153
  echo "<form method=\"post\" action=\"\">\r\n";
@@ -1156,7 +1130,7 @@ class s2class {
1156
  }
1157
  echo "<input type=\"hidden\" name=\"exportcsv\" value=\"$exportcsv\" />\r\n";
1158
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"exportcsv\" />\r\n";
1159
- echo "<p align=\"right\"><span class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Save Emails to CSV File','subscribe2') . "\" /></span>\r\n";
1160
  echo "</form>\r\n";
1161
  }
1162
  }
@@ -1168,9 +1142,9 @@ class s2class {
1168
  if (in_array($subscriber, $unconfirmed)) {
1169
  echo " align=\"right\">";
1170
  } elseif (in_array($subscriber, $confirmed)) {
1171
- echo "align=\"center\">";
1172
  } else {
1173
- echo "align=\"left\" colspan=\"3\">";
1174
  }
1175
  echo "<a href=\"mailto:$subscriber\">$subscriber</a>\r\n";
1176
  if (in_array($subscriber, $unconfirmed) || in_array($subscriber, $confirmed) ) {
@@ -1217,7 +1191,7 @@ class s2class {
1217
  }
1218
  echo "<input type=\"hidden\" name=\"reminderemails\" value=\"$reminderemails\" />\r\n";
1219
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"remind\" />\r\n";
1220
- echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Send Reminder Email','subscribe2') . "\" />\r\n";
1221
  echo "</form>";
1222
  }
1223
  echo "</div>\r\n";
@@ -1236,7 +1210,7 @@ class s2class {
1236
  echo "<input type=\"radio\" name=\"manage\" value=\"unsubscribe\" />" . __('Unsubscribe', 'subscribe2') . "<br /><br />\r\n";
1237
  echo "<input type=\"hidden\" name=\"emails\" value=\"$emails\" /><input type=\"hidden\" name=\"s2_admin\" value=\"register\" />\r\n";
1238
  $this->display_category_form();
1239
- echo "<p align=\"right\"><span class=\"submit\"><input type=\"submit\" id=\"deletepost\" name=\"submit\" value=\"" . __('Submit', 'subscribe2') . "\" /></span></form>";
1240
 
1241
  echo "</div>\r\n";
1242
  echo "<div style=\"clear: both;\"><p>&nbsp;</p></div>";
@@ -1274,6 +1248,10 @@ class s2class {
1274
  ($_POST['show_button'] == '1') ? $showbutton = '1' : $showbutton = '0';
1275
  $this->subscribe2_options['show_button'] = $showbutton;
1276
 
 
 
 
 
1277
  // send as author or admin?
1278
  $sender = 'author';
1279
  if ('admin' == $_POST['sender']) {
@@ -1289,7 +1267,12 @@ class s2class {
1289
 
1290
  // send per-post or digest emails
1291
  $email_freq = $_POST['email_freq'];
 
 
 
 
1292
  $this->subscribe2_options['email_freq'] = $email_freq;
 
1293
  wp_clear_scheduled_hook('s2_digest_cron');
1294
  $scheds = (array) wp_get_schedules();
1295
  $interval = ( isset($scheds[$email_freq]['interval']) ) ? (int) $scheds[$email_freq]['interval'] : 0;
@@ -1299,8 +1282,20 @@ class s2class {
1299
  } else {
1300
  if (!wp_next_scheduled('s2_digest_cron')) {
1301
  // if we are using digest schedule the event and prime last_cron as now
1302
- wp_schedule_event(time() + $interval, $email_freq, 's2_digest_cron');
1303
- $now = date('Y-m-d H:i:s', time());
 
 
 
 
 
 
 
 
 
 
 
 
1304
  $this->subscribe2_options['last_s2cron'] = $now;
1305
  }
1306
  }
@@ -1361,18 +1356,17 @@ class s2class {
1361
  echo __('Send Email From', 'subscribe2') . ': ';
1362
  echo "<input type=\"radio\" name=\"sender\" value=\"author\"";
1363
  if ('author' == $this->subscribe2_options['sender']) {
1364
- echo "checked=\"checked\" ";
1365
  }
1366
  echo " /> " . __('Author of the post', 'subscribe2') . " &nbsp;&nbsp;";
1367
  echo "<input type=\"radio\" name=\"sender\" value=\"admin\"";
1368
  if ('admin' == $this->subscribe2_options['sender']) {
1369
- echo "checked=\"checked\" ";
1370
  }
1371
  echo " /> " . __('Blog Admin', 'subscribe2') . "<br /><br />\r\n";
1372
  if (function_exists('wp_schedule_event')) {
1373
  echo __('Send Email as Digest', 'subscribe2') . ": <br /><br />\r\n";
1374
  $this->display_digest_choices();
1375
- echo "<br />\r\n";
1376
  }
1377
  echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
1378
  echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"1\" class=\"editform\">\r\n";
@@ -1420,6 +1414,13 @@ class s2class {
1420
  }
1421
  echo " /> " . __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "<br /><br />\r\n";
1422
 
 
 
 
 
 
 
 
1423
  //Auto Subscription for new registrations
1424
  echo "<h2>" . __('Auto Subscribe', 'subscribe2') . "</h2>\r\n";
1425
  echo __('Subscribe new users registering with your blog', 'subscribe2') . ":<br />\r\n";
@@ -1519,7 +1520,7 @@ class s2class {
1519
  update_usermeta($user_ID, 's2_autosub', $_POST['new_category']);
1520
 
1521
  $cats = $_POST['category'];
1522
- if (empty($cats)) {
1523
  $cats = explode(',', get_usermeta($user_ID, 's2_subscribed'));
1524
  if ($cats) {
1525
  foreach ($cats as $cat) {
@@ -1527,6 +1528,13 @@ class s2class {
1527
  }
1528
  }
1529
  update_usermeta($user_ID, 's2_subscribed', '-1');
 
 
 
 
 
 
 
1530
  } else {
1531
  if (!is_array($cats)) {
1532
  $cats = array($_POST['category']);
@@ -1537,13 +1545,13 @@ class s2class {
1537
  if (!empty($remove)) {
1538
  // remove subscription to these cat IDs
1539
  foreach ($remove as $id) {
1540
- delete_usermeta($user_ID, "s2_cat" .$id);
1541
  }
1542
  }
1543
  if (!empty($new)) {
1544
  // add subscription to these cat IDs
1545
  foreach ($new as $id) {
1546
- update_usermeta($user_ID, 's2_cat' . $id, "$id");
1547
  }
1548
  }
1549
  update_usermeta($user_ID, 's2_subscribed', implode(',', $cats));
@@ -1584,12 +1592,12 @@ class s2class {
1584
  echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': &nbsp;&nbsp;';
1585
  echo "<input type=\"radio\" name=\"new_category\" value=\"yes\" ";
1586
  if ('yes' == get_usermeta($user_ID, 's2_autosub')) {
1587
- echo "checked=\"yes\" ";
1588
  }
1589
  echo "/> Yes &nbsp;&nbsp;";
1590
  echo "<input type=\"radio\" name=\"new_category\" value=\"no\" ";
1591
  if ('no' == get_usermeta($user_ID, 's2_autosub')) {
1592
- echo "checked=\"yes\" ";
1593
  }
1594
  echo "/> No<br /><br />";
1595
 
@@ -1600,19 +1608,19 @@ class s2class {
1600
  // we're doing daily digests, so just show
1601
  // subscribe / unnsubscribe
1602
  echo __('Receive daily summary of new posts?', 'subscribe2') . ': &nbsp;&nbsp;';
1603
- echo "<input type=\"radio\" name=\"category\" value=\"1\" ";
1604
- if (get_usermeta($user_ID, 's2_subscribed')) {
1605
  echo "checked=\"yes\" ";
1606
  }
1607
- echo "/> Yes <input type=\"radio\" name=\"category\" value=\"\" ";
1608
- if (! get_usermeta($user_ID, 's2_subscribed')) {
1609
  echo "checked=\"yes\" ";
1610
  }
1611
  echo "/> No";
1612
  }
1613
 
1614
  // submit
1615
- echo "<p align=\"right\"><span class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __("Update Preferences &raquo;", 'subscribe2') . "\" /></span></p>";
1616
  echo "</form></div>\r\n";
1617
 
1618
  include(ABSPATH . 'wp-admin/admin-footer.php');
@@ -1685,14 +1693,14 @@ class s2class {
1685
  function display_category_form($selected = array(), $override = 1) {
1686
  global $wpdb;
1687
 
1688
- $all_cats = get_categories('type=post&hide_empty=1&hierarchical=0');
1689
  $exclude = explode(',', $this->subscribe2_options['exclude']);
1690
 
1691
  if (0 == $override) {
1692
  // registered users are not allowed to subscribe to
1693
  // excluded categories
1694
- foreach ($all_cats as $cat => $cat_ID) {
1695
- if (in_array($all_cats[$cat]->cat_ID, $exclude)) {
1696
  $cat = (int)$cat;
1697
  unset($all_cats[$cat]);
1698
  }
@@ -1710,23 +1718,23 @@ class s2class {
1710
  $j++;
1711
  }
1712
  if (0 == $j) {
1713
- echo "<input type=\"checkbox\" name=\"category[]\" value=\"" . $cat->cat_ID . "\"";
1714
- if (in_array($cat->cat_ID, $selected)) {
1715
  echo " checked=\"checked\" ";
1716
  }
1717
- echo " /> " . $cat->cat_name . "<br />\r\n";
1718
  } else {
1719
 
1720
- echo "<input type=\"checkbox\" name=\"category[]\" value=\"" . $cat->cat_ID . "\"";
1721
- if (in_array($cat->cat_ID, $selected)) {
1722
  echo " checked=\"checked\" ";
1723
  }
1724
- echo " /> " . $cat->cat_name . "<br />\r\n";
1725
  }
1726
  $i++;
1727
  }
1728
  echo "</td></tr>\r\n";
1729
- echo "<tr><td align=\"left\">\r\n";
1730
  echo "<input type=\"checkbox\" name=\"checkall\" onclick=\"setAll(this)\" /> " . __('Select / Unselect All' ,'subscribe2') . "\r\n";
1731
  echo "</td></tr>\r\n";
1732
  echo "</table>\r\n";
@@ -1744,9 +1752,9 @@ class s2class {
1744
  'public' => __('Public Subscribers', 'subscribe2'),
1745
  'confirmed' => ' &nbsp;&nbsp;' . __('Confirmed', 'subscribe2'),
1746
  'unconfirmed' => ' &nbsp;&nbsp;' . __('Unconfirmed', 'subscribe2'),
1747
- 'registered' => __('Registered Subscribers', 'subscribe2'));
1748
 
1749
- $all_cats = get_categories('type=post&hide_empty=1&hierarchical=0');
1750
 
1751
  // count the number of subscribers
1752
  $count['confirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='1'");
@@ -1761,7 +1769,7 @@ class s2class {
1761
  $count['registered'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='s2_subscribed'");
1762
  $count['all'] = ($count['confirmed'] + $count['unconfirmed'] + $count['registered']);
1763
  foreach ($all_cats as $cat) {
1764
- $count[$cat->cat_name] = $wpdb->get_var("SELECT COUNT(meta_value) FROM $wpdb->usermeta WHERE meta_key='s2_cat$cat->cat_ID'");
1765
  }
1766
 
1767
  // do have actually have some subscribers?
@@ -1785,10 +1793,10 @@ class s2class {
1785
 
1786
  if ($count['registered'] > 0) {
1787
  foreach ($all_cats as $cat) {
1788
- if (in_array($cat->cat_ID, $exclude)) { continue; }
1789
- echo "<option value=\"" . $cat->cat_ID . "\"";
1790
- if ($cat->cat_ID == $selected) { echo " selected=\"selected\" "; }
1791
- echo "> &nbsp;&nbsp;" . $cat->cat_name . "&nbsp;(" . $count[$cat->cat_name] . ") </option>\r\n";
1792
  }
1793
  }
1794
  echo "</select>";
@@ -1816,12 +1824,15 @@ class s2class {
1816
  echo " /> " . $value['display'] . "<br />\r\n";
1817
  }
1818
  if (wp_next_scheduled('s2_digest_cron')) {
 
1819
  $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
1820
  $now = time();
1821
  echo "<p>" . __('Current server time is', 'subscribe2') . ": \r\n";
1822
  echo "<strong>" . gmdate($datetime, $now+ (get_option('gmt_offset') * 3600)) . "</strong></p>\r\n";
1823
  echo "<p>" . __('Next email notification will be sent', 'subscribe2') . ": \r\n";
1824
  echo "<strong>" . gmdate($datetime, wp_next_scheduled('s2_digest_cron') + (get_option('gmt_offset') * 3600)) . "</strong></p>\r\n";
 
 
1825
  }
1826
  } // end display_digest_choices()
1827
 
@@ -1925,7 +1936,8 @@ class s2class {
1925
  }
1926
  }
1927
  }
1928
- return preg_replace('|(<p>)(\n)*<!--subscribe2-->(\n)*(</p>)|', $this->s2form, $content);
 
1929
  } // end filter()
1930
 
1931
  /**
@@ -1960,6 +1972,55 @@ class s2class {
1960
  return __('Subscription Confirmation', 'subscribe2');
1961
  } // end title_filter()
1962
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1963
  /* ===== wp-cron functions ===== */
1964
  /**
1965
  Send a daily digest of today's new posts
@@ -1981,7 +2042,7 @@ class s2class {
1981
 
1982
  // if we have posts, let's prepare the digest
1983
  foreach ($posts as $post) {
1984
- $post_cats = wp_get_post_cats('1', $post->ID);
1985
  $post_cats_string = implode(',', $post_cats);
1986
  $check = false;
1987
  // is the current post assigned to any categories
@@ -1991,6 +2052,11 @@ class s2class {
1991
  $check = true;
1992
  }
1993
  }
 
 
 
 
 
1994
  // if this post is in an excluded category,
1995
  // don't include it in the digest
1996
  if ($check) {
@@ -2041,8 +2107,8 @@ class s2class {
2041
  $registered = $this->get_registered();
2042
  $recipients = array_merge((array)$public, (array)$registered);
2043
  $mailtext = $this->substitute(stripslashes($this->subscribe2_options['mailtext']));
2044
- $body = str_replace('TABLE', $table, $mailtext);
2045
- $body = str_replace('POST', $message, $mailtext);
2046
  $this->mail($recipients, $subject, $body);
2047
  } // end subscribe2_cron
2048
 
@@ -2056,9 +2122,13 @@ class s2class {
2056
  $this->subscribe2_options = get_option('subscribe2_options');
2057
 
2058
  add_action('init', array(&$this, 'subscribe2'));
2059
- if('1' == $this->subscribe2_options['show_button']) {
2060
  add_action('init', array(&$this, 'button_init'));
2061
  }
 
 
 
 
2062
  }
2063
 
2064
  function subscribe2() {
@@ -2086,7 +2156,7 @@ class s2class {
2086
  add_action('admin_menu', array(&$this, 'admin_menu'));
2087
  add_action('create_category', array(&$this, 'autosub_new_category'));
2088
  add_action('register_form', array(&$this, 'register_form'));
2089
- add_filter('the_content', array(&$this, 'filter'));
2090
  add_filter('cron_schedules', array(&$this, 'add_weekly_sched'));
2091
 
2092
  // add action to display editor buttons if option is enabled
@@ -2106,9 +2176,15 @@ class s2class {
2106
  if ($this->subscribe2_options['email_freq'] != 'never') {
2107
  add_action('s2_digest_cron', array(&$this, 'subscribe2_cron'));
2108
  } else {
2109
- add_action('publish_post', array(&$this, 'publish'));
2110
- add_action('edit_post', array(&$this, 'edit'));
2111
- add_action('private_to_published', array(&$this, 'private2publish'));
 
 
 
 
 
 
2112
  }
2113
 
2114
  // add action to email notification about pages if option is enabled
@@ -2119,7 +2195,7 @@ class s2class {
2119
  // load our strings
2120
  $this->load_strings();
2121
  } // end subscribe2()
2122
-
2123
  /* ===== ButtonSnap configuration ===== */
2124
  /**
2125
  Register our button in the QuickTags bar
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.0
7
  Author: Matthew Robinson
8
  Author URI: http://subscribe2.wordpress.com
9
  */
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.0');
45
  define ('S2PATH', trailingslashit(dirname(__FILE__)));
46
 
47
  // use Owen's excellent ButtonSnap library
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 (
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`;");
217
  if ('' == $string) {
218
  return;
219
  }
220
+ $string = str_replace("BLOGNAME", get_option('blogname'), $string);
221
+ $string = str_replace("BLOGLINK", get_bloginfo('url'), $string);
222
+ $string = str_replace("TITLE", stripslashes($this->post_title), $string);
223
+ $string = str_replace("PERMALINK", $this->permalink, $string);
224
+ $string = str_replace("MYNAME", stripslashes($this->myname), $string);
225
+ $string = str_replace("EMAIL", $this->myemail, $string);
226
+ $string = str_replace("AUTHORNAME", $this->authorname, $string);
227
  return $string;
228
  } // end substitute()
229
 
260
 
261
  // BCC all recipients
262
  $bcc = '';
263
+ if ( (defined('BCCLIMIT')) && (BCCLIMIT > 0) && (count($recipients) > BCCLIMIT) ) {
 
264
  // we're on Dreamhost, and have more than 30 susbcribers
265
  $count = 1;
266
  $batch = array();
325
  /**
326
  Sends an email notification of a new post
327
  */
328
+ function publish($post = 0) {
329
+ if (!$post) { return $post; }
330
 
331
  // are we doing daily digests? If so, don't send anything now
332
+ if ($this->subscribe2_options['email_freq'] != 'never') { return $post; }
333
 
334
  // we need to determine whether this is a new post, or an edit
335
  if ($this->private) {
336
  // this post was published from draft status
337
  // OR is an edit of an existing post
338
  // so send no notification
339
+ return $post;
340
  }
341
 
342
+ $post_cats = wp_get_post_categories($post->ID);
343
  $post_cats_string = implode(',', $post_cats);
344
  $check = false;
345
  // is the current post assigned to any categories
355
  // excluded categories?
356
  if ('0' == $this->subscribe2_options['reg_override']) {
357
  // nope? okay, let's leave
358
+ return $post;
359
  }
360
  }
361
 
 
 
 
 
 
362
  // is this post set in the future?
363
  if ($post->post_date > current_time('mysql')) {
364
  // bail out
365
+ return $post;
366
  }
367
 
368
  // lets collect our public subscribers
378
  // do we have subscribers?
379
  if ( (empty($public)) && (empty($registered)) ) {
380
  // if not, no sense doing anything else
381
+ return $post;
382
  }
383
  // we set these class variables so that we can avoid
384
  // passing them in function calls a little later
385
  $this->post_title = $post->post_title;
386
+ $this->permalink = "<a href=\"" . get_permalink($post->ID) . "\">" . get_permalink($post->ID) . "</a>";
387
 
388
  $author = get_userdata($post->post_author);
389
  $this->authorname = $author->display_name;
405
 
406
  $plaintext = $post->post_content;
407
  $content = apply_filters('the_content', $post->post_content);
408
+ $content = str_replace("]]>", "]]&gt", $content);
409
  $excerpt = $post->post_excerpt;
410
  if ('' == $excerpt) {
411
  // no excerpt, is there a <!--more--> ?
428
  }
429
 
430
  // first we send plaintext summary emails
431
+ $body = str_replace("POST", $excerpt, $mailtext);
432
  $registered = $this->get_registered("cats=$post_cats_string&format=text&amount=excerpt");
433
  if (empty($registered)) {
434
  $recipients = (array)$public;
440
  }
441
  $this->mail($recipients, $subject, $body);
442
  // next we send plaintext full content emails
443
+ $body = str_replace("POST", strip_tags($plaintext), $mailtext);
444
  $this->mail($this->get_registered("cats=$post_cats_string&format=text&amount=post"), $subject, $body);
445
  // finally we send html full content emails
446
  $body = str_replace("\r\n", "<br />\r\n", $mailtext);
447
+ $body = str_replace("POST", $content, $body);
448
  $this->mail($this->get_registered("cats=$post_cats_string&format=html"), $subject, $body, 'html');
449
 
450
  return $id;
451
  } // end publish()
452
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  /**
454
  Send confirmation email to the user
455
  */
467
  // ACTION = 1 to subscribe, 0 to unsubscribe
468
  // HASH = md5 hash of email address
469
  // ID = user's ID in the subscribe2 table
470
+ //use home instead of siteurl incase index.php is not in core wordpress directory
471
+ $link = get_option('home') . "/?s2=";
472
 
473
  if ('add' == $what) {
474
  $link .= '1';
839
 
840
  if (0 == $user_id) { return $user_id; }
841
  $user = get_userdata($user_id);
842
+ $all_cats = get_categories(array('hide_empty' => false));
843
 
844
  if (0 == $this->subscribe2_options['reg_override']) {
845
  // registered users are not allowed to subscribe to
846
  // excluded categories
847
  $exclude = explode(',', $this->subscribe2_options['exclude']);
848
+ foreach ($all_cats as $cat => $term_id) {
849
+ if (in_array($all_cats[$cat]->term_id, $exclude)) {
850
  $cat = (int)$cat;
851
  unset($all_cats[$cat]);
852
  }
854
  }
855
 
856
  foreach ($all_cats as $cat) {
857
+ ('' == $cats) ? $cats = "$cat->term_id" : $cats .= ",$cat->term_id";
858
  }
859
 
860
  if ('' == $cats) {
1108
  if (function_exists('wp_nonce_field')) {
1109
  wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
1110
  }
1111
+ echo __('Enter addresses, one per line or comma-seperated', 'subscribe2') . "<br />\r\n";
1112
+ echo "<textarea rows=\"2\" cols=\"80\" name=\"addresses\"></textarea><br />\r\n";
1113
+ echo "<span class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Subscribe', 'subscribe2') . "\"/>\r\n";
1114
+ echo "<input type=\"hidden\" name=\"s2_admin\" value=\"subscribe\" /></span>";
1115
  echo "</form></div>";
1116
 
1117
  // subscriber lists
1121
  // show the selected subscribers
1122
  $alternate = 'alternate';
1123
  if (!empty($subscribers)) {
1124
+ echo "<p align=\"center\"><b>" . __('Registered on the left, confirmed in the middle, unconfirmed on the right', 'subscribe2') . "</b></p>\r\n";
1125
  if (is_writable(ABSPATH . 'wp-content')) {
1126
  $exportcsv = implode(",", $subscribers);
1127
  echo "<form method=\"post\" action=\"\">\r\n";
1130
  }
1131
  echo "<input type=\"hidden\" name=\"exportcsv\" value=\"$exportcsv\" />\r\n";
1132
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"exportcsv\" />\r\n";
1133
+ echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Save Emails to CSV File','subscribe2') . "\" /></p>\r\n";
1134
  echo "</form>\r\n";
1135
  }
1136
  }
1142
  if (in_array($subscriber, $unconfirmed)) {
1143
  echo " align=\"right\">";
1144
  } elseif (in_array($subscriber, $confirmed)) {
1145
+ echo " align=\"center\">";
1146
  } else {
1147
+ echo " align=\"left\" colspan=\"3\">";
1148
  }
1149
  echo "<a href=\"mailto:$subscriber\">$subscriber</a>\r\n";
1150
  if (in_array($subscriber, $unconfirmed) || in_array($subscriber, $confirmed) ) {
1191
  }
1192
  echo "<input type=\"hidden\" name=\"reminderemails\" value=\"$reminderemails\" />\r\n";
1193
  echo "<input type=\"hidden\" name=\"s2_admin\" value=\"remind\" />\r\n";
1194
+ echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Send Reminder Email','subscribe2') . "\" /></p>\r\n";
1195
  echo "</form>";
1196
  }
1197
  echo "</div>\r\n";
1210
  echo "<input type=\"radio\" name=\"manage\" value=\"unsubscribe\" />" . __('Unsubscribe', 'subscribe2') . "<br /><br />\r\n";
1211
  echo "<input type=\"hidden\" name=\"emails\" value=\"$emails\" /><input type=\"hidden\" name=\"s2_admin\" value=\"register\" />\r\n";
1212
  $this->display_category_form();
1213
+ echo "<p class=\"submit\"><input type=\"submit\" id=\"deletepost\" name=\"submit\" value=\"" . __('Submit', 'subscribe2') . "\" /></p></form>";
1214
 
1215
  echo "</div>\r\n";
1216
  echo "<div style=\"clear: both;\"><p>&nbsp;</p></div>";
1248
  ($_POST['show_button'] == '1') ? $showbutton = '1' : $showbutton = '0';
1249
  $this->subscribe2_options['show_button'] = $showbutton;
1250
 
1251
+ // show widget in Presentation->Widgets
1252
+ ($_POST['widget'] == '1') ? $showwidget = '1' : $showwidget = '0';
1253
+ $this->subscribe2_options['widget'] = $showwidget;
1254
+
1255
  // send as author or admin?
1256
  $sender = 'author';
1257
  if ('admin' == $_POST['sender']) {
1267
 
1268
  // send per-post or digest emails
1269
  $email_freq = $_POST['email_freq'];
1270
+ if ($email_freq != $this->subscribe2_options['email_freq']) {
1271
+ //ensure $timestamp is used if cron period changes
1272
+ $check = true;
1273
+ }
1274
  $this->subscribe2_options['email_freq'] = $email_freq;
1275
+ $previous_time = wp_next_scheduled('s2_digest_cron');
1276
  wp_clear_scheduled_hook('s2_digest_cron');
1277
  $scheds = (array) wp_get_schedules();
1278
  $interval = ( isset($scheds[$email_freq]['interval']) ) ? (int) $scheds[$email_freq]['interval'] : 0;
1282
  } else {
1283
  if (!wp_next_scheduled('s2_digest_cron')) {
1284
  // if we are using digest schedule the event and prime last_cron as now
1285
+ $time = time() + $interval;
1286
+ if ($interval < 86400) {
1287
+ // Schedule CRON events occurring less than daily starting now and periodically thereafter
1288
+ $timestamp = &$time;
1289
+ } else {
1290
+ // Schedule other CRON events starting at midnight and periodically thereafter
1291
+ $timestamp = mktime(0, 0, 0, date('m', $time), date('d', $time), date('Y', $time));
1292
+ }
1293
+ if ( ('on' == $_POST['reset_cron']) || $check ) {
1294
+ wp_schedule_event($timestamp, $email_freq, 's2_digest_cron');
1295
+ } else {
1296
+ wp_schedule_event($previous_time, $email_freq, 's2_digest_cron');
1297
+ }
1298
+ $now = date('Y-m-d H:i:s', $time);
1299
  $this->subscribe2_options['last_s2cron'] = $now;
1300
  }
1301
  }
1356
  echo __('Send Email From', 'subscribe2') . ': ';
1357
  echo "<input type=\"radio\" name=\"sender\" value=\"author\"";
1358
  if ('author' == $this->subscribe2_options['sender']) {
1359
+ echo " checked=\"checked\" ";
1360
  }
1361
  echo " /> " . __('Author of the post', 'subscribe2') . " &nbsp;&nbsp;";
1362
  echo "<input type=\"radio\" name=\"sender\" value=\"admin\"";
1363
  if ('admin' == $this->subscribe2_options['sender']) {
1364
+ echo " checked=\"checked\" ";
1365
  }
1366
  echo " /> " . __('Blog Admin', 'subscribe2') . "<br /><br />\r\n";
1367
  if (function_exists('wp_schedule_event')) {
1368
  echo __('Send Email as Digest', 'subscribe2') . ": <br /><br />\r\n";
1369
  $this->display_digest_choices();
 
1370
  }
1371
  echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
1372
  echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"1\" class=\"editform\">\r\n";
1414
  }
1415
  echo " /> " . __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "<br /><br />\r\n";
1416
 
1417
+ // show Widget
1418
+ echo "<input type=\"checkbox\" name=\"widget\" value=\"1\"";
1419
+ if ('1' == $this->subscribe2_options['widget']) {
1420
+ echo " checked=\"checked\"";
1421
+ }
1422
+ echo " /> " . __('Enable Subscribe2 Widget?', 'subscribe2') . "<br /><br />\r\n";
1423
+
1424
  //Auto Subscription for new registrations
1425
  echo "<h2>" . __('Auto Subscribe', 'subscribe2') . "</h2>\r\n";
1426
  echo __('Subscribe new users registering with your blog', 'subscribe2') . ":<br />\r\n";
1520
  update_usermeta($user_ID, 's2_autosub', $_POST['new_category']);
1521
 
1522
  $cats = $_POST['category'];
1523
+ if ( (empty($cats)) || ($cats == '-1') ) {
1524
  $cats = explode(',', get_usermeta($user_ID, 's2_subscribed'));
1525
  if ($cats) {
1526
  foreach ($cats as $cat) {
1528
  }
1529
  }
1530
  update_usermeta($user_ID, 's2_subscribed', '-1');
1531
+ } elseif ($cats == 'digest') {
1532
+ $all_cats = get_categories(array('hide_empty' => false));
1533
+ foreach ($all_cats as $cat) {
1534
+ ('' == $catids) ? $catids = "$cat->term_id" : $catids .= ",$cat->term_id";
1535
+ update_usermeta($user_ID, 's2_cat' . $cat->term_id, $cat->term_id);
1536
+ }
1537
+ update_usermeta($user_ID, 's2_subscribed', $catids);
1538
  } else {
1539
  if (!is_array($cats)) {
1540
  $cats = array($_POST['category']);
1545
  if (!empty($remove)) {
1546
  // remove subscription to these cat IDs
1547
  foreach ($remove as $id) {
1548
+ delete_usermeta($user_ID, "s2_cat" . $id);
1549
  }
1550
  }
1551
  if (!empty($new)) {
1552
  // add subscription to these cat IDs
1553
  foreach ($new as $id) {
1554
+ update_usermeta($user_ID, 's2_cat' . $id, $id);
1555
  }
1556
  }
1557
  update_usermeta($user_ID, 's2_subscribed', implode(',', $cats));
1592
  echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': &nbsp;&nbsp;';
1593
  echo "<input type=\"radio\" name=\"new_category\" value=\"yes\" ";
1594
  if ('yes' == get_usermeta($user_ID, 's2_autosub')) {
1595
+ echo "checked=\"checked\" ";
1596
  }
1597
  echo "/> Yes &nbsp;&nbsp;";
1598
  echo "<input type=\"radio\" name=\"new_category\" value=\"no\" ";
1599
  if ('no' == get_usermeta($user_ID, 's2_autosub')) {
1600
+ echo "checked=\"checked\" ";
1601
  }
1602
  echo "/> No<br /><br />";
1603
 
1608
  // we're doing daily digests, so just show
1609
  // subscribe / unnsubscribe
1610
  echo __('Receive daily summary of new posts?', 'subscribe2') . ': &nbsp;&nbsp;';
1611
+ echo "<input type=\"radio\" name=\"category\" value=\"digest\" ";
1612
+ if (get_usermeta($user_ID, 's2_subscribed') != '-1') {
1613
  echo "checked=\"yes\" ";
1614
  }
1615
+ echo "/> Yes <input type=\"radio\" name=\"category\" value=\"-1\" ";
1616
+ if (get_usermeta($user_ID, 's2_subscribed') == '-1') {
1617
  echo "checked=\"yes\" ";
1618
  }
1619
  echo "/> No";
1620
  }
1621
 
1622
  // submit
1623
+ echo "<p class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __("Update Preferences &raquo;", 'subscribe2') . "\" /></p>";
1624
  echo "</form></div>\r\n";
1625
 
1626
  include(ABSPATH . 'wp-admin/admin-footer.php');
1693
  function display_category_form($selected = array(), $override = 1) {
1694
  global $wpdb;
1695
 
1696
+ $all_cats = get_categories(array('hide_empty' => false));
1697
  $exclude = explode(',', $this->subscribe2_options['exclude']);
1698
 
1699
  if (0 == $override) {
1700
  // registered users are not allowed to subscribe to
1701
  // excluded categories
1702
+ foreach ($all_cats as $cat => $term_id) {
1703
+ if (in_array($all_cats[$cat]->term_id, $exclude)) {
1704
  $cat = (int)$cat;
1705
  unset($all_cats[$cat]);
1706
  }
1718
  $j++;
1719
  }
1720
  if (0 == $j) {
1721
+ echo "<input type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
1722
+ if (in_array($cat->term_id, $selected)) {
1723
  echo " checked=\"checked\" ";
1724
  }
1725
+ echo " /> " . $cat->name . "<br />\r\n";
1726
  } else {
1727
 
1728
+ echo "<input type=\"checkbox\" name=\"category[]\" value=\"" . $cat->term_id . "\"";
1729
+ if (in_array($cat->term_id, $selected)) {
1730
  echo " checked=\"checked\" ";
1731
  }
1732
+ echo " /> " . $cat->name . "<br />\r\n";
1733
  }
1734
  $i++;
1735
  }
1736
  echo "</td></tr>\r\n";
1737
+ echo "<tr><td align=\"left\" colspan=\"2\">\r\n";
1738
  echo "<input type=\"checkbox\" name=\"checkall\" onclick=\"setAll(this)\" /> " . __('Select / Unselect All' ,'subscribe2') . "\r\n";
1739
  echo "</td></tr>\r\n";
1740
  echo "</table>\r\n";
1752
  'public' => __('Public Subscribers', 'subscribe2'),
1753
  'confirmed' => ' &nbsp;&nbsp;' . __('Confirmed', 'subscribe2'),
1754
  'unconfirmed' => ' &nbsp;&nbsp;' . __('Unconfirmed', 'subscribe2'),
1755
+ 'registered' => __('Registered Users', 'subscribe2'));
1756
 
1757
+ $all_cats = get_categories(array('hide_empty' => false));
1758
 
1759
  // count the number of subscribers
1760
  $count['confirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='1'");
1769
  $count['registered'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='s2_subscribed'");
1770
  $count['all'] = ($count['confirmed'] + $count['unconfirmed'] + $count['registered']);
1771
  foreach ($all_cats as $cat) {
1772
+ $count[$cat->name] = $wpdb->get_var("SELECT COUNT(meta_value) FROM $wpdb->usermeta WHERE meta_key='s2_cat$cat->term_id'");
1773
  }
1774
 
1775
  // do have actually have some subscribers?
1793
 
1794
  if ($count['registered'] > 0) {
1795
  foreach ($all_cats as $cat) {
1796
+ if (in_array($cat->term_id, $exclude)) { continue; }
1797
+ echo "<option value=\"" . $cat->term_id . "\"";
1798
+ if ($cat->term_id == $selected) { echo " selected=\"selected\" "; }
1799
+ echo "> &nbsp;&nbsp;" . $cat->name . "&nbsp;(" . $count[$cat->name] . ") </option>\r\n";
1800
  }
1801
  }
1802
  echo "</select>";
1824
  echo " /> " . $value['display'] . "<br />\r\n";
1825
  }
1826
  if (wp_next_scheduled('s2_digest_cron')) {
1827
+ echo "<p><input type=\"checkbox\" name=\"reset_cron\" /> " . __('Reset the schedule time and date for periodic email notifications', 'subscribe2') . "</p>\r\n";
1828
  $datetime = get_option('date_format') . ' @ ' . get_option('time_format');
1829
  $now = time();
1830
  echo "<p>" . __('Current server time is', 'subscribe2') . ": \r\n";
1831
  echo "<strong>" . gmdate($datetime, $now+ (get_option('gmt_offset') * 3600)) . "</strong></p>\r\n";
1832
  echo "<p>" . __('Next email notification will be sent', 'subscribe2') . ": \r\n";
1833
  echo "<strong>" . gmdate($datetime, wp_next_scheduled('s2_digest_cron') + (get_option('gmt_offset') * 3600)) . "</strong></p>\r\n";
1834
+ } else {
1835
+ echo "<br />";
1836
  }
1837
  } // end display_digest_choices()
1838
 
1936
  }
1937
  }
1938
  }
1939
+ $content = preg_replace('|<!--subscribe2-->|', $this->s2form, $content);
1940
+ return $content;
1941
  } // end filter()
1942
 
1943
  /**
1972
  return __('Subscription Confirmation', 'subscribe2');
1973
  } // end title_filter()
1974
 
1975
+ /* ===== widget functions ===== */
1976
+ /**
1977
+ Registers our widget so it appears with the other available
1978
+ widgets and can be dragged and dropped into any active sidebars
1979
+ */
1980
+ function widget_subscribe2widget($args) {
1981
+ extract($args);
1982
+ $options = get_option('widget_subscribe2widget');
1983
+ $title = empty($options['title']) ? __('Subscribe2') : $options['title'];
1984
+ echo $before_widget;
1985
+ echo $before_title . $title . $after_title;
1986
+ echo "<div class=\"search\">";
1987
+ $content = s2class::filter('<!--subscribe2-->');
1988
+ echo $content;
1989
+ echo "</div>";
1990
+ echo $after_widget;
1991
+ }
1992
+
1993
+ /**
1994
+ Register the optional widget control form
1995
+ */
1996
+ function widget_subscribe2widget_control() {
1997
+ $options = $newoptions = get_option('widget_subscribe2widget');
1998
+ if ($_POST["s2w-submit"]) {
1999
+ $newoptions['title'] = strip_tags(stripslashes($_POST["s2w-title"]));
2000
+ }
2001
+ if ($options != $newoptions) {
2002
+ $options = $newoptions;
2003
+ update_option('widget_subscribe2widget', $options);
2004
+ }
2005
+ $title = htmlspecialchars($options['title'], ENT_QUOTES);
2006
+ echo "<p><label for=\"s2w-title\">" . __('Title:');
2007
+ echo "<input style=\"width: 250px;\" id=\"s2w-title\" name=\"s2w-title\" type=\"text\" value=\"" . $title . "\" /></label></p>";
2008
+ echo "<input type=\"hidden\" id=\"s2w-submit\" name=\"s2w-submit\" value=\"1\" />";
2009
+ }
2010
+
2011
+ /**
2012
+ Actually register the Widget into the WordPress Widget API
2013
+ */
2014
+ function register_subscribe2widget() {
2015
+ //Check Sidebar Widget and Subscribe2 plugins are activated
2016
+ if ( !function_exists('register_sidebar_widget') || !class_exists('s2class')) {
2017
+ return;
2018
+ } else {
2019
+ register_sidebar_widget('Subscribe2Widget', array(&$this, 'widget_subscribe2widget'));
2020
+ register_widget_control('Subscribe2Widget', array(&$this, 'widget_subscribe2widget_control'));
2021
+ }
2022
+ }
2023
+
2024
  /* ===== wp-cron functions ===== */
2025
  /**
2026
  Send a daily digest of today's new posts
2042
 
2043
  // if we have posts, let's prepare the digest
2044
  foreach ($posts as $post) {
2045
+ $post_cats = wp_get_post_categories($post->ID);
2046
  $post_cats_string = implode(',', $post_cats);
2047
  $check = false;
2048
  // is the current post assigned to any categories
2052
  $check = true;
2053
  }
2054
  }
2055
+ // is the current post private
2056
+ // and should this not generate a notification email?
2057
+ if ( ($this->subscribe2_options['password'] == "no") && ($post->post_password != '') ) {
2058
+ $check = true;
2059
+ }
2060
  // if this post is in an excluded category,
2061
  // don't include it in the digest
2062
  if ($check) {
2107
  $registered = $this->get_registered();
2108
  $recipients = array_merge((array)$public, (array)$registered);
2109
  $mailtext = $this->substitute(stripslashes($this->subscribe2_options['mailtext']));
2110
+ $body = str_replace("TABLE", $table, $mailtext);
2111
+ $body = str_replace("POST", $message, $mailtext);
2112
  $this->mail($recipients, $subject, $body);
2113
  } // end subscribe2_cron
2114
 
2122
  $this->subscribe2_options = get_option('subscribe2_options');
2123
 
2124
  add_action('init', array(&$this, 'subscribe2'));
2125
+ if ('1' == $this->subscribe2_options['show_button']) {
2126
  add_action('init', array(&$this, 'button_init'));
2127
  }
2128
+ // add action to display widget if option is enabled
2129
+ if ('1' == $this->subscribe2_options['widget']) {
2130
+ add_action('plugins_loaded', array(&$this, 'register_subscribe2widget'));
2131
+ }
2132
  }
2133
 
2134
  function subscribe2() {
2156
  add_action('admin_menu', array(&$this, 'admin_menu'));
2157
  add_action('create_category', array(&$this, 'autosub_new_category'));
2158
  add_action('register_form', array(&$this, 'register_form'));
2159
+ add_filter('the_content', array(&$this, 'filter'), 10);
2160
  add_filter('cron_schedules', array(&$this, 'add_weekly_sched'));
2161
 
2162
  // add action to display editor buttons if option is enabled
2176
  if ($this->subscribe2_options['email_freq'] != 'never') {
2177
  add_action('s2_digest_cron', array(&$this, 'subscribe2_cron'));
2178
  } else {
2179
+ add_action('new_to_publish', array(&$this, 'publish'));
2180
+ add_action('draft_to_publish', array(&$this, 'publish'));
2181
+ add_action('pending_to_publish', array(&$this, 'publish'));
2182
+ add_action('private_to_publish', array(&$this, 'publish'));
2183
+ if ($this->subscribe2_options['password'] == "yes") {
2184
+ add_action('new_to_private', array(&$this, 'publish'));
2185
+ add_action('draft_to_private', array(&$this, 'publish'));
2186
+ add_action('pending_to_private', array(&$this, 'publish'));
2187
+ }
2188
  }
2189
 
2190
  // add action to email notification about pages if option is enabled
2195
  // load our strings
2196
  $this->load_strings();
2197
  } // end subscribe2()
2198
+
2199
  /* ===== ButtonSnap configuration ===== */
2200
  /**
2201
  Register our button in the QuickTags bar
subscribe2/subscribe2.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2007-08-05 19:38+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"
@@ -54,7 +54,7 @@ msgstr ""
54
  msgid "Your email:"
55
  msgstr ""
56
 
57
- #: subscribe2.php:81 subscribe2.php:1140 subscribe2.php:1235
58
  msgid "Subscribe"
59
  msgstr ""
60
 
@@ -62,7 +62,7 @@ msgstr ""
62
  msgid "Unsubscribe"
63
  msgstr ""
64
 
65
- #: subscribe2.php:81 subscribe2.php:1671
66
  msgid "Send"
67
  msgstr ""
68
 
@@ -110,7 +110,7 @@ msgstr ""
110
  msgid "Subscribe2 Options"
111
  msgstr ""
112
 
113
- #: subscribe2.php:109 subscribe2.php:2137
114
  msgid "Subscribe2"
115
  msgstr ""
116
 
@@ -209,305 +209,317 @@ msgstr ""
209
  msgid "Action to perform"
210
  msgstr ""
211
 
212
- #: subscribe2.php:1239 subscribe2.php:1475
213
  msgid "Submit"
214
  msgstr ""
215
 
216
- #: subscribe2.php:1338
217
  msgid "Delivery Options"
218
  msgstr ""
219
 
220
- #: subscribe2.php:1339
221
  msgid "Send Emails for Pages"
222
  msgstr ""
223
 
224
- #: subscribe2.php:1344 subscribe2.php:1355 subscribe2.php:1446
225
  msgid "Yes"
226
  msgstr ""
227
 
228
- #: subscribe2.php:1349 subscribe2.php:1360 subscribe2.php:1440
229
- #: subscribe2.php:1451
230
  msgid "No"
231
  msgstr ""
232
 
233
- #: subscribe2.php:1350
234
  msgid "Send Emails for Password Protected Posts"
235
  msgstr ""
236
 
237
- #: subscribe2.php:1361
238
  msgid "Send Email From"
239
  msgstr ""
240
 
241
- #: subscribe2.php:1366
242
  msgid "Author of the post"
243
  msgstr ""
244
 
245
- #: subscribe2.php:1371
246
  msgid "Blog Admin"
247
  msgstr ""
248
 
249
- #: subscribe2.php:1373
250
  msgid "Send Email as Digest"
251
  msgstr ""
252
 
253
- #: subscribe2.php:1377
254
  msgid "Email Templates"
255
  msgstr ""
256
 
257
- #: subscribe2.php:1380
258
  msgid "New Post email (must not be empty)"
259
  msgstr ""
260
 
261
- #: subscribe2.php:1384
262
  msgid "Message substitions"
263
  msgstr ""
264
 
265
- #: subscribe2.php:1388
266
  msgid "the post's title"
267
  msgstr ""
268
 
269
- #: subscribe2.php:1389
270
  msgid ""
271
  "the excerpt or the entire post<br />(<i>based on the subscriber's "
272
  "preferences</i>)"
273
  msgstr ""
274
 
275
- #: subscribe2.php:1390
276
  msgid "a list of post titles (for digest emails)"
277
  msgstr ""
278
 
279
- #: subscribe2.php:1391
280
  msgid "the post's permalink"
281
  msgstr ""
282
 
283
- #: subscribe2.php:1392
284
  msgid "the admin or post author's name"
285
  msgstr ""
286
 
287
- #: subscribe2.php:1393
288
  msgid "the admin or post author's email"
289
  msgstr ""
290
 
291
- #: subscribe2.php:1394
292
  msgid "the post author's name"
293
  msgstr ""
294
 
295
- #: subscribe2.php:1395
296
  msgid ""
297
  "the generated link to confirm a request<br />(<i>only used in the "
298
  "confirmation email template</i>)"
299
  msgstr ""
300
 
301
- #: subscribe2.php:1396
302
  msgid ""
303
  "Action performed by LINK in confirmation email<br />(<i>only used in the "
304
  "confirmation email template</i>)"
305
  msgstr ""
306
 
307
- #: subscribe2.php:1398
308
  msgid "Subscribe / Unsubscribe confirmation email"
309
  msgstr ""
310
 
311
- #: subscribe2.php:1401
312
  msgid "Reminder email to Unconfirmed Subscribers"
313
  msgstr ""
314
 
315
- #: subscribe2.php:1406
316
  msgid "Excluded Categories"
317
  msgstr ""
318
 
319
- #: subscribe2.php:1407
320
  msgid ""
321
  "Posts assigned to any Excluded Category do not generate notifications and "
322
  "are not included in digest notifications"
323
  msgstr ""
324
 
325
- #: subscribe2.php:1413
326
  msgid "Allow registered users to subscribe to excluded categories?"
327
  msgstr ""
328
 
329
- #: subscribe2.php:1416
330
  msgid "Writing Options"
331
  msgstr ""
332
 
333
- #: subscribe2.php:1421
334
  msgid "Show the Subscribe2 button on the Write toolbar?"
335
  msgstr ""
336
 
337
- #: subscribe2.php:1424
 
 
 
 
338
  msgid "Auto Subscribe"
339
  msgstr ""
340
 
341
- #: subscribe2.php:1425
342
  msgid "Subscribe new users registering with your blog"
343
  msgstr ""
344
 
345
- #: subscribe2.php:1430
346
  msgid "Automatically"
347
  msgstr ""
348
 
349
- #: subscribe2.php:1435
350
  msgid "Display option on Registration Form"
351
  msgstr ""
352
 
353
- #: subscribe2.php:1441
354
  msgid "Registration Form option is checked by default"
355
  msgstr ""
356
 
357
- #: subscribe2.php:1452
358
  msgid "Auto-subscribe users to receive email as"
359
  msgstr ""
360
 
361
- #: subscribe2.php:1457 subscribe2.php:1567
362
  msgid "HTML"
363
  msgstr ""
364
 
365
- #: subscribe2.php:1462
366
  msgid "Plain Text - Full"
367
  msgstr ""
368
 
369
- #: subscribe2.php:1467
370
  msgid "Plain Text - Excerpt"
371
  msgstr ""
372
 
373
- #: subscribe2.php:1470
374
  msgid "Barred Domains"
375
  msgstr ""
376
 
377
- #: subscribe2.php:1471
378
  msgid ""
379
  "Enter domains to bar from public subscriptions: <br /> (Use a new line for "
380
  "each entry and omit the \"@\" symbol, for example email.com)"
381
  msgstr ""
382
 
383
- #: subscribe2.php:1480
384
  msgid "Reset Default"
385
  msgstr ""
386
 
387
- #: subscribe2.php:1481
388
  msgid ""
389
  "Use this to reset all options to their defaults. This <strong><em>will not</"
390
  "em></strong> modify your list of subscribers."
391
  msgstr ""
392
 
393
- #: subscribe2.php:1488
394
  msgid "RESET"
395
  msgstr ""
396
 
397
- #: subscribe2.php:1508
398
  msgid "Subscription preferences updated."
399
  msgstr ""
400
 
401
- #: subscribe2.php:1555
402
  msgid "Notification Settings"
403
  msgstr ""
404
 
405
- #: subscribe2.php:1562
406
  msgid "Receive email as"
407
  msgstr ""
408
 
409
- #: subscribe2.php:1572
410
  msgid "Plain Text"
411
  msgstr ""
412
 
413
- #: subscribe2.php:1574
414
  msgid "Email contains"
415
  msgstr ""
416
 
417
- #: subscribe2.php:1575
418
  msgid "Excerpt Only"
419
  msgstr ""
420
 
421
- #: subscribe2.php:1575
422
  msgid "Full Post"
423
  msgstr ""
424
 
425
- #: subscribe2.php:1583
426
  msgid "Note: HTML format will always deliver the full post."
427
  msgstr ""
428
 
429
- #: subscribe2.php:1584
430
  msgid "Automatically subscribe me to newly created categories"
431
  msgstr ""
432
 
433
- #: subscribe2.php:1597
434
  msgid "Subscribed Categories"
435
  msgstr ""
436
 
437
- #: subscribe2.php:1602
438
  msgid "Receive daily summary of new posts?"
439
  msgstr ""
440
 
441
- #: subscribe2.php:1615
442
  msgid "Update Preferences &raquo;"
443
  msgstr ""
444
 
445
- #: subscribe2.php:1660
446
  msgid "Send email to all subscribers"
447
  msgstr ""
448
 
449
- #: subscribe2.php:1665
450
  msgid "Subject"
451
  msgstr ""
452
 
453
- #: subscribe2.php:1665
454
  msgid "A message from "
455
  msgstr ""
456
 
457
- #: subscribe2.php:1668
458
  msgid "Recipients: "
459
  msgstr ""
460
 
461
- #: subscribe2.php:1730
462
  msgid "Select / Unselect All"
463
  msgstr ""
464
 
465
- #: subscribe2.php:1743
466
  msgid "All Subscribers"
467
  msgstr ""
468
 
469
- #: subscribe2.php:1744
470
  msgid "Public Subscribers"
471
  msgstr ""
472
 
473
- #: subscribe2.php:1745
474
  msgid "Confirmed"
475
  msgstr ""
476
 
477
- #: subscribe2.php:1746
478
  msgid "Unconfirmed"
479
  msgstr ""
480
 
481
- #: subscribe2.php:1747
482
- msgid "Registered Subscribers"
483
  msgstr ""
484
 
485
- #: subscribe2.php:1803
486
  msgid "Per Post Email"
487
  msgstr ""
488
 
489
- #: subscribe2.php:1821
 
 
 
 
490
  msgid "Current server time is"
491
  msgstr ""
492
 
493
- #: subscribe2.php:1823
494
  msgid "Next email notification will be sent"
495
  msgstr ""
496
 
497
- #: subscribe2.php:1834
498
  msgid "Check here to Subscribe to email notifications for new posts"
499
  msgstr ""
500
 
501
- #: subscribe2.php:1843
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:1960
508
  msgid "Subscription Confirmation"
509
  msgstr ""
510
 
511
- #: subscribe2.php:2039
 
 
 
 
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: 2007-09-24 21:26+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"
54
  msgid "Your email:"
55
  msgstr ""
56
 
57
+ #: subscribe2.php:81 subscribe2.php:1139 subscribe2.php:1235
58
  msgid "Subscribe"
59
  msgstr ""
60
 
62
  msgid "Unsubscribe"
63
  msgstr ""
64
 
65
+ #: subscribe2.php:81 subscribe2.php:1705
66
  msgid "Send"
67
  msgstr ""
68
 
110
  msgid "Subscribe2 Options"
111
  msgstr ""
112
 
113
+ #: subscribe2.php:109 subscribe2.php:2009 subscribe2.php:2228
114
  msgid "Subscribe2"
115
  msgstr ""
116
 
209
  msgid "Action to perform"
210
  msgstr ""
211
 
212
+ #: subscribe2.php:1239 subscribe2.php:1502
213
  msgid "Submit"
214
  msgstr ""
215
 
216
+ #: subscribe2.php:1359
217
  msgid "Delivery Options"
218
  msgstr ""
219
 
220
+ #: subscribe2.php:1360
221
  msgid "Send Emails for Pages"
222
  msgstr ""
223
 
224
+ #: subscribe2.php:1365 subscribe2.php:1376 subscribe2.php:1473
225
  msgid "Yes"
226
  msgstr ""
227
 
228
+ #: subscribe2.php:1370 subscribe2.php:1381 subscribe2.php:1467
229
+ #: subscribe2.php:1478
230
  msgid "No"
231
  msgstr ""
232
 
233
+ #: subscribe2.php:1371
234
  msgid "Send Emails for Password Protected Posts"
235
  msgstr ""
236
 
237
+ #: subscribe2.php:1382
238
  msgid "Send Email From"
239
  msgstr ""
240
 
241
+ #: subscribe2.php:1387
242
  msgid "Author of the post"
243
  msgstr ""
244
 
245
+ #: subscribe2.php:1392
246
  msgid "Blog Admin"
247
  msgstr ""
248
 
249
+ #: subscribe2.php:1394
250
  msgid "Send Email as Digest"
251
  msgstr ""
252
 
253
+ #: subscribe2.php:1397
254
  msgid "Email Templates"
255
  msgstr ""
256
 
257
+ #: subscribe2.php:1400
258
  msgid "New Post email (must not be empty)"
259
  msgstr ""
260
 
261
+ #: subscribe2.php:1404
262
  msgid "Message substitions"
263
  msgstr ""
264
 
265
+ #: subscribe2.php:1408
266
  msgid "the post's title"
267
  msgstr ""
268
 
269
+ #: subscribe2.php:1409
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:1410
276
  msgid "a list of post titles (for digest emails)"
277
  msgstr ""
278
 
279
+ #: subscribe2.php:1411
280
  msgid "the post's permalink"
281
  msgstr ""
282
 
283
+ #: subscribe2.php:1412
284
  msgid "the admin or post author's name"
285
  msgstr ""
286
 
287
+ #: subscribe2.php:1413
288
  msgid "the admin or post author's email"
289
  msgstr ""
290
 
291
+ #: subscribe2.php:1414
292
  msgid "the post author's name"
293
  msgstr ""
294
 
295
+ #: subscribe2.php:1415
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:1416
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:1418
308
  msgid "Subscribe / Unsubscribe confirmation email"
309
  msgstr ""
310
 
311
+ #: subscribe2.php:1421
312
  msgid "Reminder email to Unconfirmed Subscribers"
313
  msgstr ""
314
 
315
+ #: subscribe2.php:1426
316
  msgid "Excluded Categories"
317
  msgstr ""
318
 
319
+ #: subscribe2.php:1427
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:1433
326
  msgid "Allow registered users to subscribe to excluded categories?"
327
  msgstr ""
328
 
329
+ #: subscribe2.php:1436
330
  msgid "Writing Options"
331
  msgstr ""
332
 
333
+ #: subscribe2.php:1441
334
  msgid "Show the Subscribe2 button on the Write toolbar?"
335
  msgstr ""
336
 
337
+ #: subscribe2.php:1448
338
+ msgid "Enable Subscribe2 Widget?"
339
+ msgstr ""
340
+
341
+ #: subscribe2.php:1451
342
  msgid "Auto Subscribe"
343
  msgstr ""
344
 
345
+ #: subscribe2.php:1452
346
  msgid "Subscribe new users registering with your blog"
347
  msgstr ""
348
 
349
+ #: subscribe2.php:1457
350
  msgid "Automatically"
351
  msgstr ""
352
 
353
+ #: subscribe2.php:1462
354
  msgid "Display option on Registration Form"
355
  msgstr ""
356
 
357
+ #: subscribe2.php:1468
358
  msgid "Registration Form option is checked by default"
359
  msgstr ""
360
 
361
+ #: subscribe2.php:1479
362
  msgid "Auto-subscribe users to receive email as"
363
  msgstr ""
364
 
365
+ #: subscribe2.php:1484 subscribe2.php:1601
366
  msgid "HTML"
367
  msgstr ""
368
 
369
+ #: subscribe2.php:1489
370
  msgid "Plain Text - Full"
371
  msgstr ""
372
 
373
+ #: subscribe2.php:1494
374
  msgid "Plain Text - Excerpt"
375
  msgstr ""
376
 
377
+ #: subscribe2.php:1497
378
  msgid "Barred Domains"
379
  msgstr ""
380
 
381
+ #: subscribe2.php:1498
382
  msgid ""
383
  "Enter domains to bar from public subscriptions: <br /> (Use a new line for "
384
  "each entry and omit the \"@\" symbol, for example email.com)"
385
  msgstr ""
386
 
387
+ #: subscribe2.php:1507
388
  msgid "Reset Default"
389
  msgstr ""
390
 
391
+ #: subscribe2.php:1508
392
  msgid ""
393
  "Use this to reset all options to their defaults. This <strong><em>will not</"
394
  "em></strong> modify your list of subscribers."
395
  msgstr ""
396
 
397
+ #: subscribe2.php:1515
398
  msgid "RESET"
399
  msgstr ""
400
 
401
+ #: subscribe2.php:1535
402
  msgid "Subscription preferences updated."
403
  msgstr ""
404
 
405
+ #: subscribe2.php:1589
406
  msgid "Notification Settings"
407
  msgstr ""
408
 
409
+ #: subscribe2.php:1596
410
  msgid "Receive email as"
411
  msgstr ""
412
 
413
+ #: subscribe2.php:1606
414
  msgid "Plain Text"
415
  msgstr ""
416
 
417
+ #: subscribe2.php:1608
418
  msgid "Email contains"
419
  msgstr ""
420
 
421
+ #: subscribe2.php:1609
422
  msgid "Excerpt Only"
423
  msgstr ""
424
 
425
+ #: subscribe2.php:1609
426
  msgid "Full Post"
427
  msgstr ""
428
 
429
+ #: subscribe2.php:1617
430
  msgid "Note: HTML format will always deliver the full post."
431
  msgstr ""
432
 
433
+ #: subscribe2.php:1618
434
  msgid "Automatically subscribe me to newly created categories"
435
  msgstr ""
436
 
437
+ #: subscribe2.php:1631
438
  msgid "Subscribed Categories"
439
  msgstr ""
440
 
441
+ #: subscribe2.php:1636
442
  msgid "Receive daily summary of new posts?"
443
  msgstr ""
444
 
445
+ #: subscribe2.php:1649
446
  msgid "Update Preferences &raquo;"
447
  msgstr ""
448
 
449
+ #: subscribe2.php:1694
450
  msgid "Send email to all subscribers"
451
  msgstr ""
452
 
453
+ #: subscribe2.php:1699
454
  msgid "Subject"
455
  msgstr ""
456
 
457
+ #: subscribe2.php:1699
458
  msgid "A message from "
459
  msgstr ""
460
 
461
+ #: subscribe2.php:1702
462
  msgid "Recipients: "
463
  msgstr ""
464
 
465
+ #: subscribe2.php:1764
466
  msgid "Select / Unselect All"
467
  msgstr ""
468
 
469
+ #: subscribe2.php:1777
470
  msgid "All Subscribers"
471
  msgstr ""
472
 
473
+ #: subscribe2.php:1778
474
  msgid "Public Subscribers"
475
  msgstr ""
476
 
477
+ #: subscribe2.php:1779
478
  msgid "Confirmed"
479
  msgstr ""
480
 
481
+ #: subscribe2.php:1780
482
  msgid "Unconfirmed"
483
  msgstr ""
484
 
485
+ #: subscribe2.php:1781
486
+ msgid "Registered Users"
487
  msgstr ""
488
 
489
+ #: subscribe2.php:1837
490
  msgid "Per Post Email"
491
  msgstr ""
492
 
493
+ #: subscribe2.php:1853
494
+ msgid "Reset the schedule time and date for periodic email notifications"
495
+ msgstr ""
496
+
497
+ #: subscribe2.php:1856
498
  msgid "Current server time is"
499
  msgstr ""
500
 
501
+ #: subscribe2.php:1858
502
  msgid "Next email notification will be sent"
503
  msgstr ""
504
 
505
+ #: subscribe2.php:1871
506
  msgid "Check here to Subscribe to email notifications for new posts"
507
  msgstr ""
508
 
509
+ #: subscribe2.php:1880
510
  msgid ""
511
  "By Registering with this blog you are also agreeing to recieve email "
512
  "notifications for new posts"
513
  msgstr ""
514
 
515
+ #: subscribe2.php:1998
516
  msgid "Subscription Confirmation"
517
  msgstr ""
518
 
519
+ #: subscribe2.php:2032
520
+ msgid "Title:"
521
+ msgstr ""
522
+
523
+ #: subscribe2.php:2126
524
  msgid "Digest Email"
525
  msgstr ""
subscribe2/tinymce/editor_plugin.js CHANGED
@@ -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,7 +64,7 @@ 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
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