Subscribe To Comments Reloaded - Version 1.1

Version Description

  • The admin interface has been completely reorganized
  • Added a new option to notify the authors when new comments are posted to one of their articles
  • The management page for your visitors is now automatically created by StCR
  • A cookie is now set to remember when a visitor subscribes without commenting
  • Spam comments that make it through Akismet's filters, are now ignored (thank you Andrea Pinti)
  • Actions on comments have been tied to actions on subscriptions (i.e. comment deleted -> subscription deleted, etc)
  • Activated the official support forum
Download this release

Release Info

Developer coolmann
Plugin Icon 128x128 Subscribe To Comments Reloaded
Version 1.1
Comparing to
See all releases

Code changes from version 1.0 to 1.1

images/Thumbs.db ADDED
Binary file
images/subscribe-to-comments.png ADDED
Binary file
langs/subscribe-reloaded-it_IT.mo CHANGED
Binary file
langs/subscribe-reloaded-it_IT.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP Slim Stat 2.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2010-09-30 13:40-0500\n"
6
- "PO-Revision-Date: 2010-09-30 13:43-0500\n"
7
  "Last-Translator: Camu <info@duechiacchiere.it>\n"
8
  "Language-Team: due chiacchiere <info@duechiacchiere.it>\n"
9
  "MIME-Version: 1.0\n"
@@ -18,89 +18,123 @@ msgstr ""
18
 
19
  #: options.php:46
20
  #: options.php:106
 
 
21
  msgid "Management Page ID"
22
  msgstr "ID Pagina di gestione"
23
 
24
  #: options.php:47
25
  #: options.php:114
 
 
26
  msgid "Autopurge requests"
27
  msgstr "Pulizia DB"
28
 
29
  #: options.php:48
30
  #: options.php:122
 
 
31
  msgid "Sender name"
32
  msgstr "Nome del mittente"
33
 
34
  #: options.php:49
35
  #: options.php:130
 
 
36
  msgid "Sender email address"
37
  msgstr "Indirizzo email mittente"
38
 
39
  #: options.php:50
40
  #: options.php:138
 
 
41
  msgid "Notification subject"
42
  msgstr "Oggetto della notifica"
43
 
44
  #: options.php:51
45
  #: options.php:146
 
 
46
  msgid "Notification message"
47
  msgstr "Contenuto della notifica"
48
 
49
  #: options.php:52
50
  #: options.php:154
 
 
51
  msgid "Checkbox label"
52
  msgstr "Descrizione del checkbox"
53
 
54
  #: options.php:53
55
  #: options.php:162
 
 
56
  msgid "Checked by default"
57
  msgstr "Spuntato per default"
58
 
59
  #: options.php:54
60
  #: options.php:173
 
 
61
  msgid "Subscribed label"
62
  msgstr "Descrizione per gli iscritti"
63
 
64
  #: options.php:55
65
  #: options.php:181
 
 
66
  msgid "Awaiting label"
67
  msgstr "Notifiche in attesa"
68
 
69
  #: options.php:56
70
  #: options.php:189
 
 
71
  msgid "Author label"
72
  msgstr "Descrizione per l'autore"
73
 
74
  #: options.php:57
75
  #: options.php:197
 
 
76
  msgid "Enable double check"
77
  msgstr "Attiva doppia conferma"
78
 
79
  #: options.php:58
80
  #: options.php:208
 
 
81
  msgid "Double check subject"
82
  msgstr "Oggetto doppia conferma"
83
 
84
  #: options.php:59
85
  #: options.php:216
 
 
86
  msgid "Double check message"
87
  msgstr "Contenuto doppia conferma"
88
 
89
  #: options.php:60
90
  #: options.php:224
 
 
91
  msgid "Management subject"
92
  msgstr "Oggetto email di gestione"
93
 
94
  #: options.php:61
95
  #: options.php:232
 
 
96
  msgid "Management message"
97
  msgstr "Contenuto email di gestione"
98
 
99
  #: options.php:67
 
100
  msgid "Your settings have been successfully updated."
101
  msgstr "La configurazione &egrave; stata aggiornata con successo."
102
 
103
  #: options.php:74
 
104
  msgid "There was an error updating the following fields:"
105
  msgstr "Si &egrave; verificato un errore nell'aggiornamento dei seguenti campi:"
106
 
@@ -109,40 +143,53 @@ msgid "Subscribe to Comments"
109
  msgstr "Sottoscrivi i commenti"
110
 
111
  #: options.php:110
 
112
  msgid "The ID (<strong>not the permalink!</strong>) of the management page you created."
113
  msgstr "L'ID (<strong>non il permalink!</strong>) della pagina di gestione che hai creato."
114
 
115
  #: options.php:118
 
116
  msgid "Delete pending subscriptions (not confirmed) after X days. Zero disables this feature."
117
  msgstr "Cancella le iscrizioni non confermate dopo X giorni. Zero disabilita la funzione."
118
 
119
  #: options.php:126
 
120
  msgid "Name to use for the \"from\" field when sending a new notification to the user."
121
  msgstr "Nome da usare nel campo From quando il sistema invia una notifica all'utente."
122
 
123
  #: options.php:134
 
124
  msgid "Email address to use for the \"from\" field when sending a new notification to the user."
125
  msgstr "Indirizzo email da usare nel campo From."
126
 
127
  #: options.php:142
 
128
  msgid "Subject of the notification email. Allowed tag: [post_title]"
129
  msgstr "Oggetto dell'email di notifica. Tag consentito: [post_title]"
130
 
131
  #: options.php:150
 
132
  msgid "Content of the notification email. Allowed tags: [post_title], [comment_permalink], [comment_author], [comment_content], [post_permalink], [manager_link]"
133
  msgstr "Contenuto del messaggio di notifica. Tag consentiti: [post_title], [comment_permalink], [comment_author], [comment_content], [post_permalink], [manager_link]"
134
 
135
  #: options.php:158
 
136
  msgid "Text to show next to the checkbox added to the comment form. Allowed tag: [subscribe_link]"
137
  msgstr "Testo da mostrare accanto al checkbox mostrato nel modulo del commento. Tag consentito: [subscribe_link]"
138
 
139
  #: options.php:164
140
  #: options.php:199
 
 
 
141
  msgid "Yes"
142
  msgstr "Si"
143
 
144
  #: options.php:165
145
  #: options.php:200
 
 
 
146
  msgid "No"
147
  msgstr "No"
148
 
@@ -151,46 +198,56 @@ msgid "Send a notification email to confirm the subscription (to avoid addresses
151
  msgstr "Invia una email per confermare l'iscrizione ad un dato articolo (per evitare l'uso scorretto di indirizzi email di terzi)"
152
 
153
  #: options.php:177
 
154
  msgid "Text to show to those users who are already subscribed. Allowed tag: [manager_link]"
155
  msgstr "Testo da mostrare agli utenti gi&agrave; iscritti ad una discussione. Tag consentito: [manager_link]"
156
 
157
  #: options.php:185
 
158
  msgid "Text to show to those users who are already subscribed, but haven't clicked on the confirmation link yet. Allowed tag: [manager_link]"
159
  msgstr "Testo da mostrare agli utenti gi&agrave; iscritti ad una discussione, ma che non hanno ancora cliccato sul link di conferma. Tag consentito: [manager_link]"
160
 
161
  #: options.php:193
 
162
  msgid "Text to show to the author, to manage subscriptions to a given post. Allowed tag: [manager_link]"
163
  msgstr "Testo da mostrare agli utenti gi&agrave; iscritti ad una discussione. Tag consentito: [manager_link]"
164
 
165
  #: options.php:204
 
166
  msgid "Send a notification email to confirm the subscription (to avoid addresses misuse)."
167
  msgstr "Invia una email per confermare l'iscrizione ad un dato articolo (per evitare l'uso scorretto di indirizzi email di terzi)."
168
 
169
  #: options.php:212
 
170
  msgid "Subject of the confirmation email. Allowed tag: [post_title]"
171
  msgstr "Oggetto dell'email di notifica. Tag consentito: [post_title]"
172
 
173
  #: options.php:220
 
174
  msgid "Content of the confirmation email. Allowed tags: [post_permalink], [confirm_link], [post_title], [manager_link]"
175
  msgstr "Contenuto dell'email di conferma. Tag consentiti: [post_permalink], [confirm_link], [post_title], [manager_link]"
176
 
177
  #: options.php:228
 
178
  msgid "Subject of the mail sent to those who request to access their management page. Allowed tag: [blog_name]"
179
  msgstr "Oggetto della mail inviata a coloro che richiedono di poter gestire le proprie sottoscrizioni. Tag consentito: [blog_name]"
180
 
181
  #: options.php:236
 
182
  msgid "Content of the management email. Allowed tags: [blog_name], [manager_link]"
183
  msgstr "Contenuto dell'email di gestione. Tag consentiti: [blog_name],[manager_link]"
184
 
185
  #: options.php:240
 
 
186
  msgid "Save Changes"
187
  msgstr "Salva le opzioni"
188
 
189
- #: subscribe-to-comments-reloaded.php:104
190
  msgid "There is a new comment to [post_title]"
191
  msgstr "Nuovo commento per [post_title]"
192
 
193
- #: subscribe-to-comments-reloaded.php:105
194
  msgid ""
195
  "There is a new comment to [post_title].\n"
196
  "Comment Link: [comment_permalink]\n"
@@ -210,27 +267,27 @@ msgstr ""
210
  "Permalink: [post_permalink]\n"
211
  "Gestisci le tue iscrizioni: [manager_link]"
212
 
213
- #: subscribe-to-comments-reloaded.php:113
214
  msgid "Notify me of followup comments via e-mail. You can also <a href='[subscribe_link]'>subscribe</a> without commenting."
215
  msgstr "Ricevi un avviso se ci sono nuovi commenti. Oppure <a href='[subscribe_link]'>iscriviti</a> senza commentare."
216
 
217
- #: subscribe-to-comments-reloaded.php:115
218
  msgid "You are subscribed to this entry. <a href='[manager_link]'>Manage</a> your subscriptions."
219
  msgstr "Sei gi&agrave; iscritto a quest'articolo. Se vuoi, puoi <a href='[manager_link]'>gestire</a> il tuo profilo."
220
 
221
- #: subscribe-to-comments-reloaded.php:116
222
  msgid "Your subscription to this entry needs to be confirmed. <a href='[manager_link]'>Manage your subscriptions</a>."
223
  msgstr "La tua iscrizione &egrave; in attesa di conferma. Se vuoi, puoi <a href='[manager_link]'>gestire</a> il tuo profilo."
224
 
225
- #: subscribe-to-comments-reloaded.php:117
226
- msgid "You are the author of this entry. <a href='[manager_link]'>Manage</a> its subscriptions."
227
- msgstr "Sei l'autore di quest'articolo. Gestisci gli utenti <a href='[manager_link]'>iscritti</a> alla discussione."
228
 
229
- #: subscribe-to-comments-reloaded.php:119
230
  msgid "Please confirm your subscribtion to [post_title]"
231
  msgstr "Conferma la tua iscrizione a [post_title]"
232
 
233
- #: subscribe-to-comments-reloaded.php:120
234
  msgid ""
235
  "You have requested to be notified every time a new comment is added to:\n"
236
  "[post_permalink]\n"
@@ -246,11 +303,11 @@ msgstr ""
246
  "\n"
247
  "Se credi di aver ricevuto questo messaggio per errore, ti preghiamo di rispondere all'email per contattare l'amministratore."
248
 
249
- #: subscribe-to-comments-reloaded.php:127
250
  msgid "Manage your subscriptions on [blog_name]"
251
  msgstr "Gestisci le tue sottoscrizioni su [blog_name]"
252
 
253
- #: subscribe-to-comments-reloaded.php:128
254
  msgid ""
255
  "You have requested to manage your subscriptions to the articles on [blog_name]. Follow this link to access your personal page:\n"
256
  "[manager_link]"
@@ -258,87 +315,207 @@ msgstr ""
258
  "Hai richiesto di poter gestire le tue sottoscrizioni agli articoli su [blog_name]. Clicca sul link qui di seguito per accedere alla tua area riservata:\n"
259
  "[manager_link]"
260
 
261
- #: templates/author.php:30
262
- msgid "Subscriptions have been successfully updated. In order to cancel or suspend more notifications, select the corresponding checkbox(es) and click on the button at the end of the list."
263
- msgstr "Le tue sottoscrizioni sono state correttamente aggiornate. Se desideri disdire o sospendere ulteriori notifiche, spunta la casella corrispondente all'articolo e clicca sul pusante in fondo alla lista."
 
264
 
265
- #: templates/author.php:33
266
- msgid "You can manage the subscriptions to your articles on this page. In order to cancel or suspend one or more notifications, select the corresponding checkbox(es) and click on the button at the end of the list."
267
- msgstr "Tramite questa pagina puoi gestire le tue sottoscrizioni al mio blog. Se desideri disdire o sospendere una o pi&ugrave; notifiche, spunta le caselle corrispondenti agli articoli e clicca sul pusante in fondo alla lista."
 
 
 
 
 
 
 
 
268
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  #: templates/author.php:39
270
  #: templates/user.php:37
271
  msgid "Please remember: this operation cannot be undone. Are you sure you want to proceed?"
272
  msgstr "Ricorda: questa operazione non pu&ograve; essere annullata. Confermi di voler procedere?"
273
 
274
- #: templates/author.php:44
275
- msgid "Title"
276
- msgstr "Titolo"
277
 
278
- #: templates/author.php:56
279
- #: templates/user.php:49
280
- msgid "Legend: Y: subscribed, N: suspended, C: awaiting confirmation"
281
- msgstr "Legenda: Y: iscritto, N: notifiche sospese, C: in attesa di conferma"
282
 
283
- #: templates/author.php:57
284
- #: templates/user.php:50
285
- msgid "Action:"
286
- msgstr "Azione:"
287
 
288
- #: templates/author.php:57
289
- #: templates/user.php:50
290
- msgid "Delete"
291
- msgstr "Rimuovi"
292
 
293
- #: templates/author.php:58
294
- #: templates/user.php:51
 
 
295
  msgid "Suspend"
296
  msgstr "Sospendi"
297
 
298
- #: templates/author.php:59
299
- #: templates/user.php:52
 
 
300
  msgid "Resume"
301
  msgstr "Riattiva"
302
 
303
- #: templates/author.php:60
304
- #: templates/user.php:53
305
- msgid "Select all"
306
- msgstr "Seleziona tutti"
 
 
 
 
307
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  #: templates/author.php:61
309
  #: templates/user.php:54
310
- msgid "Invert selection"
311
- msgstr "Inverti la selezione"
312
 
 
313
  #: templates/author.php:62
314
  #: templates/user.php:55
 
 
 
 
 
 
 
 
 
 
 
 
315
  msgid "Update subscriptions"
316
  msgstr "Aggiorna sottoscrizioni"
317
 
318
- #: templates/author.php:66
319
- #: templates/user.php:59
320
- msgid "Sorry, no subscriptions found."
321
- msgstr "Spiacente, nessuna sottoscrizione trovata."
 
 
 
 
 
 
 
 
 
 
 
 
322
 
323
- #: templates/author.php:73
324
- msgid "Filters"
325
- msgstr "Filtri"
326
 
327
- #: templates/author.php:76
328
- msgid "If you know the ID of a post you want to manage, enter it in the field here below to see a list of email addresses subscribed to it"
329
- msgstr "Se conosci l'ID dell'articolo che vuoi gestire, inseriscilo nel campo qui di seguito per accedere alla relativa lista di indirizzi email iscritti alla discussione"
330
 
331
- #: templates/author.php:77
332
- msgid "Search post ID"
333
- msgstr "Cerca ID"
334
 
335
- #: templates/author.php:83
336
- msgid "If you know the email address you want to manage, enter it in the field here below to see a list of articles this reader is currently watching"
337
- msgstr "Se conosci l'indirizzo email che vuoi gestire, inseriscilo nel campo qui di seguito per accedere alla relativa lista di articoli che sta attualmente seguendo"
338
 
339
- #: templates/author.php:84
340
- msgid "Search email"
341
- msgstr "Cerca email"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
 
343
  #: templates/confirm.php:17
344
  msgid "Your subscription has been successfully confirmed. Thank you for using our notification service. Now you will receive a message every time someone posts a new comment to"
@@ -395,6 +572,50 @@ msgstr "Le tue sottoscrizioni sono state correttamente aggiornate. Se desideri d
395
  msgid "You can manage your subscriptions to the article of this blog on this page. In order to cancel or suspend one or more notifications, select the corresponding checkbox(es) and click on the button at the end of the list. You are currently subscribed to:"
396
  msgstr "Tramite questa pagina puoi gestire le tue sottoscrizioni al mio blog. Se desideri disdire o sospendere una o pi&ugrave; notifiche, spunta le caselle corrispondenti agli articoli e clicca sul pusante in fondo alla lista. Al momento, risulti iscritto a:"
397
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
  #~ msgid "\"From\" name"
399
  #~ msgstr "Nome del mittente"
400
 
@@ -461,18 +682,9 @@ msgstr "Tramite questa pagina puoi gestire le tue sottoscrizioni al mio blog. Se
461
  #~ msgid "Screen Resolution"
462
  #~ msgstr "Risoluzione schermo"
463
 
464
- #~ msgid "Post Author"
465
- #~ msgstr "Autore articolo"
466
-
467
  #~ msgid "Is equal to"
468
  #~ msgstr "Uguale a"
469
 
470
- #~ msgid "Contains"
471
- #~ msgstr "Contiene"
472
-
473
- #~ msgid "Does not contain"
474
- #~ msgstr "Non contiene"
475
-
476
  #~ msgid "Starts with"
477
  #~ msgstr "Inizia con"
478
 
2
  msgstr ""
3
  "Project-Id-Version: WP Slim Stat 2.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-10-25 14:44-0500\n"
6
+ "PO-Revision-Date: 2010-10-25 14:50-0500\n"
7
  "Last-Translator: Camu <info@duechiacchiere.it>\n"
8
  "Language-Team: due chiacchiere <info@duechiacchiere.it>\n"
9
  "MIME-Version: 1.0\n"
18
 
19
  #: options.php:46
20
  #: options.php:106
21
+ #: options/panel2.php:11
22
+ #: options/panel2.php:56
23
  msgid "Management Page ID"
24
  msgstr "ID Pagina di gestione"
25
 
26
  #: options.php:47
27
  #: options.php:114
28
+ #: options/panel2.php:12
29
+ #: options/panel2.php:64
30
  msgid "Autopurge requests"
31
  msgstr "Pulizia DB"
32
 
33
  #: options.php:48
34
  #: options.php:122
35
+ #: options/panel2.php:13
36
+ #: options/panel2.php:72
37
  msgid "Sender name"
38
  msgstr "Nome del mittente"
39
 
40
  #: options.php:49
41
  #: options.php:130
42
+ #: options/panel2.php:14
43
+ #: options/panel2.php:80
44
  msgid "Sender email address"
45
  msgstr "Indirizzo email mittente"
46
 
47
  #: options.php:50
48
  #: options.php:138
49
+ #: options/panel2.php:19
50
+ #: options/panel3.php:26
51
  msgid "Notification subject"
52
  msgstr "Oggetto della notifica"
53
 
54
  #: options.php:51
55
  #: options.php:146
56
+ #: options/panel2.php:20
57
+ #: options/panel3.php:34
58
  msgid "Notification message"
59
  msgstr "Contenuto della notifica"
60
 
61
  #: options.php:52
62
  #: options.php:154
63
+ #: options/panel2.php:21
64
+ #: options/panel3.php:42
65
  msgid "Checkbox label"
66
  msgstr "Descrizione del checkbox"
67
 
68
  #: options.php:53
69
  #: options.php:162
70
+ #: options/panel2.php:15
71
+ #: options/panel2.php:88
72
  msgid "Checked by default"
73
  msgstr "Spuntato per default"
74
 
75
  #: options.php:54
76
  #: options.php:173
77
+ #: options/panel2.php:22
78
+ #: options/panel3.php:50
79
  msgid "Subscribed label"
80
  msgstr "Descrizione per gli iscritti"
81
 
82
  #: options.php:55
83
  #: options.php:181
84
+ #: options/panel2.php:23
85
+ #: options/panel3.php:58
86
  msgid "Awaiting label"
87
  msgstr "Notifiche in attesa"
88
 
89
  #: options.php:56
90
  #: options.php:189
91
+ #: options/panel2.php:24
92
+ #: options/panel3.php:66
93
  msgid "Author label"
94
  msgstr "Descrizione per l'autore"
95
 
96
  #: options.php:57
97
  #: options.php:197
98
+ #: options/panel2.php:16
99
+ #: options/panel2.php:99
100
  msgid "Enable double check"
101
  msgstr "Attiva doppia conferma"
102
 
103
  #: options.php:58
104
  #: options.php:208
105
+ #: options/panel2.php:25
106
+ #: options/panel3.php:74
107
  msgid "Double check subject"
108
  msgstr "Oggetto doppia conferma"
109
 
110
  #: options.php:59
111
  #: options.php:216
112
+ #: options/panel2.php:26
113
+ #: options/panel3.php:82
114
  msgid "Double check message"
115
  msgstr "Contenuto doppia conferma"
116
 
117
  #: options.php:60
118
  #: options.php:224
119
+ #: options/panel2.php:27
120
+ #: options/panel3.php:90
121
  msgid "Management subject"
