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 reactivate the plugin.
Download this release
Release Info
Developer | qurl |
Plugin | Dynamic Widgets |
Version | 1.3.1 |
Comparing to | |
See all releases |
Code changes from version 1.3 to 1.3.1
- dynamic-widgets.php +16 -4
- dynwid_admin_overview.php +20 -1
- dynwid_class.php +20 -1
- dynwid_class_php4.php +20 -1
- dynwid_worker.php +2 -2
- readme.txt +6 -6
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, dates, for the homepage, single posts, pages, authors, categories, archives, error and the search page.
|
6 |
* Author: Jacco
|
7 |
-
* Version: 1.3
|
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,8 @@
|
|
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.3');
|
|
|
27 |
|
28 |
// Class version to use
|
29 |
if ( version_compare(PHP_VERSION, '5.0.0', '<') ) {
|
@@ -158,7 +159,7 @@
|
|
158 |
Warning: Cannot use a scalar value as an array in ./wp-content/plugins/dynamic-widgets/dynamic-widgets.php on line 150
|
159 |
If the bug is not fixed, warning should now be on line 173
|
160 |
*/
|
161 |
-
|
162 |
/* Fixing params */
|
163 |
if (! is_array($DW->registered_widget_controls[$widget_id]['params']) ) {
|
164 |
$DW->registered_widget_controls[$widget_id]['params'] = array();
|
@@ -209,6 +210,16 @@
|
|
209 |
require_once(dirname(__FILE__) . '/dynwid_admin.php');
|
210 |
}
|
211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
function dynwid_init() {
|
213 |
$GLOBALS['DW'] = new dynWid();
|
214 |
|
@@ -221,6 +232,7 @@
|
|
221 |
add_action('admin_menu', 'dynwid_add_admin_menu');
|
222 |
add_action('edit_tag_form_fields', 'dynwid_add_tag_page');
|
223 |
add_action('edited_term', 'dynwid_save_tagdata');
|
|
|
224 |
add_action('plugin_action_links_' . plugin_basename(__FILE__), 'dynwid_add_plugin_actions');
|
225 |
add_action('save_post', 'dynwid_save_postdata');
|
226 |
add_action('sidebar_admin_setup', 'dynwid_add_widget_control');
|
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, dates, for the homepage, single posts, pages, authors, categories, archives, error and the search page.
|
6 |
* Author: Jacco
|
7 |
+
* Version: 1.3.1
|
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 257764 2010-06-27 10:01:22Z 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.3.1');
|
27 |
+
define('DW_VERSION_URL_CHECK', 'http://www.qurl.nl/wp-content/uploads/php/dw_version.php?v=' . DW_VERSION . '&n=');
|
28 |
|
29 |
// Class version to use
|
30 |
if ( version_compare(PHP_VERSION, '5.0.0', '<') ) {
|
159 |
Warning: Cannot use a scalar value as an array in ./wp-content/plugins/dynamic-widgets/dynamic-widgets.php on line 150
|
160 |
If the bug is not fixed, warning should now be on line 173
|
161 |
*/
|
162 |
+
|
163 |
/* Fixing params */
|
164 |
if (! is_array($DW->registered_widget_controls[$widget_id]['params']) ) {
|
165 |
$DW->registered_widget_controls[$widget_id]['params'] = array();
|
210 |
require_once(dirname(__FILE__) . '/dynwid_admin.php');
|
211 |
}
|
212 |
|
213 |
+
function dynwid_check_version($plugin_data, $r) {
|
214 |
+
$check = wp_remote_fopen(DW_VERSION_URL_CHECK . $r->new_version);
|
215 |
+
|
216 |
+
if ( $check && ! empty($check) ) {
|
217 |
+
echo '<div style="font-weight:normal;">';
|
218 |
+
echo $check;
|
219 |
+
echo '</div>';
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
function dynwid_init() {
|
224 |
$GLOBALS['DW'] = new dynWid();
|
225 |
|
232 |
add_action('admin_menu', 'dynwid_add_admin_menu');
|
233 |
add_action('edit_tag_form_fields', 'dynwid_add_tag_page');
|
234 |
add_action('edited_term', 'dynwid_save_tagdata');
|
235 |
+
add_action('in_plugin_update_message-' . plugin_basename(__FILE__), 'dynwid_check_version', 10, 2);
|
236 |
add_action('plugin_action_links_' . plugin_basename(__FILE__), 'dynwid_add_plugin_actions');
|
237 |
add_action('save_post', 'dynwid_save_postdata');
|
238 |
add_action('sidebar_admin_setup', 'dynwid_add_widget_control');
|
dynwid_admin_overview.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* dynwid_admin_overview.php - Overview page
|
4 |
*
|
5 |
-
* @version $Id: dynwid_admin_overview.php
|
6 |
*/
|
7 |
|
8 |
// Special case: Reset action needs to go back to overview.
|
@@ -75,6 +75,25 @@
|
|
75 |
|
76 |
<a href="#" onclick="jQuery('#un').slideToggle('fast'); return false;">Advanced ></a>
|
77 |
<div id="un" style="display:none">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
<br />
|
79 |
For debugging purposes it is possible you're asked to create a dump. Click the 'Create dump' button and save the text file.
|
80 |
<br /><br />
|
2 |
/**
|
3 |
* dynwid_admin_overview.php - Overview page
|
4 |
*
|
5 |
+
* @version $Id: dynwid_admin_overview.php 257764 2010-06-27 10:01:22Z qurl $
|
6 |
*/
|
7 |
|
8 |
// Special case: Reset action needs to go back to overview.
|
75 |
|
76 |
<a href="#" onclick="jQuery('#un').slideToggle('fast'); return false;">Advanced ></a>
|
77 |
<div id="un" style="display:none">
|
78 |
+
<br /> <strong>wp_head() check: </strong>
|
79 |
+
<?php
|
80 |
+
$c = $DW->checkWPhead();
|
81 |
+
switch ( $c ) {
|
82 |
+
case 0:
|
83 |
+
echo '<span style="color:red">wp_head() is NOT called (at the most obvious place)</span>';
|
84 |
+
break;
|
85 |
+
|
86 |
+
case 1:
|
87 |
+
echo '<span style="color:green">wp_head() is called</span>';
|
88 |
+
break;
|
89 |
+
|
90 |
+
case 2:
|
91 |
+
echo '<span style="color:orange">Unable to determine if wp_head() is called</span>';
|
92 |
+
break;
|
93 |
+
}
|
94 |
+
?>
|
95 |
+
.<br />
|
96 |
+
|
97 |
<br />
|
98 |
For debugging purposes it is possible you're asked to create a dump. Click the 'Create dump' button and save the text file.
|
99 |
<br /><br />
|
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 {
|
@@ -84,6 +84,24 @@
|
|
84 |
$this->wpdb->query($query);
|
85 |
}
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
private function createList() {
|
88 |
$this->dynwid_list = array();
|
89 |
|
@@ -132,6 +150,7 @@
|
|
132 |
|
133 |
public function dump() {
|
134 |
echo "wp version: " . $GLOBALS['wp_version'] . "\n";
|
|
|
135 |
echo "dw version: " . DW_VERSION . "\n";
|
136 |
echo "php version: " . PHP_VERSION . "\n";
|
137 |
echo "\n";
|
2 |
/**
|
3 |
* dynwid_class.php - Dynamic Widgets Class (PHP5)
|
4 |
*
|
5 |
+
* @version $Id: dynwid_class.php 257764 2010-06-27 10:01:22Z qurl $
|
6 |
*/
|
7 |
|
8 |
class dynWid {
|
84 |
$this->wpdb->query($query);
|
85 |
}
|
86 |
|
87 |
+
public function checkWPhead() {
|
88 |
+
$ct = current_theme_info();
|
89 |
+
$headerfile = $ct->template_dir . '/header.php';
|
90 |
+
if ( file_exists($headerfile) ) {
|
91 |
+
$buffer = file_get_contents($headerfile);
|
92 |
+
if ( strpos($buffer, 'wp_head()') ) {
|
93 |
+
// wp_head() found
|
94 |
+
return 1;
|
95 |
+
} else {
|
96 |
+
// wp_head() not found
|
97 |
+
return 0;
|
98 |
+
}
|
99 |
+
} else {
|
100 |
+
// wp_head() unable to determine
|
101 |
+
return 2;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
private function createList() {
|
106 |
$this->dynwid_list = array();
|
107 |
|
150 |
|
151 |
public function dump() {
|
152 |
echo "wp version: " . $GLOBALS['wp_version'] . "\n";
|
153 |
+
echo "wp_head: " . $this->checkWPhead() . "\n";
|
154 |
echo "dw version: " . DW_VERSION . "\n";
|
155 |
echo "php version: " . PHP_VERSION . "\n";
|
156 |
echo "\n";
|
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 {
|
@@ -90,6 +90,24 @@
|
|
90 |
$this->wpdb->query($query);
|
91 |
}
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
/* private function */
|
94 |
function createList() {
|
95 |
$this->dynwid_list = array();
|
@@ -139,6 +157,7 @@
|
|
139 |
|
140 |
function dump() {
|
141 |
echo "wp version: " . $GLOBALS['wp_version'] . "\n";
|
|
|
142 |
echo "dw version: " . DW_VERSION . "\n";
|
143 |
echo "php version: " . PHP_VERSION . "\n";
|
144 |
echo "\n";
|
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 257764 2010-06-27 10:01:22Z qurl $
|
7 |
*/
|
8 |
|
9 |
class dynWid {
|
90 |
$this->wpdb->query($query);
|
91 |
}
|
92 |
|
93 |
+
function checkWPhead() {
|
94 |
+
$ct = current_theme_info();
|
95 |
+
$headerfile = $ct->template_dir . '/header.php';
|
96 |
+
if ( file_exists($headerfile) ) {
|
97 |
+
$buffer = file_get_contents($headerfile);
|
98 |
+
if ( strpos($buffer, 'wp_head()') ) {
|
99 |
+
// wp_head() found
|
100 |
+
return 1;
|
101 |
+
} else {
|
102 |
+
// wp_head() not found
|
103 |
+
return 0;
|
104 |
+
}
|
105 |
+
} else {
|
106 |
+
// wp_head() unable to determine
|
107 |
+
return 2;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
/* private function */
|
112 |
function createList() {
|
113 |
$this->dynwid_list = array();
|
157 |
|
158 |
function dump() {
|
159 |
echo "wp version: " . $GLOBALS['wp_version'] . "\n";
|
160 |
+
echo "wp_head: " . $this->checkWPhead() . "\n";
|
161 |
echo "dw version: " . DW_VERSION . "\n";
|
162 |
echo "php version: " . PHP_VERSION . "\n";
|
163 |
echo "\n";
|
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');
|
@@ -12,7 +12,7 @@
|
|
12 |
$DW->message('Page is ' . $whereami);
|
13 |
if ( $whereami == 'single' ) {
|
14 |
$post = $GLOBALS['post'];
|
15 |
-
$DW->message('post_id = '
|
16 |
}
|
17 |
|
18 |
foreach ( $DW->sidebars as $sidebar_id => $widgets ) {
|
2 |
/**
|
3 |
* dynwid_worker.php - The worker does the actual work.
|
4 |
*
|
5 |
+
* @version $Id: dynwid_worker.php 257764 2010-06-27 10:01:22Z qurl $
|
6 |
*/
|
7 |
|
8 |
$DW->message('Dynamic Widgets INIT');
|
12 |
$DW->message('Page is ' . $whereami);
|
13 |
if ( $whereami == 'single' ) {
|
14 |
$post = $GLOBALS['post'];
|
15 |
+
$DW->message('post_id = ' . $post->ID);
|
16 |
}
|
17 |
|
18 |
foreach ( $DW->sidebars as $sidebar_id => $widgets ) {
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: Qurl
|
|
3 |
Donate link:
|
4 |
Tags: widget, widgets, dynamic, sidebar, custom, rules, admin, conditional tags
|
5 |
Requires at least: 2.9.1
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 1.3
|
8 |
|
9 |
Dynamic Widgets gives you more control over your widgets. It lets you dynamicly place widgets on WordPress pages.
|
10 |
|
@@ -82,6 +82,10 @@ Please file a [bugreport](http://www.qurl.nl/bugreport/). Please note the proced
|
|
82 |
|
83 |
== Changelog ==
|
84 |
|
|
|
|
|
|
|
|
|
85 |
= Version 1.3 =
|
86 |
|
87 |
* Added support for dates functionality.
|
@@ -137,10 +141,6 @@ Please file a [bugreport](http://www.qurl.nl/bugreport/). Please note the proced
|
|
137 |
|
138 |
* Added default widget display setting option for 'Not Found' Error (404) Page.
|
139 |
|
140 |
-
== Release Notes ==
|
141 |
-
|
142 |
-
Because of the addition of the dates functionality the database needs to be upgraded. You're advised to make a backup of your WordPress database first. When upgrading, be sure -like always- you do a proper deactiavtion and reactivation of the plugin. Otherwise the upgrade process will not be triggered.
|
143 |
-
|
144 |
== Upgrade Notice ==
|
145 |
|
146 |
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 reactivate the plugin.
|
3 |
Donate link:
|
4 |
Tags: widget, widgets, dynamic, sidebar, custom, rules, admin, conditional tags
|
5 |
Requires at least: 2.9.1
|
6 |
+
Tested up to: 3.0
|
7 |
+
Stable tag: 1.3.1
|
8 |
|
9 |
Dynamic Widgets gives you more control over your widgets. It lets you dynamicly place widgets on WordPress pages.
|
10 |
|
82 |
|
83 |
== Changelog ==
|
84 |
|
85 |
+
= Version 1.3.1
|
86 |
+
|
87 |
+
* Maintenance release for WordPress 3.0 support.
|
88 |
+
|
89 |
= Version 1.3 =
|
90 |
|
91 |
* Added support for dates functionality.
|
141 |
|
142 |
* Added default widget display setting option for 'Not Found' Error (404) Page.
|
143 |
|
|
|
|
|
|
|
|
|
144 |
== Upgrade Notice ==
|
145 |
|
146 |
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 reactivate the plugin.
|