Subscribe to Comments - Version 2.1

Version Description

Download this release

Release Info

Developer markjaquith
Plugin Icon wp plugin Subscribe to Comments
Version 2.1
Comparing to
See all releases

Code changes from version 2.0.8 to 2.1

readme.html → extras/readme.html RENAMED
@@ -12,33 +12,33 @@
12
  <p>Here are some of the crucial Subscribe to Comments 2 links</p>
13
  <ul>
14
  <li><a href="http://txfx.net/code/wordpress/subscribe-to-comments/">Plugin's home</a></li>
15
- <li><a href="http://dev.wp-plugins.org/wiki/SubscribeToComments">WP Plugins Wiki Page</a></li>
16
  <li><a href="http://dev.wp-plugins.org/newticket">Report Bugs or Suggest Features</a></li>
17
- <li><a href="http://svn.wp-plugins.org/subscribe-to-comments/tags/latest-stable/subscribe-to-comments.zip">Latest Stable Version</a></li>
18
- <li><a href="http://downloads.wordpress.org/plugin/subscribe-to-comments.zip">Bleeding Edge Development Version</a></li>
19
  </ul>
20
 
21
  <h2>Installation</h2>
22
  <ol>
23
  <li>Put <code>subscribe-to-comments.php</code> into <code>[wordpress_dir]/wp-content/plugins/</code></li>
24
- <li>Put <code>wp-subscription-manager.php</code> into your blog's root WordPress directory (the directory where <code>wp-config.php</code> resides)</li>
25
  <li>Go into the WordPress admin interface and activate the plugin</li>
26
- <li>Optional: if your WordPress 1.5 theme doesn't have the <code>comment_form</code> hook, or if you would like to manually determine where in your comments form the subscribe checkbox appears, enter this where you would like it: <code>&lt;?php show_subscription_checkbox(); ?&gt;</code></li>
27
  <li>Optional: If you would like to enable users to subscribe to comments without having to leave a comment, place this somewhere in your template, but make sure it is <strong>outside the comments form</strong>. A good place would be right after the ending <code>&lt;/form&gt;</code> tag for the comments form: <code>&lt;?php show_manual_subscription_form(); ?></code></li>
28
  </ol>
29
 
30
  <h2>Notes</h2>
31
  <ul>
 
 
32
  <li>The function &gt;?php comment_subscription_status(); ?&gt; can be used within the comments loop to determine if a comment's author is subscribed or not. e.g.
33
  <pre><code>&lt;?php if (comment_subscription_status()) { ?&gt;
34
  Subscribed
35
  &lt;?php } ?&gt;</code></pre></li>
36
- <li>You need to be a logged-in WordPress user of 8 or above in order to search for subscriptions on random e-mail addresses or to remove a "do not mail" block.</li>
37
  <li>The author of the post is always determined to be subscribed, and thus will never see the "subscribe" checkbox for his entries, but instead will see the "entry author" message.</li>
38
  <li>Users are never e-mailed notifications for their own comments. (important that you know that for testing out the plugin)</li>
39
  <li>The text shown next to the checkbox for unsubscribed users, the "you are subscribed" text, and the "you are the author of this entry" text can all be customized in the options (Options -&gt; Subscribe to Comments).</li>
40
  <li>By default, the "subscribe" checkbox is unchecked, but you can change that in the options (i.e. so that it is checked by default).</li>
41
- <li>The following CSS can be used with the Kubrick theme if you want to use a custom style for the Subscription Manager and should be added to your <code>style.css</code> file:<br /><br />
42
  <pre>
43
  /* SUBSCRIPTION MANAGER STYLE */