122
  msgstr "Oggetto email di gestione"
123
 
124
  #: options.php:61
125
  #: options.php:232
126
+ #: options/panel2.php:28
127
+ #: options/panel3.php:98
128
  msgid "Management message"
129
  msgstr "Contenuto email di gestione"
130
 
131
  #: options.php:67
132
+ #: options/panel2.php:33
133
  msgid "Your settings have been successfully updated."
134
  msgstr "La configurazione &egrave; stata aggiornata con successo."
135
 
136
  #: options.php:74
137
+ #: options/panel2.php:36
138
  msgid "There was an error updating the following fields:"
139
  msgstr "Si &egrave; verificato un errore nell'aggiornamento dei seguenti campi:"
140
 
143
  msgstr "Sottoscrivi i commenti"
144
 
145
  #: options.php:110
146
+ #: options/panel2.php:60
147
  msgid "The ID (<strong>not the permalink!</strong>) of the management page you created."
148
  msgstr "L'ID (<strong>non il permalink!</strong>) della pagina di gestione che hai creato."
149
 
150
  #: options.php:118
151
+ #: options/panel2.php:68
152
  msgid "Delete pending subscriptions (not confirmed) after X days. Zero disables this feature."
153
  msgstr "Cancella le iscrizioni non confermate dopo X giorni. Zero disabilita la funzione."
154
 
155
  #: options.php:126
156
+ #: options/panel2.php:76
157
  msgid "Name to use for the \"from\" field when sending a new notification to the user."
158
  msgstr "Nome da usare nel campo From quando il sistema invia una notifica all'utente."
159
 
160
  #: options.php:134
161
+ #: options/panel2.php:84
162
  msgid "Email address to use for the \"from\" field when sending a new notification to the user."
163
  msgstr "Indirizzo email da usare nel campo From."
164
 
165
  #: options.php:142
166
+ #: options/panel3.php:30
167
  msgid "Subject of the notification email. Allowed tag: [post_title]"
168
  msgstr "Oggetto dell'email di notifica. Tag consentito: [post_title]"
169
 
170
  #: options.php:150
171
+ #: options/panel3.php:38
172
  msgid "Content of the notification email. Allowed tags: [post_title], [comment_permalink], [comment_author], [comment_content], [post_permalink], [manager_link]"
173
  msgstr "Contenuto del messaggio di notifica. Tag consentiti: [post_title], [comment_permalink], [comment_author], [comment_content], [post_permalink], [manager_link]"
174
 
175
  #: options.php:158
176
+ #: options/panel3.php:46
177
  msgid "Text to show next to the checkbox added to the comment form. Allowed tag: [subscribe_link]"
178
  msgstr "Testo da mostrare accanto al checkbox mostrato nel modulo del commento. Tag consentito: [subscribe_link]"
179
 
180
  #: options.php:164
181
  #: options.php:199
182
+ #: options/panel2.php:90
183
+ #: options/panel2.php:101
184
+ #: options/panel2.php:112
185
  msgid "Yes"
186
  msgstr "Si"
187
 
188
  #: options.php:165
189
  #: options.php:200
190
+ #: options/panel2.php:91
191
+ #: options/panel2.php:102
192
+ #: options/panel2.php:113
193
  msgid "No"
194
  msgstr "No"
195
 
198
  msgstr "Invia una email per confermare l'iscrizione ad un dato articolo (per evitare l'uso scorretto di indirizzi email di terzi)"
199
 
200
  #: options.php:177
201
+ #: options/panel3.php:54
202
  msgid "Text to show to those users who are already subscribed. Allowed tag: [manager_link]"
203
  msgstr "Testo da mostrare agli utenti gi&agrave; iscritti ad una discussione. Tag consentito: [manager_link]"
204
 
205
  #: options.php:185
206
+ #: options/panel3.php:62
207
  msgid "Text to show to those users who are already subscribed, but haven't clicked on the confirmation link yet. Allowed tag: [manager_link]"
208
  msgstr "Testo da mostrare agli utenti gi&agrave; iscritti ad una discussione, ma che non hanno ancora cliccato sul link di conferma. Tag consentito: [manager_link]"
209
 
210
  #: options.php:193
211
+ #: options/panel3.php:70
212
  msgid "Text to show to the author, to manage subscriptions to a given post. Allowed tag: [manager_link]"
213
  msgstr "Testo da mostrare agli utenti gi&agrave; iscritti ad una discussione. Tag consentito: [manager_link]"
214
 
215
  #: options.php:204
216
+ #: options/panel2.php:106
217
  msgid "Send a notification email to confirm the subscription (to avoid addresses misuse)."
218
  msgstr "Invia una email per confermare l'iscrizione ad un dato articolo (per evitare l'uso scorretto di indirizzi email di terzi)."
219
 
220
  #: options.php:212
221
+ #: options/panel3.php:78
222
  msgid "Subject of the confirmation email. Allowed tag: [post_title]"
223
  msgstr "Oggetto dell'email di notifica. Tag consentito: [post_title]"
224
 
225
  #: options.php:220
226
+ #: options/panel3.php:86
227
  msgid "Content of the confirmation email. Allowed tags: [post_permalink], [confirm_link], [post_title], [manager_link]"
228
  msgstr "Contenuto dell'email di conferma. Tag consentiti: [post_permalink], [confirm_link], [post_title], [manager_link]"
229
 
230
  #: options.php:228
231
+ #: options/panel3.php:94
232
  msgid "Subject of the mail sent to those who request to access their management page. Allowed tag: [blog_name]"
233
  msgstr "Oggetto della mail inviata a coloro che richiedono di poter gestire le proprie sottoscrizioni. Tag consentito: [blog_name]"
234
 
235
  #: options.php:236
236
+ #: options/panel3.php:102
237
  msgid "Content of the management email. Allowed tags: [blog_name], [manager_link]"
238
  msgstr "Contenuto dell'email di gestione. Tag consentiti: [blog_name],[manager_link]"
239
 
240
  #: options.php:240
241
+ #: options/panel2.php:121
242
+ #: options/panel3.php:106
243
  msgid "Save Changes"
244
  msgstr "Salva le opzioni"
245
 
246
+ #: subscribe-to-comments-reloaded.php:108
247
  msgid "There is a new comment to [post_title]"
248
  msgstr "Nuovo commento per [post_title]"
249
 
250
+ #: subscribe-to-comments-reloaded.php:109
251
  msgid ""
252
  "There is a new comment to [post_title].\n"
253
  "Comment Link: [comment_permalink]\n"
267
  "Permalink: [post_permalink]\n"
268
  "Gestisci le tue iscrizioni: [manager_link]"
269
 
270
+ #: subscribe-to-comments-reloaded.php:117
271
  msgid "Notify me of followup comments via e-mail. You can also <a href='[subscribe_link]'>subscribe</a> without commenting."
272
  msgstr "Ricevi un avviso se ci sono nuovi commenti. Oppure <a href='[subscribe_link]'>iscriviti</a> senza commentare."
273
 
274
+ #: subscribe-to-comments-reloaded.php:118
275
  msgid "You are subscribed to this entry. <a href='[manager_link]'>Manage</a> your subscriptions."
276
  msgstr "Sei gi&agrave; iscritto a quest'articolo. Se vuoi, puoi <a href='[manager_link]'>gestire</a> il tuo profilo."
277
 
278
+ #: subscribe-to-comments-reloaded.php:119
279
  msgid "Your subscription to this entry needs to be confirmed. <a href='[manager_link]'>Manage your subscriptions</a>."
280
  msgstr "La tua iscrizione &egrave; in attesa di conferma. Se vuoi, puoi <a href='[manager_link]'>gestire</a> il tuo profilo."
281
 
282
+ #: subscribe-to-comments-reloaded.php:120
283
+ msgid "You can <a href='[manager_link]'>manage the subscriptions</a> of this entry."
284
+ msgstr "Gestisci gli utenti <a href='[manager_link]'>iscritti</a> alla discussione."
285
 
286
+ #: subscribe-to-comments-reloaded.php:121
287
  msgid "Please confirm your subscribtion to [post_title]"
288
  msgstr "Conferma la tua iscrizione a [post_title]"
289
 
290
+ #: subscribe-to-comments-reloaded.php:122
291
  msgid ""
292
  "You have requested to be notified every time a new comment is added to:\n"
293
  "[post_permalink]\n"
303
  "\n"
304
  "Se credi di aver ricevuto questo messaggio per errore, ti preghiamo di rispondere all'email per contattare l'amministratore."
305
 
306
+ #: subscribe-to-comments-reloaded.php:129
307
  msgid "Manage your subscriptions on [blog_name]"
308
  msgstr "Gestisci le tue sottoscrizioni su [blog_name]"
309
 
310
+ #: subscribe-to-comments-reloaded.php:130
311
  msgid ""
312
  "You have requested to manage your subscriptions to the articles on [blog_name]. Follow this link to access your personal page:\n"
313
  "[manager_link]"
315
  "Hai richiesto di poter gestire le tue sottoscrizioni agli articoli su [blog_name]. Clicca sul link qui di seguito per accedere alla tua area riservata:\n"
316
  "[manager_link]"
317
 
318
+ #: subscribe-to-comments-reloaded.php:136
319
+ #: options/index.php:44
320
+ msgid "Manage subscriptions"
321
+ msgstr "Gestisci sottoscrizioni"
322
 
323
+ #: subscribe-to-comments-reloaded.php:137
324
+ msgid "Oops, Huston we have a problem! Please contact the administrator of this blog for further details."
325
+ msgstr "Ouch, Huston abbiamo un problema! Per favore contatta l'amministratore di questo blog per maggiori informazioni."
326
+
327
+ #: options/index.php:45
328
+ msgid "Options"
329
+ msgstr "Opzioni"
330
+
331
+ #: options/index.php:46
332
+ msgid "Messages"
333
+ msgstr "Messaggi"
334
 
335
+ #: options/index.php:47
336
+ msgid "Support"
337
+ msgstr "Supporto"
338
+
339
+ #: options/panel1.php:28
340
+ #: options/panel1.php:33
341
+ msgid "The status has been successfully updated. Rows affected:"
342
+ msgstr "Stato aggiornato con successo. Righe coinvolte:"
343
+
344
+ #: options/panel1.php:50
345
+ msgid "The status has been successfully updated."
346
+ msgstr "Stato aggiornato con successo."
347
+
348
+ #: options/panel1.php:53
349
+ #: options/panel1.php:59
350
+ msgid "Update email address"
351
+ msgstr "Aggiorna indirizzo email"
352
+
353
+ #: options/panel1.php:54
354
+ msgid "You can \"mass update\" all the occurrences of a given email address in the database with a new one."
355
+ msgstr "Puoi effettuare un aggiornamento globale di tutte le occorrenze nel database di un indirizzo email con uno nuovo."
356
+
357
+ #: options/panel1.php:56
358
+ #: options/panel1.php:96
359
  #: templates/author.php:39
360
  #: templates/user.php:37
361
  msgid "Please remember: this operation cannot be undone. Are you sure you want to proceed?"
362
  msgstr "Ricorda: questa operazione non pu&ograve; essere annullata. Confermi di voler procedere?"
363
 
364
+ #: options/panel1.php:58
365
+ msgid "From"
366
+ msgstr "Da"
367
 
368
+ #: options/panel1.php:58
369
+ msgid "To"
370
+ msgstr "In"
 
371
 
372
+ #: options/panel1.php:64
373
+ msgid "Remove or suspend email address"
374
+ msgstr "Rimuovi o sospendi un indirizzo email"
 
375
 
376
+ #: options/panel1.php:65
377
+ msgid "Change the status or permanently delete all the subscriptions for a given email address."
378
+ msgstr "Cambia lo stato o cancella tutte le sottoscrizioni associate ad un dato indirizzo email."
 
379
 
380
+ #: options/panel1.php:70
381
+ #: options/panel1.php:131
382
+ #: templates/author.php:59
383
+ #: templates/user.php:52
384
  msgid "Suspend"
385
  msgstr "Sospendi"
386
 
387
+ #: options/panel1.php:71
388
+ #: options/panel1.php:132
389
+ #: templates/author.php:60
390
+ #: templates/user.php:53
391
  msgid "Resume"
392
  msgstr "Riattiva"
393
 
394
+ #: options/panel1.php:72
395
+ #: options/panel1.php:130
396
+ msgid "Delete forever"
397
+ msgstr "Cancella definitivamente"
398
+
399
+ #: options/panel1.php:74
400
+ msgid "Update"
401
+ msgstr "Aggiorna"
402
 
403
+ #: options/panel1.php:78
404
+ msgid "Search email address"
405
+ msgstr "Cerca indirizzo email"
406
+
407
+ #: options/panel1.php:80
408
+ msgid "Find all the subscriptions where <b>email</b>"
409
+ msgstr "Trova tutte le sottoscrizioni dove l'<b>indirizzo email</b>"
410
+
411
+ #: options/panel1.php:82
412
+ msgid "equals"
413
+ msgstr "&egrave; uguale a"
414
+
415
+ #: options/panel1.php:83
416
+ msgid "contains"
417
+ msgstr "contiene"
418
+
419
+ #: options/panel1.php:84
420
+ msgid "does not contain"
421
+ msgstr "non contiene"
422
+
423
+ #: options/panel1.php:87
424
+ msgid "Search"
425
+ msgstr "Cerca"
426
+
427
+ #: options/panel1.php:118
428
+ msgid "Subscriptions for:"
429
+ msgstr "Sottoscrizioni per:"
430
+
431
+ #: options/panel1.php:119
432
+ #: templates/author.php:46
433
+ #: templates/user.php:43
434
+ msgid "Legend: Y: subscribed, N: suspended, C: awaiting confirmation"
435
+ msgstr "Legenda: Y: iscritto, N: notifiche sospese, C: in attesa di conferma"
436
+
437
+ #: options/panel1.php:128
438
  #: templates/author.php:61
439
  #: templates/user.php:54
440
+ msgid "Select all"
441
+ msgstr "Seleziona tutti"
442
 
443
+ #: options/panel1.php:129
444
  #: templates/author.php:62
445
  #: templates/user.php:55
446
+ msgid "Invert selection"
447
+ msgstr "Inverti la selezione"
448
+
449
+ #: options/panel1.php:130
450
+ #: templates/author.php:58
451
+ #: templates/user.php:51
452
+ msgid "Action:"
453
+ msgstr "Azione:"
454
+
455
+ #: options/panel1.php:133
456
+ #: templates/author.php:63
457
+ #: templates/user.php:56
458
  msgid "Update subscriptions"
459
  msgstr "Aggiorna sottoscrizioni"
460
 
461
+ #: options/panel1.php:138
462
+ msgid "Sorry, no subscriptions found for"
463
+ msgstr "Spiacente, nessuna sottoscrizione trovata per"
464
+
465
+ #: options/panel2.php:17
466
+ #: options/panel2.php:110
467
+ msgid "Notify authors"
468
+ msgstr "Notifica autori"
469
+
470
+ #: options/panel2.php:95
471
+ msgid "Decide if the checkbox should be checked by default or not."
472
+ msgstr "Scegli se il checkbox deve essere preselezionato per default o no."
473
+
474
+ #: options/panel2.php:117
475
+ msgid "Notify authors when a new comment is posted to one of their articles."
476
+ msgstr "Invia una notifica anche all'autore dell'articolo."
477
 
478
+ #: options/panel4.php:22
479
+ msgid "How valuable is the feature offered by this plugin to your visitors? Subscribe to Comments Reloaded is and will always be free, but consider supporting the author if this plugin made your web site better, especially if you are making money out of it. Any donation received will be reinvested in the development of Subscribe to Comments Reloaded, and to buy some food for my hungry family."
480
+ msgstr "Quanto è importante il valore aggiunto offerto dal mio plugin ai tuoi visitatori? Subscribe to Comments Reloaded &egrave; e sar&agrave; sempre gratuito, ma se vuoi puoi supportare l'autore con un piccolo contributo. Specialmente se stai usando questo plugin su un sito commerciale e se ritieni che questo plugin abbia contribuito a rendere il tuo lavoro migliore. Il denaro ricevuto sarà reinvestito nello sviluppo di Subscribe to Comments reloaded (hosting, programmi, ecc) e per comprare un po' di cibo per la mia famiglia affamata."
481
 
482
+ #: options/panel4.php:28
483
+ msgid "Don't want to donate? You can still help"
484
+ msgstr "Non ti va di donare soldi?"
485
 
486
+ #: options/panel4.php:29
487
+ msgid "If you don't want to donate money, please consider blogging about my plugin with a link to the plugin's page. Please let your readers know what makes your blog better. You can also contribute donating your time: do not hesitate to send me bug reports, your localization files, ideas on how to improve Subscribe to Comments Reloaded and so on. Whatever you do, thanks for using my plugin!"
488
+ msgstr "Se non ritieni opportuno donare una cifra in denaro, puoi sempre scrivere un post sul tuo blog che parli di Subscribe to Comments Reloaded, ed aggiungere un link alla pagina sul mio blog. Farai un favore sia ai tuoi visitatori che a me, se deciderai di parlarne. Volendo, puoi anche donare un po' del tuo tempo: mandami un messaggio sul forum se trovi un errore, la localizzazione dell'interfaccia, o semplicemente un'idea per rendere il plugin sempre migliore. Qualsiasi cosa tu decida di fare, grazie per star usando il mio plugin!"
489
 
490
+ #: options/panel4.php:31
491
+ msgid "Vote and show your appreciation"
492
+ msgstr "Vota e condividi"
493
 
494
+ #: options/panel4.php:32
495
+ msgid "Tell other people if Subscribe to Comments Reloaded works for you and how good it is. <a href=\"http://wordpress.org/extend/plugins/subscribe-to-comments-reloaded/\">Rate it</a> on its Plugin Directory page."
496
+ msgstr "Fai sapere agli altri se Subscribe to Comments Reloaded funziona bene e quanto ti piace. <a href=\"http://wordpress.org/extend/plugins/subscribe-to-comments-reloaded/\">Votalo</a> sulla pagina apposita di Wordpress."
497
+
498
+ #: templates/author.php:30
499
+ msgid "Subscriptions have been successfully updated. In order to cancel or suspend more notifications, select the corresponding checkbox(es) and click on the button at the end of the list."
500
+ msgstr "Le tue sottoscrizioni sono state correttamente aggiornate. Se desideri disdire o sospendere ulteriori notifiche, spunta la casella corrispondente all'articolo e clicca sul pusante in fondo alla lista."
501
+
502
+ #: templates/author.php:33
503
+ msgid "You can manage the subscriptions to your articles on this page. In order to cancel or suspend one or more notifications, select the corresponding checkbox(es) and click on the button at the end of the list."
504
+ msgstr "Tramite questa pagina puoi gestire le tue sottoscrizioni al mio blog. Se desideri disdire o sospendere una o pi&ugrave; notifiche, spunta le caselle corrispondenti agli articoli e clicca sul pusante in fondo alla lista."
505
+
506
+ #: templates/author.php:44
507
+ msgid "Title"
508
+ msgstr "Titolo"
509
+
510
+ #: templates/author.php:58
511
+ #: templates/user.php:51
512
+ msgid "Delete"
513
+ msgstr "Rimuovi"
514
+
515
+ #: templates/author.php:67
516
+ #: templates/user.php:60
517
+ msgid "Sorry, no subscriptions found."
518
+ msgstr "Spiacente, nessuna sottoscrizione trovata."
519
 
520
  #: templates/confirm.php:17
521
  msgid "Your subscription has been successfully confirmed. Thank you for using our notification service. Now you will receive a message every time someone posts a new comment to"
572
  msgid "You can manage your subscriptions to the article of this blog on this page. In order to cancel or suspend one or more notifications, select the corresponding checkbox(es) and click on the button at the end of the list. You are currently subscribed to:"
573
  msgstr "Tramite questa pagina puoi gestire le tue sottoscrizioni al mio blog. Se desideri disdire o sospendere una o pi&ugrave; notifiche, spunta le caselle corrispondenti agli articoli e clicca sul pusante in fondo alla lista. Al momento, risulti iscritto a:"
574
 
575
+ #~ msgid ""
576
+ #~ "If you know the ID of a post you want to manage, enter it in the field "
577
+ #~ "here below to see a list of email addresses subscribed to it"
578
+ #~ msgstr ""
579
+ #~ "Se conosci l'ID dell'articolo che vuoi gestire, inseriscilo nel campo qui "
580
+ #~ "di seguito per accedere alla relativa lista di indirizzi email iscritti "
581
+ #~ "alla discussione"
582
+
583
+ #~ msgid "Search post ID"
584
+ #~ msgstr "Cerca ID"
585
+
586
+ #~ msgid ""
587
+ #~ "If you know the email address you want to manage, enter it in the field "
588
+ #~ "here below to see a list of articles this reader is currently watching"
589
+ #~ msgstr ""
590
+ #~ "Se conosci l'indirizzo email che vuoi gestire, inseriscilo nel campo qui "
591
+ #~ "di seguito per accedere alla relativa lista di articoli che sta "
592
+ #~ "attualmente seguendo"
593
+
594
+ #~ msgid "Search email"
595
+ #~ msgstr "Cerca email"
596
+
597
+ #~ msgid "Search by email address"
598
+ #~ msgstr "Cerca per indirizzo email"
599
+
600
+ #~ msgid ""
601
+ #~ "You are the author of this entry. <a href='[manager_link]'>Manage</a> its "
602
+ #~ "subscriptions."
603
+ #~ msgstr ""
604
+ #~ "Sei l'autore di quest'articolo. Gestisci gli utenti <a "
605
+ #~ "href='[manager_link]'>iscritti</a> alla discussione."
606
+
607
+ #~ msgid "Filters"
608
+ #~ msgstr "Filtri"
609
+
610
+ #~ msgid "Manage posts"
611
+ #~ msgstr "Gestisci articoli"
612
+
613
+ #~ msgid "Search by post ID"
614
+ #~ msgstr "Cerca per ID dell'articolo"
615
+
616
+ #~ msgid "Thank you"
617
+ #~ msgstr "Grazie"
618
+
619
  #~ msgid "\"From\" name"
