Newsletter - Version 4.6.4

Version Description

  • Fixed the profile link in admin panels
  • Fixed the composer editor
  • Cleanup of old code
  • Force the composer editor to keep the absolute urls
Download this release

Release Info

Developer webagile
Plugin Icon 128x128 Newsletter
Version 4.6.4
Comparing to
See all releases

Code changes from version 4.6.3 to 4.6.4

Files changed (29) hide show
  1. emails/tnp-composer/_scripts/newsletter-builder.js +359 -356
  2. emails/tnp-composer/blocks/{content-01-hero.block → content-01-hero.block.php} +0 -0
  3. emails/tnp-composer/blocks/{content-01-hero.png → content-01-hero.block.png} +0 -0
  4. emails/tnp-composer/blocks/{content-02-heading.block → content-02-heading.block.php} +0 -0
  5. emails/tnp-composer/blocks/{content-02-heading.png → content-02-heading.block.png} +0 -0
  6. emails/tnp-composer/blocks/{content-03-text.block → content-03-text.block.php} +0 -0
  7. emails/tnp-composer/blocks/{content-03-text.png → content-03-text.block.png} +0 -0
  8. emails/tnp-composer/blocks/{content-04-cta.block → content-04-cta.block.php} +0 -0
  9. emails/tnp-composer/blocks/{content-04-cta.png → content-04-cta.block.png} +0 -0
  10. emails/tnp-composer/blocks/{content-05-image.block → content-05-image.block.php} +0 -0
  11. emails/tnp-composer/blocks/{content-05-image.png → content-05-image.block.png} +0 -0
  12. emails/tnp-composer/blocks/{content-06-posts.block → content-06-posts.block.php} +0 -0
  13. emails/tnp-composer/blocks/{content-06-posts.png → content-06-posts.block.png} +0 -0
  14. emails/tnp-composer/blocks/{content-07-twocols.block → content-07-twocols.block.php} +0 -0
  15. emails/tnp-composer/blocks/{content-07-twocols.png → content-07-twocols.block.png} +0 -0
  16. emails/tnp-composer/blocks/{footer-01-footer.block → footer-01-footer.block.php} +0 -0
  17. emails/tnp-composer/blocks/{footer-01-footer.png → footer-01-footer.block.png} +0 -0
  18. emails/tnp-composer/blocks/{footer-02-canspam.block → footer-02-canspam.block.php} +0 -0
  19. emails/tnp-composer/blocks/{footer-02-canspam.png → footer-02-canspam.block.png} +0 -0
  20. emails/tnp-composer/blocks/{footer-03-social.block → footer-03-social.block.php} +0 -0
  21. emails/tnp-composer/blocks/{footer-03-social.png → footer-03-social.block.png} +0 -0
  22. emails/tnp-composer/blocks/{header-01-header.block → header-01-header.block.php} +0 -0
  23. emails/tnp-composer/blocks/{header-01-header.png → header-01-header.block.png} +0 -0
  24. emails/tnp-composer/index.php +5 -5
  25. main/index.php +1 -1
  26. plugin.php +3 -7
  27. readme.txt +8 -1
  28. subscription/subscription.php +2 -138
  29. users/index.php +1 -1
