Version Description
- Fixed extra field of type "list" not showing up correctly (when more than one)
- removed the collapsed sub panel on some configuration panel (people did not realized that a click would open them)
- fixed the unconfirmed status display on users panel
- fixed the status list on user edit panel
Download this release
Release Info
Developer | satollo |
Plugin | Newsletter |
Version | 2.5.2.3 |
Comparing to | |
See all releases |
Code changes from version 2.5.1.7 to 2.5.2.3
- do.php +45 -0
- header.php +1 -1
- options.php +0 -62
- plugin.php +15 -20
- readme.txt +21 -0
- users-edit.php +1 -1
- users.php +63 -18
- widget.php +2 -2
do.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
include '../../../wp-load.php';
|
4 |
+
|
5 |
+
$action = $_REQUEST['a'];
|
6 |
+
if (empty($action)) return;
|
7 |
+
|
8 |
+
$user = $newsletter->check_user();
|
9 |
+
|
10 |
+
if ($user == null) {
|
11 |
+
echo 'Subscriber not found, sorry.';
|
12 |
+
die();
|
13 |
+
}
|
14 |
+
|
15 |
+
$options = get_option('newsletter', array());
|
16 |
+
$options_main = get_option('newsletter_main', array());
|
17 |
+
|
18 |
+
if ($action == 'c') {
|
19 |
+
setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
|
20 |
+
$wpdb->query("update " . $wpdb->prefix . "newsletter set status='C' where id=" . $user->id);
|
21 |
+
|
22 |
+
$newsletter->mail($user->email, $newsletter->replace($options['confirmed_subject'], $user), $newsletter->replace($options['confirmed_message'], $user));
|
23 |
+
$newsletter->notify_admin($user, 'Newsletter subscription');
|
24 |
+
|
25 |
+
$url = $options_main['url'];
|
26 |
+
if (empty($url)) $url = get_option('home');
|
27 |
+
|
28 |
+
header('Location: ' . $newsletter->add_qs($url, 'na=c&ni=' . $user->id . '&nt=' . $user->token, false));
|
29 |
+
die();
|
30 |
+
}
|
31 |
+
|
32 |
+
if ($action == 'uc') {
|
33 |
+
$wpdb->query($wpdb->prepare("update " . $wpdb->prefix . "newsletter set status='U' where id=%d and token=%s", $user->id, $user->token));
|
34 |
+
setcookie("newsletter", "", time() - 3600);
|
35 |
+
$newsletter->mail($user->email, $newsletter->replace($options['unsubscribed_subject'], $user), $newsletter->replace($options['unsubscribed_message'], $user));
|
36 |
+
$newsletter->notify_admin($user, 'Newsletter cancellation');
|
37 |
+
|
38 |
+
$url = $options_main['url'];
|
39 |
+
if (empty($url)) $url = get_option('home');
|
40 |
+
|
41 |
+
header('Location: ' . $newsletter->add_qs($url, 'na=uc&ni=' . $user->id . '&nt=' . $user->token, false));
|
42 |
+
die();
|
43 |
+
}
|
44 |
+
?>
|
45 |
+
Unknown action.
|
header.php
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
<iframe src="http://frames.satollo.net/newsletter.php" frameborder="0" width="100%" height="80" style="border: 0"></iframe>
|
2 |
-
|
1 |
<iframe src="http://frames.satollo.net/newsletter.php" frameborder="0" width="100%" height="80" style="border: 0"></iframe>
|
2 |
+
|
options.php
CHANGED
@@ -43,68 +43,6 @@ tinyMCE.init({
|
|
43 |
</script>
|
44 |
<?php } ?>
|
45 |
|
46 |
-
<script>
|
47 |
-
jQuery.cookie = function(name, value, options) {
|
48 |
-
if (typeof value != 'undefined') { // name and value given, set cookie
|
49 |
-
options = options || {};
|
50 |
-
if (value === null) {
|
51 |
-
value = '';
|
52 |
-
options.expires = -1;
|
53 |
-
}
|
54 |
-
var expires = '';
|
55 |
-
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
56 |
-
var date;
|
57 |
-
if (typeof options.expires == 'number') {
|
58 |
-
date = new Date();
|
59 |
-
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
60 |
-
} else {
|
61 |
-
date = options.expires;
|
62 |
-
}
|
63 |
-
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
64 |
-
}
|
65 |
-
// CAUTION: Needed to parenthesize options.path and options.domain
|
66 |
-
// in the following expressions, otherwise they evaluate to undefined
|
67 |
-
// in the packed version for some reason...
|
68 |
-
var path = options.path ? '; path=' + (options.path) : '';
|
69 |
-
var domain = options.domain ? '; domain=' + (options.domain) : '';
|
70 |
-
var secure = options.secure ? '; secure' : '';
|
71 |
-
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
72 |
-
} else { // only name given, get cookie
|
73 |
-
var cookieValue = null;
|
74 |
-
if (document.cookie && document.cookie != '') {
|
75 |
-
var cookies = document.cookie.split(';');
|
76 |
-
for (var i = 0; i < cookies.length; i++) {
|
77 |
-
var cookie = jQuery.trim(cookies[i]);
|
78 |
-
// Does this cookie string begin with the name we want?
|
79 |
-
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
80 |
-
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
81 |
-
break;
|
82 |
-
}
|
83 |
-
}
|
84 |
-
}
|
85 |
-
return cookieValue;
|
86 |
-
}
|
87 |
-
};
|
88 |
-
|
89 |
-
jQuery(document).ready(function () {
|
90 |
-
var cookie = jQuery.cookie("np-options");
|
91 |
-
if (!cookie) cookie = "0-";
|
92 |
-
jQuery(".wrap h3").each(function (index) {
|
93 |
-
var div = jQuery(this).next('div');
|
94 |
-
div.toggle(cookie.indexOf(index + "-") >= 0);
|
95 |
-
});
|
96 |
-
|
97 |
-
jQuery(".wrap h3").click(function () {
|
98 |
-
var cookie = "";
|
99 |
-
jQuery(this).next('div').toggle(500);
|
100 |
-
jQuery(".wrap h3").each(function (index) {
|
101 |
-
if (jQuery(this).next('div').is(":visible")) cookie += index + "-";
|
102 |
-
});
|
103 |
-
jQuery.cookie("np-options", cookie);
|
104 |
-
});
|
105 |
-
});
|
106 |
-
</script>
|
107 |
-
|
108 |
<div class="wrap">
|
109 |
|
110 |
<?php $nc->errors($errors); ?>
|
43 |
</script>
|
44 |
<?php } ?>
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
<div class="wrap">
|
47 |
|
48 |
<?php $nc->errors($errors); ?>
|
plugin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Newsletter
|
4 |
Plugin URI: http://www.satollo.net/plugins/newsletter
|
5 |
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>
|
6 |
-
Version: 2.5.
|
7 |
Author: Satollo
|
8 |
Author URI: http://www.satollo.net
|
9 |
Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
|
@@ -269,7 +269,7 @@ class Newsletter {
|
|
269 |
function log($text='', $level=2) {
|
270 |
if ((int) $this->options_main['logs'] < $level) return;
|
271 |
|
272 |
-
|
273 |
$time = date('d-m-Y H:i:s ');
|
274 |
switch ($level) {
|
275 |
case 1: $time .= '- ERROR';
|
@@ -280,7 +280,7 @@ class Newsletter {
|
|
280 |
break;
|
281 |
}
|
282 |
if (is_array($text) || is_object($text)) $text = print_r($text, true);
|
283 |
-
file_put_contents(dirname(__FILE__) . '/log.txt', $time . ' - ' . $
|
284 |
}
|
285 |
|
286 |
function hook_activate() {
|
@@ -307,7 +307,9 @@ class Newsletter {
|
|
307 |
$options = get_option('newsletter_profile');
|
308 |
|
309 |
$buffer .= '<div class="newsletter newsletter-profile">';
|
310 |
-
$buffer .= '<form action="" method="post"><input type="hidden" name="na" value="ps"/>';
|
|
|
|
|
311 |
$buffer .= '<table>';
|
312 |
$buffer .= '<tr><th align="right">' . $options['email'] . '</th><td><input type="text" size="30" name="ne" value="' . htmlspecialchars($user->email) . '"/></td></tr>';
|
313 |
if ($options['name_status'] >= 1) {
|
@@ -340,11 +342,11 @@ class Newsletter {
|
|
340 |
if ($options['profile_' . $i . '_type'] == 'select') {
|
341 |
$buffer .= '<select name="np' . $i . '">';
|
342 |
$opts = explode(',', $options['profile_' . $i . '_options']);
|
343 |
-
for ($
|
344 |
-
$opts[$
|
345 |
$buffer .= '<option';
|
346 |
-
if ($opts[$
|
347 |
-
$buffer .= '>' . $opts[$
|
348 |
}
|
349 |
$buffer .= '</select>';
|
350 |
}
|
@@ -405,8 +407,8 @@ class Newsletter {
|
|
405 |
if ($options_profile['profile_' . $i . '_type'] == 'select') {
|
406 |
$buffer .= '<tr><th>' . $options_profile['profile_' . $i] . '</th><td><select name="np' . $i . '">';
|
407 |
$opts = explode(',', $options_profile['profile_' . $i . '_options']);
|
408 |
-
for ($
|
409 |
-
$buffer .= '<option>' . trim($opts[$
|
410 |
}
|
411 |
$buffer .= '</select></td></tr>';
|
412 |
}
|
@@ -563,11 +565,6 @@ class Newsletter {
|
|
563 |
|
564 |
if ($action == 'c') {
|
565 |
setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
|
566 |
-
$wpdb->query("update " . $wpdb->prefix . "newsletter set status='C' where id=" . $user->id);
|
567 |
-
|
568 |
-
$this->mail($user->email, $this->replace($options['confirmed_subject'], $user), $this->replace($options['confirmed_message'], $user));
|
569 |
-
|
570 |
-
$this->notify_admin($user, 'Newsletter subscription');
|
571 |
|
572 |
if (!empty($options['confirmed_url'])) {
|
573 |
header('Location: ' . $options['confirmed_url']);
|
@@ -586,10 +583,7 @@ class Newsletter {
|
|
586 |
// Unsubscription confirm
|
587 |
if ($action == 'uc') {
|
588 |
setcookie("newsletter", "", time() - 3600);
|
589 |
-
$wpdb->query($wpdb->prepare("delete from " . $wpdb->prefix . "newsletter where id=%d" . " and token=%s", $user->id, $user->token));
|
590 |
$this->message = $this->replace($options['unsubscribed_text'], $user);
|
591 |
-
$this->mail($user->email, $this->replace($options['unsubscribed_subject'], $user), $this->replace($options['unsubscribed_message'], $user));
|
592 |
-
$this->notify_admin($user, 'Newsletter cancellation');
|
593 |
return;
|
594 |
}
|
595 |
|
@@ -726,9 +720,10 @@ class Newsletter {
|
|
726 |
if ($base == '') $base = get_option('home');
|
727 |
$id_token = '&ni=' . $user->id . '&nt=' . $user->token;
|
728 |
|
729 |
-
$text = $this->replace_url($text, 'SUBSCRIPTION_CONFIRM_URL', $this->add_qs(
|
|
|
|
|
730 |
$text = $this->replace_url($text, 'UNSUBSCRIPTION_URL', $this->add_qs($base, 'na=u' . $id_token));
|
731 |
-
$text = $this->replace_url($text, 'UNSUBSCRIPTION_CONFIRM_URL', $this->add_qs($base, 'na=uc' . $id_token));
|
732 |
$text = $this->replace_url($text, 'PROFILE_URL', $this->add_qs($base, 'na=pe' . $id_token));
|
733 |
$text = $this->replace_url($text, 'UNLOCK_URL', $this->add_qs($this->options_main['url'], 'na=m' . $id_token));
|
734 |
|
3 |
Plugin Name: Newsletter
|
4 |
Plugin URI: http://www.satollo.net/plugins/newsletter
|
5 |
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>
|
6 |
+
Version: 2.5.2.3
|
7 |
Author: Satollo
|
8 |
Author URI: http://www.satollo.net
|
9 |
Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
|
269 |
function log($text='', $level=2) {
|
270 |
if ((int) $this->options_main['logs'] < $level) return;
|
271 |
|
272 |
+
//$db = debug_backtrace(false);
|
273 |
$time = date('d-m-Y H:i:s ');
|
274 |
switch ($level) {
|
275 |
case 1: $time .= '- ERROR';
|
280 |
break;
|
281 |
}
|
282 |
if (is_array($text) || is_object($text)) $text = print_r($text, true);
|
283 |
+
file_put_contents(dirname(__FILE__) . '/log.txt', $time . ' - ' . $text . "\n", FILE_APPEND | FILE_TEXT);
|
284 |
}
|
285 |
|
286 |
function hook_activate() {
|
307 |
$options = get_option('newsletter_profile');
|
308 |
|
309 |
$buffer .= '<div class="newsletter newsletter-profile">';
|
310 |
+
$buffer .= '<form action="' . $this->options_main['url'] . '" method="post"><input type="hidden" name="na" value="ps"/>';
|
311 |
+
$buffer .= '<input type="hidden" name="ni" value="' . $user->id . '"/>';
|
312 |
+
$buffer .= '<input type="hidden" name="nt" value="' . $user->token . '"/>';
|
313 |
$buffer .= '<table>';
|
314 |
$buffer .= '<tr><th align="right">' . $options['email'] . '</th><td><input type="text" size="30" name="ne" value="' . htmlspecialchars($user->email) . '"/></td></tr>';
|
315 |
if ($options['name_status'] >= 1) {
|
342 |
if ($options['profile_' . $i . '_type'] == 'select') {
|
343 |
$buffer .= '<select name="np' . $i . '">';
|
344 |
$opts = explode(',', $options['profile_' . $i . '_options']);
|
345 |
+
for ($j = 0; $j < count($opts); $j++) {
|
346 |
+
$opts[$j] = trim($opts[$j]);
|
347 |
$buffer .= '<option';
|
348 |
+
if ($opts[$j] == $user->$field) $buffer .= ' selected';
|
349 |
+
$buffer .= '>' . $opts[$j] . '</option>';
|
350 |
}
|
351 |
$buffer .= '</select>';
|
352 |
}
|
407 |
if ($options_profile['profile_' . $i . '_type'] == 'select') {
|
408 |
$buffer .= '<tr><th>' . $options_profile['profile_' . $i] . '</th><td><select name="np' . $i . '">';
|
409 |
$opts = explode(',', $options_profile['profile_' . $i . '_options']);
|
410 |
+
for ($j = 0; $j < count($opts); $j++) {
|
411 |
+
$buffer .= '<option>' . trim($opts[$j]) . '</option>';
|
412 |
}
|
413 |
$buffer .= '</select></td></tr>';
|
414 |
}
|
565 |
|
566 |
if ($action == 'c') {
|
567 |
setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
|
|
|
|
|
|
|
|
|
|
|
568 |
|
569 |
if (!empty($options['confirmed_url'])) {
|
570 |
header('Location: ' . $options['confirmed_url']);
|
583 |
// Unsubscription confirm
|
584 |
if ($action == 'uc') {
|
585 |
setcookie("newsletter", "", time() - 3600);
|
|
|
586 |
$this->message = $this->replace($options['unsubscribed_text'], $user);
|
|
|
|
|
587 |
return;
|
588 |
}
|
589 |
|
720 |
if ($base == '') $base = get_option('home');
|
721 |
$id_token = '&ni=' . $user->id . '&nt=' . $user->token;
|
722 |
|
723 |
+
$text = $this->replace_url($text, 'SUBSCRIPTION_CONFIRM_URL', $this->add_qs(plugins_url('do.php', __FILE__), 'a=c' . $id_token));
|
724 |
+
$text = $this->replace_url($text, 'UNSUBSCRIPTION_CONFIRM_URL', $this->add_qs(plugins_url('do.php', __FILE__), 'a=uc' . $id_token));
|
725 |
+
|
726 |
$text = $this->replace_url($text, 'UNSUBSCRIPTION_URL', $this->add_qs($base, 'na=u' . $id_token));
|
|
|
727 |
$text = $this->replace_url($text, 'PROFILE_URL', $this->add_qs($base, 'na=pe' . $id_token));
|
728 |
$text = $this->replace_url($text, 'UNLOCK_URL', $this->add_qs($this->options_main['url'], 'na=m' . $id_token));
|
729 |
|
readme.txt
CHANGED
@@ -69,6 +69,27 @@ No screen shots are available at this time.
|
|
69 |
|
70 |
== Changelog ==
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
= 2.5.1.7 =
|
73 |
|
74 |
* fixed the widget which was no showing the lists and extra fields
|
69 |
|
70 |
== Changelog ==
|
71 |
|
72 |
+
= 2.5.2.3 =
|
73 |
+
|
74 |
+
* Fixed extra field of type "list" not showing up correctly (when more than one)
|
75 |
+
* removed the collapsed sub panel on some configuration panel (people did not realized that a click would open them)
|
76 |
+
* fixed the unconfirmed status display on users panel
|
77 |
+
* fixed the status list on user edit panel
|
78 |
+
|
79 |
+
= 2.5.2.2 =
|
80 |
+
|
81 |
+
* removed the backtrace on log (some PHP installations have problems with it)
|
82 |
+
|
83 |
+
= 2.5.2.1 =
|
84 |
+
|
85 |
+
* fixed an error on subscriber panels claiming an unexisting table
|
86 |
+
|
87 |
+
= 2.5.2 =
|
88 |
+
|
89 |
+
* important change on subscription confirmation and unsubscription confirmation to avoid multiple emails
|
90 |
+
* number of subscriber overview on subscriber panel
|
91 |
+
* fix on profile form showing "no user"
|
92 |
+
|
93 |
= 2.5.1.7 =
|
94 |
|
95 |
* fixed the widget which was no showing the lists and extra fields
|
users-edit.php
CHANGED
@@ -51,7 +51,7 @@ $options_profile = get_option('newsletter_profile');
|
|
51 |
<tr valign="top">
|
52 |
<th>Status</th>
|
53 |
<td>
|
54 |
-
<?php $nc->select('status', array('C'=>'Confirmed', 'S'=>'Not confirmed', '
|
55 |
</td>
|
56 |
</tr>
|
57 |
<tr valign="top">
|
51 |
<tr valign="top">
|
52 |
<th>Status</th>
|
53 |
<td>
|
54 |
+
<?php $nc->select('status', array('C'=>'Confirmed', 'S'=>'Not confirmed', 'U'=>'Unsubscribed')); ?>
|
55 |
</td>
|
56 |
</tr>
|
57 |
<tr valign="top">
|
users.php
CHANGED
@@ -33,12 +33,12 @@ if ($action == 'remove_unconfirmed') {
|
|
33 |
$wpdb->query("delete from " . $wpdb->prefix . "newsletter where status='S'");
|
34 |
}
|
35 |
|
36 |
-
if ($action == '
|
37 |
-
$wpdb->query("delete from " . $wpdb->prefix . "newsletter where status='
|
38 |
}
|
39 |
|
40 |
if ($action == 'confirm_all') {
|
41 |
-
$wpdb->query("update " . $wpdb->prefix . "newsletter set status='C'");
|
42 |
}
|
43 |
|
44 |
if ($action == 'remove_all') {
|
@@ -121,17 +121,57 @@ $nc->messages($messages);
|
|
121 |
|
122 |
<p><a href="admin.php?page=newsletter/users-edit.php&id=0" class="button">Create a new user</a></p>
|
123 |
|
124 |
-
<form method="post" action="">
|
125 |
<?php $nc->init(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
<h3>Massive actions</h3>
|
127 |
<table class="form-table">
|
128 |
<tr>
|
129 |
<th>General actions on subscribers</th>
|
130 |
<td>
|
131 |
-
<?php $nc->button_confirm('remove_unconfirmed', 'Delete all not confirmed', 'Are you sure you want to delete ALL not confirmed subscribers?'); ?>
|
132 |
-
<?php //$nc->button('remove_bounced', 'Remove bounced', 'Are you sure you want to remove bounced subscribers?'); ?>
|
133 |
<?php $nc->button_confirm('remove_all', 'Delete all', 'Are you sure you want to remove ALL subscribers?'); ?>
|
134 |
-
<?php $nc->button_confirm('confirm_all', 'Confirm all', 'Are you sure you want to mark ALL subscribers as confirmed?'); ?>
|
135 |
</td>
|
136 |
</tr>
|
137 |
<tr>
|
@@ -159,14 +199,6 @@ $nc->messages($messages);
|
|
159 |
<?php $nc->init(); ?>
|
160 |
<input type="hidden" name="options[subscriber_id]"/>
|
161 |
<input type="hidden" name="options[subscriber_status]"/>
|
162 |
-
|
163 |
-
<?php
|
164 |
-
$tmp = $wpdb->get_results($wpdb->prepare("select distinct newsletter, url from " . $wpdb->prefix . "newsletter_stats order by newsletter,url"));
|
165 |
-
$links = array(''=>'Unfiltered');
|
166 |
-
foreach ($tmp as $t) {
|
167 |
-
$links[$t->newsletter . '|' . $t->url] = $t->newsletter . ': ' . substr($t->url, 0, min(strlen($t->url), 50)) . '...';
|
168 |
-
}
|
169 |
-
?>
|
170 |
|
171 |
<h3>Search</h3>
|
172 |
<table class="form-table">
|
@@ -185,10 +217,14 @@ $nc->messages($messages);
|
|
185 |
</tr>
|
186 |
</table>
|
187 |
|
|
|
188 |
|
189 |
-
<?php if (
|
|
|
|
|
190 |
|
191 |
-
|
|
|
192 |
|
193 |
<table class="widefat">
|
194 |
<thead>
|
@@ -211,7 +247,16 @@ $nc->messages($messages);
|
|
211 |
<a href="admin.php?page=newsletter/users-edit.php&id=<?php echo $s->id; ?>"><?php echo $s->email; ?><br /><?php echo $s->name; ?> <?php echo $s->surname; ?></a>
|
212 |
</td>
|
213 |
<td><small>
|
214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
</small></td>
|
216 |
|
217 |
<td>
|
33 |
$wpdb->query("delete from " . $wpdb->prefix . "newsletter where status='S'");
|
34 |
}
|
35 |
|
36 |
+
if ($action == 'remove_unsubscribed') {
|
37 |
+
$wpdb->query("delete from " . $wpdb->prefix . "newsletter where status='U'");
|
38 |
}
|
39 |
|
40 |
if ($action == 'confirm_all') {
|
41 |
+
$wpdb->query("update " . $wpdb->prefix . "newsletter set status='C' where status='S'");
|
42 |
}
|
43 |
|
44 |
if ($action == 'remove_all') {
|
121 |
|
122 |
<p><a href="admin.php?page=newsletter/users-edit.php&id=0" class="button">Create a new user</a></p>
|
123 |
|
124 |
+
<form method="post" action="">
|
125 |
<?php $nc->init(); ?>
|
126 |
+
|
127 |
+
<table class="widefat" style="width: 300px;">
|
128 |
+
<thead><tr><th>Status</th><th>Total</th><th>Actions</th></thead>
|
129 |
+
<tr>
|
130 |
+
<td>Confirmed</td>
|
131 |
+
<td>
|
132 |
+
<?php echo $wpdb->get_var("select count(*) from " . $wpdb->prefix . "newsletter where status='C'"); ?>
|
133 |
+
</td>
|
134 |
+
<td nowrap>
|
135 |
+
</td>
|
136 |
+
</tr>
|
137 |
+
<tr>
|
138 |
+
<td>Not confirmed</td>
|
139 |
+
<td>
|
140 |
+
<?php echo $wpdb->get_var("select count(*) from " . $wpdb->prefix . "newsletter where status='S'"); ?>
|
141 |
+
</td>
|
142 |
+
<td nowrap>
|
143 |
+
<?php $nc->button_confirm('remove_unconfirmed', 'Delete all not confirmed', 'Are you sure you want to delete ALL not confirmed subscribers?'); ?>
|
144 |
+
<?php $nc->button_confirm('confirm_all', 'Confirm all', 'Are you sure you want to mark ALL subscribers as confirmed?'); ?>
|
145 |
+
</td>
|
146 |
+
</tr>
|
147 |
+
<tr>
|
148 |
+
<td>Subscribed to feed by mail</td>
|
149 |
+
<td nowrap>
|
150 |
+
<?php echo $wpdb->get_var("select count(*) from " . $wpdb->prefix . "newsletter where status='C' and feed=1"); ?>
|
151 |
+
(only for <a href="http://www.satollo.net/plugins/newsletter" target="_blank">Newsletter Pro</a>)
|
152 |
+
</td>
|
153 |
+
<td nowrap>
|
154 |
+
</td>
|
155 |
+
</tr>
|
156 |
+
<tr>
|
157 |
+
<td>Unsubscribed</td>
|
158 |
+
<td>
|
159 |
+
<?php echo $wpdb->get_var("select count(*) from " . $wpdb->prefix . "newsletter where status='U'"); ?>
|
160 |
+
</td>
|
161 |
+
<td>
|
162 |
+
<?php $nc->button_confirm('remove_unsubscribed', 'Delete all unsubscribed', 'Are you sure you want to delete ALL unsubscribed?'); ?>
|
163 |
+
</td>
|
164 |
+
</tr>
|
165 |
+
</table>
|
166 |
+
|
167 |
+
|
168 |
+
|
169 |
<h3>Massive actions</h3>
|
170 |
<table class="form-table">
|
171 |
<tr>
|
172 |
<th>General actions on subscribers</th>
|
173 |
<td>
|
|
|
|
|
174 |
<?php $nc->button_confirm('remove_all', 'Delete all', 'Are you sure you want to remove ALL subscribers?'); ?>
|
|
|
175 |
</td>
|
176 |
</tr>
|
177 |
<tr>
|
199 |
<?php $nc->init(); ?>
|
200 |
<input type="hidden" name="options[subscriber_id]"/>
|
201 |
<input type="hidden" name="options[subscriber_status]"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
|
203 |
<h3>Search</h3>
|
204 |
<table class="form-table">
|
217 |
</tr>
|
218 |
</table>
|
219 |
|
220 |
+
<h3>Search results</h3>
|
221 |
|
222 |
+
<?php if (empty($list)) { ?>
|
223 |
+
<p>No search results (or you did not search at all)</p>
|
224 |
+
<?php } ?>
|
225 |
|
226 |
+
|
227 |
+
<?php if (!empty($list)) { ?>
|
228 |
|
229 |
<table class="widefat">
|
230 |
<thead>
|
247 |
<a href="admin.php?page=newsletter/users-edit.php&id=<?php echo $s->id; ?>"><?php echo $s->email; ?><br /><?php echo $s->name; ?> <?php echo $s->surname; ?></a>
|
248 |
</td>
|
249 |
<td><small>
|
250 |
+
<?php
|
251 |
+
switch ($s->status) {
|
252 |
+
case 'S': echo 'NOT CONFIRMED'; break;
|
253 |
+
case 'C': echo 'CONFIRMED'; break;
|
254 |
+
case 'U': echo 'UNSUBSCRIBED'; break;
|
255 |
+
}
|
256 |
+
?>
|
257 |
+
<br />
|
258 |
+
Feed: only Pro version<br />
|
259 |
+
Follow Up: only Pro version
|
260 |
</small></td>
|
261 |
|
262 |
<td>
|
widget.php
CHANGED
@@ -49,8 +49,8 @@ class NewsletterWidget extends WP_Widget {
|
|
49 |
if ($options_profile['profile_' . $i . '_type'] == 'select') {
|
50 |
$form .= '<p>' . $options_profile['profile_' . $i] . '<br /><select class="newsletter-profile newsletter-profile-' . $i . '" name="np' . $i . '">';
|
51 |
$opts = explode(',', $options_profile['profile_' . $i . '_options']);
|
52 |
-
for ($
|
53 |
-
$form .= '<option>' . trim($opts[$
|
54 |
}
|
55 |
$form .= '</select></p>';
|
56 |
}
|
49 |
if ($options_profile['profile_' . $i . '_type'] == 'select') {
|
50 |
$form .= '<p>' . $options_profile['profile_' . $i] . '<br /><select class="newsletter-profile newsletter-profile-' . $i . '" name="np' . $i . '">';
|
51 |
$opts = explode(',', $options_profile['profile_' . $i . '_options']);
|
52 |
+
for ($j = 0; $j < count($opts); $j++) {
|
53 |
+
$form .= '<option>' . trim($opts[$j]) . '</option>';
|
54 |
}
|
55 |
$form .= '</select></p>';
|
56 |
}
|