Version Description
- Fixed the forced preferences on subscription panel
Download this release
Release Info
Developer | satollo |
Plugin | Newsletter |
Version | 3.2.6 |
Comparing to | |
See all releases |
Code changes from version 3.2.5 to 3.2.6
- includes/controls.php +39 -32
- plugin.php +2 -2
- readme.txt +5 -1
- subscription/subscription.php +6 -7
includes/controls.php
CHANGED
@@ -108,18 +108,6 @@ class NewsletterControls {
|
|
108 |
echo '</select>';
|
109 |
}
|
110 |
|
111 |
-
/**
|
112 |
-
* Creates a checkbox named $name and checked if the internal data contains under
|
113 |
-
* the key $name an array containig the passed value.
|
114 |
-
*/
|
115 |
-
function checkbox_group($name, $value, $label = '') {
|
116 |
-
echo '<input type="checkbox" id="' . $name . '" name="options[' . $name . '][]" value="' . $value . '"';
|
117 |
-
if (is_array($this->data[$name]) && array_search($value, $this->data[$name]) !== false)
|
118 |
-
echo ' checked="checked"';
|
119 |
-
echo '/>';
|
120 |
-
if ($label != '') echo ' <label for="' . $name . '">' . $label . '</label>';
|
121 |
-
}
|
122 |
-
|
123 |
/**
|
124 |
* Creates a set of checkbox all named as $name with values and labels extracted from
|
125 |
* $values_labels. A checkbox will be checked if internal data under key $name is an array
|
@@ -325,28 +313,21 @@ class NewsletterControls {
|
|
325 |
echo '/>';
|
326 |
if ($label != '') echo ' ' . $label . '</label>';
|
327 |
}
|
328 |
-
|
329 |
-
function color($name) {
|
330 |
-
echo $this->text($name, 10);
|
331 |
-
}
|
332 |
-
|
333 |
/**
|
334 |
-
* Creates a
|
335 |
-
*
|
336 |
*/
|
337 |
-
function
|
338 |
-
$
|
|
|
|
|
|
|
|
|
|
|
339 |
|
340 |
-
|
341 |
-
|
342 |
-
if (empty($options_profile['list_' . $i])) continue;
|
343 |
-
echo '<div class="newsletter-preferences-item">';
|
344 |
-
$this->checkbox_group($name, $i, '(' . $i . ') ' . htmlspecialchars($options_profile['list_' . $i]));
|
345 |
-
echo '</div>';
|
346 |
-
}
|
347 |
-
echo '<div style="clear: both"></div>';
|
348 |
-
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.';
|
349 |
-
echo '</div>';
|
350 |
}
|
351 |
|
352 |
/** Creates a set of checkbox named $name_[category id] (so they are posted with distinct names).
|
@@ -401,7 +382,12 @@ class NewsletterControls {
|
|
401 |
echo '</div>';
|
402 |
}
|
403 |
|
404 |
-
|
|
|
|
|
|
|
|
|
|
|
405 |
$options_profile = get_option('newsletter_profile');
|
406 |
echo '<div class="newsletter-preferences-group">';
|
407 |
|
@@ -416,6 +402,27 @@ class NewsletterControls {
|
|
416 |
echo '</div>';
|
417 |
|
418 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
419 |
|
420 |
function date($name) {
|
421 |
$this->hidden($name);
|
108 |
echo '</select>';
|
109 |
}
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
/**
|
112 |
* Creates a set of checkbox all named as $name with values and labels extracted from
|
113 |
* $values_labels. A checkbox will be checked if internal data under key $name is an array
|
313 |
echo '/>';
|
314 |
if ($label != '') echo ' ' . $label . '</label>';
|
315 |
}
|
316 |
+
|
|
|
|
|
|
|
|
|
317 |
/**
|
318 |
+
* Creates a checkbox named $name and checked if the internal data contains under
|
319 |
+
* the key $name an array containig the passed value.
|
320 |
*/
|
321 |
+
function checkbox_group($name, $value, $label = '') {
|
322 |
+
echo '<input type="checkbox" id="' . $name . '" name="options[' . $name . '][]" value="' . $value . '"';
|
323 |
+
if (is_array($this->data[$name]) && array_search($value, $this->data[$name]) !== false)
|
324 |
+
echo ' checked="checked"';
|
325 |
+
echo '/>';
|
326 |
+
if ($label != '') echo ' <label for="' . $name . '">' . $label . '</label>';
|
327 |
+
}
|
328 |
|
329 |
+
function color($name) {
|
330 |
+
echo $this->text($name, 10);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
}
|
332 |
|
333 |
/** Creates a set of checkbox named $name_[category id] (so they are posted with distinct names).
|
382 |
echo '</div>';
|
383 |
}
|
384 |
|
385 |
+
/**
|
386 |
+
* Creates a set of checkboxes named $name_[preference number] (so they are
|
387 |
+
* distinct fields).
|
388 |
+
* Empty preferences are skipped.
|
389 |
+
*/
|
390 |
+
function preferences($name = 'preferences') {
|
391 |
$options_profile = get_option('newsletter_profile');
|
392 |
echo '<div class="newsletter-preferences-group">';
|
393 |
|
402 |
echo '</div>';
|
403 |
|
404 |
}
|
405 |
+
|
406 |
+
/**
|
407 |
+
* Creates a set of checkboxes to activate the profile preferences. Every checkbox has the
|
408 |
+
* same $name and the preference number as value so the selected checkboxes
|
409 |
+
* are retrieved as an array of values.
|
410 |
+
*/
|
411 |
+
function preferences_group($name = 'preferences') {
|
412 |
+
$options_profile = get_option('newsletter_profile');
|
413 |
+
|
414 |
+
echo '<div class="newsletter-preferences-group">';
|
415 |
+
for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
|
416 |
+
if (empty($options_profile['list_' . $i])) continue;
|
417 |
+
echo '<div class="newsletter-preferences-item">';
|
418 |
+
$this->checkbox_group($name, $i, '(' . $i . ') ' . htmlspecialchars($options_profile['list_' . $i]));
|
419 |
+
echo '</div>';
|
420 |
+
}
|
421 |
+
echo '<div style="clear: both"></div>';
|
422 |
+
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.';
|
423 |
+
echo '</div>';
|
424 |
+
}
|
425 |
+
|
426 |
|
427 |
function date($name) {
|
428 |
$this->hidden($name);
|
plugin.php
CHANGED
@@ -4,7 +4,7 @@
|
|
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.2.
|
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.
|
@@ -13,7 +13,7 @@
|
|
13 |
*/
|
14 |
|
15 |
// Useed as dummy parameter on css and js links
|
16 |
-
define('NEWSLETTER_VERSION', '3.2.
|
17 |
|
18 |
global $wpdb, $newsletter;
|
19 |
|
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.2.6
|
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.
|
13 |
*/
|
14 |
|
15 |
// Useed as dummy parameter on css and js links
|
16 |
+
define('NEWSLETTER_VERSION', '3.2.6');
|
17 |
|
18 |
global $wpdb, $newsletter;
|
19 |
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
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.5.1
|
5 |
-
Stable tag: 3.2.
|
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.
|
@@ -55,6 +55,10 @@ No screen shots are available at this time.
|
|
55 |
|
56 |
== Changelog ==
|
57 |
|
|
|
|
|
|
|
|
|
58 |
= 3.2.5 =
|
59 |
|
60 |
* Fixed the home_url and blog_url replacements
|
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.5.1
|
5 |
+
Stable tag: 3.2.6
|
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.
|
55 |
|
56 |
== Changelog ==
|
57 |
|
58 |
+
= 3.2.6 =
|
59 |
+
|
60 |
+
* Fixed the forced preferences on subscription panel
|
61 |
+
|
62 |
= 3.2.5 =
|
63 |
|
64 |
* Fixed the home_url and blog_url replacements
|
subscription/subscription.php
CHANGED
@@ -225,7 +225,7 @@ class NewsletterSubscription extends NewsletterModule {
|
|
225 |
|
226 |
// New profiles
|
227 |
for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
|
228 |
-
// If the profile cannot be set by subscriber,
|
229 |
if ($options_profile['profile_' . $i . '_status'] == 0)
|
230 |
continue;
|
231 |
|
@@ -242,13 +242,12 @@ class NewsletterSubscription extends NewsletterModule {
|
|
242 |
$user['list_' . $i] = 1;
|
243 |
}
|
244 |
}
|
245 |
-
|
246 |
// Forced preferences as set on subscription configuration
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
}
|
252 |
|
253 |
$user['token'] = $newsletter->get_token();
|
254 |
$user['ip'] = $_SERVER['REMOTE_ADDR'];
|
225 |
|
226 |
// New profiles
|
227 |
for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
|
228 |
+
// If the profile cannot be set by subscriber, skip it.
|
229 |
if ($options_profile['profile_' . $i . '_status'] == 0)
|
230 |
continue;
|
231 |
|
242 |
$user['list_' . $i] = 1;
|
243 |
}
|
244 |
}
|
245 |
+
|
246 |
// Forced preferences as set on subscription configuration
|
247 |
+
for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
|
248 |
+
if (empty($options['preferences_' . $i])) continue;
|
249 |
+
$user['list_' . $i] = 1;
|
250 |
+
}
|
|
|
251 |
|
252 |
$user['token'] = $newsletter->get_token();
|
253 |
$user['ip'] = $_SERVER['REMOTE_ADDR'];
|