emails/tnp-composer/_scripts/newsletter-builder.js CHANGED
@@ -1,356 +1,359 @@
1
- jQuery.fn.hover_edit = function () {
2
-
3
- this.hover(
4
- function () {
5
- jQuery(this).append('<div class="tnpc-row-edit-hover"><i class="fa fa-pencil" style="line-height:30px;"></i></div>');
6
- jQuery(".tnpc-row-edit-hover").click(function (e) {
7
- e.preventDefault()
8
- });
9
- jQuery(".tnpc-row-edit-hover i").click(function (e) {
10
- e.preventDefault();
11
- target = jQuery(this).parent().parent();
12
-
13
- //edit image
14
- if (target.attr("data-type") == 'image') {
15
- jQuery("#tnpc-edit-image .image").val(target.find('img').attr("src"));
16
- jQuery("#tnpc-edit-image .alt").val(target.find('img').attr("alt"));
17
- jQuery("#tnpc-edit-image .url").val(target.find('a').attr("href"));
18
- jQuery("#tnpc-edit-image").fadeIn(500);
19
- jQuery("#tnpc-edit-image .tnpc-edit-box").slideDown(500);
20
- jQuery("#tnpc-edit-image .tnpc-edit-box-buttons-save").click(function () {
21
- jQuery(this).parent().parent().parent().fadeOut(500)
22
- jQuery(this).parent().parent().slideUp(500)
23
- target.find('img').attr("src", jQuery("#tnpc-edit-image .image").val());
24
- target.find('img').attr("alt", jQuery("#tnpc-edit-image .alt").val());
25
- target.find('a').attr("href", jQuery("#tnpc-edit-image .url").val());
26
- });
27
- }
28
-
29
- //edit link
30
- if (target.attr("data-type") == 'link') {
31
- jQuery("#tnpc-edit-link .title").val(target.text());
32
- jQuery("#tnpc-edit-link .url").val(target.attr("href"));
33
- jQuery("#tnpc-edit-link").fadeIn(500);
34
- jQuery("#tnpc-edit-link .tnpc-edit-box").slideDown(500);
35
- jQuery("#tnpc-edit-link .tnpc-edit-box-buttons-save").click(function () {
36
- jQuery(this).parent().parent().parent().fadeOut(500)
37
- jQuery(this).parent().parent().slideUp(500)
38
- target.text(jQuery("#tnpc-edit-link .title").val());
39
- target.attr("href", jQuery("#tnpc-edit-link .url").val());
40
- });
41
- }
42
-
43
- //edit button
44
- if (target.attr("data-type") == 'button') {
45
- jQuery("#tnpc-edit-button .title").val(target.text());
46
- jQuery("#tnpc-edit-button .url").val(target.attr("href"));
47
- jQuery('.bgcolor, .fgcolor').wpColorPicker({
48
- // change: function (event, ui) {
49
- // jQuery('.bgcolor').iris('hide');
50
- // },
51
- });
52
- jQuery('.bgcolor').wpColorPicker().iris('color', target.css("background-color"));
53
- jQuery('.fgcolor').wpColorPicker().iris('color', target.css("color"));
54
- jQuery("#tnpc-edit-button").fadeIn(500);
55
- jQuery("#tnpc-edit-button .tnpc-edit-box").slideDown(500);
56
- jQuery("#tnpc-edit-button .tnpc-edit-box-buttons-save").click(function () {
57
- jQuery(this).parent().parent().parent().fadeOut(500)
58
- jQuery(this).parent().parent().slideUp(500)
59
- target.text(jQuery("#tnpc-edit-button .title").val());
60
- target.attr("href", jQuery("#tnpc-edit-button .url").val());
61
- target.css("color", jQuery("#tnpc-edit-button .fgcolor").val());
62
- target.css("background-color", jQuery("#tnpc-edit-button .bgcolor").val());
63
- target.css("border-color", jQuery("#tnpc-edit-button .bgcolor").val());
64
- });
65
- }
66
-
67
- //edit title
68
- if (target.attr("data-type") == 'title') {
69
- jQuery("#tnpc-edit-title .title").val(target.text());
70
- jQuery("#tnpc-edit-title .color").val(target.css("color"));
71
- jQuery("#tnpc-edit-title .color").wpColorPicker({
72
- // change: function (event, ui) {
73
- // jQuery('.bgcolor').iris('hide');
74
- // },
75
- });
76
- jQuery("#tnpc-edit-title .color").wpColorPicker().iris('color', target.css("color"));
77
- jQuery("#tnpc-edit-title").fadeIn(500);
78
- jQuery("#tnpc-edit-title .tnpc-edit-box").slideDown(500);
79
- jQuery("#tnpc-edit-title .tnpc-edit-box-buttons-save").click(function () {
80
- jQuery(this).parent().parent().parent().fadeOut(500)
81
- jQuery(this).parent().parent().slideUp(500)
82
- target.text(jQuery("#tnpc-edit-title .title").val());
83
- target.css("color", jQuery("#tnpc-edit-title .color").val());
84
- });
85
- }
86
-
87
- //edit text
88
- if (target.attr("data-type") == 'text') {
89
- jQuery("#tnpc-edit-text .text").val(target.text());
90
- tinymce.init({
91
- selector: '#tnpc-edit-text .text',
92
- menubar: false,
93
- toolbar: [
94
- 'fontselect fontsizeselect forecolor | bold italic underline | link | bullist numlist | emoticons | alignleft aligncenter alignright alignjustify tnp'
95
- ],
96
- plugins: "textcolor,link,emoticons",
97
- init_instance_callback: function (editor) {
98
- editor.setContent(target.html());
99
- },
100
- elementpath: false,
101
- statusbar: false,
102
- forced_root_block: false,
103
- font_formats: "Arial=arial,helvetica,sans-serif" +
104
- "Arial Black=arial black,avant garde;" +
105
- "Tahoma=tahoma,arial,helvetica,sans-serif;" +
106
- "Trebuchet MS=trebuchet ms,geneva;" +
107
- "Verdana=verdana,geneva;" +
108
- "Georgia=georgia,palatino;" +
109
- "Times=times,times new roman;" +
110
- "Times New Roman=times new roman,times;" +
111
- "Courier=courier,courier new;" +
112
- "Courier New=courier new,courier",
113
- setup: function (editor) {
114
- editor.addButton('tnp', {
115
- type: 'menubutton',
116
- image: tinymce.baseURL + '/skins/tnp.png',
117
- menu: [
118
- {text: '{blog_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_url}&nbsp;');}},
119
- {text: '{blog_title}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_title}&nbsp;');}},
120
- {text: '{blog_description}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_description}&nbsp;');}},
121
- {text: '{date}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{date}&nbsp;');}},
122
- {text: '{date_NNN}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{date_NNN}&nbsp;');}},
123
- {text: '{email_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{email_url}&nbsp;');}},
124
- {text: '{name}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{name}&nbsp;');}},
125
- {text: '{surname}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{surname}&nbsp;');}},
126
- {text: '{title}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{title}&nbsp;');}},
127
- {text: '{email}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{email}&nbsp;');}},
128
- {text: '{profile_N}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{profile_N}&nbsp;');}},
129
- {text: '{ip}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{ip}&nbsp;');}},
130
- {text: '{subscription_confirm_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{subscription_confirm_url}&nbsp;');}},
131
- {text: '{unsubscription_confirm_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{unsubscription_confirm_url}&nbsp;');}},
132
- {text: '{profile_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{profile_url}&nbsp;');}},
133
- ],
134
- });
135
- },
136
- });
137
- if (tinymce.activeEditor != null)
138
- tinymce.activeEditor.setContent(target.html());
139
- jQuery("#tnpc-edit-text").fadeIn(500);
140
- jQuery("#tnpc-edit-text .tnpc-edit-box").slideDown(500);
141
- jQuery("#tnpc-edit-text .tnpc-edit-box-buttons-save").click(function () {
142
- jQuery(this).parent().parent().parent().fadeOut(500)
143
- jQuery(this).parent().parent().slideUp(500)
144
- target.html(tinymce.activeEditor.getContent());
145
- });
146
- }
147
-
148
- //edit icon
149
- if (target.attr("data-type") == 'icon') {
150
- jQuery("#tnpc-edit-icon").fadeIn(500);
151
- jQuery("#tnpc-edit-icon .tnpc-edit-box").slideDown(500);
152
- jQuery("#tnpc-edit-icon i").click(function () {
153
- jQuery(this).parent().parent().parent().parent().fadeOut(500)
154
- jQuery(this).parent().parent().parent().slideUp(500)
155
- target.children('i').attr('class', jQuery(this).attr('class'));
156
- });
157
- }//
158
-
159
- });
160
- }, function () {
161
- jQuery(this).children(".tnpc-row-edit-hover").remove();
162
- }
163
- );
164
- }
165
-
166
- jQuery.fn.add_delete = function () {
167
- this.append('<div class="tnpc-row-delete"><i class="fa fa-times" ></i></div>');
168
- this.find('.tnpc-row-delete').perform_delete();
169
- }
170
-
171
- jQuery.fn.perform_delete = function () {
172
- this.click(function () {
173
- jQuery(this).parent().remove();
174
- });
175
- }
176
-
177
- jQuery.fn.add_block_edit = function () {
178
- this.append('<div class="tnpc-row-edit-block"><i class="fa fa-pencil" ></i></div>');
179
- this.find('.tnpc-row-edit-block i').perform_block_edit();
180
- }
181
-
182
- jQuery.fn.perform_block_edit = function () {
183
-
184
- jQuery(".tnpc-row-edit-block").click(function (e) {
185
- e.preventDefault()
186
- });
187
-
188
- this.click(function (e) {
189
-
190
- e.preventDefault();
191
-
192
- target = jQuery(this).parent().parent().find('.edit-block');
193
-
194
- jQuery("#tnpc-edit-block .bgcolor").val(target.css("background-color"));
195
- jQuery("#tnpc-edit-block .font").val(target.css("font-family"));
196
-
197
- jQuery('.bgcolor').wpColorPicker({
198
- // change: function (event, ui) {
199
- // jQuery('.bgcolor').iris('hide');
200
- // },
201
- });
202
- jQuery('.bgcolor').wpColorPicker().iris('color', target.css("background-color"));
203
-
204
- // posts block
205
- if (jQuery(this).parent().parent().hasClass('tnpc-row-posts')) {
206
-
207
- jQuery("#tnpc-edit-posts").fadeIn(500);
208
- jQuery("#tnpc-edit-posts .tnpc-edit-box").slideDown(500);
209
-
210
- } else {
211
-
212
- jQuery("#tnpc-edit-block").fadeIn(500);
213
- jQuery("#tnpc-edit-block .tnpc-edit-box").slideDown(500);
214
-
215
- }
216
-
217
- jQuery("#tnpc-edit-block .tnpc-edit-box-buttons-save").click(function () {
218
- jQuery(this).parent().parent().parent().fadeOut(500)
219
- jQuery(this).parent().parent().slideUp(500)
220
-
221
- target.css("background-color", jQuery("#tnpc-edit-block .bgcolor").val());
222
- target.css("font-family", jQuery("#tnpc-edit-block .font").val());
223
-
224
- });
225
-
226
- jQuery("#tnpc-edit-posts .tnpc-edit-box-buttons-save").click(function () {
227
-
228
- jQuery(this).parent().parent().parent().fadeOut(500)
229
- jQuery(this).parent().parent().slideUp(500)
230
- var categories = [];
231
- jQuery('#tnpc-edit-posts input[name="options[theme_categories][]"]:checked').each(function ()
232
- {
233
- categories.push(jQuery(this).val());
234
- });
235
- var data = {
236
- 'action': 'tnpc_render',
237
- 'b': target.parent().parent().parent().data('block'),
238
- 'num': jQuery("#tnpc-edit-posts .number").val(),
239
- 'tags': jQuery("#tnpc-edit-posts .tags").val(),
240
- 'categories': categories
241
- };
242
- jQuery.post(ajaxurl, data, function (response) {
243
- new_row = jQuery(response);
244
- target.parent().before(new_row).remove();
245
- new_row.add_delete();
246
- new_row.add_block_edit();
247
- new_row.find(".tnpc-row-edit").hover_edit();
248
- });
249
- });
250
-
251
- });
252
-
253
- }
254
-
255
- jQuery(function () {
256
-
257
- // collapse wp menu
258
- jQuery('body').addClass('folded');
259
-
260
- //Drag & Drop
261
- jQuery("#newsletter-builder-area-center-frame-content").sortable({
262
- revert: false,
263
- stop: function (event, ui) {
264
- if (ui.item.hasClass("newsletter-sidebar-buttons-content-tab")) {
265
- loading_row = jQuery('<div style="text-align: center; padding: 20px; background-color: #d4d5d6; color: #52BE7F;"><i class="fa fa-cog fa-2x fa-spin" /></div>');
266
- ui.item.before(loading_row);
267
- ui.item.remove();
268
- var data = {
269
- 'action': 'tnpc_render',
270
- 'b': ui.item.data("file")
271
- };
272
- jQuery.post(ajaxurl, data, function (response) {
273
- new_row = jQuery(response);
274
- // ui.item.before(new_row);
275
- // ui.item.remove();
276
- loading_row.before(new_row);
277
- loading_row.remove();
278
- new_row.add_delete();
279
- new_row.add_block_edit();
280
- new_row.find(".tnpc-row-edit").hover_edit();
281
- });
282
- }
283
- }
284
- });
285
-
286
- jQuery(".tnpc-row").draggable({
287
- connectToSortable: "#newsletter-builder-area-center-frame-content",
288
- //helper: "clone",
289
- revert: false,
290
- handle: ".tnpc-row-move"
291
- });
292
-
293
- jQuery(".newsletter-sidebar-buttons-content-tab").draggable({
294
- connectToSortable: "#newsletter-builder-area-center-frame-content",
295
- helper: "clone",
296
- revert: false,
297
- start: function () {
298
- if (jQuery('.tnpc-row').length)
299
- jQuery('.tnpc-row').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
300
- else
301
- jQuery('#newsletter-builder-area-center-frame-content').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
302
- },
303
- stop: function () {
304
- jQuery('.tnpc-drop-here').remove();
305
- }
306
- });
307
-
308
- //close edit
309
- jQuery(".tnpc-edit-box-buttons-cancel").click(function () {
310
- jQuery(this).parent().parent().parent().fadeOut(500)
311
- jQuery(this).parent().parent().slideUp(500)
312
- });
313
-
314
- // initialize controls
315
- jQuery(".tnpc-row").add_delete();
316
- jQuery(".tnpc-row").add_block_edit();
317
- jQuery(".tnpc-row-edit").hover_edit();
318
-
319
- });
320
-
321
- function create() {
322
-
323
- jQuery("#newsletter-preloaded-export").html(jQuery("#newsletter-builder-area-center-frame-content").html());
324
-
325
- jQuery("#newsletter-preloaded-export .tnpc-row-delete").remove();
326
- jQuery("#newsletter-preloaded-export .tnpc-row-edit-block").remove();
327
- jQuery("#newsletter-preloaded-export .tnpc-row").removeClass("ui-draggable");
328
- // jQuery("#newsletter-preloaded-export .tnpc-row-edit").removeAttr("data-type");
329
- // jQuery("#newsletter-preloaded-export .tnpc-row-edit").removeClass("tnpc-row-edit");
330
- preload_export_html = jQuery("#newsletter-preloaded-export").html();
331
-
332
- if (preload_export_html.indexOf('<style type="text/css">') > -1) {
333
- export_content = preload_export_html;
334
- jQuery("#tnpc-edit-export .text").val(export_content);
335
- jQuery('#tnpc-form input[name="options[body]"]').attr('value', export_content);
336
- jQuery("#tnpc-form").submit();
337
- } else {
338
- jQuery.get(ajaxurl, {action: "tnpc_css"}, function (data) {
339
- // export_content = '<style>' + data + '</style><link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic" rel="stylesheet" type="text/css"><link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"><div id="tnpc-wrapper"><div id="tnpc-wrapper-newsletter">' + preload_export_html + '</div></div>';
340
- export_content = '<!DOCTYPE html><html><head><title>Newsletter</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta http-equiv="X-UA-Compatible" content="IE=edge" />';
341
- export_content += '<style type="text/css">' + data + '</style>';
342
- export_content += '<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic" rel="stylesheet" type="text/css">';
343
- export_content += '<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">';
344
- export_content += '</head><body style="margin: 0; padding: 0;">';
345
- export_content += preload_export_html;
346
- export_content += '</body></html>';
347
- jQuery("#tnpc-edit-export .text").val(export_content);
348
- jQuery('#tnpc-form input[name="options[body]"]').attr('value', export_content);
349
- jQuery("#tnpc-form").submit();
350
- });
351
- }
352
-
353
- jQuery("#newsletter-preloaded-export").html(' ');
354
-
355
- }
356
-
 
 
 