620
  #~ msgstr "Nome del mittente"
621
 
682
  #~ msgid "Screen Resolution"
683
  #~ msgstr "Risoluzione schermo"
684
 
 
 
 
685
  #~ msgid "Is equal to"
686
  #~ msgstr "Uguale a"
687
 
 
 
 
 
 
 
688
  #~ msgid "Starts with"
689
  #~ msgstr "Inizia con"
690
 
options/index.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Avoid direct access to this piece of code
4
+ if (__FILE__ == $_SERVER['SCRIPT_FILENAME'] ) {
5
+ header('Location: /');
6
+ exit;
7
+ }
8
+
9
+ function subscribe_reloaded_update_option( $_option, $_value, $_type ){
10
+ if (!isset($_value)) return true;
11
+ switch($_type){
12
+ case 'yesno':
13
+ if ($_value=='yes' || $_value=='no'){
14
+ update_option($_option, $_value);
15
+ return true;
16
+ }
17
+
18
+ break;
19
+ case 'integer':
20
+ update_option($_option, abs(intval($_value)));
21
+
22
+ return true;
23
+ break;
24
+
25
+ default:
26
+ update_option($_option, str_replace('"', "'", $_value));
27
+ return true;
28
+ break;
29
+ }
30
+
31
+ return false;
32
+ }
33
+
34
+ function subscribe_reloaded_get_option($_option, $_default){
35
+ $value = get_option($_option, $_default);
36
+ return stripslashes($value);
37
+ }
38
+
39
+ // Load localization files
40
+ load_plugin_textdomain('subscribe-reloaded', WP_PLUGIN_DIR .'/subscribe-to-comments-reloaded/langs', '/subscribe-to-comments-reloaded/langs');
41
+
42
+ // Define the panels
43
+ $array_panels = array(
44
+ __('Manage subscriptions','subscribe-reloaded'),
45
+ __('Options','subscribe-reloaded'),
46
+ __('Messages','subscribe-reloaded'),
47
+ __('Support','subscribe-reloaded')
48
+ );
49
+
50
+ // What panel to display
51
+ $current_panel = empty($_GET['subscribepanel'])?1:intval($_GET['subscribepanel']);
52
+
53
+ // Text direction
54
+ if ($wp_locale->text_direction != 'ltr') $array_panels = array_reverse($array_panels, true);
55
+
56
+ ?>
57
+ <div class="wrap">
58
+ <div id="subscribe-to-comments-icon" class="<?php echo $wp_locale->text_direction ?>"></div>
59
+ <h2 class="medium">
60
+ <?php
61
+ foreach($array_panels as $a_panel_id => $a_panel_details){
62
+ echo '<a class="menu-tabs';
63
+ if ($current_panel != $a_panel_id+1) echo ' menu-tab-inactive';
64
+ echo '" href="admin.php?page=subscribe-to-comments-reloaded/options/index.php&subscribepanel='.($a_panel_id+1).'">'.$a_panel_details.'</a>';
65
+ }
66
+ ?>
67
+ </h2>
68
+
69
+
70
+ <?php if (is_readable(WP_PLUGIN_DIR."/subscribe-to-comments-reloaded/options/panel$current_panel.php")) require_once(WP_PLUGIN_DIR."/subscribe-to-comments-reloaded/options/panel$current_panel.php"); ?>
71
+
72
+ </div>
options/panel1.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Avoid direct access to this piece of code
3
+ if (strpos($_SERVER['SCRIPT_FILENAME'], basename(__FILE__))){
4
+ header('Location: /');
5
+ exit;
6
+ }
7
+
8
+ if (!empty($_POST['subscription_list']) && !empty($_POST['action_type'])){
9
+ foreach($_POST['subscription_list'] as $a_subscription){
10
+ list($post_list_array[],$email_list_array[]) = explode(',', $a_subscription);
11
+ }
12
+ $post_list = implode("','", $post_list_array);
13
+ $email_list = implode("','", $email_list_array);
14
+ $rows_affected = 0;
15
+ switch($_POST['action_type']){
16
+ case 'd':
17
+ $rows_affected = $wpdb->query("DELETE FROM $wp_subscribe_reloaded->table_subscriptions WHERE `post_ID` IN ('$post_list') AND `email` IN ('$email_list')");
18
+ break;
19
+ case 's':
20
+ $rows_affected = $wpdb->query("UPDATE $wp_subscribe_reloaded->table_subscriptions SET `status` = 'N' WHERE `post_ID` IN ('$post_list') AND `email` IN ('$email_list')");
21
+ break;
22
+ case 'a':
23
+ $rows_affected = $wpdb->query("UPDATE $wp_subscribe_reloaded->table_subscriptions SET `status` = 'Y' WHERE `post_ID` IN ('$post_list') AND `email` IN ('$email_list')");
24
+ break;
25
+ default:
26
+ break;
27
+ }
28
+ echo '<div class="updated fade"><p>'.__('The status has been successfully updated. Rows affected:', 'subscribe-reloaded')." $rows_affected</p></div>";
29
+ }
30
+ if (!empty($_POST['old_sre']) && !empty($_POST['action_type']) && $_POST['action_type'] == 'u'){
31
+ $clean_old_email = !empty($_POST['old_sre'])?$wp_subscribe_reloaded->clean_email($_POST['old_sre']):(!empty($_GET['old_sre'])?$wp_subscribe_reloaded->clean_email($_GET['old_sre']):'');
32
+ $rows_affected = $wpdb->query("UPDATE $wp_subscribe_reloaded->table_subscriptions SET `email` = '$clean_email' WHERE `email` = '$clean_old_email'");
33
+ echo '<div class="updated fade"><p>'.__('The status has been successfully updated. Rows affected:', 'subscribe-reloaded')." $rows_affected</p></div>";
34
+ }
35
+ if (!empty($_POST['mass_update']) && !empty($_POST['sre']) && !empty($_POST['action_type'])){
36
+ $clean_email = $wp_subscribe_reloaded->clean_email($_POST['sre']);
37
+ switch($_POST['action_type']){
38
+ case 'd':
39
+ $wpdb->query("DELETE FROM $wp_subscribe_reloaded->table_subscriptions WHERE `email` = '$clean_email'");
40
+ break;
41
+ case 's':
42
+ $wpdb->query("UPDATE $wp_subscribe_reloaded->table_subscriptions SET `status` = 'N' WHERE `email` = '$clean_email'");
43
+ break;
44
+ case 'a':
45
+ $wpdb->query("UPDATE $wp_subscribe_reloaded->table_subscriptions SET `status` = 'Y' WHERE `email` = '$clean_email'");
46
+ break;
47
+ default:
48
+ break;
49
+ }
50
+ echo '<div class="updated fade"><p>'.__('The status has been successfully updated.', 'subscribe-reloaded')." $rows_affected</p></div>";
51
+ }
52
+ ?>
53
+ <h3><?php _e('Update email address','subscribe-reloaded') ?></h3>
54
+ <p><?php _e('You can "mass update" all the occurrences of a given email address in the database with a new one.','subscribe-reloaded') ?></p>
55
+ <form action="admin.php?page=subscribe-to-comments-reloaded/options/index.php&subscribepanel=1" method="post" id="update_address_form"
56
+ onsubmit="return confirm('<?php _e('Please remember: this operation cannot be undone. Are you sure you want to proceed?', 'subscribe-reloaded') ?>')">
57
+ <fieldset style="border:0">
58
+ <p><?php _e('From','subscribe-reloaded') ?> &nbsp;<input type='text' size='40' name='old_sre' value='' /> <?php _e('To','subscribe-reloaded') ?> &nbsp; <input type='text' size='40' name='sre' value='' />
59
+ <input type='submit' class='subscribe-form-button' value='<?php _e('Update email address','subscribe-reloaded') ?>' /></p>
60
+ <input type='hidden' name='action_type' value='u'/>
61
+ </fieldset>
62
+ </form>
63
+
64
+ <h3><?php _e('Remove or suspend email address','subscribe-reloaded') ?></h3>
65
+ <p><?php _e('Change the status or permanently delete all the subscriptions for a given email address.','subscribe-reloaded') ?></p>
66
+ <form action="admin.php?page=subscribe-to-comments-reloaded/options/index.php&subscribepanel=1" method="post">
67
+ <p><input type="text" size="40" name="sre" value="" />
68
+ <select name="action_type">
69
+ <option value=''>-------------</option>
70
+ <option value='s'><?php _e('Suspend','subscribe-reloaded') ?></option>
71
+ <option value='a'><?php _e('Resume','subscribe-reloaded') ?></option>
72
+ <option value='d'><?php _e('Delete forever','subscribe-reloaded') ?></option>
73
+ </select>
74
+ <input type="submit" class="subscribe-form-button" value="<?php _e('Update','subscribe-reloaded') ?>" />
75
+ </p>
76
+ </form>
77
+
78
+ <h3><?php _e('Search email address','subscribe-reloaded') ?></h3>
79
+ <form action="admin.php?page=subscribe-to-comments-reloaded/options/index.php&subscribepanel=1" method="post">
80
+ <p><?php _e('Find all the subscriptions where <b>email</b>','subscribe-reloaded') ?>&nbsp;
81
+ <select name="search_type">
82
+ <option value='e'><?php _e('equals','subscribe-reloaded') ?></option>
83
+ <option value='c'><?php _e('contains','subscribe-reloaded') ?></option>
84
+ <option value='n'><?php _e('does not contain','subscribe-reloaded') ?></option>
85
+ </select>
86
+ <input type="text" size="40" name="sre" value="" />
87
+ <input type="submit" class="subscribe-form-button" value="<?php _e('Search','subscribe-reloaded') ?>" /></p>
88
+ </form>
89
+
90
+ <?php
91
+ $clean_email = !empty($_POST['sre'])?$wp_subscribe_reloaded->clean_email($_POST['sre']):(!empty($_GET['sre'])?$wp_subscribe_reloaded->clean_email($_GET['sre']):'');
92
+ if (empty($clean_email) && empty($_POST['post_list']) && empty($_POST['action_type'])) return;
93
+ ?>
94
+
95
+ <form action="admin.php?page=subscribe-to-comments-reloaded/options/index.php<?php if(!empty($current_panel)) echo '&subscribepanel='.$current_panel; ?>" method="post" id="post_list_form"
96
+ onsubmit="return confirm('<?php _e('Please remember: this operation cannot be undone. Are you sure you want to proceed?', 'subscribe-reloaded') ?>')">
97
+ <fieldset style="border:0">
98
+ <?php
99
+ $search_type = !empty($_POST['search_type'])?$_POST['search_type']:'';
100
+ switch($search_type){
101
+ case 'c':
102
+ $where_clause = "`email` LIKE '%$clean_email%'";
103
+ break;
104
+ case 'n':
105
+ $where_clause = "`email` NOT LIKE '%$clean_email%'";
106
+ break;
107
+ default:
108
+ $where_clause = "`email` = '$clean_email'";
109
+ break;
110
+ }
111
+ $sql = "SELECT `email`, `status`, `post_ID`, `dt`
112
+ FROM $wp_subscribe_reloaded->table_subscriptions
113
+ WHERE $where_clause
114
+ ORDER BY `status` ASC, `post_ID` ASC";
115
+
116
+ $subscriptions = $wpdb->get_results($sql, OBJECT);
117
+ if (is_array($subscriptions) && !empty($subscriptions)){
118
+ echo '<p>'.__('Subscriptions for:','subscribe-reloaded')." <b>$clean_email</b></p>";
119
+ echo '<p>'.__('Legend: Y: subscribed, N: suspended, C: awaiting confirmation','subscribe-reloaded').'</p>';
120
+ echo '<ul>';
121
+ foreach($subscriptions as $a_subscription){
122
+ $permalink = get_permalink($a_subscription->post_ID);
123
+ $title = get_the_title($a_subscription->post_ID);
124
+ $specific_email = (($_POST['search_type'] == 'c') || ($_POST['search_type'] == 'n'))?"$a_subscription->email] [":'';
125
+ echo "<li><input type='checkbox' name='subscription_list[]' value='$a_subscription->post_ID,$a_subscription->email' id='sub_{$a_subscription->dt}'/> <label for='sub_{$a_subscription->dt}'><a href='$permalink'>$title</a></label> [$specific_email$a_subscription->status]</li>\n";
126
+ }
127
+ echo '</ul>';
128
+ echo '<p><a class="small-text" href="#" onclick="t=document.getElementById(\'post_list_form\').elements;for(i in t) t[i].checked=1">'.__('Select all','subscribe-reloaded').'</a> - ';
129
+ echo '<a class="small-text" href="#" onclick="t=document.getElementById(\'post_list_form\').elements;for(i in t)if(t[i].checked==1){t[i].checked=0} else{t[i].checked=1}">'.__('Invert selection','subscribe-reloaded').'</a></p>';
130
+ echo '<p>'.__('Action:','subscribe-reloaded').' <input type="radio" name="action_type" value="d" id="action_type_delete" /> <label for="action_type_delete">'.__('Delete forever','subscribe-reloaded').'</label> &nbsp;&nbsp;&nbsp;&nbsp; ';
131
+ echo '<input type="radio" name="action_type" value="s" id="action_type_suspend" checked="checked" /> <label for="action_type_suspend">'.__('Suspend','subscribe-reloaded').'</label> &nbsp;&nbsp;&nbsp;&nbsp; ';
132
+ echo '<input type="radio" name="action_type" value="a" id="action_type_activate" /> <label for="action_type_activate">'.__('Resume','subscribe-reloaded').'</label></p>';
133
+ echo '<p><input type="submit" class="subscribe-form-button" value="'.__('Update subscriptions','subscribe-reloaded').'" /></p>';
134
+ if (!empty($clean_email)) echo "<input type='hidden' name='sre' value='$clean_email'/>";
135
+ if (!empty($_POST['search_type'])) echo "<input type='hidden' name='search_type' value='{$_POST['search_type']}'/>";
136
+ }
137
+ else{
138
+ echo '<p>'.__('Sorry, no subscriptions found for','subscribe-reloaded')." <b>$clean_email</b></p>";
139
+ }
140
+ ?>
141
+ </fieldset>
142
+ </form>
options.php → options/panel2.php RENAMED
@@ -1,60 +1,27 @@
1
- <?php
2
-
3
  // Avoid direct access to this piece of code
4
- if (!function_exists('current_user_can') || !current_user_can('manage_options')){
5
- header('Location: /');
6
- exit;
7
- }
8
-
9
- function subscribe_reloaded_update_option( $_option, $_value, $_type ){
10
- if (!isset($_value)) return true;
11
- switch($_type){
12
- case 'yesno':
13
- if ($_value=='yes' || $_value=='no'){
14
- update_option($_option, $_value);
15
- return true;
16
- }
17
-
18
- break;
19
- case 'integer':
20
- update_option($_option, abs(intval($_value)));
21
-
22
- return true;
23
- break;
24
-
25
- default:
26
- update_option($_option, str_replace('"', "'", $_value));
27
- return true;
28
- break;
29
- }
30
-
31
- return false;
32
- }
33
-
34
- function subscribe_reloaded_get_option($_option, $_default){
35
- $value = get_option($_option, $_default);
36
- return stripslashes($value);
37
  }
38
 
39
- // Load localization files
40
- load_plugin_textdomain('subscribe-reloaded', WP_PLUGIN_DIR .'/subscribe-to-comments-reloaded/langs', '/subscribe-to-comments-reloaded/langs');
41
-
42
  // Update options
