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; }
$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; } else { $gmt_end = NULL; $start = $icsOptions['event_limit'] * (int) $_GET['eventsPage']; $icsOptions['event_limit'] = $icsOptions['event_limit'] * ((int) $_GET['eventsPage'] + 1); } $output = ICalEvents::display_events(unserialize(base64_decode($_GET['eventsFile'])), $gmt_start, $gmt_end, $icsOptions['event_limit'], $start, $_GET['uuid']); echo $output; exit; } if (isset($_GET['downloadEvent'])) { $options = get_option(ADMIN_OPTIONS_NAME); $calendars = unserialize($options['ics_files']); $events = ICalEvents::get_event($calendars[$_GET['calendarID']], $_GET['downloadEvent']); header("Content-Type: text/Calendar"); header("Content-Disposition: inline; filename=calendar-event.ics"); echo "BEGIN:VCALENDAR\n"; echo "PRODID:ICS Calendar for Wordpress (fullimpact.net)\n"; foreach ($events as $event) { echo "BEGIN:VEVENT\n"; echo utf8_decode(implode("\n", $event['raw'])) . "\n"; } echo "END:VCALENDAR\n"; exit; }
<strong>Bill Good Marketing, 12393 Gateway Park Place, Suite 600, Draper, Utah</strong><br /><br /> <a href="http://maps.google.com/maps?f=q&hl=en&geocode=&time=&date=&ttype=&q=12393+Gateway+Park+Pl+Ste+600,+draper,+utah&sll=40.520259,-111.894593&sspn=0.032297,0.037165&ie=UTF8&ll=40.527566,-111.89764&spn=0.064587,0.074329&z=14&iwloc=addr&om=1"><img style="border-top: 1px solid #909090; border-bottom: 1px solid #909090;" src="/wp-content/themes/choke/images/map.jpg" /></a> </p> <h2>calendar</h2> <p>The calendar is a aggregate of local user groups, organizations, and group sponsored activities. Subscribe to our feed to have it automatically added to your own calendar. If you do not have a calendar application that can subscribe to feeds, you may use this <a href="/calendar/month.php" target="_blank">web calendar</a> to view the events.</p> <p>Are you aware of a PHP or web development related event that's not listed here? Do you or your organization publish a calendar that could be included? Send an email about it to the list or post a note in the channel and we'll add it to the calendar.</p> <p><a class="subscribecal" href="webcal://ugaf.org/calendar/calendars/UGAF.ics">subscribe to calendar</a></p> <h2>events</h2> <ul class="nobullets"> <?php //$from = time() - (90 * 24 * 60 * 60); // three months back //$from = time(); $from = time() - 1 * 24 * 60 * 60; ICalEvents::display_events('url=http://uphpu.org/calendar/calendars/UPHPU.ics&limit=20&use_description=0&use_location=1&after_date=</strong><br />&date_format=%G %B %e / &time_format=%R&gmt_start=' . $from); ?> </ul> <?php get_footer(); ?>
function is_today($gmt) { return ICalEvents::is_same_day(strtotime(current_time('mysql')), $gmt); }
function eventBoxArray($array, $options, $uid) { $aEvents = array(); foreach ($array as $event) { $eventUID = 'ics_' . md5($event['UID'] . time()); $eventContent = '<div class="ics-calendar-event-box" id="' . $eventUID . $uid . '">'; $eventContent .= __('Event:', 'WPICSImporter') . ' <strong>' . $event['Summary'] . '</strong><br />'; if (ICalEvents::is_all_day($event['StartTime'], $event['EndTime']) || isset($options['hide_time']) && $options['hide_time'] == 'true') { $formated_date = date($options['date_format'], $event['StartTime']); } else { $formated_date = ICalEvents::format_date_range($event['StartTime'], $event['EndTime'], $event['Untimed'], $options['date_format'], $options['time_format']); } $eventContent .= __('When:', 'WPICSImporter') . ' ' . $formated_date . '<br />'; if ($event['Description'] != '') { $calContent .= __('Description:', 'WPICSImporter') . ' ' . $event['Description']; } $eventContent .= '</div>'; $eventContent .= '<div class="ics-calendar-event" icstag="' . $eventUID . $uid . '">'; $eventContent .= $event['Summary']; $eventContent .= '</div>'; $aEvents[] = $eventContent; } return $aEvents; }