1
+ jQuery.fn.hover_edit = function () {
2
+
3
+ this.hover(
4
+ function () {
5
+ jQuery(this).append('<div class="tnpc-row-edit-hover"><i class="fa fa-pencil" style="line-height:30px;"></i></div>');
6
+ jQuery(".tnpc-row-edit-hover").click(function (e) {
7
+ e.preventDefault()
8
+ });
9
+ jQuery(".tnpc-row-edit-hover i").click(function (e) {
10
+ e.preventDefault();
11
+ $this = jQuery(this);
12
+ target = $this.parent().parent();
13
+ $this.parent().remove();
14
+
15
+ //edit image
16
+ if (target.attr("data-type") == 'image') {
17
+ jQuery("#tnpc-edit-image .image").val(target.find('img').attr("src"));
18
+ jQuery("#tnpc-edit-image .alt").val(target.find('img').attr("alt"));
19
+ jQuery("#tnpc-edit-image .url").val(target.find('a').attr("href"));
20
+ jQuery("#tnpc-edit-image").fadeIn(500);
21
+ jQuery("#tnpc-edit-image .tnpc-edit-box").slideDown(500);
22
+ jQuery("#tnpc-edit-image .tnpc-edit-box-buttons-save").click(function () {
23
+ jQuery(this).parent().parent().parent().fadeOut(500)
24
+ jQuery(this).parent().parent().slideUp(500)
25
+ target.find('img').attr("src", jQuery("#tnpc-edit-image .image").val());
26
+ target.find('img').attr("alt", jQuery("#tnpc-edit-image .alt").val());
27
+ target.find('a').attr("href", jQuery("#tnpc-edit-image .url").val());
28
+ });
29
+ }
30
+
31
+ //edit link
32
+ if (target.attr("data-type") == 'link') {
33
+ jQuery("#tnpc-edit-link .title").val(target.text());
34
+ jQuery("#tnpc-edit-link .url").val(target.attr("href"));
35
+ jQuery("#tnpc-edit-link").show();
36
+ jQuery("#tnpc-edit-link .tnpc-edit-box").show();
37
+ //jQuery("#tnpc-edit-link .tnpc-edit-box").slideDown(300);
38
+ jQuery("#tnpc-edit-link .tnpc-edit-box-buttons-save").click(function () {
39
+ jQuery(this).parent().parent().parent().fadeOut(500)
40
+ jQuery(this).parent().parent().slideUp(500)
41
+ target.text(jQuery("#tnpc-edit-link .title").val());
42
+ target.attr("href", jQuery("#tnpc-edit-link .url").val());
43
+ });
44
+ }
45
+
46
+ //edit button
47
+ if (target.attr("data-type") == 'button') {
48
+ jQuery("#tnpc-edit-button .title").val(target.text());
49
+ jQuery("#tnpc-edit-button .url").val(target.attr("href"));
50
+ jQuery('.bgcolor, .fgcolor').wpColorPicker({
51
+ // change: function (event, ui) {
52
+ // jQuery('.bgcolor').iris('hide');
53
+ // },
54
+ });
55
+ jQuery('.bgcolor').wpColorPicker().iris('color', target.css("background-color"));
56
+ jQuery('.fgcolor').wpColorPicker().iris('color', target.css("color"));
57
+ jQuery("#tnpc-edit-button").fadeIn(500);
58
+ jQuery("#tnpc-edit-button .tnpc-edit-box").slideDown(500);
59
+ jQuery("#tnpc-edit-button .tnpc-edit-box-buttons-save").click(function () {
60
+ jQuery(this).parent().parent().parent().fadeOut(500)
61
+ jQuery(this).parent().parent().slideUp(500)
62
+ target.text(jQuery("#tnpc-edit-button .title").val());
63
+ target.attr("href", jQuery("#tnpc-edit-button .url").val());
64
+ target.css("color", jQuery("#tnpc-edit-button .fgcolor").val());
65
+ target.css("background-color", jQuery("#tnpc-edit-button .bgcolor").val());
66
+ target.css("border-color", jQuery("#tnpc-edit-button .bgcolor").val());
67
+ });
68
+ }
69
+
70
+ //edit title
71
+ if (target.attr("data-type") == 'title') {
72
+ jQuery("#tnpc-edit-title .title").val(target.text());
73
+ jQuery("#tnpc-edit-title .color").val(target.css("color"));
74
+ jQuery("#tnpc-edit-title .color").wpColorPicker({
75
+ // change: function (event, ui) {
76
+ // jQuery('.bgcolor').iris('hide');
77
+ // },
78
+ });
79
+ jQuery("#tnpc-edit-title .color").wpColorPicker().iris('color', target.css("color"));
80
+ jQuery("#tnpc-edit-title").fadeIn(500);
81
+ jQuery("#tnpc-edit-title .tnpc-edit-box").slideDown(500);
82
+ jQuery("#tnpc-edit-title .tnpc-edit-box-buttons-save").click(function () {
83
+ jQuery(this).parent().parent().parent().fadeOut(500)
84
+ jQuery(this).parent().parent().slideUp(500)
85
+ target.text(jQuery("#tnpc-edit-title .title").val());
86
+ target.css("color", jQuery("#tnpc-edit-title .color").val());
87
+ });
88
+ }
89
+
90
+ //edit text
91
+ if (target.attr("data-type") == 'text') {
92
+ jQuery("#tnpc-edit-text .text").val(target.text());
93
+ tinymce.init({
94
+ selector: '#tnpc-edit-text .text',
95
+ menubar: false,
96
+ toolbar: [
97
+ 'fontselect fontsizeselect forecolor | bold italic underline | link | bullist numlist | emoticons | alignleft aligncenter alignright alignjustify tnp'
98
+ ],
99
+ plugins: "textcolor,link,emoticons",
100
+ init_instance_callback: function (editor) {
101
+ editor.setContent(target.html());
102
+ },
103
+ elementpath: false,
104
+ statusbar: false,
105
+ forced_root_block: false,
106
+ font_formats: "Arial=arial,helvetica,sans-serif" +
107
+ "Arial Black=arial black,avant garde;" +
108
+ "Tahoma=tahoma,arial,helvetica,sans-serif;" +
109
+ "Trebuchet MS=trebuchet ms,geneva;" +
110
+ "Verdana=verdana,geneva;" +
111
+ "Georgia=georgia,palatino;" +
112
+ "Times=times,times new roman;" +
113
+ "Times New Roman=times new roman,times;" +
114
+ "Courier=courier,courier new;" +
115
+ "Courier New=courier new,courier",
116
+ setup: function (editor) {
117
+ editor.addButton('tnp', {
118
+ type: 'menubutton',
119
+ image: tinymce.baseURL + '/skins/tnp.png',
120
+ menu: [
121
+ {text: '{blog_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_url}&nbsp;');}},
122
+ {text: '{blog_title}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_title}&nbsp;');}},
123
+ {text: '{blog_description}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{blog_description}&nbsp;');}},
124
+ {text: '{date}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{date}&nbsp;');}},
125
+ {text: '{date_NNN}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{date_NNN}&nbsp;');}},
126
+ {text: '{email_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{email_url}&nbsp;');}},
127
+ {text: '{name}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{name}&nbsp;');}},
128
+ {text: '{surname}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{surname}&nbsp;');}},
129
+ {text: '{title}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{title}&nbsp;');}},
130
+ {text: '{email}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{email}&nbsp;');}},
131
+ {text: '{profile_N}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{profile_N}&nbsp;');}},
132
+ {text: '{ip}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{ip}&nbsp;');}},
133
+ {text: '{subscription_confirm_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{subscription_confirm_url}&nbsp;');}},
134
+ {text: '{unsubscription_confirm_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{unsubscription_confirm_url}&nbsp;');}},
135
+ {text: '{profile_url}', onclick: function () {console.log(this.text); editor.insertContent('&nbsp;{profile_url}&nbsp;');}},
136
+ ],
137
+ });
138
+ },
139
+ });
140
+ if (tinymce.activeEditor != null)
141
+ tinymce.activeEditor.setContent(target.html());
142
+ jQuery("#tnpc-edit-text").fadeIn(500);
143
+ jQuery("#tnpc-edit-text .tnpc-edit-box").slideDown(500);
144
+ jQuery("#tnpc-edit-text .tnpc-edit-box-buttons-save").click(function () {
145
+ jQuery(this).parent().parent().parent().fadeOut(500)
146
+ jQuery(this).parent().parent().slideUp(500)
147
+ target.html(tinymce.activeEditor.getContent());
148
+ });
149
+ }
150
+
151
+ //edit icon
152
+ if (target.attr("data-type") == 'icon') {
153
+ jQuery("#tnpc-edit-icon").fadeIn(500);
154
+ jQuery("#tnpc-edit-icon .tnpc-edit-box").slideDown(500);
155
+ jQuery("#tnpc-edit-icon i").click(function () {
156
+ jQuery(this).parent().parent().parent().parent().fadeOut(500)
157
+ jQuery(this).parent().parent().parent().slideUp(500)
158
+ target.children('i').attr('class', jQuery(this).attr('class'));
159
+ });
160
+ }//
161
+
162
+ });
163
+ }, function () {
164
+ jQuery(this).children(".tnpc-row-edit-hover").remove();
165
+ }
166
+ );
167
+ }
168
+
169
+ jQuery.fn.add_delete = function () {
170
+ this.append('<div class="tnpc-row-delete"><i class="fa fa-times" ></i></div>');
171
+ this.find('.tnpc-row-delete').perform_delete();
172
+ }
173
+
174
+ jQuery.fn.perform_delete = function () {
175
+ this.click(function () {
176
+ jQuery(this).parent().remove();
177
+ });
178
+ }
179
+
180
+ jQuery.fn.add_block_edit = function () {
181
+ this.append('<div class="tnpc-row-edit-block"><i class="fa fa-pencil" ></i></div>');
182
+ this.find('.tnpc-row-edit-block i').perform_block_edit();
183
+ }
184
+
185
+ jQuery.fn.perform_block_edit = function () {
186
+
187
+ jQuery(".tnpc-row-edit-block").click(function (e) {
188
+ e.preventDefault()
189
+ });
190
+
191
+ this.click(function (e) {
192
+
193
+ e.preventDefault();
194
+
195
+ target = jQuery(this).parent().parent().find('.edit-block');
196
+
197
+ jQuery("#tnpc-edit-block .bgcolor").val(target.css("background-color"));
198
+ jQuery("#tnpc-edit-block .font").val(target.css("font-family"));
199
+
200
+ jQuery('.bgcolor').wpColorPicker({
201
+ // change: function (event, ui) {
202
+ // jQuery('.bgcolor').iris('hide');
203
+ // },
204
+ });
205
+ jQuery('.bgcolor').wpColorPicker().iris('color', target.css("background-color"));
206
+
207
+ // posts block
208
+ if (jQuery(this).parent().parent().hasClass('tnpc-row-posts')) {
209
+
210
+ jQuery("#tnpc-edit-posts").fadeIn(500);
211
+ jQuery("#tnpc-edit-posts .tnpc-edit-box").slideDown(500);
212
+
213
+ } else {
214
+
215
+ jQuery("#tnpc-edit-block").fadeIn(500);
216
+ jQuery("#tnpc-edit-block .tnpc-edit-box").slideDown(500);
217
+
218
+ }
219
+
220
+ jQuery("#tnpc-edit-block .tnpc-edit-box-buttons-save").click(function () {
221
+ jQuery(this).parent().parent().parent().fadeOut(500)
222
+ jQuery(this).parent().parent().slideUp(500)
223
+
224
+ target.css("background-color", jQuery("#tnpc-edit-block .bgcolor").val());
225
+ target.css("font-family", jQuery("#tnpc-edit-block .font").val());
226
+
227
+ });
228
+
229
+ jQuery("#tnpc-edit-posts .tnpc-edit-box-buttons-save").click(function () {
230
+
231
+ jQuery(this).parent().parent().parent().fadeOut(500)
232
+ jQuery(this).parent().parent().slideUp(500)
233
+ var categories = [];
234
+ jQuery('#tnpc-edit-posts input[name="options[theme_categories][]"]:checked').each(function ()
235
+ {
236
+ categories.push(jQuery(this).val());
237
+ });
238
+ var data = {
239
+ 'action': 'tnpc_render',
240
+ 'b': target.parent().parent().parent().data('block'),
241
+ 'num': jQuery("#tnpc-edit-posts .number").val(),
242
+ 'tags': jQuery("#tnpc-edit-posts .tags").val(),
243
+ 'categories': categories
244
+ };
245
+ jQuery.post(ajaxurl, data, function (response) {
246
+ new_row = jQuery(response);
247
+ target.parent().before(new_row).remove();
248
+ new_row.add_delete();
249
+ new_row.add_block_edit();
250
+ new_row.find(".tnpc-row-edit").hover_edit();
251
+ });
252
+ });
253
+
254
+ });
255
+
256
+ }
257
+
258
+ jQuery(function () {
259
+
260
+ // collapse wp menu
261
+ jQuery('body').addClass('folded');
262
+
263
+ //Drag & Drop
264
+ jQuery("#newsletter-builder-area-center-frame-content").sortable({
265
+ revert: false,
266
+ stop: function (event, ui) {
267
+ if (ui.item.hasClass("newsletter-sidebar-buttons-content-tab")) {
268
+ loading_row = jQuery('<div style="text-align: center; padding: 20px; background-color: #d4d5d6; color: #52BE7F;"><i class="fa fa-cog fa-2x fa-spin" /></div>');
269
+ ui.item.before(loading_row);
270
+ ui.item.remove();
271
+ var data = {
272
+ 'action': 'tnpc_render',
273
+ 'b': ui.item.data("file")
274
+ };
275
+ jQuery.post(ajaxurl, data, function (response) {
276
+ new_row = jQuery(response);
277
+ // ui.item.before(new_row);
278
+ // ui.item.remove();
279
+ loading_row.before(new_row);
280
+ loading_row.remove();
281
+ new_row.add_delete();
282
+ new_row.add_block_edit();
283
+ new_row.find(".tnpc-row-edit").hover_edit();
284
+ });
285
+ }
286
+ }
287
+ });
288
+
289
+ jQuery(".tnpc-row").draggable({
290
+ connectToSortable: "#newsletter-builder-area-center-frame-content",
291
+ //helper: "clone",
292
+ revert: false,
293
+ handle: ".tnpc-row-move"
294
+ });
295
+
296
+ jQuery(".newsletter-sidebar-buttons-content-tab").draggable({
297
+ connectToSortable: "#newsletter-builder-area-center-frame-content",
298
+ helper: "clone",
299
+ revert: false,
300
+ start: function () {
301
+ if (jQuery('.tnpc-row').length)
302
+ jQuery('.tnpc-row').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
303
+ else
304
+ jQuery('#newsletter-builder-area-center-frame-content').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
305
+ },
306
+ stop: function () {
307
+ jQuery('.tnpc-drop-here').remove();
308
+ }
309
+ });
310
+
311
+ //close edit
312
+ jQuery(".tnpc-edit-box-buttons-cancel").click(function () {
313
+ jQuery(this).parent().parent().parent().fadeOut(500)
314
+ jQuery(this).parent().parent().slideUp(500)
315
+ });
316
+
317
+ // initialize controls
318
+ jQuery(".tnpc-row").add_delete();
319
+ jQuery(".tnpc-row").add_block_edit();
320
+ jQuery(".tnpc-row-edit").hover_edit();
321
+
322
+ });
323
+
324
+ function create() {
325
+
326
+ jQuery("#newsletter-preloaded-export").html(jQuery("#newsletter-builder-area-center-frame-content").html());
327
+
328
+ jQuery("#newsletter-preloaded-export .tnpc-row-delete").remove();
329
+ jQuery("#newsletter-preloaded-export .tnpc-row-edit-block").remove();
330
+ jQuery("#newsletter-preloaded-export .tnpc-row").removeClass("ui-draggable");
331
+ // jQuery("#newsletter-preloaded-export .tnpc-row-edit").removeAttr("data-type");
332
+ // jQuery("#newsletter-preloaded-export .tnpc-row-edit").removeClass("tnpc-row-edit");
333
+ preload_export_html = jQuery("#newsletter-preloaded-export").html();
334
+
335
+ if (preload_export_html.indexOf('<style type="text/css">') > -1) {
336
+ export_content = preload_export_html;
337
+ jQuery("#tnpc-edit-export .text").val(export_content);
338
+ jQuery('#tnpc-form input[name="options[body]"]').attr('value', export_content);
339
+ jQuery("#tnpc-form").submit();
340
+ } else {
341
+ jQuery.get(ajaxurl, {action: "tnpc_css"}, function (data) {
342
+ // export_content = '<style>' + data + '</style><link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic" rel="stylesheet" type="text/css"><link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"><div id="tnpc-wrapper"><div id="tnpc-wrapper-newsletter">' + preload_export_html + '</div></div>';
343
+ export_content = '<!DOCTYPE html><html><head><title>Newsletter</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta http-equiv="X-UA-Compatible" content="IE=edge" />';
344
+ export_content += '<style type="text/css">' + data + '</style>';
345
+ export_content += '<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic" rel="stylesheet" type="text/css">';
346
+ export_content += '<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">';
347
+ export_content += '</head><body style="margin: 0; padding: 0;">';
348
+ export_content += preload_export_html;
349
+ export_content += '</body></html>';
350
+ jQuery("#tnpc-edit-export .text").val(export_content);
351
+ jQuery('#tnpc-form input[name="options[body]"]').attr('value', export_content);
352
+ jQuery("#tnpc-form").submit();
353
+ });
354
+ }
355
+
356
+ jQuery("#newsletter-preloaded-export").html(' ');
357
+
358
+ }
359
+
emails/tnp-composer/blocks/{content-01-hero.block → content-01-hero.block.php} RENAMED
File without changes
emails/tnp-composer/blocks/{content-01-hero.png → content-01-hero.block.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-02-heading.block → content-02-heading.block.php} RENAMED
File without changes
emails/tnp-composer/blocks/{content-02-heading.png → content-02-heading.block.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-03-text.block → content-03-text.block.php} RENAMED
File without changes
emails/tnp-composer/blocks/{content-03-text.png → content-03-text.block.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-04-cta.block → content-04-cta.block.php} RENAMED
File without changes
emails/tnp-composer/blocks/{content-04-cta.png → content-04-cta.block.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-05-image.block → content-05-image.block.php} RENAMED
File without changes
emails/tnp-composer/blocks/{content-05-image.png → content-05-image.block.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-06-posts.block → content-06-posts.block.php} RENAMED
File without changes
emails/tnp-composer/blocks/{content-06-posts.png → content-06-posts.block.png} RENAMED
File without changes
emails/tnp-composer/blocks/{content-07-twocols.block → content-07-twocols.block.php} RENAMED
File without changes
emails/tnp-composer/blocks/{content-07-twocols.png → content-07-twocols.block.png} RENAMED
File without changes
emails/tnp-composer/blocks/{footer-01-footer.block → footer-01-footer.block.php} RENAMED
File without changes
emails/tnp-composer/blocks/{footer-01-footer.png → footer-01-footer.block.png} RENAMED
File without changes
emails/tnp-composer/blocks/{footer-02-canspam.block → footer-02-canspam.block.php} RENAMED
File without changes
emails/tnp-composer/blocks/{footer-02-canspam.png → footer-02-canspam.block.png} RENAMED
File without changes
emails/tnp-composer/blocks/{footer-03-social.block → footer-03-social.block.php} RENAMED
File without changes
emails/tnp-composer/blocks/{footer-03-social.png → footer-03-social.block.png} RENAMED
File without changes
emails/tnp-composer/blocks/{header-01-header.block → header-01-header.block.php} RENAMED
File without changes
emails/tnp-composer/blocks/{header-01-header.png → header-01-header.block.png} RENAMED
File without changes
emails/tnp-composer/index.php CHANGED
@@ -3,7 +3,7 @@ if (!defined('ABSPATH')) exit;
3
 
