本文整理汇总了PHP中IsDate_inputed函数的典型用法代码示例。如果您正苦于以下问题:PHP IsDate_inputed函数的具体用法?PHP IsDate_inputed怎么用?PHP IsDate_inputed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsDate_inputed函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: php_showevent
function php_showevent()
{
global $wpdb;
if (isset($_GET['date'])) {
if (IsDate_inputed($_GET['date'])) {
$date = $_GET['date'];
} else {
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
}
} else {
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
}
if (isset($_GET['calendar_id'])) {
$calendar = $_GET['calendar_id'];
} else {
$calendar = 0;
}
$year = substr($date, 0, 4);
$month = substr($date, 5, 2);
$eventID = $_GET['eventID'];
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE id=%d', $eventID));
$all_files_spider_cal['row'] = $row;
$all_files_spider_cal['option'] = $option;
return array($all_files_spider_cal);
}
示例2: php_showevent
function php_showevent()
{
global $wpdb;
if (isset($_GET['calendar_id'])) {
$calendar = $_GET['calendar_id'];
} else {
$calendar = 0;
}
if (isset($_GET['date'])) {
if (IsDate_inputed($_GET['date'])) {
$date = $_GET['date'];
} else {
$date = date("Y-m-d");
}
} else {
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
}
$year = substr($date, 0, 4);
$month = substr($date, 5, 2);
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event where calendar=%d", $calendar);
$rows = $wpdb->get_results($query);
$all_spider_files['rows'] = $rows;
$all_spider_files['option'] = $option;
return array($all_spider_files);
}
示例3: big_calendar_list_widget
function big_calendar_list_widget()
{
require_once "frontend_functions.php";
global $wpdb;
$widget = isset($_GET['widget']) && (int) $_GET['widget'] ? (int) $_GET['widget'] : 0;
$many_sp_calendar = isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar'])) ? esc_html($_GET['many_sp_calendar']) : 1;
$calendar_id = isset($_GET['calendar']) ? (int) $_GET['calendar'] : '';
$theme_id = isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1;
$date = isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date'])) ? esc_html($_GET['date']) : '';
$view_select = isset($_GET['select']) ? esc_html($_GET['select']) : 'month,';
$path_sp_cal = isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '';
$site_url = get_option("home", get_site_url()) . '/wp-admin/admin-ajax.php';
///////////////////////////////////////////////////////////////////////////////////
if (isset($_GET['cat_id'])) {
$cat_id = $_GET['cat_id'];
} else {
$cat_id = "";
}
if (isset($_GET['cat_ids'])) {
$cat_ids = $_GET['cat_ids'];
} else {
$cat_ids = "";
}
if ($cat_ids == '') {
$cat_ids .= $cat_id . ',';
} else {
$cat_ids .= ',' . $cat_id . ',';
}
$cat_ids = substr($cat_ids, 0, -1);
function getelementcountinarray($array, $element)
{
$t = 0;
for ($i = 0; $i < count($array); $i++) {
if ($element == $array[$i]) {
$t++;
}
}
return $t;
}
function getelementindexinarray($array, $element)
{
$t = '';
for ($i = 0; $i < count($array); $i++) {
if ($element == $array[$i]) {
$t .= $i . ',';
}
}
return $t;
}
$cat_ids_array = explode(',', $cat_ids);
if ($cat_id != '') {
if (getelementcountinarray($cat_ids_array, $cat_id) % 2 == 0) {
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
$index_array = explode(',', $index_in_line);
array_pop($index_array);
for ($j = 0; $j < count($index_array); $j++) {
unset($cat_ids_array[$index_array[$j]]);
}
$cat_ids = implode(',', $cat_ids_array);
}
} else {
$cat_ids = substr($cat_ids, 0, -1);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
$weekstart = $theme->week_start_day;
$bg = '#' . str_replace('#', '', $theme->header_bgcolor);
$bg_color_selected = '#' . str_replace('#', '', $theme->bg_color_selected);
$color_arrow = '#' . str_replace('#', '', $theme->arrow_color);
$evented_color = '#' . str_replace('#', '', $theme->text_color_this_month_evented);
$evented_color_bg = '#' . str_replace('#', '', $theme->bg_color_this_month_evented);
$sun_days = '#' . str_replace('#', '', $theme->text_color_sun_days);
$text_color_other_months = '#' . str_replace('#', '', $theme->text_color_other_months);
$text_color_this_month_unevented = '#' . str_replace('#', '', $theme->text_color_this_month_unevented);
$text_color_month = '#' . str_replace('#', '', $theme->text_color_month);
$color_week_days = '#' . str_replace('#', '', $theme->text_color_week_days);
$text_color_selected = '#' . str_replace('#', '', $theme->text_color_selected);
$border_day = '#' . str_replace('#', '', $theme->border_day);
$calendar_width = $theme->width;
$calendar_bg = '#' . str_replace('#', '', $theme->footer_bgcolor);
$weekdays_bg_color = '#' . str_replace('#', '', $theme->weekdays_bg_color);
$weekday_su_bg_color = '#' . str_replace('#', '', $theme->su_bg_color);
$cell_border_color = '#' . str_replace('#', '', $theme->cell_border_color);
$year_font_size = $theme->year_font_size;
$year_font_color = '#' . str_replace('#', '', $theme->year_font_color);
$year_tabs_bg_color = '#' . str_replace('#', '', $theme->year_tabs_bg_color);
$font_year = $theme->font_year;
$font_month = $theme->font_month;
$font_day = $theme->font_day;
$font_weekday = $theme->font_weekday;
$show_cat = 1;
$ev_title_color = '#' . str_replace('#', '', $theme->ev_title_color);
$popup_width = $theme->popup_width;
$popup_height = $theme->popup_height;
$show_event_bgcolor = '#' . str_replace('#', '', $theme->show_event_bgcolor);
__('January', 'sp_calendar');
__('February', 'sp_calendar');
__('March', 'sp_calendar');
__('April', 'sp_calendar');
__('May', 'sp_calendar');
//.........这里部分代码省略.........
示例4: spiderbigcalendar
function spiderbigcalendar()
{
require_once "front_end/frontend_functions.php";
$calendar_id = isset($_GET['calendar_id']) ? (int) $_GET['calendar_id'] : 0;
$date = isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date'])) ? esc_html($_GET['date']) : date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
$ev_ids_inline = isset($_GET['ev_ids']) ? esc_html($_GET['ev_ids']) : '';
$eventID = isset($_GET['eventID']) ? (int) $_GET['eventID'] : '';
$widget = isset($_GET['widget']) && (int) $_GET['widget'] ? (int) $_GET['widget'] : 0;
$theme_id = isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1;
global $wpdb;
if ($widget) {
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
} else {
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
}
$title_color = '#' . str_replace('#', '', $theme->title_color);
$title_size = $theme->title_font_size;
$title_font = $theme->title_font;
$title_style = $theme->title_style;
$date_color = '#' . str_replace('#', '', $theme->date_color);
$date_size = $theme->date_size;
$date_font = $theme->date_font;
$date_style = $theme->date_style;
$next_prev_event_bgcolor = '#' . str_replace('#', '', $theme->next_prev_event_bgcolor);
$next_prev_event_arrowcolor = '#' . str_replace('#', '', $theme->next_prev_event_arrowcolor);
$show_event_bgcolor = '#' . str_replace('#', '', $theme->show_event_bgcolor);
$popup_width = $theme->popup_width;
$popup_height = $theme->popup_height;
$date_format = $theme->date_format;
$show_repeat = $theme->show_repeat;
$date_format_array = explode('/', $date_format);
for ($i = 0; $i < count($date_format_array); $i++) {
if ($date_format_array[$i] == 'w') {
$date_format_array[$i] = 'l';
}
if ($date_format_array[$i] == 'm') {
$date_format_array[$i] = 'F';
}
if ($date_format_array[$i] == 'y') {
$date_format_array[$i] = 'Y';
}
}
$all_files_cal = php_showevent($calendar_id, $date, $eventID);
$row = $all_files_cal[0]['row'];
$datte = isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date'])) ? esc_html($_GET['date']) : date("Y-m-d");
$activedate = explode('-', $datte);
$activedatetimestamp = mktime(0, 0, 0, $activedate[1], $activedate[2], $activedate[0]);
$activedatestr = '';
for ($i = 0; $i < count($date_format_array); $i++) {
$activedatestr .= __(date("" . $date_format_array[$i] . "", $activedatetimestamp), 'sp_calendar') . ' ';
}
$date = $datte;
$day = substr($date, 8);
$ev_id = explode(',', $ev_ids_inline);
?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script>
function next(day_events, ev_id, theme_id, calendar_id, date, day, ev_ids) {
var p = 0;
for (var key in day_events) {
p = p + 1;
if (day_events[key] == ev_id && day_events[parseInt(key) + 1]) {
window.location = '<?php
echo admin_url('admin-ajax.php?action=spidercalendarbig');
?>
&theme_id=' + theme_id + '&calendar_id=' + calendar_id + '&ev_ids=' + ev_ids + '&eventID=' + day_events[parseInt(key) + 1] + '&date=' + date + '&day=' + day + '&widget=<?php
echo $widget;
?>
';
}
}
}
function change() {
jQuery('#dayevent').ready(function () {
jQuery('#dayevent').animate({
opacity:1,
marginLeft:"0in"
}, 1000, function () {
});
});
}
jQuery(document).ready(function() {
change();
});
// window.onload = change();
function prev(array1, ev_id, theme_id, calendar_id, date, day, ev_ids) {
var day_events = array1;
for (var key in day_events) {
if (day_events[key] == ev_id && day_events[parseInt(key) - 1]) {
window.location = '<?php
echo admin_url('admin-ajax.php?action=spidercalendarbig');
?>
&theme_id=' + theme_id + '&calendar_id=' + calendar_id + '&ev_ids=' + ev_ids + '&eventID=' + day_events[parseInt(key) - 1] + '&date=' + date + '&day=' + day + '&widget=<?php
echo $widget;
?>
';
}
}
}
document.onkeydown = function (evt) {
//.........这里部分代码省略.........
示例5: big_calendar_day
function big_calendar_day()
{
require_once "frontend_functions.php";
global $wpdb;
$widget = isset($_GET['widget']) && (int) $_GET['widget'] ? (int) $_GET['widget'] : 0;
$many_sp_calendar = isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar'])) ? esc_html($_GET['many_sp_calendar']) : 1;
$calendar_id = isset($_GET['calendar']) ? (int) $_GET['calendar'] : '';
$theme_id = isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1;
$date = isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date'])) ? esc_html($_GET['date']) : '';
$view_select = isset($_GET['select']) ? esc_html($_GET['select']) : 'month,';
$path_sp_cal = isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '';
$site_url = get_option("home", get_site_url()) . '/wp-admin/admin-ajax.php';
///////////////////////////////////////////////////////////////////////////////////
if (isset($_GET['cat_id'])) {
$cat_id = $_GET['cat_id'];
} else {
$cat_id = "";
}
if (isset($_GET['cat_ids'])) {
$cat_ids = $_GET['cat_ids'];
} else {
$cat_ids = "";
}
if ($cat_ids == '') {
$cat_ids .= $cat_id . ',';
} else {
$cat_ids .= ',' . $cat_id . ',';
}
$cat_ids = substr($cat_ids, 0, -1);
function getelementcountinarray($array, $element)
{
$t = 0;
for ($i = 0; $i < count($array); $i++) {
if ($element == $array[$i]) {
$t++;
}
}
return $t;
}
function getelementindexinarray($array, $element)
{
$t = '';
for ($i = 0; $i < count($array); $i++) {
if ($element == $array[$i]) {
$t .= $i . ',';
}
}
return $t;
}
$cat_ids_array = explode(',', $cat_ids);
if ($cat_id != '') {
if (getelementcountinarray($cat_ids_array, $cat_id) % 2 == 0) {
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
$index_array = explode(',', $index_in_line);
array_pop($index_array);
for ($j = 0; $j < count($index_array); $j++) {
unset($cat_ids_array[$index_array[$j]]);
}
$cat_ids = implode(',', $cat_ids_array);
}
} else {
$cat_ids = substr($cat_ids, 0, -1);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
$cal_width = $theme->width;
$bg_top = '#' . str_replace('#', '', $theme->bg_top);
$bg_bottom = '#' . str_replace('#', '', $theme->bg_bottom);
$border_color = '#' . str_replace('#', '', $theme->border_color);
$text_color_year = '#' . str_replace('#', '', $theme->text_color_year);
$text_color_month = '#' . str_replace('#', '', $theme->text_color_month);
$color_week_days = '#' . str_replace('#', '', $theme->text_color_week_days);
$text_color_other_months = '#' . str_replace('#', '', $theme->text_color_other_months);
$text_color_this_month_unevented = '#' . str_replace('#', '', $theme->text_color_this_month_unevented);
$evented_color = '#' . str_replace('#', '', $theme->text_color_this_month_evented);
$evented_color_bg = '#' . str_replace('#', '', $theme->bg_color_this_month_evented);
$color_arrow_year = '#' . str_replace('#', '', $theme->arrow_color_year);
$color_arrow_month = '#' . str_replace('#', '', $theme->arrow_color_month);
$sun_days = '#' . str_replace('#', '', $theme->text_color_sun_days);
$event_title_color = '#' . str_replace('#', '', $theme->event_title_color);
$current_day_border_color = '#' . str_replace('#', '', $theme->current_day_border_color);
$cell_border_color = '#' . str_replace('#', '', $theme->cell_border_color);
$cell_height = $theme->cell_height;
$popup_width = $theme->popup_width;
$popup_height = $theme->popup_height;
$number_of_shown_evetns = $theme->number_of_shown_evetns;
$sundays_font_size = $theme->sundays_font_size;
$other_days_font_size = $theme->other_days_font_size;
$weekdays_font_size = $theme->weekdays_font_size;
$border_width = $theme->border_width;
$top_height = $theme->top_height;
$bg_color_other_months = '#' . str_replace('#', '', $theme->bg_color_other_months);
$sundays_bg_color = '#' . str_replace('#', '', $theme->sundays_bg_color);
$weekdays_bg_color = '#' . str_replace('#', '', $theme->weekdays_bg_color);
$weekstart = $theme->week_start_day;
$weekday_sunday_bg_color = '#' . str_replace('#', '', $theme->weekday_sunday_bg_color);
$border_radius = $theme->border_radius;
$border_radius2 = $border_radius - $border_width;
$week_days_cell_height = $theme->week_days_cell_height;
$year_font_size = $theme->year_font_size;
//.........这里部分代码省略.........
示例6: php_showevent
$date_color = '#' . 'FFFFFF';
$date_size = 16;
$date_font = '';
$date_style = 'bold';
$next_prev_event_bgcolor = '#' . 'FFA142';
$next_prev_event_arrowcolor = '#' . 'FFFFFF';
$show_event_bgcolor = '#' . '36A7E9';
$popup_width = '800';
$popup_height = '600';
$date_format = 'w/d/m/y';
$show_repeat = 1;
$all_files = php_showevent();
$rows = $all_files[0]['rows'];
$option = $all_files[0]['option'];
if (isset($_GET['date'])) {
if (IsDate_inputed($_GET['date'])) {
$datee = $_GET['date'];
} else {
$datee = date("Y-m-d");
}
} else {
$datee = date("Y-m-d");
}
$activedate = explode('-', $datee);
$activedatetimestamp = mktime(0, 0, 0, $activedate[1], $activedate[2], $activedate[0]);
$activedatestr = date("l", $activedatetimestamp) . ', ' . date("d", $activedatetimestamp) . ' ' . date("F", $activedatetimestamp) . ', ' . date("Y", $activedatetimestamp);
$date = $datee;
$day = substr($date, 8);
if (isset($_GET['calendar_id'])) {
$calendar_id = $_GET['calendar_id'];
} else {
示例7: php_getdays
function php_getdays()
{
global $wpdb;
$id = $_GET['id'];
$calendar = $_GET['calendar'];
if (isset($_GET['date'])) {
if (IsDate_inputed($_GET['date'])) {
$date = $_GET['date'];
} else {
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
}
} else {
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
}
$year = substr($date, 0, 4);
$month = substr($date, 5, 2);
$theme_id = $_GET['theme_id'];
if (isset($_GET['widget'])) {
$widget = 1;
} else {
$widget = 0;
}
$show_time = 1;
if (!$_GET['calendar']) {
$calendar = 0;
}
$rows = $wpdb->get_results($wpdb->prepare("SELECT * from " . $wpdb->prefix . "spidercalendar_event where published=1 and ( ( (date<=%s or date like %s) and date_end>=%s) or ( date_end is Null and date like %s ) ) and calendar=%d ", "" . substr($date, 0, 7) . "-01", "" . substr($date, 0, 7) . "%", "" . substr($date, 0, 7) . "-01", "" . substr($date, 0, 7) . "%", $calendar));
//echo "SELECT date,date_end,text_for_date from #__spidercalendar where published=1 and ( ( (date<='".substr( $date,0,7)."-01' or date like '".substr( $date,0,7)."%') and date_end>='".substr( $date,0,7)."-01' ) or ( date_end is Null and date like '".substr( $date,0,7)."%' ) ) ";
$id_array = array();
$s = count($rows);
$id_array = array();
$array_days = array();
$array_days1 = array();
$title = array();
$ev_ids = array();
///mec FOR
for ($i = 1; $i <= $s; $i++) {
$date_month = (int) substr($rows[$i - 1]->date, 5, 2);
$date_end_month = (int) substr($rows[$i - 1]->date_end, 5, 2);
$date_day = (int) substr($rows[$i - 1]->date, 8, 2);
$date_end_day = (int) substr($rows[$i - 1]->date_end, 8, 2);
//echo $date_day;
$date_year_month = (int) (substr($rows[$i - 1]->date, 0, 4) . substr($rows[$i - 1]->date, 5, 2));
$date_end_year_month = (int) (substr($rows[$i - 1]->date_end, 0, 4) . substr($rows[$i - 1]->date_end, 5, 2));
$year_month = (int) ($year . $month);
$repeat = $rows[$i - 1]->repeat;
if ($repeat == "") {
$repeat = 1;
}
$start_date = $rows[$i - 1]->date;
//echo $date_month.'<br>' ;
//echo (int)$month.'<br>';
$weekly = $rows[$i - 1]->week;
$weekly_array = explode(',', $weekly);
$date_days = array();
$weekdays_start = array();
$weekdays = array();
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// NO Repeat /////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($rows[$i - 1]->repeat_method == 'no_repeat') {
$date_days[] = $date_day;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// Repeat Daily /////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($rows[$i - 1]->repeat_method == 'daily') {
$t = php_daysDifference($rows[$i - 1]->date, $rows[$i - 1]->date_end);
for ($k = 1; $k <= $t / $repeat; $k++) {
$next_date = php_GetNextDate($start_date, $repeat);
$next_date_array = explode('/', $next_date);
if ((int) $month == $date_month && (int) substr($date_year_month, 0, 4) == (int) $year) {
$date_days[0] = $date_day;
}
if ((int) $month == $next_date_array[0] && (int) $year == $next_date_array[2]) {
$date_days[] = $next_date_array[1];
}
$start_date = date("Y-m-d", mktime(0, 0, 0, $next_date_array[0], $next_date_array[1], $next_date_array[2]));
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// Repeat Weekly ///////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($rows[$i - 1]->repeat_method == 'weekly') {
for ($j = 0; $j <= 6; $j++) {
if (in_array(date("D", mktime(0, 0, 0, $date_month, $date_day + $j, substr($rows[$i - 1]->date, 0, 4))), $weekly_array)) {
$weekdays_start[] = $date_day + $j;
}
}
for ($p = 0; $p < count($weekly_array) - 1; $p++) {
$start_date = substr($rows[$i - 1]->date, 0, 8) . $weekdays_start[$p];
$t = php_daysDifference($rows[$i - 1]->date, $rows[$i - 1]->date_end);
$r = 0;
for ($k = 1; $k < $t / $repeat; $k++) {
$start_date_array[] = $start_date;
$next_date = php_GetNextDate($start_date, $repeat * 7);
$next_date_array = explode('/', $next_date);
if ((int) $month == $date_month && (int) substr($date_year_month, 0, 4) == (int) $year) {
$date_days[0] = $weekdays_start[$p];
}
//.........这里部分代码省略.........
示例8: big_calendar_month
function big_calendar_month()
{
require_once "frontend_functions.php";
global $wpdb;
$widget = isset($_GET['widget']) && (int) $_GET['widget'] ? (int) $_GET['widget'] : 0;
$many_sp_calendar = isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar'])) ? esc_html($_GET['many_sp_calendar']) : 1;
$calendar_id = isset($_GET['calendar']) ? (int) $_GET['calendar'] : '';
$theme_id = isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 13;
$date = isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date'])) ? esc_html($_GET['date']) : '';
$view_select = isset($_GET['select']) ? esc_html($_GET['select']) : 'month,';
$path_sp_cal = isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '';
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where id=" . $calendar_id . "";
$calendar = $wpdb->query($query);
$site_url = get_option("home", get_site_url()) . '/wp-admin/admin-ajax.php';
///////////////////////////////////////////////////////////////////////////////////
if (isset($_GET['cat_id'])) {
$cat_id = $_GET['cat_id'];
} else {
$cat_id = "";
}
if (isset($_GET['cat_ids'])) {
$cat_ids = $_GET['cat_ids'];
} else {
$cat_ids = "";
}
if ($cat_ids == '') {
$cat_ids .= $cat_id . ',';
} else {
$cat_ids .= ',' . $cat_id . ',';
}
$cat_ids = substr($cat_ids, 0, -1);
function getelementcountinarray($array, $element)
{
$t = 0;
for ($i = 0; $i < count($array); $i++) {
if ($element == $array[$i]) {
$t++;
}
}
return $t;
}
function getelementindexinarray($array, $element)
{
$t = '';
for ($i = 0; $i < count($array); $i++) {
if ($element == $array[$i]) {
$t .= $i . ',';
}
}
return $t;
}
$cat_ids_array = explode(',', $cat_ids);
if ($cat_id != '') {
if (getelementcountinarray($cat_ids_array, $cat_id) % 2 == 0) {
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
$index_array = explode(',', $index_in_line);
array_pop($index_array);
for ($j = 0; $j < count($index_array); $j++) {
unset($cat_ids_array[$index_array[$j]]);
}
$cat_ids = implode(',', $cat_ids_array);
}
} else {
$cat_ids = substr($cat_ids, 0, -1);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
$cal_width = $theme->width;
$bg_top = '#' . str_replace('#', '', $theme->bg_top);
$bg_bottom = '#' . str_replace('#', '', $theme->bg_bottom);
$border_color = '#' . str_replace('#', '', $theme->border_color);
$text_color_year = '#' . str_replace('#', '', $theme->text_color_year);
$text_color_month = '#' . str_replace('#', '', $theme->text_color_month);
$color_week_days = '#' . str_replace('#', '', $theme->text_color_week_days);
$text_color_other_months = '#' . str_replace('#', '', $theme->text_color_other_months);
$text_color_this_month_unevented = '#' . str_replace('#', '', $theme->text_color_this_month_unevented);
$evented_color = '#' . str_replace('#', '', $theme->text_color_this_month_evented);
$evented_color_bg = '#' . str_replace('#', '', $theme->bg_color_this_month_evented);
$color_arrow_year = '#' . str_replace('#', '', $theme->arrow_color_year);
$color_arrow_month = '#' . str_replace('#', '', $theme->arrow_color_month);
$sun_days = '#' . str_replace('#', '', $theme->text_color_sun_days);
$event_title_color = '#' . str_replace('#', '', $theme->event_title_color);
$current_day_border_color = '#' . str_replace('#', '', $theme->current_day_border_color);
$cell_border_color = '#' . str_replace('#', '', $theme->cell_border_color);
$cell_height = $theme->cell_height;
$popup_width = $theme->popup_width;
$popup_height = $theme->popup_height;
$number_of_shown_evetns = $theme->number_of_shown_evetns;
$sundays_font_size = $theme->sundays_font_size;
$other_days_font_size = $theme->other_days_font_size;
$weekdays_font_size = $theme->weekdays_font_size;
$border_width = $theme->border_width;
$top_height = $theme->top_height;
$bg_color_other_months = '#' . str_replace('#', '', $theme->bg_color_other_months);
$sundays_bg_color = '#' . str_replace('#', '', $theme->sundays_bg_color);
$weekdays_bg_color = '#' . str_replace('#', '', $theme->weekdays_bg_color);
$weekstart = $theme->week_start_day;
$weekday_sunday_bg_color = '#' . str_replace('#', '', $theme->weekday_sunday_bg_color);
$border_radius = $theme->border_radius;
$border_radius2 = $border_radius - $border_width;
//.........这里部分代码省略.........