44
  .subscription-manager {
12
  <p>Here are some of the crucial Subscribe to Comments 2 links</p>
13
  <ul>
14
  <li><a href="http://txfx.net/code/wordpress/subscribe-to-comments/">Plugin's home</a></li>
 
15
  <li><a href="http://dev.wp-plugins.org/newticket">Report Bugs or Suggest Features</a></li>
16
+ <li><a href="http://downloads.wordpress.org/plugin/subscribe-to-comments.zip">Latest Stable Version</a></li>
 
17
  </ul>
18
 
19
  <h2>Installation</h2>
20
  <ol>
21
  <li>Put <code>subscribe-to-comments.php</code> into <code>[wordpress_dir]/wp-content/plugins/</code></li>
22
+ <li><strong>If you are upgrading from a 2.0.x version of this plugin only,</strong> put <code>wp-subscription-manager.php</code> into your blog's root WordPress directory (the directory where <code>wp-config.php</code> resides)</li>
23
  <li>Go into the WordPress admin interface and activate the plugin</li>
24
+ <li>Optional: if your WordPress theme doesn't have the <code>comment_form</code> hook, or if you would like to manually determine where in your comments form the subscribe checkbox appears, enter this where you would like it: <code>&lt;?php show_subscription_checkbox(); ?&gt;</code></li>
25
  <li>Optional: If you would like to enable users to subscribe to comments without having to leave a comment, place this somewhere in your template, but make sure it is <strong>outside the comments form</strong>. A good place would be right after the ending <code>&lt;/form&gt;</code> tag for the comments form: <code>&lt;?php show_manual_subscription_form(); ?></code></li>
26
  </ol>
27
 
28
  <h2>Notes</h2>
29
  <ul>
30
+ <li>The <code>subscribe-to-comments.pot</code> file is for translators... normal users should disregard it</li>
31
+ <li>The only file that <em>must</em> be uploaded is the <code>subscribe-to-comments.php</code> file. The <code>wp-subscription-manager.php</code> file is for backwards compatability only. If you are installing the plugin for the first time, you don't need it. None of the other files in the <code>/readme-etc/</code> directory need to be uploaded</li>
32
  <li>The function &gt;?php comment_subscription_status(); ?&gt; can be used within the comments loop to determine if a comment's author is subscribed or not. e.g.
33
  <pre><code>&lt;?php if (comment_subscription_status()) { ?&gt;
34
  Subscribed
35
  &lt;?php } ?&gt;</code></pre></li>
36
+ <li>You need to be a logged-in WordPress user with the "manage_options" capability in order to search for subscriptions on random e-mail addresses or to remove a "do not mail" block.</li>
37
  <li>The author of the post is always determined to be subscribed, and thus will never see the "subscribe" checkbox for his entries, but instead will see the "entry author" message.</li>
38
  <li>Users are never e-mailed notifications for their own comments. (important that you know that for testing out the plugin)</li>
39
  <li>The text shown next to the checkbox for unsubscribed users, the "you are subscribed" text, and the "you are the author of this entry" text can all be customized in the options (Options -&gt; Subscribe to Comments).</li>
40
  <li>By default, the "subscribe" checkbox is unchecked, but you can change that in the options (i.e. so that it is checked by default).</li>
41
+ <li>The following CSS can be used with the WordPress default "Kubrick" theme if you want to use a custom style for the Subscription Manager and should be added to your <code>style.css</code> file:<br /><br />
42
  <pre>
43
  /* SUBSCRIPTION MANAGER STYLE */
44
  .subscription-manager {
subscribe-to-comments.pot → extras/subscribe-to-comments.pot RENAMED
@@ -1,157 +1,157 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Subscribe to Comments 2.0\n"
4
- "POT-Creation-Date: 2006-09-11 00:36-0400\n"
5
  "Last-Translator: Mark Jaquith <mark.i18n@txfx.net>\n"
6
  "Language-Team: Mark Jaquith <mark.wordpress@txfx.net>\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=utf-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
 
11
- #: subscribe-to-comments.php:81
12
  msgid "<strong>Error: </strong>"
13
  msgstr ""
14
 
15
- #: subscribe-to-comments.php:96
16
  msgid "Subscribe without commenting"
17
  msgstr ""
18
 
19
- #: subscribe-to-comments.php:98
20
  msgid "E-Mail:"
21
  msgstr ""
22
 
23
- #: subscribe-to-comments.php:100
24
  msgid "Subscribe"
25
  msgstr ""
26
 
27
- #: subscribe-to-comments.php:145
28
  msgid "\"From\" name for notifications:"
29
  msgstr ""
30
 
31
- #: subscribe-to-comments.php:146
32
  msgid "\"From\" e-mail addresss for notifications:"
33
  msgstr ""
34
 
35
- #: subscribe-to-comments.php:147
36
  msgid "\"Subscribe\" box should be checked by default"
37
  msgstr ""
38
 
39
- #: subscribe-to-comments.php:148
40
  msgid ""
41
  "Do a CSS \"clear\" on the subscription checkbox/message (uncheck this if the "
42
  "checkbox/message appears in a strange location in your theme)"
43
  msgstr ""
44
 
45
- #: subscribe-to-comments.php:151
46
  msgid "Comment Form Text"
47
  msgstr ""
48
 
49
- #: subscribe-to-comments.php:153
50
  msgid ""
51
  "Customize the messages shown to different people. Use <code>[manager_link]</"
52
  "code> to insert the URI to the Subscription Manager."
53
  msgstr ""
54
 
55
- #: subscribe-to-comments.php:157
56
  msgid "Not subscribed"
57
  msgstr ""
58
 
59
- #: subscribe-to-comments.php:159
60
  msgid "Subscribed"
61
  msgstr ""
62
 
63
- #: subscribe-to-comments.php:161
64
  msgid "Entry Author"
65
  msgstr ""
66
 
67
- #: subscribe-to-comments.php:173
68
  msgid "Use custom style for Subscription Manager"
69
  msgstr ""
70
 
71
- #: subscribe-to-comments.php:175
72
  msgid ""
73
  "These settings only matter if you are using a custom style. <code>"
74
  "[theme_path]</code> will be replaced with the path to your current theme."
75
  msgstr ""
76
 
77
- #: subscribe-to-comments.php:178
78
  msgid "Path to header:"
79
  msgstr ""
80
 
81
- #: subscribe-to-comments.php:179
82
  msgid "Path to sidebar:"
83
  msgstr ""
84
 
85
- #: subscribe-to-comments.php:180
86
  msgid "Path to footer:"
87
  msgstr ""
88
 
89
- #: subscribe-to-comments.php:183
90
  msgid "HTML for before the subscription manager:"
91
  msgstr ""
92
 
93
- #: subscribe-to-comments.php:184
94
  msgid "HTML for after the subscription manager:"
95
  msgstr ""
96
 
97
- #: subscribe-to-comments.php:209
98
  msgid "Options saved."
99
  msgstr ""
100
 
101
- #: subscribe-to-comments.php:216
102
  msgid "Update Options &raquo;"
103
  msgstr ""
104
 
105
- #: subscribe-to-comments.php:388
106
  msgid "Please provide a valid e-mail address."
107
  msgstr ""
108
 
109
- #: subscribe-to-comments.php:392
110
  msgid "This e-mail address may not be subscribed"
111
  msgstr ""
112
 
113
- #: subscribe-to-comments.php:398 subscribe-to-comments.php:414
114
  msgid "You appear to be already subscribed to this entry."
115
  msgstr ""
116
 
117
- #: subscribe-to-comments.php:404
118
  msgid "Comments are not allowed on this entry."
119
  msgstr ""
120
 
121
- #: subscribe-to-comments.php:608
122
  #, php-format
123
  msgid "There is a new comment on the post \"%s\""
124
  msgstr ""
125
 
126
- #: subscribe-to-comments.php:609
127
  #, php-format
128
  msgid "Author: %s\n"
129
  msgstr ""
130
 
131
- #: subscribe-to-comments.php:610
132
  msgid "Comment:\n"
133
  msgstr ""
134
 
135
- #: subscribe-to-comments.php:611
136
  msgid "See all comments on this post here:\n"
137
  msgstr ""
138
 
139
- #: subscribe-to-comments.php:614
140
  msgid ""
141
  "To manage your subscriptions or to block all notifications from this site, "
142
  "click the link below:\n"
143
  msgstr ""
144
 
145
- #: subscribe-to-comments.php:617
146
  #, php-format
147
  msgid "New Comment On: %s"
148
  msgstr ""
149
 
150
- #: subscribe-to-comments.php:638
151
  msgid "E-mail change confirmation"
152
  msgstr ""
153
 
154
- #: subscribe-to-comments.php:639
155
  #, php-format
156
  msgid ""
157
  "You are receiving this message to confirm a change of e-mail address for "
@@ -159,22 +159,22 @@ msgid ""
159
  "\n"
160
  msgstr ""
161
 
162
- #: subscribe-to-comments.php:640
163
  #, php-format
164
  msgid ""
165
  "To change your e-mail address to %s, click this link:\n"
166
  "\n"
167
  msgstr ""
168
 
169
- #: subscribe-to-comments.php:642 subscribe-to-comments.php:654
170
  msgid "If you did not request this action, please disregard this message."
171
  msgstr ""
172
 
173
- #: subscribe-to-comments.php:650
174
  msgid "E-mail block confirmation"
175
  msgstr ""
176
 
177
- #: subscribe-to-comments.php:651
178
  #, php-format
179
  msgid ""
180
  "You are receiving this message to confirm that you no longer wish to receive "
@@ -182,85 +182,79 @@ msgid ""
182
  "\n"
183
  msgstr ""
184
 
185
- #: subscribe-to-comments.php:652
186
  msgid ""
187
  "To cancel all future notifications for this address, click this link:\n"
188
  "\n"
189
  msgstr ""
190
 
191
- #: subscribe-to-comments.php:686
192
  msgid "click here"
193
  msgstr ""
194
 
195
- #: subscribe-to-comments.php:708
196
  msgid "Notify me of followup comments via e-mail"
197
  msgstr ""
198
 
199
- #: subscribe-to-comments.php:708
200
  msgid ""
201
  "You are subscribed to this entry. <a href=\"[manager_link]\">Manage your "
202
  "subscriptions</a>."
203
  msgstr ""
204
 
205
- #: subscribe-to-comments.php:708
206
  msgid ""
207
  "You are the author of this entry. <a href=\"[manager_link]\">Manage "
208
  "subscriptions</a>."
209
  msgstr ""
210
 
211
- #: subscribe-to-comments.php:777 wp-subscription-manager.php:119
212
  msgid "Comment Subscription Manager"
213
  msgstr ""
214
 
215
- #: subscribe-to-comments.php:777 wp-subscription-manager.php:220
216
  msgid "Subscriptions"
217
  msgstr ""
218
 
219
- #: subscribe-to-comments.php:782
220
  msgid "Subscribe to Comments"
221
  msgstr ""
222
 
223
- #: wp-subscription-manager.php:9
224
- msgid ""
225
- "You must activate the \"Subscribe to Comments\" plugin in the WordPress "
226
- "admin panel"
227
- msgstr ""
228
-
229
- #: wp-subscription-manager.php:26
230
  msgid "You may not access this page without a valid key."
231
  msgstr ""
232
 
233
- #: wp-subscription-manager.php:34
234
  #, php-format
235
  msgid ""
236
  "All notifications that were formerly sent to <strong>%s</strong> will now be "
237
  "sent to <strong>%s</strong>!"
238
  msgstr ""
239
 
240
- #: wp-subscription-manager.php:46
241
  #, php-format
242
  msgid "<strong>%s</strong> %s removed successfully."
243
  msgstr ""
244
 
245
- #: wp-subscription-manager.php:46
246
  msgid "subscriptions"
247
  msgstr ""
248
 
249
- #: wp-subscription-manager.php:46
250
  msgid "subscription"
251
  msgstr ""
252
 
253
- #: wp-subscription-manager.php:51
254
  #, php-format
255
  msgid "The block on <strong>%s</strong> has been successfully removed."
256
  msgstr ""
257
 
258
- #: wp-subscription-manager.php:53
259
  #, php-format
260
  msgid "<strong>%s</strong> isn't blocked!"
261
  msgstr ""
262
 
263
- #: wp-subscription-manager.php:58
264
  #, php-format
265
  msgid ""
266
  "<strong>%s</strong> has been blocked from receiving notifications. You will "
@@ -268,14 +262,14 @@ msgid ""
268
  "change your notification address."
269
  msgstr ""
270
 
271
- #: wp-subscription-manager.php:61
272
  #, php-format
273
  msgid ""
274
  "Your change of e-mail request was successfully received. Please check your "
275
  "old account (<strong>%s</strong>) in order to confirm the change."
276
  msgstr ""
277
 
278
- #: wp-subscription-manager.php:66
279
  #, php-format
280
  msgid ""
281
  "Your request to block <strong>%s</strong> from receiving any further "
@@ -284,12 +278,12 @@ msgid ""
284
  "sent to you."
285
  msgstr ""
286
 
287
- #: wp-subscription-manager.php:70
288
  #, php-format
289
  msgid "<strong>%s</strong> has been successfully subscribed to %s"
290
  msgstr ""
291
 
292
- #: wp-subscription-manager.php:75
293
  #, php-format
294
  msgid ""
295
  "<strong>%s</strong> has been added to the \"do not mail\" list. You will no "
@@ -298,41 +292,41 @@ msgid ""
298
  "this block."
299
  msgstr ""
300
 
301
- #: wp-subscription-manager.php:77
302
  #, php-format
303
  msgid "<strong>%s</strong> has already been blocked!"
304
  msgstr ""
305
 
306
- #: wp-subscription-manager.php:94
307
  #, php-format
308
  msgid "%s Comment Subscription Manager"
309
  msgstr ""
310
 
311
- #: wp-subscription-manager.php:122
312
  #, php-format
313
  msgid "Return to the page you were viewing: %s"
314
  msgstr ""
315
 
316
- #: wp-subscription-manager.php:133
317
  msgid "Remove Block"
318
  msgstr ""
319
 
320
- #: wp-subscription-manager.php:136
321
  #, php-format
322
  msgid ""
323
  "Click the button below to remove the block on <strong>%s</strong>. This "
324
  "should only be done if the user has specifically requested it."
325
  msgstr ""
326
 
327
- #: wp-subscription-manager.php:144
328
  msgid "Remove Block &raquo;"
329
  msgstr ""
330
 
331
- #: wp-subscription-manager.php:152
332
  msgid "Blocked"
333
  msgstr ""
334
 
335
- #: wp-subscription-manager.php:155
336
  #, php-format
337
  msgid ""
338
  "You have indicated that you do not wish to receive any notifications at "
@@ -341,29 +335,59 @@ msgid ""
341
  "administrator</a>."
342
  msgstr ""
343
 
344
- #: wp-subscription-manager.php:169
345
  #, php-format
346
  msgid "<strong>%s</strong> is not subscribed to any posts on this site."
347
  msgstr ""
348
 
349
- #: wp-subscription-manager.php:171
350
  #, php-format
351
  msgid "<strong>%s</strong> is not a valid e-mail address."
352
  msgstr ""
353
 
354
- #: wp-subscription-manager.php:183
 
 
 
 
355
  msgid "Find Subscriptions"
356
  msgstr ""
357
 
358
- #: wp-subscription-manager.php:186
359
  msgid "Enter an e-mail address to view its subscriptions or undo a block."
360
  msgstr ""
361
 
362
- #: wp-subscription-manager.php:194
363
  msgid "Search &raquo;"
364
  msgstr ""
365
 
366
- #: wp-subscription-manager.php:223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
367
  #, php-format
368
  msgid ""
369
  "<strong>%s</strong> is subscribed to the posts listed below. To unsubscribe "
@@ -371,23 +395,23 @@ msgid ""
371
  "\"Remove Selected Subscription(s)\" at the bottom of the list."
372
  msgstr ""
373
 
374
- #: wp-subscription-manager.php:237
375
  msgid "Invert Checkbox Selection"
376
  msgstr ""
377
 
378
- #: wp-subscription-manager.php:241
379
  msgid "Remove Selected Subscription(s) &raquo;"
380
  msgstr ""
381
 
382
- #: wp-subscription-manager.php:248
383
  msgid "Advanced Options"
384
  msgstr ""
385
 
386
- #: wp-subscription-manager.php:251
387
  msgid "Block All Notifications"
388
  msgstr ""
389
 
390
- #: wp-subscription-manager.php:258
391
  #, php-format
392
  msgid ""
393
  "If you would like <strong>%s</strong> to be blocked from receiving any "
@@ -396,15 +420,15 @@ msgid ""
396
  "your consent."
397
  msgstr ""
398
 
399
- #: wp-subscription-manager.php:262
400
  msgid "Block Notifications &raquo;"
401
  msgstr ""
402
 
403
- #: wp-subscription-manager.php:268
404
  msgid "Change E-mail Address"
405
  msgstr ""
406
 
407
- #: wp-subscription-manager.php:275
408
  #, php-format
409
  msgid ""
410
  "If you would like to change the e-mail address for your subscriptions, enter "
@@ -412,10 +436,10 @@ msgid ""
412
  "clicking a special link sent to your current address (<strong>%s</strong>)."
413
  msgstr ""
414
 
415
- #: wp-subscription-manager.php:279
416
  msgid "New E-mail Address:"
417
  msgstr ""
418
 
419
- #: wp-subscription-manager.php:284
420
  msgid "Change E-mail Address &raquo;"
421
  msgstr ""
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Subscribe to Comments 2.0\n"
4
+ "POT-Creation-Date: 2007-01-23 07:01-0500\n"
5
  "Last-Translator: Mark Jaquith <mark.i18n@txfx.net>\n"
6
  "Language-Team: Mark Jaquith <mark.wordpress@txfx.net>\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=utf-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
 
11
+ #: subscribe-to-comments.php:68
12
  msgid "<strong>Error: </strong>"
13
  msgstr ""
14
 
15
+ #: subscribe-to-comments.php:83
16
  msgid "Subscribe without commenting"
17
  msgstr ""
18
 
19
+ #: subscribe-to-comments.php:85
20
  msgid "E-Mail:"
21
  msgstr ""
22
 
23
+ #: subscribe-to-comments.php:87
24
  msgid "Subscribe"
25
  msgstr ""
26
 
27
+ #: subscribe-to-comments.php:141
28
  msgid "\"From\" name for notifications:"
29
  msgstr ""
30
 
31
+ #: subscribe-to-comments.php:142
32
  msgid "\"From\" e-mail addresss for notifications:"
33
  msgstr ""
34
 
35
+ #: subscribe-to-comments.php:143
36
  msgid "\"Subscribe\" box should be checked by default"
37
  msgstr ""
38
 
39
+ #: subscribe-to-comments.php:144
40
  msgid ""
41
  "Do a CSS \"clear\" on the subscription checkbox/message (uncheck this if the "
42
  "checkbox/message appears in a strange location in your theme)"
43
  msgstr ""
44
 
45
+ #: subscribe-to-comments.php:147
46
  msgid "Comment Form Text"
47
  msgstr ""
48
 
49
+ #: subscribe-to-comments.php:149
50
  msgid ""
51
  "Customize the messages shown to different people. Use <code>[manager_link]</"
52
  "code> to insert the URI to the Subscription Manager."
53
  msgstr ""
54
 
55
+ #: subscribe-to-comments.php:153
56
  msgid "Not subscribed"
57
  msgstr ""
58
 
59
+ #: subscribe-to-comments.php:155
60
  msgid "Subscribed"
61
  msgstr ""
62
 
63
+ #: subscribe-to-comments.php:157
64
  msgid "Entry Author"
65
  msgstr ""
66
 
67
+ #: subscribe-to-comments.php:163
68
  msgid "Use custom style for Subscription Manager"
69
  msgstr ""
70
 
71
+ #: subscribe-to-comments.php:165
72
  msgid ""
73
  "These settings only matter if you are using a custom style. <code>"
74
  "[theme_path]</code> will be replaced with the path to your current theme."
75
  msgstr ""
76
 
77
+ #: subscribe-to-comments.php:168
78
  msgid "Path to header:"
79
  msgstr ""
80
 
81
+ #: subscribe-to-comments.php:169
82
  msgid "Path to sidebar:"
83
  msgstr ""
84
 
85
+ #: subscribe-to-comments.php:170
86
  msgid "Path to footer:"
87
  msgstr ""
88
 
89
+ #: subscribe-to-comments.php:173
90
  msgid "HTML for before the subscription manager:"
91
  msgstr ""
92
 
93
+ #: subscribe-to-comments.php:174
94
  msgid "HTML for after the subscription manager:"
95
  msgstr ""
96
 
97
+ #: subscribe-to-comments.php:199
98
  msgid "Options saved."
99
  msgstr ""
100
 
101
+ #: subscribe-to-comments.php:206
102
  msgid "Update Options &raquo;"
103
  msgstr ""
104
 
105
+ #: subscribe-to-comments.php:377
106
  msgid "Please provide a valid e-mail address."
107
  msgstr ""
108
 
109
+ #: subscribe-to-comments.php:381
110
  msgid "This e-mail address may not be subscribed"
111
  msgstr ""
112
 
113
+ #: subscribe-to-comments.php:387 subscribe-to-comments.php:403
114
  msgid "You appear to be already subscribed to this entry."
115
  msgstr ""
116
 
117
+ #: subscribe-to-comments.php:393
118
  msgid "Comments are not allowed on this entry."
119
  msgstr ""
120
 
121
+ #: subscribe-to-comments.php:597
122
  #, php-format
123
  msgid "There is a new comment on the post \"%s\""
124
  msgstr ""
125
 
126
+ #: subscribe-to-comments.php:598
127
  #, php-format
128
  msgid "Author: %s\n"
129
  msgstr ""
130
 
131
+ #: subscribe-to-comments.php:599
132
  msgid "Comment:\n"
133
  msgstr ""
134
 
135
+ #: subscribe-to-comments.php:600
136
  msgid "See all comments on this post here:\n"
137
  msgstr ""
138
 
139
+ #: subscribe-to-comments.php:603
140
  msgid ""
141
  "To manage your subscriptions or to block all notifications from this site, "
142
  "click the link below:\n"
143
  msgstr ""
144
 
145
+ #: subscribe-to-comments.php:606
146
  #, php-format
147
  msgid "New Comment On: %s"
148
  msgstr ""
149
 
150
+ #: subscribe-to-comments.php:625
151
  msgid "E-mail change confirmation"
152
  msgstr ""
153
 
154
+ #: subscribe-to-comments.php:626
155
  #, php-format
156
  msgid ""
157
  "You are receiving this message to confirm a change of e-mail address for "
159
  "\n"
160
  msgstr ""
161
 
162
+ #: subscribe-to-comments.php:627
163
  #, php-format
164
  msgid ""
165
  "To change your e-mail address to %s, click this link:\n"
166
  "\n"
167
  msgstr ""
168
 
169
+ #: subscribe-to-comments.php:629 subscribe-to-comments.php:641
170
  msgid "If you did not request this action, please disregard this message."
171
  msgstr ""
172
 
173
+ #: subscribe-to-comments.php:637
174
  msgid "E-mail block confirmation"
175
  msgstr ""
176
 
177
+ #: subscribe-to-comments.php:638
178
  #, php-format
179
  msgid ""
180
  "You are receiving this message to confirm that you no longer wish to receive "
182
  "\n"
183
  msgstr ""
184
 
185
+ #: subscribe-to-comments.php:639
186
  msgid ""
187
  "To cancel all future notifications for this address, click this link:\n"
188
  "\n"
189
  msgstr ""
190
 
191
+ #: subscribe-to-comments.php:679
192
  msgid "click here"
193
  msgstr ""
194
 
195
+ #: subscribe-to-comments.php:701
196
  msgid "Notify me of followup comments via e-mail"
197
  msgstr ""
198
 
199
+ #: subscribe-to-comments.php:701
200
  msgid ""
201
  "You are subscribed to this entry. <a href=\"[manager_link]\">Manage your "
202
  "subscriptions</a>."
203
  msgstr ""
204
 
205
+ #: subscribe-to-comments.php:701
206
  msgid ""
207
  "You are the author of this entry. <a href=\"[manager_link]\">Manage "
208
  "subscriptions</a>."
209
  msgstr ""
210
 
211
+ #: subscribe-to-comments.php:780 subscribe-to-comments.php:946
212
  msgid "Comment Subscription Manager"
213
  msgstr ""
214
 
215
+ #: subscribe-to-comments.php:780 subscribe-to-comments.php:1124
216
  msgid "Subscriptions"
217
  msgstr ""
218
 
219
+ #: subscribe-to-comments.php:785
220
  msgid "Subscribe to Comments"
221
  msgstr ""
222
 
223
+ #: subscribe-to-comments.php:854
 
 
 
 
 
 
224
  msgid "You may not access this page without a valid key."
225
  msgstr ""
226
 
227
+ #: subscribe-to-comments.php:862
228
  #, php-format
229
  msgid ""
230
  "All notifications that were formerly sent to <strong>%s</strong> will now be "
231
  "sent to <strong>%s</strong>!"
232
  msgstr ""
233
 
234
+ #: subscribe-to-comments.php:874
235
  #, php-format
236
  msgid "<strong>%s</strong> %s removed successfully."
237
  msgstr ""
238
 
239
+ #: subscribe-to-comments.php:874
240
  msgid "subscriptions"
241
  msgstr ""
242
 
243
+ #: subscribe-to-comments.php:874
244
  msgid "subscription"
245
  msgstr ""
246
 
247
+ #: subscribe-to-comments.php:879
248
  #, php-format
249
  msgid "The block on <strong>%s</strong> has been successfully removed."
250
  msgstr ""
251
 
252
+ #: subscribe-to-comments.php:881
253
  #, php-format
254
  msgid "<strong>%s</strong> isn't blocked!"
255
  msgstr ""
256
 
257
+ #: subscribe-to-comments.php:886
258
  #, php-format
259
  msgid ""
260
  "<strong>%s</strong> has been blocked from receiving notifications. You will "
262
  "change your notification address."
263
  msgstr ""
264
 
265
+ #: subscribe-to-comments.php:889
266
  #, php-format
267
  msgid ""
268
  "Your change of e-mail request was successfully received. Please check your "
269
  "old account (<strong>%s</strong>) in order to confirm the change."
270
  msgstr ""
271
 
272
+ #: subscribe-to-comments.php:894
273
  #, php-format
274
  msgid ""
275
  "Your request to block <strong>%s</strong> from receiving any further "
278
  "sent to you."
279
  msgstr ""
280
 
281
+ #: subscribe-to-comments.php:898
282
  #, php-format
283
  msgid "<strong>%s</strong> has been successfully subscribed to %s"
284
  msgstr ""
285
 
286
+ #: subscribe-to-comments.php:903
287
  #, php-format
288
  msgid ""
289
  "<strong>%s</strong> has been added to the \"do not mail\" list. You will no "
292
  "this block."
293
  msgstr ""
294
 
295
+ #: subscribe-to-comments.php:905
296
  #, php-format
297
  msgid "<strong>%s</strong> has already been blocked!"
298
  msgstr ""
299
 
300
+ #: subscribe-to-comments.php:921
301
  #, php-format
302
  msgid "%s Comment Subscription Manager"
303
  msgstr ""
304
 
305
+ #: subscribe-to-comments.php:949
306
  #, php-format
307
  msgid "Return to the page you were viewing: %s"
308
  msgstr ""
309
 
310
+ #: subscribe-to-comments.php:960
311
  msgid "Remove Block"
312
  msgstr ""
313
 
314
+ #: subscribe-to-comments.php:963
315
  #, php-format
316
  msgid ""
317
  "Click the button below to remove the block on <strong>%s</strong>. This "
318
  "should only be done if the user has specifically requested it."
319
  msgstr ""
320
 
321
+ #: subscribe-to-comments.php:971
322
  msgid "Remove Block &raquo;"
323
  msgstr ""
324
 
325
+ #: subscribe-to-comments.php:979
326
  msgid "Blocked"
327
  msgstr ""
328
 
329
+ #: subscribe-to-comments.php:982
330
  #, php-format
331
  msgid ""
332
  "You have indicated that you do not wish to receive any notifications at "
335
  "administrator</a>."
336
  msgstr ""
337
 
338
+ #: subscribe-to-comments.php:997
339
  #, php-format
340
  msgid "<strong>%s</strong> is not subscribed to any posts on this site."
341
  msgstr ""
342
 
343
+ #: subscribe-to-comments.php:999
344
  #, php-format
345
  msgid "<strong>%s</strong> is not a valid e-mail address."
346
  msgstr ""
347
 
348
+ #: subscribe-to-comments.php:1012
349
+ msgid "&laquo; Back"
350
+ msgstr ""
351
+
352
+ #: subscribe-to-comments.php:1015
353
  msgid "Find Subscriptions"
354
  msgstr ""
355
 
356
+ #: subscribe-to-comments.php:1018
357
  msgid "Enter an e-mail address to view its subscriptions or undo a block."
358
  msgstr ""
359
 
360
+ #: subscribe-to-comments.php:1026
361
  msgid "Search &raquo;"
362
  msgstr ""
363
 
364
+ #: subscribe-to-comments.php:1034
365
+ msgid "Top Subscriber List"
366
+ msgstr ""
367
+
368
+ #: subscribe-to-comments.php:1036
369
+ msgid "Subscriber List"
370
+ msgstr ""
371
+
372
+ #: subscribe-to-comments.php:1055
373
+ msgid "Show all subscribers"
374
+ msgstr ""
375
+
376
+ #: subscribe-to-comments.php:1057
377
+ msgid ""
378
+ "Show list of subscribers in <code>CC:</code>-field format (for bulk e-"
379
+ "mailing)"
380
+ msgstr ""
381
+
382
+ #: subscribe-to-comments.php:1059
383
+ msgid "&laquo; Back to regular view"
384
+ msgstr ""
385
+
386
+ #: subscribe-to-comments.php:1074
387
+ msgid "Top Subscribed Posts"
388
+ msgstr ""
389
+
390
+ #: subscribe-to-comments.php:1127
391
  #, php-format
392
  msgid ""
393
  "<strong>%s</strong> is subscribed to the posts listed below. To unsubscribe "
395
  "\"Remove Selected Subscription(s)\" at the bottom of the list."
396
  msgstr ""
397
 
398
+ #: subscribe-to-comments.php:1141
399
  msgid "Invert Checkbox Selection"
400
  msgstr ""
401
 
402
+ #: subscribe-to-comments.php:1145
403
  msgid "Remove Selected Subscription(s) &raquo;"
404
  msgstr ""
405
 
406
+ #: subscribe-to-comments.php:1152
407
  msgid "Advanced Options"
408
  msgstr ""
409
 
410
+ #: subscribe-to-comments.php:1155
411
  msgid "Block All Notifications"
412
  msgstr ""
413
 
414
+ #: subscribe-to-comments.php:1162
415
  #, php-format
416
  msgid ""
417
  "If you would like <strong>%s</strong> to be blocked from receiving any "
420
  "your consent."
421
  msgstr ""
422
 
423
+ #: subscribe-to-comments.php:1166
424
  msgid "Block Notifications &raquo;"
425
  msgstr ""
426
 
427
+ #: subscribe-to-comments.php:1172
428
  msgid "Change E-mail Address"
429
  msgstr ""
430
 
431
+ #: subscribe-to-comments.php:1179
432
  #, php-format
433
  msgid ""
434
  "If you would like to change the e-mail address for your subscriptions, enter "
436
  "clicking a special link sent to your current address (<strong>%s</strong>)."
437
  msgstr ""
438
 
439
+ #: subscribe-to-comments.php:1183
440
  msgid "New E-mail Address:"
441
  msgstr ""
442
 
443
+ #: subscribe-to-comments.php:1188
444
  msgid "Change E-mail Address &raquo;"
445
  msgstr ""
readme.txt CHANGED
@@ -1,16 +1,22 @@
1
  === Subscribe to Comments ===
2
- Tags: comments, subscription
3
  Contributors: markjaquith
 
 
 
4
 
5
- Subscribe to Comments 2 is a WordPress plugin that allows commenters on an entry to subscribe to e-mail notifications for subsequent comments. It does NOT e-mail you new blog posts. For that functionality, use Skippy's Subscribe2 plugin.
 
 
 
 
6
 
7
  == Installation ==
8
 
9
  1. Put subscribe-to-comments.php into [wordpress_dir]/wp-content/plugins/
10
- 2. Put wp-subscription-manager.php into your blog's root WordPress directory (the directory where wp-config.php resides)
11
- 3. Go into the WordPress admin interface and activate the plugin
12
- 4. Optional: if your WordPress 1.5 theme doesn't have the comment_form hook, or if you would like to manually determine where in your comments form the subscribe checkbox appears, enter this where you would like it: <?php show_subscription_checkbox(); ?>
13
- 5. Optional: If you would like to enable users to subscribe to comments without having to leave a comment, place this somewhere in your template, but make sure it is <strong>outside the comments form</strong>. A good place would be right after the ending </form> tag for the comments form: <?php show_manual_subscription_form(); ?>
14
 
15
  == Frequently Asked Questions ==
16
 
@@ -18,7 +24,7 @@ Subscribe to Comments 2 is a WordPress plugin that allows commenters on an entry
18
 
19
  1. Log out of WordPress
20
  2. Leave a comment on an entry and check the comment subscription box, using an e-mail that is NOT the WP admin e-mail address or the e-mail address of the author of the post.
21
- 3. Leave a second comment (don't have to subscribed) using any old e-mail address
22
  4. This should trigger a notification to the first address you used.
23
 
24
  = I'd like the subscription checkbox to be checked by default. Can I do that? =
@@ -27,4 +33,4 @@ By default, the "subscribe" checkbox is unchecked, but you can change that in th
27
 
28
  = My subscription checkbox shows up in a strange place. How do I fix it? =
29
 
30
- Try unchecking the CSS "clear" option.
1
  === Subscribe to Comments ===
2
+ Tags: comments, subscription, email
3
  Contributors: markjaquith
4
+ Requires at least: 2.0
5
+ Tested up to: 2.1
6
+ Stable tag: trunk
7
 
8
+ Subscribe to Comments allows commenters on an entry to subscribe to e-mail notifications for subsequent comments.
9
+
10
+ == Description ==
11
+
12
+ Subscribe to Comments is a robust plugin that enables commenters to sign up for e-mail notification of subsequent entries. The plugin includes a full-featured subscription manager that your commenters can use to unsubscribe to certain posts, block all notifications, or even change their notification e-mail address!
13
 
14
  == Installation ==
15
 
16
  1. Put subscribe-to-comments.php into [wordpress_dir]/wp-content/plugins/
17
+ 2. Go into the WordPress admin interface and activate the plugin
18
+ 3. Optional: if your WordPress theme doesn't have the comment_form hook, or if you would like to manually determine where in your comments form the subscribe checkbox appears, enter this where you would like it: `<?php show_subscription_checkbox(); ?>`
19
+ 4. Optional: If you would like to enable users to subscribe to comments without having to first leave a comment, place this somewhere in your template, but make sure it is **outside the comments form**. A good place would be right after the ending `</form>` tag for the comments form: `<?php show_manual_subscription_form(); ?>`
 
20
 
21
  == Frequently Asked Questions ==
22
 
24
 
25
  1. Log out of WordPress
26
  2. Leave a comment on an entry and check the comment subscription box, using an e-mail that is NOT the WP admin e-mail address or the e-mail address of the author of the post.
27
+ 3. Leave a second comment using a different e-mail address than the one you used in step 2 (it can be a bogus address).
28
  4. This should trigger a notification to the first address you used.
29
 
30
  = I'd like the subscription checkbox to be checked by default. Can I do that? =
33
 
34
  = My subscription checkbox shows up in a strange place. How do I fix it? =
35
 
36
+ Try unchecking the CSS "clear" option. Beyond that, you're on your own with CSS positioning.
subscribe-to-comments.php CHANGED
@@ -1,27 +1,14 @@
1
  <?php
2
  /*
3
  Plugin Name: Subscribe To Comments
4
- Version: 2.0.8
5
  Plugin URI: http://txfx.net/code/wordpress/subscribe-to-comments/
6
  Description: Allows readers to recieve notifications of new comments that are posted to an entry. Based on version 1 from <a href="http://scriptygoddess.com/">Scriptygoddess</a>
7
  Author: Mark Jaquith
8
  Author URI: http://txfx.net/
9
  */
10
 
11
-
12
-
13
- /* ================= */
14
- /* Display Functions */
15
- /* ================= */
16
-
17
- /* -------------------------
18
- What follows are the functions that display things in your comments form.
19
- Feel free to customize them to your needs
20
- ------------------------- */
21
-
22
- /* -------------------------
23
- This is the code that is inserted into your comment form. You may modify it, if you wish.
24
- ------------------------- */
25
  function show_subscription_checkbox ($id='0') {
26
  global $sg_subscribe;
27
  sg_subscribe_start();
@@ -75,7 +62,7 @@ return $id;
75
  /* Place this somewhere within "the loop", but NOT within another form */
76
  /* This is NOT inserted automaticallly... you must place it yourself */
77
  /* -------------------------------------------------------------------- */
78
- function show_manual_subscription_form () {
79
  global $id, $sg_subscribe, $user_email;
80
  sg_subscribe_start();
81
  $sg_subscribe->show_errors('solo_subscribe', '<div class="solo-subscribe-errors">', '</div>', __('<strong>Error: </strong>', 'subscribe-to-comments'), '<br />');
@@ -87,10 +74,10 @@ if ( !$sg_subscribe->current_viewer_subscription_status() ) :
87
  <?php /* This is the text that is displayed for users who are NOT subscribed */ ?>
88
  <?php /* ------------------------------------------------------------------- */ ?>
89
 
90
- <form action="http://<?php echo $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI']); ?>" method="post">
91
  <input type="hidden" name="solo-comment-subscribe" value="solo-comment-subscribe" />
92
  <input type="hidden" name="postid" value="<?php echo $id; ?>" />
93
- <input type="hidden" name="ref" value="<?php echo urlencode('http://' . $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI'])); ?>" />
94
 
95
  <p class="solo-subscribe-to-comments">
96
  <?php _e('Subscribe without commenting', 'subscribe-to-comments'); ?>
@@ -126,19 +113,28 @@ return false;
126
 
127
 
128
 
 
 
 
 
 
 
 
 
129
  /* ============================= */
130
  /* DO NOT MODIFY BELOW THIS LINE */
131
  /* ============================= */
132
 
133
- class sg_subscribe_settings
134
- {
135
- function options_page_contents()
136
- {
137
  /** Commit changed options if posted **/
138
- if($_SERVER['REQUEST_METHOD'] == 'POST')
139
- {
 
140
  update_option('sg_subscribe_settings', $_POST['sg_subscribe_settings']);
141
  }
 
 
142
  echo '<h2>Subscribe to Comments Options</h2>';
143
  echo '<ul>';
144
 
@@ -163,12 +159,6 @@ class sg_subscribe_settings
163
  echo '</ul></fieldset>';
164
 
165
 
166
-
167
-
168
-
169
-
170
-
171
-
172
  echo '<fieldset>';
173
  echo '<legend><input type="checkbox" id="use_custom_style" name="sg_subscribe_settings[use_custom_style]" value="use_custom_style"' . sg_subscribe_settings::checkflag('use_custom_style') . ' /> <label for="use_custom_style">' . __('Use custom style for Subscription Manager', 'subscribe-to-comments') . '</label></legend>';
174
 
@@ -215,6 +205,10 @@ class sg_subscribe_settings
215
  echo '<p class="submit"><input type="submit" name="sg_subscribe_settings_submit" value="';
216
  _e('Update Options &raquo;', 'subscribe-to-comments');
217
  echo '" /></p></div>';
 
 
 
 
218
  echo '</form>';
219
  }
220
 
@@ -296,10 +290,9 @@ class sg_subscribe {
296
  $this->form_action = 'edit.php?page=' . STC_PLUGIN_BASENAME;
297
 
298
 
299
- foreach (array('email', 'key', 'ref', 'new_email') as $var) {
300
  if ( isset($_REQUEST[$var]) && !empty($_REQUEST[$var]) )
301
- $this->{$var} = wp_specialchars(trim($_REQUEST[$var]));
302
- }
303
  if ( !$this->key )
304
  $this->key = 'unset';
305
  }
@@ -338,15 +331,14 @@ class sg_subscribe {
338
 
339
 
340
  function subscriptions_from_post($postid) {
341
- if ( is_array($this->post_subscriptions) ) return $this->post_subscriptions;
 
342
  global $wpdb;
343
  $postid = (int) $postid;
344
  $this->post_subscriptions = $wpdb->get_results("SELECT comment_author_email FROM $wpdb->comments WHERE comment_post_ID = '$postid' AND comment_subscribe='Y' AND comment_author_email != '' AND comment_approved = '1' GROUP BY LCASE(comment_author_email)");
345
  $subscribed_without_comment = get_post_meta($postid, '_sg_subscribe-to-comments');
346
- if ( is_array($subscribed_without_comment) ) {
347
- foreach ( $subscribed_without_comment as $email )
348
- $this->post_subscriptions[]->comment_author_email = $email;
349
- }
350
  return $this->post_subscriptions;
351
  }
352
 
@@ -358,26 +350,17 @@ class sg_subscribe {
358
  $email = $this->email;
359
  global $wpdb;
360
  $email = $wpdb->escape(strtolower($email));
361
- $i = 0;
362
  $subscriptions = $wpdb->get_results("SELECT comment_post_ID FROM $wpdb->comments WHERE LCASE(comment_author_email) = '$email' AND comment_subscribe='Y' AND comment_approved = '1' GROUP BY comment_post_ID");
363
- if ( is_array($subscriptions) ) {
364
- foreach ( $subscriptions as $subscription ) {
365
- $this->email_subscriptions[$i] = $subscription->comment_post_ID;
366
- $i++;
367
- }
368
- }
369
  $subscriptions = $wpdb->get_results("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_sg_subscribe-to-comments' AND LCASE(meta_value) = '$email' GROUP BY post_id");
370
- if ( is_array($subscriptions) ) {
371
- foreach ($subscriptions as $subscription) {
372
- $this->email_subscriptions[$i] = $subscription->post_id;
373
- $i++;
374
- }
375
- }
376
- if ( $i > 0 ) {
377
  sort($this->email_subscriptions, SORT_NUMERIC);
378
  return $this->email_subscriptions;
379
  }
380
- // no subscriptions
381
  return false;
382
  }
383
 
@@ -398,7 +381,7 @@ class sg_subscribe {
398
  $this->add_error(__('This e-mail address may not be subscribed', 'subscribe-to-comments'),'solo_subscribe');
399
 
400
  if ( is_array($this->subscriptions_from_email($email)) )
401
- if (in_array($postid, $this->subscriptions_from_email($email))) {
402
  // already subscribed
403
  setcookie('comment_author_email_' . COOKIEHASH, stripslashes($email), time() + 30000000, COOKIEPATH);
404
  $this->add_error(__('You appear to be already subscribed to this entry.', 'subscribe-to-comments'),'solo_subscribe');
@@ -435,7 +418,7 @@ class sg_subscribe {
435
  $email = $wpdb->escape(strtolower($wpdb->get_var("SELECT comment_author_email FROM $wpdb->comments WHERE comment_ID = '$cid'")));
436
  $postid = $wpdb->get_var("SELECT comment_post_ID from $wpdb->comments WHERE comment_ID = '$cid'");
437
 
438
- $previously_subscribed = ( $wpdb->get_var("SELECT comment_subscribe from $wpdb->comments WHERE comment_post_ID = '$postid' AND LCASE(comment_author_email) = '$email' AND comment_subscribe = 'Y' LIMIT 1") || in_array(stripslashes($email), get_post_meta($postid, '_sg_subscribe-to-comments')) ) ? true : false;
439
 
440
  // If user wants to be notified or has previously subscribed, set the flag on this current comment
441
  if (($_POST['subscribe'] == 'subscribe' && is_email($email)) || $previously_subscribed) {
@@ -455,7 +438,7 @@ class sg_subscribe {
455
  $email = strtolower($email);
456
  // add the option if it doesn't exist
457
  add_option('do_not_mail', '');
458
- $blocked = explode (' ', get_settings('do_not_mail'));
459
  if ( in_array($email, $blocked) )
460
  return true;
461
  return false;
@@ -514,7 +497,7 @@ class sg_subscribe {
514
  $subscriber_emails = array();
515
 
516
  // We run the comment loop, and put each unique subscriber into a new array
517
- foreach ( $comments as $comment ) {
518
  if ( comment_subscription_status() && !in_array($comment->comment_author_email, $subscriber_emails) ) {
519
  $sg_subscribers[] = $comment;
520
  $subscriber_emails[] = $comment->comment_author_email;
@@ -618,20 +601,18 @@ class sg_subscribe {
618
  $message .= get_permalink($comment->comment_post_ID) . "#comments\n\n";
619
  //add link to manage comment notifications
620
  $message .= __("To manage your subscriptions or to block all notifications from this site, click the link below:\n", 'subscribe-to-comments');
621
- $message .= get_settings('siteurl')."/wp-subscription-manager.php?email=[email]&key=[key]";
622
 
623
  $subject = sprintf(__('New Comment On: %s', 'subscribe-to-comments'), stripslashes($post->post_title));
624
 
625
  $subscriptions = $this->subscriptions_from_post($comment->comment_post_ID);
626
- if ( is_array($subscriptions) ) {
627
- foreach ( $subscriptions as $email ) {
628
- if ( !$this->is_blocked($email->comment_author_email) && $email->comment_author_email != $comment->comment_author_email && is_email($email->comment_author_email) ) {
629
- $message_final = str_replace('[email]', urlencode($email->comment_author_email), $message);
630
- $message_final = str_replace('[key]', $this->generate_key($email->comment_author_email), $message_final);
631
- $this->send_mail($email->comment_author_email, $subject, $message_final);
632
- }
633
- } // foreach subscription
634
- } // if subscriptions
635
  } // end if comment approved
636
  return $cid;
637
  }
@@ -644,7 +625,7 @@ class sg_subscribe {
644
  $subject = __('E-mail change confirmation', 'subscribe-to-comments');
645
  $message = sprintf(__("You are receiving this message to confirm a change of e-mail address for your subscriptions at \"%s\"\n\n", 'subscribe-to-comments'), get_bloginfo('blogname'));
646
  $message .= sprintf(__("To change your e-mail address to %s, click this link:\n\n", 'subscribe-to-comments'), $this->new_email);
647
- $message .= get_bloginfo('wpurl') . "/wp-subscription-manager.php?email=" . urlencode($this->email) . "&new_email=" . urlencode($this->new_email) . "&key=" . $this->generate_key($this->email . $this->new_email) . ".\n\n";
648
  $message .= __('If you did not request this action, please disregard this message.', 'subscribe-to-comments');
649
  return $this->send_mail($this->email, $subject, $message);
650
  }
@@ -656,7 +637,7 @@ class sg_subscribe {
656
  $subject = __('E-mail block confirmation', 'subscribe-to-comments');
657
  $message = sprintf(__("You are receiving this message to confirm that you no longer wish to receive e-mail comment notifications from \"%s\"\n\n", 'subscribe-to-comments'), get_bloginfo('name'));
658
  $message .= __("To cancel all future notifications for this address, click this link:\n\n", 'subscribe-to-comments');
659
- $message .= get_bloginfo('wpurl') . "/wp-subscription-manager.php?email=" . urlencode($email) . "&key=" . $this->generate_key($email . 'blockrequest') . "&blockemailconfirm=true" . ".\n\n";
660
  $message .= __("If you did not request this action, please disregard this message.", 'subscribe-to-comments');
661
  return $this->send_mail($email, $subject, $message);
662
  }
@@ -664,8 +645,15 @@ class sg_subscribe {
664
 
665
  function send_mail($to, $subject, $message) {
666
  $subject = '[' . get_bloginfo('name') . '] ' . $subject;
667
- $headers = "From: ".$this->site_name." <".$this->site_email.">\n";
668
- $headers .= "MIME-Version: 1.0\n" . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
 
 
 
 
 
 
 
669
  return wp_mail($to, $subject, $message, $headers);
670
  }
671
 
@@ -678,7 +666,6 @@ class sg_subscribe {
678
  $return = true;
679
  if ( $wpdb->query("UPDATE $wpdb->postmeta SET meta_value = '$new_email' WHERE meta_value = '$email' AND meta_key = '_sg_subscribe-to-comments'") )
680
  $return = true;
681
-
682
  return $return;
683
  }
684
 
@@ -729,7 +716,7 @@ class sg_subscribe {
729
  update_option('sg_subscribe_settings', $settings);
730
 
731
  $column_name = 'comment_subscribe';
732
- foreach ($wpdb->get_col("DESC $wpdb->comments", 0) as $column )
733
  if ($column == $column_name)
734
  return true;
735
 
@@ -758,18 +745,19 @@ class sg_subscribe {
758
  return 'admin';
759
 
760
  if ( is_array($this->subscriptions_from_email($email)) )
761
- if ( in_array($post->ID, $this->email_subscriptions) ) return $email;
 
762
  return false;
763
  }
764
 
765
 
766
  function manage_link($email='', $html=true, $echo=true) {
767
- $link = get_bloginfo('wpurl') . '/wp-subscription-manager.php';
768
  if ( $email != 'admin' ) {
769
  $link = add_query_arg('email', urlencode(urlencode($email)), $link);
770
  $link = add_query_arg('key', $this->generate_key($email), $link);
771
  }
772
- $link = add_query_arg('ref', urlencode('http://' . $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI'])), $link);
773
  $link = str_replace('+', '%2B', $link);
774
  if ( $html )
775
  $link = htmlentities($link);
@@ -779,6 +767,15 @@ class sg_subscribe {
779
  }
780
 
781
 
 
 
 
 
 
 
 
 
 
782
  function add_admin_menu() {
783
  add_management_page(__('Comment Subscription Manager', 'subscribe-to-comments'), __('Subscriptions', 'subscribe-to-comments'), 8, __FILE__, 'sg_subscribe_admin');
784
 
@@ -796,10 +793,6 @@ class sg_subscribe {
796
 
797
 
798
 
799
-
800
-
801
-
802
-
803
  function sg_subscribe_start() {
804
  global $sg_subscribe;
805
 
@@ -809,11 +802,6 @@ function sg_subscribe_start() {
809
  }
810
  }
811
 
812
- function sg_subscribe_admin() {
813
- include (ABSPATH . 'wp-subscription-manager.php');
814
- }
815
-
816
-
817
  // This will be overridden if the user manually places the function
818
  // in the comments form before the comment_form do_action() call
819
  add_action('comment_form', 'show_subscription_checkbox');
@@ -825,7 +813,7 @@ add_action('comment_post', create_function('$a', 'global $sg_subscribe; sg_subsc
825
  add_action('wp_set_comment_status', create_function('$a', 'global $sg_subscribe; sg_subscribe_start(); return $sg_subscribe->send_notifications($a);'));
826
  add_action('admin_menu', create_function('$a', 'global $sg_subscribe; sg_subscribe_start(); $sg_subscribe->add_admin_menu();'));
827
  add_action('admin_head', create_function('$a', 'global $sg_subscribe; sg_subscribe_start(); $sg_subscribe->sg_wp_head();'));
828
-
829
 
830
 
831
  // detect "subscribe without commenting" attempts
@@ -837,4 +825,390 @@ add_action('init', create_function('$a','global $sg_subscribe; if ( $_POST[\'sol
837
 
838
  define('STC_PLUGIN_BASENAME', plugin_basename(__FILE__));
839
 
840
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /*
3
  Plugin Name: Subscribe To Comments
4
+ Version: 2.1
5
  Plugin URI: http://txfx.net/code/wordpress/subscribe-to-comments/
6
  Description: Allows readers to recieve notifications of new comments that are posted to an entry. Based on version 1 from <a href="http://scriptygoddess.com/">Scriptygoddess</a>
7
  Author: Mark Jaquith
8
  Author URI: http://txfx.net/
9
  */
10
 
11
+ /* This is the code that is inserted into the comment form */
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  function show_subscription_checkbox ($id='0') {
13
  global $sg_subscribe;
14
  sg_subscribe_start();
62
  /* Place this somewhere within "the loop", but NOT within another form */
63
  /* This is NOT inserted automaticallly... you must place it yourself */
64
  /* -------------------------------------------------------------------- */
65
+ function show_manual_subscription_form() {
66
  global $id, $sg_subscribe, $user_email;
67
  sg_subscribe_start();
68
  $sg_subscribe->show_errors('solo_subscribe', '<div class="solo-subscribe-errors">', '</div>', __('<strong>Error: </strong>', 'subscribe-to-comments'), '<br />');
74
  <?php /* This is the text that is displayed for users who are NOT subscribed */ ?>
75
  <?php /* ------------------------------------------------------------------- */ ?>
76
 
77
+ <form action="http://<?php echo $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI'], 1); ?>" method="post">
78
  <input type="hidden" name="solo-comment-subscribe" value="solo-comment-subscribe" />
79
  <input type="hidden" name="postid" value="<?php echo $id; ?>" />
80
+ <input type="hidden" name="ref" value="<?php echo urlencode('http://' . $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI'], 1)); ?>" />
81
 
82
  <p class="solo-subscribe-to-comments">
83
  <?php _e('Subscribe without commenting', 'subscribe-to-comments'); ?>
113
 
114
 
115
 
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
  /* ============================= */
125
  /* DO NOT MODIFY BELOW THIS LINE */
126
  /* ============================= */
127
 
128
+ class sg_subscribe_settings {
129
+ function options_page_contents() {
 
 
130
  /** Commit changed options if posted **/
131
+ // var_dump($_POST);
132
+ if ( isset($_POST['sg_subscribe_settings_submit']) ) {
133
+ check_admin_referer('subscribe-to-comments-update_options');
134
  update_option('sg_subscribe_settings', $_POST['sg_subscribe_settings']);
135
  }
136
+
137
+
138
  echo '<h2>Subscribe to Comments Options</h2>';
139
  echo '<ul>';
140
 
159
  echo '</ul></fieldset>';
160
 
161
 
 
 
 
 
 
 
162
  echo '<fieldset>';
163
  echo '<legend><input type="checkbox" id="use_custom_style" name="sg_subscribe_settings[use_custom_style]" value="use_custom_style"' . sg_subscribe_settings::checkflag('use_custom_style') . ' /> <label for="use_custom_style">' . __('Use custom style for Subscription Manager', 'subscribe-to-comments') . '</label></legend>';
164
 
205
  echo '<p class="submit"><input type="submit" name="sg_subscribe_settings_submit" value="';
206
  _e('Update Options &raquo;', 'subscribe-to-comments');
207
  echo '" /></p></div>';
208
+
209
+ if ( function_exists('wp_nonce_field') )
210
+ wp_nonce_field('subscribe-to-comments-update_options');
211
+
212
  echo '</form>';
213
  }
214
 
290
  $this->form_action = 'edit.php?page=' . STC_PLUGIN_BASENAME;
291
 
292
 
293
+ foreach ( array('email', 'key', 'ref', 'new_email') as $var )
294
  if ( isset($_REQUEST[$var]) && !empty($_REQUEST[$var]) )
295
+ $this->{$var} = wp_specialchars(trim($_REQUEST[$var]), 1);
 
296
  if ( !$this->key )
297
  $this->key = 'unset';
298
  }
331
 
332
 
333
  function subscriptions_from_post($postid) {
334
+ if ( is_array($this->post_subscriptions) )
335
+ return $this->post_subscriptions;
336
  global $wpdb;
337
  $postid = (int) $postid;
338
  $this->post_subscriptions = $wpdb->get_results("SELECT comment_author_email FROM $wpdb->comments WHERE comment_post_ID = '$postid' AND comment_subscribe='Y' AND comment_author_email != '' AND comment_approved = '1' GROUP BY LCASE(comment_author_email)");
339
  $subscribed_without_comment = get_post_meta($postid, '_sg_subscribe-to-comments');
340
+ foreach ( (array) $subscribed_without_comment as $email )
341
+ $this->post_subscriptions[]->comment_author_email = $email;
 
 
342
  return $this->post_subscriptions;
343
  }
344
 
350
  $email = $this->email;
351
  global $wpdb;
352
  $email = $wpdb->escape(strtolower($email));
353
+
354
  $subscriptions = $wpdb->get_results("SELECT comment_post_ID FROM $wpdb->comments WHERE LCASE(comment_author_email) = '$email' AND comment_subscribe='Y' AND comment_approved = '1' GROUP BY comment_post_ID");
355
+ foreach ( (array) $subscriptions as $subscription )
356
+ $this->email_subscriptions[] = $subscription->comment_post_ID;
 
 
 
 
357
  $subscriptions = $wpdb->get_results("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_sg_subscribe-to-comments' AND LCASE(meta_value) = '$email' GROUP BY post_id");
358
+ foreach ( (array) $subscriptions as $subscription)
359
+ $this->email_subscriptions[] = $subscription->post_id;
360
+ if ( is_array($this->email_subscriptions) ) {
 
 
 
 
361
  sort($this->email_subscriptions, SORT_NUMERIC);
362
  return $this->email_subscriptions;
363
  }
 
364
  return false;
365
  }
366
 
381
  $this->add_error(__('This e-mail address may not be subscribed', 'subscribe-to-comments'),'solo_subscribe');
382
 
383
  if ( is_array($this->subscriptions_from_email($email)) )
384
+ if (in_array($postid, (array) $this->subscriptions_from_email($email))) {
385
  // already subscribed
386
  setcookie('comment_author_email_' . COOKIEHASH, stripslashes($email), time() + 30000000, COOKIEPATH);
387
  $this->add_error(__('You appear to be already subscribed to this entry.', 'subscribe-to-comments'),'solo_subscribe');
418
  $email = $wpdb->escape(strtolower($wpdb->get_var("SELECT comment_author_email FROM $wpdb->comments WHERE comment_ID = '$cid'")));
419
  $postid = $wpdb->get_var("SELECT comment_post_ID from $wpdb->comments WHERE comment_ID = '$cid'");
420
 
421
+ $previously_subscribed = ( $wpdb->get_var("SELECT comment_subscribe from $wpdb->comments WHERE comment_post_ID = '$postid' AND LCASE(comment_author_email) = '$email' AND comment_subscribe = 'Y' LIMIT 1") || in_array(stripslashes($email), (array) get_post_meta($postid, '_sg_subscribe-to-comments')) ) ? true : false;
422
 
423
  // If user wants to be notified or has previously subscribed, set the flag on this current comment
424
  if (($_POST['subscribe'] == 'subscribe' && is_email($email)) || $previously_subscribed) {
438
  $email = strtolower($email);
439
  // add the option if it doesn't exist
440
  add_option('do_not_mail', '');
441
+ $blocked = (array) explode (' ', get_settings('do_not_mail'));
442
  if ( in_array($email, $blocked) )
443
  return true;
444
  return false;
497
  $subscriber_emails = array();
498
 
499
  // We run the comment loop, and put each unique subscriber into a new array
500
+ foreach ( (array) $comments as $comment ) {
501
  if ( comment_subscription_status() && !in_array($comment->comment_author_email, $subscriber_emails) ) {
502
  $sg_subscribers[] = $comment;
503
  $subscriber_emails[] = $comment->comment_author_email;
601
  $message .= get_permalink($comment->comment_post_ID) . "#comments\n\n";
602
  //add link to manage comment notifications
603
  $message .= __("To manage your subscriptions or to block all notifications from this site, click the link below:\n", 'subscribe-to-comments');
604
+ $message .= get_settings('home') . '/?wp-subscription-manager=1&email=[email]&key=[key]';
605
 
606
  $subject = sprintf(__('New Comment On: %s', 'subscribe-to-comments'), stripslashes($post->post_title));
607
 
608
  $subscriptions = $this->subscriptions_from_post($comment->comment_post_ID);
609
+ foreach ( (array) $subscriptions as $email ) {
610
+ if ( !$this->is_blocked($email->comment_author_email) && $email->comment_author_email != $comment->comment_author_email && is_email($email->comment_author_email) ) {
611
+ $message_final = str_replace('[email]', urlencode($email->comment_author_email), $message);
612
+ $message_final = str_replace('[key]', $this->generate_key($email->comment_author_email), $message_final);
613
+ $this->send_mail($email->comment_author_email, $subject, $message_final);
614
+ }
615
+ } // foreach subscription
 
 
616
  } // end if comment approved
617
  return $cid;
618
  }
625
  $subject = __('E-mail change confirmation', 'subscribe-to-comments');
626
  $message = sprintf(__("You are receiving this message to confirm a change of e-mail address for your subscriptions at \"%s\"\n\n", 'subscribe-to-comments'), get_bloginfo('blogname'));
627
  $message .= sprintf(__("To change your e-mail address to %s, click this link:\n\n", 'subscribe-to-comments'), $this->new_email);
628
+ $message .= get_option('home') . "/?wp-subscription-manager=1&email=" . urlencode($this->email) . "&new_email=" . urlencode($this->new_email) . "&key=" . $this->generate_key($this->email . $this->new_email) . ".\n\n";
629
  $message .= __('If you did not request this action, please disregard this message.', 'subscribe-to-comments');
630
  return $this->send_mail($this->email, $subject, $message);
631
  }
637
  $subject = __('E-mail block confirmation', 'subscribe-to-comments');
638
  $message = sprintf(__("You are receiving this message to confirm that you no longer wish to receive e-mail comment notifications from \"%s\"\n\n", 'subscribe-to-comments'), get_bloginfo('name'));
639
  $message .= __("To cancel all future notifications for this address, click this link:\n\n", 'subscribe-to-comments');
640
+ $message .= get_option('home') . "/?wp-subscription-manager=1&email=" . urlencode($email) . "&key=" . $this->generate_key($email . 'blockrequest') . "&blockemailconfirm=true" . ".\n\n";
641
  $message .= __("If you did not request this action, please disregard this message.", 'subscribe-to-comments');
642
  return $this->send_mail($email, $subject, $message);
643
  }
645
 
646
  function send_mail($to, $subject, $message) {
647
  $subject = '[' . get_bloginfo('name') . '] ' . $subject;
648
+
649
+ // strip out some chars that might cause issues, and assemble vars
650
+ $site_name = str_replace('"', "'", $this->site_name);
651
+ $site_email = str_replace(array('<', '>'), array('', ''), $this->site_email);
652
+ $charset = get_settings('blog_charset');
653
+
654
+ $headers = "From: \"{$site_name}\" <{$site_email}>\n";
655
+ $headers .= "MIME-Version: 1.0\n";
656
+ $headers .= "Content-Type: text/plain; charset=\"{$charset}\"\n";
657
  return wp_mail($to, $subject, $message, $headers);
658
  }
659
 
666
  $return = true;
667
  if ( $wpdb->query("UPDATE $wpdb->postmeta SET meta_value = '$new_email' WHERE meta_value = '$email' AND meta_key = '_sg_subscribe-to-comments'") )
668
  $return = true;
 
669
  return $return;
670
  }
671
 
716
  update_option('sg_subscribe_settings', $settings);
717
 
718
  $column_name = 'comment_subscribe';
719
+ foreach ( (array) $wpdb->get_col("DESC $wpdb->comments", 0) as $column )
720
  if ($column == $column_name)
721
  return true;
722
 
745
  return 'admin';
746
 
747
  if ( is_array($this->subscriptions_from_email($email)) )
748
+ if ( in_array($post->ID, (array) $this->email_subscriptions) )
749
+ return $email;
750
  return false;
751
  }
752
 
753
 
754
  function manage_link($email='', $html=true, $echo=true) {
755
+ $link = get_option('home') . '/?wp-subscription-manager=1';
756
  if ( $email != 'admin' ) {
757
  $link = add_query_arg('email', urlencode(urlencode($email)), $link);
758
  $link = add_query_arg('key', $this->generate_key($email), $link);
759
  }
760
+ $link = add_query_arg('ref', urlencode('http://' . $_SERVER['HTTP_HOST'] . wp_specialchars($_SERVER['REQUEST_URI'], 1)), $link);
761
  $link = str_replace('+', '%2B', $link);
762
  if ( $html )
763
  $link = htmlentities($link);
767
  }
768
 
769
 
770
+ function on_edit($cid) {
771
+ global $wpdb;
772
+ $comment = &get_comment($cid);
773
+ if ( !is_email($comment->comment_author_email) && $comment->comment_subscribe == 'Y' )
774
+ $wpdb->query("UPDATE $wpdb->comments SET comment_subscribe = 'N' WHERE comment_ID = '$comment->comment_ID' LIMIT 1");
775
+ return $cid;
776
+ }
777
+
778
+
779
  function add_admin_menu() {
780
  add_management_page(__('Comment Subscription Manager', 'subscribe-to-comments'), __('Subscriptions', 'subscribe-to-comments'), 8, __FILE__, 'sg_subscribe_admin');
781
 
793
 
794
 
795
 
 
 
 
 
796
  function sg_subscribe_start() {
797
  global $sg_subscribe;
798
 
802
  }
803
  }
804
 
 
 
 
 
 
805
  // This will be overridden if the user manually places the function
806
  // in the comments form before the comment_form do_action() call
807
  add_action('comment_form', 'show_subscription_checkbox');
813
  add_action('wp_set_comment_status', create_function('$a', 'global $sg_subscribe; sg_subscribe_start(); return $sg_subscribe->send_notifications($a);'));
814
  add_action('admin_menu', create_function('$a', 'global $sg_subscribe; sg_subscribe_start(); $sg_subscribe->add_admin_menu();'));
815
  add_action('admin_head', create_function('$a', 'global $sg_subscribe; sg_subscribe_start(); $sg_subscribe->sg_wp_head();'));
816
+ add_action('edit_comment', array('sg_subscribe', 'on_edit'));
817
 
818
 
819
  // detect "subscribe without commenting" attempts
825
 
826
  define('STC_PLUGIN_BASENAME', plugin_basename(__FILE__));
827
 
828
+ if ( isset($_REQUEST['wp-subscription-manager']) )
829
+ add_action('template_redirect', 'sg_subscribe_admin_standalone');
830
+
831
+ function sg_subscribe_admin_standalone() {
832
+ sg_subscribe_admin(true);
833
+ }
834
+
835
+ function sg_subscribe_admin($standalone = false) {
836
+ global $wpdb, $sg_subscribe;
837
+
838
+ sg_subscribe_start();
839
+
840
+ if ( $standalone ) {
841
+ $sg_subscribe->form_action = get_option('home') . '/?wp-subscription-manager=1';
842
+ $sg_subscribe->standalone = true;
843
+ ob_start(create_function('$a', 'return str_replace("<title>", "<title> " . __("Subscription Manager", "subscribe-to-comments") . " &raquo; ", $a);'));
844
+ } else {
845
+ $sg_subscribe->form_action = 'edit.php?page=subscribe-to-comments.php';
846
+ $sg_subscribe->standalone = false;
847
+ }
848
+
849
+ $sg_subscribe->manager_init();
850
+
851
+ get_currentuserinfo();
852
+
853
+ if ( !$sg_subscribe->validate_key() )
854
+ die ( __('You may not access this page without a valid key.', 'subscribe-to-comments') );
855
+
856
+ $sg_subscribe->determine_action();
857
+
858
+ switch ($sg_subscribe->action) :
859
+
860
+ case "change_email" :
861
+ if ( $sg_subscribe->change_email() ) {
862
+ $sg_subscribe->add_message(sprintf(__('All notifications that were formerly sent to <strong>%s</strong> will now be sent to <strong>%s</strong>!', 'subscribe-to-comments'), $sg_subscribe->email, $sg_subscribe->new_email));
863
+ // change info to the new email
864
+ $sg_subscribe->email = $sg_subscribe->new_email;
865
+ unset($sg_subscribe->new_email);
866
+ $sg_subscribe->key = $sg_subscribe->generate_key($sg_subscribe->email);
867
+ $sg_subscribe->validate_key();
868
+ }
869
+ break;
870
+
871
+ case "remove_subscriptions" :
872
+ $postsremoved = $sg_subscribe->remove_subscriptions($_POST['subscrips']);
873
+ if ( $postsremoved > 0 )
874
+ $sg_subscribe->add_message(sprintf(__('<strong>%s</strong> %s removed successfully.', 'subscribe-to-comments'), $postsremoved, ($postsremoved != 1) ? __('subscriptions', 'subscribe-to-comments') : __('subscription', 'subscribe-to-comments')));
875
+ break;
876
+
877
+ case "remove_block" :
878
+ if ($sg_subscribe->remove_block($sg_subscribe->email))
879
+ $sg_subscribe->add_message(sprintf(__('The block on <strong>%s</strong> has been successfully removed.', 'subscribe-to-comments'), $sg_subscribe->email));
880
+ else
881
+ $sg_subscribe->add_error(sprintf(__('<strong>%s</strong> isn\'t blocked!', 'subscribe-to-comments'), $sg_subscribe->email), 'manager');
882
+ break;
883
+
884
+ case "email_change_request" :
885
+ if ($sg_subscribe->is_blocked($sg_subscribe->email))
886
+ $sg_subscribe->add_error(sprintf(__('<strong>%s</strong> has been blocked from receiving notifications. You will have to have the administrator remove the block before you will be able to change your notification address.', 'subscribe-to-comments'), $sg_subscribe->email));
887
+ else
888
+ if ($sg_subscribe->change_email_request($sg_subscribe->email, $sg_subscribe->new_email))
889
+ $sg_subscribe->add_message(sprintf(__('Your change of e-mail request was successfully received. Please check your old account (<strong>%s</strong>) in order to confirm the change.', 'subscribe-to-comments'), $sg_subscribe->email));
890
+ break;
891
+
892
+ case "block_request" :
893
+ if ($sg_subscribe->block_email_request($sg_subscribe->email ))
894
+ $sg_subscribe->add_message(sprintf(__('Your request to block <strong>%s</strong> from receiving any further notifications has been received. In order for you to complete the block, please check your e-mail and click on the link in the message that has been sent to you.', 'subscribe-to-comments'), $sg_subscribe->email));
895
+ break;
896
+
897
+ case "solo_subscribe" :
898
+ $sg_subscribe->add_message(sprintf(__('<strong>%s</strong> has been successfully subscribed to %s', 'subscribe-to-comments'), $sg_subscribe->email, $sg_subscribe->entry_link($_GET['subscribeid'])));
899
+ break;
900
+
901
+ case "block" :
902
+ if ($sg_subscribe->add_block($sg_subscribe->email))
903
+ $sg_subscribe->add_message(sprintf(__('<strong>%s</strong> has been added to the "do not mail" list. You will no longer receive any notifications from this site. If this was done in error, please contact the <a href="mailto:%s">site administrator</a> to remove this block.', 'subscribe-to-comments'), $sg_subscribe->email, $sg_subscribe->site_email));
904
+ else
905
+ $sg_subscribe->add_error(sprintf(__('<strong>%s</strong> has already been blocked!', 'subscribe-to-comments'), $sg_subscribe->email), 'manager');
906
+ $sg_subscribe->key = $sg_subscribe->generate_key($sg_subscribe->email);
907
+ $sg_subscribe->validate_key();
908
+ break;
909
+
910
+ endswitch;
911
+
912
+
913
+
914
+ if ( $sg_subscribe->standalone ) {
915
+ if ( !$sg_subscribe->use_wp_style && !empty($sg_subscribe->header) ) {
916
+ @include($sg_subscribe->header);
917
+ echo $sg_subscribe->before_manager;
918
+ } else { ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
919
+ <html>
920
+ <head>
921
+ <title><?php printf(__('%s Comment Subscription Manager', 'subscribe-to-comments'), bloginfo('name')); ?></title>
922
+
923
+ <style type="text/css" media="screen">
924
+ @import url( <?php echo get_settings('siteurl'); ?>/wp-admin/wp-admin.css );
925
+ </style>
926
+
927
+ <link rel="stylesheet" type="text/css" media="print" href="<?php echo get_settings('siteurl'); ?>/print.css" />
928
+
929
+ <meta http-equiv="Content-Type" content="text/html;
930
+ charset=<?php bloginfo('charset'); ?>" />
931
+
932
+ <?php $sg_subscribe->sg_wp_head(); ?>
933
+
934
+ </head>
935
+ <body>
936
+ <?php } ?>
937
+ <?php } ?>
938
+
939
+
940
+ <?php $sg_subscribe->show_messages(); ?>
941
+
942
+ <?php $sg_subscribe->show_errors(); ?>
943
+
944
+
945
+ <div class="wrap">
946
+ <h2><?php bloginfo('name'); ?> <?php _e('Comment Subscription Manager', 'subscribe-to-comments'); ?></h2>
947
+
948
+ <?php if (!empty($sg_subscribe->ref)) : ?>
949
+ <?php $sg_subscribe->add_message(sprintf(__('Return to the page you were viewing: %s', 'subscribe-to-comments'), $sg_subscribe->entry_link(url_to_postid($sg_subscribe->ref), $sg_subscribe->ref))); ?>
950
+ <?php $sg_subscribe->show_messages(); ?>
951
+ <?php endif; ?>
952
+
953
+
954
+
955
+ <?php if ( $sg_subscribe->is_blocked() ) { ?>
956
+
957
+ <?php if ( current_user_can('manage_options') ) : ?>
958
+
959
+ <fieldset class="options">
960
+ <legend><?php _e('Remove Block', 'subscribe-to-comments'); ?></legend>
961
+
962
+ <p>
963
+ <?php printf(__('Click the button below to remove the block on <strong>%s</strong>. This should only be done if the user has specifically requested it.', 'subscribe-to-comments'), $sg_subscribe->email); ?>
964
+ </p>
965
+
966
+ <form name="removeBlock" method="post" action="<?php echo $sg_subscribe->form_action; ?>">
967
+ <input type="hidden" name="removeBlock" value="removeBlock /">
968
+ <?php $sg_subscribe->hidden_form_fields(); ?>
969
+
970
+ <p class="submit">
971
+ <input type="submit" name="submit" value="<?php _e('Remove Block &raquo;', 'subscribe-to-comments'); ?>" />
972
+ </p>
973
+ </form>
974
+ </fieldset>
975
+
976
+ <?php else : ?>
977
+
978
+ <fieldset class="options">
979
+ <legend><?php _e('Blocked', 'subscribe-to-comments'); ?></legend>
980
+
981
+ <p>
982
+ <?php printf(__('You have indicated that you do not wish to receive any notifications at <strong>%s</strong> from this site. If this is incorrect, or if you wish to have the block removed, please contact the <a href="mailto:%s">site administrator</a>.', 'subscribe-to-comments'), $sg_subscribe->email, $sg_subscribe->site_email); ?>
983
+ </p>
984
+ </fieldset>
985
+
986
+ <?php endif; ?>
987
+
988
+
989
+ <?php } else { ?>
990
+
991
+
992
+ <?php $postlist = $sg_subscribe->subscriptions_from_email(); ?>
993
+
994
+ <?php
995
+ if ( isset($sg_subscribe->email) && !is_array($postlist) && $sg_subscribe->email != $sg_subscribe->site_email && $sg_subscribe->email != get_bloginfo('admin_email') ) {
996
+ if ( is_email($sg_subscribe->email) )
997
+ $sg_subscribe->add_error(sprintf(__('<strong>%s</strong> is not subscribed to any posts on this site.', 'subscribe-to-comments'), $sg_subscribe->email));
998
+ else
999
+ $sg_subscribe->add_error(sprintf(__('<strong>%s</strong> is not a valid e-mail address.', 'subscribe-to-comments'), $sg_subscribe->email));
1000
+ }
1001
+ ?>
1002
+
1003
+ <?php $sg_subscribe->show_errors(); ?>
1004
+
1005
+
1006
+
1007
+
1008
+ <?php if ( current_user_can('manage_options') ) { ?>
1009
+
1010
+ <fieldset class="options">
1011
+ <?php if ( $_REQUEST['email'] ) : ?>
1012
+ <p><a href="<?php echo $sg_subscribe->form_action; ?>"><?php _e('&laquo; Back'); ?></a></p>
1013
+ <?php endif; ?>
1014
+
1015
+ <legend><?php _e('Find Subscriptions', 'subscribe-to-comments'); ?></legend>
1016
+
1017
+ <p>
1018
+ <?php _e('Enter an e-mail address to view its subscriptions or undo a block.', 'subscribe-to-comments'); ?>
1019
+ </p>
1020
+
1021
+ <form name="getemail" method="post" action="<?php echo $sg_subscribe->form_action; ?>">
1022
+ <input type="hidden" name="ref" value="<?php echo $sg_subscribe->ref; ?>" />
1023
+
1024
+ <p>
1025
+ <input name="email" type="text" id="email" size="40" />
1026
+ <input type="submit" value="<?php _e('Search &raquo;', 'subscribe-to-comments'); ?>" />
1027
+ </p>
1028
+ </form>
1029
+ </fieldset>
1030
+
1031
+ <?php if ( !$_REQUEST['email'] ) : ?>
1032
+ <fieldset class="options">
1033
+ <?php if ( !$_REQUEST['showallsubscribers'] ) : ?>
1034
+ <legend><?php _e('Top Subscriber List', 'subscribe-to-comments'); ?></legend>
1035
+ <?php else : ?>
1036
+ <legend><?php _e('Subscriber List', 'subscribe-to-comments'); ?></legend>
1037
+ <?php endif; ?>
1038
+
1039
+ <?php
1040
+ $stc_limit = ( !$_REQUEST['showallsubscribers'] ) ? 'LIMIT 25' : '';
1041
+ $all_ct_subscriptions = $wpdb->get_results("SELECT distinct LCASE(comment_author_email) as email, count(distinct comment_post_ID) as ccount FROM $wpdb->comments WHERE comment_subscribe='Y' AND comment_approved = '1' GROUP BY email ORDER BY ccount DESC $stc_limit");
1042
+ $all_pm_subscriptions = $wpdb->get_results("SELECT distinct LCASE(meta_value) as email, count(post_id) as ccount FROM $wpdb->postmeta WHERE meta_key = '_sg_subscribe-to-comments' GROUP BY email ORDER BY ccount DESC $stc_limit");
1043
+ $all_subscriptions = array();
1044
+
1045
+ foreach ( array('all_ct_subscriptions', 'all_pm_subscriptions') as $each ) {
1046
+ foreach ( (array) $$each as $sub ) {
1047
+ if ( !isset($all_subscriptions[$sub->email]) )
1048
+ $all_subscriptions[$sub->email] = (int) $sub->ccount;
1049
+ else
1050
+ $all_subscriptions[$sub->email] += (int) $sub->ccount;
1051
+ }
1052
+ }
1053
+
1054
+ if ( !$_REQUEST['showallsubscribers'] ) : ?>
1055
+ <p><a href="<?php echo add_query_arg('showallsubscribers', '1', $sg_subscribe->form_action); ?>"><?php _e('Show all subscribers', 'subscribe-to-comments'); ?></a></p>
1056
+ <?php elseif ( !$_REQUEST['showccfield'] ) : ?>
1057
+ <p><a href="<?php echo add_query_arg('showccfield', '1'); ?>"><?php _e('Show list of subscribers in <code>CC:</code>-field format (for bulk e-mailing)', 'subscribe-to-comments'); ?></a></p>
1058
+ <?php else : ?>
1059
+ <p><a href="<?php echo $sg_subscribe->form_action; ?>"><?php _e('&laquo; Back to regular view'); ?></a></p>
1060
+ <p><textarea cols="60" rows="10"><?php echo implode(', ', array_keys($all_subscriptions) ); ?></textarea></p>
1061
+ <?php endif;
1062
+
1063
+
1064
+ if ( $all_subscriptions ) {
1065
+ if ( !$_REQUEST['showccfield'] ) {
1066
+ echo "<ul>\n";
1067
+ foreach ( (array) $all_subscriptions as $email => $ccount ) {
1068
+ $enc_email = urlencode($email);
1069
+ echo "<li>($ccount) <a href='{$sg_subscribe->form_action}&email=$enc_email'>$email</a></li>\n";
1070
+ }
1071
+ echo "</ul>\n";
1072
+ }
1073
+ ?>
1074
+ <legend><?php _e('Top Subscribed Posts', 'subscribe-to-comments'); ?></legend>
1075
+ <?php
1076
+ $top_subscribed_posts1 = $wpdb->get_results("SELECT distinct comment_post_ID as post_id, count(distinct comment_author_email) as ccount FROM $wpdb->comments WHERE comment_subscribe='Y' AND comment_approved = '1' GROUP BY post_id ORDER BY ccount DESC LIMIT 25");
1077
+ $top_subscribed_posts2 = $wpdb->get_results("SELECT distinct post_id, count(distinct meta_value) as ccount FROM $wpdb->postmeta WHERE meta_key = '_sg_subscribe-to-comments' GROUP BY post_id ORDER BY ccount DESC LIMIT 25");
1078
+ $all_top_posts = array();
1079
+
1080
+ foreach ( array('top_subscribed_posts1', 'top_subscribed_posts2') as $each ) {
1081
+ foreach ( (array) $$each as $pid ) {
1082
+ if ( !isset($all_top_posts[$pid->post_id]) )
1083
+ $all_top_posts[$pid->post_id] = (int) $pid->ccount;
1084
+ else
1085
+ $all_top_posts[$pid->post_id] += (int) $pid->ccount;
1086
+ }
1087
+ }
1088
+ arsort($all_top_posts);
1089
+
1090
+ echo "<ul>\n";
1091
+ foreach ( $all_top_posts as $pid => $ccount ) {
1092
+ echo "<li>($ccount) <a href='" . get_permalink($pid) . "'>" . get_the_title($pid) . "</a></li>\n";
1093
+ }
1094
+ echo "</ul>";
1095
+ ?>
1096
+
1097
+ <?php } ?>
1098
+
1099
+ </fieldset>
1100
+
1101
+ <?php endif; ?>
1102
+
1103
+ <?php } ?>
1104
+
1105
+ <?php if ( count($postlist) > 0 && is_array($postlist) ) { ?>
1106
+
1107
+
1108
+ <script type="text/javascript">
1109
+ <!--
1110
+ function checkAll(form) {
1111
+ for ( i = 0, n = form.elements.length; i < n; i++ ) {
1112
+ if ( form.elements[i].type == "checkbox" ) {
1113
+ if ( form.elements[i].checked == true )
1114
+ form.elements[i].checked = false;
1115
+ else
1116
+ form.elements[i].checked = true;
1117
+ }
1118
+ }
1119
+ }
1120
+ //-->
1121
+ </script>
1122
+
1123
+ <fieldset class="options">
1124
+ <legend><?php _e('Subscriptions', 'subscribe-to-comments'); ?></legend>
1125
+
1126
+ <p>
1127
+ <?php printf(__('<strong>%s</strong> is subscribed to the posts listed below. To unsubscribe to one or more posts, click the checkbox next to the title, then click "Remove Selected Subscription(s)" at the bottom of the list.', 'subscribe-to-comments'), $sg_subscribe->email); ?>
1128
+ </p>
1129
+
1130
+ <form name="removeSubscription" id="removeSubscription" method="post" action="<?php echo $sg_subscribe->form_action; ?>">
1131
+ <input type="hidden" name="removesubscrips" value="removesubscrips" />
1132
+ <?php $sg_subscribe->hidden_form_fields(); ?>
1133
+
1134
+ <ol>
1135
+ <?php for ($i = 0; $i < count($postlist); $i++) { ?>
1136
+ <li><label for="subscrip-<?php echo $i; ?>"><input id="subscrip-<?php echo $i; ?>" type="checkbox" name="subscrips[]" value="<?php echo $postlist[$i]; ?>" /> <?php echo $sg_subscribe->entry_link($postlist[$i]); ?></label></li>
1137
+ <?php } ?>
1138
+ </ol>
1139
+
1140
+ <p>
1141
+ <a href="javascript:;" onclick="checkAll(document.getElementById('removeSubscription')); return false; "><?php _e('Invert Checkbox Selection', 'subscribe-to-comments'); ?></a>
1142
+ </p>
1143
+
1144
+ <p class="submit">
1145
+ <input type="submit" name="submit" value="<?php _e('Remove Selected Subscription(s) &raquo;', 'subscribe-to-comments'); ?>" />
1146
+ </p>
1147
+ </form>
1148
+ </fieldset>
1149
+ </div>
1150
+
1151
+ <div class="wrap">
1152
+ <h2><?php _e('Advanced Options', 'subscribe-to-comments'); ?></h2>
1153
+
1154
+ <fieldset class="options">
1155
+ <legend><?php _e('Block All Notifications', 'subscribe-to-comments'); ?></legend>
1156
+
1157
+ <form name="blockemail" method="post" action="<?php echo $sg_subscribe->form_action; ?>">
1158
+ <input type="hidden" name="blockemail" value="blockemail" />
1159
+ <?php $sg_subscribe->hidden_form_fields(); ?>
1160
+
1161
+ <p>
1162
+ <?php printf(__('If you would like <strong>%s</strong> to be blocked from receiving any notifications from this site, click the button below. This should be reserved for cases where someone is signing you up for notifications without your consent.', 'subscribe-to-comments'), $sg_subscribe->email); ?>
1163
+ </p>
1164
+
1165
+ <p class="submit">
1166
+ <input type="submit" name="submit" value="<?php _e('Block Notifications &raquo;', 'subscribe-to-comments'); ?>" />
1167
+ </p>
1168
+ </form>
1169
+ </fieldset>
1170
+
1171
+ <fieldset class="options">
1172
+ <legend><?php _e('Change E-mail Address', 'subscribe-to-comments'); ?></legend>
1173
+
1174
+ <form name="changeemailrequest" method="post" action="<?php echo $sg_subscribe->form_action; ?>">
1175
+ <input type="hidden" name="changeemailrequest" value="changeemailrequest" />
1176
+ <?php $sg_subscribe->hidden_form_fields(); ?>
1177
+
1178
+ <p>
1179
+ <?php printf(__('If you would like to change the e-mail address for your subscriptions, enter the new address below. You will be required to verify this request by clicking a special link sent to your current address (<strong>%s</strong>).', 'subscribe-to-comments'), $sg_subscribe->email); ?>
1180
+ </p>
1181
+
1182
+ <p>
1183
+ <?php _e('New E-mail Address:', 'subscribe-to-comments'); ?>
1184
+ <input name="new_email" type="text" id="new_email" size="40" />
1185
+ </p>
1186
+
1187
+ <p class="submit">
1188
+ <input type="submit" name="submit" value="<?php _e('Change E-mail Address &raquo;', 'subscribe-to-comments'); ?>" />
1189
+ </p>
1190
+ </form>
1191
+ </fieldset>
1192
+
1193
+ <?php } ?>
1194
+ <?php } //end if not in do not mail ?>
1195
+ </div>
1196
+
1197
+ <?php if ( $sg_subscribe->standalone ) : ?>
1198
+ <?php if ( !$sg_subscribe->use_wp_style ) :
1199
+ echo $sg_subscribe->after_manager;
1200
+
1201
+ if ( !empty($sg_subscribe->sidebar) )
1202
+ @include_once($sg_subscribe->sidebar);
1203
+ if ( !empty($sg_subscribe->footer) )
1204
+ @include_once($sg_subscribe->footer);
1205
+ ?>
1206
+ <?php else : ?>
1207
+ </body>
1208
+ </html>
1209
+ <?php endif; ?>
1210
+ <?php endif; ?>
1211
+
1212
+
1213
+ <?php die(); // stop WP from loading ?>
1214
+ <?php } ?>
wp-subscription-manager.php DELETED
@@ -1,306 +0,0 @@
1
- <?php
2
- // need to declare these global;
3
- global $wpdb, $user_level, $sg_subscribe;
4
-
5
- if (!function_exists('sg_subscribe_start')) {
6
- require('./wp-blog-header.php');
7
-
8
- if (!function_exists('sg_subscribe_start'))
9
- die (__('You must activate the "Subscribe to Comments" plugin in the WordPress admin panel', 'subscribe-to-comments'));
10
-
11
- sg_subscribe_start();
12
- $sg_subscribe->form_action = 'wp-subscription-manager.php';
13
- $sg_subscribe->standalone = true;
14
- ob_start(create_function('$a', 'return str_replace("<title>", "<title> " . __("Subscription Manager", "subscribe-to-comments") . " &raquo; ", $a);'));
15
- } else {
16
- sg_subscribe_start();
17
- $sg_subscribe->form_action = 'edit.php?page=subscribe-to-comments.php';
18
- $sg_subscribe->standalone = false;
19
- }
20
-
21
- $sg_subscribe->manager_init();
22
-
23
- get_currentuserinfo();
24
-
25
- if ( !$sg_subscribe->validate_key() )
26
- die ( __('You may not access this page without a valid key.', 'subscribe-to-comments') );
27
-
28
- $sg_subscribe->determine_action();
29
-
30
- switch ($sg_subscribe->action) :
31
-
32
- case "change_email" :
33
- if ( $sg_subscribe->change_email() ) {
34
- $sg_subscribe->add_message(sprintf(__('All notifications that were formerly sent to <strong>%s</strong> will now be sent to <strong>%s</strong>!', 'subscribe-to-comments'), $sg_subscribe->email, $sg_subscribe->new_email));
35
- // change info to the new email
36
- $sg_subscribe->email = $sg_subscribe->new_email;
37
- unset($sg_subscribe->new_email);
38
- $sg_subscribe->key = $sg_subscribe->generate_key($sg_subscribe->email);
39
- $sg_subscribe->validate_key();
40
- }
41
- break;
42
-
43
- case "remove_subscriptions" :
44
- $postsremoved = $sg_subscribe->remove_subscriptions($_POST['subscrips']);
45
- if ( $postsremoved > 0 )
46
- $sg_subscribe->add_message(sprintf(__('<strong>%s</strong> %s removed successfully.', 'subscribe-to-comments'), $postsremoved, ($postsremoved != 1) ? __('subscriptions', 'subscribe-to-comments') : __('subscription', 'subscribe-to-comments')));
47
- break;
48
-
49
- case "remove_block" :
50
- if ($sg_subscribe->remove_block($sg_subscribe->email))
51
- $sg_subscribe->add_message(sprintf(__('The block on <strong>%s</strong> has been successfully removed.', 'subscribe-to-comments'), $sg_subscribe->email));
52
- else
53
- $sg_subscribe->add_error(sprintf(__('<strong>%s</strong> isn\'t blocked!', 'subscribe-to-comments'), $sg_subscribe->email), 'manager');
54
- break;
55
-
56
- case "email_change_request" :
57
- if ($sg_subscribe->is_blocked($sg_subscribe->email))
58
- $sg_subscribe->add_error(sprintf(__('<strong>%s</strong> has been blocked from receiving notifications. You will have to have the administrator remove the block before you will be able to change your notification address.', 'subscribe-to-comments'), $sg_subscribe->email));
59
- else
60
- if ($sg_subscribe->change_email_request($sg_subscribe->email, $sg_subscribe->new_email))
61
- $sg_subscribe->add_message(sprintf(__('Your change of e-mail request was successfully received. Please check your old account (<strong>%s</strong>) in order to confirm the change.', 'subscribe-to-comments'), $sg_subscribe->email));
62
- break;
63
-
64
- case "block_request" :
65
- if ($sg_subscribe->block_email_request($sg_subscribe->email ))
66
- $sg_subscribe->add_message(sprintf(__('Your request to block <strong>%s</strong> from receiving any further notifications has been received. In order for you to complete the block, please check your e-mail and click on the link in the message that has been sent to you.', 'subscribe-to-comments'), $sg_subscribe->email));
67
- break;
68
-
69
- case "solo_subscribe" :
70
- $sg_subscribe->add_message(sprintf(__('<strong>%s</strong> has been successfully subscribed to %s', 'subscribe-to-comments'), $sg_subscribe->email, $sg_subscribe->entry_link($_GET['subscribeid'])));
71
- break;
72
-
73
- case "block" :
74
- if ($sg_subscribe->add_block($sg_subscribe->email))
75
- $sg_subscribe->add_message(sprintf(__('<strong>%s</strong> has been added to the "do not mail" list. You will no longer receive any notifications from this site. If this was done in error, please contact the <a href="mailto:%s">site administrator</a> to remove this block.', 'subscribe-to-comments'), $sg_subscribe->email, $sg_subscribe->site_email));
76
- else
77
- $sg_subscribe->add_error(sprintf(__('<strong>%s</strong> has already been blocked!', 'subscribe-to-comments'), $sg_subscribe->email), 'manager');
78
- $sg_subscribe->key = $sg_subscribe->generate_key($sg_subscribe->email);
79
- $sg_subscribe->validate_key();
80
- break;
81
-
82
- endswitch;
83
-
84
-
85
-
86
- if ($sg_subscribe->standalone) {
87
- if ( !$sg_subscribe->use_wp_style && !empty($sg_subscribe->header) ) {
88
-
89
- include ( $sg_subscribe->header );
90
- echo $sg_subscribe->before_manager;
91
- } else { ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
92
- <html>
93
- <head>
94
- <title><?php printf(__('%s Comment Subscription Manager', 'subscribe-to-comments'), bloginfo('name')); ?></title>
95
-
96
- <style type="text/css" media="screen">
97
- @import url( <?php echo get_settings('siteurl'); ?>/wp-admin/wp-admin.css );
98
- </style>
99
-
100
- <link rel="stylesheet" type="text/css" media="print" href="<?php echo get_settings('siteurl'); ?>/print.css" />
101
-
102
- <meta http-equiv="Content-Type" content="text/plain;
103
- charset=<?php bloginfo('charset'); ?>" />
104
-
105
- <?php $sg_subscribe->sg_wp_head(); ?>
106
-
107
- </head>
108
- <body>
109
- <?php } ?>
110
- <?php } ?>
111
-
112
-
113
- <?php $sg_subscribe->show_messages(); ?>
114
-
115
- <?php $sg_subscribe->show_errors(); ?>
116
-
117
-
118
- <div class="wrap">
119
- <h2><?php bloginfo('name'); ?> <?php _e('Comment Subscription Manager', 'subscribe-to-comments'); ?></h2>
120
-
121
- <?php if (!empty($sg_subscribe->ref)) : ?>
122
- <?php $sg_subscribe->add_message(sprintf(__('Return to the page you were viewing: %s', 'subscribe-to-comments'), $sg_subscribe->entry_link(url_to_postid($sg_subscribe->ref), $sg_subscribe->ref))); ?>
123
- <?php $sg_subscribe->show_messages(); ?>
124
- <?php endif; ?>
125
-
126
-
127
-
128
- <?php if ($sg_subscribe->is_blocked()) { ?>
129
-
130
- <?php if ( current_user_can('manage_options') ) : ?>
131
-
132
- <fieldset class="options">
133
- <legend><?php _e('Remove Block', 'subscribe-to-comments'); ?></legend>
134
-
135
- <p>
136
- <?php printf(__('Click the button below to remove the block on <strong>%s</strong>. This should only be done if the user has specifically requested it.', 'subscribe-to-comments'), $sg_subscribe->email); ?>
137
- </p>
138
-
139
- <form name="removeBlock" method="post" action="<?php echo $sg_subscribe->form_action; ?>">
140
- <input type="hidden" name="removeBlock" value="removeBlock /">
141
- <?php $sg_subscribe->hidden_form_fields(); ?>
142
-
143
- <p class="submit">
144
- <input type="submit" name="submit" value="<?php _e('Remove Block &raquo;', 'subscribe-to-comments'); ?>" />
145
- </p>
146
- </form>
147
- </fieldset>
148
-
149
- <?php else : ?>
150
-
151
- <fieldset class="options">
152
- <legend><?php _e('Blocked', 'subscribe-to-comments'); ?></legend>
153
-
154
- <p>
155
- <?php printf(__('You have indicated that you do not wish to receive any notifications at <strong>%s</strong> from this site. If this is incorrect, or if you wish to have the block removed, please contact the <a href="mailto:%s">site administrator</a>.', 'subscribe-to-comments'), $sg_subscribe->email, $sg_subscribe->site_email); ?>
156
- </p>
157
- </fieldset>
158
-
159
- <?php endif; ?>
160
-
161
-
162
- <?php } else { ?>
163
-
164
-
165
- <?php $postlist = $sg_subscribe->subscriptions_from_email(); ?>
166
-
167
- <?php if (isset($sg_subscribe->email) && !is_array($postlist) && $sg_subscribe->email != $sg_subscribe->site_email && $sg_subscribe->email != get_bloginfo('admin_email') ) { ?>
168
- <?php if (is_email($sg_subscribe->email)) : ?>
169
- <?php $sg_subscribe->add_error(sprintf(__('<strong>%s</strong> is not subscribed to any posts on this site.', 'subscribe-to-comments'), $sg_subscribe->email)); ?>
170
- <?php else : ?>
171
- <?php $sg_subscribe->add_error(sprintf(__('<strong>%s</strong> is not a valid e-mail address.', 'subscribe-to-comments'), $sg_subscribe->email)); ?>
172
- <?php endif; ?>
173
- <?php } ?>
174
-
175
- <?php $sg_subscribe->show_errors(); ?>
176
-
177
-
178
-
179
-
180
- <?php if ( current_user_can('manage_options') ) { ?>
181
-
182
- <fieldset class="options">
183
- <legend><?php _e('Find Subscriptions', 'subscribe-to-comments'); ?></legend>
184
-
185
- <p>
186
- <?php _e('Enter an e-mail address to view its subscriptions or undo a block.', 'subscribe-to-comments'); ?>
187
- </p>
188
-
189
- <form name="getemail" method="post" action="<?php echo $sg_subscribe->form_action; ?>">
190
- <input type="hidden" name="ref" value="<?php echo $sg_subscribe->ref; ?>" />
191
-
192
- <p>
193
- <input name="email" type="text" id="email" size="40" />
194
- <input type="submit" value="<?php _e('Search &raquo;', 'subscribe-to-comments'); ?>" />
195
- </p>
196
- </form>
197
- </fieldset>
198
-
199
- <?php } ?>
200
-
201
- <?php if ( count($postlist) > 0 && is_array($postlist) ) { ?>
202
-
203
-
204
- <script type="text/javascript">
205
- <!--
206
- function checkAll(form) {
207
- for( i = 0, n = form.elements.length; i < n; i++ ) {
208
- if( form.elements[i].type == "checkbox" ) {
209
- if( form.elements[i].checked == true )
210
- form.elements[i].checked = false;
211
- else
212
- form.elements[i].checked = true;
213
- }
214
- }
215
- }
216
- // -->
217
- </script>
218
-
219
- <fieldset class="options">
220
- <legend><?php _e('Subscriptions', 'subscribe-to-comments'); ?></legend>
221
-
222
- <p>
223
- <?php printf(__('<strong>%s</strong> is subscribed to the posts listed below. To unsubscribe to one or more posts, click the checkbox next to the title, then click "Remove Selected Subscription(s)" at the bottom of the list.', 'subscribe-to-comments'), $sg_subscribe->email); ?>
224
- </p>
225
-
226
- <form name="removeSubscription" id="removeSubscription" method="post" action="<?php echo $sg_subscribe->form_action; ?>">
227
- <input type="hidden" name="removesubscrips" value="removesubscrips" />
228
- <?php $sg_subscribe->hidden_form_fields(); ?>
229
-
230
- <ol>
231
- <?php for ($i = 0; $i < count($postlist); $i++) { ?>
232
- <li><label for="subscrip-<?php echo $i; ?>"><input id="subscrip-<?php echo $i; ?>" type="checkbox" name="subscrips[]" value="<?php echo $postlist[$i]; ?>" /> <?php echo $sg_subscribe->entry_link($postlist[$i]); ?></label></li>
233
- <?php } ?>
234
- </ol>
235
-
236
- <p>
237
- <a href="javascript:;" onclick="checkAll(document.getElementById('removeSubscription')); return false; "><?php _e('Invert Checkbox Selection', 'subscribe-to-comments'); ?></a>
238
- </p>
239
-
240
- <p class="submit">
241
- <input type="submit" name="submit" value="<?php _e('Remove Selected Subscription(s) &raquo;', 'subscribe-to-comments'); ?>" />
242
- </p>
243
- </form>
244
- </fieldset>
245
- </div>
246
-
247
- <div class="wrap">
248
- <h2><?php _e('Advanced Options', 'subscribe-to-comments'); ?></h2>
249
-
250
- <fieldset class="options">
251
- <legend><?php _e('Block All Notifications', 'subscribe-to-comments'); ?></legend>
252
-
253
- <form name="blockemail" method="post" action="<?php echo $sg_subscribe->form_action; ?>">
254
- <input type="hidden" name="blockemail" value="blockemail" />
255
- <?php $sg_subscribe->hidden_form_fields(); ?>
256
-
257
- <p>
258
- <?php printf(__('If you would like <strong>%s</strong> to be blocked from receiving any notifications from this site, click the button below. This should be reserved for cases where someone is signing you up for notifications without your consent.', 'subscribe-to-comments'), $sg_subscribe->email); ?>
259
- </p>
260
-
261
- <p class="submit">
262
- <input type="submit" name="submit" value="<?php _e('Block Notifications &raquo;', 'subscribe-to-comments'); ?>" />
263
- </p>
264
- </form>
265
- </fieldset>
266
-
267
- <fieldset class="options">
268
- <legend><?php _e('Change E-mail Address', 'subscribe-to-comments'); ?></legend>
269
-
270
- <form name="changeemailrequest" method="post" action="<?php echo $sg_subscribe->form_action; ?>">
271
- <input type="hidden" name="changeemailrequest" value="changeemailrequest" />
272
- <?php $sg_subscribe->hidden_form_fields(); ?>
273
-
274
- <p>
275
- <?php printf(__('If you would like to change the e-mail address for your subscriptions, enter the new address below. You will be required to verify this request by clicking a special link sent to your current address (<strong>%s</strong>).', 'subscribe-to-comments'), $sg_subscribe->email); ?>
276
- </p>
277
-
278
- <p>
279
- <?php _e('New E-mail Address:', 'subscribe-to-comments'); ?>
280
- <input name="new_email" type="text" id="new_email" size="40" />
281
- </p>
282
-
283
- <p class="submit">
284
- <input type="submit" name="submit" value="<?php _e('Change E-mail Address &raquo;', 'subscribe-to-comments'); ?>" />
285
- </p>
286
- </form>
287
- </fieldset>
288
-
289
- <?php } ?>
290
- <?php } //end if not in do not mail ?>
291
- </div>
292
-
293
- <?php if ( $sg_subscribe->standalone ) : ?>
294
- <?php if ( !$sg_subscribe->use_wp_style ) :
295
- echo $sg_subscribe->after_manager;
296
-
297
- if ( !empty($sg_subscribe->sidebar) )
298
- include_once($sg_subscribe->sidebar);
299
- if ( !empty($sg_subscribe->footer) )
300
- include_once($sg_subscribe->footer);
301
- ?>
302
- <?php else : ?>
303
- </body>
304
- </html>
305
- <?php endif; ?>
306
- <?php endif; ?>