43
  if (isset($_POST['options'])){
44
-
45
  $faulty_fields = '';
46
  if (isset($_POST['options']['manager_page']) && !subscribe_reloaded_update_option('subscribe_reloaded_manager_page', $_POST['options']['manager_page'], 'text')) $faulty_fields = __('Management Page ID','subscribe-reloaded').', ';
47
  if (isset($_POST['options']['purge_days']) && !subscribe_reloaded_update_option('subscribe_reloaded_purge_days', $_POST['options']['purge_days'], 'integer')) $faulty_fields = __('Autopurge requests','subscribe-reloaded').', ';
48
  if (isset($_POST['options']['from_name']) && !subscribe_reloaded_update_option('subscribe_reloaded_from_name', $_POST['options']['from_name'], 'text')) $faulty_fields = __('Sender name','subscribe-reloaded').', ';
49
  if (isset($_POST['options']['from_email']) && !subscribe_reloaded_update_option('subscribe_reloaded_from_email', $_POST['options']['from_email'], 'text')) $faulty_fields = __('Sender email address','subscribe-reloaded').', ';
 
 
 
 
50
  if (isset($_POST['options']['notification_subject']) && !subscribe_reloaded_update_option('subscribe_reloaded_notification_subject', $_POST['options']['notification_subject'], 'text')) $faulty_fields = __('Notification subject','subscribe-reloaded').', ';
51
  if (isset($_POST['options']['notification_content']) && !subscribe_reloaded_update_option('subscribe_reloaded_notification_content', $_POST['options']['notification_content'], 'text')) $faulty_fields = __('Notification message','subscribe-reloaded').', ';
52
  if (isset($_POST['options']['checkbox_label']) && !subscribe_reloaded_update_option('subscribe_reloaded_checkbox_label', $_POST['options']['checkbox_label'], 'text')) $faulty_fields = __('Checkbox label','subscribe-reloaded').', ';
53
- if (isset($_POST['options']['checked_by_default']) && !subscribe_reloaded_update_option('subscribe_reloaded_checked_by_default', $_POST['options']['checked_by_default'], 'yesno')) $faulty_fields = __('Checked by default','subscribe-reloaded').', ';
54
  if (isset($_POST['options']['subscribed_label']) && !subscribe_reloaded_update_option('subscribe_reloaded_subscribed_label', $_POST['options']['subscribed_label'], 'text')) $faulty_fields = __('Subscribed label','subscribe-reloaded').', ';
55
  if (isset($_POST['options']['subscribed_waiting_label']) && !subscribe_reloaded_update_option('subscribe_reloaded_subscribed_waiting_label', $_POST['options']['subscribed_waiting_label'], 'text')) $faulty_fields = __('Awaiting label','subscribe-reloaded').', ';
56
- if (isset($_POST['options']['author_label']) && !subscribe_reloaded_update_option('subscribe_reloaded_author_label', $_POST['options']['author_label'], 'text')) $faulty_fields = __('Author label','subscribe-reloaded').', ';
57
- if (isset($_POST['options']['enable_double_check']) && !subscribe_reloaded_update_option('subscribe_reloaded_enable_double_check', $_POST['options']['enable_double_check'], 'yesno')) $faulty_fields = __('Enable double check','subscribe-reloaded').', ';
58
  if (isset($_POST['options']['double_check_subject']) && !subscribe_reloaded_update_option('subscribe_reloaded_double_check_subject', $_POST['options']['double_check_subject'], 'text')) $faulty_fields = __('Double check subject','subscribe-reloaded').', ';
59
  if (isset($_POST['options']['double_check_content']) && !subscribe_reloaded_update_option('subscribe_reloaded_double_check_content', $_POST['options']['double_check_content'], 'text')) $faulty_fields = __('Double check message','subscribe-reloaded').', ';
60
  if (isset($_POST['options']['management_subject']) && !subscribe_reloaded_update_option('subscribe_reloaded_management_subject', $_POST['options']['management_subject'], 'text')) $faulty_fields = __('Management subject','subscribe-reloaded').', ';
@@ -63,12 +30,7 @@ if (isset($_POST['options'])){
63
  // Display an alert in the admin interface if something went wrong
64
  echo '<div class="updated fade"><p>';
65
  if (empty($faulty_fields)){
66
- if (empty($message_to_show)){
67
  _e('Your settings have been successfully updated.','subscribe-reloaded');
68
- }
69
- else{
70
- echo $message_to_show;
71
- }
72
  }
73
  else{
74
  _e('There was an error updating the following fields:','subscribe-reloaded');
@@ -76,30 +38,18 @@ if (isset($_POST['options'])){
76
  }
77
  echo "</p></div>\n";
78
  }
 
79
  // Reload the new options
80
  $subscribe_reloaded_options = array();
81
  $subscribe_reloaded_options['manager_page'] = subscribe_reloaded_get_option('subscribe_reloaded_manager_page', '');
82
  $subscribe_reloaded_options['purge_days'] = subscribe_reloaded_get_option('subscribe_reloaded_purge_days', '0');
83
  $subscribe_reloaded_options['from_name'] = subscribe_reloaded_get_option('subscribe_reloaded_from_name', 'admin');
84
  $subscribe_reloaded_options['from_email'] = subscribe_reloaded_get_option('subscribe_reloaded_from_email', get_bloginfo('admin_email'));
85
- $subscribe_reloaded_options['notification_subject'] = subscribe_reloaded_get_option('subscribe_reloaded_notification_subject', 'There is a new comment on the post [post_title]');
86
- $subscribe_reloaded_options['notification_content'] = subscribe_reloaded_get_option('subscribe_reloaded_notification_content', '');
87
- $subscribe_reloaded_options['checkbox_label'] = subscribe_reloaded_get_option('subscribe_reloaded_checkbox_label', "Notify me of followup comments via e-mail. You can also <a href='[subscribe_link]'>subscribe</a> without commenting.");
88
  $subscribe_reloaded_options['checked_by_default'] = subscribe_reloaded_get_option('subscribe_reloaded_checked_by_default', 'no');
89
- $subscribe_reloaded_options['subscribed_label'] = subscribe_reloaded_get_option('subscribe_reloaded_subscribed_label', "You are subscribed to this entry. <a href='[manager_link]'>Manage your subscriptions</a>.");
90
- $subscribe_reloaded_options['subscribed_waiting_label'] = subscribe_reloaded_get_option('subscribe_reloaded_subscribed_waiting_label', "Your subscription to this entry needs to be confirmed. <a href='[manager_link]'>Manage your subscriptions</a>.");
91
- $subscribe_reloaded_options['author_label'] = subscribe_reloaded_get_option('subscribe_reloaded_author_label', "You are the author of this entry. <a href='[manager_link]'>Manage its subscriptions</a>.");
92
  $subscribe_reloaded_options['enable_double_check'] = subscribe_reloaded_get_option('subscribe_reloaded_enable_double_check', 'no');
93
- $subscribe_reloaded_options['double_check_subject'] = subscribe_reloaded_get_option('subscribe_reloaded_double_check_subject', 'Please confirm your subscribtion to [post_title]');
94
- $subscribe_reloaded_options['double_check_content'] = subscribe_reloaded_get_option('subscribe_reloaded_double_check_content', '');
95
- $subscribe_reloaded_options['management_subject'] = subscribe_reloaded_get_option('subscribe_reloaded_management_subject', 'Manage your subscriptions on [blog_name]');
96
- $subscribe_reloaded_options['management_content'] = subscribe_reloaded_get_option('subscribe_reloaded_management_content', '');
97
-
98
  ?>
99
-
100
- <div class="wrap">
101
- <h2><?php _e('Subscribe to Comments', 'subscribe-reloaded') ?></h2>
102
- <form action="admin.php?page=subscribe-to-comments-reloaded/options.php" method="post">
103
  <table class="form-table <?php echo $wp_locale->text_direction ?>">
104
  <tbody>
105
  <tr valign="top">
@@ -134,30 +84,6 @@ $subscribe_reloaded_options['management_content'] = subscribe_reloaded_get_optio
134
  <td class="description" style="padding-top:0"><?php _e('Email address to use for the "from" field when sending a new notification to the user.','subscribe-reloaded'); ?></td>
135
  </tr>
136
 
137
- <tr valign="top">
138
- <th scope="row" rowspan="2"><label for="notification_subject"><?php _e('Notification subject','subscribe-reloaded') ?></label></th>
139
- <td style="padding-bottom:0"><input type="text" name="options[notification_subject]" id="notification_subject" value="<?php echo $subscribe_reloaded_options['notification_subject']; ?>" size="70"></td>
140
- </tr>
141
- <tr>
142
- <td class="description" style="padding-top:0"><?php _e('Subject of the notification email. Allowed tag: [post_title]','subscribe-reloaded'); ?></td>
143
- </tr>
144
-
145
- <tr valign="top">
146
- <th scope="row" rowspan="2"><label for="notification_content"><?php _e('Notification message','subscribe-reloaded') ?></label></th>
147
- <td style="padding-bottom:0"><textarea name="options[notification_content]" id="notification_content" cols="70" rows="5"><?php echo $subscribe_reloaded_options['notification_content']; ?></textarea></td>
148
- </tr>
149
- <tr>
150
- <td class="description" style="padding-top:0"><?php _e('Content of the notification email. Allowed tags: [post_title], [comment_permalink], [comment_author], [comment_content], [post_permalink], [manager_link]','subscribe-reloaded'); ?></td>
151
- </tr>
152
-
153
- <tr valign="top">
154
- <th scope="row" rowspan="2"><label for="checkbox_label"><?php _e('Checkbox label','subscribe-reloaded') ?></label></th>
155
- <td style="padding-bottom:0"><input type="text" name="options[checkbox_label]" id="checkbox_label" value="<?php echo $subscribe_reloaded_options['checkbox_label']; ?>" size="70"></td>
156
- </tr>
157
- <tr>
158
- <td class="description" style="padding-top:0"><?php _e('Text to show next to the checkbox added to the comment form. Allowed tag: [subscribe_link]','subscribe-reloaded'); ?></td>
159
- </tr>
160
-
161
  <tr valign="top">
162
  <th scope="row" rowspan="2"><label for="checked_by_default"><?php _e('Checked by default','subscribe-reloaded') ?></label></th>
163
  <td>
@@ -166,33 +92,9 @@ $subscribe_reloaded_options['management_content'] = subscribe_reloaded_get_optio
166
  </td>
167
  </tr>
168
  <tr>
169
- <td class="description" style="padding-top:0"><?php _e('Send a notification email to confirm the subscription (to avoid addresses misuse)','subscribe-reloaded'); ?></td>
170
  </tr>
171
 
172
- <tr valign="top">
173
- <th scope="row" rowspan="2"><label for="subscribed_label"><?php _e('Subscribed label','subscribe-reloaded') ?></label></th>
174
- <td style="padding-bottom:0"><input type="text" name="options[subscribed_label]" id="subscribed_label" value="<?php echo $subscribe_reloaded_options['subscribed_label']; ?>" size="70"></td>
175
- </tr>
176
- <tr>
177
- <td class="description" style="padding-top:0"><?php _e('Text to show to those users who are already subscribed. Allowed tag: [manager_link]','subscribe-reloaded'); ?></td>
178
- </tr>
179
-
180
- <tr valign="top">
181
- <th scope="row" rowspan="2"><label for="subscribed_waiting_label"><?php _e('Awaiting label','subscribe-reloaded') ?></label></th>
182
- <td style="padding-bottom:0"><input type="text" name="options[subscribed_waiting_label]" id="subscribed_waiting_label" value="<?php echo $subscribe_reloaded_options['subscribed_waiting_label']; ?>" size="70"></td>
183
- </tr>
184
- <tr>
185
- <td class="description" style="padding-top:0"><?php _e("Text to show to those users who are already subscribed, but haven't clicked on the confirmation link yet. Allowed tag: [manager_link]",'subscribe-reloaded'); ?></td>
186
- </tr>
187
-
188
- <tr valign="top">
189
- <th scope="row" rowspan="2"><label for="author_label"><?php _e('Author label','subscribe-reloaded') ?></label></th>
190
- <td style="padding-bottom:0"><input type="text" name="options[author_label]" id="author_label" value="<?php echo $subscribe_reloaded_options['author_label']; ?>" size="70"></td>
191
- </tr>
192
- <tr>
193
- <td class="description" style="padding-top:0"><?php _e('Text to show to the author, to manage subscriptions to a given post. Allowed tag: [manager_link]','subscribe-reloaded'); ?></td>
194
- </tr>
195
-
196
  <tr valign="top">
197
  <th scope="row" rowspan="2"><label for="enable_double_check"><?php _e('Enable double check','subscribe-reloaded') ?></label></th>
198
  <td>
@@ -205,38 +107,16 @@ $subscribe_reloaded_options['management_content'] = subscribe_reloaded_get_optio
205
  </tr>
206
 
207
  <tr valign="top">
208
- <th scope="row" rowspan="2"><label for="double_check_subject"><?php _e('Double check subject','subscribe-reloaded') ?></label></th>
209
- <td style="padding-bottom:0"><input type="text" name="options[double_check_subject]" id="double_check_subject" value="<?php echo $subscribe_reloaded_options['double_check_subject']; ?>" size="70"></td>
210
- </tr>
211
- <tr>
212
- <td class="description" style="padding-top:0"><?php _e('Subject of the confirmation email. Allowed tag: [post_title]','subscribe-reloaded'); ?></td>
213
- </tr>
214
-
215
- <tr valign="top">
216
- <th scope="row" rowspan="2"><label for="double_check_content"><?php _e('Double check message','subscribe-reloaded') ?></label></th>
217
- <td style="padding-bottom:0"><textarea name="options[double_check_content]" id="double_check_content" cols="70" rows="5"><?php echo $subscribe_reloaded_options['double_check_content']; ?></textarea></td>
218
- </tr>
219
- <tr>
220
- <td class="description" style="padding-top:0"><?php _e('Content of the confirmation email. Allowed tags: [post_permalink], [confirm_link], [post_title], [manager_link]','subscribe-reloaded'); ?></td>
221
- </tr>
222
-
223
- <tr valign="top">
224
- <th scope="row" rowspan="2"><label for="management_subject"><?php _e('Management subject','subscribe-reloaded') ?></label></th>
225
- <td style="padding-bottom:0"><input type="text" name="options[management_subject]" id="management_subject" value="<?php echo $subscribe_reloaded_options['management_subject']; ?>" size="70"></td>
226
- </tr>
227
- <tr>
228
- <td class="description" style="padding-top:0"><?php _e('Subject of the mail sent to those who request to access their management page. Allowed tag: [blog_name]','subscribe-reloaded'); ?></td>
229
- </tr>
230
-
231
- <tr valign="top">
232
- <th scope="row" rowspan="2"><label for="management_content"><?php _e('Management message','subscribe-reloaded') ?></label></th>
233
- <td style="padding-bottom:0"><textarea name="options[management_content]" id="management_content" cols="70" rows="5"><?php echo $subscribe_reloaded_options['management_content']; ?></textarea></td>
234
  </tr>
235
  <tr>
236
- <td class="description" style="padding-top:0"><?php _e('Content of the management email. Allowed tags: [blog_name], [manager_link]','subscribe-reloaded'); ?></td>
237
  </tr>
238
- </tbody>
239
  </table>
240
  <p class="submit"><input type="submit" value="<?php _e('Save Changes') ?>" class="button-primary" name="Submit"></p>
241
  </form>
242
- </div>
1
+ <?php
 
2
  // Avoid direct access to this piece of code
3
+ if (strpos($_SERVER['SCRIPT_FILENAME'], basename(__FILE__))){
4
+ header('Location: /');
5
+ exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  }
7
 
 
 
 
8
  // Update options
9
  if (isset($_POST['options'])){
 
10
  $faulty_fields = '';
11
  if (isset($_POST['options']['manager_page']) && !subscribe_reloaded_update_option('subscribe_reloaded_manager_page', $_POST['options']['manager_page'], 'text')) $faulty_fields = __('Management Page ID','subscribe-reloaded').', ';
12
  if (isset($_POST['options']['purge_days']) && !subscribe_reloaded_update_option('subscribe_reloaded_purge_days', $_POST['options']['purge_days'], 'integer')) $faulty_fields = __('Autopurge requests','subscribe-reloaded').', ';
13
  if (isset($_POST['options']['from_name']) && !subscribe_reloaded_update_option('subscribe_reloaded_from_name', $_POST['options']['from_name'], 'text')) $faulty_fields = __('Sender name','subscribe-reloaded').', ';
14
  if (isset($_POST['options']['from_email']) && !subscribe_reloaded_update_option('subscribe_reloaded_from_email', $_POST['options']['from_email'], 'text')) $faulty_fields = __('Sender email address','subscribe-reloaded').', ';
15
+ if (isset($_POST['options']['checked_by_default']) && !subscribe_reloaded_update_option('subscribe_reloaded_checked_by_default', $_POST['options']['checked_by_default'], 'yesno')) $faulty_fields = __('Checked by default','subscribe-reloaded').', ';
16
+ if (isset($_POST['options']['enable_double_check']) && !subscribe_reloaded_update_option('subscribe_reloaded_enable_double_check', $_POST['options']['enable_double_check'], 'yesno')) $faulty_fields = __('Enable double check','subscribe-reloaded').', ';
17
+ if (isset($_POST['options']['notify_authors']) && !subscribe_reloaded_update_option('subscribe_reloaded_notify_authors', $_POST['options']['notify_authors'], 'yesno')) $faulty_fields = __('Notify authors','subscribe-reloaded').', ';
18
+
19
  if (isset($_POST['options']['notification_subject']) && !subscribe_reloaded_update_option('subscribe_reloaded_notification_subject', $_POST['options']['notification_subject'], 'text')) $faulty_fields = __('Notification subject','subscribe-reloaded').', ';
20
  if (isset($_POST['options']['notification_content']) && !subscribe_reloaded_update_option('subscribe_reloaded_notification_content', $_POST['options']['notification_content'], 'text')) $faulty_fields = __('Notification message','subscribe-reloaded').', ';
21
  if (isset($_POST['options']['checkbox_label']) && !subscribe_reloaded_update_option('subscribe_reloaded_checkbox_label', $_POST['options']['checkbox_label'], 'text')) $faulty_fields = __('Checkbox label','subscribe-reloaded').', ';
 
22
  if (isset($_POST['options']['subscribed_label']) && !subscribe_reloaded_update_option('subscribe_reloaded_subscribed_label', $_POST['options']['subscribed_label'], 'text')) $faulty_fields = __('Subscribed label','subscribe-reloaded').', ';
23
  if (isset($_POST['options']['subscribed_waiting_label']) && !subscribe_reloaded_update_option('subscribe_reloaded_subscribed_waiting_label', $_POST['options']['subscribed_waiting_label'], 'text')) $faulty_fields = __('Awaiting label','subscribe-reloaded').', ';
24
+ if (isset($_POST['options']['author_label']) && !subscribe_reloaded_update_option('subscribe_reloaded_author_label', $_POST['options']['author_label'], 'text')) $faulty_fields = __('Author label','subscribe-reloaded').', ';
 
25
  if (isset($_POST['options']['double_check_subject']) && !subscribe_reloaded_update_option('subscribe_reloaded_double_check_subject', $_POST['options']['double_check_subject'], 'text')) $faulty_fields = __('Double check subject','subscribe-reloaded').', ';
26
  if (isset($_POST['options']['double_check_content']) && !subscribe_reloaded_update_option('subscribe_reloaded_double_check_content', $_POST['options']['double_check_content'], 'text')) $faulty_fields = __('Double check message','subscribe-reloaded').', ';
27
  if (isset($_POST['options']['management_subject']) && !subscribe_reloaded_update_option('subscribe_reloaded_management_subject', $_POST['options']['management_subject'], 'text')) $faulty_fields = __('Management subject','subscribe-reloaded').', ';
30
  // Display an alert in the admin interface if something went wrong
31
  echo '<div class="updated fade"><p>';
32
  if (empty($faulty_fields)){
 
33
  _e('Your settings have been successfully updated.','subscribe-reloaded');
 
 
 
 
34
  }
35
  else{
36
  _e('There was an error updating the following fields:','subscribe-reloaded');
38
  }
39
  echo "</p></div>\n";
40
  }
41
+
42
  // Reload the new options
43
  $subscribe_reloaded_options = array();
44
  $subscribe_reloaded_options['manager_page'] = subscribe_reloaded_get_option('subscribe_reloaded_manager_page', '');
45
  $subscribe_reloaded_options['purge_days'] = subscribe_reloaded_get_option('subscribe_reloaded_purge_days', '0');
46
  $subscribe_reloaded_options['from_name'] = subscribe_reloaded_get_option('subscribe_reloaded_from_name', 'admin');
47
  $subscribe_reloaded_options['from_email'] = subscribe_reloaded_get_option('subscribe_reloaded_from_email', get_bloginfo('admin_email'));
 
 
 
48
  $subscribe_reloaded_options['checked_by_default'] = subscribe_reloaded_get_option('subscribe_reloaded_checked_by_default', 'no');
 
 
 
49
  $subscribe_reloaded_options['enable_double_check'] = subscribe_reloaded_get_option('subscribe_reloaded_enable_double_check', 'no');
50
+ $subscribe_reloaded_options['notify_authors'] = subscribe_reloaded_get_option('subscribe_reloaded_notify_authors', 'no');
 
 
 
 
51
  ?>
52
+ <form action="admin.php?page=subscribe-to-comments-reloaded/options/index.php&subscribepanel=<?php echo $current_panel ?>" method="post">
 
 
 
53
  <table class="form-table <?php echo $wp_locale->text_direction ?>">
54
  <tbody>
55
  <tr valign="top">
84
  <td class="description" style="padding-top:0"><?php _e('Email address to use for the "from" field when sending a new notification to the user.','subscribe-reloaded'); ?></td>
85
  </tr>
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  <tr valign="top">
88
  <th scope="row" rowspan="2"><label for="checked_by_default"><?php _e('Checked by default','subscribe-reloaded') ?></label></th>
89
  <td>
92
  </td>
93
  </tr>
94
  <tr>
95
+ <td class="description" style="padding-top:0"><?php _e('Decide if the checkbox should be checked by default or not.','subscribe-reloaded'); ?></td>
96
  </tr>
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  <tr valign="top">
99
  <th scope="row" rowspan="2"><label for="enable_double_check"><?php _e('Enable double check','subscribe-reloaded') ?></label></th>
100
  <td>
107
  </tr>
108
 
109
  <tr valign="top">
110
+ <th scope="row" rowspan="2"><label for="notify_authors"><?php _e('Notify authors','subscribe-reloaded') ?></label></th>
111
+ <td>
112
+ <input type="radio" name="options[notify_authors]" id="notify_authors" value="yes"<?php echo ($subscribe_reloaded_options['notify_authors'] == 'yes')?' checked="checked"':''; ?>> <?php _e('Yes','subscribe-reloaded') ?> &nbsp; &nbsp; &nbsp;
113
+ <input type="radio" name="options[notify_authors]" value="no" <?php echo ($subscribe_reloaded_options['notify_authors'] == 'no')?' checked="checked"':''; ?>> <?php _e('No','subscribe-reloaded') ?>
114
+ </td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  </tr>
116
  <tr>
117
+ <td class="description" style="padding-top:0"><?php _e('Notify authors when a new comment is posted to one of their articles.','subscribe-reloaded'); ?></td>
118
  </tr>
119
+ </tbody>
120
  </table>
121
  <p class="submit"><input type="submit" value="<?php _e('Save Changes') ?>" class="button-primary" name="Submit"></p>
122
  </form>
 
options/panel3.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Avoid direct access to this piece of code
3
+ if (strpos($_SERVER['SCRIPT_FILENAME'], basename(__FILE__))){
4
+ header('Location: /');
5
+ exit;
6
+ }
7
+
8
+ // Reload the new options
9
+ $subscribe_reloaded_options = array();
10
+ $subscribe_reloaded_options['notification_subject'] = subscribe_reloaded_get_option('subscribe_reloaded_notification_subject', 'There is a new comment on the post [post_title]');
11
+ $subscribe_reloaded_options['notification_content'] = subscribe_reloaded_get_option('subscribe_reloaded_notification_content', '');
12
+ $subscribe_reloaded_options['checkbox_label'] = subscribe_reloaded_get_option('subscribe_reloaded_checkbox_label', "Notify me of followup comments via e-mail. You can also <a href='[subscribe_link]'>subscribe</a> without commenting.");
13
+ $subscribe_reloaded_options['subscribed_label'] = subscribe_reloaded_get_option('subscribe_reloaded_subscribed_label', "You are subscribed to this entry. <a href='[manager_link]'>Manage your subscriptions</a>.");
14
+ $subscribe_reloaded_options['subscribed_waiting_label'] = subscribe_reloaded_get_option('subscribe_reloaded_subscribed_waiting_label', "Your subscription to this entry needs to be confirmed. <a href='[manager_link]'>Manage your subscriptions</a>.");
15
+ $subscribe_reloaded_options['author_label'] = subscribe_reloaded_get_option('subscribe_reloaded_author_label', "You can <a href='[manager_link]'>manage the subscriptions</a> of this entry.");
16
+ $subscribe_reloaded_options['double_check_subject'] = subscribe_reloaded_get_option('subscribe_reloaded_double_check_subject', 'Please confirm your subscribtion to [post_title]');
17
+ $subscribe_reloaded_options['double_check_content'] = subscribe_reloaded_get_option('subscribe_reloaded_double_check_content', '');
18
+ $subscribe_reloaded_options['management_subject'] = subscribe_reloaded_get_option('subscribe_reloaded_management_subject', 'Manage your subscriptions on [blog_name]');
19
+ $subscribe_reloaded_options['management_content'] = subscribe_reloaded_get_option('subscribe_reloaded_management_content', '');
20
+
21
+ ?>
22
+ <form action="admin.php?page=subscribe-to-comments-reloaded/options/index.php&subscribepanel=<?php echo $current_panel ?>" method="post">
23
+ <table class="form-table <?php echo $wp_locale->text_direction ?>">
24
+ <tbody>
25
+ <tr valign="top">
26
+ <th scope="row" rowspan="2"><label for="notification_subject"><?php _e('Notification subject','subscribe-reloaded') ?></label></th>
27
+ <td style="padding-bottom:0"><input type="text" name="options[notification_subject]" id="notification_subject" value="<?php echo $subscribe_reloaded_options['notification_subject']; ?>" size="70"></td>
28
+ </tr>
29
+ <tr>
30
+ <td class="description" style="padding-top:0"><?php _e('Subject of the notification email. Allowed tag: [post_title]','subscribe-reloaded'); ?></td>
31
+ </tr>
32
+
33
+ <tr valign="top">
34
+ <th scope="row" rowspan="2"><label for="notification_content"><?php _e('Notification message','subscribe-reloaded') ?></label></th>
35
+ <td style="padding-bottom:0"><textarea name="options[notification_content]" id="notification_content" cols="70" rows="5"><?php echo $subscribe_reloaded_options['notification_content']; ?></textarea></td>
36
+ </tr>
37
+ <tr>
38
+ <td class="description" style="padding-top:0"><?php _e('Content of the notification email. Allowed tags: [post_title], [comment_permalink], [comment_author], [comment_content], [post_permalink], [manager_link]','subscribe-reloaded'); ?></td>
39
+ </tr>
40
+
41
+ <tr valign="top">
42
+ <th scope="row" rowspan="2"><label for="checkbox_label"><?php _e('Checkbox label','subscribe-reloaded') ?></label></th>
43
+ <td style="padding-bottom:0"><input type="text" name="options[checkbox_label]" id="checkbox_label" value="<?php echo $subscribe_reloaded_options['checkbox_label']; ?>" size="70"></td>
44
+ </tr>
45
+ <tr>
46
+ <td class="description" style="padding-top:0"><?php _e('Text to show next to the checkbox added to the comment form. Allowed tag: [subscribe_link]','subscribe-reloaded'); ?></td>
47
+ </tr>
48
+
49
+ <tr valign="top">
50
+ <th scope="row" rowspan="2"><label for="subscribed_label"><?php _e('Subscribed label','subscribe-reloaded') ?></label></th>
51
+ <td style="padding-bottom:0"><input type="text" name="options[subscribed_label]" id="subscribed_label" value="<?php echo $subscribe_reloaded_options['subscribed_label']; ?>" size="70"></td>
52
+ </tr>
53
+ <tr>
54
+ <td class="description" style="padding-top:0"><?php _e('Text to show to those users who are already subscribed. Allowed tag: [manager_link]','subscribe-reloaded'); ?></td>
55
+ </tr>
56
+
57
+ <tr valign="top">
58
+ <th scope="row" rowspan="2"><label for="subscribed_waiting_label"><?php _e('Awaiting label','subscribe-reloaded') ?></label></th>
59
+ <td style="padding-bottom:0"><input type="text" name="options[subscribed_waiting_label]" id="subscribed_waiting_label" value="<?php echo $subscribe_reloaded_options['subscribed_waiting_label']; ?>" size="70"></td>
60
+ </tr>
61
+ <tr>
62
+ <td class="description" style="padding-top:0"><?php _e("Text to show to those users who are already subscribed, but haven't clicked on the confirmation link yet. Allowed tag: [manager_link]",'subscribe-reloaded'); ?></td>
63
+ </tr>
64
+
65
+ <tr valign="top">
66
+ <th scope="row" rowspan="2"><label for="author_label"><?php _e('Author label','subscribe-reloaded') ?></label></th>
67
+ <td style="padding-bottom:0"><input type="text" name="options[author_label]" id="author_label" value="<?php echo $subscribe_reloaded_options['author_label']; ?>" size="70"></td>
68
+ </tr>
69
+ <tr>
70
+ <td class="description" style="padding-top:0"><?php _e('Text to show to the author, to manage subscriptions to a given post. Allowed tag: [manager_link]','subscribe-reloaded'); ?></td>
71
+ </tr>
72
+
73
+ <tr valign="top">
74
+ <th scope="row" rowspan="2"><label for="double_check_subject"><?php _e('Double check subject','subscribe-reloaded') ?></label></th>
75
+ <td style="padding-bottom:0"><input type="text" name="options[double_check_subject]" id="double_check_subject" value="<?php echo $subscribe_reloaded_options['double_check_subject']; ?>" size="70"></td>
76
+ </tr>
77
+ <tr>
78
+ <td class="description" style="padding-top:0"><?php _e('Subject of the confirmation email. Allowed tag: [post_title]','subscribe-reloaded'); ?></td>
79
+ </tr>
80
+
81
+ <tr valign="top">
82
+ <th scope="row" rowspan="2"><label for="double_check_content"><?php _e('Double check message','subscribe-reloaded') ?></label></th>
83
+ <td style="padding-bottom:0"><textarea name="options[double_check_content]" id="double_check_content" cols="70" rows="5"><?php echo $subscribe_reloaded_options['double_check_content']; ?></textarea></td>
84
+ </tr>
85
+ <tr>
86
+ <td class="description" style="padding-top:0"><?php _e('Content of the confirmation email. Allowed tags: [post_permalink], [confirm_link], [post_title], [manager_link]','subscribe-reloaded'); ?></td>
87
+ </tr>
88
+
89
+ <tr valign="top">
90
+ <th scope="row" rowspan="2"><label for="management_subject"><?php _e('Management subject','subscribe-reloaded') ?></label></th>
91
+ <td style="padding-bottom:0"><input type="text" name="options[management_subject]" id="management_subject" value="<?php echo $subscribe_reloaded_options['management_subject']; ?>" size="70"></td>
92
+ </tr>
93
+ <tr>
94
+ <td class="description" style="padding-top:0"><?php _e('Subject of the mail sent to those who request to access their management page. Allowed tag: [blog_name]','subscribe-reloaded'); ?></td>
95
+ </tr>
96
+
97
+ <tr valign="top">
98
+ <th scope="row" rowspan="2"><label for="management_content"><?php _e('Management message','subscribe-reloaded') ?></label></th>
99
+ <td style="padding-bottom:0"><textarea name="options[management_content]" id="management_content" cols="70" rows="5"><?php echo $subscribe_reloaded_options['management_content']; ?></textarea></td>
100
+ </tr>
101
+ <tr>
102
+ <td class="description" style="padding-top:0"><?php _e('Content of the management email. Allowed tags: [blog_name], [manager_link]','subscribe-reloaded'); ?></td>
103
+ </tr>
104
+ </tbody>
105
+ </table>
106
+ <p class="submit"><input type="submit" value="<?php _e('Save Changes') ?>" class="button-primary" name="Submit"></p>
107
+ </form>
options/panel4.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Avoid direct access to this piece of code
3
+ if (strpos($_SERVER['SCRIPT_FILENAME'], basename(__FILE__))){
4
+ header('Location: /');
5
+ exit;
6
+ }
7
+ ?>
8
+
9
+ <table class="form-table">
10
+ <tbody>
11
+ <tr valign="top">
12
+ <th scope="row"><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
13
+ <input type="hidden" name="cmd" value="_s-xclick">
14
+ <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHLwYJKoZIhvcNAQcEoIIHIDCCBxwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBngge5NiTQd7ePyOWNY6kjSyj/Q74nE0K3TTdGFoCbMdW6Ld1K7ifjcuPubEWZretwChUBBSruL3EI+XRK16SIblLbJGVMBoEaPMY8pEWCKbM9C0frSLWkmHX4jKAwT1bW2fi4jzf4nFxHXyiHd/ieqGcz1/nfKSffkvigmCIz8DELMAkGBSsOAwIaBQAwgawGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIs4aMz1tHajWAgYim4zSsL96VbGijTiV+GDHKFPi14KLFmyFAJU5orefIC77/Ijj/vEG7tVAV/RzvKQISpSss2gynFxsUccCrA3umK9h8RTBQnWboOrawh9LlerJgeTdjMznG8rPa1BztYT2QYvlfBiICgQViIqXBpZ03ig+sdwZnq9CXOdW+WpMKfyaEq6U5pm1woIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTAwNDE0MTYyNTU2WjAjBgkqhkiG9w0BCQQxFgQU09GMwy7SPhAXAMsygoSa9ybOqHcwDQYJKoZIhvcNAQEBBQAEgYAeNN2U8by1ew6vdBe0we+yhDjy6ihGhGsd6S7hOsR6esdlisOzUkvYM3p1dE+f2J4+0yQFm7uqKZQ4PbjLw41/PsKrqAo/UACpymR2NhNY2sfMnFfFADJGVTo67+wwC33i0wx+GtrTEeqUlTy9vXyaW0WiKw9HoUxN+AfhyyMS9g==-----END PKCS7-----">
15
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
16
+ <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
17
+ </form>
18
+
19
+
20
+ </th>
21
+ <td class='wrap'>
22
+ <?php _e('How valuable is the feature offered by this plugin to your visitors? Subscribe to Comments Reloaded is and will always be free, but consider supporting the author if this plugin made your web site better, especially if you are making money out of it. Any donation received will be reinvested in the development of Subscribe to Comments Reloaded, and to buy some food for my hungry family.','subscribe-reloaded') ?>
23
+ </td>
24
+ </tr>
25
+ </tbody>
26
+ </table>
27
+
28
+ <h3><?php _e("Don't want to donate? You can still help",'wp-slimstat-options') ?></h3>
29
+ <p><?php _e("If you don't want to donate money, please consider blogging about my plugin with a link to the plugin's page. Please let your readers know what makes your blog better. You can also contribute donating your time: do not hesitate to send me bug reports, your localization files, ideas on how to improve Subscribe to Comments Reloaded and so on. Whatever you do, thanks for using my plugin!",'subscribe-reloaded') ?></p>
30
+
31
+ <h3><?php _e("Vote and show your appreciation",'subscribe-reloaded') ?></h3>
32
+ <p><?php _e('Tell other people if Subscribe to Comments Reloaded works for you and how good it is. <a href="http://wordpress.org/extend/plugins/subscribe-to-comments-reloaded/">Rate it</a> on its Plugin Directory page.','subscribe-reloaded') ?></p>
readme.txt CHANGED
@@ -3,18 +3,16 @@
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=Z732JS7KQ6RRL&lc=US&item_name=Subscribe%20To%20Comments%20Reloaded&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: subscribe, comments, notification, subscription, manage, double check-in, follow, commenting
5
  Requires at least: 2.9.2
6
- Tested up to: 3.0.1
7
- Stable tag: 1.0
8
 
9
  == Description ==
10
- Subscribe to Comments Reloaded 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! It solves most of the issues present in Mark Jaquith's version, using the latest Wordpress features and functionality. Plus, it introduces a double check-in mechanism, that requires users to confirm their subscription clicking on a link they will receive via email.
11
 
12
  ## Requirements
13
  * Wordpress 2.9 or higher
14
  * PHP 5.1 or higher
15
  * MySQL 5.x or higher
16
- * At least 5 MB of free web space
17
- * At least 5 MB of free DB space
18
 
19
  ## Main Features
20
  * Does not modify Wordpress system tables anymore
@@ -28,16 +26,29 @@ Subscribe to Comments Reloaded is a robust plugin that enables commenters to sig
28
 
29
  == Installation ==
30
 
31
- 0. If you are using Subscribe To Comments by Mark Jaquith, disable it
32
- 1. Upload the entire folder and all the subfolders to your Wordpress plugins' folder
33
- 2. Activate it
34
- 3. Create a new page whose content is the error message shown to the user is something goes wrong
35
- 4. Write down the ID of this new page
36
- 5. Go to Settings > Subscribe to Comments and enter the ID in the first field
37
- 6. Customize all the messages to fit your needs
38
 
 
 
 
 
 
39
 
40
  == Changelog ==
41
 
 
 
 
 
 
 
 
 
 
42
  = 1.0 =
43
  * First beta release
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=Z732JS7KQ6RRL&lc=US&item_name=Subscribe%20To%20Comments%20Reloaded&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: subscribe, comments, notification, subscription, manage, double check-in, follow, commenting
5
  Requires at least: 2.9.2
6
+ Tested up to: 3.1
7
+ Stable tag: 1.1
8
 
9
  == Description ==
10
+ Subscribe to Comments Reloaded 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 or suspend all notifications. It solves most of the issues that affect Mark Jaquith's version, using the latest Wordpress features and functionality. Plus, allows administrators to enable a double opt-in mechanism, requiring users to confirm their subscription clicking on a link they will receive via email.
11
 
12
  ## Requirements
13
  * Wordpress 2.9 or higher
14
  * PHP 5.1 or higher
15
  * MySQL 5.x or higher
 
 
16
 
17
  ## Main Features
18
  * Does not modify Wordpress system tables anymore
26
 
27
  == Installation ==
28
 
29
+ 1. If you are using Subscribe To Comments by Mark Jaquith, disable it
30
+ 2. Upload the entire folder and all the subfolders to your Wordpress plugins' folder
31
+ 3. Activate it
32
+ 4. Customize all the messages (Settings > Subscribe to Comments > Messages)
33
+ 5. If your template does not call the 'comment_form' action, you will have to manually edit it. To show the checkbox and its label, add: `<?php if (function_exists('subscribe_reloaded_show')) subscribe_reloaded_show(); ?>`
34
+ 6. StCR creates a new page in your blog, feel free to customize the 'error message' it contains to fit your needs. That copy will be shown to the user if an error occurs, i.e. the security key in the URL is not valid.
 
35
 
36
+ == Screenshots ==
37
+
38
+ 1. Manage your subscriptions
39
+ 2. Customize the behavior
40
+ 3. Use your own messages to interact with your users
41
 
42
  == Changelog ==
43
 
44
+ = 1.1 =
45
+ * The admin interface has been completely reorganized
46
+ * Added a new option to notify the authors when new comments are posted to one of their articles
47
+ * The management page for your visitors is now automatically created by StCR
48
+ * A cookie is now set to remember when a visitor subscribes without commenting
49
+ * Spam comments that make it through Akismet's filters, are now ignored (thank you Andrea Pinti)
50
+ * Actions on comments have been tied to actions on subscriptions (i.e. comment deleted -> subscription deleted, etc)
51
+ * Activated the official [support forum](http://lab.duechiacchiere.it/index.php?board=5.0)
52
+
53
  = 1.0 =
54
  * First beta release
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
style.css ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* View Panel */
2
+ #subscribe-to-comments-icon{
3
+ background:transparent url(images/subscribe-to-comments.png) no-repeat scroll 4px 4px;
4
+ float:left;
5
+ height:30px;
6
+ margin:16px 2px 0 4px;
7
+ width:40px;
8
+ }
9
+ #subscribe-to-comments-icon.rtl{
10
+ float:right;
11
+ }
12
+ .wrap form p,.wrap form ul{
13
+ margin:6px;
14
+ }
15
+ .wrap form p span{
16
+ float:left;
17
+ }
18
+ .wrap form p span.rtl{
19
+ float:right;
20
+ }
21
+ .wrap form a.small-text{
22
+ font-size:.8em;
23
+ }
24
+ .wrap h2.medium{
25
+ border-bottom:1px solid #CCCCCC;
26
+ font-size:12px;
27
+ padding-bottom:0;
28
+ }
29
+ .wrap .menu-tabs{
30
+ -moz-border-radius:5px 5px 0 0;
31
+ background-color:transparent;
32
+ border-color:#CCCCCC;
33
+ border-style:solid;
34
+ border-width:1px 1px 0;
35
+ color:#464646;
36
+ font-weight:bold;
37
+ margin-right:6px;
38
+ padding:6px 12px 10px;
39
+ text-decoration:none;
40
+ }
41
+ .wrap .menu-tabs.menu-tab-inactive{
42
+ border-style:dashed;
43
+ font-weight:400;
44
+ padding:6px 10px;
45
+ position:relative;
46
+ top:5px;
47
+ }
48
+ .form-table th{
49
+ padding:3px 10px;
50
+ white-space:nowrap;
51
+ width:15%;
52
+ }
53
+ .form-table td{
54
+ padding:3px 10px;
55
+ }
56
+ .form-table td.description{
57
+ white-space:normal;
58
+ }
59
+ .form-table td.narrowcolumn{
60
+ width:100px;
61
+ }
62
+ .form-table td.shortrow{
63
+ padding:0 10px 20px;
64
+ white-space:normal;
65
+ }
66
+ .form-table input{
67
+ margin:0 8px 0 0;
68
+ }
69
+ .form-table.rtl input{
70
+ margin:0 0 0 8px;
71
+ }
72
+ .form-table input.longtext{
73
+ width:400px;
74
+ }
subscribe-to-comments-reloaded.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: Subscribe to Comments Reloaded
4
- Version: 1.0
5
- Plugin URI: http://www.duechiacchiere.it/
6
- Description: Subscribe to Comments with Double-Opt-In
7
  Author: camu
8
  Author URI: http://www.duechiacchiere.it/
9
  */
@@ -16,23 +16,23 @@ if (strpos($_SERVER['SCRIPT_FILENAME'], basename(__FILE__))){
16
 
17
  function subscribe_reloaded_show(){
18
  global $post;
19
-
20
  $manager_link = get_permalink(get_option('subscribe_reloaded_manager_page', ''));
21
  if (strpos($manager_link, '?') !== false)
22
  $manager_link = "$manager_link&amp;srp=$post->ID";
23
  else
24
  $manager_link = "$manager_link?srp=$post->ID";
25
-
26
  $wp_subscribe_reloaded = new wp_subscribe_reloaded();
27
  if ($wp_subscribe_reloaded->is_author($post->post_author)){ // when the second parameter is empty, cookie value will be used
28
  echo str_replace('[manager_link]', $manager_link,
29
- stripslashes(get_option('subscribe_reloaded_author_label', "You are the author of this entry. <a href='[manager_link]'>Manage its subscriptions</a>.")));
30
  }
31
- elseif($wp_subscribe_reloaded->is_user_subscribed($post->ID, '', 'Y')){
32
  echo str_replace('[manager_link]', $manager_link,
33
  stripslashes(get_option('subscribe_reloaded_subscribed_label', "You are subscribed to this entry. <a href='[manager_link]'>Manage your subscriptions</a>.")));
34
  }
35
- elseif($wp_subscribe_reloaded->is_user_subscribed($post->ID, '', 'C')){
36
  echo str_replace('[manager_link]', $manager_link,
37
  stripslashes(get_option('subscribe_reloaded_subscribed_waiting_label', "Your subscription to this entry needs to be confirmed. <a href='[manager_link]'>Manage your subscriptions</a>.")));
38
  }
@@ -51,10 +51,10 @@ class wp_subscribe_reloaded {
51
  // Input: none
52
  // Output: none
53
  public function __construct(){
54
- global $table_prefix;
55
 
56
  // We use a bunch of tables to store data
57
- $this->table_subscriptions = $table_prefix . 'subscribe_reloaded';
58
  $this->salt = defined('NONCE_KEY')?NONCE_KEY:'please create a unique key in your wp-config.php';
59
  }
60
  // end __construct
@@ -65,10 +65,10 @@ class wp_subscribe_reloaded {
65
  // Output: none
66
  public function activate(){
67
  global $wpdb;
68
-
69
  // Load localization files
70
  load_plugin_textdomain('subscribe-reloaded', WP_PLUGIN_DIR .'/subscribe-to-comments-reloaded/langs', '/subscribe-to-comments-reloaded/langs');
71
-
72
  // Table that stores the actual data about subscribers
73
  $subscriptions_table_sql = "
74
  CREATE TABLE IF NOT EXISTS `$this->table_subscriptions` (
@@ -94,13 +94,17 @@ class wp_subscribe_reloaded {
94
  $wpdb->query($import_sql);
95
 
96
  // Remove the old data
97
- $wpdb->query("ALTER TABLE $wpdb->comments DROP COLUMN `comment_subscribe`");
98
  }
99
 
100
  add_option('subscribe_reloaded_manager_page', '', '', 'no');
101
- add_option('subscribe_reloaded_purge_days', '30', '', 'no');
102
  add_option('subscribe_reloaded_from_name', 'admin', '', 'no');
103
  add_option('subscribe_reloaded_from_email', get_bloginfo('admin_email'), '', 'no');
 
 
 
 
104
  add_option('subscribe_reloaded_notification_subject', __('There is a new comment to [post_title]','subscribe-reloaded'), '', 'no');
105
  add_option('subscribe_reloaded_notification_content', __('There is a new comment to [post_title].
106
  Comment Link: [comment_permalink]
@@ -111,11 +115,9 @@ Comment:
111
  Permalink: [post_permalink]
112
  Manage your subscriptions: [manager_link]','subscribe-reloaded'), '', 'no');
113
  add_option('subscribe_reloaded_checkbox_label', __("Notify me of followup comments via e-mail. You can also <a href='[subscribe_link]'>subscribe</a> without commenting.",'subscribe-reloaded'), '', 'no');
114
- add_option('subscribe_reloaded_checked_by_default', 'no', '', 'no');
115
  add_option('subscribe_reloaded_subscribed_label', __("You are subscribed to this entry. <a href='[manager_link]'>Manage</a> your subscriptions.",'subscribe-reloaded'), '', 'no');
116
  add_option('subscribe_reloaded_subscribed_waiting_label', __("Your subscription to this entry needs to be confirmed. <a href='[manager_link]'>Manage your subscriptions</a>.",'subscribe-reloaded'), '', 'no');
117
- add_option('subscribe_reloaded_author_label', __("You are the author of this entry. <a href='[manager_link]'>Manage</a> its subscriptions.",'subscribe-reloaded'), '', 'no');
118
- add_option('subscribe_reloaded_enable_double_check', 'no', '', 'no');
119
  add_option('subscribe_reloaded_double_check_subject', __('Please confirm your subscribtion to [post_title]','subscribe-reloaded'), '', 'no');
120
  add_option('subscribe_reloaded_double_check_content', __('You have requested to be notified every time a new comment is added to:
121
  [post_permalink]
@@ -127,13 +129,29 @@ Please confirm your request by clicking on this link:
127
  add_option('subscribe_reloaded_management_subject', __('Manage your subscriptions on [blog_name]','subscribe-reloaded'));
128
  add_option('subscribe_reloaded_management_content', __('You have requested to manage your subscriptions to the articles on [blog_name]. Follow this link to access your personal page:
129
  [manager_link]','subscribe-reloaded'));
130
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  // Schedule the autopurge hook
132
  if (!wp_next_scheduled('subscribe_reloaded_purge'))
133
  wp_schedule_event(time(), 'daily', 'subscribe_reloaded_purge');
134
  }
135
  // end activate
136
-
137
  // Function: deactivate
138
  // Description: Performs some clean-up maintenance (disable cron job).
139
  // Input: none
@@ -145,7 +163,7 @@ Please confirm your request by clicking on this link:
145
  wp_clear_scheduled_hook('subscribe_reloaded_purge');
146
  }
147
  // end deactivate
148
-
149
  // Function: subscribe_reloaded_purge
150
  // Description: Removes old entries from the database
151
  // Input: none
@@ -156,14 +174,14 @@ Please confirm your request by clicking on this link:
156
  if (($autopurge_interval = intval(get_option('subscribe_reloaded_purge_days', 0))) <= 0) return;
157
 
158
  // Delete old entries
159
- $delete_sql = "DELETE FROM `$this->table_subscriptions` WHERE `dt` <= DATE_SUB(NOW(), INTERVAL $autopurge_interval day)";
160
  $wpdb->query($delete_sql);
161
  }
162
  // end subscribe_reloaded_purge
163
-
164
  // Function: confirmation_email
165
  // Description: Sends the confirmation message to a given user
166
- // Input: email, post_id (to retrieve its title and permalink), comment_id
167
  // Output: none
168
  public function confirmation_email($_email = '', $_post_ID = 0){
169
  // Retrieve the options from the database
@@ -172,25 +190,25 @@ Please confirm your request by clicking on this link:
172
  $subject = stripslashes(get_option('subscribe_reloaded_double_check_subject', 'Please confirm your subscribtion to [post_title]'));
173
  $message = stripslashes(get_option('subscribe_reloaded_double_check_content', ''));
174
  $manager_link = get_permalink(get_option('subscribe_reloaded_manager_page', ''));
175
- $clean_email = urlencode($this->clean_email($_email));
176
  $subscriber_salt = md5($this->salt.$clean_email);
177
-
178
  if (strpos($manager_link, '?') !== false){
179
- $confirm_link = "$manager_link&sre=$clean_email&srk=$subscriber_salt&srp=$_post_ID&sra=c";
180
- $manager_link = "$manager_link&sre=$clean_email&srk=$subscriber_salt";
181
  }
182
  else{
183
- $confirm_link = "$manager_link?sre=$clean_email&srk=$subscriber_salt&srp=$_post_ID&sra=c";
184
- $manager_link = "$manager_link?sre=$clean_email&srk=$subscriber_salt";
185
  }
186
-
187
  $headers = "MIME-Version: 1.0\n";
188
  $headers .= "From: $from_name <$from_email>\n";
189
  $headers .= "Content-Type: text/plain; charset=".get_bloginfo('charset')."\n";
190
-
191
  $post = get_post($_post_ID);
192
  $post_permalink = get_permalink($_post_ID);
193
-
194
  // Replace tags with their actual values
195
  $subject = str_replace('[post_title]', $post->post_title, $subject);
196
  $message = str_replace('[post_title]', $post->post_title, $message);
@@ -201,31 +219,30 @@ Please confirm your request by clicking on this link:
201
  wp_mail($clean_email, $subject, $message, $headers);
202
  }
203
  // end confirmation_email
204
-
205
  // Function: new_comment_posted
206
- // Description: Deletes a row in the subscriptions' table
207
- // Input: post_id, email
208
  // Output: none
209
  public function new_comment_posted($_comment_ID = 0, $_comment_status = 0){
210
  global $wpdb;
211
-
212
  // Retrieve the information about the new comment
213
- $info = $wpdb->get_row("SELECT `comment_post_ID`, `comment_author_email` FROM $wpdb->comments WHERE `comment_ID` = '$_comment_ID' AND `comment_approved` = 1 LIMIT 1", OBJECT);
214
- $subscribed_emails = array();
215
-
216
- // Send a notification to all the users subscribed to this post
217
- if (!empty($info)){
218
- $subscribed_emails = $this->_get_subscriptions($info->comment_post_ID, 'Y');
219
- foreach($subscribed_emails as $a_email){
220
- // Skip the user who posted this new comment
221
- if ($a_email != $info->comment_author_email) $this->_notify_user($a_email, $info->comment_post_ID, $_comment_ID);
222
- }
223
- }
224
 
 
 
225
  // Did this visitor request to be subscribed to the discussion? (and s/he is not subscribed)
226
- if (!empty($_POST['subscribe-reloaded']) && $_POST['subscribe-reloaded'] == 'yes' && is_array($subscribed_emails)){
227
-
228
- // Are we using double check-in?
 
 
 
 
 
 
229
  $enable_double_check = get_option('subscribe_reloaded_enable_double_check', 'no');
230
  if ($enable_double_check == 'yes' && !$this->is_user_subscribed($info->comment_post_ID, $info->comment_author_email, 'C')){
231
  $this->add_subscription($info->comment_author_email, 'C', $info->comment_post_ID);
@@ -235,20 +252,91 @@ Please confirm your request by clicking on this link:
235
  $this->add_subscription($info->comment_author_email, 'Y', $info->comment_post_ID);
236
  }
237
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  return $_comment_ID;
239
  }
240
  // end new_comment_posted
241
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  // Function: subscribe_reloaded_manage
243
  // Description: Displays the appropriate management page
244
  // Input: default page content
245
  // Output: appropriate page content
246
  public function subscribe_reloaded_manage($_content = ''){
247
  global $post;
248
-
249
  $manager_page_id = get_option('subscribe_reloaded_manager_page', '0');
250
  if (empty($post) || ($post->ID != $manager_page_id) || (strpos($_SERVER['REQUEST_URI'],get_permalink($manager_page_id)) !== false) ) return $_content;
251
-
252
  $post_ID = !empty($_POST['srp'])?intval($_POST['srp']):(!empty($_GET['srp'])?intval($_GET['srp']):0);
253
 
254
  // Is the post_id passed in the query string valid?
@@ -256,7 +344,7 @@ Please confirm your request by clicking on this link:
256
  if (($post_ID > 0) && !is_object($target_post)){
257
  return $_content;
258
  }
259
-
260
  $action = !empty($_POST['sra'])?$_POST['sra']:(!empty($_GET['sra'])?$_GET['sra']:0);
261
  $email = !empty($_POST['sre'])?urldecode($_POST['sre']):(!empty($_GET['sre'])?urldecode($_GET['sre']):0);
262
  $key = !empty($_POST['srk'])?$_POST['srk']:(!empty($_GET['srk'])?$_GET['srk']:0);
@@ -266,7 +354,7 @@ Please confirm your request by clicking on this link:
266
  include(WP_PLUGIN_DIR.'/subscribe-to-comments-reloaded/templates/subscribe.php');
267
  return '';
268
  }
269
-
270
  // Management page for post authors
271
  if (($post_ID > 0) && $this->is_author($target_post->post_author)){
272
  include(WP_PLUGIN_DIR.'/subscribe-to-comments-reloaded/templates/author.php');
@@ -287,60 +375,60 @@ Please confirm your request by clicking on this link:
287
  include(WP_PLUGIN_DIR.'/subscribe-to-comments-reloaded/templates/user.php');
288
  return '';
289
  }
290
-
291
  // Get the management link in your email
292
  if (!empty($_COOKIE['comment_author_email_'. COOKIEHASH])){
293
  include(WP_PLUGIN_DIR.'/subscribe-to-comments-reloaded/templates/request-management-link.php');
294
  return '';
295
  }
296
-
297
  return $_content;
298
  }
299
  // end subscribe_reloaded_manage
300
 
301
  // Function: add_subscription
302
  // Description: Adds a new row to the table
303
- // Input: email, status, post_id
304
  // Output: none
305
  public function add_subscription($_email, $_status, $_post_ID){
306
  global $wpdb;
307
-
308
  // Using Wordpress local time
309
  $dt = date_i18n('Y-m-d H:i:s');
310
-
311
  $clean_email = $this->clean_email($_email);
312
  $wpdb->query("INSERT IGNORE INTO $this->table_subscriptions (`email`, `status`, `post_ID`, `dt`) VALUES ('$clean_email', '$_status', '$_post_ID', '$dt')");
313
  }
314
  // end add_subscription
315
-
316
  // Function: delete_subscription
317
  // Description: Deletes a row in the subscriptions' table
318
- // Input: post_id, email
319
  // Output: none
320
  public function delete_subscription($_post_ID = '', $_email = ''){
321
  global $wpdb;
322
-
323
  $sql = "DELETE FROM $this->table_subscriptions WHERE `post_ID` = '$_post_ID'".(!empty($_email)?" AND `email` = '$_email'":'');
324
  $wpdb->query( $sql );
325
  }
326
  // end delete_subscription
327
-
328
  // Function: is_user_subscribed
329
  // Description: Checks if a given email address is subscribed to a post
330
- // Input: post_id
331
  // Output: boolean
332
  public function is_user_subscribed($_post_ID = 0, $_email = '', $_status = 'Y'){
333
-
334
  if ((empty($_COOKIE['comment_author_email_'. COOKIEHASH]) && empty($_email)) || empty($_post_ID)) return false;
335
-
336
  $subscribed_emails = $this->_get_subscriptions($_post_ID, $_status);
337
  $user_email = empty($_email)?urldecode($_COOKIE['comment_author_email_'. COOKIEHASH]):$_email;
338
-
339
  if (in_array($user_email, $subscribed_emails)) return true;
340
  return false;
341
  }
342
  // end is_user_subscribed
343
-
344
  // Function: is_author
345
  // Description: Checks if current logged in user is the author of this post
346
  // Input: author ID
@@ -350,11 +438,11 @@ Please confirm your request by clicking on this link:
350
  return (!empty($current_user) && (($_post_author == $current_user->ID) || current_user_can('manage_options')));
351
  }
352
  // end is_author
353
-
354
  // Function: clean_email
355
  // Description: Returns an email address where some possible 'offending' strings have been removed
356
  // Input: email
357
- // Output: none
358
  public function clean_email($_email){
359
  $offending_strings = array(
360
  "/to\:/i",
@@ -368,21 +456,33 @@ Please confirm your request by clicking on this link:
368
  return htmlspecialchars(stripslashes(strip_tags(preg_replace($offending_strings, '', $_email))));
369
  }
370
  // end clean_email
371
-
372
  // Function: add_config_menu
373
  // Description: Adds a new entry in the admin menu, to manage this plugin's options
374
- // Input: none
375
- // Output: none
376
  public function add_config_menu( $_s ) {
377
  global $current_user;
378
 
379
  if (current_user_can('manage_options')){
380
- add_options_page( 'Subscribe to Comments', 'Subscribe to Comments', 'manage_options', WP_PLUGIN_DIR.'/subscribe-to-comments-reloaded/options.php' );
381
  }
382
  return $_s;
383
  }
384
  // end add_config_menu
385
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  // Function: _create_table
387
  // Description: Creates a table in the database
388
  // Input: SQL with the structure of the table to be created, name of the table
@@ -422,7 +522,7 @@ Please confirm your request by clicking on this link:
422
  $subject = stripslashes(get_option('subscribe_reloaded_notification_subject', 'There is a new comment on the post [post_title]'));
423
  $message = stripslashes(get_option('subscribe_reloaded_notification_content', ''));
424
  $manager_link = get_permalink(get_option('subscribe_reloaded_manager_page', ''));
425
- $clean_email = urlencode($this->clean_email($_email));
426
  $subscriber_salt = md5($this->salt.$clean_email);
427
  if (strpos($manager_link, '?') !== false){
428
  $manager_link = "$manager_link&sre=".urlencode($clean_email)."&srk=$subscriber_salt";
@@ -430,16 +530,16 @@ Please confirm your request by clicking on this link:
430
  else{
431
  $manager_link = "$manager_link?sre=".urlencode($clean_email)."&srk=$subscriber_salt";
432
  }
433
-
434
  $headers = "MIME-Version: 1.0\n";
435
  $headers .= "From: $from_name <$from_email>\n";
436
  $headers .= "Content-Type: text/plain; charset=".get_bloginfo('charset')."\n";
437
-
438
  $post = get_post($_post_ID);
439
  $comment = get_comment($_comment_ID);
440
  $post_permalink = get_permalink( $_post_ID );
441
  $comment_permalink = get_comment_link($_comment_ID);
442
-
443
  // Replace tags with their actual values
444
  $subject = str_replace('[post_title]', $post->post_title, $subject);
445
  $message = str_replace('[post_title]', $post->post_title, $message);
@@ -452,7 +552,7 @@ Please confirm your request by clicking on this link:
452
  wp_mail($clean_email, $subject, $message, $headers);
453
  }
454
  // end _notify_user
455
-
456
  // Function: _get_subscriptions
457
  // Description: Retrieves a list of emails subscribed to this post
458
  // Input: post_id
@@ -460,14 +560,14 @@ Please confirm your request by clicking on this link:
460
  private function _get_subscriptions($_post_ID = 0, $_status = 'Y'){
461
  global $wpdb;
462
  $flat_result = array();
463
-
464
  $result = $wpdb->get_results("SELECT DISTINCT `email` FROM $this->table_subscriptions WHERE `post_ID` = '$_post_ID' AND `status` = '$_status'", ARRAY_N);
465
  if (is_array($result)){
466
  foreach($result as $a_result){
467
  $flat_result[] = $a_result[0];
468
  }
469
  }
470
-
471
  return $flat_result;
472
  }
473
  // end _get_subscriptions
@@ -477,18 +577,28 @@ Please confirm your request by clicking on this link:
477
  // Ok, let's use every tool we defined here above
478
  $wp_subscribe_reloaded = new wp_subscribe_reloaded();
479
 
 
 
 
 
 
 
 
 
480
  // Initialization routine that should be executed on activation/deactivation
481
  register_activation_hook( __FILE__, array( &$wp_subscribe_reloaded, 'activate' ) );
482
  register_deactivation_hook( __FILE__, array( &$wp_subscribe_reloaded, 'deactivate' ) );
483
 
484
  // Add appropriate entries in the admin menu
485
  add_action( 'admin_menu', array( &$wp_subscribe_reloaded, 'add_config_menu' ) );
 
486
 
487
  // What to do when a new comment is posted
488
  add_action('comment_post', array( &$wp_subscribe_reloaded, 'new_comment_posted' ) );
489
 
490
- // Add user's subscription after a pending comment is approved
491
- // add_action('wp_set_comment_status', create_function('$a', 'global $sg_subscribe; sg_subscribe_start(); return $sg_subscribe->send_notifications($a);'));
 
492
 
493
  // Remove subscriptions attached to a post that is being deleted
494
  add_action( 'delete_post', array( &$wp_subscribe_reloaded, 'delete_subscription' ) );
@@ -500,4 +610,4 @@ add_filter('the_content', array( &$wp_subscribe_reloaded, 'subscribe_reloaded_ma
500
  add_action('comment_form', 'subscribe_reloaded_show');
501
 
502
  // Create a hook to use with the daily cron job
503
- add_action('subscribe_reloaded_purge', array( &$wp_slimstat,'subscribe_reloaded_purge') );
1
  <?php
2
  /*
3
  Plugin Name: Subscribe to Comments Reloaded
4
+ Version: 1.1
5
+ Plugin URI: http://lab.duechiacchiere.it/index.php?board=5.0
6
+ Description: Let your users follow the discussion...
7
  Author: camu
8
  Author URI: http://www.duechiacchiere.it/
9
  */
16
 
17
  function subscribe_reloaded_show(){
18
  global $post;
19
+
20
  $manager_link = get_permalink(get_option('subscribe_reloaded_manager_page', ''));
21
  if (strpos($manager_link, '?') !== false)
22
  $manager_link = "$manager_link&amp;srp=$post->ID";
23
  else
24
  $manager_link = "$manager_link?srp=$post->ID";
25
+
26
  $wp_subscribe_reloaded = new wp_subscribe_reloaded();
27
  if ($wp_subscribe_reloaded->is_author($post->post_author)){ // when the second parameter is empty, cookie value will be used
28
  echo str_replace('[manager_link]', $manager_link,
29
+ stripslashes(get_option('subscribe_reloaded_author_label', "You can <a href='[manager_link]'>manage the subscriptions</a> of this entry.")));
30
  }
31
+ elseif($wp_subscribe_reloaded->is_user_subscribed($post->ID, '', 'Y')){
32
  echo str_replace('[manager_link]', $manager_link,
33
  stripslashes(get_option('subscribe_reloaded_subscribed_label', "You are subscribed to this entry. <a href='[manager_link]'>Manage your subscriptions</a>.")));
34
  }
35
+ elseif($wp_subscribe_reloaded->is_user_subscribed($post->ID, '', 'C')){
36
  echo str_replace('[manager_link]', $manager_link,
37
  stripslashes(get_option('subscribe_reloaded_subscribed_waiting_label', "Your subscription to this entry needs to be confirmed. <a href='[manager_link]'>Manage your subscriptions</a>.")));
38
  }
51
  // Input: none
52
  // Output: none
53
  public function __construct(){
54
+ global $wpdb;
55
 
56
  // We use a bunch of tables to store data
57
+ $this->table_subscriptions = $wpdb->prefix . 'subscribe_reloaded';
58
  $this->salt = defined('NONCE_KEY')?NONCE_KEY:'please create a unique key in your wp-config.php';
59
  }
60
  // end __construct
65
  // Output: none
66
  public function activate(){
67
  global $wpdb;
68
+
69
  // Load localization files
70
  load_plugin_textdomain('subscribe-reloaded', WP_PLUGIN_DIR .'/subscribe-to-comments-reloaded/langs', '/subscribe-to-comments-reloaded/langs');
71
+
72
  // Table that stores the actual data about subscribers
73
  $subscriptions_table_sql = "
74
  CREATE TABLE IF NOT EXISTS `$this->table_subscriptions` (
94
  $wpdb->query($import_sql);
95
 
96
  // Remove the old data
97
+ $wpdb->query("ALTER TABLE $wpdb->comments DROP COLUMN `comment_subscribe`");
98
  }
99
 
100
  add_option('subscribe_reloaded_manager_page', '', '', 'no');
101
+ add_option('subscribe_reloaded_purge_days', '30', '', 'no');
102
  add_option('subscribe_reloaded_from_name', 'admin', '', 'no');
103
  add_option('subscribe_reloaded_from_email', get_bloginfo('admin_email'), '', 'no');
104
+ add_option('subscribe_reloaded_checked_by_default', 'no', '', 'no');
105
+ add_option('subscribe_reloaded_enable_double_check', 'no', '', 'no');
106
+ add_option('subscribe_reloaded_notify_authors', 'no', '', 'no');
107
+
108
  add_option('subscribe_reloaded_notification_subject', __('There is a new comment to [post_title]','subscribe-reloaded'), '', 'no');
109
  add_option('subscribe_reloaded_notification_content', __('There is a new comment to [post_title].
110
  Comment Link: [comment_permalink]
115
  Permalink: [post_permalink]
116
  Manage your subscriptions: [manager_link]','subscribe-reloaded'), '', 'no');
117
  add_option('subscribe_reloaded_checkbox_label', __("Notify me of followup comments via e-mail. You can also <a href='[subscribe_link]'>subscribe</a> without commenting.",'subscribe-reloaded'), '', 'no');
 
118
  add_option('subscribe_reloaded_subscribed_label', __("You are subscribed to this entry. <a href='[manager_link]'>Manage</a> your subscriptions.",'subscribe-reloaded'), '', 'no');
119
  add_option('subscribe_reloaded_subscribed_waiting_label', __("Your subscription to this entry needs to be confirmed. <a href='[manager_link]'>Manage your subscriptions</a>.",'subscribe-reloaded'), '', 'no');
120
+ add_option('subscribe_reloaded_author_label', __("You can <a href='[manager_link]'>manage the subscriptions</a> of this entry.",'subscribe-reloaded'), '', 'no');
 
121
  add_option('subscribe_reloaded_double_check_subject', __('Please confirm your subscribtion to [post_title]','subscribe-reloaded'), '', 'no');
122
  add_option('subscribe_reloaded_double_check_content', __('You have requested to be notified every time a new comment is added to:
123
  [post_permalink]
129
  add_option('subscribe_reloaded_management_subject', __('Manage your subscriptions on [blog_name]','subscribe-reloaded'));
130
  add_option('subscribe_reloaded_management_content', __('You have requested to manage your subscriptions to the articles on [blog_name]. Follow this link to access your personal page:
131
  [manager_link]','subscribe-reloaded'));
132
+
133
+ // Generate management page
134
+ if (intval(get_option('subscribe_reloaded_manager_page', 0)) <= 0){
135
+ $management_page_array = array(
136
+ 'post_title' => __('Manage subscriptions', 'subscribe-reloaded'),
137
+ 'post_content' => __('Oops, Huston we have a problem! Please contact the administrator of this blog for further details.', 'subscribe-reloaded'),
138
+ 'post_type' => 'page',
139
+ 'ping_status' => 'closed',
140
+ 'comment_status' => 'closed',
141
+ 'post_status' => 'publish',
142
+ 'post_author' => 1
143
+ );
144
+ $management_page_id = wp_insert_post($management_page_array);
145
+ if (!empty($management_page_id))
146
+ update_option('subscribe_reloaded_manager_page', $management_page_id);
147
+ }
148
+
149
  // Schedule the autopurge hook
150
  if (!wp_next_scheduled('subscribe_reloaded_purge'))
151
  wp_schedule_event(time(), 'daily', 'subscribe_reloaded_purge');
152
  }
153
  // end activate
154
+
155
  // Function: deactivate
156
  // Description: Performs some clean-up maintenance (disable cron job).
157
  // Input: none
163
  wp_clear_scheduled_hook('subscribe_reloaded_purge');
164
  }
165
  // end deactivate
166
+
167
  // Function: subscribe_reloaded_purge
168
  // Description: Removes old entries from the database
169
  // Input: none
174
  if (($autopurge_interval = intval(get_option('subscribe_reloaded_purge_days', 0))) <= 0) return;
175
 
176
  // Delete old entries
177
+ $delete_sql = "DELETE FROM `$this->table_subscriptions` WHERE `dt` <= DATE_SUB(NOW(), INTERVAL $autopurge_interval day) AND `status` = 'C'";
178
  $wpdb->query($delete_sql);
179
  }
180
  // end subscribe_reloaded_purge
181
+
182
  // Function: confirmation_email
183
  // Description: Sends the confirmation message to a given user
184
+ // Input: email, post ID (to retrieve its title and permalink)
185
  // Output: none
186
  public function confirmation_email($_email = '', $_post_ID = 0){
187
  // Retrieve the options from the database
190
  $subject = stripslashes(get_option('subscribe_reloaded_double_check_subject', 'Please confirm your subscribtion to [post_title]'));
191
  $message = stripslashes(get_option('subscribe_reloaded_double_check_content', ''));
192
  $manager_link = get_permalink(get_option('subscribe_reloaded_manager_page', ''));
193
+ $clean_email = $this->clean_email($_email);
194
  $subscriber_salt = md5($this->salt.$clean_email);
195
+
196
  if (strpos($manager_link, '?') !== false){
197
+ $confirm_link = "$manager_link&sre=".urlencode($clean_email)."&srk=$subscriber_salt&srp=$_post_ID&sra=c";
198
+ $manager_link = "$manager_link&sre=".urlencode($clean_email)."&srk=$subscriber_salt";
199
  }
200
  else{
201
+ $confirm_link = "$manager_link?sre=".urlencode($clean_email)."&srk=$subscriber_salt&srp=$_post_ID&sra=c";
202
+ $manager_link = "$manager_link?sre=".urlencode($clean_email)."&srk=$subscriber_salt";
203
  }
204
+
205
  $headers = "MIME-Version: 1.0\n";
206
  $headers .= "From: $from_name <$from_email>\n";
207
  $headers .= "Content-Type: text/plain; charset=".get_bloginfo('charset')."\n";
208
+
209
  $post = get_post($_post_ID);
210
  $post_permalink = get_permalink($_post_ID);
211
+
212
  // Replace tags with their actual values
213
  $subject = str_replace('[post_title]', $post->post_title, $subject);
214
  $message = str_replace('[post_title]', $post->post_title, $message);
219
  wp_mail($clean_email, $subject, $message, $headers);
220
  }
221
  // end confirmation_email
222
+
223
  // Function: new_comment_posted
224
+ // Description: Adds a new row in the subscriptions' table, when a new comment is posted
225
+ // Input: comment ID, comment status (not used)
226
  // Output: none
227
  public function new_comment_posted($_comment_ID = 0, $_comment_status = 0){
228
  global $wpdb;
229
+
230
  // Retrieve the information about the new comment
231
+ $info = $wpdb->get_row("SELECT `comment_post_ID`, `comment_author_email`, `comment_approved` FROM $wpdb->comments WHERE `comment_ID` = '$_comment_ID' LIMIT 1", OBJECT);
232
+ if (empty($info) || $info->comment_approved == 'spam') return $_comment_ID;
 
 
 
 
 
 
 
 
 
233
 
234
+ $subscribed_emails = array();
235
+
236
  // Did this visitor request to be subscribed to the discussion? (and s/he is not subscribed)
237
+ if (!empty($_POST['subscribe-reloaded']) && $_POST['subscribe-reloaded'] == 'yes'){
238
+
239
+ // Comment has been held in the moderation queue
240
+ if ($info->comment_approved == '0'){
241
+ $this->add_subscription($info->comment_author_email, 'C', $info->comment_post_ID);
242
+ return $_comment_ID;
243
+ }
244
+
245
+ // Are we using double check-in?
246
  $enable_double_check = get_option('subscribe_reloaded_enable_double_check', 'no');
247
  if ($enable_double_check == 'yes' && !$this->is_user_subscribed($info->comment_post_ID, $info->comment_author_email, 'C')){
248
  $this->add_subscription($info->comment_author_email, 'C', $info->comment_post_ID);
252
  $this->add_subscription($info->comment_author_email, 'Y', $info->comment_post_ID);
253
  }
254
  }
255
+
256
+ // Send a notification to all the users subscribed to this post
257
+ if (!empty($info)){
258
+ $subscribed_emails = $this->_get_subscriptions($info->comment_post_ID, 'Y');
259
+ foreach($subscribed_emails as $a_email){
260
+ // Skip the user who posted this new comment
261
+ if ($a_email != $info->comment_author_email) $this->_notify_user($a_email, $info->comment_post_ID, $_comment_ID);
262
+ }
263
+ }
264
+
265
+ // Notify author, if the case
266
+ $notify_author = get_option('subscribe_reloaded_notify_authors', 'no');
267
+ if ($notify_author == 'yes'){
268
+ $author_email = $wpdb->get_var("SELECT tu.`user_email` FROM $wpdb->posts tp, $wpdb->users tu WHERE tp.`post_author` = tu.`ID` AND tp.`ID` = '$info->comment_post_ID'");
269
+ $this->_notify_user($author_email, $info->comment_post_ID, $_comment_ID);
270
+ }
271
+
272
  return $_comment_ID;
273
  }
274
  // end new_comment_posted
275
+
276
+ // Function: comment_status
277
+ // Description: Performs the appropriate action when a comment is edited
278
+ // Input: comment ID, new comment status (not used)
279
+ // Output: comment ID
280
+ public function comment_status($_comment_ID = 0, $_comment_status = 0){
281
+ global $wpdb;
282
+
283
+ // Retrieve the information about the comment
284
+ $info = $wpdb->get_row("SELECT `comment_post_ID`, `comment_author_email`, `comment_approved` FROM $wpdb->comments WHERE `comment_ID` = '$_comment_ID' LIMIT 1", OBJECT);
285
+ if (empty($info)) return $_comment_ID;
286
+
287
+ switch($info->comment_approved){
288
+ case '0': // Unapproved
289
+ case 'trash':
290
+ $wpdb->query("UPDATE $this->table_subscriptions set `status` = 'C' WHERE `email` = '$info->comment_author_email' AND `post_ID` = '$info->comment_post_ID'");
291
+ break;
292
+
293
+ case '1': // Approved
294
+ // Are we using double check-in?
295
+ $enable_double_check = get_option('subscribe_reloaded_enable_double_check', 'no');
296
+ if (($enable_double_check == 'yes') && $this->is_user_subscribed($info->comment_post_ID, $info->comment_author_email, 'C')){
297
+ $this->confirmation_email($info->comment_author_email, $info->comment_post_ID);
298
+ }
299
+ else{
300
+ $wpdb->query("UPDATE $this->table_subscriptions set `status` = 'Y' WHERE `email` = '$info->comment_author_email' AND `post_ID` = '$info->comment_post_ID'");
301
+ }
302
+ break;
303
+
304
+ default:
305
+ break;
306
+ }
307
+ return $_comment_ID;
308
+ }
309
+ // end comment_status
310
+
311
+ // Function: comment_deleted
312
+ // Description: Performs the appropriate action when a comment is deleted
313
+ // Input: ID of the deleted comment
314
+ // Output: comment ID
315
+ public function comment_deleted($_comment_ID){
316
+ global $wpdb;
317
+
318
+ $info = $wpdb->get_row("SELECT `comment_post_ID`, `comment_author_email`, `comment_approved` FROM $wpdb->comments WHERE `comment_ID` = '$_comment_ID' LIMIT 1", OBJECT);
319
+ if (empty($info)) return $_comment_ID;
320
+
321
+ // Are there any other approved comments sent by this user?
322
+ $count_approved_comments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE `comment_post_ID` = '$info->comment_post_ID' AND `comment_author_email` = '$info->comment_author_email' AND `comment_approved` = 1");
323
+ if (intval($count_approved_comments) == 0){
324
+ $this->delete_subscription($info->comment_post_ID, $info->comment_author_email);
325
+ }
326
+ return $_comment_ID;
327
+ }
328
+ // end comment_deleted
329
+
330
  // Function: subscribe_reloaded_manage
331
  // Description: Displays the appropriate management page
332
  // Input: default page content
333
  // Output: appropriate page content
334
  public function subscribe_reloaded_manage($_content = ''){
335
  global $post;
336
+
337
  $manager_page_id = get_option('subscribe_reloaded_manager_page', '0');
338
  if (empty($post) || ($post->ID != $manager_page_id) || (strpos($_SERVER['REQUEST_URI'],get_permalink($manager_page_id)) !== false) ) return $_content;
339
+
340
  $post_ID = !empty($_POST['srp'])?intval($_POST['srp']):(!empty($_GET['srp'])?intval($_GET['srp']):0);
341
 
342
  // Is the post_id passed in the query string valid?
344
  if (($post_ID > 0) && !is_object($target_post)){
345
  return $_content;
346
  }
347
+
348
  $action = !empty($_POST['sra'])?$_POST['sra']:(!empty($_GET['sra'])?$_GET['sra']:0);
349
  $email = !empty($_POST['sre'])?urldecode($_POST['sre']):(!empty($_GET['sre'])?urldecode($_GET['sre']):0);
350
  $key = !empty($_POST['srk'])?$_POST['srk']:(!empty($_GET['srk'])?$_GET['srk']:0);
354
  include(WP_PLUGIN_DIR.'/subscribe-to-comments-reloaded/templates/subscribe.php');
355
  return '';
356
  }
357
+
358
  // Management page for post authors
359
  if (($post_ID > 0) && $this->is_author($target_post->post_author)){
360
  include(WP_PLUGIN_DIR.'/subscribe-to-comments-reloaded/templates/author.php');
375
  include(WP_PLUGIN_DIR.'/subscribe-to-comments-reloaded/templates/user.php');
376
  return '';
377
  }
378
+
379
  // Get the management link in your email
380
  if (!empty($_COOKIE['comment_author_email_'. COOKIEHASH])){
381
  include(WP_PLUGIN_DIR.'/subscribe-to-comments-reloaded/templates/request-management-link.php');
382
  return '';
383
  }
384
+
385
  return $_content;
386
  }
387
  // end subscribe_reloaded_manage
388
 
389
  // Function: add_subscription
390
  // Description: Adds a new row to the table
391
+ // Input: email, status, post ID
392
  // Output: none
393
  public function add_subscription($_email, $_status, $_post_ID){
394
  global $wpdb;
395
+
396
  // Using Wordpress local time
397
  $dt = date_i18n('Y-m-d H:i:s');
398
+
399
  $clean_email = $this->clean_email($_email);
400
  $wpdb->query("INSERT IGNORE INTO $this->table_subscriptions (`email`, `status`, `post_ID`, `dt`) VALUES ('$clean_email', '$_status', '$_post_ID', '$dt')");
401
  }
402
  // end add_subscription
403
+
404
  // Function: delete_subscription
405
  // Description: Deletes a row in the subscriptions' table
406
+ // Input: post ID, email
407
  // Output: none
408
  public function delete_subscription($_post_ID = '', $_email = ''){
409
  global $wpdb;
410
+
411
  $sql = "DELETE FROM $this->table_subscriptions WHERE `post_ID` = '$_post_ID'".(!empty($_email)?" AND `email` = '$_email'":'');
412
  $wpdb->query( $sql );
413
  }
414
  // end delete_subscription
415
+
416
  // Function: is_user_subscribed
417
  // Description: Checks if a given email address is subscribed to a post
418
+ // Input: post ID, email, status of the subscription
419
  // Output: boolean
420
  public function is_user_subscribed($_post_ID = 0, $_email = '', $_status = 'Y'){
421
+
422
  if ((empty($_COOKIE['comment_author_email_'. COOKIEHASH]) && empty($_email)) || empty($_post_ID)) return false;
423
+
424
  $subscribed_emails = $this->_get_subscriptions($_post_ID, $_status);
425
  $user_email = empty($_email)?urldecode($_COOKIE['comment_author_email_'. COOKIEHASH]):$_email;
426
+
427
  if (in_array($user_email, $subscribed_emails)) return true;
428
  return false;
429
  }
430
  // end is_user_subscribed
431
+
432
  // Function: is_author
433
  // Description: Checks if current logged in user is the author of this post
434
  // Input: author ID
438
  return (!empty($current_user) && (($_post_author == $current_user->ID) || current_user_can('manage_options')));
439
  }
440
  // end is_author
441
+
442
  // Function: clean_email
443
  // Description: Returns an email address where some possible 'offending' strings have been removed
444
  // Input: email
445
+ // Output: clean email address
446
  public function clean_email($_email){
447
  $offending_strings = array(
448
  "/to\:/i",
456
  return htmlspecialchars(stripslashes(strip_tags(preg_replace($offending_strings, '', $_email))));
457
  }
458
  // end clean_email
459
+
460
  // Function: add_config_menu
461
  // Description: Adds a new entry in the admin menu, to manage this plugin's options
462
+ // Input: wordpress internal strings
463
+ // Output: same string received as input
464
  public function add_config_menu( $_s ) {
465
  global $current_user;
466
 
467
  if (current_user_can('manage_options')){
468
+ add_options_page( 'Subscribe to Comments', 'Subscribe to Comments', 'manage_options', WP_PLUGIN_DIR.'/subscribe-to-comments-reloaded/options/index.php' );
469
  }
470
  return $_s;
471
  }
472
  // end add_config_menu
473
 
474
+ // Function: add_stylesheet
475
+ // Description: Adds a custom stylesheet file to the admin interface
476
+ // Input: none
477
+ // Output: none
478
+ public function add_stylesheet() {
479
+ // It looks like WP_PLUGIN_URL doesn't honor the HTTPS setting in wp-config.php
480
+ $stylesheet_url = (is_ssl()?str_replace('http://', 'https://', WP_PLUGIN_URL):WP_PLUGIN_URL).'/subscribe-to-comments-reloaded/style.css';
481
+ wp_register_style('subscribe-to-comments', $stylesheet_url);
482
+ wp_enqueue_style('subscribe-to-comments');
483
+ }
484
+ // end add_stylesheet
485
+
486
  // Function: _create_table
487
  // Description: Creates a table in the database
488
  // Input: SQL with the structure of the table to be created, name of the table
522
  $subject = stripslashes(get_option('subscribe_reloaded_notification_subject', 'There is a new comment on the post [post_title]'));
523
  $message = stripslashes(get_option('subscribe_reloaded_notification_content', ''));
524
  $manager_link = get_permalink(get_option('subscribe_reloaded_manager_page', ''));
525
+ $clean_email = $this->clean_email($_email);
526
  $subscriber_salt = md5($this->salt.$clean_email);
527
  if (strpos($manager_link, '?') !== false){
528
  $manager_link = "$manager_link&sre=".urlencode($clean_email)."&srk=$subscriber_salt";
530
  else{
531
  $manager_link = "$manager_link?sre=".urlencode($clean_email)."&srk=$subscriber_salt";
532
  }
533
+
534
  $headers = "MIME-Version: 1.0\n";
535
  $headers .= "From: $from_name <$from_email>\n";
536
  $headers .= "Content-Type: text/plain; charset=".get_bloginfo('charset')."\n";
537
+
538
  $post = get_post($_post_ID);
539
  $comment = get_comment($_comment_ID);
540
  $post_permalink = get_permalink( $_post_ID );
541
  $comment_permalink = get_comment_link($_comment_ID);
542
+
543
  // Replace tags with their actual values
544
  $subject = str_replace('[post_title]', $post->post_title, $subject);
545
  $message = str_replace('[post_title]', $post->post_title, $message);
552
  wp_mail($clean_email, $subject, $message, $headers);
553
  }
554
  // end _notify_user
555
+
556
  // Function: _get_subscriptions
557
  // Description: Retrieves a list of emails subscribed to this post
558
  // Input: post_id
560
  private function _get_subscriptions($_post_ID = 0, $_status = 'Y'){
561
  global $wpdb;
562
  $flat_result = array();
563
+
564
  $result = $wpdb->get_results("SELECT DISTINCT `email` FROM $this->table_subscriptions WHERE `post_ID` = '$_post_ID' AND `status` = '$_status'", ARRAY_N);
565
  if (is_array($result)){
566
  foreach($result as $a_result){
567
  $flat_result[] = $a_result[0];
568
  }
569
  }
570
+
571
  return $flat_result;
572
  }
573
  // end _get_subscriptions
577
  // Ok, let's use every tool we defined here above
578
  $wp_subscribe_reloaded = new wp_subscribe_reloaded();
579
 
580
+ // Setup a cookie if the user just subscribed without commenting
581
+ $subscribe_to_comments_action = !empty($_POST['sra'])?$_POST['sra']:(!empty($_GET['sra'])?$_GET['sra']:0);
582
+ $subscribe_to_comments_post_ID = !empty($_POST['srp'])?intval($_POST['srp']):(!empty($_GET['srp'])?intval($_GET['srp']):0);
583
+ if (!empty($subscribe_to_comments_action) && !empty($_POST['subscribe_reloaded_email']) && ($subscribe_to_comments_action == 's') && ($subscribe_to_comments_post_ID > 0)){
584
+ $subscribe_to_comments_clean_email = $wp_subscribe_reloaded->clean_email($_POST['subscribe_reloaded_email']);
585
+ setcookie('comment_author_email'.COOKIEHASH, $subscribe_to_comments_clean_email, time()+1209600, '/');
586
+ }
587
+
588
  // Initialization routine that should be executed on activation/deactivation
589
  register_activation_hook( __FILE__, array( &$wp_subscribe_reloaded, 'activate' ) );
590
  register_deactivation_hook( __FILE__, array( &$wp_subscribe_reloaded, 'deactivate' ) );
591
 
592
  // Add appropriate entries in the admin menu
593
  add_action( 'admin_menu', array( &$wp_subscribe_reloaded, 'add_config_menu' ) );
594
+ add_action('admin_print_styles-subscribe-to-comments-reloaded/options/index.php', array( &$wp_subscribe_reloaded, 'add_stylesheet') );
595
 
596
  // What to do when a new comment is posted
597
  add_action('comment_post', array( &$wp_subscribe_reloaded, 'new_comment_posted' ) );
598
 
599
+ // Monitor actions on existing comments
600
+ add_action('delete_comment', array( &$wp_subscribe_reloaded, 'comment_deleted' ) );
601
+ add_action('wp_set_comment_status', array( &$wp_subscribe_reloaded, 'comment_status' ) );
602
 
603
  // Remove subscriptions attached to a post that is being deleted
604
  add_action( 'delete_post', array( &$wp_subscribe_reloaded, 'delete_subscription' ) );
610
  add_action('comment_form', 'subscribe_reloaded_show');
611
 
612
  // Create a hook to use with the daily cron job
613
+ add_action('subscribe_reloaded_purge', array( &$wp_subscribe_reloaded,'subscribe_reloaded_purge') );
templates/author.php CHANGED
@@ -37,12 +37,13 @@ else{
37
 
38
  <form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>" method="post" id="email_list_form"
39
  onsubmit="return confirm('<?php _e('Please remember: this operation cannot be undone. Are you sure you want to proceed?', 'subscribe-reloaded') ?>')">
40
- <fieldset>
41
  <?php
42
  $subscriptions = $wpdb->get_results("SELECT `email`, `status`, `dt` FROM $wp_subscribe_reloaded->table_subscriptions WHERE `post_ID` = '$clean_post_id' ORDER BY `dt` ASC, `email` ASC", OBJECT);
43
  if (is_array($subscriptions) && !empty($subscriptions)){
44
  $title = __('Title','subscribe-reloaded').': <strong>'.get_the_title($clean_post_id).'</strong>';
45
  echo "<p>$title</p>";
 
46
  echo '<ul>';
47
  foreach($subscriptions as $i => $a_subscription){
48
  $subscriber_salt = md5($wp_subscribe_reloaded->salt.$a_subscription->email);
@@ -53,13 +54,13 @@ else{
53
  $manager_link = "$manager_link?sre=".urlencode($a_subscription->email)."&srk=$subscriber_salt";
54
  echo "<li><input type='checkbox' name='email_list[]' value='{$a_subscription->email}' id='e_$i'/> <label for='e_$i'><a href='$manager_link'>$a_subscription->email</a> - $a_subscription->dt</label> [$a_subscription->status]</li>\n";
55
  }
56
- echo '</ul><p>'.__('Legend: Y: subscribed, N: suspended, C: awaiting confirmation','subscribe-reloaded').'</p>';
 
 
57
  echo '<p>'.__('Action:','subscribe-reloaded').' <input type="radio" name="action_type" value="d" id="action_type_delete" /> <label for="action_type_delete">'.__('Delete','subscribe-reloaded').'</label> &nbsp;&nbsp;&nbsp;&nbsp; ';
58
  echo '<input type="radio" name="action_type" value="s" id="action_type_suspend" checked="checked" /> <label for="action_type_suspend">'.__('Suspend','subscribe-reloaded').'</label> &nbsp;&nbsp;&nbsp;&nbsp; ';
59
  echo '<input type="radio" name="action_type" value="a" id="action_type_activate" /> <label for="action_type_activate">'.__('Resume','subscribe-reloaded').'</label></p>';
60
- echo '<p><input type="button" class="subscribe-form-button" onclick="t=document.getElementById(\'email_list_form\').elements;for(i in t) t[i].checked=1" value="'.__('Select all','subscribe-reloaded').'" />';
61
- echo '<input type="button" class="subscribe-form-button" onclick="t=document.getElementById(\'email_list_form\').elements;for(i in t)if(t[i].checked==1){t[i].checked=0} else{t[i].checked=1}" value="'.__('Invert selection','subscribe-reloaded').'" />';
62
- echo '<input type="submit" class="subscribe-form-button" value="'.__('Update subscriptions','subscribe-reloaded').'" /><input type="hidden" name="srp" value="'.$clean_post_id.'"/></p>';
63
 
64
  }
65
  else{
@@ -67,21 +68,4 @@ else{
67
  }
68
  ?>
69
  </fieldset>
70
- </form>
71
-
72
- <?php if (current_user_can('manage_options')): ?>
73
- <h3><?php _e('Filters','subscribe-reloaded') ?></h3>
74
- <form action="<?php echo get_permalink(get_option('subscribe_reloaded_manager_page', '')) ?>" method="post" id="change_post_id">
75
- <fieldset>
76
- <p><?php _e('If you know the ID of a post you want to manage, enter it in the field here below to see a list of email addresses subscribed to it','subscribe-reloaded') ?>
77
- <br/><input type="text" size="10" name="srp" value="" /> <input type="submit" class="subscribe-form-button" value="<?php _e('Search post ID','subscribe-reloaded') ?>" /></p>
78
- </fieldset>
79
- </form>
80
-
81
- <form action="<?php echo get_permalink(get_option('subscribe_reloaded_manager_page', '')) ?>" method="post" id="filter_email_address">
82
- <fieldset>
83
- <p><?php _e('If you know the email address you want to manage, enter it in the field here below to see a list of articles this reader is currently watching','subscribe-reloaded') ?>
84
- <br/><input type="text" size="40" name="sre" value="" /> <input type="submit" class="subscribe-form-button" value="<?php _e('Search email','subscribe-reloaded') ?>" /></p>
85
- </fieldset>
86
- </form>
87
- <?php endif; // current_user_can('manage_options') ?>
37
 
38
  <form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>" method="post" id="email_list_form"
39
  onsubmit="return confirm('<?php _e('Please remember: this operation cannot be undone. Are you sure you want to proceed?', 'subscribe-reloaded') ?>')">
40
+ <fieldset style="border:0">
41
  <?php
42
  $subscriptions = $wpdb->get_results("SELECT `email`, `status`, `dt` FROM $wp_subscribe_reloaded->table_subscriptions WHERE `post_ID` = '$clean_post_id' ORDER BY `dt` ASC, `email` ASC", OBJECT);
43
  if (is_array($subscriptions) && !empty($subscriptions)){
44
  $title = __('Title','subscribe-reloaded').': <strong>'.get_the_title($clean_post_id).'</strong>';
45
  echo "<p>$title</p>";
46
+ echo '<p>'.__('Legend: Y: subscribed, N: suspended, C: awaiting confirmation','subscribe-reloaded').'</p>';
47
  echo '<ul>';
48
  foreach($subscriptions as $i => $a_subscription){
49
  $subscriber_salt = md5($wp_subscribe_reloaded->salt.$a_subscription->email);
54
  $manager_link = "$manager_link?sre=".urlencode($a_subscription->email)."&srk=$subscriber_salt";
55
  echo "<li><input type='checkbox' name='email_list[]' value='{$a_subscription->email}' id='e_$i'/> <label for='e_$i'><a href='$manager_link'>$a_subscription->email</a> - $a_subscription->dt</label> [$a_subscription->status]</li>\n";
56
  }
57
+ echo '</ul>';
58
+ echo '<p><a class="small-text" href="#" onclick="t=document.getElementById(\'email_list_form\').elements;for(i in t) t[i].checked=1">'.__('Select all','subscribe-reloaded').'</a> - ';
59
+ echo '<a class="small-text" href="#" onclick="t=document.getElementById(\'email_list_form\').elements;for(i in t)if(t[i].checked==1){t[i].checked=0} else{t[i].checked=1}">'.__('Invert selection','subscribe-reloaded').'</a></p>';
60
  echo '<p>'.__('Action:','subscribe-reloaded').' <input type="radio" name="action_type" value="d" id="action_type_delete" /> <label for="action_type_delete">'.__('Delete','subscribe-reloaded').'</label> &nbsp;&nbsp;&nbsp;&nbsp; ';
61
  echo '<input type="radio" name="action_type" value="s" id="action_type_suspend" checked="checked" /> <label for="action_type_suspend">'.__('Suspend','subscribe-reloaded').'</label> &nbsp;&nbsp;&nbsp;&nbsp; ';
62
  echo '<input type="radio" name="action_type" value="a" id="action_type_activate" /> <label for="action_type_activate">'.__('Resume','subscribe-reloaded').'</label></p>';
63
+ echo '<p><input type="submit" class="subscribe-form-button" value="'.__('Update subscriptions','subscribe-reloaded').'" /><input type="hidden" name="srp" value="'.$clean_post_id.'"/></p>';
 
 
64
 
65
  }
66
  else{
68
  }
69
  ?>
70
  </fieldset>
71
+ </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/request-management-link.php CHANGED
@@ -9,7 +9,7 @@ if (strpos($_SERVER['SCRIPT_FILENAME'], basename(__FILE__))){
9
  load_plugin_textdomain('subscribe-reloaded', WP_PLUGIN_DIR .'/subscribe-to-comments-reloaded/langs', '/subscribe-to-comments-reloaded/langs');
10
 
11
  // Is the post_id passed in the query string valid?
12
- $post_ID = !empty($_GET['srp'])?intval($_GET['srp']):0;
13
  $post = get_post($post_ID);
14
  if (($post_ID > 0) && !is_object($post)){
15
  return '';
@@ -52,7 +52,7 @@ if (!empty($_POST['subscribe_reloaded_email'])){
52
 
53
  <p><?php _e("To manage your subscriptions, please enter your email address here below. We will send you a message containing the link to access your personal management page.", 'subscribe-reloaded'); ?></p>
54
  <form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post" onsubmit="if(this.subscribe_reloaded_email.value=='' || his.subscribe_reloaded_email.value.indexOf('@')==0) return false">
55
- <fieldset>
56
  <p><label for="subscribe_reloaded_email"><?php _e('Email','subscribe-reloaded') ?></label> <input type="text" class="subscribe-form-field" name="subscribe_reloaded_email" value="<?php echo isset($_COOKIE['comment_author_email_'.COOKIEHASH])?$_COOKIE['comment_author_email_'.COOKIEHASH]:'email'; ?>" size="22"/>
57
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e('Send','subscribe-reloaded') ?>" /></p>
58
  </fieldset>
9
  load_plugin_textdomain('subscribe-reloaded', WP_PLUGIN_DIR .'/subscribe-to-comments-reloaded/langs', '/subscribe-to-comments-reloaded/langs');
10
 
11
  // Is the post_id passed in the query string valid?
12
+ $post_ID = !empty($_POST['srp'])?intval($_POST['srp']):(!empty($_GET['srp'])?intval($_GET['srp']):0);
13
  $post = get_post($post_ID);
14
  if (($post_ID > 0) && !is_object($post)){
15
  return '';
52
 
53
  <p><?php _e("To manage your subscriptions, please enter your email address here below. We will send you a message containing the link to access your personal management page.", 'subscribe-reloaded'); ?></p>
54
  <form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post" onsubmit="if(this.subscribe_reloaded_email.value=='' || his.subscribe_reloaded_email.value.indexOf('@')==0) return false">
55
+ <fieldset style="border:0">
56
  <p><label for="subscribe_reloaded_email"><?php _e('Email','subscribe-reloaded') ?></label> <input type="text" class="subscribe-form-field" name="subscribe_reloaded_email" value="<?php echo isset($_COOKIE['comment_author_email_'.COOKIEHASH])?$_COOKIE['comment_author_email_'.COOKIEHASH]:'email'; ?>" size="22"/>
57
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e('Send','subscribe-reloaded') ?>" /></p>
58
  </fieldset>
templates/subscribe.php CHANGED
@@ -32,12 +32,12 @@ if (!empty($_POST['subscribe_reloaded_email'])){
32
  wp_mail(get_bloginfo('admin_email'), $subject, $message, $headers);
33
 
34
  echo '<p>';
35
- if ($enable_double_check == 'yes'){
36
  $wp_subscribe_reloaded->add_subscription($_POST['subscribe_reloaded_email'], 'C', $post_ID);
37
- $this->confirmation_email($_POST['subscribe_reloaded_email'], $post_ID);
38
  printf(__("Thank you for using our subscription service. In order to confirm your request, please check your email for the verification message and follow the instructions. In the meanwhile, you can go back to <a href='%s'>%s</a>.", 'subscribe-reloaded'), get_permalink($post_ID), $post->post_title);
39
  }
40
- else {
41
  $this->add_subscription($_POST['subscribe_reloaded_email'], 'Y', $post_ID);
42
  printf(__("Thank you for using our subscription service. Your request has been completed, and you are now subscribed to <a href='%s'>%s</a>. You will receive a notification email every time a new comment to this article is approved and posted by the administrator.", 'subscribe-reloaded'), get_permalink($post_ID), $post->post_title);
43
  }
@@ -49,7 +49,7 @@ if (!empty($_POST['subscribe_reloaded_email'])){
49
 
50
  <p><?php printf(__("You can follow the discussion on <strong>%s</strong> without having to leave a comment. Cool, huh? Just enter your email address in the form here below and you're all set.", 'subscribe-reloaded'), $post->post_title); ?></p>
51
  <form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post" onsubmit="if(this.subscribe_reloaded_email.value=='' || his.subscribe_reloaded_email.value.indexOf('@')==0) return false">
52
- <fieldset>
53
  <p><label for="subscribe_reloaded_email"><?php _e('Email','subscribe-reloaded') ?></label> <input type="text" class="subscribe-form-field" name="subscribe_reloaded_email" value="<?php echo isset($_COOKIE['comment_author_email_'.COOKIEHASH])?$_COOKIE['comment_author_email_'.COOKIEHASH]:'email'; ?>" size="22"/>
54
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e('Send','subscribe-reloaded') ?>" /></p>
55
  </fieldset>
32
  wp_mail(get_bloginfo('admin_email'), $subject, $message, $headers);
33
 
34
  echo '<p>';
35
+ if ($enable_double_check == 'yes' && !$wp_subscribe_reloaded->is_user_subscribed($post_ID, $_POST['subscribe_reloaded_email'], 'C')){
36
  $wp_subscribe_reloaded->add_subscription($_POST['subscribe_reloaded_email'], 'C', $post_ID);
37
+ $wp_subscribe_reloaded->confirmation_email($_POST['subscribe_reloaded_email'], $post_ID);
38
  printf(__("Thank you for using our subscription service. In order to confirm your request, please check your email for the verification message and follow the instructions. In the meanwhile, you can go back to <a href='%s'>%s</a>.", 'subscribe-reloaded'), get_permalink($post_ID), $post->post_title);
39
  }
40
+ elseif(!$wp_subscribe_reloaded->is_user_subscribed($post_ID, $_POST['subscribe_reloaded_email'], 'Y')){
41
  $this->add_subscription($_POST['subscribe_reloaded_email'], 'Y', $post_ID);
42
  printf(__("Thank you for using our subscription service. Your request has been completed, and you are now subscribed to <a href='%s'>%s</a>. You will receive a notification email every time a new comment to this article is approved and posted by the administrator.", 'subscribe-reloaded'), get_permalink($post_ID), $post->post_title);
43
  }
49
 
50
  <p><?php printf(__("You can follow the discussion on <strong>%s</strong> without having to leave a comment. Cool, huh? Just enter your email address in the form here below and you're all set.", 'subscribe-reloaded'), $post->post_title); ?></p>
51
  <form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post" onsubmit="if(this.subscribe_reloaded_email.value=='' || his.subscribe_reloaded_email.value.indexOf('@')==0) return false">
52
+ <fieldset style="border:0">
53
  <p><label for="subscribe_reloaded_email"><?php _e('Email','subscribe-reloaded') ?></label> <input type="text" class="subscribe-form-field" name="subscribe_reloaded_email" value="<?php echo isset($_COOKIE['comment_author_email_'.COOKIEHASH])?$_COOKIE['comment_author_email_'.COOKIEHASH]:'email'; ?>" size="22"/>
54
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e('Send','subscribe-reloaded') ?>" /></p>
55
  </fieldset>
templates/user.php CHANGED
@@ -35,24 +35,25 @@ else{
35
 
36
  <form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>" method="post" id="post_list_form"
37
  onsubmit="return confirm('<?php _e('Please remember: this operation cannot be undone. Are you sure you want to proceed?', 'subscribe-reloaded') ?>')">
38
- <fieldset>
39
  <?php
40
  $clean_email = !empty($_POST['sre'])?$wp_subscribe_reloaded->clean_email($_POST['sre']):(!empty($_GET['sre'])?$wp_subscribe_reloaded->clean_email($_GET['sre']):'');
41
  $subscriptions = $wpdb->get_results("SELECT `status`, `post_ID`, `dt` FROM $wp_subscribe_reloaded->table_subscriptions WHERE `email` = '$clean_email' ORDER BY `status` ASC, `post_ID` ASC", OBJECT);
42
  if (is_array($subscriptions) && !empty($subscriptions)){
 
43
  echo '<ul>';
44
  foreach($subscriptions as $a_subscription){
45
  $permalink = get_permalink($a_subscription->post_ID);
46
  $title = get_the_title($a_subscription->post_ID);
47
  echo "<li><input type='checkbox' name='post_list[]' value='{$a_subscription->post_ID}' id='post_{$a_subscription->post_ID}'/> <label for='post_{$a_subscription->post_ID}'><a href='$permalink'>$title</a></label> [{$a_subscription->status}]</li>\n";
48
  }
49
- echo '</ul><p>'.__('Legend: Y: subscribed, N: suspended, C: awaiting confirmation','subscribe-reloaded').'</p>';
 
 
50
  echo '<p>'.__('Action:','subscribe-reloaded').' <input type="radio" name="action_type" value="d" id="action_type_delete" /> <label for="action_type_delete">'.__('Delete','subscribe-reloaded').'</label> &nbsp;&nbsp;&nbsp;&nbsp; ';
51
  echo '<input type="radio" name="action_type" value="s" id="action_type_suspend" checked="checked" /> <label for="action_type_suspend">'.__('Suspend','subscribe-reloaded').'</label> &nbsp;&nbsp;&nbsp;&nbsp; ';
52
  echo '<input type="radio" name="action_type" value="a" id="action_type_activate" /> <label for="action_type_activate">'.__('Resume','subscribe-reloaded').'</label></p>';
53
- echo '<p><input type="button" class="subscribe-form-button" onclick="t=document.getElementById(\'post_list_form\').elements;for(i in t) t[i].checked=1" value="'.__('Select all','subscribe-reloaded').'" />';
54
- echo '<input type="button" class="subscribe-form-button" onclick="t=document.getElementById(\'post_list_form\').elements;for(i in t)if(t[i].checked==1){t[i].checked=0} else{t[i].checked=1}" value="'.__('Invert selection','subscribe-reloaded').'" />';
55
- echo '<input type="submit" class="subscribe-form-button" value="'.__('Update subscriptions','subscribe-reloaded').'" /></p>';
56
 
57
  }
58
  else{
35
 
36
  <form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>" method="post" id="post_list_form"
37
  onsubmit="return confirm('<?php _e('Please remember: this operation cannot be undone. Are you sure you want to proceed?', 'subscribe-reloaded') ?>')">
38
+ <fieldset style="border:0">
39
  <?php
40
  $clean_email = !empty($_POST['sre'])?$wp_subscribe_reloaded->clean_email($_POST['sre']):(!empty($_GET['sre'])?$wp_subscribe_reloaded->clean_email($_GET['sre']):'');
41
  $subscriptions = $wpdb->get_results("SELECT `status`, `post_ID`, `dt` FROM $wp_subscribe_reloaded->table_subscriptions WHERE `email` = '$clean_email' ORDER BY `status` ASC, `post_ID` ASC", OBJECT);
42
  if (is_array($subscriptions) && !empty($subscriptions)){
43
+ echo '<p>'.__('Legend: Y: subscribed, N: suspended, C: awaiting confirmation','subscribe-reloaded').'</p>';
44
  echo '<ul>';
45
  foreach($subscriptions as $a_subscription){
46
  $permalink = get_permalink($a_subscription->post_ID);
47
  $title = get_the_title($a_subscription->post_ID);
48
  echo "<li><input type='checkbox' name='post_list[]' value='{$a_subscription->post_ID}' id='post_{$a_subscription->post_ID}'/> <label for='post_{$a_subscription->post_ID}'><a href='$permalink'>$title</a></label> [{$a_subscription->status}]</li>\n";
49
  }
50
+ echo '</ul>';
51
+ echo '<p><a class="subscribe-small-text" href="#" onclick="t=document.getElementById(\'post_list_form\').elements;for(i in t) t[i].checked=1">'.__('Select all','subscribe-reloaded').'</a> - ';
52
+ echo '<a class="small-text" href="#" onclick="t=document.getElementById(\'post_list_form\').elements;for(i in t)if(t[i].checked==1){t[i].checked=0} else{t[i].checked=1}">'.__('Invert selection','subscribe-reloaded').'</a></p>';
53
  echo '<p>'.__('Action:','subscribe-reloaded').' <input type="radio" name="action_type" value="d" id="action_type_delete" /> <label for="action_type_delete">'.__('Delete','subscribe-reloaded').'</label> &nbsp;&nbsp;&nbsp;&nbsp; ';
54
  echo '<input type="radio" name="action_type" value="s" id="action_type_suspend" checked="checked" /> <label for="action_type_suspend">'.__('Suspend','subscribe-reloaded').'</label> &nbsp;&nbsp;&nbsp;&nbsp; ';
55
  echo '<input type="radio" name="action_type" value="a" id="action_type_activate" /> <label for="action_type_activate">'.__('Resume','subscribe-reloaded').'</label></p>';
56
+ echo '<p><input type="submit" class="subscribe-form-button" value="'.__('Update subscriptions','subscribe-reloaded').'" /></p>';
 
 
57
 
58
  }
59
  else{
uninstall.php CHANGED
@@ -1,22 +1,25 @@
1
  <?php
2
 
3
- global $wpdb, $table_prefix;
4
 
5
  // Goodbye data...
6
- $wpdb->query("DROP TABLE IF EXISTS `{$table_prefix}subscribe_reloaded`");
7
 
8
  // Goodbye options...
9
  delete_option('subscribe_reloaded_manager_page');
 
10
  delete_option('subscribe_reloaded_from_name');
11
  delete_option('subscribe_reloaded_from_email');
 
 
 
 
12
  delete_option('subscribe_reloaded_notification_subject');
13
  delete_option('subscribe_reloaded_notification_content');
14
  delete_option('subscribe_reloaded_checkbox_label');
15
- delete_option('subscribe_reloaded_checked_by_default');
16
  delete_option('subscribe_reloaded_subscribed_label');
17
  delete_option('subscribe_reloaded_subscribed_waiting_label');
18
  delete_option('subscribe_reloaded_author_label');
19
- delete_option('subscribe_reloaded_enable_double_check');
20
  delete_option('subscribe_reloaded_double_check_subject');
21
  delete_option('subscribe_reloaded_double_check_content');
22
  delete_option('subscribe_reloaded_management_subject');
1
  <?php
2
 
3
+ global $wpdb;
4
 
5
  // Goodbye data...
6
+ $wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}subscribe_reloaded`");
7
 
8
  // Goodbye options...
9
  delete_option('subscribe_reloaded_manager_page');
10
+ delete_option('subscribe_reloaded_purge_days');
11
  delete_option('subscribe_reloaded_from_name');
12
  delete_option('subscribe_reloaded_from_email');
13
+ delete_option('subscribe_reloaded_checked_by_default');
14
+ delete_option('subscribe_reloaded_enable_double_check');
15
+ delete_option('subscribe_reloaded_notify_authors');
16
+
17
  delete_option('subscribe_reloaded_notification_subject');
18
  delete_option('subscribe_reloaded_notification_content');
19
  delete_option('subscribe_reloaded_checkbox_label');
 
20
  delete_option('subscribe_reloaded_subscribed_label');
21
  delete_option('subscribe_reloaded_subscribed_waiting_label');
22
  delete_option('subscribe_reloaded_author_label');
 
23
  delete_option('subscribe_reloaded_double_check_subject');
24
  delete_option('subscribe_reloaded_double_check_content');
25
  delete_option('subscribe_reloaded_management_subject');