4
  /* READ THE BLOCKS */
5
  $blocks_dir = NEWSLETTER_DIR . '/emails/tnp-composer/blocks/';
6
- $files = glob($blocks_dir . '*.block', GLOB_BRACE);
7
  foreach ($files as $file) {
8
  $path_parts = pathinfo($file);
9
  $filename = $path_parts['filename'];
@@ -66,10 +66,10 @@ $block_options = get_option('newsletter_main');
66
  echo $body;
67
  }
68
  } else {
69
- include $blocks_dir . 'header-01-header.block';
70
- include $blocks_dir . 'content-01-hero.block';
71
- include $blocks_dir . 'footer-01-footer.block';
72
- include $blocks_dir . 'footer-02-canspam.block';
73
  }
74
  ?>
75
 
3
 
4
  /* READ THE BLOCKS */
5
  $blocks_dir = NEWSLETTER_DIR . '/emails/tnp-composer/blocks/';
6
+ $files = glob($blocks_dir . '*.block.php', GLOB_BRACE);
7
  foreach ($files as $file) {
8
  $path_parts = pathinfo($file);
9
  $filename = $path_parts['filename'];
66
  echo $body;
67
  }
68
  } else {
69
+ include $blocks_dir . 'header-01-header.block.php';
70
+ include $blocks_dir . 'content-01-hero.block.php';
71
+ include $blocks_dir . 'footer-01-footer.block.php';
72
+ include $blocks_dir . 'footer-02-canspam.block.php';
73
  }
