| @@ -66,18 +66,18 @@ | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** @see WP_Widget::update -- do not rename this */ |
| 69 | 69 | public function update( $new_instance, $old_instance ) { |
| 70 | - $instance['title'] = !empty($new_instance['title']) ? strip_tags( $new_instance['title'] ) : ''; | |
| 71 | - $instance['skin'] = !empty($new_instance['skin']) ? strip_tags( $new_instance['skin'] ) : ''; | |
| 72 | - $instance['custom_skin'] = !empty($new_instance['custom_skin']) ? strip_tags( $new_instance['custom_skin'] ) : ''; | |
| 73 | - $instance['radius'] = ( empty($new_instance['radius']) || (int) $new_instance['radius'] < 5 ) ? 5 : (int) $new_instance['radius']; | |
| 74 | - $instance['noseconds'] = !empty($new_instance['noseconds']) ? '1' : ''; | |
| 75 | - $instance['gmtoffset'] = !empty($new_instance['gmtoffset']) ? (float) $new_instance['gmtoffset'] : ''; | |
| 76 | - $instance['showdigital'] = !empty($new_instance['showdigital']) ? strip_tags( $new_instance['showdigital'] ) : ''; | |
| 77 | - $instance['digitalcolor'] = !empty($new_instance['digitalcolor']) ? CoolClock::colorval( $new_instance['digitalcolor'] ) : ''; | |
| 78 | - $instance['scale'] = !empty($new_instance['scale']) ? strip_tags( $new_instance['scale'] ) : ''; | |
| 79 | - $instance['align'] = !empty($new_instance['align']) ? strip_tags( $new_instance['align'] ) : ''; | |
| 70 | + $instance['title'] = strip_tags( $new_instance['title'] ); | |
| 71 | + $instance['skin'] = strip_tags( $new_instance['skin'] ); | |
| 72 | + $instance['custom_skin'] = strip_tags( $new_instance['custom_skin'] ); | |
| 73 | + $instance['radius'] = ( (int) $new_instance['radius'] < 5 ) ? 5 : (int) $new_instance['radius']; | |
| 74 | + $instance['noseconds'] = (bool) $new_instance['noseconds']; | |
| 75 | + $instance['gmtoffset'] = ( $new_instance['gmtoffset'] == '' ) ? '' : (float) $new_instance['gmtoffset']; | |
| 76 | + $instance['showdigital'] = strip_tags( $new_instance['showdigital'] ); | |
| 77 | + $instance['digitalcolor'] = strip_tags( $new_instance['digitalcolor'] ); | |
| 78 | + $instance['scale'] = strip_tags( $new_instance['scale'] ); | |
| 79 | + $instance['align'] = strip_tags( $new_instance['align'] ); | |
| 80 | 80 | |
| 81 | 81 | if ( current_user_can('unfiltered_html') ) |
| 82 | 82 | $instance['subtext'] = $new_instance['subtext']; |
| 83 | 83 | else |
| @@ -232,15 +232,15 @@ | ||
| 232 | 232 | |
| 233 | 233 | $advanced = '<p><label for="' . $this->get_field_id('digitalcolor') . '">' . __('Digital color:', 'coolclock') . '</label> '; |
| 234 | 234 | $advanced .= '<input id="' . $this->get_field_id('digitalcolor') . '" name="' . $this->get_field_name('digitalcolor') . '" type="text" value="' . $instance['digitalcolor'] . '" /> <em>' . __('(use a valid HTML color code or name)', 'coolclock') . '</em></p>'; |
| 235 | 235 | |
| 236 | - $advanced .= '<p><a href="http://premium.status301.net/downloads/coolclock-advanced/">' . __('More digital font options »', 'coolclock') . '</a></p> | |
| 236 | + $advanced .= '<p><a href="http://premium.status301.net/downloads/coolclock-advanced/">' . __('More digital font options »', 'coolclock') . '</a></p> | |
| 237 | 237 | <p><strong>' . __('Background') . '</strong></p><p><a href="http://premium.status301.net/downloads/coolclock-advanced/">' . __('Available in the Advanced extension »', 'coolclock') . '</a></p>'; |
| 238 | 238 | |
| 239 | 239 | // Advanced filter |
| 240 | 240 | $output .= apply_filters( 'coolclock_widget_form_advanced', $advanced, $this, $instance, $defaults ); |
| 241 | 241 | |
| 242 | - if ( class_exists( 'CoolClockAdvanced' ) && isset(CoolClockAdvanced::$plugin_version) && version_compare( CoolClockAdvanced::$plugin_version, '7.1', '<' ) ) { // add an upgrade notice | |
| 242 | + if ( class_exists( 'CoolClockAdvanced' ) && isset(CoolClockAdvanced::$plugin_version) && version_compare( CoolClockAdvanced::$plugin_version, '7.0', '<' ) ) { // add an upgrade notice | |
| 243 | 243 | $output .= '<div class="update-nag"><strong>' . __('Please upgrade the CoolClock - Advanced extension.', 'coolclock') . '</strong> '. ' <a href="http://premium.status301.net/account/" target="_blank">' . __('Please log in with your account credentials here.', 'coolclock') . '</a>' . __('You can download the new version using the link in the downloads list.', 'coolclock') . '</div>'; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | echo $output; |