Version Description
Download this release
Release Info
Developer | MattyRob |
Plugin | Subscribe2 |
Version | 3.4 |
Comparing to | |
See all releases |
Code changes from version 3.0 to 3.4
- ReadMe.txt +53 -0
- subscribe2/include.php +1 -1
- subscribe2/spacer.gif +0 -0
- subscribe2/subscribe2.php +2192 -2085
- subscribe2/subscribe2.pot +142 -112
- subscribe2/tinymce/editor_plugin.js +171 -0
- subscribe2/tinymce/langs/en_us.js +5 -0
- subscribe2/tinymce/langs/nl_nl.js +5 -0
ReadMe.txt
CHANGED
@@ -77,10 +77,63 @@ Batches will occur for each group of message as described above. A site on Drea
|
|
77 |
|
78 |
== Version History ==
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
Version 3.0 by Matthew Robinson
|
81 |
|
82 |
* Updated for WordPress 2.1 Branch
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
Version 2.14 by Matthew Robinson
|
85 |
|
86 |
* Amended DREAMHOST setting to BCCLIMIT as more hosts are limiting emails
|
77 |
|
78 |
== Version History ==
|
79 |
|
80 |
+
Version 3.4 by Matthew Robinson
|
81 |
+
|
82 |
+
* QuickTag button now displays a Marker! (HUGE thanks to Raven!)
|
83 |
+
* Fix for excluded categories in User Menu
|
84 |
+
* BCCLIMIT typo corrected in Mail function
|
85 |
+
* Call to translation files moved to avoid call to undefined function
|
86 |
+
* Options added to send mails for pages and password protected posts
|
87 |
+
* Option added to display subscription checkbox in WordPress Register screen
|
88 |
+
* Small typo and layout amendments
|
89 |
+
|
90 |
+
Version 3.3 by Matthew Robinson
|
91 |
+
|
92 |
+
* QuickTag button added! Works with Visual and Standard Editor. __Look in Code for token addition if using RTE.__
|
93 |
+
* Current Server time displayed for Cron tasks
|
94 |
+
* Fixed bug so Registered users now identified correctly
|
95 |
+
* Upgrade function called via WordPress hook to prevent calls to undefined functions
|
96 |
+
* Fixed a bug affecting Registered Users not appearing in the drop down list
|
97 |
+
* Improved handling of the Subscribe2 option array
|
98 |
+
|
99 |
+
Version 3.2 by Matthew Robinson
|
100 |
+
|
101 |
+
* Fixed a bug affecting Registered Users not appearing in the drop down list
|
102 |
+
* Improved handling of the Subscribe2 option array
|
103 |
+
|
104 |
+
Version 3.1 by Matthew Robinson
|
105 |
+
|
106 |
+
* Amended code to use core cron functionality for future posts and digest notifications, no longer need WP-Cron
|
107 |
+
* Improved HTML code generated for admin pages
|
108 |
+
* Removed sending of emails for WordPress Pages
|
109 |
+
* Fixed display issues if S2PAGE is not defined
|
110 |
+
|
111 |
Version 3.0 by Matthew Robinson
|
112 |
|
113 |
* Updated for WordPress 2.1 Branch
|
114 |
|
115 |
+
Version 2.18 by Matthew Robinson
|
116 |
+
|
117 |
+
* BCCLIMIT typo corrected in Mail function
|
118 |
+
* Call to translation files moved to avoid call to undefined function
|
119 |
+
* Small typo and layout amendments
|
120 |
+
|
121 |
+
Version 2.17 by Matthew Robinson
|
122 |
+
|
123 |
+
* Current Server time displayed for Cron tasks
|
124 |
+
* Fixed bug so Registered users now identified correctly
|
125 |
+
* Upgrade function called via WordPress hook to prevent calls to undefined functions
|
126 |
+
|
127 |
+
Version 2.16 by Matthew Robinson
|
128 |
+
|
129 |
+
* Fixed a bug affecting Registered Users not appearing in the drop down list
|
130 |
+
* Improved handling of the Subscribe2 option array
|
131 |
+
|
132 |
+
Version 2.15 by Matthew Robinson
|
133 |
+
|
134 |
+
* Improved HTML code generated for admin pages
|
135 |
+
* Fixed display issues if S2PAGE is not defined
|
136 |
+
|
137 |
Version 2.14 by Matthew Robinson
|
138 |
|
139 |
* Amended DREAMHOST setting to BCCLIMIT as more hosts are limiting emails
|
subscribe2/include.php
CHANGED
@@ -36,7 +36,7 @@ if (!isset($this->subscribe2_options['email_freq'])) {
|
|
36 |
} // option for sending emails periodically or per-post
|
37 |
|
38 |
if (!isset($this->subscribe2_options['mailtext'])) {
|
39 |
-
$this->subscribe2_options['mailtext'] = "BLOGNAME has posted a new item, 'TITLE'\
|
40 |
} // Default notification email text
|
41 |
|
42 |
if (!isset($this->subscribe2_options['confirm_email'])) {
|
36 |
} // option for sending emails periodically or per-post
|
37 |
|
38 |
if (!isset($this->subscribe2_options['mailtext'])) {
|
39 |
+
$this->subscribe2_options['mailtext'] = "BLOGNAME has posted a new item, 'TITLE'\n\nPOST\n\nYou may view the latest post at\nPERMALINK\n\nYou received this e-mail because you asked to be notified when new updates are posted.\nBest regards,\nMYNAME\nEMAIL";
|
40 |
} // Default notification email text
|
41 |
|
42 |
if (!isset($this->subscribe2_options['confirm_email'])) {
|
subscribe2/spacer.gif
ADDED
Binary file
|
subscribe2/subscribe2.php
CHANGED
@@ -1,2086 +1,2193 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: Subscribe2
|
4 |
-
Plugin URI: http://subscribe2.wordpress.com
|
5 |
-
Description: Notifies an email list when new entries are posted.
|
6 |
-
Version: 2.3.
|
7 |
-
Author: Matthew Robinson
|
8 |
-
Author URI: http://subscribe2.wordpress.com
|
9 |
-
*/
|
10 |
-
|
11 |
-
/*
|
12 |
-
Copyright (C) 2006-7 Matthew Robinson
|
13 |
-
Based on the Original Subscribe2 plugin by
|
14 |
-
Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
|
15 |
-
|
16 |
-
This program is free software; you can redistribute it and/or
|
17 |
-
modify it under the terms of the GNU General Public License
|
18 |
-
as published by the Free Software Foundation; either version 2
|
19 |
-
of the License, or (at your option) any later version.
|
20 |
-
|
21 |
-
This program is distributed in the hope that it will be useful,
|
22 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
-
GNU General Public License for more details.
|
25 |
-
|
26 |
-
You should have received a copy of the GNU General Public License
|
27 |
-
along with this program; if not, write to the Free Software
|
28 |
-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
29 |
-
http://www.gnu.org/licenses/gpl.html
|
30 |
-
*/
|
31 |
-
|
32 |
-
// If you are on a host that limits the
|
33 |
-
// permitted on each outgoing email message
|
34 |
-
// change
|
35 |
-
define('BCCLIMIT', '0');
|
36 |
-
|
37 |
-
// by default,
|
38 |
-
// when displaying the confirmation screen to public subscribers.
|
39 |
-
// You can override this by specifying a page ID below.
|
40 |
-
define('S2PAGE', '0');
|
41 |
-
|
42 |
-
// our version number. Don't touch
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
$
|
50 |
-
$
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
function
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
//
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
$
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
$
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
$
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
$this->
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
$
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
//
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
}
|
359 |
-
}
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
//
|
374 |
-
if (
|
375 |
-
// this post
|
376 |
-
//
|
377 |
-
//
|
378 |
-
|
379 |
-
}
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
$
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
}
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
//
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
$
|
439 |
-
}
|
440 |
-
$
|
441 |
-
|
442 |
-
|
443 |
-
$
|
444 |
-
|
445 |
-
$
|
446 |
-
|
447 |
-
$
|
448 |
-
$
|
449 |
-
|
450 |
-
$
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
$this->
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
$
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
}
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
$
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
$
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
if (
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
if (
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
}
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
$this->
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
return
|
774 |
-
}
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
return $this->
|
794 |
-
}
|
795 |
-
} // end
|
796 |
-
|
797 |
-
/**
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
$
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
if (''
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
$
|
837 |
-
}
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
if (!
|
865 |
-
$
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
$
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
$
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
if (
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
if (
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
$
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
}
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
$
|
1098 |
-
|
1099 |
-
}
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
$
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
$
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
$
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
(
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
$
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
$this->subscribe2_options['
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
echo "<
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
echo "<
|
1369 |
-
echo "<
|
1370 |
-
echo
|
1371 |
-
echo "<
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
echo "
|
1376 |
-
echo "<
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
echo "
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
echo "
|
1387 |
-
echo
|
1388 |
-
echo "<
|
1389 |
-
echo
|
1390 |
-
|
1391 |
-
|
1392 |
-
echo "
|
1393 |
-
|
1394 |
-
echo "<
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
echo "
|
1399 |
-
echo "<
|
1400 |
-
echo "<
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
echo "
|
1405 |
-
|
1406 |
-
|
1407 |
-
echo "<
|
1408 |
-
echo "
|
1409 |
-
echo
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
echo "<
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
echo "
|
1430 |
-
echo
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
echo "
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
echo "<
|
1460 |
-
echo
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
$
|
1502 |
-
}
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
echo
|
1557 |
-
echo "<input type=\"radio\" name=\"
|
1558 |
-
if ('
|
1559 |
-
echo "checked=\"
|
1560 |
-
}
|
1561 |
-
echo "/>
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
echo
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
$
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
$
|
1697 |
-
}
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
'
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
$all_cats
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
if (
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
foreach ($
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
|
1804 |
-
if (
|
1805 |
-
|
1806 |
-
echo
|
1807 |
-
echo "<
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
|
1869 |
-
$this->
|
1870 |
-
|
1871 |
-
|
1872 |
-
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
|
1877 |
-
|
1878 |
-
|
1879 |
-
|
1880 |
-
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
|
1887 |
-
|
1888 |
-
|
1889 |
-
|
1890 |
-
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
}
|
1895 |
-
|
1896 |
-
|
1897 |
-
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
|
1903 |
-
|
1904 |
-
|
1905 |
-
if
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
1912 |
-
|
1913 |
-
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
-
|
1919 |
-
|
1920 |
-
|
1921 |
-
|
1922 |
-
|
1923 |
-
|
1924 |
-
|
1925 |
-
|
1926 |
-
|
1927 |
-
|
1928 |
-
|
1929 |
-
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
1935 |
-
|
1936 |
-
|
1937 |
-
|
1938 |
-
|
1939 |
-
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
|
1954 |
-
$
|
1955 |
-
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
$
|
1990 |
-
$
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
|
2011 |
-
$
|
2012 |
-
$this->
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
|
2019 |
-
|
2020 |
-
|
2021 |
-
|
2022 |
-
|
2023 |
-
|
2024 |
-
|
2025 |
-
|
2026 |
-
|
2027 |
-
}
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
add_action('
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2086 |
?>
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Subscribe2
|
4 |
+
Plugin URI: http://subscribe2.wordpress.com
|
5 |
+
Description: Notifies an email list when new entries are posted.
|
6 |
+
Version: 2.3.4 for WP2.1
|
7 |
+
Author: Matthew Robinson
|
8 |
+
Author URI: http://subscribe2.wordpress.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
/*
|
12 |
+
Copyright (C) 2006-7 Matthew Robinson
|
13 |
+
Based on the Original Subscribe2 plugin by
|
14 |
+
Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
|
15 |
+
|
16 |
+
This program is free software; you can redistribute it and/or
|
17 |
+
modify it under the terms of the GNU General Public License
|
18 |
+
as published by the Free Software Foundation; either version 2
|
19 |
+
of the License, or (at your option) any later version.
|
20 |
+
|
21 |
+
This program is distributed in the hope that it will be useful,
|
22 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
+
GNU General Public License for more details.
|
25 |
+
|
26 |
+
You should have received a copy of the GNU General Public License
|
27 |
+
along with this program; if not, write to the Free Software
|
28 |
+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
29 |
+
http://www.gnu.org/licenses/gpl.html
|
30 |
+
*/
|
31 |
+
|
32 |
+
// If you are on a host that limits the number of recipients
|
33 |
+
// permitted on each outgoing email message
|
34 |
+
// change the value on the line below to your hosts limit
|
35 |
+
define('BCCLIMIT', '0');
|
36 |
+
|
37 |
+
// by default, Subscribe2 grabs the first page from your database for use
|
38 |
+
// when displaying the confirmation screen to public subscribers.
|
39 |
+
// You can override this by specifying a page ID on the line below.
|
40 |
+
define('S2PAGE', '0');
|
41 |
+
|
42 |
+
// our version number. Don't touch this or any line below
|
43 |
+
// unless you know exacly what you are doing
|
44 |
+
define('S2VERSION', '2.3.4');
|
45 |
+
|
46 |
+
// use Owen's excellent ButtonSnap library
|
47 |
+
require(ABSPATH . '/wp-content/plugins/buttonsnap.php');
|
48 |
+
|
49 |
+
$mysubscribe2 = new s2class;
|
50 |
+
$mysubscribe2->s2init();
|
51 |
+
|
52 |
+
// start our class
|
53 |
+
class s2class {
|
54 |
+
// variables and constructor are declared at the end
|
55 |
+
|
56 |
+
/**
|
57 |
+
Load all our strings
|
58 |
+
*/
|
59 |
+
function load_strings() {
|
60 |
+
// adjust the output of Subscribe2 here
|
61 |
+
|
62 |
+
$this->please_log_in = "<p>" . __('To manage your subscription options please ', 'subscribe2') . "<a href=\"" . get_settings('siteurl') . "/wp-login.php\">login</a>.</p>";
|
63 |
+
|
64 |
+
$this->use_profile_admin = "<p>" . __('You may manage your subscription options from your ', 'subscribe2') . "<a href=\"" . get_settings('siteurl') . "/wp-admin/users.php?page=" . plugin_basename(__FILE__) . "\">profile</a>.</p>";
|
65 |
+
|
66 |
+
$this->use_profile_users = "<p>" . __('You may manage your subscription options from your ', 'subscribe2') . "<a href=\"" . get_settings('siteurl') . "/wp-admin/profile.php?page=" . plugin_basename(__FILE__) . "\">profile</a>.</p>";
|
67 |
+
|
68 |
+
$this->confirmation_sent = "<p>" . __('A confirmation message is on its way!', 'subscribe2') . "</p>";
|
69 |
+
|
70 |
+
$this->already_subscribed = "<p>" . __('That email address is already subscribed.', 'subscribe2') . "</p>";
|
71 |
+
|
72 |
+
$this->not_subscribed = "<p>" . __('That email address is not subscribed.', 'subscribe2') . "</p>";
|
73 |
+
|
74 |
+
$this->not_an_email = "<p>" . __('Sorry, but that does not look like an email address to me.', 'subscribe2') . "</p>";
|
75 |
+
|
76 |
+
$this->barred_domain = "<p>" . __('Sorry, email addresses at that domain are currently barred due to spam, please use an alternative email address.', 'subscribe2') . "</p>";
|
77 |
+
|
78 |
+
$this->mail_sent = "<p>" . __('Message sent!', 'subscribe2') . "</p>";
|
79 |
+
|
80 |
+
$this->form = "<form method=\"post\" action=\"\">" . __('Your email:', 'subscribe2') . " <input type=\"text\" name=\"email\" value=\"\" size=\"20\" /> <br /><input type=\"radio\" name=\"s2_action\" value=\"subscribe\" checked=\"checked\" /> " . __('Subscribe', 'subscribe2') . " <input type=\"radio\" name=\"s2_action\" value=\"unsubscribe\" /> " . __('Unsubscribe', 'subscribe2') . "  <input type=\"submit\" value=\"" . __('Send', 'subscribe2') . "\" /></form>\r\n";
|
81 |
+
|
82 |
+
// confirmation messages
|
83 |
+
$this->no_such_email = "<p>" . __('No such email address is registered.', 'subscribe2') . "</p>";
|
84 |
+
|
85 |
+
$this->added = "<p>" . __('You have successfully subscribed!', 'subscribe2') . "</p>";
|
86 |
+
|
87 |
+
$this->deleted = "<p>" . __('You have successfully unsubscribed.', 'subscribe2') . "</p>";
|
88 |
+
|
89 |
+
$this->confirm_subject = "[" . get_settings('blogname') . "] " . __('Please confirm your request', 'subscribe2');
|
90 |
+
|
91 |
+
$this->remind_subject = "[" . get_settings('blogname') . "] " . __('Subscription Reminder', 'subscribe2');
|
92 |
+
|
93 |
+
$this->subscribe = __('subscribe', 'subscribe2'); //ACTION replacement in subscribing confirmation email
|
94 |
+
|
95 |
+
$this->unsubscribe = __('unsubscribe', 'subscribe2'); //ACTION replacement in unsubscribing in confirmation email
|
96 |
+
|
97 |
+
// menu strings
|
98 |
+
$this->options_saved = __('Options saved!', 'subscribe2');
|
99 |
+
$this->options_reset = __('Options reset!', 'subscribe2');
|
100 |
+
} // end load_strings()
|
101 |
+
|
102 |
+
/* ===== WordPress menu registration ===== */
|
103 |
+
/**
|
104 |
+
Hook the menu
|
105 |
+
*/
|
106 |
+
function admin_menu() {
|
107 |
+
add_management_page(__('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), "manage_options", __FILE__, array(&$this, 'manage_menu'));
|
108 |
+
add_options_page(__('Subscribe2 Options', 'subscribe2'), __('Subscribe2','subscribe2'), "manage_options", __FILE__, array(&$this, 'options_menu'));
|
109 |
+
if (current_user_can('manage_options')) {
|
110 |
+
add_submenu_page('users.php', __('Subscriptions', 'subscribe2'), __('Subscriptions', 'subscribe2'), "read", __FILE__, array(&$this, 'user_menu'));
|
111 |
+
} else {
|
112 |
+
add_submenu_page('profile.php', __('Subscriptions', 'subscribe2'), __('Subscriptions', 'subscribe2'), "read", __FILE__, array(&$this, 'user_menu'));
|
113 |
+
}
|
114 |
+
add_submenu_page('post-new.php', __('Mail Subscribers','subscribe2'), __('Mail Subscribers', 'subscribe2'),"manage_options", __FILE__, array(&$this, 'write_menu'));
|
115 |
+
$s2nonce = md5('subscribe2');
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
Insert Javascript into admin_header
|
120 |
+
*/
|
121 |
+
function admin_head() {
|
122 |
+
echo "<script type=\"text/javascript\">\r\n";
|
123 |
+
echo "<!--\r\n";
|
124 |
+
echo "function setAll(theElement) {\r\n";
|
125 |
+
echo " var theForm = theElement.form, z = 0;\r\n";
|
126 |
+
echo " for(z=0; z<theForm.length;z++){\r\n";
|
127 |
+
echo " if(theForm[z].type == 'checkbox' && theForm[z].name == 'category[]'){\r\n";
|
128 |
+
echo " theForm[z].checked = theElement.checked;\r\n";
|
129 |
+
echo " }\r\n";
|
130 |
+
echo " }\r\n";
|
131 |
+
echo "}\r\n";
|
132 |
+
echo "-->\r\n";
|
133 |
+
echo "</script>\r\n";
|
134 |
+
}
|
135 |
+
|
136 |
+
function add_weekly_sched($sched) {
|
137 |
+
$sched['weekly'] = array('interval' => 604800, 'display' => __('Once Weekly','subscribe2'));
|
138 |
+
return $sched;
|
139 |
+
}
|
140 |
+
|
141 |
+
/* ===== Install, upgrade, reset ===== */
|
142 |
+
/**
|
143 |
+
Install our table
|
144 |
+
*/
|
145 |
+
function install() {
|
146 |
+
// include upgrade-functions for maybe_create_table;
|
147 |
+
if (!function_exists('maybe_create_table')) {
|
148 |
+
require_once(ABSPATH . '/wp-admin/upgrade-functions.php');
|
149 |
+
}
|
150 |
+
$date = date('Y-m-d');
|
151 |
+
$sql = "CREATE TABLE $this->public (
|
152 |
+
id int(11) NOT NULL auto_increment,
|
153 |
+
email varchar(64) NOT NULL default '',
|
154 |
+
active tinyint(1) default 0,
|
155 |
+
date DATE default '$date' NOT NULL,
|
156 |
+
PRIMARY KEY (id) )";
|
157 |
+
|
158 |
+
// create the table, as needed
|
159 |
+
maybe_create_table($this->public, $sql);
|
160 |
+
$this->reset();
|
161 |
+
} // end install()
|
162 |
+
|
163 |
+
/**
|
164 |
+
Upgrade the database
|
165 |
+
*/
|
166 |
+
function upgrade() {
|
167 |
+
global $wpdb;
|
168 |
+
|
169 |
+
// include upgrade-functions for maybe_create_table;
|
170 |
+
if (!function_exists('maybe_create_table')) {
|
171 |
+
require_once(ABSPATH . '/wp-admin/upgrade-functions.php');
|
172 |
+
}
|
173 |
+
$date = date('Y-m-d');
|
174 |
+
maybe_add_column($this->public, 'date', "ALTER TABLE `$this->public` ADD `date` DATE DEFAULT '$date' NOT NULL AFTER `active`;");
|
175 |
+
|
176 |
+
// let's take the time to check process registered users
|
177 |
+
// existing public subscribers are subscribed to all categories
|
178 |
+
$users = $wpdb->get_col("SELECT ID FROM $wpdb->users");
|
179 |
+
if (!empty($users)) {
|
180 |
+
foreach ($users as $user) {
|
181 |
+
$this->register($user);
|
182 |
+
}
|
183 |
+
}
|
184 |
+
// update the options table to serialized format
|
185 |
+
$old_options = $wpdb->get_col("SELECT option_name from $wpdb->options where option_name LIKE 's2%' AND option_name != 's2_future_posts'");
|
186 |
+
|
187 |
+
if (!empty($old_options)) {
|
188 |
+
foreach ($old_options as $option) {
|
189 |
+
$value = get_option($option);
|
190 |
+
$option_array = substr($option, 3);
|
191 |
+
$this->subscribe2_options[$option_array] = $value;
|
192 |
+
delete_option($option);
|
193 |
+
}
|
194 |
+
}
|
195 |
+
$this->subscribe2_options['version'] = S2VERSION;
|
196 |
+
//double check that the options are in the database
|
197 |
+
require(ABSPATH . "/wp-content/plugins/subscribe2/include.php");
|
198 |
+
update_option('subscribe2_options', $this->subscribe2_options);
|
199 |
+
} // end upgrade()
|
200 |
+
|
201 |
+
/**
|
202 |
+
Reset our options
|
203 |
+
*/
|
204 |
+
function reset() {
|
205 |
+
delete_option('subscribe2_options');
|
206 |
+
unset($this->subscribe2_options);
|
207 |
+
require(ABSPATH . "/wp-content/plugins/subscribe2/include.php");
|
208 |
+
update_option('subscribe2_options', $this->subscribe2_options);
|
209 |
+
} // end reset()
|
210 |
+
|
211 |
+
/* ===== mail handling ===== */
|
212 |
+
/**
|
213 |
+
Performs string substitutions for subscribe2 mail texts
|
214 |
+
*/
|
215 |
+
function substitute($string = '') {
|
216 |
+
if ('' == $string) {
|
217 |
+
return;
|
218 |
+
}
|
219 |
+
$string = str_replace('BLOGNAME', get_settings('blogname'), $string);
|
220 |
+
$string = str_replace('BLOGLINK', get_bloginfo('url'), $string);
|
221 |
+
$string = str_replace('TITLE', stripslashes($this->post_title), $string);
|
222 |
+
$string = str_replace('PERMALINK', $this->permalink, $string);
|
223 |
+
$string = str_replace('MYNAME', stripslashes($this->myname), $string);
|
224 |
+
$string = str_replace('EMAIL', $this->myemail, $string);
|
225 |
+
$string = str_replace('AUTHORNAME', $this->authorname, $string);
|
226 |
+
return $string;
|
227 |
+
} // end sustitute()
|
228 |
+
|
229 |
+
/**
|
230 |
+
Delivers email to recipients in HTML or plaintext
|
231 |
+
*/
|
232 |
+
function mail ($recipients = array(), $subject = '', $message = '', $type='text') {
|
233 |
+
if ( (empty($recipients)) || ('' == $message) ) { return; }
|
234 |
+
|
235 |
+
// Set sender details
|
236 |
+
if ('' == $this->myname) {
|
237 |
+
$admin = get_userdata(1);
|
238 |
+
$this->myname = $admin->display_name;
|
239 |
+
$this->myemail = $admin->user_email;
|
240 |
+
}
|
241 |
+
$headers = "From: " . $this->myname . " <" . $this->myemail . ">\n";
|
242 |
+
$headers .= "Return-Path: <" . $this->myemail . ">\n";
|
243 |
+
$headers .= "Reply-To: " . $this->myemail . "\n";
|
244 |
+
$headers .= "X-Mailer:PHP" . phpversion() . "\n";
|
245 |
+
$headers .= "Precedence: list\nList-Id: " . get_settings('blogname') . "\n";
|
246 |
+
|
247 |
+
if ('html' == $type) {
|
248 |
+
// To send HTML mail, the Content-type header must be set
|
249 |
+
$headers .= "MIME-Version: 1.0\n";
|
250 |
+
$headers .= "Content-type: " . get_bloginfo('html_type') . "; charset=\"". get_bloginfo('charset') . "\"\n";
|
251 |
+
$mailtext = "<html><head><title>" . $subject . "</title></head><body>" . $message . "</body></html>";
|
252 |
+
} else {
|
253 |
+
$headers .= "MIME-Version: 1.0\n";
|
254 |
+
$headers .= "Content-type: text/plain; charset=\"". get_bloginfo('charset') . "\"\n";
|
255 |
+
$message = preg_replace('|&[^a][^m][^p].{0,3};|', '', $message);
|
256 |
+
$message = preg_replace('|&|', '&', $message);
|
257 |
+
$mailtext = wordwrap(strip_tags($message), 80, "\n");
|
258 |
+
}
|
259 |
+
|
260 |
+
// BCC all recipients
|
261 |
+
$bcc = '';
|
262 |
+
if ( (defined('BCCLIMIT') && (BCCLIMIT > 0) ) &&
|
263 |
+
(count($recipients) > BCCLIMIT) ) {
|
264 |
+
// we're on Dreamhost, and have more than 30 susbcribers
|
265 |
+
$count = 1;
|
266 |
+
$batch = array();
|
267 |
+
foreach ($recipients as $recipient) {
|
268 |
+
// advance the array pointer by one, for use down below
|
269 |
+
// the array pointer _is not_ advanced by the foreach() loop itself
|
270 |
+
next($recipients);
|
271 |
+
$recipient = trim($recipient);
|
272 |
+
// sanity check -- make sure we have a valid email
|
273 |
+
if (!is_email($recipient)) { continue; }
|
274 |
+
// and NOT the sender's email, since they'll
|
275 |
+
// get a copy anyway
|
276 |
+
if ( (! empty($recipient)) && ($this->myemail != $recipient) ) {
|
277 |
+
('' == $bcc) ? $bcc = "Bcc: $recipient" : $bcc .= ",\r\n $recipient";
|
278 |
+
// Headers constructed as per definition at http://www.ietf.org/rfc/rfc2822.txt
|
279 |
+
}
|
280 |
+
if (BCCLIMIT == $count) {
|
281 |
+
$count = 1;
|
282 |
+
$batch[] = $bcc;
|
283 |
+
$bcc = '';
|
284 |
+
} else {
|
285 |
+
if (false == current($recipients)) {
|
286 |
+
// we've reached the end of the subscriber list
|
287 |
+
// add what we have to the batch, and move on
|
288 |
+
$batch[] = $bcc;
|
289 |
+
break;
|
290 |
+
} else {
|
291 |
+
$count++;
|
292 |
+
}
|
293 |
+
}
|
294 |
+
}
|
295 |
+
// rewind the array, just to be safe
|
296 |
+
reset($recipients);
|
297 |
+
} else {
|
298 |
+
// we're not on dreamhost, or have less than 30
|
299 |
+
// subscribers, so do it normal
|
300 |
+
foreach ($recipients as $recipient) {
|
301 |
+
$recipient = trim($recipient);
|
302 |
+
// sanity check -- make sure we have a valid email
|
303 |
+
if (!is_email($recipient)) { continue; }
|
304 |
+
// and NOT the sender's email, since they'll
|
305 |
+
// get a copy anyway
|
306 |
+
if ( (!empty($recipient)) && ($this->myemail != $recipient) ) {
|
307 |
+
('' == $bcc) ? $bcc = "Bcc: $recipient" : $bcc .= ",\r\n $recipient";
|
308 |
+
// Headers constructed as per definition at http://www.ietf.org/rfc/rfc2822.txt
|
309 |
+
}
|
310 |
+
}
|
311 |
+
$headers .= "$bcc\r\n";
|
312 |
+
}
|
313 |
+
// actually send mail
|
314 |
+
if ( (defined('BCCLIMIT')) && (BCCLIMIT > 0) && (isset($batch)) ) {
|
315 |
+
foreach ($batch as $bcc) {
|
316 |
+
$newheaders = $headers . "$bcc\r\n";
|
317 |
+
@wp_mail($this->myemail, $subject, $mailtext, $newheaders);
|
318 |
+
}
|
319 |
+
} else {
|
320 |
+
@wp_mail($this->myemail, $subject, $mailtext, $headers);
|
321 |
+
}
|
322 |
+
} // end mail()
|
323 |
+
|
324 |
+
/**
|
325 |
+
Sends an email notification of a new post
|
326 |
+
*/
|
327 |
+
function publish($id = 0) {
|
328 |
+
if (!$id) { return $id; }
|
329 |
+
|
330 |
+
// are we doing daily digests? If so, don't send anything now
|
331 |
+
if ($this->subscribe2_options['email_freq'] != 'never') { return; }
|
332 |
+
|
333 |
+
// we need to determine whether this is a new post, or an edit
|
334 |
+
if ($this->private) {
|
335 |
+
// this post was published from draft status
|
336 |
+
// OR is an edit of an existing post
|
337 |
+
// so send no notification
|
338 |
+
return $id;
|
339 |
+
}
|
340 |
+
|
341 |
+
$post_cats = wp_get_post_cats('1', $id);
|
342 |
+
$post_cats_string = implode(',', $post_cats);
|
343 |
+
$check = false;
|
344 |
+
// is the current post assigned to any categories
|
345 |
+
// which should not generate a notification email?
|
346 |
+
foreach (explode(',', $this->subscribe2_options['exclude']) as $cat) {
|
347 |
+
if (in_array($cat, $post_cats)) {
|
348 |
+
$check = true;
|
349 |
+
}
|
350 |
+
}
|
351 |
+
// if so, bail out
|
352 |
+
if ($check) {
|
353 |
+
// hang on -- can registered users subscribe to
|
354 |
+
// excluded categories?
|
355 |
+
if ('0' == $this->subscribe2_options['reg_override']) {
|
356 |
+
// nope? okay, let's leave
|
357 |
+
return $id;
|
358 |
+
}
|
359 |
+
}
|
360 |
+
|
361 |
+
global $wpdb;
|
362 |
+
$post =& get_post($id);
|
363 |
+
// is the post password protected?
|
364 |
+
if ( ($this->subscribe2_options['password'] == "no") && ($post->post_password != '') ) {return $id; }
|
365 |
+
|
366 |
+
// is this post set in the future?
|
367 |
+
if ($post->post_date > current_time('mysql')) {
|
368 |
+
// bail out
|
369 |
+
return $id;
|
370 |
+
}
|
371 |
+
|
372 |
+
// lets collect our public subscribers
|
373 |
+
// and all our registered subscribers for these categories
|
374 |
+
if (!$check) {
|
375 |
+
// if this post is assigned to an excluded
|
376 |
+
// category, then this test will prevent
|
377 |
+
// the public from receiving notification
|
378 |
+
$public = $this->get_public();
|
379 |
+
}
|
380 |
+
$registered = $this->get_registered("cats=$post_cats_string");
|
381 |
+
|
382 |
+
// do we have subscribers?
|
383 |
+
if ( (empty($public)) && (empty($registered)) ) {
|
384 |
+
// if not, no sense doing anything else
|
385 |
+
return $id;
|
386 |
+
}
|
387 |
+
// we set these class variables so that we can avoid
|
388 |
+
// passing them in function calls a little later
|
389 |
+
$this->post_title = $post->post_title;
|
390 |
+
$this->permalink = "<a href=\"" . get_permalink($id) . "\">" . get_permalink($id) . "</a>";
|
391 |
+
|
392 |
+
$author = get_userdata($post->post_author);
|
393 |
+
$this->authorname = $author->display_name;
|
394 |
+
|
395 |
+
// do we send as admin, or post author?
|
396 |
+
if ('author' == $this->subscribe2_options['sender']) {
|
397 |
+
// get author details
|
398 |
+
$user =& $author;
|
399 |
+
} else {
|
400 |
+
// get admin details
|
401 |
+
$user = get_userdata(1);
|
402 |
+
}
|
403 |
+
$this->myemail = $user->user_email;
|
404 |
+
$this->myname = $user->display_name;
|
405 |
+
// Get email subject
|
406 |
+
$subject = $this->substitute(stripslashes($this->s2_subject));
|
407 |
+
// Get the message template
|
408 |
+
$mailtext = $this->substitute(stripslashes($this->subscribe2_options['mailtext']));
|
409 |
+
|
410 |
+
$plaintext = $post->post_content;
|
411 |
+
$content = apply_filters('the_content', $post->post_content);
|
412 |
+
$content = str_replace(']]>', ']]>', $content);
|
413 |
+
$excerpt = $post->post_excerpt;
|
414 |
+
if ('' == $excerpt) {
|
415 |
+
// no excerpt, is there a <!--more--> ?
|
416 |
+
if (false !== strpos($plaintext, '<!--more-->')) {
|
417 |
+
list($excerpt, $more) = explode('<!--more-->', $plaintext, 2);
|
418 |
+
// strip leading and trailing whitespace
|
419 |
+
$excerpt = strip_tags($excerpt);
|
420 |
+
$excerpt = trim($excerpt);
|
421 |
+
} else {
|
422 |
+
// no <!--more-->, so grab the first 55 words
|
423 |
+
$excerpt = strip_tags($plaintext);
|
424 |
+
$excerpt_length = 55;
|
425 |
+
$words = explode(' ', $excerpt, $excerpt_length + 1);
|
426 |
+
if (count($words) > $excerpt_length) {
|
427 |
+
array_pop($words);
|
428 |
+
array_push($words, '[...]');
|
429 |
+
$excerpt = implode(' ', $words);
|
430 |
+
}
|
431 |
+
}
|
432 |
+
}
|
433 |
+
|
434 |
+
// first we send plaintext summary emails
|
435 |
+
$body = str_replace('POST', $excerpt, $mailtext);
|
436 |
+
$registered = $this->get_registered("cats=$post_cats_string&format=text&amount=excerpt");
|
437 |
+
if (empty($registered)) {
|
438 |
+
$recipients = (array)$public;
|
439 |
+
}
|
440 |
+
elseif (empty($public)) {
|
441 |
+
$recipients = (array)$registered;
|
442 |
+
} else {
|
443 |
+
$recipients = array_merge((array)$public, (array)$registered);
|
444 |
+
}
|
445 |
+
$this->mail($recipients, $subject, $body);
|
446 |
+
// next we send plaintext full content emails
|
447 |
+
$body = str_replace('POST', strip_tags($plaintext), $mailtext);
|
448 |
+
$this->mail($this->get_registered("cats=$post_cats_string&format=text&amount=post"), $subject, $body);
|
449 |
+
// finally we send html full content emails
|
450 |
+
$body = str_replace("\r\n", "<br />\r\n", $mailtext);
|
451 |
+
$body = str_replace('POST', $content, $body);
|
452 |
+
$this->mail($this->get_registered("cats=$post_cats_string&format=html"), $subject, $body, 'html');
|
453 |
+
|
454 |
+
return $id;
|
455 |
+
} // end publish()
|
456 |
+
|
457 |
+
/**
|
458 |
+
Sends a notification when a draft post is published
|
459 |
+
*/
|
460 |
+
function private2publish($id = 0) {
|
461 |
+
if (0 == $id) { return $id; }
|
462 |
+
|
463 |
+
$this->publish($id);
|
464 |
+
$this->private = TRUE;
|
465 |
+
return $id;
|
466 |
+
} // end private2publish()
|
467 |
+
|
468 |
+
/**
|
469 |
+
Prevents notifications from being sent when editing posts
|
470 |
+
*/
|
471 |
+
function edit($id = 0) {
|
472 |
+
if (0 == $id) { return; }
|
473 |
+
|
474 |
+
$this->private = TRUE;
|
475 |
+
return $id;
|
476 |
+
}
|
477 |
+
|
478 |
+
/**
|
479 |
+
Send confirmation email to the user
|
480 |
+
*/
|
481 |
+
function send_confirm($what = '', $is_remind = FALSE) {
|
482 |
+
if ($this->filtered == 1) { return; }
|
483 |
+
if ( (!$this->email) || (!$what) ) {
|
484 |
+
return false;
|
485 |
+
}
|
486 |
+
$id = $this->get_id($this->email);
|
487 |
+
if (!$id) {
|
488 |
+
return false;
|
489 |
+
}
|
490 |
+
|
491 |
+
// generate the URL "?s2=ACTION+HASH+ID"
|
492 |
+
// ACTION = 1 to subscribe, 0 to unsubscribe
|
493 |
+
// HASH = md5 hash of email address
|
494 |
+
// ID = user's ID in the subscribe2 table
|
495 |
+
$link = get_settings('siteurl') . "?s2=";
|
496 |
+
|
497 |
+
if ('add' == $what) {
|
498 |
+
$link .= '1';
|
499 |
+
} elseif ('del' == $what) {
|
500 |
+
$link .= '0';
|
501 |
+
}
|
502 |
+
$link .= md5($this->email);
|
503 |
+
$link .= $id;
|
504 |
+
|
505 |
+
$admin = get_userdata(1);
|
506 |
+
$this->myname = $admin->display_name;
|
507 |
+
|
508 |
+
if ($is_remind == TRUE) {
|
509 |
+
$body = $this->substitute(stripslashes($this->subscribe2_options['remind_email']));
|
510 |
+
$subject = stripslashes($this->remind_subject);
|
511 |
+
} else {
|
512 |
+
$body = $this->substitute(stripslashes($this->subscribe2_options['confirm_email']));
|
513 |
+
if ('add' == $what) {
|
514 |
+
$body = str_replace("ACTION", $this->subscribe, $body);
|
515 |
+
} elseif ('del' == $what) {
|
516 |
+
$body = str_replace("ACTION", $this->unsubscribe, $body);
|
517 |
+
}
|
518 |
+
$subject = stripslashes($this->confirm_subject);
|
519 |
+
}
|
520 |
+
|
521 |
+
$body = str_replace("LINK", $link, $body);
|
522 |
+
|
523 |
+
$mailheaders .= "From: $admin->display_name <$admin->user_email>\n";
|
524 |
+
$mailheaders .= "Return-Path: <$admin->user_email>\n";
|
525 |
+
$mailheaders .= "X-Mailer:PHP" . phpversion() . "\n";
|
526 |
+
$mailheaders .= "Precedence: list\nList-Id: " . get_settings('blogname') . "\n";
|
527 |
+
$mailheaders .= "MIME-Version: 1.0\n";
|
528 |
+
$mailheaders .= "Content-type: text/plain; charset=\"". get_bloginfo('charset') . "\"\n";
|
529 |
+
|
530 |
+
@wp_mail ($this->email, $subject, $body, $mailheaders);
|
531 |
+
} // end send_confirm()
|
532 |
+
|
533 |
+
/* ===== Category functions ===== */
|
534 |
+
/**
|
535 |
+
Return either a comma-separated list of all the category IDs in the blog or an array of cat_ID => cat_name
|
536 |
+
*/
|
537 |
+
function get_all_categories($select = 'id') {
|
538 |
+
global $wpdb;
|
539 |
+
if ('id' == $select) {
|
540 |
+
return implode(',', $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories"));
|
541 |
+
} else {
|
542 |
+
$cats = array();
|
543 |
+
$result = $wpdb->get_results("SELECT cat_ID, cat_name FROM $wpdb->categories", ARRAY_N);
|
544 |
+
foreach ($result as $result) {
|
545 |
+
$cats[$result[0]] = $result[1];
|
546 |
+
}
|
547 |
+
return $cats;
|
548 |
+
}
|
549 |
+
} // end get_all_categories()
|
550 |
+
|
551 |
+
/* ===== Subscriber functions ===== */
|
552 |
+
/**
|
553 |
+
Given a public subscriber ID, returns the email address
|
554 |
+
*/
|
555 |
+
function get_email ($id = 0) {
|
556 |
+
global $wpdb;
|
557 |
+
|
558 |
+
if (!$id) {
|
559 |
+
return false;
|
560 |
+
}
|
561 |
+
return $wpdb->get_var("SELECT email FROM $this->public WHERE id=$id");
|
562 |
+
} // end get_email
|
563 |
+
|
564 |
+
/**
|
565 |
+
Given a public subscriber email, returns the subscriber ID
|
566 |
+
*/
|
567 |
+
function get_id ($email = '') {
|
568 |
+
global $wpdb;
|
569 |
+
|
570 |
+
if (!$email) {
|
571 |
+
return false;
|
572 |
+
}
|
573 |
+
return $wpdb->get_var("SELECT id FROM $this->public WHERE email='$email'");
|
574 |
+
} // end get_id()
|
575 |
+
|
576 |
+
/**
|
577 |
+
Activate an email address
|
578 |
+
If the address is not already present, it will be added
|
579 |
+
*/
|
580 |
+
function activate ($email = '') {
|
581 |
+
global $wpdb;
|
582 |
+
|
583 |
+
if ('' == $email) {
|
584 |
+
if ('' != $this->email) {
|
585 |
+
$email = $this->email;
|
586 |
+
} else {
|
587 |
+
return false;
|
588 |
+
}
|
589 |
+
}
|
590 |
+
|
591 |
+
if (false !== $this->is_public($email)) {
|
592 |
+
$check = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE user_email='$this->email'");
|
593 |
+
if ($check) { return; }
|
594 |
+
$wpdb->get_results("UPDATE $this->public SET active='1' WHERE email='$email'");
|
595 |
+
} else {
|
596 |
+
$wpdb->get_results("INSERT INTO $this->public (email, active, date) VALUES ('$email', '1', NOW())");
|
597 |
+
}
|
598 |
+
} // end activate()
|
599 |
+
|
600 |
+
/**
|
601 |
+
Add an unconfirmed email address to the subscriber list
|
602 |
+
*/
|
603 |
+
function add ($email = '') {
|
604 |
+
if ($this->filtered ==1) { return; }
|
605 |
+
global $wpdb;
|
606 |
+
|
607 |
+
if ('' == $email) {
|
608 |
+
if ('' != $this->email) {
|
609 |
+
$email = $this->email;
|
610 |
+
} else {
|
611 |
+
return false;
|
612 |
+
}
|
613 |
+
}
|
614 |
+
|
615 |
+
if (!is_email($email)) { return false; }
|
616 |
+
|
617 |
+
if (false !== $this->is_public($email)) {
|
618 |
+
$wpdb->get_results("UPDATE $this->public SET date=NOW() WHERE email='$email'");
|
619 |
+
} else {
|
620 |
+
$wpdb->get_results("INSERT INTO $this->public (email, active, date) VALUES ('$email', '0', NOW())");
|
621 |
+
}
|
622 |
+
} // end add()
|
623 |
+
|
624 |
+
/**
|
625 |
+
Remove a user from the subscription table
|
626 |
+
*/
|
627 |
+
function delete($email = '') {
|
628 |
+
global $wpdb;
|
629 |
+
|
630 |
+
if ('' == $email) {
|
631 |
+
if ('' != $this->email) {
|
632 |
+
$email = $this->email;
|
633 |
+
} else {
|
634 |
+
return false;
|
635 |
+
}
|
636 |
+
}
|
637 |
+
|
638 |
+
if (!is_email($email)) { return false; }
|
639 |
+
$wpdb->get_results("DELETE FROM $this->public WHERE email='$email'");
|
640 |
+
} // end delete()
|
641 |
+
|
642 |
+
/**
|
643 |
+
Toggle a public subscriber's status
|
644 |
+
*/
|
645 |
+
function toggle($email = '') {
|
646 |
+
global $wpdb;
|
647 |
+
|
648 |
+
if ( ('' == $email) || (! is_email($email)) ) { return false; }
|
649 |
+
|
650 |
+
// let's see if this is a public user
|
651 |
+
$status = $this->is_public($email);
|
652 |
+
if (false === $status) { return false; }
|
653 |
+
|
654 |
+
if ('0' == $status) {
|
655 |
+
$wpdb->get_results("UPDATE $this->public SET active='1' WHERE email='$email'");
|
656 |
+
} else {
|
657 |
+
$wpdb->get_results("UPDATE $this->public SET active='0' WHERE email='$email'");
|
658 |
+
}
|
659 |
+
} // end toggle()
|
660 |
+
|
661 |
+
/**
|
662 |
+
Send reminder email to unconfirmed public subscribers
|
663 |
+
*/
|
664 |
+
function remind($emails = '') {
|
665 |
+
if ('' == $emails) { return false; }
|
666 |
+
|
667 |
+
$admin = get_userdata(1);
|
668 |
+
$this->myname = $admin->display_name;
|
669 |
+
|
670 |
+
$recipients = explode(",", $emails);
|
671 |
+
if (!is_array($recipients)) { $recipients = array(); }
|
672 |
+
foreach ($recipients as $recipient) {
|
673 |
+
$this->email = $recipient;
|
674 |
+
$this->send_confirm('add', TRUE);
|
675 |
+
}
|
676 |
+
} //end remind()
|
677 |
+
|
678 |
+
/**
|
679 |
+
Export email list to CSV download
|
680 |
+
*/
|
681 |
+
function exportcsv($emails = '') {
|
682 |
+
if ('' == $emails) {return false; }
|
683 |
+
|
684 |
+
$f = fopen(ABSPATH . '/wp-content/email.csv', 'w');
|
685 |
+
fwrite($f, $emails);
|
686 |
+
fclose($f);
|
687 |
+
} //end exportcsv
|
688 |
+
|
689 |
+
/**
|
690 |
+
Check email is not from a barred domain
|
691 |
+
*/
|
692 |
+
function is_barred($email='') {
|
693 |
+
$barred_option = $this->subscribe2_options['barred'];
|
694 |
+
list($user, $domain) = split('@', $email);
|
695 |
+
$bar_check = stristr($barred_option, $domain);
|
696 |
+
|
697 |
+
if(!empty($bar_check)) {
|
698 |
+
return true;
|
699 |
+
} else {
|
700 |
+
return false;
|
701 |
+
}
|
702 |
+
} //end is_barred()
|
703 |
+
|
704 |
+
/**
|
705 |
+
Confirm request from the link emailed to the user and email the admin
|
706 |
+
*/
|
707 |
+
function confirm($content = '') {
|
708 |
+
global $wpdb;
|
709 |
+
|
710 |
+
if (1 == $this->filtered) { return $content; }
|
711 |
+
|
712 |
+
$code = $_GET['s2'];
|
713 |
+
$action = intval(substr($code, 0, 1));
|
714 |
+
$hash = substr($code, 1, 32);
|
715 |
+
$code = str_replace($hash, '', $code);
|
716 |
+
$id = intval(substr($code, 1));
|
717 |
+
if ($id) {
|
718 |
+
$this->email = $this->get_email($id);
|
719 |
+
if ( (!$this->email) || ($hash !== md5($this->email)) ) {
|
720 |
+
return $this->no_such_email;
|
721 |
+
}
|
722 |
+
} else {
|
723 |
+
return $this->no_such_email;
|
724 |
+
}
|
725 |
+
|
726 |
+
if ('1' == $action) {
|
727 |
+
// make this subscription active
|
728 |
+
$this->activate();
|
729 |
+
$this->message = $this->added;
|
730 |
+
$subject = '[' . get_settings('blogname') . '] ' . __('New subscriber', 'subscribe2');
|
731 |
+
$message = "$this->email " . __('subscribed to email notifications!', 'subscribe2');
|
732 |
+
$recipients = $wpdb->get_col("SELECT DISTINCT(user_email) FROM $wpdb->users INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key='wp_user_level' AND $wpdb->usermeta.meta_value='10'");
|
733 |
+
$this->mail($recipients, $subject, $message);
|
734 |
+
$this->filtered = 1;
|
735 |
+
} elseif ('0' == $action) {
|
736 |
+
// remove this subscriber
|
737 |
+
$this->delete();
|
738 |
+
$this->message = $this->deleted;
|
739 |
+
$this->filtered = 1;
|
740 |
+
}
|
741 |
+
|
742 |
+
if ('' != $this->message) {
|
743 |
+
return $this->message;
|
744 |
+
}
|
745 |
+
} // end confirm
|
746 |
+
|
747 |
+
/**
|
748 |
+
Is the supplied email address a public subscriber?
|
749 |
+
*/
|
750 |
+
function is_public($email = '') {
|
751 |
+
global $wpdb;
|
752 |
+
|
753 |
+
if ('' == $email) { return false; }
|
754 |
+
|
755 |
+
$check = $wpdb->get_var("SELECT active FROM $this->public WHERE email='$email'");
|
756 |
+
if ( ('0' == $check) || ('1' == $check) ) {
|
757 |
+
return $check;
|
758 |
+
} else {
|
759 |
+
return false;
|
760 |
+
}
|
761 |
+
} // end is_public
|
762 |
+
|
763 |
+
/**
|
764 |
+
Is the supplied email address a registered user of the blog?
|
765 |
+
*/
|
766 |
+
function is_registered($email = '') {
|
767 |
+
global $wpdb;
|
768 |
+
|
769 |
+
if ('' == $email) { return false; }
|
770 |
+
|
771 |
+
$check = $wpdb->get_var("SELECT email FROM $wpdb->users WHERE user_email='$email'");
|
772 |
+
if ($check) {
|
773 |
+
return true;
|
774 |
+
} else {
|
775 |
+
return false;
|
776 |
+
}
|
777 |
+
}
|
778 |
+
|
779 |
+
/**
|
780 |
+
Return an array of all the public subscribers
|
781 |
+
*/
|
782 |
+
function get_public ($confirmed = 1) {
|
783 |
+
global $wpdb;
|
784 |
+
if (1 == $confirmed) {
|
785 |
+
if ('' == $this->all_public) {
|
786 |
+
$this->all_public = $wpdb->get_col("SELECT email FROM $this->public WHERE active='1'");
|
787 |
+
}
|
788 |
+
return $this->all_public;
|
789 |
+
} else {
|
790 |
+
if ('' == $this->all_unconfirmed) {
|
791 |
+
$this->all_unconfirmed = $wpdb->get_col("SELECT email FROM $this->public WHERE active='0'");
|
792 |
+
}
|
793 |
+
return $this->all_unconfirmed;
|
794 |
+
}
|
795 |
+
} // end get_public()
|
796 |
+
|
797 |
+
/**
|
798 |
+
Return an array of registered subscribers
|
799 |
+
Collect all the registered users of the blog who are subscribed to the specified categories
|
800 |
+
*/
|
801 |
+
function get_registered ($args = '') {
|
802 |
+
global $wpdb;
|
803 |
+
|
804 |
+
$format = '';
|
805 |
+
$amount = '';
|
806 |
+
$cats = '';
|
807 |
+
$subscribers = array();
|
808 |
+
|
809 |
+
parse_str($args, $r);
|
810 |
+
if (!isset($r['cats']))
|
811 |
+
$r['cats'] = '';
|
812 |
+
if (!isset($r['format']))
|
813 |
+
$r['format'] = 'all';
|
814 |
+
if (!isset($r['amount']))
|
815 |
+
$r['amount'] = 'all';
|
816 |
+
|
817 |
+
$JOIN = ''; $AND = '';
|
818 |
+
// text or HTML subscribers
|
819 |
+
if ('all' != $r['format']) {
|
820 |
+
$JOIN .= "INNER JOIN $wpdb->usermeta AS b ON a.user_id = b.user_id ";
|
821 |
+
$AND .= " AND b.meta_key='s2_format' AND b.meta_value=";
|
822 |
+
if ('html' == $r['format']) {
|
823 |
+
$AND .= "'html'";
|
824 |
+
} elseif ('text' == $r['format']) {
|
825 |
+
$AND .= "'text'";
|
826 |
+
}
|
827 |
+
}
|
828 |
+
|
829 |
+
// full post or excerpt subscribers
|
830 |
+
if ('all' != $r['amount']) {
|
831 |
+
$JOIN .= "INNER JOIN $wpdb->usermeta AS c ON a.user_id = c.user_id ";
|
832 |
+
$AND .= " AND c.meta_key='s2_excerpt' AND c.meta_value=";
|
833 |
+
if ('excerpt' == $r['amount']) {
|
834 |
+
$AND .= "'excerpt'";
|
835 |
+
} elseif ('post' == $r['amount']) {
|
836 |
+
$AND.= "'post'";
|
837 |
+
}
|
838 |
+
}
|
839 |
+
|
840 |
+
// specific category subscribers
|
841 |
+
if ('' != $r['cats']) {
|
842 |
+
$JOIN .= "INNER JOIN $wpdb->usermeta AS d ON a.user_id = d.user_id ";
|
843 |
+
foreach (explode(',', $r['cats']) as $cat) {
|
844 |
+
('' == $and) ? $and = "d.meta_key='s2_cat$cat'" : $and .= " OR d.meta_key='s2_cat$cat'";
|
845 |
+
}
|
846 |
+
$AND .= "AND ($and)";
|
847 |
+
}
|
848 |
+
|
849 |
+
$sql = "SELECT a.user_id FROM $wpdb->usermeta AS a " . $JOIN . " WHERE a.meta_key='s2_subscribed'" . $AND;
|
850 |
+
$result = $wpdb->get_col($sql);
|
851 |
+
if ($result) {
|
852 |
+
$ids = implode(',', $result);
|
853 |
+
return $wpdb->get_col("SELECT user_email FROM $wpdb->users WHERE ID IN ($ids)");
|
854 |
+
}
|
855 |
+
} // end get_registered()
|
856 |
+
|
857 |
+
/**
|
858 |
+
Collects the signup date for all public subscribers
|
859 |
+
*/
|
860 |
+
function signup_date($email = '') {
|
861 |
+
if ('' == $email) { return false; }
|
862 |
+
|
863 |
+
global $wpdb;
|
864 |
+
if (!empty($this->signup_dates)) {
|
865 |
+
return $this->signup_dates[$email];
|
866 |
+
} else {
|
867 |
+
$results = $wpdb->get_results("SELECT email, date FROM $this->public", ARRAY_N);
|
868 |
+
foreach ($results as $result) {
|
869 |
+
$this->signup_dates[$result[0]] = $result[1];
|
870 |
+
}
|
871 |
+
return $this->signup_dates[$email];
|
872 |
+
}
|
873 |
+
} // end signup_date()
|
874 |
+
|
875 |
+
/**
|
876 |
+
Create the appropriate usermeta values when a user registers
|
877 |
+
If the registering user had previously subscribed to notifications, this function will delete them from the public subscriber list first
|
878 |
+
*/
|
879 |
+
function register ($user_id = 0, $wpreg = '') {
|
880 |
+
global $wpdb;
|
881 |
+
|
882 |
+
if (0 == $user_id) { return $user_id; }
|
883 |
+
$user = get_userdata($user_id);
|
884 |
+
$all_cats = get_categories('type=post&hide_empty=1&hierarchical=0');
|
885 |
+
foreach ($all_cats as $cat) {
|
886 |
+
('' == $cats) ? $cats = "$cat->cat_ID" : $cats .= ",$cat->cat_ID";
|
887 |
+
}
|
888 |
+
|
889 |
+
// has this user previously signed up for email notification?
|
890 |
+
if (false !== $this->is_public($user->user_email)) {
|
891 |
+
// delete this user from the public table, and subscribe them to all the categories
|
892 |
+
$this->delete($user->user_email);
|
893 |
+
update_usermeta($user_id, 's2_subscribed', $cats);
|
894 |
+
foreach(explode(',', $cats) as $cat) {
|
895 |
+
update_usermeta($user_id, 's2_cat' . $cat. "$cat");
|
896 |
+
}
|
897 |
+
update_usermeta($user_id, 's2_format', 'text');
|
898 |
+
update_usermeta($user_id, 's2_excerpt', 'excerpt');
|
899 |
+
} else {
|
900 |
+
// add the usermeta for new registrations, but don't subscribe them
|
901 |
+
$check = get_usermeta($user_id, 's2_subscribed');
|
902 |
+
// ensure existing subscriptions are not overwritten on upgrade
|
903 |
+
if (empty($check)) {
|
904 |
+
if ( ('yes' == $this->subscribe2_options['autosub']) || (('wpreg' == $this->subscribe2_options['autosub']) && (1 == $wpreg)) ) {
|
905 |
+
// don't add entires by default if autosub is off, messes up daily digests
|
906 |
+
update_usermeta($user_id, 's2_subscribed', $cats);
|
907 |
+
foreach(explode(',', $cats) as $cat) {
|
908 |
+
update_usermeta($user_id, 's2_cat' . $cat, "$cat");
|
909 |
+
}
|
910 |
+
if ('html' == $this->subscribe2_options['autoformat']) {
|
911 |
+
update_usermeta($user_id, 's2_format', 'html');
|
912 |
+
update_usermeta($user_id, 's2_excerpt', 'post');
|
913 |
+
} elseif ('fulltext' == $this->subscribe2_options['autoformat']) {
|
914 |
+
update_usermeta($user_id, 's2_format', 'text');
|
915 |
+
update_usermeta($user_id, 's2_excerpt', 'post');
|
916 |
+
} else {
|
917 |
+
update_usermeta($user_id, 's2_format', 'text');
|
918 |
+
update_usermeta($user_id, 's2_excerpt', 'excerpt');
|
919 |
+
}
|
920 |
+
} else {
|
921 |
+
update_usermeta($user_id, 's2_subscribed', '-1');
|
922 |
+
}
|
923 |
+
}
|
924 |
+
}
|
925 |
+
return $user_id;
|
926 |
+
} // end register()
|
927 |
+
|
928 |
+
/**
|
929 |
+
Subscribe all registered users to category selected on Admin Manage Page
|
930 |
+
*/
|
931 |
+
function subscribe_registered_users ($emails = '', $cats = '') {
|
932 |
+
if ( ('' == $emails) || ('' == $cats) ) { return false; }
|
933 |
+
global $wpdb;
|
934 |
+
|
935 |
+
$useremails = explode(",", $emails);
|
936 |
+
$useremails = implode("', '", $useremails);
|
937 |
+
|
938 |
+
$sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ('$useremails')";
|
939 |
+
$user_IDs = $wpdb->get_col($sql);
|
940 |
+
if (!is_array($cats)) {
|
941 |
+
$cats = array($cats);
|
942 |
+
}
|
943 |
+
|
944 |
+
foreach ($user_IDs as $user_ID) {
|
945 |
+
$old_cats = explode(',', get_usermeta($user_ID, 's2_subscribed'));
|
946 |
+
if (!is_array($old_cats)) {
|
947 |
+
$old_cats = array($old_cats);
|
948 |
+
}
|
949 |
+
$new = array_diff($cats, $old_cats);
|
950 |
+
if (!empty($new)) {
|
951 |
+
// add subscription to these cat IDs
|
952 |
+
foreach ($new as $id) {
|
953 |
+
update_usermeta($user_ID, 's2_cat' . $id, "$id");
|
954 |
+
}
|
955 |
+
}
|
956 |
+
$newcats = array_merge($cats, $old_cats);
|
957 |
+
update_usermeta($user_ID, 's2_subscribed', implode(',', $newcats));
|
958 |
+
}
|
959 |
+
} // end subscribe_registered_users
|
960 |
+
|
961 |
+
/**
|
962 |
+
Unsubscribe all registered users to category selected on Admin Manage Page
|
963 |
+
*/
|
964 |
+
function unsubscribe_registered_users ($emails = '', $cats = '') {
|
965 |
+
if ( ('' == $emails) || ('' == $cats) ) { return false; }
|
966 |
+
global $wpdb;
|
967 |
+
|
968 |
+
$useremails = explode(",", $emails);
|
969 |
+
$useremails = implode("', '", $useremails);
|
970 |
+
|
971 |
+
$sql = "SELECT ID FROM $wpdb->users WHERE user_email IN ('$useremails')";
|
972 |
+
$user_IDs = $wpdb->get_col($sql);
|
973 |
+
if (!is_array($cats)) {
|
974 |
+
$cats = array($cats);
|
975 |
+
}
|
976 |
+
|
977 |
+
foreach ($user_IDs as $user_ID) {
|
978 |
+
$old_cats = explode(',', get_usermeta($user_ID, 's2_subscribed'));
|
979 |
+
if (!is_array($old_cats)) {
|
980 |
+
$old_cats = array($old_cats);
|
981 |
+
}
|
982 |
+
$remain = array_diff($old_cats, $cats);
|
983 |
+
if (!empty($remain)) {
|
984 |
+
// remove subscription to these cat IDs and update s2_subscribed
|
985 |
+
foreach ($cats as $id) {
|
986 |
+
delete_usermeta($user_ID, 's2_cat' . $id, "$id");
|
987 |
+
}
|
988 |
+
update_usermeta($user_ID, 's2_subscribed', implode(',', $remain));
|
989 |
+
} else {
|
990 |
+
// remove subscription to these cat IDs and update s2_subscribed to ''
|
991 |
+
foreach ($cats as $id) {
|
992 |
+
delete_usermeta($user_ID, 's2_cat' . $id, "$id");
|
993 |
+
}
|
994 |
+
update_usermeta($user_ID, 's2_subscribed', '-1');
|
995 |
+
}
|
996 |
+
}
|
997 |
+
} // end unsubscribe_registered_users
|
998 |
+
|
999 |
+
/**
|
1000 |
+
Autosubscribe registered users to newly created categories
|
1001 |
+
if registered user has selected this option
|
1002 |
+
*/
|
1003 |
+
function autosub_new_category ($new_category='') {
|
1004 |
+
global $wpdb;
|
1005 |
+
|
1006 |
+
$sql = "SELECT DISTINCT user_id FROM $wpdb->usermeta WHERE $wpdb->usermeta.meta_key='s2_autosub' AND $wpdb->usermeta.meta_value='yes'";
|
1007 |
+
$user_IDs = $wpdb->get_col($sql);
|
1008 |
+
if ('' == $user_IDs) { return; }
|
1009 |
+
|
1010 |
+
foreach ($user_IDs as $user_ID) {
|
1011 |
+
$old_cats = explode(',', get_usermeta($user_ID, 's2_subscribed'));
|
1012 |
+
if (!is_array($old_cats)) {
|
1013 |
+
$old_cats = array($old_cats);
|
1014 |
+
}
|
1015 |
+
// add subscription to these cat IDs
|
1016 |
+
update_usermeta($user_ID, 's2_cat' . $new_category, "$new_category");
|
1017 |
+
$newcats = array_merge($old_cats, (array)$new_category);
|
1018 |
+
update_usermeta($user_ID, 's2_subscribed', implode(',', $newcats));
|
1019 |
+
}
|
1020 |
+
} // end autosub_new_category
|
1021 |
+
|
1022 |
+
/* ===== Menus ===== */
|
1023 |
+
/**
|
1024 |
+
Our management page
|
1025 |
+
*/
|
1026 |
+
function manage_menu() {
|
1027 |
+
global $wpdb, $s2nonce;
|
1028 |
+
|
1029 |
+
//Get Registered Subscribers for bulk management
|
1030 |
+
$registered = $this->get_registered();
|
1031 |
+
if (!empty($registered)) {
|
1032 |
+
$emails = implode(",", $registered);
|
1033 |
+
}
|
1034 |
+
|
1035 |
+
$what = '';
|
1036 |
+
$reminderform = false;
|
1037 |
+
|
1038 |
+
// was anything POSTed ?
|
1039 |
+
if (isset($_POST['s2_admin'])) {
|
1040 |
+
check_admin_referer('subscribe2-manage_subscribers' . $s2nonce);
|
1041 |
+
if ('subscribe' == $_POST['s2_admin']) {
|
1042 |
+
foreach (preg_split ("/[\s,]+/", $_POST['addresses']) as $email) {
|
1043 |
+
if (is_email($email)) {
|
1044 |
+
$this->activate($email);
|
1045 |
+
}
|
1046 |
+
}
|
1047 |
+
$_POST['what'] = 'confirmed';
|
1048 |
+
echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . __('Address(es) subscribed!', 'subscribe2') . "</p></strong></div>";
|
1049 |
+
} elseif ('delete' == $_POST['s2_admin']) {
|
1050 |
+
$this->delete($_POST['email']);
|
1051 |
+
echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . $_POST['email'] . ' ' . __('deleted!', 'subscribe2') . "</p></strong></div>";
|
1052 |
+
} elseif ('toggle' == $_POST['s2_admin']) {
|
1053 |
+
$this->toggle($_POST['email']);
|
1054 |
+
echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . $_POST['email'] . ' ' . __('status changed!', 'subscribe2') . "</p></strong></div>";
|
1055 |
+
} elseif ('remind' == $_POST['s2_admin']) {
|
1056 |
+
$this->remind($_POST['reminderemails']);
|
1057 |
+
echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . __('Reminder Email(s) Sent!','subscribe2') . "</p></strong></div>";
|
1058 |
+
} elseif ('exportcsv' == $_POST['s2_admin']) {
|
1059 |
+
$this->exportcsv($_POST['exportcsv']);
|
1060 |
+
echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . __('CSV File Created in wp-content','subscribe2') . "</p></strong></div>";
|
1061 |
+
} elseif ( ('register' == $_POST['s2_admin']) && ('Subscribe' == $_POST['submit']) ) {
|
1062 |
+
$this->subscribe_registered_users($_POST['emails'], $_POST['category']);
|
1063 |
+
echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . __('Registered Users Subscribed!','subscribe2') . "</p></strong></div>";
|
1064 |
+
} elseif ( ('register' == $_POST['s2_admin']) && ('Unsubscribe' == $_POST['submit']) ) {
|
1065 |
+
$this->unsubscribe_registered_users($_POST['emails'], $_POST['category']);
|
1066 |
+
echo "<div id=\"message\" class=\"updated fade\"><strong><p>" . __('Registered Users Unsubscribed!','subscribe2') . "</p></strong></div>";
|
1067 |
+
}
|
1068 |
+
}
|
1069 |
+
|
1070 |
+
if (isset($_POST['what'])) {
|
1071 |
+
if ('all' == $_POST['what']) {
|
1072 |
+
$what = 'all';
|
1073 |
+
$confirmed = $this->get_public();
|
1074 |
+
$unconfirmed = $this->get_public(0);
|
1075 |
+
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed, (array)$registered);
|
1076 |
+
} elseif ('public' == $_POST['what']) {
|
1077 |
+
$what = 'public';
|
1078 |
+
$confirmed = $this->get_public();
|
1079 |
+
$unconfirmed = $this->get_public(0);
|
1080 |
+
$subscribers = array_merge((array)$confirmed, (array)$unconfirmed);
|
1081 |
+
} elseif ('confirmed' == $_POST['what']) {
|
1082 |
+
$what = 'confirmed';
|
1083 |
+
$confirmed = $this->get_public();
|
1084 |
+
$subscribers = $confirmed;
|
1085 |
+
} elseif ('unconfirmed' == $_POST['what']) {
|
1086 |
+
$what = 'unconfirmed';
|
1087 |
+
$unconfirmed = $this->get_public(0);
|
1088 |
+
$subscribers = $unconfirmed;
|
1089 |
+
if (!empty($unconfirmed)) {
|
1090 |
+
$reminderemails = implode(",", $unconfirmed);
|
1091 |
+
$reminderform = true;
|
1092 |
+
}
|
1093 |
+
} elseif (is_numeric($_POST['what'])) {
|
1094 |
+
$what = intval($_POST['what']);
|
1095 |
+
$subscribers = $this->get_registered("cats=$what");
|
1096 |
+
} elseif ('registered' == $_POST['what']) {
|
1097 |
+
$what = 'registered';
|
1098 |
+
$subscribers = $registered;
|
1099 |
+
}
|
1100 |
+
} elseif ('' == $what) {
|
1101 |
+
$what = 'registered';
|
1102 |
+
$subscribers = $registered;
|
1103 |
+
$registermessage = '';
|
1104 |
+
if (empty($subscribers)) {
|
1105 |
+
$confirmed = $this->get_public();
|
1106 |
+
$subscribers = $confirmed;
|
1107 |
+
$what = 'confirmed';
|
1108 |
+
if (empty($subscribers)) {
|
1109 |
+
$unconfirmed = $this->get_public(0);
|
1110 |
+
$subscribers = $unconfirmed;
|
1111 |
+
$what = 'unconfirmed';
|
1112 |
+
if (empty($subscribers)) {
|
1113 |
+
$what = 'all';
|
1114 |
+
}
|
1115 |
+
}
|
1116 |
+
}
|
1117 |
+
}
|
1118 |
+
if (!empty($subscribers)) {
|
1119 |
+
natcasesort($subscribers);
|
1120 |
+
}
|
1121 |
+
// safety check for our arrays
|
1122 |
+
if ('' == $confirmed) { $confirmed = array(); }
|
1123 |
+
if ('' == $unconfirmed) { $unconfirmed = array(); }
|
1124 |
+
if ('' == $registered) { $registered = array(); }
|
1125 |
+
|
1126 |
+
// show our form
|
1127 |
+
echo "<div class=\"wrap\">";
|
1128 |
+
echo "<h2>" . __('Subscribe Addresses', 'subscribe2') . "</h2>\r\n";
|
1129 |
+
echo "<form method=\"post\" action=\"\">\r\n";
|
1130 |
+
if (function_exists('wp_nonce_field')) {
|
1131 |
+
wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
|
1132 |
+
}
|
1133 |
+
echo "<span style=\"align:left\">" . __('Enter addresses, one per line or comma-seperated', 'subscribe2') . "</span><br />\r\n";
|
1134 |
+
echo "<textarea rows=\"2\" cols=\"80\" name=\"addresses\"></textarea>";
|
1135 |
+
echo "<span class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Subscribe', 'subscribe2') . "\"/>";
|
1136 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"subscribe\" /></span>";
|
1137 |
+
echo "</form></div>";
|
1138 |
+
|
1139 |
+
// subscriber lists
|
1140 |
+
echo "<div class=\"wrap\"><h2>" . __('Subscribers', 'subscribe2') . "</h2>\r\n";
|
1141 |
+
|
1142 |
+
$this->display_subscriber_dropdown($what, __('Filter', 'subscribe2'));
|
1143 |
+
// show the selected subscribers
|
1144 |
+
$alternate = 'alternate';
|
1145 |
+
if (!empty($subscribers)) {
|
1146 |
+
echo "<p align=\"center\"><b>" . __('Registered on the left, confirmed in the middle, unconfirmed on the right', 'subscribe2') . "</b></p>";
|
1147 |
+
if (is_writable(ABSPATH . '/wp-content')) {
|
1148 |
+
$exportcsv = implode(",", $subscribers);
|
1149 |
+
echo "<span class=\"submit\"><form method=\"post\" action=\"\">\r\n";
|
1150 |
+
if (function_exists('wp_nonce_field')) {
|
1151 |
+
wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
|
1152 |
+
}
|
1153 |
+
echo "<input type=\"hidden\" name=\"exportcsv\" value=\"$exportcsv\" />\r\n";
|
1154 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"exportcsv\" />\r\n";
|
1155 |
+
echo "<input type=\"submit\" name=\"submit\" value=\"" . __('Save Emails to CSV File','subscribe2') . "\" />\r\n";
|
1156 |
+
echo "</form></span>\r\n";
|
1157 |
+
}
|
1158 |
+
}
|
1159 |
+
echo "<table cellpadding=\"2\" cellspacing=\"2\">";
|
1160 |
+
if (!empty($subscribers)) {
|
1161 |
+
foreach ($subscribers as $subscriber) {
|
1162 |
+
echo "<tr class=\"$alternate\">";
|
1163 |
+
echo "<td width=\"75%\"";
|
1164 |
+
if (in_array($subscriber, $unconfirmed)) {
|
1165 |
+
echo " align=\"right\">";
|
1166 |
+
} elseif (in_array($subscriber, $confirmed)) {
|
1167 |
+
echo "align=\"center\">";
|
1168 |
+
} else {
|
1169 |
+
echo "align=\"left\" colspan=\"3\">";
|
1170 |
+
}
|
1171 |
+
echo "<a href=\"mailto:$subscriber\">$subscriber</a>\r\n";
|
1172 |
+
if (in_array($subscriber, $unconfirmed) || in_array($subscriber, $confirmed) ) {
|
1173 |
+
echo "(" . $this->signup_date($subscriber) . ")</td>\r\n";
|
1174 |
+
echo "<td width=\"5%\" align=\"center\">\r\n";
|
1175 |
+
echo "<form method=\"post\" action=\"\">";
|
1176 |
+
if (function_exists('wp_nonce_field')) {
|
1177 |
+
wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
|
1178 |
+
}
|
1179 |
+
echo "<input type=\"hidden\" name=\"email\" value=\"$subscriber\" />\r\n";
|
1180 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"toggle\" />\r\n";
|
1181 |
+
echo "<input type=\"hidden\" name=\"what\" value=\"$what\" />\r\n";
|
1182 |
+
echo "<input type=\"submit\" name=\"submit\" value=\"";
|
1183 |
+
(in_array($subscriber, $unconfirmed)) ? $foo = '<-' : $foo= '->';
|
1184 |
+
echo "$foo\" /></form></td>\r\n";
|
1185 |
+
echo "<td width=\"2%\" align=\"center\">\r\n";
|
1186 |
+
echo "<form method=\"post\" action=\"\">\r\n";
|
1187 |
+
if (function_exists('wp_nonce_field')) {
|
1188 |
+
wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
|
1189 |
+
}
|
1190 |
+
echo "<span class=\"delete\">\r\n";
|
1191 |
+
echo "<input type=\"hidden\" name=\"email\" value=\"$subscriber\" />\r\n";
|
1192 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"delete\" />\r\n";
|
1193 |
+
echo "<input type=\"hidden\" name=\"what\" value=\"$what\" />\r\n";
|
1194 |
+
echo "<input type=\"submit\" name=\"submit\" value=\"X\" />\r\n";
|
1195 |
+
echo "</span></form>";
|
1196 |
+
}
|
1197 |
+
echo "</td></tr>\r\n";
|
1198 |
+
('alternate' == $alternate) ? $alternate = '' : $alternate = 'alternate';
|
1199 |
+
}
|
1200 |
+
} else {
|
1201 |
+
echo "<tr><td align=\"center\"><b>" . __('NONE', 'subscribe2') . "</b></td></tr>\r\n";
|
1202 |
+
}
|
1203 |
+
echo "</table>";
|
1204 |
+
if ($reminderform) {
|
1205 |
+
echo "<span class=\"submit\"><form method=\"post\" action=\"\">\r\n";
|
1206 |
+
if (function_exists('wp_nonce_field')) {
|
1207 |
+
wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
|
1208 |
+
}
|
1209 |
+
echo "<input type=\"hidden\" name=\"reminderemails\" value=\"$reminderemails\" />\r\n";
|
1210 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"remind\" />\r\n";
|
1211 |
+
echo "<input type=\"submit\" name=\"submit\" value=\"" . __('Send Reminder Email','subscribe2') . "\" />\r\n";
|
1212 |
+
echo "</form></span>";
|
1213 |
+
}
|
1214 |
+
echo "</div>\r\n";
|
1215 |
+
|
1216 |
+
//show bulk managment form
|
1217 |
+
echo "<div class=\"wrap\">";
|
1218 |
+
echo "<h2 >" . __('Categories', 'subscribe2') . "</h2>\r\n";
|
1219 |
+
echo __('Existing Registered Users can be automatically (un)subscribed to categories using this section.', 'subscribe2') . "<br />\r\n";
|
1220 |
+
echo "<strong><em style=\"color: red\">" . __('Consider User Privacy as changes cannot be undone', 'subscribe2') . "</em></strong><br />\r\n";
|
1221 |
+
echo "<span class=\"submit\"><form method=\"post\" action=\"\">\r\n";
|
1222 |
+
if (function_exists('wp_nonce_field')) {
|
1223 |
+
wp_nonce_field('subscribe2-manage_subscribers' . $s2nonce);
|
1224 |
+
}
|
1225 |
+
echo "<input type=\"hidden\" name=\"emails\" value=\"$emails\" /><input type=\"hidden\" name=\"s2_admin\" value=\"register\" />";
|
1226 |
+
$this->display_category_form();
|
1227 |
+
echo "<input type=\"submit\" id=\"deletepost\" name=\"submit\" value=\"" . __('Subscribe','subscribe2') . "\" />";
|
1228 |
+
echo "<input type=\"submit\" id=\"deletepost\" name=\"submit\" value=\"" . __('Unsubscribe','subscribe2') . "\" /></form></span>";
|
1229 |
+
|
1230 |
+
echo "</div>\r\n";
|
1231 |
+
echo "<div style=\"clear: both;\"><p> </p></div>";
|
1232 |
+
|
1233 |
+
include(ABSPATH . '/wp-admin/admin-footer.php');
|
1234 |
+
// just to be sure
|
1235 |
+
die;
|
1236 |
+
} // end manage_menu()
|
1237 |
+
|
1238 |
+
/**
|
1239 |
+
Our options page
|
1240 |
+
*/
|
1241 |
+
function options_menu() {
|
1242 |
+
global $s2nonce;
|
1243 |
+
|
1244 |
+
// was anything POSTed?
|
1245 |
+
if (isset($_POST['s2_admin'])) {
|
1246 |
+
check_admin_referer('subscribe2-options_subscribers' . $s2nonce);
|
1247 |
+
if ('RESET' == $_POST['s2_admin']) {
|
1248 |
+
$this->reset();
|
1249 |
+
echo "<div id=\"message\" class=\"updated fade\"><strong><p>$this->options_reset</p></strong></div>";
|
1250 |
+
} elseif ('options' == $_POST['s2_admin']) {
|
1251 |
+
// excluded categories
|
1252 |
+
if (!empty($_POST['category'])) {
|
1253 |
+
$exclude_cats = implode(',', $_POST['category']);
|
1254 |
+
} else {
|
1255 |
+
$exclude_cats = '';
|
1256 |
+
}
|
1257 |
+
$this->subscribe2_options['exclude'] = $exclude_cats;
|
1258 |
+
// allow override?
|
1259 |
+
(isset($_POST['reg_override'])) ? $override = '1' : $override = '0';
|
1260 |
+
$this->subscribe2_options['reg_override'] = $override;
|
1261 |
+
|
1262 |
+
// show button?
|
1263 |
+
($_POST['show_button'] == '1') ? $showbutton = '1' : $showbutton = '0';
|
1264 |
+
$this->subscribe2_options['show_button'] = $showbutton;
|
1265 |
+
|
1266 |
+
// send as author or admin?
|
1267 |
+
$sender = 'author';
|
1268 |
+
if ('admin' == $_POST['sender']) {
|
1269 |
+
$sender = 'admin';
|
1270 |
+
}
|
1271 |
+
$this->subscribe2_options['sender'] = $sender;
|
1272 |
+
|
1273 |
+
// send email for pages and password protected posts
|
1274 |
+
$pages_option = $_POST['pages'];
|
1275 |
+
$this->subscribe2_options['pages']= $pages_option;
|
1276 |
+
$password_option = $_POST['password'];
|
1277 |
+
$this->subscribe2_options['password']= $password_option;
|
1278 |
+
|
1279 |
+
// send per-post or digest emails
|
1280 |
+
$email_freq = $_POST['email_freq'];
|
1281 |
+
$this->subscribe2_options['email_freq'] = $email_freq;
|
1282 |
+
wp_clear_scheduled_hook('s2_digest_cron');
|
1283 |
+
$scheds = (array) wp_get_schedules();
|
1284 |
+
$interval = ( isset($scheds[$email_freq]['interval']) ) ? (int) $scheds[$email_freq]['interval'] : 0;
|
1285 |
+
if ($interval == 0) {
|
1286 |
+
// if we are on per-post emails remove last_cron entry
|
1287 |
+
unset($this->subscribe2_options['last_s2cron']);
|
1288 |
+
} else {
|
1289 |
+
if (!wp_next_scheduled('s2_digest_cron')) {
|
1290 |
+
// if we are using digest schedule the event and prime last_cron as now
|
1291 |
+
wp_schedule_event(time() + $interval, $email_freq, 's2_digest_cron');
|
1292 |
+
$now = date('Y-m-d H:i:s', time());
|
1293 |
+
$this->subscribe2_options['last_s2cron'] = $now;
|
1294 |
+
}
|
1295 |
+
}
|
1296 |
+
|
1297 |
+
// email templates
|
1298 |
+
$mailtext = $_POST['mailtext'];
|
1299 |
+
$this->subscribe2_options['mailtext'] = $mailtext;
|
1300 |
+
$confirm_email = $_POST['confirm_email'];
|
1301 |
+
$this->subscribe2_options['confirm_email'] = $confirm_email;
|
1302 |
+
$remind_email = $_POST['remind_email'];
|
1303 |
+
$this->subscribe2_options['remind_email'] = $remind_email;
|
1304 |
+
|
1305 |
+
//automatic subscription
|
1306 |
+
$autosub_option = $_POST['autosub'];
|
1307 |
+
$this->subscribe2_options['autosub']= $autosub_option;
|
1308 |
+
$autosub_format_option = $_POST['autoformat'];
|
1309 |
+
$this->subscribe2_options['autoformat']= $autosub_format_option;
|
1310 |
+
|
1311 |
+
//barred domains
|
1312 |
+
$barred_option = $_POST['barred'];
|
1313 |
+
$this->subscribe2_options['barred'] = $barred_option;
|
1314 |
+
echo "<div id=\"message\" class=\"updated fade\"><strong><p>$this->options_saved</p></strong></div>";
|
1315 |
+
update_option('subscribe2_options', $this->subscribe2_options);
|
1316 |
+
}
|
1317 |
+
}
|
1318 |
+
// show our form
|
1319 |
+
echo "<div class=\"wrap\">";
|
1320 |
+
echo "<form method=\"post\" action=\"\">\r\n";
|
1321 |
+
if (function_exists('wp_nonce_field')) {
|
1322 |
+
wp_nonce_field('subscribe2-options_subscribers' . $s2nonce);
|
1323 |
+
}
|
1324 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"options\" />\r\n";
|
1325 |
+
echo "<h2>" . __('Delivery Options', 'subscribe2') . ":</h2>\r\n";
|
1326 |
+
echo __('Send Emails for Pages', 'subscribe2') . ': ';
|
1327 |
+
echo "<input type=\"radio\" name=\"pages\" value=\"yes\"";
|
1328 |
+
if ('yes' == $this->subscribe2_options['pages']) {
|
1329 |
+
echo " checked=\"checked\"";
|
1330 |
+
}
|
1331 |
+
echo " /> " . __('Yes', 'subscribe2') . " ";
|
1332 |
+
echo "<input type=\"radio\" name=\"pages\" value=\"no\"";
|
1333 |
+
if ('no' == $this->subscribe2_options['pages']) {
|
1334 |
+
echo " checked=\"checked\"";
|
1335 |
+
}
|
1336 |
+
echo " /> " . __('No', 'subscribe2') . "<br /><br />\r\n";
|
1337 |
+
echo __('Send Emails for Password Protected Posts', 'subscribe2') . ': ';
|
1338 |
+
echo "<input type=\"radio\" name=\"password\" value=\"yes\"";
|
1339 |
+
if ('yes' == $this->subscribe2_options['password']) {
|
1340 |
+
echo " checked=\"checked\"";
|
1341 |
+
}
|
1342 |
+
echo " /> " . __('Yes', 'subscribe2') . " ";
|
1343 |
+
echo "<input type=\"radio\" name=\"password\" value=\"no\"";
|
1344 |
+
if ('no' == $this->subscribe2_options['password']) {
|
1345 |
+
echo " checked=\"checked\"";
|
1346 |
+
}
|
1347 |
+
echo " /> " . __('No', 'subscribe2') . "<br /><br />\r\n";
|
1348 |
+
echo __('Send Email From', 'subscribe2') . ': ';
|
1349 |
+
echo "<input type=\"radio\" name=\"sender\" value=\"author\"";
|
1350 |
+
if ('author' == $this->subscribe2_options['sender']) {
|
1351 |
+
echo "checked=\"checked\" ";
|
1352 |
+
}
|
1353 |
+
echo " /> " . __('Author of the post', 'subscribe2') . " ";
|
1354 |
+
echo "<input type=\"radio\" name=\"sender\" value=\"admin\"";
|
1355 |
+
if ('admin' == $this->subscribe2_options['sender']) {
|
1356 |
+
echo "checked=\"checked\" ";
|
1357 |
+
}
|
1358 |
+
echo " /> " . __('Blog Admin', 'subscribe2') . "<br /><br />\r\n";
|
1359 |
+
if (function_exists('wp_schedule_event')) {
|
1360 |
+
echo __('Send Email as Digest', 'subscribe2') . ": <br /><br />\r\n";
|
1361 |
+
$this->display_digest_choices();
|
1362 |
+
echo "<br />\r\n";
|
1363 |
+
}
|
1364 |
+
echo "<h2>" . __('Email Templates', 'subscribe2') . "</h2>\r\n";
|
1365 |
+
echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"1\" class=\"editform\">\r\n";
|
1366 |
+
echo "<tr><td>";
|
1367 |
+
echo __('New Post email (must not be empty)', 'subscribe2') . ":";
|
1368 |
+
echo "<br />\r\n";
|
1369 |
+
echo "<textarea rows=\"9\" cols=\"60\" name=\"mailtext\">" . stripslashes($this->subscribe2_options['mailtext']) . "</textarea><br /><br />\r\n";
|
1370 |
+
echo "</td><td valign=\"top\" rowspan=\"3\">";
|
1371 |
+
echo "<h3>" . __('Message substitions', 'subscribe2') . "</h3>\r\n";
|
1372 |
+
echo "<dl>";
|
1373 |
+
echo "<dt><b>BLOGNAME</b></dt><dd>" . get_bloginfo('name') . "</dd>\r\n";
|
1374 |
+
echo "<dt><b>BLOGLINK</b></dt><dd>" . get_bloginfo('url') . "</dd>\r\n";
|
1375 |
+
echo "<dt><b>TITLE</b></dt><dd>" . __("the post's title", 'subscribe2') . "</dd>\r\n";
|
1376 |
+
echo "<dt><b>POST</b></dt><dd>" . __("the excerpt or the entire post<br />(<i>based on the subscriber's preferences</i>)", 'subscribe2') . "</dd>\r\n";
|
1377 |
+
echo "<dt><b>PERMALINK</b></dt><dd>" . __("the post's permalink", 'subscribe2') . "</dd>\r\n";
|
1378 |
+
echo "<dt><b>MYNAME</b></dt><dd>" . __("the admin or post author's name", 'subscribe2') . "</dd>\r\n";
|
1379 |
+
echo "<dt><b>EMAIL</b></dt><dd>" . __("the admin or post author's email", 'subscribe2') . "</dd>\r\n";
|
1380 |
+
echo "<dt><b>AUTHORNAME</b></dt><dd>" . __("the post author's name", 'subscribe2') . "</dd>\r\n";
|
1381 |
+
echo "<dt><b>LINK</b></dt><dd>" . __("the generated link to confirm a request<br />(<i>only used in the confirmation email template</i>)", 'subscribe2') . "</dd>\r\n";
|
1382 |
+
echo "<dt><b>ACTION</b></dt><dd>" . __("Action performed by LINK in confirmation email<br />(<i>only used in the confirmation email template</i>)", 'subscribe2') . "</dd>\r\n";
|
1383 |
+
echo "</dl></td></tr><tr><td>";
|
1384 |
+
echo __('Subscribe / Unsubscribe confirmation email', 'subscribe2') . ":<br />\r\n";
|
1385 |
+
echo "<textarea rows=\"9\" cols=\"60\" name=\"confirm_email\">" . stripslashes($this->subscribe2_options['confirm_email']) . "</textarea><br /><br />\r\n";
|
1386 |
+
echo "</td></tr><tr valign=\"top\"><td>";
|
1387 |
+
echo __('Reminder email to Unconfirmed Subscribers', 'subscribe2') . ":<br />\r\n";
|
1388 |
+
echo "<textarea rows=\"9\" cols=\"60\" name=\"remind_email\">" . stripslashes($this->subscribe2_options['remind_email']) . "</textarea><br /><br />\r\n";
|
1389 |
+
echo "</td></tr></table><br />\r\n";
|
1390 |
+
|
1391 |
+
// excluded categories
|
1392 |
+
echo "<h2>" . __('Excluded Categories', 'subscribe2') . "</h2>\r\n";
|
1393 |
+
$this->display_category_form(explode(',', $this->subscribe2_options['exclude']));
|
1394 |
+
echo "<center><input type=\"checkbox\" name=\"reg_override\" value=\"1\"";
|
1395 |
+
if ('1' == $this->subscribe2_options['reg_override']) {
|
1396 |
+
echo " checked=\"checked\"";
|
1397 |
+
}
|
1398 |
+
echo " /> " . __('Allow registered users to subscribe to excluded categories?', 'subscribe2') . "</center><br />\r\n";
|
1399 |
+
echo "<h2>" . __('Writing Options', 'subscribe2') . "</h2>\r\n";
|
1400 |
+
echo "<input type=\"checkbox\" name=\"show_button\" value=\"1\"";
|
1401 |
+
if ('1' == $this->subscribe2_options['show_button']) {
|
1402 |
+
echo " checked=\"checked\"";
|
1403 |
+
}
|
1404 |
+
echo " /> " . __('Show the Subscribe2 button on the Write toolbar?', 'subscribe2') . "<br /><br />\r\n";
|
1405 |
+
|
1406 |
+
//Auto Subscription for new registrations
|
1407 |
+
echo "<h2>" . __('Auto Subscribe', 'subscribe2') . "</h2>\r\n";
|
1408 |
+
echo __('Subscribe new users registering with your blog.', 'subscribe2') . "<br />\r\n";
|
1409 |
+
echo "<input type=\"radio\" name=\"autosub\" value=\"yes\"";
|
1410 |
+
if ('yes' == $this->subscribe2_options['autosub']) {
|
1411 |
+
echo " checked=\"checked\"";
|
1412 |
+
}
|
1413 |
+
echo " /> " . __('Automatically', 'subscribe2') . " ";
|
1414 |
+
echo "<input type=\"radio\" name=\"autosub\" value=\"wpreg\"";
|
1415 |
+
if ('wpreg' == $this->subscribe2_options['autosub']) {
|
1416 |
+
echo " checked=\"checked\"";
|
1417 |
+
}
|
1418 |
+
echo " /> " . __('Display option on Registration Form', 'subscribe2') . " ";
|
1419 |
+
echo "<input type=\"radio\" name=\"autosub\" value=\"no\"";
|
1420 |
+
if ('no' == $this->subscribe2_options['autosub']) {
|
1421 |
+
echo " checked=\"checked\"";
|
1422 |
+
}
|
1423 |
+
echo " /> " . __('No', 'subscribe2') . "<br /><br />\r\n";
|
1424 |
+
echo __('Auto-subscribe users to receive email as', 'subscribe2') . ": <br />\r\n";
|
1425 |
+
echo "<input type=\"radio\" name=\"autoformat\" value=\"html\"";
|
1426 |
+
if ('html' == $this->subscribe2_options['autoformat']) {
|
1427 |
+
echo "checked=\"checked\" ";
|
1428 |
+
}
|
1429 |
+
echo "/> " . __('HTML', 'subscribe2') ." ";
|
1430 |
+
echo "<input type=\"radio\" name=\"autoformat\" value=\"fulltext\" ";
|
1431 |
+
if ('fulltext' == $this->subscribe2_options['autoformat']) {
|
1432 |
+
echo "checked=\"checked\" ";
|
1433 |
+
}
|
1434 |
+
echo "/> " . __('Plain Text - Full', 'subscribe2') . " ";
|
1435 |
+
echo "<input type=\"radio\" name=\"autoformat\" value=\"text\" ";
|
1436 |
+
if ('text' == $this->subscribe2_options['autoformat']) {
|
1437 |
+
echo "checked=\"checked\" ";
|
1438 |
+
}
|
1439 |
+
echo "/> " . __('Plain Text - Excerpt', 'subscribe2') . " <br /><br />";
|
1440 |
+
|
1441 |
+
//barred domains
|
1442 |
+
echo "<h2>" . __('Barred Domains', 'subscribe2') . "</h2>\r\n";
|
1443 |
+
echo __('Enter domains to bar from public subscriptions: <br /> (Use a new line for each entry and omit the "@" symbol, for example email.com)', 'subscribe2');
|
1444 |
+
echo "<br />\r\n<textarea style=\"width: 98%;\" rows=\"4\" cols=\"60\" name=\"barred\">" . $this->subscribe2_options['barred'] . "</textarea>";
|
1445 |
+
|
1446 |
+
// submit
|
1447 |
+
echo "<p align=\"center\"><span class=\"submit\"><input type=\"submit\" id=\"save\" name=\"submit\" value=\"" . __('Submit', 'subscribe2') . "\" /></span></p>";
|
1448 |
+
echo "</form>\r\n";
|
1449 |
+
echo "</div><div class=\"wrap\">";
|
1450 |
+
|
1451 |
+
// reset
|
1452 |
+
echo "<h2>" . __('Reset Default', 'subscribe2') . "</h2>\r\n";
|
1453 |
+
echo "<p>" . __('Use this to reset all options to their defaults. This <strong><em>will not</em></strong> modify your list of subscribers.', 'subscribe2') . "</p>\r\n";
|
1454 |
+
echo "<form method=\"post\" action=\"\">";
|
1455 |
+
if (function_exists('wp_nonce_field')) {
|
1456 |
+
wp_nonce_field('subscribe2-options_subscribers' . $s2nonce);
|
1457 |
+
}
|
1458 |
+
echo "<p align=\"center\"><span class=\"submit\">";
|
1459 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"RESET\" />";
|
1460 |
+
echo "<input type=\"submit\" id=\"deletepost\" name=\"submit\" value=\"" . __('RESET', 'subscribe2') .
|
1461 |
+
"\" />";
|
1462 |
+
echo "</span></p></form></div>\r\n";
|
1463 |
+
|
1464 |
+
include(ABSPATH . '/wp-admin/admin-footer.php');
|
1465 |
+
// just to be sure
|
1466 |
+
die;
|
1467 |
+
} // end options_menu()
|
1468 |
+
|
1469 |
+
/**
|
1470 |
+
Our profile menu
|
1471 |
+
*/
|
1472 |
+
function user_menu() {
|
1473 |
+
global $user_ID, $s2nonce;
|
1474 |
+
|
1475 |
+
get_currentuserinfo();
|
1476 |
+
|
1477 |
+
// was anything POSTed?
|
1478 |
+
if ( (isset($_POST['s2_admin'])) && ('user' == $_POST['s2_admin']) ) {
|
1479 |
+
check_admin_referer('subscribe2-user_subscribers' . $s2nonce);
|
1480 |
+
echo "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Subscription preferences updated.', 'subscribe2') . "</strong></p></div>\n";
|
1481 |
+
$format = 'text';
|
1482 |
+
$post = 'post';
|
1483 |
+
if ('html' == $_POST['s2_format']) {
|
1484 |
+
$format = 'html';
|
1485 |
+
}
|
1486 |
+
if ('excerpt' == $_POST['s2_excerpt']) {
|
1487 |
+
$post = 'excerpt';
|
1488 |
+
}
|
1489 |
+
update_usermeta($user_ID, 's2_excerpt', $post);
|
1490 |
+
update_usermeta($user_ID, 's2_format', $format);
|
1491 |
+
update_usermeta($user_ID, 's2_autosub', $_POST['new_category']);
|
1492 |
+
|
1493 |
+
$cats = $_POST['category'];
|
1494 |
+
if (empty($cats)) {
|
1495 |
+
$cats = explode(',', get_usermeta($user_ID, 's2_subscribed'));
|
1496 |
+
if ($cats) {
|
1497 |
+
foreach ($cats as $cat) {
|
1498 |
+
delete_usermeta($user_ID, "s2_cat" . $cat);
|
1499 |
+
}
|
1500 |
+
}
|
1501 |
+
update_usermeta($user_ID, 's2_subscribed', '-1');
|
1502 |
+
} else {
|
1503 |
+
if (!is_array($cats)) {
|
1504 |
+
$cats = array($_POST['category']);
|
1505 |
+
}
|
1506 |
+
$old_cats = explode(',', get_usermeta($user_ID, 's2_subscribed'));
|
1507 |
+
$remove = array_diff($old_cats, $cats);
|
1508 |
+
$new = array_diff($cats, $old_cats);
|
1509 |
+
if (!empty($remove)) {
|
1510 |
+
// remove subscription to these cat IDs
|
1511 |
+
foreach ($remove as $id) {
|
1512 |
+
delete_usermeta($user_ID, "s2_cat" .$id);
|
1513 |
+
}
|
1514 |
+
}
|
1515 |
+
if (!empty($new)) {
|
1516 |
+
// add subscription to these cat IDs
|
1517 |
+
foreach ($new as $id) {
|
1518 |
+
update_usermeta($user_ID, 's2_cat' . $id, "$id");
|
1519 |
+
}
|
1520 |
+
}
|
1521 |
+
update_usermeta($user_ID, 's2_subscribed', implode(',', $cats));
|
1522 |
+
}
|
1523 |
+
}
|
1524 |
+
|
1525 |
+
// show our form
|
1526 |
+
echo "<div class=\"wrap\">";
|
1527 |
+
echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
|
1528 |
+
echo "<form method=\"post\" action=\"\">";
|
1529 |
+
if (function_exists('wp_nonce_field')) {
|
1530 |
+
wp_nonce_field('subscribe2-user_subscribers' . $s2nonce);
|
1531 |
+
}
|
1532 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"user\" />";
|
1533 |
+
if ($this->subscribe2_options['email_freq'] == 'never') {
|
1534 |
+
echo __('Receive email as', 'subscribe2') . ": ";
|
1535 |
+
echo "<input type=\"radio\" name=\"s2_format\" value=\"html\"";
|
1536 |
+
if ('html' == get_usermeta($user_ID, 's2_format')) {
|
1537 |
+
echo "checked=\"checked\" ";
|
1538 |
+
}
|
1539 |
+
echo "/> " . __('HTML', 'subscribe2') ." ";
|
1540 |
+
echo "<input type=\"radio\" name=\"s2_format\" value=\"text\" ";
|
1541 |
+
if ('text' == get_usermeta($user_ID, 's2_format')) {
|
1542 |
+
echo "checked=\"checked\" ";
|
1543 |
+
}
|
1544 |
+
echo "/> " . __('Plain Text', 'subscribe2') . "<br /><br />\r\n";
|
1545 |
+
|
1546 |
+
echo __('Email contains', 'subscribe2') . ": ";
|
1547 |
+
$amount = array ('excerpt' => __('Excerpt Only', 'subscribe2'), 'post' => __('Full Post', 'subscribe2'));
|
1548 |
+
foreach ($amount as $key => $value) {
|
1549 |
+
echo "<input type=\"radio\" name=\"s2_excerpt\" value=\"" . $key . "\"";
|
1550 |
+
if ($key == get_usermeta($user_ID, 's2_excerpt')) {
|
1551 |
+
echo " checked=\"checked\"";
|
1552 |
+
}
|
1553 |
+
echo " /> " . $value . " ";
|
1554 |
+
}
|
1555 |
+
echo "<p style=\"color: red\">" . __('Note: HTML format will always deliver the full post.', 'subscribe2') . "</p>\r\n";
|
1556 |
+
echo __('Automatically subscribe me to newly created categories', 'subscribe2') . ': ';
|
1557 |
+
echo "<input type=\"radio\" name=\"new_category\" value=\"yes\" ";
|
1558 |
+
if ('yes' == get_usermeta($user_ID, 's2_autosub')) {
|
1559 |
+
echo "checked=\"yes\" ";
|
1560 |
+
}
|
1561 |
+
echo "/> Yes ";
|
1562 |
+
echo "<input type=\"radio\" name=\"new_category\" value=\"no\" ";
|
1563 |
+
if ('no' == get_usermeta($user_ID, 's2_autosub')) {
|
1564 |
+
echo "checked=\"yes\" ";
|
1565 |
+
}
|
1566 |
+
echo "/> No<br /><br />";
|
1567 |
+
|
1568 |
+
// subscribed categories
|
1569 |
+
echo "<h2>" . __('Subscribed Categories', 'subscribe2') . "</h2>\r\n";
|
1570 |
+
$this->display_category_form(explode(',', get_usermeta($user_ID, 's2_subscribed')), $this->subscribe2_options['reg_override']);
|
1571 |
+
} else {
|
1572 |
+
// we're doing daily digests, so just show
|
1573 |
+
// subscribe / unnsubscribe
|
1574 |
+
echo __('Receive daily summary of new posts?', 'subscribe2') . ': ';
|
1575 |
+
echo "<input type=\"radio\" name=\"category\" value=\"1\" ";
|
1576 |
+
if (get_usermeta($user_ID, 's2_subscribed')) {
|
1577 |
+
echo "checked=\"yes\" ";
|
1578 |
+
}
|
1579 |
+
echo "/> Yes <input type=\"radio\" name=\"category\" value=\"\" ";
|
1580 |
+
if (! get_usermeta($user_ID, 's2_subscribed')) {
|
1581 |
+
echo "checked=\"yes\" ";
|
1582 |
+
}
|
1583 |
+
echo "/> No";
|
1584 |
+
}
|
1585 |
+
|
1586 |
+
// submit
|
1587 |
+
echo "<p align=\"right\"><span class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __("Update Preferences »", 'subscribe2') . "\" /></span></p>";
|
1588 |
+
echo "</form></div>\r\n";
|
1589 |
+
|
1590 |
+
include(ABSPATH . '/wp-admin/admin-footer.php');
|
1591 |
+
// just to be sure
|
1592 |
+
die;
|
1593 |
+
} // end user_menu()
|
1594 |
+
|
1595 |
+
/**
|
1596 |
+
Display the Write sub-menu
|
1597 |
+
*/
|
1598 |
+
function write_menu() {
|
1599 |
+
global $wpdb, $s2nonce;
|
1600 |
+
|
1601 |
+
// was anything POSTed?
|
1602 |
+
if (isset($_POST['s2_admin']) && ('mail' == $_POST['s2_admin']) ) {
|
1603 |
+
check_admin_referer('subscribe2-write_subscribers' . $s2nonce);
|
1604 |
+
if ('confirmed' == $_POST['what']) {
|
1605 |
+
$recipients = $this->get_public();
|
1606 |
+
} elseif ('unconfirmed' == $_POST['what']) {
|
1607 |
+
$recipients = $this->get_public(0);
|
1608 |
+
} elseif ('public' == $_POST['what']) {
|
1609 |
+
$confirmed = $this->get_public();
|
1610 |
+
$unconfirmed = $this->get_public(0);
|
1611 |
+
$recipients = array_merge((array)$confirmed, (array)$unconfirmed);
|
1612 |
+
} elseif (is_numeric($_POST['what'])) {
|
1613 |
+
$cat = intval($_POST['what']);
|
1614 |
+
$recipients = $this->get_registered("cats=$cat");
|
1615 |
+
} else {
|
1616 |
+
$recipients = $this->get_registered();
|
1617 |
+
}
|
1618 |
+
global $user_identity, $user_email;
|
1619 |
+
get_currentuserinfo();
|
1620 |
+
$this->myname = $user_identity;
|
1621 |
+
$this->myemail = $user_email;
|
1622 |
+
$subject = strip_tags($_POST['subject']);
|
1623 |
+
$message = stripslashes($_POST['message']);
|
1624 |
+
$this->mail($recipients, $subject, $message, 'text');
|
1625 |
+
$message = $this->mail_sent;
|
1626 |
+
}
|
1627 |
+
|
1628 |
+
if ('' != $message) {
|
1629 |
+
echo "<div id=\"message\" class=\"updated\"><strong><p>" . $message . "</p></strong></div>\r\n";
|
1630 |
+
}
|
1631 |
+
// show our form
|
1632 |
+
echo "<div class=\"wrap\"><h2>" . __('Send email to all subscribers', 'subscribe2') . "</h2>\r\n";
|
1633 |
+
echo "<form method=\"post\" action=\"\">\r\n";
|
1634 |
+
if (function_exists('wp_nonce_field')) {
|
1635 |
+
wp_nonce_field('subscribe2-write_subscribers' . $s2nonce);
|
1636 |
+
}
|
1637 |
+
echo __('Subject', 'subscribe2') . ": <input type=\"text\" size=\"69\" name=\"subject\" value=\"" . __('A message from ', 'subscribe2') . get_settings('blogname') . "\" /> <br />";
|
1638 |
+
echo "<textarea rows=\"12\" cols=\"75\" name=\"message\"></textarea>";
|
1639 |
+
echo "<br />\r\n";
|
1640 |
+
echo __('Recipients: ', 'subscribe2');
|
1641 |
+
$this->display_subscriber_dropdown('registered', false, array('all'));
|
1642 |
+
echo "<input type=\"hidden\" name=\"s2_admin\" value=\"mail\" />";
|
1643 |
+
echo " <span class=\"submit\"><input type=\"submit\" name=\"submit\" value=\"" . __('Send', 'subscribe2') . "\" /></span> ";
|
1644 |
+
echo "</form></div>\r\n";
|
1645 |
+
echo "<div style=\"clear: both;\"><p> </p></div>";
|
1646 |
+
|
1647 |
+
include(ABSPATH . '/wp-admin/admin-footer.php');
|
1648 |
+
// just to be sure
|
1649 |
+
die;
|
1650 |
+
} // end write_menu()
|
1651 |
+
|
1652 |
+
/* ===== helper functions: forms and stuff ===== */
|
1653 |
+
/**
|
1654 |
+
Display a table of categories with checkboxes
|
1655 |
+
Optionally pre-select those categories specified
|
1656 |
+
*/
|
1657 |
+
function display_category_form($selected = array(), $override = 1) {
|
1658 |
+
global $wpdb;
|
1659 |
+
|
1660 |
+
$all_cats = get_categories('type=post&hide_empty=1&hierarchical=0');
|
1661 |
+
$exclude = explode(',', $this->subscribe2_options['exclude']);
|
1662 |
+
|
1663 |
+
if (0 == $override) {
|
1664 |
+
// registered users are not allowed to subscribe to
|
1665 |
+
// excluded categories
|
1666 |
+
foreach ($all_cats as $cat => $cat_ID) {
|
1667 |
+
if (in_array($all_cats[$cat]->cat_ID, $exclude)) {
|
1668 |
+
$cat = (int)$cat;
|
1669 |
+
unset($all_cats[$cat]);
|
1670 |
+
}
|
1671 |
+
}
|
1672 |
+
}
|
1673 |
+
|
1674 |
+
$half = (count($all_cats) / 2);
|
1675 |
+
$i = 0;
|
1676 |
+
$j = 0;
|
1677 |
+
echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"5\" class=\"editform\">\r\n";
|
1678 |
+
echo "<tr valign=\"top\"><td width=\"50%\" align=\"left\">\r\n";
|
1679 |
+
foreach ($all_cats as $cat) {
|
1680 |
+
if ( ($i >= $half) && (0 == $j) ){
|
1681 |
+
echo "</td><td width=\"50%\" align=\"left\">\r\n";
|
1682 |
+
$j++;
|
1683 |
+
}
|
1684 |
+
if (0 == $j) {
|
1685 |
+
echo "<input type=\"checkbox\" name=\"category[]\" value=\"" . $cat->cat_ID . "\"";
|
1686 |
+
if (in_array($cat->cat_ID, $selected)) {
|
1687 |
+
echo " checked=\"checked\" ";
|
1688 |
+
}
|
1689 |
+
echo " /> " . $cat->cat_name . "<br />\r\n";
|
1690 |
+
} else {
|
1691 |
+
|
1692 |
+
echo "<input type=\"checkbox\" name=\"category[]\" value=\"" . $cat->cat_ID . "\"";
|
1693 |
+
if (in_array($cat->cat_ID, $selected)) {
|
1694 |
+
echo " checked=\"checked\" ";
|
1695 |
+
}
|
1696 |
+
echo " /> " . $cat->cat_name . "<br />\r\n";
|
1697 |
+
}
|
1698 |
+
$i++;
|
1699 |
+
}
|
1700 |
+
echo "</td></tr>\r\n";
|
1701 |
+
echo "<tr><td align=\"left\">\r\n";
|
1702 |
+
echo "<input type=\"checkbox\" name=\"checkall\" onclick=\"setAll(this)\" /> " . __('Select / Unselect All' ,'subscribe2') . "\r\n";
|
1703 |
+
echo "</td></tr>\r\n";
|
1704 |
+
echo "</table>\r\n";
|
1705 |
+
} // end display_category_form()
|
1706 |
+
|
1707 |
+
/**
|
1708 |
+
Display a drop-down form to select subscribers
|
1709 |
+
$selected is the option to select
|
1710 |
+
$submit is the text to use on the Submit button
|
1711 |
+
*/
|
1712 |
+
function display_subscriber_dropdown ($selected = 'registered', $submit = '', $exclude = array()) {
|
1713 |
+
global $wpdb;
|
1714 |
+
|
1715 |
+
$who = array('all' => __('All Subscribers', 'subscribe2'),
|
1716 |
+
'public' => __('Public Subscribers', 'subscribe2'),
|
1717 |
+
'confirmed' => ' ' . __('Confirmed', 'subscribe2'),
|
1718 |
+
'unconfirmed' => ' ' . __('Unconfirmed', 'subscribe2'),
|
1719 |
+
'registered' => __('Registered Subscribers', 'subscribe2'));
|
1720 |
+
|
1721 |
+
$all_cats = get_categories('type=post&hide_empty=1&hierarchical=0');
|
1722 |
+
|
1723 |
+
// count the number of subscribers
|
1724 |
+
$count['confirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='1'");
|
1725 |
+
$count['unconfirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM $this->public WHERE active='0'");
|
1726 |
+
if (in_array('unconfirmed', $exclude)) {
|
1727 |
+
$count['public'] = $count['confirmed'];
|
1728 |
+
} elseif (in_array('confirmed', $exclude)) {
|
1729 |
+
$count['public'] = $count['unconfirmed'];
|
1730 |
+
} else {
|
1731 |
+
$count['public'] = ($count['confirmed'] + $count['unconfirmed']);
|
1732 |
+
}
|
1733 |
+
$count['registered'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='s2_subscribed'");
|
1734 |
+
$count['all'] = ($count['confirmed'] + $count['unconfirmed'] + $count['registered']);
|
1735 |
+
foreach ($all_cats as $cat) {
|
1736 |
+
$count[$cat->cat_name] = $wpdb->get_var("SELECT COUNT(meta_value) FROM $wpdb->usermeta WHERE meta_key='s2_cat$cat->cat_ID'");
|
1737 |
+
}
|
1738 |
+
|
1739 |
+
// do have actually have some subscribers?
|
1740 |
+
if ( (0 == $count['confirmed']) && (0 == $count['unconfirmed']) && (0 == $count['registered']) ) {
|
1741 |
+
// no? bail out
|
1742 |
+
return;
|
1743 |
+
}
|
1744 |
+
|
1745 |
+
if (false !== $submit) {
|
1746 |
+
echo "<form method=\"post\" action=\"\">";
|
1747 |
+
}
|
1748 |
+
echo "<select name=\"what\">\r\n";
|
1749 |
+
foreach ($who as $whom => $display) {
|
1750 |
+
if (in_array($whom, $exclude)) { continue; }
|
1751 |
+
if (0 == $count[$whom]) { continue; }
|
1752 |
+
|
1753 |
+
echo "<option value=\"" . $whom . "\"";
|
1754 |
+
if ($whom == $selected) { echo " selected=\"selected\" "; }
|
1755 |
+
echo ">$display (" . ($count[$whom]) . ")</option>\r\n";
|
1756 |
+
}
|
1757 |
+
|
1758 |
+
if ($count['registered'] > 0) {
|
1759 |
+
foreach ($all_cats as $cat) {
|
1760 |
+
if (in_array($cat->cat_ID, $exclude)) { continue; }
|
1761 |
+
echo "<option value=\"" . $cat->cat_ID . "\"";
|
1762 |
+
if ($cat->cat_ID == $selected) { echo " selected=\"selected\" "; }
|
1763 |
+
echo "> " . $cat->cat_name . " (" . $count[$cat->cat_name] . ") </option>\r\n";
|
1764 |
+
}
|
1765 |
+
}
|
1766 |
+
echo "</select>";
|
1767 |
+
if (false !== $submit) {
|
1768 |
+
echo "<span class=\"submit\"><input type=\"submit\" value=\"$submit\" /></span></form>\r\n";
|
1769 |
+
}
|
1770 |
+
} // end display_subscriber_dropdown()
|
1771 |
+
|
1772 |
+
function display_digest_choices() {
|
1773 |
+
global $wpdb;
|
1774 |
+
$schedule = (array)wp_get_schedules();
|
1775 |
+
$schedule = array_merge(array('never' => array('interval' => 0, 'display' => __('Per Post Email','subscribe2'))), $schedule);
|
1776 |
+
$sort = array();
|
1777 |
+
foreach ( (array)$schedule as $key => $value ) $sort[$key] = $value['interval'];
|
1778 |
+
asort($sort);
|
1779 |
+
$schedule_sorted = array();
|
1780 |
+
foreach ($sort as $key => $value) {
|
1781 |
+
$schedule_sorted[$key] = $schedule[$key];
|
1782 |
+
}
|
1783 |
+
foreach ($schedule_sorted as $key => $value) {
|
1784 |
+
echo "<input type=\"radio\" name=\"email_freq\" value=\"" . $key . "\"";
|
1785 |
+
if ($key == $this->subscribe2_options['email_freq']) {
|
1786 |
+
echo " checked=\"checked\" ";
|
1787 |
+
}
|
1788 |
+
echo " /> " . $value['display'] . "<br />\r\n";
|
1789 |
+
}
|
1790 |
+
if (wp_next_scheduled('s2_digest_cron')) {
|
1791 |
+
$datetime = get_option('date_format') . ' @ ' . get_option('time_format');
|
1792 |
+
$now = time();
|
1793 |
+
echo "<p>" . __('Current server time is', 'subscribe2') . ": \r\n";
|
1794 |
+
echo "<strong>" . gmdate($datetime, $now+ (get_option('gmt_offset') * 3600)) . "</strong></p>\r\n";
|
1795 |
+
echo "<p>" . __('Next email notification will be sent', 'subscribe2') . ": \r\n";
|
1796 |
+
echo "<strong>" . gmdate($datetime, wp_next_scheduled('s2_digest_cron') + (get_option('gmt_offset') * 3600)) . "</strong></p>\r\n";
|
1797 |
+
}
|
1798 |
+
} // end display_digest_choices()
|
1799 |
+
|
1800 |
+
/**
|
1801 |
+
Adds information to the WordPress registration screen for new users
|
1802 |
+
*/
|
1803 |
+
function register_form() {
|
1804 |
+
if ('wpreg' == $this->subscribe2_options['autosub']) {
|
1805 |
+
echo "<p>\r\n<label>";
|
1806 |
+
echo __('Check here to Subscribe to email notifications for new posts') . ":<br />\r\n";
|
1807 |
+
echo "<input type=\"checkbox\" name=\"subscribe\" /></label>\r\n";
|
1808 |
+
echo "</p>\r\n";
|
1809 |
+
} elseif ('yes' == $this->subscribe2_options['autosub']) {
|
1810 |
+
echo "<p>\r\n<center>\r\n";
|
1811 |
+
echo __('By Registering with this blog you are also agreeing to recieve email notifications for new posts') . "<br />\r\n";
|
1812 |
+
echo "</center></p>\r\n";
|
1813 |
+
}
|
1814 |
+
}
|
1815 |
+
|
1816 |
+
/**
|
1817 |
+
Process function to add action if user selects to subscribe to posts during registration
|
1818 |
+
*/
|
1819 |
+
function register_post() {
|
1820 |
+
if ('on' == $_POST['subscribe']) {
|
1821 |
+
add_action('user_register', array(&$this, 'register_action'));
|
1822 |
+
}
|
1823 |
+
}
|
1824 |
+
|
1825 |
+
/**
|
1826 |
+
Action to process Subscribe2 registration from WordPress registration
|
1827 |
+
*/
|
1828 |
+
function register_action($user_id = 0) {
|
1829 |
+
if (0 == $user_id) { return $user_id; }
|
1830 |
+
$this->register($user_id, 1);
|
1831 |
+
}
|
1832 |
+
|
1833 |
+
/* ===== template and filter functions ===== */
|
1834 |
+
/**
|
1835 |
+
Display our form; also handles (un)subscribe requests
|
1836 |
+
*/
|
1837 |
+
function filter($content = '') {
|
1838 |
+
if ( ('' == $content) || (! preg_match('|<!--subscribe2-->|', $content)) ) { return $content; }
|
1839 |
+
$this->s2form = $this->form;
|
1840 |
+
|
1841 |
+
global $user_ID;
|
1842 |
+
get_currentuserinfo();
|
1843 |
+
if ($user_ID) {
|
1844 |
+
if (current_user_can('manage_options')) {
|
1845 |
+
$this->s2form = $this->use_profile_admin;
|
1846 |
+
} else {
|
1847 |
+
$this->s2form = $this->use_profile_users;
|
1848 |
+
}
|
1849 |
+
}
|
1850 |
+
if (isset($_POST['s2_action'])) {
|
1851 |
+
global $wpdb, $user_email;
|
1852 |
+
if (!is_email($_POST['email'])) {
|
1853 |
+
$this->s2form = $this->form . $this->not_an_email;
|
1854 |
+
} elseif ($this->is_barred($_POST['email'])) {
|
1855 |
+
$this->s2form = $this->form . $this->barred_domain;
|
1856 |
+
} else {
|
1857 |
+
$this->email = $_POST['email'];
|
1858 |
+
// does the supplied email belong to a registered user?
|
1859 |
+
$check = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE user_email = '$this->email'");
|
1860 |
+
if ('' != $check) {
|
1861 |
+
// this is a registered email
|
1862 |
+
$this->s2form = $this->please_log_in;
|
1863 |
+
} else {
|
1864 |
+
// this is not a registered email
|
1865 |
+
// what should we do?
|
1866 |
+
if ('subscribe' == $_POST['s2_action']) {
|
1867 |
+
// someone is trying to subscribe
|
1868 |
+
// lets see if they've tried to subscribe previously
|
1869 |
+
if ('1' !== $this->is_public($this->email)) {
|
1870 |
+
// the user is unknown or inactive
|
1871 |
+
$this->add();
|
1872 |
+
$this->send_confirm('add');
|
1873 |
+
// set a variable to denote that we've already run, and shouldn't run again
|
1874 |
+
$this->filtered = 1; //set this to not send duplicate emails
|
1875 |
+
$this->s2form = $this->confirmation_sent;
|
1876 |
+
} else {
|
1877 |
+
// they're already subscribed
|
1878 |
+
$this->s2form = $this->already_subscribed;
|
1879 |
+
}
|
1880 |
+
$this->action = 'subscribe';
|
1881 |
+
} elseif ('unsubscribe' == $_POST['s2_action']) {
|
1882 |
+
// is this email a subscriber?
|
1883 |
+
if (false == $this->is_public($this->email)) {
|
1884 |
+
$this->s2form = $this->form . $this->not_subscribed;
|
1885 |
+
} else {
|
1886 |
+
$this->send_confirm('del');
|
1887 |
+
// set a variable to denote that we've already run, and shouldn't run again
|
1888 |
+
$this->filtered = 1;
|
1889 |
+
$this->s2form = $this->confirmation_sent;
|
1890 |
+
}
|
1891 |
+
$this->action='unsubscribe';
|
1892 |
+
}
|
1893 |
+
}
|
1894 |
+
}
|
1895 |
+
}
|
1896 |
+
return preg_replace('|(<p>)(\n)*<!--subscribe2-->(\n)*(</p>)|', $this->s2form, $content);
|
1897 |
+
} // end filter()
|
1898 |
+
|
1899 |
+
/**
|
1900 |
+
Overrides the default query when handling a (un)subscription confirmation
|
1901 |
+
This is basically a trick: if the s2 variable is in the query string, just grab the first
|
1902 |
+
static page and override it's contents later with title_filter()
|
1903 |
+
*/
|
1904 |
+
function query_filter() {
|
1905 |
+
// don't interfere if we've already done our thing
|
1906 |
+
if (1 == $this->filtered) { return; }
|
1907 |
+
|
1908 |
+
global $wpdb;
|
1909 |
+
|
1910 |
+
if ( (defined('S2PAGE')) && (0 != S2PAGE) ) {
|
1911 |
+
return "page_id=" . S2PAGE;
|
1912 |
+
} else {
|
1913 |
+
$id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type='page' LIMIT 1");
|
1914 |
+
if ($id) {
|
1915 |
+
return "page_id=$id";
|
1916 |
+
} else {
|
1917 |
+
return "showposts=1";
|
1918 |
+
}
|
1919 |
+
}
|
1920 |
+
} // end query_filter()
|
1921 |
+
|
1922 |
+
/**
|
1923 |
+
Overrides the page title
|
1924 |
+
*/
|
1925 |
+
function title_filter() {
|
1926 |
+
// don't interfere if we've already done our thing
|
1927 |
+
if (1 == $this->filtered) { return; }
|
1928 |
+
return __('Subscription Confirmation', 'subscribe2');
|
1929 |
+
} // end title_filter()
|
1930 |
+
|
1931 |
+
/* ===== wp-cron functions ===== */
|
1932 |
+
/**
|
1933 |
+
Send a daily digest of today's new posts
|
1934 |
+
*/
|
1935 |
+
function subscribe2_cron() {
|
1936 |
+
global $wpdb;
|
1937 |
+
|
1938 |
+
// collect posts
|
1939 |
+
$now = date('Y-m-d H:i:s', time());
|
1940 |
+
$prev = $this->subscribe2_options['last_s2cron'];
|
1941 |
+
$posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content FROM $wpdb->posts WHERE post_date >= '$prev' AND post_date < '$now' AND post_status='publish' AND post_type='post'");
|
1942 |
+
|
1943 |
+
// update last_s2cron execution time before completing or bailing
|
1944 |
+
$this->subscribe2_options['last_s2cron'] = $now;
|
1945 |
+
update_option('subscribe2_options', $this->subscribe2_options);
|
1946 |
+
|
1947 |
+
// do we have any posts?
|
1948 |
+
if (empty($posts)) { return; }
|
1949 |
+
|
1950 |
+
// if we have posts, let's prepare the digest
|
1951 |
+
foreach ($posts as $post) {
|
1952 |
+
$post_cats = wp_get_post_cats('1', $post->ID);
|
1953 |
+
$post_cats_string = implode(',', $post_cats);
|
1954 |
+
$check = false;
|
1955 |
+
// is the current post assigned to any categories
|
1956 |
+
// which should not generate a notification email?
|
1957 |
+
foreach (explode(',', $this->subscribe2_options['exclude']) as $cat) {
|
1958 |
+
if (in_array($cat, $post_cats)) {
|
1959 |
+
$check = true;
|
1960 |
+
}
|
1961 |
+
}
|
1962 |
+
// if this post is in an excluded category,
|
1963 |
+
// don't include it in the digest
|
1964 |
+
if ($check) {
|
1965 |
+
continue;
|
1966 |
+
}
|
1967 |
+
$message .= $post->post_title . "\r\n";
|
1968 |
+
$message .= get_permalink($post->ID) . "\r\n";
|
1969 |
+
$excerpt = $post->post_excerpt;
|
1970 |
+
if ('' == $excerpt) {
|
1971 |
+
// no excerpt, is there a <!--more--> ?
|
1972 |
+
if (false !== strpos($post->post_content, '<!--more-->')) {
|
1973 |
+
list($excerpt, $more) = explode('<!--more-->', $plaintext, 2);
|
1974 |
+
// strip leading and trailing whitespace
|
1975 |
+
$excerpt = trim($excerpt);
|
1976 |
+
} else {
|
1977 |
+
$excerpt = strip_tags($post->post_content);
|
1978 |
+
$words = explode(' ', $excerpt, 56);
|
1979 |
+
if (count($words) > 55) {
|
1980 |
+
array_pop($words);
|
1981 |
+
array_push($words, '[...]');
|
1982 |
+
$excerpt = implode(' ', $words);
|
1983 |
+
}
|
1984 |
+
}
|
1985 |
+
}
|
1986 |
+
$message .= $excerpt . "\r\n\r\n";
|
1987 |
+
}
|
1988 |
+
|
1989 |
+
$author = get_userdata($post->post_author);
|
1990 |
+
$this->authorname = $author->display_name;
|
1991 |
+
|
1992 |
+
// do we send as admin, or post author?
|
1993 |
+
if ('author' == $this->subscribe2_options['sender']) {
|
1994 |
+
// get author details
|
1995 |
+
$user =& $author;
|
1996 |
+
} else {
|
1997 |
+
// get admin detailts
|
1998 |
+
$user = get_userdata(1);
|
1999 |
+
}
|
2000 |
+
$this->myemail = $user->user_email;
|
2001 |
+
$this->myname = $user->display_name;
|
2002 |
+
|
2003 |
+
$scheds = (array) wp_get_schedules();
|
2004 |
+
$email_freq = $this->subscribe2_options['email_freq'];
|
2005 |
+
$display = $scheds[$email_freq]['display'];
|
2006 |
+
$subject = '[' . stripslashes(get_settings('blogname')) . '] ' . $display . ' ' . __('Digest Email', 'subscribe2');
|
2007 |
+
$public = $this->get_public();
|
2008 |
+
$registered = $this->get_registered();
|
2009 |
+
$recipients = array_merge((array)$public, (array)$registered);
|
2010 |
+
$mailtext = $this->substitute(stripslashes($this->subscribe2_options['mailtext']));
|
2011 |
+
$body = str_replace('POST', $message, $mailtext);
|
2012 |
+
$this->mail($recipients, $subject, $body);
|
2013 |
+
} // end subscribe2_cron
|
2014 |
+
|
2015 |
+
/* ===== Our constructor ===== */
|
2016 |
+
/**
|
2017 |
+
Subscribe2 constructor
|
2018 |
+
*/
|
2019 |
+
function s2init() {
|
2020 |
+
// load the options
|
2021 |
+
$this->subscribe2_options = array();
|
2022 |
+
$this->subscribe2_options = get_option('subscribe2_options');
|
2023 |
+
|
2024 |
+
add_action('init', array(&$this, 'subscribe2'));
|
2025 |
+
if('1' == $this->subscribe2_options['show_button']) {
|
2026 |
+
add_action('init', array(&$this, 'button_init'));
|
2027 |
+
}
|
2028 |
+
}
|
2029 |
+
|
2030 |
+
function subscribe2() {
|
2031 |
+
global $table_prefix;
|
2032 |
+
|
2033 |
+
load_plugin_textdomain('subscribe2', 'wp-content/plugins/subscribe2');
|
2034 |
+
|
2035 |
+
// do we need to install anything?
|
2036 |
+
$this->public = $table_prefix . "subscribe2";
|
2037 |
+
if(!mysql_query("DESCRIBE " . $this->public)==FALSE) { $this->install(); }
|
2038 |
+
//do we need to upgrade anything?
|
2039 |
+
if ($this->subscribe2_options['version'] !== S2VERSION) {
|
2040 |
+
add_action('shutdown', array(&$this, 'upgrade'));
|
2041 |
+
}
|
2042 |
+
|
2043 |
+
if (isset($_GET['s2'])) {
|
2044 |
+
// someone is confirming a request
|
2045 |
+
add_filter('query_string', array(&$this, 'query_filter'));
|
2046 |
+
add_filter('the_title', array(&$this, 'title_filter'));
|
2047 |
+
add_filter('the_content', array(&$this, 'confirm'));
|
2048 |
+
}
|
2049 |
+
|
2050 |
+
//add regular actions and filters
|
2051 |
+
add_action('admin_head', array(&$this, 'admin_head'));
|
2052 |
+
add_action('admin_menu', array(&$this, 'admin_menu'));
|
2053 |
+
add_action('create_category', array(&$this, 'autosub_new_category'));
|
2054 |
+
add_action('register_form', array(&$this, 'register_form'));
|
2055 |
+
add_filter('the_content', array(&$this, 'filter'));
|
2056 |
+
add_filter('cron_schedules', array(&$this, 'add_weekly_sched'));
|
2057 |
+
|
2058 |
+
// add action to display editor buttons if option is enabled
|
2059 |
+
if ('1' == $this->subscribe2_options['show_button']) {
|
2060 |
+
add_action('edit_page_form', array(&$this, 's2_edit_form'));
|
2061 |
+
add_action('edit_form_advanced', array(&$this, 's2_edit_form'));
|
2062 |
+
}
|
2063 |
+
|
2064 |
+
// add action for automatic subscription based on option settings
|
2065 |
+
if ('yes' == $this->subscribe2_options['autosub']) {
|
2066 |
+
add_action('user_register', array(&$this, 'register'));
|
2067 |
+
} elseif ('wpreg' == $this->subscribe2_options['autosub']) {
|
2068 |
+
add_action('register_post', array(&$this, 'register_post'));
|
2069 |
+
}
|
2070 |
+
|
2071 |
+
// add actions for processing posts based on per-post or cron email settings
|
2072 |
+
if ($this->subscribe2_options['email_freq'] != 'never') {
|
2073 |
+
add_action('s2_digest_cron', array(&$this, 'subscribe2_cron'));
|
2074 |
+
} else {
|
2075 |
+
add_action('publish_post', array(&$this, 'publish'));
|
2076 |
+
add_action('edit_post', array(&$this, 'edit'));
|
2077 |
+
add_action('private_to_published', array(&$this, 'private2publish'));
|
2078 |
+
}
|
2079 |
+
|
2080 |
+
// add action to email notification about pages if option is enabled
|
2081 |
+
if ($this->subscribe2_options['pages'] == 'yes') {
|
2082 |
+
add_action('publish_page', array(&$this, 'publish'));
|
2083 |
+
}
|
2084 |
+
|
2085 |
+
// load our strings
|
2086 |
+
$this->load_strings();
|
2087 |
+
} // end subscribe2()
|
2088 |
+
|
2089 |
+
/* ===== ButtonSnap configuration ===== */
|
2090 |
+
/**
|
2091 |
+
Register our button in the QuickTags bar
|
2092 |
+
*/
|
2093 |
+
function button_init() {
|
2094 |
+
if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) return;
|
2095 |
+
if ( 'true' == get_user_option('rich_editing') ) {
|
2096 |
+
// Load and append our TinyMCE external plugin
|
2097 |
+
add_filter('mce_plugins', array(&$this, 'mce_plugins'));
|
2098 |
+
add_filter('mce_buttons', array(&$this, 'mce_buttons'));
|
2099 |
+
add_action('tinymce_before_init', array(&$this, 'tinymce_before_init'));
|
2100 |
+
add_action('marker_css', array(&$this, 'button_css'));
|
2101 |
+
} else {
|
2102 |
+
buttonsnap_separator();
|
2103 |
+
buttonsnap_jsbutton(get_settings('siteurl') . '/wp-content/plugins/subscribe2/s2_button.png', __('Subscribe2', 'subscribe2'), 's2_insert_token();');
|
2104 |
+
}
|
2105 |
+
}
|
2106 |
+
|
2107 |
+
/**
|
2108 |
+
Style a marker in the Rich Text Editor for our tag
|
2109 |
+
By default, the RTE suppresses output of HTML comments, so this
|
2110 |
+
places a CSS style on our token in order to make it display
|
2111 |
+
*/
|
2112 |
+
function button_css() {
|
2113 |
+
$marker_url = get_settings('siteurl') . '/wp-content/plugins/subscribe2/s2_marker.png';
|
2114 |
+
echo "
|
2115 |
+
.s2_marker {
|
2116 |
+
display: block;
|
2117 |
+
height: 45px;
|
2118 |
+
margin-top: 5px;
|
2119 |
+
background-image: url({$marker_url});
|
2120 |
+
background-repeat: no-repeat;
|
2121 |
+
background-position: center;
|
2122 |
+
}
|
2123 |
+
";
|
2124 |
+
}
|
2125 |
+
|
2126 |
+
// Add buttons in WordPress v2.1+, thanks to An-archos
|
2127 |
+
function mce_plugins($plugins) {
|
2128 |
+
array_push($plugins, '-subscribe2quicktags');
|
2129 |
+
return $plugins;
|
2130 |
+
}
|
2131 |
+
|
2132 |
+
function mce_buttons($buttons) {
|
2133 |
+
array_push($buttons, 'separator');
|
2134 |
+
array_push($buttons, 'subscribe2quicktags');
|
2135 |
+
return $buttons;
|
2136 |
+
}
|
2137 |
+
|
2138 |
+
function tinymce_before_init() {
|
2139 |
+
$this->fullpath = get_settings('siteurl') . '/wp-content/plugins/subscribe2/tinymce/';
|
2140 |
+
echo "tinyMCE.loadPlugin('subscribe2quicktags', '" . $this->fullpath . "');\n";
|
2141 |
+
}
|
2142 |
+
|
2143 |
+
function s2_edit_form() {
|
2144 |
+
echo "<!-- Start Subscribe2 Quicktags Javascript -->\r\n";
|
2145 |
+
echo "<script type=\"text/javascript\">\r\n";
|
2146 |
+
echo "//<![CDATA[\r\n";
|
2147 |
+
echo "function s2_insert_token() {
|
2148 |
+
buttonsnap_settext('<!--subscribe2-->');
|
2149 |
+
}\r\n";
|
2150 |
+
echo "//]]>\r\n";
|
2151 |
+
echo "</script>\r\n";
|
2152 |
+
echo "<!-- End Subscribe2 Quicktags Javascript -->\r\n";
|
2153 |
+
}
|
2154 |
+
|
2155 |
+
/* ===== our variables ===== */
|
2156 |
+
// cache variables
|
2157 |
+
var $version = '';
|
2158 |
+
var $all_public = '';
|
2159 |
+
var $all_unconfirmed = '';
|
2160 |
+
var $excluded_cats = '';
|
2161 |
+
var $post_title = '';
|
2162 |
+
var $permalink = '';
|
2163 |
+
var $myname = '';
|
2164 |
+
var $myemail = '';
|
2165 |
+
var $s2_subject = '[BLOGNAME] TITLE';
|
2166 |
+
var $signup_dates = array();
|
2167 |
+
var $private = false;
|
2168 |
+
var $filtered = 0;
|
2169 |
+
|
2170 |
+
// state variables used to affect processing
|
2171 |
+
var $action = '';
|
2172 |
+
var $email = '';
|
2173 |
+
var $message = '';
|
2174 |
+
var $error = '';
|
2175 |
+
|
2176 |
+
// some messages
|
2177 |
+
var $please_log_in = '';
|
2178 |
+
var $use_profile = '';
|
2179 |
+
var $confirmation_sent = '';
|
2180 |
+
var $already_subscribed = '';
|
2181 |
+
var $not_subscribed ='';
|
2182 |
+
var $not_an_email = '';
|
2183 |
+
var $barred_domain = '';
|
2184 |
+
var $mail_sent = '';
|
2185 |
+
var $form = '';
|
2186 |
+
var $no_such_email = '';
|
2187 |
+
var $added = '';
|
2188 |
+
var $deleted = '';
|
2189 |
+
var $confirm_subject = '';
|
2190 |
+
var $options_saved = '';
|
2191 |
+
var $options_reset = '';
|
2192 |
+
} // end class subscribe2
|
2193 |
?>
|
subscribe2/subscribe2.pot
CHANGED
@@ -8,7 +8,7 @@ msgid ""
|
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
-
"POT-Creation-Date: 2007-
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -16,449 +16,479 @@ msgstr ""
|
|
16 |
"Content-Type: text/plain; charset=CHARSET\n"
|
17 |
"Content-Transfer-Encoding: 8bit\n"
|
18 |
|
19 |
-
#: subscribe2.php:
|
20 |
msgid "To manage your subscription options please "
|
21 |
msgstr ""
|
22 |
|
23 |
-
#: subscribe2.php:
|
24 |
msgid "You may manage your subscription options from your "
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: subscribe2.php:
|
28 |
msgid "A confirmation message is on its way!"
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: subscribe2.php:
|
32 |
msgid "That email address is already subscribed."
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: subscribe2.php:
|
36 |
msgid "That email address is not subscribed."
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: subscribe2.php:
|
40 |
msgid "Sorry, but that does not look like an email address to me."
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: subscribe2.php:
|
44 |
msgid ""
|
45 |
"Sorry, email addresses at that domain are currently barred due to spam, "
|
46 |
"please use an alternative email address."
|
47 |
msgstr ""
|
48 |
|
49 |
-
#: subscribe2.php:
|
50 |
msgid "Message sent!"
|
51 |
msgstr ""
|
52 |
|
53 |
-
#: subscribe2.php:
|
54 |
msgid "Your email:"
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: subscribe2.php:
|
58 |
msgid "Subscribe"
|
59 |
msgstr ""
|
60 |
|
61 |
-
#: subscribe2.php:
|
62 |
msgid "Unsubscribe"
|
63 |
msgstr ""
|
64 |
|
65 |
-
#: subscribe2.php:
|
66 |
msgid "Send"
|
67 |
msgstr ""
|
68 |
|
69 |
-
#: subscribe2.php:
|
70 |
msgid "No such email address is registered."
|
71 |
msgstr ""
|
72 |
|
73 |
-
#: subscribe2.php:
|
74 |
msgid "You have successfully subscribed!"
|
75 |
msgstr ""
|
76 |
|
77 |
-
#: subscribe2.php:
|
78 |
msgid "You have successfully unsubscribed."
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: subscribe2.php:
|
82 |
msgid "Please confirm your request"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: subscribe2.php:
|
86 |
msgid "Subscription Reminder"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: subscribe2.php:
|
90 |
msgid "subscribe"
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: subscribe2.php:
|
94 |
msgid "unsubscribe"
|
95 |
msgstr ""
|
96 |
|
97 |
-
#: subscribe2.php:
|
98 |
msgid "Options saved!"
|
99 |
msgstr ""
|
100 |
|
101 |
-
#: subscribe2.php:
|
102 |
msgid "Options reset!"
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: subscribe2.php:
|
106 |
msgid "Subscribers"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: subscribe2.php:
|
110 |
msgid "Subscribe2 Options"
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: subscribe2.php:
|
114 |
msgid "Subscribe2"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: subscribe2.php:
|
118 |
msgid "Subscriptions"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: subscribe2.php:
|
122 |
msgid "Mail Subscribers"
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: subscribe2.php:
|
126 |
msgid "Once Weekly"
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: subscribe2.php:
|
130 |
msgid "New subscriber"
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: subscribe2.php:
|
134 |
msgid "subscribed to email notifications!"
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: subscribe2.php:
|
138 |
msgid "Address(es) subscribed!"
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: subscribe2.php:
|
142 |
msgid "deleted!"
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: subscribe2.php:
|
146 |
msgid "status changed!"
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: subscribe2.php:
|
150 |
msgid "Reminder Email(s) Sent!"
|
151 |
msgstr ""
|
152 |
|
153 |
-
#: subscribe2.php:
|
154 |
msgid "CSV File Created in wp-content"
|
155 |
msgstr ""
|
156 |
|
157 |
-
#: subscribe2.php:
|
158 |
msgid "Registered Users Subscribed!"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: subscribe2.php:
|
162 |
msgid "Registered Users Unsubscribed!"
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: subscribe2.php:
|
166 |
msgid "Subscribe Addresses"
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: subscribe2.php:
|
170 |
msgid "Enter addresses, one per line or comma-seperated"
|
171 |
msgstr ""
|
172 |
|
173 |
-
#: subscribe2.php:
|
174 |
msgid "Filter"
|
175 |
msgstr ""
|
176 |
|
177 |
-
#: subscribe2.php:
|
178 |
msgid ""
|
179 |
"Registered on the left, confirmed in the middle, unconfirmed on the right"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: subscribe2.php:
|
183 |
msgid "Save Emails to CSV File"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: subscribe2.php:
|
187 |
msgid "NONE"
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: subscribe2.php:
|
191 |
msgid "Send Reminder Email"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: subscribe2.php:
|
195 |
msgid "Categories"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: subscribe2.php:
|
199 |
msgid ""
|
200 |
"Existing Registered Users can be automatically (un)subscribed to categories "
|
201 |
"using this section."
|
202 |
msgstr ""
|
203 |
|
204 |
-
#: subscribe2.php:
|
205 |
msgid "Consider User Privacy as changes cannot be undone"
|
206 |
msgstr ""
|
207 |
|
208 |
-
#: subscribe2.php:
|
209 |
msgid "Delivery Options"
|
210 |
msgstr ""
|
211 |
|
212 |
-
#: subscribe2.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
msgid "Send Email From"
|
214 |
msgstr ""
|
215 |
|
216 |
-
#: subscribe2.php:
|
217 |
msgid "Author of the post"
|
218 |
msgstr ""
|
219 |
|
220 |
-
#: subscribe2.php:
|
221 |
msgid "Blog Admin"
|
222 |
msgstr ""
|
223 |
|
224 |
-
#: subscribe2.php:
|
225 |
msgid "Send Email as Digest"
|
226 |
msgstr ""
|
227 |
|
228 |
-
#: subscribe2.php:
|
229 |
msgid "Email Templates"
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: subscribe2.php:
|
233 |
msgid "New Post email (must not be empty)"
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: subscribe2.php:
|
237 |
msgid "Message substitions"
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: subscribe2.php:
|
241 |
msgid "the post's title"
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: subscribe2.php:
|
245 |
msgid ""
|
246 |
"the excerpt or the entire post<br />(<i>based on the subscriber's "
|
247 |
"preferences</i>)"
|
248 |
msgstr ""
|
249 |
|
250 |
-
#: subscribe2.php:
|
251 |
msgid "the post's permalink"
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: subscribe2.php:
|
255 |
msgid "the admin or post author's name"
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: subscribe2.php:
|
259 |
msgid "the admin or post author's email"
|
260 |
msgstr ""
|
261 |
|
262 |
-
#: subscribe2.php:
|
263 |
msgid "the post author's name"
|
264 |
msgstr ""
|
265 |
|
266 |
-
#: subscribe2.php:
|
267 |
msgid ""
|
268 |
"the generated link to confirm a request<br />(<i>only used in the "
|
269 |
"confirmation email template</i>)"
|
270 |
msgstr ""
|
271 |
|
272 |
-
#: subscribe2.php:
|
273 |
msgid ""
|
274 |
"Action performed by LINK in confirmation email<br />(<i>only used in the "
|
275 |
"confirmation email template</i>)"
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: subscribe2.php:
|
279 |
msgid "Subscribe / Unsubscribe confirmation email"
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: subscribe2.php:
|
283 |
msgid "Reminder email to Unconfirmed Subscribers"
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: subscribe2.php:
|
287 |
msgid "Excluded Categories"
|
288 |
msgstr ""
|
289 |
|
290 |
-
#: subscribe2.php:
|
291 |
msgid "Allow registered users to subscribe to excluded categories?"
|
292 |
msgstr ""
|
293 |
|
294 |
-
#: subscribe2.php:
|
295 |
msgid "Writing Options"
|
296 |
msgstr ""
|
297 |
|
298 |
-
#: subscribe2.php:
|
299 |
msgid "Show the Subscribe2 button on the Write toolbar?"
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: subscribe2.php:
|
303 |
msgid "Auto Subscribe"
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: subscribe2.php:
|
307 |
-
msgid "
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: subscribe2.php:
|
311 |
-
msgid "
|
312 |
msgstr ""
|
313 |
|
314 |
-
#: subscribe2.php:
|
315 |
-
msgid "
|
316 |
msgstr ""
|
317 |
|
318 |
-
#: subscribe2.php:
|
319 |
msgid "Auto-subscribe users to receive email as"
|
320 |
msgstr ""
|
321 |
|
322 |
-
#: subscribe2.php:
|
323 |
msgid "HTML"
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: subscribe2.php:
|
327 |
msgid "Plain Text - Full"
|
328 |
msgstr ""
|
329 |
|
330 |
-
#: subscribe2.php:
|
331 |
msgid "Plain Text - Excerpt"
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: subscribe2.php:
|
335 |
msgid "Barred Domains"
|
336 |
msgstr ""
|
337 |
|
338 |
-
#: subscribe2.php:
|
339 |
msgid ""
|
340 |
"Enter domains to bar from public subscriptions: <br /> (Use a new line for "
|
341 |
"each entry and omit the \"@\" symbol, for example email.com)"
|
342 |
msgstr ""
|
343 |
|
344 |
-
#: subscribe2.php:
|
345 |
msgid "Submit"
|
346 |
msgstr ""
|
347 |
|
348 |
-
#: subscribe2.php:
|
349 |
msgid "Reset Default"
|
350 |
msgstr ""
|
351 |
|
352 |
-
#: subscribe2.php:
|
353 |
msgid ""
|
354 |
"Use this to reset all options to their defaults. This <strong><em>will not</"
|
355 |
"em></strong> modify your list of subscribers."
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: subscribe2.php:
|
359 |
msgid "RESET"
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: subscribe2.php:
|
363 |
msgid "Subscription preferences updated."
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: subscribe2.php:
|
367 |
msgid "Notification Settings"
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: subscribe2.php:
|
371 |
msgid "Receive email as"
|
372 |
msgstr ""
|
373 |
|
374 |
-
#: subscribe2.php:
|
375 |
msgid "Plain Text"
|
376 |
msgstr ""
|
377 |
|
378 |
-
#: subscribe2.php:
|
379 |
msgid "Email contains"
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: subscribe2.php:
|
383 |
msgid "Excerpt Only"
|
384 |
msgstr ""
|
385 |
|
386 |
-
#: subscribe2.php:
|
387 |
msgid "Full Post"
|
388 |
msgstr ""
|
389 |
|
390 |
-
#: subscribe2.php:
|
391 |
msgid "Note: HTML format will always deliver the full post."
|
392 |
msgstr ""
|
393 |
|
394 |
-
#: subscribe2.php:
|
395 |
msgid "Automatically subscribe me to newly created categories"
|
396 |
msgstr ""
|
397 |
|
398 |
-
#: subscribe2.php:
|
399 |
msgid "Subscribed Categories"
|
400 |
msgstr ""
|
401 |
|
402 |
-
#: subscribe2.php:
|
403 |
msgid "Receive daily summary of new posts?"
|
404 |
msgstr ""
|
405 |
|
406 |
-
#: subscribe2.php:
|
407 |
msgid "Update Preferences »"
|
408 |
msgstr ""
|
409 |
|
410 |
-
#: subscribe2.php:
|
411 |
msgid "Send email to all subscribers"
|
412 |
msgstr ""
|
413 |
|
414 |
-
#: subscribe2.php:
|
415 |
msgid "Subject"
|
416 |
msgstr ""
|
417 |
|
418 |
-
#: subscribe2.php:
|
419 |
msgid "A message from "
|
420 |
msgstr ""
|
421 |
|
422 |
-
#: subscribe2.php:
|
423 |
msgid "Recipients: "
|
424 |
msgstr ""
|
425 |
|
426 |
-
#: subscribe2.php:
|
427 |
msgid "Select / Unselect All"
|
428 |
msgstr ""
|
429 |
|
430 |
-
#: subscribe2.php:
|
431 |
msgid "All Subscribers"
|
432 |
msgstr ""
|
433 |
|
434 |
-
#: subscribe2.php:
|
435 |
msgid "Public Subscribers"
|
436 |
msgstr ""
|
437 |
|
438 |
-
#: subscribe2.php:
|
439 |
msgid "Confirmed"
|
440 |
msgstr ""
|
441 |
|
442 |
-
#: subscribe2.php:
|
443 |
msgid "Unconfirmed"
|
444 |
msgstr ""
|
445 |
|
446 |
-
#: subscribe2.php:
|
447 |
msgid "Registered Subscribers"
|
448 |
msgstr ""
|
449 |
|
450 |
-
#: subscribe2.php:
|
451 |
msgid "Per Post Email"
|
452 |
msgstr ""
|
453 |
|
454 |
-
#: subscribe2.php:
|
|
|
|
|
|
|
|
|
455 |
msgid "Next email notification will be sent"
|
456 |
msgstr ""
|
457 |
|
458 |
-
#: subscribe2.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
459 |
msgid "Subscription Confirmation"
|
460 |
msgstr ""
|
461 |
|
462 |
-
#: subscribe2.php:
|
463 |
msgid "Digest Email"
|
464 |
msgstr ""
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
+
"POT-Creation-Date: 2007-05-18 22:36+0100\n"
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
16 |
"Content-Type: text/plain; charset=CHARSET\n"
|
17 |
"Content-Transfer-Encoding: 8bit\n"
|
18 |
|
19 |
+
#: subscribe2.php:62
|
20 |
msgid "To manage your subscription options please "
|
21 |
msgstr ""
|
22 |
|
23 |
+
#: subscribe2.php:64 subscribe2.php:66
|
24 |
msgid "You may manage your subscription options from your "
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: subscribe2.php:68
|
28 |
msgid "A confirmation message is on its way!"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: subscribe2.php:70
|
32 |
msgid "That email address is already subscribed."
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: subscribe2.php:72
|
36 |
msgid "That email address is not subscribed."
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: subscribe2.php:74
|
40 |
msgid "Sorry, but that does not look like an email address to me."
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: subscribe2.php:76
|
44 |
msgid ""
|
45 |
"Sorry, email addresses at that domain are currently barred due to spam, "
|
46 |
"please use an alternative email address."
|
47 |
msgstr ""
|
48 |
|
49 |
+
#: subscribe2.php:78
|
50 |
msgid "Message sent!"
|
51 |
msgstr ""
|
52 |
|
53 |
+
#: subscribe2.php:80
|
54 |
msgid "Your email:"
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: subscribe2.php:80 subscribe2.php:1135 subscribe2.php:1227
|
58 |
msgid "Subscribe"
|
59 |
msgstr ""
|
60 |
|
61 |
+
#: subscribe2.php:80 subscribe2.php:1228
|
62 |
msgid "Unsubscribe"
|
63 |
msgstr ""
|
64 |
|
65 |
+
#: subscribe2.php:80 subscribe2.php:1643
|
66 |
msgid "Send"
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: subscribe2.php:83
|
70 |
msgid "No such email address is registered."
|
71 |
msgstr ""
|
72 |
|
73 |
+
#: subscribe2.php:85
|
74 |
msgid "You have successfully subscribed!"
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: subscribe2.php:87
|
78 |
msgid "You have successfully unsubscribed."
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: subscribe2.php:89
|
82 |
msgid "Please confirm your request"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: subscribe2.php:91
|
86 |
msgid "Subscription Reminder"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: subscribe2.php:93
|
90 |
msgid "subscribe"
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: subscribe2.php:95
|
94 |
msgid "unsubscribe"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: subscribe2.php:98
|
98 |
msgid "Options saved!"
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: subscribe2.php:99
|
102 |
msgid "Options reset!"
|
103 |
msgstr ""
|
104 |
|
105 |
+
#: subscribe2.php:107 subscribe2.php:1140
|
106 |
msgid "Subscribers"
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: subscribe2.php:108
|
110 |
msgid "Subscribe2 Options"
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: subscribe2.php:108 subscribe2.php:2103
|
114 |
msgid "Subscribe2"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: subscribe2.php:110 subscribe2.php:112
|
118 |
msgid "Subscriptions"
|
119 |
msgstr ""
|
120 |
|
121 |
+
#: subscribe2.php:114
|
122 |
msgid "Mail Subscribers"
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: subscribe2.php:137
|
126 |
msgid "Once Weekly"
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: subscribe2.php:730
|
130 |
msgid "New subscriber"
|
131 |
msgstr ""
|
132 |
|
133 |
+
#: subscribe2.php:731
|
134 |
msgid "subscribed to email notifications!"
|
135 |
msgstr ""
|
136 |
|
137 |
+
#: subscribe2.php:1048
|
138 |
msgid "Address(es) subscribed!"
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: subscribe2.php:1051
|
142 |
msgid "deleted!"
|
143 |
msgstr ""
|
144 |
|
145 |
+
#: subscribe2.php:1054
|
146 |
msgid "status changed!"
|
147 |
msgstr ""
|
148 |
|
149 |
+
#: subscribe2.php:1057
|
150 |
msgid "Reminder Email(s) Sent!"
|
151 |
msgstr ""
|
152 |
|
153 |
+
#: subscribe2.php:1060
|
154 |
msgid "CSV File Created in wp-content"
|
155 |
msgstr ""
|
156 |
|
157 |
+
#: subscribe2.php:1063
|
158 |
msgid "Registered Users Subscribed!"
|
159 |
msgstr ""
|
160 |
|
161 |
+
#: subscribe2.php:1066
|
162 |
msgid "Registered Users Unsubscribed!"
|
163 |
msgstr ""
|
164 |
|
165 |
+
#: subscribe2.php:1128
|
166 |
msgid "Subscribe Addresses"
|
167 |
msgstr ""
|
168 |
|
169 |
+
#: subscribe2.php:1133
|
170 |
msgid "Enter addresses, one per line or comma-seperated"
|
171 |
msgstr ""
|
172 |
|
173 |
+
#: subscribe2.php:1142
|
174 |
msgid "Filter"
|
175 |
msgstr ""
|
176 |
|
177 |
+
#: subscribe2.php:1146
|
178 |
msgid ""
|
179 |
"Registered on the left, confirmed in the middle, unconfirmed on the right"
|
180 |
msgstr ""
|
181 |
|
182 |
+
#: subscribe2.php:1155
|
183 |
msgid "Save Emails to CSV File"
|
184 |
msgstr ""
|
185 |
|
186 |
+
#: subscribe2.php:1201
|
187 |
msgid "NONE"
|
188 |
msgstr ""
|
189 |
|
190 |
+
#: subscribe2.php:1211
|
191 |
msgid "Send Reminder Email"
|
192 |
msgstr ""
|
193 |
|
194 |
+
#: subscribe2.php:1218
|
195 |
msgid "Categories"
|
196 |
msgstr ""
|
197 |
|
198 |
+
#: subscribe2.php:1219
|
199 |
msgid ""
|
200 |
"Existing Registered Users can be automatically (un)subscribed to categories "
|
201 |
"using this section."
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: subscribe2.php:1220
|
205 |
msgid "Consider User Privacy as changes cannot be undone"
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: subscribe2.php:1325
|
209 |
msgid "Delivery Options"
|
210 |
msgstr ""
|
211 |
|
212 |
+
#: subscribe2.php:1326
|
213 |
+
msgid "Send Emails for Pages"
|
214 |
+
msgstr ""
|
215 |
+
|
216 |
+
#: subscribe2.php:1331 subscribe2.php:1342
|
217 |
+
msgid "Yes"
|
218 |
+
msgstr ""
|
219 |
+
|
220 |
+
#: subscribe2.php:1336 subscribe2.php:1347 subscribe2.php:1423
|
221 |
+
msgid "No"
|
222 |
+
msgstr ""
|
223 |
+
|
224 |
+
#: subscribe2.php:1337
|
225 |
+
msgid "Send Emails for Password Protected Posts"
|
226 |
+
msgstr ""
|
227 |
+
|
228 |
+
#: subscribe2.php:1348
|
229 |
msgid "Send Email From"
|
230 |
msgstr ""
|
231 |
|
232 |
+
#: subscribe2.php:1353
|
233 |
msgid "Author of the post"
|
234 |
msgstr ""
|
235 |
|
236 |
+
#: subscribe2.php:1358
|
237 |
msgid "Blog Admin"
|
238 |
msgstr ""
|
239 |
|
240 |
+
#: subscribe2.php:1360
|
241 |
msgid "Send Email as Digest"
|
242 |
msgstr ""
|
243 |
|
244 |
+
#: subscribe2.php:1364
|
245 |
msgid "Email Templates"
|
246 |
msgstr ""
|
247 |
|
248 |
+
#: subscribe2.php:1367
|
249 |
msgid "New Post email (must not be empty)"
|
250 |
msgstr ""
|
251 |
|
252 |
+
#: subscribe2.php:1371
|
253 |
msgid "Message substitions"
|
254 |
msgstr ""
|
255 |
|
256 |
+
#: subscribe2.php:1375
|
257 |
msgid "the post's title"
|
258 |
msgstr ""
|
259 |
|
260 |
+
#: subscribe2.php:1376
|
261 |
msgid ""
|
262 |
"the excerpt or the entire post<br />(<i>based on the subscriber's "
|
263 |
"preferences</i>)"
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: subscribe2.php:1377
|
267 |
msgid "the post's permalink"
|
268 |
msgstr ""
|
269 |
|
270 |
+
#: subscribe2.php:1378
|
271 |
msgid "the admin or post author's name"
|
272 |
msgstr ""
|
273 |
|
274 |
+
#: subscribe2.php:1379
|
275 |
msgid "the admin or post author's email"
|
276 |
msgstr ""
|
277 |
|
278 |
+
#: subscribe2.php:1380
|
279 |
msgid "the post author's name"
|
280 |
msgstr ""
|
281 |
|
282 |
+
#: subscribe2.php:1381
|
283 |
msgid ""
|
284 |
"the generated link to confirm a request<br />(<i>only used in the "
|
285 |
"confirmation email template</i>)"
|
286 |
msgstr ""
|
287 |
|
288 |
+
#: subscribe2.php:1382
|
289 |
msgid ""
|
290 |
"Action performed by LINK in confirmation email<br />(<i>only used in the "
|
291 |
"confirmation email template</i>)"
|
292 |
msgstr ""
|
293 |
|
294 |
+
#: subscribe2.php:1384
|
295 |
msgid "Subscribe / Unsubscribe confirmation email"
|
296 |
msgstr ""
|
297 |
|
298 |
+
#: subscribe2.php:1387
|
299 |
msgid "Reminder email to Unconfirmed Subscribers"
|
300 |
msgstr ""
|
301 |
|
302 |
+
#: subscribe2.php:1392
|
303 |
msgid "Excluded Categories"
|
304 |
msgstr ""
|
305 |
|
306 |
+
#: subscribe2.php:1398
|
307 |
msgid "Allow registered users to subscribe to excluded categories?"
|
308 |
msgstr ""
|
309 |
|
310 |
+
#: subscribe2.php:1399
|
311 |
msgid "Writing Options"
|
312 |
msgstr ""
|
313 |
|
314 |
+
#: subscribe2.php:1404
|
315 |
msgid "Show the Subscribe2 button on the Write toolbar?"
|
316 |
msgstr ""
|
317 |
|
318 |
+
#: subscribe2.php:1407
|
319 |
msgid "Auto Subscribe"
|
320 |
msgstr ""
|
321 |
|
322 |
+
#: subscribe2.php:1408
|
323 |
+
msgid "Subscribe new users registering with your blog."
|
324 |
msgstr ""
|
325 |
|
326 |
+
#: subscribe2.php:1413
|
327 |
+
msgid "Automatically"
|
328 |
msgstr ""
|
329 |
|
330 |
+
#: subscribe2.php:1418
|
331 |
+
msgid "Display option on Registration Form"
|
332 |
msgstr ""
|
333 |
|
334 |
+
#: subscribe2.php:1424
|
335 |
msgid "Auto-subscribe users to receive email as"
|
336 |
msgstr ""
|
337 |
|
338 |
+
#: subscribe2.php:1429 subscribe2.php:1539
|
339 |
msgid "HTML"
|
340 |
msgstr ""
|
341 |
|
342 |
+
#: subscribe2.php:1434
|
343 |
msgid "Plain Text - Full"
|
344 |
msgstr ""
|
345 |
|
346 |
+
#: subscribe2.php:1439
|
347 |
msgid "Plain Text - Excerpt"
|
348 |
msgstr ""
|
349 |
|
350 |
+
#: subscribe2.php:1442
|
351 |
msgid "Barred Domains"
|
352 |
msgstr ""
|
353 |
|
354 |
+
#: subscribe2.php:1443
|
355 |
msgid ""
|
356 |
"Enter domains to bar from public subscriptions: <br /> (Use a new line for "
|
357 |
"each entry and omit the \"@\" symbol, for example email.com)"
|
358 |
msgstr ""
|
359 |
|
360 |
+
#: subscribe2.php:1447
|
361 |
msgid "Submit"
|
362 |
msgstr ""
|
363 |
|
364 |
+
#: subscribe2.php:1452
|
365 |
msgid "Reset Default"
|
366 |
msgstr ""
|
367 |
|
368 |
+
#: subscribe2.php:1453
|
369 |
msgid ""
|
370 |
"Use this to reset all options to their defaults. This <strong><em>will not</"
|
371 |
"em></strong> modify your list of subscribers."
|
372 |
msgstr ""
|
373 |
|
374 |
+
#: subscribe2.php:1460
|
375 |
msgid "RESET"
|
376 |
msgstr ""
|
377 |
|
378 |
+
#: subscribe2.php:1480
|
379 |
msgid "Subscription preferences updated."
|
380 |
msgstr ""
|
381 |
|
382 |
+
#: subscribe2.php:1527
|
383 |
msgid "Notification Settings"
|
384 |
msgstr ""
|
385 |
|
386 |
+
#: subscribe2.php:1534
|
387 |
msgid "Receive email as"
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: subscribe2.php:1544
|
391 |
msgid "Plain Text"
|
392 |
msgstr ""
|
393 |
|
394 |
+
#: subscribe2.php:1546
|
395 |
msgid "Email contains"
|
396 |
msgstr ""
|
397 |
|
398 |
+
#: subscribe2.php:1547
|
399 |
msgid "Excerpt Only"
|
400 |
msgstr ""
|
401 |
|
402 |
+
#: subscribe2.php:1547
|
403 |
msgid "Full Post"
|
404 |
msgstr ""
|
405 |
|
406 |
+
#: subscribe2.php:1555
|
407 |
msgid "Note: HTML format will always deliver the full post."
|
408 |
msgstr ""
|
409 |
|
410 |
+
#: subscribe2.php:1556
|
411 |
msgid "Automatically subscribe me to newly created categories"
|
412 |
msgstr ""
|
413 |
|
414 |
+
#: subscribe2.php:1569
|
415 |
msgid "Subscribed Categories"
|
416 |
msgstr ""
|
417 |
|
418 |
+
#: subscribe2.php:1574
|
419 |
msgid "Receive daily summary of new posts?"
|
420 |
msgstr ""
|
421 |
|
422 |
+
#: subscribe2.php:1587
|
423 |
msgid "Update Preferences »"
|
424 |
msgstr ""
|
425 |
|
426 |
+
#: subscribe2.php:1632
|
427 |
msgid "Send email to all subscribers"
|
428 |
msgstr ""
|
429 |
|
430 |
+
#: subscribe2.php:1637
|
431 |
msgid "Subject"
|
432 |
msgstr ""
|
433 |
|
434 |
+
#: subscribe2.php:1637
|
435 |
msgid "A message from "
|
436 |
msgstr ""
|
437 |
|
438 |
+
#: subscribe2.php:1640
|
439 |
msgid "Recipients: "
|
440 |
msgstr ""
|
441 |
|
442 |
+
#: subscribe2.php:1702
|
443 |
msgid "Select / Unselect All"
|
444 |
msgstr ""
|
445 |
|
446 |
+
#: subscribe2.php:1715
|
447 |
msgid "All Subscribers"
|
448 |
msgstr ""
|
449 |
|
450 |
+
#: subscribe2.php:1716
|
451 |
msgid "Public Subscribers"
|
452 |
msgstr ""
|
453 |
|
454 |
+
#: subscribe2.php:1717
|
455 |
msgid "Confirmed"
|
456 |
msgstr ""
|
457 |
|
458 |
+
#: subscribe2.php:1718
|
459 |
msgid "Unconfirmed"
|
460 |
msgstr ""
|
461 |
|
462 |
+
#: subscribe2.php:1719
|
463 |
msgid "Registered Subscribers"
|
464 |
msgstr ""
|
465 |
|
466 |
+
#: subscribe2.php:1775
|
467 |
msgid "Per Post Email"
|
468 |
msgstr ""
|
469 |
|
470 |
+
#: subscribe2.php:1793
|
471 |
+
msgid "Current server time is"
|
472 |
+
msgstr ""
|
473 |
+
|
474 |
+
#: subscribe2.php:1795
|
475 |
msgid "Next email notification will be sent"
|
476 |
msgstr ""
|
477 |
|
478 |
+
#: subscribe2.php:1806
|
479 |
+
msgid "Check here to Subscribe to email notifications for new posts"
|
480 |
+
msgstr ""
|
481 |
+
|
482 |
+
#: subscribe2.php:1811
|
483 |
+
msgid ""
|
484 |
+
"By Registering with this blog you are also agreeing to recieve email "
|
485 |
+
"notifications for new posts"
|
486 |
+
msgstr ""
|
487 |
+
|
488 |
+
#: subscribe2.php:1928
|
489 |
msgid "Subscription Confirmation"
|
490 |
msgstr ""
|
491 |
|
492 |
+
#: subscribe2.php:2006
|
493 |
msgid "Digest Email"
|
494 |
msgstr ""
|
subscribe2/tinymce/editor_plugin.js
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('subscribe2quicktags', 'en_us,nl_nl');
|
2 |
+
|
3 |
+
var TinyMCE_Subscribe2Quicktags = {
|
4 |
+
getInfo : function() {
|
5 |
+
return {
|
6 |
+
longname : "Subscribe2 Quicktag",
|
7 |
+
author : 'MattyRob',
|
8 |
+
authorurl : 'http://subscribe2.wordpress.com/',
|
9 |
+
infourl : 'http://subscribe2.wordpress.com/',
|
10 |
+
version : tinyMCE.majorVersion + '.' + tinyMCE.minorVersion
|
11 |
+
};
|
12 |
+
},
|
13 |
+
getControlHTML : function(cn) {
|
14 |
+
switch (cn) {
|
15 |
+
case 'subscribe2quicktags':
|
16 |
+
buttons = tinyMCE.getButtonHTML('subscribe2', 'lang_subscribe2quicktags_subscribe2', '{$pluginurl}/../s2_button.png', 'subscribe2');
|
17 |
+
return buttons;
|
18 |
+
}
|
19 |
+
return '';
|
20 |
+
},
|
21 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
22 |
+
var inst = tinyMCE.getInstanceById(editor_id);
|
23 |
+
var focusElm = inst.getFocusElement();
|
24 |
+
function getAttrib(elm, name) {
|
25 |
+
return elm.getAttribute(name) ? elm.getAttribute(name) : "";
|
26 |
+
}
|
27 |
+
|
28 |
+
switch (command) {
|
29 |
+
case 'subscribe2':
|
30 |
+
//s2_insert_token(); //Replaced by insert image:
|
31 |
+
var flag = "";
|
32 |
+
// is image is selected
|
33 |
+
if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") {
|
34 |
+
flag = getAttrib(focusElm, 'class');
|
35 |
+
flagIE = getAttrib(focusElm, 'className');
|
36 |
+
|
37 |
+
if ( flag == 'mce_plugin_s2_img' || flagIE == 'mce_plugin_s2_img' )
|
38 |
+
alert("Placeholder for Subscribe2 form " + getAttrib(focusElm,'moretext') );
|
39 |
+
|
40 |
+
return true;
|
41 |
+
}
|
42 |
+
|
43 |
+
alt = "Placeholder for Subscribe2 form";
|
44 |
+
cssstyle = 'background:url(../wp-content/plugins/subscribe2/s2_marker.png) no-repeat 5px 5px;';
|
45 |
+
|
46 |
+
html = ''
|
47 |
+
+ '<img src="../wp-content/plugins/subscribe2/spacer.gif" '
|
48 |
+
+ 'width="210px" height="25px" '
|
49 |
+
+ 'alt="'+alt+'" title="'+alt+'" style="'+cssstyle+'" class="mce_plugin_s2_img" />';
|
50 |
+
|
51 |
+
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, html);
|
52 |
+
tinyMCE.selectedInstance.repaint();
|
53 |
+
|
54 |
+
return true;
|
55 |
+
}
|
56 |
+
return false;
|
57 |
+
},
|
58 |
+
|
59 |
+
/* EDIT: added for marker by Ravan */
|
60 |
+
cleanup : function(type, content) {
|
61 |
+
switch (type) {
|
62 |
+
|
63 |
+
case "insert_to_editor":
|
64 |
+
// Parse all <!--subscribe2--> tags and replace them with images
|
65 |
+
var startPos = 0;
|
66 |
+
var alt = "Placeholder for Subscribe2 form";
|
67 |
+
var cssstyle = 'background:url(../wp-content/plugins/subscribe2/s2_marker.png) no-repeat 5px 5px;';
|
68 |
+
while ((startPos = content.indexOf('<!--subscribe2', startPos)) != -1) {
|
69 |
+
var endPos = content.indexOf('-->', startPos) + 3;
|
70 |
+
// Insert image
|
71 |
+
var moreText = content.substring(startPos + 14, endPos - 3);
|
72 |
+
var contentAfter = content.substring(endPos);
|
73 |
+
content = content.substring(0, startPos);
|
74 |
+
content += '<img src="../wp-content/plugins/subscribe2/spacer.gif" ';
|
75 |
+
content += ' width="210px" height="25px" moretext="'+moreText+'" ';
|
76 |
+
content += 'alt="'+alt+'" title="'+alt+'" style="'+cssstyle+'" class="mce_plugin_s2_img" />';
|
77 |
+
content += contentAfter;
|
78 |
+
startPos++;
|
79 |
+
}
|
80 |
+
break;
|
81 |
+
|
82 |
+
case "get_from_editor":
|
83 |
+
// Parse all img tags and replace them with <!--subscribe2-->
|
84 |
+
var startPos = -1;
|
85 |
+
while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
|
86 |
+
var endPos = content.indexOf('/>', startPos);
|
87 |
+
var attribs = this._parseAttributes(content.substring(startPos + 4, endPos));
|
88 |
+
|
89 |
+
if (attribs['class'] == "mce_plugin_s2_img") {
|
90 |
+
endPos += 2;
|
91 |
+
|
92 |
+
var moreText = attribs['moretext'] ? attribs['moretext'] : '';
|
93 |
+
var embedHTML = '<!--subscribe2'+moreText+'-->';
|
94 |
+
|
95 |
+
// Insert embed/object chunk
|
96 |
+
chunkBefore = content.substring(0, startPos);
|
97 |
+
chunkAfter = content.substring(endPos);
|
98 |
+
content = chunkBefore + embedHTML + chunkAfter;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
break;
|
102 |
+
}
|
103 |
+
|
104 |
+
// Pass through to next handler in chain
|
105 |
+
return content;
|
106 |
+
},
|
107 |
+
|
108 |
+
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
109 |
+
|
110 |
+
tinyMCE.switchClass(editor_id + '_subscribe2', 'mceButtonNormal');
|
111 |
+
|
112 |
+
if (node == null)
|
113 |
+
return;
|
114 |
+
|
115 |
+
do {
|
116 |
+
if (node.nodeName.toLowerCase() == "img" && tinyMCE.getAttrib(node, 'class').indexOf('mce_plugin_s2_img') == 0) {
|
117 |
+
tinyMCE.switchClass(editor_id + '_subscribe2', 'mceButtonSelected');
|
118 |
+
}
|
119 |
+
} while ((node = node.parentNode));
|
120 |
+
|
121 |
+
return true;
|
122 |
+
},
|
123 |
+
|
124 |
+
_parseAttributes : function(attribute_string) {
|
125 |
+
var attributeName = "";
|
126 |
+
var attributeValue = "";
|
127 |
+
var withInName;
|
128 |
+
var withInValue;
|
129 |
+
var attributes = new Array();
|
130 |
+
var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');
|
131 |
+
|
132 |
+
if (attribute_string == null || attribute_string.length < 2)
|
133 |
+
return null;
|
134 |
+
|
135 |
+
withInName = withInValue = false;
|
136 |
+
|
137 |
+
for (var i=0; i<attribute_string.length; i++) {
|
138 |
+
var chr = attribute_string.charAt(i);
|
139 |
+
|
140 |
+
if ((chr == '"' || chr == "'") && !withInValue)
|
141 |
+
withInValue = true;
|
142 |
+
else if ((chr == '"' || chr == "'") && withInValue) {
|
143 |
+
withInValue = false;
|
144 |
+
|
145 |
+
var pos = attributeName.lastIndexOf(' ');
|
146 |
+
if (pos != -1)
|
147 |
+
attributeName = attributeName.substring(pos+1);
|
148 |
+
|
149 |
+
attributes[attributeName.toLowerCase()] = attributeValue.substring(1);
|
150 |
+
|
151 |
+
attributeName = "";
|
152 |
+
attributeValue = "";
|
153 |
+
} else if (!whiteSpaceRegExp.test(chr) && !withInName && !withInValue)
|
154 |
+
withInName = true;
|
155 |
+
|
156 |
+
if (chr == '=' && withInName)
|
157 |
+
withInName = false;
|
158 |
+
|
159 |
+
if (withInName)
|
160 |
+
attributeName += chr;
|
161 |
+
|
162 |
+
if (withInValue)
|
163 |
+
attributeValue += chr;
|
164 |
+
}
|
165 |
+
|
166 |
+
return attributes;
|
167 |
+
}
|
168 |
+
/* end */
|
169 |
+
};
|
170 |
+
|
171 |
+
tinyMCE.addPlugin('subscribe2quicktags', TinyMCE_Subscribe2Quicktags);
|
subscribe2/tinymce/langs/en_us.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// US lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('subscribe2quicktags',{
|
4 |
+
subscribe2 : 'Embed Subscribe2 token'
|
5 |
+
});
|
subscribe2/tinymce/langs/nl_nl.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// NL lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('subscribe2quicktags',{
|
4 |
+
subscribe2 : 'Subscribe2 teken invoegen'
|
5 |
+
});
|