Newsletter - Version 3.7.3

Version Description

Download this release

Release Info

Developer satollo
Plugin Icon 128x128 Newsletter
Version 3.7.3
Comparing to
See all releases

Code changes from version 3.6.3 to 3.7.3

Files changed (112) hide show
  1. admin.css +496 -385
  2. do/profile.php +1 -1
  3. do/subscribe.php +17 -0
  4. emails/create.php +43 -0
  5. emails/edit.php +110 -106
  6. emails/editor.css +4 -0
  7. emails/emails.php +7 -1
  8. emails/index.php +28 -24
  9. emails/languages/en_US.php +2 -0
  10. emails/languages/en_US.po +172 -0
  11. emails/languages/it_IT.mo +0 -0
  12. emails/languages/it_IT.po +180 -0
  13. emails/new.php +78 -38
  14. emails/theme.php +23 -19
  15. emails/themes/blank/theme-text.php +7 -6
  16. emails/themes/default/footer.php +8 -0
  17. emails/themes/default/images/facebook.png +0 -0
  18. emails/themes/default/images/googleplus.png +0 -0
  19. emails/themes/default/images/linkedin.png +0 -0
  20. emails/themes/default/images/twitter.png +0 -0
  21. emails/themes/default/images/vimeo.png +0 -0
  22. emails/themes/default/images/youtube.png +0 -0
  23. emails/themes/default/screenshot.png +0 -0
  24. emails/themes/default/social.php +3 -3
  25. emails/themes/default/social_main.php +44 -0
  26. emails/themes/default/theme-options.php +73 -38
  27. emails/themes/default/theme-text.php +2 -2
  28. emails/themes/default/theme.php +29 -17
  29. emails/themes/linear/theme-options.php +7 -0
  30. emails/themes/linear/theme-text.php +2 -2
  31. emails/themes/linear/theme.php +16 -10
  32. emails/themes/pint/theme-text.php +2 -2
  33. emails/themes/simple/theme-text.php +2 -2
  34. emails/themes/theme-1/theme-options.php +0 -1
  35. emails/themes/theme-3/theme-options.php +0 -1
  36. emails/themes/vimeo-like/theme-options.php +15 -8
  37. emails/themes/vimeo-like/theme-text.php +2 -2
  38. emails/themes/vimeo-like/theme.php +12 -7
  39. emails/themes/xmas-2014/images/footer.png +0 -0
  40. emails/themes/xmas-2014/images/header.png +0 -0
  41. emails/themes/xmas-2014/screenshot.png +0 -0
  42. emails/themes/xmas-2014/theme.php +122 -0
  43. feed/feed.php +1 -82
  44. feed/index.php +7 -332
  45. feed/languages/en_US.php +0 -6
  46. feed/preview.php +0 -11
  47. feed/themes/default/theme-options.php +0 -67
  48. feed/themes/default/theme.php +0 -104
  49. header-extension.php +7 -6
  50. header-new.php +56 -54
  51. header.php +9 -8
  52. images/animated-overlay.gif +0 -0
  53. images/arrow.png +0 -0
  54. images/header/debug.png +0 -0
  55. images/header/logo.png +0 -0
  56. images/header/tnp-logo-white-header@2x1.png +0 -0
  57. images/menu-icon.png +0 -0
  58. images/nomedia.png +0 -0
  59. images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  60. images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  61. images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  62. images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  63. images/ui-bg_glass_75_dadada_1x400.png +0 -0
  64. images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  65. images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  66. images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  67. images/ui-icons_222222_256x240.png +0 -0
  68. images/ui-icons_2e83ff_256x240.png +0 -0
  69. images/ui-icons_454545_256x240.png +0 -0
  70. images/ui-icons_888888_256x240.png +0 -0
  71. images/ui-icons_cd0a0a_256x240.png +0 -0
  72. includes/controls.php +92 -26
  73. includes/logger.php +6 -2
  74. includes/module.php +14 -31
  75. includes/themes.php +46 -18
  76. main/diagnostic.php +179 -42
  77. main/index.php +27 -27
  78. main/main.php +242 -118
  79. plugin.php +147 -83
  80. readme.txt +88 -11
  81. statistics/index.php +48 -16
  82. statistics/statistics.php +66 -12
  83. statistics/view.php +46 -9
  84. subscription/email-alternative.php +18 -3
  85. subscription/email.html +29 -0
  86. subscription/email.php +4 -11
  87. subscription/forms.php +3 -3
  88. subscription/languages/de_DE.php +3 -1
  89. subscription/languages/en_US.php +4 -2
  90. subscription/languages/es_ES.php +2 -0
  91. subscription/languages/fr_FR.php +2 -0
  92. subscription/languages/it_IT.php +2 -0
  93. subscription/languages/nl_NL.php +2 -0
  94. subscription/languages/pl_PL.php +2 -0
  95. subscription/languages/profile-en_US.php +2 -0
  96. subscription/languages/profile-it_IT.php +2 -0
  97. subscription/languages/pt_BR.php +2 -0
  98. subscription/languages/ru_RU.php +2 -0
  99. subscription/menu.inc.php +3 -3
  100. subscription/options.php +180 -109
  101. subscription/profile.php +70 -81
  102. subscription/styles/shortcode-default.css +61 -0
  103. subscription/subscription.php +298 -72
  104. users/edit.php +2 -2
  105. users/import.php +22 -19
  106. users/index-old.php +1 -1
  107. users/index.php +39 -23
  108. users/massive.php +80 -78
  109. users/menu.inc.php +6 -6
  110. users/new.php +1 -1
  111. users/stats.php +3 -3
  112. widget.php +2 -2
admin.css CHANGED
@@ -1,380 +1,387 @@
1
- /*
2
- * jQuery UI CSS Framework 1.8.16
3
- *
4
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT or GPL Version 2 licenses.
6
- * http://jquery.org/license
7
- *
8
- * http://docs.jquery.com/UI/Theming/API
9
- */
 
10
 
11
  /* Layout helpers
12
  ----------------------------------*/
13
- .ui-helper-hidden { display: none; }
14
- .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
- .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
- .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
- .ui-helper-clearfix { display: inline-block; }
18
- /* required comment for clearfix to work in Opera \*/
19
- * html .ui-helper-clearfix { height:1%; }
20
- .ui-helper-clearfix { display:block; }
21
- /* end clearfix */
22
- .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
 
25
  /* Interaction Cues
26
  ----------------------------------*/
27
- .ui-state-disabled { cursor: default !important; }
 
 
28
 
29
 
30
  /* Icons
31
  ----------------------------------*/
32
 
33
  /* states and images */
34
- .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
 
 
 
 
 
35
 
36
 
37
  /* Misc visuals
38
  ----------------------------------*/
39
 
40
  /* Overlays */
41
- .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42
- /*
43
- * jQuery UI Accordion 1.8.16
44
- *
45
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
46
- * Dual licensed under the MIT or GPL Version 2 licenses.
47
- * http://jquery.org/license
48
- *
49
- * http://docs.jquery.com/UI/Accordion#theming
50
- */
51
- /* IE/Win - Fix animation bug - #4615 */
52
- .ui-accordion { width: 100%; }
53
- .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
54
- .ui-accordion .ui-accordion-li-fix { display: inline; }
55
- .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
56
- .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
57
- .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
58
- .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
59
- .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
60
- .ui-accordion .ui-accordion-content-active { display: block; }
61
- /*
62
- * jQuery UI Autocomplete 1.8.16
63
- *
64
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
65
- * Dual licensed under the MIT or GPL Version 2 licenses.
66
- * http://jquery.org/license
67
- *
68
- * http://docs.jquery.com/UI/Autocomplete#theming
69
- */
70
- .ui-autocomplete { position: absolute; cursor: default; }
71
-
72
- /* workarounds */
73
- * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
- /*
76
- * jQuery UI Menu 1.8.16
77
- *
78
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
79
- * Dual licensed under the MIT or GPL Version 2 licenses.
80
- * http://jquery.org/license
81
- *
82
- * http://docs.jquery.com/UI/Menu#theming
83
- */
84
- .ui-menu {
85
- list-style:none;
86
- padding: 2px;
87
- margin: 0;
88
- display:block;
89
- float: left;
90
  }
91
- .ui-menu .ui-menu {
92
- margin-top: -3px;
93
  }
94
- .ui-menu .ui-menu-item {
95
- margin:0;
96
- padding: 0;
97
- zoom: 1;
98
- float: left;
99
- clear: left;
100
- width: 100%;
101
  }
102
- .ui-menu .ui-menu-item a {
103
- text-decoration:none;
104
- display:block;
105
- padding:.2em .4em;
106
- line-height:1.5;
107
- zoom:1;
108
  }
109
- .ui-menu .ui-menu-item a.ui-state-hover,
110
- .ui-menu .ui-menu-item a.ui-state-active {
111
- font-weight: normal;
112
- margin: -1px;
 
 
 
 
 
 
 
113
  }
114
- /*
115
- * jQuery UI Button 1.8.16
116
- *
117
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
118
- * Dual licensed under the MIT or GPL Version 2 licenses.
119
- * http://jquery.org/license
120
- *
121
- * http://docs.jquery.com/UI/Button#theming
122
- */
123
- .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
124
- .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
125
- button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
126
- .ui-button-icons-only { width: 3.4em; }
127
- button.ui-button-icons-only { width: 3.7em; }
128
-
129
- /*button text element */
130
- .ui-button .ui-button-text { display: block; line-height: 1.4; }
131
- .ui-button-text-only .ui-button-text { padding: .4em 1em; }
132
- .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
133
- .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
134
- .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
135
- .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
136
- /* no icon support for input elements, provide padding by default */
137
- input.ui-button { padding: .4em 1em; }
138
-
139
- /*button icon element(s) */
140
- .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
141
- .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
142
- .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
143
- .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
144
- .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
145
-
146
- /*button sets*/
147
- .ui-buttonset { margin-right: 7px; }
148
- .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
149
-
150
- /* workarounds */
151
- button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
152
- /*
153
- * jQuery UI Datepicker 1.8.16
154
- *
155
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
156
- * Dual licensed under the MIT or GPL Version 2 licenses.
157
- * http://jquery.org/license
158
- *
159
- * http://docs.jquery.com/UI/Datepicker#theming
160
- */
161
- .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
162
- .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
163
- .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
164
- .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
165
- .ui-datepicker .ui-datepicker-prev { left:2px; }
166
- .ui-datepicker .ui-datepicker-next { right:2px; }
167
- .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
168
- .ui-datepicker .ui-datepicker-next-hover { right:1px; }
169
- .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
170
- .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
171
- .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
172
- .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
173
- .ui-datepicker select.ui-datepicker-month,
174
- .ui-datepicker select.ui-datepicker-year { width: 49%;}
175
- .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
176
- .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
177
- .ui-datepicker td { border: 0; padding: 1px; }
178
- .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
179
- .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
180
- .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
181
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
182
-
183
- /* with multiple calendars */
184
- .ui-datepicker.ui-datepicker-multi { width:auto; }
185
- .ui-datepicker-multi .ui-datepicker-group { float:left; }
186
- .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
187
- .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
188
- .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
189
- .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
190
- .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
191
- .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
192
- .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
193
- .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
194
-
195
- /* RTL support */
196
- .ui-datepicker-rtl { direction: rtl; }
197
- .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
198
- .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
199
- .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
200
- .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
201
- .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
202
- .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
203
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
204
- .ui-datepicker-rtl .ui-datepicker-group { float:right; }
205
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
206
- .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
207
-
208
- /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
209
- .ui-datepicker-cover {
210
- display: none; /*sorry for IE5*/
211
- display/**/: block; /*sorry for IE5*/
212
- position: absolute; /*must have*/
213
- z-index: -1; /*must have*/
214
- filter: mask(); /*must have*/
215
- top: -4px; /*must have*/
216
- left: -4px; /*must have*/
217
- width: 200px; /*must have*/
218
- height: 200px; /*must have*/
219
- }/*
220
- * jQuery UI Dialog 1.8.16
221
- *
222
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
223
- * Dual licensed under the MIT or GPL Version 2 licenses.
224
- * http://jquery.org/license
225
- *
226
- * http://docs.jquery.com/UI/Dialog#theming
227
- */
228
- .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
229
- .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
230
- .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
231
- .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
232
- .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
233
- .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
234
- .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
235
- .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
236
- .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
237
- .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
238
- .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
239
- .ui-draggable .ui-dialog-titlebar { cursor: move; }
240
- /*
241
- * jQuery UI Progressbar 1.8.16
242
- *
243
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
244
- * Dual licensed under the MIT or GPL Version 2 licenses.
245
- * http://jquery.org/license
246
- *
247
- * http://docs.jquery.com/UI/Progressbar#theming
248
- */
249
- .ui-progressbar { height:2em; text-align: left; }
250
- .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/*
251
- * jQuery UI Resizable 1.8.16
252
- *
253
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
254
- * Dual licensed under the MIT or GPL Version 2 licenses.
255
- * http://jquery.org/license
256
- *
257
- * http://docs.jquery.com/UI/Resizable#theming
258
- */
259
- .ui-resizable { position: relative;}
260
- .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
261
- .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
262
- .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
263
- .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
264
- .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
265
- .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
266
- .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
267
- .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
268
- .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
269
- .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
270
- * jQuery UI Selectable 1.8.16
271
- *
272
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
273
- * Dual licensed under the MIT or GPL Version 2 licenses.
274
- * http://jquery.org/license
275
- *
276
- * http://docs.jquery.com/UI/Selectable#theming
277
- */
278
- .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
279
- /*
280
- * jQuery UI Slider 1.8.16
281
- *
282
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
283
- * Dual licensed under the MIT or GPL Version 2 licenses.
284
- * http://jquery.org/license
285
- *
286
- * http://docs.jquery.com/UI/Slider#theming
287
- */
288
- .ui-slider { position: relative; text-align: left; }
289
- .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
290
- .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
291
-
292
- .ui-slider-horizontal { height: .8em; }
293
- .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
294
- .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
295
- .ui-slider-horizontal .ui-slider-range-min { left: 0; }
296
- .ui-slider-horizontal .ui-slider-range-max { right: 0; }
297
-
298
- .ui-slider-vertical { width: .8em; height: 100px; }
299
- .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
300
- .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
301
- .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
302
- .ui-slider-vertical .ui-slider-range-max { top: 0; }/*
303
- * jQuery UI Tabs 1.8.16
304
- *
305
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
306
- * Dual licensed under the MIT or GPL Version 2 licenses.
307
- * http://jquery.org/license
308
- *
309
- * http://docs.jquery.com/UI/Tabs#theming
310
- */
311
- .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
312
- .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
313
- .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
314
- .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
315
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
316
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
317
- .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
318
- .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
319
- .ui-tabs .ui-tabs-hide { display: none !important; }
320
- /*
321
- * jQuery UI CSS Framework 1.8.16
322
- *
323
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
324
- * Dual licensed under the MIT or GPL Version 2 licenses.
325
- * http://jquery.org/license
326
- *
327
- * http://docs.jquery.com/UI/Theming/API
328
- *
329
- * To view and modify this theme, visit http://jqueryui.com/themeroller/
330
- */
331
-
332
-
333
- /* Component containers
334
- ----------------------------------*/
335
- .ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
336
- .ui-widget .ui-widget { font-size: 1em; }
337
- .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
338
- .ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
339
- .ui-widget-content a { color: #222222/*{fcContent}*/; }
340
- .ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; }
341
- .ui-widget-header a { color: #222222/*{fcHeader}*/; }
342
 
343
  /* Interaction states
344
  ----------------------------------*/
345
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }
346
- .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; }
347
- .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; }
348
- .ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; }
349
- .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; }
350
- .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; }
351
- .ui-widget :active { outline: none; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
 
353
  /* Interaction Cues
354
  ----------------------------------*/
355
- .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
356
- .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
357
- .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
358
- .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
359
- .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
360
- .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
361
- .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
362
- .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
 
364
  /* Icons
365
  ----------------------------------*/
366
 
367
  /* states and images */
368
- .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
369
- .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
370
- .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; }
371
- .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }
372
- .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; }
373
- .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; }
374
- .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; }
375
- .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
 
377
  /* positioning */
 
378
  .ui-icon-carat-1-n { background-position: 0 0; }
379
  .ui-icon-carat-1-ne { background-position: -16px 0; }
380
  .ui-icon-carat-1-e { background-position: -32px 0; }
@@ -501,8 +508,8 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
501
  .ui-icon-help { background-position: -48px -144px; }
502
  .ui-icon-check { background-position: -64px -144px; }
503
  .ui-icon-bullet { background-position: -80px -144px; }
504
- .ui-icon-radio-off { background-position: -96px -144px; }
505
- .ui-icon-radio-on { background-position: -112px -144px; }
506
  .ui-icon-pin-w { background-position: -128px -144px; }
507
  .ui-icon-pin-s { background-position: -144px -144px; }
508
  .ui-icon-play { background-position: 0 -160px; }
@@ -556,18 +563,45 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
556
  ----------------------------------*/
557
 
558
  /* Corner radius */
559
- .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -khtml-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; }
560
- .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -khtml-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
561
- .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
562
- .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
563
 
564
  /* Overlays */
565
- .ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
566
- .ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; }
567
-
568
-
569
-
570
-
 
 
 
 
 
 
 
571
 
572
 
573
 
@@ -601,21 +635,23 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
601
  /* Admin header */
602
  #newsletter-header-new {
603
  text-align: left;
604
- background-color: #fff;
605
  padding: 10px;
606
- xpadding-left: 15px;
607
- xborder-radius: 3px;
608
- xtext-transform: uppercase;
609
  font-size: 12px;
610
  border: 1px solid #ccc;
611
- float: right;
612
- width: 300px;
613
- xmargin-bottom: 10px;
614
  }
615
 
616
  #newsletter-header-new a {
617
- margin-right: 10px;
618
  text-decoration: none;
 
 
 
 
 
 
 
619
  }
620
 
621
  /* Admin header for extensions */
@@ -646,15 +682,26 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
646
  }
647
 
648
  .newsletter-separator {
649
- clear: both;
650
  height: 5px;
651
  }
652
 
 
653
  .wrap, .wrap td, .wrap th, .wrap input, .wrap textarea {
654
  font-size: 13px;
655
  font-family: sans-serif;
656
  line-height: 130%;
657
  }
 
 
 
 
 
 
 
 
 
 
658
 
659
  .wrap td a {
660
  text-decoration: underline;
@@ -665,29 +712,16 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
665
  }
666
 
667
  .wrap h2 {
668
- xcolor: #21759B;
669
- xfont-size: 20px;
670
- xmargin: 10px 0;
671
- xpadding: 0;
672
- xfont-family: Georgia;
673
  }
674
 
675
  .wrap h3 {
676
- font-family: Georgia;
677
  }
678
 
679
  .wrap h4 {
680
- font-size: 1.1em;
681
- font-weight: bold;
682
- font-family: Georgia;
683
- font-style: italic;
684
  }
685
 
686
  .wrap h5 {
687
- color: #666;
688
- font-size: 14px;
689
- padding: 0;
690
- margin: 10px 0;
691
  }
692
 
693
  .wrap ul li {
@@ -704,6 +738,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
704
  font-weight: bold;
705
  border-right: 1px solid #ddd;
706
  max-width: 200px;
 
707
  }
708
  .form-table th small {
709
  font-weight: normal;
@@ -862,19 +897,19 @@ table.clicks {
862
  }
863
  */
864
 
865
- .newsletter-notice {
866
- background-color: lightYellow;
867
- border-color: #E6DB55;
868
- border-radius: 3px;
869
- border-style: solid;
870
- border-width: 1px;
871
- padding: .6em;
872
- margin-bottom: .6em;
873
- margin-top: .6em;
874
  }
875
 
876
- .newsletter-dismiss {
877
- float: right;
 
 
 
 
 
 
878
  }
879
 
880
  .newsletter-message {
@@ -1011,3 +1046,79 @@ table.clicks {
1011
  margin-top: 0;
1012
  }
1013
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.10.4 - 2014-04-29
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.tabs.css, jquery.ui.theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ /* Imports */
8
+
9
+ @import url(http://fonts.googleapis.com/css?family=Montserrat:400,700);
10
+ @import url(//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css);
11
 
12
  /* Layout helpers
13
  ----------------------------------*/
14
+ .ui-helper-hidden {
15
+ display: none;
16
+ }
17
+ .ui-helper-hidden-accessible {
18
+ border: 0;
19
+ clip: rect(0 0 0 0);
20
+ height: 1px;
21
+ margin: -1px;
22
+ overflow: hidden;
23
+ padding: 0;
24
+ position: absolute;
25
+ width: 1px;
26
+ }
27
+ .ui-helper-reset {
28
+ margin: 0;
29
+ padding: 0;
30
+ border: 0;
31
+ outline: 0;
32
+ line-height: 1.3;
33
+ text-decoration: none;
34
+ font-size: 100%;
35
+ list-style: none;
36
+ }
37
+ .ui-helper-clearfix:before,
38
+ .ui-helper-clearfix:after {
39
+ content: "";
40
+ display: table;
41
+ border-collapse: collapse;
42
+ }
43
+ .ui-helper-clearfix:after {
44
+ clear: both;
45
+ }
46
+ .ui-helper-clearfix {
47
+ min-height: 0; /* support: IE7 */
48
+ }
49
+ .ui-helper-zfix {
50
+ width: 100%;
51
+ height: 100%;
52
+ top: 0;
53
+ left: 0;
54
+ position: absolute;
55
+ opacity: 0;
56
+ filter:Alpha(Opacity=0);
57
+ }
58
+
59
+ .ui-front {
60
+ z-index: 100;
61
+ }
62
 
63
 
64
  /* Interaction Cues
65
  ----------------------------------*/
66
+ .ui-state-disabled {
67
+ cursor: default !important;
68
+ }
69
 
70
 
71
  /* Icons
72
  ----------------------------------*/
73
 
74
  /* states and images */
75
+ .ui-icon {
76
+ display: block;
77
+ text-indent: -99999px;
78
+ overflow: hidden;
79
+ background-repeat: no-repeat;
80
+ }
81
 
82
 
83
  /* Misc visuals
84
  ----------------------------------*/
85
 
86
  /* Overlays */
87
+ .ui-widget-overlay {
88
+ position: fixed;
89
+ top: 0;
90
+ left: 0;
91
+ width: 100%;
92
+ height: 100%;
93
+ }
94
+ .ui-resizable {
95
+ position: relative;
96
+ }
97
+ .ui-resizable-handle {
98
+ position: absolute;
99
+ font-size: 0.1px;
100
+ display: block;
101
+ }
102
+ .ui-resizable-disabled .ui-resizable-handle,
103
+ .ui-resizable-autohide .ui-resizable-handle {
104
+ display: none;
105
+ }
106
+ .ui-resizable-n {
107
+ cursor: n-resize;
108
+ height: 7px;
109
+ width: 100%;
110
+ top: -5px;
111
+ left: 0;
112
+ }
113
+ .ui-resizable-s {
114
+ cursor: s-resize;
115
+ height: 7px;
116
+ width: 100%;
117
+ bottom: -5px;
118
+ left: 0;
119
+ }
120
+ .ui-resizable-e {
121
+ cursor: e-resize;
122
+ width: 7px;
123
+ right: -5px;
124
+ top: 0;
125
+ height: 100%;
126
+ }
127
+ .ui-resizable-w {
128
+ cursor: w-resize;
129
+ width: 7px;
130
+ left: -5px;
131
+ top: 0;
132
+ height: 100%;
133
+ }
134
+ .ui-resizable-se {
135
+ cursor: se-resize;
136
+ width: 12px;
137
+ height: 12px;
138
+ right: 1px;
139
+ bottom: 1px;
140
+ }
141
+ .ui-resizable-sw {
142
+ cursor: sw-resize;
143
+ width: 9px;
144
+ height: 9px;
145
+ left: -5px;
146
+ bottom: -5px;
147
+ }
148
+ .ui-resizable-nw {
149
+ cursor: nw-resize;
150
+ width: 9px;
151
+ height: 9px;
152
+ left: -5px;
153
+ top: -5px;
154
+ }
155
+ .ui-resizable-ne {
156
+ cursor: ne-resize;
157
+ width: 9px;
158
+ height: 9px;
159
+ right: -5px;
160
+ top: -5px;
161
+ }
162
+ .ui-selectable-helper {
163
+ position: absolute;
164
+ z-index: 100;
165
+ border: 1px dotted black;
166
+ }
167
+ .ui-tabs {
168
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
169
+ padding: .2em;
170
+ }
171
+ .ui-tabs .ui-tabs-nav {
172
+ margin: 0;
173
+ padding: .2em .2em 0;
174
+ }
175
+ .ui-tabs .ui-tabs-nav li {
176
+ list-style: none;
177
+ float: left;
178
+ position: relative;
179
+ top: 0;
180
+ margin: 1px .2em 0 0;
181
+ border-bottom-width: 0;
182
+ padding: 0;
183
+ white-space: nowrap;
184
+ }
185
+ .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
186
+ float: left;
187
+ padding: .5em 1em;
188
+ text-decoration: none;
189
+ }
190
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active {
191
+ margin-bottom: -1px;
192
+ padding-bottom: 1px;
193
+ }
194
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
195
+ .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
196
+ .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
197
+ cursor: text;
198
+ }
199
+ .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
200
+ cursor: pointer;
201
+ }
202
+ .ui-tabs .ui-tabs-panel {
203
+ display: block;
204
+ border-width: 0;
205
+ padding: 1em 1.4em;
206
+ background: none;
207
+ }
208
 
209
+ /* Component containers
210
+ ----------------------------------*/
211
+ .ui-widget {
212
+ /*font-family: Verdana,Arial,sans-serif;*/
213
+ font-size: 1.1em;
 
 
 
 
 
 
 
 
 
 
214
  }
215
+ .ui-widget .ui-widget {
216
+ font-size: 1em;
217
  }
218
+ .ui-widget input,
219
+ .ui-widget select,
220
+ .ui-widget textarea,
221
+ .ui-widget button {
222
+ /*font-family: Verdana,Arial,sans-serif;*/
223
+ font-size: 1em;
 
224
  }
225
+ .ui-widget-content {
226
+ border: 1px solid #aaaaaa;
227
+ background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
228
+ color: #222222;
 
 
229
  }
230
+ .ui-widget-content a {
231
+ color: #222222;
232
+ }
233
+ .ui-widget-header {
234
+ border: 1px solid #aaaaaa;
235
+ background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
236
+ color: #222222;
237
+ font-weight: bold;
238
+ }
239
+ .ui-widget-header a {
240
+ color: #222222;
241
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
 
243
  /* Interaction states
244
  ----------------------------------*/
245
+ .ui-state-default,
246
+ .ui-widget-content .ui-state-default,
247
+ .ui-widget-header .ui-state-default {
248
+ border: 1px solid #d3d3d3;
249
+ background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
250
+ font-weight: normal;
251
+ color: #555555;
252
+ }
253
+ .ui-state-default a,
254
+ .ui-state-default a:link,
255
+ .ui-state-default a:visited {
256
+ color: #555555;
257
+ text-decoration: none;
258
+ }
259
+ .ui-state-hover,
260
+ .ui-widget-content .ui-state-hover,
261
+ .ui-widget-header .ui-state-hover,
262
+ .ui-state-focus,
263
+ .ui-widget-content .ui-state-focus,
264
+ .ui-widget-header .ui-state-focus {
265
+ border: 1px solid #999999;
266
+ background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
267
+ font-weight: normal;
268
+ color: #212121;
269
+ }
270
+ .ui-state-hover a,
271
+ .ui-state-hover a:hover,
272
+ .ui-state-hover a:link,
273
+ .ui-state-hover a:visited,
274
+ .ui-state-focus a,
275
+ .ui-state-focus a:hover,
276
+ .ui-state-focus a:link,
277
+ .ui-state-focus a:visited {
278
+ color: #212121;
279
+ text-decoration: none;
280
+ }
281
+ .ui-state-active,
282
+ .ui-widget-content .ui-state-active,
283
+ .ui-widget-header .ui-state-active {
284
+ border: 1px solid #aaaaaa;
285
+ background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
286
+ font-weight: normal;
287
+ color: #212121;
288
+ }
289
+ .ui-state-active a,
290
+ .ui-state-active a:link,
291
+ .ui-state-active a:visited {
292
+ color: #212121;
293
+ text-decoration: none;
294
+ }
295
 
296
  /* Interaction Cues
297
  ----------------------------------*/
298
+ .ui-state-highlight,
299
+ .ui-widget-content .ui-state-highlight,
300
+ .ui-widget-header .ui-state-highlight {
301
+ border: 1px solid #fcefa1;
302
+ background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
303
+ color: #363636;
304
+ }
305
+ .ui-state-highlight a,
306
+ .ui-widget-content .ui-state-highlight a,
307
+ .ui-widget-header .ui-state-highlight a {
308
+ color: #363636;
309
+ }
310
+ .ui-state-error,
311
+ .ui-widget-content .ui-state-error,
312
+ .ui-widget-header .ui-state-error {
313
+ border: 1px solid #cd0a0a;
314
+ background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
315
+ color: #cd0a0a;
316
+ }
317
+ .ui-state-error a,
318
+ .ui-widget-content .ui-state-error a,
319
+ .ui-widget-header .ui-state-error a {
320
+ color: #cd0a0a;
321
+ }
322
+ .ui-state-error-text,
323
+ .ui-widget-content .ui-state-error-text,
324
+ .ui-widget-header .ui-state-error-text {
325
+ color: #cd0a0a;
326
+ }
327
+ .ui-priority-primary,
328
+ .ui-widget-content .ui-priority-primary,
329
+ .ui-widget-header .ui-priority-primary {
330
+ font-weight: bold;
331
+ }
332
+ .ui-priority-secondary,
333
+ .ui-widget-content .ui-priority-secondary,
334
+ .ui-widget-header .ui-priority-secondary {
335
+ opacity: .7;
336
+ filter:Alpha(Opacity=70);
337
+ font-weight: normal;
338
+ }
339
+ .ui-state-disabled,
340
+ .ui-widget-content .ui-state-disabled,
341
+ .ui-widget-header .ui-state-disabled {
342
+ opacity: .35;
343
+ filter:Alpha(Opacity=35);
344
+ background-image: none;
345
+ }
346
+ .ui-state-disabled .ui-icon {
347
+ filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
348
+ }
349
 
350
  /* Icons
351
  ----------------------------------*/
352
 
353
  /* states and images */
354
+ .ui-icon {
355
+ width: 16px;
356
+ height: 16px;
357
+ }
358
+ .ui-icon,
359
+ .ui-widget-content .ui-icon {
360
+ background-image: url("images/ui-icons_222222_256x240.png");
361
+ }
362
+ .ui-widget-header .ui-icon {
363
+ background-image: url("images/ui-icons_222222_256x240.png");
364
+ }
365
+ .ui-state-default .ui-icon {
366
+ background-image: url("images/ui-icons_888888_256x240.png");
367
+ }
368
+ .ui-state-hover .ui-icon,
369
+ .ui-state-focus .ui-icon {
370
+ background-image: url("images/ui-icons_454545_256x240.png");
371
+ }
372
+ .ui-state-active .ui-icon {
373
+ background-image: url("images/ui-icons_454545_256x240.png");
374
+ }
375
+ .ui-state-highlight .ui-icon {
376
+ background-image: url("images/ui-icons_2e83ff_256x240.png");
377
+ }
378
+ .ui-state-error .ui-icon,
379
+ .ui-state-error-text .ui-icon {
380
+ background-image: url("images/ui-icons_cd0a0a_256x240.png");
381
+ }
382
 
383
  /* positioning */
384
+ .ui-icon-blank { background-position: 16px 16px; }
385
  .ui-icon-carat-1-n { background-position: 0 0; }
386
  .ui-icon-carat-1-ne { background-position: -16px 0; }
387
  .ui-icon-carat-1-e { background-position: -32px 0; }
508
  .ui-icon-help { background-position: -48px -144px; }
509
  .ui-icon-check { background-position: -64px -144px; }
510
  .ui-icon-bullet { background-position: -80px -144px; }
511
+ .ui-icon-radio-on { background-position: -96px -144px; }
512
+ .ui-icon-radio-off { background-position: -112px -144px; }
513
  .ui-icon-pin-w { background-position: -128px -144px; }
514
  .ui-icon-pin-s { background-position: -144px -144px; }
515
  .ui-icon-play { background-position: 0 -160px; }
563
  ----------------------------------*/
564
 
565
  /* Corner radius */
566
+ .ui-corner-all,
567
+ .ui-corner-top,
568
+ .ui-corner-left,
569
+ .ui-corner-tl {
570
+ border-top-left-radius: 4px;
571
+ }
572
+ .ui-corner-all,
573
+ .ui-corner-top,
574
+ .ui-corner-right,
575
+ .ui-corner-tr {
576
+ border-top-right-radius: 4px;
577
+ }
578
+ .ui-corner-all,
579
+ .ui-corner-bottom,
580
+ .ui-corner-left,
581
+ .ui-corner-bl {
582
+ border-bottom-left-radius: 4px;
583
+ }
584
+ .ui-corner-all,
585
+ .ui-corner-bottom,
586
+ .ui-corner-right,
587
+ .ui-corner-br {
588
+ border-bottom-right-radius: 4px;
589
+ }
590
 
591
  /* Overlays */
592
+ .ui-widget-overlay {
593
+ background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
594
+ opacity: .3;
595
+ filter: Alpha(Opacity=30);
596
+ }
597
+ .ui-widget-shadow {
598
+ margin: -8px 0 0 -8px;
599
+ padding: 8px;
600
+ background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
601
+ opacity: .3;
602
+ filter: Alpha(Opacity=30);
603
+ border-radius: 8px;
604
+ }
605
 
606
 
607
 
635
  /* Admin header */
636
  #newsletter-header-new {
637
  text-align: left;
638
+ background-color: #332D39;
639
  padding: 10px;
 
 
 
640
  font-size: 12px;
641
  border: 1px solid #ccc;
642
+ margin-bottom: 15px;
643
+ xheight: 110px;
 
644
  }
645
 
646
  #newsletter-header-new a {
 
647
  text-decoration: none;
648
+ font-family: "Montserrat",sans-serif;
649
+ color: white;
650
+ letter-spacing: 0.2em;
651
+ }
652
+
653
+ #newsletter-header-new a:hover {
654
+ color: #F64747;
655
  }
656
 
657
  /* Admin header for extensions */
682
  }
683
 
684
  .newsletter-separator {
685
+ clear: both;
686
  height: 5px;
687
  }
688
 
689
+ /*
690
  .wrap, .wrap td, .wrap th, .wrap input, .wrap textarea {
691
  font-size: 13px;
692
  font-family: sans-serif;
693
  line-height: 130%;
694
  }
695
+ */
696
+
697
+ .wrap select {
698
+ height: auto;
699
+ vertical-align: initial;
700
+ }
701
+ .wrap {
702
+ background-color: white;
703
+ padding: 10px;
704
+ }
705
 
706
  .wrap td a {
707
  text-decoration: underline;
712
  }
713
 
714
  .wrap h2 {
 
 
 
 
 
715
  }
716
 
717
  .wrap h3 {
 
718
  }
719
 
720
  .wrap h4 {
 
 
 
 
721
  }
722
 
723
  .wrap h5 {
724
+
 
 
 
725
  }
726
 
727
  .wrap ul li {
738
  font-weight: bold;
739
  border-right: 1px solid #ddd;
740
  max-width: 200px;
741
+ color: #000000;
742
  }
743
  .form-table th small {
744
  font-weight: normal;
897
  }
898
  */
899
 
900
+ .notice {
901
+ padding-right: 70px;
902
+ position: relative;
 
 
 
 
 
 
903
  }
904
 
905
+ .notice a.dismiss {
906
+ display: block;
907
+ position: absolute;
908
+ right: 10px;
909
+ top: 10px;
910
+ font-size: 20px;
911
+ text-decoration: none;
912
+ color: #666;
913
  }
914
 
915
  .newsletter-message {
1046
  margin-top: 0;
1047
  }
1048
 
1049
+
1050
+ /* CSS The Newsletter Team */
1051
+
1052
+ /* CSS Tips */
1053
+
1054
+ .tnp-tip {
1055
+ margin-top: 5px;
1056
+ }
1057
+
1058
+ .tip-button {
1059
+ padding: 0px 5px;
1060
+ color: #FD5F65;
1061
+ text-transform: uppercase;
1062
+ letter-spacing: 0.2em;
1063
+ font-family: "Montserrat";
1064
+ font-size: 10px;
1065
+ border: 1px red solid;
1066
+ }
1067
+
1068
+ .tip-content {
1069
+ font-family: "Montserrat";
1070
+ font-weight: 500;
1071
+ font-size: 11px;
1072
+ color: #999999;
1073
+ }
1074
+
1075
+ /* CSS General Font Styles */
1076
+
1077
+ .wrap p {
1078
+ font-family: "Montserrat";
1079
+ font-weight: 400;
1080
+ }
1081
+ #tabs h3 {
1082
+ color: #222;
1083
+ font-size: 1.3em;
1084
+ margin: 1em 0;
1085
+ font-family: "Montserrat";
1086
+ text-transform: uppercase;
1087
+ letter-spacing: 0.2em;
1088
+ border-bottom: 1px solid black;
1089
+ padding: 10px;
1090
+ }
1091
+
1092
+ p.description {
1093
+ font-size: 11px !important;
1094
+ }
1095
+
1096
+
1097
+ /* CSS Themes Preview */
1098
+
1099
+ .tnp-theme-preview {
1100
+ display: block;
1101
+ float: left;
1102
+ text-align: center;
1103
+ }
1104
+
1105
+ .tnp-theme-preview p {
1106
+ font-family: "Montserrat";
1107
+ font-size: 11px;
1108
+ letter-spacing: 0.2em;
1109
+ text-transform: uppercase;
1110
+ }
1111
+
1112
+ .tnp-theme-preview img:hover {
1113
+ border: 5px solid #FD5F65;
1114
+ border-radius: 10px;
1115
+ padding: 5px;
1116
+ background-color: #FD5F65;
1117
+ }
1118
+
1119
+ .tnp-theme-preview img {
1120
+ border: 5px solid transparent;
1121
+ border-radius: 10px;
1122
+ padding: 5px;
1123
+ }
1124
+
do/profile.php CHANGED
@@ -12,7 +12,7 @@ unset($_GET['na']);
12
 
13
  include '../../../../wp-load.php';
14
 
15
- $user = NewsletterSubscription::instance()->get_user_from_request();
16
  if ($user == null)
17
  die('No subscriber found.');
18
 
12
 
13
  include '../../../../wp-load.php';
14
 
15
+ $user = NewsletterSubscription::instance()->check_user();
16
  if ($user == null)
17
  die('No subscriber found.');
18
 
do/subscribe.php CHANGED
@@ -1,4 +1,9 @@
1
  <?php
 
 
 
 
 
2
  header('Content-Type: text/html;charset=UTF-8');
3
  header('X-Robots-Tag: noindex,nofollow,noarchive');
4
  header('Cache-Control: no-cache,no-store,private');
@@ -33,7 +38,19 @@ else {
33
  <body onload="document.getElementById('form').action = '?ts=<?php echo time(); ?>';document.getElementById('form').submit()">
34
  <form id="form" action="<?php echo plugins_url('newsletter'); ?>/do/dummy.php" method="post">
35
  <?php foreach ($_REQUEST as $name => $value) { ?>
 
 
 
 
 
 
 
 
 
36
  <input type="hidden" name="<?php echo esc_attr($name); ?>" value="<?php echo esc_attr($value); ?>">
 
 
 
37
  <?php } ?>
38
  </form>
39
  </body>
1
  <?php
2
+ if (isset($_GET['test'])) {
3
+ header('Content-Type: text/plain');
4
+ echo 'ok';
5
+ return;
6
+ }
7
  header('Content-Type: text/html;charset=UTF-8');
8
  header('X-Robots-Tag: noindex,nofollow,noarchive');
9
  header('Cache-Control: no-cache,no-store,private');
38
  <body onload="document.getElementById('form').action = '?ts=<?php echo time(); ?>';document.getElementById('form').submit()">
39
  <form id="form" action="<?php echo plugins_url('newsletter'); ?>/do/dummy.php" method="post">
40
  <?php foreach ($_REQUEST as $name => $value) { ?>
41
+ <?php
42
+ if (is_array($value)) {
43
+ foreach ($value as $element) {
44
+ ?>
45
+ <input type="hidden" name="<?php echo esc_attr($name); ?>[]" value="<?php echo esc_attr($element); ?>">
46
+ <?php
47
+ }
48
+ } else {
49
+ ?>
50
  <input type="hidden" name="<?php echo esc_attr($name); ?>" value="<?php echo esc_attr($value); ?>">
51
+ <?php
52
+ }
53
+ ?>
54
  <?php } ?>
55
  </form>
56
  </body>
emails/create.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once '../../../../wp-load.php';
4
+
5
+ if (!is_user_logged_in()) die();
6
+ if (Newsletter::instance()->options['editor'] == 1 && !current_user_can('manage_categories')) die();
7
+ else if (!current_user_can('manage_options')) die();
8
+
9
+ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
10
+ $controls = new NewsletterControls();
11
+ $module = NewsletterEmails::instance();
12
+
13
+ if ($controls->is_action('create')) {
14
+ $module->save_options($controls->data);
15
+
16
+ $email = array();
17
+ $email['status'] = 'new';
18
+ $email['subject'] = __('Here the email subject', 'newsletter-emails');
19
+ $email['track'] = 1;
20
+
21
+ $theme_options = $module->get_current_theme_options();
22
+
23
+ $theme_url = $module->get_current_theme_url();
24
+ $theme_subject = '';
25
+
26
+ ob_start();
27
+ include $module->get_current_theme_file_path('theme.php');
28
+ $email['message'] = ob_get_clean();
29
+
30
+ if (!empty($theme_subject)) {
31
+ $email['subject'] = $theme_subject;
32
+ }
33
+
34
+ ob_start();
35
+ include $module->get_current_theme_file_path('theme-text.php');
36
+ $email['message_text'] = ob_get_clean();
37
+
38
+ $email['type'] = 'message';
39
+ $email['send_on'] = time();
40
+ $email = Newsletter::instance()->save_email($email);
41
+
42
+ header('Location: ' . $module->get_admin_page_url('edit') . '&id=' . $email->id);
43
+ }
emails/edit.php CHANGED
@@ -3,17 +3,23 @@ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterEmails::instance();
5
 
6
-
7
  // Always required
8
- $email_id = $_GET['id'];
9
- $email = Newsletter::instance()->get_email($email_id, ARRAY_A);
 
 
 
 
 
10
 
11
  // If there is no action we assume we are enter the first time so we populate the
12
  // $nc->data with the editable email fields
13
  if (!$controls->is_action()) {
14
  $controls->data = $email;
15
- if (!empty($email['preferences'])) $controls->data['preferences'] = explode(',', $email['preferences']);
16
- if (!empty($email['sex'])) $controls->data['sex'] = explode(',', $email['sex']);
 
 
17
  $email_options = unserialize($email['options']);
18
  if (is_array($email_options)) {
19
  $controls->data = array_merge($controls->data, $email_options);
@@ -50,11 +56,15 @@ if ($controls->is_action('test') || $controls->is_action('save') || $controls->i
50
 
51
  $email['options'] = serialize($email['options']);
52
 
53
- if (is_array($controls->data['preferences'])) $email['preferences'] = implode(',', $controls->data['preferences']);
54
- else $email['preferences'] = '';
 
 
55
 
56
- if (is_array($controls->data['sex'])) $email['sex'] = implode(',', $controls->data['sex']);
57
- else $email['sex'] = '';
 
 
58
 
59
  // Before send, we build the query to extract subscriber, so the delivery engine does not
60
  // have to worry about the email parameters
@@ -72,7 +82,7 @@ if ($controls->is_action('test') || $controls->is_action('save') || $controls->i
72
  if (is_array($preferences)) {
73
 
74
  // Not set one of the preferences specified
75
- $operator = $controls->data['preferences_status_operator'] == 0?' or ':' and ';
76
  if ($controls->data['preferences_status'] == 1) {
77
  $query .= " and (";
78
  foreach ($preferences as $x) {
@@ -80,8 +90,7 @@ if ($controls->is_action('test') || $controls->is_action('save') || $controls->i
80
  }
81
  $query = substr($query, 0, -4);
82
  $query .= ")";
83
- }
84
- else {
85
  $query .= " and (";
86
  foreach ($preferences as $x) {
87
  $query .= "list_" . $x . "=1" . $operator;
@@ -112,9 +121,9 @@ if ($controls->is_action('test') || $controls->is_action('save') || $controls->i
112
  $email['send_on'] = $controls->data['send_on'];
113
 
114
  if ($controls->is_action('editor')) {
115
- $email['editor'] = $email['editor'] == 0?1:0;
116
  }
117
-
118
  // Cleans up of tag
119
  $email['message'] = NewsletterModule::clean_url_tags($email['message']);
120
 
@@ -157,11 +166,19 @@ if ($controls->is_action('abort')) {
157
  if ($controls->is_action('test')) {
158
  $users = NewsletterUsers::instance()->get_test_users();
159
  if (count($users) == 0) {
160
- $controls->errors = 'There are no test subscribers. Read more about test subscribers <a href="http://www.satollo.net/plugins/newsletter/subscribers-module#test" target="_blank">here</a>.';
161
  } else {
162
  Newsletter::instance()->send(Newsletter::instance()->get_email($email_id), $users);
163
- $controls->messages .= 'Test emails sent to ' . count($users) . ' test subscribers. Read more about test subscribers <a href="http://www.satollo.net/plugins/newsletter/subscribers-module#test" target="_blank">here</a>.';
 
 
 
164
  }
 
 
 
 
 
165
  $controls->messages .= '<br>If diagnostic emails are delivered but test emails are not, try to change the encoding to "base 64" on main configuration panel';
166
  }
167
 
@@ -176,38 +193,38 @@ if ($email['editor'] == 0) {
176
  $controls->data['message'] = substr($controls->data['message'], $x + 1, $y - $x - 1);
177
  }
178
  }
179
-
180
  ?>
181
 
182
  <script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/tiny_mce/tiny_mce.js"></script>
183
  <script type="text/javascript">
184
  tinyMCE.init({
185
- mode : "specific_textareas",
186
- editor_selector : "visual",
187
- theme : "advanced",
 
 
188
  plugins: "table,fullscreen,legacyoutput",
189
- theme_advanced_disable : "styleselect",
190
  theme_advanced_buttons1_add: "forecolor,blockquote,code,fontsizeselect,fontselect",
191
- theme_advanced_buttons3_add : "tablecontrols,fullscreen",
192
- relative_urls : false,
193
  theme_advanced_statusbar_location: "bottom",
194
- remove_script_host : false,
195
- theme_advanced_resizing : true,
196
- theme_advanced_toolbar_location : "top",
197
- document_base_url : "<?php echo get_option('home'); ?>/",
198
- content_css: "<?php echo plugins_url('newsletter') . '/emails/css.php?id=' . $email_id . '&' . time(); ?>"
199
  });
200
 
201
- jQuery(document).ready(function() {
202
- jQuery('#upload_image_button').click(function() {
203
  tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
204
  return false;
205
  });
206
 
207
- window.send_to_editor = function(html) {
208
- imgurl = jQuery('img',html).attr('src');
209
- //jQuery('#upload_image').val(imgurl);
210
- tinyMCE.execCommand('mceInsertContent',false,'<img src="' + imgurl + '" />');
211
  tb_remove();
212
  }
213
  });
@@ -215,14 +232,14 @@ if ($email['editor'] == 0) {
215
 
216
  <div class="wrap">
217
 
218
- <?php //$help_url = 'http://www.satollo.net/plugins/newsletter/newsletters-module'; ?>
219
- <?php //include NEWSLETTER_DIR . '/header-new.php'; ?>
220
 
221
  <div id="newsletter-title">
222
- <h2>Edit Newsletter</h2>
223
- </div>
224
  <div class="newsletter-separator"></div>
225
-
226
  <?php
227
  if ($controls->data['status'] == 'S') {
228
  echo '<div class="newsletter-message">Warning! This email is configured to be sent to NOT CONFIRMED subscribers.</div>';
@@ -247,43 +264,37 @@ if ($email['editor'] == 0) {
247
 
248
  <div id="tabs">
249
  <ul>
250
- <li><a href="#tabs-a">Message</a></li>
251
- <li><a href="#tabs-b">Message (textual)</a></li>
252
- <li><a href="#tabs-c">Who will receive it</a></li>
253
- <li><a href="#tabs-d">Other options</a></li>
 
254
  <!--<li><a href="#tabs-5">Documentation</a></li>-->
255
  </ul>
256
 
257
 
258
  <div id="tabs-a">
259
- <table class="form-table">
260
- <tr valign="top">
261
- <th>Subject</th>
262
- <td>
263
- <?php $controls->text('subject', 70); ?>
264
- </td>
265
- </tr>
266
 
267
- <tr valign="top">
268
- <th>Message</th>
269
- <td>
270
- <input id="upload_image_button" type="button" value="Choose or upload an image" />
271
- <?php $email['editor'] == 0 ? $controls->editor('message', 30) : $controls->textarea_fixed('message', '100%', '400'); ?>
272
- <div class="hints">
273
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-tags" target="">See the list of all tags</a> that can be used on the email text.
274
- </div>
275
- </td>
276
- </tr>
277
- </table>
278
  </div>
279
 
280
 
281
  <div id="tabs-b">
282
  <div class="tab-preamble">
283
- <p>
284
- This is the textual version of your newsletter. If you empty it, only an HTML version will be sent but
285
- is an anti-spam best practice to include a text only version.
286
- </p>
287
  </div>
288
  <table class="form-table">
289
  <tr valign="top">
@@ -298,45 +309,42 @@ if ($email['editor'] == 0) {
298
 
299
  <div id="tabs-c">
300
  <table class="form-table">
301
-
302
  <tr valign="top">
303
- <th><?php _e('Gender', 'newsletter'); ?></th>
304
  <td>
305
- <?php $controls->checkboxes_group('sex', array('f'=>'Women', 'm'=>'Men', 'n'=>'Not specified')); ?>
306
  <div class="hints">
307
  Leaving all gender options unselected disable this filter.
308
  </div>
309
  </td>
310
  </tr>
311
  <tr valign="top">
312
- <th><?php _e('Subscriber preferences', 'newsletter'); ?></th>
313
  <td>
314
- Subscribers with
315
- <?php $controls->select('preferences_status_operator', array(0=>'at least one preference', 1=>'all preferences')); ?>
316
-
317
- <?php $controls->select('preferences_status', array(0=>'active', 1=>'not active')); ?>
318
  between the selected ones below:
319
 
320
  <?php $controls->preferences_group('preferences', true); ?>
321
- <div class="hints">
322
  You can address the newsletter to subscribers who selected at least one of the options or to who
323
  has not selected at least one of the options.
324
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-preferences" target="_blank">Read more about the "NOT ACTIVE" usage</a>.
325
- </div>
326
  </td>
327
  </tr>
328
-
329
  <tr valign="top">
330
- <th>Subscriber status</th>
331
  <td>
332
- <?php $controls->select('status', array('C'=>'Confirmed', 'S'=>'Not confirmed')); ?>
333
 
334
- <div class="hints">
335
- <strong>Warning! Use this option with care!</strong>
336
- <br>
337
- You should NEVER send emails to not confirmed subscribers, but if you need to send them
338
- an email to ask for confirmation, you can use this option.
339
- </div>
340
  </td>
341
  </tr>
342
  <tr valign="top">
@@ -344,23 +352,22 @@ if ($email['editor'] == 0) {
344
  <td>
345
  <?php $controls->yesno('wp_users'); ?>
346
 
347
- <div class="hints">
348
  Limit to the subscribers which are WordPress users as well.
349
- </div>
350
  </td>
351
  </tr>
352
  <tr valign="top">
353
  <th>
354
- Approximative number of receivers<br>
355
- <small>Updated everytime you save</small>
356
  </th>
357
  <td>
358
  <?php
359
  echo $wpdb->get_var(str_replace('*', 'count(*)', $email['query']));
360
  ?>
361
- <div class="hints">
362
- If you change selections below, save the email to update this values.
363
- </div>
364
  </td>
365
  </tr>
366
  </table>
@@ -370,34 +377,31 @@ if ($email['editor'] == 0) {
370
  <div id="tabs-d">
371
  <table class="form-table">
372
  <tr valign="top">
373
- <th>Private?</th>
374
  <td>
375
  <?php $controls->yesno('private'); ?>
376
- <div class="hints">
377
- Potentially used for public showing of a newsletter. Actually has not effects.
378
- </div>
 
379
  </td>
380
  </tr>
381
  <tr valign="top">
382
- <th>Track clicks and message opening?</th>
383
  <td>
384
  <?php $controls->yesno('track'); ?>
385
- <div class="hints">
386
- When this option is enabled, each link in the email text will be rewritten and clicks
387
- on them intercepted.
388
- </div>
389
  </td>
390
  </tr>
391
  <tr valign="top">
392
- <th>Send on</th>
393
  <td>
394
  <?php $controls->datetime('send_on'); ?> (<?php echo date_i18n(get_option('date_format') . ' ' . get_option('time_format')); ?> )
395
-
396
- <div class="hints">
397
- Change this date to schedule this newsletter.
398
- </div>
399
  </td>
400
  </tr>
 
 
 
 
401
  <tr valign="top">
402
  <th>Email status</th>
403
  <td><?php echo $email['status']; ?></td>
3
  $controls = new NewsletterControls();
4
  $module = NewsletterEmails::instance();
5
 
 
6
  // Always required
7
+ $email = Newsletter::instance()->get_email((int)$_GET['id'], ARRAY_A);
8
+
9
+ if (empty($email)) {
10
+ echo 'Wrong email identifier';
11
+ return;
12
+ }
13
+ $email_id = $email['id'];
14
 
15
  // If there is no action we assume we are enter the first time so we populate the
16
  // $nc->data with the editable email fields
17
  if (!$controls->is_action()) {
18
  $controls->data = $email;
19
+ if (!empty($email['preferences']))
20
+ $controls->data['preferences'] = explode(',', $email['preferences']);
21
+ if (!empty($email['sex']))
22
+ $controls->data['sex'] = explode(',', $email['sex']);
23
  $email_options = unserialize($email['options']);
24
  if (is_array($email_options)) {
25
  $controls->data = array_merge($controls->data, $email_options);
56
 
57
  $email['options'] = serialize($email['options']);
58
 
59
+ if (is_array($controls->data['preferences']))
60
+ $email['preferences'] = implode(',', $controls->data['preferences']);
61
+ else
62
+ $email['preferences'] = '';
63
 
64
+ if (is_array($controls->data['sex']))
65
+ $email['sex'] = implode(',', $controls->data['sex']);
66
+ else
67
+ $email['sex'] = '';
68
 
69
  // Before send, we build the query to extract subscriber, so the delivery engine does not
70
  // have to worry about the email parameters
82
  if (is_array($preferences)) {
83
 
84
  // Not set one of the preferences specified
85
+ $operator = $controls->data['preferences_status_operator'] == 0 ? ' or ' : ' and ';
86
  if ($controls->data['preferences_status'] == 1) {
87
  $query .= " and (";
88
  foreach ($preferences as $x) {
90
  }
91
  $query = substr($query, 0, -4);
92
  $query .= ")";
93
+ } else {
 
94
  $query .= " and (";
95
  foreach ($preferences as $x) {
96
  $query .= "list_" . $x . "=1" . $operator;
121
  $email['send_on'] = $controls->data['send_on'];
122
 
123
  if ($controls->is_action('editor')) {
124
+ $email['editor'] = $email['editor'] == 0 ? 1 : 0;
125
  }
126
+
127
  // Cleans up of tag
128
  $email['message'] = NewsletterModule::clean_url_tags($email['message']);
129
 
166
  if ($controls->is_action('test')) {
167
  $users = NewsletterUsers::instance()->get_test_users();
168
  if (count($users) == 0) {
169
+ $controls->messages = __('There are no test subscribers.', 'newsletter-emails');
170
  } else {
171
  Newsletter::instance()->send(Newsletter::instance()->get_email($email_id), $users);
172
+ $controls->messages = __('Test newsletter sent to:', 'newsletter-emails');
173
+ foreach ($users as &$user)
174
+ $controls->messages .= ' ' . $user->email;
175
+ $controls->messages .= '.';
176
  }
177
+
178
+ $controls->messages .= '<br>';
179
+ $controls->messages .= '<a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank">' .
180
+ __('Read more about test subscribers', 'newsletter-emails') . '</a>.';
181
+
182
  $controls->messages .= '<br>If diagnostic emails are delivered but test emails are not, try to change the encoding to "base 64" on main configuration panel';
183
  }
184
 
193
  $controls->data['message'] = substr($controls->data['message'], $x + 1, $y - $x - 1);
194
  }
195
  }
 
196
  ?>
197
 
198
  <script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/tiny_mce/tiny_mce.js"></script>
199
  <script type="text/javascript">
200
  tinyMCE.init({
201
+ height: 700,
202
+ mode: "specific_textareas",
203
+ editor_selector: "visual",
204
+ theme: "advanced",
205
+ entity_encoding: "raw",
206
  plugins: "table,fullscreen,legacyoutput",
207
+ theme_advanced_disable: "styleselect",
208
  theme_advanced_buttons1_add: "forecolor,blockquote,code,fontsizeselect,fontselect",
209
+ theme_advanced_buttons3_add: "tablecontrols,fullscreen",
210
+ relative_urls: false,
211
  theme_advanced_statusbar_location: "bottom",
212
+ remove_script_host: false,
213
+ theme_advanced_resizing: true,
214
+ theme_advanced_toolbar_location: "top",
215
+ document_base_url: "<?php echo get_option('home'); ?>/",
216
+ content_css: ["<?php echo plugins_url('newsletter') ?>/emails/editor.css", "<?php echo plugins_url('newsletter') . '/emails/css.php?id=' . $email_id . '&' . time(); ?>"]
217
  });
218
 
219
+ jQuery(document).ready(function () {
220
+ jQuery('#upload_image_button').click(function () {
221
  tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
222
  return false;
223
  });
224
 
225
+ window.send_to_editor = function (html) {
226
+ var imgURL = html.match(/src=\"(.*?)\"/);
227
+ tinyMCE.execCommand('mceInsertContent', false, '<img src="' + imgURL[1] + '" />');
 
228
  tb_remove();
229
  }
230
  });
232
 
233
  <div class="wrap">
234
 
235
+ <?php //$help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/newsletters-module'; ?>
236
+ <?php //include NEWSLETTER_DIR . '/header-new.php'; ?>
237
 
238
  <div id="newsletter-title">
239
+ <h2>Edit Newsletter</h2>
240
+ </div>
241
  <div class="newsletter-separator"></div>
242
+
243
  <?php
244
  if ($controls->data['status'] == 'S') {
245
  echo '<div class="newsletter-message">Warning! This email is configured to be sent to NOT CONFIRMED subscribers.</div>';
264
 
265
  <div id="tabs">
266
  <ul>
267
+ <li><a href="#tabs-a"><?php _e('Message', 'newsletter-emails') ?></a></li>
268
+ <li><a href="#tabs-b"><?php _e('Message (textual)', 'newsletter-emails') ?></a></li>
269
+ <li><a href="#tabs-c"><?php _e('Targeting', 'newsletter-emails') ?></a></li>
270
+ <li><a href="#tabs-d"><?php _e('Other', 'newsletter-emails') ?></a></li>
271
+ <li><a href="#tabs-status"><?php _e('Status', 'newsletter-emails') ?></a></li>
272
  <!--<li><a href="#tabs-5">Documentation</a></li>-->
273
  </ul>
274
 
275
 
276
  <div id="tabs-a">
 
 
 
 
 
 
 
277
 
278
+ <?php $controls->text('subject', 70, 'Subject'); ?>
279
+
280
+ <input id="upload_image_button" type="button" value="Choose or upload an image" />
281
+
282
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-tags" target="_blank"><?php _e('Available tags', 'newsletter-emails') ?></a>
283
+
284
+ <br><br>
285
+
286
+ <?php $email['editor'] == 0 ? $controls->editor('message', 30) : $controls->textarea_fixed('message', '100%', '700'); ?>
287
+
288
+
289
  </div>
290
 
291
 
292
  <div id="tabs-b">
293
  <div class="tab-preamble">
294
+ <p>
295
+ This is the textual version of your newsletter. If you empty it, only an HTML version will be sent but
296
+ is an anti-spam best practice to include a text only version.
297
+ </p>
298
  </div>
299
  <table class="form-table">
300
  <tr valign="top">
309
 
310
  <div id="tabs-c">
311
  <table class="form-table">
312
+
313
  <tr valign="top">
314
+ <th><?php _e('Gender', 'newsletter-emails'); ?></th>
315
  <td>
316
+ <?php $controls->checkboxes_group('sex', array('f' => 'Women', 'm' => 'Men', 'n' => 'Not specified')); ?>
317
  <div class="hints">
318
  Leaving all gender options unselected disable this filter.
319
  </div>
320
  </td>
321
  </tr>
322
  <tr valign="top">
323
+ <th><?php _e('Subscriber preferences', 'newsletter-emails'); ?></th>
324
  <td>
325
+ Subscribers with
326
+ <?php $controls->select('preferences_status_operator', array(0 => 'at least one preference', 1 => 'all preferences')); ?>
327
+
328
+ <?php $controls->select('preferences_status', array(0 => 'active', 1 => 'not active')); ?>
329
  between the selected ones below:
330
 
331
  <?php $controls->preferences_group('preferences', true); ?>
332
+ <p class="description">
333
  You can address the newsletter to subscribers who selected at least one of the options or to who
334
  has not selected at least one of the options.
335
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">Read more about the "NOT ACTIVE" usage</a>.
336
+ </p>
337
  </td>
338
  </tr>
339
+
340
  <tr valign="top">
341
+ <th><?php _e('Subscriber status', 'newsletter-emails') ?></th>
342
  <td>
343
+ <?php $controls->select('status', array('C' => __('Confirmed', 'newsletter-emails'), 'S' => __('Not confirmed', 'newsletter-emails'))); ?>
344
 
345
+ <p class="description">
346
+ <?php _e('Send to not confirmed subscribers ONLY to ask for confirmation including the {subscription_confirm_url} tag.', 'newsletter-emails') ?>
347
+ </p>
 
 
 
348
  </td>
349
  </tr>
350
  <tr valign="top">
352
  <td>
353
  <?php $controls->yesno('wp_users'); ?>
354
 
355
+ <p class="description">
356
  Limit to the subscribers which are WordPress users as well.
357
+ </p>
358
  </td>
359
  </tr>
360
  <tr valign="top">
361
  <th>
362
+ <?php _e('Targeted subscribers', 'newsletter-emails') ?>
 
363
  </th>
364
  <td>
365
  <?php
366
  echo $wpdb->get_var(str_replace('*', 'count(*)', $email['query']));
367
  ?>
368
+ <p class="description">
369
+ <?php _e('Save to update if on targeting filters have been changed', 'newsletter-emails') ?>
370
+ </p>
371
  </td>
372
  </tr>
373
  </table>
377
  <div id="tabs-d">
378
  <table class="form-table">
379
  <tr valign="top">
380
+ <th><?php _e('Private', 'newsletter-emails') ?></th>
381
  <td>
382
  <?php $controls->yesno('private'); ?>
383
+ <p class="description">
384
+ <?php _e('Hide/show from public sent newsletter list.', 'newsletter-emails') ?>
385
+ <?php _e('Required', 'newsletter-emails') ?>: <a href="" target="_blank">Newsletter Archive Extension</a>
386
+ </p>
387
  </td>
388
  </tr>
389
  <tr valign="top">
390
+ <th><?php _e('Track clicks and message opening', 'newsletter-emails') ?></th>
391
  <td>
392
  <?php $controls->yesno('track'); ?>
 
 
 
 
393
  </td>
394
  </tr>
395
  <tr valign="top">
396
+ <th><?php _e('Send on', 'newsletter-emails') ?></th>
397
  <td>
398
  <?php $controls->datetime('send_on'); ?> (<?php echo date_i18n(get_option('date_format') . ' ' . get_option('time_format')); ?> )
 
 
 
 
399
  </td>
400
  </tr>
401
+ </table>
402
+ </div>
403
+ <div id="tabs-status">
404
+ <table class="form-table">
405
  <tr valign="top">
406
  <th>Email status</th>
407
  <td><?php echo $email['status']; ?></td>
emails/editor.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ body, td, pre {
2
+ font-size: 12px;
3
+ }
4
+
emails/emails.php CHANGED
@@ -58,7 +58,13 @@ class NewsletterEmails extends NewsletterModule {
58
  }
59
 
60
  function get_current_theme_options() {
61
- return $this->themes->get_options($this->get_current_theme());
 
 
 
 
 
 
62
  }
63
 
64
  /**
58
  }
59
 
60
  function get_current_theme_options() {
61
+ $theme_options = $this->themes->get_options($this->get_current_theme());
62
+ // main options merge
63
+ $main_options = Newsletter::instance()->options;
64
+ foreach ($main_options as $key => $value) {
65
+ $theme_options['main_'.$key] = $value;
66
+ }
67
+ return $theme_options;
68
  }
69
 
70
  /**
emails/index.php CHANGED
@@ -1,4 +1,8 @@
1
  <?php
 
 
 
 
2
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterEmails::instance();
@@ -15,7 +19,7 @@ if ($controls->is_action('unconvert')) {
15
 
16
  if ($controls->is_action('send')) {
17
  $newsletter->hook_newsletter();
18
- $controls->messages .= 'Delivery engine triggered.';
19
  }
20
 
21
  if ($controls->is_action('copy')) {
@@ -28,14 +32,14 @@ if ($controls->is_action('copy')) {
28
  $email['type'] = 'message';
29
  $email['editor'] = $original->editor;
30
  $email['track'] = $original->track;
31
-
32
  Newsletter::instance()->save_email($email);
33
- $controls->messages .= 'Message duplicated.';
34
  }
35
 
36
  if ($controls->is_action('delete')) {
37
  Newsletter::instance()->delete_email($_POST['btn']);
38
- $controls->messages .= 'Message deleted';
39
  }
40
 
41
  if ($controls->is_action('delete_selected')) {
@@ -48,13 +52,11 @@ $emails = Newsletter::instance()->get_emails('message');
48
 
49
  <div class="wrap">
50
 
51
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/newsletters-module'; ?>
52
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
53
 
54
  <div id="newsletter-title">
55
- <h2>Newsletter List</h2>
56
-
57
- <p>Here you can manage your messages: compose, deliver, monitor.</p>
58
 
59
  </div>
60
  <div class="newsletter-separator"></div>
@@ -77,20 +79,21 @@ $emails = Newsletter::instance()->get_emails('message');
77
  <?php } ?>
78
 
79
  <p>
80
- <a href="<?php echo $module->get_admin_page_url('theme'); ?>" class="button">New message</a>
81
- <?php $controls->button_confirm('delete_selected', 'Delete selected messages', 'Proceed?'); ?>
82
- <?php $controls->button('send', 'Trigger the delivery engine'); ?>
 
83
  </p>
84
  <table class="widefat" style="width: auto">
85
  <thead>
86
  <tr>
87
  <th>&nbsp;</th>
88
  <th>Id</th>
89
- <th>Subject</th>
90
-
91
- <th>Status</th>
92
- <th>Progress<sup>*</sup></th>
93
- <th>Date</th>
94
  <th>&nbsp;</th>
95
  <th>&nbsp;</th>
96
  <th>&nbsp;</th>
@@ -104,33 +107,34 @@ $emails = Newsletter::instance()->get_emails('message');
104
  <td><input type="checkbox" name="ids[]" value="<?php echo $email->id; ?>"/></td>
105
  <td><?php echo $email->id; ?></td>
106
  <td><?php echo htmlspecialchars($email->subject); ?></td>
107
-
108
  <td>
109
  <?php
110
  if ($email->status == 'sending') {
111
  if ($email->send_on > time()) {
112
- echo 'planned';
113
  }
114
  else {
115
- echo 'sending';
116
  }
117
  } else {
118
  echo $email->status;
119
  }
120
  ?>
121
  </td>
122
- <td><?php if ($email->status == 'sent' || $email->status == 'sending')echo $email->sent . ' of ' . $email->total; ?></td>
123
  <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $module->format_date($email->send_on); ?></td>
 
124
  <td><a class="button" href="<?php echo $module->get_admin_page_url('edit'); ?>&amp;id=<?php echo $email->id; ?>">Edit</a></td>
125
  <td>
126
  <a class="button" href="<?php echo NewsletterStatistics::instance()->get_statistics_url($email->id); ?>">Statistics</a>
127
  </td>
128
- <td><?php $controls->button_confirm('copy', 'Copy', 'Proceed?', $email->id); ?></td>
129
- <td><?php $controls->button_confirm('delete', 'Delete', 'Proceed?', $email->id); ?></td>
130
  </tr>
131
- <?php } ?>
132
  </tbody>
133
  </table>
134
- <p><sup>*</sup> The expected total can change at the delivery end due to subscriptions/unsubscriptions in the meanwhile.</p>
135
  </form>
136
  </div>
1
  <?php
2
+ if (function_exists('load_plugin_textdomain')) {
3
+ load_plugin_textdomain('newsletter-emails', false, 'newsletter/emails/languages');
4
+ load_plugin_textdomain('newsletter', false, 'newsletter/languages');
5
+ }
6
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
7
  $controls = new NewsletterControls();
8
  $module = NewsletterEmails::instance();
19
 
20
  if ($controls->is_action('send')) {
21
  $newsletter->hook_newsletter();
22
+ $controls->messages .= __('Delivery engine triggered.', 'newsletter-emails');
23
  }
24
 
25
  if ($controls->is_action('copy')) {
32
  $email['type'] = 'message';
33
  $email['editor'] = $original->editor;
34
  $email['track'] = $original->track;
35
+
36
  Newsletter::instance()->save_email($email);
37
+ $controls->messages .= __('Message duplicated.', 'newsletter-emails');
38
  }
39
 
40
  if ($controls->is_action('delete')) {
41
  Newsletter::instance()->delete_email($_POST['btn']);
42
+ $controls->messages .= __('Message deleted.', 'newsletter-emails');
43
  }
44
 
45
  if ($controls->is_action('delete_selected')) {
52
 
53
  <div class="wrap">
54
 
55
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/newsletters-module'; ?>
56
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
57
 
58
  <div id="newsletter-title">
59
+ <h2><?php _e('Newsletters', 'newsletter-emails')?></h2>
 
 
60
 
61
  </div>
62
  <div class="newsletter-separator"></div>
79
  <?php } ?>
80
 
81
  <p>
82
+ <a href="<?php echo $module->get_admin_page_url('theme'); ?>" class="button"><?php _e('New newsletter', 'newsletter-emails')?></a>
83
+ <?php $controls->button_confirm('delete_selected', __('Delete selected newsletters', 'newsletter-emails'),
84
+ __('Proceed?', 'newsletter-emails')); ?>
85
+ <?php $controls->button('send', __('Trigger the delivery engine', 'newsletter-emails')); ?>
86
  </p>
87
  <table class="widefat" style="width: auto">
88
  <thead>
89
  <tr>
90
  <th>&nbsp;</th>
91
  <th>Id</th>
92
+ <th><?php _e('Subject', 'newsletter')?></th>
93
+ <th><?php _e('Status', 'newsletter')?></th>
94
+ <th><?php _e('Progress', 'newsletter')?>&nbsp;(*)</th>
95
+ <th><?php _e('Date', 'newsletter')?></th>
96
+ <th><?php _e('Tracking', 'newsletter')?></th>
97
  <th>&nbsp;</th>
98
  <th>&nbsp;</th>
99
  <th>&nbsp;</th>
107
  <td><input type="checkbox" name="ids[]" value="<?php echo $email->id; ?>"/></td>
108
  <td><?php echo $email->id; ?></td>
109
  <td><?php echo htmlspecialchars($email->subject); ?></td>
110
+
111
  <td>
112
  <?php
113
  if ($email->status == 'sending') {
114
  if ($email->send_on > time()) {
115
+ _e('Scheduled', 'newsletter-emails');
116
  }
117
  else {
118
+ _e('Sending', 'newsletter-emails');
119
  }
120
  } else {
121
  echo $email->status;
122
  }
123
  ?>
124
  </td>
125
+ <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $email->sent . ' ' . __('of', 'newsletter') . ' ' . $email->total; ?></td>
126
  <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $module->format_date($email->send_on); ?></td>
127
+ <td><?php echo $email->track==1?__('Yes', 'newsletter-emails'):__('Yes', 'newsletter-emails'); ?></td>
128
  <td><a class="button" href="<?php echo $module->get_admin_page_url('edit'); ?>&amp;id=<?php echo $email->id; ?>">Edit</a></td>
129
  <td>
130
  <a class="button" href="<?php echo NewsletterStatistics::instance()->get_statistics_url($email->id); ?>">Statistics</a>
131
  </td>
132
+ <td><?php $controls->button_confirm('copy', __('Copy', 'newsletter-emails'), __('Proceed?', 'newsletter-emails'), $email->id); ?></td>
133
+ <td><?php $controls->button_confirm('delete', __('Delete', 'newsletter-emails'), __('Proceed?', 'newsletter-emails'), $email->id); ?></td>
134
  </tr>
135
+ <?php } ?>
136
  </tbody>
137
  </table>
138
+ <p>(*) <?php _e('The expected total can change at the delivery end due to subscriptions/unsubscriptions in the meanwhile.', 'newsletter-emails')?></p>
139
  </form>
140
  </div>
emails/languages/en_US.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  $options = array(
4
  'theme'=>'default'
5
  );
1
  <?php
2
 
3
+ // This file is used only on first installation!
4
+
5
  $options = array(
6
  'theme'=>'default'
7
  );
emails/languages/en_US.po ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Content-Type: text/plain; charset=utf-8\n"
4
+ "Content-Transfer-Encoding: 8bit\n"
5
+
6
+ #. Text in echo
7
+ #: emails/new.php:132
8
+ msgid "Back to the themes"
9
+ msgstr ""
10
+
11
+ #. Text in function
12
+ #: emails/index.php:131
13
+ msgid "Copy"
14
+ msgstr ""
15
+
16
+ #. Text in echo
17
+ #: emails/new.php:131
18
+ msgid "Create a newsletter"
19
+ msgstr ""
20
+
21
+ #. Text in echo
22
+ #: emails/index.php:94
23
+ msgid "Date"
24
+ msgstr ""
25
+
26
+ #. Text in function
27
+ #: emails/index.php:132
28
+ msgid "Delete"
29
+ msgstr ""
30
+
31
+ #. Text in function
32
+ #: emails/index.php:82
33
+ msgid "Delete selected newsletters"
34
+ msgstr ""
35
+
36
+ #. Text in function
37
+ #: emails/index.php:1
38
+ msgid "Delivery engine triggered."
39
+ msgstr ""
40
+
41
+ #. Text in echo
42
+ #: emails/edit.php:302
43
+ msgid "Gender"
44
+ msgstr ""
45
+
46
+ #. Text in function
47
+ #: emails/new.php:1
48
+ #: emails/new.php:43
49
+ msgid "Here the email subject"
50
+ msgstr ""
51
+
52
+ #. Text in echo
53
+ #: emails/edit.php:259
54
+ msgid "Message"
55
+ msgstr ""
56
+
57
+ #. Text in echo
58
+ #: emails/edit.php:260
59
+ msgid "Message (textual)"
60
+ msgstr ""
61
+
62
+ #. Text in function
63
+ #: emails/index.php:1
64
+ msgid "Message deleted."
65
+ msgstr ""
66
+
67
+ #. Text in function
68
+ #: emails/index.php:1
69
+ msgid "Message duplicated."
70
+ msgstr ""
71
+
72
+ #. Text in echo
73
+ #: emails/index.php:81
74
+ msgid "New newsletter"
75
+ msgstr ""
76
+
77
+ #. Text in echo
78
+ #: emails/index.php:58
79
+ msgid "Newsletters"
80
+ msgstr ""
81
+
82
+ #. Text in function
83
+ #: emails/index.php:82
84
+ #: emails/index.php:131
85
+ #: emails/index.php:132
86
+ msgid "Proceed?"
87
+ msgstr ""
88
+
89
+ #. Text in echo
90
+ #: emails/index.php:93
91
+ msgid "Progress"
92
+ msgstr ""
93
+
94
+ #. Text in function
95
+ #: emails/edit.php:1
96
+ msgid "Read more about test subscribers"
97
+ msgstr ""
98
+
99
+ #. Text in echo
100
+ #: emails/new.php:146
101
+ msgid "Refresh the preview"
102
+ msgstr ""
103
+
104
+ #. Text in echo
105
+ #: emails/index.php:111
106
+ msgid "Scheduled"
107
+ msgstr ""
108
+
109
+ #. Text in echo
110
+ #: emails/theme.php:54
111
+ msgid "Select a theme"
112
+ msgstr ""
113
+
114
+ #. Text in echo
115
+ #: emails/index.php:111
116
+ msgid "Sending"
117
+ msgstr ""
118
+
119
+ #. Text in echo
120
+ #: emails/index.php:92
121
+ msgid "Status"
122
+ msgstr ""
123
+
124
+ #. Text in echo
125
+ #: emails/index.php:91
126
+ msgid "Subject"
127
+ msgstr ""
128
+
129
+ #. Text in echo
130
+ #: emails/edit.php:311
131
+ msgid "Subscriber preferences"
132
+ msgstr ""
133
+
134
+ #. Text in function
135
+ #: emails/edit.php:1
136
+ msgid "Test newsletter sent to:"
137
+ msgstr ""
138
+
139
+ #. Text in echo
140
+ #: emails/index.php:137
141
+ msgid "The expected total can change at the delivery end due to subscriptions/unsubscriptions in the meanwhile."
142
+ msgstr ""
143
+
144
+ #. Text in echo
145
+ #: emails/new.php:147
146
+ msgid "Theme options are saved for next time you\\'ll use this theme."
147
+ msgstr ""
148
+
149
+ #. Text in function
150
+ #: emails/edit.php:1
151
+ msgid "There are no test subscribers."
152
+ msgstr ""
153
+
154
+ #. Text in echo
155
+ #: emails/index.php:95
156
+ msgid "Tracking"
157
+ msgstr ""
158
+
159
+ #. Text in function
160
+ #: emails/index.php:84
161
+ msgid "Trigger the delivery engine"
162
+ msgstr ""
163
+
164
+ #. Text in function
165
+ #: emails/index.php:126
166
+ msgid "Yes"
167
+ msgstr ""
168
+
169
+ #. Text in function
170
+ #: emails/index.php:124
171
+ msgid "of"
172
+ msgstr ""
emails/languages/it_IT.mo ADDED
Binary file
emails/languages/it_IT.po ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Content-Type: text/plain; charset=UTF-8\n"
4
+ "Content-Transfer-Encoding: 8bit\n"
5
+ "Project-Id-Version: \n"
6
+ "POT-Creation-Date: \n"
7
+ "PO-Revision-Date: \n"
8
+ "Last-Translator: \n"
9
+ "Language-Team: \n"
10
+ "MIME-Version: 1.0\n"
11
+ "X-Generator: Poedit 1.7.3\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "Language: it_IT\n"
14
+
15
+ #. Text in echo
16
+ #: emails/new.php:132
17
+ msgid "Back to the themes"
18
+ msgstr "Torna ai temi"
19
+
20
+ #. Text in function
21
+ #: emails/index.php:131
22
+ msgid "Copy"
23
+ msgstr "Copia"
24
+
25
+ #. Text in echo
26
+ #: emails/new.php:131
27
+ msgid "Create a newsletter"
28
+ msgstr "Crea una newsletter"
29
+
30
+ #. Text in echo
31
+ #: emails/index.php:94
32
+ msgid "Date"
33
+ msgstr "Data"
34
+
35
+ #. Text in function
36
+ #: emails/index.php:132
37
+ msgid "Delete"
38
+ msgstr "Elimina"
39
+
40
+ #. Text in function
41
+ #: emails/index.php:82
42
+ msgid "Delete selected newsletters"
43
+ msgstr "Cancella le newsletter selezionate"
44
+
45
+ #. Text in function
46
+ #: emails/index.php:1
47
+ msgid "Delivery engine triggered."
48
+ msgstr ""
49
+
50
+ #. Text in echo
51
+ #: emails/edit.php:302
52
+ msgid "Gender"
53
+ msgstr "Genere"
54
+
55
+ #. Text in function
56
+ #: emails/new.php:1 emails/new.php:43
57
+ msgid "Here the email subject"
58
+ msgstr "Qui l'oggetto dell'email"
59
+
60
+ #. Text in echo
61
+ #: emails/edit.php:259
62
+ msgid "Message"
63
+ msgstr "Messaggio"
64
+
65
+ #. Text in echo
66
+ #: emails/edit.php:260
67
+ msgid "Message (textual)"
68
+ msgstr "Messaggio (testo)"
69
+
70
+ #. Text in function
71
+ #: emails/index.php:1
72
+ msgid "Message deleted."
73
+ msgstr "Messaggio cancellato."
74
+
75
+ #. Text in function
76
+ #: emails/index.php:1
77
+ msgid "Message duplicated."
78
+ msgstr "Messaggio duplicato."
79
+
80
+ #. Text in echo
81
+ #: emails/index.php:81
82
+ msgid "New newsletter"
83
+ msgstr "Nuova newsletter"
84
+
85
+ #. Text in echo
86
+ #: emails/index.php:58
87
+ msgid "Newsletters"
88
+ msgstr ""
89
+
90
+ #. Text in function
91
+ #: emails/index.php:82 emails/index.php:131 emails/index.php:132
92
+ msgid "Proceed?"
93
+ msgstr ""
94
+
95
+ #. Text in echo
96
+ #: emails/index.php:93
97
+ msgid "Progress"
98
+ msgstr ""
99
+
100
+ #. Text in function
101
+ #: emails/edit.php:1
102
+ msgid "Read more about test subscribers"
103
+ msgstr ""
104
+
105
+ #. Text in echo
106
+ #: emails/new.php:146
107
+ msgid "Refresh the preview"
108
+ msgstr ""
109
+
110
+ #. Text in echo
111
+ #: emails/index.php:111
112
+ msgid "Scheduled"
113
+ msgstr ""
114
+
115
+ #. Text in echo
116
+ #: emails/theme.php:54
117
+ msgid "Select a theme"
118
+ msgstr ""
119
+
120
+ #. Text in echo
121
+ #: emails/index.php:111
122
+ msgid "Sending"
123
+ msgstr ""
124
+
125
+ #. Text in echo
126
+ #: emails/index.php:92
127
+ msgid "Status"
128
+ msgstr ""
129
+
130
+ #. Text in echo
131
+ #: emails/index.php:91
132
+ msgid "Subject"
133
+ msgstr ""
134
+
135
+ #. Text in echo
136
+ #: emails/edit.php:311
137
+ msgid "Subscriber preferences"
138
+ msgstr ""
139
+
140
+ #. Text in function
141
+ #: emails/edit.php:1
142
+ msgid "Test newsletter sent to:"
143
+ msgstr ""
144
+
145
+ #. Text in echo
146
+ #: emails/index.php:137
147
+ msgid ""
148
+ "The expected total can change at the delivery end due to subscriptions/"
149
+ "unsubscriptions in the meanwhile."
150
+ msgstr ""
151
+
152
+ #. Text in echo
153
+ #: emails/new.php:147
154
+ msgid "Theme options are saved for next time you\\'ll use this theme."
155
+ msgstr ""
156
+
157
+ #. Text in function
158
+ #: emails/edit.php:1
159
+ msgid "There are no test subscribers."
160
+ msgstr ""
161
+
162
+ #. Text in echo
163
+ #: emails/index.php:95
164
+ msgid "Tracking"
165
+ msgstr ""
166
+
167
+ #. Text in function
168
+ #: emails/index.php:84
169
+ msgid "Trigger the delivery engine"
170
+ msgstr ""
171
+
172
+ #. Text in function
173
+ #: emails/index.php:126
174
+ msgid "Yes"
175
+ msgstr ""
176
+
177
+ #. Text in function
178
+ #: emails/index.php:124
179
+ msgid "of"
180
+ msgstr ""
emails/new.php CHANGED
@@ -1,4 +1,8 @@
1
  <?php
 
 
 
 
2
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $controls = new NewsletterControls();
4
  $module = NewsletterEmails::instance();
@@ -6,20 +10,12 @@ $module = NewsletterEmails::instance();
6
  if ($controls->is_action('theme')) {
7
  $controls->merge($module->themes->get_options($controls->data['theme']));
8
  $module->save_options($controls->data);
9
- }
10
 
11
- if ($controls->is_action('save')) {
12
- $module->save_options($controls->data);
13
- //$controls->messages = 'Saved.';
14
- }
15
-
16
- if ($controls->is_action('create')) {
17
- $module->save_options($controls->data);
18
-
19
- if ($controls->is_action('create')) {
20
  $email = array();
21
  $email['status'] = 'new';
22
- $email['subject'] = 'Here the email subject';
23
  $email['track'] = 1;
24
 
25
  $theme_options = $module->get_current_theme_options();
@@ -41,86 +37,130 @@ if ($controls->is_action('create')) {
41
  $email['type'] = 'message';
42
  $email['send_on'] = time();
43
  $email = Newsletter::instance()->save_email($email);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  ?>
45
  <script>
46
- location.href="<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>";
47
  </script>
48
  <div class="wrap">
49
- <p>If you are not automatically redirected to the composer, <a href="<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>">click here</a>.</p>
50
  </div>
51
  <?php
52
- return;
53
- }
54
  }
55
 
56
  if ($controls->data == null) {
57
  $controls->data = $module->get_options();
58
  }
59
 
60
-
61
-
62
  function newsletter_emails_update_options($options) {
63
  add_option('newsletter_emails', '', null, 'no');
64
  update_option('newsletter_emails', $options);
65
- }
66
 
67
  function newsletter_emails_update_theme_options($theme, $options) {
68
  $x = strrpos($theme, '/');
69
  if ($x !== false) {
70
- $theme = substr($theme, $x+1);
71
  }
72
  add_option('newsletter_emails_' . $theme, '', null, 'no');
73
  update_option('newsletter_emails_' . $theme, $options);
74
- }
75
 
76
  function newsletter_emails_get_options() {
77
  $options = get_option('newsletter_emails', array());
78
  return $options;
79
- }
80
 
81
  function newsletter_emails_get_theme_options($theme) {
82
  $x = strrpos($theme, '/');
83
  if ($x !== false) {
84
- $theme = substr($theme, $x+1);
85
  }
86
  $options = get_option('newsletter_emails_' . $theme, array());
87
  return $options;
88
- }
89
  ?>
90
 
91
  <div class="wrap">
92
 
93
- <?php //$help_url = 'http://www.satollo.net/plugins/newsletter/newsletters-module'; ?>
94
- <?php //include NEWSLETTER_DIR . '/header-new.php'; ?>
95
 
96
  <div id="newsletter-title">
97
- <h2>New Newsletter</h2>
98
- <p><a href="<?php echo NewsletterEmails::instance()->get_admin_page_url('theme'); ?>">Back to the themes</a></p>
99
- </div>
 
100
  <div class="newsletter-separator"></div>
101
-
102
  <?php $controls->show(); ?>
103
 
104
  <form method="post" action="<?php echo $module->get_admin_page_url('new'); ?>">
105
  <?php $controls->init(); ?>
106
  <?php $controls->hidden('theme'); ?>
107
 
108
- <table style="width: 100%">
109
  <tr>
110
- <td style="text-align: center; vertical-align: top; border-bottom: 1px solid #ccc">
111
- <?php $controls->button_primary('save', '(1) Save options and refresh the preview'); ?><br><br>
 
 
112
  </td>
113
- <td style="text-align: center; vertical-align: top; border-bottom: 1px solid #ccc">
114
- <?php $controls->button_primary('create', '(2) Go to edit this message'); ?><br><br>
 
115
  </td>
116
  </tr>
117
  <tr>
118
- <td style="width: 600px; vertical-align: top">
119
  <?php @include $module->get_current_theme_file_path('theme-options.php'); ?>
120
-
121
- This theme options are saved for next time you'll use it!
122
  </td>
123
- <td style="vertical-align: top">
124
  <iframe src="<?php echo wp_nonce_url(plugins_url('newsletter') . '/emails/preview.php?' . time()); ?>" width="100%" height="700" style="border: 1px solid #ccc"></iframe>
125
  </td>
126
  </tr>
1
  <?php
2
+ if (function_exists('load_plugin_textdomain')) {
3
+ load_plugin_textdomain('newsletter-emails', false, 'newsletter/emails/languages');
4
+ load_plugin_textdomain('newsletter', false, 'newsletter/languages');
5
+ }
6
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
7
  $controls = new NewsletterControls();
8
  $module = NewsletterEmails::instance();
10
  if ($controls->is_action('theme')) {
11
  $controls->merge($module->themes->get_options($controls->data['theme']));
12
  $module->save_options($controls->data);
 
13
 
14
+ // If this theme has no intermediate options...
15
+ if (!file_exists($module->get_current_theme_file_path('theme-options.php'))) {
 
 
 
 
 
 
 
16
  $email = array();
17
  $email['status'] = 'new';
18
+ $email['subject'] = __('Here the email subject', 'newsletter-emails');
19
  $email['track'] = 1;
20
 
21
  $theme_options = $module->get_current_theme_options();
37
  $email['type'] = 'message';
38
  $email['send_on'] = time();
39
  $email = Newsletter::instance()->save_email($email);
40
+ ?>
41
+ <script>
42
+ location.href = "<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>";
43
+ </script>
44
+ <div class="wrap">
45
+ <p>If you are not automatically redirected to the composer, <a href="<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>">click here</a>.</p>
46
+ </div>
47
+ <?php
48
+ return;
49
+ }
50
+ }
51
+
52
+ if ($controls->is_action('save')) {
53
+ $module->save_options($controls->data);
54
+ //$controls->messages = 'Saved.';
55
+ }
56
+
57
+ if ($controls->is_action('create')) {
58
+ $module->save_options($controls->data);
59
+
60
+ $email = array();
61
+ $email['status'] = 'new';
62
+ $email['subject'] = __('Here the email subject', 'newsletter-emails');
63
+ $email['track'] = 1;
64
+
65
+ $theme_options = $module->get_current_theme_options();
66
+
67
+ $theme_url = $module->get_current_theme_url();
68
+ $theme_subject = '';
69
+
70
+ ob_start();
71
+ include $module->get_current_theme_file_path('theme.php');
72
+ $email['message'] = ob_get_clean();
73
+
74
+ if (!empty($theme_subject)) {
75
+ $email['subject'] = $theme_subject;
76
+ }
77
+
78
+ ob_start();
79
+ include $module->get_current_theme_file_path('theme-text.php');
80
+ $email['message_text'] = ob_get_clean();
81
+
82
+ $email['type'] = 'message';
83
+ $email['send_on'] = time();
84
+ $email = Newsletter::instance()->save_email($email);
85
  ?>
86
  <script>
87
+ location.href = "<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>";
88
  </script>
89
  <div class="wrap">
90
+ <p><a href="<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>">click here to proceed</a>.</p>
91
  </div>
92
  <?php
93
+ return;
 
94
  }
95
 
96
  if ($controls->data == null) {
97
  $controls->data = $module->get_options();
98
  }
99
 
 
 
100
  function newsletter_emails_update_options($options) {
101
  add_option('newsletter_emails', '', null, 'no');
102
  update_option('newsletter_emails', $options);
103
+ }
104
 
105
  function newsletter_emails_update_theme_options($theme, $options) {
106
  $x = strrpos($theme, '/');
107
  if ($x !== false) {
108
+ $theme = substr($theme, $x + 1);
109
  }
110
  add_option('newsletter_emails_' . $theme, '', null, 'no');
111
  update_option('newsletter_emails_' . $theme, $options);
112
+ }
113
 
114
  function newsletter_emails_get_options() {
115
  $options = get_option('newsletter_emails', array());
116
  return $options;
117
+ }
118
 
119
  function newsletter_emails_get_theme_options($theme) {
120
  $x = strrpos($theme, '/');
121
  if ($x !== false) {
122
+ $theme = substr($theme, $x + 1);
123
  }
124
  $options = get_option('newsletter_emails_' . $theme, array());
125
  return $options;
126
+ }
127
  ?>
128
 
129
  <div class="wrap">
130
 
131
+ <?php //$help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/newsletters-module'; ?>
132
+ <?php //include NEWSLETTER_DIR . '/header-new.php'; ?>
133
 
134
  <div id="newsletter-title">
135
+ <h2><?php _e('Create a newsletter', 'newsletter-emails') ?>
136
+ <a class="add-new-h2" href="<?php echo NewsletterEmails::instance()->get_admin_page_url('theme'); ?>"><?php _e('Back to the themes', 'newsletter-emails') ?></a>
137
+ </h2>
138
+ </div>
139
  <div class="newsletter-separator"></div>
140
+
141
  <?php $controls->show(); ?>
142
 
143
  <form method="post" action="<?php echo $module->get_admin_page_url('new'); ?>">
144
  <?php $controls->init(); ?>
145
  <?php $controls->hidden('theme'); ?>
146
 
147
+ <table style="width: 100%; border-collapse: collapse">
148
  <tr>
149
+ <td style="text-align: left; vertical-align: top; border-bottom: 1px solid #ddd; padding-bottom: 10px">
150
+ <div style="float: right; margin-left: 15px;"><?php $controls->button_primary('save', __('Refresh the preview', 'newsletter-emails')); ?></div>
151
+ <span style="font-size: 1.1em"><?php _e('Theme options are saved for next time you\'ll use this theme.', 'newsletter-emails') ?></span>
152
+
153
  </td>
154
+ <td style="text-align: left; vertical-align: top; border-bottom: 1px solid #ddd; padding-bottom: 10px">
155
+ <div style="float: right"><?php $controls->button_primary('create', 'Proceed to edit &raquo;', 'this.form.action=\'' . plugins_url('newsletter') . '/emails/create.php\';this.form.submit()'); ?></div>
156
+ <img style="position: relative; left: 5px; top: 10px;"src="<?php echo plugins_url('newsletter') ?>/images/arrow.png" height="35">
157
  </td>
158
  </tr>
159
  <tr>
160
+ <td style="width: 600px; vertical-align: top; padding-top: 10px">
161
  <?php @include $module->get_current_theme_file_path('theme-options.php'); ?>
 
 
162
  </td>
163
+ <td style="vertical-align: top; padding-top: 15px; padding-left: 15px">
164
  <iframe src="<?php echo wp_nonce_url(plugins_url('newsletter') . '/emails/preview.php?' . time()); ?>" width="100%" height="700" style="border: 1px solid #ccc"></iframe>
165
  </td>
166
  </tr>
emails/theme.php CHANGED
@@ -14,61 +14,65 @@ if ($controls->data == null) {
14
  $controls->data = $module->get_options();
15
  }
16
 
17
-
18
-
19
  function newsletter_emails_update_options($options) {
20
  add_option('newsletter_emails', '', null, 'no');
21
  update_option('newsletter_emails', $options);
22
- }
23
 
24
  function newsletter_emails_update_theme_options($theme, $options) {
25
  $x = strrpos($theme, '/');
26
  if ($x !== false) {
27
- $theme = substr($theme, $x+1);
28
  }
29
  add_option('newsletter_emails_' . $theme, '', null, 'no');
30
  update_option('newsletter_emails_' . $theme, $options);
31
- }
32
 
33
  function newsletter_emails_get_options() {
34
  $options = get_option('newsletter_emails', array());
35
  return $options;
36
- }
37
 
38
  function newsletter_emails_get_theme_options($theme) {
39
  $x = strrpos($theme, '/');
40
  if ($x !== false) {
41
- $theme = substr($theme, $x+1);
42
  }
43
  $options = get_option('newsletter_emails_' . $theme, array());
44
  return $options;
45
- }
46
-
47
- $themes = $module->themes->get_all_with_data();
48
  ?>
49
 
50
  <div class="wrap">
51
 
52
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/newsletters-module'; ?>
53
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
54
 
55
  <div id="newsletter-title">
56
- <h2>New Newsletter: Theme Selection</h2>
57
-
58
- <p>To create custom themes <a href="http://www.satollo.net/plugins/newsletter/newsletter-themes" target="_blank">read here</a>.</p>
59
  </div>
60
-
61
  <div class="newsletter-separator"></div>
62
-
63
  <?php $controls->show(); ?>
64
 
65
  <form method="post" id="newsletter-form" action="<?php echo $module->get_admin_page_url('new'); ?>">
66
  <?php $controls->init(); ?>
67
  <?php $controls->hidden('theme'); ?>
68
  <?php foreach ($themes as $key => &$data) { ?>
69
- <div style="display: block; float: left; text-align: center; margin-right: 10px;">
70
- <?php echo $key; ?><br>
71
- <a href="#" onclick="var f = document.getElementById('newsletter-form'); f.act.value='theme'; f.elements['options[theme]'].value='<?php echo $key; ?>'; f.submit(); return false" style="margin-right: 20px; margin-bottom: 20px"><img src="<?php echo $data['screenshot'] ?>" width="200" height="200" style="border: 5px solid #ccc; border-radius: 5px; padding: 5px"></a>
 
 
 
 
 
 
72
  </div>
73
  <?php } ?>
74
  </form>
14
  $controls->data = $module->get_options();
15
  }
16
 
 
 
17
  function newsletter_emails_update_options($options) {
18
  add_option('newsletter_emails', '', null, 'no');
19
  update_option('newsletter_emails', $options);
20
+ }
21
 
22
  function newsletter_emails_update_theme_options($theme, $options) {
23
  $x = strrpos($theme, '/');
24
  if ($x !== false) {
25
+ $theme = substr($theme, $x + 1);
26
  }
27
  add_option('newsletter_emails_' . $theme, '', null, 'no');
28
  update_option('newsletter_emails_' . $theme, $options);
29
+ }
30
 
31
  function newsletter_emails_get_options() {
32
  $options = get_option('newsletter_emails', array());
33
  return $options;
34
+ }
35
 
36
  function newsletter_emails_get_theme_options($theme) {
37
  $x = strrpos($theme, '/');
38
  if ($x !== false) {
39
+ $theme = substr($theme, $x + 1);
40
  }
41
  $options = get_option('newsletter_emails_' . $theme, array());
42
  return $options;
43
+ }
44
+
45
+ $themes = $module->themes->get_all_with_data();
46
  ?>
47
 
48
  <div class="wrap">
49
 
50
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/newsletters-module'; ?>
51
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
52
 
53
  <div id="newsletter-title">
54
+ <h2><?php _e('Select a theme', 'newsletter-emails') ?>
55
+ <a class="add-new-h2" href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-themes" target="_blank">Custom themes</a>
56
+ </h2>
57
  </div>
58
+
59
  <div class="newsletter-separator"></div>
60
+
61
  <?php $controls->show(); ?>
62
 
63
  <form method="post" id="newsletter-form" action="<?php echo $module->get_admin_page_url('new'); ?>">
64
  <?php $controls->init(); ?>
65
  <?php $controls->hidden('theme'); ?>
66
  <?php foreach ($themes as $key => &$data) { ?>
67
+ <div class="tnp-theme-preview">
68
+ <p><?php echo $data['name']; ?></p>
69
+ <a href="#" onclick="var f = document.getElementById('newsletter-form');
70
+ f.act.value = 'theme';
71
+ f.elements['options[theme]'].value = '<?php echo $data['name']; ?>';
72
+ f.submit();
73
+ return false;" style="margin-right: 20px; margin-bottom: 20px">
74
+ <img src="<?php echo $data['screenshot'] ?>" width="200" height="200">
75
+ </a>
76
  </div>
77
  <?php } ?>
78
  </form>
emails/themes/blank/theme-text.php CHANGED
@@ -1,7 +1,8 @@
1
- Blank newsletter!
2
 
3
- ---
4
- To unsubscribe follow the link
5
- {unsubscription_url}
6
- to edit your profile follow the link
7
- {profile_url}
 
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
 
3
+ {email_url}.
4
+
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
+
7
+ To change your subscription follow:
8
+ {profile_url}.
emails/themes/default/footer.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <!-- Footer -->
2
+ <div style="text-align: center; font-weight: bold; margin: 40px 0 10px;"><?php echo $theme_options['main_footer_title'] ?></div>
3
+ <div style="text-align: center; margin: 10px 0 20px;"><?php echo $theme_options['main_footer_contact'] ?></div>
4
+
5
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social_main.php'; ?>
6
+
7
+ <div style="text-align: center; color: #888; margin-top: 20px;"><?php echo $theme_options['main_footer_legal'] ?></div>
8
+ <div style="text-align: center; color: #888">To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.</div>
emails/themes/default/images/facebook.png CHANGED
Binary file
emails/themes/default/images/googleplus.png CHANGED
Binary file
emails/themes/default/images/linkedin.png CHANGED
Binary file
emails/themes/default/images/twitter.png CHANGED
Binary file
emails/themes/default/images/vimeo.png ADDED
Binary file
emails/themes/default/images/youtube.png CHANGED
Binary file
emails/themes/default/screenshot.png CHANGED
Binary file
emails/themes/default/social.php CHANGED
@@ -1,7 +1,7 @@
1
  <!-- Social -->
2
  <?php
3
- if (isset($theme_options['theme_social_disable'])) return;
4
- $social_icon_url = plugins_url('emails/themes/default/images', 'newsletter/plugin.pnp');
5
  ?>
6
  <table cellpadding="5" align="center">
7
  <tr>
@@ -46,7 +46,7 @@ $social_icon_url = plugins_url('emails/themes/default/images', 'newsletter/plugi
46
  <a href="<?php echo $theme_options['theme_youtube'] ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"><br>Youtube</a>
47
  </td>
48
  <?php } ?>
49
-
50
  <?php if (!empty($theme_options['theme_soundcloud'])) { ?>
51
  <td style="text-align: center; vertical-align: top" align="center" valign="top">
52
  <a href="<?php echo $theme_options['theme_soundcloud'] ?>"><img src="<?php echo $social_icon_url ?>/soundcloud.png"><br>SoundCloud</a>
1
  <!-- Social -->
2
  <?php
3
+ if (isset($theme_options['theme_social_disable'])) return;
4
+ $social_icon_url = plugins_url('newsletter') . '/emails/themes/default/images';
5
  ?>
6
  <table cellpadding="5" align="center">
7
  <tr>
46
  <a href="<?php echo $theme_options['theme_youtube'] ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"><br>Youtube</a>
47
  </td>
48
  <?php } ?>
49
+
50
  <?php if (!empty($theme_options['theme_soundcloud'])) { ?>
51
  <td style="text-align: center; vertical-align: top" align="center" valign="top">
52
  <a href="<?php echo $theme_options['theme_soundcloud'] ?>"><img src="<?php echo $social_icon_url ?>/soundcloud.png"><br>SoundCloud</a>
emails/themes/default/social_main.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- Social -->
2
+ <?php
3
+ if (isset($theme_options['theme_social_disable'])) return;
4
+ $social_icon_url = plugins_url('newsletter') . '/emails/themes/default/images';
5
+ ?>
6
+ <table cellpadding="5" align="center">
7
+ <tr>
8
+ <?php if (!empty($theme_options['main_facebook_url'])) { ?>
9
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
10
+ <a href="<?php echo $theme_options['main_facebook_url'] ?>"><img src="<?php echo $social_icon_url ?>/facebook.png" alt="Facebook"></a>
11
+ </td>
12
+ <?php } ?>
13
+
14
+ <?php if (!empty($theme_options['main_googleplus_url'])) { ?>
15
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
16
+ <a href="<?php echo $theme_options['main_googleplus_url'] ?>"><img src="<?php echo $social_icon_url ?>/googleplus.png"></a>
17
+ </td>
18
+ <?php } ?>
19
+
20
+ <?php if (!empty($theme_options['main_twitter_url'])) { ?>
21
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
22
+ <a href="<?php echo $theme_options['main_twitter_url'] ?>"><img src="<?php echo $social_icon_url ?>/twitter.png"></a>
23
+ </td>
24
+ <?php } ?>
25
+
26
+ <?php if (!empty($theme_options['main_linkedin_url'])) { ?>
27
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
28
+ <a href="<?php echo $theme_options['main_linkedin_url'] ?>"><img src="<?php echo $social_icon_url ?>/linkedin.png"></a>
29
+ </td>
30
+ <?php } ?>
31
+
32
+ <?php if (!empty($theme_options['main_youtube_url'])) { ?>
33
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
34
+ <a href="<?php echo $theme_options['main_youtube_url'] ?>"><img src="<?php echo $social_icon_url ?>/youtube.png"></a>
35
+ </td>
36
+ <?php } ?>
37
+
38
+ <?php if (!empty($theme_options['main_vimeo_url'])) { ?>
39
+ <td style="text-align: center; vertical-align: top" align="center" valign="top">
40
+ <a href="<?php echo $theme_options['main_vimeo_url'] ?>"><img src="<?php echo $social_icon_url ?>/vimeo.png"></a>
41
+ </td>
42
+ <?php } ?>
43
+ </tr>
44
+ </table>
emails/themes/default/theme-options.php CHANGED
@@ -1,43 +1,78 @@
1
- <div id="tabs">
2
  <ul>
3
  <li><a href="#tab-general">General</a></li>
4
  <li><a href="#tab-posts">Posts</a></li>
5
- <li><a href="#tab-social">Social</a></li>
6
  </ul>
7
 
8
- <div id="tab-general">
9
- Base color
10
- <?php $controls->color('theme_color'); ?> (format #RRGGBB)
11
- <br><br>
12
- Banner/Title
13
- <?php $controls->wp_editor('theme_banner'); ?>
14
- <div class="hints">
15
- Create a content with an image (500 pixel wide) that will be your newsletter banner and that will replace the
16
- title with your blog name.
17
- </div>
18
- </div>
19
- <div id="tab-posts">
20
- <?php $controls->checkbox('theme_posts', 'Add latest posts'); ?>
21
- <br>
22
- <?php $controls->checkbox('theme_thumbnails', 'Add post thumbnails'); ?>
23
- <br>
24
- <?php $controls->checkbox('theme_excerpts', 'Add post excerpts'); ?>
25
- <br><br>
26
- Categories
27
- <?php $controls->categories_group('theme_categories'); ?>
28
- <br><br>
29
- Tags
30
- <?php $controls->text('theme_tags', 30); ?> (comma separated)
31
- <br><br>
32
- Max posts
33
- <?php $controls->text('theme_max_posts', 5); ?>
34
- <br><br>
35
- Post types to include
36
- <br>
37
- <?php $controls->post_types('theme_post_types'); ?>
38
- <div class="hints">Leave all uncheck for a default behavior.</div>
39
- </div>
40
- <div id="tab-social">
41
- <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
42
- </div>
43
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--<div id="tabs">
2
  <ul>
3
  <li><a href="#tab-general">General</a></li>
4
  <li><a href="#tab-posts">Posts</a></li>
 
5
  </ul>
6
 
7
+ <div id="tab-general">-->
8
+ <table class="form-table">
9
+ <tr><td colspan="2">General options for header, social links and footer sections could also be set in <a href="?page=newsletter_main_main">Blog Info panel</a>.</td></tr>
10
+ <tr>
11
+ <th>Base color</th>
12
+ <td>
13
+ <?php $controls->color('theme_color'); ?>
14
+ <p class="description" style="display: inline">Hex values, e.g. #FF0000</p>
15
+ </td>
16
+ </tr>
17
+ <tr>
18
+ <th>Disable social links</th>
19
+ <td><?php $controls->checkbox('theme_social_disable', ''); ?></td>
20
+ </tr>
21
+ <!-- <tr>
22
+ <th>Banner/Title</th>
23
+ <td>
24
+ <?php //$controls->wp_editor('theme_banner'); ?>
25
+ <div class="hints">
26
+ Create a content with an image (500 pixel wide) that will be your newsletter banner and that will replace the
27
+ title with your blog name.
28
+ </div>
29
+ <?php $controls->media('theme_header_logo', 'full'); ?>
30
+ <p class="description">
31
+ Click to change. This should be your logo in .png or .jpg format.
32
+ </p>
33
+ </td>
34
+ </tr>-->
35
+ </table>
36
+ <h3>Posts</h3>
37
+ <table class="form-table">
38
+ <tr>
39
+ <th>Posts</th>
40
+ <td>
41
+ <?php $controls->checkbox('theme_posts', 'Add latest posts'); ?>
42
+ <br>
43
+ <?php $controls->checkbox('theme_thumbnails', 'Add post thumbnails'); ?>
44
+ <br>
45
+ <?php $controls->checkbox('theme_excerpts', 'Add post excerpts'); ?>
46
+ </td>
47
+ </tr>
48
+ <tr>
49
+ <th>Categories</th>
50
+ <td>
51
+ <?php $controls->categories_group('theme_categories'); ?>
52
+ </td>
53
+ </tr>
54
+ <tr>
55
+ <th>Tags</th>
56
+ <td>
57
+ <?php $controls->text('theme_tags', 30); ?>
58
+ <p class="description" style="display: inline"> comma separated</p>
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <th>Max posts</th>
63
+ <td>
64
+ <?php $controls->text('theme_max_posts', 5); ?>
65
+ </td>
66
+ </tr>
67
+ <tr>
68
+ <th>Post types to include</th>
69
+ <td>
70
+ <?php $controls->post_types('theme_post_types'); ?>
71
+ <div class="hints">Leave all unchecked for default behaviour.</div>
72
+ </td>
73
+ </tr>
74
+ </table>
75
+ <!--</div>-->
76
+ <!--<div id="tab-posts">-->
77
+ <!--</div>-->
78
+ <!--</div>-->
emails/themes/default/theme-text.php CHANGED
@@ -1,8 +1,8 @@
1
- This email requires a modern e-mail reader but uou can view the email online here:
2
 
3
  {email_url}.
4
 
5
- Thank you, <?php echo get_option('blogname'); ?>
6
 
7
  To change your subscription follow:
8
  {profile_url}.
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
 
3
  {email_url}.
4
 
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
 
7
  To change your subscription follow:
8
  {profile_url}.
emails/themes/default/theme.php CHANGED
@@ -11,7 +11,7 @@
11
  global $newsletter, $post;
12
 
13
  $color = $theme_options['theme_color'];
14
- if (empty($color)) $color = '#0088cc';
15
 
16
  if (isset($theme_options['theme_posts'])) {
17
  $filters = array();
@@ -50,24 +50,37 @@ if (isset($theme_options['theme_posts'])) {
50
  <table align="center">
51
  <tr>
52
  <td style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666;">
53
- <div style="text-align: left; background-color: #fff; max-width: 500px; border-top: 10px solid <?php echo $color; ?>; border-bottom: 3px solid <?php echo $color; ?>;">
54
-
55
- <?php
56
- if (!empty($theme_options['theme_banner'])) {
57
- echo $theme_options['theme_banner'];
58
- } else { ?>
59
- <div style="padding: 10px 20px; color: #000; font-size: 20px; background-color: #EFEFEF; border-bottom: 1px solid #ddd">
60
- <?php echo get_option('blogname'); ?>
 
 
 
 
 
 
 
 
 
 
61
  </div>
 
 
 
 
62
  <?php } ?>
63
-
64
- <div style="padding: 20px; background-color: #fff; line-height: 18px">
65
 
66
- <p style="text-align: center"><a target="_blank" href="{email_url}">View this email online</a></p>
67
 
68
- <?php if (empty($posts)) { ?>
69
- <p>Here you can start to write your message. Be polite with your readers! Do not forget the subsject of this message.</p>
70
- <?php } else { ?>
71
  <table cellpadding="5">
72
  <?php foreach ($posts as $post) { setup_postdata($post); ?>
73
  <tr>
@@ -83,9 +96,8 @@ if (isset($theme_options['theme_posts'])) {
83
  </table>
84
  <?php } ?>
85
 
86
- <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
87
 
88
- <p>To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.
89
  </div>
90
 
91
  </div>
11
  global $newsletter, $post;
12
 
13
  $color = $theme_options['theme_color'];
14
+ if (empty($color)) $color = '#000000';
15
 
16
  if (isset($theme_options['theme_posts'])) {
17
  $filters = array();
50
  <table align="center">
51
  <tr>
52
  <td style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666;">
53
+ <div style="text-align: left; background-color: #fff; max-width: 500px;">
54
+ <div style="text-align: center">
55
+ <?php //HEADER
56
+ // if (!empty($theme_options['theme_banner'])) {
57
+ // echo $theme_options['theme_banner'];
58
+ if (!empty($theme_options['theme_header_logo']['url'])) { ?>
59
+ <img alt="<?php echo $theme_options['main_header_title'] ?>" src="<?php echo $theme_options['theme_header_logo']['url'] ?>" />
60
+ <?php } elseif (!empty($theme_options['main_header_logo']['url'])) { ?>
61
+ <img alt="<?php echo $theme_options['main_header_title'] ?>" src="<?php echo $theme_options['main_header_logo']['url'] ?>" />
62
+ <?php } elseif (!empty($theme_options['main_header_title'])) { ?>
63
+ <div style="padding: 30px 0; color: #000; font-size: 28px; background-color: #EFEFEF; border-bottom: 1px solid #ddd; text-align: center;">
64
+ <?php echo $theme_options['main_header_title'] ?>
65
+ </div>
66
+ <?php } else { ?>
67
+ <div style="padding: 30px 20px; color: #000; font-size: 28px; background-color: #EFEFEF; border-bottom: 1px solid #ddd; text-align: center;">
68
+ <?php echo get_option('blogname'); ?>
69
+ </div>
70
+ <?php } ?>
71
  </div>
72
+ <?php if (!empty($theme_options['main_header_sub'])) { ?>
73
+ <div style="padding: 10px 0; color: #000; font-size: 16px; text-align: center;">
74
+ <?php echo $theme_options['main_header_sub'] ?>
75
+ </div>
76
  <?php } ?>
77
+
78
+ <div style="padding: 10px 20px 20px 20px; background-color: #fff; line-height: 18px">
79
 
80
+ <p style="text-align: center; font-size: small;"><a target="_blank" href="{email_url}">View this email online</a></p>
81
 
82
+ <p>Here you can start to write your message. Be polite with your readers! Don't forget the subject of this message.</p>
83
+ <?php if (!empty($posts)) { ?>
 
84
  <table cellpadding="5">
85
  <?php foreach ($posts as $post) { setup_postdata($post); ?>
86
  <tr>
96
  </table>
97
  <?php } ?>
98
 
99
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/footer.php'; ?>
100
 
 
101
  </div>
102
 
103
  </div>
emails/themes/linear/theme-options.php CHANGED
@@ -7,5 +7,12 @@
7
  <th>Categories</th>
8
  <td><?php $controls->categories_group('theme_categories'); ?></td>
9
  </tr>
 
 
 
 
 
 
 
10
  </table>
11
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
7
  <th>Categories</th>
8
  <td><?php $controls->categories_group('theme_categories'); ?></td>
9
  </tr>
10
+ <tr>
11
+ <th>Post types</th>
12
+ <td>
13
+ <?php $controls->post_types('theme_post_types'); ?>
14
+ <p class="description">Leave all uncheck for a default behavior.</p>
15
+ </td>
16
+ </tr>
17
  </table>
18
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
emails/themes/linear/theme-text.php CHANGED
@@ -1,8 +1,8 @@
1
- This email requires a modern e-mail reader. You can view the email online here:
2
 
3
  {email_url}.
4
 
5
- Thank you, <?php echo get_option('blogname'); ?>
6
 
7
  To change your subscription follow:
8
  {profile_url}.
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
 
3
  {email_url}.
4
 
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
 
7
  To change your subscription follow:
8
  {profile_url}.
emails/themes/linear/theme.php CHANGED
@@ -5,12 +5,19 @@ $filters = array();
5
  if (!empty($theme_options['theme_categories'])) {
6
  $filters['category__in'] = $theme_options['theme_categories'];
7
  }
8
- if (empty($theme_options['theme_max_posts']))
 
9
  $filters['showposts'] = 10;
10
- else
11
  $filters['showposts'] = (int) $theme_options['theme_max_posts'];
 
 
 
 
 
12
 
13
  $posts = get_posts($filters);
 
14
  ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
15
  <html>
16
  <head>
@@ -45,7 +52,7 @@ $posts = get_posts($filters);
45
  <table border="0" cellpadding="0" cellspacing="0" width="600" bgcolor="#FFFFFF">
46
  <tr>
47
  <td align="center" valign="middle" height="150" style="color: #202020;font-family: Arial;font-size: 34px;font-weight: bold;line-height: 100%;padding: 5px 0 -2px 0;border-width: 1px 0px;border-style: solid;border-color: #dddddd;">
48
- <?php echo get_option('blogname'); ?>
49
  </td>
50
  </tr>
51
  </table>
@@ -74,7 +81,7 @@ $posts = get_posts($filters);
74
  <?php } ?>
75
  </td>
76
  </tr>
77
- <?php } ?>
78
  </table>
79
  </td>
80
 
@@ -83,18 +90,17 @@ $posts = get_posts($filters);
83
  <tr>
84
  <td valign="top">
85
 
86
- <?php foreach ($posts as $post) {
87
- setup_postdata($post);
88
- ?>
89
  <h2 style="color: #202020;font-family: Arial;font-size: 20px;font-weight: bold;margin-top: 0;margin-bottom: 10px;border-bottom: 1px solid #efefef;">
90
  <?php the_title(); ?>
91
  </h2>
92
  <center><img src="<?php echo newsletter_get_post_image($post->ID, 'medium'); ?>"></center>
93
  <div style="color: #505050;font-family: Arial;font-size: 14px;line-height: 150%;">
94
- <?php the_excerpt(); ?>
95
  </div>
96
- <?php } ?>
97
-
98
  </td>
99
  </tr>
100
  </table>
5
  if (!empty($theme_options['theme_categories'])) {
6
  $filters['category__in'] = $theme_options['theme_categories'];
7
  }
8
+
9
+ if (empty($theme_options['theme_max_posts'])) {
10
  $filters['showposts'] = 10;
11
+ } else {
12
  $filters['showposts'] = (int) $theme_options['theme_max_posts'];
13
+ }
14
+
15
+ if (!empty($theme_options['theme_post_types'])) {
16
+ $filters['post_type'] = $theme_options['theme_post_types'];
17
+ }
18
 
19
  $posts = get_posts($filters);
20
+
21
  ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
22
  <html>
23
  <head>
52
  <table border="0" cellpadding="0" cellspacing="0" width="600" bgcolor="#FFFFFF">
53
  <tr>
54
  <td align="center" valign="middle" height="150" style="color: #202020;font-family: Arial;font-size: 34px;font-weight: bold;line-height: 100%;padding: 5px 0 -2px 0;border-width: 1px 0px;border-style: solid;border-color: #dddddd;">
55
+ <?php echo get_option('blogname'); ?>
56
  </td>
57
  </tr>
58
  </table>
81
  <?php } ?>
82
  </td>
83
  </tr>
84
+ <?php } ?>
85
  </table>
86
  </td>
87
 
90
  <tr>
91
  <td valign="top">
92
 
93
+ <?php foreach ($posts as $post) {
94
+ setup_postdata($post);
95
+ ?>
96
  <h2 style="color: #202020;font-family: Arial;font-size: 20px;font-weight: bold;margin-top: 0;margin-bottom: 10px;border-bottom: 1px solid #efefef;">
97
  <?php the_title(); ?>
98
  </h2>
99
  <center><img src="<?php echo newsletter_get_post_image($post->ID, 'medium'); ?>"></center>
100
  <div style="color: #505050;font-family: Arial;font-size: 14px;line-height: 150%;">
101
+ <?php the_excerpt(); ?>
102
  </div>
103
+ <?php } ?>
 
104
  </td>
105
  </tr>
106
  </table>
emails/themes/pint/theme-text.php CHANGED
@@ -1,8 +1,8 @@
1
- This email requires a modern e-mail reader. You can view the email online here:
2
 
3
  {email_url}.
4
 
5
- Thank you, <?php echo get_option('blogname'); ?>
6
 
7
  To change your subscription follow:
8
  {profile_url}.
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
 
3
  {email_url}.
4
 
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
 
7
  To change your subscription follow:
8
  {profile_url}.
emails/themes/simple/theme-text.php CHANGED
@@ -1,8 +1,8 @@
1
- This email requires a modern e-mail reader but uou can view the email online here:
2
 
3
  {email_url}.
4
 
5
- Thank you, <?php echo get_option('blogname'); ?>
6
 
7
  To change your subscription follow:
8
  {profile_url}.
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
 
3
  {email_url}.
4
 
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
 
7
  To change your subscription follow:
8
  {profile_url}.
emails/themes/theme-1/theme-options.php CHANGED
@@ -38,6 +38,5 @@ $controls->merge_defaults($theme_defaults);
38
  </tr>
39
  </table>
40
 
41
- <h3>Social</h3>
42
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
43
 
38
  </tr>
39
  </table>
40
 
 
41
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
42
 
emails/themes/theme-3/theme-options.php CHANGED
@@ -39,6 +39,5 @@ $controls->merge_defaults($theme_defaults);
39
  </tr>
40
  </table>
41
 
42
- <h3>Social</h3>
43
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
44
 
39
  </tr>
40
  </table>
41
 
 
42
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
43
 
emails/themes/vimeo-like/theme-options.php CHANGED
@@ -3,19 +3,19 @@
3
  * This is a pre packaged theme options page. Every option name
4
  * must start with "theme_" so Newsletter can distinguish them from other
5
  * options that are specific to the object using the theme.
6
- *
7
  * An array of theme default options should always be present and that default options
8
  * should be merged with the current complete set of options as shown below.
9
- *
10
  * Every theme can define its own set of options, the will be used in the theme.php
11
  * file while composing the email body. Newsletter knows nothing about theme options
12
  * (other than saving them) and does not use or relies on any of them.
13
- *
14
  * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
  * a decent system will be implemented.
16
  */
17
  $theme_defaults = array(
18
- 'theme_max_posts'=>5,
19
  'theme_read_more'=>'Read More',
20
  'theme_pre_message'=>'This email has been sent to {email} because subscribed and confirmed on ' . get_option('blogname') . '. <a href="{profile_url}">Click here to modify you subscription or unsubscribe</a>.',
21
  'theme_categories'=>array()
@@ -25,29 +25,36 @@ $theme_defaults = array(
25
  $controls->merge_defaults($theme_defaults);
26
  ?>
27
 
28
- <table class="form-table">
29
  <tr valign="top">
30
  <th>Max new posts to include</th>
31
  <td>
32
  <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
33
- </td>
34
  </tr>
35
  <tr valign="top">
36
  <th>Categories to include</th>
37
  <td><?php $controls->categories_group('theme_categories'); ?></td>
38
  </tr>
 
 
 
 
 
 
 
39
  <tr valign="top">
40
  <th>Pre message</th>
41
  <td>
42
  <?php $controls->text('theme_pre_message', 70); ?>
43
  </td>
44
- </tr>
45
  <tr valign="top">
46
  <th>Read more label</th>
47
  <td>
48
  <?php $controls->text('theme_read_more'); ?>
49
  </td>
50
- </tr>
51
  </table>
52
 
53
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
3
  * This is a pre packaged theme options page. Every option name
4
  * must start with "theme_" so Newsletter can distinguish them from other
5
  * options that are specific to the object using the theme.
6
+ *
7
  * An array of theme default options should always be present and that default options
8
  * should be merged with the current complete set of options as shown below.
9
+ *
10
  * Every theme can define its own set of options, the will be used in the theme.php
11
  * file while composing the email body. Newsletter knows nothing about theme options
12
  * (other than saving them) and does not use or relies on any of them.
13
+ *
14
  * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
  * a decent system will be implemented.
16
  */
17
  $theme_defaults = array(
18
+ 'theme_max_posts'=>5,
19
  'theme_read_more'=>'Read More',
20
  'theme_pre_message'=>'This email has been sent to {email} because subscribed and confirmed on ' . get_option('blogname') . '. <a href="{profile_url}">Click here to modify you subscription or unsubscribe</a>.',
21
  'theme_categories'=>array()
25
  $controls->merge_defaults($theme_defaults);
26
  ?>
27
 
28
+ <table class="form-table">
29
  <tr valign="top">
30
  <th>Max new posts to include</th>
31
  <td>
32
  <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
33
+ </td>
34
  </tr>
35
  <tr valign="top">
36
  <th>Categories to include</th>
37
  <td><?php $controls->categories_group('theme_categories'); ?></td>
38
  </tr>
39
+ <tr>
40
+ <th>Post types</th>
41
+ <td>
42
+ <?php $controls->post_types('theme_post_types'); ?>
43
+ <p class="description">Leave all uncheck for a default behavior.</p>
44
+ </td>
45
+ </tr>
46
  <tr valign="top">
47
  <th>Pre message</th>
48
  <td>
49
  <?php $controls->text('theme_pre_message', 70); ?>
50
  </td>
51
+ </tr>
52
  <tr valign="top">
53
  <th>Read more label</th>
54
  <td>
55
  <?php $controls->text('theme_read_more'); ?>
56
  </td>
57
+ </tr>
58
  </table>
59
 
60
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
emails/themes/vimeo-like/theme-text.php CHANGED
@@ -1,8 +1,8 @@
1
- This email requires a modern e-mail reader. You can view the email online here:
2
 
3
  {email_url}.
4
 
5
- Thank you, <?php echo get_option('blogname'); ?>
6
 
7
  To change your subscription follow:
8
  {profile_url}.
1
+ This email requires a modern e-mail reader but you can view the email online here:
2
 
3
  {email_url}.
4
 
5
+ Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
6
 
7
  To change your subscription follow:
8
  {profile_url}.
emails/themes/vimeo-like/theme.php CHANGED
@@ -4,16 +4,16 @@ global $post; // Current post managed by WordPress
4
 
5
  /*
6
  * Some variabled are prepared by Newsletter Plus and are available inside the theme,
7
- * for example the theme options used to build the email body as configured by blog
8
  * owner.
9
- *
10
  * $theme_options - is an associative array with theme options: every option starts
11
  * with "theme_" as required. See the theme-options.php file for details.
12
  * Inside that array there are the autmated email options as well, if needed.
13
  * A special value can be present in theme_options and is the "last_run" which indicates
14
  * when th automated email has been composed last time. Is should be used to find if
15
  * there are now posts or not.
16
- *
17
  * $is_test - if true it means we are composing an email for test purpose.
18
  */
19
 
@@ -23,8 +23,9 @@ $filters = array();
23
 
24
  // Maximum number of post to retrieve
25
  $filters['showposts'] = (int) $theme_options['theme_max_posts'];
26
- if ($filters['showposts'] == 0)
27
  $filters['showposts'] = 10;
 
28
 
29
 
30
  // Include only posts from specified categories. Do not filter per category is no
@@ -33,6 +34,10 @@ if (is_array($theme_options['theme_categories'])) {
33
  $filters['cat'] = implode(',', $theme_options['theme_categories']);
34
  }
35
 
 
 
 
 
36
  // Retrieve the posts asking them to WordPress
37
  $posts = get_posts($filters);
38
 
@@ -132,15 +137,15 @@ $font_size = $theme_options['theme_font_size'];
132
  </table>
133
  </td>
134
  </tr>
135
-
136
- <?php if (!isset($theme_options['theme_social_disable'])) { ?>
137
  <tr>
138
  <td style="font:normal 11px helvetica,sans-serif;">
139
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
140
  </td>
141
  </tr>
142
  <?php } ?>
143
- </table>
144
 
145
  </body>
146
  </html>
4
 
5
  /*
6
  * Some variabled are prepared by Newsletter Plus and are available inside the theme,
7
+ * for example the theme options used to build the email body as configured by blog
8
  * owner.
9
+ *
10
  * $theme_options - is an associative array with theme options: every option starts
11
  * with "theme_" as required. See the theme-options.php file for details.
12
  * Inside that array there are the autmated email options as well, if needed.
13
  * A special value can be present in theme_options and is the "last_run" which indicates
14
  * when th automated email has been composed last time. Is should be used to find if
15
  * there are now posts or not.
16
+ *
17
  * $is_test - if true it means we are composing an email for test purpose.
18
  */
19
 
23
 
24
  // Maximum number of post to retrieve
25
  $filters['showposts'] = (int) $theme_options['theme_max_posts'];
26
+ if ($filters['showposts'] == 0) {
27
  $filters['showposts'] = 10;
28
+ }
29
 
30
 
31
  // Include only posts from specified categories. Do not filter per category is no
34
  $filters['cat'] = implode(',', $theme_options['theme_categories']);
35
  }
36
 
37
+ if (!empty($theme_options['theme_post_types'])) {
38
+ $filters['post_type'] = $theme_options['theme_post_types'];
39
+ }
40
+
41
  // Retrieve the posts asking them to WordPress
42
  $posts = get_posts($filters);
43
 
137
  </table>
138
  </td>
139
  </tr>
140
+
141
+ <?php if (!isset($theme_options['theme_social_disable'])) { ?>
142
  <tr>
143
  <td style="font:normal 11px helvetica,sans-serif;">
144
  <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
145
  </td>
146
  </tr>
147
  <?php } ?>
148
+ </table>
149
 
150
  </body>
151
  </html>
emails/themes/xmas-2014/images/footer.png ADDED
Binary file
emails/themes/xmas-2014/images/header.png ADDED
Binary file
emails/themes/xmas-2014/screenshot.png ADDED
Binary file
emails/themes/xmas-2014/theme.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <title></title>
6
+
7
+ <style type="text/css">
8
+ .ExternalClass {width:100%;}
9
+
10
+ .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
11
+ line-height: 100%;
12
+ }
13
+
14
+ body {-webkit-text-size-adjust:none; -ms-text-size-adjust:none;}
15
+
16
+ body {margin:0; padding:0;}
17
+
18
+ table td {border-collapse:collapse;}
19
+
20
+ p {margin:0; padding:0; margin-bottom:1em;}
21
+
22
+ h1, h2, h3, h4, h5, h6 {
23
+ color: #666;
24
+ line-height: 100%;
25
+ }
26
+
27
+ a, a:link {
28
+ color:#2A5DB0;
29
+ text-decoration: underline;
30
+ }
31
+
32
+ body, #body_style {
33
+ background:#A52B00;
34
+ min-height:1000px;
35
+ xcolor:#000;
36
+ font-family:Arial, Helvetica, sans-serif;
37
+ font-size:14px;
38
+ }
39
+
40
+ span.yshortcuts { color:#000; background-color:none; border:none;}
41
+ span.yshortcuts:hover,
42
+ span.yshortcuts:active,
43
+ span.yshortcuts:focus {color:#000; background-color:none; border:none;}
44
+
45
+ a:visited { color: #3c96e2; text-decoration: none}
46
+ a:focus { color: #3c96e2; text-decoration: underline}
47
+ a:hover { color: #3c96e2; text-decoration: underline}
48
+
49
+ @media only screen and (max-device-width: 480px) {
50
+
51
+
52
+ body[yahoo] #container1 {display:block !important}
53
+ body[yahoo] p {font-size: 10px}
54
+
55
+ }
56
+
57
+ @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
58
+
59
+
60
+ body[yahoo] #container1 {display:block !important}
61
+ body[yahoo] p {font-size: 14px}
62
+
63
+ }
64
+
65
+ </style>
66
+
67
+
68
+ </head>
69
+ <body style="margin-top: 0; background:#A52B00; min-height:1000px; color:#000;font-family:Arial, Helvetica, sans-serif; font-size:14px"
70
+ alink="#FF0000" link="#FF0000" bgcolor="#A52B00" text="#000000" yahoo="fix">
71
+
72
+ <div id="body_style" style="padding:0px">
73
+
74
+ <table cellpadding="0" cellspacing="0" border="0" bgcolor="#ffffff" width="600" align="center">
75
+ <tr>
76
+ <td width="600" colspan="3"><img src="<?php echo $theme_url; ?>/images/header.png"></td>
77
+ </tr>
78
+ <tr>
79
+ <td width="600" align="center" colspan="3">
80
+ <h1><?php echo get_option('blogname'); ?></h1>
81
+ </td>
82
+ </tr>
83
+ <tr>
84
+ <td width="20">&nbsp;</td>
85
+ <td width="560">
86
+ <p>Hi {name},</p>
87
+
88
+ <p>The Newsletter Team wishes you merry Christmas and happy New Year. This time of year is special for us and we would like
89
+ to share this time with you, also.</p>
90
+
91
+ <p>We'll take a rest for few days with our families but we have a <strong>big surprise</strong> for YOU that will
92
+ be unvealed the first days of the New Year.</p>
93
+
94
+ <p>Curious? You can <a href="<?php echo get_option('blogname'); ?>">discover a little more right now</a>.</p>
95
+
96
+ <p>
97
+ See you soon, TNT.<br>
98
+ <a href="<?php echo get_option('blogname'); ?>">http://www.thenewsletterplugin.com</a>
99
+ </p>
100
+
101
+ </td>
102
+ <td width="20">&nbsp;</td>
103
+ </tr>
104
+ <td width="600" colspan="3">
105
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
106
+ </td>
107
+ <tr>
108
+ <td width="20">&nbsp;</td>
109
+ <td width="560" style="color:#666">
110
+ <p>To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.
111
+ </td>
112
+ <td width="20">&nbsp;</td>
113
+ </tr>
114
+ <tr>
115
+ <td width="600" colspan="3" bgcolor="#A52B00"><img src="<?php echo $theme_url; ?>/images/footer.png"></td>
116
+ </tr>
117
+ </table>
118
+
119
+ </div>
120
+
121
+ </body>
122
+ </html>
feed/feed.php CHANGED
@@ -15,93 +15,12 @@ class NewsletterFeed extends NewsletterModule {
15
  }
16
 
17
  function __construct() {
18
- $this->themes = new NewsletterThemes('feed');
19
  parent::__construct('feed', '1.0.0');
20
- add_filter('newsletter_user_subscribe', array($this, 'hook_user_subscribe'));
21
- add_filter('newsletter_subscription_extra', array($this, 'hook_subscription_extra'));
22
- }
23
-
24
- function create_email($options) {
25
- global $wpdb, $newsletter;
26
-
27
- $posts = $this->get_posts();
28
-
29
- $email = array();
30
-
31
- $last_run = 0;
32
- $theme_options = $this->themes->get_options($options['theme']);
33
- $theme_url = $this->themes->get_theme_url($options['theme']);
34
- $theme_subject = '';
35
-
36
- ob_start();
37
- require $this->themes->get_file_path($options['theme'], 'theme.php');
38
- $email['message'] = ob_get_clean();
39
-
40
- if (!empty($theme_subject)) {
41
- $email['subject'] = $theme_subject;
42
- } else {
43
- $email['subject'] = trim($options['subject']);
44
- }
45
- if (empty($email['subject'])) {
46
- $email['subject'] = $posts[0]->post_title;
47
- }
48
-
49
- return $email;
50
- }
51
-
52
- function hook_user_subscribe($user) {
53
- if ($this->options['subscription'] == 1 && isset($_REQUEST['feed']))
54
- $user['feed'] = 1;
55
- if ($this->options['subscription'] == 2)
56
- $user['feed'] = 1;
57
- return $user;
58
- }
59
-
60
- function hook_subscription_extra($extra) {
61
-
62
- if ($this->options['subscription'] == 1) {
63
- $field = array();
64
- $field['label'] = '';
65
- $field['field'] = '<input type="checkbox" name="feed" value="1"/>&nbsp;' . $this->options['name'];
66
- $extra[] = $field;
67
- }
68
- return $extra;
69
  }
70
 
71
  function admin_menu() {
72
- $this->add_menu_page('index', 'Feed by Mail (Demo)');
73
  }
74
-
75
- function get_posts($options = null) {
76
- if ($options == null)
77
- $options = $this->options;
78
-
79
- $excluded_categories = '';
80
- $categories = get_categories();
81
- foreach ($categories as $c) {
82
- if ($options['category_' . $c->cat_ID] == 1) {
83
- $excluded_categories .= '-' . $c->cat_ID . ',';
84
- }
85
- }
86
-
87
- $max_posts = $options['max_posts'];
88
- if (!is_numeric($max_posts))
89
- $max_posts = 10;
90
-
91
- $filters = array('showposts' => $max_posts, 'post_status' => 'publish');
92
- if ($excluded_categories != '')
93
- $filters['cat'] = $excluded_categories;
94
-
95
- $posts = get_posts($filters);
96
-
97
- $newsletter->feed_posts = $posts;
98
- $newsletter->feed_max_posts = $max_posts;
99
- $newsletter->feed_excluded_categories = $excluded_categories;
100
- $newsletter->feed_options = $this->options;
101
-
102
- return $posts;
103
- }
104
-
105
  }
106
 
107
  NewsletterFeed::instance();
15
  }
16
 
17
  function __construct() {
 
18
  parent::__construct('feed', '1.0.0');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
20
 
21
  function admin_menu() {
22
+ $this->add_menu_page('index', 'Feed by Mail');
23
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
 
26
  NewsletterFeed::instance();
feed/index.php CHANGED
@@ -1,340 +1,15 @@
1
- <?php
2
- require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
- $module = NewsletterFeed::instance();
4
- $controls = new NewsletterControls();
5
-
6
- if (!$controls->is_action()) {
7
- $controls->data = $module->options;
8
- }
9
- else {
10
-
11
- if ($controls->is_action('reset')) {
12
- $controls->data = $module->reset_options();
13
- $controls->messages = 'Options restored.';
14
- }
15
-
16
- if ($controls->is_action('save')) {
17
- $controls->data['add_new'] = $controls->data['subscription'] == 2?1:0;
18
- if (!is_numeric($controls->data['max_posts'])) $controls->data['max_posts'] = 10;
19
- $module->save_options($controls->data);
20
- }
21
-
22
- if ($controls->is_action('add_all')) {
23
- $result = $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set feed=1 where feed=0");
24
- $controls->messages = $result . ' subscribers has been activated.';
25
- }
26
-
27
- if ($controls->is_action('remove_all')) {
28
- $result = $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set feed=0 where feed=1");
29
- $controls->messages = $result . ' subscribers has been deactivated.';
30
- }
31
-
32
- if ($controls->is_action('test')) {
33
- $users = NewsletterUsers::instance()->get_test_users();
34
- if (empty($users)) {
35
- $controls->errors = 'There are no test subscribers. Read more about test subscribers <a href="http://www.satollo.net/plugins/newsletter/subscribers-module#test" target="_blank">here</a>.';
36
- }
37
- else {
38
- $email = $module->create_email($controls->data);
39
-
40
- Newsletter::instance()->send($email, $users);
41
-
42
- $controls->messages = 'Test email sent to: ';
43
- foreach ($users as &$user) $controls->messages .= $user->email . ' ';
44
- }
45
-
46
- }
47
-
48
- if ($controls->is_action('delete')) {
49
- $wpdb->query($wpdb->prepare("delete from " . NEWSLETTER_EMAILS_TABLE . " where id=%d", $_POST['btn']));
50
- }
51
-
52
- if ($controls->is_action('reset_time')) {
53
- $module->save_last_run(0);
54
- $controls->messages = 'Reset. On next run all posts are considered as new';
55
- }
56
-
57
- if ($controls->is_action('back_time')) {
58
- $module->add_to_last_run(-3600*24);
59
- $controls->messages = 'Set.';
60
- }
61
-
62
- if ($controls->is_action('forward_time')) {
63
- $module->add_to_last_run(3600*24);
64
- $controls->messages = 'Set.';
65
- }
66
-
67
- if ($controls->is_action('now_time')) {
68
- $module->save_last_run(time());
69
- $controls->messages = 'Set.';
70
- }
71
- }
72
-
73
- ?>
74
-
75
  <div class="wrap">
76
 
77
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
78
 
79
- <h5>Feed by Mail (Demo)</h5>
80
-
81
- <h2>Main configuration</h2>
82
-
83
- <?php $controls->show(); ?>
84
 
85
- <div class="preamble">
86
- <p>
87
- <strong>This is a demo version of the real <a href="http://www.satollo.net/plugins/newsletter/feed-by-mail-module" target="_blank">Feed by Mail</a> module.</strong>
88
- </p>
89
- <p>
90
- Anyway, options saved on this panel will be preserved if you install the real module and you can already offer to
91
- subscribers the option to opt-in this service.
92
- </p>
93
- <p>
94
- If you don't want to see this panel on menu, disable it on Welcome panel.
95
- </p>
96
  </div>
97
 
98
- <form method="post" action="">
99
- <?php $controls->init(); ?>
100
-
101
- <div id="tabs">
102
-
103
- <ul>
104
- <li><a href="#tabs-1">Configuration</a></li>
105
- <li><a href="#tabs-2">Theme options</a></li>
106
- <li><a href="#tabs-3">Preview</a></li>
107
- <li><a href="#tabs-4">New posts</a></li>
108
- <li><a href="#tabs-5">Emails</a></li>
109
- <li><a href="#tabs-6">Actions and statistics</a></li>
110
- </ul>
111
-
112
- <div id="tabs-1">
113
-
114
- <table class="form-table">
115
- <tr valign="top">
116
- <th>Enabled?</th>
117
- <td>
118
- <?php $controls->yesno('enabled'); ?>
119
- <div class="hints">
120
- When disabled, no emails will be sent but subscription to this service will continue to work.
121
- </div>
122
- </td>
123
- </tr>
124
- <tr valign="top">
125
- <th>Service name</th>
126
- <td>
127
- <?php $controls->text('name', 50); ?>
128
- <div class="hints">
129
- This name is shown on subscription and profile forms so user can subscribe or unsubscribe from it.
130
- </div>
131
- </td>
132
- </tr>
133
-
134
- <tr>
135
- <th>On subscription...</th>
136
- <td>
137
- <?php $controls->select('subscription', array(0=>'Do nothing', 1=>'Show this service option', 2=>'Add it to every new subscriber')); ?>
138
- <div class="hints">
139
- This setting is valid even if the service is disabled, so users that subscribe will be added to the feed by mail service
140
- but no feed by mail email will be sent.
141
- </div>
142
- </td>
143
- </tr>
144
-
145
- <tr valign="top">
146
- <th>Days</th>
147
- <td>
148
- Monday&nbsp;<?php $controls->yesno('day_1'); ?>
149
- Tuesday&nbsp;<?php $controls->yesno('day_2'); ?>
150
- Wednesday&nbsp;<?php $controls->yesno('day_3'); ?>
151
- Thursday&nbsp;<?php $controls->yesno('day_4'); ?>
152
- Friday&nbsp;<?php $controls->yesno('day_5'); ?>
153
- Saturday&nbsp;<?php $controls->yesno('day_6'); ?>
154
- Sunday&nbsp;<?php $controls->yesno('day_7'); ?>
155
- </td>
156
- </tr>
157
-
158
- <tr valign="top">
159
- <th>Delivery hour</th>
160
- <td>
161
- <?php $controls->hours('hour'); ?>
162
- </td>
163
- </tr>
164
-
165
- <tr valign="top">
166
- <th>Max posts to extract</th>
167
- <td>
168
- <?php $controls->text('max_posts', 5); ?>
169
- </td>
170
- </tr>
171
-
172
- <tr valign="top">
173
- <th>Categories to EXCLUDE</th>
174
- <td>
175
- <?php $controls->categories(); ?>
176
- </td>
177
- </tr>
178
-
179
- <tr valign="top">
180
- <th>Track link clicks?</th>
181
- <td>
182
- <?php $controls->yesno('track'); ?>
183
- </td>
184
- </tr>
185
-
186
- <tr valign="top">
187
- <th>Subject</th>
188
- <td>
189
- <?php $controls->text('subject', 50); ?>
190
- <div class="hints">
191
- The subject of emails sent. If you leave it empty, the last post title is used. You can use the Newsletter tags.
192
- </div>
193
- </td>
194
- </tr>
195
- </table>
196
- </div>
197
-
198
-
199
- <div id="tabs-2">
200
- <table class="form-table">
201
- <tr valign="top">
202
- <th>Theme</th>
203
- <td>
204
- <?php $controls->select('theme', $module->themes->get_all()); ?>
205
- (save to load the new theme options and update the preview)
206
- <?php //$controls->button('theme_change', 'Change'); ?>
207
-
208
- <div class="hints">
209
- Send a test to see the theme layout. Custom themes are stored on wp-content/plugins/newsletter-custom/themes-feed.
210
- </div>
211
- </td>
212
- </tr>
213
- </table>
214
-
215
- <?php
216
- $file = $module->themes->get_file_path($controls->data['theme'], 'theme-options.php');
217
- if (is_file($file)) {
218
- require $file;
219
- }
220
- ?>
221
- </div>
222
-
223
-
224
- <div id="tabs-3">
225
- <div class="tab-preamble">
226
- <p>
227
- This is only a preview to see how the theme will generate emails, it's not the actual email that will be sent
228
- next time.
229
- </p>
230
- </div>
231
- <iframe src="<?php echo plugins_url('newsletter'); ?>/feed/preview.php?<?php echo time(); ?>" width="100%" height="700"></iframe>
232
- </div>
233
-
234
-
235
- <div id="tabs-4">
236
- <div class="tab-preamble">
237
- <p>
238
- Posts below are the one will be included on next email (scheduled future posts are not counted so
239
- more posts could be included).
240
- </p>
241
- </div>
242
- <table class="form-table">
243
- <tr valign="top">
244
- <th>Last run</th>
245
- <td>
246
- <?php echo $module->date($module->get_last_run()); ?>
247
- <?php $controls->button_confirm('reset_time', 'Reset as it never ran', 'Are you sure?'); ?>
248
- <?php $controls->button('back_time', 'Back one day'); ?>
249
- <?php $controls->button('forward_time', 'Forward one day'); ?>
250
- <?php $controls->button('now_time', 'Set to now'); ?>
251
- <div class="hints">
252
- Moving the last run, you can include or exclude posts on next message. See the list below.
253
- </div>
254
- </td>
255
- </tr>
256
- <tr valign="top">
257
- <th>New posts from last run</th>
258
- <td>
259
- <?php
260
- global $post;
261
- $posts = $module->get_posts();
262
- list($new_posts, $old_posts) = $module->split_posts($posts, $module->get_last_run());
263
- foreach ($new_posts as $post) {
264
- setup_postdata($post);
265
- ?>
266
- [<?php echo the_ID(); ?>] <?php echo $module->date($module->m2t($post->post_date_gmt)); ?> <a target="_blank" href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a><br />
267
- <?php } ?>
268
- </td>
269
- </tr>
270
- </table>
271
- </div>
272
-
273
-
274
- <div id="tabs-5">
275
-
276
- <div class="tab-preamble">
277
- <p>
278
- <strong>No emails will be generated by this demo module.</strong>
279
- </p>
280
- </div>
281
-
282
- <table class="widefat">
283
- <thead>
284
- <tr>
285
- <th>Id</th>
286
- <th>Subject</th>
287
- <th>Date</th>
288
- <th>Status</th>
289
- <th>&nbsp;</th>
290
- </tr>
291
- </thead>
292
-
293
- <tbody>
294
- <tr>
295
- <td>66</td>
296
- <td>This week updates!</td>
297
- <td>2013-02-23</td>
298
- <td>
299
- sent (2356/2356)
300
- </td>
301
- <td><a class="button" href="#">Statistics</a></td>
302
- </tr>
303
- </tbody>
304
- </table>
305
-
306
- </div>
307
-
308
-
309
- <div id="tabs-6">
310
- <?php
311
- $total_feed = $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where feed=1 and status='C'");
312
- $total = $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='C'");
313
- ?>
314
- <div class="tab-preamble">
315
- <p>
316
- Here you can run some massive actions on subscribers. These button works really!
317
- </p>
318
- </div>
319
- <?php $controls->button_confirm('add_all', 'Add this service to all subscribers', 'Proceed?'); ?>
320
- <?php $controls->button_confirm('remove_all', 'Remove this service from all subscribers', 'Proceed?'); ?>
321
-
322
- <h3>Statistics</h3>
323
- <p>
324
- Active subscribers: <?php echo $total_feed; ?> of <?php echo $total; ?>
325
- </p>
326
- </div>
327
-
328
- </div>
329
-
330
- <div class="newsletter-buttons newsletter-buttons-bottom">
331
- <?php $controls->button('save', 'Save'); ?>
332
- <?php $controls->button('reset', 'Reset'); ?>
333
- <?php $controls->button('test', 'Test'); ?>
334
- </div>
335
-
336
-
337
- </form>
338
-
339
-
340
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <div class="wrap">
2
 
3
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
4
 
5
+ <h5>Feed by Mail</h5>
 
 
 
 
6
 
7
+ <div class="updated">
8
+ <p>
9
+ The Feed by Mail demo has been removed to make the plugin <strong>faster</strong>. You can install the demo separately getting it
10
+ from <a href="http://www.thenewsletterplugin.com/downloads/demos" target="_blank">here</a> or directly the full version from
11
+ <a href="http://www.thenewsletterplugin.com/downloads" target="_blank">here</a>.
12
+ </p>
 
 
 
 
 
13
  </div>
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  </div>
feed/languages/en_US.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- $options = array(
4
- 'theme'=>'default',
5
- 'subscription'=>0
6
- );
 
 
 
 
 
 
feed/preview.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- header('Content-Type: text/html;charset=UTF-8');
3
- include '../../../../wp-load.php';
4
-
5
- $user_info = get_userdata(get_current_user_id());
6
- if ($user_info->user_level < 7) die('Only the administrator can view the preview');
7
-
8
- $module = NewsletterFeed::instance();
9
- $email = $module->create_email($module->options, 0);
10
-
11
- echo $email['message'];
 
 
 
 
 
 
 
 
 
 
 
feed/themes/default/theme-options.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- /*
3
- * This is a pre packaged theme options page. Every option name
4
- * must start with "theme_" so Newsletter can distinguish them from other
5
- * options that are specific to the object using the theme.
6
- *
7
- * An array of theme default options should always be present and that default options
8
- * should be merged with the current complete set of options as shown below.
9
- *
10
- * Every theme can define its own set of options, the will be used in the theme.php
11
- * file while composing the email body. Newsletter knows nothing about theme options
12
- * (other than saving them) and does not use or relies on any of them.
13
- *
14
- * For multilanguage purpose you can actually check the constants "WP_LANG", until
15
- * a decent system will be implemented.
16
- */
17
- $theme_defaults = array(
18
- 'theme_title'=>get_option('blogname'),
19
- 'theme_email_url'=>'You\'re receiving this email because you subscribed it at ' . get_option('blogname') .
20
- ' as {email}. To read this email online <a href="{email_url}">click here</a>. To modify your subscription <a href="{profile_url}">click here</a>.',
21
- 'theme_profile_url'=>'To modify your subscription, <a href="{profile_url}">click here</a>.',
22
- 'theme_color' =>'#0088cc',
23
- 'theme_max_posts' => '10',
24
- 'theme_full_post' => '0',
25
- );
26
-
27
- // Mandatory!
28
- $controls->merge_defaults($theme_defaults);
29
- ?>
30
- <table class="form-table">
31
- <tr valign="top">
32
- <th>Title</th>
33
- <td>
34
- <?php $controls->text('theme_title', 70); ?>
35
- </td>
36
- </tr>
37
- <tr valign="top">
38
- <th>Header message (small font)</th>
39
- <td>
40
- <?php $controls->textarea('theme_email_url'); ?>
41
- </td>
42
- </tr>
43
- <tr valign="top">
44
- <th>Preamble (before the post list)</th>
45
- <td>
46
- <?php $controls->wp_editor('theme_preamble'); ?>
47
- </td>
48
- </tr>
49
- <tr valign="top">
50
- <th>Footer message (small font)</th>
51
- <td>
52
- <?php $controls->textarea('theme_profile_url'); ?>
53
- </td>
54
- </tr>
55
- <tr>
56
- <th>Base color</th>
57
- <td><?php $controls->color('theme_color'); ?></td>
58
- </tr>
59
- <tr>
60
- <th>How to show posts</th>
61
- <td><?php $controls->select('theme_full_post', array(0=>'Excerpt', 1=>'Full content')); ?></td>
62
- </tr>
63
- <tr>
64
- <th>Show thumbnails</th>
65
- <td><?php $controls->checkbox('theme_thumbnails'); ?></td>
66
- </tr>
67
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
feed/themes/default/theme.php DELETED
@@ -1,104 +0,0 @@
1
- <?php
2
-
3
- // Mandatory
4
- global $post;
5
-
6
- /*
7
- * Some variables are already defined:
8
- *
9
- * - $posts Contains all the posts (new and old) with the maximum specified on Feed by Mail configuration.
10
- * - $last_run Is the last time an email was sent and the time value to use to split the posts
11
- * - $theme_options An array with all theme options
12
- * - $theme_url Is the absolute URL to the theme folder used to reference images
13
- * - $theme_subject Will be the email subject if set by this theme
14
- *
15
- * Pay attention that on this new version there is no more the user available: the theme is used once to compose the
16
- * email and then sent to the delivery engine.
17
- *
18
- * Refer to http://codex.wordpress.org/Function_Reference/setup_postdata for the post cicle. It MUST be written as
19
- *
20
- * foreach($new_posts as $post) { setup_postdata($post)
21
- *
22
- */
23
-
24
- // Get new an old posts
25
- list($new_posts, $old_posts) = NewsletterModule::split_posts($posts, $last_run);
26
- $color = $theme_options['theme_color'];
27
- ?><!DOCTYPE html>
28
- <html>
29
- <head>
30
- <style type="text/css" media="all">
31
- a {
32
- text-decoration: none;
33
- color: <?php echo $color; ?>;
34
- }
35
- </style>
36
- </head>
37
- <body style="background-color: #ddd; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666; margin: 0 auto; padding: 0;">
38
- <br>
39
- <table align="center">
40
- <tr>
41
- <td style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666;">
42
- <div style="text-align: left; max-width: 500px; border-top: 10px solid <?php echo $color; ?>; border-bottom: 3px solid <?php echo $color; ?>;">
43
- <p>This is a demo</p>
44
- <div style="padding: 10px 20px; color: #000; font-size: 20px; background-color: #EFEFEF; border-bottom: 1px solid #ddd">
45
- <?php echo $theme_options['theme_title']; ?>
46
- </div>
47
- <div style="padding: 20px; background-color: #fff; line-height: 18px">
48
-
49
- <p><small><?php echo $options['theme_email_url']; ?></small></p>
50
-
51
- <?php echo $options['theme_preamble']; ?>
52
-
53
- <table>
54
- <?php foreach($new_posts as $post) { setup_postdata($post); ?>
55
-
56
- <tr>
57
- <td colspan="2">
58
- <br>
59
- <a style="text-decoration: none; font-size: 18px" href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a><br>
60
- </td>
61
- </tr>
62
- <?php if ($theme_options['theme_full_post'] == 1) { ?>
63
- <tr>
64
- <td colspan="2">
65
- <?php the_content(); ?>
66
- </td>
67
- </tr>
68
- <?php } else { ?>
69
- <tr>
70
- <td valign="top" style="padding-right: 10px;">
71
- <?php if (isset($theme_options['theme_thumbnails'])) { ?>
72
- <a href="<?php echo get_permalink(); ?>"><img src="<?php echo NewsletterModule::get_post_image($post->ID, 'thumbnail', WP_CONTENT_URL . '/newsletter/feed/images/blank.png'); ?>" withd="100" height="100"></a>
73
- <?php } ?>
74
- </td>
75
- <td valign="top">
76
- <small><?php echo preg_replace('/<\\/*p>/i', '', get_the_excerpt()); ?></small>
77
- </td>
78
- </tr>
79
- <?php } ?>
80
-
81
- <?php } ?>
82
-
83
- </table>
84
-
85
- <?php if (!empty($old_posts)) { ?>
86
- <table>
87
- <?php foreach($old_posts as $post) { setup_postdata($post); ?>
88
- <tr>
89
- <td valign="top">
90
- <a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a>
91
- </td>
92
- </tr>
93
- <?php } ?>
94
- </table>
95
- <?php } ?>
96
-
97
- <p><small><?php echo $theme_options['theme_profile_url']; ?></small></p>
98
- </div>
99
- </div>
100
- </td>
101
- </tr>
102
- </table>
103
- </body>
104
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
header-extension.php CHANGED
@@ -9,16 +9,17 @@
9
  <?php if (NEWSLETTER_HEADER) { ?>
10
  <div id="newsletter-header-ext">
11
  <div style="text-align: center; margin-top: 5px;">
12
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-documentation" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/documentation.png"> Documentation</a>
13
- <a href="http://www.satollo.net/forums" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/forum.png"> Forum</a>
14
- <a href="https://www.facebook.com/satollo.net" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/facebook.png"> Facebook</a>
 
15
 
16
- <!--<a href="http://www.satollo.net/plugins/newsletter/newsletter-collaboration" target="_blank">Collaboration</a>-->
17
  </div>
18
 
19
  <div style="text-align: center; margin-top: 5px;">
20
- <form style="margin: 0;" action="http://www.satollo.net/wp-content/plugins/newsletter/do/subscribe.php" method="post" target="_blank">
21
- My Newsletter<!-- to satollo.net--> <input type="email" name="ne" required placeholder="Your email" style="padding: 2px">
22
  <input type="submit" value="Go" style="padding: 2px">
23
  </form>
24
  </div>
9
  <?php if (NEWSLETTER_HEADER) { ?>
10
  <div id="newsletter-header-ext">
11
  <div style="text-align: center; margin-top: 5px;">
12
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-documentation" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/documentation.png"> Documentation</a>
13
+ <a href="http://www.thenewsletterplugin.com/forums" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/forum.png"> Forum</a>
14
+ <a href="https://www.facebook.com/thenewsletterplugin
15
+ " target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/facebook.png"> Facebook</a>
16
 
17
+ <!--<a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-collaboration" target="_blank">Collaboration</a>-->
18
  </div>
19
 
20
  <div style="text-align: center; margin-top: 5px;">
21
+ <form style="margin: 0;" action="http://www.thenewsletterplugin.com/wp-content/plugins/newsletter/do/subscribe.php" method="post" target="_blank">
22
+ My Newsletter<!-- to thenewsletterplugin.com--> <input type="email" name="ne" required placeholder="Your email" style="padding: 2px">
23
  <input type="submit" value="Go" style="padding: 2px">
24
  </form>
25
  </div>
header-new.php CHANGED
@@ -1,74 +1,76 @@
1
  <?php
2
  $dismissed = get_option('newsletter_dismissed', array());
3
 
4
- if (isset($_REQUEST['dismiss']) && check_admin_referer()) {
5
  $dismissed[$_REQUEST['dismiss']] = 1;
6
  update_option('newsletter_dismissed', $dismissed);
7
  }
8
 
9
- ?>
10
-
11
- <?php if (isset($dismissed['rate']) && $dismissed['rate'] != 1) { ?>
12
- <div class="newsletter-notice">
13
- I never asked before and I'm curious: <a href="http://wordpress.org/extend/plugins/newsletter/" target="_blank">would you rate this plugin</a>?
14
- (few seconds required). (account on WordPress.org required, every blog owner should have one...). <strong>Really appreciated, Stefano</strong>.
15
- <div class="newsletter-dismiss"><a href="<?php echo wp_nonce_url($_SERVER['REQUEST_URI'] . '&dismiss=rate')?>">Dismiss</a></div>
16
- <div style="clear: both"></div>
17
- </div>
18
- <?php } ?>
19
-
20
- <?php if (isset($dismissed['newsletter-page']) && $dismissed['newsletter-page'] != 1 && empty(NewsletterSubscription::instance()->options['url'])) { ?>
21
- <div class="newsletter-notice">
22
- Create a page with your blog style to show the subscription form and the subscription messages. Go to the
23
- <a href="?page=newsletter_subscription_options">subscription panel</a> to
24
- configure it.
25
- <div class="newsletter-dismiss"><a href="<?php echo wp_nonce_url($_SERVER['REQUEST_URI'] . '&dismiss=newsletter-page')?>">Dismiss</a></div>
26
- <div style="clear: both"></div>
27
- </div>
28
- <?php } ?>
29
-
30
-
31
- <?php $newsletter->warnings(); ?>
32
 
 
33
 
34
  <?php if (NEWSLETTER_HEADER) { ?>
35
- <div id="newsletter-header-new">
36
- <div style="text-align: center">
37
- <a href="http://www.satollo.net/plugins/newsletter" target="_blank" style="font-weight: bold; font-size: 13px; text-transform: uppercase">Get the Professional Extensions!</a>
38
- </div>
39
-
40
- <div style="text-align: center; margin-top: 5px;">
41
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-documentation" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/documentation.png"> Documentation</a>
42
- <a href="http://www.satollo.net/forums" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/forum.png"> Forum</a>
43
- <a href="https://www.facebook.com/satollo.net" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/header/facebook.png"> Facebook</a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
- <!--<a href="http://www.satollo.net/plugins/newsletter/newsletter-collaboration" target="_blank">Collaboration</a>-->
46
  </div>
 
47
 
48
- <div style="text-align: center; margin-top: 5px;">
49
- <form style="margin: 0;" action="http://www.satollo.net/wp-content/plugins/newsletter/do/subscribe.php" method="post" target="_blank">
50
- My Newsletter<!-- to satollo.net--> <input type="email" name="ne" required placeholder="Your email" style="padding: 2px">
51
- <input type="submit" value="Go" style="padding: 2px">
52
- </form>
 
 
53
  </div>
 
54
 
55
- <div style="text-align: center; margin-top: 5px;">
56
- <table style="margin: 0 auto">
57
- <tr>
58
- <td style="padding: 2px; border: 0; margin: 0; vertical-align: middle">
59
- <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5Y6JXSA7BSU2L" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/donate.png"></a>
60
- </td>
61
- <td style="padding: 2px; border: 0; margin: 0; vertical-align: middle">
62
- <a href="http://www.satollo.net/donations" target="_blank">Even <b>2$</b> really help: why?</a> </td>
63
- </tr>
64
- </table>
65
-
66
 
 
 
 
 
 
 
 
 
67
  </div>
68
- <!--
69
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-delivery-engine" target="_blank">Engine next run in <?php echo wp_next_scheduled('newsletter') - time(); ?> s</a>
70
- -->
71
- </div>
72
  <?php } ?>
73
 
74
 
 
1
  <?php
2
  $dismissed = get_option('newsletter_dismissed', array());
3
 
4
+ if (isset($_REQUEST['dismiss'])) {
5
  $dismissed[$_REQUEST['dismiss']] = 1;
6
  update_option('newsletter_dismissed', $dismissed);
7
  }
8
 
9
+ $user_count = $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='C'");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
+ ?>
12
 
13
  <?php if (NEWSLETTER_HEADER) { ?>
14
+ <div id="newsletter-header-new">
15
+ <!--
16
+ <a href="http://www.thenewsletterplugin.com" target="_blank"><img src="<?php echo plugins_url('newsletter'); ?>/images/header/logo.png" style="height: 30px; margin-bottom: 10px; display: block;"></a>
17
+
18
+ <div style="border-top: 1px solid white; width: 100%; margin-bottom: 10px;"></div>
19
+ -->
20
+ <?php if (NEWSLETTER_DEBUG) { ?>
21
+ <img src="<?php echo plugins_url('newsletter'); ?>/images/header/debug.png" style="vertical-align: middle;" title="Debug mode active!">&nbsp;&nbsp;&nbsp;
22
+ <?php } ?>
23
+ <img src="<?php echo plugins_url('newsletter'); ?>/images/header/logo.png" style="vertical-align: middle;">
24
+
25
+ <a href="http://www.thenewsletterplugin.com/?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-extensions&utm_content=<?php echo NEWSLETTER_VERSION?>" target="_blank" style="font-weight: bold; font-size: 13px; text-transform: uppercase">
26
+ Get the Professional Extensions!
27
+ </a>
28
+ &nbsp;&nbsp;&nbsp;
29
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-documentation" target="_blank">
30
+ <i class="fa fa-file-text"></i> Documentation
31
+ </a>
32
+ &nbsp;&nbsp;
33
+ <a href="http://www.thenewsletterplugin.com/forums" target="_blank">
34
+ <i class="fa fa-life-ring"></i> Forum
35
+ </a>
36
+ &nbsp;&nbsp;
37
+ <a href="https://www.facebook.com/thenewsletterplugin
38
+ " target="_blank">
39
+ <i class="fa fa-facebook-square"></i> Facebook
40
+ </a>
41
 
 
42
  </div>
43
+ <?php } ?>
44
 
45
+ <?php if (NEWSLETTER_DEBUG || !isset($dismissed['rate']) && $user_count > 200) { ?>
46
+ <div class="notice">
47
+ <a href="<?php echo $_SERVER['REQUEST_URI'] . '&dismiss=rate' ?>" class="dismiss">&times;</a>
48
+ <p>
49
+ We never asked before and we're curious: <a href="http://wordpress.org/extend/plugins/newsletter/" target="_blank">would you rate this plugin</a>?
50
+ (few seconds required - account on WordPress.org required, every blog owner should have one...). <strong>Really appreciated, The Newsletter Team</strong>.
51
+ </p>
52
  </div>
53
+ <?php } ?>
54
 
55
+ <?php if (NEWSLETTER_DEBUG || !isset($dismissed['tracking-url'])) { ?>
56
+ <div class="notice">
57
+ <a href="<?php echo $_SERVER['REQUEST_URI'] . '&dismiss=tracking-url' ?>" class="dismiss">&times;</a>
58
+ <p>
59
+ There is a new option avoid to hit spam filters available on statistics panel. Check it out.
60
+ </p>
61
+ </div>
62
+ <?php } ?>
 
 
 
63
 
64
+ <?php if (NEWSLETTER_DEBUG || !isset($dismissed['newsletter-page']) && empty(NewsletterSubscription::instance()->options['url'])) { ?>
65
+ <div class="notice">
66
+ <a href="<?php echo $_SERVER['REQUEST_URI'] . '&dismiss=newsletter-page' ?>" class="dismiss">&times;</a>
67
+ <p>
68
+ You should create a blog page to show the subscription form and the subscription messages. Go to the
69
+ <a href="?page=newsletter_subscription_options">subscription panel</a> to
70
+ configure it.
71
+ </p>
72
  </div>
 
 
 
 
73
  <?php } ?>
74
 
75
 
76
+ <?php $newsletter->warnings(); ?>
header.php CHANGED
@@ -9,20 +9,21 @@ if (isset($_REQUEST['dismiss']) && check_admin_referer()) {
9
  ?>
10
  <?php if (NEWSLETTER_HEADER) { ?>
11
  <div id="newsletter-header">
12
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-documentation" target="_blank">Documentation</a>
13
- <a href="http://www.satollo.net/forums" target="_blank">Forum</a>
14
 
15
- <!--<a href="http://www.satollo.net/plugins/newsletter/newsletter-collaboration" target="_blank">Collaboration</a>-->
16
 
17
- <form style="display: inline; margin: 0;" action="http://www.satollo.net/wp-content/plugins/newsletter/do/subscribe.php" method="post" target="_blank">
18
- Subscribe<!-- to satollo.net--> <input type="email" name="ne" required placeholder="Your email">
19
  <input type="submit" value="Go">
20
  </form>
21
 
22
- <a href="https://www.facebook.com/satollo.net" target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/facebook.png"></a>
 
23
 
24
  <!--
25
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-delivery-engine" target="_blank">Engine next run in <?php echo wp_next_scheduled('newsletter') - time(); ?> s</a>
26
  -->
27
  </div>
28
  <?php } ?>
@@ -30,7 +31,7 @@ if (isset($_REQUEST['dismiss']) && check_admin_referer()) {
30
  <?php if (isset($dismissed['rate']) && $dismissed['rate'] != 1) { ?>
31
  <div class="newsletter-notice">
32
  I never asked before and I'm curious: <a href="http://wordpress.org/extend/plugins/newsletter/" target="_blank">would you rate this plugin</a>?
33
- (few seconds required). (account on WordPress.org required, every blog owner should have one...). <strong>Really appreciated, Stefano</strong>.
34
  <div class="newsletter-dismiss"><a href="<?php echo wp_nonce_url($_SERVER['REQUEST_URI'] . '&dismiss=rate')?>">Dismiss</a></div>
35
  <div style="clear: both"></div>
36
  </div>
9
  ?>
10
  <?php if (NEWSLETTER_HEADER) { ?>
11
  <div id="newsletter-header">
12
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-documentation" target="_blank">Documentation</a>
13
+ <a href="http://www.thenewsletterplugin.com/forums" target="_blank">Forum</a>
14
 
15
+ <!--<a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-collaboration" target="_blank">Collaboration</a>-->
16
 
17
+ <form style="display: inline; margin: 0;" action="http://www.thenewsletterplugin.com/wp-content/plugins/newsletter/do/subscribe.php" method="post" target="_blank">
18
+ Subscribe<!-- to thenewsletterplugin.com--> <input type="email" name="ne" required placeholder="Your email">
19
  <input type="submit" value="Go">
20
  </form>
21
 
22
+ <a href="https://www.facebook.com/thenewsletterplugin
23
+ " target="_blank"><img style="vertical-align: bottom" src="<?php echo plugins_url('newsletter'); ?>/images/facebook.png"></a>
24
 
25
  <!--
26
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">Engine next run in <?php echo wp_next_scheduled('newsletter') - time(); ?> s</a>
27
  -->
28
  </div>
29
  <?php } ?>
31
  <?php if (isset($dismissed['rate']) && $dismissed['rate'] != 1) { ?>
32
  <div class="newsletter-notice">
33
  I never asked before and I'm curious: <a href="http://wordpress.org/extend/plugins/newsletter/" target="_blank">would you rate this plugin</a>?
34
+ (few seconds required). (account on WordPress.org required, every blog owner should have one...). <strong>Really appreciated, The Newsletter Team</strong>.
35
  <div class="newsletter-dismiss"><a href="<?php echo wp_nonce_url($_SERVER['REQUEST_URI'] . '&dismiss=rate')?>">Dismiss</a></div>
36
  <div style="clear: both"></div>
37
  </div>
images/animated-overlay.gif ADDED
Binary file
images/arrow.png ADDED
Binary file
images/header/debug.png ADDED
Binary file
images/header/logo.png ADDED
Binary file
images/header/tnp-logo-white-header@2x1.png ADDED
Binary file
images/menu-icon.png ADDED
Binary file
images/nomedia.png ADDED
Binary file
images/ui-bg_flat_0_aaaaaa_40x100.png CHANGED
Binary file
images/ui-bg_flat_75_ffffff_40x100.png CHANGED
Binary file
images/ui-bg_glass_55_fbf9ee_1x400.png CHANGED
Binary file
images/ui-bg_glass_65_ffffff_1x400.png CHANGED
Binary file
images/ui-bg_glass_75_dadada_1x400.png CHANGED
Binary file
images/ui-bg_glass_75_e6e6e6_1x400.png CHANGED
Binary file
images/ui-bg_glass_95_fef1ec_1x400.png CHANGED
Binary file
images/ui-bg_highlight-soft_75_cccccc_1x100.png CHANGED
Binary file
images/ui-icons_222222_256x240.png CHANGED
Binary file
images/ui-icons_2e83ff_256x240.png CHANGED
Binary file
images/ui-icons_454545_256x240.png CHANGED
Binary file
images/ui-icons_888888_256x240.png CHANGED
Binary file
images/ui-icons_cd0a0a_256x240.png CHANGED
Binary file
includes/controls.php CHANGED
@@ -73,14 +73,16 @@ class NewsletterControls {
73
  return true;
74
  die('Invalid call');
75
  }
76
-
77
  function get_value($name) {
78
- if (!isset($this->data[$name])) return null;
 
79
  return $this->data[$name];
80
  }
81
-
82
  function get_value_array($name) {
83
- if (!isset($this->data[$name]) || !is_array($this->data[$name])) return array();
 
84
  return $this->data[$name];
85
  }
86
 
@@ -89,14 +91,14 @@ class NewsletterControls {
89
  */
90
  function show() {
91
  if (!empty($this->errors)) {
92
- echo '<div class="newsletter-error">';
93
  echo $this->errors;
94
- echo '</div>';
95
  }
96
  if (!empty($this->messages)) {
97
- echo '<div class="newsletter-message">';
98
  echo $this->messages;
99
- echo '</div>';
100
  }
101
  }
102
 
@@ -153,7 +155,7 @@ class NewsletterControls {
153
  */
154
  function checkboxes_group($name, $values_labels) {
155
  $value_array = $this->get_value_array($name);
156
-
157
  echo "<div class='newsletter-checkboxes-group'>";
158
  foreach ($values_labels as $value => $label) {
159
  echo "<div class='newsletter-checkboxes-item'>";
@@ -187,7 +189,7 @@ class NewsletterControls {
187
  */
188
  function select_group($name, $options) {
189
  $value_array = $this->get_value_array($name);
190
-
191
  echo '<select name="options[' . $name . '][]">';
192
 
193
  foreach ($options as $key => $label) {
@@ -264,7 +266,7 @@ class NewsletterControls {
264
 
265
  function value_date($name, $show_remaining) {
266
  $time = $this->get_value($name);
267
-
268
  echo gmdate(get_option('date_format') . ' ' . get_option('time_format'), $time + get_option('gmt_offset') * 3600);
269
  $delta = $time - time();
270
  if ($show_remaining && $delta > 0) {
@@ -344,6 +346,9 @@ class NewsletterControls {
344
 
345
  function wp_editor($name, $settings = array()) {
346
  wp_editor($this->data[$name], $name, array_merge(array('textarea_name' => 'options[' . $name . ']', 'wpautop' => false), $settings));
 
 
 
347
  }
348
 
349
  function textarea($name, $width = '100%', $height = '50') {
@@ -456,12 +461,12 @@ class NewsletterControls {
456
  echo '</div>';
457
  echo '<div class="hints">';
458
  echo 'User\'s preferences can be activated from the "Subscription Form" panel. They can be used to simulate lists or create private groups. The number is the "preference number". ';
459
- echo '<a href="http://www.satollo.net/plugins/newsletter/newsletter-preferences" target="_blank">Read more about preferences</a>.';
460
  echo '</div>';
461
- }
462
 
463
  /**
464
- * Creates a set of checkboxes all names $name[] and the preference number as value
465
  * so the selected checkboxes are retrieved as an array of values ($REQUEST[$name]
466
  * will be an array if at east one preference is checked).
467
  */
@@ -477,12 +482,12 @@ class NewsletterControls {
477
  echo '</div>';
478
  }
479
  echo '<div style="clear: both"></div>';
480
- echo '<a href="http://www.satollo.net/plugins/newsletter/newsletter-preferences" target="_blank">Click here know more about preferences.</a> They can be configured on Subscription/Form field panel.';
481
  echo '</div>';
482
  }
483
 
484
  /** Creates as many selects as the active preferences with the three values
485
- * 'any', 'yes', 'no' corresponding to the values 0, 1, 2.
486
  */
487
  function preferences_selects($name = 'preferences', $skip_empty = false) {
488
  $options_profile = get_option('newsletter_profile');
@@ -500,7 +505,7 @@ class NewsletterControls {
500
  echo '</div>';
501
  }
502
  echo '<div style="clear: both"></div>';
503
- echo '<a href="http://www.satollo.net/plugins/newsletter/newsletter-preferences" target="_blank">Click here know more about preferences.</a> They can be configured on Subscription/Form field panel.';
504
  echo '</div>';
505
  }
506
 
@@ -621,6 +626,27 @@ class NewsletterControls {
621
  }
622
  });
623
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
624
  </script>
625
  ';
626
  echo '<input name="act" type="hidden" value=""/>';
@@ -670,12 +696,12 @@ class NewsletterControls {
670
  function get_test_subscribers() {
671
  return NewsletterUsers::instance()->get_test_users();
672
  }
673
-
674
  function css_font_size($name) {
675
  $value = $this->get_value($name);
676
 
677
  echo '<select id="options-' . $name . '" name="options[' . $name . ']">';
678
- for ($i=8; $i<50; $i++) {
679
  echo '<option value="' . $i . '"';
680
  if ($value == $i)
681
  echo ' selected';
@@ -683,27 +709,27 @@ class NewsletterControls {
683
  }
684
  echo '</select>&nbsp;px';
685
  }
686
-
687
  function css_border($name) {
688
  $value = $this->get_value($name . '_width');
689
 
690
  echo 'width&nbsp;<select id="options-' . $name . '-width" name="options[' . $name . '_width]">';
691
- for ($i=0; $i<10; $i++) {
692
  echo '<option value="' . $i . '"';
693
  if ($value == $i)
694
  echo ' selected';
695
  echo '>' . $i . '</option>';
696
  }
697
  echo '</select>&nbsp;px&nbsp;&nbsp;';
698
-
699
- $this->select($name . '_type', array('solid'=>'Solid', 'dashed'=>'Dashed'));
700
-
701
  $this->color($name . '_color');
702
-
703
  $value = $this->get_value($name . '_radius');
704
 
705
  echo '&nbsp;&nbsp;radius&nbsp;<select id="options-' . $name . '-radius" name="options[' . $name . '_radius]">';
706
- for ($i=0; $i<10; $i++) {
707
  echo '<option value="' . $i . '"';
708
  if ($value == $i)
709
  echo ' selected';
@@ -712,6 +738,46 @@ class NewsletterControls {
712
  echo '</select>&nbsp;px';
713
  }
714
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
715
  }
716
 
717
  ?>
73
  return true;
74
  die('Invalid call');
75
  }
76
+
77
  function get_value($name) {
78
+ if (!isset($this->data[$name]))
79
+ return null;
80
  return $this->data[$name];
81
  }
82
+
83
  function get_value_array($name) {
84
+ if (!isset($this->data[$name]) || !is_array($this->data[$name]))
85
+ return array();
86
  return $this->data[$name];
87
  }
88
 
91
  */
92
  function show() {
93
  if (!empty($this->errors)) {
94
+ echo '<div class="error"><p>';
95
  echo $this->errors;
96
+ echo '</p></div>';
97
  }
98
  if (!empty($this->messages)) {
99
+ echo '<div class="updated"><p>';
100
  echo $this->messages;
101
+ echo '</p></div>';
102
  }
103
  }
104
 
155
  */
156
  function checkboxes_group($name, $values_labels) {
157
  $value_array = $this->get_value_array($name);
158
+
159
  echo "<div class='newsletter-checkboxes-group'>";
160
  foreach ($values_labels as $value => $label) {
161
  echo "<div class='newsletter-checkboxes-item'>";
189
  */
190
  function select_group($name, $options) {
191
  $value_array = $this->get_value_array($name);
192
+
193
  echo '<select name="options[' . $name . '][]">';
194
 
195
  foreach ($options as $key => $label) {
266
 
267
  function value_date($name, $show_remaining) {
268
  $time = $this->get_value($name);
269
+
270
  echo gmdate(get_option('date_format') . ' ' . get_option('time_format'), $time + get_option('gmt_offset') * 3600);
271
  $delta = $time - time();
272
  if ($show_remaining && $delta > 0) {
346
 
347
  function wp_editor($name, $settings = array()) {
348
  wp_editor($this->data[$name], $name, array_merge(array('textarea_name' => 'options[' . $name . ']', 'wpautop' => false), $settings));
349
+ if (!is_plugin_active('mce_table_buttons/mce_table_buttons.php')) {
350
+ echo '<p class="description">You can install <a href="https://wordpress.org/plugins/mce-table-buttons/" target="_blank">MCE Table Button</a> for a table management toolbar add on.</p>';
351
+ }
352
  }
353
 
354
  function textarea($name, $width = '100%', $height = '50') {
461
  echo '</div>';
462
  echo '<div class="hints">';
463
  echo 'User\'s preferences can be activated from the "Subscription Form" panel. They can be used to simulate lists or create private groups. The number is the "preference number". ';
464
+ echo '<a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">Read more about preferences</a>.';
465
  echo '</div>';
466
+ }
467
 
468
  /**
469
+ * Creates a set of checkboxes all names $name[] and the preference number as value
470
  * so the selected checkboxes are retrieved as an array of values ($REQUEST[$name]
471
  * will be an array if at east one preference is checked).
472
  */
482
  echo '</div>';
483
  }
484
  echo '<div style="clear: both"></div>';
485
+ echo '<a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">Click here know more about preferences.</a> They can be configured on Subscription/Form field panel.';
486
  echo '</div>';
487
  }
488
 
489
  /** Creates as many selects as the active preferences with the three values
490
+ * 'any', 'yes', 'no' corresponding to the values 0, 1, 2.
491
  */
492
  function preferences_selects($name = 'preferences', $skip_empty = false) {
493
  $options_profile = get_option('newsletter_profile');
505
  echo '</div>';
506
  }
507
  echo '<div style="clear: both"></div>';
508
+ echo '<a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">Click here know more about preferences.</a> They can be configured on Subscription/Form field panel.';
509
  echo '</div>';
510
  }
511
 
626
  }
627
  });
628
  });
629
+ function newsletter_media(name) {
630
+ var tnp_uploader = wp.media({
631
+ title: "Select an image",
632
+ button: {
633
+ text: "Select"
634
+ },
635
+ multiple: false
636
+ }).on("select", function() {
637
+ var media = tnp_uploader.state().get("selection").first();
638
+ document.getElementById(name + "_id").value = media.id;
639
+ document.getElementById(name + "_url").value = media.attributes.url;
640
+ document.getElementById(name + "_img").src = media.attributes.sizes.thumbnail.url;
641
+ }).open();
642
+ }
643
+ function newsletter_media_remove(name) {
644
+ if (confirm("Are you sure?")) {
645
+ document.getElementById(name + "_id").value = "";
646
+ document.getElementById(name + "_url").value = "";
647
+ document.getElementById(name + "_img").src = "' . plugins_url('newsletter') . '/images/nomedia.png";
648
+ }
649
+ }
650
  </script>
651
  ';
652
  echo '<input name="act" type="hidden" value=""/>';
696
  function get_test_subscribers() {
697
  return NewsletterUsers::instance()->get_test_users();
698
  }
699
+
700
  function css_font_size($name) {
701
  $value = $this->get_value($name);
702
 
703
  echo '<select id="options-' . $name . '" name="options[' . $name . ']">';
704
+ for ($i = 8; $i < 50; $i++) {
705
  echo '<option value="' . $i . '"';
706
  if ($value == $i)
707
  echo ' selected';
709
  }
710
  echo '</select>&nbsp;px';
711
  }
712
+
713
  function css_border($name) {
714
  $value = $this->get_value($name . '_width');
715
 
716
  echo 'width&nbsp;<select id="options-' . $name . '-width" name="options[' . $name . '_width]">';
717
+ for ($i = 0; $i < 10; $i++) {
718
  echo '<option value="' . $i . '"';
719
  if ($value == $i)
720
  echo ' selected';
721
  echo '>' . $i . '</option>';
722
  }
723
  echo '</select>&nbsp;px&nbsp;&nbsp;';
724
+
725
+ $this->select($name . '_type', array('solid' => 'Solid', 'dashed' => 'Dashed'));
726
+
727
  $this->color($name . '_color');
728
+
729
  $value = $this->get_value($name . '_radius');
730
 
731
  echo '&nbsp;&nbsp;radius&nbsp;<select id="options-' . $name . '-radius" name="options[' . $name . '_radius]">';
732
+ for ($i = 0; $i < 10; $i++) {
733
  echo '<option value="' . $i . '"';
734
  if ($value == $i)
735
  echo ' selected';
738
  echo '</select>&nbsp;px';
739
  }
740
 
741
+ function media($name, $size='thumbnail') {
742
+ $media_id = $this->data[$name]['id'];
743
+ $media = wp_get_attachment_image_src($media_id, $size);
744
+
745
+ if ($media === false) {
746
+ $media = array('', '', '');
747
+ echo '<img id="' . $name . '_img" src="' . plugins_url('newsletter') . '/images/nomedia.png" onclick="newsletter_media(\'' . $name . '\')">';
748
+ } else {
749
+ echo '<img id="' . $name . '_img" src="' . $media[0] . '" onclick="newsletter_media(\'' . $name . '\')">';
750
+ echo '<br>';
751
+ echo '<a href="#" onclick="newsletter_media_remove(\'' . $name . '\'); return false">Remove</a>';
752
+
753
+ }
754
+
755
+ echo '<input type="hidden" id="' . $name . '_id" name="options[' . $name . '][id]" value="' . $media_id . '" size="5">';
756
+ echo '<input type="hidden" id="' . $name . '_url" name="options[' . $name . '][url]" value="' . esc_attr($media[0]) . '" size="50">';
757
+
758
+ }
759
+
760
+ function media_input($option, $name, $label) {
761
+
762
+ // if (empty($option)) {
763
+ // $option = $this->currentoption;
764
+ // }
765
+ // $options = $this->get_option($option);
766
+ // $val = '';
767
+ // if (isset($options[$var])) {
768
+ // $val = $options[$var];
769
+ // }
770
+
771
+ if (!empty($label)) {
772
+ $output = '<label class="select" for="tnp_' . $name . '">' . $label . ':</label>';
773
+ }
774
+ $output .= '<input id="tnp_' . $name . '" type="text" size="36" name="' . $option . '[' . $name . ']" value="' . esc_attr($val) . '" />';
775
+ $output .= '<input id="tnp_' . $name . '_button" class="button" type="button" value="Select Image" />';
776
+ $output .= '<br class="clear"/>';
777
+
778
+ echo $output;
779
+ }
780
+
781
  }
782
 
783
  ?>
includes/logger.php CHANGED
@@ -1,5 +1,9 @@
1
  <?php
2
 
 
 
 
 
3
  class NewsletterLogger {
4
 
5
  const NONE = 0;
@@ -23,11 +27,11 @@ class NewsletterLogger {
23
  update_option('newsletter_logger_secret', $secret);
24
  }
25
 
26
- if (!wp_mkdir_p(WP_CONTENT_DIR . '/logs/newsletter/')) {
27
  $this->level = self::NONE;
28
  }
29
 
30
- $this->file = WP_CONTENT_DIR . '/logs/newsletter/' . $module . '-' . $secret . '.txt';
31
  }
32
 
33
  function log($text, $level = self::ERROR) {
1
  <?php
2
 
3
+ if (!defined('NEWSLETTER_LOG_DIR')) {
4
+ define('NEWSLETTER_LOG_DIR', WP_CONTENT_DIR . '/logs/newsletter/');
5
+ }
6
+
7
  class NewsletterLogger {
8
 
9
  const NONE = 0;
27
  update_option('newsletter_logger_secret', $secret);
28
  }
29
 
30
+ if (!wp_mkdir_p(NEWSLETTER_LOG_DIR)) {
31
  $this->level = self::NONE;
32
  }
33
 
34
+ $this->file = NEWSLETTER_LOG_DIR . '/' . $module . '-' . $secret . '.txt';
35
  }
36
 
37
  function log($text, $level = self::ERROR) {
includes/module.php CHANGED
@@ -104,38 +104,18 @@ class NewsletterModule {
104
  $wpdb->suppress_errors($suppress_errors);
105
  }
106
 
107
- // function hook_version_check() {
108
- // $this->logger->info('Checking for new version');
109
- // if (empty($this->module_id)) return;
110
- // $version = @file_get_contents('http://www.satollo.net/wp-content/plugins/file-commerce-pro/version.php?f=' . $this->module_id);
111
- // if ($version) {
112
- // update_option($this->prefix . '_available_version', $version);
113
- // $this->available_version = $version;
114
- // }
115
- // }
116
-
117
  /**
118
- * Return, eventually, the version of this moduke available on satollo.net.
119
- * @return string
120
  */
121
  static function get_available_version($module_id, $force = false) {
122
- if (empty($module_id))
123
- return '';
124
- $version = get_transient('newsletter_module_' . $module_id . '_version');
125
- if ($force || !$version) {
126
- $version = @file_get_contents('http://www.satollo.net/wp-content/plugins/file-commerce-pro/version.php?f=' . $module_id);
127
- set_transient('newsletter_module_' . $module_id . '_version', $version, 2 * 86400);
128
- }
129
- return $version;
130
  }
131
 
 
 
 
132
  function new_version_available($force = false) {
133
- if (empty($this->module_id))
134
- return false;
135
- $version = self::get_available_version($this->module_id, $force);
136
- if (empty($version))
137
- return false;
138
- return ($version > $this->version) ? $version : false;
139
  }
140
 
141
  /** Returns a prefix to be used for option names and other things which need to be uniquely named. The parameter
@@ -159,8 +139,9 @@ class NewsletterModule {
159
  }
160
 
161
  function get_default_options($sub = '') {
162
- if (!empty($sub))
163
  $sub .= '-';
 
164
  @include NEWSLETTER_DIR . '/' . $this->module . '/languages/' . $sub . 'en_US.php';
165
  @include WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/languages/' . $sub . 'en_US.php';
166
  @include NEWSLETTER_DIR . '/' . $this->module . '/languages/' . $sub . WPLANG . '.php';
@@ -404,7 +385,7 @@ class NewsletterModule {
404
  if ($last_run < 0) {
405
  return array_chunk($posts, ceil(count($posts)/2));
406
  }
407
-
408
  $result = array(array(), array());
409
  foreach ($posts as &$post) {
410
  if (self::is_post_old($post, $time))
@@ -457,7 +438,9 @@ class NewsletterModule {
457
  static function clean_url_tags($text) {
458
  $text = str_replace('%7B', '{', $text);
459
  $text = str_replace('%7D', '}', $text);
460
- $text = preg_replace("/[\"']http[^\"']+(\\{[^\\}]+\\})[\"']/i", "\"\\1\"", $text);
 
 
461
  return $text;
462
  }
463
 
@@ -505,7 +488,7 @@ class NewsletterModule {
505
  }
506
 
507
  function admin_menu() {
508
-
509
  }
510
 
511
  function add_menu_page($page, $title) {
@@ -537,7 +520,7 @@ class NewsletterModule {
537
  }
538
 
539
  function get_admin_page_url($page) {
540
- return '?page=newsletter_' . $this->module . '_' . $page;
541
  }
542
 
543
  /** Returns all the emails of the give type (message, feed, followup, ...) and in the given format
104
  $wpdb->suppress_errors($suppress_errors);
105
  }
106
 
 
 
 
 
 
 
 
 
 
 
107
  /**
108
+ * Kept for compatibility.
 
109
  */
110
  static function get_available_version($module_id, $force = false) {
111
+ return '';
 
 
 
 
 
 
 
112
  }
113
 
114
+ /**
115
+ * Kept for compatibility.
116
+ */
117
  function new_version_available($force = false) {
118
+ return false;
 
 
 
 
 
119
  }
120
 
121
  /** Returns a prefix to be used for option names and other things which need to be uniquely named. The parameter
139
  }
140
 
141
  function get_default_options($sub = '') {
142
+ if (!empty($sub)) {
143
  $sub .= '-';
144
+ }
145
  @include NEWSLETTER_DIR . '/' . $this->module . '/languages/' . $sub . 'en_US.php';
146
  @include WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/languages/' . $sub . 'en_US.php';
147
  @include NEWSLETTER_DIR . '/' . $this->module . '/languages/' . $sub . WPLANG . '.php';
385
  if ($last_run < 0) {
386
  return array_chunk($posts, ceil(count($posts)/2));
387
  }
388
+
389
  $result = array(array(), array());
390
  foreach ($posts as &$post) {
391
  if (self::is_post_old($post, $time))
438
  static function clean_url_tags($text) {
439
  $text = str_replace('%7B', '{', $text);
440
  $text = str_replace('%7D', '}', $text);
441
+
442
+ // Only tags which are {*_url}
443
+ $text = preg_replace("/[\"']http[^\"']+(\\{[^\\}]+_url\\})[\"']/i", "\"\\1\"", $text);
444
  return $text;
445
  }
446
 
488
  }
489
 
490
  function admin_menu() {
491
+
492
  }
493
 
494
  function add_menu_page($page, $title) {
520
  }
521
 
522
  function get_admin_page_url($page) {
523
+ return admin_url('admin.php') . '?page=newsletter_' . $this->module . '_' . $page;
524
  }
525
 
526
  /** Returns all the emails of the give type (message, feed, followup, ...) and in the given format
includes/themes.php CHANGED
@@ -25,8 +25,10 @@ class NewsletterThemes {
25
 
26
  if ($handle !== false) {
27
  while ($file = readdir($handle)) {
28
- if ($file == '.' || $file == '..') continue;
29
- if (!is_file($dir . '/' . $file . '/theme.php')) continue;
 
 
30
  $list[$file] = $file;
31
  }
32
  closedir($handle);
@@ -38,9 +40,12 @@ class NewsletterThemes {
38
 
39
  if ($handle !== false) {
40
  while ($file = readdir($handle)) {
41
- if ($file == '.' || $file == '..') continue;
42
- if (isset($list[$file])) continue;
43
- if (!is_file($dir . '/' . $file . '/theme.php')) continue;
 
 
 
44
 
45
  $list[$file] = $file;
46
  }
@@ -50,6 +55,16 @@ class NewsletterThemes {
50
 
51
  return $list;
52
  }
 
 
 
 
 
 
 
 
 
 
53
 
54
  function get_all_with_data() {
55
  $list = array();
@@ -59,9 +74,12 @@ class NewsletterThemes {
59
 
60
  if ($handle !== false) {
61
  while ($file = readdir($handle)) {
62
- if ($file == '.' || $file == '..') continue;
63
- if (isset($list[$file])) continue;
64
- if (!is_file($dir . '/' . $file . '/theme.php')) continue;
 
 
 
65
  $data = array();
66
  $data['name'] = $file;
67
  $screenshot = $dir . '/' . $file . '/screenshot.png';
@@ -81,8 +99,10 @@ class NewsletterThemes {
81
 
82
  if ($handle !== false) {
83
  while ($file = readdir($handle)) {
84
- if ($file == '.' || $file == '..') continue;
85
- if (!is_file($dir . '/' . $file . '/theme.php')) continue;
 
 
86
  $data = array();
87
  $data['name'] = $file;
88
  $screenshot = $dir . '/' . $file . '/screenshot.png';
@@ -96,7 +116,8 @@ class NewsletterThemes {
96
  closedir($handle);
97
  }
98
  }
99
-
 
100
 
101
  return $list;
102
  }
@@ -111,7 +132,8 @@ class NewsletterThemes {
111
  add_option('newsletter_' . $this->module . '_theme_' . $theme, array(), null, 'no');
112
  $theme_options = array();
113
  foreach ($options as $key => &$value) {
114
- if (substr($key, 0, 6) != 'theme_') continue;
 
115
  $theme_options[$key] = $value;
116
  }
117
  update_option('newsletter_' . $this->module . '_theme_' . $theme, $theme_options);
@@ -120,14 +142,17 @@ class NewsletterThemes {
120
  function get_options($theme) {
121
  $options = get_option('newsletter_' . $this->module . '_theme_' . $theme);
122
  // To avoid merge problems.
123
- if (!is_array($options)) return array();
 
124
  return $options;
125
  }
126
 
127
  function get_file_path($theme, $file) {
128
  $path = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes/' . $theme . '/' . $file;
129
- if (is_file($path)) return $path;
130
- else return NEWSLETTER_DIR . '/' . $this->module . '/themes/' . $theme . '/' . $file;
 
 
131
  }
132
 
133
  function get_theme_url($theme) {
@@ -157,7 +182,8 @@ class NewsletterThemes {
157
  @include $path2 . '/' . WPLANG . '.php';
158
  }
159
 
160
- if (!is_array($options)) return array();
 
161
  return $options;
162
  }
163
 
@@ -166,6 +192,8 @@ class NewsletterThemes {
166
  function nt_option($name, $def = null) {
167
  $options = get_option('newsletter_email');
168
  $option = $options['theme_' . $name];
169
- if (!isset($option)) return $def;
170
- else return $option;
 
 
171
  }
25
 
26
  if ($handle !== false) {
27
  while ($file = readdir($handle)) {
28
+ if ($file == '.' || $file == '..')
29
+ continue;
30
+ if (!is_file($dir . '/' . $file . '/theme.php'))
31
+ continue;
32
  $list[$file] = $file;
33
  }
34
  closedir($handle);
40
 
41
  if ($handle !== false) {
42
  while ($file = readdir($handle)) {
43
+ if ($file == '.' || $file == '..')
44
+ continue;
45
+ if (isset($list[$file]))
46
+ continue;
47
+ if (!is_file($dir . '/' . $file . '/theme.php'))
48
+ continue;
49
 
50
  $list[$file] = $file;
51
  }
55
 
56
  return $list;
57
  }
58
+
59
+ function themescmp($a, $b)
60
+ {
61
+ $al = strtolower($a['name']);
62
+ $bl = strtolower($b['name']);
63
+ if ($al == 'default') {
64
+ return -1;
65
+ }
66
+ return (strcmp($al, $bl));
67
+ }
68
 
69
  function get_all_with_data() {
70
  $list = array();
74
 
75
  if ($handle !== false) {
76
  while ($file = readdir($handle)) {
77
+ if ($file == '.' || $file == '..')
78
+ continue;
79
+ if (isset($list[$file]))
80
+ continue;
81
+ if (!is_file($dir . '/' . $file . '/theme.php'))
82
+ continue;
83
  $data = array();
84
  $data['name'] = $file;
85
  $screenshot = $dir . '/' . $file . '/screenshot.png';
99
 
100
  if ($handle !== false) {
101
  while ($file = readdir($handle)) {
102
+ if ($file == '.' || $file == '..')
103
+ continue;
104
+ if (!is_file($dir . '/' . $file . '/theme.php'))
105
+ continue;
106
  $data = array();
107
  $data['name'] = $file;
108
  $screenshot = $dir . '/' . $file . '/screenshot.png';
116
  closedir($handle);
117
  }
118
  }
119
+
120
+ usort($list, array($this, "themescmp"));
121
 
122
  return $list;
123
  }
132
  add_option('newsletter_' . $this->module . '_theme_' . $theme, array(), null, 'no');
133
  $theme_options = array();
134
  foreach ($options as $key => &$value) {
135
+ if (substr($key, 0, 6) != 'theme_')
136
+ continue;
137
  $theme_options[$key] = $value;
138
  }
139
  update_option('newsletter_' . $this->module . '_theme_' . $theme, $theme_options);
142
  function get_options($theme) {
143
  $options = get_option('newsletter_' . $this->module . '_theme_' . $theme);
144
  // To avoid merge problems.
145
+ if (!is_array($options))
146
+ return array();
147
  return $options;
148
  }
149
 
150
  function get_file_path($theme, $file) {
151
  $path = WP_CONTENT_DIR . '/extensions/newsletter/' . $this->module . '/themes/' . $theme . '/' . $file;
152
+ if (is_file($path))
153
+ return $path;
154
+ else
155
+ return NEWSLETTER_DIR . '/' . $this->module . '/themes/' . $theme . '/' . $file;
156
  }
157
 
158
  function get_theme_url($theme) {
182
  @include $path2 . '/' . WPLANG . '.php';
183
  }
184
 
185
+ if (!is_array($options))
186
+ return array();
187
  return $options;
188
  }
189
 
192
  function nt_option($name, $def = null) {
193
  $options = get_option('newsletter_email');
194
  $option = $options['theme_' . $name];
195
+ if (!isset($option))
196
+ return $def;
197
+ else
198
+ return $option;
199
  }
main/diagnostic.php CHANGED
@@ -9,6 +9,15 @@ if ($controls->is_action('save')) {
9
  $controls->messages = 'Loggin levels saved.';
10
  }
11
 
 
 
 
 
 
 
 
 
 
12
  if ($controls->is_action('trigger')) {
13
  $newsletter->hook_newsletter();
14
  $controls->messages = 'Delivery engine triggered.';
@@ -73,7 +82,9 @@ if ($controls->is_action('test_wp')) {
73
  if ($r) {
74
  $controls->messages .= 'Direct WordPress email sent<br />';
75
  } else {
76
- $controls->errors .= 'Direct WordPress email NOT sent: <strong>ask now your provider</strong> to know if you can send emails from your blog or not..<br>';
 
 
77
  }
78
  }
79
 
@@ -88,10 +99,13 @@ if ($controls->is_action('send_test')) {
88
  $r = $newsletter->mail($controls->data['test_email'], 'Newsletter: pure text email', array('text' => $text));
89
 
90
 
91
- if ($r)
92
  $controls->messages .= 'Newsletter TEXT test email sent.<br />';
93
- else
94
  $controls->errors .= 'Newsletter TEXT test email NOT sent: try to change the sender data, remove the return path and the reply to settings.<br />';
 
 
 
95
 
96
  $text = '<p>This is a <strong>html</strong> email sent using the <i>sender data</i> set on Newsletter main setting.</p>';
97
  $text .= '<p>You should see some "mark up", like bold and italic characters.</p>';
@@ -107,17 +121,38 @@ if ($controls->is_action('send_test')) {
107
  $text['html'] = '<p>This is an <b>HTML</b> test email part sent using the sender data set on Newsletter main setting.</p>';
108
  $text['text'] = 'This is a textual test email part sent using the sender data set on Newsletter main setting.';
109
  $r = $newsletter->mail($controls->data['test_email'], 'Newsletter: both textual and html email', $text);
110
- if ($r)
111
  $controls->messages .= 'Newsletter: both textual and html test email sent.<br />';
112
- else
113
  $controls->errors .= 'Newsletter both TEXT and HTML test email NOT sent: try to change the sender data, remove the return path and the reply to settings.<br />';
 
114
  }
115
 
116
- if (empty($controls->data))
117
  $controls->data = get_option('newsletter_diagnostic');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  ?>
119
  <div class="wrap">
120
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/newsletter-diagnostic'; ?>
121
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
122
 
123
  <div id="newsletter-title">
@@ -135,42 +170,48 @@ if (empty($controls->data))
135
  <form method="post" action="">
136
  <?php $controls->init(); ?>
137
 
138
- <h3>Test your mail system</h3>
139
- Email: <?php $controls->text('test_email'); ?>
140
- <?php $controls->button('test_wp', 'Send an email with WordPress'); ?>
141
- <?php $controls->button('send_test', 'Send few emails with Newsletter'); ?>
142
- <div class="hints">
143
- First test emailing with WordPress if it does not work you need to contact your provider. Test on different addresses.
144
- <br>
145
- Second test emailing with Newsletter. You must receive three distinct email in different formats.
146
- <br>
147
- If the WordPress test works but Newsletter test doesn't, check the main configuration and try to change the sender,
148
- return path and reply to email addresses.
149
- </div>
150
 
151
 
152
- <h3>System Check and Upgrade</h3>
153
- <p>
154
- Tables below contain some system parameter that can affect Newsletter plugin working mode. When asking for support consider to
155
- report those values.
156
- </p>
157
-
158
  <div id="tabs">
159
 
160
  <ul>
161
- <li><a href="#tabs-1">Logging</a></li>
 
162
  <li><a href="#tabs-2">Semaphores and Crons</a></li>
163
  <li><a href="#tabs-4">System</a></li>
164
- <li><a href="#tabs-upgrade">Maintainance</a></li>
 
 
 
165
  </ul>
166
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  <!-- LOGGING -->
168
- <div id="tabs-1">
169
 
170
- <h4>Logging</h4>
171
  <p>
172
  The logging feature of Newsletter, when enabled, writes detailed information of the working
173
- status inside some (so called) log files. Log files, one per module, are stored inside the folder
174
  <code>wp-content/logs/newsletter</code>.
175
  </p>
176
 
@@ -197,8 +238,7 @@ if (empty($controls->data))
197
  </td>
198
  <td>
199
  <?php
200
- $dir = WP_CONTENT_DIR . '/logs/newsletter';
201
- if (!is_dir($dir)) {
202
  echo '<span class="newsletter-error-span">The log folder does not exists, no logging possible!</span>';
203
  } else {
204
  echo 'The log folder exists.';
@@ -259,7 +299,7 @@ if (empty($controls->data))
259
  <td>
260
  <?php
261
  if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON)
262
- echo 'DISABLED. (can be a problem, see the <a href="http://www.satollo.net/plugins/newsletter/newsletter-delivery-engine" target="_tab">delivery engine documentation</a>)';
263
  else
264
  echo "ENABLED. (it's ok)";
265
  ?>
@@ -299,19 +339,48 @@ if (empty($controls->data))
299
  <td>
300
  <?php echo NewsletterModule::format_scheduler_time('newsletter'); ?>
301
  <?php $controls->button('trigger', 'Trigger now'); ?>
302
- <br>
303
- If inactive or always in "running now" status your blog has a problem: <a href="http://www.satollo.net/?p=2015" target="_blank">read more here</a>.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  </td>
305
  </tr>
306
 
307
-
308
  </tbody>
309
  </table>
310
  </div>
311
 
312
  <!-- SYSTEM -->
313
  <div id="tabs-4">
314
- <h4>System parameters</h4>
315
 
316
  <table class="widefat" style="width: auto">
317
  <thead>
@@ -339,7 +408,7 @@ if (empty($controls->data))
339
  <td>
340
  <?php
341
  if (defined('NEWSLETTER_MAX_EXECUTION_TIME')) {
342
- echo NEWSLETTER_MAX_EXECUTION_TIME . 'seconds';
343
  } else {
344
  echo 'Not set';
345
  }
@@ -358,6 +427,38 @@ if (empty($controls->data))
358
  <?php echo @ini_get('memory_limit'); ?>
359
  </td>
360
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  <tr>
362
  <td>WordPress Memory limit</td>
363
  <td>
@@ -410,14 +511,34 @@ if (empty($controls->data))
410
  ?>
411
  </td>
412
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
  <tr>
414
  <td>File permissions</td>
415
  <td>
416
  <?php
 
417
  $index_permissions = fileperms(ABSPATH . '/index.php');
418
  $subscribe_permissions = fileperms(NEWSLETTER_DIR . '/do/subscribe.php');
419
- if ($index_permissions != $subscribe_permissions) {
420
- echo 'Plugin file permissions differ from blog index.php permissions, that may compromise the subscription process';
 
421
  } else {
422
  echo 'OK';
423
  }
@@ -428,11 +549,17 @@ if (empty($controls->data))
428
  </table>
429
 
430
  </div>
 
431
  <div id="tabs-upgrade">
432
  <p>
433
  Plugin and modules are able to upgrade them self when needed. If you urgently need to try to force an upgrade, press the
434
  button below.
435
  </p>
 
 
 
 
 
436
  <p>
437
  <?php $controls->button('upgrade', 'Force an upgrade'); ?>
438
  </p>
@@ -443,14 +570,24 @@ if (empty($controls->data))
443
  <p>
444
  <?php $controls->button('undismiss', 'Restore'); ?>
445
  </p>
446
-
447
- <p>
448
  Very old versions need to be upgraded on a spacial way. Use the button blow.
449
  </p>
450
  <p>
451
  <?php $controls->button('upgrade_old', 'Force an upgrade from very old versions'); ?>
452
  </p>
453
  </div>
 
 
 
 
 
 
 
 
 
 
454
  </div>
455
 
456
  </form>
9
  $controls->messages = 'Loggin levels saved.';
10
  }
11
 
12
+ if ($controls->is_action('reset_cron_calls')) {
13
+ update_option($module->prefix . '_cron_calls', false);
14
+ $controls->messages = 'Reset.';
15
+ }
16
+ if ($controls->is_action('check-versions')) {
17
+ $newsletter->hook_newsletter_extension_versions(true);
18
+ $controls->messages = 'Extensions data updated. Go to the plugins panel to see if there are updates available.';
19
+ }
20
+
21
  if ($controls->is_action('trigger')) {
22
  $newsletter->hook_newsletter();
23
  $controls->messages = 'Delivery engine triggered.';
82
  if ($r) {
83
  $controls->messages .= 'Direct WordPress email sent<br />';
84
  } else {
85
+ $controls->errors = 'Direct WordPress email NOT sent: <strong>ask now your provider</strong> to know if you can send emails from your blog or not..<br>';
86
+ global $phpmailer;
87
+ $controls->errors .= 'Mailer error message: ' . $phpmailer->ErrorInfo . '<br>';
88
  }
89
  }
90
 
99
  $r = $newsletter->mail($controls->data['test_email'], 'Newsletter: pure text email', array('text' => $text));
100
 
101
 
102
+ if ($r) {
103
  $controls->messages .= 'Newsletter TEXT test email sent.<br />';
104
+ } else {
105
  $controls->errors .= 'Newsletter TEXT test email NOT sent: try to change the sender data, remove the return path and the reply to settings.<br />';
106
+ //$controls->errors .='<pre>xxx' . htmlspecialchars(print_r($newsletter->mailer->ErrorInfo, true)) . '</pre>';
107
+ $controls->errors .='<pre>' . print_r(error_get_last(), true) . '</pre>';
108
+ }
109
 
110
  $text = '<p>This is a <strong>html</strong> email sent using the <i>sender data</i> set on Newsletter main setting.</p>';
111
  $text .= '<p>You should see some "mark up", like bold and italic characters.</p>';
121
  $text['html'] = '<p>This is an <b>HTML</b> test email part sent using the sender data set on Newsletter main setting.</p>';
122
  $text['text'] = 'This is a textual test email part sent using the sender data set on Newsletter main setting.';
123
  $r = $newsletter->mail($controls->data['test_email'], 'Newsletter: both textual and html email', $text);
124
+ if ($r) {
125
  $controls->messages .= 'Newsletter: both textual and html test email sent.<br />';
126
+ } else {
127
  $controls->errors .= 'Newsletter both TEXT and HTML test email NOT sent: try to change the sender data, remove the return path and the reply to settings.<br />';
128
+ }
129
  }
130
 
131
+ if (empty($controls->data)) {
132
  $controls->data = get_option('newsletter_diagnostic');
133
+ }
134
+
135
+ $calls = get_option('newsletter_diagnostic_cron_calls', array());
136
+
137
+ if (count($calls) > 1) {
138
+ $mean = 0;
139
+ $max = 0;
140
+ $min = 0;
141
+ for ($i = 1; $i < count($calls); $i++) {
142
+ $diff = $calls[$i] - $calls[$i - 1];
143
+ $mean += $diff;
144
+ if ($min == 0 || $min > $diff) {
145
+ $min = $diff;
146
+ }
147
+ if ($max < $diff) {
148
+ $max = $diff;
149
+ }
150
+ }
151
+ $mean = $mean / count($calls) - 1;
152
+ }
153
  ?>
154
  <div class="wrap">
155
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-diagnostic'; ?>
156
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
157
 
158
  <div id="newsletter-title">
170
  <form method="post" action="">
171
  <?php $controls->init(); ?>
172
 
 
 
 
 
 
 
 
 
 
 
 
 
173
 
174
 
 
 
 
 
 
 
175
  <div id="tabs">
176
 
177
  <ul>
178
+ <li><a href="#tabs-tests">Tests</a></li>
179
+ <li><a href="#tabs-logging">Logging</a></li>
180
  <li><a href="#tabs-2">Semaphores and Crons</a></li>
181
  <li><a href="#tabs-4">System</a></li>
182
+ <li><a href="#tabs-upgrade">Maintenance</a></li>
183
+ <?php if (isset($_GET['debug'])) { ?>
184
+ <li><a href="#tabs-debug">Debug Data</a></li>
185
+ <?php } ?>
186
  </ul>
187
 
188
+ <!-- TESTS -->
189
+ <div id="tabs-tests">
190
+ <p>Here you can test if the blog is able to send emails reliabily.</p>
191
+
192
+ <p>Email address where to send test messages: <?php $controls->text('test_email', 50); ?></p>
193
+
194
+ <p>
195
+ <?php $controls->button('test_wp', 'Send an email with WordPress'); ?>
196
+ <?php $controls->button('send_test', 'Send few emails with Newsletter'); ?>
197
+ </p>
198
+
199
+ <p class="description">
200
+ First test emailing with WordPress if it does not work you need to contact your provider. Test on different addresses.
201
+ <br>
202
+ Second test emailing with Newsletter. You must receive three distinct email in different formats.
203
+ <br>
204
+ If the WordPress test works but Newsletter test doesn't, check the main configuration and try to change the sender,
205
+ return path and reply to email addresses.
206
+ </p>
207
+ </div>
208
+
209
  <!-- LOGGING -->
210
+ <div id="tabs-logging">
211
 
 
212
  <p>
213
  The logging feature of Newsletter, when enabled, writes detailed information of the working
214
+ status inside few (so called) log files. Log files, one per module, are stored inside the folder
215
  <code>wp-content/logs/newsletter</code>.
216
  </p>
217
 
238
  </td>
239
  <td>
240
  <?php
241
+ if (!is_dir(NEWSLETTER_LOG_DIR)) {
 
242
  echo '<span class="newsletter-error-span">The log folder does not exists, no logging possible!</span>';
243
  } else {
244
  echo 'The log folder exists.';
299
  <td>
300
  <?php
301
  if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON)
302
+ echo 'DISABLED. (can be a problem, see the <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_tab">delivery engine documentation</a>)';
303
  else
304
  echo "ENABLED. (it's ok)";
305
  ?>
339
  <td>
340
  <?php echo NewsletterModule::format_scheduler_time('newsletter'); ?>
341
  <?php $controls->button('trigger', 'Trigger now'); ?>
342
+ <p class="description">
343
+ If inactive or always in "running now" status your blog has a problem: <a href="http://www.thenewsletterplugin.com/how-to-make-the-wordpress-cron-work" target="_blank">read more here</a>.
344
+ </p>
345
+ </td>
346
+ </tr>
347
+ <tr>
348
+ <td>Collected samples</td>
349
+ <td>
350
+ <?php echo count($calls); ?>
351
+ <p class="description">Samples are collected in a maximum number of <?php echo Newsletter::MAX_CRON_SAMPLES; ?></p>
352
+ </td>
353
+ </tr>
354
+ <tr>
355
+ <td>Scheduler execution interval mean</td>
356
+ <td>
357
+ <?php
358
+ if (count($calls) > 10) {
359
+ echo (int) $mean . ' seconds';
360
+ if ($mean < NEWSLETTER_CRON_INTERVAL * 1.2) {
361
+ echo ' (<span style="color: green; font-weight: bold">OK</span>)';
362
+ } else {
363
+ echo ' (<span style="color: red; font-weight: bold">KO</span>)';
364
+ }
365
+ } else {
366
+ echo 'Still not enough data. It requires few hours to collect a relevant data set.';
367
+ }
368
+ ?>
369
+
370
+ <p class="description">
371
+ Should be less than <?php echo NEWSLETTER_CRON_INTERVAL; ?> seconds.
372
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">Read more</a>.
373
+ </p>
374
+
375
  </td>
376
  </tr>
377
 
 
378
  </tbody>
379
  </table>
380
  </div>
381
 
382
  <!-- SYSTEM -->
383
  <div id="tabs-4">
 
384
 
385
  <table class="widefat" style="width: auto">
386
  <thead>
408
  <td>
409
  <?php
410
  if (defined('NEWSLETTER_MAX_EXECUTION_TIME')) {
411
+ echo NEWSLETTER_MAX_EXECUTION_TIME . ' seconds';
412
  } else {
413
  echo 'Not set';
414
  }
427
  <?php echo @ini_get('memory_limit'); ?>
428
  </td>
429
  </tr>
430
+ <tr>
431
+ <td>WordPress plugin url</td>
432
+ <td>
433
+ <?php echo WP_PLUGIN_URL; ?>
434
+ <br>
435
+ Filters:
436
+
437
+ <?php
438
+ $filters = $wp_filter['plugins_url'];
439
+ if (!is_array($filters))
440
+ echo 'no filters attached to "plugin_urls"';
441
+ else {
442
+ echo '<ul>';
443
+ foreach ($filters as &$filter) {
444
+ foreach ($filter as &$entry) {
445
+ echo '<li>';
446
+ if (is_array($entry['function']))
447
+ echo get_class($entry['function'][0]) . '->' . $entry['function'][1];
448
+ else
449
+ echo $entry['function'];
450
+ echo '</li>';
451
+ }
452
+ }
453
+ echo '</ul>';
454
+ }
455
+ ?>
456
+ <p class="description">
457
+ This value should contains the full URL to your plugin folder. If there are filters
458
+ attached, the value can be different from the original generated by WordPress and sometime worng.
459
+ </p>
460
+ </td>
461
+ </tr>
462
  <tr>
463
  <td>WordPress Memory limit</td>
464
  <td>
511
  ?>
512
  </td>
513
  </tr>
514
+ <tr>
515
+ <td>Action file accessibility</td>
516
+ <td>
517
+ <?php
518
+ $res = wp_remote_get(plugins_url('newsletter') . '/do/subscribe.php?test=1');
519
+ if (is_wp_error($res)) {
520
+ echo 'It seems the Newsletter action files are not reachable. See the note and the file permission check below.';
521
+ } else {
522
+ echo 'OK';
523
+ }
524
+ ?>
525
+ <p class="description">
526
+ If this internal test fails, subscription, confirmation and so on could fail. Try to open
527
+ <a href="<?php echo plugins_url('newsletter') . '/do/subscribe.php?test=1'?>" target="_blank">this link</a>: if
528
+ it reports "ok", consider this test as passed.
529
+ </p>
530
+ </td>
531
+ </tr>
532
  <tr>
533
  <td>File permissions</td>
534
  <td>
535
  <?php
536
+ $index_owner = fileowner(ABSPATH . '/index.php');
537
  $index_permissions = fileperms(ABSPATH . '/index.php');
538
  $subscribe_permissions = fileperms(NEWSLETTER_DIR . '/do/subscribe.php');
539
+ $subscribe_owner = fileowner(NEWSLETTER_DIR . '/do/subscribe.php');
540
+ if ($index_permissions != $subscribe_permissions || $index_owner != $subscribe_owner) {
541
+ echo 'Plugin file permissions or owner differ from blog index.php permissions, that may compromise the subscription process';
542
  } else {
543
  echo 'OK';
544
  }
549
  </table>
550
 
551
  </div>
552
+
553
  <div id="tabs-upgrade">
554
  <p>
555
  Plugin and modules are able to upgrade them self when needed. If you urgently need to try to force an upgrade, press the
556
  button below.
557
  </p>
558
+
559
+ <p>
560
+ <?php $controls->button('check-versions', 'Check for new extension versions'); ?>
561
+ </p>
562
+
563
  <p>
564
  <?php $controls->button('upgrade', 'Force an upgrade'); ?>
565
  </p>
570
  <p>
571
  <?php $controls->button('undismiss', 'Restore'); ?>
572
  </p>
573
+
574
+ <p>
575
  Very old versions need to be upgraded on a spacial way. Use the button blow.
576
  </p>
577
  <p>
578
  <?php $controls->button('upgrade_old', 'Force an upgrade from very old versions'); ?>
579
  </p>
580
  </div>
581
+
582
+ <?php if (isset($_GET['debug'])) { ?>
583
+ <div id="tabs-debug">
584
+ <h3>Extension versions data</h3>
585
+ <pre style="font-size: 11px"><?php echo esc_html(print_r(get_option('newsletter_extension_versions'), true)); ?></pre>
586
+
587
+ <h3>Update plugins data</h3>
588
+ <pre style="font-size: 11px"><?php echo esc_html(print_r(get_site_transient('update_plugins'), true)); ?></pre>
589
+ </div>
590
+ <?php } ?>
591
  </div>
592
 
593
  </form>
main/index.php CHANGED
@@ -16,13 +16,13 @@ if ($controls->is_action('feed_disable')) {
16
  <div class="wrap main-index">
17
 
18
 
19
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter'; ?>
20
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
21
 
22
  <div id="newsletter-title">
23
  <h2>Welcome and Support</h2>
24
  <p>
25
- With my horrible English, everything can be found starting from <a href="http://www.satollo.net/plugins/newsletter" target="_blank">Newsletter Official page</a>
26
  and every configuration panel has some included documentation just to avoid the most common mistakes.
27
  </p>
28
  </div>
@@ -55,7 +55,7 @@ if ($controls->is_action('feed_disable')) {
55
 
56
  <li>
57
  <em>More about subscription.</em> The subscription and unsubscription processes to a mailing
58
- list <strong>must be clear</strong> to the blog owner. <a href="http://www.satollo.net/plugins/newsletter/subscription-module" target="_blank">You can find more on Satollo.net</a>.
59
  </li>
60
  </ol>
61
 
@@ -69,7 +69,7 @@ if ($controls->is_action('feed_disable')) {
69
  <li>
70
  <em>I get a 500/fatal error during subscription.</em> This is mostly a problem of file permissions. On the diagnostic
71
  panel there is a check and on
72
- <a target="_blank" href="http://www.satollo.net/plugins/newsletter/subscription-module#errors">Satollo.net there are some solutions</a>.
73
  </li>
74
  </ol>
75
 
@@ -88,11 +88,11 @@ if ($controls->is_action('feed_disable')) {
88
  </li>
89
  <li>
90
  <em>I want to send my newsletter.</em> Simple, press the send button. The email is created and put on
91
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-delivery-engine" target="_blank">delivery engine queue</a>.
92
  On newsletter list, it will be shown as "sending".
93
  </li>
94
  <li>
95
- <em>The newsletter is going out too slowly.</em> The <a href="http://www.satollo.net/plugins/newsletter/newsletter-delivery-engine" target="_blank">delivery engine</a> sends
96
  emails as quickly as configured, see the <a href="admin.php?page=newsletter_main_main">main
97
  configuration panel</a>. Look at your provider documentation as well, since it surely has a hourly limit.
98
  </li>
@@ -101,7 +101,7 @@ if ($controls->is_action('feed_disable')) {
101
  <h3>Extensions</h3>
102
  <p>
103
  Newsletter plugin can be extended with advanced features installing one or more of the
104
- available Professional Extensions you can find on <a href="http://www.satollo.net/downloads" target="_blank">www.satollo.net/downloads</a>.
105
  </p>
106
  <p>
107
  Newsletter Extensions are regular plugins (from version 2.x) and can be managed from the plugin panel of your
@@ -113,39 +113,39 @@ if ($controls->is_action('feed_disable')) {
113
  There are few options to find or ask for support:
114
  </p>
115
  <ul>
116
- <li><a href="http://www.satollo.net/plugins/newsletter" target="_blank">The official Newsletter page</a> contains information and links to documentation and FAQ</li>
117
- <li><a href="http://www.satollo.net/forums/forum/newsletter-plugin" target="_blank">The official Newsletter forum</a> where to find solutions or create new requests</li>
118
- <li><a href="http://www.satollo.net/tag/newsletter" target="_blank">Newsletter articles and comments</a> are a source of solutions</li>
119
- <li>Only for <a href="http://www.satollo.net/membership" target="_blank">members</a> the <a href="http://www.satollo.net/support-form" target="_blank">support page</a>
120
- <li>Write directly to me at stefano@satollo.net</li>
121
  </ul>
122
 
123
  <h3>Documentation</h3>
124
  <p>
125
- Below are the pages on www.satollo.net which document Newsletter. Since the site evolves, more pages can be available and
126
  the full list is always up-to-date on main Newsletter page.
127
  </p>
128
 
129
  <ul>
130
- <li><a href="http://www.satollo.net/plugins/newsletter" target="_blank">Official Newsletter page</a></li>
131
- <li><a href="http://www.satollo.net/plugins/newsletter/newsletter-configuration" target="_blank">Main configuration</a></li>
132
- <li><a href="http://www.satollo.net/plugins/newsletter/newsletter-diagnostic" target="_blank">Diagnostic</a></li>
133
- <li><a href="http://www.satollo.net/plugins/newsletter/newsletter-faq" target="_blank">FAQ</a></li>
134
- <li><a href="http://www.satollo.net/plugins/newsletter/newsletter-delivery-engine" target="_blank">Delivery Engine</a></li>
135
 
136
 
137
- <li><a href="http://www.satollo.net/plugins/newsletter/subscription-module" target="_blank">Subscription Module</a></li>
138
- <li><a href="http://www.satollo.net/plugins/newsletter/newsletter-forms" target="_blank">Subscription Forms</a></li>
139
- <li><a href="http://www.satollo.net/plugins/newsletter/newsletter-preferences" target="_blank">Subscriber's preferences</a></li>
140
 
141
- <li><a href="http://www.satollo.net/plugins/newsletter/newsletters-module" target="_blank">Newsletters Module</a></li>
142
- <li><a href="http://www.satollo.net/plugins/newsletter/newsletter-themes" target="_blank">Themes</a></li>
143
 
144
- <li><a href="http://www.satollo.net/plugins/newsletter/subscribers-module" target="_blank">Subscribers Module</a></li>
145
- <li><a href="http://www.satollo.net/plugins/newsletter/statistics-module" target="_blank">Statistics Module</a></li>
146
 
147
- <li><a href="http://www.satollo.net/plugins/newsletter/feed-by-mail-module" target="_blank">Feed by Mail Module</a></li>
148
- <!--<li><a href="http://www.satollo.net/plugins/newsletter/follow-up-module" target="_blank">Follow Up Module</a></li>
149
  -->
150
  </ul>
151
 
16
  <div class="wrap main-index">
17
 
18
 
19
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter'; ?>
20
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
21
 
22
  <div id="newsletter-title">
23
  <h2>Welcome and Support</h2>
24
  <p>
25
+ With my horrible English, everything can be found starting from <a href="http://www.thenewsletterplugin.com/plugins/newsletter" target="_blank">Newsletter Official page</a>
26
  and every configuration panel has some included documentation just to avoid the most common mistakes.
27
  </p>
28
  </div>
55
 
56
  <li>
57
  <em>More about subscription.</em> The subscription and unsubscription processes to a mailing
58
+ list <strong>must be clear</strong> to the blog owner. <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module" target="_blank">You can find more on thenewsletterplugin.com</a>.
59
  </li>
60
  </ol>
61
 
69
  <li>
70
  <em>I get a 500/fatal error during subscription.</em> This is mostly a problem of file permissions. On the diagnostic
71
  panel there is a check and on
72
+ <a target="_blank" href="http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module#errors">thenewsletterplugin.com there are some solutions</a>.
73
  </li>
74
  </ol>
75
 
88
  </li>
89
  <li>
90
  <em>I want to send my newsletter.</em> Simple, press the send button. The email is created and put on
91
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">delivery engine queue</a>.
92
  On newsletter list, it will be shown as "sending".
93
  </li>
94
  <li>
95
+ <em>The newsletter is going out too slowly.</em> The <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">delivery engine</a> sends
96
  emails as quickly as configured, see the <a href="admin.php?page=newsletter_main_main">main
97
  configuration panel</a>. Look at your provider documentation as well, since it surely has a hourly limit.
98
  </li>
101
  <h3>Extensions</h3>
102
  <p>
103
  Newsletter plugin can be extended with advanced features installing one or more of the
104
+ available Professional Extensions you can find on <a href="http://www.thenewsletterplugin.com/downloads" target="_blank">www.thenewsletterplugin.com/downloads</a>.
105
  </p>
106
  <p>
107
  Newsletter Extensions are regular plugins (from version 2.x) and can be managed from the plugin panel of your
113
  There are few options to find or ask for support:
114
  </p>
115
  <ul>
116
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter" target="_blank">The official Newsletter page</a> contains information and links to documentation and FAQ</li>
117
+ <li><a href="http://www.thenewsletterplugin.com/forums/forum/newsletter-plugin" target="_blank">The official Newsletter forum</a> where to find solutions or create new requests</li>
118
+ <li><a href="http://www.thenewsletterplugin.com/tag/newsletter" target="_blank">Newsletter articles and comments</a> are a source of solutions</li>
119
+ <li>Only for <a href="http://www.thenewsletterplugin.com/membership" target="_blank">members</a> the <a href="http://www.thenewsletterplugin.com/support-form" target="_blank">support page</a>
120
+ <li>Write directly to us at info@thenewsletterplugin.com</li>
121
  </ul>
122
 
123
  <h3>Documentation</h3>
124
  <p>
125
+ Below are the pages on www.thenewsletterplugin.com which document Newsletter. Since the site evolves, more pages can be available and
126
  the full list is always up-to-date on main Newsletter page.
127
  </p>
128
 
129
  <ul>
130
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter" target="_blank">Official Newsletter page</a></li>
131
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration" target="_blank">Main configuration</a></li>
132
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-diagnostic" target="_blank">Diagnostic</a></li>
133
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-faq" target="_blank">FAQ</a></li>
134
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">Delivery Engine</a></li>
135
 
136
 
137
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module" target="_blank">Subscription Module</a></li>
138
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-forms" target="_blank">Subscription Forms</a></li>
139
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">Subscriber's preferences</a></li>
140
 
141
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletters-module" target="_blank">Newsletters Module</a></li>
142
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-themes" target="_blank">Themes</a></li>
143
 
144
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module" target="_blank">Subscribers Module</a></li>
145
+ <li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/statistics-module" target="_blank">Statistics Module</a></li>
146
 
147
+ <li><a href="http://www.thenewsletterplugin.com/feed-by-mail-extension?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-feed" target="_blank">Feed by Mail Module</a></li>
148
+ <!--<li><a href="http://www.thenewsletterplugin.com/plugins/newsletter/follow-up-module" target="_blank">Follow Up Module</a></li>
149
  -->
150
  </ul>
151
 
main/main.php CHANGED
@@ -24,12 +24,12 @@ if (!$controls->is_action()) {
24
  // Validation
25
  $controls->data['sender_email'] = $newsletter->normalize_email($controls->data['sender_email']);
26
  if (!$newsletter->is_email($controls->data['sender_email'])) {
27
- $controls->errors .= 'The sender email address is not correct.<br />';
28
  }
29
 
30
  $controls->data['return_path'] = $newsletter->normalize_email($controls->data['return_path']);
31
  if (!$newsletter->is_email($controls->data['return_path'], true)) {
32
- $controls->errors .= 'Return path email is not correct.<br />';
33
  }
34
 
35
  $controls->data['php_time_limit'] = (int) $controls->data['php_time_limit'];
@@ -43,11 +43,12 @@ if (!$controls->is_action()) {
43
 
44
  $controls->data['reply_to'] = $newsletter->normalize_email($controls->data['reply_to']);
45
  if (!$newsletter->is_email($controls->data['reply_to'], true)) {
46
- $controls->errors .= 'Reply to email is not correct.<br />';
47
  }
48
 
49
  if (empty($controls->errors)) {
50
  update_option('newsletter_main', $controls->data);
 
51
  }
52
  }
53
 
@@ -107,53 +108,38 @@ if (!$controls->is_action()) {
107
 
108
  <div class="wrap">
109
 
110
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/newsletter-configuration'; ?>
111
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
112
 
113
- <div id="newsletter-title">
114
- <h2>Newsletter Main Configuration</h2>
115
- <div class="newsletter-preamble">
116
- <p>
117
- The general Newsletter configuration: sender name and email, delivery speed, SMTP and others.
118
- </p>
119
- </div>
120
- </div>
121
 
122
  <div class="newsletter-separator"></div>
123
  <?php $controls->show(); ?>
124
 
125
- <!--
126
- <div class="preamble">
127
- <p>
128
- Do not be scared by all those configurations. Only <strong>basic settings</strong> are important and should be reviewed to
129
- make Newsletter plugin work correctly. If something doesn't work, run a test from
130
- <a href="admin.php?page=newsletter_main_diagnostic">diagnostic panel</a>.
131
- </p>
132
- </div>
133
- -->
134
-
135
  <form method="post" action="">
136
  <?php $controls->init(); ?>
137
 
138
  <div id="tabs">
139
 
140
  <ul>
141
- <li><a href="#tabs-basic">Basic settings</a></li>
142
- <li><a href="#tabs-speed">Delivery speed</a></li>
143
- <li><a href="#tabs-2">Advanced settings</a></li>
 
144
  <li><a href="#tabs-5">SMTP</a></li>
145
- <li><a href="#tabs-3">Content locking</a></li>
146
  </ul>
147
 
148
  <div id="tabs-basic">
149
 
150
- <div class="tab-preamble">
151
- <p>
152
- <strong>Important!</strong>
153
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-configuration" target="_blank">Read the configuration page</a>
154
- to know every details about these settings.
155
- </p>
156
- </div>
157
 
158
  <table class="form-table">
159
 
@@ -162,12 +148,12 @@ if (!$controls->is_action()) {
162
  <td>
163
  <?php $controls->text_email('sender_email', 40); ?> (valid email address)
164
 
165
- <div class="hints">
166
  This the email address from which subscribers will se your email coming. Since this setting can
167
  affect the reliability of delivery,
168
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-configuration#sender" target="_blank">read my notes here</a> (important).
169
  Generally use an address within your domain name.
170
- </div>
171
  </td>
172
  </tr>
173
  <tr>
@@ -175,10 +161,10 @@ if (!$controls->is_action()) {
175
  <td>
176
  <?php $controls->text('sender_name', 40); ?> (optional)
177
 
178
- <div class="hints">
179
  Insert here the name which subscribers will see as the sender of your email (for example your blog name). Since this setting can affect the reliability of delivery (usually under Windows)
180
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-configuration#sender" target="_blank">read my notes here</a>.
181
- </div>
182
  </td>
183
  </tr>
184
 
@@ -186,11 +172,11 @@ if (!$controls->is_action()) {
186
  <th>Return path</th>
187
  <td>
188
  <?php $controls->text_email('return_path', 40); ?> (valid email address, default empty)
189
- <div class="hints">
190
  Email address where delivery error messages are sent by mailing systems (eg. mailbox full, invalid address, ...).<br>
191
  Some providers do not accept this field: they can block emails or force it to a different value affecting the delivery reliability.
192
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-configuration#return-path" target="_blank">Read my notes here</a> (important).
193
- </div>
194
  </td>
195
  </tr>
196
  <tr valign="top">
@@ -201,52 +187,197 @@ if (!$controls->is_action()) {
201
  This is the email address where subscribers will reply (eg. if they want to reply to a newsletter). Leave it blank if
202
  you don't want to specify a different address from the sender email above. Since this setting can
203
  affect the reliability of delivery,
204
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-configuration#reply-to" target="_blank">read my notes here</a> (important).
205
  </p>
206
  </td>
207
  </tr>
208
-
209
  <tr valign="top">
210
  <th>License key</th>
211
  <td>
212
  <?php $controls->text('contract_key', 40); ?>
213
  <p class="description">
214
- This key is used by <a href="http://www.satollo.net/plugins/newsletter" target="_blank">extensions</a> to
215
  self update. It does not unlock hidden features or like!
216
  <?php if (defined('NEWSLETTER_LICENSE_KEY')) { ?>
217
- <br>A global license key is actually defined, this value will be ignored.
218
  <?php } ?>
219
  </p>
220
  </td>
221
  </tr>
222
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  </table>
 
224
  </div>
225
 
226
  <div id="tabs-speed">
227
- <div class="tab-preamble">
228
- <p>
229
- You can set the speed of the email delivery as <strong>emails per hour</strong>. The delivery engine
230
- runs every <strong>5 minutes</strong> and sends a limited number of email to keep the sending rate
231
- below the specified limit. For example if you set 120 emails per hour the delivery engine will
232
- send at most 10 emails per run.
233
- </p>
234
- <p>
235
- <strong>Important!</strong> Read the
236
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-delivery-engine" target="_blank">delivery engine page</a>
237
- to solve speed problems and find blog setup examples to make it work at the best.
238
- </p>
239
- </div>
240
  <table class="form-table">
241
  <tr>
242
  <th>Max emails per hour</th>
243
  <td>
244
  <?php $controls->text('scheduler_max', 5); ?>
245
- <div class="hints">
246
- Newsletter delivery engine respects this limit and it should be set to a value less than the maximum allowed by your provider
247
- (Hostgator: 500 per hour, Dreamhost: 100 per hour, Go Daddy: 1000 per day using their SMTP, Gmail: 500 per day).
248
- Read <a href="http://www.satollo.net/plugins/newsletter/newsletter-delivery-engine" target="_blank">more on delivery engine</a> (important).
249
- </div>
250
  </td>
251
  </tr>
252
  </table>
@@ -254,11 +385,9 @@ if (!$controls->is_action()) {
254
 
255
  <div id="tabs-2">
256
 
257
- <div class="tab-preamble">
258
- <p>
259
- Every setting is explained <a href="http://www.satollo.net/plugins/newsletter/newsletter-configuration#advanced" target="_blank">here</a>.
260
- </p>
261
- </div>
262
 
263
  <table class="form-table">
264
 
@@ -273,10 +402,10 @@ if (!$controls->is_action()) {
273
  <th>API key</th>
274
  <td>
275
  <?php $controls->text('api_key', 40); ?>
276
- <div class="hints">
277
  When non-empty can be used to directly call the API for external integration. See API documentation on
278
  documentation panel.
279
- </div>
280
  </td>
281
  </tr>
282
 
@@ -284,31 +413,31 @@ if (!$controls->is_action()) {
284
  <th>Custom CSS</th>
285
  <td>
286
  <?php $controls->textarea('css'); ?>
287
- <div class="hints">
288
  Add here your own css to style the forms. The whole form is enclosed in a div with class
289
  "newsletter" and it's made with a table (guys, I know about your table less design
290
  mission, don't blame me too much!)
291
- </div>
292
  </td>
293
  </tr>
294
  <tr valign="top">
295
  <th>Email body content encoding</th>
296
  <td>
297
  <?php $controls->select('content_transfer_encoding', array('' => 'Default', '8bit' => '8 bit', 'base64' => 'Base 64')); ?>
298
- <div class="hints">
299
  Sometimes setting it to Base 64 solves problem with old mail servers (for example truncated or unformatted emails.
300
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-configuration#enconding" target="_blank">Read more here</a>.
301
- </div>
302
  </td>
303
  </tr>
304
  <tr valign="top">
305
  <th>PHP max execution time</th>
306
  <td>
307
- <?php $controls->text('php_time_limit', 10); ?>
308
- (before write in something, <a href="http://www.satollo.net/plugins/newsletter/newsletter-configuration#advanced" target="_blank">read here</a>)
309
- <div class="hints">
310
- Sets the PHP max execution time in seconds, overriding the default of your server.
311
- </div>
312
  </td>
313
  </tr>
314
  </table>
@@ -317,22 +446,20 @@ if (!$controls->is_action()) {
317
 
318
 
319
  <div id="tabs-5">
320
- <div class="tab-preamble">
321
- <p>
322
- <strong>These options can be overridden by modules which integrates with external
323
- SMTPs (like MailJet, SendGrid, ...) if installed and activated.</strong>
324
- </p>
325
- <p>
326
-
327
- What you need to know to use and external SMTP can be found
328
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-configuration#smtp" target="_blank">here</a>.
329
- <br>
330
- On GoDaddy you should follow this <a href="http://www.satollo.net/godaddy-using-smtp-external-server-on-shared-hosting" target="_blank">special setup</a>.
331
- </p>
332
- <p>
333
- Consider <a href="http://www.satollo.net/affiliate/sendgrid" target="_blank">SendGrid</a> for a serious and reliable SMTP service.
334
- </p>
335
- </div>
336
 
337
  <table class="form-table">
338
  <tr>
@@ -345,10 +472,10 @@ if (!$controls->is_action()) {
345
  host: <?php $controls->text('smtp_host', 30); ?>
346
  port: <?php $controls->text('smtp_port', 6); ?>
347
  <?php $controls->select('smtp_secure', array('' => 'No secure protocol', 'tls' => 'TLS protocol', 'ssl' => 'SSL protocol')); ?>
348
- <div class="hints">
349
  Leave port empty for default value (25). To use Gmail try host "smtp.gmail.com" and port "465" and SSL protocol (without quotes).
350
  For GoDaddy use "relay-hosting.secureserver.net".
351
- </div>
352
  </td>
353
  </tr>
354
  <tr>
@@ -356,9 +483,9 @@ if (!$controls->is_action()) {
356
  <td>
357
  user: <?php $controls->text('smtp_user', 30); ?>
358
  password: <?php $controls->text('smtp_pass', 30); ?>
359
- <div class="hints">
360
  If authentication is not required, leave "user" field blank.
361
- </div>
362
  </td>
363
  </tr>
364
  <tr>
@@ -366,10 +493,10 @@ if (!$controls->is_action()) {
366
  <td>
367
  <?php $controls->text_email('smtp_test_email', 30); ?>
368
  <?php $controls->button('smtp_test', 'Send a test email to this address'); ?>
369
- <div class="hints">
370
  If the test reports a "connection failed", review your settings and, if correct, contact
371
  your provider to unlock the connection (if possible).
372
- </div>
373
  </td>
374
  </tr>
375
  </table>
@@ -379,21 +506,18 @@ if (!$controls->is_action()) {
379
 
380
 
381
  <div id="tabs-3">
382
- <!-- Content locking -->
383
- <div class="tab-preamble">
384
- <p>
385
- Please, <a href="http://www.satollo.net/plugins/newsletter/newsletter-locked-content" target="_blank">read more here how to use and configure</a>,
386
- since it can incredibly increase your subscription rate.
387
- </p>
388
- </div>
389
  <table class="form-table">
390
  <tr valign="top">
391
  <th>Tags or categories to lock</th>
392
  <td>
393
  <?php $controls->text('lock_ids', 70); ?>
394
- <div class="hints">
395
  Use tag or category slug or id, comma separated.
396
- </div>
397
  </td>
398
  </tr>
399
 
@@ -401,10 +525,10 @@ if (!$controls->is_action()) {
401
  <th>Unlock destination URL</th>
402
  <td>
403
  <?php $controls->text('lock_url', 70); ?>
404
- <div class="hints">
405
  This is a web address (URL) where users are redirect when they click on unlocking URL ({unlock_url})
406
  inserted in newsletters and welcome message.
407
- </div>
408
  </td>
409
  </tr>
410
  <tr valign="top">
@@ -412,13 +536,13 @@ if (!$controls->is_action()) {
412
  <td>
413
  <?php wp_editor($controls->data['lock_message'], 'lock_message', array('textarea_name' => 'options[lock_message]')); ?>
414
 
415
- <div class="hints">
416
  This message is shown in place of protected post or page content which is surrounded with
417
  [newsletter_lock] and [/newsletter_lock] short codes or in place of the full content if they are
418
  in categories or have tags as specified above.<br />
419
  You can use the {subscription_form} tag to display the subscription form.<br>
420
  <strong>Remeber to add the {unlock_url} on the welcome email so the user can unlock the content.</strong>
421
- </div>
422
  </td>
423
  </tr>
424
  </table>
@@ -428,7 +552,7 @@ if (!$controls->is_action()) {
428
 
429
  </div> <!-- tabs -->
430
 
431
- <p class="submit">
432
  <?php $controls->button('save', 'Save'); ?>
433
  <?php $controls->button_confirm('remove', 'Totally remove this plugin', 'Really sure to totally remove this plugin. All data will be lost!'); ?>
434
  </p>
24
  // Validation
25
  $controls->data['sender_email'] = $newsletter->normalize_email($controls->data['sender_email']);
26
  if (!$newsletter->is_email($controls->data['sender_email'])) {
27
+ $controls->errors .= 'The sender email address is not correct.<br>';
28
  }
29
 
30
  $controls->data['return_path'] = $newsletter->normalize_email($controls->data['return_path']);
31
  if (!$newsletter->is_email($controls->data['return_path'], true)) {
32
+ $controls->errors .= 'Return path email is not correct.<br>';
33
  }
34
 
35
  $controls->data['php_time_limit'] = (int) $controls->data['php_time_limit'];
43
 
44
  $controls->data['reply_to'] = $newsletter->normalize_email($controls->data['reply_to']);
45
  if (!$newsletter->is_email($controls->data['reply_to'], true)) {
46
+ $controls->errors .= 'Reply to email is not correct.<br>';
47
  }
48
 
49
  if (empty($controls->errors)) {
50
  update_option('newsletter_main', $controls->data);
51
+ $controls->messages .= 'Saved.';
52
  }
53
  }
54
 
108
 
109
  <div class="wrap">
110
 
111
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration'; ?>
112
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
113
 
114
+
115
+ <h2>Newsletter Main Configuration</h2>
116
+
 
 
 
 
 
117
 
118
  <div class="newsletter-separator"></div>
119
  <?php $controls->show(); ?>
120
 
 
 
 
 
 
 
 
 
 
 
121
  <form method="post" action="">
122
  <?php $controls->init(); ?>
123
 
124
  <div id="tabs">
125
 
126
  <ul>
127
+ <li><a href="#tabs-basic">Basic Settings</a></li>
128
+ <li><a href="#tabs-user">Blog Info</a></li>
129
+ <li><a href="#tabs-speed">Delivery Speed</a></li>
130
+ <li><a href="#tabs-2">Advanced Settings</a></li>
131
  <li><a href="#tabs-5">SMTP</a></li>
132
+ <li><a href="#tabs-3">Content Locking</a></li>
133
  </ul>
134
 
135
  <div id="tabs-basic">
136
 
137
+ <p>
138
+ <strong>Important!</strong>
139
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration" target="_blank">Read the configuration page</a>
140
+ to know every details about these settings.
141
+ </p>
142
+
 
143
 
144
  <table class="form-table">
145
 
148
  <td>
149
  <?php $controls->text_email('sender_email', 40); ?> (valid email address)
150
 
151
+ <p class="description">
152
  This the email address from which subscribers will se your email coming. Since this setting can
153
  affect the reliability of delivery,
154
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration#sender" target="_blank">read my notes here</a> (important).
155
  Generally use an address within your domain name.
156
+ </p>
157
  </td>
158
  </tr>
159
  <tr>
161
  <td>
162
  <?php $controls->text('sender_name', 40); ?> (optional)
163
 
164
+ <p class="description">
165
  Insert here the name which subscribers will see as the sender of your email (for example your blog name). Since this setting can affect the reliability of delivery (usually under Windows)
166
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration#sender" target="_blank">read my notes here</a>.
167
+ </p>
168
  </td>
169
  </tr>
170
 
172
  <th>Return path</th>
173
  <td>
174
  <?php $controls->text_email('return_path', 40); ?> (valid email address, default empty)
175
+ <p class="description">
176
  Email address where delivery error messages are sent by mailing systems (eg. mailbox full, invalid address, ...).<br>
177
  Some providers do not accept this field: they can block emails or force it to a different value affecting the delivery reliability.
178
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration#return-path" target="_blank">Read my notes here</a> (important).
179
+ </p>
180
  </td>
181
  </tr>
182
  <tr valign="top">
187
  This is the email address where subscribers will reply (eg. if they want to reply to a newsletter). Leave it blank if
188
  you don't want to specify a different address from the sender email above. Since this setting can
189
  affect the reliability of delivery,
190
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration#reply-to" target="_blank">read my notes here</a> (important).
191
  </p>
192
  </td>
193
  </tr>
194
+
195
  <tr valign="top">
196
  <th>License key</th>
197
  <td>
198
  <?php $controls->text('contract_key', 40); ?>
199
  <p class="description">
200
+ This key is used by <a href="http://www.thenewsletterplugin.com/plugins/newsletter" target="_blank">extensions</a> to
201
  self update. It does not unlock hidden features or like!
202
  <?php if (defined('NEWSLETTER_LICENSE_KEY')) { ?>
203
+ <br>A global license key is actually defined, this value will be ignored.
204
  <?php } ?>
205
  </p>
206
  </td>
207
  </tr>
208
+
209
+ </table>
210
+ </div>
211
+
212
+ <div id="tabs-user">
213
+
214
+ <p>
215
+ These informations are used by Newsletter themes to automatically generate some sections of regular newsletters,
216
+ <a href="http://www.thenewsletterplugin.com/feed-by-mail-extension?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-feed" target="_blank">
217
+ auto messages
218
+ </a> and
219
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/follow-up-module?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-followup" target="_blank">
220
+ follow-up mails
221
+ </a>.
222
+ Themes may not use all these fields and/or have specific alternate configurations. All fields are <strong>optional</strong>.
223
+ </p>
224
+
225
+ <h3>Header Settings</h3>
226
+
227
+ <table class="form-table">
228
+ <tr valign="top">
229
+ <th>
230
+ Header logo
231
+ <div class="tnp-tip">
232
+ <span class="tip-button">Tip</span>
233
+ <span class="tip-content">
234
+ Keep the file lightweight and ideally smaller than 500px in width and 200px in height.
235
+ Remember that .png images provide best performances with text and shapes logos.
236
+ </span>
237
+ </div>
238
+ </th>
239
+ <td>
240
+ <?php $controls->media('header_logo'); ?>
241
+ <p class="description">
242
+ Click to change. This should be your logo in .png or .jpg format.
243
+ </p>
244
+ </td>
245
+ </tr>
246
+ <tr>
247
+ <th>Header title</th>
248
+ <td>
249
+ <?php $controls->text('header_title', 40); ?>
250
+ <p class="description">Appears only when no logo has been uploaded or when it's blocked by email clients.</p>
251
+ </td>
252
+ </tr>
253
+ <tr>
254
+ <th>Header subheading</th>
255
+ <td>
256
+ <?php $controls->text('header_sub', 40); ?>
257
+ <p class="description">Appears only if present.</p>
258
+ </td>
259
+ </tr>
260
+ </table>
261
+
262
+ <h3>Social Settings</h3>
263
+
264
+ <p>Social icons will be added automatically to your newsletter only for set URLs.</p>
265
+
266
+ <table class="form-table">
267
+ <tr valign="top">
268
+ <th>Facebook</th>
269
+ <td>
270
+ <?php $controls->text('facebook_url', 40); ?>
271
+ <p class="description">
272
+ Your Facebook url (e.g. https://www.facebook.com/thenewsletterplugin)
273
+ </p>
274
+ </td>
275
+ </tr>
276
+ <tr valign="top">
277
+ <th>Google+</th>
278
+ <td>
279
+ <?php $controls->text('googleplus_url', 40); ?>
280
+ <p class="description">
281
+ Your Google+ url (e.g. https://plus.google.com/...)
282
+ </p>
283
+ </td>
284
+ </tr>
285
+ <tr valign="top">
286
+ <th>Twitter</th>
287
+ <td>
288
+ <?php $controls->text('twitter_url', 40); ?>
289
+ <p class="description">
290
+ Your Twitter url (e.g. https://twitter.com/...)
291
+ </p>
292
+ </td>
293
+ </tr>
294
+ <tr valign="top">
295
+ <th>Linkedin</th>
296
+ <td>
297
+ <?php $controls->text('linkedin_url', 40); ?>
298
+ <p class="description">
299
+ Your Linkedin url (e.g. https://www.linkedin.com/in/...)
300
+ </p>
301
+ </td>
302
+ </tr>
303
+ <tr valign="top">
304
+ <th>YouTube</th>
305
+ <td>
306
+ <?php $controls->text('youtube_url', 40); ?>
307
+ <p class="description">
308
+ Your YouTube url (e.g. https://www.youtube.com/channel/...)
309
+ </p>
310
+ </td>
311
+ </tr>
312
+ <tr valign="top">
313
+ <th>Vimeo</th>
314
+ <td>
315
+ <?php $controls->text('vimeo_url', 40); ?>
316
+ <p class="description">
317
+ Your Vimeo url (e.g. http://vimeo.com/...)
318
+ </p>
319
+ </td>
320
+ </tr>
321
+ </table>
322
+
323
+ <h3>Footer Settings</h3>
324
+
325
+ <table class="form-table">
326
+ <tr valign="top">
327
+ <th>Blog or company name</th>
328
+ <td>
329
+ <?php $controls->text('footer_title', 40); ?>
330
+ <p class="description">
331
+ User or corporation name to be displayed on the newsletter footer.
332
+ </p>
333
+ </td>
334
+ </tr>
335
+ <tr valign="top">
336
+ <th>Address</th>
337
+ <td>
338
+ <?php $controls->text('footer_contact', 40); ?>
339
+ <p class="description">
340
+ Your real address, if available. The CAN-SPAM Act requires it.
341
+ </p>
342
+ </td>
343
+ </tr>
344
+ <tr>
345
+ <th>Copyright, privacy or legal text</th>
346
+ <td>
347
+ <?php $controls->text('footer_legal', 40); ?>
348
+ <p class="description">
349
+ Any copyright, privacy or legal text you want on the newsletter footer.
350
+ </p>
351
+ </td>
352
+ </tr>
353
  </table>
354
+
355
  </div>
356
 
357
  <div id="tabs-speed">
358
+
359
+ <p>
360
+ You can set the speed of the email delivery as <strong>emails per hour</strong>. The delivery engine
361
+ runs every <strong>5 minutes</strong> and sends a limited number of email to keep the sending rate
362
+ below the specified limit. For example if you set 120 emails per hour the delivery engine will
363
+ send at most 10 emails per run.
364
+ </p>
365
+ <p>
366
+ <strong>Important!</strong> Read the
367
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">delivery engine page</a>
368
+ to solve speed problems and find blog setup examples to make it work at the best.
369
+ </p>
370
+
371
  <table class="form-table">
372
  <tr>
373
  <th>Max emails per hour</th>
374
  <td>
375
  <?php $controls->text('scheduler_max', 5); ?>
376
+ <p class="description">
377
+ The Newsletter delivery engine respects this limit and it should be set to a value less than the maximum allowed by your provider
378
+ (Hostgator: 500 per hour, Dreamhost: 100 per hour, Go Daddy: 1000 per <strong>day</strong> using their SMTP, Gmail: 500 per day).
379
+ Read <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">more on delivery engine</a> (important).
380
+ </p>
381
  </td>
382
  </tr>
383
  </table>
385
 
386
  <div id="tabs-2">
387
 
388
+ <p>
389
+ Every setting is explained <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration#advanced" target="_blank">here</a>.
390
+ </p>
 
 
391
 
392
  <table class="form-table">
393
 
402
  <th>API key</th>
403
  <td>
404
  <?php $controls->text('api_key', 40); ?>
405
+ <p class="description">
406
  When non-empty can be used to directly call the API for external integration. See API documentation on
407
  documentation panel.
408
+ </p>
409
  </td>
410
  </tr>
411
 
413
  <th>Custom CSS</th>
414
  <td>
415
  <?php $controls->textarea('css'); ?>
416
+ <p class="description">
417
  Add here your own css to style the forms. The whole form is enclosed in a div with class
418
  "newsletter" and it's made with a table (guys, I know about your table less design
419
  mission, don't blame me too much!)
420
+ </p>
421
  </td>
422
  </tr>
423
  <tr valign="top">
424
  <th>Email body content encoding</th>
425
  <td>
426
  <?php $controls->select('content_transfer_encoding', array('' => 'Default', '8bit' => '8 bit', 'base64' => 'Base 64')); ?>
427
+ <p class="description">
428
  Sometimes setting it to Base 64 solves problem with old mail servers (for example truncated or unformatted emails.
429
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration#enconding" target="_blank">Read more here</a>.
430
+ </p>
431
  </td>
432
  </tr>
433
  <tr valign="top">
434
  <th>PHP max execution time</th>
435
  <td>
436
+ <?php $controls->text('php_time_limit', 10); ?>
437
+ (before write in something, <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration#advanced" target="_blank">read here</a>)
438
+ <p class="description">
439
+ Sets the PHP max execution time in seconds, overriding the default of your server.
440
+ </p>
441
  </td>
442
  </tr>
443
  </table>
446
 
447
 
448
  <div id="tabs-5">
449
+ <p>
450
+ <strong>These options can be overridden by modules which integrates with external
451
+ SMTPs (like MailJet, SendGrid, ...) if installed and activated.</strong>
452
+ </p>
453
+ <p>
454
+
455
+ What you need to know to use and external SMTP can be found
456
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-configuration#smtp" target="_blank">here</a>.
457
+ <br>
458
+ On GoDaddy you should follow this <a href="http://www.thenewsletterplugin.com/godaddy-using-smtp-external-server-shared-hosting" target="_blank">special setup</a>.
459
+ </p>
460
+ <p>
461
+ Consider <a href="http://www.thenewsletterplugin.com/affiliate/sendgrid" target="_blank">SendGrid</a> for a serious and reliable SMTP service.
462
+ </p>
 
 
463
 
464
  <table class="form-table">
465
  <tr>
472
  host: <?php $controls->text('smtp_host', 30); ?>
473
  port: <?php $controls->text('smtp_port', 6); ?>
474
  <?php $controls->select('smtp_secure', array('' => 'No secure protocol', 'tls' => 'TLS protocol', 'ssl' => 'SSL protocol')); ?>
475
+ <p class="description">
476
  Leave port empty for default value (25). To use Gmail try host "smtp.gmail.com" and port "465" and SSL protocol (without quotes).
477
  For GoDaddy use "relay-hosting.secureserver.net".
478
+ </p>
479
  </td>
480
  </tr>
481
  <tr>
483
  <td>
484
  user: <?php $controls->text('smtp_user', 30); ?>
485
  password: <?php $controls->text('smtp_pass', 30); ?>
486
+ <p class="description">
487
  If authentication is not required, leave "user" field blank.
488
+ </p>
489
  </td>
490
  </tr>
491
  <tr>
493
  <td>
494
  <?php $controls->text_email('smtp_test_email', 30); ?>
495
  <?php $controls->button('smtp_test', 'Send a test email to this address'); ?>
496
+ <p class="description">
497
  If the test reports a "connection failed", review your settings and, if correct, contact
498
  your provider to unlock the connection (if possible).
499
+ </p>
500
  </td>
501
  </tr>
502
  </table>
506
 
507
 
508
  <div id="tabs-3">
509
+ <p>
510
+ Please, <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-locked-content" target="_blank">read more here how to use and configure</a>,
511
+ since it can incredibly increase your subscription rate.
512
+ </p>
 
 
 
513
  <table class="form-table">
514
  <tr valign="top">
515
  <th>Tags or categories to lock</th>
516
  <td>
517
  <?php $controls->text('lock_ids', 70); ?>
518
+ <p class="description">
519
  Use tag or category slug or id, comma separated.
520
+ </p>
521
  </td>
522
  </tr>
523
 
525
  <th>Unlock destination URL</th>
526
  <td>
527
  <?php $controls->text('lock_url', 70); ?>
528
+ <p class="description">
529
  This is a web address (URL) where users are redirect when they click on unlocking URL ({unlock_url})
530
  inserted in newsletters and welcome message.
531
+ </p>
532
  </td>
533
  </tr>
534
  <tr valign="top">
536
  <td>
537
  <?php wp_editor($controls->data['lock_message'], 'lock_message', array('textarea_name' => 'options[lock_message]')); ?>
538
 
539
+ <p class="description">
540
  This message is shown in place of protected post or page content which is surrounded with
541
  [newsletter_lock] and [/newsletter_lock] short codes or in place of the full content if they are
542
  in categories or have tags as specified above.<br />
543
  You can use the {subscription_form} tag to display the subscription form.<br>
544
  <strong>Remeber to add the {unlock_url} on the welcome email so the user can unlock the content.</strong>
545
+ </p>
546
  </td>
547
  </tr>
548
  </table>
552
 
553
  </div> <!-- tabs -->
554
 
555
+ <p>
556
  <?php $controls->button('save', 'Save'); ?>
557
  <?php $controls->button_confirm('remove', 'Totally remove this plugin', 'Really sure to totally remove this plugin. All data will be lost!'); ?>
558
  </p>
plugin.php CHANGED
@@ -2,18 +2,18 @@
2
 
3
  /*
4
  Plugin Name: Newsletter
5
- Plugin URI: http://www.satollo.net/plugins/newsletter
6
- Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.satollo.net/plugins/newsletter#update">this page</a> to know what's changed.</strong>
7
- Version: 3.6.3
8
  Author: Stefano Lissa
9
- Author URI: http://www.satollo.net
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
11
 
12
- Copyright 2009-2014 Stefano Lissa (email: stefano@satollo.net, web: http://www.satollo.net)
13
  */
14
 
15
  // Used as dummy parameter on css and js links
16
- define('NEWSLETTER_VERSION', '3.6.3');
17
 
18
  global $wpdb, $newsletter;
19
 
@@ -64,6 +64,9 @@ if (!defined('NEWSLETTER_CRON_INTERVAL'))
64
  if (!defined('NEWSLETTER_HEADER'))
65
  define('NEWSLETTER_HEADER', true);
66
 
 
 
 
67
  // Force the whole system log level to this value
68
  //define('NEWSLETTER_LOG_LEVEL', 4);
69
 
@@ -98,6 +101,8 @@ class Newsletter extends NewsletterModule {
98
  var $lock_found = false;
99
  static $instance;
100
 
 
 
101
  /**
102
  * @return Newsletter
103
  */
@@ -125,14 +130,24 @@ class Newsletter extends NewsletterModule {
125
 
126
  add_action('init', array($this, 'hook_init'));
127
  add_action('newsletter', array($this, 'hook_newsletter'), 1);
128
- add_action('newsletter_check_versions', array($this, 'hook_check_versions'), 99);
129
-
130
 
131
  // This specific event is created by "Feed by mail" panel on configuration
132
  add_action('shutdown', array($this, 'hook_shutdown'));
133
 
134
- if (defined('DOING_CRON') && DOING_CRON)
 
 
 
 
 
 
 
 
 
135
  return;
 
 
136
 
137
  // TODO: Meditation on how to use those ones...
138
  register_activation_hook(__FILE__, array($this, 'hook_activate'));
@@ -144,7 +159,7 @@ class Newsletter extends NewsletterModule {
144
 
145
  add_shortcode('newsletter_lock', array($this, 'shortcode_newsletter_lock'));
146
  add_filter('the_content', array($this, 'hook_the_content'), 99);
147
- add_shortcode('newsletter_profile', array($this, 'shortcode_newsletter_profile'));
148
 
149
  if (is_admin()) {
150
  add_action('admin_head', array($this, 'hook_admin_head'));
@@ -229,9 +244,13 @@ class Newsletter extends NewsletterModule {
229
  wp_clear_scheduled_hook('newsletter');
230
  wp_schedule_event(time() + 30, 'newsletter', 'newsletter');
231
 
 
 
 
 
 
232
  wp_clear_scheduled_hook('newsletter_update');
233
  wp_clear_scheduled_hook('newsletter_check_versions');
234
- wp_schedule_event(time() + 30, 'newsletter_weekly', 'newsletter_check_versions');
235
 
236
  wp_mkdir_p(WP_CONTENT_DIR . '/extensions/newsletter');
237
  wp_mkdir_p(WP_CONTENT_DIR . '/cache/newsletter');
@@ -242,13 +261,12 @@ class Newsletter extends NewsletterModule {
242
  wp_clear_scheduled_hook('newsletter_feed_version_check');
243
  wp_clear_scheduled_hook('newsletter_popup_version_check');
244
 
245
-
246
  return true;
247
  }
248
 
249
  function admin_menu() {
250
  // This adds the main menu page
251
- add_menu_page('Newsletter', 'Newsletter', ($this->options['editor'] == 1) ? 'manage_categories' : 'manage_options', 'newsletter_main_index');
252
 
253
  $this->add_menu_page('index', 'Welcome');
254
  $this->add_menu_page('main', 'Configuration');
@@ -265,13 +283,13 @@ class Newsletter extends NewsletterModule {
265
  if ($x === false) {
266
  $warnings .= 'The delivery engine is off (it should never be off). Deactivate and reactivate the plugin. Thank you.<br>';
267
  } else if (time() - $x > 900) {
268
- $warnings .= 'The cron system seems not running correctly. See <a href="http://www.satollo.net/how-to-make-the-wordpress-cron-work" target="_blank">this page</a> for more information.<br>';
269
  }
270
 
271
  if (!empty($warnings)) {
272
- echo '<div id="#newsletter-warnings">';
273
  echo $warnings;
274
- echo '</div>';
275
  }
276
  }
277
 
@@ -284,6 +302,7 @@ class Newsletter extends NewsletterModule {
284
  wp_enqueue_script('media-upload');
285
  wp_enqueue_script('thickbox');
286
  wp_enqueue_style('thickbox');
 
287
  }
288
  }
289
 
@@ -352,27 +371,6 @@ class Newsletter extends NewsletterModule {
352
  return NewsletterStatistics::instance()->relink($text, $email_id, $user_id);
353
  }
354
 
355
- function hook_check_versions() {
356
- //$this->logger->info('Checking for new versions');
357
- $url = 'http://www.satollo.net/wp-content/plugins/file-commerce-pro/version.php?f=';
358
- $modules = array(
359
- 'reports' => 34,
360
- 'feed' => 35,
361
- 'followup' => 37,
362
- 'facebook' => 41,
363
- 'sendgrid' => 40,
364
- 'popup' => 43,
365
- 'mandrill' => 44,
366
- 'mailjet' => 38);
367
-
368
- foreach ($modules as $name => $id) {
369
- $version = @file_get_contents($url . $id);
370
- if ($version) {
371
- update_option('newsletter_' . $name . '_available_version', $version);
372
- }
373
- }
374
- }
375
-
376
  /**
377
  * Runs every 5 minutes and look for emails that need to be processed.
378
  */
@@ -447,7 +445,7 @@ class Newsletter extends NewsletterModule {
447
  $headers = array('List-Unsubscribe' => '<' . NEWSLETTER_UNSUBSCRIBE_URL . '?nk=' . $user->id . '-' . $user->token . '>');
448
  $headers['Precedence'] = 'bulk';
449
  $headers['X-Newsletter-Email-Id'] = $email->id;
450
-
451
 
452
  if (!$test) {
453
  $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set sent=sent+1, last_id=" . $user->id . " where id=" . $email->id . " limit 1");
@@ -887,8 +885,9 @@ class Newsletter extends NewsletterModule {
887
  $text = str_replace('{key}', $user->id . '-' . $user->token, $text);
888
  $text = str_replace('%7Bkey%7D', $user->id . '-' . $user->token, $text);
889
 
890
- if (strpos($text, '{profile_form}') !== false)
891
  $text = str_replace('{profile_form}', NewsletterSubscription::instance()->get_profile_form($user), $text);
 
892
 
893
  for ($i = 1; $i < NEWSLETTER_PROFILE_MAX; $i++) {
894
  $p = 'profile_' . $i;
@@ -963,7 +962,7 @@ class Newsletter extends NewsletterModule {
963
  }
964
 
965
  function replace_url($text, $tag, $url) {
966
- $home = get_option('home') . '/';
967
  $tag_lower = strtolower($tag);
968
  $text = str_replace($home . '{' . $tag_lower . '}', $url, $text);
969
  $text = str_replace($home . '%7B' . $tag_lower . '%7D', $url, $text);
@@ -1032,17 +1031,17 @@ class Newsletter extends NewsletterModule {
1032
  return '<div class="newsletter-lock">' . $buffer . '</div>';
1033
  }
1034
 
1035
- function shortcode_newsletter_profile($attrs, $content) {
1036
- global $wpdb, $current_user;
1037
-
1038
- $user = $this->check_user();
1039
-
1040
- if ($user == null) {
1041
- return 'No user found.';
1042
- }
1043
-
1044
- return $this->profile_form($user);
1045
- }
1046
 
1047
  /**
1048
  * Exceutes a query and log it.
@@ -1054,38 +1053,6 @@ class Newsletter extends NewsletterModule {
1054
  return $wpdb->query($query);
1055
  }
1056
 
1057
- function notify_admin($user, $subject) {
1058
- if ($this->options['notify'] != 1)
1059
- return;
1060
- $message = "Subscriber details:\n\n" .
1061
- "email: " . $user->email . "\n" .
1062
- "first name: " . $user->name . "\n" .
1063
- "last name: " . $user->surname . "\n" .
1064
- "gender: " . $user->sex . "\n";
1065
-
1066
- $options_profile = get_option('newsletter_profile');
1067
-
1068
- for ($i = 0; $i < NEWSLETTER_PROFILE_MAX; $i++) {
1069
- if ($options_profile['profile_' . $i] == '')
1070
- continue;
1071
- $field = 'profile_' . $i;
1072
- $message .= $options_profile['profile_' . $i] . ': ' . $user->$field . "\n";
1073
- }
1074
-
1075
- for ($i = 0; $i < NEWSLETTER_LIST_MAX; $i++) {
1076
- if ($options_profile['list_' . $i] == '')
1077
- continue;
1078
- $field = 'list_' . $i;
1079
- $message .= $options_profile['list_' . $i] . ': ' . $user->$field . "\n";
1080
- }
1081
-
1082
- $message .= "token: " . $user->token . "\n" .
1083
- "status: " . $user->status . "\n" .
1084
- "\nYours, Newsletter.";
1085
-
1086
- wp_mail(get_option('admin_email'), '[' . get_option('blogname') . '] ' . $subject, $message, "Content-type: text/plain; charset=UTF-8\n");
1087
- }
1088
-
1089
  function get_user_from_request($required = false) {
1090
  if (isset($_REQUEST['nk'])) {
1091
  list($id, $token) = @explode('-', $_REQUEST['nk'], 2);
@@ -1151,6 +1118,103 @@ class Newsletter extends NewsletterModule {
1151
  return $r;
1152
  }
1153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1154
  }
1155
 
1156
  $newsletter = Newsletter::instance();
2
 
3
  /*
4
  Plugin Name: Newsletter
5
+ Plugin URI: http://www.thenewsletterplugin.com/plugins/newsletter
6
+ Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.thenewsletterplugin.com/plugins/newsletter#update">this page</a> to know what's changed.</strong>
7
+ Version: 3.7.2
8
  Author: Stefano Lissa
9
+ Author URI: http://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
11
 
12
+ Copyright 2009-2015 The Newsletter Team (email: info@thenewsletterplugin.com, web: http://www.thenewsletterplugin.com)
13
  */
14
 
15
  // Used as dummy parameter on css and js links
16
+ define('NEWSLETTER_VERSION', '3.7.2');
17
 
18
  global $wpdb, $newsletter;
19
 
64
  if (!defined('NEWSLETTER_HEADER'))
65
  define('NEWSLETTER_HEADER', true);
66
 
67
+ if (!defined('NEWSLETTER_DEBUG'))
68
+ define('NEWSLETTER_DEBUG', false);
69
+
70
  // Force the whole system log level to this value
71
  //define('NEWSLETTER_LOG_LEVEL', 4);
72
 
101
  var $lock_found = false;
102
  static $instance;
103
 
104
+ const MAX_CRON_SAMPLES = 300;
105
+
106
  /**
107
  * @return Newsletter
108
  */
130
 
131
  add_action('init', array($this, 'hook_init'));
132
  add_action('newsletter', array($this, 'hook_newsletter'), 1);
133
+ add_action('newsletter_extension_versions', array($this, 'hook_newsletter_extension_versions'), 1);
 
134
 
135
  // This specific event is created by "Feed by mail" panel on configuration
136
  add_action('shutdown', array($this, 'hook_shutdown'));
137
 
138
+ if (defined('DOING_CRON') && DOING_CRON) {
139
+ $calls = get_option('newsletter_diagnostic_cron_calls', array());
140
+ if (empty($calls)) {
141
+ add_option('newsletter_diagnostic_cron_calls', $calls, null, 'no');
142
+ }
143
+ $calls[] = time();
144
+ if (count($calls) > self::MAX_CRON_SAMPLES) {
145
+ array_shift($calls);
146
+ }
147
+ update_option('newsletter_diagnostic_cron_calls', $calls);
148
  return;
149
+ }
150
+
151
 
152
  // TODO: Meditation on how to use those ones...
153
  register_activation_hook(__FILE__, array($this, 'hook_activate'));
159
 
160
  add_shortcode('newsletter_lock', array($this, 'shortcode_newsletter_lock'));
161
  add_filter('the_content', array($this, 'hook_the_content'), 99);
162
+ //add_shortcode('newsletter_profile', array($this, 'shortcode_newsletter_profile'));
163
 
164
  if (is_admin()) {
165
  add_action('admin_head', array($this, 'hook_admin_head'));
244
  wp_clear_scheduled_hook('newsletter');
245
  wp_schedule_event(time() + 30, 'newsletter', 'newsletter');
246
 
247
+ wp_clear_scheduled_hook('newsletter_extension_versions');
248
+ wp_schedule_event(time() + 30, 'newsletter_extension_versions', 'newsletter_weekly');
249
+
250
+ add_option('newsletter_extension_versions', array(), null, 'no');
251
+
252
  wp_clear_scheduled_hook('newsletter_update');
253
  wp_clear_scheduled_hook('newsletter_check_versions');
 
254
 
255
  wp_mkdir_p(WP_CONTENT_DIR . '/extensions/newsletter');
256
  wp_mkdir_p(WP_CONTENT_DIR . '/cache/newsletter');
261
  wp_clear_scheduled_hook('newsletter_feed_version_check');
262
  wp_clear_scheduled_hook('newsletter_popup_version_check');
263
 
 
264
  return true;
265
  }
266
 
267
  function admin_menu() {
268
  // This adds the main menu page
269
+ add_menu_page('Newsletter', 'Newsletter', ($this->options['editor'] == 1) ? 'manage_categories' : 'manage_options', 'newsletter_main_index', '', plugins_url('newsletter') . '/images/menu-icon.png');
270
 
271
  $this->add_menu_page('index', 'Welcome');
272
  $this->add_menu_page('main', 'Configuration');
283
  if ($x === false) {
284
  $warnings .= 'The delivery engine is off (it should never be off). Deactivate and reactivate the plugin. Thank you.<br>';
285
  } else if (time() - $x > 900) {
286
+ $warnings .= 'The cron system seems not running correctly. See <a href="http://www.thenewsletterplugin.com/how-to-make-the-wordpress-cron-work" target="_blank">this page</a> for more information.<br>';
287
  }
288
 
289
  if (!empty($warnings)) {
290
+ echo '<div class="error"><p>';
291
  echo $warnings;
292
+ echo '</p></div>';
293
  }
294
  }
295
 
302
  wp_enqueue_script('media-upload');
303
  wp_enqueue_script('thickbox');
304
  wp_enqueue_style('thickbox');
305
+ wp_enqueue_media();
306
  }
307
  }
308
 
371
  return NewsletterStatistics::instance()->relink($text, $email_id, $user_id);
372
  }
373
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
  /**
375
  * Runs every 5 minutes and look for emails that need to be processed.
376
  */
445
  $headers = array('List-Unsubscribe' => '<' . NEWSLETTER_UNSUBSCRIBE_URL . '?nk=' . $user->id . '-' . $user->token . '>');
446
  $headers['Precedence'] = 'bulk';
447
  $headers['X-Newsletter-Email-Id'] = $email->id;
448
+
449
 
450
  if (!$test) {
451
  $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set sent=sent+1, last_id=" . $user->id . " where id=" . $email->id . " limit 1");
885
  $text = str_replace('{key}', $user->id . '-' . $user->token, $text);
886
  $text = str_replace('%7Bkey%7D', $user->id . '-' . $user->token, $text);
887
 
888
+ if (strpos($text, '{profile_form}') !== false) {
889
  $text = str_replace('{profile_form}', NewsletterSubscription::instance()->get_profile_form($user), $text);
890
+ }
891
 
892
  for ($i = 1; $i < NEWSLETTER_PROFILE_MAX; $i++) {
893
  $p = 'profile_' . $i;
962
  }
963
 
964
  function replace_url($text, $tag, $url) {
965
+ $home = trailingslashit(home_url());
966
  $tag_lower = strtolower($tag);
967
  $text = str_replace($home . '{' . $tag_lower . '}', $url, $text);
968
  $text = str_replace($home . '%7B' . $tag_lower . '%7D', $url, $text);
1031
  return '<div class="newsletter-lock">' . $buffer . '</div>';
1032
  }
1033
 
1034
+ // function shortcode_newsletter_profile($attrs, $content) {
1035
+ // global $wpdb, $current_user;
1036
+ //
1037
+ // $user = $this->check_user();
1038
+ //
1039
+ // if ($user == null) {
1040
+ // return 'No user found.';
1041
+ // }
1042
+ //
1043
+ // return $this->profile_form($user);
1044
+ // }
1045
 
1046
  /**
1047
  * Exceutes a query and log it.
1053
  return $wpdb->query($query);
1054
  }
1055
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1056
  function get_user_from_request($required = false) {
1057
  if (isset($_REQUEST['nk'])) {
1058
  list($id, $token) = @explode('-', $_REQUEST['nk'], 2);
1118
  return $r;
1119
  }
1120
 
1121
+ /**
1122
+ * Called weekly if at least one extension is active.
1123
+ */
1124
+ function hook_newsletter_extension_versions($force = false) {
1125
+ if (!$force && !defined('NEWSLETTER_EXTENSION')) {
1126
+ return;
1127
+ }
1128
+ $response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/versions/all.txt');
1129
+ if (is_wp_error($response)) {
1130
+ $this->logger->error($response);
1131
+ return;
1132
+ }
1133
+
1134
+ $versions = json_decode(wp_remote_retrieve_body($response));
1135
+ update_option('newsletter_extension_versions', $versions);
1136
+ }
1137
+
1138
+ function get_extension_version($extension_id) {
1139
+ $versions = get_option('newsletter_extension_versions');
1140
+ if (!is_array($versions)) {
1141
+ return null;
1142
+ }
1143
+ foreach ($versions as $data) {
1144
+ if ($data->id == $extension_id) {
1145
+ return $data->version;
1146
+ }
1147
+ }
1148
+
1149
+ return null;
1150
+ }
1151
+
1152
+ /**
1153
+ * Completes the WordPress plugin update data with the extension data.
1154
+ * $value is the data WordPress is saving
1155
+ * $extension is an instance of an extension
1156
+ */
1157
+ function set_extension_update_data($value, $extension) {
1158
+
1159
+ // See the wp_update_plugins function
1160
+ if (!is_object($value)) {
1161
+ return $value;
1162
+ }
1163
+
1164
+ // If someone registered our extension name on wordpress.org... get rid of it otherwise
1165
+ // our extenions will be overwritten!
1166
+ unset($value->response[$extension->plugin]);
1167
+ unset($value->no_update[$extension->plugin]);
1168
+
1169
+ if (defined('NEWSLETTER_EXTENSION_UPDATE') && !NEWSLETTER_EXTENSION_UPDATE) {
1170
+ return $value;
1171
+ }
1172
+
1173
+ if (!function_exists('get_plugin_data')) {
1174
+ return $value;
1175
+ }
1176
+
1177
+ $new_version = $this->get_extension_version($extension->id);
1178
+
1179
+ if (empty($new_version)) {
1180
+ return $value;
1181
+ }
1182
+
1183
+ if (function_exists('get_plugin_data')) {
1184
+ if (file_exists(WP_PLUGIN_DIR . '/' . $extension->plugin)) {
1185
+ $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $extension->plugin, false, false);
1186
+ } else if (file_exists(WPMU_PLUGIN_DIR . '/' . $extension->plugin)) {
1187
+ $plugin_data = get_plugin_data(WPMU_PLUGIN_DIR . '/' . $extension->plugin, false, false);
1188
+ }
1189
+ }
1190
+
1191
+ if (!isset($plugin_data)) {
1192
+ return $value;
1193
+ }
1194
+
1195
+ if (version_compare($new_version, $plugin_data['Version']) <= 0) {
1196
+ return $value;
1197
+ }
1198
+
1199
+ $plugin = new stdClass();
1200
+ $plugin->id = $extension->id;
1201
+ $plugin->slug = $extension->slug;
1202
+ $plugin->plugin = $extension->plugin;
1203
+ $plugin->new_version = $new_version;
1204
+ $plugin->url = '';
1205
+ $value->response[$extension->plugin] = $plugin;
1206
+
1207
+ if (defined('NEWSLETTER_LICENSE_KEY')) {
1208
+ $value->response[$extension->plugin]->package = 'http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/get.php?f=' . $extension->id .
1209
+ '&k=' . NEWSLETTER_LICENSE_KEY;
1210
+ } else {
1211
+ $value->response[$extension->plugin]->package = 'http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/get.php?f=' . $extension->id .
1212
+ '&k=' . Newsletter::instance()->options['contract_key'];
1213
+ }
1214
+
1215
+ return $value;
1216
+ }
1217
+
1218
  }
1219
 
1220
  $newsletter = Newsletter::instance();
readme.txt CHANGED
@@ -1,15 +1,15 @@
1
  === Newsletter ===
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing
3
  Requires at least: 3.3.0
4
- Tested up to: 3.9.2
5
  Stable tag: trunk
6
- Donate link: http://www.satollo.net/donations
7
 
8
  Add a real newsletter to your blog. In seconds. For free. With unlimited emails and subscribers.
9
 
10
  == Description ==
11
 
12
- This plug-in adds a real newsletter system to your WordPress blog. Perfect for list building,
13
  you can create cool emails with visual editor, send and
14
  track them.
15
 
@@ -32,9 +32,9 @@ Key features:
32
  * diagnostic panel for **easy system tests**
33
  * **extensible** with specific modules (Facebook, Reports, Feed by Mail, Follow Up)
34
 
35
- Visit the [Newsletter official page](http://www.satollo.net/plugins/newsletter) to know more.
36
 
37
- Thank you, Stefano Lissa (Satollo).
38
 
39
  == Installation ==
40
 
@@ -44,12 +44,12 @@ Thank you, Stefano Lissa (Satollo).
44
 
45
  == Frequently Asked Questions ==
46
 
47
- See the [Newsletter FAQ](http://www.satollo.net/plugins/newsletter/newsletter-faq) or the
48
- [Newsletter Forum](http://www.satollo.net/forums) to ask for help.
49
 
50
- For documentation start from [Newsletter official page](http://www.satollo.net/plugins/newsletter).
51
 
52
- Thank you, Stefano Lissa (Satollo).
53
 
54
  == Screen shots ==
55
 
@@ -57,9 +57,86 @@ No screen shots are available at this time.
57
 
58
  == Changelog ==
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  = 3.6.3 =
61
 
62
- * fixed the feed by mail test function
63
 
64
  = 3.6.2 =
65
 
@@ -131,7 +208,7 @@ No screen shots are available at this time.
131
  = 3.4.9 =
132
 
133
  * Fixed some warnings in debug mode
134
- * Fixed the disabling setting of the social icons (on default newsletter themes)
135
  * Added filters on widget for WPML
136
  * Added filter for single line feeds refused by some mail servers
137
 
1
  === Newsletter ===
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing
3
  Requires at least: 3.3.0
4
+ Tested up to: 4.1.1
5
  Stable tag: trunk
6
+ Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter to your blog. In seconds. For free. With unlimited emails and subscribers.
9
 
10
  == Description ==
11
 
12
+ This plug-in adds a real newsletter system to your WordPress blog. Perfect for list building,
13
  you can create cool emails with visual editor, send and
14
  track them.
15
 
32
  * diagnostic panel for **easy system tests**
33
  * **extensible** with specific modules (Facebook, Reports, Feed by Mail, Follow Up)
34
 
35
+ Visit the [Newsletter official page](http://www.thenewsletterplugin.com/) to know more.
36
 
37
+ Thank you, The Newsletter Team
38
 
39
  == Installation ==
40
 
44
 
45
  == Frequently Asked Questions ==
46
 
47
+ See the [Newsletter FAQ](http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-faq) or the
48
+ [Newsletter Forum](http://www.thenewsletterplugin.com/forums) to ask for help.
49
 
50
+ For documentation start from [Newsletter documentation](http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-documentation).
51
 
52
+ Thank you, The Newsletter Team
53
 
54
  == Screen shots ==
55
 
57
 
58
  == Changelog ==
59
 
60
+ = coming =
61
+
62
+ * Added shortcodes for in page form building (beta): see the [plugin documentation](http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-documentation).
63
+
64
+ = 3.7.2 =
65
+
66
+ * Fixed the editor issue on subscription steps panel
67
+
68
+ = 3.7.1 =
69
+
70
+ * Attempt to fix the home url retrieval on some custom installations
71
+ * Removed some unused code
72
+ * Fixed the rate request notice
73
+ * Added the new URL tracking option (beta)
74
+ * Added the new URL tracking option notice
75
+ * Added file owner checking on diagnostic panel
76
+ * Added action files call checking on diagnostic panel
77
+ * Added dimensions on read-tracking image
78
+ * Added the html tag to the message templates
79
+ * Changed the template generation method to avoid conflicts with themes
80
+
81
+ = 3.7.0 =
82
+
83
+ * Bugfix
84
+
85
+ = 3.6.9 =
86
+
87
+ * Little fix
88
+
89
+ = 3.6.8 =
90
+
91
+ * Fixed the subject of the administrative notification
92
+ * Cleaned up obsolete code
93
+ * Added support for extension versions check
94
+ * Fixed typo in text only themes
95
+ * Fixed wrong unsubscribe code in German Welcome Email
96
+
97
+ = 3.6.7 =
98
+
99
+ * New Blog Info configuration panel
100
+ * New Default Theme
101
+ * Minor layout changes
102
+ * Fix subscription email link
103
+ * Added notices when filters are active on subscriber management panel
104
+ * Few fixes on statistic panel
105
+ * Fixed undefined index noticies on subscription page
106
+ * Several fixes
107
+ * A TNT team member quitted smoking, so the plugin become smoking free
108
+
109
+ = 3.6.6 =
110
+
111
+ * Added a cron monitor
112
+ * Added a xmas theme
113
+ * Fixed the opt-in mode for wordpress registsred users
114
+ * Fixed the noticies
115
+ * Fixed somes styles
116
+ * Added the direct newsletter edit for themes without options
117
+ * Header changed
118
+ * Fixed all links to refer the new site www.thenewsletterplugin.com
119
+ * Fixed the newsletter editor default style
120
+
121
+ = 3.6.5 =
122
+
123
+ * Added parameter "plugin url" on diagnostic panel
124
+ * Added custom post types to the linear theme
125
+ * Added custom post types to the vimeo-like theme
126
+ * Fixed the feed by mail placeholder panel
127
+ * Fixed the antibot option with preferences
128
+
129
+ = 3.6.4 =
130
+
131
+ * Support for greek (and others) characters without the entity encoding
132
+ * Fixed a debug notice in the widget code
133
+ * Added gender on import
134
+ * Added support for the constant NEWSLETTER_LOG_DIR in wp-config.php to define the loggin folder
135
+ * Fixed the domain removal on subscription steps messages
136
+
137
  = 3.6.3 =
138
 
139
+ * Fixed the feed by mail test function
140
 
141
  = 3.6.2 =
142
 
208
  = 3.4.9 =
209
 
210
  * Fixed some warnings in debug mode
211
+ * Fixed the disabling setting of the social icons (on default newsletter themes)
212
  * Added filters on widget for WPML
213
  * Added filter for single line feeds refused by some mail servers
214
 
statistics/index.php CHANGED
@@ -1,9 +1,17 @@
1
  <?php
 
 
 
 
2
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
3
  $module = NewsletterStatistics::instance();
4
  $controls = new NewsletterControls();
5
  $emails = Newsletter::instance()->get_emails();
6
 
 
 
 
 
7
  if ($controls->is_action('save')) {
8
  $module->save_options($controls->data);
9
  $controls->messages = 'Saved.';
@@ -11,7 +19,7 @@ if ($controls->is_action('save')) {
11
  ?>
12
 
13
  <div class="wrap">
14
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/statistics-module'; ?>
15
 
16
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
17
 
@@ -28,46 +36,70 @@ if ($controls->is_action('save')) {
28
  convenience, below there is a list of each email sent by Newsletter till now.
29
  </p>
30
  <p>
31
- A more advanced report for each email can be generated installing the Reports Extension
32
- from <a href="http://www.satollo.net/downloads" target="_blank">this page</a>.
33
  </p>
34
  </div>
35
  <div class="newsletter-separator"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  <table class="widefat" style="width: auto">
38
  <thead>
39
  <tr>
40
  <th>Id</th>
41
- <th>Subject</th>
42
  <th>Type</th>
43
- <th>Status</th>
44
  <th>&nbsp;</th>
45
  <th>&nbsp;</th>
 
46
  <th>&nbsp;</th>
47
  </tr>
48
  </thead>
49
 
50
  <tbody>
51
  <?php foreach ($emails as &$email) { ?>
 
52
  <tr>
53
  <td><?php echo $email->id; ?></td>
54
  <td><?php echo htmlspecialchars($email->subject); ?></td>
55
  <td><?php echo $email->type; ?></td>
56
  <td>
57
- <?php
58
- if ($email->status == 'sending') {
59
- if ($email->send_on > time()) {
60
- echo 'planned';
61
- } else {
62
- echo 'sending';
 
 
 
 
63
  }
64
- } else {
65
- echo $email->status;
66
- }
67
- ?>
68
  </td>
69
- <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $email->sent . ' of ' . $email->total; ?></td>
70
  <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $module->format_date($email->send_on); ?></td>
 
71
  <td>
72
  <a class="button" href="<?php echo NewsletterStatistics::instance()->get_statistics_url($email->id); ?>">statistics</a>
73
  </td>
1
  <?php
2
+ if (function_exists('load_plugin_textdomain')) {
3
+ load_plugin_textdomain('newsletter-statistics', false, 'newsletter/statistics/languages');
4
+ load_plugin_textdomain('newsletter', false, 'newsletter/languages');
5
+ }
6
  require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
7
  $module = NewsletterStatistics::instance();
8
  $controls = new NewsletterControls();
9
  $emails = Newsletter::instance()->get_emails();
10
 
11
+ if (!$controls->is_action()) {
12
+ $controls->data = $module->options;
13
+ }
14
+
15
  if ($controls->is_action('save')) {
16
  $module->save_options($controls->data);
17
  $controls->messages = 'Saved.';
19
  ?>
20
 
21
  <div class="wrap">
22
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/statistics-module'; ?>
23
 
24
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
25
 
36
  convenience, below there is a list of each email sent by Newsletter till now.
37
  </p>
38
  <p>
39
+ <strong>Advanced reports for each email can be generated installing the
40
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/reports-module?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-report&utm_content=<?php echo NEWSLETTER_VERSION?>" target="_blank">Reports Extension</a></strong>.
41
  </p>
42
  </div>
43
  <div class="newsletter-separator"></div>
44
+
45
+ <form method="post" action="">
46
+ <?php $controls->init(); ?>
47
+ <table class="form-table">
48
+ <tr>
49
+ <th><?php _e('Tracking URL', 'newsletter-statistics') ?></th>
50
+ <td>
51
+ <?php $controls->select('tracking_url', array(0=>__('Standard', 'newsletter-statistics'),
52
+ 1=>__('Blog Home URL with parameters', 'newsletter-statistics'))) ?>
53
+ <p class="description">
54
+ <?php _e('How the links inside newsletters are rewritten to track clicks.', 'newsletter-statistics') ?>
55
+ <?php _e('Since spam filters check links inside emails, <a href="http://www.thenewsletterplugin.com/plugins/newsletter/statistics-module#tracking-url" target="_blank">read more about this setting</a>.', 'newsletter-statistics') ?>
56
+ </p>
57
+ </td>
58
+ </tr>
59
+ </table>
60
+ <p>
61
+ <?php $controls->button('save', __('Save', 'newsletter')) ?>
62
+ </p>
63
+ </form>
64
 
65
  <table class="widefat" style="width: auto">
66
  <thead>
67
  <tr>
68
  <th>Id</th>
69
+ <th><?php _e('Subject', 'newsletter')?></th>
70
  <th>Type</th>
71
+ <th><?php _e('Status', 'newsletter')?></th>
72
  <th>&nbsp;</th>
73
  <th>&nbsp;</th>
74
+ <th><?php _e('Tracking', 'newsletter')?></th>
75
  <th>&nbsp;</th>
76
  </tr>
77
  </thead>
78
 
79
  <tbody>
80
  <?php foreach ($emails as &$email) { ?>
81
+ <?php if ($email->type != 'message' && $email->type != 'feed') continue; ?>
82
  <tr>
83
  <td><?php echo $email->id; ?></td>
84
  <td><?php echo htmlspecialchars($email->subject); ?></td>
85
  <td><?php echo $email->type; ?></td>
86
  <td>
87
+ <?php
88
+ if ($email->status == 'sending') {
89
+ if ($email->send_on > time()) {
90
+ _e('Scheduled', 'newsletter-emails');
91
+ }
92
+ else {
93
+ _e('Sending', 'newsletter-emails');
94
+ }
95
+ } else {
96
+ echo $email->status;
97
  }
98
+ ?>
 
 
 
99
  </td>
100
+ <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $email->sent . ' ' . __('of', 'newsletter'). ' ' . $email->total; ?></td>
101
  <td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $module->format_date($email->send_on); ?></td>
102
+ <td><?php echo $email->track==1?'Yes':'No'; ?></td>
103
  <td>
104
  <a class="button" href="<?php echo NewsletterStatistics::instance()->get_statistics_url($email->id); ?>">statistics</a>
105
  </td>
statistics/statistics.php CHANGED
@@ -17,7 +17,41 @@ class NewsletterStatistics extends NewsletterModule {
17
  }
18
 
19
  function __construct() {
 
 
20
  parent::__construct('statistics', '1.1.0');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
 
23
  function upgrade() {
@@ -45,7 +79,7 @@ class NewsletterStatistics extends NewsletterModule {
45
  $this->upgrade_query("alter table {$wpdb->prefix}newsletter_stats add column anchor varchar(200) not null default ''");
46
  $this->upgrade_query("alter table {$wpdb->prefix}newsletter_stats add column ip varchar(20) not null default ''");
47
  $this->upgrade_query("alter table {$wpdb->prefix}newsletter_stats add column country varchar(4) not null default ''");
48
-
49
  $this->upgrade_query("ALTER TABLE `{$wpdb->prefix}newsletter_stats` ADD INDEX `email_id` (`email_id`)");
50
  $this->upgrade_query("ALTER TABLE `{$wpdb->prefix}newsletter_stats` ADD INDEX `user_id` (`user_id`)");
51
 
@@ -54,10 +88,7 @@ class NewsletterStatistics extends NewsletterModule {
54
  // $this->upgrade_query("alter table {$wpdb->prefix}newsletter_links add column email_id int not null default 0");
55
  // $this->upgrade_query("alter table {$wpdb->prefix}newsletter_links add column token varchar(10) not null default ''");
56
  // $this->upgrade_query("alter table {$wpdb->prefix}newsletter_links add column text varchar(255) not null default ''");
57
-
58
-
59
  //$this->upgrade_query("create table if not exists {$wpdb->prefix}newsletter_stats (id int auto_increment, primary key (id)) $charset_collate");
60
-
61
  }
62
 
63
  function admin_menu() {
@@ -70,34 +101,50 @@ class NewsletterStatistics extends NewsletterModule {
70
  $this->relink_user_id = $user_id;
71
  $text = preg_replace_callback('/(<[aA][^>]+href=["\'])([^>"\']+)(["\'][^>]*>)(.*?)(<\/[Aa]>)/', array($this, 'relink_callback'), $text);
72
 
73
- // TODO: use the WP rewriting
74
- $text = str_replace('</body>', '<img alt="newsletter" src="' . plugins_url('newsletter') . '/statistics/open.php?r=' . urlencode(base64_encode($email_id . ';' . $user_id)) . '"/></body>', $text);
 
 
 
75
  return $text;
76
  }
77
 
78
  function relink_callback($matches) {
79
  $href = str_replace('&amp;', '&', $matches[2]);
 
80
  // Do not replace the tracking or subscription/unsubscription links.
81
- if (strpos($href, '/newsletter/') !== false)
82
  return $matches[0];
83
- if (substr($href, 0, 1) == '#')
 
 
84
  return $matches[0];
85
- if (substr($href, 0, 7) == 'mailto:')
 
 
86
  return $matches[0];
 
87
 
88
-
89
  $anchor = '';
90
  if ($this->options['anchor'] == 1) {
91
  $anchor = trim(str_replace(';', ' ', $matches[4]));
 
92
  $anchor = strip_tags($anchor, '<img>');
 
 
93
  if (stripos($anchor, '<img') === false && strlen($anchor) > 100) {
94
  $anchor = substr($anchor, 0, 100);
95
  }
96
  }
97
 
98
- $url = plugins_url('newsletter') . '/statistics/link.php?r=' .
99
- urlencode(base64_encode($this->relink_email_id . ';' . $this->relink_user_id . ';' . $href . ';' . $anchor));
100
 
 
 
 
 
 
101
  return $matches[1] . $url . $matches[3] . $matches[4] . $matches[5];
102
  }
103
 
@@ -112,6 +159,13 @@ class NewsletterStatistics extends NewsletterModule {
112
  return (int) $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where email_id=" . $email_id);
113
  }
114
 
 
 
 
 
 
 
 
115
  }
116
 
117
  NewsletterStatistics::instance();
17
  }
18
 
19
  function __construct() {
20
+ global $wpdb;
21
+
22
  parent::__construct('statistics', '1.1.0');
23
+
24
+ // Link tracking redirect
25
+ if (isset($_GET['nltr'])) {
26
+ list($email_id, $user_id, $url, $anchor) = explode(';', base64_decode($_GET['nltr']), 4);
27
+ $wpdb->insert(NEWSLETTER_STATS_TABLE, array(
28
+ 'email_id' => $email_id,
29
+ 'user_id' => $user_id,
30
+ 'url' => $url,
31
+ 'anchor' => $anchor,
32
+ 'ip' => $_SERVER['REMOTE_ADDR']
33
+ )
34
+ );
35
+
36
+ header('Location: ' . $url);
37
+ die();
38
+ }
39
+
40
+ // Open tracking image
41
+ if (isset($_GET['noti'])) {
42
+ list($email_id, $user_id) = explode(';', base64_decode($_GET['r']), 2);
43
+
44
+ $wpdb->insert(NEWSLETTER_STATS_TABLE, array(
45
+ 'email_id' => $email_id,
46
+ 'user_id' => $user_id,
47
+ 'ip' => $_SERVER['REMOTE_ADDR']
48
+ )
49
+ );
50
+
51
+ header('Content-Type: image/gif');
52
+ echo base64_decode('_R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
53
+ die();
54
+ }
55
  }
56
 
57
  function upgrade() {
79
  $this->upgrade_query("alter table {$wpdb->prefix}newsletter_stats add column anchor varchar(200) not null default ''");
80
  $this->upgrade_query("alter table {$wpdb->prefix}newsletter_stats add column ip varchar(20) not null default ''");
81
  $this->upgrade_query("alter table {$wpdb->prefix}newsletter_stats add column country varchar(4) not null default ''");
82
+
83
  $this->upgrade_query("ALTER TABLE `{$wpdb->prefix}newsletter_stats` ADD INDEX `email_id` (`email_id`)");
84
  $this->upgrade_query("ALTER TABLE `{$wpdb->prefix}newsletter_stats` ADD INDEX `user_id` (`user_id`)");
85
 
88
  // $this->upgrade_query("alter table {$wpdb->prefix}newsletter_links add column email_id int not null default 0");
89
  // $this->upgrade_query("alter table {$wpdb->prefix}newsletter_links add column token varchar(10) not null default ''");
90
  // $this->upgrade_query("alter table {$wpdb->prefix}newsletter_links add column text varchar(255) not null default ''");
 
 
91
  //$this->upgrade_query("create table if not exists {$wpdb->prefix}newsletter_stats (id int auto_increment, primary key (id)) $charset_collate");
 
92
  }
93
 
94
  function admin_menu() {
101
  $this->relink_user_id = $user_id;
102
  $text = preg_replace_callback('/(<[aA][^>]+href=["\'])([^>"\']+)(["\'][^>]*>)(.*?)(<\/[Aa]>)/', array($this, 'relink_callback'), $text);
103
 
104
+ if ($this->options['tracking_url'] == 1) {
105
+ $text = str_replace('</body>', '<img width="1" height="1" alt="" src="' . home_url() . '?noti=' . urlencode(base64_encode($email_id . ';' . $user_id)) . '"/></body>', $text);
106
+ } else {
107
+ $text = str_replace('</body>', '<img width="1" height="1" alt="" src="' . plugins_url('newsletter') . '/statistics/open.php?r=' . urlencode(base64_encode($email_id . ';' . $user_id)) . '"/></body>', $text);
108
+ }
109
  return $text;
110
  }
111
 
112
  function relink_callback($matches) {
113
  $href = str_replace('&amp;', '&', $matches[2]);
114
+
115
  // Do not replace the tracking or subscription/unsubscription links.
116
+ if (strpos($href, '/newsletter/') !== false) {
117
  return $matches[0];
118
+ }
119
+ // Do not relink anchors
120
+ if (substr($href, 0, 1) == '#') {
121
  return $matches[0];
122
+ }
123
+ // Do not relink mailto:
124
+ if (substr($href, 0, 7) == 'mailto:') {
125
  return $matches[0];
126
+ }
127
 
128
+ // This is the link text which is added to the tracking data
129
  $anchor = '';
130
  if ($this->options['anchor'] == 1) {
131
  $anchor = trim(str_replace(';', ' ', $matches[4]));
132
+ // Keep images but not other tags
133
  $anchor = strip_tags($anchor, '<img>');
134
+
135
+ // Truncate if needed to avoid to much long URLs
136
  if (stripos($anchor, '<img') === false && strlen($anchor) > 100) {
137
  $anchor = substr($anchor, 0, 100);
138
  }
139
  }
140
 
141
+ $r = urlencode(base64_encode($this->relink_email_id . ';' . $this->relink_user_id . ';' . $href . ';' . $anchor));
 
142
 
143
+ if ($this->options['tracking_url'] == 1) {
144
+ $url = home_url() . '?nltr=' . $r;
145
+ } else {
146
+ $url = plugins_url('newsletter') . '/statistics/link.php?r=' . $r;
147
+ }
148
  return $matches[1] . $url . $matches[3] . $matches[4] . $matches[5];
149
  }
150
 
159
  return (int) $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where email_id=" . $email_id);
160
  }
161
 
162
+ function get_clicked_count($email_id) {
163
+ global $wpdb;
164
+ $email_id = (int) $email_id;
165
+
166
+ return (int) $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where url<>'' and email_id=" . $email_id);
167
+ }
168
+
169
  }
170
 
171
  NewsletterStatistics::instance();
statistics/view.php CHANGED
@@ -1,39 +1,76 @@
1
  <?php
2
  $module = NewsletterStatistics::instance();
3
- $email = $module->get_email($_GET['id']);
4
  ?>
5
  <div class="wrap">
6
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/statistics-module'; ?>
7
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
8
 
9
  <div id="newsletter-title">
10
  <h2>Statistics for "<?php echo esc_html($email->subject); ?>"</h2>
11
 
 
12
  <p>
13
  Complete statistics for this email are available with
14
- <a href="http://www.satollo.net/plugins/newsletter/reports-module" target="_blank">Reports for Newsletter</a>.
 
15
  </p>
 
 
16
  </div>
17
  <div class="newsletter-separator"></div>
18
 
 
 
 
 
19
  <table class="widefat" style="width: auto">
20
  <thead>
21
  <tr>
22
- <td>Field</td>
23
- <td>Value</td>
24
  </tr>
25
  </thead>
26
 
27
  <tbody>
28
  <tr>
29
- <td>Total sent</td>
30
- <td><?php echo $email->sent; ?></td>
31
  </tr>
32
  <tr>
33
- <td>Email open</td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  <td><?php echo $module->get_read_count($email->id); ?></td>
35
  </tr>
 
 
 
 
 
 
 
36
  </tbody>
37
  </table>
38
-
39
  </div>
1
  <?php
2
  $module = NewsletterStatistics::instance();
3
+ $email = $module->get_email((int)$_GET['id']);
4
  ?>
5
  <div class="wrap">
6
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/statistics-module'; ?>
7
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
8
 
9
  <div id="newsletter-title">
10
  <h2>Statistics for "<?php echo esc_html($email->subject); ?>"</h2>
11
 
12
+ <div class="updated">
13
  <p>
14
  Complete statistics for this email are available with
15
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/reports-module?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-report&utm_content=<?php echo NEWSLETTER_VERSION?>" target="_blank">Reports for Newsletter</a>.
16
+ Even for already sent email, the Reports for Newsletter will display collected data.
17
  </p>
18
+ </div>
19
+
20
  </div>
21
  <div class="newsletter-separator"></div>
22
 
23
+ <?php if (!$email->track) { ?>
24
+ <div class="error"><p>Warning! This email has the tracking option disabled, no data will be collected.</p></div>
25
+ <?php } ?>
26
+
27
  <table class="widefat" style="width: auto">
28
  <thead>
29
  <tr>
30
+ <th>Field</th>
31
+ <th>Value</th>
32
  </tr>
33
  </thead>
34
 
35
  <tbody>
36
  <tr>
37
+ <td>Email Id</td>
38
+ <td><?php echo $email->id; ?></td>
39
  </tr>
40
  <tr>
41
+ <td>Status</td>
42
+ <td>
43
+ <?php
44
+ if ($email->status == 'sending') {
45
+ if ($email->send_on > time()) {
46
+ echo 'planned';
47
+ } else {
48
+ echo 'sending';
49
+ }
50
+ } else {
51
+ echo $email->status;
52
+ }
53
+ ?>
54
+ </td>
55
+ </tr>
56
+ <tr>
57
+ <td>Progress</td>
58
+ <td>
59
+ <?php if ($email->status == 'sent' || $email->status == 'sending') echo $email->sent . ' of ' . $email->total; ?>
60
+ </td>
61
+ </tr>
62
+ <tr>
63
+ <td>Emails Opened</td>
64
  <td><?php echo $module->get_read_count($email->id); ?></td>
65
  </tr>
66
+ <tr>
67
+ <td>Emails Clicked</td>
68
+ <td>
69
+ <?php echo $module->get_clicked_count($email->id); ?> (details on clicks available with
70
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/reports-module?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-report" target="_blank">Reports for Newsletter</a>)
71
+ </td>
72
+ </tr>
73
  </tbody>
74
  </table>
75
+
76
  </div>
subscription/email-alternative.php CHANGED
@@ -1,7 +1,19 @@
1
  <?php
2
-
3
- // TODO: Explain how to customize.
4
-
 
 
 
 
 
 
 
 
 
 
 
 
5
  ?>
6
  <html>
7
  <head>
@@ -10,6 +22,9 @@
10
  </head>
11
 
12
  <body style="font-family: sans-serif; font-size: 12px">
 
 
13
  <?php echo $message; ?>
 
14
  </body>
15
  </html>
1
  <?php
2
+ /*
3
+ * Copy this file into
4
+ *
5
+ * wp-content/extensions/newsletter/subscription
6
+ *
7
+ * and RENAME it to email.php.
8
+ *
9
+ * It will be used insted of the standard email.php file to generate the body of
10
+ * confirmation and welcome emails.
11
+ *
12
+ * A globally available $message variable contains the generated message as resulted
13
+ * by merging your configured message (on subscription steps panel) and the user's
14
+ * data.
15
+ *
16
+ */
17
  ?>
18
  <html>
19
  <head>
22
  </head>
23
 
24
  <body style="font-family: sans-serif; font-size: 12px">
25
+
26
+ <?php // NEVER FORGET THIS LINE! ?>
27
  <?php echo $message; ?>
28
+
29
  </body>
30
  </html>
subscription/email.html ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <style type="text/css" media="all">
5
+ a {
6
+ text-decoration: none;
7
+ color: #0088cc;
8
+ }
9
+ </style>
10
+ </head>
11
+ <body>
12
+ <table style="background-color: #ddd; width: 100%">
13
+ <tr>
14
+ <td align="center">
15
+ <br>
16
+ <table style="background-color: #fff; width: 500px; border: 1px solid #bbb">
17
+ <tr>
18
+ <td>
19
+
20
+ {message}
21
+
22
+ </td>
23
+ </tr>
24
+ </table>
25
+ </td>
26
+ </tr>
27
+ </table>
28
+ </body>
29
+ </html>
subscription/email.php CHANGED
@@ -1,20 +1,13 @@
1
  <?php
2
  /*
3
- * To customize this file, do not edit it. Instead use the sample alternative email-alternative.php
4
- * and copy it on
5
  *
6
- * wp-content/extensions/newsletter/subscription/email.php
 
7
  *
8
- * creating the folders as needed. Then customize that file.
9
- *
10
- * Remember to keep at least the line of code
11
- *
12
- * <?php echo $message; ?>
13
- *
14
- * which prints the current email body created by Newsletter based on te current subscription
15
- * process step.
16
  */
17
 
 
18
  if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/subscription/email.php')) {
19
  include WP_CONTENT_DIR . '/extensions/newsletter/subscription/email.php';
20
  return;
1
  <?php
2
  /*
3
+ * NEVER EDIT THIS FILE OR COPY IT SOMEWHERE ELSE!
 
4
  *
5
+ * See the email-alternative.php to customized the confirmation and welcome
6
+ * emails layout.
7
  *
 
 
 
 
 
 
 
 
8
  */
9
 
10
+ // Check for an alternative email builder.
11
  if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/subscription/email.php')) {
12
  include WP_CONTENT_DIR . '/extensions/newsletter/subscription/email.php';
13
  return;
subscription/forms.php CHANGED
@@ -9,12 +9,12 @@ if (!$controls->is_action()) {
9
 
10
  if ($controls->is_action('save')) {
11
  update_option('newsletter_forms', $controls->data);
12
- $controls->messages = 'Saved';
13
  }
14
  ?>
15
 
16
  <div class="wrap">
17
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/newsletter-forms'; ?>
18
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
19
 
20
  <div id="newsletter-title">
@@ -23,7 +23,7 @@ if ($controls->is_action('save')) {
23
  <h2>Alternative Hand-Coded Forms</h2>
24
  <p>
25
  Here you can store your hand coded forms to recall them from short codes.
26
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-forms" target="_blank">Read more about forms</a>.
27
  </p>
28
  </div>
29
  <div class="newsletter-separator"></div>
9
 
10
  if ($controls->is_action('save')) {
11
  update_option('newsletter_forms', $controls->data);
12
+ $controls->messages = 'Saved.';
13
  }
14
  ?>
15
 
16
  <div class="wrap">
17
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-forms'; ?>
18
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
19
 
20
  <div id="newsletter-title">
23
  <h2>Alternative Hand-Coded Forms</h2>
24
  <p>
25
  Here you can store your hand coded forms to recall them from short codes.
26
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-forms" target="_blank">Read more about forms</a>.
27
  </p>
28
  </div>
29
  <div class="newsletter-separator"></div>
subscription/languages/de_DE.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  // Message show after a subbscription request has made.
4
  $options['confirmation_text'] =
5
  "<p>Sie haben sich in unseren Newsletter eingetragen.
@@ -35,7 +37,7 @@ Willkommen zu unserem {blog_title} Newsletter.</p>
35
  <p>
36
  Wir werden Sie künftig regelm&auml;&szlig;ig &uuml;ber Neuigkeiten zu {blog_title} informieren</p>
37
  <p>
38
- Wenn Sie unseren newsletter nicht mehr erhalten m&ouml;chten, tragen Sie sich bitte unter dem folgenden Link aus dem Verteiler aus: <a href=\"{newsletter_url}\">austragen</a></p>
39
  <p>Besten Dank!</p>";
40
 
41
  // Unsubscription request introductory text
1
  <?php
2
 
3
+ // This file is used only on first installation!
4
+
5
  // Message show after a subbscription request has made.
6
  $options['confirmation_text'] =
7
  "<p>Sie haben sich in unseren Newsletter eingetragen.
37
  <p>
38
  Wir werden Sie künftig regelm&auml;&szlig;ig &uuml;ber Neuigkeiten zu {blog_title} informieren</p>
39
  <p>
40
+ Wenn Sie unseren newsletter nicht mehr erhalten m&ouml;chten, tragen Sie sich bitte unter dem folgenden Link aus dem Verteiler aus: <a href=\"{unsubscription_url}\">austragen</a></p>
41
  <p>Besten Dank!</p>";
42
 
43
  // Unsubscription request introductory text
subscription/languages/en_US.php CHANGED
@@ -17,6 +17,8 @@ $options['error_text'] = '<p>This subscription can\'t be completed, sorry. The e
17
 
18
  $options['already_confirmed_text'] = '<p>This email address is already subscribed, anyway a welcome email has been resent. Thank you.</p>';
19
 
 
 
20
  // Subscription page introductory text (befor the subscription form)
21
  $options['subscription_text'] =
22
  "{subscription_form}";
@@ -37,8 +39,8 @@ $options['confirmation_subject'] =
37
  $options['confirmation_message'] =
38
  "<p>Hi {name},</p>
39
  <p>A newsletter subscription request for this email address was
40
- received. Please confirm it by clicking here. If you cannot
41
- click the link, please use the following link.</p>
42
 
43
  <p>{subscription_confirm_url}</p>
44
 
17
 
18
  $options['already_confirmed_text'] = '<p>This email address is already subscribed, anyway a welcome email has been resent. Thank you.</p>';
19
 
20
+ $options['subscribe_wp_users'] = 0;
21
+
22
  // Subscription page introductory text (befor the subscription form)
23
  $options['subscription_text'] =
24
  "{subscription_form}";
39
  $options['confirmation_message'] =
40
  "<p>Hi {name},</p>
41
  <p>A newsletter subscription request for this email address was
42
+ received. Please confirm it by <a href=\"{subscription_confirm_url}\"><strong>clicking here</strong></a>. If you cannot
43
+ click the link, please use the following link:</p>
44
 
45
  <p>{subscription_confirm_url}</p>
46
 
subscription/languages/es_ES.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  // Mostrar mensaje despues de una solicitud de suscripcion hecha.
4
  $options['confirmation_text'] =
5
  "<p>Con exito suscrito a mi boletín informativo.
1
  <?php
2
 
3
+ // This file is used only on first installation!
4
+
5
  // Mostrar mensaje despues de una solicitud de suscripcion hecha.
6
  $options['confirmation_text'] =
7
  "<p>Con exito suscrito a mi boletín informativo.
subscription/languages/fr_FR.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  // Message show after a subbscription request has made.
4
  $options['confirmation_text'] =
5
  "<p>Votre demande d'inscription est enregistr&eacute;e. Merci ! Un e-mail de confirmation vous a été envoyé. V&eacute;rifier &eacute;galement votre dossier spam.</p>";
1
  <?php
2
 
3
+ // This file is used only on first installation!
4
+
5
  // Message show after a subbscription request has made.
6
  $options['confirmation_text'] =
7
  "<p>Votre demande d'inscription est enregistr&eacute;e. Merci ! Un e-mail de confirmation vous a été envoyé. V&eacute;rifier &eacute;galement votre dossier spam.</p>";
subscription/languages/it_IT.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  // Subscription registration message
4
  $options['confirmation_text'] =
5
  "<p>L'iscrizione è quasi completa: controlla la tua
1
  <?php
2
 
3
+ // This file is used only on first installation!
4
+
5
  // Subscription registration message
6
  $options['confirmation_text'] =
7
  "<p>L'iscrizione è quasi completa: controlla la tua
subscription/languages/nl_NL.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  // Message show after a subbscription request has made.
4
  $options['confirmation_text'] =
5
  "<p>Je hebt je ingeschreven op de nieuwsbrief.</p>
1
  <?php
2
 
3
+ // This file is used only on first installation!
4
+
5
  // Message show after a subbscription request has made.
6
  $options['confirmation_text'] =
7
  "<p>Je hebt je ingeschreven op de nieuwsbrief.</p>
subscription/languages/pl_PL.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  // Message show after a subbscription request has made.
4
  $options['confirmation_text'] =
5
  "<p>Zostałeś zapisany do subskrypcji.
1
  <?php
2
 
3
+ // This file is used only on first installation!
4
+
5
  // Message show after a subbscription request has made.
6
  $options['confirmation_text'] =
7
  "<p>Zostałeś zapisany do subskrypcji.
subscription/languages/profile-en_US.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  $options = array();
4
  $options['email'] = 'Email';
5
  $options['email_error'] = 'The email is not correct';
1
  <?php
2
 
3
+ // This file is used only on first installation!
4
+
5
  $options = array();
6
  $options['email'] = 'Email';
7
  $options['email_error'] = 'The email is not correct';
subscription/languages/profile-it_IT.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  $options = array();
4
  $options['email'] = 'Email';
5
  $options['email_error'] = 'L\'indirizzo email non è corretto';
1
  <?php
2
 
3
+ // This file is used only on first installation!
4
+
5
  $options = array();
6
  $options['email'] = 'Email';
7
  $options['email_error'] = 'L\'indirizzo email non è corretto';
subscription/languages/pt_BR.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  // Message show after a subbscription request has made.
4
  $options['confirmation_text'] =
5
  "<p>Você foi inscrito corretamente na newsletter.
1
  <?php
2
 
3
+ // This file is used only on first installation!
4
+
5
  // Message show after a subbscription request has made.
6
  $options['confirmation_text'] =
7
  "<p>Você foi inscrito corretamente na newsletter.
subscription/languages/ru_RU.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  // Message show after a subbscription request has made.
4
  $options['confirmation_text'] =
5
  "<p>Вы успешно подписаны на рассылку. Вы получите письмо с подтверждением через несколько минут. Перейдите по ссылке в письме для подтверждения. Если в течении 15 минут письмо все-таки не пришло, проверьте папку со спамом на вашем ящике, на случай если почтовая служба сочла письмо спамом. Если же письма нигде нет, свяжитесь с администратором сайта</a>.</p>";
1
  <?php
2
 
3
+ // This file is used only on first installation!
4
+
5
  // Message show after a subbscription request has made.
6
  $options['confirmation_text'] =
7
  "<p>Вы успешно подписаны на рассылку. Вы получите письмо с подтверждением через несколько минут. Перейдите по ссылке в письме для подтверждения. Если в течении 15 минут письмо все-таки не пришло, проверьте папку со спамом на вашем ящике, на случай если почтовая служба сочла письмо спамом. Если же письма нигде нет, свяжитесь с администратором сайта</a>.</p>";
subscription/menu.inc.php CHANGED
@@ -1,6 +1,6 @@
1
  <!--<h5>Subscription Module</h5>-->
2
  <div id="newsletter-nav">
3
- <a class="button" href="<?php echo $module->get_admin_page_url('options'); ?>">Subscription steps</a>
4
- <a class="button" href="<?php echo $module->get_admin_page_url('profile'); ?>">Form fields and translation</a>
5
- <a class="button" href="<?php echo $module->get_admin_page_url('forms'); ?>">Alternative forms</a>
6
  </div>
1
  <!--<h5>Subscription Module</h5>-->
2
  <div id="newsletter-nav">
3
+ <a class="button-primary" href="<?php echo $module->get_admin_page_url('options'); ?>">Subscription steps</a>
4
+ <a class="button-primary" href="<?php echo $module->get_admin_page_url('profile'); ?>">Form fields and translation</a>
5
+ <a class="button-primary" href="<?php echo $module->get_admin_page_url('forms'); ?>">Alternative forms</a>
6
  </div>
subscription/options.php CHANGED
@@ -62,7 +62,7 @@ if ($controls->is_action()) {
62
  $controls->messages = 'Saved.';
63
  }
64
 
65
- if ($controls->is_action('create')) {
66
  $page = array();
67
  $page['post_title'] = 'Newsletter';
68
  $page['post_content'] = '[newsletter]';
@@ -77,12 +77,65 @@ if ($controls->is_action('create')) {
77
 
78
  $controls->data['url'] = get_permalink($page_id);
79
  $module->save_options($controls->data);
80
- }
81
 
82
  if ($controls->is_action('reset')) {
83
  $controls->data = $module->reset_options();
84
  }
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  } else {
87
  $controls->data = get_option('newsletter', array());
88
 
@@ -94,31 +147,8 @@ if ($controls->is_action('create')) {
94
  }
95
  ?>
96
 
97
- <?php if (isset($controls->data['novisual']) && $controls->data['novisual'] != 1) { ?>
98
- <script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/tiny_mce/tiny_mce.js"></script>
99
-
100
- <script type="text/javascript">
101
- tinyMCE.init({
102
- inline_styles : false,
103
- mode : "specific_textareas",
104
- editor_selector : "visual",
105
- theme : "advanced",
106
- theme_advanced_disable : "styleselect",
107
- relative_urls : false,
108
- remove_script_host : false,
109
- theme_advanced_buttons1_add: "forecolor,blockquote,code,fontsizeselect,fontselect",
110
- theme_advanced_buttons3_add : "tablecontrols,fullscreen",
111
- theme_advanced_toolbar_location : "top",
112
- theme_advanced_resizing : true,
113
- theme_advanced_statusbar_location: "bottom",
114
- document_base_url : "<?php echo get_option('home'); ?>/",
115
- content_css : "<?php echo plugins_url('newsletter'); ?>/editor.css?" + new Date().getTime()
116
- });
117
- </script>
118
- <?php } ?>
119
-
120
  <div class="wrap">
121
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/subscription-module'; ?>
122
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
123
 
124
  <div id="newsletter-title">
@@ -138,7 +168,7 @@ if ($controls->is_action('create')) {
138
  Page layout where messages are shown is managed by subscription/page.php file which contains instruction on how to
139
  customize it OR use a WordPress page for messages as described on subscription configuration.
140
  </p>
141
- </div>
142
  <div class="newsletter-separator"></div>
143
 
144
 
@@ -151,6 +181,7 @@ if ($controls->is_action('create')) {
151
  <li><a href="#tabs-2">Subscription</a></li>
152
  <li><a href="#tabs-3">Confirmation</a></li>
153
  <li><a href="#tabs-4">Welcome</a></li>
 
154
  <li><a href="#tabs-9">Profile</a></li>
155
  <li><a href="#tabs-5">Unsubscription</a></li>
156
  <li><a href="#tabs-wp">WP Registration</a></li>
@@ -163,10 +194,10 @@ if ($controls->is_action('create')) {
163
  <th>Opt In</th>
164
  <td>
165
  <?php $controls->select('noconfirmation', array(0 => 'Double Opt In', 1 => 'Single Opt In')); ?>
166
- <div class="hints">
167
  <strong>Double Opt In</strong> means subscribers need to confirm their email address by an activation link sent them on a activation email message.<br />
168
  <strong>Single Opt In</strong> means subscribers do not need to confirm their email address.<br />
169
- </div>
170
  </td>
171
  </tr>
172
  <tr valign="top">
@@ -179,39 +210,43 @@ if ($controls->is_action('create')) {
179
  }
180
  ?>
181
 
182
- <div class="hints">
183
  Optional (but recommended) an address of a WordPress page (eg. <?php echo get_option('home') . '/newsletter'; ?>)
184
  you <strong>manually created</strong> for subscription and messages.
185
  <br>
186
  The page must have in its body <strong>only</strong> the short code <strong>[newsletter]</strong> (as is).
187
 
188
  <?php if (!empty($controls->data['url'])) { ?>
189
- <br>
190
- If something is not working as expected with this address you can empty the field above and save: a button will appear
191
- to create that page automatically.
192
  <?php } ?>
193
- </div>
194
  </td>
195
  </tr>
 
196
  <tr valign="top">
197
  <th>Disable visual editors?</th>
198
  <td>
199
  <?php $controls->yesno('novisual'); ?>
 
 
 
 
200
  </td>
201
  </tr>
202
- <tr valign="top">
 
203
  <th>Notifications</th>
204
  <td>
205
  <?php $controls->yesno('notify'); ?>
206
  to: <?php $controls->text_email('notify_email'); ?> (email address, leave empty for the WordPress administration email <?php echo get_option('admin_email'); ?>)
207
- <div class="hints">
208
- Notifies when a user confirm his subscription or unsubscribe.
209
- </div>
210
  </td>
211
  </tr>
212
- </table>
213
-
214
-
215
  </div>
216
 
217
 
@@ -221,20 +256,20 @@ if ($controls->is_action('create')) {
221
  <tr valign="top">
222
  <th>Subscription page</th>
223
  <td>
224
- <?php $controls->editor('subscription_text'); ?>
225
- <div class="hints">
226
- User <strong>{subscription_form}</strong> to insert the subscription form where you prefere in the text or
227
  <strong>{subscription_form_N}</strong> (with N from 1 to 10) to insert one of the custom forms.
228
- </div>
229
  </td>
230
  </tr>
231
  <tr valign="top">
232
  <th>Forced preferences</th>
233
  <td>
234
  <?php $controls->preferences(); ?>
235
- <div class="hints">
236
  Add to new subscribers these preferences by default.
237
- </div>
238
  </td>
239
  </tr>
240
  <tr valign="top">
@@ -254,22 +289,22 @@ if ($controls->is_action('create')) {
254
  <tr valign="top">
255
  <th>Already subscribed page content</th>
256
  <td>
257
- <?php $controls->editor('already_confirmed_text'); ?><br>
258
  <?php $controls->checkbox('resend_welcome_email_disabled', 'Do not resend the welcome email'); ?>
259
- <div class="hints">
260
- Shown when the email is already subscribed and confirmed. The welcome email, is not disabled, will
261
  be sent. Find out more on this topic on its
262
- <a href="http://www.satollo.net/plugins/newsletter/subscription-module#repeated" target="_blank">documentation page</a>.
263
- </div>
264
  </td>
265
  </tr>
266
  <tr valign="top">
267
  <th>Error page content</th>
268
  <td>
269
- <?php $controls->editor('error_text'); ?>
270
- <div class="hints">
271
- Message shown when the email is bounced.
272
- </div>
273
  </td>
274
  </tr>
275
  </table>
@@ -277,20 +312,19 @@ if ($controls->is_action('create')) {
277
 
278
 
279
  <div id="tabs-3">
280
- <div class="tab-preamble">
281
- <p>This configuration applies only when in double opt-in mode.</p>
282
- </div>
283
 
284
  <table class="form-table">
285
  <tr valign="top">
286
  <th>Confirmation required message</th>
287
  <td>
288
- <?php $controls->editor('confirmation_text'); ?>
289
- <div class="hints">
290
- This is the text showed to a user who has pressed "subscribe me" on the previous
291
- step informing that an email to confirm subscription has just been sent. Remember
292
- the user to check the spam folder and to follow the email instructions.
293
- </div>
294
  </td>
295
  </tr>
296
 
@@ -298,10 +332,10 @@ if ($controls->is_action('create')) {
298
  <th>Alternative custom confirmation required page</th>
299
  <td>
300
  <?php $controls->text('confirmation_url', 70); ?>
301
- <div class="hints">
302
- A full page address (http://yourblog.com/confirm) to be used instead of message above. If empty the message is
303
- used.
304
- </div>
305
  </td>
306
  </tr>
307
 
@@ -310,14 +344,15 @@ if ($controls->is_action('create')) {
310
  <tr valign="top">
311
  <th>Confirmation email</th>
312
  <td>
313
- <?php $controls->email('confirmation'); ?>
314
- <div class="hints">
 
315
  Message sent by email to new subscribers with instructions to confirm their subscription
316
  (for double opt-in process). Do not forget to add the <strong>{subscription_confirm_url}</strong>
317
  that users must click to activate their subscription.<br />
318
  Sometime can be useful to add a <strong>{unsubscription_url}</strong> to let users to
319
- cancel if they wrongly subscribed your newsletter.
320
- </div>
321
  </td>
322
  </tr>
323
  </table>
@@ -329,12 +364,12 @@ if ($controls->is_action('create')) {
329
  <tr valign="top">
330
  <th>Welcome message</th>
331
  <td>
332
- <?php $controls->editor('confirmed_text'); ?>
333
- <div class="hints">
334
  Showed when the user follow the confirmation URL sent to him with previous email
335
  settings or if signed up directly with no double opt-in process. You can use the <strong>{profile_form}</strong> tag to let the user to
336
  complete it's profile.
337
- </div>
338
  </td>
339
  </tr>
340
 
@@ -342,10 +377,10 @@ if ($controls->is_action('create')) {
342
  <th>Alternative custom welcome page</th>
343
  <td>
344
  <?php $controls->text('confirmed_url', 70); ?>
345
- <div class="hints">
346
  A full page address (http://yourblog.com/welcome) to be used instead of message above. If empty the message is
347
  used.
348
- </div>
349
  </td>
350
  </tr>
351
 
@@ -353,11 +388,12 @@ if ($controls->is_action('create')) {
353
  <th>Conversion tracking code<br/><small>ADVANCED</small></th>
354
  <td>
355
  <?php $controls->textarea('confirmed_tracking'); ?>
356
- <div class="hints">
357
  The code is injected AS-IS in welcome page and can be used to track conversion
358
  (you can use PHP if needed). It does not work with a custom welcome page.
359
  Conversion code is usually supply by tracking services,
360
- like Google AdWords, Google Analytics and so on.</div>
 
361
  </td>
362
  </tr>
363
 
@@ -367,36 +403,66 @@ if ($controls->is_action('create')) {
367
  Welcome email<br /><small>The right place where to put bonus content link</small>
368
  </th>
369
  <td>
370
- <?php $controls->email('confirmed', null, true); ?>
371
- <div class="hints">
372
  Email sent to the user to confirm his subscription, the successful confirmation
373
  page, the welcome email. This is the right message where to put a <strong>{unlock_url}</strong> link to remember to the
374
  user where is the premium content (if any, main configuration panel).<br />
375
  It's a good idea to add the <strong>{unsubscription_url}</strong> too and the <strong>{profile_url}</strong>
376
  letting users to cancel or manage/complete their profile.
377
- </div>
378
  </td>
379
  </tr>
380
 
381
  </table>
382
  </div>
383
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  <!-- PROFILE -->
385
  <div id="tabs-9">
386
- <div class="tab-preamble">
387
- <p>
388
- The page shown when the subscriber wants to edit hid profile following the link
389
- {profile_url} you added to a newsletter.
390
- </p>
391
- </div>
392
 
393
  <table class="form-table">
394
  <tr valign="top">
395
  <th>Profile page</th>
396
  <td>
397
  <?php $controls->editor('profile_text'); ?>
398
- <?php $controls->hint('This is the page where subscribers can edit their data and it must contain the {profile_form} tag.',
399
- 'http://www.satollo.net/plugins/newsletter/subscription-module#profile'); ?>
400
  </td>
401
  </tr>
402
  <tr>
@@ -410,12 +476,14 @@ if ($controls->is_action('create')) {
410
 
411
 
412
  <div id="tabs-5">
413
- <p class="intro">
 
414
  A user starts the cancellation process clicking the unsubscription link in
415
  a newsletter. This link contains the email to unsubscribe and some unique information
416
  to avoid hacking. The user are required to confirm the unsubscription: this is the last
417
  step where YOU can communicate with your almost missed user.
418
- <br />
 
419
  To create immediate cancellation, you can use the <strong>{unsubscription_confirm_url}</strong>
420
  in your newsletters and upon click on that link goodbye message and email are used directly
421
  skipping the confirm request.
@@ -426,11 +494,11 @@ if ($controls->is_action('create')) {
426
  <th>Cancellation message</th>
427
  <td>
428
  <?php $controls->editor('unsubscription_text'); ?>
429
- <div class="hints">
430
  This text is show to users who click on a "unsubscription link" in a newsletter
431
  email. You <strong>must</strong> insert a link in the text that user can follow to confirm the
432
  unsubscription request using the tag <strong>{unsubscription_confirm_url}</strong>.
433
- </div>
434
  </td>
435
  </tr>
436
 
@@ -439,9 +507,9 @@ if ($controls->is_action('create')) {
439
  <th>Goodbye message</th>
440
  <td>
441
  <?php $controls->editor('unsubscribed_text'); ?>
442
- <div class="hints">
443
  Shown to users after the cancellation has been completed.
444
- </div>
445
  </td>
446
  </tr>
447
 
@@ -450,10 +518,10 @@ if ($controls->is_action('create')) {
450
  <th>Goodbye email</th>
451
  <td>
452
  <?php $controls->email('unsubscribed'); ?>
453
- <div class="hints">
454
  Sent after a cancellation, is the last message you send to the user before his removal
455
  from your newsletter subscribers. Leave the subject empty to disable this message.
456
- </div>
457
  </td>
458
  </tr>
459
  </table>
@@ -501,19 +569,22 @@ if ($controls->is_action('create')) {
501
  </div>
502
 
503
 
504
- <div id="tabs-wp">
505
- <div class="tab-preamble">
506
- <p>Configure if and how a regular WordPress user registration can be connected to a Newsletter subscription.</p>
507
- <p>Important! This type of subscription does not require confirmation, it's automatic on first login.
508
- <a href="http://www.satollo.net/plugins/newsletter/subscription-module#registration" target="_blank">Read more on documentation page</a>.
509
  </p>
510
- </div>
 
 
 
 
511
  <table class="form-table">
512
  <tr valign="top">
513
  <th>Subscription on registration</th>
514
  <td>
515
- <?php $controls->select('subscribe_wp_users', array(0=>'No', 1=>'Yes, force subscription', 2=>'Yes, show the option', 3=>'Yes, show the option already checked')); ?>
516
- <?php $controls->hint('Adds a newsletter subscription option on registration.', 'http://www.satollo.net/plugins/newsletter/subscription-module#registration'); ?>
517
  </td>
518
  </tr>
519
  <tr valign="top">
@@ -529,10 +600,10 @@ if ($controls->is_action('create')) {
529
  </td>
530
  </tr>
531
  </table>
532
- </div>
533
  </div>
 
534
 
535
- <p class="submit">
536
  <?php $controls->button('save', 'Save'); ?>
537
  <?php $controls->button_confirm('reset', 'Reset all', 'Are you sure you want to reset all?'); ?>
538
  </p>
62
  $controls->messages = 'Saved.';
63
  }
64
 
65
+ if ($controls->is_action('create')) {
66
  $page = array();
67
  $page['post_title'] = 'Newsletter';
68
  $page['post_content'] = '[newsletter]';
77
 
78
  $controls->data['url'] = get_permalink($page_id);
79
  $module->save_options($controls->data);
80
+ }
81
 
82
  if ($controls->is_action('reset')) {
83
  $controls->data = $module->reset_options();
84
  }
85
 
86
+ if ($controls->is_action('reset-template')) {
87
+ $controls->data['template'] = file_get_contents(dirname(__FILE__) . '/email.html');
88
+ }
89
+
90
+ if ($controls->is_action('test-template')) {
91
+
92
+ $users = NewsletterUsers::instance()->get_test_users();
93
+ if (count($users) == 0) {
94
+ $controls->errors = 'There are no test subscribers. Read more about test subscribers <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank">here</a>.';
95
+ } else {
96
+ $template = $controls->data['template'];
97
+ if (strpos($template, '{message}') === false) {
98
+ $template .= '{message}';
99
+ }
100
+ $message = '<p>This is a generic example of message embedded inside the template.</p>';
101
+ $message = str_replace('{message}', $message, $template);
102
+ $addresses = array();
103
+ foreach ($users as &$user) {
104
+ $addresses[] = $user->email;
105
+ Newsletter::instance()->mail($user->email, 'Newsletter Messages Template Test', $newsletter->replace($message, $user));
106
+ }
107
+ $controls->messages .= 'Test emails sent to ' . count($users) . ' test subscribers: ' .
108
+ implode(', ', $addresses) . '. Read more about test subscribers <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank">here</a>.';
109
+ }
110
+ }
111
+
112
+ if ($controls->is_action('test-confirmation')) {
113
+
114
+ $users = NewsletterUsers::instance()->get_test_users();
115
+ if (count($users) == 0) {
116
+ $controls->errors = 'There are no test subscribers. Read more about test subscribers <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank">here</a>.';
117
+ } else {
118
+ $template = $controls->data['template'];
119
+ if (strpos($template, '{message}') === false) {
120
+ $template .= '{message}';
121
+ }
122
+ $message = '<p>This is a generic example of message embedded inside the template.</p>';
123
+ $message = str_replace('{message}', $message, $template);
124
+ $addresses = array();
125
+ foreach ($users as &$user) {
126
+ $addresses[] = $user->email;
127
+ $res = $module->mail($user->email, $module->options['confirmation_subject'], $newsletter->replace($module->options['confirmation_message'], $user));
128
+ if (!$res) {
129
+ $controls->errors = 'The email address ' . $user->email . ' failed.';
130
+ break;
131
+ }
132
+ }
133
+ $controls->messages .= 'Test emails sent to ' . count($users) . ' test subscribers: ' .
134
+ implode(', ', $addresses) . '. Read more about test subscribers <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank">here</a>.';
135
+ $controls->messages .= '<br>If the message is not received, try to chnage the message text it could trigger some antispam filters.';
136
+ }
137
+ }
138
+
139
  } else {
140
  $controls->data = get_option('newsletter', array());
141
 
147
  }
148
  ?>
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  <div class="wrap">
151
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module'; ?>
152
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
153
 
154
  <div id="newsletter-title">
168
  Page layout where messages are shown is managed by subscription/page.php file which contains instruction on how to
169
  customize it OR use a WordPress page for messages as described on subscription configuration.
170
  </p>
171
+ </div>
172
  <div class="newsletter-separator"></div>
173
 
174
 
181
  <li><a href="#tabs-2">Subscription</a></li>
182
  <li><a href="#tabs-3">Confirmation</a></li>
183
  <li><a href="#tabs-4">Welcome</a></li>
184
+ <li><a href="#tabs-8">Template</a></li>
185
  <li><a href="#tabs-9">Profile</a></li>
186
  <li><a href="#tabs-5">Unsubscription</a></li>
187
  <li><a href="#tabs-wp">WP Registration</a></li>
194
  <th>Opt In</th>
195
  <td>
196
  <?php $controls->select('noconfirmation', array(0 => 'Double Opt In', 1 => 'Single Opt In')); ?>
197
+ <p class="description">
198
  <strong>Double Opt In</strong> means subscribers need to confirm their email address by an activation link sent them on a activation email message.<br />
199
  <strong>Single Opt In</strong> means subscribers do not need to confirm their email address.<br />
200
+ </p>
201
  </td>
202
  </tr>
203
  <tr valign="top">
210
  }
211
  ?>
212
 
213
+ <p class="description">
214
  Optional (but recommended) an address of a WordPress page (eg. <?php echo get_option('home') . '/newsletter'; ?>)
215
  you <strong>manually created</strong> for subscription and messages.
216
  <br>
217
  The page must have in its body <strong>only</strong> the short code <strong>[newsletter]</strong> (as is).
218
 
219
  <?php if (!empty($controls->data['url'])) { ?>
220
+ <br>
221
+ If something is not working as expected with this address you can empty the field above and save: a button will appear
222
+ to create that page automatically.
223
  <?php } ?>
224
+ </p>
225
  </td>
226
  </tr>
227
+ <?php /*
228
  <tr valign="top">
229
  <th>Disable visual editors?</th>
230
  <td>
231
  <?php $controls->yesno('novisual'); ?>
232
+ <p class="description">
233
+ If you prefer to edit the messages on this cofiguration panel writing them in HTML, you can
234
+ disable the visual editors.
235
+ </p>
236
  </td>
237
  </tr>
238
+ */ ?>
239
+ <tr valign="top">
240
  <th>Notifications</th>
241
  <td>
242
  <?php $controls->yesno('notify'); ?>
243
  to: <?php $controls->text_email('notify_email'); ?> (email address, leave empty for the WordPress administration email <?php echo get_option('admin_email'); ?>)
244
+ <p class="description">
245
+ Notifications are sent on confirmed subscriptions and cancellations.
246
+ </p>
247
  </td>
248
  </tr>
249
+ </table>
 
 
250
  </div>
251
 
252
 
256
  <tr valign="top">
257
  <th>Subscription page</th>
258
  <td>
259
+ <?php $controls->wp_editor('subscription_text'); ?>
260
+ <p class="description">
261
+ Use <strong>{subscription_form}</strong> to insert the subscription form where you prefer in the text or
262
  <strong>{subscription_form_N}</strong> (with N from 1 to 10) to insert one of the custom forms.
263
+ </p>
264
  </td>
265
  </tr>
266
  <tr valign="top">
267
  <th>Forced preferences</th>
268
  <td>
269
  <?php $controls->preferences(); ?>
270
+ <p class="description">
271
  Add to new subscribers these preferences by default.
272
+ </p>
273
  </td>
274
  </tr>
275
  <tr valign="top">
289
  <tr valign="top">
290
  <th>Already subscribed page content</th>
291
  <td>
292
+ <?php $controls->wp_editor('already_confirmed_text'); ?><br>
293
  <?php $controls->checkbox('resend_welcome_email_disabled', 'Do not resend the welcome email'); ?>
294
+ <p class="description">
295
+ Shown when the email is already subscribed and confirmed. The welcome email, if not disabled, will
296
  be sent. Find out more on this topic on its
297
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module#repeated" target="_blank">documentation page</a>.
298
+ </p>
299
  </td>
300
  </tr>
301
  <tr valign="top">
302
  <th>Error page content</th>
303
  <td>
304
+ <?php $controls->wp_editor('error_text'); ?>
305
+ <p class="description">
306
+ Message shown when the email is bounced or other errors occurred.
307
+ </p>
308
  </td>
309
  </tr>
310
  </table>
312
 
313
 
314
  <div id="tabs-3">
315
+
316
+ <p>This configuration applies only when you sent the double opt-in mode.</p>
 
317
 
318
  <table class="form-table">
319
  <tr valign="top">
320
  <th>Confirmation required message</th>
321
  <td>
322
+ <?php $controls->wp_editor('confirmation_text'); ?>
323
+ <p class="description">
324
+ This message is shown to just subscribed users which require to confirm the subscription
325
+ following the instructions sent them with the following email. Invite them to check the mailbox and to
326
+ give a look to the spam folder if no messages are received within 10 minutes.
327
+ </p>
328
  </td>
329
  </tr>
330
 
332
  <th>Alternative custom confirmation required page</th>
333
  <td>
334
  <?php $controls->text('confirmation_url', 70); ?>
335
+ <p class="description">
336
+ A full page address (http://yourblog.com/confirm) to be used instead of message above.
337
+ If left empty the message above is used.
338
+ </p>
339
  </td>
340
  </tr>
341
 
344
  <tr valign="top">
345
  <th>Confirmation email</th>
346
  <td>
347
+ <?php $controls->email('confirmation', 'wordpress'); ?>
348
+ <?php $controls->button('test-confirmation', 'Send a test'); ?>
349
+ <p class="description">
350
  Message sent by email to new subscribers with instructions to confirm their subscription
351
  (for double opt-in process). Do not forget to add the <strong>{subscription_confirm_url}</strong>
352
  that users must click to activate their subscription.<br />
353
  Sometime can be useful to add a <strong>{unsubscription_url}</strong> to let users to
354
+ cancel if they wrongly subscribed to your newsletter.
355
+ </p>
356
  </td>
357
  </tr>
358
  </table>
364
  <tr valign="top">
365
  <th>Welcome message</th>
366
  <td>
367
+ <?php $controls->wp_editor('confirmed_text'); ?>
368
+ <p class="description">
369
  Showed when the user follow the confirmation URL sent to him with previous email
370
  settings or if signed up directly with no double opt-in process. You can use the <strong>{profile_form}</strong> tag to let the user to
371
  complete it's profile.
372
+ </p>
373
  </td>
374
  </tr>
375
 
377
  <th>Alternative custom welcome page</th>
378
  <td>
379
  <?php $controls->text('confirmed_url', 70); ?>
380
+ <p class="description">
381
  A full page address (http://yourblog.com/welcome) to be used instead of message above. If empty the message is
382
  used.
383
+ </p>
384
  </td>
385
  </tr>
386
 
388
  <th>Conversion tracking code<br/><small>ADVANCED</small></th>
389
  <td>
390
  <?php $controls->textarea('confirmed_tracking'); ?>
391
+ <p class="description">
392
  The code is injected AS-IS in welcome page and can be used to track conversion
393
  (you can use PHP if needed). It does not work with a custom welcome page.
394
  Conversion code is usually supply by tracking services,
395
+ like Google AdWords, Google Analytics and so on.
396
+ </p>
397
  </td>
398
  </tr>
399
 
403
  Welcome email<br /><small>The right place where to put bonus content link</small>
404
  </th>
405
  <td>
406
+ <?php $controls->email('confirmed', 'wordpress', true); ?>
407
+ <p class="description">
408
  Email sent to the user to confirm his subscription, the successful confirmation
409
  page, the welcome email. This is the right message where to put a <strong>{unlock_url}</strong> link to remember to the
410
  user where is the premium content (if any, main configuration panel).<br />
411
  It's a good idea to add the <strong>{unsubscription_url}</strong> too and the <strong>{profile_url}</strong>
412
  letting users to cancel or manage/complete their profile.
413
+ </p>
414
  </td>
415
  </tr>
416
 
417
  </table>
418
  </div>
419
 
420
+ <!-- TEMPLATE -->
421
+ <div id="tabs-8">
422
+ <p>
423
+ Edit the default template of confirmation, welcome and cancellation emails. Add the {message} tag where you
424
+ want the specific message text to be included.
425
+ </p>
426
+
427
+ <table class="form-table">
428
+ <tr valign="top">
429
+ <th>Enabled?</th>
430
+ <td>
431
+ <?php $controls->yesno('template_enabled'); ?>
432
+ <p class="description">
433
+ When not enabled, the old templating system is used (see the file
434
+ wp-content/plugins/newsletter/subscription/email.php).
435
+ </p>
436
+ </td>
437
+ </tr>
438
+ <tr valign="top">
439
+ <th>Email template</th>
440
+ <td>
441
+ <?php $controls->textarea('template'); ?>
442
+ <?php $controls->button('reset-template', 'Reset this template'); ?>
443
+ <?php $controls->button('test-template', 'Send a test'); ?>
444
+ </td>
445
+ </tr>
446
+ </table>
447
+
448
+ </div>
449
+
450
  <!-- PROFILE -->
451
  <div id="tabs-9">
452
+
453
+ <p>
454
+ The page shown when the subscriber wants to edit hid profile following the link
455
+ {profile_url} you added to a newsletter.
456
+ </p>
457
+
458
 
459
  <table class="form-table">
460
  <tr valign="top">
461
  <th>Profile page</th>
462
  <td>
463
  <?php $controls->editor('profile_text'); ?>
464
+ <?php $controls->hint('This is the page where subscribers can edit their data and it must contain the {profile_form} tag.', 'http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module#profile');
465
+ ?>
466
  </td>
467
  </tr>
468
  <tr>
476
 
477
 
478
  <div id="tabs-5">
479
+
480
+ <p>
481
  A user starts the cancellation process clicking the unsubscription link in
482
  a newsletter. This link contains the email to unsubscribe and some unique information
483
  to avoid hacking. The user are required to confirm the unsubscription: this is the last
484
  step where YOU can communicate with your almost missed user.
485
+ </p>
486
+ <p>
487
  To create immediate cancellation, you can use the <strong>{unsubscription_confirm_url}</strong>
488
  in your newsletters and upon click on that link goodbye message and email are used directly
489
  skipping the confirm request.
494
  <th>Cancellation message</th>
495
  <td>
496
  <?php $controls->editor('unsubscription_text'); ?>
497
+ <p class="description">
498
  This text is show to users who click on a "unsubscription link" in a newsletter
499
  email. You <strong>must</strong> insert a link in the text that user can follow to confirm the
500
  unsubscription request using the tag <strong>{unsubscription_confirm_url}</strong>.
501
+ </p>
502
  </td>
503
  </tr>
504
 
507
  <th>Goodbye message</th>
508
  <td>
509
  <?php $controls->editor('unsubscribed_text'); ?>
510
+ <p class="description">
511
  Shown to users after the cancellation has been completed.
512
+ </p>
513
  </td>
514
  </tr>
515
 
518
  <th>Goodbye email</th>
519
  <td>
520
  <?php $controls->email('unsubscribed'); ?>
521
+ <p class="description">
522
  Sent after a cancellation, is the last message you send to the user before his removal
523
  from your newsletter subscribers. Leave the subject empty to disable this message.
524
+ </p>
525
  </td>
526
  </tr>
527
  </table>
569
  </div>
570
 
571
 
572
+ <div id="tabs-wp">
573
+
574
+ <p>
575
+ Configure if and how a regular WordPress user registration can be connected to a Newsletter subscription.
 
576
  </p>
577
+ <p>
578
+ Important! This type of subscription does not require confirmation, it's automatic on first login.
579
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module#registration" target="_blank">Read more on documentation page</a>.
580
+ </p>
581
+
582
  <table class="form-table">
583
  <tr valign="top">
584
  <th>Subscription on registration</th>
585
  <td>
586
+ <?php $controls->select('subscribe_wp_users', array(0 => 'No', 1 => 'Yes, force subscription', 2 => 'Yes, show the option', 3 => 'Yes, show the option already checked')); ?>
587
+ <?php $controls->hint('Adds a newsletter subscription option on registration.', 'http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module#registration'); ?>
588
  </td>
589
  </tr>
590
  <tr valign="top">
600
  </td>
601
  </tr>
602
  </table>
 
603
  </div>
604
+ </div>
605
 
606
+ <p>
607
  <?php $controls->button('save', 'Save'); ?>
608
  <?php $controls->button_confirm('reset', 'Reset all', 'Are you sure you want to reset all?'); ?>
609
  </p>
subscription/profile.php CHANGED
@@ -41,7 +41,7 @@ $rules = array(0 => 'Optional', 1 => 'Required');
41
  </script>
42
 
43
  <div class="wrap">
44
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/subscription-module'; ?>
45
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
46
 
47
  <div id="newsletter-title">
@@ -51,7 +51,7 @@ $rules = array(0 => 'Optional', 1 => 'Required');
51
  <p>
52
  This panel contains the configuration of the subscription and profile editing forms which collect the subscriber data you want to have.<br>
53
  And let you to <strong>translate</strong> every single button and label.<br>
54
- <strong>Preferences</strong> can be an important setting for your newsletter: <a href="http://www.satollo.net/plugins/newsletter/newsletter-preferences" target="_blank">here you can read more about them</a>.
55
  </p>
56
 
57
  </div>
@@ -73,9 +73,9 @@ $rules = array(0 => 'Optional', 1 => 'Required');
73
  </ul>
74
 
75
  <div id="tabs-2">
76
- <div class="tab-preamble">
77
- <p>The main subscriber fields. Only the email field is, of course, mandatory.</p>
78
- </div>
79
  <table class="form-table">
80
  <tr>
81
  <th>Email</th>
@@ -95,10 +95,10 @@ $rules = array(0 => 'Optional', 1 => 'Required');
95
  <tr><th>Rules</th><td><?php $controls->select('name_rules', $rules); ?></td></tr>
96
  <tr><th>Error message</th><td><?php $controls->text('name_error', 50); ?></td></tr>
97
  </table>
98
- <div class="hints">
99
  If you want to collect only a generic "name", use only this field and not the
100
  last name field.
101
- </div>
102
  </td>
103
  </tr>
104
  <tr>
@@ -131,10 +131,10 @@ $rules = array(0 => 'Optional', 1 => 'Required');
131
  for others: <?php $controls->text('title_none'); ?>
132
  </td></tr>
133
  </table>
134
- <div class="hints">
135
  Salutation titles are inserted in emails message when the tag {title} is used. For example
136
  "Good morning {title} {surname} {name}".
137
- </div>
138
  </td>
139
  </tr>
140
 
@@ -145,104 +145,95 @@ $rules = array(0 => 'Optional', 1 => 'Required');
145
  <tr><th>Subscribe button</th><td><?php $controls->text('subscribe'); ?></td></tr>
146
  <tr><th>Save button</th><td><?php $controls->text('save'); ?> (on profile page)</td></tr>
147
  </table>
148
- <div class="hints">
149
  For "subscribe" insert an URL to an image (http://...) to use it as a graphical button.
150
- </div>
151
  </td>
152
  </tr>
 
153
  <tr>
154
  <th>Privacy check box</th>
155
  <td>
156
  <table class="newsletter-option-grid">
157
- <tr><th>Enabled?</th><?php $controls->yesno('privacy_status'); ?></td></tr>
158
  <tr><th>Label</th><td><?php $controls->text('privacy', 50); ?></td></tr>
159
- <tr><th>Error message</th><td><?php $controls->text('privacy_error', 50); ?></td></tr>
160
  <tr><th>Privacy URL</th><td><?php $controls->text('privacy_url', 50); ?></td></tr>
 
161
  </table>
 
 
 
 
162
  </td>
163
  </tr>
164
 
165
-
166
  </table>
167
  </div>
168
 
169
 
170
  <div id="tabs-3">
171
- <table class="form-table">
172
- <tr>
173
- <th>Generic profile fields</th>
174
- <td>
175
- <div class="hints">Fields of type "list" must be configured with a set of options, comma separated
176
- like: "first option, second option, third option".
177
- </div>
178
- <table class="widefat">
179
- <thead>
180
- <tr>
181
- <th>Field</th><th>Label</th><th>When/Where</th><th>Type</th><th>Configuration</th>
182
- </tr>
183
- </thead>
184
- <?php for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) { ?>
185
- <tr>
186
- <td>Profile <?php echo $i; ?></td>
187
- <td><?php $controls->text('profile_' . $i); ?></td>
188
- <td><?php $controls->select('profile_' . $i . '_status', $status); ?></td>
189
- <td><?php $controls->select('profile_' . $i . '_type', array('text' => 'Text', 'select' => 'List')); ?></td>
190
- <td>
191
- <?php $controls->textarea_fixed('profile_' . $i . '_options', '300px', '50px'); ?>
192
- </td>
193
- </tr>
194
- <?php } ?>
195
- </table>
196
- <div class="hints">
197
- Those fields are collected as texts, Newsletter Pro does not give meaning to them, it just stores them.
198
- </div>
199
- </td>
200
- </tr>
201
  </table>
 
202
  </div>
203
 
204
 
205
  <div id="tabs-4">
206
  <p>
207
- Preferences are on/off choices users can change on their profile. Those preferences are then
208
- used by you to target emails you create.
 
209
  </p>
210
- <table class="form-table">
211
- <tr>
212
- <th>Preferences</th>
213
- <td>
214
- <table class="widefat">
215
- <thead>
216
- <tr>
217
- <th>Field</th>
218
- <th>When/Where</th>
219
- <th>Name</th>
220
- <th>&nbsp;</th>
221
- </tr>
222
- </thead>
223
- <?php for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) { ?>
224
- <tr>
225
- <td>Preference <?php echo $i; ?></td>
226
- <td><?php $controls->select('list_' . $i . '_status', $status); ?></td>
227
- <td><?php $controls->text('list_' . $i); ?></td>
228
- <td><?php $controls->select('list_' . $i . '_checked', array(0 => 'Uncheked', 1 => 'Checked')); ?></td>
229
- </tr>
230
- <?php } ?>
231
- </table>
232
- <div class="hints">
233
- Disabled preferences are not selectable by users but they can be assigned from admin panels, so they can be
234
- considered as private user preferences.
235
- </div>
236
- </td>
237
- </tr>
238
  </table>
 
239
  </div>
240
 
241
 
242
  <div id="tabs-5">
243
- <div class="tab-preamble">
244
- <p>This panel shows the form HTML code generated by Newsletter if you want to copy it as starting point for a custom form.</p>
245
- </div>
246
 
247
  <h3>Standard form code</h3>
248
  <textarea readonly style="width: 100%; height: 500px; font-family: monospace"><?php echo htmlspecialchars(NewsletterSubscription::instance()->get_subscription_form()); ?></textarea>
@@ -253,9 +244,7 @@ $rules = array(0 => 'Optional', 1 => 'Required');
253
  </div>
254
 
255
  <div id="tabs-6">
256
- <div class="tab-preamble">
257
- <p></p>
258
- </div>
259
  <table class="form-table">
260
  <tr>
261
  <th>Subscription form style</th>
@@ -274,7 +263,7 @@ $rules = array(0 => 'Optional', 1 => 'Required');
274
 
275
  </div>
276
 
277
- <p class="submit">
278
  <?php $controls->button('save', 'Save'); ?>
279
  <?php $controls->button_confirm('reset', 'Reset all', 'Are you sure you want to reset all?'); ?>
280
  </p>
41
  </script>
42
 
43
  <div class="wrap">
44
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/subscription-module'; ?>
45
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
46
 
47
  <div id="newsletter-title">
51
  <p>
52
  This panel contains the configuration of the subscription and profile editing forms which collect the subscriber data you want to have.<br>
53
  And let you to <strong>translate</strong> every single button and label.<br>
54
+ <strong>Preferences</strong> can be an important setting for your newsletter: <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">here you can read more about them</a>.
55
  </p>
56
 
57
  </div>
73
  </ul>
74
 
75
  <div id="tabs-2">
76
+
77
+ <p>The main subscriber fields. Only the email field is, of course, mandatory.</p>
78
+
79
  <table class="form-table">
80
  <tr>
81
  <th>Email</th>
95
  <tr><th>Rules</th><td><?php $controls->select('name_rules', $rules); ?></td></tr>
96
  <tr><th>Error message</th><td><?php $controls->text('name_error', 50); ?></td></tr>
97
  </table>
98
+ <p class="description">
99
  If you want to collect only a generic "name", use only this field and not the
100
  last name field.
101
+ </p>
102
  </td>
103
  </tr>
104
  <tr>
131
  for others: <?php $controls->text('title_none'); ?>
132
  </td></tr>
133
  </table>
134
+ <p class="description">
135
  Salutation titles are inserted in emails message when the tag {title} is used. For example
136
  "Good morning {title} {surname} {name}".
137
+ </p>
138
  </td>
139
  </tr>
140
 
145
  <tr><th>Subscribe button</th><td><?php $controls->text('subscribe'); ?></td></tr>
146
  <tr><th>Save button</th><td><?php $controls->text('save'); ?> (on profile page)</td></tr>
147
  </table>
148
+ <p class="description">
149
  For "subscribe" insert an URL to an image (http://...) to use it as a graphical button.
150
+ </p>
151
  </td>
152
  </tr>
153
+
154
  <tr>
155
  <th>Privacy check box</th>
156
  <td>
157
  <table class="newsletter-option-grid">
158
+ <tr><th>Enabled?</th><td><?php $controls->yesno('privacy_status'); ?></td></tr>
159
  <tr><th>Label</th><td><?php $controls->text('privacy', 50); ?></td></tr>
 
160
  <tr><th>Privacy URL</th><td><?php $controls->text('privacy_url', 50); ?></td></tr>
161
+ <tr><th>Error message</th><td><?php $controls->text('privacy_error', 50); ?></td></tr>
162
  </table>
163
+ <p class="description">
164
+ The privacy acceptance checkbox (required in many Europen countries) force the subscriber to
165
+ check it to procees. If an URL is specified the label is linket to that page.
166
+ </p>
167
  </td>
168
  </tr>
169
 
 
170
  </table>
171
  </div>
172
 
173
 
174
  <div id="tabs-3">
175
+ <p>
176
+ Generic textual profile fields that can be collected during the subscription. Field formats can be one line text
177
+ or selection list. Fields of type "list" must be configured with a set of options, comma separated
178
+ like: "first option, second option, third option".
179
+ </p>
180
+
181
+ <table class="widefat">
182
+ <thead>
183
+ <tr>
184
+ <th>Field</th><th>Name/Label</th><th>Placeholder</th><th>When/Where</th><th>Type</th><th>Rule</th><th>List values comma separated</th>
185
+ </tr>
186
+ </thead>
187
+ <?php for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) { ?>
188
+ <tr>
189
+ <td>Profile <?php echo $i; ?></td>
190
+ <td><?php $controls->text('profile_' . $i); ?></td>
191
+ <td><?php $controls->text('profile_' . $i . '_placeholder'); ?></td>
192
+ <td><?php $controls->select('profile_' . $i . '_status', $status); ?></td>
193
+ <td><?php $controls->select('profile_' . $i . '_type', array('text' => 'Text', 'select' => 'List')); ?></td>
194
+ <td><?php $controls->select('profile_' . $i . '_rules', $rules); ?></td>
195
+ <td>
196
+ <?php $controls->textarea_fixed('profile_' . $i . '_options', '200px', '50px'); ?>
197
+ </td>
198
+ </tr>
199
+ <?php } ?>
 
 
 
 
 
200
  </table>
201
+
202
  </div>
203
 
204
 
205
  <div id="tabs-4">
206
  <p>
207
+ Preferences are on/off choices users can select during subscription and change on their profile.
208
+ Those preferences are then used by you to target emails you create. Private preferenced can be used
209
+ to create group/list since the subscriber cannot change them.
210
  </p>
211
+
212
+ <table class="widefat">
213
+ <thead>
214
+ <tr>
215
+ <th>Field</th>
216
+ <th>Name/Label</th>
217
+ <th>When/Where</th>
218
+ <th>Initially...</th>
219
+ </tr>
220
+ </thead>
221
+ <?php for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) { ?>
222
+ <tr>
223
+ <td>Preference <?php echo $i; ?></td>
224
+ <td><?php $controls->text('list_' . $i); ?></td>
225
+ <td><?php $controls->select('list_' . $i . '_status', $status); ?></td>
226
+ <td><?php $controls->select('list_' . $i . '_checked', array(0 => 'Unchecked', 1 => 'Checked')); ?></td>
227
+ </tr>
228
+ <?php } ?>
 
 
 
 
 
 
 
 
 
 
229
  </table>
230
+
231
  </div>
232
 
233
 
234
  <div id="tabs-5">
235
+
236
+ <p>This panel shows the form HTML code generated by Newsletter if you want to copy it as starting point for a custom form.</p>
 
237
 
238
  <h3>Standard form code</h3>
239
  <textarea readonly style="width: 100%; height: 500px; font-family: monospace"><?php echo htmlspecialchars(NewsletterSubscription::instance()->get_subscription_form()); ?></textarea>
244
  </div>
245
 
246
  <div id="tabs-6">
247
+
 
 
248
  <table class="form-table">
249
  <tr>
250
  <th>Subscription form style</th>
263
 
264
  </div>
265
 
266
+ <p>
267
  <?php $controls->button('save', 'Save'); ?>
268
  <?php $controls->button_confirm('reset', 'Reset all', 'Are you sure you want to reset all?'); ?>
269
  </p>
subscription/styles/shortcode-default.css ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .newsletter-form {
2
+ width: 100%;
3
+ display: block;
4
+ margin: 15px 0;
5
+ border: 0;
6
+ }
7
+
8
+ .newsletter-field {
9
+ clear: both;
10
+ text-align: left;
11
+ }
12
+
13
+ .newsletter-field label {
14
+ display: inline-block;
15
+ width: 135px;
16
+ font-size: 14px;
17
+ line-height: normal;
18
+ text-align: right;
19
+ margin-right: 15px;
20
+ }
21
+
22
+ .newsletter-field input, .newsletter-field select {
23
+ padding: 5px;
24
+ font-size: 14px;
25
+ margin-right: 0;
26
+ line-height: normal;
27
+ border: 1px solid rgba(0,0,0,.1);
28
+ border-radius: 2px;
29
+ }
30
+
31
+ .newsletter-field-preference label, .newsletter-field-privacy label {
32
+ text-align: left;
33
+ }
34
+
35
+ .newsletter-field-preference, .newsletter-field-privacy, .newsletter-field-button {
36
+ margin-left: 150px;
37
+ }
38
+
39
+ .newsletter-field-preference input {
40
+ margin-right: 10px;
41
+ }
42
+
43
+ .newsletter-privacy {
44
+ margin-right: 10px;
45
+ }
46
+
47
+ @media all and (max-width: 480px) {
48
+ .newsletter-field label {
49
+ display: block;
50
+ text-align: left;
51
+ width: 100%;
52
+ }
53
+ .newsletter-field-preference label, .newsletter-field-privacy label {
54
+ display: inline;
55
+ width: auto;
56
+ }
57
+ .newsletter-field-preference, .newsletter-field-privacy, .newsletter-field-button {
58
+ margin-left: 0px;
59
+ }
60
+ }
61
+
subscription/subscription.php CHANGED
@@ -19,7 +19,7 @@ class NewsletterSubscription extends NewsletterModule {
19
  }
20
 
21
  function __construct() {
22
- parent::__construct('subscription', '1.1.1');
23
 
24
  add_action('wp_login', array($this, 'hook_wp_login'));
25
 
@@ -29,6 +29,10 @@ class NewsletterSubscription extends NewsletterModule {
29
  }
30
 
31
  function hook_init() {
 
 
 
 
32
  $action = isset($_REQUEST['na']) ? $_REQUEST['na'] : '';
33
  if (empty($action) || is_admin())
34
  return;
@@ -186,32 +190,44 @@ class NewsletterSubscription extends NewsletterModule {
186
  function subscribe($status = null, $emails = true) {
187
  global $newsletter;
188
 
 
189
  $options = get_option('newsletter', array());
 
 
190
  $options_profile = get_option('newsletter_profile', array());
191
 
192
  $opt_in = (int) $this->options['noconfirmation']; // 0 - double, 1 - single
193
 
194
  $email = $newsletter->normalize_email(stripslashes($_REQUEST['ne']));
195
- if ($email == null)
 
 
196
  die('Wrong email');
 
197
 
198
  $user = $newsletter->get_user($email);
199
 
200
  if ($user != null) {
201
  $this->logger->info('Subscription of an address with status ' . $user->status);
 
 
202
  if ($user->status == 'B') {
 
203
  $user->status = 'E';
204
  return $user;
205
  }
206
 
207
  // Already confirmed
208
  if ($user->status == 'C') {
 
 
209
  if ($emails && !isset($options['resend_welcome_email_disabled']) && !isset($options['confirmed_disabled'])) {
210
  $message = $options[$prefix . 'confirmed_message'];
211
  $subject = $options[$prefix . 'confirmed_subject'];
212
  $this->mail($user->email, $newsletter->replace($subject, $user), $newsletter->replace($message, $user));
213
  }
214
 
 
215
  $user->status = 'A';
216
  return $user;
217
  }
@@ -231,24 +247,27 @@ class NewsletterSubscription extends NewsletterModule {
231
  $user['surname'] = $newsletter->normalize_name(stripslashes($_REQUEST['ns']));
232
  // TODO: required checking
233
 
234
- if (!empty($_REQUEST['nx']))
235
- $user['sex'] = $_REQUEST['nx'][0];
 
236
  // TODO: valid values check
237
 
238
- $user['referrer'] = $_REQUEST['nr'];
239
- $user['http_referer'] = $_SERVER['HTTP_REFERER'];
240
 
241
  // New profiles
242
  for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
243
  // If the profile cannot be set by subscriber, skip it.
244
- if ($options_profile['profile_' . $i . '_status'] == 0)
245
  continue;
 
246
 
247
  $user['profile_' . $i] = trim(stripslashes($_REQUEST['np' . $i]));
248
  }
249
 
250
  // Preferences (field names are nl[] and values the list number so special forms with radio button can work)
251
  if (is_array($_REQUEST['nl'])) {
 
252
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
253
  // If not zero it is selectable by user (on subscription or on profile)
254
  if ($options_profile['list_' . $i . '_status'] == 0)
@@ -256,6 +275,8 @@ class NewsletterSubscription extends NewsletterModule {
256
  if (in_array($i, $_REQUEST['nl']))
257
  $user['list_' . $i] = 1;
258
  }
 
 
259
  }
260
 
261
  // Forced preferences as set on subscription configuration
@@ -267,15 +288,10 @@ class NewsletterSubscription extends NewsletterModule {
267
 
268
  $user['token'] = $newsletter->get_token();
269
  $user['ip'] = $_SERVER['REMOTE_ADDR'];
270
- if ($status != null)
271
  $user['status'] = $status;
272
- else
273
  $user['status'] = $opt_in == 1 ? 'C' : 'S';
274
-
275
- // TODO: add the flow integration?
276
-
277
- if (isset($flow)) {
278
- $user['flow'] = $flow;
279
  }
280
 
281
  $user = apply_filters('newsletter_user_subscribe', $user);
@@ -283,8 +299,9 @@ class NewsletterSubscription extends NewsletterModule {
283
  // TODO: should be removed!!!
284
  if (defined('NEWSLETTER_FEED_VERSION')) {
285
  $options_feed = get_option('newsletter_feed', array());
286
- if ($options_feed['add_new'] == 1)
287
  $user['feed'] = 1;
 
288
  }
289
 
290
  $user = $newsletter->save_user($user);
@@ -295,9 +312,9 @@ class NewsletterSubscription extends NewsletterModule {
295
  setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
296
  }
297
 
298
- if (!$emails)
299
  return $user;
300
-
301
 
302
  $prefix = ($user->status == 'C') ? 'confirmed_' : 'confirmation_';
303
 
@@ -319,12 +336,21 @@ class NewsletterSubscription extends NewsletterModule {
319
  * @return type
320
  */
321
  function mail($to, $subject, $message) {
 
 
 
 
 
 
 
 
 
 
 
 
 
322
 
323
- ob_start();
324
- include NEWSLETTER_DIR . '/subscription/email.php';
325
- $message = ob_get_clean();
326
-
327
- Newsletter::instance()->mail($to, $subject, $message);
328
  }
329
 
330
  /**
@@ -559,45 +585,12 @@ class NewsletterSubscription extends NewsletterModule {
559
  list ($id, $token) = @explode('-', $_COOKIE['newsletter'], 2);
560
  }
561
 
562
- if (is_numeric($id) && !empty($token)) {
563
- return $wpdb->get_row($wpdb->prepare("select * from " . NEWSLETTER_USERS_TABLE . " where id=%d and token=%s limit 1", $id, $token));
564
- }
565
-
566
- return null;
567
-
568
- // TODO: Remove!
569
- if ($this->options_main['wp_integration'] != 1) {
570
- return null;
571
- }
572
-
573
- get_currentuserinfo();
574
-
575
- // Retrieve the related newsletter user
576
- $user = $wpdb->get_row("select * from " . NEWSLETTER_USERS_TABLE . " where wp_user_id=" . $current_user->ID . " limit 1");
577
- // There is an email matching?
578
- if (empty($user)) {
579
- $user = $wpdb->get_row($wpdb->prepare("select * from " . NEWSLETTER_USERS_TABLE . " where email=%s limit 1", strtolower($current_user->user_email)));
580
- // If not found, create a new Newsletter user, else update the wp_user_id since this email must be linked
581
- // to the WP user email.
582
- if (empty($user)) {
583
- return null;
584
- //echo 'WP user not found';
585
- $user = array();
586
- $user['status'] = 'C';
587
- $user['wp_user_id'] = $current_user->ID;
588
- $user['token'] = $this->get_token();
589
- $user['email'] = strtolower($current_user->user_email);
590
-
591
- $id = $wpdb->insert(NEWSLETTER_USERS_TABLE, $user);
592
- $user = $newsletter->get_user($id);
593
- } else {
594
- //echo 'WP user found via email';
595
- $wpdb->query($wpdb->prepare("update " . NEWSLETTER_USERS_TABLE . " set wp_user_id=" . $current_user->ID . ", email=%s", $current_user->user_email));
596
  }
597
- } else {
598
- //echo 'WP user found via id';
599
  }
600
-
601
  return $user;
602
  }
603
 
@@ -637,6 +630,223 @@ class NewsletterSubscription extends NewsletterModule {
637
  return $buffer;
638
  }
639
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
640
  /**
641
  * Returns the form html code for subscription.
642
  *
@@ -768,7 +978,7 @@ class NewsletterSubscription extends NewsletterModule {
768
  if ($options_profile['name_status'] == 2) {
769
  $buffer .= '<div class="newsletter-field-div newsletter-firstname-div"><label>' . $options_profile['name'] . '</label>';
770
  $buffer .= '<input class="newsletter-firstname" type="text" name="nn" size="30"' . ($options_profile['name_rules'] == 1 ? 'required' : '') . '></div>';
771
- $buffer .= "\n";
772
  }
773
 
774
  if ($options_profile['surname_status'] == 2) {
@@ -858,6 +1068,20 @@ class NewsletterSubscription extends NewsletterModule {
858
  return $buffer;
859
  }
860
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
861
  /**
862
  * Generate the profile editing form.
863
  */
@@ -917,17 +1141,19 @@ class NewsletterSubscription extends NewsletterModule {
917
  }
918
 
919
  // Lists
920
- $buffer .= '<tr><th>&nbsp;</th><td>';
921
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
922
- if ($options['list_' . $i . '_status'] == 0)
923
  continue;
924
- $buffer .= '<input type="checkbox" name="nl[]" value="' . $i . '"';
 
925
  $list = 'list_' . $i;
926
- if ($user->$list == 1)
927
  $buffer .= ' checked';
928
- $buffer .= '/> ' . htmlspecialchars($options['list_' . $i]) . '<br />';
 
929
  }
930
- $buffer .= '</td></tr>';
931
 
932
  $extra = apply_filters('newsletter_profile_extra', array(), $user);
933
  foreach ($extra as &$x) {
@@ -1013,12 +1239,12 @@ class NewsletterSubscription extends NewsletterModule {
1013
  }
1014
 
1015
  $message .= "token: " . $user->token . "\n" .
1016
- "status: " . $user->status . "\n" .
1017
- "\nYours, Newsletter Pro.";
1018
  $email = trim($this->options['notify_email']);
1019
  if (empty($email))
1020
  $email = get_option('admin_email');
1021
- wp_mail($email, '[' . get_option('blogname') . '] ' . $subject, $message, "Content-type: text/plain; charset=UTF-8\n");
 
1022
  }
1023
 
1024
  }
@@ -1057,7 +1283,7 @@ function newsletter_shortcode($attrs, $content) {
1057
  $module = NewsletterSubscription::instance();
1058
  $user = $module->get_user_from_request();
1059
  $message_key = $module->get_message_key_from_request();
1060
-
1061
 
1062
  $message = $module->options[$message_key . '_text'];
1063
 
@@ -1129,8 +1355,8 @@ function newsletter_subscription_user_register($wp_user_id) {
1129
  $_REQUEST['ne'] = $wp_user->user_email;
1130
  $_REQUEST['nr'] = 'registration';
1131
  // Upon registration there is no last name and first name, sorry.
1132
- // With registration always store as unconfirmed, it will be confirmed on first login
1133
- $user = $module->subscribe('S', false);
1134
 
1135
  // Now we associate it with wp
1136
  $module->set_user_wp_user_id($user->id, $wp_user_id);
19
  }
20
 
21
  function __construct() {
22
+ parent::__construct('subscription', '1.1.2');
23
 
24
  add_action('wp_login', array($this, 'hook_wp_login'));
25
 
29
  }
30
 
31
  function hook_init() {
32
+ add_shortcode('newsletter_profile', array($this, 'shortcode_profile'));
33
+ add_shortcode('newsletter_subscription', array($this, 'shortcode_subscription'));
34
+ add_shortcode('newsletter_field', array($this, 'shortcode_field'));
35
+
36
  $action = isset($_REQUEST['na']) ? $_REQUEST['na'] : '';
37
  if (empty($action) || is_admin())
38
  return;
190
  function subscribe($status = null, $emails = true) {
191
  global $newsletter;
192
 
193
+ // Messages
194
  $options = get_option('newsletter', array());
195
+
196
+ // Form field configuration
197
  $options_profile = get_option('newsletter_profile', array());
198
 
199
  $opt_in = (int) $this->options['noconfirmation']; // 0 - double, 1 - single
200
 
201
  $email = $newsletter->normalize_email(stripslashes($_REQUEST['ne']));
202
+
203
+ // Shound never reach this point without a valid email address
204
+ if ($email == null) {
205
  die('Wrong email');
206
+ }
207
 
208
  $user = $newsletter->get_user($email);
209
 
210
  if ($user != null) {
211
  $this->logger->info('Subscription of an address with status ' . $user->status);
212
+
213
+ // Bounced
214
  if ($user->status == 'B') {
215
+ // Non persistent status to decide which message to show (error)
216
  $user->status = 'E';
217
  return $user;
218
  }
219
 
220
  // Already confirmed
221
  if ($user->status == 'C') {
222
+
223
+ // Resend the welcome email, if enabled
224
  if ($emails && !isset($options['resend_welcome_email_disabled']) && !isset($options['confirmed_disabled'])) {
225
  $message = $options[$prefix . 'confirmed_message'];
226
  $subject = $options[$prefix . 'confirmed_subject'];
227
  $this->mail($user->email, $newsletter->replace($subject, $user), $newsletter->replace($message, $user));
228
  }
229
 
230
+ // Non persistent status to decide which message to show (already subscribed)
231
  $user->status = 'A';
232
  return $user;
233
  }
247
  $user['surname'] = $newsletter->normalize_name(stripslashes($_REQUEST['ns']));
248
  // TODO: required checking
249
 
250
+ if (!empty($_REQUEST['nx'])) {
251
+ $user['sex'] = $this->normalize_sex($_REQUEST['nx'][0]);
252
+ }
253
  // TODO: valid values check
254
 
255
+ $user['referrer'] = strip_tags(trim($_REQUEST['nr']));
256
+ $user['http_referer'] = strip_tags(trim($_SERVER['HTTP_REFERER']));
257
 
258
  // New profiles
259
  for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
260
  // If the profile cannot be set by subscriber, skip it.
261
+ if ($options_profile['profile_' . $i . '_status'] == 0) {
262
  continue;
263
+ }
264
 
265
  $user['profile_' . $i] = trim(stripslashes($_REQUEST['np' . $i]));
266
  }
267
 
268
  // Preferences (field names are nl[] and values the list number so special forms with radio button can work)
269
  if (is_array($_REQUEST['nl'])) {
270
+ $this->logger->debug($_REQUEST['nl']);
271
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
272
  // If not zero it is selectable by user (on subscription or on profile)
273
  if ($options_profile['list_' . $i . '_status'] == 0)
275
  if (in_array($i, $_REQUEST['nl']))
276
  $user['list_' . $i] = 1;
277
  }
278
+ } else {
279
+ $this->logger->debug('No preferences received');
280
  }
281
 
282
  // Forced preferences as set on subscription configuration
288
 
289
  $user['token'] = $newsletter->get_token();
290
  $user['ip'] = $_SERVER['REMOTE_ADDR'];
291
+ if ($status != null) {
292
  $user['status'] = $status;
293
+ } else {
294
  $user['status'] = $opt_in == 1 ? 'C' : 'S';
 
 
 
 
 
295
  }
296
 
297
  $user = apply_filters('newsletter_user_subscribe', $user);
299
  // TODO: should be removed!!!
300
  if (defined('NEWSLETTER_FEED_VERSION')) {
301
  $options_feed = get_option('newsletter_feed', array());
302
+ if ($options_feed['add_new'] == 1) {
303
  $user['feed'] = 1;
304
+ }
305
  }
306
 
307
  $user = $newsletter->save_user($user);
312
  setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
313
  }
314
 
315
+ if (!$emails) {
316
  return $user;
317
+ }
318
 
319
  $prefix = ($user->status == 'C') ? 'confirmed_' : 'confirmation_';
320
 
336
  * @return type
337
  */
338
  function mail($to, $subject, $message) {
339
+ // If the template setup on administrative panel is enabled, use it, if not
340
+ // use the default old templating system.
341
+ if ($this->options['template_enabled'] == 1) {
342
+ $template = $this->options['template'];
343
+ if (strpos($template, '{message}') === false) {
344
+ $template .= '{message}';
345
+ }
346
+ $message = str_replace('{message}', $message, $template);
347
+ } else {
348
+ ob_start();
349
+ include NEWSLETTER_DIR . '/subscription/email.php';
350
+ $message = ob_get_clean();
351
+ }
352
 
353
+ return Newsletter::instance()->mail($to, $subject, $message);
 
 
 
 
354
  }
355
 
356
  /**
585
  list ($id, $token) = @explode('-', $_COOKIE['newsletter'], 2);
586
  }
587
 
588
+ $user = $newsletter->get_user($id);
589
+ if ($user == null || $token != $user->token) {
590
+ if (is_user_logged_in()) {
591
+ $user = $this->get_user_by_wp_user_id(get_current_user_id());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
592
  }
 
 
593
  }
 
594
  return $user;
595
  }
596
 
630
  return $buffer;
631
  }
632
 
633
+ function shortcode_subscription($attrs, $content) {
634
+ if (isset($attrs['css'])) {
635
+ if (!empty($attrs['css'])) {
636
+ echo '<style scoped>';
637
+ include dirname(__FILE__) . '/styles/shortcode-' . $attrs['css'] . '.css';
638
+ echo '</style>';
639
+ }
640
+ } else {
641
+ echo '<style scoped>';
642
+ include dirname(__FILE__) . '/styles/shortcode-default.css';
643
+ echo '</style>';
644
+
645
+ }
646
+
647
+ $options_profile = get_option('newsletter_profile');
648
+
649
+ $buffer = '<form method="post" action="' . plugins_url('newsletter/do/subscribe.php') . '" class="newsletter-form">';
650
+
651
+ //$content = str_replace("\r\n", "", $content);
652
+ $buffer .= do_shortcode($content);
653
+
654
+ if (isset($attrs['button_label'])) {
655
+ $label = $attrs['button_label'];
656
+ } else {
657
+ $label = $options_profile['subscribe'];
658
+ }
659
+
660
+ $buffer .= '<div class="newsletter-field newsletter-field-button">';
661
+ if (strpos($label, 'http') === 0) {
662
+ $buffer .= '<input class="newsletter-button-image" type="image" src="' . $label . '">';
663
+ } else {
664
+ $buffer .= '<input class="newsletter-button" type="submit" value="' . $label . '">';
665
+ }
666
+ $buffer .= '</div>';
667
+
668
+ return $buffer;
669
+ }
670
+
671
+ function shortcode_field($attrs, $content) {
672
+ $options_profile = get_option('newsletter_profile');
673
+ $name = $attrs['name'];
674
+
675
+ $buffer = '';
676
+
677
+ if ($name == 'email') {
678
+ $buffer .= '<div class="newsletter-field newsletter-field-email">';
679
+ if (isset($attrs['label'])) {
680
+ if ($attrs['label'] != '')
681
+ $buffer .= '<label for="">' . $attrs['label'] . '</label>';
682
+ } else {
683
+ $buffer .= '<label for="">' . $options_profile['email'] . '</label>';
684
+ }
685
+ $buffer .= '<input class="newsletter-email" type="email" name="ne" required>';
686
+ $buffer .= '</div>';
687
+ return $buffer;
688
+ }
689
+
690
+ if ($name == 'first_name') {
691
+ $buffer .= '<div class="newsletter-field newsletter-field-firstname">';
692
+ if (isset($attrs['label'])) {
693
+ if ($attrs['label'] != '')
694
+ $buffer .= '<label for="">' . $attrs['label'] . '</label>';
695
+ } else {
696
+ $buffer .= '<label for="">' . $options_profile['name'] . '</label>';
697
+ }
698
+ $buffer .= '<input class="newsletter-firstname" type="text" name="nn"';
699
+ if ($options_profile['name_rules'] == 1) {
700
+ $buffer .= ' required';
701
+ }
702
+ $buffer .= '>';
703
+ $buffer .= '</div>';
704
+ return $buffer;
705
+ }
706
+
707
+ if ($name == 'last_name') {
708
+ $buffer .= '<div class="newsletter-field newsletter-field-lastname">';
709
+ if (isset($attrs['label'])) {
710
+ if ($attrs['label'] != '')
711
+ $buffer .= '<label for="">' . $attrs['label'] . '</label>';
712
+ } else {
713
+ $buffer .= '<label for="">' . $options_profile['surname'] . '</label>';
714
+ }
715
+ $buffer .= '<input class="newsletter-lastname" type="text" name="ns"';
716
+ if ($options_profile['surname_rules'] == 1) {
717
+ $buffer .= ' required';
718
+ }
719
+ $buffer .= '>';
720
+ $buffer .= '</div>';
721
+ return $buffer;
722
+ }
723
+
724
+ if ($name == 'preference' || $name == 'list') {
725
+ $list = (int) $attrs['number'];
726
+ if (isset($attrs['hidden'])) {
727
+ $buffer .= '<input type="hidden" name="nl[]" value="' . $list . '">';
728
+ } else {
729
+ $buffer .= '<div class="newsletter-field newsletter-field-preference">';
730
+ $buffer .= '<input type="checkbox" id="nl' . $list . '" name="nl[]" value="' . $list . '"';
731
+ if (isset($attrs['checked'])) {
732
+ $buffer .= ' checked';
733
+ }
734
+ $buffer .= '>';
735
+ if (isset($attrs['label'])) {
736
+ if ($attrs['label'] != '')
737
+ $buffer .= '<label for="nl' . $list . '">' . $attrs['label'] . '</label>';
738
+ } else {
739
+ $buffer .= '<label for="nl' . $list . '">' . $options_profile['list_' . $i] . '</label>';
740
+ }
741
+ $buffer .= '</div>';
742
+ }
743
+ return $buffer;
744
+ }
745
+
746
+ if ($name == 'lists' || $name == 'preferences') {
747
+ $lists = '';
748
+ for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
749
+ if ($options_profile['list_' . $i . '_status'] != 2)
750
+ continue;
751
+ $lists .= '<div class="newsletter-field newsletter-field-preference">';
752
+ $lists .= '<input type="checkbox" name="nl[]" value="' . $i . '"';
753
+ if ($options_profile['list_' . $i . '_checked'] == 1)
754
+ $lists .= ' checked';
755
+ $lists .= '> <label for="">' . $options_profile['list_' . $i] . '</label>';
756
+ $lists .= '</div>';
757
+ }
758
+ return $lists;
759
+ }
760
+
761
+ // TODO: add the "not specified"
762
+ if ($name == 'sex' || $name == 'gender') {
763
+ $buffer .= '<div class="newsletter-field newsletter-field-gender">';
764
+ if (isset($attrs['label'])) {
765
+ if ($attrs['label'] != '')
766
+ $buffer .= '<label for="">' . $attrs['label'] . '</label>';
767
+ } else {
768
+ $buffer .= '<label for="">' . $options_profile['sex'] . '</label>';
769
+ }
770
+
771
+ $buffer .= '<select name="nx" class="newsletter-gender">';
772
+ $buffer .= '<option value="m">' . $options_profile['sex_male'] . '</option>';
773
+ $buffer .= '<option value="f">' . $options_profile['sex_female'] . '</option>';
774
+ $buffer .= '</select>';
775
+ $buffer .= '</div>';
776
+ return $buffer;
777
+ }
778
+
779
+ if ($name == 'profile') {
780
+ $number = (int) $attrs['number'];
781
+ $type = $options_profile['profile_' . $number . '_type'];
782
+ $size = isset($attrs['size']) ? $attrs['size'] : '';
783
+ $buffer .= '<div class="newsletter-field newsletter-field-profile">';
784
+ if (isset($attrs['label'])) {
785
+ if ($attrs['label'] != '') {
786
+ $buffer .= '<label for="">' . $attrs['label'] . '</label>';
787
+ }
788
+ } else {
789
+ $buffer .= '<label for="">' . $options_profile['profile_' . $number] . '</label>';
790
+ }
791
+ $placeholder = isset($attrs['placeholder']) ? $attrs['placeholder'] : $options_profile['profile_' . $number . '_placeholder'];
792
+
793
+ $required = $options_profile['profile_' . $number . '_rules'] == 1;
794
+
795
+ // Text field
796
+ if ($type == 'text') {
797
+ $buffer .= '<input class="newsletter-profile newsletter-profile-' . $number . '" type="text" size="' . $size . '" name="np' . $number . '" placeholder="' . esc_attr($placeholder) . '"';
798
+ if ($required) $buffer .= ' required';
799
+ $buffer .= '>';
800
+ }
801
+
802
+ // Select field
803
+ if ($type == 'select') {
804
+ $buffer .= '<select class="newsletter-profile newsletter-profile-' . $number . '" name="np' . $number . '"';
805
+ if ($required) $buffer .= ' required';
806
+ $buffer .= '>';
807
+ if (!empty($placeholder)) {
808
+ $buffer .= '<option value="">' . esc_html($placeholder) . '</option>';
809
+ }
810
+ $opts = explode(',', $options_profile['profile_' . $number . '_options']);
811
+ for ($j = 0; $j < count($opts); $j++) {
812
+ $buffer .= '<option>' . trim($opts[$j]) . '</option>';
813
+ }
814
+ $buffer .= '</select>';
815
+ }
816
+
817
+ $buffer .= '</div>';
818
+
819
+ return $buffer;
820
+ }
821
+
822
+ if (strpos($name, 'privacy') === 0) {
823
+
824
+ if (!isset($attrs['url'])) {
825
+ $attrs['url'] = $options_profile['privacy_url'];
826
+ }
827
+
828
+ if (!isset($attrs['label'])) {
829
+ $attrs['label'] = $options_profile['list_' . $i];
830
+ }
831
+
832
+ $buffer .= '<div class="newsletter-field newsletter-field-privacy">';
833
+
834
+ $buffer .= '<input type="checkbox" name="ny" required class="newsletter-privacy"> ';
835
+ $buffer .= '<label for="ny">';
836
+ if (!empty($attrs['url'])) {
837
+ $buffer .= '<a target="_blank" href="' . $options_profile['privacy_url'] . '">';
838
+ }
839
+ $buffer .= $attrs['label'];
840
+ if (!empty($attrs['url'])) {
841
+ $buffer .= '</a>';
842
+ }
843
+ $buffer .= '</label>';
844
+ $buffer .= '</div>';
845
+
846
+ return $buffer;
847
+ }
848
+ }
849
+
850
  /**
851
  * Returns the form html code for subscription.
852
  *
978
  if ($options_profile['name_status'] == 2) {
979
  $buffer .= '<div class="newsletter-field-div newsletter-firstname-div"><label>' . $options_profile['name'] . '</label>';
980
  $buffer .= '<input class="newsletter-firstname" type="text" name="nn" size="30"' . ($options_profile['name_rules'] == 1 ? 'required' : '') . '></div>';
981
+ $buffer .= "\n";
982
  }
983
 
984
  if ($options_profile['surname_status'] == 2) {
1068
  return $buffer;
1069
  }
1070
 
1071
+ function shortcode_profile($attrs, $content) {
1072
+ $user = $this->check_user();
1073
+
1074
+ if (empty($user)) {
1075
+ if (empty($content)) {
1076
+ return 'Subscriber profile not found.';
1077
+ } else {
1078
+ return $content;
1079
+ }
1080
+ }
1081
+
1082
+ return $this->get_profile_form($user);
1083
+ }
1084
+
1085
  /**
1086
  * Generate the profile editing form.
1087
  */
1141
  }
1142
 
1143
  // Lists
1144
+ $buffer .= '<tr><th>&nbsp;</th><td style="text-align: left"><div class="newsletter-preferences">';
1145
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
1146
+ if ($options['list_' . $i . '_status'] == 0) {
1147
  continue;
1148
+ }
1149
+ $buffer .= '<input class="newsletter-preference" type="checkbox" name="nl[]" value="' . $i . '"';
1150
  $list = 'list_' . $i;
1151
+ if ($user->$list == 1) {
1152
  $buffer .= ' checked';
1153
+ }
1154
+ $buffer .= '/>&nbsp;<span class="newsletter-preference-label">' . htmlspecialchars($options['list_' . $i]) . '</span><br />';
1155
  }
1156
+ $buffer .= '</div></td></tr>';
1157
 
1158
  $extra = apply_filters('newsletter_profile_extra', array(), $user);
1159
  foreach ($extra as &$x) {
1239
  }
1240
 
1241
  $message .= "token: " . $user->token . "\n" .
1242
+ "status: " . $user->status . "\n";
 
1243
  $email = trim($this->options['notify_email']);
1244
  if (empty($email))
1245
  $email = get_option('admin_email');
1246
+ $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
1247
+ wp_mail($email, '[' . $blogname . '] ' . $subject, $message, "Content-type: text/plain; charset=UTF-8\n");
1248
  }
1249
 
1250
  }
1283
  $module = NewsletterSubscription::instance();
1284
  $user = $module->get_user_from_request();
1285
  $message_key = $module->get_message_key_from_request();
1286
+
1287
 
1288
  $message = $module->options[$message_key . '_text'];
1289
 
1355
  $_REQUEST['ne'] = $wp_user->user_email;
1356
  $_REQUEST['nr'] = 'registration';
1357
  // Upon registration there is no last name and first name, sorry.
1358
+ // $status is determined by the opt in
1359
+ $user = $module->subscribe(null, false);
1360
 
1361
  // Now we associate it with wp
1362
  $module->set_user_wp_user_id($user->id, $wp_user_id);
users/edit.php CHANGED
@@ -35,7 +35,7 @@ if (!$controls->is_action()) {
35
  $options_profile = get_option('newsletter_profile');
36
  ?>
37
  <div class="wrap">
38
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/subscribers-module'; ?>
39
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
40
 
41
  <div id="newsletter-title">
@@ -114,7 +114,7 @@ $options_profile = get_option('newsletter_profile');
114
  <?php $controls->yesno('feed'); ?>
115
  <div class="hints">
116
  "Yes" when this subscriber has the feed by mail service active. The
117
- <a href="http://www.satollo.net/plugins/newsletter/feed-by-mail-module" target="_blank">feed by mail is an extension of this plugin</a>.
118
  </div>
119
  </td>
120
  </tr>
35
  $options_profile = get_option('newsletter_profile');
36
  ?>
37
  <div class="wrap">
38
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module'; ?>
39
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
40
 
41
  <div id="newsletter-title">
114
  <?php $controls->yesno('feed'); ?>
115
  <div class="hints">
116
  "Yes" when this subscriber has the feed by mail service active. The
117
+ <a href="http://www.thenewsletterplugin.com/feed-by-mail-extension?utm_source=plugin&utm_medium=link&utm_campaign=newsletter-feed" target="_blank">feed by mail is an extension of this plugin</a>.
118
  </div>
119
  </td>
120
  </tr>
users/import.php CHANGED
@@ -31,13 +31,16 @@ if ($controls->is_action('import')) {
31
  foreach ($lines as &$line) {
32
  // Parse the CSV line
33
  $line = trim($line);
34
- if ($line == '')
35
  continue;
36
- if ($line[0] == '#' || $line[0] == ';')
 
37
  continue;
 
38
  $separator = $controls->data['separator'];
39
- if ($separator == 'tab')
40
  $separator = "\t";
 
41
  $data = explode($separator, $line);
42
 
43
  // Builds a subscriber data structure
@@ -52,11 +55,19 @@ if ($controls->is_action('import')) {
52
  if ($subscriber == null) {
53
  $subscriber = array();
54
  $subscriber['email'] = $email;
55
- $subscriber['name'] = $newsletter->normalize_name($data[1]);
56
- $subscriber['surname'] = $newsletter->normalize_name($data[2]);
 
 
 
 
 
 
 
57
  $subscriber['status'] = 'C';
58
- foreach ($controls->data['preferences'] as $i)
59
  $subscriber['list_' . $i] = 1;
 
60
  NewsletterUsers::instance()->save_user($subscriber);
61
  $results .= '[ADDED] ' . $line . "\n";
62
  $added_count++;
@@ -100,7 +111,7 @@ if ($controls->is_action('import')) {
100
  ?>
101
 
102
  <div class="wrap">
103
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/subscribers-module'; ?>
104
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
105
 
106
  <div id="newsletter-title">
@@ -143,15 +154,6 @@ if ($controls->is_action('import')) {
143
  </td>
144
  </tr>
145
 
146
- <!--
147
- <tr valign="top">
148
- <th>Follow up</th>
149
- <td>
150
- <?php $controls->select('followup', array('none' => 'None', 'activate' => 'Activate')); ?>
151
- </td>
152
- </tr>
153
- -->
154
-
155
  <tr valign="top">
156
  <th>Import mode</th>
157
  <td>
@@ -195,11 +197,12 @@ if ($controls->is_action('import')) {
195
 
196
  <p>
197
  Import list format is:<br /><br />
198
- <b>email 1</b><i>[separator]</i><b>first name 1</b><i>[separator]</i><b>last name 1</b><i>[new line]</i><br />
199
- <b>email 2</b><i>[separator]</i><b>first name 2</b><i>[separator]</i><b>last name 2</b><i>[new line]</i><br />
200
  <br />
201
  where [separator] must be selected from the available ones. Empty lines and lines starting with "#" will be skipped. There is
202
- no separator essaping mechanism, so be sure that field values do not contain the selected separator.
 
203
  </p>
204
 
205
  </div>
31
  foreach ($lines as &$line) {
32
  // Parse the CSV line
33
  $line = trim($line);
34
+ if ($line == '') {
35
  continue;
36
+ }
37
+ if ($line[0] == '#' || $line[0] == ';') {
38
  continue;
39
+ }
40
  $separator = $controls->data['separator'];
41
+ if ($separator == 'tab') {
42
  $separator = "\t";
43
+ }
44
  $data = explode($separator, $line);
45
 
46
  // Builds a subscriber data structure
55
  if ($subscriber == null) {
56
  $subscriber = array();
57
  $subscriber['email'] = $email;
58
+ if (isset($data[1])) {
59
+ $subscriber['name'] = $newsletter->normalize_name($data[1]);
60
+ }
61
+ if (isset($data[2])) {
62
+ $subscriber['surname'] = $newsletter->normalize_name($data[2]);
63
+ }
64
+ if (isset($data[3])) {
65
+ $subscriber['sex'] = $newsletter->normalize_sex($data[3]);
66
+ }
67
  $subscriber['status'] = 'C';
68
+ foreach ($controls->data['preferences'] as $i) {
69
  $subscriber['list_' . $i] = 1;
70
+ }
71
  NewsletterUsers::instance()->save_user($subscriber);
72
  $results .= '[ADDED] ' . $line . "\n";
73
  $added_count++;
111
  ?>
112
 
113
  <div class="wrap">
114
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module'; ?>
115
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
116
 
117
  <div id="newsletter-title">
154
  </td>
155
  </tr>
156
 
 
 
 
 
 
 
 
 
 
157
  <tr valign="top">
158
  <th>Import mode</th>
159
  <td>
197
 
198
  <p>
199
  Import list format is:<br /><br />
200
+ <b>email 1</b><i>[separator]</i><b>first name 1</b><i>[separator]</i><b>last name 1</b><i>[separator]</i><b>gender 1</b><i>[new line]</i><br />
201
+ <b>email 2</b><i>[separator]</i><b>first name 2</b><i>[separator]</i><b>last name 2</b><i>[separator]</i><b>gender 2</b><i>[new line]</i><br />
202
  <br />
203
  where [separator] must be selected from the available ones. Empty lines and lines starting with "#" will be skipped. There is
204
+ no separator escaping mechanism, so be sure that field values do not contain the selected separator. The only required field is the email
205
+ all other fields are options. Gender must be "m" or "f".
206
  </p>
207
 
208
  </div>
users/index-old.php CHANGED
@@ -91,7 +91,7 @@ else {
91
 
92
  <div class="wrap">
93
 
94
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/subscribers-module'; ?>
95
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
96
 
97
  <?php include NEWSLETTER_DIR . '/users/menu.inc.php'; ?>
91
 
92
  <div class="wrap">
93
 
94
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module'; ?>
95
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
96
 
97
  <?php include NEWSLETTER_DIR . '/users/menu.inc.php'; ?>
users/index.php CHANGED
@@ -69,7 +69,7 @@ if (!empty($controls->data['search_status'])) {
69
  $where .= " and status=%s";
70
  }
71
  }
72
-
73
  // Total items, total pages
74
  $items_per_page = 20;
75
  $where = $wpdb->prepare($where, $query_args);
@@ -107,40 +107,49 @@ $controls->data['search_page']++;
107
 
108
  <div class="wrap">
109
 
110
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/subscribers-module'; ?>
111
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
112
 
113
-
114
-
115
  <div id="newsletter-title">
116
  <?php include NEWSLETTER_DIR . '/users/menu.inc.php'; ?>
117
  <h2>Subscriber Search</h2>
118
  </div>
119
 
120
  <div class="newsletter-separator"></div>
121
-
122
  <?php $controls->show(); ?>
123
 
124
  <form id="channel" method="post" action="">
125
  <?php $controls->init(); ?>
126
 
127
  <div style="padding: .6em; border: 1px solid #ddd; background-color: #f4f4f4; border-radius: 3px;">
128
- <?php $controls->text('search_text', 80); ?>
129
-
130
- <!--<?php $controls->checkbox('search_test'); ?> show subscriber with "test" flag on-->
131
- <?php $controls->select('search_status', array(''=>'Any status', 'T'=>'Test subscribers', 'C'=>'Confirmed', 'S'=>'Not confirmed', 'U'=>'Unsubscribed', 'B'=>'Bounced')); ?>
132
- <?php $controls->button('search', 'Search'); ?>
 
133
  </div>
134
 
135
 
 
 
136
  <div class="newsletter-paginator">
137
- <?php echo $count ?> subscribers found
138
  <?php $controls->button('first', '«'); ?>
139
  <?php $controls->button('prev', '‹'); ?>
140
- <?php $controls->text('search_page', 3); ?> of <?php echo $last_page+1 ?> <?php $controls->button('go', 'Go'); ?>
141
  <?php $controls->button('next', '›'); ?>
142
  <?php $controls->button('last', '»'); ?>
143
  </div>
 
 
 
 
 
 
144
  <table class="widefat">
145
  <thead>
146
  <tr>
@@ -149,9 +158,9 @@ $controls->data['search_page']++;
149
  <?php if (isset($options['show_profile']) && $options['show_profile'] == 1) { ?>
150
  <th>Profile</th>
151
  <?php } ?>
152
- <th>Status</th>
153
  <?php if (isset($options['show_preferences']) && $options['show_preferences'] == 1) { ?>
154
- <th>Preferences</th>
155
  <?php } ?>
156
  <th>Actions</th>
157
  <?php if (isset($options['search_clicks']) && $options['search_clicks'] == 1) { ?>
@@ -192,10 +201,10 @@ $controls->data['search_page']++;
192
  <small>
193
  <?php
194
  switch ($s->status) {
195
- case 'S': echo 'NOT CONFIRMED'; break;
196
- case 'C': echo 'CONFIRMED'; break;
197
- case 'U': echo 'UNSUBSCRIBED'; break;
198
- case 'B': echo 'BOUNCED'; break;
199
  }
200
  ?>
201
  </small>
@@ -215,21 +224,28 @@ $controls->data['search_page']++;
215
  <?php } ?>
216
 
217
  <td>
218
- <a class="button-secondary" href="<?php echo $module->get_admin_page_url('edit'); ?>&amp;id=<?php echo $s->id; ?>">Edit</a>
219
- <?php $controls->button_confirm('remove', 'Remove', 'Proceed?', $s->id); ?>
220
 
221
  <?php //$controls->button('status', 'Confirm', 'newsletter_set_status(this.form,' . $s->id . ',\'C\')'); ?>
222
  <?php //$controls->button('status', 'Unconfirm', 'newsletter_set_status(this.form,' . $s->id . ',\'S\')'); ?>
223
 
224
- <?php $controls->button_confirm('resend', 'Resend confirmation', 'Proceed?', $s->id); ?>
225
- <?php $controls->button_confirm('resend_welcome', 'Resend welcome', 'Proceed?', $s->id); ?>
226
- <a href="<?php echo plugins_url('newsletter/do/profile.php'); ?>?nk=<?php echo $s->id . '-' . $s->token; ?>" class="button" target="_blank">Profile page</a>
227
  </td>
228
 
229
 
230
  </tr>
231
  <?php } ?>
232
  </table>
 
233
 
 
 
 
 
 
 
234
  </form>
235
  </div>
69
  $where .= " and status=%s";
70
  }
71
  }
72
+
73
  // Total items, total pages
74
  $items_per_page = 20;
75
  $where = $wpdb->prepare($where, $query_args);
107
 
108
  <div class="wrap">
109
 
110
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module'; ?>
111
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
112
 
113
+
114
+
115
  <div id="newsletter-title">
116
  <?php include NEWSLETTER_DIR . '/users/menu.inc.php'; ?>
117
  <h2>Subscriber Search</h2>
118
  </div>
119
 
120
  <div class="newsletter-separator"></div>
121
+
122
  <?php $controls->show(); ?>
123
 
124
  <form id="channel" method="post" action="">
125
  <?php $controls->init(); ?>
126
 
127
  <div style="padding: .6em; border: 1px solid #ddd; background-color: #f4f4f4; border-radius: 3px;">
128
+ <?php $controls->text('search_text', 80, __('Search text', 'newsletter-users')); ?>
129
+
130
+ <?php _e('filter by', 'newsletter-users')?>:<?php $controls->select('search_status', array(''=>'Any status', 'T'=>'Test subscribers', 'C'=>'Confirmed', 'S'=>'Not confirmed', 'U'=>'Unsubscribed', 'B'=>'Bounced')); ?>
131
+ <?php $controls->button('search', __('Search', 'newsletter-users')); ?>
132
+ <br>
133
+ <?php $controls->checkbox('show_preferences', __('Show preferences', 'newsletter-users')); ?>
134
  </div>
135
 
136
 
137
+
138
+
139
  <div class="newsletter-paginator">
140
+
141
  <?php $controls->button('first', '«'); ?>
142
  <?php $controls->button('prev', '‹'); ?>
143
+ <?php $controls->text('search_page', 3); ?> of <?php echo $last_page+1 ?> <?php $controls->button('go', __('Go', 'newsletter-users')); ?>
144
  <?php $controls->button('next', '›'); ?>
145
  <?php $controls->button('last', '»'); ?>
146
  </div>
147
+
148
+ <?php echo $count ?> <?php _e('subscribers found', 'newsletter-users')?>
149
+ <?php if ($where != "where 1=1") { ?>
150
+ <p><strong><?php _e('The list is filtered, see the filters above.', 'newsletter-users') ?></strong></p>
151
+ <?php } ?>
152
+
153
  <table class="widefat">
154
  <thead>
155
  <tr>
158
  <?php if (isset($options['show_profile']) && $options['show_profile'] == 1) { ?>
159
  <th>Profile</th>
160
  <?php } ?>
161
+ <th><?php _e('Status', 'newsletter-users') ?></th>
162
  <?php if (isset($options['show_preferences']) && $options['show_preferences'] == 1) { ?>
163
+ <th><?php _e('Preferences', 'newsletter-users') ?></th>
164
  <?php } ?>
165
  <th>Actions</th>
166
  <?php if (isset($options['search_clicks']) && $options['search_clicks'] == 1) { ?>
201
  <small>
202
  <?php
203
  switch ($s->status) {
204
+ case 'S': _e('NOT CONFIRMED', 'newsletter-users'); break;
205
+ case 'C': _e('CONFIRMED', 'newsletter-users'); break;
206
+ case 'U': _e('UNSUBSCRIBED', 'newsletter-users'); break;
207
+ case 'B': _e('BOUNCED', 'newsletter-users'); break;
208
  }
209
  ?>
210
  </small>
224
  <?php } ?>
225
 
226
  <td>
227
+ <a class="button-secondary" href="<?php echo $module->get_admin_page_url('edit'); ?>&amp;id=<?php echo $s->id; ?>"><?php _e('Edit', 'newsletter-users') ?></a>
228
+ <?php $controls->button_confirm('remove', __('Remove', 'newsletter-users'), __('Proceed?', 'newsletter-users'), $s->id); ?>
229
 
230
  <?php //$controls->button('status', 'Confirm', 'newsletter_set_status(this.form,' . $s->id . ',\'C\')'); ?>
231
  <?php //$controls->button('status', 'Unconfirm', 'newsletter_set_status(this.form,' . $s->id . ',\'S\')'); ?>
232
 
233
+ <?php $controls->button_confirm('resend', __('Resend confirmation', 'newsletter-users'), __('Proceed?', 'newsletter-users'), $s->id); ?>
234
+ <?php $controls->button_confirm('resend_welcome', __('Resend welcome', 'newsletter-users'), __('Proceed?', 'newsletter-users'), $s->id); ?>
235
+ <a href="<?php echo plugins_url('newsletter/do/profile.php'); ?>?nk=<?php echo $s->id . '-' . $s->token; ?>" class="button" target="_blank"><?php _e('Profile page', 'newsletter-users') ?></a>
236
  </td>
237
 
238
 
239
  </tr>
240
  <?php } ?>
241
  </table>
242
+ <div class="newsletter-paginator">
243
 
244
+ <?php $controls->button('first', '«'); ?>
245
+ <?php $controls->button('prev', '‹'); ?>
246
+ <?php $controls->text('search_page', 3); ?> of <?php echo $last_page+1 ?> <?php $controls->button('go', __('Go', 'newsletter-users')); ?>
247
+ <?php $controls->button('next', '›'); ?>
248
+ <?php $controls->button('last', '»'); ?>
249
+ </div>
250
  </form>
251
  </div>
users/massive.php CHANGED
@@ -14,52 +14,48 @@ for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
14
 
15
  if ($controls->is_action('remove_unconfirmed')) {
16
  $r = $wpdb->query("delete from " . NEWSLETTER_USERS_TABLE . " where status='S'");
17
- $controls->messages = $r . ' not confirmed deleted.';
18
  }
19
 
20
  if ($controls->is_action('remove_unsubscribed')) {
21
  $r = $wpdb->query("delete from " . NEWSLETTER_USERS_TABLE . " where status='U'");
22
- $controls->messages = $r . ' unsubscribed deleted (profiles associated to WordPress users are never deleted).';
23
  }
24
 
25
  if ($controls->is_action('remove_bounced')) {
26
  $r = $wpdb->query("delete from " . NEWSLETTER_USERS_TABLE . " where status='B'");
27
- $controls->messages = $r . ' bounced deleted.';
28
  }
29
 
30
  if ($controls->is_action('unconfirm_all')) {
31
  $r = $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set status='S' where status='C'");
32
- $controls->messages = $r . ' unconfirmed.';
33
  }
34
 
35
  if ($controls->is_action('confirm_all')) {
36
  $r = $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set status='C' where status='S'");
37
- $controls->messages = $r . ' confirmed.';
38
  }
39
 
40
  if ($controls->is_action('remove_all')) {
41
  $r = $wpdb->query("delete from " . NEWSLETTER_USERS_TABLE);
42
- $controls->messages = $r . ' deleted.';
43
  }
44
 
45
  if ($controls->is_action('list_add')) {
46
  $r = $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set list_" . $controls->data['list'] . "=1");
47
- $controls->messages = $r . ' added to list ' . $controls->data['list'];
48
  }
49
 
50
  if ($controls->is_action('list_remove')) {
51
  $r = $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set list_" . $controls->data['list'] . "=0");
52
- $controls->messages = $r . ' removed from list ' . $controls->data['list'];
53
  }
54
 
55
  if ($controls->is_action('list_delete')) {
56
  $wpdb->query("delete from " . NEWSLETTER_USERS_TABLE . " where list_" . $controls->data['list'] . "<>0");
57
  }
58
 
59
- if ($controls->is_action('feed')) {
60
- $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set list_" . $controls->data['list_feed'] . "=1 where feed=1");
61
- }
62
-
63
  if ($controls->is_action('list_manage')) {
64
  if ($controls->data['list_action'] == 'move') {
65
  $wpdb->query("update " . NEWSLETTER_USERS_TABLE . ' set list_' . $controls->data['list_1'] . '=0, list_' . $controls->data['list_2'] . '=1' .
@@ -77,7 +73,7 @@ if ($controls->is_action('resend_all')) {
77
  $opts = get_option('newsletter');
78
 
79
  if ($list) {
80
- $controls->messages = 'Confirmation email sent to: ';
81
  foreach ($list as &$user) {
82
  $controls->messages .= $user->email . ' ';
83
  $newsletter->mail($user->email, $newsletter->replace($opts['confirmation_subject'], $user), $newsletter->replace($opts['confirmation_message'], $user));
@@ -137,7 +133,8 @@ if ($controls->is_action('align_wp_users')) {
137
  $module->save_user($nl_user);
138
  $count++;
139
  }
140
- $controls->messages = 'Total WP users aligned ' . count($wp_users) . ', total new subscribers ' . $count . '.';
 
141
  }
142
 
143
 
@@ -193,14 +190,14 @@ if ($controls->is_action('bounces')) {
193
  ?>
194
 
195
  <div class="wrap">
196
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/subscribers-module'; ?>
197
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
198
 
199
 
200
  <div id="newsletter-title">
201
  <?php include NEWSLETTER_DIR . '/users/menu.inc.php'; ?>
202
  <h2>Massive Actions on Subscribers</h2>
203
- <p>Please, backup before run a massive operation.</p>
204
  </div>
205
 
206
  <div style="clear: both; height: 10px;"></div>
@@ -220,31 +217,37 @@ if ($controls->is_action('bounces')) {
220
 
221
  <div id="tabs">
222
  <ul>
223
- <li><a href="#tabs-1">Global Actions</a></li>
224
- <li><a href="#tabs-2">Preferences Management</a></li>
225
- <li><a href="#tabs-3">Other</a></li>
226
  <li><a href="#tabs-4">Bounces</a></li>
227
  </ul>
228
 
229
  <div id="tabs-1">
230
  <table class="widefat" style="width: 300px;">
231
- <thead><tr><th>Status</th><th>Total</th><th>Actions</th></thead>
 
 
 
 
 
 
232
  <tr>
233
- <td>Total in database</td>
234
  <td>
235
  <?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE); ?>
236
  </td>
237
  <td nowrap>
238
- <?php $controls->button_confirm('remove_all', 'Delete all', 'Are you sure you want to remove ALL subscribers?'); ?>
239
  </td>
240
  </tr>
241
  <tr>
242
- <td>Confirmed</td>
243
  <td>
244
  <?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='C'"); ?>
245
  </td>
246
  <td nowrap>
247
- <?php $controls->button_confirm('unconfirm_all', 'Unconfirm all', 'Are you sure? No way back.'); ?>
248
  </td>
249
  </tr>
250
  <tr>
@@ -253,47 +256,52 @@ if ($controls->is_action('bounces')) {
253
  <?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='S'"); ?>
254
  </td>
255
  <td nowrap>
256
- <?php $controls->button_confirm('remove_unconfirmed', 'Delete all not confirmed', 'Are you sure you want to delete ALL not confirmed subscribers?'); ?>
257
- <?php $controls->button_confirm('confirm_all', 'Confirm all', 'Are you sure you want to mark ALL subscribers as confirmed?'); ?>
258
- <?php $controls->hint('To send a comfirmation email to all, you can create a special newsletter.', 'http://www.satollo.net/plugins/newsletter/subscribers-module#resend-confirm'); ?>
259
- <?php //$controls->button_confirm('resend_all', 'Resend confirmation message to all', 'Are you sure?'); ?>
 
260
  </td>
261
  </tr>
262
  <tr>
263
- <td>Unsubscribed</td>
264
  <td>
265
  <?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='U'"); ?>
266
  </td>
267
  <td>
268
- <?php $controls->button_confirm('remove_unsubscribed', 'Delete all unsubscribed', 'Are you sure you want to delete ALL unsubscribed?'); ?>
269
  </td>
270
  </tr>
271
  <tr>
272
- <td>Import WP user</td>
273
  <td>
274
  &nbsp;
275
  </td>
276
  <td>
277
- Link WordPress users with status
278
- <?php $controls->select('align_wp_users_status', array('C'=>'Confirmed', 'S'=>'Not confirmed')); ?>
279
- <?php $controls->button_confirm('align_wp_users', 'Go', 'Proceed?'); ?>
280
- <?php $controls->hint('Please, carefully read the documentation before taking this action!', 'http://www.satollo.net/plugins/newsletter/subscribers-module#import-wp-users'); ?>
 
 
 
 
281
  </td>
282
  </tr>
283
 
284
  <tr>
285
- <td>Bounced</td>
286
  <td>
287
  <?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='B'"); ?>
288
  </td>
289
  <td>
290
- <?php $controls->button_confirm('remove_bounced', 'Delete all bounced', 'Are you sure?'); ?>
291
  </td>
292
  </tr>
293
  </table>
294
- <p>Bounce are not detected by Newsletter plugin, you should use the <a href="http://www.satollo.net/plugins/bounce" target="_blank">Bounce plugin</a>.</p>
295
 
296
- <h3>Sex</h3>
297
  <?php
298
  // TODO: do them with a single query
299
  $all_count = $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='C'");
@@ -302,7 +310,7 @@ if ($controls->is_action('bounces')) {
302
  $other_count = ($all_count-$male_count-$female_count)
303
  ?>
304
  <table class="widefat" style="width: 300px">
305
- <thead><tr><th>Sex</th><th>Total</th></thead>
306
  <tr><td>Male</td><td><?php echo $male_count; ?></td></tr>
307
  <tr><td>Female</td><td><?php echo $female_count; ?></td></tr>
308
  <tr><td>Not specified</td><td><?php echo $other_count; ?></td></tr>
@@ -313,12 +321,12 @@ if ($controls->is_action('bounces')) {
313
  <div id="tabs-2">
314
  <table class="form-table">
315
  <tr>
316
- <th>Preferences management</th>
317
  <td>
318
  For preference <?php $controls->select('list', $lists); ?>:
319
- <?php $controls->button_confirm('list_add', 'Add it to every user', 'Are you sure?'); ?>
320
- <?php $controls->button_confirm('list_remove', 'Remove it from every user', 'Are you sure?'); ?>
321
- <?php $controls->button_confirm('list_delete', 'Delete subscribers of it', 'Are you really sure you want to delete those user from your database?'); ?>
322
  <br /><br />
323
  <?php $controls->select('list_action', array('move' => 'Change', 'add' => 'Add')); ?>
324
  all subscribers with preference <?php $controls->select('list_1', $lists); ?>
@@ -330,23 +338,20 @@ if ($controls->is_action('bounces')) {
330
  </div>
331
  </td>
332
  </tr>
333
- <tr>
334
- <th>Feed by mail</th>
335
- <td>
336
- Set preference <?php $controls->select('list_feed', $lists); ?> to feed by mail subscribers
337
- <?php $controls->button_confirm('feed', 'Go!', 'Are you sure?'); ?>
338
- <div class="hints">
339
- </div>
340
- </td>
341
- </tr>
342
  </table>
343
  </div>
344
 
345
 
346
  <div id="tabs-3">
347
- <p>Totals refer only confirmed subscribers.</p>
348
  <table class="widefat" style="width: 300px;">
349
- <thead><tr><th>Number</th><th>Preference</th><th>Total</th></thead>
 
 
 
 
 
 
350
  <?php for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) { ?>
351
  <tr>
352
  <td><?php echo $i; ?></td>
@@ -359,31 +364,28 @@ if ($controls->is_action('bounces')) {
359
  </table>
360
  </div>
361
 
362
- <div id="tabs-4">
363
- <div class="tab-preamble">
364
- <p>
365
- Import a set of bounced email addresses: they will be marked as "bounced" and no more contacted. Sending
366
- emails to bounced address (many times) can put your server in some black list.
367
- </p>
368
- </div>
369
- <table class="form-table">
370
- <tr>
371
- <th>Bounced addresses</th>
372
- <td>
373
- <?php $controls->textarea('bounced_emails'); ?>
374
- <div class="hints">
375
- One email address per line.
376
- </div>
377
- </td>
378
- </tr>
379
- </table>
380
-
381
-
382
- <?php $controls->button_confirm('bounces', 'Mark those emails as bounced', 'Are you sure?'); ?>
383
- </div>
384
 
385
  </div>
386
 
387
-
388
  </form>
389
  </div>
14
 
15
  if ($controls->is_action('remove_unconfirmed')) {
16
  $r = $wpdb->query("delete from " . NEWSLETTER_USERS_TABLE . " where status='S'");
17
+ $controls->messages = __('Subscribers not confirmed deleted: ', 'newsletter-users') . $r . '.';
18
  }
19
 
20
  if ($controls->is_action('remove_unsubscribed')) {
21
  $r = $wpdb->query("delete from " . NEWSLETTER_USERS_TABLE . " where status='U'");
22
+ $controls->messages = __('Subscribers unsubscribed deleted: ', 'newsletter-users') . $r . '.';
23
  }
24
 
25
  if ($controls->is_action('remove_bounced')) {
26
  $r = $wpdb->query("delete from " . NEWSLETTER_USERS_TABLE . " where status='B'");
27
+ $controls->messages = __('Subscribers bounced deleted: ', 'newsletter-users') . $r . '.';
28
  }
29
 
30
  if ($controls->is_action('unconfirm_all')) {
31
  $r = $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set status='S' where status='C'");
32
+ $controls->messages = __('Subscribers changed to not confirmed: ', 'newsletter-users') . $r . '.';
33
  }
34
 
35
  if ($controls->is_action('confirm_all')) {
36
  $r = $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set status='C' where status='S'");
37
+ $controls->messages = __('Subscribers changed to confirmed: ', 'newsletter-users') . $r . '.';
38
  }
39
 
40
  if ($controls->is_action('remove_all')) {
41
  $r = $wpdb->query("delete from " . NEWSLETTER_USERS_TABLE);
42
+ $controls->messages = __('Subscribers deleted: ', 'newsletter-users') . $r . '.';
43
  }
44
 
45
  if ($controls->is_action('list_add')) {
46
  $r = $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set list_" . $controls->data['list'] . "=1");
47
+ $controls->messages = $r . ' ' . __('added to the list/preference', 'newsletter-users') . ' ' . $controls->data['list'];
48
  }
49
 
50
  if ($controls->is_action('list_remove')) {
51
  $r = $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set list_" . $controls->data['list'] . "=0");
52
+ $controls->messages = $r . ' ' . __('removed to the list/preference', 'newsletter-users') . ' ' . $controls->data['list'];
53
  }
54
 
55
  if ($controls->is_action('list_delete')) {
56
  $wpdb->query("delete from " . NEWSLETTER_USERS_TABLE . " where list_" . $controls->data['list'] . "<>0");
57
  }
58
 
 
 
 
 
59
  if ($controls->is_action('list_manage')) {
60
  if ($controls->data['list_action'] == 'move') {
61
  $wpdb->query("update " . NEWSLETTER_USERS_TABLE . ' set list_' . $controls->data['list_1'] . '=0, list_' . $controls->data['list_2'] . '=1' .
73
  $opts = get_option('newsletter');
74
 
75
  if ($list) {
76
+ $controls->messages = __('Confirmation email sent to:', 'newsletter-users');
77
  foreach ($list as &$user) {
78
  $controls->messages .= $user->email . ' ';
79
  $newsletter->mail($user->email, $newsletter->replace($opts['confirmation_subject'], $user), $newsletter->replace($opts['confirmation_message'], $user));
133
  $module->save_user($nl_user);
134
  $count++;
135
  }
136
+ $controls->messages = count($wp_users) . ' ' . __('WordPress users processed', 'newsletter-users') . '. ';
137
+ $controls->messages .= $count . ' ' . __('subscriptions added', 'newsletter-users') . '.';
138
  }
139
 
140
 
190
  ?>
191
 
192
  <div class="wrap">
193
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module'; ?>
194
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
195
 
196
 
197
  <div id="newsletter-title">
198
  <?php include NEWSLETTER_DIR . '/users/menu.inc.php'; ?>
199
  <h2>Massive Actions on Subscribers</h2>
200
+ <p><?php _e('Please, backup before run a massive action.', 'newsletter-users')?></p>
201
  </div>
202
 
203
  <div style="clear: both; height: 10px;"></div>
217
 
218
  <div id="tabs">
219
  <ul>
220
+ <li><a href="#tabs-1"><?php _e('Massive actions', 'newsletter-users')?></a></li>
221
+ <li><a href="#tabs-2"><?php _e('Preferences/lists management', 'newsletter-users')?></a></li>
222
+ <li><a href="#tabs-3"><?php _e('Other', 'newsletter-users')?></a></li>
223
  <li><a href="#tabs-4">Bounces</a></li>
224
  </ul>
225
 
226
  <div id="tabs-1">
227
  <table class="widefat" style="width: 300px;">
228
+ <thead>
229
+ <tr>
230
+ <th><?php _e('Status', 'newsletter-users')?></th>
231
+ <th><?php _e('Total', 'newsletter-users')?></th>
232
+ <th><?php _e('Actions', 'newsletter-users')?></th>
233
+ </tr>
234
+ </thead>
235
  <tr>
236
+ <td><?php _e('Total collected emails', 'newsletter-users')?></td>
237
  <td>
238
  <?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE); ?>
239
  </td>
240
  <td nowrap>
241
+ <?php $controls->button_confirm('remove_all', __('Delete all', 'newsletter-users'), __('Are you sure you want to remove ALL subscribers?', 'newsletter-users')); ?>
242
  </td>
243
  </tr>
244
  <tr>
245
+ <td><?php _e('Confirmed', 'newsletter-users')?></td>
246
  <td>
247
  <?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='C'"); ?>
248
  </td>
249
  <td nowrap>
250
+ <?php $controls->button_confirm('unconfirm_all', __('Unconfirm all', 'newsletter-users'), __('Are you sure?', 'newsletter-users')); ?>
251
  </td>
252
  </tr>
253
  <tr>
256
  <?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='S'"); ?>
257
  </td>
258
  <td nowrap>
259
+ <?php $controls->button_confirm('remove_unconfirmed', __('Delete all not confirmed', 'newsletter-users'), __('Are you sure you want to delete ALL not confirmed subscribers?', 'newsletter-users')); ?>
260
+ <?php $controls->button_confirm('confirm_all', __('Confirm all', 'newsletter-users'), __('Are you sure you want to mark ALL subscribers as confirmed?', 'newsletter-users')); ?>
261
+ <p class="description">
262
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#resend-confirm" target="_blank"><?php _e('We have some tips about global actions, read more.', 'newsletter-users')?></a>
263
+ </p>
264
  </td>
265
  </tr>
266
  <tr>
267
+ <td><?php _e('Unsubscribed', 'newsletter-users')?></td>
268
  <td>
269
  <?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='U'"); ?>
270
  </td>
271
  <td>
272
+ <?php $controls->button_confirm('remove_unsubscribed', __('Delete all unsubscribed', 'newsletter-users'), __('Are you sure?', 'newsletter-users')); ?>
273
  </td>
274
  </tr>
275
  <tr>
276
+ <td><?php _e('Import WordPress users', 'newsletter-users')?></td>
277
  <td>
278
  &nbsp;
279
  </td>
280
  <td>
281
+ <?php _e('With status', 'newsletter-users')?>
282
+ <?php $controls->select('align_wp_users_status', array('C'=>__('Confirmed', 'newsletter-users'), 'S'=>__('Not confirmed', 'newsletter-users'))); ?>
283
+ <?php $controls->button_confirm('align_wp_users', __('Go', 'newsletter-users'), __('Proceed?', 'newsletter-users')); ?>
284
+ <p class="description">
285
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#import-wp-users" target="_blank">
286
+ <?php _e('Please, carefully read the documentation before taking this action!', 'newsletter-users') ?>
287
+ </a>
288
+ </p>
289
  </td>
290
  </tr>
291
 
292
  <tr>
293
+ <td><?php _e('Bounced', 'newsletter-users')?></td>
294
  <td>
295
  <?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='B'"); ?>
296
  </td>
297
  <td>
298
+ <?php $controls->button_confirm('remove_bounced', __('Delete all bounced', 'newsletter-users'), __('Are you sure?', 'newsletter-users')); ?>
299
  </td>
300
  </tr>
301
  </table>
302
+ <p>Bounce are not detected by Newsletter plugin.</p>
303
 
304
+ <h3><?php _e('Gender', 'newsletter-users')?></h3>
305
  <?php
306
  // TODO: do them with a single query
307
  $all_count = $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where status='C'");
310
  $other_count = ($all_count-$male_count-$female_count)
311
  ?>
312
  <table class="widefat" style="width: 300px">
313
+ <thead><tr><th><?php _e('Gender', 'newsletter-users')?></th><th>Total</th></thead>
314
  <tr><td>Male</td><td><?php echo $male_count; ?></td></tr>
315
  <tr><td>Female</td><td><?php echo $female_count; ?></td></tr>
316
  <tr><td>Not specified</td><td><?php echo $other_count; ?></td></tr>
321
  <div id="tabs-2">
322
  <table class="form-table">
323
  <tr>
324
+ <th><?php _e('Preferences/lists management', 'newsletter-users')?></th>
325
  <td>
326
  For preference <?php $controls->select('list', $lists); ?>:
327
+ <?php $controls->button_confirm('list_add', 'Add it to every user', __('Are you sure?', 'newsletter-users')); ?>
328
+ <?php $controls->button_confirm('list_remove', 'Remove it from every user', __('Are you sure?', 'newsletter-users')); ?>
329
+ <?php $controls->button_confirm('list_delete', 'Delete subscribers of it', __('Are you sure?', 'newsletter-users')); ?>
330
  <br /><br />
331
  <?php $controls->select('list_action', array('move' => 'Change', 'add' => 'Add')); ?>
332
  all subscribers with preference <?php $controls->select('list_1', $lists); ?>
338
  </div>
339
  </td>
340
  </tr>
 
 
 
 
 
 
 
 
 
341
  </table>
342
  </div>
343
 
344
 
345
  <div id="tabs-3">
346
+ <p><?php _e('Totals refer only to confirmed subscribers.', 'newsletter-users')?></p>
347
  <table class="widefat" style="width: 300px;">
348
+ <thead>
349
+ <tr>
350
+ <th><?php _e('Number', 'newsletter-users')?></th>
351
+ <th><?php _e('Preference', 'newsletter-users')?></th>
352
+ <th><?php _e('Total', 'newsletter-users')?></th>
353
+ </tr>
354
+ </thead>
355
  <?php for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) { ?>
356
  <tr>
357
  <td><?php echo $i; ?></td>
364
  </table>
365
  </div>
366
 
367
+ <div id="tabs-4">
368
+ <p>
369
+ Import a set of bounced email addresses: they will be marked as "bounced" and no more contacted. Sending
370
+ emails to bounced address (many times) can put your server in some black list.
371
+ </p>
372
+
373
+ <table class="form-table">
374
+ <tr>
375
+ <th><?php _e('Bounced addresses', 'newsletter-users')?></th>
376
+ <td>
377
+ <?php $controls->textarea('bounced_emails'); ?>
378
+ <p class="description">
379
+ <?php _e('One email address per line.', 'newsletter-users')?>One email address per line.
380
+ </p>
381
+ </td>
382
+ </tr>
383
+ </table>
384
+
385
+ <?php $controls->button_confirm('bounces', 'Mark those emails as bounced', __('Are you sure?', 'newsletter-users')); ?>
386
+ </div>
 
 
387
 
388
  </div>
389
 
 
390
  </form>
391
  </div>
users/menu.inc.php CHANGED
@@ -1,11 +1,11 @@
1
  <!--<h5>Subscribers Management Module</h5>-->
2
 
3
  <div id="newsletter-nav">
4
- <a class="button" href="<?php echo $module->get_admin_page_url('index'); ?>">Search</a>
5
  <!--<a class="button" href="<?php echo $module->get_admin_page_url('index'); ?>">Old search</a>-->
6
- <a class="button" href="<?php echo $module->get_admin_page_url('new'); ?>">New subscriber</a>
7
- <a class="button" href="<?php echo $module->get_admin_page_url('massive'); ?>">Massive changes</a>
8
- <a class="button" href="<?php echo $module->get_admin_page_url('stats'); ?>">Statistics</a>
9
- <a class="button" href="<?php echo $module->get_admin_page_url('import'); ?>">Import</a>
10
- <a class="button" href="<?php echo $module->get_admin_page_url('export'); ?>">Export</a>
11
  </div>
1
  <!--<h5>Subscribers Management Module</h5>-->
2
 
3
  <div id="newsletter-nav">
4
+ <a class="button-primary" href="<?php echo $module->get_admin_page_url('index'); ?>">Search</a>
5
  <!--<a class="button" href="<?php echo $module->get_admin_page_url('index'); ?>">Old search</a>-->
6
+ <a class="button-primary" href="<?php echo $module->get_admin_page_url('new'); ?>">New subscriber</a>
7
+ <a class="button-primary" href="<?php echo $module->get_admin_page_url('massive'); ?>">Massive changes</a>
8
+ <a class="button-primary" href="<?php echo $module->get_admin_page_url('stats'); ?>">Statistics</a>
9
+ <a class="button-primary" href="<?php echo $module->get_admin_page_url('import'); ?>">Import</a>
10
+ <a class="button-primary" href="<?php echo $module->get_admin_page_url('export'); ?>">Export</a>
11
  </div>
users/new.php CHANGED
@@ -18,7 +18,7 @@ if ($controls->is_action('save')) {
18
  }
19
  ?>
20
  <div class="wrap">
21
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/subscribers-module'; ?>
22
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
23
  <div id="newsletter-title">
24
  <?php include NEWSLETTER_DIR . '/users/menu.inc.php'; ?>
18
  }
19
  ?>
20
  <div class="wrap">
21
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module'; ?>
22
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
23
  <div id="newsletter-title">
24
  <?php include NEWSLETTER_DIR . '/users/menu.inc.php'; ?>
users/stats.php CHANGED
@@ -8,7 +8,7 @@ $module = NewsletterUsers::instance();
8
 
9
  <div class="wrap">
10
 
11
- <?php $help_url = 'http://www.satollo.net/plugins/newsletter/subscribers-module'; ?>
12
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
13
 
14
  <div id="newsletter-title">
@@ -82,7 +82,7 @@ $module = NewsletterUsers::instance();
82
  <div class="tab-preamble">
83
  <p>
84
  User count by preference.
85
- <a href="http://www.satollo.net/plugins/newsletter/newsletter-preferences" target="_blank">Read more about preferences</a> and/or
86
  configure them from te "Subscription Form" panel.
87
  <p>
88
  </div>
@@ -110,7 +110,7 @@ $module = NewsletterUsers::instance();
110
  <div id="tabs-countries">
111
  <div class="tab-preamble">
112
  <?php if (!class_exists('NewsletterReports')) { ?>
113
- <p><strong>The <a href="http://www.satollo.net/plugins/newsletter/reports-module" target="_blank">Reports Extension</a> is required
114
  to compute the data for this chart.</strong></p>
115
  <?php } ?>
116
  <p>
8
 
9
  <div class="wrap">
10
 
11
+ <?php $help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module'; ?>
12
  <?php include NEWSLETTER_DIR . '/header-new.php'; ?>
13
 
14
  <div id="newsletter-title">
82
  <div class="tab-preamble">
83
  <p>
84
  User count by preference.
85
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">Read more about preferences</a> and/or
86
  configure them from te "Subscription Form" panel.
87
  <p>
88
  </div>
110
  <div id="tabs-countries">
111
  <div class="tab-preamble">
112
  <?php if (!class_exists('NewsletterReports')) { ?>
113
+ <p><strong>The <a href="http://www.thenewsletterplugin.com/plugins/newsletter/reports-module" target="_blank">Reports Extension</a> is required
114
  to compute the data for this chart.</strong></p>
115
  <?php } ?>
116
  <p>
widget.php CHANGED
@@ -25,7 +25,7 @@ class NewsletterWidget extends WP_Widget {
25
 
26
  $form .= '<p><input class="newsletter-email" type="email" required name="ne" value="' . esc_attr($options_profile['email']) . '" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>';
27
 
28
- if ($options_profile['sex_status'] == 2) {
29
  $form .= '<p><select name="nx" class="newsletter-sex">';
30
  $form .= '<option value="m">' . $options_profile['sex_male'] . '</option>';
31
  $form .= '<option value="f">' . $options_profile['sex_female'] . '</option>';
@@ -85,7 +85,7 @@ class NewsletterWidget extends WP_Widget {
85
  }
86
 
87
  $form .= '</form>';
88
-
89
  return $form;
90
  }
91
 
25
 
26
  $form .= '<p><input class="newsletter-email" type="email" required name="ne" value="' . esc_attr($options_profile['email']) . '" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>';
27
 
28
+ if (isset($options_profile['sex_status']) && $options_profile['sex_status'] == 2) {
29
  $form .= '<p><select name="nx" class="newsletter-sex">';
30
  $form .= '<option value="m">' . $options_profile['sex_male'] . '</option>';
31
  $form .= '<option value="f">' . $options_profile['sex_female'] . '</option>';
85
  }
86
 
87
  $form .= '</form>';
88
+
89
  return $form;
90
  }
91