示例#1
0
function dpProEventCalendar_getEventsMonth()
{
    $nonce = $_POST['postEventsNonce'];
    //if ( ! wp_verify_nonce( $nonce, 'ajax-get-events-nonce' ) )
    //   die ( 'Busted!');
    if (!isset($_POST['month'])) {
        die;
    }
    $month = $_POST['month'];
    $year = $_POST['year'];
    $calendar = $_POST['calendar'];
    $category = $_POST['category'];
    $event_id = $_POST['event_id'];
    $author = $_POST['author'];
    require_once 'classes/base.class.php';
    $dpProEventCalendar = new DpProEventCalendar(false, $calendar, null, null, '', $category, $event_id, $author);
    $next_month_days = cal_days_in_month(CAL_GREGORIAN, str_pad($month, 2, "0", STR_PAD_LEFT), $year);
    $month_number = str_pad($month, 2, "0", STR_PAD_LEFT);
    echo $dpProEventCalendar->upcomingCalendarLayout(false, 20, '', $year . "-" . $month_number . "-01 00:00:00", $year . "-" . $month_number . "-" . $next_month_days . " 23:59:59", true);
    die;
}
示例#2
0
文件: ical.php 项目: seoduda/Patua
require_once 'Mobile_Detect.php';
$detect = new Mobile_Detect();
global $dpProEventCalendar, $wpdb, $table_prefix;
if (!is_numeric($_GET['calendar_id']) || $_GET['calendar_id'] <= 0) {
    die;
}
$calendar_id = $_GET['calendar_id'];
$dpProEventCalendar = new DpProEventCalendar(false, $calendar_id);
if (!$dpProEventCalendar->calendar_obj->ical_active) {
    die;
}
$limit = $dpProEventCalendar->calendar_obj->ical_limit;
if (!is_numeric($limit) || $limit <= 0) {
    $limit = 99;
}
$cal_events = $dpProEventCalendar->upcomingCalendarLayout(true, $limit);
//timezone
$tz = get_option('timezone_string');
// get current PHP timezone
if ($tz == "") {
    $tz = date_default_timezone_get();
}
function timezoneDoesDST($tzId, $time = "")
{
    if (class_exists('DateTimeZone') && $tzId != "") {
        $tz = new DateTimeZone($tzId);
        $date = new DateTime($time != "" ? $time : "now", $tz);
        $trans = $tz->getTransitions();
        foreach ($trans as $k => $t) {
            if ($t["ts"] > $date->format('U')) {
                return $trans[$k - 1]['isdst'];
示例#3
0
<?php

global $post_ID, $post;
setup_postdata($post);
$post_ID = get_the_ID();
$SITE_URL = plugin_dir_url(__FILE__);
require_once dirname(__FILE__) . '/../../classes/base.class.php';
$calendar_id = get_post_meta($post_ID, 'pec_id_calendar');
if (!is_array($calendar_id)) {
    $calendar_id = array(0);
}
$dpProEventCalendar_obj = new DpProEventCalendar(false, $calendar_id[0], null, null, '', '', $post_ID);
$event_dates = $dpProEventCalendar_obj->upcomingCalendarLayout(true, 20);
if (!is_array($event_dates)) {
    $event_dates = array();
}
$booking_limit = get_post_meta($post_ID, 'pec_booking_limit', true);
?>


<!DOCTYPE html>
<html lang="en">
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>  
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

		<!--== CSS Files ==-->
		<link href="<?php 
echo $SITE_URL;
?>