function initCalendar($options, $eventid = '', $eventdate = '', $cuid = '') { if (empty($cuid)) { $cuid = rand(1, 5000); } $cellStyle = ' style="width:' . $this->cellWidth . '; height:' . $this->cellHeight . '; "'; //$calContent .= _r($calEvents); $calContent .= '<script type="text/javascript"> jQuery(document).ready(function() { var options = { realPath:"' . base64_encode($_SERVER['REQUEST_URI']) . '", calendar:"' . $options['ics_file_default'] . '", cuid:"' . $cuid . '" }; '; $calContent .= ' jQuery("#ics-prev-button' . $cuid . ', #ics-next-button' . $cuid . '").click(function() { jQuery.get("' . ICSCALENDAR_URLPATH . 'ajax-load.php?showMonth="+jQuery(this).attr("month")+"", options, function(data) { jQuery("#ics-calendar-uid' . $cuid . ' > div").unbind(); jQuery().unbind("mousemove"); jQuery("#ics-calendar-uid' . $cuid . '").html(data); }); }); }); '; $calContent .= '</script>'; $calContent .= '<div class="ics-calendar-header"><small><a class="ics-nav-button" id="ics-prev-button' . $cuid . '" href="javascript:void(0);">« ' . __('Prev Month', 'WPICSImporter') . '</a></small> ' . '<div id="ics-calendar-header-text' . $cuid . '"></div> <small><a class="ics-nav-button" id="ics-next-button' . $cuid . '" href="javascript:void(0);">' . __('Next Month', 'WPICSImporter') . ' »</a></small></div>'; $calContent .= '<div id="ics-calendar-uid' . $cuid . '" class="ics-calendar-holder">'; $calContent .= icsCalDisplay::showCalendar($options, NULL, $eventid, $eventdate, $cuid); $calContent .= '</div>'; return $calContent; }
<?php 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;