74
  ?>
75
 
main/index.php CHANGED
@@ -351,7 +351,7 @@ $labels = array_reverse($labels);
351
  ?></td>
352
  <td style="white-space:nowrap">
353
  <a class="button" title="<?php _e('Edit', 'newsletter') ?>" href="<?php echo $users_module->get_admin_page_url('edit'); ?>&amp;id=<?php echo $s->id; ?>"><i class="fa fa-pencil"></i></a>
354
- <a title="<?php _e('Profile', 'newsletter') ?>" href="<?php echo plugins_url('newsletter/do/profile.php'); ?>?nk=<?php echo $s->id . '-' . $s->token; ?>" class="button" target="_blank"><i class="fa fa-user"></i></a>
355
  </td>
356
  </tr>
357
  <?php } ?>
351
  ?></td>
352
  <td style="white-space:nowrap">
353
  <a class="button" title="<?php _e('Edit', 'newsletter') ?>" href="<?php echo $users_module->get_admin_page_url('edit'); ?>&amp;id=<?php echo $s->id; ?>"><i class="fa fa-pencil"></i></a>
354
+ <a title="<?php _e('Profile', 'newsletter') ?>" href="<?php echo home_url('/') ?>?na=p&nk=<?php echo $s->id . '-' . $s->token; ?>" class="button" target="_blank"><i class="fa fa-user"></i></a>
355
  </td>
