function widgetICSImporter($args) { global $dl_pluginICS; extract($args, EXTR_SKIP); if (!isset($dl_pluginICS)) { return; } $widget = WPICSImporter::getWidgetOptions(); $options = $dl_pluginICS->getAdminOptions(); $options = WPICSImporter::prepareWidgetOptions($widget, $options); echo $before_widget . $before_title; echo $widget['widget_title']; echo $after_title; if ($widget['show_next_buttons'] == 1) { ?> <script type="text/javascript"> var ICSCalendarCurrentPage = 1; function ICSCalendarPage(move) { jQuery.get("<?php echo ICSCALENDAR_URLPATH; ?> ajax-load.php", {'widgetPage' : ICSCalendarCurrentPage+parseInt(move)}, function(data) { ICSCalendarCurrentPage += parseInt(move); jQuery("#ics-calendar-widget-next").show(); if(ICSCalendarCurrentPage>1) { jQuery("#ics-calendar-widget-prev").show(); } else { jQuery("#ics-calendar-widget-prev").hide(); } jQuery("#ics-calendar-widget").html(data); }); } </script> <?php } echo '<ul id="ics-calendar-widget">'; echo ICalEvents::custom_display_events($options); echo '</ul>'; if ($widget['widget_link'] != '') { echo '<small><a href="' . $widget['widget_link'] . '">More »</a></small> '; } if ($widget['show_next_buttons'] == 1) { echo '<small><a id="ics-calendar-widget-prev" href="javascript:ICSCalendarPage(-1);" style="display:none; ">« Previous</a> <a id="ics-calendar-widget-next" href="javascript:ICSCalendarPage(1);">Next »</a></small>'; } print $after_widget; }
require_once "../../../wp-config.php"; if (isset($_GET['showMonth'])) { $options = get_option(ADMIN_OPTIONS_NAME); //$_GET; //$icsOptions = WPICSImporter::getAdminOptions(); $options['ics_file_default'] = $_GET['calendar']; echo icsCalDisplay::showCalendar($options, $_GET['showMonth'], '', '', $_GET['cuid']); exit; } if (isset($_GET['widgetPage'])) { $widget = WPICSImporter::getWidgetOptions(); $options = WPICSImporter::getAdminOptions(); $options = WPICSImporter::prepareWidgetOptions($widget, $options); $options['events_page'] = (int) $_GET['widgetPage']; $output = ICalEvents::custom_display_events($options, true); echo $output['output']; if ($output['count'] < $options['event_limit']) { echo '<script>jQuery("#ics-calendar-widget-next").hide();</script>'; } exit; } if (isset($_GET['eventsPage']) && isset($_GET['eventsStart']) && isset($_GET['eventsEnd']) && isset($_GET['eventsFile'])) { $icsOptions = WPICSImporter::getAdminOptions(); $gmt_start = $_GET['eventsStart']; $gmt_end = $_GET['eventsEnd']; if ($icsOptions['limit_type'] == 'days') { $gmt_start += (int) $icsOptions['event_limit'] * 24 * 3600 * (int) $_GET['eventsPage']; $gmt_end += (int) $icsOptions['event_limit'] * 24 * 3600 * (int) $_GET['eventsPage']; $icsOptions['event_limit'] = 0; $start = 0;