Subscribe2 - Version 6.0

Version Description

Download this release

Release Info

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

Code changes from version 5.9 to 6.0

ReadMe.txt CHANGED
@@ -2,9 +2,9 @@
2
Contributors: MattyRob, Skippy, RavanH
3
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2387904
4
Tags: posts, subscription, email, subscribe, notify, notification
5
- Requires at least: 2.0.x
6
- Tested up to: 3.0
7
- Stable tag: 5.9
8
9
Sends a list of subscribers an email notification when new posts are published to your blog
10
@@ -33,8 +33,8 @@ If you want to send HTML emails to Public Subscribers too then upgrade to [Subsc
33
5. Click the "Tools" admin menu link, and select "Subscribers".
34
6. Manually subscribe people as you see fit.
35
7. Create a [WordPress Page](http://codex.wordpress.org/Pages) to display the subscription form. When creating the page, you may click the "S2" button on the QuickBar to automatically insert the subscribe2 token. Or, if you prefer, you may manually insert the subscribe2 token:
36
- <!--subscribe2-->
37
- ***Ensure the token is on a line by itself and that it has a blank line above and below.***
38
This token will automatically be replaced by dynamic subscription information and will display all forms and messages as necessary.
39
8. In the WordPress "Settings" area for Subscribe2 select the page name in the "Appearance" section that of the WordPress page created in step 7.
40
@@ -155,6 +155,19 @@ Secondly, make sure that the token (<!--subscribe2-->) is correctly entered in y
155
156
== Changelog ==
157
158
= Version 5.9 by Matthew Robinson =
159
160
* Added support for WordPress 3.0 Custom Post Types
@@ -660,4 +673,8 @@ Secondly, make sure that the token (<!--subscribe2-->) is correctly entered in y
660
661
= Version 2.2 =
662
663
- * By Scott Merrill, see http://www.skippy.net/blog/category/wordpress/plugins/subscribe2/
2
Contributors: MattyRob, Skippy, RavanH
3
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904
4
Tags: posts, subscription, email, subscribe, notify, notification
5
+ Requires at least: 2.8
6
+ Tested up to: 3.0.1
7
+ Stable tag: 6.0
8
9
Sends a list of subscribers an email notification when new posts are published to your blog
10
33
5. Click the "Tools" admin menu link, and select "Subscribers".
34
6. Manually subscribe people as you see fit.
35
7. Create a [WordPress Page](http://codex.wordpress.org/Pages) to display the subscription form. When creating the page, you may click the "S2" button on the QuickBar to automatically insert the subscribe2 token. Or, if you prefer, you may manually insert the subscribe2 token:
36
+ <!--subscribe2-->
37
+ ***Ensure the token is on a line by itself and that it has a blank line above and below.***
38
This token will automatically be replaced by dynamic subscription information and will display all forms and messages as necessary.
39
8. In the WordPress "Settings" area for Subscribe2 select the page name in the "Appearance" section that of the WordPress page created in step 7.
40
155
156
== Changelog ==
157
158
+ = Version 6.0 by Matthew Robinson =
159
+
160
+ * Improved case sensitive SQL queries to avoid issues on some server configurations
161
+ * Introduced option to check the notification override button by default at Settings->Subscribe2 - Appearance
162
+ * Extend support for for multiuser sites to include WordPress 3.0
163
+ * Converted both Widgets to the WordPress 2.8 API - check your widgets are installation
164
+ * Improved the Colour Picker in the Counter Widget
165
+ * Integrated the Counter Widget into the Settings page
166
+ * Removed several functions from the code for WordPress versions prior to 2.8 (2.8 is now a minimum requirement for Subscribe2)
167
+ * Removed legacy tinymce files that are no longer required
168
+ * Added code to prevent duplicate Public Subscriber entries
169
+ * Introduced TABLELINKS keyword for digest type notifications
170
+
171
= Version 5.9 by Matthew Robinson =
172
173
* Added support for WordPress 3.0 Custom Post Types
673
674
= Version 2.2 =
675
676
+ * By Scott Merrill, see http://www.skippy.net/blog/category/wordpress/plugins/subscribe2/
677
+
678
+ == Upgrade Notice ==
679
+
680
+ See Version History
counterwidget.php DELETED
@@ -1,407 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Subscribe2 Counter Widget
4
- Plugin URI: http://subscribe2.wordpress.com
5
- Description: Adds a sidebar widget to easily customize and display your Subscribe2 subscribers stats.
6
- Version: 5.9
7
- Author: Matthew Robinson
8
- Author URI: http://subscribe2.wordpress.com
9
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904
10
- */
11
-
12
- // Put functions into one big function we'll call at the plugins_loaded
13
- // action. This ensures that all required plugin functions are defined.
14
- function widget_s2counter_init() {
15
-
16
- if ( !function_exists('register_sidebar_widget') )
17
- return;
18
-
19
- if ( !class_exists('s2class') )
20
- return;
21
-
22
- /**
23
- Register the Widget
24
- */
25
- function widget_s2counter($args) {
26
- extract($args);
27
- $options = get_option('widget_s2counter');
28
- $title = empty($options['title']) ? 'Subscriber Count' : $options['title'];
29
- $s2w_bg = $options['s2w_bg'];
30
- $s2w_fg = $options['s2w_fg'];
31
- $s2w_width = $options['s2w_width'];
32
- $s2w_height = $options['s2w_height'];
33
- $s2w_font = $options['s2w_font'];
34
- echo $before_widget;
35
- echo $before_title . $title . $after_title;
36
- global $mysubscribe2;
37
- $registered = $mysubscribe2->get_registered();
38
- $confirmed = $mysubscribe2->get_public();
39
- $count = (count($registered) + count($confirmed));
40
- echo "<center><div style=\"text-align:center; background-color:" . $s2w_bg . "; color:" . $s2w_fg . "; width:" . $s2w_width . "px; height:" . $s2w_height . "px; font:" . $s2w_font . "pt Verdana, Arial, Helvetica, sans-serif; vertical-align:middle; padding:3px; border:1px solid #444;\">";
41
- echo $count;
42
- echo "</div></center>";
43
- echo $after_widget;
44
- }
45
-
46
- /**
47
- Register the optional widget control form
48
- */
49
- function widget_s2counter_control() {
50
- $options = get_option('widget_s2counter');
51
- if ( !is_array($options) )
52
- $options = array('title'=>'Subscriber Count',
53
- 's2w_bg'=>'#E3DACF',
54
- 's2w_fg'=>'#345797',
55
- 's2w_width'=>'82',
56
- 's2w_height'=>'16',
57
- 's2w_font'=>'11');
58
-
59
- if ( $_POST['s2counter'] ) {
60
- // Remember to sanitize and format use input appropriately.
61
- $options['title'] = strip_tags(stripslashes($_POST['title']));
62
- $options['s2w_bg'] = strip_tags(stripslashes($_POST['s2w_bodyColor']));
63
- $options['s2w_fg'] = strip_tags(stripslashes($_POST['s2w_textColor']));
64
- $options['s2w_width'] = strip_tags(stripslashes($_POST['width']));
65
- $options['s2w_height'] = strip_tags(stripslashes($_POST['height']));
66
- $options['s2w_font'] = strip_tags(stripslashes($_POST['font']));
67
- update_option('widget_s2counter', $options);
68
- }
69
-
70
- // Be sure you format your options to be valid HTML attributes.
71
- $s2w_title = htmlspecialchars($options['title'], ENT_QUOTES);
72
- $s2w_bg = htmlspecialchars($options['s2w_bg'], ENT_QUOTES);
73
- $s2w_fg = htmlspecialchars($options['s2w_fg'], ENT_QUOTES);
74
- $s2w_width = htmlspecialchars($options['s2w_width'], ENT_QUOTES);
75
- $s2w_height = htmlspecialchars($options['s2w_height'], ENT_QUOTES);
76
- $s2w_font = htmlspecialchars($options['s2w_font'], ENT_QUOTES);
77
- ?>
78
-
79
- <style type="text/css">
80
- div.csq { border:none; width:10px; height:10px; background-color:transparent; cursor:pointer; }
81
- div#countPreviewDiv { text-align:center; background-color:<?php echo $s2w_bg; ?>; color:<?php echo $s2w_fg; ?>; width:<?php echo $s2w_width; ?>px; height:<?php echo $s2w_height; ?>px; font:<?php echo $s2w_font; ?>pt Verdana, Arial, Helvetica, sans-serif; vertical-align:middle; padding:3px; border:1px solid #444; }
82
- </style>
83
-
84
- <script type="text/javascript">
85
- function assignColor(theColor) {
86
- if (document.getElementById) {
87
- var circForm = document.forms['widget-controls'];
88
- var re6 = /#[0-9A-Za-z]{6}/;
89
- if (!re6.test(theColor)) {
90
- return;
91
- }
92
- bodyFld = circForm.s2w_radioColor[0];
93
- txtFld = circForm.s2w_radioColor[1];
94
- pv = document.getElementById("countPreviewDiv");
95
- if (bodyFld.checked) {
96
- circForm.elements['s2w_bodyColor'].value = theColor;
97
- pv.style.backgroundColor = theColor;
98
- } else {
99
- circForm.elements['s2w_textColor'].value = theColor;
100
- pv.style.color = theColor;
101
- }
102
- }
103
- }
104
- function assignSize(theSize, theStyle) {
105
- if (document.getElementById) {
106
- var circForm = document.forms['widget-controls'];
107
- pv = document.getElementById("countPreviewDiv");
108
- if (theStyle == 'width') {
109
- pv.style.width = theSize+"px";
110
- }
111
- if (theStyle == 'height') {
112
- pv.style.height = theSize+"px";
113
- }
114
- if (theStyle == 'font') {
115
- pv.style.fontSize = theSize+"pt";
116
- }
117
- }
118
- }
119
- </script>
120
-
121
- <div>
122
- <fieldset>
123
- <legend>Widget Title</legend>
124
- <input type="text" name="title" id="title" value="<?php echo $s2w_title; ?>" class="widefat" />
125
- </fieldset>
126
-
127
- <fieldset>
128
- <legend>Color Scheme:</legend>
129
- <table style="border:0; padding:0; margin:0 0 12px 0; border-collapse:collapse;" align="center">
130
- <tr>
131
- <td style="background-color:#000000;margin:0;padding:0"><a href="javascript:assignColor('#000000')"><div class="csq"></div></a></td>
132
- <td style="background-color:#000033;margin:0;padding:0"><a href="javascript:assignColor('#000033')"><div class="csq"></div></a></td>
133
- <td style="background-color:#000066;margin:0;padding:0"><a href="javascript:assignColor('#000066')"><div class="csq"></div></a></td>
134
- <td style="background-color:#000099;margin:0;padding:0"><a href="javascript:assignColor('#000099')"><div class="csq"></div></a></td>
135
- <td style="background-color:#0000CC;margin:0;padding:0"><a href="javascript:assignColor('#0000CC')"><div class="csq"></div></a></td>
136
- <td style="background-color:#0000FF;margin:0;padding:0"><a href="javascript:assignColor('#0000FF')"><div class="csq"></div></a></td>
137
- <td style="background-color:#006600;margin:0;padding:0"><a href="javascript:assignColor('#006600')"><div class="csq"></div></a></td>
138
- <td style="background-color:#006633;margin:0;padding:0"><a href="javascript:assignColor('#006633')"><div class="csq"></div></a></td>
139
- <td style="background-color:#006666;margin:0;padding:0"><a href="javascript:assignColor('#006666')"><div class="csq"></div></a></td>
140
- <td style="background-color:#006699;margin:0;padding:0"><a href="javascript:assignColor('#006699')"><div class="csq"></div></a></td>
141
- <td style="background-color:#0066CC;margin:0;padding:0"><a href="javascript:assignColor('#0066CC')"><div class="csq"></div></a></td>
142
- <td style="background-color:#0066FF;margin:0;padding:0"><a href="javascript:assignColor('#0066FF')"><div class="csq"></div></a></td>
143
- <td style="background-color:#00CC00;margin:0;padding:0"><a href="javascript:assignColor('#00CC00')"><div class="csq"></div></a></td>
144
- <td style="background-color:#00CC33;margin:0;padding:0"><a href="javascript:assignColor('#00CC33')"><div class="csq"></div></a></td>
145
- <td style="background-color:#00CC66;margin:0;padding:0"><a href="javascript:assignColor('#00CC66')"><div class="csq"></div></a></td>
146
- <td style="background-color:#00CC99;margin:0;padding:0"><a href="javascript:assignColor('#00CC99')"><div class="csq"></div></a></td>
147
- <td style="background-color:#00CCCC;margin:0;padding:0"><a href="javascript:assignColor('#00CCCC')"><div class="csq"></div></a></td>
148
- <td style="background-color:#00CCFF;margin:0;padding:0"><a href="javascript:assignColor('#00CCFF')"><div class="csq"></div></a></td>
149
- </tr>
150
- <tr>
151
- <td style="background-color:#003300;margin:0;padding:0"><a href="javascript:assignColor('#003300')"><div class="csq"></div></a></td>
152
- <td style="background-color:#003333;margin:0;padding:0"><a href="javascript:assignColor('#003333')"><div class="csq"></div></a></td>
153
- <td style="background-color:#003366;margin:0;padding:0"><a href="javascript:assignColor('#003366')"><div class="csq"></div></a></td>
154
- <td style="background-color:#003399;margin:0;padding:0"><a href="javascript:assignColor('#003399')"><div class="csq"></div></a></td>
155
- <td style="background-color:#0033CC;margin:0;padding:0"><a href="javascript:assignColor('#0033CC')"><div class="csq"></div></a></td>
156
- <td style="background-color:#0033FF;margin:0;padding:0"><a href="javascript:assignColor('#0033FF')"><div class="csq"></div></a></td>
157
- <td style="background-color:#009900;margin:0;padding:0"><a href="javascript:assignColor('#009900')"><div class="csq"></div></a></td>
158
- <td style="background-color:#009933;margin:0;padding:0"><a href="javascript:assignColor('#009933')"><div class="csq"></div></a></td>
159
- <td style="background-color:#009966;margin:0;padding:0"><a href="javascript:assignColor('#009966')"><div class="csq"></div></a></td>
160
- <td style="background-color:#009999;margin:0;padding:0"><a href="javascript:assignColor('#009999')"><div class="csq"></div></a></td>
161
- <td style="background-color:#0099CC;margin:0;padding:0"><a href="javascript:assignColor('#0099CC')"><div class="csq"></div></a></td>
162
- <td style="background-color:#0099FF;margin:0;padding:0"><a href="javascript:assignColor('#0099FF')"><div class="csq"></div></a></td>
163
- <td style="background-color:#00FF00;margin:0;padding:0"><a href="javascript:assignColor('#00FF00')"><div class="csq"></div></a></td>
164
- <td style="background-color:#00FF33;margin:0;padding:0"><a href="javascript:assignColor('#00FF33')"><div class="csq"></div></a></td>
165
- <td style="background-color:#00FF66;margin:0;padding:0"><a href="javascript:assignColor('#00FF66')"><div class="csq"></div></a></td>
166
- <td style="background-color:#00FF99;margin:0;padding:0"><a href="javascript:assignColor('#00FF99')"><div class="csq"></div></a></td>
167
- <td style="background-color:#00FFCC;margin:0;padding:0"><a href="javascript:assignColor('#00FFCC')"><div class="csq"></div></a></td>
168
- <td style="background-color:#00FFFF;margin:0;padding:0"><a href="javascript:assignColor('#00FFFF')"><div class="csq"></div></a></td>
169
- </tr>
170
- <tr>
171
- <td style="background-color:#330000;margin:0;padding:0"><a href="javascript:assignColor('#330000')"><div class="csq"></div></a></td>
172
- <td style="background-color:#330033;margin:0;padding:0"><a href="javascript:assignColor('#330033')"><div class="csq"></div></a></td>
173
- <td style="background-color:#330066;margin:0;padding:0"><a href="javascript:assignColor('#330066')"><div class="csq"></div></a></td>
174
- <td style="background-color:#330099;margin:0;padding:0"><a href="javascript:assignColor('#330099')"><div class="csq"></div></a></td>
175
- <td style="background-color:#3300CC;margin:0;padding:0"><a href="javascript:assignColor('#3300CC')"><div class="csq"></div></a></td>
176
- <td style="background-color:#3300FF;margin:0;padding:0"><a href="javascript:assignColor('#3300FF')"><div class="csq"></div></a></td>
177
- <td style="background-color:#336600;margin:0;padding:0"><a href="javascript:assignColor('#336600')"><div class="csq"></div></a></td>
178
- <td style="background-color:#336633;margin:0;padding:0"><a href="javascript:assignColor('#336633')"><div class="csq"></div></a></td>
179
- <td style="background-color:#336666;margin:0;padding:0"><a href="javascript:assignColor('#336666')"><div class="csq"></div></a></td>
180
- <td style="background-color:#336699;margin:0;padding:0"><a href="javascript:assignColor('#336699')"><div class="csq"></div></a></td>
181
- <td style="background-color:#3366CC;margin:0;padding:0"><a href="javascript:assignColor('#3366CC')"><div class="csq"></div></a></td>
182
- <td style="background-color:#3366FF;margin:0;padding:0"><a href="javascript:assignColor('#3366FF')"><div class="csq"></div></a></td>
183
- <td style="background-color:#33CC00;margin:0;padding:0"><a href="javascript:assignColor('#33CC00')"><div class="csq"></div></a></td>
184
- <td style="background-color:#33CC33;margin:0;padding:0"><a href="javascript:assignColor('#33CC33')"><div class="csq"></div></a></td>
185
- <td style="background-color:#33CC66;margin:0;padding:0"><a href="javascript:assignColor('#33CC66')"><div class="csq"></div></a></td>
186
- <td style="background-color:#33CC99;margin:0;padding:0"><a href="javascript:assignColor('#33CC99')"><div class="csq"></div></a></td>
187
- <td style="background-color:#33CCCC;margin:0;padding:0"><a href="javascript:assignColor('#33CCCC')"><div class="csq"></div></a></td>
188
- <td style="background-color:#33CCFF;margin:0;padding:0"><a href="javascript:assignColor('#33CCFF')"><div class="csq"></div></a></td>
189
- </tr>
190
- <tr>
191
- <td style="background-color:#333300;margin:0;padding:0"><a href="javascript:assignColor('#333300')"><div class="csq"></div></a></td>
192
- <td style="background-color:#333333;margin:0;padding:0"><a href="javascript:assignColor('#333333')"><div class="csq"></div></a></td>
193
- <td style="background-color:#333366;margin:0;padding:0"><a href="javascript:assignColor('#333366')"><div class="csq"></div></a></td>
194
- <td style="background-color:#333399;margin:0;padding:0"><a href="javascript:assignColor('#333399')"><div class="csq"></div></a></td>
195
- <td style="background-color:#3333CC;margin:0;padding:0"><a href="javascript:assignColor('#3333CC')"><div class="csq"></div></a></td>
196
- <td style="background-color:#3333FF;margin:0;padding:0"><a href="javascript:assignColor('#3333FF')"><div class="csq"></div></a></td>
197
- <td style="background-color:#339900;margin:0;padding:0"><a href="javascript:assignColor('#339900')"><div class="csq"></div></a></td>
198
- <td style="background-color:#339933;margin:0;padding:0"><a href="javascript:assignColor('#339933')"><div class="csq"></div></a></td>
199
- <td style="background-color:#339966;margin:0;padding:0"><a href="javascript:assignColor('#339966')"><div class="csq"></div></a></td>
200
- <td style="background-color:#339999;margin:0;padding:0"><a href="javascript:assignColor('#339999')"><div class="csq"></div></a></td>
201
- <td style="background-color:#3399CC;margin:0;padding:0"><a href="javascript:assignColor('#3399CC')"><div class="csq"></div></a></td>
202
- <td style="background-color:#3399FF;margin:0;padding:0"><a href="javascript:assignColor('#3399FF')"><div class="csq"></div></a></td>
203
- <td style="background-color:#33FF00;margin:0;padding:0"><a href="javascript:assignColor('#33FF00')"><div class="csq"></div></a></td>
204
- <td style="background-color:#33FF33;margin:0;padding:0"><a href="javascript:assignColor('#33FF33')"><div class="csq"></div></a></td>
205
- <td style="background-color:#33FF66;margin:0;padding:0"><a href="javascript:assignColor('#33FF66')"><div class="csq"></div></a></td>
206
- <td style="background-color:#33FF99;margin:0;padding:0"><a href="javascript:assignColor('#33FF99')"><div class="csq"></div></a></td>
207
- <td style="background-color:#33FFCC;margin:0;padding:0"><a href="javascript:assignColor('#33FFCC')"><div class="csq"></div></a></td>
208
- <td style="background-color:#33FFFF;margin:0;padding:0"><a href="javascript:assignColor('#33FFFF')"><div class="csq"></div></a></td>
209
- </tr>
210
- <tr>
211
- <td style="background-color:#660000;margin:0;padding:0"><a href="javascript:assignColor('#660000')"><div class="csq"></div></a></td>
212
- <td style="background-color:#660033;margin:0;padding:0"><a href="javascript:assignColor('#660033')"><div class="csq"></div></a></td>
213
- <td style="background-color:#660066;margin:0;padding:0"><a href="javascript:assignColor('#660066')"><div class="csq"></div></a></td>
214
- <td style="background-color:#660099;margin:0;padding:0"><a href="javascript:assignColor('#660099')"><div class="csq"></div></a></td>
215
- <td style="background-color:#6600CC;margin:0;padding:0"><a href="javascript:assignColor('#6600CC')"><div class="csq"></div></a></td>
216
- <td style="background-color:#6600FF;margin:0;padding:0"><a href="javascript:assignColor('#6600FF')"><div class="csq"></div></a></td>
217
- <td style="background-color:#666600;margin:0;padding:0"><a href="javascript:assignColor('#666600')"><div class="csq"></div></a></td>
218
- <td style="background-color:#666633;margin:0;padding:0"><a href="javascript:assignColor('#666633')"><div class="csq"></div></a></td>
219
- <td style="background-color:#666666;margin:0;padding:0"><a href="javascript:assignColor('#666666')"><div class="csq"></div></a></td>
220
- <td style="background-color:#666699;margin:0;padding:0"><a href="javascript:assignColor('#666699')"><div class="csq"></div></a></td>
221
- <td style="background-color:#6666CC;margin:0;padding:0"><a href="javascript:assignColor('#6666CC')"><div class="csq"></div></a></td>
222
- <td style="background-color:#6666FF;margin:0;padding:0"><a href="javascript:assignColor('#6666FF')"><div class="csq"></div></a></td>
223
- <td style="background-color:#66CC00;margin:0;padding:0"><a href="javascript:assignColor('#66CC00')"><div class="csq"></div></a></td>
224
- <td style="background-color:#66CC33;margin:0;padding:0"><a href="javascript:assignColor('#66CC33')"><div class="csq"></div></a></td>
225
- <td style="background-color:#66CC66;margin:0;padding:0"><a href="javascript:assignColor('#66CC66')"><div class="csq"></div></a></td>
226
- <td style="background-color:#66CC99;margin:0;padding:0"><a href="javascript:assignColor('#66CC99')"><div class="csq"></div></a></td>
227
- <td style="background-color:#66CCCC;margin:0;padding:0"><a href="javascript:assignColor('#66CCCC')"><div class="csq"></div></a></td>
228
- <td style="background-color:#66CCFF;margin:0;padding:0"><a href="javascript:assignColor('#66CCFF')"><div class="csq"></div></a></td>
229
- </tr>
230
- <tr>
231
- <td style="background-color:#663300;margin:0;padding:0"><a href="javascript:assignColor('#663300')"><div class="csq"></div></a></td>
232
- <td style="background-color:#663333;margin:0;padding:0"><a href="javascript:assignColor('#663333')"><div class="csq"></div></a></td>
233
- <td style="background-color:#663366;margin:0;padding:0"><a href="javascript:assignColor('#663366')"><div class="csq"></div></a></td>
234
- <td style="background-color:#663399;margin:0;padding:0"><a href="javascript:assignColor('#663399')"><div class="csq"></div></a></td>
235
- <td style="background-color:#6633CC;margin:0;padding:0"><a href="javascript:assignColor('#6633CC')"><div class="csq"></div></a></td>
236
- <td style="background-color:#6633FF;margin:0;padding:0"><a href="javascript:assignColor('#6633FF')"><div class="csq"></div></a></td>
237
- <td style="background-color:#669900;margin:0;padding:0"><a href="javascript:assignColor('#669900')"><div class="csq"></div></a></td>
238
- <td style="background-color:#669933;margin:0;padding:0"><a href="javascript:assignColor('#669933')"><div class="csq"></div></a></td>
239
- <td style="background-color:#669966;margin:0;padding:0"><a href="javascript:assignColor('#669966')"><div class="csq"></div></a></td>
240
- <td style="background-color:#669999;margin:0;padding:0"><a href="javascript:assignColor('#669999')"><div class="csq"></div></a></td>
241
- <td style="background-color:#6699CC;margin:0;padding:0"><a href="javascript:assignColor('#6699CC')"><div class="csq"></div></a></td>
242
- <td style="background-color:#6699FF;margin:0;padding:0"><a href="javascript:assignColor('#6699FF')"><div class="csq"></div></a></td>
243
- <td style="background-color:#66FF00;margin:0;padding:0"><a href="javascript:assignColor('#66FF00')"><div class="csq"></div></a></td>
244
- <td style="background-color:#66FF33;margin:0;padding:0"><a href="javascript:assignColor('#66FF33')"><div class="csq"></div></a></td>
245
- <td style="background-color:#66FF66;margin:0;padding:0"><a href="javascript:assignColor('#66FF66')"><div class="csq"></div></a></td>
246
- <td style="background-color:#66FF99;margin:0;padding:0"><a href="javascript:assignColor('#66FF99')"><div class="csq"></div></a></td>
247
- <td style="background-color:#66FFCC;margin:0;padding:0"><a href="javascript:assignColor('#66FFCC')"><div class="csq"></div></a></td>
248
- <td style="background-color:#66FFFF;margin:0;padding:0"><a href="javascript:assignColor('#66FFFF')"><div class="csq"></div></a></td>
249
- </tr>
250
- <tr>
251
- <td style="background-color:#990000;margin:0;padding:0"><a href="javascript:assignColor('#990000')"><div class="csq"></div></a></td>
252
- <td style="background-color:#990033;margin:0;padding:0"><a href="javascript:assignColor('#990033')"><div class="csq"></div></a></td>
253
- <td style="background-color:#990066;margin:0;padding:0"><a href="javascript:assignColor('#990066')"><div class="csq"></div></a></td>
254
- <td style="background-color:#990099;margin:0;padding:0"><a href="javascript:assignColor('#990099')"><div class="csq"></div></a></td>
255
- <td style="background-color:#9900CC;margin:0;padding:0"><a href="javascript:assignColor('#9900CC')"><div class="csq"></div></a></td>
256
- <td style="background-color:#9900FF;margin:0;padding:0"><a href="javascript:assignColor('#9900FF')"><div class="csq"></div></a></td>
257
- <td style="background-color:#996600;margin:0;padding:0"><a href="javascript:assignColor('#996600')"><div class="csq"></div></a></td>
258
- <td style="background-color:#996633;margin:0;padding:0"><a href="javascript:assignColor('#996633')"><div class="csq"></div></a></td>
259
- <td style="background-color:#996666;margin:0;padding:0"><a href="javascript:assignColor('#996666')"><div class="csq"></div></a></td>
260
- <td style="background-color:#996699;margin:0;padding:0"><a href="javascript:assignColor('#996699')"><div class="csq"></div></a></td>
261
- <td style="background-color:#9966CC;margin:0;padding:0"><a href="javascript:assignColor('#9966CC')"><div class="csq"></div></a></td>
262
- <td style="background-color:#9966FF;margin:0;padding:0"><a href="javascript:assignColor('#9966FF')"><div class="csq"></div></a></td>
263
- <td style="background-color:#99CC00;margin:0;padding:0"><a href="javascript:assignColor('#99CC00')"><div class="csq"></div></a></td>
264
- <td style="background-color:#99CC33;margin:0;padding:0"><a href="javascript:assignColor('#99CC33')"><div class="csq"></div></a></td>
265
- <td style="background-color:#99CC66;margin:0;padding:0"><a href="javascript:assignColor('#99CC66')"><div class="csq"></div></a></td>
266
- <td style="background-color:#99CC99;margin:0;padding:0"><a href="javascript:assignColor('#99CC99')"><div class="csq"></div></a></td>
267
- <td style="background-color:#99CCCC;margin:0;padding:0"><a href="javascript:assignColor('#99CCCC')"><div class="csq"></div></a></td>
268
- <td style="background-color:#99CCFF;margin:0;padding:0"><a href="javascript:assignColor('#99CCFF')"><div class="csq"></div></a></td>
269
- </tr>
270
- <tr>
271
- <td style="background-color:#993300;margin:0;padding:0"><a href="javascript:assignColor('#993300')"><div class="csq"></div></a></td>
272
- <td style="background-color:#993333;margin:0;padding:0"><a href="javascript:assignColor('#993333')"><div class="csq"></div></a></td>
273
- <td style="background-color:#993366;margin:0;padding:0"><a href="javascript:assignColor('#993366')"><div class="csq"></div></a></td>
274
- <td style="background-color:#993399;margin:0;padding:0"><a href="javascript:assignColor('#993399')"><div class="csq"></div></a></td>
275
- <td style="background-color:#9933CC;margin:0;padding:0"><a href="javascript:assignColor('#9933CC')"><div class="csq"></div></a></td>
276
- <td style="background-color:#9933FF;margin:0;padding:0"><a href="javascript:assignColor('#9933FF')"><div class="csq"></div></a></td>
277
- <td style="background-color:#999900;margin:0;padding:0"><a href="javascript:assignColor('#999900')"><div class="csq"></div></a></td>
278
- <td style="background-color:#999933;margin:0;padding:0"><a href="javascript:assignColor('#999933')"><div class="csq"></div></a></td>
279
- <td style="background-color:#999966;margin:0;padding:0"><a href="javascript:assignColor('#999966')"><div class="csq"></div></a></td>
280
- <td style="background-color:#999999;margin:0;padding:0"><a href="javascript:assignColor('#999999')"><div class="csq"></div></a></td>
281
- <td style="background-color:#9999CC;margin:0;padding:0"><a href="javascript:assignColor('#9999CC')"><div class="csq"></div></a></td>
282
- <td style="background-color:#9999FF;margin:0;padding:0"><a href="javascript:assignColor('#9999FF')"><div class="csq"></div></a></td>
283
- <td style="background-color:#99FF00;margin:0;padding:0"><a href="javascript:assignColor('#99FF00')"><div class="csq"></div></a></td>
284
- <td style="background-color:#99FF33;margin:0;padding:0"><a href="javascript:assignColor('#99FF33')"><div class="csq"></div></a></td>
285
- <td style="background-color:#99FF66;margin:0;padding:0"><a href="javascript:assignColor('#99FF66')"><div class="csq"></div></a></td>
286
- <td style="background-color:#99FF99;margin:0;padding:0"><a href="javascript:assignColor('#99FF99')"><div class="csq"></div></a></td>
287
- <td style="background-color:#99FFCC;margin:0;padding:0"><a href="javascript:assignColor('#99FFCC')"><div class="csq"></div></a></td>
288
- <td style="background-color:#99FFFF;margin:0;padding:0"><a href="javascript:assignColor('#99FFFF')"><div class="csq"></div></a></td>
289
- </tr>
290
- <tr>
291
- <td style="background-color:#CC0000;margin:0;padding:0"><a href="javascript:assignColor('#CC0000')"><div class="csq"></div></a></td>
292
- <td style="background-color:#CC0033;margin:0;padding:0"><a href="javascript:assignColor('#CC0033')"><div class="csq"></div></a></td>
293
- <td style="background-color:#CC0066;margin:0;padding:0"><a href="javascript:assignColor('#CC0066')"><div class="csq"></div></a></td>
294
- <td style="background-color:#CC0099;margin:0;padding:0"><a href="javascript:assignColor('#CC0099')"><div class="csq"></div></a></td>
295
- <td style="background-color:#CC00CC;margin:0;padding:0"><a href="javascript:assignColor('#CC00CC')"><div class="csq"></div></a></td>
296
- <td style="background-color:#CC00FF;margin:0;padding:0"><a href="javascript:assignColor('#CC00FF')"><div class="csq"></div></a></td>
297
- <td style="background-color:#CC6600;margin:0;padding:0"><a href="javascript:assignColor('#CC6600')"><div class="csq"></div></a></td>
298
- <td style="background-color:#CC6633;margin:0;padding:0"><a href="javascript:assignColor('#CC6633')"><div class="csq"></div></a></td>
299
- <td style="background-color:#CC6666;margin:0;padding:0"><a href="javascript:assignColor('#CC6666')"><div class="csq"></div></a></td>
300
- <td style="background-color:#CC6699;margin:0;padding:0"><a href="javascript:assignColor('#CC6699')"><div class="csq"></div></a></td>
301
- <td style="background-color:#CC66CC;margin:0;padding:0"><a href="javascript:assignColor('#CC66CC')"><div class="csq"></div></a></td>
302
- <td style="background-color:#CC66FF;margin:0;padding:0"><a href="javascript:assignColor('#CC66FF')"><div class="csq"></div></a></td>
303
- <td style="background-color:#CCCC00;margin:0;padding:0"><a href="javascript:assignColor('#CCCC00')"><div class="csq"></div></a></td>
304
- <td style="background-color:#CCCC33;margin:0;padding:0"><a href="javascript:assignColor('#CCCC33')"><div class="csq"></div></a></td>
305
- <td style="background-color:#CCCC66;margin:0;padding:0"><a href="javascript:assignColor('#CCCC66')"><div class="csq"></div></a></td>
306
- <td style="background-color:#CCCC99;margin:0;padding:0"><a href="javascript:assignColor('#CCCC99')"><div class="csq"></div></a></td>
307
- <td style="background-color:#CCCCCC;margin:0;padding:0"><a href="javascript:assignColor('#CCCCCC')"><div class="csq"></div></a></td>
308
- <td style="background-color:#CCCCFF;margin:0;padding:0"><a href="javascript:assignColor('#CCCCFF')"><div class="csq"></div></a></td>
309
- </tr>
310
- <tr>
311
- <td style="background-color:#CC3300;margin:0;padding:0"><a href="javascript:assignColor('#CC3300')"><div class="csq"></div></a></td>
312
- <td style="background-color:#CC3333;margin:0;padding:0"><a href="javascript:assignColor('#CC3333')"><div class="csq"></div></a></td>
313
- <td style="background-color:#CC3366;margin:0;padding:0"><a href="javascript:assignColor('#CC3366')"><div class="csq"></div></a></td>
314
- <td style="background-color:#CC3399;margin:0;padding:0"><a href="javascript:assignColor('#CC3399')"><div class="csq"></div></a></td>
315
- <td style="background-color:#CC33CC;margin:0;padding:0"><a href="javascript:assignColor('#CC33CC')"><div class="csq"></div></a></td>
316
- <td style="background-color:#CC33FF;margin:0;padding:0"><a href="javascript:assignColor('#CC33FF')"><div class="csq"></div></a></td>
317
- <td style="background-color:#CC9900;margin:0;padding:0"><a href="javascript:assignColor('#CC9900')"><div class="csq"></div></a></td>
318
- <td style="background-color:#CC9933;margin:0;padding:0"><a href="javascript:assignColor('#CC9933')"><div class="csq"></div></a></td>
319
- <td style="background-color:#CC9966;margin:0;padding:0"><a href="javascript:assignColor('#CC9966')"><div class="csq"></div></a></td>
320
- <td style="background-color:#CC9999;margin:0;padding:0"><a href="javascript:assignColor('#CC9999')"><div class="csq"></div></a></td>
321
- <td style="background-color:#CC99CC;margin:0;padding:0"><a href="javascript:assignColor('#CC99CC')"><div class="csq"></div></a></td>
322
- <td style="background-color:#CC99FF;margin:0;padding:0"><a href="javascript:assignColor('#CC99FF')"><div class="csq"></div></a></td>
323
- <td style="background-color:#CCFF00;margin:0;padding:0"><a href="javascript:assignColor('#CCFF00')"><div class="csq"></div></a></td>
324
- <td style="background-color:#CCFF33;margin:0;padding:0"><a href="javascript:assignColor('#CCFF33')"><div class="csq"></div></a></td>
325
- <td style="background-color:#CCFF66;margin:0;padding:0"><a href="javascript:assignColor('#CCFF66')"><div class="csq"></div></a></td>
326
- <td style="background-color:#CCFF99;margin:0;padding:0"><a href="javascript:assignColor('#CCFF99')"><div class="csq"></div></a></td>
327
- <td style="background-color:#CCFFCC;margin:0;padding:0"><a href="javascript:assignColor('#CCFFCC')"><div class="csq"></div></a></td>
328
- <td style="background-color:#CCFFFF;margin:0;padding:0"><a href="javascript:assignColor('#CCFFFF')"><div class="csq"></div></a></td>
329
- </tr>
330
- <tr>
331
- <td style="background-color:#FF0000;margin:0;padding:0"><a href="javascript:assignColor('#FF0000')"><div class="csq"></div></a></td>
332
- <td style="background-color:#FF0033;margin:0;padding:0"><a href="javascript:assignColor('#FF0033')"><div class="csq"></div></a></td>
333
- <td style="background-color:#FF0066;margin:0;padding:0"><a href="javascript:assignColor('#FF0066')"><div class="csq"></div></a></td>
334
- <td style="background-color:#FF0099;margin:0;padding:0"><a href="javascript:assignColor('#FF0099')"><div class="csq"></div></a></td>
335
- <td style="background-color:#FF00CC;margin:0;padding:0"><a href="javascript:assignColor('#FF00CC')"><div class="csq"></div></a></td>
336
- <td style="background-color:#FF00FF;margin:0;padding:0"><a href="javascript:assignColor('#FF00FF')"><div class="csq"></div></a></td>
337
- <td style="background-color:#FF6600;margin:0;padding:0"><a href="javascript:assignColor('#FF6600')"><div class="csq"></div></a></td>
338
- <td style="background-color:#FF6633;margin:0;padding:0"><a href="javascript:assignColor('#FF6633')"><div class="csq"></div></a></td>
339
- <td style="background-color:#FF6666;margin:0;padding:0"><a href="javascript:assignColor('#FF6666')"><div class="csq"></div></a></td>
340
- <td style="background-color:#FF6699;margin:0;padding:0"><a href="javascript:assignColor('#FF6699')"><div class="csq"></div></a></td>
341
- <td style="background-color:#FF66CC;margin:0;padding:0"><a href="javascript:assignColor('#FF66CC')"><div class="csq"></div></a></td>
342
- <td style="background-color:#FF66FF;margin:0;padding:0"><a href="javascript:assignColor('#FF66FF')"><div class="csq"></div></a></td>
343
- <td style="background-color:#FFCC00;margin:0;padding:0"><a href="javascript:assignColor('#FFCC00')"><div class="csq"></div></a></td>
344
- <td style="background-color:#FFCC33;margin:0;padding:0"><a href="javascript:assignColor('#FFCC33')"><div class="csq"></div></a></td>
345
- <td style="background-color:#FFCC66;margin:0;padding:0"><a href="javascript:assignColor('#FFCC66')"><div class="csq"></div></a></td>
346
- <td style="background-color:#FFCC99;margin:0;padding:0"><a href="javascript:assignColor('#FFCC99')"><div class="csq"></div></a></td>
347
- <td style="background-color:#FFCCCC;margin:0;padding:0"><a href="javascript:assignColor('#FFCCCC')"><div class="csq"></div></a></td>
348
- <td style="background-color:#FFCCFF;margin:0;padding:0"><a href="javascript:assignColor('#FFCCFF')"><div class="csq"></div></a></td>
349
- </tr>
350
- <tr>
351
- <td style="background-color:#FF3300;margin:0;padding:0"><a href="javascript:assignColor('#FF3300')"><div class="csq"></div></a></td>
352
- <td style="background-color:#FF3333;margin:0;padding:0"><a href="javascript:assignColor('#FF3333')"><div class="csq"></div></a></td>
353
- <td style="background-color:#FF3366;margin:0;padding:0"><a href="javascript:assignColor('#FF3366')"><div class="csq"></div></a></td>
354
- <td style="background-color:#FF3399;margin:0;padding:0"><a href="javascript:assignColor('#FF3399')"><div class="csq"></div></a></td>
355
- <td style="background-color:#FF33CC;margin:0;padding:0"><a href="javascript:assignColor('#FF33CC')"><div class="csq"></div></a></td>
356
- <td style="background-color:#FF33FF;margin:0;padding:0"><a href="javascript:assignColor('#FF33FF')"><div class="csq"></div></a></td>
357
- <td style="background-color:#FF9900;margin:0;padding:0"><a href="javascript:assignColor('#FF9900')"><div class="csq"></div></a></td>
358
- <td style="background-color:#FF9933;margin:0;padding:0"><a href="javascript:assignColor('#FF9933')"><div class="csq"></div></a></td>
359
- <td style="background-color:#FF9966;margin:0;padding:0"><a href="javascript:assignColor('#FF9966')"><div class="csq"></div></a></td>
360
- <td style="background-color:#FF9999;margin:0;padding:0"><a href="javascript:assignColor('#FF9999')"><div class="csq"></div></a></td>
361
- <td style="background-color:#FF99CC;margin:0;padding:0"><a href="javascript:assignColor('#FF99CC')"><div class="csq"></div></a></td>
362
- <td style="background-color:#FF99FF;margin:0;padding:0"><a href="javascript:assignColor('#FF99FF')"><div class="csq"></div></a></td>
363
- <td style="background-color:#FFFF00;margin:0;padding:0"><a href="javascript:assignColor('#FFFF00')"><div class="csq"></div></a></td>
364
- <td style="background-color:#FFFF33;margin:0;padding:0"><a href="javascript:assignColor('#FFFF33')"><div class="csq"></div></a></td>
365
- <td style="background-color:#FFFF66;margin:0;padding:0"><a href="javascript:assignColor('#FFFF66')"><div class="csq"></div></a></td>
366
- <td style="background-color:#FFFF99;margin:0;padding:0"><a href="javascript:assignColor('#FFFF99')"><div class="csq"></div></a></td>
367
- <td style="background-color:#FFFFCC;margin:0;padding:0"><a href="javascript:assignColor('#FFFFCC')"><div class="csq"></div></a></td>
368
- <td style="background-color:#FFFFFF;margin:0;padding:0"><a href="javascript:assignColor('#FFFFFF')"><div class="csq"></div></a></td>
369
- </tr>
370
- </table>
371
- <label for="s2w_radioColor1"><input type="radio" name="s2w_radioColor" value="body" id="s2w_radioColor1" checked="checked" /><input type="text" name="s2w_bodyColor" maxlength="7" value="<?php echo $s2w_bg; ?>" onkeyup="document.forms['widget-controls'].s2w_radioColor[0].checked=true;assignColor(this.value)" style="width:60px;" /> Body</label><br /><br />
372
- <label for="s2w_radioColor2"><input type="radio" name="s2w_radioColor" value="text" id="s2w_radioColor2" /><input type="text" name="s2w_textColor" maxlength="7" value="<?php echo $s2w_fg; ?>" onkeyup="document.forms['widget-controls'].s2w_radioColor[1].checked=true;assignColor(this.value)" style="width:60px;" /> Text</label><br />
373
- </fieldset>
374
-
375
- <fieldset>
376
- <legend>Width, Height and Font Size</legend>
377
- <table style="border:0; padding:0; margin:0 0 12px 0; border-collapse:collapse;" align="center">
378
- <tr><td>Width</td>
379
- <td><input type="text" name="width" id="width" value="<?php echo $s2w_width; ?>" onkeyup="assignSize(this.value, this.name)" /></td></tr>
380
- <tr><td>Height</td>
381
- <td><input type="text" name="height" id="height" value="<?php echo $s2w_height; ?>" onkeyup="assignSize(this.value, this.name)" /></td></tr>
382
- <tr><td>Font</td>
383
- <td><input type="text" name="font" id="font" value="<?php echo $s2w_font; ?>" onkeyup="assignSize(this.value, this.name)" /></td></tr>
384
- </table>
385
- </fieldset>
386
-
387
- <fieldset style="text-align:center;">
388
- <legend>Subscriber Counter Button Preview</legend>
389
- <center><div id="countPreviewDiv">30</div></center>
390
- </fieldset>
391
-
392
- <input type="hidden" id="s2counter" name="s2counter" value="1" />
393
-
394
- </div>
395
- <?php
396
- }
397
-
398
- /**
399
- Actually register the Widget into the WordPress Widget API
400
- */
401
- register_sidebar_widget('Subscribe2 Counter', 'widget_s2counter');
402
- register_widget_control('Subscribe2 Counter', 'widget_s2counter_control');
403
- }
404
-
405
- // Run our code later in case this loads prior to any required plugins.
406
- add_action('plugins_loaded', 'widget_s2counter_init');
407
- ?>
include/colorpicker/css/colorpicker.css ADDED
@@ -0,0 +1,161 @@
1
+ .colorpicker {
2
+ width: 356px;
3
+ height: 176px;
4
+ overflow: hidden;
5
+ position: absolute;
6
+ background: url(../images/colorpicker_background.png);
7
+ font-family: Arial, Helvetica, sans-serif;
8
+ display: none;
9
+ }
10
+ .colorpicker_color {
11
+ width: 150px;
12
+ height: 150px;
13
+ left: 14px;
14
+ top: 13px;
15
+ position: absolute;
16
+ background: #f00;
17
+ overflow: hidden;
18
+ cursor: crosshair;
19
+ }
20
+ .colorpicker_color div {
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ width: 150px;
25
+ height: 150px;
26
+ background: url(../images/colorpicker_overlay.png);
27
+ }
28
+ .colorpicker_color div div {
29
+ position: absolute;
30
+ top: 0;
31
+ left: 0;
32
+ width: 11px;
33
+ height: 11px;
34
+ overflow: hidden;
35
+ background: url(../images/colorpicker_select.gif);
36
+ margin: -5px 0 0 -5px;
37
+ }
38
+ .colorpicker_hue {
39
+ position: absolute;
40
+ top: 13px;
41
+ left: 171px;
42
+ width: 35px;
43
+ height: 150px;
44
+ cursor: n-resize;
45
+ }
46
+ .colorpicker_hue div {
47
+ position: absolute;
48
+ width: 35px;
49
+ height: 9px;
50
+ overflow: hidden;
51
+ background: url(../images/colorpicker_indic.gif) left top;
52
+ margin: -4px 0 0 0;
53
+ left: 0px;
54
+ }
55
+ .colorpicker_new_color {
56
+ position: absolute;
57
+ width: 60px;
58
+ height: 30px;
59
+ left: 213px;
60
+ top: 13px;
61
+ background: #f00;
62
+ }
63
+ .colorpicker_current_color {
64
+ position: absolute;
65
+ width: 60px;
66
+ height: 30px;
67
+ left: 283px;
68
+ top: 13px;
69
+ background: #f00;
70
+ }
71
+ .colorpicker input {
72
+ background-color: transparent;
73
+ border: 1px solid transparent;
74
+ position: absolute;
75
+ font-size: 10px;
76
+ font-family: Arial, Helvetica, sans-serif;
77
+ color: #898989;
78
+ top: 4px;
79
+ right: 11px;
80
+ text-align: right;
81
+ margin: 0;
82
+ padding: 0;
83
+ height: 11px;
84
+ }
85
+ .colorpicker_hex {
86
+ position: absolute;
87
+ width: 72px;
88
+ height: 22px;
89
+ background: url(../images/colorpicker_hex.png) top;
90
+ left: 212px;
91
+ top: 142px;
92
+ }
93
+ .colorpicker_hex input {
94
+ right: 6px;
95
+ }
96
+ .colorpicker_field {
97
+ height: 22px;
98
+ width: 62px;
99
+ background-position: top;
100
+ position: absolute;
101
+ }
102
+ .colorpicker_field span {
103
+ position: absolute;
104
+ width: 12px;
105
+ height: 22px;
106
+ overflow: hidden;
107
+ top: 0;
108
+ right: 0;
109
+ cursor: n-resize;
110
+ }
111
+ .colorpicker_rgb_r {
112
+ background-image: url(../images/colorpicker_rgb_r.png);
113
+ top: 52px;
114
+ left: 212px;
115
+ }
116
+ .colorpicker_rgb_g {
117
+ background-image: url(../images/colorpicker_rgb_g.png);
118
+ top: 82px;
119
+ left: 212px;
120
+ }
121
+ .colorpicker_rgb_b {
122
+ background-image: url(../images/colorpicker_rgb_b.png);
123
+ top: 112px;
124
+ left: 212px;
125
+ }
126
+ .colorpicker_hsb_h {
127
+ background-image: url(../images/colorpicker_hsb_h.png);
128
+ top: 52px;
129
+ left: 282px;
130
+ }
131
+ .colorpicker_hsb_s {
132
+ background-image: url(../images/colorpicker_hsb_s.png);
133
+ top: 82px;
134
+ left: 282px;
135
+ }
136
+ .colorpicker_hsb_b {
137
+ background-image: url(../images/colorpicker_hsb_b.png);
138
+ top: 112px;
139
+ left: 282px;
140
+ }
141
+ .colorpicker_submit {
142
+ position: absolute;
143
+ width: 22px;
144
+ height: 22px;
145
+ background: url(../images/colorpicker_submit.png) top;
146
+ left: 322px;
147
+ top: 142px;
148
+ overflow: hidden;
149
+ }
150
+ .colorpicker_focus {
151
+ background-position: center;
152
+ }
153
+ .colorpicker_hex.colorpicker_focus {
154
+ background-position: bottom;
155
+ }
156
+ .colorpicker_submit.colorpicker_focus {
157
+ background-position: bottom;
158
+ }
159
+ .colorpicker_slider {
160
+ background-position: bottom;
161
+ }
include/colorpicker/images/blank.gif ADDED
Binary file
include/colorpicker/images/colorpicker_background.png ADDED
Binary file
include/colorpicker/images/colorpicker_hex.png ADDED
Binary file
include/colorpicker/images/colorpicker_hsb_b.png ADDED
Binary file
include/colorpicker/images/colorpicker_hsb_h.png ADDED
Binary file
include/colorpicker/images/colorpicker_hsb_s.png ADDED
Binary file
include/colorpicker/images/colorpicker_indic.gif ADDED
Binary file
include/colorpicker/images/colorpicker_overlay.png ADDED
Binary file
include/colorpicker/images/colorpicker_rgb_b.png ADDED
Binary file
include/colorpicker/images/colorpicker_rgb_g.png ADDED
Binary file
include/colorpicker/images/colorpicker_rgb_r.png ADDED
Binary file
include/colorpicker/images/colorpicker_select.gif ADDED
Binary file
include/colorpicker/images/colorpicker_submit.png ADDED
Binary file
include/colorpicker/images/select.png ADDED
Binary file
include/colorpicker/images/select2.png ADDED
Binary file
include/colorpicker/images/slider.png ADDED
Binary file
include/colorpicker/js/colorpicker.js ADDED
@@ -0,0 +1,484 @@
1
+ /**
2
+ *
3
+ * Color picker
4
+ * Author: Stefan Petre www.eyecon.ro
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses
7
+ *
8
+ */
9
+ (function (jQuery) {
10
+ var ColorPicker = function () {
11
+ var
12
+ ids = {},
13
+ inAction,
14
+ charMin = 65,
15
+ visible,
16
+ tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
17
+ defaults = {
18
+ eventName: 'click',
19
+ onShow: function () {},
20
+ onBeforeShow: function(){},
21
+ onHide: function () {},
22
+ onChange: function () {},
23
+ onSubmit: function () {},
24
+ color: 'ff0000',
25
+ livePreview: true,
26
+ flat: false
27
+ },
28
+ fillRGBFields = function (hsb, cal) {
29
+ var rgb = HSBToRGB(hsb);
30
+ jQuery(cal).data('colorpicker').fields
31
+ .eq(1).val(rgb.r).end()
32
+ .eq(2).val(rgb.g).end()
33
+ .eq(3).val(rgb.b).end();
34
+ },
35
+ fillHSBFields = function (hsb, cal) {
36
+ jQuery(cal).data('colorpicker').fields
37
+ .eq(4).val(hsb.h).end()
38
+ .eq(5).val(hsb.s).end()
39
+ .eq(6).val(hsb.b).end();
40
+ },
41
+ fillHexFields = function (hsb, cal) {
42
+ jQuery(cal).data('colorpicker').fields
43
+ .eq(0).val(HSBToHex(hsb)).end();
44
+ },
45
+ setSelector = function (hsb, cal) {
46
+ jQuery(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
47
+ jQuery(cal).data('colorpicker').selectorIndic.css({
48
+ left: parseInt(150 * hsb.s/100, 10),
49
+ top: parseInt(150 * (100-hsb.b)/100, 10)
50
+ });
51
+ },
52
+ setHue = function (hsb, cal) {
53
+ jQuery(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
54
+ },
55
+ setCurrentColor = function (hsb, cal) {
56
+ jQuery(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
57
+ },
58
+ setNewColor = function (hsb, cal) {
59
+ jQuery(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
60
+ },
61
+ keyDown = function (ev) {
62
+ var pressedKey = ev.charCode || ev.keyCode || -1;
63
+ if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
64
+ return false;
65
+ }
66
+ var cal = jQuery(this).parent().parent();
67
+ if (cal.data('colorpicker').livePreview === true) {
68
+ change.apply(this);
69
+ }
70
+ },
71
+ change = function (ev) {
72
+ var cal = jQuery(this).parent().parent(), col;
73
+ if (this.parentNode.className.indexOf('_hex') > 0) {
74
+ cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
75
+ } else if (this.parentNode.className.indexOf('_hsb') > 0) {
76
+ cal.data('colorpicker').color = col = fixHSB({
77
+ h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
78
+ s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
79
+ b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
80
+ });
81
+ } else {
82
+ cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
83
+ r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
84
+ g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
85
+ b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
86
+ }));
87
+ }
88
+ if (ev) {
89
+ fillRGBFields(col, cal.get(0));
90
+ fillHexFields(col, cal.get(0));
91
+ fillHSBFields(col, cal.get(0));
92
+ }
93
+ setSelector(col, cal.get(0));
94
+ setHue(col, cal.get(0));
95
+ setNewColor(col, cal.get(0));
96
+ cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
97
+ },
98
+ blur = function (ev) {
99
+ var cal = jQuery(this).parent().parent();
100
+ cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
101
+ },
102
+ focus = function () {
103
+ charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
104
+ jQuery(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
105
+ jQuery(this).parent().addClass('colorpicker_focus');
106
+ },
107
+ downIncrement = function (ev) {
108
+ var field = jQuery(this).parent().find('input').focus();
109
+ var current = {
110
+ el: jQuery(this).parent().addClass('colorpicker_slider'),
111
+ max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
112
+ y: ev.pageY,
113
+ field: field,
114
+ val: parseInt(field.val(), 10),
115
+ preview: jQuery(this).parent().parent().data('colorpicker').livePreview
116
+ };
117
+ jQuery(document).bind('mouseup', current, upIncrement);
118
+ jQuery(document).bind('mousemove', current, moveIncrement);
119
+ },
120
+ moveIncrement = function (ev) {
121
+ ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
122
+ if (ev.data.preview) {
123
+ change.apply(ev.data.field.get(0), [true]);
124
+ }
125
+ return false;
126
+ },
127
+ upIncrement = function (ev) {
128
+ change.apply(ev.data.field.get(0), [true]);
129
+ ev.data.el.removeClass('colorpicker_slider').find('input').focus();
130
+ jQuery(document).unbind('mouseup', upIncrement);
131
+ jQuery(document).unbind('mousemove', moveIncrement);
132
+ return false;
133
+ },
134
+ downHue = function (ev) {
135
+ var current = {
136
+ cal: jQuery(this).parent(),
137
+ y: jQuery(this).offset().top
138
+ };
139
+ current.preview = current.cal.data('colorpicker').livePreview;
140
+ jQuery(document).bind('mouseup', current, upHue);
141
+ jQuery(document).bind('mousemove', current, moveHue);
142
+ },
143
+ moveHue = function (ev) {
144
+ change.apply(
145
+ ev.data.cal.data('colorpicker')
146
+ .fields
147
+ .eq(4)
148
+ .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
149
+ .get(0),
150
+ [ev.data.preview]
151
+ );
152
+ return false;
153
+ },
154
+ upHue = function (ev) {
155
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
156
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
157
+ jQuery(document).unbind('mouseup', upHue);
158
+ jQuery(document).unbind('mousemove', moveHue);
159
+ return false;
160
+ },
161
+ downSelector = function (ev) {
162
+ var current = {
163
+ cal: jQuery(this).parent(),
164
+ pos: jQuery(this).offset()
165
+ };
166
+ current.preview = current.cal.data('colorpicker').livePreview;
167
+ jQuery(document).bind('mouseup', current, upSelector);
168
+ jQuery(document).bind('mousemove', current, moveSelector);
169
+ },
170
+ moveSelector = function (ev) {
171
+ change.apply(
172
+ ev.data.cal.data('colorpicker')
173
+ .fields
174
+ .eq(6)
175
+ .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
176
+ .end()
177
+ .eq(5)
178
+ .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
179
+ .get(0),
180
+ [ev.data.preview]
181
+ );
182
+ return false;
183
+ },
184
+ upSelector = function (ev) {
185
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
186
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
187
+ jQuery(document).unbind('mouseup', upSelector);
188
+ jQuery(document).unbind('mousemove', moveSelector);
189
+ return false;
190
+ },
191
+ enterSubmit = function (ev) {
192
+ jQuery(this).addClass('colorpicker_focus');
193
+ },
194
+ leaveSubmit = function (ev) {
195
+ jQuery(this).removeClass('colorpicker_focus');
196
+ },
197
+ clickSubmit = function (ev) {
198
+ var cal = jQuery(this).parent();
199
+ var col = cal.data('colorpicker').color;
200
+ cal.data('colorpicker').origColor = col;
201
+ setCurrentColor(col, cal.get(0));
202
+ cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
203
+ },
204
+ show = function (ev) {
205
+ var cal = jQuery('#' + jQuery(this).data('colorpickerId'));
206
+ cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
207
+ var pos = jQuery(this).offset();
208
+ var viewPort = getViewport();
209
+ var top = pos.top + this.offsetHeight;
210
+ var left = pos.left;
211
+ if (top + 176 > viewPort.t + viewPort.h) {
212
+ top -= this.offsetHeight + 176;
213
+ }
214
+ if (left + 356 > viewPort.l + viewPort.w) {
215
+ left -= 356;
216
+ }
217
+ cal.css({left: left + 'px', top: top + 'px'});
218
+ if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
219
+ cal.show();
220
+ }
221
+ jQuery(document).bind('mousedown', {cal: cal}, hide);
222
+ return false;
223
+ },
224
+ hide = function (ev) {
225
+ if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
226
+ if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
227
+ ev.data.cal.hide();
228
+ }
229
+ jQuery(document).unbind('mousedown', hide);
230
+ }
231
+ },
232
+ isChildOf = function(parentEl, el, container) {
233
+ if (parentEl == el) {
234
+ return true;
235
+ }
236
+ if (parentEl.contains) {
237
+ return parentEl.contains(el);
238
+ }
239
+ if ( parentEl.compareDocumentPosition ) {
240
+ return !!(parentEl.compareDocumentPosition(el) & 16);
241
+ }
242
+ var prEl = el.parentNode;
243
+ while(prEl && prEl != container) {
244
+ if (prEl == parentEl)
245
+ return true;
246
+ prEl = prEl.parentNode;
247
+ }
248
+ return false;
249
+ },
250
+ getViewport = function () {
251
+ var m = document.compatMode == 'CSS1Compat';
252
+ return {
253
+ l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
254
+ t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
255
+ w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
256
+ h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
257
+ };
258
+ },
259
+ fixHSB = function (hsb) {
260
+ return {
261
+ h: Math.min(360, Math.max(0, hsb.h)),
262
+ s: Math.min(100, Math.max(0, hsb.s)),
263
+ b: Math.min(100, Math.max(0, hsb.b))
264
+ };
265
+ },
266
+ fixRGB = function (rgb) {
267
+ return {
268
+ r: Math.min(255, Math.max(0, rgb.r)),
269
+ g: Math.min(255, Math.max(0, rgb.g)),
270
+ b: Math.min(255, Math.max(0, rgb.b))
271
+ };
272
+ },
273
+ fixHex = function (hex) {
274
+ var len = 6 - hex.length;
275
+ if (len > 0) {
276
+ var o = [];
277
+ for (var i=0; i<len; i++) {
278
+ o.push('0');
279
+ }
280
+ o.push(hex);
281
+ hex = o.join('');
282
+ }
283
+ return hex;
284
+ },
285
+ HexToRGB = function (hex) {
286
+ var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
287
+ return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
288
+ },
289
+ HexToHSB = function (hex) {
290
+ return RGBToHSB(HexToRGB(hex));
291
+ },
292
+ RGBToHSB = function (rgb) {
293
+ var hsb = {
294
+ h: 0,
295
+ s: 0,
296
+ b: 0
297
+ };
298
+ var min = Math.min(rgb.r, rgb.g, rgb.b);
299
+ var max = Math.max(rgb.r, rgb.g, rgb.b);
300
+ var delta = max - min;
301
+ hsb.b = max;
302
+ if (max != 0) {
303
+
304
+ }
305
+ hsb.s = max != 0 ? 255 * delta / max : 0;
306
+ if (hsb.s != 0) {
307
+ if (rgb.r == max) {
308
+ hsb.h = (rgb.g - rgb.b) / delta;
309
+ } else if (rgb.g == max) {
310
+ hsb.h = 2 + (rgb.b - rgb.r) / delta;
311
+ } else {
312
+ hsb.h = 4 + (rgb.r - rgb.g) / delta;
313
+ }
314
+ } else {
315
+ hsb.h = -1;
316
+ }
317
+ hsb.h *= 60;
318
+ if (hsb.h < 0) {
319
+ hsb.h += 360;
320
+ }
321
+ hsb.s *= 100/255;
322
+ hsb.b *= 100/255;
323
+ return hsb;
324
+ },
325
+ HSBToRGB = function (hsb) {
326
+ var rgb = {};
327
+ var h = Math.round(hsb.h);
328
+ var s = Math.round(hsb.s*255/100);
329
+ var v = Math.round(hsb.b*255/100);
330
+ if(s == 0) {
331
+ rgb.r = rgb.g = rgb.b = v;
332
+ } else {
333
+ var t1 = v;
334
+ var t2 = (255-s)*v/255;
335
+ var t3 = (t1-t2)*(h%60)/60;
336
+ if(h==360) h = 0;
337
+ if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
338
+ else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
339
+ else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
340
+ else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
341
+ else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
342
+ else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
343
+ else {rgb.r=0; rgb.g=0; rgb.b=0}
344
+ }
345
+ return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
346
+ },
347
+ RGBToHex = function (rgb) {
348
+ var hex = [
349
+ rgb.r.toString(16),
350
+ rgb.g.toString(16),
351
+ rgb.b.toString(16)
352
+ ];
353
+ jQuery.each(hex, function (nr, val) {
354
+ if (val.length == 1) {
355
+ hex[nr] = '0' + val;
356
+ }
357
+ });
358
+ return hex.join('');
359
+ },
360
+ HSBToHex = function (hsb) {
361
+ return RGBToHex(HSBToRGB(hsb));
362
+ },
363
+ restoreOriginal = function () {
364
+ var cal = jQuery(this).parent();
365
+ var col = cal.data('colorpicker').origColor;
366
+ cal.data('colorpicker').color = col;
367
+ fillRGBFields(col, cal.get(0));
368
+ fillHexFields(col, cal.get(0));
369
+ fillHSBFields(col, cal.get(0));
370
+ setSelector(col, cal.get(0));
371
+ setHue(col, cal.get(0));
372
+ setNewColor(col, cal.get(0));
373
+ };
374
+ return {
375
+ init: function (opt) {
376
+ opt = jQuery.extend({}, defaults, opt||{});
377
+ if (typeof opt.color == 'string') {
378
+ opt.color = HexToHSB(opt.color);
379
+ } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
380
+ opt.color = RGBToHSB(opt.color);
381
+ } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
382
+ opt.color = fixHSB(opt.color);
383
+ } else {
384
+ return this;
385
+ }
386
+ return this.each(function () {
387
+ if (!jQuery(this).data('colorpickerId')) {
388
+ var options = jQuery.extend({}, opt);
389
+ options.origColor = opt.color;
390
+ var id = 'collorpicker_' + parseInt(Math.random() * 1000);
391
+ jQuery(this).data('colorpickerId', id);
392
+ var cal = jQuery(tpl).attr('id', id);
393
+ if (options.flat) {
394
+ cal.appendTo(this).show();
395
+ } else {
396
+ cal.appendTo(document.body);
397
+ }
398
+ options.fields = cal
399
+ .find('input')
400
+ .bind('keyup', keyDown)
401
+ .bind('change', change)
402
+ .bind('blur', blur)
403
+ .bind('focus', focus);
404
+ cal
405
+ .find('span').bind('mousedown', downIncrement).end()
406
+ .find('>div.colorpicker_current_color').bind('click', restoreOriginal);
407
+ options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
408
+ options.selectorIndic = options.selector.find('div div');
409
+ options.el = this;
410
+ options.hue = cal.find('div.colorpicker_hue div');
411
+ cal.find('div.colorpicker_hue').bind('mousedown', downHue);
412
+ options.newColor = cal.find('div.colorpicker_new_color');
413
+ options.currentColor = cal.find('div.colorpicker_current_color');
414
+ cal.data('colorpicker', options);
415
+ cal.find('div.colorpicker_submit')
416
+ .bind('mouseenter', enterSubmit)
417
+ .bind('mouseleave', leaveSubmit)
418
+ .bind('click', clickSubmit);
419
+ fillRGBFields(options.color, cal.get(0));
420
+ fillHSBFields(options.color, cal.get(0));
421
+ fillHexFields(options.color, cal.get(0));
422
+ setHue(options.color, cal.get(0));
423
+ setSelector(options.color, cal.get(0));
424
+ setCurrentColor(options.color, cal.get(0));
425
+ setNewColor(options.color, cal.get(0));
426
+ if (options.flat) {
427
+ cal.css({
428
+ position: 'relative',
429
+ display: 'block'
430
+ });
431
+ } else {
432
+ jQuery(this).bind(options.eventName, show);
433
+ }
434
+ }
435
+ });
436
+ },
437
+ showPicker: function() {
438
+ return this.each( function () {
439
+ if (jQuery(this).data('colorpickerId')) {
440
+ show.apply(this);
441
+ }
442
+ });
443
+ },
444
+ hidePicker: function() {
445
+ return this.each( function () {
446
+ if (jQuery(this).data('colorpickerId')) {
447
+ jQuery('#' + jQuery(this).data('colorpickerId')).hide();
448
+ }
449
+ });
450
+ },
451
+ setColor: function(col) {
452
+ if (typeof col == 'string') {
453
+ col = HexToHSB(col);
454
+ } else if (col.r != undefined && col.g != undefined && col.b != undefined) {
455
+ col = RGBToHSB(col);
456
+ } else if (col.h != undefined && col.s != undefined && col.b != undefined) {
457
+ col = fixHSB(col);
458
+ } else {
459
+ return this;
460
+ }
461
+ return this.each(function(){
462
+ if (jQuery(this).data('colorpickerId')) {
463
+ var cal = jQuery('#' + jQuery(this).data('colorpickerId'));
464
+ cal.data('colorpicker').color = col;
465
+ cal.data('colorpicker').origColor = col;
466
+ fillRGBFields(col, cal.get(0));
467
+ fillHSBFields(col, cal.get(0));
468
+ fillHexFields(col, cal.get(0));
469
+ setHue(col, cal.get(0));
470
+ setSelector(col, cal.get(0));
471
+ setCurrentColor(col, cal.get(0));
472
+ setNewColor(col, cal.get(0));
473
+ }
474
+ });
475
+ }
476
+ };
477
+ }();
478
+ jQuery.fn.extend({
479
+ ColorPicker: ColorPicker.init,
480
+ ColorPickerHide: ColorPicker.hidePicker,
481
+ ColorPickerShow: ColorPicker.showPicker,
482
+ ColorPickerSetColor: ColorPicker.setColor
483
+ });
484
+ })(jQuery)
include/counterwidget.php ADDED
@@ -0,0 +1,97 @@
1
+ <?php
2
+ class S2_Counter_widget extends WP_Widget {
3
+ /**
4
+ Declares the S2_Counter_widget class.
5
+ */
6
+ function S2_Counter_widget() {
7
+ $widget_options = array('classname' => 's2_counter', 'description' => __('Subscriber Counter widget for the Subscribe2 plugin', 'subscribe2') );
8
+ $control_options = array('width' => 250, 'height' => 500);
9
+ $this->WP_Widget('s2_counter', __('Subscribe2 Counter', 'subscribe2'), $widget_options, $control_options);
10
+ }
11
+
12
+ /**
13
+ Displays the Widget
14
+ */
15
+ function widget($args, $instance) {
16
+ extract($args);
17
+
18
+ $title = empty($instance['title']) ? 'Subscriber Count' : $instance['title'];
19
+ $s2w_bg = empty($instance['s2w_bg']) ? 'E3DACF' : $instance['s2w_bg'];
20
+ $s2w_fg = empty($instance['s2w_fg']) ? '345797' : $instance['s2w_fg'];
21
+ $s2w_width = empty($instance['s2w_width']) ? '82' : $instance['s2w_width'];
22
+ $s2w_height = empty($instance['s2w_height']) ? '16' : $instance['s2w_height'];
23
+ $s2w_font = empty($instance['s2w_font']) ? '11' : $instance['s2w_font'];
24
+
25
+ echo $before_widget;
26
+ echo $before_title . $title . $after_title;
27
+ global $mysubscribe2;
28
+ $registered = $mysubscribe2->get_registered();
29
+ $confirmed = $mysubscribe2->get_public();
30
+ $count = (count($registered) + count($confirmed));
31
+ echo "<ul><div style=\"text-align:center; background-color:#" . $s2w_bg . "; color:#" . $s2w_fg . "; width:" . $s2w_width . "px; height:" . $s2w_height . "px; font:" . $s2w_font . "pt Verdana, Arial, Helvetica, sans-serif; vertical-align:middle; padding:3px; border:1px solid #444;\">";
32
+ echo $count;
33
+ echo "</span></div></ul>";
34
+ echo $after_widget;
35
+ }
36
+
37
+ /**
38
+ Saves the widgets settings.
39
+ */
40
+ function update($new_instance, $old_instance) {
41
+ $instance = $old_instance;
42
+ $instance['title'] = strip_tags(stripslashes($new_instance['title']));
43
+ $instance['s2w_bg'] = strip_tags(stripslashes($new_instance['s2w_bg']));
44
+ $instance['s2w_fg'] = strip_tags(stripslashes($new_instance['s2w_fg']));
45
+ $instance['s2w_width'] = strip_tags(stripslashes($new_instance['s2w_width']));
46
+ $instance['s2w_height'] = strip_tags(stripslashes($new_instance['s2w_height']));
47
+ $instance['s2w_font'] = strip_tags(stripslashes($new_instance['s2w_font']));
48
+
49
+ return $instance;
50
+ }
51
+
52
+ /**
53
+ Creates the edit form for the widget.
54
+ */
55
+ function form($instance) {
56
+ // set some defaults
57
+ $options = get_option('widget_s2counter');
58
+ if ( $options === false ) {
59
+ $defaults = array('title'=>'Subscriber Count', 's2w_bg'=>'E3DACF', 's2w_fg'=>'345797', 's2w_width'=>'82', 's2w_height'=>'16', 's2w_font'=>'11');
60
+ } else {
61
+ $defaults = array('title'=>$options['title'], 's2w_bg'=>$options['s2w_bg'], 's2w_fg'=>$options['s2w_fg'], 's2w_width'=>$options['s2w_width'], 's2w_height'=>$options['s2w_height'], 's2w_font'=>$options['s2w_font']);
62
+ delete_option('widget_s2counter');
63
+ }
64
+ $instance = wp_parse_args( (array) $instance, $defaults);
65
+ // Be sure you format your options to be valid HTML attributes.
66
+ $s2w_title = htmlspecialchars($instance['title'], ENT_QUOTES);
67
+ $s2w_bg = htmlspecialchars($instance['s2w_bg'], ENT_QUOTES);
68
+ $s2w_fg = htmlspecialchars($instance['s2w_fg'], ENT_QUOTES);
69
+ $s2w_width = htmlspecialchars($instance['s2w_width'], ENT_QUOTES);
70
+ $s2w_height = htmlspecialchars($instance['s2w_height'], ENT_QUOTES);
71
+ $s2w_font = htmlspecialchars($instance['s2w_font'], ENT_QUOTES);
72
+ echo "<div>\r\n";
73
+ echo "<fieldset><legend>" . __('Widget Title', 'subscribe2') . "</legend>\r\n";
74
+ echo "<label><input type=\"text\" name=\"" . $this->get_field_name('title') . "\" id=\"" . $this->get_field_id('title') . "\" value=\"" . $s2w_title . "\" /></label>\r\n";
75
+ echo "</fieldset>\r\n";
76
+
77
+ echo "<fieldset>\r\n";
78
+ echo "<legend>" . __('Color Scheme', 'subscribe2') . "</legend>\r\n";
79
+ echo "<label>\r\n";
80
+ echo "<input type=\"text\" name=\"" . $this->get_field_name('s2w_bg') . "\" id=\"" . $this->get_field_id('s2w_bg') . "\" maxlength=\"7\" value=\"" . $s2w_bg . "\" class=\"colorpickerField\" style=\"width:60px;\" /> " . __('Body', 'subscribe2') . "</label><br />\r\n";
81
+ echo "<label>\r\n";
82
+ echo "<input type=\"text\" name=\"" . $this->get_field_name('s2w_fg') . "\" id=\"" . $this->get_field_id('s2w_fg') . "\" maxlength=\"7\" value=\"" . $s2w_fg . "\" class=\"colorpickerField\" style=\"width:60px;\" /> " . __('Text', 'subsribe2') . "</label><br />\r\n";
83
+ echo "</fieldset>";
84
+
85
+ echo "<fieldset>\r\n";
86
+ echo "<legend>" . __('Width, Height and Font Size', 'subscribe2') . "</legend>\r\n";
87
+ echo "<table style=\"border:0; padding:0; margin:0 0 12px 0; border-collapse:collapse;\" align=\"center\">\r\n";
88
+ echo "<tr><td>" . __('Width', 'subscribe2') . "</td>\r\n";
89
+ echo "<td><label><input type=\"text\" name=\"" . $this->get_field_name('s2w_width') . "\" id=\"" . $this->get_field_id('s2w_width') . "\" value=\"" . $s2w_width . "\" /></label></td></tr>\r\n";
90
+ echo "<tr><td>" . __('Height', 'subscribe2') . "</td>\r\n";
91
+ echo "<td><label><input type=\"text\" name=\"" . $this->get_field_name('s2w_height') . "\" id=\"" . $this->get_field_id('s2w_height') . "\" value=\"" . $s2w_height . "\" /></label></td></tr>\r\n";
92
+ echo "<tr><td>" . __('Font', 'subscribe2') . "</td>\r\n";
93
+ echo "<td><label><input type=\"text\" name=\"" . $this->get_field_name('s2w_font') . "\" id=\"" . $this->get_field_id('s2w_font') . "\" value=\"" . $s2w_font . "\" /></label></td></tr>\r\n";
94
+ echo "</table></fieldset></div>\r\n";
95
+ }
96
+ }// end S2_Counter_widget class
97
+ ?>
include/options.php CHANGED
@@ -26,14 +26,10 @@ if (!isset($this->subscribe2_options['autosub_def'])) {
26
$this->subscribe2_options['autosub_def'] = "yes";
27
} // option for user default auto-subscription to new categories
28
29
- if (!isset($this->subscribe2_options['bcclimit'])) {
30
$this->subscribe2_options['bcclimit'] = 0;
31
} // option for default bcc limit on email notifications
32
33
- if (!isset($this->subscribe2_options['cron_order'])) {
34
- $this->subscribe2_options['cron_order'] = 'asc';
35
- } // option for sorting digest posts in ascending or descending order
36
-
37
if (!isset($this->subscribe2_options['admin_email'])) {
38
$this->subscribe2_options['admin_email'] = "subs";
39
} // option for sending new subscriber notifications to admins
@@ -86,6 +82,10 @@ if (!isset($this->subscribe2_options['widget'])) {
86
$this->subscribe2_options['widget'] = "0";
87
} // option to enable Subscribe2 Widget
88
89
if (!isset($this->subscribe2_options['entries'])) {
90
$this->subscribe2_options['entries'] = 25;
91
} // option for the number of subscribers displayed on each page
26
$this->subscribe2_options['autosub_def'] = "yes";
27
} // option for user default auto-subscription to new categories
28
29
+ if(!isset($this->subscribe2_options['bcclimit'])) {
30
$this->subscribe2_options['bcclimit'] = 0;
31
} // option for default bcc limit on email notifications
32
33
if (!isset($this->subscribe2_options['admin_email'])) {
34
$this->subscribe2_options['admin_email'] = "subs";
35
} // option for sending new subscriber notifications to admins
82
$this->subscribe2_options['widget'] = "0";
83
} // option to enable Subscribe2 Widget
84
85
+ if (!isset($this->subscribe2_options['counterwidget'])) {
86
+ $this->subscribe2_options['counterwidget'] = "0";
87
+ } // option to enable Subscribe2 Counter Widget
88
+
89
if (!isset($this->subscribe2_options['entries'])) {
90
$this->subscribe2_options['entries'] = 25;
91
} // option for the number of subscribers displayed on each page
include/widget.php ADDED
@@ -0,0 +1,82 @@
1
+ <?php
2
+ class S2_Form_widget extends WP_Widget {
3
+ /**
4
+ Declares the Subscribe2 widget class.
5
+ */
6
+ function S2_Form_widget() {
7
+ $widget_ops = array('classname' => 's2_form_widget', 'description' => __('Sidebar Widget for Subscribe2', 'subscribe2') );
8
+ $control_ops = array('width' => 250, 'height' => 300);
9
+ $this->WP_Widget('s2_form_widget', __('Subscribe2 Widget'), $widget_ops, $control_ops);
10
+ }
11
+
12
+ /**
13
+ Displays the Widget
14
+ */
15
+ function widget($args, $instance) {
16
+ extract($args);
17
+ $title = empty($instance['title']) ? __('Subscribe2', 'subscribe2') : $instance['title'];
18
+ $div = empty($instance['div']) ? 'search' : $instance['div'];
19
+ $widgetprecontent = empty($instance['widgetprecontent']) ? '' : $instance['widgetprecontent'];
20
+ $widgetpostcontent = empty($instance['widgetpostcontent']) ? '' : $instance['widgetpostcontent'];
21
+ echo $before_widget;
22
+ echo $before_title . $title . $after_title;
23
+ echo "<div class=\"" . $div . "\">";
24
+ global $mysubscribe2;
25
+ $content = $mysubscribe2->filter('<!--subscribe2-->');
26
+ if ( !empty($widgetprecontent) ) {
27
+ echo $widgetprecontent;
28
+ }
29
+ echo $content;
30
+ if ( !empty($widgetpostcontent) ) {
31
+ echo $widgetpostcontent;
32
+ }
33
+ echo "</div>";
34
+ echo $after_widget;
35
+ }
36
+
37
+ /**
38
+ Saves the widgets settings.
39
+ */
40
+ function update($new_instance, $old_instance) {
41
+ $instance = $old_instance;
42
+ $instance['title'] = strip_tags(stripslashes($new_instance['title']));
43
+ $instance['div'] = strip_tags(stripslashes($new_instance['div']));
44
+ $instance['widgetprecontent'] = strip_tags(stripslashes($new_instance['widgetprecontent']));
45
+ $instance['widgetpostcontent'] = strip_tags(stripslashes($new_instance['widgetpostcontent']));
46
+
47
+ return $instance;
48
+ }
49
+
50
+ /**
51
+ Creates the edit form for the widget.
52
+ */
53
+ function form($instance) {
54
+ // set some defaults, getting any old options first
55
+ $options = get_option('widget_subscribe2widget');
56
+ if ( $options === false ) {
57
+ $defaults = array('title' => 'Subscribe2', 'div' => 'search', 'widgetprecontent' => '', 'widgetpostcontent' => '');
58
+ } else {
59
+ $defaults = array('title' => $options['title'], 'div' => $options['div'], 'widgetprecontent' => $options['widgetprecontent'], 'widgetpostcontent' => $options['widgetpostcontent']);
60
+ delete_option('widget_subscribe2widget');
61
+ }
62
+ // code to obtain old settings too
63
+ $instance = wp_parse_args( (array) $instance, $defaults);
64
+
65
+ $title = htmlspecialchars($instance['title'], ENT_QUOTES);
66
+ $div= htmlspecialchars($instance['div'], ENT_QUOTES);
67
+ $widgetprecontent = htmlspecialchars($instance['widgetprecontent'], ENT_QUOTES);
68
+ $widgetpostcontent = htmlspecialchars($instance['widgetpostcontent'], ENT_QUOTES);
69
+
70
+ echo "<div\r\n";
71
+ echo "<p><label for=\"" . $this->get_field_name('title') . "\">" . __('Title', 'subscribe2') . ":";
72
+ echo "<input class=\"widefat\" id=\"" . $this->get_field_id('title') . "\" name=\"" . $this->get_field_name('title') . "\" type=\"text\" value=\"" . $title . "\" /></label></p>";
73
+ echo "<p><label for=\"" . $this->get_field_name('div') . "\">" . __('Div class name', 'subscribe2') . ":";
74
+ echo "<input class=\"widefat\" id=\"" . $this->get_field_id('div') . "\" name=\"" . $this->get_field_name('div') . "\" type=\"text\" value=\"" . $div . "\" /></label></p>";
75
+ echo "<p><label for=\"" . $this->get_field_name('widgetprecontent') . "\">" . __('Pre-Content', 'subscribe2') . ":";
76
+ echo "<input class=\"widefat\" id=\"" . $this->get_field_name('widgetprecontent') . "\" name=\"" . $this->get_field_name('widgetprecontent') . "\" type=\"text\" value=\"" . $widgetprecontent . "\" /></label></p>";
77
+ echo "<p><label for=\"" . $this->get_field_name('widgetpostcontent') . "\">" . __('Post-Content', 'subscribe2') . ":";
78
+ echo "<input class=\"widefat\" id=\"" . $this->get_field_id('widgetpostcontent') . "\" name=\"" . $this->get_field_name('widgetpostcontent') . "\" type=\"text\" value=\"" . $widgetpostcontent . "\" /></label></p>";
79
+ echo "</div\r\n";
80
+ }
81
+ } // End S2_Form_widget class
82
+ ?>
subscribe2.php CHANGED
@@ -3,14 +3,14 @@
3
Plugin Name: Subscribe2
4
Plugin URI: http://subscribe2.wordpress.com
5
Description: Notifies an email list when new entries are posted.
6
- Version: 5.9
7
Author: Matthew Robinson
8
Author URI: http://subscribe2.wordpress.com
9
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904
10
*/
11
12
/*
13
- Copyright (C) 2006-9 Matthew Robinson
14
Based on the Original Subscribe2 plugin by
15
Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
16
@@ -32,7 +32,7 @@ along with Subscribe2. If not, see <http://www.gnu.org/licenses/>.
32
33
// our version number. Don't touch this or any line below
34
// unless you know exacly what you are doing
35
- define( 'S2VERSION', '5.9' );
36
define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
37
define( 'S2DIR', plugin_basename(dirname(__FILE__)) );
38
@@ -42,14 +42,6 @@ if ( !in_array(ini_get('safe_mode'), $safe_mode) && ini_get('max_execution_time'
42
@ini_set('max_execution_time', 300);
43
}
44
45
- // Pre-2.6 compatibility
46
- if ( !defined('WP_CONTENT_URL') ) {
47
- define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content' );
48
- }
49
- if ( !defined('WP_CONTENT_DIR') ) {
50
- define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
51
- }
52
-
53
/* Include buttonsnap library by Owen Winckler */
54
if ( !class_exists('buttonsnap') ) {
55
require( WP_CONTENT_DIR . '/plugins/' . S2DIR . '/include/buttonsnap.php' );
@@ -71,8 +63,22 @@ class s2class {
71
$this->please_log_in = "<p>" . __('To manage your subscription options please', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-login.php\">" . __('login', 'subscribe2') . "</a>.</p>";
72
73
$this->use_profile_admin = "<p>" . __('You may manage your subscription options from your', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-admin/users.php?page=s2_users\">" . __('profile', 'subscribe2') . "</a>.</p>";
74
75
$this->use_profile_users = "<p>" . __('You may manage your subscription options from your', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-admin/profile.php?page=s2_users\">" . __('profile', 'subscribe2') . "</a>.</p>";
76
77
$this->confirmation_sent = "<p>" . __('A confirmation message is on its way!', 'subscribe2') . "</p>";
78
@@ -226,7 +232,7 @@ class s2class {
226
update_option('subscribe2_options', $this->subscribe2_options);
227
228
// upgrade old wpmu user meta data to new
229
- if ( isset($wpmu_version) || strpos($wp_version, 'wordpress-mu') ) {
230
$this->namechange_subscribe2_widget();
231
// loop through all users
232
foreach ( $users as $user ) {
@@ -270,7 +276,7 @@ class s2class {
270
foreach ( $public_subscribers as $email ) {
271
$new_email = $this->sanitize_email($email);
272
if ( $email !== $new_email ) {
273
- $wpdb->get_results("UPDATE $this->public SET email='$new_email' WHERE email='$email'");
274
}
275
}
276
} // end upgrade()
@@ -295,7 +301,7 @@ class s2class {
295
return;
296
}
297
$string = str_replace("BLOGNAME", html_entity_decode(get_option('blogname'), ENT_QUOTES), $string);
298
- $string = str_replace("BLOGLINK", get_bloginfo('url'), $string);
299
$string = str_replace("TITLE", stripslashes($this->post_title), $string);
300
$link = "<a href=\"" . $this->permalink . "\">" . $this->permalink . "</a>";
301
$string = str_replace("PERMALINK", $link, $string);
@@ -329,7 +335,7 @@ class s2class {
329
if ( 'html' == $type ) {
330
$headers = $this->headers('html');
331
if ( 'yes' == $this->subscribe2_options['stylesheet'] ) {
332
- $mailtext = apply_filters('s2_html_email', "<html><head><title>" . $subject . "</title><link rel=\"stylesheet\" href=\"" . get_bloginfo('stylesheet_url') . "\" type=\"text/css\" media=\"screen\" /></head><body>" . $message . "</body></html>");
333
} else {
334
$mailtext = apply_filters('s2_html_email', "<html><head><title>" . $subject . "</title></head><body>" . $message . "</body></html>");
335
}
@@ -431,9 +437,9 @@ class s2class {
431
$header['X-Mailer'] = "PHP" . phpversion() . "";
432
if ( $type == 'html' ) {
433
// To send HTML mail, the Content-Type header must be set
434
- $header['Content-Type'] = get_bloginfo('html_type') . "; charset=\"". get_bloginfo('charset') . "\"";
435
} else {
436
- $header['Content-Type'] = "text/plain; charset=\"". get_bloginfo('charset') . "\"";
437
}
438
439
// apply header filter to allow on-the-fly amendments
@@ -753,7 +759,7 @@ class s2class {
753
if ( false !== $this->is_public($email) ) {
754
$check = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE user_email='$this->email'");
755
if ( $check ) { return; }
756
- $wpdb->get_results("UPDATE $this->public SET active='1', ip='$this->ip' WHERE email='$email'");
757
} else {
758
global $current_user;
759
$wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, ip) VALUES (%s, %d, NOW(), %s)", $email, 1, $current_user->user_login));
@@ -778,7 +784,7 @@ class s2class {
778
if ( !is_email($email) ) { return false; }
779
780
if ( false !== $this->is_public($email) ) {
781
- $wpdb->get_results("UPDATE $this->public SET date=NOW() WHERE email='$email'");
782
} else {
783
$wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, ip) VALUES (%s, %d, NOW(), %s)", $email, 0, $this->ip));
784
}
@@ -799,7 +805,7 @@ class s2class {
799
}
800
801
if ( !is_email($email) ) { return false; }
802
- $wpdb->get_results("DELETE FROM $this->public WHERE email='$email'");
803
} // end delete()
804
805
/**
@@ -815,9 +821,9 @@ class s2class {
815
if ( false === $status ) { return false; }
816
817
if ( '0' == $status ) {
818
- $wpdb->get_results("UPDATE $this->public SET active='1' WHERE email='$email'");
819
} else {
820
- $wpdb->get_results("UPDATE $this->public SET active='0' WHERE email='$email'");
821
}
822
} // end toggle()
823
@@ -948,7 +954,7 @@ class s2class {
948
if ( '' == $email ) { return false; }
949
950
// run the query and force case sensitivity
951
- $check = $wpdb->get_var("SELECT active FROM $this->public WHERE email='$email' COLLATE utf8_bin");
952
if ( '0' == $check || '1' == $check ) {
953
return $check;
954
} else {
@@ -1496,15 +1502,32 @@ class s2class {
1496
if ( isset($_POST['s2_admin']) ) {
1497
check_admin_referer('subscribe2-manage_subscribers' . $s2nonce);
1498
if ( $_POST['addresses'] ) {
1499
foreach ( preg_split ("/[\s,]+/", $_POST['addresses']) as $email ) {
1500
if ( is_email($email) && $_POST['subscribe'] ) {
1501
- $this->activate($this->sanitize_email($email));
1502
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) subscribed!', 'subscribe2') . "</strong></p></div>";
1503
} elseif ( is_email($email) && $_POST['unsubscribe'] ) {
1504
- $this->delete($this->sanitize_email($email));
1505
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) unsubscribed!', 'subscribe2') . "</strong></p></div>";
1506
}
1507
}
1508
echo $message;
1509
$_POST['what'] = 'confirmed';
1510
} elseif ( $_POST['process'] ) {
@@ -1948,6 +1971,14 @@ class s2class {
1948
( $_POST['widget'] == '1' ) ? $showwidget = '1' : $showwidget = '0';
1949
$this->subscribe2_options['widget'] = $showwidget;
1950
1951
//automatic subscription
1952
$this->subscribe2_options['autosub'] = $_POST['autosub'];
1953
$this->subscribe2_options['newreg_override'] = $_POST['newreg_override'];
@@ -2089,12 +2120,13 @@ class s2class {
2089
echo "<p class=\"submit\"><input type=\"submit\" class=\"button-secondary\" name=\"preview\" value=\"" . __('Send Email Preview', 'subscribe2') . "\" /></p>\r\n";
2090
echo "<h3>" . __('Message substitions', 'subscribe2') . "</h3>\r\n";
2091
echo "<dl>";
2092
- echo "<dt><b>BLOGNAME</b></dt><dd>" . get_bloginfo('name') . "</dd>\r\n";
2093
- echo "<dt><b>BLOGLINK</b></dt><dd>" . get_bloginfo('url') . "</dd>\r\n";
2094
echo "<dt><b>TITLE</b></dt><dd>" . __("the post's title<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
2095
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";
2096
echo "<dt><b>POSTTIME</b></dt><dd>" . __("the excerpt of the post and the time it was posted<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
2097
echo "<dt><b>TABLE</b></dt><dd>" . __("a list of post titles<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
2098
echo "<dt><b>PERMALINK</b></dt><dd>" . __("the post's permalink<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
2099
echo "<dt><b>TINYLINK</b></dt><dd>" . __("the post's permalink after conversion by TinyURL<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
2100
echo "<dt><b>DATE</b></dt><dd>" . __("the date the post was made<br />(<i>for per-post emails only</i>)", "subscribe2") . "</dd>\r\n";
@@ -2168,7 +2200,21 @@ class s2class {
2168
echo " checked=\"checked\"";
2169
}
2170
echo " /> " . __('Enable Subscribe2 Widget?', 'subscribe2') . "</label><br /><br />\r\n";
2171
- echo"</p>";
2172
2173
//Auto Subscription for new registrations
2174
echo "<h2>" . __('Auto Subscribe', 'subscribe2') . "</h2>\r\n";
@@ -2403,14 +2449,14 @@ class s2class {
2403
$subscribed = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
2404
// if we are subscribed to the current blog display an "unsubscribe" link
2405
if ( !empty($subscribed) ) {
2406
- $unsubscribe_link = get_bloginfo('url') . "/wp-admin/?s2mu_unsubscribe=". $blog_id;
2407
echo "<p><a href=\"". $unsubscribe_link ."\" class=\"button\">" . __('Unsubscribe me from this blog', 'subscribe2') . "</a></p>";
2408
} else {
2409
// else we show a "subscribe" link
2410
- $subscribe_link = get_bloginfo('url') . "/wp-admin/?s2mu_subscribe=". $blog_id;
2411
echo "<p><a href=\"". $subscribe_link ."\" class=\"button\">" . __('Subscribe to all categories', 'subscribe2') . "</a></p>";
2412
}
2413
- echo "<h2>" . __('Subscribed Categories on', 'subscribe2') . " " . get_bloginfo('name') . " </h2>\r\n";
2414
} else {
2415
echo "<h2>" . __('Subscribed Categories', 'subscribe2') . "</h2>\r\n";
2416
}
@@ -2440,7 +2486,7 @@ class s2class {
2440
if ( $this->s2_mu && !isset($_GET['email']) ) {
2441
global $blog_id;
2442
$s2blog_id = $blog_id;
2443
- $blogs = get_blog_list(0, 'all');
2444
2445
$blogs_subscribed = array();
2446
$blogs_notsubscribed = array();
@@ -2461,15 +2507,15 @@ class s2class {
2461
// check if we're subscribed to the blog
2462
$subscribed = get_usermeta($user_ID, $this->get_usermeta_keyname('s2_subscribed'));
2463
2464
- $blogname = get_bloginfo('name');
2465
if ( strlen($blogname) > 30 ) {
2466
$blog['blogname'] = wp_html_excerpt($blogname, 30) . "..";
2467
} else {
2468
$blog['blogname'] = $blogname;
2469
}
2470
- $blog['description'] = get_bloginfo('description');
2471
- $blog['blogurl'] = get_bloginfo('url');
2472
- $blog['subscribe_page'] = get_bloginfo('url') . "/wp-admin/users.php?page=s2_users";
2473
2474
$key = strtolower($blog['blogname'] . "-" . $blog['blog_id']);
2475
if ( !empty($subscribed) ) {
@@ -2915,10 +2961,10 @@ class s2class {
2915
Filter for usermeta table key names to adjust them if needed for WPMU blogs
2916
*/
2917
function get_usermeta_keyname($metaname) {
2918
- global $wpdb, $wp_version, $wpmu_version;
2919
2920
// Is this WordPressMU or not?
2921
- if ( isset($wpmu_version) || strpos($wp_version, 'wordpress-mu') ) {
2922
switch( $metaname ) {
2923
case 's2_subscribed':
2924
case 's2_cat':
@@ -2930,6 +2976,25 @@ class s2class {
2930
return $metaname;
2931
}
2932
2933
/**
2934
Adds a links directly to the settings page from the plugin page
2935
*/
@@ -2976,13 +3041,8 @@ class s2class {
2976
Create meta box on write pages
2977
*/
2978
function s2_meta_init() {
2979
- if ( function_exists('add_meta_box') ) {
2980
- add_meta_box('subscribe2', __('Subscribe2 Notification Override', 'subscribe2' ), array(&$this, 's2_meta_box'), 'post', 'advanced');
2981
- add_meta_box('subscribe2', __('Subscribe2 Notification Override', 'subscribe2' ), array(&$this, 's2_meta_box'), 'page', 'advanced');
2982
- } else {
2983
- add_action('dbx_post_advanced', array(&$this, 's2_meta_box_old'));
2984
- add_action('dbx_page_advanced', array(&$this, 's2_meta_box_old'));
2985
- }
2986
} // end s2_meta_init()
2987
2988
/**
@@ -2994,24 +3054,12 @@ class s2class {
2994
echo "<input type=\"hidden\" name=\"s2meta_nonce\" id=\"s2meta_nonce\" value=\"" . wp_create_nonce(md5(plugin_basename(__FILE__))) . "\" />";
2995
echo __("Check here to disable sending of an email notification for this post/page", 'subscribe2');
2996
echo "&nbsp;&nbsp;<input type=\"checkbox\" name=\"s2_meta_field\" value=\"no\"";
2997
- if ( $s2mail == 'no' ) {
2998
echo " checked=\"checked\"";
2999
}
3000
echo " />";
3001
} // end s2_meta_box()
3002
3003
- /**
3004
- Meta box code for WordPress pre-2.5
3005
- */
3006
- function s2_meta_box_old() {
3007
- echo "<div class=\"dbx-b-ox-wrapper\">\r\n";
3008
- echo "<fieldset id=\"s2_meta_box\" class=\"dbx-box\">\r\n";
3009
- echo "<div class=\"dbx-h-andle-wrapper\"><h3 class=\"dbx-handle\">" . __('Subscribe2 Notification Override', 'subscribe2') . "</h3></div>\r\n";
3010
- echo "<div class=\"dbx-c-ontent-wrapper\"><div class=\"dbx-content\">\r\n";
3011
- $this->s2_meta_box();
3012
- echo "</div></div></fieldset></div>\r\n";
3013
- } // end s2_meta_box_old()
3014
-
3015
/**
3016
Meta box form handler
3017
*/
@@ -3027,7 +3075,7 @@ class s2class {
3027
if ( isset($_POST['s2_meta_field']) && $_POST['s2_meta_field'] == 'no' ) {
3028
update_post_meta($post_id, 's2mail', $_POST['s2_meta_field']);
3029
} else {
3030
- delete_post_meta($post_id, 's2mail');
3031
}
3032
} // end s2_meta_box_handler()
3033
@@ -3143,73 +3191,56 @@ class s2class {
3143
3144
/* ===== widget functions ===== */
3145
/**
3146
- Registers our widget so it appears with the other available
3147
- widgets and can be dragged and dropped into any active sidebars
3148
- */
3149
- function widget_subscribe2widget($args) {
3150
- extract($args);
3151
- $options = get_option('widget_subscribe2widget');
3152
- $title = empty($options['title']) ? __('Subscribe2', 'subscribe2') : $options['title'];
3153
- $div = empty($options['div']) ? 'search' : $options['div'];
3154
- $widgetprecontent = empty($options['widgetprecontent']) ? '' : $options['widgetprecontent'];
3155
- $widgetpostcontent = empty($options['widgetpostcontent']) ? '' : $options['widgetpostcontent'];
3156
- echo $before_widget;
3157
- echo $before_title . $title . $after_title;
3158
- echo "<div class=\"" . $div . "\">";
3159
- $content = s2class::filter('<!--subscribe2-->');
3160
- if ( !empty($widgetprecontent) ) {
3161
- echo $widgetprecontent;
3162
- }
3163
- echo $content;
3164
- if ( !empty($widgetpostcontent) ) {
3165
- echo $widgetpostcontent;
3166
- }
3167
- echo "</div>";
3168
- echo $after_widget;
3169
- } // end widget_subscribe2widget()
3170
-
3171
- /**
3172
- Register the optional widget control form
3173
- */
3174
- function widget_subscribe2widget_control() {
3175
- $options = $newoptions = get_option('widget_subscribe2widget');
3176
- if ( $_POST["s2w-submit"] ) {
3177
- $newoptions['title'] = strip_tags(stripslashes($_POST["s2w-title"]));
3178
- $newoptions['div'] = sanitize_title(strip_tags(stripslashes($_POST["s2w-div"])));
3179
- $newoptions['widgetprecontent'] = stripslashes($_POST["s2w-widgetprecontent"]);
3180
- $newoptions['widgetpostcontent'] = stripslashes($_POST["s2w-widgetpostcontent"]);
3181
- }
3182
- if ( $options != $newoptions ) {
3183
- $options = $newoptions;
3184
- update_option('widget_subscribe2widget', $options);
3185
- }
3186
- $title = htmlspecialchars($options['title'], ENT_QUOTES);
3187
- $widgetprecontent = htmlspecialchars($options['widgetprecontent'], ENT_QUOTES);
3188
- $widgetpostcontent = htmlspecialchars($options['widgetpostcontent'], ENT_QUOTES);
3189
- $div = $options['div'];
3190
- echo "<p><label for=\"s2w-title\">" . __('Title', 'subscribe2') . ":";
3191
- echo "<input class=\"widefat\" id=\"s2w-title\" name=\"s2w-title\" type=\"text\" value=\"" . $title . "\" /></label></p>";
3192
- echo "<p><label for=\"s2w-div\">" . __('Div class name', 'subscribe2') . ":";
3193
- echo "<input class=\"widefat\" id=\"s2w-title\" name=\"s2w-div\" type=\"text\" value=\"" . $div . "\" /></label></p>";
3194
- echo "<p><label for=\"s2w-widgetprecontent\">" . __('Pre-Content', 'subscribe2') . ":";
3195
- echo "<input class=\"widefat\" id=\"s2w-widgetprecontent\" name=\"s2w-widgetprecontent\" type=\"text\" value=\"" . $widgetprecontent . "\" /></label></p>";
3196
- echo "<p><label for=\"s2w-widgetpostcontent\">" . __('Post-Content', 'subscribe2') . ":";
3197
- echo "<input class=\"widefat\" id=\"s2w-widgetpostcontent\" name=\"s2w-widgetpostcontent\" type=\"text\" value=\"" . $widgetpostcontent . "\" /></label></p>";
3198
- echo "<input type=\"hidden\" id=\"s2w-submit\" name=\"s2w-submit\" value=\"1\" />";
3199
- } // end widget_subscribe2_widget_control()
3200
-
3201
- /**
3202
- Actually register the Widget into the WordPress Widget API
3203
- */
3204
- function register_subscribe2widget() {
3205
- //Check Sidebar Widget and Subscribe2 plugins are activated
3206
- if ( !function_exists('register_sidebar_widget') || !class_exists('s2class') ) {
3207
- return;
3208
- } else {
3209
- register_sidebar_widget('Subscribe2', array(&$this, 'widget_subscribe2widget'));
3210
- register_widget_control('Subscribe2', array(&$this, 'widget_subscribe2widget_control'));
3211
- }
3212
- } // end register_subscribe2widget()
3213
3214
function namechange_subscribe2_widget() {
3215
// rename WPMU widgets without requiring user to re-enable
@@ -3255,18 +3286,9 @@ class s2class {
3255
function button_init() {
3256
if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) { return; }
3257
if ( 'true' == get_user_option('rich_editing') ) {
3258
- global $wp_db_version;
3259
- //check if we are using WordPress 2.5+
3260
- if ( $wp_db_version >= 7098 ) {
3261
- // Use WordPress 2.5+ hooks
3262
- add_filter('mce_external_plugins', array(&$this, 'mce3_plugin'));
3263
- add_filter('mce_buttons', array(&$this, 'mce3_button'));
3264
- } else {
3265
- // Load and append our TinyMCE external plugin
3266
- add_filter('mce_plugins', array(&$this, 'mce2_plugin'));
3267
- add_filter('mce_buttons', array(&$this, 'mce2_button'));
3268
- add_filter('tinymce_before_init', array(&$this, 'tinymce2_before_init'));
3269
- }
3270
} else {
3271
buttonsnap_separator();
3272
buttonsnap_jsbutton(WP_CONTENT_URL . '/plugins/' . S2DIR . '/include/s2_button.png', __('Subscribe2', 'subscribe2'), 's2_insert_token();');
@@ -3287,23 +3309,6 @@ class s2class {
3287
return $arr;
3288
}
3289
3290
- // Add buttons in WordPress v2.1+, thanks to An-archos
3291
- function mce2_plugin($plugins) {
3292
- array_push($plugins, '-subscribe2quicktags');
3293
- return $plugins;
3294
- }
3295
-
3296
- function mce2_button($buttons) {
3297
- array_push($buttons, 'separator');
3298
- array_push($buttons, 'subscribe2quicktags');
3299
- return $buttons;
3300
- }
3301
-
3302
- function tinymce2_before_init() {
3303
- $this->fullpath = WP_CONTENT_URL . '/plugins/' . S2DIR . '/tinymce/';
3304
- echo "tinyMCE.loadPlugin('subscribe2quicktags', '" . $this->fullpath . "');\n";
3305
- }
3306
-
3307
function s2_edit_form() {
3308
echo "<!-- Start Subscribe2 Quicktags Javascript -->\r\n";
3309
echo "<script type=\"text/javascript\">\r\n";
@@ -3392,6 +3397,7 @@ class s2class {
3392
$all_post_cats = array();
3393
$mailtext = apply_filters('s2_email_template', $this->subscribe2_options['mailtext']);
3394
$table = '';
3395
$message_post= '';
3396
$message_posttime = '';
3397
foreach ( $posts as $post ) {
@@ -3427,7 +3433,8 @@ class s2class {
3427
continue;
3428
}
3429
$post_title = html_entity_decode($post->post_title, ENT_QUOTES);
3430
- ('' == $table) ? $table = "* " . $post_title : $table .= "\r\n* " . $post_title;
3431
$message_post .= $post_title;
3432
$message_posttime .= $post_title;
3433
if ( strstr($mailtext, "AUTHORNAME") ) {
@@ -3440,6 +3447,7 @@ class s2class {
3440
$message_post .= "\r\n";
3441
$message_posttime .= "\r\n";
3442
3443
$message_post .= get_permalink($post->ID) . "\r\n";
3444
$message_posttime .= __('Posted on', 'subscribe2') . ": " . mysql2date($datetime, $post->post_date) . "\r\n";
3445
$message_posttime .= get_permalink($post->ID) . "\r\n";
@@ -3491,7 +3499,7 @@ class s2class {
3491
$message_posttime = trim($message_posttime);
3492
3493
//sanity check - don't send a mail if the content is empty
3494
- if ( !$message_post && !$message_posttime && !$table ) {
3495
return;
3496
}
3497
@@ -3506,6 +3514,7 @@ class s2class {
3506
( '' == get_option('blogname') ) ? $subject = "" : $subject = "[" . stripslashes(get_option('blogname')) . "] ";
3507
$subject .= $display . " " . __('Digest Email', 'subscribe2');
3508
$mailtext = stripslashes($this->substitute($mailtext));
3509
$mailtext = str_replace("TABLE", $table, $mailtext);
3510
$mailtext = str_replace("POSTTIME", $message_posttime, $mailtext);
3511
$mailtext = str_replace("POST", $message_post, $mailtext);
@@ -3536,10 +3545,19 @@ class s2class {
3536
if ( '1' == $this->subscribe2_options['show_button'] ) {
3537
add_action('init', array(&$this, 'button_init'));
3538
}
3539
// add action to display widget if option is enabled
3540
if ( '1' == $this->subscribe2_options['widget'] ) {
3541
- add_action('plugins_loaded', array(&$this, 'register_subscribe2widget'));
3542
}
3543
// add action to handle WPMU subscriptions and unsubscriptions
3544
if ( isset($_GET['s2mu_subscribe']) || isset($_GET['s2mu_unsubscribe']) ) {
3545
add_action('init', array(&$this, 'wpmu_subscribe'));
@@ -3552,10 +3570,12 @@ class s2class {
3552
load_plugin_textdomain('subscribe2', 'wp-content/plugins/' . S2DIR, '/' . S2DIR);
3553
3554
// Is this WordPressMU or not?
3555
if ( isset($wpmu_version) || strpos($wp_version, 'wordpress-mu') ) {
3556
$this->s2_mu = true;
3557
- } else {
3558
- $this->s2_mu = false;
3559
}
3560
3561
// do we need to install anything?
@@ -3568,6 +3588,8 @@ class s2class {
3568
3569
if ( isset($_GET['s2']) ) {
3570
// someone is confirming a request
3571
add_filter('query_string', array(&$this, 'query_filter'));
3572
add_filter('the_title', array(&$this, 'title_filter'));
3573
add_filter('the_content', array(&$this, 'confirm'));
3
Plugin Name: Subscribe2
4
Plugin URI: http://subscribe2.wordpress.com
5
Description: Notifies an email list when new entries are posted.
6
+ Version: 6.0
7
Author: Matthew Robinson
8
Author URI: http://subscribe2.wordpress.com
9
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904
10
*/
11
12
/*
13
+ Copyright (C) 2006-10 Matthew Robinson
14
Based on the Original Subscribe2 plugin by
15
Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
16
32
33
// our version number. Don't touch this or any line below
34
// unless you know exacly what you are doing
35
+ define( 'S2VERSION', '6.0' );
36
define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
37
define( 'S2DIR', plugin_basename(dirname(__FILE__)) );
38
42
@ini_set('max_execution_time', 300);
43
}
44
45
/* Include buttonsnap library by Owen Winckler */
46
if ( !class_exists('buttonsnap') ) {
47
require( WP_CONTENT_DIR . '/plugins/' . S2DIR . '/include/buttonsnap.php' );
63
$this->please_log_in = "<p>" . __('To manage your subscription options please', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-login.php\">" . __('login', 'subscribe2') . "</a>.</p>";
64
65
$this->use_profile_admin = "<p>" . __('You may manage your subscription options from your', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-admin/users.php?page=s2_users\">" . __('profile', 'subscribe2') . "</a>.</p>";
66
+ if ( $this->s2_mu === true) {
67
+ global $blog_id, $user_ID;
68
+ if ( !is_blog_user($blog_id) ) {
69
+ // if we are on multisite and the user is not a member of this blog change the link
70
+ $this->use_profile_admin = "<p><a href=\"" . get_option('siteurl') . "/wp-admin/?s2mu_subscribe=" . $blog_id . "\">" . __('Subscribe', 'subscribe2') . "</a>" . __('to email notifications when this blog posts new content', 'subscribe2') . ".</p>";
71
+ }
72
+ }
73
74
$this->use_profile_users = "<p>" . __('You may manage your subscription options from your', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-admin/profile.php?page=s2_users\">" . __('profile', 'subscribe2') . "</a>.</p>";
75
+ if ( $this->s2_mu === true) {
76
+ global $blog_id, $user_ID;
77
+ if ( !is_blog_user($blog_id) ) {
78
+ // if we are on multisite and the user is not a member of this blog change the link
79
+ $this->use_profile_users = "<p><a href=\"" . get_option('siteurl') . "/wp-admin/?s2mu_subscribe=" . $blog_id . "\">" . __('Subscribe', 'subscribe2') . "</a>" . __('to email notifications when this blog posts new content', 'subscribe2') . ".</p>";
80
+ }
81
+ }
82
83
$this->confirmation_sent = "<p>" . __('A confirmation message is on its way!', 'subscribe2') . "</p>";
84
232
update_option('subscribe2_options', $this->subscribe2_options);
233
234
// upgrade old wpmu user meta data to new
235
+ if ( $this->s2_mu === true ) {
236
$this->namechange_subscribe2_widget();
237
// loop through all users
238
foreach ( $users as $user ) {
276
foreach ( $public_subscribers as $email ) {
277
$new_email = $this->sanitize_email($email);
278
if ( $email !== $new_email ) {
279
+ $wpdb->get_results("UPDATE $this->public SET email='$new_email' WHERE CAST(email as binary)='$email'");
280
}
281
}
282
} // end upgrade()
301
return;
302
}
303
$string = str_replace("BLOGNAME", html_entity_decode(get_option('blogname'), ENT_QUOTES), $string);
304
+ $string = str_replace("BLOGLINK", get_option('home'), $string);
305
$string = str_replace("TITLE", stripslashes($this->post_title), $string);
306
$link = "<a href=\"" . $this->permalink . "\">" . $this->permalink . "</a>";
307
$string = str_replace("PERMALINK", $link, $string);
335
if ( 'html' == $type ) {
336
$headers = $this->headers('html');
337
if ( 'yes' == $this->subscribe2_options['stylesheet'] ) {
338
+ $mailtext = apply_filters('s2_html_email', "<html><head><title>" . $subject . "</title><link rel=\"stylesheet\" href=\"" . get_stylesheet_uri() . "\" type=\"text/css\" media=\"screen\" /></head><body>" . $message . "</body></html>");
339
} else {
340
$mailtext = apply_filters('s2_html_email', "<html><head><title>" . $subject . "</title></head><body>" . $message . "</body></html>");
341
}
437
$header['X-Mailer'] = "PHP" . phpversion() . "";
438
if ( $type == 'html' ) {
439
// To send HTML mail, the Content-Type header must be set
440
+ $header['Content-Type'] = get_option('html_type') . "; charset=\"". get_option('blog_charset') . "\"";
441
} else {
442
+ $header['Content-Type'] = "text/plain; charset=\"". get_option('blog_charset') . "\"";
443
}
444
445
// apply header filter to allow on-the-fly amendments
759
if ( false !== $this->is_public($email) ) {
760
$check = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE user_email='$this->email'");
761
if ( $check ) { return; }
762
+ $wpdb->get_results("UPDATE $this->public SET active='1', ip='$this->ip' WHERE CAST(email as binary)='$email'");
763
} else {
764
global $current_user;
765
$wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, ip) VALUES (%s, %d, NOW(), %s)", $email, 1, $current_user->user_login));
784
if ( !is_email($email) ) { return false; }
785
786
if ( false !== $this->is_public($email) ) {
787
+ $wpdb->get_results("UPDATE $this->public SET date=NOW() WHERE CAST(email as binary)='$email'");
788
} else {
789
$wpdb->get_results($wpdb->prepare("INSERT INTO $this->public (email, active, date, ip) VALUES (%s, %d, NOW(), %s)", $email, 0, $this->ip));
790
}
805
}
806
807
if ( !is_email($email) ) { return false; }
808
+ $wpdb->get_results("DELETE FROM $this->public WHERE CAST(email as binary)='$email'");
809
} // end delete()
810
811
/**
821
if ( false === $status ) { return false; }
822
823
if ( '0' == $status ) {
824
+ $wpdb->get_results("UPDATE $this->public SET active='1' WHERE CAST(email as binary)='$email'");
825
} else {
826
+ $wpdb->get_results("UPDATE $this->public SET active='0' WHERE CAST(email as binary)='$email'");
827
}
828
} // end toggle()
829
954
if ( '' == $email ) { return false; }
955
956
// run the query and force case sensitivity
957
+ $check = $wpdb->get_var("SELECT active FROM $this->public WHERE CAST(email as binary)='$email'");
958
if ( '0' == $check || '1' == $check ) {
959
return $check;
960
} else {
1502
if ( isset($_POST['s2_admin']) ) {
1503
check_admin_referer('subscribe2-manage_subscribers' . $s2nonce);
1504
if ( $_POST['addresses'] ) {
1505
+ $sub_error = '';
1506
+ $unsub_error = '';
1507
foreach ( preg_split ("/[\s,]+/", $_POST['addresses']) as $email ) {
1508
+ $email = $this->sanitize_email($email);
1509
if ( is_email($email) && $_POST['subscribe'] ) {
1510
+ if ( $this->is_public($email) !== false ) {
1511
+ ('' == $sub_error) ? $sub_error = "$email" : $sub_error .= ", $email";
1512
+ continue;
1513
+ }
1514
+ $this->activate($email);
1515
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) subscribed!', 'subscribe2') . "</strong></p></div>";
1516
} elseif ( is_email($email) && $_POST['unsubscribe'] ) {
1517
+ if ( $this->is_public($email) === false ) {
1518
+ ('' == $unsub_error) ? $unsub_error = "$email" : $unsub_error .= ", $email";
1519
+ continue;
1520
+ }
1521
+ $this->delete($email);
1522
$message = "<div id=\"message\" class=\"updated fade\"><p><strong>" . __('Address(es) unsubscribed!', 'subscribe2') . "</strong></p></div>";
1523
}
1524
}
1525
+ if ( $sub_error != '' ) {
1526
+ echo "<div id=\"message\" class=\"error\"><p><strong>" . __('Some emails were not processed, the following were already subscribed' , 'subscribe2') . ":<br />$sub_error</strong></p></div>";
1527
+ }
1528
+ if ( $unsub_error != '' ) {
1529
+ echo "<div id=\"message\" class=\"error\"><p><strong>" . __('Some emails were not processed, the following were not in the database' , 'subscribe2') . ":<br />$unsub_error</strong></p></div>";
1530
+ }
1531
echo $message;
1532
$_POST['what'] = 'confirmed';
1533
} elseif ( $_POST['process'] ) {
1971
( $_POST['widget'] == '1' ) ? $showwidget = '1' : $showwidget = '0';
1972
$this->subscribe2_options['widget'] = $showwidget;
1973
1974
+ // show counterwidget in Presentation->Widgets
1975
+ ( $_POST['counterwidget'] == '1' ) ? $showcounterwidget = '1' : $showcounterwidget = '0';
1976
+ $this->subscribe2_options['counterwidget'] = $showcounterwidget;
1977
+
1978
+ // Subscribe2 over ride postmeta checked by default
1979
+ ( $_POST['s2meta_default'] == '1' ) ? $s2meta_default = '1' : $s2meta_default = '0';
1980
+ $this->subscribe2_options['s2meta_default'] = $s2meta_default;
1981
+
1982
//automatic subscription
1983
$this->subscribe2_options['autosub'] = $_POST['autosub'];
1984
$this->subscribe2_options['newreg_override'] = $_POST['newreg_override'];
2120
echo "<p class=\"submit\"><input type=\"submit\" class=\"button-secondary\" name=\"preview\" value=\"" . __('Send Email Preview', 'subscribe2') . "\" /></p>\r\n";
2121
echo "<h3>" . __('Message substitions', 'subscribe2') . "</h3>\r\n";
2122
echo "<dl>";
2123
+ echo "<dt><b>BLOGNAME</b></dt><dd>" . get_option('blogname') . "</dd>\r\n";
2124
+ echo "<dt><b>BLOGLINK</b></dt><dd>" . get_option('home') . "</dd>\r\n";
2125
echo "<dt><b>TITLE</b></dt><dd>" . __("the post's title<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
2126
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";
2127
echo "<dt><b>POSTTIME</b></dt><dd>" . __("the excerpt of the post and the time it was posted<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
2128
echo "<dt><b>TABLE</b></dt><dd>" . __("a list of post titles<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
2129
+ echo "<dt><b>TABLELINKS</b></dt><dd>" . __("a list of post titles followed by links to the atricles<br />(<i>for digest emails only</i>)", 'subscribe2') . "</dd>\r\n";
2130
echo "<dt><b>PERMALINK</b></dt><dd>" . __("the post's permalink<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
2131
echo "<dt><b>TINYLINK</b></dt><dd>" . __("the post's permalink after conversion by TinyURL<br />(<i>for per-post emails only</i>)", 'subscribe2') . "</dd>\r\n";
2132
echo "<dt><b>DATE</b></dt><dd>" . __("the date the post was made<br />(<i>for per-post emails only</i>)", "subscribe2") . "</dd>\r\n";
2200
echo " checked=\"checked\"";
2201
}
2202
echo " /> " . __('Enable Subscribe2 Widget?', 'subscribe2') . "</label><br /><br />\r\n";
2203
+
2204
+ // show Counter Widget
2205
+ echo "<label><input type=\"checkbox\" name=\"counterwidget\" value=\"1\"";
2206
+ if ( '1' == $this->subscribe2_options['counterwidget'] ) {
2207
+ echo " checked=\"checked\"";
2208
+ }