356
  </tr>
357
  <?php } ?>
plugin.php CHANGED
@@ -4,7 +4,7 @@
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/category/release">this page</a> to know what's changed.</strong>
7
- Version: 4.6.3
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: http://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -14,7 +14,7 @@
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
- define('NEWSLETTER_VERSION', '4.6.3');
18
 
19
  global $wpdb, $newsletter;
20
 
@@ -1442,10 +1442,6 @@ if (!is_dir(WP_PLUGIN_DIR . '/newsletter-feed')) {
1442
  }
1443
  }
1444
 
1445
- //if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/updates/updates.php')) {
1446
- // require_once WP_CONTENT_DIR . '/extensions/newsletter/updates/updates.php';
1447
- //}
1448
-
1449
  if (!is_dir(WP_PLUGIN_DIR . '/newsletter-followup')) {
1450
  if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/followup/followup.php')) {
1451
  require_once WP_CONTENT_DIR . '/extensions/newsletter/followup/followup.php';
@@ -1512,7 +1508,7 @@ function newsletter_deactivate() {
1512
 
1513
  function tnpc_render_callback() {
1514
  $block_options = get_option('newsletter_main');
1515
- include NEWSLETTER_DIR . '/emails/tnp-composer/blocks/' . sanitize_file_name($_POST['b']) . '.block';
1516
  wp_die(); // this is required to terminate immediately and return a proper response
1517
  }
1518
 
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/category/release">this page</a> to know what's changed.</strong>
7
+ Version: 4.6.4
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: http://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
+ define('NEWSLETTER_VERSION', '4.6.4');
18
 
19
  global $wpdb, $newsletter;
20
 
1442
  }
1443
  }
