Version Description
Be sure to deactivate Dynamic Widgets Plugin before installing the new version following steps 1 and 2 in the installation procedure. After the install you can re-activate the plugin.
Download this release
Release Info
Developer | qurl |
Plugin | Dynamic Widgets |
Version | 1.2.3 |
Comparing to | |
See all releases |
Code changes from version 1.2 to 1.2.3
- dynamic-widgets.php +4 -3
- dynwid_admin_edit.php +54 -11
- dynwid_admin_save.php +7 -2
- dynwid_class.php +15 -2
- dynwid_class_php4.php +15 -2
- dynwid_worker.php +13 -3
- readme.txt +14 -9
dynamic-widgets.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: http://www.qurl.nl/dynamic-widgets/
|
5 |
* Description: Dynamic Widgets gives you more control over your widgets. It lets you dynamicly place widgets on pages by excluding or including rules by roles, for the homepage, single posts, pages, authors, categories, archives and the error page.
|
6 |
* Author: Jacco
|
7 |
-
* Version: 1.2
|
8 |
* Author URI: http://www.qurl.nl/
|
9 |
* Tags: widget, widgets, dynamic, sidebar, custom, rules, admin, conditional tags
|
10 |
*
|
@@ -15,7 +15,7 @@
|
|
15 |
*
|
16 |
* Released under the GPL v.2, http://www.gnu.org/copyleft/gpl.html
|
17 |
*
|
18 |
-
* @version $Id: dynamic-widgets.php
|
19 |
*/
|
20 |
|
21 |
// Constants
|
@@ -23,7 +23,7 @@
|
|
23 |
define('DW_DB_TABLE', 'dynamic_widgets');
|
24 |
define('DW_LIST_LIMIT', 20);
|
25 |
define('DW_LIST_STYLE', 'style="overflow:auto;height:240px;"');
|
26 |
-
define('DW_VERSION', '1.2');
|
27 |
|
28 |
// Class version to use
|
29 |
if ( version_compare(PHP_VERSION, '5.0.0', '<') ) {
|
@@ -355,6 +355,7 @@
|
|
355 |
'category' => 'Category Pages',
|
356 |
'archive' => 'Archive Pages',
|
357 |
'e404' => 'Error Page',
|
|
|
358 |
);
|
359 |
$opt = $DW->getOptions($widget_id, NULL);
|
360 |
foreach ( $opt as $widget ) {
|
4 |
* Plugin URI: http://www.qurl.nl/dynamic-widgets/
|
5 |
* Description: Dynamic Widgets gives you more control over your widgets. It lets you dynamicly place widgets on pages by excluding or including rules by roles, for the homepage, single posts, pages, authors, categories, archives and the error page.
|
6 |
* Author: Jacco
|
7 |
+
* Version: 1.2.3
|
8 |
* Author URI: http://www.qurl.nl/
|
9 |
* Tags: widget, widgets, dynamic, sidebar, custom, rules, admin, conditional tags
|
10 |
*
|
15 |
*
|
16 |
* Released under the GPL v.2, http://www.gnu.org/copyleft/gpl.html
|
17 |
*
|
18 |
+
* @version $Id: dynamic-widgets.php 223034 2010-03-29 17:11:10Z qurl $
|
19 |
*/
|
20 |
|
21 |
// Constants
|
23 |
define('DW_DB_TABLE', 'dynamic_widgets');
|
24 |
define('DW_LIST_LIMIT', 20);
|
25 |
define('DW_LIST_STYLE', 'style="overflow:auto;height:240px;"');
|
26 |
+
define('DW_VERSION', '1.2.3');
|
27 |
|
28 |
// Class version to use
|
29 |
if ( version_compare(PHP_VERSION, '5.0.0', '<') ) {
|
355 |
'category' => 'Category Pages',
|
356 |
'archive' => 'Archive Pages',
|
357 |
'e404' => 'Error Page',
|
358 |
+
'search' => 'Search page'
|
359 |
);
|
360 |
$opt = $DW->getOptions($widget_id, NULL);
|
361 |
foreach ( $opt as $widget ) {
|
dynwid_admin_edit.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* dynwid_admin_edit.php - Options settings
|
4 |
*
|
5 |
-
* @version $Id: dynwid_admin_edit.php
|
6 |
*/
|
7 |
|
8 |
// Roles
|
@@ -36,13 +36,18 @@
|
|
36 |
}
|
37 |
|
38 |
// Front Page
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
}
|
48 |
|
@@ -142,6 +147,19 @@
|
|
142 |
$page_condition_select_style = DW_LIST_STYLE;
|
143 |
}
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
// Author
|
146 |
$author_yes_selected = 'checked="checked"';
|
147 |
$opt_author = $DW->getOptions($_GET['id'], 'author');
|
@@ -211,6 +229,17 @@
|
|
211 |
unset($e404_yes_selected);
|
212 |
}
|
213 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
?>
|
215 |
|
216 |
<style type="text/css">
|
@@ -277,9 +306,15 @@ Show widget to everybody?
|
|
277 |
|
278 |
<br /><br />
|
279 |
|
280 |
-
<b>Front Page</b
|
281 |
Show widget on the front page?<br />
|
282 |
<?php $DW->dumpOpt($opt_frontpage); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
<input type="radio" name="front-page" value="yes" id="front-page-yes" <?php echo $frontpage_yes_selected; ?> /> <label for="front-page-yes">Yes</label>
|
284 |
<input type="radio" name="front-page" value="no" id="front-page-no" <?php echo $frontpage_no_selected; ?> /> <label for="front-page-no">No</label>
|
285 |
|
@@ -341,14 +376,14 @@ Show widget default on single posts?<br />
|
|
341 |
<br /><br />
|
342 |
|
343 |
<b>Pages</b><br />
|
344 |
-
Show widget default on pages?<br />
|
345 |
<?php $DW->dumpOpt($opt_page); ?>
|
346 |
<input type="radio" name="page" value="yes" id="page-yes" <?php echo $page_yes_selected; ?> /> <label for="page-yes">Yes</label>
|
347 |
<input type="radio" name="page" value="no" id="page-no" <?php echo $page_no_selected; ?> /> <label for="page-no">No</label><br />
|
348 |
Except the page(s):<br />
|
349 |
<div id="page-select" class="condition-select" <?php echo $page_condition_select_style; ?>>
|
350 |
<?php foreach ( $pages as $page ) { ?>
|
351 |
-
<input type="checkbox" id="page_act_<?php echo $page->ID; ?>" name="page_act[]" value="<?php echo $page->ID; ?>" <?php echo ( count($page_act) > 0 && in_array($page->ID,$page_act) ) ? 'checked="checked"' : ''; ?> /> <label for="page_act_<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></label><br />
|
352 |
<?php } ?>
|
353 |
</div>
|
354 |
|
@@ -402,6 +437,14 @@ Show widget on the error page?<br />
|
|
402 |
|
403 |
<br /><br />
|
404 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
<input class="button-primary" type="submit" value="Save" />
|
406 |
</form>
|
407 |
|
2 |
/**
|
3 |
* dynwid_admin_edit.php - Options settings
|
4 |
*
|
5 |
+
* @version $Id: dynwid_admin_edit.php 223034 2010-03-29 17:11:10Z qurl $
|
6 |
*/
|
7 |
|
8 |
// Roles
|
36 |
}
|
37 |
|
38 |
// Front Page
|
39 |
+
if ( get_option('show_on_front') == 'page' ) {
|
40 |
+
$frontpage_yes_selected = 'disabled="true"';
|
41 |
+
$frontpage_no_selected = $frontpage_yes_selected;
|
42 |
+
} else {
|
43 |
+
$frontpage_yes_selected = 'checked="checked"';
|
44 |
+
$opt_frontpage = $DW->getOptions($_GET['id'], 'front-page');
|
45 |
+
if ( count($opt_frontpage) > 0 ) {
|
46 |
+
$frontpage_condition = $opt_frontpage[0]['value'];
|
47 |
+
if ( $frontpage_condition == '0' ) {
|
48 |
+
$frontpage_no_selected = $frontpage_yes_selected;
|
49 |
+
unset($frontpage_yes_selected);
|
50 |
+
}
|
51 |
}
|
52 |
}
|
53 |
|
147 |
$page_condition_select_style = DW_LIST_STYLE;
|
148 |
}
|
149 |
|
150 |
+
$static_page = array();
|
151 |
+
if ( get_option('show_on_front') == 'page' ) {
|
152 |
+
if ( get_option('page_on_front') == get_option('page_for_posts') ) {
|
153 |
+
$id = get_option('page_on_front');
|
154 |
+
$static_page[$id] = 'Front page, Posts page';
|
155 |
+
} else {
|
156 |
+
$id = get_option('page_on_front');
|
157 |
+
$static_page[$id] = 'Front page';
|
158 |
+
$id = get_option('page_for_posts');
|
159 |
+
$static_page[$id] = 'Posts page';
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
// Author
|
164 |
$author_yes_selected = 'checked="checked"';
|
165 |
$opt_author = $DW->getOptions($_GET['id'], 'author');
|
229 |
unset($e404_yes_selected);
|
230 |
}
|
231 |
}
|
232 |
+
|
233 |
+
// Search
|
234 |
+
$search_yes_selected = 'checked="checked"';
|
235 |
+
$opt_search = $DW->getOptions($_GET['id'], 'search');
|
236 |
+
if ( count($opt_search) > 0 ) {
|
237 |
+
$search_condition = $opt_search[0]['value'];
|
238 |
+
if ( $search_condition == '0' ) {
|
239 |
+
$search_no_selected = $search_yes_selected;
|
240 |
+
unset($search_yes_selected);
|
241 |
+
}
|
242 |
+
}
|
243 |
?>
|
244 |
|
245 |
<style type="text/css">
|
306 |
|
307 |
<br /><br />
|
308 |
|
309 |
+
<b>Front Page</b> <img src="<?php echo $DW->plugin_url; ?>img/info.gif" alt="info" onclick="divToggle('frontpage');" /><br />
|
310 |
Show widget on the front page?<br />
|
311 |
<?php $DW->dumpOpt($opt_frontpage); ?>
|
312 |
+
<div>
|
313 |
+
<div id="frontpage" class="infotext">
|
314 |
+
This option only applies when your front page is set to display your latest posts (See Settings > Reading).<br />
|
315 |
+
When a static page is set, you can use the options for the static pages below.
|
316 |
+
</div>
|
317 |
+
</div>
|
318 |
<input type="radio" name="front-page" value="yes" id="front-page-yes" <?php echo $frontpage_yes_selected; ?> /> <label for="front-page-yes">Yes</label>
|
319 |
<input type="radio" name="front-page" value="no" id="front-page-no" <?php echo $frontpage_no_selected; ?> /> <label for="front-page-no">No</label>
|
320 |
|
376 |
<br /><br />
|
377 |
|
378 |
<b>Pages</b><br />
|
379 |
+
Show widget default on static pages?<br />
|
380 |
<?php $DW->dumpOpt($opt_page); ?>
|
381 |
<input type="radio" name="page" value="yes" id="page-yes" <?php echo $page_yes_selected; ?> /> <label for="page-yes">Yes</label>
|
382 |
<input type="radio" name="page" value="no" id="page-no" <?php echo $page_no_selected; ?> /> <label for="page-no">No</label><br />
|
383 |
Except the page(s):<br />
|
384 |
<div id="page-select" class="condition-select" <?php echo $page_condition_select_style; ?>>
|
385 |
<?php foreach ( $pages as $page ) { ?>
|
386 |
+
<input type="checkbox" id="page_act_<?php echo $page->ID; ?>" name="page_act[]" value="<?php echo $page->ID; ?>" <?php echo ( count($page_act) > 0 && in_array($page->ID,$page_act) ) ? 'checked="checked"' : ''; ?> /> <label for="page_act_<?php echo $page->ID; ?>"><?php echo $page->post_title; ?> <?php echo ( get_option('show_on_front') == 'page' && isset($static_page[$page->ID]) ? '(' . $static_page[$page->ID] . ')' : '' ) ?></label><br />
|
387 |
<?php } ?>
|
388 |
</div>
|
389 |
|
437 |
|
438 |
<br /><br />
|
439 |
|
440 |
+
<b>Search Page</b><br />
|
441 |
+
Show widget on the search page?<br />
|
442 |
+
<?php $DW->dumpOpt($opt_search); ?>
|
443 |
+
<input type="radio" name="search" value="yes" id="search-yes" <?php echo $search_yes_selected; ?> /> <label for="search-yes">Yes</label>
|
444 |
+
<input type="radio" name="search" value="no" id="search-no" <?php echo $search_no_selected; ?> /> <label for="search-no">No</label>
|
445 |
+
|
446 |
+
<br /><br />
|
447 |
+
|
448 |
<input class="button-primary" type="submit" value="Save" />
|
449 |
</form>
|
450 |
|
dynwid_admin_save.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* dynwid_admin_save.php - Saving options to the database
|
4 |
*
|
5 |
-
* @version $Id: dynwid_admin_save.php
|
6 |
*/
|
7 |
|
8 |
// Security - nonce
|
@@ -14,7 +14,7 @@
|
|
14 |
die();
|
15 |
}
|
16 |
|
17 |
-
$fields = array('front-page', 'single', 'page', 'author', 'category', 'archive', 'e404');
|
18 |
$work = FALSE;
|
19 |
foreach ( $fields as $field ) {
|
20 |
if ( $_POST[$field] == 'yes' ) {
|
@@ -124,6 +124,11 @@
|
|
124 |
$DW->addSingleOption($_POST['widget_id'], 'e404');
|
125 |
}
|
126 |
|
|
|
|
|
|
|
|
|
|
|
127 |
// Redirect to ReturnURL
|
128 |
if (! empty($_POST['returnurl']) ) {
|
129 |
$q = array();
|
2 |
/**
|
3 |
* dynwid_admin_save.php - Saving options to the database
|
4 |
*
|
5 |
+
* @version $Id: dynwid_admin_save.php 223034 2010-03-29 17:11:10Z qurl $
|
6 |
*/
|
7 |
|
8 |
// Security - nonce
|
14 |
die();
|
15 |
}
|
16 |
|
17 |
+
$fields = array('front-page', 'single', 'page', 'author', 'category', 'archive', 'e404', 'search');
|
18 |
$work = FALSE;
|
19 |
foreach ( $fields as $field ) {
|
20 |
if ( $_POST[$field] == 'yes' ) {
|
124 |
$DW->addSingleOption($_POST['widget_id'], 'e404');
|
125 |
}
|
126 |
|
127 |
+
// Search
|
128 |
+
if ( $_POST['search'] == 'no' ) {
|
129 |
+
$DW->addSingleOption($_POST['widget_id'], 'search');
|
130 |
+
}
|
131 |
+
|
132 |
// Redirect to ReturnURL
|
133 |
if (! empty($_POST['returnurl']) ) {
|
134 |
$q = array();
|
dynwid_class.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* dynwid_class.php - Dynamic Widgets Class (PHP5)
|
4 |
*
|
5 |
-
* @version $Id: dynwid_class.php
|
6 |
*/
|
7 |
|
8 |
class dynWid {
|
@@ -91,8 +91,10 @@
|
|
91 |
}
|
92 |
|
93 |
public function detectPage() {
|
94 |
-
if ( is_front_page() ) {
|
95 |
return 'front-page';
|
|
|
|
|
96 |
} else if ( is_single() ) {
|
97 |
return 'single';
|
98 |
} else if ( is_page() ) {
|
@@ -105,6 +107,8 @@
|
|
105 |
return 'archive';
|
106 |
} else if ( is_404() ) {
|
107 |
return 'e404';
|
|
|
|
|
108 |
} else {
|
109 |
return 'undef';
|
110 |
}
|
@@ -114,6 +118,12 @@
|
|
114 |
echo "wp version: " . $GLOBALS['wp_version'] . "\n";
|
115 |
echo "dw version: " . DW_VERSION . "\n";
|
116 |
echo "php version: " . PHP_VERSION . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
echo "\n";
|
119 |
echo "list: \n";
|
@@ -177,6 +187,9 @@
|
|
177 |
ORDER BY maintype, name";
|
178 |
|
179 |
} else {
|
|
|
|
|
|
|
180 |
$query = "SELECT widget_id, maintype, name, value FROM " . $this->dbtable . "
|
181 |
WHERE widget_id LIKE '" . $widget_id . "'
|
182 |
AND (maintype LIKE '" . $maintype . "%' OR maintype = 'role')
|
2 |
/**
|
3 |
* dynwid_class.php - Dynamic Widgets Class (PHP5)
|
4 |
*
|
5 |
+
* @version $Id: dynwid_class.php 223034 2010-03-29 17:11:10Z qurl $
|
6 |
*/
|
7 |
|
8 |
class dynWid {
|
91 |
}
|
92 |
|
93 |
public function detectPage() {
|
94 |
+
if ( is_front_page() && get_option('show_on_front') == 'posts' ) {
|
95 |
return 'front-page';
|
96 |
+
} else if ( is_home() && get_option('show_on_front') == 'page' ) {
|
97 |
+
return 'home';
|
98 |
} else if ( is_single() ) {
|
99 |
return 'single';
|
100 |
} else if ( is_page() ) {
|
107 |
return 'archive';
|
108 |
} else if ( is_404() ) {
|
109 |
return 'e404';
|
110 |
+
} else if ( is_search() ) {
|
111 |
+
return 'search';
|
112 |
} else {
|
113 |
return 'undef';
|
114 |
}
|
118 |
echo "wp version: " . $GLOBALS['wp_version'] . "\n";
|
119 |
echo "dw version: " . DW_VERSION . "\n";
|
120 |
echo "php version: " . PHP_VERSION . "\n";
|
121 |
+
echo "\n";
|
122 |
+
echo "front: " . get_option('show_on_front') . "\n";
|
123 |
+
if ( get_option('show_on_front') == 'page' ) {
|
124 |
+
echo "front page: " . get_option('page_on_front') . "\n";
|
125 |
+
echo "posts page: " . get_option('page_for_posts') . "\n";
|
126 |
+
}
|
127 |
|
128 |
echo "\n";
|
129 |
echo "list: \n";
|
187 |
ORDER BY maintype, name";
|
188 |
|
189 |
} else {
|
190 |
+
if ( $maintype == 'home' ) {
|
191 |
+
$maintype = 'page';
|
192 |
+
}
|
193 |
$query = "SELECT widget_id, maintype, name, value FROM " . $this->dbtable . "
|
194 |
WHERE widget_id LIKE '" . $widget_id . "'
|
195 |
AND (maintype LIKE '" . $maintype . "%' OR maintype = 'role')
|
dynwid_class_php4.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* dynwid_class_php4.php - Dynamic Widgets Class for PHP4
|
4 |
* Needs at least PHP 4.1.0
|
5 |
*
|
6 |
-
* @version $Id: dynwid_class_php4.php
|
7 |
*/
|
8 |
|
9 |
class dynWid {
|
@@ -98,8 +98,10 @@
|
|
98 |
}
|
99 |
|
100 |
function detectPage() {
|
101 |
-
if ( is_front_page() ) {
|
102 |
return 'front-page';
|
|
|
|
|
103 |
} else if ( is_single() ) {
|
104 |
return 'single';
|
105 |
} else if ( is_page() ) {
|
@@ -112,6 +114,8 @@
|
|
112 |
return 'archive';
|
113 |
} else if ( is_404() ) {
|
114 |
return 'e404';
|
|
|
|
|
115 |
} else {
|
116 |
return 'undef';
|
117 |
}
|
@@ -121,6 +125,12 @@
|
|
121 |
echo "wp version: " . $GLOBALS['wp_version'] . "\n";
|
122 |
echo "dw version: " . DW_VERSION . "\n";
|
123 |
echo "php version: " . PHP_VERSION . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
echo "\n";
|
126 |
echo "list: \n";
|
@@ -184,6 +194,9 @@
|
|
184 |
ORDER BY maintype, name";
|
185 |
|
186 |
} else {
|
|
|
|
|
|
|
187 |
$query = "SELECT widget_id, maintype, name, value FROM " . $this->dbtable . "
|
188 |
WHERE widget_id LIKE '" . $widget_id . "'
|
189 |
AND (maintype LIKE '" . $maintype . "%' OR maintype = 'role')
|
3 |
* dynwid_class_php4.php - Dynamic Widgets Class for PHP4
|
4 |
* Needs at least PHP 4.1.0
|
5 |
*
|
6 |
+
* @version $Id: dynwid_class_php4.php 223034 2010-03-29 17:11:10Z qurl $
|
7 |
*/
|
8 |
|
9 |
class dynWid {
|
98 |
}
|
99 |
|
100 |
function detectPage() {
|
101 |
+
if ( is_front_page() && get_option('show_on_front') == 'posts' ) {
|
102 |
return 'front-page';
|
103 |
+
} else if ( is_home() && get_option('show_on_front') == 'page' ) {
|
104 |
+
return 'home';
|
105 |
} else if ( is_single() ) {
|
106 |
return 'single';
|
107 |
} else if ( is_page() ) {
|
114 |
return 'archive';
|
115 |
} else if ( is_404() ) {
|
116 |
return 'e404';
|
117 |
+
} else if ( is_search() ) {
|
118 |
+
return 'search';
|
119 |
} else {
|
120 |
return 'undef';
|
121 |
}
|
125 |
echo "wp version: " . $GLOBALS['wp_version'] . "\n";
|
126 |
echo "dw version: " . DW_VERSION . "\n";
|
127 |
echo "php version: " . PHP_VERSION . "\n";
|
128 |
+
echo "\n";
|
129 |
+
echo "front: " . get_option('show_on_front') . "\n";
|
130 |
+
if ( get_option('show_on_front') == 'page' ) {
|
131 |
+
echo "front page: " . get_option('page_on_front') . "\n";
|
132 |
+
echo "posts page: " . get_option('page_for_posts') . "\n";
|
133 |
+
}
|
134 |
|
135 |
echo "\n";
|
136 |
echo "list: \n";
|
194 |
ORDER BY maintype, name";
|
195 |
|
196 |
} else {
|
197 |
+
if ( $maintype == 'home' ) {
|
198 |
+
$maintype = 'page';
|
199 |
+
}
|
200 |
$query = "SELECT widget_id, maintype, name, value FROM " . $this->dbtable . "
|
201 |
WHERE widget_id LIKE '" . $widget_id . "'
|
202 |
AND (maintype LIKE '" . $maintype . "%' OR maintype = 'role')
|
dynwid_worker.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* dynwid_worker.php - The worker does the actual work.
|
4 |
*
|
5 |
-
* @version $Id: dynwid_worker.php
|
6 |
*/
|
7 |
|
8 |
$DW->message('Dynamic Widgets INIT');
|
@@ -120,13 +120,13 @@
|
|
120 |
/* Author AND Category */
|
121 |
if ( count($act_author) > 0 && count($act_category) > 0 ) {
|
122 |
// Use of array_intersect to be sure one value in both arrays returns true
|
123 |
-
if ( in_array($post->post_author
|
124 |
$display = $other;
|
125 |
$DW->message('Exception triggered for ' . $widget_id . ' sets display to ' . $e . ' (rule ES1)');
|
126 |
}
|
127 |
/* Only Author */
|
128 |
} else if ( count($act_author) > 0 && count($act_category == 0) ) {
|
129 |
-
if ( in_array($post->post_author
|
130 |
$display = $other;
|
131 |
$DW->message('Exception triggered for ' . $widget_id . ' sets display to ' . $e . ' (rule ES2)');
|
132 |
}
|
@@ -154,6 +154,16 @@
|
|
154 |
}
|
155 |
}
|
156 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
|
158 |
case 'page':
|
159 |
if ( count($act) > 0 && is_page($act) ) {
|
2 |
/**
|
3 |
* dynwid_worker.php - The worker does the actual work.
|
4 |
*
|
5 |
+
* @version $Id: dynwid_worker.php 223034 2010-03-29 17:11:10Z qurl $
|
6 |
*/
|
7 |
|
8 |
$DW->message('Dynamic Widgets INIT');
|
120 |
/* Author AND Category */
|
121 |
if ( count($act_author) > 0 && count($act_category) > 0 ) {
|
122 |
// Use of array_intersect to be sure one value in both arrays returns true
|
123 |
+
if ( in_array($post->post_author, $act_author) && (bool) array_intersect($post_category, $act_category) ) {
|
124 |
$display = $other;
|
125 |
$DW->message('Exception triggered for ' . $widget_id . ' sets display to ' . $e . ' (rule ES1)');
|
126 |
}
|
127 |
/* Only Author */
|
128 |
} else if ( count($act_author) > 0 && count($act_category == 0) ) {
|
129 |
+
if ( in_array($post->post_author, $act_author) ) {
|
130 |
$display = $other;
|
131 |
$DW->message('Exception triggered for ' . $widget_id . ' sets display to ' . $e . ' (rule ES2)');
|
132 |
}
|
154 |
}
|
155 |
}
|
156 |
break;
|
157 |
+
|
158 |
+
case 'home':
|
159 |
+
if ( count($act) > 0 ) {
|
160 |
+
$home_id = get_option('page_for_posts');
|
161 |
+
if ( in_array($home_id, $act) ) {
|
162 |
+
$display = $other;
|
163 |
+
$DW->message('Exception triggered for ' . $widget_id . ' sets display to ' . $e . ' (rule EH1)');
|
164 |
+
}
|
165 |
+
}
|
166 |
+
break;
|
167 |
|
168 |
case 'page':
|
169 |
if ( count($act) > 0 && is_page($act) ) {
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:
|
|
4 |
Tags: widget, widgets, dynamic, sidebar, custom, rules, admin, conditional tags
|
5 |
Requires at least: 2.9.1
|
6 |
Tested up to: 2.9.2
|
7 |
-
Stable tag: 1.2
|
8 |
|
9 |
Dynamic Widgets gives you more control over your widgets. It lets you dynamicly place widgets on WordPress pages.
|
10 |
|
@@ -21,6 +21,7 @@ Dynamic Widgets gives you more control over your widgets. It lets you dynamicly
|
|
21 |
- Category pages
|
22 |
- Archive pages
|
23 |
- Error Page
|
|
|
24 |
* Exceptions can be created for:
|
25 |
- User roles on role, including not logged in (anonymous) users
|
26 |
- Single post pages on Author, Categories, Tags and/or Individual posts
|
@@ -79,6 +80,18 @@ Please file a [bugreport](http://www.qurl.nl/bugreport/). Please note the proced
|
|
79 |
|
80 |
== Changelog ==
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
= Version 1.2 =
|
83 |
|
84 |
* Added support for PHP4 (not fully tested).
|
@@ -110,14 +123,6 @@ Please file a [bugreport](http://www.qurl.nl/bugreport/). Please note the proced
|
|
110 |
|
111 |
Be sure to deactivate Dynamic Widgets Plugin before installing the new version following steps 1 and 2 in the installation procedure. After the install you can re-activate the plugin.
|
112 |
|
113 |
-
== Release notes ==
|
114 |
-
|
115 |
-
= Version 1.2 =
|
116 |
-
|
117 |
-
PHP4 support is now automatic. However, PHP4 support is not fully tested. If you encounter problems, please let me know. I'll try to work out a solution.
|
118 |
-
|
119 |
-
Due to the addition of the Author pages option, the behavior of the Archive pages option has slightly changed. The Archive pages option does not include the Author pages anymore. If you have widgets with the Archive option set to 'No' the upgrade process to version 1.2 will automaticly set 'No' to the Author pages also to keep the old behavior. An upgrade is only triggered when a proper deactivate and activate cycle is done.
|
120 |
-
|
121 |
== Screenshots ==
|
122 |
|
123 |
1. Widgets overview page
|
4 |
Tags: widget, widgets, dynamic, sidebar, custom, rules, admin, conditional tags
|
5 |
Requires at least: 2.9.1
|
6 |
Tested up to: 2.9.2
|
7 |
+
Stable tag: 1.2.3
|
8 |
|
9 |
Dynamic Widgets gives you more control over your widgets. It lets you dynamicly place widgets on WordPress pages.
|
10 |
|
21 |
- Category pages
|
22 |
- Archive pages
|
23 |
- Error Page
|
24 |
+
- Search Page
|
25 |
* Exceptions can be created for:
|
26 |
- User roles on role, including not logged in (anonymous) users
|
27 |
- Single post pages on Author, Categories, Tags and/or Individual posts
|
80 |
|
81 |
== Changelog ==
|
82 |
|
83 |
+
= Version 1.2.3 =
|
84 |
+
|
85 |
+
* Added default widget display setting option for Search Page.
|
86 |
+
|
87 |
+
= Version 1.2.2 =
|
88 |
+
|
89 |
+
* Added detection for posts page when front page display is set to static page (more or less a bugfix for 1.2.1).
|
90 |
+
|
91 |
+
= Version 1.2.1 =
|
92 |
+
|
93 |
+
* Added functionality when front page display is set to static page.
|
94 |
+
|
95 |
= Version 1.2 =
|
96 |
|
97 |
* Added support for PHP4 (not fully tested).
|
123 |
|
124 |
Be sure to deactivate Dynamic Widgets Plugin before installing the new version following steps 1 and 2 in the installation procedure. After the install you can re-activate the plugin.
|
125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
== Screenshots ==
|
127 |
|
128 |
1. Widgets overview page
|