Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter robotcake

    (@robotcake)

    I think I know why, actually not the sidebar problem but the widget in the sidebar have some problem, i am not sure if that is javascript conflit, the widget is events manager, this is the events calendar widget:

    <?php
    /**
     * @author marcus
     * Standard events calendar widget
     */
    class EM_Widget_Calendar extends WP_Widget {
    
    	var $defaults = array();
    
        /** constructor */
        function EM_Widget_Calendar() {
        	$this->defaults = array(
        		'title' => __('Calendar','dbem'),
        		'long_events' => 0,
        		'category' => 0
        	);
        	$widget_ops = array('description' => __( "Display your events in a calendar widget.", 'dbem') );
            parent::WP_Widget(false, $name = __('Events Calendar','dbem'), $widget_ops);
        }
    
        /** @see WP_Widget::widget */
        function widget($args, $instance) {
        	$instance = array_merge($this->defaults, $instance);
    
        	echo $args['before_widget'];
        	if( !empty($instance['title']) ){
    		    echo $args['before_title'];
    		    echo $instance['title'];
    		    echo $args['after_title'];
        	}
        	//Shall we show a specific month?
    		if ( !empty($_REQUEST['calendar_day']) ) {
    			$date = explode('-', $_REQUEST['calendar_day']);
    			$instance['month'] = $date[1];
    			$instance['year'] = $date[0];
    		}else{
    			$instance['month'] = date("m");
    		}
    
    	    //Our Widget Content
    	    echo EM_Calendar::output(apply_filters('em_widget_calendar_get_args',$instance));
    
    	    echo $args['after_widget'];
        }
    
        /** @see WP_Widget::update */
        function update($new_instance, $old_instance) {
        	//filter the new instance and replace blanks with defaults
        	$new_instance['title'] = (!isset($new_instance['title'])) ? $this->defaults['title']:$new_instance['title'];
        	$new_instance['long_events'] = ($new_instance['long_events'] == '') ? $this->defaults['long_events']:$new_instance['long_events'];
        	$new_instance['category'] = ($new_instance['category'] == '') ? $this->defaults['category']:$new_instance['category'];
        	return $new_instance;
        }
    
        /** @see WP_Widget::form */
        function form($instance) {
        	$instance = array_merge($this->defaults, $instance);
            ?>
    		<p>
    			<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'dbem'); ?>: </label>
    			<input type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr($instance['title']); ?>" />
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id('long_events'); ?>"><?php _e('Show Long Events?', 'dbem'); ?>: </label>
    			<input type="checkbox" id="<?php echo $this->get_field_id('long_events'); ?>" name="<?php echo $this->get_field_name('long_events'); ?>" value="1" <?php echo ($instance['long_events'] == '1') ? 'checked="checked"':''; ?>/>
    		</p>
    		<p>
                <label for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Category IDs','dbem'); ?>: </label>
                <input type="text" id="<?php echo $this->get_field_id('category'); ?>" name="<?php echo $this->get_field_name('category'); ?>" size="3" value="<?php echo esc_attr($instance['category']); ?>" />
                <em><?php _e('1,2,3 or 2 (0 = all)','dbem'); ?> </em>
            </p>
            <?php
        }
    
    }
    add_action('widgets_init', create_function('', 'return register_widget("EM_Widget_Calendar");'));

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still – use the pastebin. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]

    Plugin Author oferwald

    (@oferwald)

    I must only assume that this generated some html code that will not pass validation, can you check the original page in w3c validator?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘No translation after Dynamic sidebar function call’ is closed to new replies.