1444
 
 
 
 
 
1445
  if (!is_dir(WP_PLUGIN_DIR . '/newsletter-followup')) {
1446
  if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/followup/followup.php')) {
1447
  require_once WP_CONTENT_DIR . '/extensions/newsletter/followup/followup.php';
1508
 
1509
  function tnpc_render_callback() {
1510
  $block_options = get_option('newsletter_main');
1511
+ include NEWSLETTER_DIR . '/emails/tnp-composer/blocks/' . sanitize_file_name($_POST['b']) . '.php';
1512
  wp_die(); // this is required to terminate immediately and return a proper response
1513
  }
1514
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated
3
  Requires at least: 3.4.0
4
  Tested up to: 4.6.1
5
- Stable tag: 4.6.3
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -77,6 +77,13 @@ Thank you, The Newsletter Team
77
 
78
  == Changelog ==
79
 
 
 
 
 
 
 
 
80
  = 4.6.3 =
81
 
82
  * Fixed the profile save with new action url
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated
3
  Requires at least: 3.4.0
4
  Tested up to: 4.6.1
5
+ Stable tag: 4.6.4
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
77
 
78
  == Changelog ==
79
 
80
+ = 4.6.4 =
81
+
82
+ * Fixed the profile link in admin panels
83
+ * Fixed the composer editor
84
+ * Cleanup of old code
85
+ * Force the composer editor to keep the absolute urls
86
+
87
  = 4.6.3 =
88
 
89
  * Fixed the profile save with new action url
subscription/subscription.php CHANGED
@@ -26,8 +26,6 @@ class NewsletterSubscription extends NewsletterModule {
26
 
27
  parent::__construct('subscription', '2.0.2');
28
 
29
- // $this->options_lock = $this->get_options('lock');
30
- //add_action('wp_login', array($this, 'hook_wp_login'));
31
  // Must be called after the Newsletter::hook_init, since some constants are defined
32
  // there.
33
  add_action('init', array($this, 'hook_init'), 90);
@@ -43,14 +41,6 @@ class NewsletterSubscription extends NewsletterModule {
43
  //add_shortcode('newsletter_lock', array($this, 'shortcode_newsletter_lock'));
44
  }
45
 
46
- // function hook_delete_user($id) {
47
- // global $wpdb;
48
- // $options = $this->get_options('wp');
49
- // if ($options['delete'] == 1) {
50
- // $wpdb->delete(NEWSLETTER_USERS_TABLE, array('wp_user_id' => $id));
51
- // }
52
- // }
53
-
54
  function hook_wp_loaded() {
55
  global $newsletter, $wpdb;
56
 
@@ -206,54 +196,6 @@ class NewsletterSubscription extends NewsletterModule {
206
  $this->add_admin_page('unsubscription', 'Unsubscription');
207
  }
208
 
209
- // function hook_the_content($content) {
210
- // global $post, $cache_stop;
211
- //
212
- // if ($this->lock_found || !is_singular() || is_user_logged_in()) {
213
- // return $content;
214
- // }
215
- //
216
- // if (!empty($this->options_lock['ids'])) {
217
- // $ids = explode(',', $this->options_lock['ids']);
218
- // }
219
- //
220
- // if (!empty($ids) && (has_tag($ids) || in_category($ids) || in_array($post->post_name, $ids))) {
221
- // $cache_stop = true;
222
- // $user = $this->check_user();
223
- // if ($user == null || $user->status != 'C') {
224
- // $buffer = $this->replace($this->options_lock['message']);
225
- // return '<div class="newsletter-lock">' . do_shortcode($buffer) . '</div>';
226
- // }
227
- // }
228
- //
229
- // return $content;
230
- // }
231
- // function shortcode_newsletter_lock($attrs, $content = null) {
232
- // global $hyper_cache_stop, $cache_stop;
233
- //
234
- // //$this->logger->debug('Lock short code start');
235
- // $hyper_cache_stop = true;
236
- // $cache_stop = true;
237
- //
238
- // $this->lock_found = true;
239
- //
240
- // $user = $this->check_user();
241
- // if ($user != null && $user->status == 'C') {
242
- // return do_shortcode($content);
243
- // }
244
- //
245
- // $buffer = $this->options_lock['message'];
246
- //// ob_start();
247
- //// eval('? >' . $buffer . "\n");
248
- //// $buffer = ob_get_clean();
249
- // // TODO: add the newsletter check on submit
250
- // $buffer = str_ireplace('<form', '<form method="post" action="' . plugins_url('newsletter/do/subscribe.php') . '"', $buffer);
251
- // $buffer = Newsletter::instance()->replace($buffer, null, null, 'lock');
252
- //
253
- // $buffer = do_shortcode($buffer);
254
- //
255
- // return '<div class="newsletter-lock">' . $buffer . '</div>';
256
- // }
257
 
258
  function hook_wp_footer() {
259
 
@@ -293,27 +235,6 @@ class NewsletterSubscription extends NewsletterModule {
293
  return parent::get_options($sub);
294
  }
295
 
296
- /**
297
- * See wp-includes/user.php function wp_signon().
298
- */
299
- // function hook_wp_login($user_login) {
300
- //
301
- // $newsletter = Newsletter::instance();
302
- //
303
- // //$this->logger->info(__METHOD__ . '> Start with ' . $user_login);
304
- // $wp_user = get_user_by('login', $user_login);
305
- // if (!empty($wp_user)) {
306
- // //$this->logger->info($wp_user);
307
- // // We have a user able to login, so his subscription can be confirmed if not confirmed
308
- // $user = $newsletter->get_user($wp_user->user_email);
309
- // if (!empty($user)) {
310
- // $wp_options = $this->get_options('wp');
311
- // $this->confirm($user->id, $wp_options['welcome'] == 1);
312
- // }
313
- // }
314
- // //$this->logger->info(__METHOD__ . '> End');
315
- // }
316
-
317
  /**
318
  * Return the subscribed user.
319
  *
@@ -1723,48 +1644,8 @@ function newsletter_shortcode($attrs, $content) {
1723
  return $message;
1724
  }
1725
 
1726
- //// The hook is always active so the module can be activated only on registration (otherwise we should check that
1727
- //// option on every page load. The registration code should be moved inside the module...
1728
- //add_action('user_register', 'newsletter_subscription_user_register');
1729
- //
1730
- //function newsletter_subscription_user_register($wp_user_id) {
1731
- // global $wpdb, $newsletter;
1732
- //
1733
- // $module = NewsletterSubscription::instance();
1734
- // $wp_options = $module->get_options('wp');
1735
- // // If the integration is disabled...
1736
- // if ($wp_options['subscribe'] == 0) {
1737
- // return;
1738
- // }
1739
- //
1740
- // // If not forced and the user didn't choose the newsletter...
1741
- // if ($wp_options['subscribe'] != 1) {
1742
- // if (!isset($_REQUEST['newsletter'])) {
1743
- // return;
1744
- // }
1745
- // }
1746
- //
1747
- // $module->logger->info('Adding a registered WordPress user (' . $wp_user_id . ')');
1748
- // $wp_user = $wpdb->get_row($wpdb->prepare("select * from $wpdb->users where id=%d limit 1", $wp_user_id));
1749
- // if (empty($wp_user)) {
1750
- // $module->logger->error('User not found?!');
1751
- // return;
1752
- // }
1753
- //
1754
- // // Yes, some registration procedures allow empty email
1755
- // if (!NewsletterModule::is_email($wp_user->user_email)) {
1756
- // return;
1757
- // }
1758
- //
1759
- // $_REQUEST['ne'] = $wp_user->user_email;
1760
- // $_REQUEST['nr'] = 'registration';
1761
- // // Upon registration there is no last name and first name, sorry.
1762
- // // $status is determined by the opt in
1763
- // $user = $module->subscribe(null, $wp_options['confirmation'] == 1);
1764
- //
1765
- // // Now we associate it with wp
1766
- // $module->set_user_wp_user_id($user->id, $wp_user_id);
1767
- //}
1768
  // Compatibility code
1769
 
1770
  function newsletter_form($number = null) {
@@ -1774,20 +1655,3 @@ function newsletter_form($number = null) {
1774
  echo NewsletterSubscription::instance()->get_subscription_form();
1775
  }
1776
  }
1777
-
1778
- //add_action('register_form', 'newsletter_register_form');
1779
- //
1780
- //function newsletter_register_form() {
1781
- // $module = NewsletterSubscription::instance();
1782
- // $wp_options = $module->get_options('wp');
1783
- // if ($wp_options['subscribe'] == 2 || $wp_options['subscribe'] == 3) {
1784
- // echo '<p>';
1785
- // echo '<input type="checkbox" value="1" name="newsletter"';
1786
- // if ($wp_options['subscribe'] == 3) {
1787
- // echo ' checked';
1788
- // }
1789
- // echo '>&nbsp;';
1790
- // echo $wp_options['subscribe_label'];
1791
- // echo '</p>';
1792
- // }
1793
- //}
26
 
27
  parent::__construct('subscription', '2.0.2');
28
 
 
 
29
  // Must be called after the Newsletter::hook_init, since some constants are defined
30
  // there.
31
  add_action('init', array($this, 'hook_init'), 90);
41
  //add_shortcode('newsletter_lock', array($this, 'shortcode_newsletter_lock'));
42
  }
43
 
 
 
 
 
 
 
 
 
44
  function hook_wp_loaded() {
45
  global $newsletter, $wpdb;
46
 
196
  $this->add_admin_page('unsubscription', 'Unsubscription');
197
  }
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
 
200
  function hook_wp_footer() {
201
 
235
  return parent::get_options($sub);
236
  }
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  /**
239
  * Return the subscribed user.
240
  *
1644
  return $message;
1645
  }
1646
 
1647
+ NewsletterSubscription::instance();
1648
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1649
  // Compatibility code
1650
 
1651
  function newsletter_form($number = null) {
1655
  echo NewsletterSubscription::instance()->get_subscription_form();
1656
  }
1657
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
users/index.php CHANGED
@@ -242,7 +242,7 @@ $controls->data['search_page']++;
242
 
243
  <?php $controls->button_confirm('resend', __('Resend confirmation', 'newsletter'), __('Proceed?', 'newsletter'), $s->id); ?>
244
  <?php $controls->button_confirm('resend_welcome', __('Resend welcome', 'newsletter'), __('Proceed?', 'newsletter'), $s->id); ?>
245
- <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') ?></a>
246
  </td>
247
 
248
 
242
 
243
  <?php $controls->button_confirm('resend', __('Resend confirmation', 'newsletter'), __('Proceed?', 'newsletter'), $s->id); ?>
244
  <?php $controls->button_confirm('resend_welcome', __('Resend welcome', 'newsletter'), __('Proceed?', 'newsletter'), $s->id); ?>
245
+ <a href="<?php echo home_url('/') ?>?na=p&nk=<?php echo $s->id . '-' . $s->token; ?>" class="button" target="_blank"><?php _e('Profile page', 'newsletter') ?></a>
246
  </td>
247
 
248