Conversation
support1. events-widget.php (line:53) has table prefix hardcoded, should use $wpdb->prefix instead of wp_. 2. The standard wrappers $before_widget, and $after_widget was not used along with an absolute positioning for the widget. 3. events.php (line: 49) the menu icon is assumed to be existing in the theme, better distribute the icon with the plugin and point it there using plugins_url I had corrected all these on my copy. https://wordpress.org/plugins/manags-events/
Found more bugs in the events-widget.php If have only single day events, those will not be displayed on the calendar widget. This is because the range will not satisfy. Modified the code in the events-widget.php function get_dates($start, $end) { $startDay = strtotime($start); $endDay = strtotime($end); $days = ($endDay - $startDay) / (60 * 60 * 24); $this->eventsData[] = date("m/d/Y", $startDay); for ($i = 1; $i <= $days; $i++) { $this->eventsData[] = date("m/d/Y", $startDay + ($i * 86400)); } } /*for php 5.3>*/ function get_dates_5($start,$end){ $begin = new DateTime( $start ); $end = new DateTime( $end ); $interval = DateInterval::createFromDateString('1 day'); $period = new DatePeriod($begin, $interval, $end); if(empty($period)){ $this->eventsData[]= $begin->format( "m/d/Y" ); }else{ foreach ( $period as $dt ){ $this->eventsData[]= $dt->format( "m/d/Y" ); } } }
Hi Jiju Thomas Mathew Thanks for pointing the issues in plugin.Bugs are now fixed and new version is released with a new slider feature is added in the plugin
Found more bugs in the events-widget.php If have only single day events, those will not be displayed on the calendar widget. This is because the range will not satisfy. Modified the code in the events-widget.php function get_dates($start, $end) { $startDay = strtotime($start); $endDay = strtotime($end); $days = ($endDay - $startDay) / (60 * 60 * 24); $this->eventsData[] = date("m/d/Y", $startDay); for ($i = 1; $i <= $days; $i++) { $this->eventsData[] = date("m/d/Y", $startDay + ($i * 86400)); } } /*for php 5.3>*/ function get_dates_5($start,$end){ $begin = new DateTime( $start ); $end = new DateTime( $end ); $interval = DateInterval::createFromDateString('1 day'); $period = new DatePeriod($begin, $interval, $end); if(empty($period)){ $this->eventsData[]= $begin->format( "m/d/Y" ); }else{ foreach ( $period as $dt ){ $this->eventsData[]= $dt->format( "m/d/Y" ); } } }
Hi Jiju Thomas Mathew Thanks for pointing the issues in plugin.Bugs are now fixed and new version is released with a new slider feature is added in the plugin