Version Description
Download this release
Release Info
Developer | webdorado |
Plugin | Calendar by WD – Responsive Event Calendar |
Version | 1.4 |
Comparing to | |
See all releases |
Code changes from version 1.3.9 to 1.4
- Theme_functions.php +513 -0
- calendar.php +455 -26
- calendar_functions.html.php +814 -128
- calendar_functions.php +264 -23
- elements/calendar-jos.css +1 -0
- featured_plugins.css +80 -0
- front_end/bigcalendarday.php +428 -43
- front_end/bigcalendarday_widget.php +242 -17
- front_end/bigcalendarlist.php +385 -34
- front_end/bigcalendarlist_widget.php +238 -14
- front_end/bigcalendarmonth.php +561 -87
- front_end/bigcalendarmonth_widget.php +340 -29
- front_end/bigcalendarweek.php +421 -55
- front_end/bigcalendarweek_widget.php +240 -15
- front_end/frontend_functions.php +107 -3
- front_end/images/add_but.png +0 -0
- front_end/images/delete_el.png +0 -0
- front_end/images/down.png +0 -0
- front_end/images/up.png +0 -0
- functions_for_xml_and_ajax.php +168 -18
- images/calendar1.png +0 -0
- images/catalog.jpg +0 -0
- images/contact.maker.jpg +0 -0
- images/contacts.jpg +0 -0
- images/delete_el.png +0 -0
- images/down.png +0 -0
- images/downarrow.png +0 -0
- images/download.jpg +0 -0
- images/facebook.jpg +0 -0
- images/faq.jpg +0 -0
- images/flash.calendar.jpg +0 -0
- images/folder.menu.jpg +0 -0
- images/form.jpg +0 -0
- images/player.jpg +0 -0
- images/spider.calendar.jpg +0 -0
- images/up.png +0 -0
- images/zoom.jpg +0 -0
- readme.txt +8 -4
- responsive.css +25 -0
- responsive.js +24 -0
- spider_calendar_update.php +49 -12
- spidercalendar_upcoming_events_widget.php +2898 -0
- widget_Theme_functions.php +334 -0
Theme_functions.php
ADDED
@@ -0,0 +1,513 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!current_user_can('manage_options')) {
|
3 |
+
die('Access Denied');
|
4 |
+
}
|
5 |
+
// function add_theme_calendar() {
|
6 |
+
// global $wpdb;
|
7 |
+
// html_add_theme();
|
8 |
+
// }
|
9 |
+
|
10 |
+
function show_theme_calendar() {
|
11 |
+
global $wpdb;
|
12 |
+
$order = " ORDER BY title ASC";
|
13 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
14 |
+
$sort["sortid_by"] = "title";
|
15 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
16 |
+
$sort["1_or_2"] = "2";
|
17 |
+
if (isset($_POST['page_number'])) {
|
18 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
19 |
+
$sort["sortid_by"] = esc_html($_POST['order_by']);
|
20 |
+
}
|
21 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
22 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
23 |
+
$sort["1_or_2"] = "2";
|
24 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
25 |
+
}
|
26 |
+
else {
|
27 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
28 |
+
$sort["1_or_2"] = "1";
|
29 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
30 |
+
}
|
31 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
32 |
+
$limit = (esc_html($_POST['page_number']) - 1) * 20;
|
33 |
+
}
|
34 |
+
else {
|
35 |
+
$limit = 0;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
else {
|
39 |
+
$limit = 0;
|
40 |
+
}
|
41 |
+
if (isset($_POST['search_events_by_title'])) {
|
42 |
+
$search_tag = esc_html($_POST['search_events_by_title']);
|
43 |
+
}
|
44 |
+
else {
|
45 |
+
$search_tag = "";
|
46 |
+
}
|
47 |
+
if ($search_tag) {
|
48 |
+
$where = ' WHERE title LIKE "%' . $search_tag . '%"';
|
49 |
+
}
|
50 |
+
else {
|
51 |
+
$where = '';
|
52 |
+
}
|
53 |
+
// get the total number of records
|
54 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_theme" . $where;
|
55 |
+
$total = $wpdb->get_var($query);
|
56 |
+
$pageNav['total'] = $total;
|
57 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
58 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_theme" . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
|
59 |
+
$rows = $wpdb->get_results($query);
|
60 |
+
html_show_theme_calendar($rows, $pageNav, $sort);
|
61 |
+
}
|
62 |
+
|
63 |
+
function apply_theme_calendar($id) {
|
64 |
+
global $wpdb;
|
65 |
+
$title = ((isset($_POST["title"])) ? esc_html(stripslashes($_POST["title"])) : '');
|
66 |
+
$width = ((isset($_POST["width"])) ? esc_html($_POST["width"]) : '');
|
67 |
+
$week_start_day = ((isset($_POST["week_start_day"])) ? esc_html($_POST["week_start_day"]) : '');
|
68 |
+
$border_color = ((isset($_POST["border_color"])) ? esc_html($_POST["border_color"]) : '');
|
69 |
+
$border_radius = ((isset($_POST["border_radius"])) ? esc_html($_POST["border_radius"]) : '');
|
70 |
+
$border_width = ((isset($_POST["border_width"])) ? esc_html($_POST["border_width"]) : '');
|
71 |
+
$top_height = ((isset($_POST["top_height"])) ? esc_html($_POST["top_height"]) : '');
|
72 |
+
$bg_top = ((isset($_POST["bg_top"])) ? esc_html($_POST["bg_top"]) : '');
|
73 |
+
$year_font_size = ((isset($_POST["year_font_size"])) ? esc_html($_POST["year_font_size"]) : '');
|
74 |
+
$text_color_year = ((isset($_POST["text_color_year"])) ? esc_html($_POST["text_color_year"]) : '');
|
75 |
+
$arrow_color_year = ((isset($_POST["arrow_color_year"])) ? esc_html($_POST["arrow_color_year"]) : '');
|
76 |
+
$month_type = ((isset($_POST["month_type"])) ? esc_html($_POST["month_type"]) : '');
|
77 |
+
$month_font_size = ((isset($_POST["month_font_size"])) ? esc_html($_POST["month_font_size"]) : '');
|
78 |
+
$text_color_month = ((isset($_POST["text_color_month"])) ? esc_html($_POST["text_color_month"]) : '');
|
79 |
+
$arrow_color_month = ((isset($_POST["arrow_color_month"])) ? esc_html($_POST["arrow_color_month"]) : '');
|
80 |
+
$next_month_text_color = ((isset($_POST["next_month_text_color"])) ? esc_html($_POST["next_month_text_color"]) : '');
|
81 |
+
$next_month_font_size = ((isset($_POST["next_month_font_size"])) ? esc_html($_POST["next_month_font_size"]) : '');
|
82 |
+
$next_month_arrow_color = ((isset($_POST["next_month_arrow_color"])) ? esc_html($_POST["next_month_arrow_color"]) : '');
|
83 |
+
$prev_month_text_color = ((isset($_POST["prev_month_text_color"])) ? esc_html($_POST["prev_month_text_color"]) : '');
|
84 |
+
$prev_month_font_size = ((isset($_POST["prev_month_font_size"])) ? esc_html($_POST["prev_month_font_size"]) : '');
|
85 |
+
$prev_month_arrow_color = ((isset($_POST["prev_month_arrow_color"])) ? esc_html($_POST["prev_month_arrow_color"]) : '');
|
86 |
+
$arrow_size = ((isset($_POST["arrow_size"])) ? esc_html($_POST["arrow_size"]) : '');
|
87 |
+
$text_color_week_days = ((isset($_POST["text_color_week_days"])) ? esc_html($_POST["text_color_week_days"]) : '');
|
88 |
+
$week_days_cell_height = ((isset($_POST["week_days_cell_height"])) ? esc_html($_POST["week_days_cell_height"]) : '');
|
89 |
+
$weekdays_bg_color = ((isset($_POST["weekdays_bg_color"])) ? esc_html($_POST["weekdays_bg_color"]) : '');
|
90 |
+
$weekday_sunday_bg_color = ((isset($_POST["weekday_sunday_bg_color"])) ? esc_html($_POST["weekday_sunday_bg_color"]) : '');
|
91 |
+
$weekdays_font_size = ((isset($_POST["weekdays_font_size"])) ? esc_html($_POST["weekdays_font_size"]) : '');
|
92 |
+
$bg_bottom = ((isset($_POST["bg_bottom"])) ? esc_html($_POST["bg_bottom"]) : '');
|
93 |
+
$cell_height = ((isset($_POST["cell_height"])) ? esc_html($_POST["cell_height"]) : '');
|
94 |
+
$text_color_other_months = ((isset($_POST["text_color_other_months"])) ? esc_html($_POST["text_color_other_months"]) : '');
|
95 |
+
$bg_color_other_months = ((isset($_POST["bg_color_other_months"])) ? esc_html($_POST["bg_color_other_months"]) : '');
|
96 |
+
$text_color_this_month_unevented = ((isset($_POST["text_color_this_month_unevented"])) ? esc_html($_POST["text_color_this_month_unevented"]) : '');
|
97 |
+
$text_color_this_month_evented = ((isset($_POST["text_color_this_month_evented"])) ? esc_html($_POST["text_color_this_month_evented"]) : '');
|
98 |
+
$bg_color_this_month_evented = ((isset($_POST["bg_color_this_month_evented"])) ? esc_html($_POST["bg_color_this_month_evented"]) : '');
|
99 |
+
$event_title_color = ((isset($_POST["event_title_color"])) ? esc_html($_POST["event_title_color"]) : '');
|
100 |
+
$current_day_border_color = ((isset($_POST["current_day_border_color"])) ? esc_html($_POST["current_day_border_color"]) : '');
|
101 |
+
$cell_border_color = ((isset($_POST["cell_border_color"])) ? esc_html($_POST["cell_border_color"]) : '');
|
102 |
+
$text_color_sun_days = ((isset($_POST["text_color_sun_days"])) ? esc_html($_POST["text_color_sun_days"]) : '');
|
103 |
+
$sundays_bg_color = ((isset($_POST["sundays_bg_color"])) ? esc_html($_POST["sundays_bg_color"]) : '');
|
104 |
+
$sundays_font_size = ((isset($_POST["sundays_font_size"])) ? esc_html($_POST["sundays_font_size"]) : '');
|
105 |
+
$other_days_font_size = ((isset($_POST["other_days_font_size"])) ? esc_html($_POST["other_days_font_size"]) : '');
|
106 |
+
$show_time = ((isset($_POST["show_time"])) ? esc_html($_POST["show_time"]) : '');
|
107 |
+
$show_event = ((isset($_POST["show_event"])) ? esc_html($_POST["show_event"]) : '');
|
108 |
+
$date_format = ((isset($_POST["date_format"])) ? esc_html($_POST["date_format"]) : '');
|
109 |
+
$title_color = ((isset($_POST["title_color"])) ? esc_html($_POST["title_color"]) : '');
|
110 |
+
$title_font_size = ((isset($_POST["title_font_size"])) ? esc_html($_POST["title_font_size"]) : '');
|
111 |
+
$title_font = ((isset($_POST["title_font"])) ? esc_html($_POST["title_font"]) : '');
|
112 |
+
$title_style = ((isset($_POST["title_style"])) ? esc_html($_POST["title_style"]) : '');
|
113 |
+
$date_color = ((isset($_POST["date_color"])) ? esc_html($_POST["date_color"]) : '');
|
114 |
+
$date_size = ((isset($_POST["date_size"])) ? esc_html($_POST["date_size"]) : '');
|
115 |
+
$date_font = ((isset($_POST["date_font"])) ? esc_html($_POST["date_font"]) : '');
|
116 |
+
$date_style = ((isset($_POST["date_style"])) ? esc_html($_POST["date_style"]) : '');
|
117 |
+
$next_prev_event_bgcolor = ((isset($_POST["next_prev_event_bgcolor"])) ? esc_html($_POST["next_prev_event_bgcolor"]) : '');
|
118 |
+
$next_prev_event_arrowcolor = ((isset($_POST["next_prev_event_arrowcolor"])) ? esc_html($_POST["next_prev_event_arrowcolor"]) : '');
|
119 |
+
$show_event_bgcolor = ((isset($_POST["show_event_bgcolor"])) ? esc_html($_POST["show_event_bgcolor"]) : '');
|
120 |
+
$popup_width = ((isset($_POST["popup_width"])) ? esc_html($_POST["popup_width"]) : '');
|
121 |
+
$popup_height = ((isset($_POST["popup_height"])) ? esc_html($_POST["popup_height"]) : '');
|
122 |
+
$number_of_shown_evetns = ((isset($_POST["number_of_shown_evetns"])) ? esc_html($_POST["number_of_shown_evetns"]) : '');
|
123 |
+
$show_repeat = ((isset($_POST["show_repeat"])) ? esc_html($_POST["show_repeat"]) : '');
|
124 |
+
$day_start = ((isset($_POST["show_event"])) ? esc_html($_POST["show_event"]) : '');
|
125 |
+
$views_tabs_font_size = ((isset($_POST["views_tabs_font_size"])) ? esc_html($_POST["views_tabs_font_size"]) : '');
|
126 |
+
$views_tabs_text_color = ((isset($_POST["views_tabs_text_color"])) ? esc_html($_POST["views_tabs_text_color"]) : '');
|
127 |
+
$views_tabs_bg_color = ((isset($_POST["views_tabs_bg_color"])) ? esc_html($_POST["views_tabs_bg_color"]) : '');
|
128 |
+
$day_month_font_color = ((isset($_POST["day_month_font_color"])) ? esc_html($_POST["day_month_font_color"]) : '');
|
129 |
+
$week_font_color = ((isset($_POST["week_font_color"])) ? esc_html($_POST["week_font_color"]) : '');
|
130 |
+
$day_month_font_size = ((isset($_POST["day_month_font_size"])) ? esc_html($_POST["day_month_font_size"]) : '');
|
131 |
+
$week_font_size = ((isset($_POST["week_font_size"])) ? esc_html($_POST["week_font_size"]) : '');
|
132 |
+
$ev_title_bg_color = ((isset($_POST["ev_title_bg_color"])) ? esc_html($_POST["ev_title_bg_color"]) : '');
|
133 |
+
$date_height = ((isset($_POST["date_height"])) ? esc_html($_POST["date_height"]) : '');
|
134 |
+
$event_table_height = ((isset($_POST["event_table_height"])) ? esc_html($_POST["event_table_height"]) : '');
|
135 |
+
$event_num_font_size = ((isset($_POST["event_num_font_size"])) ? esc_html($_POST["event_num_font_size"]) : '');
|
136 |
+
$date_font_size = ((isset($_POST["date_font_size"])) ? esc_html($_POST["date_font_size"]) : '');
|
137 |
+
$event_num_color = ((isset($_POST["event_num_color"])) ? esc_html($_POST["event_num_color"]) : '');
|
138 |
+
$event_num_bg_color2 = ((isset($_POST["event_num_bg_color2"])) ? esc_html($_POST["event_num_bg_color2"]) : '');
|
139 |
+
$event_num_bg_color1 = ((isset($_POST["event_num_bg_color1"])) ? esc_html($_POST["event_num_bg_color1"]) : '');
|
140 |
+
$event_bg_color2 = ((isset($_POST["event_bg_color2"])) ? esc_html($_POST["event_bg_color2"]) : '');
|
141 |
+
$event_bg_color1 = ((isset($_POST["event_bg_color1"])) ? esc_html($_POST["event_bg_color1"]) : '');
|
142 |
+
$date_bg_color = ((isset($_POST["date_bg_color"])) ? esc_html($_POST["date_bg_color"]) : '');
|
143 |
+
if ($id === -1) {
|
144 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_theme', array(
|
145 |
+
'id' => NULL,
|
146 |
+
'title' => $title,
|
147 |
+
'width' => $width,
|
148 |
+
'week_start_day' => $week_start_day,
|
149 |
+
'border_color' => $border_color,
|
150 |
+
'border_radius' => $border_radius,
|
151 |
+
'border_width' => $border_width,
|
152 |
+
'top_height' => $top_height,
|
153 |
+
'bg_top' => $bg_top,
|
154 |
+
'year_font_size' => $year_font_size,
|
155 |
+
'text_color_year' => $text_color_year,
|
156 |
+
'arrow_color_year' => $arrow_color_year,
|
157 |
+
'month_type' => $month_type,
|
158 |
+
'month_font_size' => $month_font_size,
|
159 |
+
'text_color_month' => $text_color_month,
|
160 |
+
'arrow_color_month' => $arrow_color_month,
|
161 |
+
'next_month_text_color' => $next_month_text_color,
|
162 |
+
'next_month_font_size' => $next_month_font_size,
|
163 |
+
'next_month_arrow_color' => $next_month_arrow_color,
|
164 |
+
'prev_month_text_color' => $prev_month_text_color,
|
165 |
+
'prev_month_font_size' => $prev_month_font_size,
|
166 |
+
'prev_month_arrow_color' => $prev_month_arrow_color,
|
167 |
+
'arrow_size' => $arrow_size,
|
168 |
+
'text_color_week_days' => $text_color_week_days,
|
169 |
+
'week_days_cell_height' => $week_days_cell_height,
|
170 |
+
'weekdays_bg_color' => $weekdays_bg_color,
|
171 |
+
'weekday_sunday_bg_color' => $weekday_sunday_bg_color,
|
172 |
+
'weekdays_font_size' => $weekdays_font_size,
|
173 |
+
'bg_bottom' => $bg_bottom,
|
174 |
+
'cell_height' => $cell_height,
|
175 |
+
'text_color_other_months' => $text_color_other_months,
|
176 |
+
'bg_color_other_months' => $bg_color_other_months,
|
177 |
+
'text_color_this_month_unevented' => $text_color_this_month_unevented,
|
178 |
+
'text_color_this_month_evented' => $text_color_this_month_evented,
|
179 |
+
'bg_color_this_month_evented' => $bg_color_this_month_evented,
|
180 |
+
'event_title_color' => $event_title_color,
|
181 |
+
'current_day_border_color' => $current_day_border_color,
|
182 |
+
'cell_border_color' => $cell_border_color,
|
183 |
+
'text_color_sun_days' => $text_color_sun_days,
|
184 |
+
'sundays_bg_color' => $sundays_bg_color,
|
185 |
+
'sundays_font_size' => $sundays_font_size,
|
186 |
+
'other_days_font_size' => $other_days_font_size,
|
187 |
+
'show_time' => $show_time,
|
188 |
+
'date_format' => $date_format,
|
189 |
+
'title_color' => $title_color,
|
190 |
+
'title_font_size' => $title_font_size,
|
191 |
+
'title_font' => $title_font,
|
192 |
+
'title_style' => $title_style,
|
193 |
+
'date_color' => $date_color,
|
194 |
+
'date_size' => $date_size,
|
195 |
+
'date_font' => $date_font,
|
196 |
+
'date_style' => $date_style,
|
197 |
+
'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
|
198 |
+
'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
|
199 |
+
'show_event_bgcolor' => $show_event_bgcolor,
|
200 |
+
'popup_width' => $popup_width,
|
201 |
+
'popup_height' => $popup_height,
|
202 |
+
'number_of_shown_evetns' => $number_of_shown_evetns,
|
203 |
+
'show_repeat' => $show_repeat,
|
204 |
+
'day_start' => $show_event,
|
205 |
+
'views_tabs_font_size' => $views_tabs_font_size,
|
206 |
+
'views_tabs_text_color' => $views_tabs_text_color,
|
207 |
+
'views_tabs_bg_color' => $views_tabs_bg_color,
|
208 |
+
'day_month_font_color' => $day_month_font_color,
|
209 |
+
'week_font_color' => $week_font_color,
|
210 |
+
'day_month_font_size' => $day_month_font_size,
|
211 |
+
'week_font_size' => $week_font_size,
|
212 |
+
'ev_title_bg_color' => $ev_title_bg_color,
|
213 |
+
'date_height' => $date_height,
|
214 |
+
'event_table_height' => $event_table_height,
|
215 |
+
'event_num_font_size' => $event_num_font_size,
|
216 |
+
'date_font_size' => $date_font_size,
|
217 |
+
'event_num_color' => $event_num_color,
|
218 |
+
'event_num_bg_color2' => $event_num_bg_color2,
|
219 |
+
'event_num_bg_color1' => $event_num_bg_color1,
|
220 |
+
'event_bg_color2' => $event_bg_color2,
|
221 |
+
'event_bg_color1' => $event_bg_color1,
|
222 |
+
'date_bg_color' => $date_bg_color,
|
223 |
+
'day_start' => $show_event,
|
224 |
+
), array(
|
225 |
+
'%d',
|
226 |
+
'%s',
|
227 |
+
'%s',
|
228 |
+
'%s',
|
229 |
+
'%s',
|
230 |
+
'%s',
|
231 |
+
'%s',
|
232 |
+
'%s',
|
233 |
+
'%s',
|
234 |
+
'%s',
|
235 |
+
'%s',
|
236 |
+
'%s',
|
237 |
+
'%s',
|
238 |
+
'%s',
|
239 |
+
'%s',
|
240 |
+
'%s',
|
241 |
+
'%s',
|
242 |
+
'%s',
|
243 |
+
'%s',
|
244 |
+
'%s',
|
245 |
+
'%s',
|
246 |
+
'%s',
|
247 |
+
'%s',
|
248 |
+
'%s',
|
249 |
+
'%s',
|
250 |
+
'%s',
|
251 |
+
'%s',
|
252 |
+
'%s',
|
253 |
+
'%s',
|
254 |
+
'%s',
|
255 |
+
'%s',
|
256 |
+
'%s',
|
257 |
+
'%s',
|
258 |
+
'%s',
|
259 |
+
'%s',
|
260 |
+
'%s',
|
261 |
+
'%s',
|
262 |
+
'%s',
|
263 |
+
'%s',
|
264 |
+
'%s',
|
265 |
+
'%s',
|
266 |
+
'%s',
|
267 |
+
'%s',
|
268 |
+
'%s',
|
269 |
+
'%s',
|
270 |
+
'%s',
|
271 |
+
'%s',
|
272 |
+
'%s',
|
273 |
+
'%s',
|
274 |
+
'%s',
|
275 |
+
'%s',
|
276 |
+
'%s',
|
277 |
+
'%s',
|
278 |
+
'%s',
|
279 |
+
'%s',
|
280 |
+
'%s',
|
281 |
+
'%s',
|
282 |
+
'%d',
|
283 |
+
'%d',
|
284 |
+
'%s',
|
285 |
+
'%s',
|
286 |
+
'%s',
|
287 |
+
'%s',
|
288 |
+
'%s',
|
289 |
+
'%s',
|
290 |
+
'%s',
|
291 |
+
'%s',
|
292 |
+
'%s',
|
293 |
+
'%s',
|
294 |
+
'%s',
|
295 |
+
'%s',
|
296 |
+
'%s',
|
297 |
+
'%s',
|
298 |
+
'%s',
|
299 |
+
'%s',
|
300 |
+
'%s',
|
301 |
+
'%s',
|
302 |
+
'%s',
|
303 |
+
'%d'
|
304 |
+
));
|
305 |
+
}
|
306 |
+
else {
|
307 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_theme', array(
|
308 |
+
'title' => $title,
|
309 |
+
'width' => $width,
|
310 |
+
'week_start_day' => $week_start_day,
|
311 |
+
'border_color' => $border_color,
|
312 |
+
'border_radius' => $border_radius,
|
313 |
+
'border_width' => $border_width,
|
314 |
+
'top_height' => $top_height,
|
315 |
+
'bg_top' => $bg_top,
|
316 |
+
'year_font_size' => $year_font_size,
|
317 |
+
'text_color_year' => $text_color_year,
|
318 |
+
'arrow_color_year' => $arrow_color_year,
|
319 |
+
'month_type' => $month_type,
|
320 |
+
'month_font_size' => $month_font_size,
|
321 |
+
'text_color_month' => $text_color_month,
|
322 |
+
'arrow_color_month' => $arrow_color_month,
|
323 |
+
'next_month_text_color' => $next_month_text_color,
|
324 |
+
'next_month_font_size' => $next_month_font_size,
|
325 |
+
'next_month_arrow_color' => $next_month_arrow_color,
|
326 |
+
'prev_month_text_color' => $prev_month_text_color,
|
327 |
+
'prev_month_font_size' => $prev_month_font_size,
|
328 |
+
'prev_month_arrow_color' => $prev_month_arrow_color,
|
329 |
+
'arrow_size' => $arrow_size,
|
330 |
+
'text_color_week_days' => $text_color_week_days,
|
331 |
+
'week_days_cell_height' => $week_days_cell_height,
|
332 |
+
'weekdays_bg_color' => $weekdays_bg_color,
|
333 |
+
'weekday_sunday_bg_color' => $weekday_sunday_bg_color,
|
334 |
+
'weekdays_font_size' => $weekdays_font_size,
|
335 |
+
'bg_bottom' => $bg_bottom,
|
336 |
+
'cell_height' => $cell_height,
|
337 |
+
'text_color_other_months' => $text_color_other_months,
|
338 |
+
'bg_color_other_months' => $bg_color_other_months,
|
339 |
+
'text_color_this_month_unevented' => $text_color_this_month_unevented,
|
340 |
+
'text_color_this_month_evented' => $text_color_this_month_evented,
|
341 |
+
'bg_color_this_month_evented' => $bg_color_this_month_evented,
|
342 |
+
'event_title_color' => $event_title_color,
|
343 |
+
'current_day_border_color' => $current_day_border_color,
|
344 |
+
'cell_border_color' => $cell_border_color,
|
345 |
+
'text_color_sun_days' => $text_color_sun_days,
|
346 |
+
'sundays_bg_color' => $sundays_bg_color,
|
347 |
+
'sundays_font_size' => $sundays_font_size,
|
348 |
+
'other_days_font_size' => $other_days_font_size,
|
349 |
+
'show_time' => $show_time,
|
350 |
+
'date_format' => $date_format,
|
351 |
+
'title_color' => $title_color,
|
352 |
+
'title_font_size' => $title_font_size,
|
353 |
+
'title_font' => $title_font,
|
354 |
+
'title_style' => $title_style,
|
355 |
+
'date_color' => $date_color,
|
356 |
+
'date_size' => $date_size,
|
357 |
+
'date_font' => $date_font,
|
358 |
+
'date_style' => $date_style,
|
359 |
+
'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
|
360 |
+
'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
|
361 |
+
'show_event_bgcolor' => $show_event_bgcolor,
|
362 |
+
'popup_width' => $popup_width,
|
363 |
+
'popup_height' => $popup_height,
|
364 |
+
'number_of_shown_evetns' => $number_of_shown_evetns,
|
365 |
+
'show_repeat' => $show_repeat,
|
366 |
+
'day_start' => $show_event,
|
367 |
+
'views_tabs_font_size' => $views_tabs_font_size,
|
368 |
+
'views_tabs_text_color' => $views_tabs_text_color,
|
369 |
+
'views_tabs_bg_color' => $views_tabs_bg_color,
|
370 |
+
'day_month_font_color' => $day_month_font_color,
|
371 |
+
'week_font_color' => $week_font_color,
|
372 |
+
'day_month_font_size' => $day_month_font_size,
|
373 |
+
'week_font_size' => $week_font_size,
|
374 |
+
'ev_title_bg_color' => $ev_title_bg_color,
|
375 |
+
'date_height' => $date_height,
|
376 |
+
'event_table_height' => $event_table_height,
|
377 |
+
'event_num_font_size' => $event_num_font_size,
|
378 |
+
'date_font_size' => $date_font_size,
|
379 |
+
'event_num_color' => $event_num_color,
|
380 |
+
'event_num_bg_color2' => $event_num_bg_color2,
|
381 |
+
'event_num_bg_color1' => $event_num_bg_color1,
|
382 |
+
'event_bg_color2' => $event_bg_color2,
|
383 |
+
'event_bg_color1' => $event_bg_color1,
|
384 |
+
'date_bg_color' => $date_bg_color,
|
385 |
+
'day_start' => $show_event,
|
386 |
+
), array('id' => $id), array(
|
387 |
+
'%s',
|
388 |
+
'%s',
|
389 |
+
'%s',
|
390 |
+
'%s',
|
391 |
+
'%s',
|
392 |
+
'%s',
|
393 |
+
'%s',
|
394 |
+
'%s',
|
395 |
+
'%s',
|
396 |
+
'%s',
|
397 |
+
'%s',
|
398 |
+
'%s',
|
399 |
+
'%s',
|
400 |
+
'%s',
|
401 |
+
'%s',
|
402 |
+
'%s',
|
403 |
+
'%s',
|
404 |
+
'%s',
|
405 |
+
'%s',
|
406 |
+
'%s',
|
407 |
+
'%s',
|
408 |
+
'%s',
|
409 |
+
'%s',
|
410 |
+
'%s',
|
411 |
+
'%s',
|
412 |
+
'%s',
|
413 |
+
'%s',
|
414 |
+
'%s',
|
415 |
+
'%s',
|
416 |
+
'%s',
|
417 |
+
'%s',
|
418 |
+
'%s',
|
419 |
+
'%s',
|
420 |
+
'%s',
|
421 |
+
'%s',
|
422 |
+
'%s',
|
423 |
+
'%s',
|
424 |
+
'%s',
|
425 |
+
'%s',
|
426 |
+
'%s',
|
427 |
+
'%s',
|
428 |
+
'%s',
|
429 |
+
'%s',
|
430 |
+
'%s',
|
431 |
+
'%s',
|
432 |
+
'%s',
|
433 |
+
'%s',
|
434 |
+
'%s',
|
435 |
+
'%s',
|
436 |
+
'%s',
|
437 |
+
'%s',
|
438 |
+
'%s',
|
439 |
+
'%s',
|
440 |
+
'%s',
|
441 |
+
'%s',
|
442 |
+
'%s',
|
443 |
+
'%d',
|
444 |
+
'%d',
|
445 |
+
'%s',
|
446 |
+
'%s',
|
447 |
+
'%s',
|
448 |
+
'%s',
|
449 |
+
'%s',
|
450 |
+
'%s',
|
451 |
+
'%s',
|
452 |
+
'%s',
|
453 |
+
'%s',
|
454 |
+
'%s',
|
455 |
+
'%s',
|
456 |
+
'%s',
|
457 |
+
'%s',
|
458 |
+
'%s',
|
459 |
+
'%s',
|
460 |
+
'%s',
|
461 |
+
'%s',
|
462 |
+
'%s',
|
463 |
+
'%s',
|
464 |
+
'%d',
|
465 |
+
), array('%d'));
|
466 |
+
}
|
467 |
+
if ($save_or_no === FALSE) {
|
468 |
+
?>
|
469 |
+
<div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
|
470 |
+
<?php
|
471 |
+
return FALSE;
|
472 |
+
}
|
473 |
+
else {
|
474 |
+
?>
|
475 |
+
<div class="updated"><p><strong>Theme Saved.</strong></p></div>
|
476 |
+
<?php
|
477 |
+
return TRUE;
|
478 |
+
}
|
479 |
+
}
|
480 |
+
|
481 |
+
function edit_theme_calendar($id) {
|
482 |
+
global $wpdb;
|
483 |
+
if ($id == 0) {
|
484 |
+
$row = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=1');
|
485 |
+
}
|
486 |
+
else {
|
487 |
+
$row = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=' . $id);
|
488 |
+
}
|
489 |
+
html_edit_theme_calendar($row, $id);
|
490 |
+
}
|
491 |
+
|
492 |
+
function remove_theme_calendar($id) {
|
493 |
+
if ($id > 0 && $id < 18) {
|
494 |
+
?>
|
495 |
+
<div id="message" class="error"><p>You can't delete deafult theme.</p></div>
|
496 |
+
<?php
|
497 |
+
return FALSE;
|
498 |
+
}
|
499 |
+
global $wpdb;
|
500 |
+
$sql_remove_tag = "DELETE FROM " . $wpdb->prefix . "spidercalendar_theme WHERE id='" . $id . "'";
|
501 |
+
if (!$wpdb->query($sql_remove_tag)) {
|
502 |
+
?>
|
503 |
+
<div id="message" class="error"><p>Spider Calendar Theme Not Deleted</p></div>
|
504 |
+
<?php
|
505 |
+
}
|
506 |
+
else {
|
507 |
+
?>
|
508 |
+
<div class="updated"><p><strong>Item Deleted.</strong></p></div>
|
509 |
+
<?php
|
510 |
+
}
|
511 |
+
}
|
512 |
+
|
513 |
+
?>
|
calendar.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Spider Event Calendar
|
5 |
Plugin URI: http://web-dorado.com/products/wordpress-calendar.html
|
6 |
Description: Spider Event Calendar is a highly configurable product which allows you to have multiple organized events. Spider Event Calendar is an extraordinary user friendly extension.
|
7 |
-
Version: 1.
|
8 |
Author: http://web-dorado.com/
|
9 |
License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*/
|
@@ -15,9 +15,20 @@ function sp_calendar_language_load() {
|
|
15 |
}
|
16 |
add_action('init', 'sp_calendar_language_load');
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
// Include widget.
|
19 |
require_once("widget_spider_calendar.php");
|
20 |
-
|
21 |
function current_page_url_sc() {
|
22 |
if (is_home()) {
|
23 |
$pageURL = site_url();
|
@@ -68,13 +79,29 @@ function spider_calendar_big_front_end($id, $theme, $default, $select, $widget =
|
|
68 |
require_once("front_end/frontend_functions.php");
|
69 |
ob_start();
|
70 |
global $many_sp_calendar;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
?>
|
|
|
|
|
72 |
<div id='bigcalendar<?php echo $many_sp_calendar ?>'></div>
|
73 |
<script>
|
|
|
74 |
var tb_pathToImage = "<?php echo plugins_url('images/loadingAnimation.gif', __FILE__) ?>";
|
75 |
var tb_closeImage = "<?php echo plugins_url('images/tb-close.png', __FILE__) ?>"
|
|
|
76 |
if (typeof showbigcalendar != 'function') {
|
77 |
-
|
|
|
|
|
78 |
var xmlHttp;
|
79 |
try {
|
80 |
xmlHttp = new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
|
@@ -95,22 +122,88 @@ function spider_calendar_big_front_end($id, $theme, $default, $select, $widget =
|
|
95 |
}
|
96 |
xmlHttp.onreadystatechange = function () {
|
97 |
if (xmlHttp.readyState == 4) {
|
98 |
-
document.getElementById(id).innerHTML = xmlHttp.responseText;
|
99 |
jQuery('#' + id).html(xmlHttp.responseText);
|
100 |
}
|
101 |
}
|
102 |
xmlHttp.open("GET", calendarlink, false);
|
103 |
xmlHttp.send();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
var thickDims, tbWidth, tbHeight;
|
105 |
jQuery(document).ready(function ($) {
|
106 |
thickDims = function () {
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
if (tbWidth) {
|
109 |
if (tbWidth < (W - 90)) w = tbWidth; else w = W - 200;
|
110 |
} else w = W - 200;
|
111 |
if (tbHeight) {
|
112 |
if (tbHeight < (H - 90)) h = tbHeight; else h = H - 200;
|
113 |
} else h = H - 200;
|
|
|
114 |
if (tbWindow.size()) {
|
115 |
tbWindow.width(w).height(h);
|
116 |
$('#TB_iframeContent').width(w).height(h - 27);
|
@@ -118,19 +211,79 @@ function spider_calendar_big_front_end($id, $theme, $default, $select, $widget =
|
|
118 |
if (typeof document.body.style.maxWidth != 'undefined')
|
119 |
tbWindow.css({'top':(H - h) / 2, 'margin-top':'0'});
|
120 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
};
|
|
|
|
|
122 |
thickDims();
|
123 |
$(window).resize(function () {
|
124 |
-
thickDims()
|
125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
$('a.thickbox-preview' + id).click(function () {
|
127 |
tb_click.call(this);
|
128 |
var alink = jQuery(this).parents('.available-theme').find('.activatelink'), link = '', href = jQuery(this).attr('href'), url, text;
|
129 |
var reg_with = new RegExp(xx_cal_xx + "tbWidth=[0-9]+");
|
|
|
130 |
if (tbWidth = href.match(reg_with))
|
131 |
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
132 |
else
|
133 |
tbWidth = jQuery(window).width() - 90;
|
|
|
|
|
134 |
var reg_heght = new RegExp(xx_cal_xx + "tbHeight=[0-9]+");
|
135 |
if (tbHeight = href.match(reg_heght))
|
136 |
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
@@ -139,19 +292,30 @@ function spider_calendar_big_front_end($id, $theme, $default, $select, $widget =
|
|
139 |
jQuery('#TB_title').css({'background-color':'#222', 'color':'#dfdfdf'});
|
140 |
jQuery('#TB_closeAjaxWindow').css({'float':'left'});
|
141 |
jQuery('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
|
|
142 |
jQuery('#TB_iframeContent').width('100%');
|
143 |
thickDims();
|
|
|
144 |
return false;
|
|
|
145 |
});
|
|
|
146 |
});
|
|
|
|
|
|
|
147 |
}
|
|
|
148 |
}
|
|
|
149 |
document.onkeydown = function (evt) {
|
150 |
evt = evt || window.event;
|
151 |
if (evt.keyCode == 27) {
|
152 |
document.getElementById('sbox-window').close();
|
153 |
}
|
154 |
};
|
|
|
|
|
155 |
<?php global $wpdb;
|
156 |
$calendarr = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='%d'", $id));
|
157 |
$year = ($calendarr->def_year ? $calendarr->def_year : date("Y"));
|
@@ -203,8 +367,15 @@ function spider_calendar_big_front_end($id, $theme, $default, $select, $widget =
|
|
203 |
'many_sp_calendar' => $many_sp_calendar,
|
204 |
'cur_page_url' => urlencode(current_page_url_sc()),
|
205 |
'widget' => $widget,
|
206 |
-
|
|
|
|
|
207 |
</script>
|
|
|
|
|
|
|
|
|
|
|
208 |
<?php
|
209 |
$many_sp_calendar++;
|
210 |
$calendar = ob_get_contents();
|
@@ -215,6 +386,7 @@ function spider_calendar_big_front_end($id, $theme, $default, $select, $widget =
|
|
215 |
// Quick edit.
|
216 |
add_action('wp_ajax_spidercalendarinlineedit', 'spider_calendar_quick_edit');
|
217 |
add_action('wp_ajax_spidercalendarinlineupdate', 'spider_calendar_quick_update');
|
|
|
218 |
function spider_calendar_quick_update() {
|
219 |
$current_user = wp_get_current_user();
|
220 |
if ($current_user->roles[0] !== 'administrator') {
|
@@ -360,11 +532,16 @@ function sp_calendar_register($plugin_array) {
|
|
360 |
function sp_calendar_options_panel() {
|
361 |
add_menu_page('Theme page title', 'Calendar', 'manage_options', 'SpiderCalendar', 'Manage_Spider_Calendar', plugins_url("images/calendar_menu.png", __FILE__));
|
362 |
$page_calendar = add_submenu_page('SpiderCalendar', 'Calendars', 'Calendars', 'manage_options', 'SpiderCalendar', 'Manage_Spider_Calendar');
|
|
|
363 |
$page_theme = add_submenu_page('SpiderCalendar', 'Calendar Parameters', 'Calendar Themes', 'manage_options', 'spider_calendar_themes', 'spider_calendar_params');
|
364 |
$page_widget_theme = add_submenu_page('SpiderCalendar', 'Calendar Parameters', 'Widget Themes', 'manage_options', 'spider_widget_calendar_themes', 'spider_widget_calendar_params');
|
|
|
|
|
365 |
add_submenu_page('SpiderCalendar', 'Licensing', 'Licensing', 'manage_options', 'Spider_calendar_Licensing', 'Spider_calendar_Licensing');
|
366 |
add_submenu_page('SpiderCalendar', 'Uninstall Spider Event Calendar', 'Uninstall Spider Event Calendar', 'manage_options', 'Uninstall_sp_calendar', 'Uninstall_sp_calendar'); // uninstall Calendar
|
|
|
367 |
add_action('admin_print_styles-' . $page_theme, 'spider_calendar_themes_admin_styles_scripts');
|
|
|
368 |
add_action('admin_print_styles-' . $page_calendar, 'spider_calendar_admin_styles_scripts');
|
369 |
add_action('admin_print_styles-' . $page_widget_theme, 'spider_widget_calendar_themes_admin_styles_scripts');
|
370 |
}
|
@@ -419,6 +596,14 @@ function spider_calendar_admin_styles_scripts() {
|
|
419 |
wp_enqueue_style("Css", plugins_url("elements/calendar-jos.css", __FILE__), FALSE);
|
420 |
}
|
421 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
add_filter('admin_head', 'spide_ShowTinyMCE');
|
423 |
function spide_ShowTinyMCE() {
|
424 |
// conditions here
|
@@ -429,9 +614,11 @@ function spide_ShowTinyMCE() {
|
|
429 |
add_thickbox();
|
430 |
}
|
431 |
wp_print_scripts('media-upload');
|
|
|
432 |
if (function_exists('wp_tiny_mce')) {
|
433 |
wp_tiny_mce();
|
434 |
}
|
|
|
435 |
wp_admin_css();
|
436 |
wp_enqueue_script('utils');
|
437 |
do_action("admin_print_styles-post-php");
|
@@ -584,7 +771,7 @@ function Manage_Spider_Calendar() {
|
|
584 |
show_spider_event($calendar_id);
|
585 |
break;
|
586 |
case 'published_event';
|
587 |
-
published_spider_event($id);
|
588 |
show_spider_event($calendar_id);
|
589 |
break;
|
590 |
default:
|
@@ -593,6 +780,87 @@ function Manage_Spider_Calendar() {
|
|
593 |
}
|
594 |
}
|
595 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
596 |
function spider_widget_calendar_params() {
|
597 |
wp_enqueue_script('media-upload');
|
598 |
wp_admin_css('thickbox');
|
@@ -646,26 +914,33 @@ function Uninstall_sp_calendar() {
|
|
646 |
$base_name = plugin_basename('Spider_Calendar');
|
647 |
$base_page = 'admin.php?page=' . $base_name;
|
648 |
$mode = (isset($_GET['mode']) ? trim($_GET['mode']) : '');
|
|
|
649 |
if (!empty($_POST['do'])) {
|
650 |
if ($_POST['do'] == "UNINSTALL Spider Event Calendar") {
|
651 |
check_admin_referer('Spider_Calendar uninstall');
|
652 |
-
|
653 |
-
echo '<
|
654 |
echo '<p>';
|
655 |
echo "Table '" . $wpdb->prefix . "spidercalendar_event' has been deleted.";
|
656 |
-
|
657 |
echo '<font style="color:#000;">';
|
658 |
echo '</font><br />';
|
659 |
echo '</p>';
|
|
|
|
|
|
|
|
|
|
|
|
|
660 |
echo '<p>';
|
661 |
echo "Table '" . $wpdb->prefix . "spidercalendar_calendar' has been deleted.";
|
662 |
-
|
663 |
echo '<font style="color:#000;">';
|
664 |
echo '</font><br />';
|
665 |
echo '</p>';
|
666 |
-
|
667 |
echo "Table '" . $wpdb->prefix . "spidercalendar_theme' has been deleted.";
|
668 |
-
|
669 |
echo '<font style="color:#000;">';
|
670 |
echo '</font><br />';
|
671 |
echo '</p>';
|
@@ -675,9 +950,9 @@ function Uninstall_sp_calendar() {
|
|
675 |
echo '<font style="color:#000;">';
|
676 |
echo '</font><br />';
|
677 |
echo '</p>';
|
678 |
-
echo '</
|
679 |
$mode = 'end-UNINSTALL';
|
680 |
-
|
681 |
}
|
682 |
}
|
683 |
switch ($mode) {
|
@@ -688,10 +963,10 @@ function Uninstall_sp_calendar() {
|
|
688 |
echo '<p><strong>' . sprintf('<a href="%s">Click Here</a> To Finish The Uninstallation And Spider Event Calendar Will Be Deactivated Automatically.', $deactivate_url) . '</strong></p>';
|
689 |
echo '</div>';
|
690 |
break;
|
691 |
-
// Main Page
|
692 |
default:
|
693 |
?>
|
694 |
-
<form method="post" action="<?php echo admin_url('admin.php?page=Uninstall_sp_calendar'); ?>">
|
695 |
<?php wp_nonce_field('Spider_Calendar uninstall'); ?>
|
696 |
<div class="wrap">
|
697 |
<div id="icon-Spider_Calendar" class="icon32"><br/></div>
|
@@ -721,20 +996,37 @@ function Uninstall_sp_calendar() {
|
|
721 |
<ol>
|
722 |
<?php
|
723 |
echo '<li>' . $wpdb->prefix . 'spidercalendar_event</li>' . "\n";
|
|
|
724 |
echo '<li>' . $wpdb->prefix . 'spidercalendar_calendar</li>' . "\n";
|
725 |
-
|
726 |
echo '<li>' . $wpdb->prefix . 'spidercalendar_widget_theme</li>' . "\n";
|
727 |
?>
|
728 |
</ol>
|
729 |
</td>
|
730 |
</tr>
|
731 |
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
732 |
<p style="text-align: center;">
|
733 |
<?php echo 'Do you really want to uninstall Spider Event Calendar?'; ?><br/><br/>
|
734 |
-
<input type="checkbox"
|
735 |
-
|
|
|
736 |
class="button-primary"
|
737 |
-
onclick="
|
738 |
</p>
|
739 |
</div>
|
740 |
</form>
|
@@ -742,6 +1034,136 @@ function Uninstall_sp_calendar() {
|
|
742 |
}
|
743 |
}
|
744 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
745 |
// Activate plugin.
|
746 |
function SpiderCalendar_activate() {
|
747 |
global $wpdb;
|
@@ -775,9 +1197,17 @@ function SpiderCalendar_activate() {
|
|
775 |
`published` tinyint(1) NOT NULL,
|
776 |
PRIMARY KEY (`id`)
|
777 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
778 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
779 |
$wpdb->query($spider_event_table);
|
780 |
$wpdb->query($spider_calendar_table);
|
|
|
781 |
require_once "spider_calendar_update.php";
|
782 |
spider_calendar_chech_update();
|
783 |
}
|
@@ -791,5 +1221,4 @@ function spider_calendar_ajax_func() {
|
|
791 |
<?php
|
792 |
}
|
793 |
add_action('admin_head', 'spider_calendar_ajax_func');
|
794 |
-
|
795 |
-
?>
|
4 |
Plugin Name: Spider Event Calendar
|
5 |
Plugin URI: http://web-dorado.com/products/wordpress-calendar.html
|
6 |
Description: Spider Event Calendar is a highly configurable product which allows you to have multiple organized events. Spider Event Calendar is an extraordinary user friendly extension.
|
7 |
+
Version: 1.4
|
8 |
Author: http://web-dorado.com/
|
9 |
License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*/
|
15 |
}
|
16 |
add_action('init', 'sp_calendar_language_load');
|
17 |
|
18 |
+
add_action('init', 'sp_cal_registr_some_scripts');
|
19 |
+
|
20 |
+
function sp_cal_registr_some_scripts(){
|
21 |
+
|
22 |
+
wp_register_script("Canlendar_upcoming", plugins_url("elements/calendar.js", __FILE__));
|
23 |
+
wp_register_script("calendnar-setup_upcoming", plugins_url("elements/calendar-setup.js", __FILE__));
|
24 |
+
wp_register_script("calenndar_function_upcoming", plugins_url("elements/calendar_function.js", __FILE__));
|
25 |
+
|
26 |
+
|
27 |
+
}
|
28 |
+
|
29 |
// Include widget.
|
30 |
require_once("widget_spider_calendar.php");
|
31 |
+
require_once("spidercalendar_upcoming_events_widget.php");
|
32 |
function current_page_url_sc() {
|
33 |
if (is_home()) {
|
34 |
$pageURL = site_url();
|
79 |
require_once("front_end/frontend_functions.php");
|
80 |
ob_start();
|
81 |
global $many_sp_calendar;
|
82 |
+
global $wpdb;
|
83 |
+
|
84 |
+
if ($widget === 1) {
|
85 |
+
$themes = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme));
|
86 |
+
}
|
87 |
+
else{
|
88 |
+
$themes = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme));
|
89 |
+
}
|
90 |
+
$cal_width = $themes->width;
|
91 |
+
|
92 |
?>
|
93 |
+
<input type="hidden" id="cal_width<?php echo $many_sp_calendar ?>" value="<?php echo $cal_width ?>" />
|
94 |
+
|
95 |
<div id='bigcalendar<?php echo $many_sp_calendar ?>'></div>
|
96 |
<script>
|
97 |
+
|
98 |
var tb_pathToImage = "<?php echo plugins_url('images/loadingAnimation.gif', __FILE__) ?>";
|
99 |
var tb_closeImage = "<?php echo plugins_url('images/tb-close.png', __FILE__) ?>"
|
100 |
+
var randi;
|
101 |
if (typeof showbigcalendar != 'function') {
|
102 |
+
|
103 |
+
function showbigcalendar(id, calendarlink, randi,widget) {
|
104 |
+
|
105 |
var xmlHttp;
|
106 |
try {
|
107 |
xmlHttp = new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
|
122 |
}
|
123 |
xmlHttp.onreadystatechange = function () {
|
124 |
if (xmlHttp.readyState == 4) {
|
125 |
+
// document.getElementById(id).innerHTML = xmlHttp.responseText;
|
126 |
jQuery('#' + id).html(xmlHttp.responseText);
|
127 |
}
|
128 |
}
|
129 |
xmlHttp.open("GET", calendarlink, false);
|
130 |
xmlHttp.send();
|
131 |
+
|
132 |
+
|
133 |
+
////////////////////////////////////////////////////////////////////////////
|
134 |
+
jQuery(document).ready(function (){
|
135 |
+
jQuery('#views_select').toggle(function () {
|
136 |
+
|
137 |
+
jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
|
138 |
+
}, function () {
|
139 |
+
|
140 |
+
jQuery('#drop_down_views').stop(true, true).slideUp(500);
|
141 |
+
|
142 |
+
});
|
143 |
+
|
144 |
+
|
145 |
+
});
|
146 |
+
//////////////////////////////////////////////////////////////
|
147 |
+
|
148 |
+
|
149 |
+
if(widget!=1)
|
150 |
+
{
|
151 |
+
if(jQuery(window).width() > 640)
|
152 |
+
{
|
153 |
+
|
154 |
+
jQuery('drop_down_views').hide();
|
155 |
+
var parent_width = document.getElementById('bigcalendar'+randi).parentNode.clientWidth;
|
156 |
+
var calwidth= document.getElementById('cal_width'+randi).value;
|
157 |
+
var responsive_width = (calwidth)/parent_width*100;
|
158 |
+
document.getElementById('afterbig'+randi).setAttribute('style','width:'+responsive_width+'%;');
|
159 |
+
jQuery('pop_table').css('height','100%');
|
160 |
+
|
161 |
+
}
|
162 |
+
|
163 |
+
else if(jQuery(jQuery('#bigcalendar'+randi).parent()).width() > 640)
|
164 |
+
{
|
165 |
+
|
166 |
+
jQuery('drop_down_views').hide();
|
167 |
+
var parent_width = document.getElementById('bigcalendar'+randi).parentNode.clientWidth;
|
168 |
+
var calwidth= document.getElementById('cal_width'+randi).value;
|
169 |
+
var responsive_width = (calwidth)/parent_width*100;
|
170 |
+
document.getElementById('afterbig'+randi).setAttribute('style','width:'+responsive_width+'%;');
|
171 |
+
jQuery('pop_table').css('height','100%');
|
172 |
+
|
173 |
+
}
|
174 |
+
|
175 |
+
else
|
176 |
+
{
|
177 |
+
document.getElementById('afterbig'+randi).setAttribute('style','width:100%;');
|
178 |
+
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
var thickDims, tbWidth, tbHeight;
|
185 |
jQuery(document).ready(function ($) {
|
186 |
thickDims = function () {
|
187 |
+
/* var originH=jQuery('#TB_window').height();
|
188 |
+
var originW=jQuery('#TB_window').width();
|
189 |
+
alert(originW)*/
|
190 |
+
|
191 |
+
jQuery('#TB_window iframe').css('margin-left','0%');
|
192 |
+
jQuery('#TB_window iframe').css('margin-top','0%');
|
193 |
+
jQuery('#TB_window iframe').css('margin-left','0%');
|
194 |
+
jQuery('#TB_window iframe').css('margin-top','0%');
|
195 |
+
|
196 |
+
jQuery('#TB_window iframe').css('padding-left','0%');
|
197 |
+
jQuery('#TB_window iframe').css('padding-top','0%');
|
198 |
+
|
199 |
+
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
200 |
if (tbWidth) {
|
201 |
if (tbWidth < (W - 90)) w = tbWidth; else w = W - 200;
|
202 |
} else w = W - 200;
|
203 |
if (tbHeight) {
|
204 |
if (tbHeight < (H - 90)) h = tbHeight; else h = H - 200;
|
205 |
} else h = H - 200;
|
206 |
+
|
207 |
if (tbWindow.size()) {
|
208 |
tbWindow.width(w).height(h);
|
209 |
$('#TB_iframeContent').width(w).height(h - 27);
|
211 |
if (typeof document.body.style.maxWidth != 'undefined')
|
212 |
tbWindow.css({'top':(H - h) / 2, 'margin-top':'0'});
|
213 |
}
|
214 |
+
|
215 |
+
if(jQuery(window).width() < 640 ){
|
216 |
+
var tb_left = parseInt((w / 2), 10) + 20;
|
217 |
+
jQuery('#TB_window').css('left', tb_left + 'px')
|
218 |
+
jQuery('#TB_window').css('width','90%');
|
219 |
+
jQuery('#TB_window').css('margin-top','-13%');
|
220 |
+
jQuery('#TB_window iframe').css('height','100%');
|
221 |
+
jQuery('#TB_window iframe').css('width','100%');
|
222 |
+
}
|
223 |
+
|
224 |
+
|
225 |
+
|
226 |
+
|
227 |
+
if(jQuery(window).width() > 640 )
|
228 |
+
{
|
229 |
+
jQuery('#TB_window').css('left','50%');
|
230 |
+
}
|
231 |
+
|
232 |
+
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
|
237 |
+
if (typeof popup_width_from_src != "undefined") {
|
238 |
+
popup_width_from_src=jQuery('.thickbox-previewbigcalendar'+randi).attr('href').indexOf('tbWidth=');
|
239 |
+
str=jQuery('.thickbox-previewbigcalendar'+randi).attr('href').substr(popup_width_from_src+8,150)
|
240 |
+
find_amp=str.indexOf('&');
|
241 |
+
width_orig=str.substr(0,find_amp);
|
242 |
+
|
243 |
+
find_eq=str.indexOf('=');
|
244 |
+
height_orig=str.substr(find_eq+1,5);
|
245 |
+
|
246 |
+
jQuery('#TB_window').css('max-width',width_orig+'px');
|
247 |
+
jQuery('#TB_window iframe').css('max-width',width_orig+'px');
|
248 |
+
jQuery('#TB_window').css('max-height',height_orig+'px');
|
249 |
+
}
|
250 |
+
|
251 |
+
jQuery('#TB_window').css('background','none');
|
252 |
+
jQuery('#TB_window').css('background-color','none');
|
253 |
+
jQuery('#TB_window iframe').css('background-color','none');
|
254 |
+
|
255 |
};
|
256 |
+
|
257 |
+
|
258 |
thickDims();
|
259 |
$(window).resize(function () {
|
260 |
+
thickDims();
|
261 |
+
|
262 |
+
if(jQuery(window).width() < 640 ){
|
263 |
+
jQuery('#TB_window').css('width','90%');
|
264 |
+
jQuery('#TB_window').css('margin-top','-13%');
|
265 |
+
jQuery('#TB_window iframe').css('height','100%');
|
266 |
+
jQuery('#TB_window').css('height','100%');
|
267 |
+
}
|
268 |
+
|
269 |
+
|
270 |
+
if(jQuery(window).width() > 900 )
|
271 |
+
{
|
272 |
+
jQuery('#TB_window').css('left','50%');
|
273 |
+
}
|
274 |
+
});
|
275 |
+
|
276 |
$('a.thickbox-preview' + id).click(function () {
|
277 |
tb_click.call(this);
|
278 |
var alink = jQuery(this).parents('.available-theme').find('.activatelink'), link = '', href = jQuery(this).attr('href'), url, text;
|
279 |
var reg_with = new RegExp(xx_cal_xx + "tbWidth=[0-9]+");
|
280 |
+
|
281 |
if (tbWidth = href.match(reg_with))
|
282 |
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
283 |
else
|
284 |
tbWidth = jQuery(window).width() - 90;
|
285 |
+
|
286 |
+
|
287 |
var reg_heght = new RegExp(xx_cal_xx + "tbHeight=[0-9]+");
|
288 |
if (tbHeight = href.match(reg_heght))
|
289 |
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
292 |
jQuery('#TB_title').css({'background-color':'#222', 'color':'#dfdfdf'});
|
293 |
jQuery('#TB_closeAjaxWindow').css({'float':'left'});
|
294 |
jQuery('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
295 |
+
|
296 |
jQuery('#TB_iframeContent').width('100%');
|
297 |
thickDims();
|
298 |
+
|
299 |
return false;
|
300 |
+
|
301 |
});
|
302 |
+
|
303 |
});
|
304 |
+
|
305 |
+
|
306 |
+
|
307 |
}
|
308 |
+
|
309 |
}
|
310 |
+
|
311 |
document.onkeydown = function (evt) {
|
312 |
evt = evt || window.event;
|
313 |
if (evt.keyCode == 27) {
|
314 |
document.getElementById('sbox-window').close();
|
315 |
}
|
316 |
};
|
317 |
+
|
318 |
+
|
319 |
<?php global $wpdb;
|
320 |
$calendarr = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='%d'", $id));
|
321 |
$year = ($calendarr->def_year ? $calendarr->def_year : date("Y"));
|
367 |
'many_sp_calendar' => $many_sp_calendar,
|
368 |
'cur_page_url' => urlencode(current_page_url_sc()),
|
369 |
'widget' => $widget,
|
370 |
+
'rand' => $many_sp_calendar,
|
371 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>');
|
372 |
+
|
373 |
</script>
|
374 |
+
<style>
|
375 |
+
#TB_iframeContent{
|
376 |
+
height: 100% !important;
|
377 |
+
}
|
378 |
+
</style>
|
379 |
<?php
|
380 |
$many_sp_calendar++;
|
381 |
$calendar = ob_get_contents();
|
386 |
// Quick edit.
|
387 |
add_action('wp_ajax_spidercalendarinlineedit', 'spider_calendar_quick_edit');
|
388 |
add_action('wp_ajax_spidercalendarinlineupdate', 'spider_calendar_quick_update');
|
389 |
+
add_action('wp_ajax_upcoming', 'upcoming_widget');
|
390 |
function spider_calendar_quick_update() {
|
391 |
$current_user = wp_get_current_user();
|
392 |
if ($current_user->roles[0] !== 'administrator') {
|
532 |
function sp_calendar_options_panel() {
|
533 |
add_menu_page('Theme page title', 'Calendar', 'manage_options', 'SpiderCalendar', 'Manage_Spider_Calendar', plugins_url("images/calendar_menu.png", __FILE__));
|
534 |
$page_calendar = add_submenu_page('SpiderCalendar', 'Calendars', 'Calendars', 'manage_options', 'SpiderCalendar', 'Manage_Spider_Calendar');
|
535 |
+
$page_event_category = add_submenu_page('SpiderCalendar', 'Event Category', 'Event Category', 'manage_options', 'spider_calendar_event_category', 'Manage_Spider_Category_Calendar');
|
536 |
$page_theme = add_submenu_page('SpiderCalendar', 'Calendar Parameters', 'Calendar Themes', 'manage_options', 'spider_calendar_themes', 'spider_calendar_params');
|
537 |
$page_widget_theme = add_submenu_page('SpiderCalendar', 'Calendar Parameters', 'Widget Themes', 'manage_options', 'spider_widget_calendar_themes', 'spider_widget_calendar_params');
|
538 |
+
$Featured_Plugins = add_submenu_page('SpiderCalendar', 'Featured Plugins', 'Featured Plugins', 'manage_options', 'calendar_Featured_Plugins', 'calendar_Featured_Plugins');
|
539 |
+
|
540 |
add_submenu_page('SpiderCalendar', 'Licensing', 'Licensing', 'manage_options', 'Spider_calendar_Licensing', 'Spider_calendar_Licensing');
|
541 |
add_submenu_page('SpiderCalendar', 'Uninstall Spider Event Calendar', 'Uninstall Spider Event Calendar', 'manage_options', 'Uninstall_sp_calendar', 'Uninstall_sp_calendar'); // uninstall Calendar
|
542 |
+
add_action('admin_print_styles-' . $Featured_Plugins, 'calendar_Featured_Plugins_styles');
|
543 |
add_action('admin_print_styles-' . $page_theme, 'spider_calendar_themes_admin_styles_scripts');
|
544 |
+
add_action('admin_print_styles-' . $page_event_category, 'spider_calendar_event_category_admin_styles_scripts');
|
545 |
add_action('admin_print_styles-' . $page_calendar, 'spider_calendar_admin_styles_scripts');
|
546 |
add_action('admin_print_styles-' . $page_widget_theme, 'spider_widget_calendar_themes_admin_styles_scripts');
|
547 |
}
|
596 |
wp_enqueue_style("Css", plugins_url("elements/calendar-jos.css", __FILE__), FALSE);
|
597 |
}
|
598 |
|
599 |
+
function spider_calendar_event_category_admin_styles_scripts(){
|
600 |
+
wp_enqueue_script("Calendar", plugins_url("elements/calendar.js", __FILE__), FALSE);
|
601 |
+
wp_enqueue_script("calendar-setup", plugins_url("elements/calendar-setup.js", __FILE__), FALSE);
|
602 |
+
wp_enqueue_script("calendar_function", plugins_url("elements/calendar_function.js", __FILE__), FALSE);
|
603 |
+
wp_enqueue_style("Css", plugins_url("elements/calendar-jos.css", __FILE__), FALSE);
|
604 |
+
wp_enqueue_script("colcor_js", plugins_url('jscolor/jscolor.js', __FILE__));
|
605 |
+
}
|
606 |
+
|
607 |
add_filter('admin_head', 'spide_ShowTinyMCE');
|
608 |
function spide_ShowTinyMCE() {
|
609 |
// conditions here
|
614 |
add_thickbox();
|
615 |
}
|
616 |
wp_print_scripts('media-upload');
|
617 |
+
if(version_compare(get_bloginfo('version'),3.3)<0){
|
618 |
if (function_exists('wp_tiny_mce')) {
|
619 |
wp_tiny_mce();
|
620 |
}
|
621 |
+
}
|
622 |
wp_admin_css();
|
623 |
wp_enqueue_script('utils');
|
624 |
do_action("admin_print_styles-post-php");
|
771 |
show_spider_event($calendar_id);
|
772 |
break;
|
773 |
case 'published_event';
|
774 |
+
published_spider_event($calendar_id, $id);
|
775 |
show_spider_event($calendar_id);
|
776 |
break;
|
777 |
default:
|
780 |
}
|
781 |
}
|
782 |
|
783 |
+
function Manage_Spider_Category_Calendar(){
|
784 |
+
require_once("calendar_functions.html.php");
|
785 |
+
require_once("calendar_functions.php");
|
786 |
+
if (!function_exists('print_html_nav')) {
|
787 |
+
require_once("nav_function/nav_html_func.php");
|
788 |
+
}
|
789 |
+
|
790 |
+
global $wpdb;
|
791 |
+
if (isset($_GET["task"])) {
|
792 |
+
$task = esc_html($_GET["task"]);
|
793 |
+
}
|
794 |
+
else {
|
795 |
+
$task = "";
|
796 |
+
show_event_cat();
|
797 |
+
return;
|
798 |
+
}
|
799 |
+
if (isset($_GET["id"])) {
|
800 |
+
$id = (int) $_GET["id"];
|
801 |
+
}
|
802 |
+
else {
|
803 |
+
$id = 0;
|
804 |
+
}
|
805 |
+
|
806 |
+
switch($task){
|
807 |
+
case 'add_category':
|
808 |
+
edit_event_category($id);
|
809 |
+
break;
|
810 |
+
|
811 |
+
case 'save_category_event':
|
812 |
+
if(!$id){
|
813 |
+
save_spider_category_event();
|
814 |
+
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
815 |
+
}
|
816 |
+
else
|
817 |
+
{
|
818 |
+
apply_spider_category_event($id);
|
819 |
+
}
|
820 |
+
show_event_cat();
|
821 |
+
break;
|
822 |
+
|
823 |
+
case 'apply_event_category':
|
824 |
+
if (!$id) {
|
825 |
+
save_spider_category_event();
|
826 |
+
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
827 |
+
}
|
828 |
+
else {
|
829 |
+
apply_spider_category_event($id);
|
830 |
+
}
|
831 |
+
edit_event_category($id);
|
832 |
+
break;
|
833 |
+
|
834 |
+
case 'edit_event_category':
|
835 |
+
//apply_spider_category_event();
|
836 |
+
edit_event_category($id);
|
837 |
+
break;
|
838 |
+
|
839 |
+
case 'remove_event_category':
|
840 |
+
remove_category_event($id);
|
841 |
+
show_event_cat();
|
842 |
+
break;
|
843 |
+
case 'published':
|
844 |
+
spider_category_published($id);
|
845 |
+
show_event_cat();
|
846 |
+
break;
|
847 |
+
}
|
848 |
+
|
849 |
+
}
|
850 |
+
|
851 |
+
function upcoming_widget(){
|
852 |
+
require_once("calendar_functions.html.php");
|
853 |
+
require_once("spidercalendar_upcoming_events_widget.php");
|
854 |
+
require_once("calendar_functions.php");
|
855 |
+
if (!function_exists('print_html_nav')) {
|
856 |
+
require_once("nav_function/nav_html_func.php");
|
857 |
+
}
|
858 |
+
|
859 |
+
global $wpdb;
|
860 |
+
|
861 |
+
spider_upcoming();
|
862 |
+
}
|
863 |
+
|
864 |
function spider_widget_calendar_params() {
|
865 |
wp_enqueue_script('media-upload');
|
866 |
wp_admin_css('thickbox');
|
914 |
$base_name = plugin_basename('Spider_Calendar');
|
915 |
$base_page = 'admin.php?page=' . $base_name;
|
916 |
$mode = (isset($_GET['mode']) ? trim($_GET['mode']) : '');
|
917 |
+
|
918 |
if (!empty($_POST['do'])) {
|
919 |
if ($_POST['do'] == "UNINSTALL Spider Event Calendar") {
|
920 |
check_admin_referer('Spider_Calendar uninstall');
|
921 |
+
|
922 |
+
echo '<form id="message" class="updated fade">';
|
923 |
echo '<p>';
|
924 |
echo "Table '" . $wpdb->prefix . "spidercalendar_event' has been deleted.";
|
925 |
+
$wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_event");
|
926 |
echo '<font style="color:#000;">';
|
927 |
echo '</font><br />';
|
928 |
echo '</p>';
|
929 |
+
echo '<p>';
|
930 |
+
echo "Table '" . $wpdb->prefix . "spidercalendar_event_category' has been deleted.";
|
931 |
+
$wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_event_category");
|
932 |
+
echo '<font style="color:#000;">';
|
933 |
+
echo '</font><br />';
|
934 |
+
echo '</p>';
|
935 |
echo '<p>';
|
936 |
echo "Table '" . $wpdb->prefix . "spidercalendar_calendar' has been deleted.";
|
937 |
+
$wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_calendar");
|
938 |
echo '<font style="color:#000;">';
|
939 |
echo '</font><br />';
|
940 |
echo '</p>';
|
941 |
+
echo '<p>';
|
942 |
echo "Table '" . $wpdb->prefix . "spidercalendar_theme' has been deleted.";
|
943 |
+
$wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_theme");
|
944 |
echo '<font style="color:#000;">';
|
945 |
echo '</font><br />';
|
946 |
echo '</p>';
|
950 |
echo '<font style="color:#000;">';
|
951 |
echo '</font><br />';
|
952 |
echo '</p>';
|
953 |
+
echo '</form>';
|
954 |
$mode = 'end-UNINSTALL';
|
955 |
+
|
956 |
}
|
957 |
}
|
958 |
switch ($mode) {
|
963 |
echo '<p><strong>' . sprintf('<a href="%s">Click Here</a> To Finish The Uninstallation And Spider Event Calendar Will Be Deactivated Automatically.', $deactivate_url) . '</strong></p>';
|
964 |
echo '</div>';
|
965 |
break;
|
966 |
+
// Main Page
|
967 |
default:
|
968 |
?>
|
969 |
+
<form method="post" id="uninstall_form" action="<?php echo admin_url('admin.php?page=Uninstall_sp_calendar'); ?>">
|
970 |
<?php wp_nonce_field('Spider_Calendar uninstall'); ?>
|
971 |
<div class="wrap">
|
972 |
<div id="icon-Spider_Calendar" class="icon32"><br/></div>
|
996 |
<ol>
|
997 |
<?php
|
998 |
echo '<li>' . $wpdb->prefix . 'spidercalendar_event</li>' . "\n";
|
999 |
+
echo '<li>' . $wpdb->prefix . 'spidercalendar_event_category</li>' . "\n";
|
1000 |
echo '<li>' . $wpdb->prefix . 'spidercalendar_calendar</li>' . "\n";
|
1001 |
+
echo '<li>' . $wpdb->prefix . 'spidercalendar_theme</li>' . "\n";
|
1002 |
echo '<li>' . $wpdb->prefix . 'spidercalendar_widget_theme</li>' . "\n";
|
1003 |
?>
|
1004 |
</ol>
|
1005 |
</td>
|
1006 |
</tr>
|
1007 |
</table>
|
1008 |
+
<script>
|
1009 |
+
function uninstall(){
|
1010 |
+
jQuery(document).ready(function() {
|
1011 |
+
if(jQuery('#uninstall_yes').is(':checked')){
|
1012 |
+
var answer = confirm('<?php echo 'You Are About To Uninstall Spider Event Calendar From WordPress.\nThis Action Is Not Reversible.\n\n Choose [Cancel] To Stop, [OK] To Uninstall.'; ?>');
|
1013 |
+
|
1014 |
+
if(answer)
|
1015 |
+
jQuery("#uninstall_form").submit();
|
1016 |
+
}
|
1017 |
+
else
|
1018 |
+
alert('To uninstall please check the box above.');
|
1019 |
+
|
1020 |
+
});
|
1021 |
+
}
|
1022 |
+
</script>
|
1023 |
<p style="text-align: center;">
|
1024 |
<?php echo 'Do you really want to uninstall Spider Event Calendar?'; ?><br/><br/>
|
1025 |
+
<input type="checkbox" value="yes" id="uninstall_yes" /> <?php echo 'Yes'; ?><br/><br/>
|
1026 |
+
<input type="hidden" name="do" value="UNINSTALL Spider Event Calendar" />
|
1027 |
+
<input type="button" name="DODO" value="<?php echo 'UNINSTALL Spider Event Calendar'; ?>"
|
1028 |
class="button-primary"
|
1029 |
+
onclick="uninstall()"/>
|
1030 |
</p>
|
1031 |
</div>
|
1032 |
</form>
|
1034 |
}
|
1035 |
}
|
1036 |
|
1037 |
+
function calendar_Featured_Plugins_styles() {
|
1038 |
+
wp_enqueue_style("Featured_Plugins", plugins_url("featured_plugins.css", __FILE__));
|
1039 |
+
}
|
1040 |
+
function calendar_Featured_Plugins() {
|
1041 |
+
?>
|
1042 |
+
<div id="main_featured_plugins_page">
|
1043 |
+
<table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;">
|
1044 |
+
<tr>
|
1045 |
+
<td colspan="2" style="height: 70px;"><h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Featured Plugins</h3></td>
|
1046 |
+
<td align="right" style="font-size:16px;">
|
1047 |
+
</td>
|
1048 |
+
</tr>
|
1049 |
+
</table>
|
1050 |
+
<form method="post">
|
1051 |
+
<ul id="featured-plugins-list">
|
1052 |
+
<li class="form-maker">
|
1053 |
+
<div class="product">
|
1054 |
+
<div class="title">
|
1055 |
+
<strong class="heading">Form Maker</strong>
|
1056 |
+
<p>Wordpress form builder plugin</p>
|
1057 |
+
</div>
|
1058 |
+
</div>
|
1059 |
+
<div class="description">
|
1060 |
+
<p>Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.</p>
|
1061 |
+
<a target="_blank" href="http://web-dorado.com/products/wordpress-form.html" class="download">Download</a>
|
1062 |
+
</div>
|
1063 |
+
</li>
|
1064 |
+
<li class="catalog">
|
1065 |
+
<div class="product">
|
1066 |
+
<div class="title">
|
1067 |
+
<strong class="heading">Spider Catalog</strong>
|
1068 |
+
<p>WordPress product catalog plugin</p>
|
1069 |
+
</div>
|
1070 |
+
</div>
|
1071 |
+
<div class="description">
|
1072 |
+
<p>Spider Catalog for WordPress is a convenient tool for organizing the products represented on your website into catalogs.</p>
|
1073 |
+
<a target="_blank" href="http://web-dorado.com/products/wordpress-catalog.html" class="download">Download</a>
|
1074 |
+
</div>
|
1075 |
+
</li>
|
1076 |
+
<li class="player">
|
1077 |
+
<div class="product">
|
1078 |
+
<div class="title">
|
1079 |
+
<strong class="heading">Video Player</strong>
|
1080 |
+
<p>WordPress Video player plugin</p>
|
1081 |
+
</div>
|
1082 |
+
</div>
|
1083 |
+
<div class="description">
|
1084 |
+
<p>Spider Video Player for WordPress is a Flash & HTML5 video player plugin that allows you to easily add videos to your website with the possibility</p>
|
1085 |
+
<a target="_blank" href="http://web-dorado.com/products/wordpress-player.html" class="download">Download</a>
|
1086 |
+
</div>
|
1087 |
+
</li>
|
1088 |
+
<li class="contacts">
|
1089 |
+
<div class="product">
|
1090 |
+
<div class="title">
|
1091 |
+
<strong class="heading">Spider Contacts</strong>
|
1092 |
+
<p>Wordpress staff list plugin</p>
|
1093 |
+
</div>
|
1094 |
+
</div>
|
1095 |
+
<div class="description">
|
1096 |
+
<p>Spider Contacts helps you to display information about the group of people more intelligible, effective and convenient.</p>
|
1097 |
+
<a target="_blank" href="http://web-dorado.com/products/wordpress-contacts-plugin.html" class="download">Download</a>
|
1098 |
+
</div>
|
1099 |
+
</li>
|
1100 |
+
<li class="facebook">
|
1101 |
+
<div class="product">
|
1102 |
+
<div class="title">
|
1103 |
+
<strong class="heading">Spider Facebook</strong>
|
1104 |
+
<p>WordPress Facebook plugin</p>
|
1105 |
+
</div>
|
1106 |
+
</div>
|
1107 |
+
<div class="description">
|
1108 |
+
<p>Spider Facebook is a WordPress integration tool for Facebook.It includes all the available Facebook social plugins and widgets to be added to your web</p>
|
1109 |
+
<a target="_blank" href="http://web-dorado.com/products/wordpress-facebook.html" class="download">Download</a>
|
1110 |
+
</div>
|
1111 |
+
</li>
|
1112 |
+
<li class="faq">
|
1113 |
+
<div class="product">
|
1114 |
+
<div class="title">
|
1115 |
+
<strong class="heading">Spider FAQ</strong>
|
1116 |
+
<p>WordPress FAQ Plugin</p>
|
1117 |
+
</div>
|
1118 |
+
</div>
|
1119 |
+
<div class="description">
|
1120 |
+
<p>The Spider FAQ WordPress plugin is for creating an FAQ (Frequently Asked Questions) section for your website.</p>
|
1121 |
+
<a target="_blank" href="http://web-dorado.com/products/wordpress-faq-plugin.html" class="download">Download</a>
|
1122 |
+
</div>
|
1123 |
+
</li>
|
1124 |
+
<li class="zoom">
|
1125 |
+
<div class="product">
|
1126 |
+
<div class="title">
|
1127 |
+
<strong class="heading">Zoom</strong>
|
1128 |
+
<p>WordPress text zoom plugin</p>
|
1129 |
+
</div>
|
1130 |
+
</div>
|
1131 |
+
<div class="description">
|
1132 |
+
<p>Zoom enables site users to resize the predefined areas of the web site.</p>
|
1133 |
+
<a target="_blank" href="http://web-dorado.com/products/wordpress-zoom.html" class="download">Download</a>
|
1134 |
+
</div>
|
1135 |
+
</li>
|
1136 |
+
<li class="flash-calendar">
|
1137 |
+
<div class="product">
|
1138 |
+
<div class="title">
|
1139 |
+
<strong class="heading">Flash Calendar</strong>
|
1140 |
+
<p>WordPress flash calendar plugin</p>
|
1141 |
+
</div>
|
1142 |
+
</div>
|
1143 |
+
<div class="description">
|
1144 |
+
<p>Spider Flash Calendar is a highly configurable Flash calendar plugin which allows you to have multiple organized events.</p>
|
1145 |
+
<a target="_blank" href="http://web-dorado.com/products/wordpress-events-calendar.html" class="download">Download</a>
|
1146 |
+
</div>
|
1147 |
+
</li>
|
1148 |
+
<li class="contact-maker">
|
1149 |
+
<div class="product">
|
1150 |
+
<div class="title">
|
1151 |
+
<strong class="heading">Contact Form Maker</strong>
|
1152 |
+
<p>WordPress contact form builder plugin</p>
|
1153 |
+
</div>
|
1154 |
+
</div>
|
1155 |
+
<div class="description">
|
1156 |
+
<p>WordPress Contact Form Maker is an advanced and easy-to-use tool for creating forms.</p>
|
1157 |
+
<a target="_blank" href="http://web-dorado.com/products/wordpress-contact-form-maker-plugin.html" class="download">Download</a>
|
1158 |
+
</div>
|
1159 |
+
</li>
|
1160 |
+
|
1161 |
+
</ul>
|
1162 |
+
</form>
|
1163 |
+
</div >
|
1164 |
+
<?php
|
1165 |
+
}
|
1166 |
+
|
1167 |
// Activate plugin.
|
1168 |
function SpiderCalendar_activate() {
|
1169 |
global $wpdb;
|
1197 |
`published` tinyint(1) NOT NULL,
|
1198 |
PRIMARY KEY (`id`)
|
1199 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
1200 |
+
$spider_category_event_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "spidercalendar_event_category` (
|
1201 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
1202 |
+
`title` varchar(255) NOT NULL,
|
1203 |
+
`published` tinyint(1) NOT NULL,
|
1204 |
+
`color` varchar(255) NOT NULL,
|
1205 |
+
`description` longtext NOT NULL,
|
1206 |
+
PRIMARY KEY (`id`)
|
1207 |
+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
1208 |
$wpdb->query($spider_event_table);
|
1209 |
$wpdb->query($spider_calendar_table);
|
1210 |
+
$wpdb->query($spider_category_event_table);
|
1211 |
require_once "spider_calendar_update.php";
|
1212 |
spider_calendar_chech_update();
|
1213 |
}
|
1221 |
<?php
|
1222 |
}
|
1223 |
add_action('admin_head', 'spider_calendar_ajax_func');
|
1224 |
+
?>
|
|
calendar_functions.html.php
CHANGED
@@ -151,7 +151,7 @@ function html_show_spider_calendar($rows, $pageNav, $sort) {
|
|
151 |
$serch_value = "";
|
152 |
}
|
153 |
$serch_fields = '
|
154 |
-
<div class="alignleft actions"
|
155 |
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
156 |
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()">
|
157 |
</div>
|
@@ -231,7 +231,12 @@ function html_add_spider_calendar() {
|
|
231 |
}
|
232 |
function submitform(pressbutton) {
|
233 |
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
|
|
|
|
|
|
|
|
234 |
document.getElementById('adminForm').submit();
|
|
|
235 |
}
|
236 |
function doNothing() {
|
237 |
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
@@ -355,7 +360,12 @@ function html_edit_spider_calendar($row) {
|
|
355 |
}
|
356 |
function submitform(pressbutton) {
|
357 |
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
|
|
|
|
|
|
|
|
358 |
document.getElementById('adminForm').submit();
|
|
|
359 |
}
|
360 |
function doNothing() {
|
361 |
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
@@ -478,6 +488,595 @@ function selectted($row, $y) {
|
|
478 |
}
|
479 |
}
|
480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
481 |
// Events.
|
482 |
function html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name) {
|
483 |
global $wpdb;
|
@@ -528,7 +1127,7 @@ function html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name)
|
|
528 |
<td width="100%"><h2>Event Manager for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
529 |
<td>
|
530 |
<p class="submit" style="padding:0px; text-align:left">
|
531 |
-
<input class="button-primary" type="button" value="Add
|
532 |
</p>
|
533 |
</td>
|
534 |
<td>
|
@@ -548,7 +1147,7 @@ function html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name)
|
|
548 |
$startdate = (isset($_POST["startdate"]) ? esc_html($_POST["startdate"]) : '');
|
549 |
$enddate = (isset($_POST["enddate"]) ? esc_html($_POST["enddate"]) : '');
|
550 |
$serch_fields = '
|
551 |
-
<div class="alignleft actions"
|
552 |
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
553 |
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()" />
|
554 |
</div>
|
@@ -590,6 +1189,12 @@ function html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name)
|
|
590 |
<span>Time</span>
|
591 |
<span class="sorting-indicator"></span>
|
592 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
593 |
</th>
|
594 |
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
595 |
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
@@ -609,6 +1214,7 @@ function html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name)
|
|
609 |
</td>
|
610 |
<td><?php if ($rows[$i]->date_end != '0000-00-00' && $rows[$i]->date_end != '2070-12-12') echo $rows[$i]->date . ' - ' . $rows[$i]->date_end; else echo $rows[$i]->date; ?></td>
|
611 |
<td><?php echo $rows[$i]->time ?></td>
|
|
|
612 |
<td><a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?>
|
613 |
href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=published_event&id=<?php echo $rows[$i]->id; ?>"><?php if ($rows[$i]->published)
|
614 |
echo 'Yes'; else echo 'No'; ?></a>
|
@@ -659,15 +1265,25 @@ function html_add_spider_event($calendar_id, $cal_name) {
|
|
659 |
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value != "" && form.selminute_to.value != "") {
|
660 |
submitform(pressbutton);
|
661 |
}
|
|
|
662 |
else {
|
663 |
alert('Invalid Time');
|
664 |
}
|
665 |
}
|
|
|
|
|
666 |
function submitform(pressbutton) {
|
667 |
-
|
668 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
}
|
670 |
-
function checkhour(id) {
|
671 |
if (typeof(event) != 'undefined') {
|
672 |
var e = event; // for trans-browser compatibility
|
673 |
var charCode = e.which || e.keyCode;
|
@@ -685,7 +1301,7 @@ function html_add_spider_event($calendar_id, $cal_name) {
|
|
685 |
}
|
686 |
return true;
|
687 |
}
|
688 |
-
function check12hour(id) {
|
689 |
if (typeof(event) != 'undefined') {
|
690 |
var e = event; // for trans-browser compatibility
|
691 |
var charCode = e.which || e.keyCode;
|
@@ -707,7 +1323,7 @@ function html_add_spider_event($calendar_id, $cal_name) {
|
|
707 |
}
|
708 |
return true;
|
709 |
}
|
710 |
-
function checknumber(id) {
|
711 |
if (typeof(event) != 'undefined') {
|
712 |
var e = event; // for trans-browser compatibility
|
713 |
var charCode = e.which || e.keyCode;
|
@@ -717,7 +1333,7 @@ function html_add_spider_event($calendar_id, $cal_name) {
|
|
717 |
}
|
718 |
return true;
|
719 |
}
|
720 |
-
function checkminute(id) {
|
721 |
if (typeof(event) != 'undefined') {
|
722 |
var e = event; // for trans-browser compatibility
|
723 |
var charCode = e.which || e.keyCode;
|
@@ -879,12 +1495,6 @@ function html_add_spider_event($calendar_id, $cal_name) {
|
|
879 |
This section allows you to create/edit the events of a particular calendar.<br/> You can add unlimited number of events for each calendar.
|
880 |
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
881 |
</td>
|
882 |
-
<td colspan="7" align="right" style="font-size:16px;">
|
883 |
-
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
884 |
-
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
885 |
-
Get the full version
|
886 |
-
</a>
|
887 |
-
</td>
|
888 |
</tr>
|
889 |
<tbody>
|
890 |
<tr>
|
@@ -898,6 +1508,15 @@ function html_add_spider_event($calendar_id, $cal_name) {
|
|
898 |
<?php
|
899 |
global $wpdb;
|
900 |
$calendar = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='" . $calendar_id . "'");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
901 |
?>
|
902 |
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>" method="post" id="adminForm" name="adminForm">
|
903 |
<table width="95%">
|
@@ -911,26 +1530,41 @@ function html_add_spider_event($calendar_id, $cal_name) {
|
|
911 |
<td class="key"><label for="title">Title: </label></td>
|
912 |
<td><input type="text" id="title" name="title" size="41"/></td>
|
913 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
914 |
<tr>
|
915 |
<td class="key"><label for="date">Date: </label></td>
|
916 |
<td>
|
917 |
-
<input style="width:90px" class="inputbox" type="text" name="date" id="date" size="10" maxlength="10" value=""/>
|
918 |
-
<input type="reset" class="button" value="..." onclick="return showCalendar('date','%Y-%m-%d');"/>
|
919 |
</td>
|
920 |
</tr>
|
921 |
<tr>
|
922 |
<td class="key"><label for="selhour_from">Time: </label></td>
|
923 |
<?php if ($calendar->time_format == 1) { ?>
|
924 |
<td>
|
925 |
-
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right" onkeypress="return check12hour('selhour_from')" value="" title="from"/> <b>:</b>
|
926 |
-
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right" onkeypress="return checkminute('selminute_from')" value="" onblur="add_0('selminute_from')" title="from"/>
|
927 |
<select id="select_from" name="select_from">
|
928 |
<option selected="selected">AM</option>
|
929 |
<option>PM</option>
|
930 |
</select>
|
931 |
<span style="font-size:12px"> - </span>
|
932 |
-
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right" onkeypress="return check12hour('selhour_to')" value="" title="to"/> <b>:</b>
|
933 |
-
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right" onkeypress="return checkminute('selminute_to')" value="" onblur="add_0('selminute_to')" title="to"/>
|
934 |
<select id="select_to" name="select_to">
|
935 |
<option>AM</option>
|
936 |
<option>PM</option>
|
@@ -938,19 +1572,25 @@ function html_add_spider_event($calendar_id, $cal_name) {
|
|
938 |
</td>
|
939 |
<?php } if ($calendar->time_format == 0) { ?>
|
940 |
<td>
|
941 |
-
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right" onkeypress="return checkhour('selhour_from')" value="" title="from" onblur="add_0('selhour_from')"/> <b>:</b>
|
942 |
-
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right" onkeypress="return checkminute('selminute_from')" value="" title="from" onblur="add_0('selminute_from')"/>
|
943 |
<span style="font-size:12px"> - </span>
|
944 |
-
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right" onkeypress="return checkhour('selhour_to')" value="" title="to" onblur="add_0('selhour_to')"/> <b>:</b>
|
945 |
-
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right" onkeypress="return checkminute('selminute_to')" value="" title="to" onblur="add_0('selminute_to')"/>
|
946 |
</td>
|
947 |
<?php }?>
|
948 |
</tr>
|
949 |
<tr>
|
950 |
<td class="key"><label for="poststuff">Note: </label></td>
|
951 |
<td>
|
952 |
-
<div id="poststuff" style="width:100% !important;">
|
953 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
954 |
</div>
|
955 |
</td>
|
956 |
</tr>
|
@@ -969,15 +1609,25 @@ function html_add_spider_event($calendar_id, $cal_name) {
|
|
969 |
</td>
|
970 |
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
971 |
<div style="width:100%">
|
972 |
-
<fieldset class="adminform"><legend>Repeat Event</legend>
|
973 |
<table>
|
974 |
<tr>
|
975 |
<td valign="top">
|
976 |
-
|
977 |
-
|
978 |
-
<
|
979 |
-
<input type="radio" value="
|
980 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
981 |
</td>
|
982 |
<td style="padding-left:10px" valign="top">
|
983 |
<div id="daily" style="display:none">Repeat every
|
@@ -1066,6 +1716,7 @@ function html_add_spider_event($calendar_id, $cal_name) {
|
|
1066 |
function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
1067 |
global $wpdb;
|
1068 |
$calendar = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar");
|
|
|
1069 |
?>
|
1070 |
<style>
|
1071 |
.calendar .button {
|
@@ -1084,8 +1735,13 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
|
1084 |
</style>
|
1085 |
<script language="javascript" type="text/javascript">
|
1086 |
function submitform(pressbutton) {
|
|
|
|
|
|
|
|
|
1087 |
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1088 |
document.getElementById('adminForm').submit();
|
|
|
1089 |
}
|
1090 |
function submitbutton(pressbutton) {
|
1091 |
var form = document.adminForm;
|
@@ -1112,74 +1768,74 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
|
1112 |
alert('Invalid Time');
|
1113 |
}
|
1114 |
}
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
}
|
1122 |
-
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1123 |
-
hour = parseFloat(hour);
|
1124 |
-
if (document.getSelection() != '') {
|
1125 |
-
return true;
|
1126 |
-
}
|
1127 |
-
if ((hour < 0) || (hour > 23)) {
|
1128 |
-
return false;
|
1129 |
-
}
|
1130 |
}
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
var e = event; // for trans-browser compatibility
|
1136 |
-
var charCode = e.which || e.keyCode;
|
1137 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1138 |
-
return false;
|
1139 |
-
}
|
1140 |
-
minute = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1141 |
-
minute = parseFloat(minute);
|
1142 |
-
if (document.getSelection() != '') {
|
1143 |
-
return true;
|
1144 |
-
}
|
1145 |
-
if ((minute < 0) || (minute > 59)) {
|
1146 |
-
return false;
|
1147 |
-
}
|
1148 |
}
|
1149 |
-
|
1150 |
-
|
1151 |
-
function checknumber(id) {
|
1152 |
-
if (typeof(event) != 'undefined') {
|
1153 |
-
var e = event; // for trans-browser compatibility
|
1154 |
-
var charCode = e.which || e.keyCode;
|
1155 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1156 |
-
return false;
|
1157 |
-
}
|
1158 |
}
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1180 |
}
|
1181 |
-
return true;
|
1182 |
}
|
|
|
|
|
1183 |
function add_0(id) {
|
1184 |
input = document.getElementById(id);
|
1185 |
if (input.value.length == 1) {
|
@@ -1293,6 +1949,10 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
|
1293 |
document.getElementById(id).value = document.getElementById('repeat_input').value;
|
1294 |
}
|
1295 |
</script>
|
|
|
|
|
|
|
|
|
1296 |
<table width="95%">
|
1297 |
<tr>
|
1298 |
<td width="100%" style="font-size:14px; font-weight:bold">
|
@@ -1301,12 +1961,6 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
|
1301 |
This section allows you to create/edit the events of a particular calendar.<br/> You can add unlimited number of events for each calendar.
|
1302 |
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
1303 |
</td>
|
1304 |
-
<td colspan="7" align="right" style="font-size:16px;">
|
1305 |
-
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
1306 |
-
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
1307 |
-
Get the full version
|
1308 |
-
</a>
|
1309 |
-
</td>
|
1310 |
</tr>
|
1311 |
<tbody>
|
1312 |
<tr>
|
@@ -1317,6 +1971,7 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
|
1317 |
</tr>
|
1318 |
</tbody>
|
1319 |
</table>
|
|
|
1320 |
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm">
|
1321 |
<table width="95%">
|
1322 |
<tr>
|
@@ -1329,6 +1984,22 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
|
1329 |
<td class="key"><label for="message">Title: </label></td>
|
1330 |
<td><input type="text" id="title" name="title" size="41" value="<?php echo htmlspecialchars($row->title, ENT_QUOTES); ?>"/></td>
|
1331 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1332 |
<tr>
|
1333 |
<td class="key"><label for="message">Date: </label></td>
|
1334 |
<td>
|
@@ -1365,23 +2036,24 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
|
1365 |
?>
|
1366 |
<?php if ($calendar->time_format == 0) { ?>
|
1367 |
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
1368 |
-
onkeypress="return checkhour('selhour_from')" value="<?php echo $from[0]; ?>" title="from"
|
1369 |
onblur="add_0('selhour_from')"/> <b>:</b>
|
1370 |
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
1371 |
-
onkeypress="return checkminute('selminute_from')" value="<?php echo substr($from[1], 0, 2); ?>"
|
1372 |
title="from" onblur="add_0('selminute_from')"/> <span style="font-size:12px"> - </span>
|
1373 |
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
1374 |
-
onkeypress="return checkhour('selhour_to')" value="<?php echo $to[0]; ?>" title="to"
|
1375 |
onblur="add_0('selhour_to')"/> <b>:</b>
|
1376 |
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
1377 |
-
onkeypress="return checkminute('selminute_to')" value="<?php echo substr($to[1], 0, 2); ?>"
|
1378 |
title="to" onblur="add_0('selminute_to')"/>
|
1379 |
-
<?php }
|
|
|
1380 |
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
1381 |
-
onkeypress="return check12hour('selhour_from')" value="<?php echo $from[0]; ?>" title="from"
|
1382 |
onblur="add_0('selhour_from')"/> <b>:</b>
|
1383 |
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
1384 |
-
onkeypress="return checkminute('selminute_from')" value="<?php echo substr($from[1], 0, 2); ?>"
|
1385 |
title="from" onblur="add_0('selminute_from')"/>
|
1386 |
<select id="select_from" name="select_from">
|
1387 |
<option <?php if (substr($from[1], 2, 2) == "AM")
|
@@ -1393,10 +2065,10 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
|
1393 |
</select>
|
1394 |
<span style="font-size:12px"> - </span>
|
1395 |
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
1396 |
-
onkeypress="return check12hour('selhour_to')" value="<?php echo $to[0]; ?>" title="to"
|
1397 |
onblur="add_0('selhour_to')"/> <b>:</b>
|
1398 |
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
1399 |
-
onkeypress="return checkminute('selminute_to')" value="<?php echo substr($to[1], 0, 2); ?>"
|
1400 |
title="to" onblur="add_0('selminute_to')"/>
|
1401 |
<select id="select_to" name="select_to">
|
1402 |
<option <?php if (substr($to[1], 2, 2) == "AM")
|
@@ -1412,8 +2084,15 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
|
1412 |
<tr>
|
1413 |
<td class="key"><label for="note">Note: </label></td>
|
1414 |
<td>
|
1415 |
-
<div id="poststuff" style="width:100% !important;">
|
1416 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1417 |
</div>
|
1418 |
</td>
|
1419 |
</tr>
|
@@ -1432,21 +2111,31 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
|
1432 |
</td>
|
1433 |
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
1434 |
<div style="width:100%">
|
1435 |
-
<fieldset class="adminform">
|
1436 |
<legend>Repeat Event</legend>
|
1437 |
<table>
|
1438 |
<tr>
|
1439 |
<td valign="top">
|
1440 |
-
<input type="radio" value="no_repeat" name="repeat_method" <?php if ($row->repeat_method == 'no_repeat')
|
1441 |
-
echo 'checked="checked"' ?> checked="checked" onchange="change_type('no_repeat')"/>
|
1442 |
-
|
1443 |
-
|
1444 |
-
<input type="radio" value="
|
1445 |
-
echo 'checked="checked"' ?>
|
1446 |
-
|
1447 |
-
|
1448 |
-
<input type="radio" value="
|
1449 |
-
echo 'checked="checked"' ?> onchange="change_type('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1450 |
</td>
|
1451 |
<td style="padding-left:10px" valign="top">
|
1452 |
<div id="daily" style="display:<?php if ($row->repeat_method == 'no_repeat') echo 'none'; ?>">
|
@@ -1543,7 +2232,4 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
|
1543 |
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
1544 |
<input type="hidden" name="task" value="event"/>
|
1545 |
<input type="hidden" name="calendar" value=""/>
|
1546 |
-
</form>
|
1547 |
-
<?php
|
1548 |
-
}
|
1549 |
-
?>
|
151 |
$serch_value = "";
|
152 |
}
|
153 |
$serch_fields = '
|
154 |
+
<div class="alignleft actions">
|
155 |
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
156 |
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()">
|
157 |
</div>
|
231 |
}
|
232 |
function submitform(pressbutton) {
|
233 |
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
234 |
+
if (document.getElementById('title').value == "") {
|
235 |
+
alert('Provide calendar title:');
|
236 |
+
}
|
237 |
+
else {
|
238 |
document.getElementById('adminForm').submit();
|
239 |
+
}
|
240 |
}
|
241 |
function doNothing() {
|
242 |
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
360 |
}
|
361 |
function submitform(pressbutton) {
|
362 |
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
363 |
+
if (document.getElementById('title').value == "") {
|
364 |
+
alert('Provide calendar title:');
|
365 |
+
}
|
366 |
+
else {
|
367 |
document.getElementById('adminForm').submit();
|
368 |
+
}
|
369 |
}
|
370 |
function doNothing() {
|
371 |
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
488 |
}
|
489 |
}
|
490 |
|
491 |
+
function show_event_category($rows, $pageNav, $sort){
|
492 |
+
global $wpdb;
|
493 |
+
?>
|
494 |
+
<script language="javascript">
|
495 |
+
function confirmation(href, title) {
|
496 |
+
var answer = confirm("Are you sure you want to delete '" + title + "'?")
|
497 |
+
if (answer) {
|
498 |
+
document.getElementById('admin_form').action = href;
|
499 |
+
document.getElementById('admin_form').submit();
|
500 |
+
}
|
501 |
+
}
|
502 |
+
function ordering(name, as_or_desc) {
|
503 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
504 |
+
document.getElementById('order_by').value = name;
|
505 |
+
document.getElementById('admin_form').submit();
|
506 |
+
}
|
507 |
+
function submit_form_id(x) {
|
508 |
+
var val = x.options[x.selectedIndex].value;
|
509 |
+
document.getElementById("id_for_playlist").value = val;
|
510 |
+
document.getElementById("admin_form").submit();
|
511 |
+
}
|
512 |
+
function doNothing() {
|
513 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
514 |
+
if (keyCode == 13) {
|
515 |
+
if (!e) var e = window.event;
|
516 |
+
e.cancelBubble = true;
|
517 |
+
e.returnValue = false;
|
518 |
+
if (e.stopPropagation) {
|
519 |
+
e.stopPropagation();
|
520 |
+
e.preventDefault();
|
521 |
+
}
|
522 |
+
}
|
523 |
+
}
|
524 |
+
var show_one_cal = 1;
|
525 |
+
var get_cal_id = 0;
|
526 |
+
function show_calendar_inline(cal_id) {
|
527 |
+
if (show_one_cal == 1) {
|
528 |
+
show_one_cal = 0;
|
529 |
+
jQuery.ajax({
|
530 |
+
type:'POST',
|
531 |
+
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineedit') ?>',
|
532 |
+
data:{calendar_id:cal_id},
|
533 |
+
dataType:'html',
|
534 |
+
success:function (data) {
|
535 |
+
cancel_qiucik_edit(get_cal_id);
|
536 |
+
var edit_cal_tr = document.createElement("tr")
|
537 |
+
edit_cal_tr.innerHTML = data;
|
538 |
+
edit_cal_tr.setAttribute('class', 'inline-edit-row inline-edit-row-page inline-edit-page quick-edit-row quick-edit-row-page inline-edit-page alternate inline-editor')
|
539 |
+
edit_cal_tr.setAttribute('id', 'edit_calendar-' + cal_id);
|
540 |
+
|
541 |
+
document.getElementById('Calendar-' + cal_id).style.display = "none";
|
542 |
+
document.getElementById('calendar_body').appendChild(edit_cal_tr);
|
543 |
+
document.getElementById('calendar_body').insertBefore(edit_cal_tr, document.getElementById('Calendar-' + cal_id));
|
544 |
+
get_cal_id = cal_id;
|
545 |
+
show_one_cal = 1
|
546 |
+
}
|
547 |
+
});
|
548 |
+
}
|
549 |
+
}
|
550 |
+
function cancel_qiucik_edit(cal_id) {
|
551 |
+
if (document.getElementById('edit_calendar-' + cal_id)) {
|
552 |
+
var tr = document.getElementById('edit_calendar-' + cal_id);
|
553 |
+
tr.parentNode.removeChild(tr);
|
554 |
+
document.getElementById('Calendar-' + cal_id).style.display = "";
|
555 |
+
}
|
556 |
+
}
|
557 |
+
function updae_inline_sp_calendar(cal_id) {
|
558 |
+
var cal_title = document.getElementById('calendar_title').value;
|
559 |
+
var cal_12_format = getCheckedValue(document.getElementsByName('time_format'));
|
560 |
+
var def_year = document.getElementById('def_year').value;
|
561 |
+
var def_month = document.getElementById('def_month').value;
|
562 |
+
document.getElementById('imig_for_waiting').style.display = "block";
|
563 |
+
jQuery.ajax({
|
564 |
+
type:'POST',
|
565 |
+
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineupdate') ?>',
|
566 |
+
data:{
|
567 |
+
calendar_id:cal_id,
|
568 |
+
calendar_title:cal_title,
|
569 |
+
us_12_format_sp_calendar:cal_12_format,
|
570 |
+
default_year:def_year,
|
571 |
+
default_month:def_month
|
572 |
+
},
|
573 |
+
dataType:'html',
|
574 |
+
success:function (data) {
|
575 |
+
if (data) {
|
576 |
+
document.getElementById('imig_for_waiting').style.display = "none";
|
577 |
+
document.getElementById('Calendar-' + cal_id).innerHTML = data;
|
578 |
+
cancel_qiucik_edit(cal_id);
|
579 |
+
}
|
580 |
+
else {
|
581 |
+
alert('ERROR PLEAS INSTALL PLUGIN AGAIN');
|
582 |
+
cancel_qiucik_edit(cal_id);
|
583 |
+
}
|
584 |
+
}
|
585 |
+
});
|
586 |
+
}
|
587 |
+
function getCheckedValue(radioObj) {
|
588 |
+
if (!radioObj)
|
589 |
+
return "";
|
590 |
+
var radioLength = radioObj.length;
|
591 |
+
if (radioLength == undefined)
|
592 |
+
if (radioObj.checked)
|
593 |
+
return radioObj.value;
|
594 |
+
else
|
595 |
+
return "";
|
596 |
+
for (var i = 0; i < radioLength; i++) {
|
597 |
+
if (radioObj[i].checked) {
|
598 |
+
return radioObj[i].value;
|
599 |
+
}
|
600 |
+
}
|
601 |
+
return "";
|
602 |
+
}
|
603 |
+
</script>
|
604 |
+
<form method="post" onkeypress="doNothing()" action="admin.php?page=spider_calendar_event_category" id="admin_form" name="admin_form">
|
605 |
+
<table cellspacing="10" width="100%" id="category_table">
|
606 |
+
<tr>
|
607 |
+
<td width="100%" style="font-size:14px; font-weight:bold">
|
608 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
609 |
+
<br />
|
610 |
+
This section allows you to create calendars. You can add unlimited number of calendars.
|
611 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
612 |
+
</td>
|
613 |
+
<td colspan="7" align="right" style="font-size:16px;">
|
614 |
+
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
615 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
616 |
+
Get the full version
|
617 |
+
</a>
|
618 |
+
</td>
|
619 |
+
</tr>
|
620 |
+
|
621 |
+
<tr>
|
622 |
+
<td style="width:210px"><h2>Event Category</h2></td>
|
623 |
+
<td style="width:90px; text-align:right;">
|
624 |
+
<p class="submit" style="padding:0px; text-align:left">
|
625 |
+
<input type="button" value="Add a Category" name="custom_parametrs" onclick="window.location.href='admin.php?page=spider_calendar_event_category&task=add_category'"/>
|
626 |
+
</p>
|
627 |
+
</td>
|
628 |
+
<td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
|
629 |
+
</td>
|
630 |
+
</tr>
|
631 |
+
</table>
|
632 |
+
<?php
|
633 |
+
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
634 |
+
$serch_value = $_POST['search_cat_by_title'];
|
635 |
+
}
|
636 |
+
else {
|
637 |
+
$serch_value = "";
|
638 |
+
}
|
639 |
+
$serch_fields = '
|
640 |
+
<div class="alignleft actions" >
|
641 |
+
<label for="search_cat_by_title" style="font-size:14px">Title: </label>
|
642 |
+
<input type="text" name="search_cat_by_title" value="' . $serch_value . '" id="search_cat_by_title" onchange="clear_serch_texts()">
|
643 |
+
</div>
|
644 |
+
<div class="alignleft actions">
|
645 |
+
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
646 |
+
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
647 |
+
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=spider_calendar_event_category\'" class="button-secondary action">
|
648 |
+
</div>';
|
649 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
650 |
+
?>
|
651 |
+
<table class="wp-list-table widefat fixed pages" style="width:95%">
|
652 |
+
<thead>
|
653 |
+
<TR>
|
654 |
+
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
655 |
+
<a href="javascript:ordering('id',<?php echo(($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
656 |
+
<span>ID</span>
|
657 |
+
<span class="sorting-indicator"></span>
|
658 |
+
</a>
|
659 |
+
</th>
|
660 |
+
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
661 |
+
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
662 |
+
<span>Title</span>
|
663 |
+
<span class="sorting-indicator"></span>
|
664 |
+
</a>
|
665 |
+
</th>
|
666 |
+
<th scope="col" id="description" class="<?php echo (($sort["sortid_by"] == "description") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
667 |
+
<a href="javascript:ordering('description',<?php echo (($sort["sortid_by"] == "description") ? $sort["1_or_2"] : "1"); ?>)">
|
668 |
+
<span>Description</span>
|
669 |
+
<span class="sorting-indicator"></span>
|
670 |
+
</a>
|
671 |
+
</th>
|
672 |
+
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
673 |
+
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
674 |
+
<span>Published</span>
|
675 |
+
<span class="sorting-indicator"></span>
|
676 |
+
</a>
|
677 |
+
</th>
|
678 |
+
</TR>
|
679 |
+
</thead>
|
680 |
+
<tbody id="category_body">
|
681 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
682 |
+
<tr id="Calendar-<?php echo $rows[$i]->id; ?>" class=" hentry alternate iedit author-self" style="display:table-row;">
|
683 |
+
<td><?php echo $rows[$i]->id; ?></td>
|
684 |
+
<td class="post-title page-title column-title">
|
685 |
+
<?php echo $rows[$i]->title; ?></a>
|
686 |
+
|
687 |
+
<div class="row-actions">
|
688 |
+
<span class="edit">
|
689 |
+
<a href="admin.php?page=spider_calendar_event_category&task=edit_event_category&id=<?php echo $rows[$i]->id; ?>" title="Edit This Calendar">Edit</a> | </span>
|
690 |
+
<span class="trash">
|
691 |
+
<a class="submitdelete" title="Delete This Calendar" href="javascript:confirmation('admin.php?page=spider_calendar_event_category&task=remove_event_category&id=<?php echo $rows[$i]->id; ?>','<?php echo $rows[$i]->title; ?>')">Delete</a></span>
|
692 |
+
</div>
|
693 |
+
</td>
|
694 |
+
<td><?php echo $rows[$i]->description; ?></td>
|
695 |
+
<td><a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?> href="admin.php?page=spider_calendar_event_category&task=published&id=<?php echo $rows[$i]->id; ?>"><?php if ($rows[$i]->published) echo 'Yes'; else echo 'No'; ?></a>
|
696 |
+
</td>
|
697 |
+
</tr>
|
698 |
+
<?php } ?>
|
699 |
+
</tbody>
|
700 |
+
</table>
|
701 |
+
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo $_POST['id_for_playlist'];?>"/>
|
702 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc'];?>"/>
|
703 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo $_POST['order_by'];?>"/>
|
704 |
+
<?php
|
705 |
+
?>
|
706 |
+
</form>
|
707 |
+
<?php
|
708 |
+
|
709 |
+
}
|
710 |
+
|
711 |
+
function edit_event_category($id){
|
712 |
+
global $wpdb;
|
713 |
+
$row=$wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE id=".$id."");
|
714 |
+
?>
|
715 |
+
|
716 |
+
<script language="javascript" type="text/javascript">
|
717 |
+
<!--
|
718 |
+
function submitbutton(pressbutton) {
|
719 |
+
document.getElementById('adminForm').action = "admin.php?page=spider_calendar_event_category&task=" + pressbutton+"&id=<?php echo $id?>";
|
720 |
+
if (document.getElementById('cat_title').value == "") {
|
721 |
+
alert('Provide the category title:');
|
722 |
+
}
|
723 |
+
else {
|
724 |
+
document.getElementById('adminForm').submit();
|
725 |
+
}
|
726 |
+
}
|
727 |
+
</script>
|
728 |
+
|
729 |
+
<table>
|
730 |
+
<tr>
|
731 |
+
<td align="right"><input type="button" onclick="submitbutton('save_category_event')" value="Save" class="button-secondary action"></td>
|
732 |
+
<td align="right"><input type="button" onclick="submitbutton('apply_event_category')" value="Apply" class="button-secondary action"></td>
|
733 |
+
<td align="right"><input type="button" onclick="window.location.href='admin.php?page=spider_calendar_event_category'" value="Cancel" class="button-secondary action">
|
734 |
+
</td>
|
735 |
+
</tr>
|
736 |
+
</table>
|
737 |
+
|
738 |
+
|
739 |
+
<form action="" method="post" name="adminForm" id="adminForm">
|
740 |
+
<div class="width-45 fltlft ">
|
741 |
+
<fieldset class="adminform" >
|
742 |
+
|
743 |
+
|
744 |
+
|
745 |
+
|
746 |
+
<table class="admintable" >
|
747 |
+
|
748 |
+
|
749 |
+
|
750 |
+
<tr>
|
751 |
+
<td class="key" ><label for="message"><?php echo 'Category title'; ?>:</label> </td>
|
752 |
+
<td>
|
753 |
+
|
754 |
+
<input type="text" name="title" value="<?php if(isset($row->title)) echo htmlspecialchars($row->title);
|
755 |
+
?>" id="cat_title"/>
|
756 |
+
</td>
|
757 |
+
</tr>
|
758 |
+
|
759 |
+
<tr>
|
760 |
+
<td class="key" ><label for="message"><?php echo 'Category Color'; ?>:</label> </td>
|
761 |
+
|
762 |
+
<td><input type="text" name="color" id="color" class="color" style="width:134px;" value="<?php if(isset($row->color)) echo htmlspecialchars($row->color);
|
763 |
+
?>"/></td>
|
764 |
+
</tr>
|
765 |
+
|
766 |
+
|
767 |
+
<tr>
|
768 |
+
<td class="key"><label for="message"> <?php echo 'Description'; ?>:</label></td>
|
769 |
+
<td ><div id="poststuff" style="width:100% !important;">
|
770 |
+
|
771 |
+
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
772 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor(stripslashes($row->description),"description","title" ); ?>
|
773 |
+
</div>
|
774 |
+
<?php }else{
|
775 |
+
if(isset($row->description)) $desc1 = $row->description;
|
776 |
+
else $desc1 = "";
|
777 |
+
wp_editor($desc1, "description"); }?>
|
778 |
+
|
779 |
+
</div>
|
780 |
+
</div></td>
|
781 |
+
|
782 |
+
</tr>
|
783 |
+
|
784 |
+
<tr>
|
785 |
+
<td class="key" ><label for="message"><?php echo 'Published'; ?>:</label> </td>
|
786 |
+
|
787 |
+
<td>
|
788 |
+
<input type="radio" name="published" id="published0" value="0" <?php if(isset($row->published)) cheched($row->published, '0'); ?> class="inputbox">
|
789 |
+
<label for="published0">No</label>
|
790 |
+
<input type="radio" name="published" id="published1" value="1" <?php if(isset($row->published)) cheched($row->published, '1'); ?> class="inputbox">
|
791 |
+
<label for="published1">Yes</label>
|
792 |
+
</td>
|
793 |
+
</tr>
|
794 |
+
|
795 |
+
</table>
|
796 |
+
|
797 |
+
</fieldset >
|
798 |
+
</div>
|
799 |
+
<input type="hidden" name="id" value="<?php echo $id ?>" />
|
800 |
+
</form>
|
801 |
+
<?php
|
802 |
+
|
803 |
+
|
804 |
+
|
805 |
+
}
|
806 |
+
|
807 |
+
|
808 |
+
function html_upcoming_widget($rows, $pageNav, $sort){
|
809 |
+
require_once("spidercalendar_upcoming_events_widget.php");
|
810 |
+
global $wpdb;
|
811 |
+
$input_id=$_GET['id_input'];
|
812 |
+
$w_id = $_GET['w_id'];
|
813 |
+
$tbody_id='event'.$w_id;
|
814 |
+
$calendar_id=$_GET['upcalendar_id'];
|
815 |
+
?><html>
|
816 |
+
<head>
|
817 |
+
<link rel="stylesheet" id="thickbox-css" href="<?php echo plugins_url("elements/calendar-jos.css", __FILE__) ?>" type="text/css" media="all">
|
818 |
+
<?php wp_print_scripts("Canlendar_upcoming");
|
819 |
+
wp_print_scripts("calendnar-setup_upcoming");
|
820 |
+
wp_print_scripts("calenndar_function_upcoming");
|
821 |
+
?>
|
822 |
+
|
823 |
+
<style>
|
824 |
+
.calendar .button {
|
825 |
+
display: table-cell !important;
|
826 |
+
}
|
827 |
+
|
828 |
+
.button{
|
829 |
+
width: 30px;
|
830 |
+
}
|
831 |
+
input[type=checkbox]:checked:before,
|
832 |
+
th.sorted.asc .sorting-indicator:before, th.desc:hover span.sorting-indicator:before,
|
833 |
+
th.sorted.desc .sorting-indicator:before, th.asc:hover span.sorting-indicator:before{
|
834 |
+
content: close-quote !important;
|
835 |
+
}
|
836 |
+
|
837 |
+
</style>
|
838 |
+
<script language="javascript">
|
839 |
+
function ordering(name, as_or_desc) {
|
840 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
841 |
+
document.getElementById('order_by').value = name;
|
842 |
+
document.getElementById('admin_form').submit();
|
843 |
+
}
|
844 |
+
function submit_form_id(x) {
|
845 |
+
var val = x.options[x.selectedIndex].value;
|
846 |
+
document.getElementById("id_for_playlist").value = val;
|
847 |
+
document.getElementById("admin_form").submit();
|
848 |
+
}
|
849 |
+
|
850 |
+
function doNothing() {
|
851 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
852 |
+
if (keyCode == 13) {
|
853 |
+
if (!e) {
|
854 |
+
var e = window.event;
|
855 |
+
}
|
856 |
+
e.cancelBubble = true;
|
857 |
+
e.returnValue = false;
|
858 |
+
if (e.stopPropagation) {
|
859 |
+
e.stopPropagation();
|
860 |
+
e.preventDefault();
|
861 |
+
}
|
862 |
+
}
|
863 |
+
}
|
864 |
+
|
865 |
+
|
866 |
+
function isChecked(isitchecked){
|
867 |
+
if (isitchecked == true){
|
868 |
+
document.adminForm.boxchecked.value++;
|
869 |
+
}
|
870 |
+
else {
|
871 |
+
document.adminForm.boxchecked.value--;
|
872 |
+
}
|
873 |
+
}
|
874 |
+
|
875 |
+
|
876 |
+
function checkAll( n, fldName ) {
|
877 |
+
|
878 |
+
if (!fldName) {
|
879 |
+
|
880 |
+
fldName = 'cb';
|
881 |
+
|
882 |
+
}
|
883 |
+
|
884 |
+
var f = document.admin_form;
|
885 |
+
|
886 |
+
var c = f.toggle.checked;
|
887 |
+
|
888 |
+
var n2 = 0;
|
889 |
+
|
890 |
+
for (i=0; i < n; i++) {
|
891 |
+
|
892 |
+
cb = eval( 'f.' + fldName + '' + i );
|
893 |
+
|
894 |
+
if (cb) {
|
895 |
+
|
896 |
+
cb.checked = c;
|
897 |
+
|
898 |
+
n2++;
|
899 |
+
|
900 |
+
}
|
901 |
+
|
902 |
+
}
|
903 |
+
|
904 |
+
if (c) {
|
905 |
+
|
906 |
+
document.admin_form.boxchecked.value = n2;
|
907 |
+
|
908 |
+
} else {
|
909 |
+
|
910 |
+
document.admin_form.boxchecked.value = 0;
|
911 |
+
|
912 |
+
}
|
913 |
+
|
914 |
+
}
|
915 |
+
|
916 |
+
|
917 |
+
|
918 |
+
|
919 |
+
function select_events()
|
920 |
+
|
921 |
+
{
|
922 |
+
var id =[];
|
923 |
+
var title =[];
|
924 |
+
|
925 |
+
for(i=0; i<<?php echo count($rows)?>; i++)
|
926 |
+
if(document.getElementById("p"+i))
|
927 |
+
if(document.getElementById("p"+i).checked)
|
928 |
+
{
|
929 |
+
id.push(document.getElementById("p"+i).value);
|
930 |
+
title.push(document.getElementById("title_"+i).value);
|
931 |
+
|
932 |
+
}
|
933 |
+
window.parent.jSelectEvents('<?php echo $input_id ?>','<?php echo $tbody_id ?>','<?php echo $w_id ?>',id, title);
|
934 |
+
}
|
935 |
+
|
936 |
+
|
937 |
+
</script>
|
938 |
+
<?php
|
939 |
+
|
940 |
+
|
941 |
+
if(get_bloginfo( 'version' )>3.3){
|
942 |
+
|
943 |
+
?>
|
944 |
+
|
945 |
+
<link rel="stylesheet" href="<?php echo bloginfo("url") ?>/wp-admin/load-styles.php?c=0&dir=ltr&load=admin-bar,wp-admin&ver=7f0753feec257518ac1fec83d5bced6a" type="text/css" media="all">
|
946 |
+
|
947 |
+
<?php
|
948 |
+
|
949 |
+
}
|
950 |
+
|
951 |
+
else
|
952 |
+
|
953 |
+
{
|
954 |
+
|
955 |
+
?>
|
956 |
+
|
957 |
+
<link rel="stylesheet" href="<?php echo bloginfo("url") ?>/wp-admin/load-styles.php?c=1&dir=ltr&load=global,wp-admin&ver=aba7495e395713976b6073d5d07d3b17" type="text/css" media="all">
|
958 |
+
|
959 |
+
<?php
|
960 |
+
|
961 |
+
}
|
962 |
+
|
963 |
+
?>
|
964 |
+
|
965 |
+
<link rel="stylesheet" id="thickbox-css" href="<?php echo bloginfo('url')?>/wp-includes/js/thickbox/thickbox.css?ver=20111117" type="text/css" media="all">
|
966 |
+
|
967 |
+
<!---- <link rel="stylesheet" id="colors-css" href="<?php echo bloginfo('url')?>/wp-admin/css/colors-classic.css?ver=20111206" type="text/css" media="all"> --->
|
968 |
+
</head>
|
969 |
+
<body>
|
970 |
+
<form method="post" onkeypress="doNothing()" action="<?php echo admin_url('admin-ajax.php') ?>?action=upcoming&id_input=<?php echo $input_id;?>&upcalendar_id=<?php echo $calendar_id;?>&w_id=<?php echo $w_id;?>" id="admin_form" name="admin_form">
|
971 |
+
<table cellspacing="10" width="100%">
|
972 |
+
|
973 |
+
<tr>
|
974 |
+
<td width="100%"><h2>Event Manager</h2></td></td>
|
975 |
+
<td align="right" width="100%">
|
976 |
+
|
977 |
+
<button onclick="select_events();" style="width:98px; height:34px; background:url(<?php echo plugins_url('',__FILE__) ?>/front_end/images/add_but.png) no-repeat;border:none;cursor:pointer;"> </button>
|
978 |
+
</td>
|
979 |
+
</tr>
|
980 |
+
</table>
|
981 |
+
<?php
|
982 |
+
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
983 |
+
$serch_value = $_POST['search_events_by_title'];
|
984 |
+
}
|
985 |
+
else {
|
986 |
+
$serch_value = "";
|
987 |
+
}
|
988 |
+
$startdate = (isset($_POST["startdate"]) ? esc_html($_POST["startdate"]) : '');
|
989 |
+
$enddate = (isset($_POST["enddate"]) ? esc_html($_POST["enddate"]) : '');
|
990 |
+
$serch_fields = '
|
991 |
+
<div class="alignleft actions">
|
992 |
+
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
993 |
+
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()" style="border: 1px solid #DCDCEC;"/>
|
994 |
+
</div>
|
995 |
+
<div class="alignleft actions">
|
996 |
+
From: <input class="inputbox" type="text" style="width: 90px;border: 1px solid #DCDCEC;" name="startdate" id="startdate" size="10" maxlength="10" value="' . $startdate . '" />
|
997 |
+
<input type="reset" class="button" value="..." onclick="return showCalendar(\'startdate\',\'%Y-%m-%d\');">
|
998 |
+
To: <input class="inputbox" type="text" style="width: 90px;border: 1px solid #DCDCEC;" name="enddate" id="enddate" size="10" maxlength="10" value="' . $enddate . '">
|
999 |
+
<input type="reset" class="button" value="..." onclick="return showCalendar(\'enddate\',\'%Y-%m-%d\');">
|
1000 |
+
</div>
|
1001 |
+
<div class="alignleft actions">
|
1002 |
+
<input type="button" style="border: 1px solid #DCDCEC;border-radius: 10px;" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\';document.getElementById(\'serch_or_not\').value=\'search\'; document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
1003 |
+
<input type="button" style="border: 1px solid #DCDCEC;border-radius: 10px;" value="Reset" onclick="window.location.href=\'admin-ajax.php?action=upcoming&id_input='.$input_id.'&upcalendar_id='.$calendar_id.'&w_id='.$w_id.'\'" class="button-secondary action">
|
1004 |
+
</div>';
|
1005 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
1006 |
+
?>
|
1007 |
+
<style>
|
1008 |
+
.sorting-indicator {
|
1009 |
+
width: 7px;
|
1010 |
+
height: 4px;
|
1011 |
+
margin-top: 8px;
|
1012 |
+
margin-left: 7px;
|
1013 |
+
background-image: url('images/sort.gif');
|
1014 |
+
background-repeat: no-repeat;
|
1015 |
+
}
|
1016 |
+
</style>
|
1017 |
+
<table class="wp-list-table widefat fixed pages" style="width:100%">
|
1018 |
+
<thead>
|
1019 |
+
<TR>
|
1020 |
+
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px;background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);">
|
1021 |
+
<a href="javascript:ordering('id',<?php echo (($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
1022 |
+
<span>ID</span>
|
1023 |
+
<span class="sorting-indicator"></span>
|
1024 |
+
</a>
|
1025 |
+
</th>
|
1026 |
+
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);" width="20" class="manage-column column-cb check-column">
|
1027 |
+
|
1028 |
+
<input style="border: 1px solid #DCDCEC;-webkit-appearance: checkbox;" type="checkbox" name="toggle" id="toggle" value="" onclick="checkAll(<?php echo count($rows)?>, 'p')">
|
1029 |
+
|
1030 |
+
</th>
|
1031 |
+
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);" scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1032 |
+
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
1033 |
+
<span>Title</span>
|
1034 |
+
<span class="sorting-indicator"></span>
|
1035 |
+
</a>
|
1036 |
+
</th>
|
1037 |
+
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);"scope="col" id="date" class="<?php echo (($sort["sortid_by"] == "date") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1038 |
+
<a href="javascript:ordering('date',<?php echo (($sort["sortid_by"] == "date") ? $sort["1_or_2"] : "1"); ?>)">
|
1039 |
+
<span>Date</span>
|
1040 |
+
<span class="sorting-indicator"></span>
|
1041 |
+
</a>
|
1042 |
+
</th>
|
1043 |
+
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);"scope="col" id="time" class="<?php echo (($sort["sortid_by"] == "time") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1044 |
+
<a href="javascript:ordering('time',<?php echo (($sort["sortid_by"] == "time") ? $sort["1_or_2"] : "1"); ?>)">
|
1045 |
+
<span>Time</span>
|
1046 |
+
<span class="sorting-indicator"></span>
|
1047 |
+
</a>
|
1048 |
+
</th>
|
1049 |
+
</TR>
|
1050 |
+
</thead>
|
1051 |
+
<tbody>
|
1052 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
1053 |
+
<tr>
|
1054 |
+
|
1055 |
+
<td style="border-bottom: 1px solid #DCDCEC;"><?php echo $rows[$i]->id; ?></td>
|
1056 |
+
<td style="border-bottom: 1px solid #DCDCEC;">
|
1057 |
+
<input style="border: 1px solid #DCDCEC;-webkit-appearance: checkbox;" type="checkbox" id="p<?php echo $i?>" value="<?php echo $rows[$i]->id;?>" />
|
1058 |
+
<input type="hidden" id="title_<?php echo $i?>" value="<?php echo htmlspecialchars($rows[$i]->title);?>" />
|
1059 |
+
</td>
|
1060 |
+
<td style="border-bottom: 1px solid #DCDCEC;"><a href="<?php echo admin_url('admin-ajax.php') ?>?action=upcoming" onclick="window.parent.jSelectEvents('<?php echo $input_id ?>','<?php echo $tbody_id ?>','<?php echo $w_id ?>',['<?php echo $rows[$i]->id?>'],['<?php echo htmlspecialchars(addslashes($rows[$i]->title));?>'])"><?php echo $rows[$i]->title; ?></a>
|
1061 |
+
</td>
|
1062 |
+
<td style="border-bottom: 1px solid #DCDCEC;"><?php if ($rows[$i]->date_end != '0000-00-00' && $rows[$i]->date_end != '2070-12-12') echo $rows[$i]->date . ' - ' . $rows[$i]->date_end; else echo $rows[$i]->date; ?></td>
|
1063 |
+
<td style="border-bottom: 1px solid #DCDCEC;"><?php echo $rows[$i]->time ?></td>
|
1064 |
+
</tr>
|
1065 |
+
<?php } ?>
|
1066 |
+
</tbody>
|
1067 |
+
</table>
|
1068 |
+
<input type="hidden" name="boxchecked" value="0">
|
1069 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc']; ?>"/>
|
1070 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo $_POST['order_by']; ?>"/>
|
1071 |
+
<?php
|
1072 |
+
?>
|
1073 |
+
</form>
|
1074 |
+
</body>
|
1075 |
+
</html>
|
1076 |
+
<?php
|
1077 |
+
die();
|
1078 |
+
}
|
1079 |
+
|
1080 |
// Events.
|
1081 |
function html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name) {
|
1082 |
global $wpdb;
|
1127 |
<td width="100%"><h2>Event Manager for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
1128 |
<td>
|
1129 |
<p class="submit" style="padding:0px; text-align:left">
|
1130 |
+
<input class="button-primary" type="button" value="Add an Event" name="custom_parametrs" onclick="window.location.href='admin.php?page=SpiderCalendar&task=add_event&calendar_id=<?php echo $calendar_id; ?>'"/>
|
1131 |
</p>
|
1132 |
</td>
|
1133 |
<td>
|
1147 |
$startdate = (isset($_POST["startdate"]) ? esc_html($_POST["startdate"]) : '');
|
1148 |
$enddate = (isset($_POST["enddate"]) ? esc_html($_POST["enddate"]) : '');
|
1149 |
$serch_fields = '
|
1150 |
+
<div class="alignleft actions">
|
1151 |
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
1152 |
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()" />
|
1153 |
</div>
|
1189 |
<span>Time</span>
|
1190 |
<span class="sorting-indicator"></span>
|
1191 |
</a>
|
1192 |
+
</th>
|
1193 |
+
<th scope="col" id="cattitle" class="<?php echo (($sort["sortid_by"] == "cattitle") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1194 |
+
<a href="javascript:ordering('cattitle',<?php echo (($sort["sortid_by"] == "cattitle") ? $sort["1_or_2"] : "1"); ?>)">
|
1195 |
+
<span>Category</span>
|
1196 |
+
<span class="sorting-indicator"></span>
|
1197 |
+
</a>
|
1198 |
</th>
|
1199 |
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
1200 |
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
1214 |
</td>
|
1215 |
<td><?php if ($rows[$i]->date_end != '0000-00-00' && $rows[$i]->date_end != '2070-12-12') echo $rows[$i]->date . ' - ' . $rows[$i]->date_end; else echo $rows[$i]->date; ?></td>
|
1216 |
<td><?php echo $rows[$i]->time ?></td>
|
1217 |
+
<td><?php echo $rows[$i]->cattitle ?></td>
|
1218 |
<td><a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?>
|
1219 |
href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=published_event&id=<?php echo $rows[$i]->id; ?>"><?php if ($rows[$i]->published)
|
1220 |
echo 'Yes'; else echo 'No'; ?></a>
|
1265 |
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value != "" && form.selminute_to.value != "") {
|
1266 |
submitform(pressbutton);
|
1267 |
}
|
1268 |
+
|
1269 |
else {
|
1270 |
alert('Invalid Time');
|
1271 |
}
|
1272 |
}
|
1273 |
+
|
1274 |
+
|
1275 |
function submitform(pressbutton) {
|
1276 |
+
|
1277 |
+
if (document.getElementById('title').value == "") {
|
1278 |
+
alert('Provide the title:');
|
1279 |
+
}
|
1280 |
+
else {
|
1281 |
+
document.getElementById('adminForm').submit();
|
1282 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1283 |
+
document.getElementById('adminForm').submit();
|
1284 |
+
}
|
1285 |
}
|
1286 |
+
function checkhour(id,event) {
|
1287 |
if (typeof(event) != 'undefined') {
|
1288 |
var e = event; // for trans-browser compatibility
|
1289 |
var charCode = e.which || e.keyCode;
|
1301 |
}
|
1302 |
return true;
|
1303 |
}
|
1304 |
+
function check12hour(id,event) {
|
1305 |
if (typeof(event) != 'undefined') {
|
1306 |
var e = event; // for trans-browser compatibility
|
1307 |
var charCode = e.which || e.keyCode;
|
1323 |
}
|
1324 |
return true;
|
1325 |
}
|
1326 |
+
function checknumber(id,event) {
|
1327 |
if (typeof(event) != 'undefined') {
|
1328 |
var e = event; // for trans-browser compatibility
|
1329 |
var charCode = e.which || e.keyCode;
|
1333 |
}
|
1334 |
return true;
|
1335 |
}
|
1336 |
+
function checkminute(id,event) {
|
1337 |
if (typeof(event) != 'undefined') {
|
1338 |
var e = event; // for trans-browser compatibility
|
1339 |
var charCode = e.which || e.keyCode;
|
1495 |
This section allows you to create/edit the events of a particular calendar.<br/> You can add unlimited number of events for each calendar.
|
1496 |
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
1497 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
1498 |
</tr>
|
1499 |
<tbody>
|
1500 |
<tr>
|
1508 |
<?php
|
1509 |
global $wpdb;
|
1510 |
$calendar = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='" . $calendar_id . "'");
|
1511 |
+
|
1512 |
+
|
1513 |
+
$query1 = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.category, " . $wpdb->prefix . "spidercalendar_event_category.title
|
1514 |
+
FROM " . $wpdb->prefix . "spidercalendar_event
|
1515 |
+
JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
1516 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id;");
|
1517 |
+
|
1518 |
+
$query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
1519 |
+
|
1520 |
?>
|
1521 |
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>" method="post" id="adminForm" name="adminForm">
|
1522 |
<table width="95%">
|
1530 |
<td class="key"><label for="title">Title: </label></td>
|
1531 |
<td><input type="text" id="title" name="title" size="41"/></td>
|
1532 |
</tr>
|
1533 |
+
|
1534 |
+
<tr>
|
1535 |
+
<td class="key"><label for="category">Select Category: </label></td>
|
1536 |
+
<td>
|
1537 |
+
<select id="category" name="category" style="width:240px">
|
1538 |
+
<option value="0">--Select Category--</option>
|
1539 |
+
<?php foreach ($query2 as $key => $category) {
|
1540 |
+
?>
|
1541 |
+
<option value="<?php echo $category->id; ?>"><?php if(isset($category)) echo $category->title ?></option>
|
1542 |
+
<?php
|
1543 |
+
}
|
1544 |
+
?>
|
1545 |
+
</select>
|
1546 |
+
</td>
|
1547 |
+
</tr>
|
1548 |
<tr>
|
1549 |
<td class="key"><label for="date">Date: </label></td>
|
1550 |
<td>
|
1551 |
+
<input style="width:90px" class="inputbox" type="text" name="date" id="date" size="10" maxlength="10" value="" />
|
1552 |
+
<input type="reset" class="button" value="..." onclick="return showCalendar('date','%Y-%m-%d');" style="width: 31px;" />
|
1553 |
</td>
|
1554 |
</tr>
|
1555 |
<tr>
|
1556 |
<td class="key"><label for="selhour_from">Time: </label></td>
|
1557 |
<?php if ($calendar->time_format == 1) { ?>
|
1558 |
<td>
|
1559 |
+
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right" onkeypress="return check12hour('selhour_from',event)" value="" title="from"/> <b>:</b>
|
1560 |
+
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right" onkeypress="return checkminute('selminute_from',event)" value="" onblur="add_0('selminute_from')" title="from"/>
|
1561 |
<select id="select_from" name="select_from">
|
1562 |
<option selected="selected">AM</option>
|
1563 |
<option>PM</option>
|
1564 |
</select>
|
1565 |
<span style="font-size:12px"> - </span>
|
1566 |
+
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right" onkeypress="return check12hour('selhour_to',event)" value="" title="to"/> <b>:</b>
|
1567 |
+
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right" onkeypress="return checkminute('selminute_to',event)" value="" onblur="add_0('selminute_to')" title="to"/>
|
1568 |
<select id="select_to" name="select_to">
|
1569 |
<option>AM</option>
|
1570 |
<option>PM</option>
|
1572 |
</td>
|
1573 |
<?php } if ($calendar->time_format == 0) { ?>
|
1574 |
<td>
|
1575 |
+
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right" onkeypress="return checkhour('selhour_from',event)" value="" title="from" onblur="add_0('selhour_from')"/> <b>:</b>
|
1576 |
+
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right" onkeypress="return checkminute('selminute_from',event)" value="" title="from" onblur="add_0('selminute_from')"/>
|
1577 |
<span style="font-size:12px"> - </span>
|
1578 |
+
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right" onkeypress="return checkhour('selhour_to',event)" value="" title="to" onblur="add_0('selhour_to')"/> <b>:</b>
|
1579 |
+
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right" onkeypress="return checkminute('selminute_to',event)" value="" title="to" onblur="add_0('selminute_to')"/>
|
1580 |
</td>
|
1581 |
<?php }?>
|
1582 |
</tr>
|
1583 |
<tr>
|
1584 |
<td class="key"><label for="poststuff">Note: </label></td>
|
1585 |
<td>
|
1586 |
+
<div id="poststuff" style="width:100% !important;">
|
1587 |
+
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
1588 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
|
1589 |
+
<?php the_editor(stripslashes(""),"text_for_date","title" ); ?>
|
1590 |
+
</div>
|
1591 |
+
<?php }else{
|
1592 |
+
wp_editor("", "text_for_date"); }?>
|
1593 |
+
</div>
|
1594 |
</div>
|
1595 |
</td>
|
1596 |
</tr>
|
1609 |
</td>
|
1610 |
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
1611 |
<div style="width:100%">
|
1612 |
+
<fieldset class="adminform" style="margin-left: -25px;"><legend>Repeat Event</legend>
|
1613 |
<table>
|
1614 |
<tr>
|
1615 |
<td valign="top">
|
1616 |
+
<input type="radio" id="no_repeat_type" value="no_repeat" name="repeat_method" checked="checked" onchange="change_type('no_repeat')">
|
1617 |
+
<label for="no_repeat_type">Don't repeat this event</label>
|
1618 |
+
<br/>
|
1619 |
+
<input type="radio" id="daily_type" value="daily" name="repeat_method" onchange="change_type('daily');">
|
1620 |
+
<label for="daily_type">Repeat daily</label>
|
1621 |
+
<br/>
|
1622 |
+
<input type="radio" id="weekly_type" value="weekly" name="repeat_method" onchange="change_type('weekly');">
|
1623 |
+
<label for="weekly_type">Repeat weekly</label>
|
1624 |
+
<br/>
|
1625 |
+
<input type="radio" id="monthly_type" value="monthly" name="repeat_method" onchange="change_type('monthly');">
|
1626 |
+
<label for="monthly_type">Repeat monthly</label>
|
1627 |
+
<br/>
|
1628 |
+
<input type="radio" id="yearly_type" value="yearly" name="repeat_method" onchange="change_type('yearly');">
|
1629 |
+
<label for="yearly_type">Repeat yearly</label>
|
1630 |
+
<br/>
|
1631 |
</td>
|
1632 |
<td style="padding-left:10px" valign="top">
|
1633 |
<div id="daily" style="display:none">Repeat every
|
1716 |
function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
1717 |
global $wpdb;
|
1718 |
$calendar = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar");
|
1719 |
+
|
1720 |
?>
|
1721 |
<style>
|
1722 |
.calendar .button {
|
1735 |
</style>
|
1736 |
<script language="javascript" type="text/javascript">
|
1737 |
function submitform(pressbutton) {
|
1738 |
+
if (document.getElementById('title').value == "") {
|
1739 |
+
alert('Provide the title:');
|
1740 |
+
}
|
1741 |
+
else {
|
1742 |
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1743 |
document.getElementById('adminForm').submit();
|
1744 |
+
}
|
1745 |
}
|
1746 |
function submitbutton(pressbutton) {
|
1747 |
var form = document.adminForm;
|
1768 |
alert('Invalid Time');
|
1769 |
}
|
1770 |
}
|
1771 |
+
function checkhour(id,event) {
|
1772 |
+
if (typeof(event) != 'undefined') {
|
1773 |
+
var e = event; // for trans-browser compatibility
|
1774 |
+
var charCode = e.which || e.keyCode;
|
1775 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1776 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1777 |
}
|
1778 |
+
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1779 |
+
hour = parseFloat(hour);
|
1780 |
+
if (document.getSelection() != '') {
|
1781 |
+
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1782 |
}
|
1783 |
+
if ((hour < 0) || (hour > 23)) {
|
1784 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1785 |
}
|
1786 |
+
}
|
1787 |
+
return true;
|
1788 |
+
}
|
1789 |
+
function check12hour(id,event) {
|
1790 |
+
if (typeof(event) != 'undefined') {
|
1791 |
+
var e = event; // for trans-browser compatibility
|
1792 |
+
var charCode = e.which || e.keyCode;
|
1793 |
+
input = document.getElementById(id);
|
1794 |
+
if (charCode == 48 && input.value.length == 0) {
|
1795 |
+
return false;
|
1796 |
+
}
|
1797 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1798 |
+
return false;
|
1799 |
+
}
|
1800 |
+
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1801 |
+
hour = parseFloat(hour);
|
1802 |
+
if (document.getSelection() != '') {
|
1803 |
+
return true;
|
1804 |
+
}
|
1805 |
+
if ((hour < 0) || (hour > 12)) {
|
1806 |
+
return false;
|
1807 |
+
}
|
1808 |
+
}
|
1809 |
+
return true;
|
1810 |
+
}
|
1811 |
+
function checknumber(id,event) {
|
1812 |
+
if (typeof(event) != 'undefined') {
|
1813 |
+
var e = event; // for trans-browser compatibility
|
1814 |
+
var charCode = e.which || e.keyCode;
|
1815 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1816 |
+
return false;
|
1817 |
+
}
|
1818 |
+
}
|
1819 |
+
return true;
|
1820 |
+
}
|
1821 |
+
function checkminute(id,event) {
|
1822 |
+
if (typeof(event) != 'undefined') {
|
1823 |
+
var e = event; // for trans-browser compatibility
|
1824 |
+
var charCode = e.which || e.keyCode;
|
1825 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1826 |
+
return false;
|
1827 |
+
}
|
1828 |
+
minute = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1829 |
+
minute = parseFloat(minute);
|
1830 |
+
if (document.getSelection() != '') {
|
1831 |
+
return true;
|
1832 |
+
}
|
1833 |
+
if ((minute < 0) || (minute > 59)) {
|
1834 |
+
return false;
|
1835 |
}
|
|
|
1836 |
}
|
1837 |
+
return true;
|
1838 |
+
}
|
1839 |
function add_0(id) {
|
1840 |
input = document.getElementById(id);
|
1841 |
if (input.value.length == 1) {
|
1949 |
document.getElementById(id).value = document.getElementById('repeat_input').value;
|
1950 |
}
|
1951 |
</script>
|
1952 |
+
<?php $query = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.category, " . $wpdb->prefix . "spidercalendar_event_category.title as cattitle FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id");
|
1953 |
+
|
1954 |
+
$query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
1955 |
+
?>
|
1956 |
<table width="95%">
|
1957 |
<tr>
|
1958 |
<td width="100%" style="font-size:14px; font-weight:bold">
|
1961 |
This section allows you to create/edit the events of a particular calendar.<br/> You can add unlimited number of events for each calendar.
|
1962 |
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
1963 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
1964 |
</tr>
|
1965 |
<tbody>
|
1966 |
<tr>
|
1971 |
</tr>
|
1972 |
</tbody>
|
1973 |
</table>
|
1974 |
+
|
1975 |
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm">
|
1976 |
<table width="95%">
|
1977 |
<tr>
|
1984 |
<td class="key"><label for="message">Title: </label></td>
|
1985 |
<td><input type="text" id="title" name="title" size="41" value="<?php echo htmlspecialchars($row->title, ENT_QUOTES); ?>"/></td>
|
1986 |
</tr>
|
1987 |
+
<tr>
|
1988 |
+
<td class="key"><label for="category">Select Category: </label></td>
|
1989 |
+
<td>
|
1990 |
+
<select id="category" name="category" style="width:240px">
|
1991 |
+
<option value="0" <?php if ($row->category == "0") echo 'selected="selected"'; ?>><?php if(isset($category)) echo $category->title ?>--Select Category--</option>
|
1992 |
+
<?php foreach ($query2 as $key => $category) {
|
1993 |
+
?>
|
1994 |
+
<option value="<?php echo $category->id; ?>" <?php if ( $category->id == $row->category ) echo 'selected="selected"'; ?>><?php if(isset($category)) echo $category->title ?></option>
|
1995 |
+
<?php
|
1996 |
+
}
|
1997 |
+
?>
|
1998 |
+
|
1999 |
+
</select>
|
2000 |
+
</td>
|
2001 |
+
</tr>
|
2002 |
+
|
2003 |
<tr>
|
2004 |
<td class="key"><label for="message">Date: </label></td>
|
2005 |
<td>
|
2036 |
?>
|
2037 |
<?php if ($calendar->time_format == 0) { ?>
|
2038 |
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
2039 |
+
onkeypress="return checkhour('selhour_from',event)" value="<?php echo $from[0]; ?>" title="from"
|
2040 |
onblur="add_0('selhour_from')"/> <b>:</b>
|
2041 |
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
2042 |
+
onkeypress="return checkminute('selminute_from',event)" value="<?php echo substr($from[1], 0, 2); ?>"
|
2043 |
title="from" onblur="add_0('selminute_from')"/> <span style="font-size:12px"> - </span>
|
2044 |
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
2045 |
+
onkeypress="return checkhour('selhour_to',event)" value="<?php echo $to[0]; ?>" title="to"
|
2046 |
onblur="add_0('selhour_to')"/> <b>:</b>
|
2047 |
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
2048 |
+
onkeypress="return checkminute('selminute_to',event)" value="<?php echo substr($to[1], 0, 2); ?>"
|
2049 |
title="to" onblur="add_0('selminute_to')"/>
|
2050 |
+
<?php }
|
2051 |
+
if ($calendar->time_format == 1) { ?>
|
2052 |
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
2053 |
+
onkeypress="return check12hour('selhour_from',event)" value="<?php echo $from[0]; ?>" title="from"
|
2054 |
onblur="add_0('selhour_from')"/> <b>:</b>
|
2055 |
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
2056 |
+
onkeypress="return checkminute('selminute_from',event)" value="<?php echo substr($from[1], 0, 2); ?>"
|
2057 |
title="from" onblur="add_0('selminute_from')"/>
|
2058 |
<select id="select_from" name="select_from">
|
2059 |
<option <?php if (substr($from[1], 2, 2) == "AM")
|
2065 |
</select>
|
2066 |
<span style="font-size:12px"> - </span>
|
2067 |
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
2068 |
+
onkeypress="return check12hour('selhour_to',event)" value="<?php echo $to[0]; ?>" title="to"
|
2069 |
onblur="add_0('selhour_to')"/> <b>:</b>
|
2070 |
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
2071 |
+
onkeypress="return checkminute('selminute_to',event)" value="<?php echo substr($to[1], 0, 2); ?>"
|
2072 |
title="to" onblur="add_0('selminute_to')"/>
|
2073 |
<select id="select_to" name="select_to">
|
2074 |
<option <?php if (substr($to[1], 2, 2) == "AM")
|
2084 |
<tr>
|
2085 |
<td class="key"><label for="note">Note: </label></td>
|
2086 |
<td>
|
2087 |
+
<div id="poststuff" style="width:100% !important;">
|
2088 |
+
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
2089 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor(stripslashes($row->description),"text_for_date","title" ); ?>
|
2090 |
+
</div>
|
2091 |
+
<?php }else{
|
2092 |
+
if(isset($row->text_for_date)) $desc1 = $row->text_for_date;
|
2093 |
+
else $desc1 = "";
|
2094 |
+
wp_editor($desc1, "text_for_date"); }?>
|
2095 |
+
</div>
|
2096 |
</div>
|
2097 |
</td>
|
2098 |
</tr>
|
2111 |
</td>
|
2112 |
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
2113 |
<div style="width:100%">
|
2114 |
+
<fieldset class="adminform" style="margin-left: -25px;">
|
2115 |
<legend>Repeat Event</legend>
|
2116 |
<table>
|
2117 |
<tr>
|
2118 |
<td valign="top">
|
2119 |
+
<input type="radio" value="no_repeat" id="no_repeat_type" name="repeat_method" <?php if ($row->repeat_method == 'no_repeat')
|
2120 |
+
echo 'checked="checked"' ?> checked="checked" onchange="change_type('no_repeat')"/>
|
2121 |
+
<label for="no_repeat_type">Don't repeat this event</label><br/>
|
2122 |
+
|
2123 |
+
<input type="radio" value="daily" id="daily_type" name="repeat_method" <?php if ($row->repeat_method == 'daily')
|
2124 |
+
echo 'checked="checked"' ?> onchange="change_type('daily')"/>
|
2125 |
+
<label for="daily_type">Repeat daily</label><br/>
|
2126 |
+
|
2127 |
+
<input type="radio" value="weekly" id="weekly_type" name="repeat_method" <?php if ($row->repeat_method == 'weekly')
|
2128 |
+
echo 'checked="checked"' ?> onchange="change_type('weekly')"/>
|
2129 |
+
<label for="weekly_type">Repeat weekly</label>
|
2130 |
+
<br/>
|
2131 |
+
<input type="radio" value="monthly" id="monthly_type" name="repeat_method" <?php if ($row->repeat_method == 'monthly')
|
2132 |
+
echo 'checked="checked"'?> onchange="change_type('monthly')"/>
|
2133 |
+
<label for="monthly_type">Repeat monthly</label>
|
2134 |
+
<br/>
|
2135 |
+
<input type="radio" value="yearly" id="yearly_type" name="repeat_method" <?php if ($row->repeat_method == 'yearly')
|
2136 |
+
echo 'checked="checked"' ?> onchange="change_type('yearly')"/>
|
2137 |
+
<label for="yearly_type">Repeat yearly</label>
|
2138 |
+
<br/>
|
2139 |
</td>
|
2140 |
<td style="padding-left:10px" valign="top">
|
2141 |
<div id="daily" style="display:<?php if ($row->repeat_method == 'no_repeat') echo 'none'; ?>">
|
2232 |
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
2233 |
<input type="hidden" name="task" value="event"/>
|
2234 |
<input type="hidden" name="calendar" value=""/>
|
2235 |
+
</form> <?php } ?>
|
|
|
|
|
|
calendar_functions.php
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (function_exists('current_user_can')) {
|
4 |
if (!current_user_can('manage_options')) {
|
5 |
die('Access Denied');
|
6 |
}
|
@@ -10,17 +8,21 @@ function add_spider_calendar() {
|
|
10 |
html_add_spider_calendar();
|
11 |
}
|
12 |
|
13 |
-
function
|
14 |
-
|
|
|
|
|
|
|
|
|
15 |
$order = " ORDER BY title ASC";
|
16 |
$sort["default_style"] = "manage-column column-autor sortable desc";
|
17 |
$sort["sortid_by"] = "title";
|
18 |
$sort["custom_style"] = "manage-column column-title sorted asc";
|
19 |
$sort["1_or_2"] = "2";
|
20 |
if (isset($_POST['page_number'])) {
|
21 |
-
if ($_POST['asc_or_desc'] && ($_POST['asc_or_desc'] == 1)) {
|
22 |
if (isset($_POST['order_by'])) {
|
23 |
-
$sort["sortid_by"] =
|
24 |
}
|
25 |
$sort["custom_style"] = "manage-column column-title sorted asc";
|
26 |
$sort["1_or_2"] = "2";
|
@@ -32,7 +34,75 @@ function show_spider_calendar() {
|
|
32 |
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
33 |
}
|
34 |
if ($_POST['page_number']) {
|
35 |
-
$limit = ($_POST['page_number']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
else {
|
38 |
$limit = 0;
|
@@ -64,6 +134,62 @@ function show_spider_calendar() {
|
|
64 |
html_show_spider_calendar($rows, $pageNav, $sort);
|
65 |
}
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
// Edit calendar.
|
68 |
function edit_spider_calendar($id) {
|
69 |
global $wpdb;
|
@@ -96,12 +222,98 @@ function remove_spider_calendar($id) {
|
|
96 |
}
|
97 |
}
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
// Save calendar.
|
100 |
function apply_spider_calendar($id) {
|
101 |
if (!$id) {
|
102 |
echo '<h1 style="color:#00C">Error. ID does not exist.</h1>';
|
103 |
exit;
|
104 |
}
|
|
|
105 |
$title = (isset($_POST["title"]) ? esc_html(stripslashes($_POST["title"])) : '');
|
106 |
$user_type = (isset($_POST["user_type"]) ? esc_html($_POST["user_type"]) : '');
|
107 |
$time_format = (isset($_POST["time_format"]) ? (int) $_POST["time_format"] : 0);
|
@@ -162,6 +374,7 @@ function apply_spider_calendar($id) {
|
|
162 |
<?php
|
163 |
return TRUE;
|
164 |
}
|
|
|
165 |
}
|
166 |
|
167 |
// Publish/Unpublish calendar.
|
@@ -185,20 +398,24 @@ function spider_calendar_published($id) {
|
|
185 |
?>
|
186 |
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
187 |
<?php
|
|
|
|
|
188 |
}
|
189 |
}
|
190 |
|
191 |
// Event in table
|
192 |
function show_spider_event($calendar_id) {
|
193 |
-
|
194 |
$order = " ORDER BY title ASC";
|
195 |
$sort["default_style"] = "manage-column column-autor sortable desc";
|
196 |
$sort["sortid_by"] = "title";
|
197 |
$sort["custom_style"] = "manage-column column-title sorted asc";
|
198 |
$sort["1_or_2"] = "2";
|
199 |
if (isset($_POST['page_number'])) {
|
200 |
-
if (isset($_POST['
|
201 |
-
$sort["sortid_by"] = (
|
|
|
|
|
202 |
$sort["custom_style"] = "manage-column column-title sorted asc";
|
203 |
$sort["1_or_2"] = "2";
|
204 |
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
@@ -208,8 +425,8 @@ function show_spider_event($calendar_id) {
|
|
208 |
$sort["1_or_2"] = "1";
|
209 |
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
210 |
}
|
211 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
212 |
-
$limit = ((
|
213 |
}
|
214 |
else {
|
215 |
$limit = 0;
|
@@ -219,31 +436,34 @@ function show_spider_event($calendar_id) {
|
|
219 |
$limit = 0;
|
220 |
}
|
221 |
if (isset($_POST['search_events_by_title'])) {
|
222 |
-
$search_tag = $_POST['search_events_by_title'];
|
223 |
}
|
224 |
else {
|
225 |
$search_tag = "";
|
226 |
}
|
227 |
if ($search_tag) {
|
228 |
-
$where = ' AND title LIKE "%' . $search_tag . '%"';
|
229 |
}
|
230 |
else {
|
231 |
$where = '';
|
232 |
}
|
233 |
-
if (isset($_POST['startdate']) && $_POST['startdate']) {
|
234 |
-
$where .= ' AND date > \'' . $_POST['startdate'] . '\' ';
|
235 |
}
|
236 |
if (isset($_POST['enddate']) && $_POST['enddate']) {
|
237 |
-
$where .= ' AND date < \'' . $_POST['enddate'] . '\' ';
|
238 |
}
|
239 |
// Get the total number of records.
|
240 |
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=" . $calendar_id . " " . $where . " ";
|
241 |
$total = $wpdb->get_var($query);
|
242 |
$pageNav['total'] = $total;
|
243 |
$pageNav['limit'] = $limit / 20 + 1;
|
244 |
-
|
|
|
|
|
|
|
245 |
$rows = $wpdb->get_results($query);
|
246 |
-
$cal_name = $wpdb->get_var('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE id
|
247 |
html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name);
|
248 |
}
|
249 |
|
@@ -268,7 +488,9 @@ function edit_spider_event($calendar_id, $id) {
|
|
268 |
// Save event.
|
269 |
function apply_spider_event($calendar_id, $id) {
|
270 |
global $wpdb;
|
|
|
271 |
$title = ((isset($_POST['title'])) ? esc_html(stripslashes($_POST['title'])) : '');
|
|
|
272 |
$text_for_date = ((isset($_POST['text_for_date'])) ? stripslashes($_POST['text_for_date']) : '');
|
273 |
$published = ((isset($_POST['published'])) ? (int) $_POST['published'] : 1);
|
274 |
$repeat = ((isset($_POST['repeat'])) ? esc_html($_POST['repeat']) : '');
|
@@ -304,6 +526,7 @@ function apply_spider_event($calendar_id, $id) {
|
|
304 |
if ($id === -1) {
|
305 |
$save = $wpdb->insert($wpdb->prefix . 'spidercalendar_event', array(
|
306 |
'id' => NULL,
|
|
|
307 |
'title' => $title,
|
308 |
'time' => $time,
|
309 |
'calendar' => $calendar_id,
|
@@ -322,6 +545,7 @@ function apply_spider_event($calendar_id, $id) {
|
|
322 |
'userID' => ''
|
323 |
), array(
|
324 |
'%d',
|
|
|
325 |
'%s',
|
326 |
'%s',
|
327 |
'%d',
|
@@ -343,6 +567,7 @@ function apply_spider_event($calendar_id, $id) {
|
|
343 |
else {
|
344 |
$save = $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
|
345 |
'title' => $title,
|
|
|
346 |
'time' => $time,
|
347 |
'calendar' => $calendar_id,
|
348 |
'date' => $date,
|
@@ -359,6 +584,7 @@ function apply_spider_event($calendar_id, $id) {
|
|
359 |
'repeat_method' => $repeat_method
|
360 |
), array('id' => $id), array(
|
361 |
'%s',
|
|
|
362 |
'%s',
|
363 |
'%d',
|
364 |
'%s',
|
@@ -387,10 +613,11 @@ function apply_spider_event($calendar_id, $id) {
|
|
387 |
<?php
|
388 |
return FALSE;
|
389 |
}
|
|
|
390 |
}
|
391 |
|
392 |
// Publish/Unpublish event.
|
393 |
-
function published_spider_event($id) {
|
394 |
global $wpdb;
|
395 |
$publish = $wpdb->get_var('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE `id`=' . $id);
|
396 |
if ($publish) {
|
@@ -410,6 +637,8 @@ function published_spider_event($id) {
|
|
410 |
?>
|
411 |
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
412 |
<?php
|
|
|
|
|
413 |
}
|
414 |
}
|
415 |
|
@@ -428,5 +657,17 @@ function remove_spider_event($calendar_id, $id) {
|
|
428 |
<?php
|
429 |
}
|
430 |
}
|
431 |
-
|
432 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if (function_exists('current_user_can')) {
|
|
|
|
|
2 |
if (!current_user_can('manage_options')) {
|
3 |
die('Access Denied');
|
4 |
}
|
8 |
html_add_spider_calendar();
|
9 |
}
|
10 |
|
11 |
+
function spider_upcoming(){
|
12 |
+
if(isset($_GET['upcalendar_id']))
|
13 |
+
$calendar_id=(int)$_GET['upcalendar_id'];
|
14 |
+
else $calendar_id="0";
|
15 |
+
|
16 |
+
global $wpdb;
|
17 |
$order = " ORDER BY title ASC";
|
18 |
$sort["default_style"] = "manage-column column-autor sortable desc";
|
19 |
$sort["sortid_by"] = "title";
|
20 |
$sort["custom_style"] = "manage-column column-title sorted asc";
|
21 |
$sort["1_or_2"] = "2";
|
22 |
if (isset($_POST['page_number'])) {
|
23 |
+
if (esc_html($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
24 |
if (isset($_POST['order_by'])) {
|
25 |
+
$sort["sortid_by"] = esc_html($_POST['order_by']);
|
26 |
}
|
27 |
$sort["custom_style"] = "manage-column column-title sorted asc";
|
28 |
$sort["1_or_2"] = "2";
|
34 |
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
35 |
}
|
36 |
if ($_POST['page_number']) {
|
37 |
+
$limit = (esc_html($_POST['page_number'])- 1) * 20;
|
38 |
+
}
|
39 |
+
else {
|
40 |
+
$limit = 0;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
else {
|
44 |
+
$limit = 0;
|
45 |
+
}
|
46 |
+
if (isset($_POST['search_events_by_title'])) {
|
47 |
+
$search_tag = esc_html($_POST['search_events_by_title']);
|
48 |
+
}
|
49 |
+
else {
|
50 |
+
$search_tag = "";
|
51 |
+
}
|
52 |
+
|
53 |
+
if ($search_tag) {
|
54 |
+
$where = ' AND ' . $wpdb->prefix . 'spidercalendar_event.title LIKE "%' . $search_tag . '%"';
|
55 |
+
}
|
56 |
+
else {
|
57 |
+
$where = '';
|
58 |
+
}
|
59 |
+
if (isset($_POST['startdate']) && esc_html($_POST['startdate'])) {
|
60 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date > \'' . esc_html($_POST['startdate']) . '\' ';
|
61 |
+
}
|
62 |
+
if (isset($_POST['enddate']) && esc_html($_POST['enddate'])) {
|
63 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date < \'' . esc_html($_POST['enddate']) . '\' ';
|
64 |
+
}
|
65 |
+
// Get the total number of records.
|
66 |
+
|
67 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=" . $calendar_id . " " . $where . " ";
|
68 |
+
|
69 |
+
$total = $wpdb->get_var($query);
|
70 |
+
$pageNav['total'] = $total;
|
71 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
72 |
+
|
73 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=" . $calendar_id . " " . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
|
74 |
+
|
75 |
+
$rows=$wpdb->get_results($query);
|
76 |
+
|
77 |
+
|
78 |
+
html_upcoming_widget($rows, $pageNav, $sort);
|
79 |
+
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
function show_spider_calendar() {
|
84 |
+
global $wpdb;
|
85 |
+
$order = " ORDER BY title ASC";
|
86 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
87 |
+
$sort["sortid_by"] = "title";
|
88 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
89 |
+
$sort["1_or_2"] = "2";
|
90 |
+
if (isset($_POST['page_number'])) {
|
91 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
92 |
+
$sort["sortid_by"] = esc_html($_POST['order_by']);
|
93 |
+
}
|
94 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
95 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
96 |
+
$sort["1_or_2"] = "2";
|
97 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
98 |
+
}
|
99 |
+
else {
|
100 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
101 |
+
$sort["1_or_2"] = "1";
|
102 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
103 |
+
}
|
104 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
105 |
+
$limit = (esc_html($_POST['page_number']) - 1) * 20;
|
106 |
}
|
107 |
else {
|
108 |
$limit = 0;
|
134 |
html_show_spider_calendar($rows, $pageNav, $sort);
|
135 |
}
|
136 |
|
137 |
+
function show_event_cat(){
|
138 |
+
global $wpdb;
|
139 |
+
$order = " ORDER BY title ASC";
|
140 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
141 |
+
$sort["sortid_by"] = "title";
|
142 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
143 |
+
$sort["1_or_2"] = "2";
|
144 |
+
if (isset($_POST['page_number'])) {
|
145 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
146 |
+
$sort["sortid_by"] = esc_html($_POST['order_by']);
|
147 |
+
}
|
148 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
149 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
150 |
+
$sort["1_or_2"] = "2";
|
151 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
152 |
+
}
|
153 |
+
else {
|
154 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
155 |
+
$sort["1_or_2"] = "1";
|
156 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
157 |
+
}
|
158 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
159 |
+
$limit = (esc_html($_POST['page_number']) - 1) * 20;
|
160 |
+
}
|
161 |
+
else {
|
162 |
+
$limit = 0;
|
163 |
+
}
|
164 |
+
}
|
165 |
+
else {
|
166 |
+
$limit = 0;
|
167 |
+
}
|
168 |
+
if (isset($_POST['search_cat_by_title'])) {
|
169 |
+
$search_tag = esc_html($_POST['search_cat_by_title']);
|
170 |
+
}
|
171 |
+
else {
|
172 |
+
$search_tag = "";
|
173 |
+
}
|
174 |
+
if ($search_tag) {
|
175 |
+
$where = ' WHERE title LIKE "%' . $search_tag . '%"';
|
176 |
+
}
|
177 |
+
else {
|
178 |
+
$where = ' ';
|
179 |
+
}
|
180 |
+
// Get the total number of records.
|
181 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event_category" . $where;
|
182 |
+
$total = $wpdb->get_var($query);
|
183 |
+
$pageNav['total'] = $total;
|
184 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
185 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category" . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
|
186 |
+
|
187 |
+
$rows = $wpdb->get_results($query);
|
188 |
+
// display function
|
189 |
+
show_event_category($rows, $pageNav, $sort);
|
190 |
+
|
191 |
+
}
|
192 |
+
|
193 |
// Edit calendar.
|
194 |
function edit_spider_calendar($id) {
|
195 |
global $wpdb;
|
222 |
}
|
223 |
}
|
224 |
|
225 |
+
//Save Category Event
|
226 |
+
|
227 |
+
function save_spider_category_event() {
|
228 |
+
/*
|
229 |
+
if (!$id) {
|
230 |
+
echo '<h1 style="color:#00C">Error. ID does not exist.</h1>';
|
231 |
+
exit;
|
232 |
+
}
|
233 |
+
*/
|
234 |
+
if($_POST['title']!=""){
|
235 |
+
$title = (isset($_POST["title"]) ? esc_html(stripslashes($_POST["title"])) : '');
|
236 |
+
$published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
|
237 |
+
$color = (isset($_POST["color"]) ? esc_html(stripslashes($_POST["color"])) : '');
|
238 |
+
$description = (isset($_POST["description"]) ? esc_html(stripslashes($_POST["description"])) : '');
|
239 |
+
global $wpdb;
|
240 |
+
|
241 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_event_category', array(
|
242 |
+
'id' => NULL,
|
243 |
+
'title' => $title,
|
244 |
+
'published' => $published,
|
245 |
+
'color' => $color,
|
246 |
+
'description' => $description,
|
247 |
+
), array(
|
248 |
+
'%d',
|
249 |
+
'%s',
|
250 |
+
'%d',
|
251 |
+
'%s',
|
252 |
+
'%s'
|
253 |
+
));
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
+
|
258 |
+
// Publish/Unpublish category.
|
259 |
+
function spider_category_published($id) {
|
260 |
+
global $wpdb;
|
261 |
+
$publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_event_category WHERE `id`="%d"', $id));
|
262 |
+
if ($publish) {
|
263 |
+
$publish = 0;
|
264 |
+
$publish_unpublish = 'Category unpublished.';
|
265 |
+
}
|
266 |
+
else {
|
267 |
+
$publish = 1;
|
268 |
+
$publish_unpublish = 'Category published.';
|
269 |
+
}
|
270 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event_category', array(
|
271 |
+
'published' => $publish,
|
272 |
+
), array('id' => $id), array(
|
273 |
+
'%d',
|
274 |
+
));
|
275 |
+
if ($save_or_no !== FALSE) {
|
276 |
+
?>
|
277 |
+
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
278 |
+
<?php
|
279 |
+
$location_cal = admin_url('admin.php?page=spider_calendar_event_category');
|
280 |
+
header('Location: '.$location_cal.'');
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
|
285 |
+
//Apply category event
|
286 |
+
|
287 |
+
function apply_spider_category_event($id) {
|
288 |
+
|
289 |
+
$title = (isset($_POST["title"]) ? esc_html(stripslashes($_POST["title"])) : '');
|
290 |
+
$published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
|
291 |
+
$color = (isset($_POST["color"]) ? esc_html(stripslashes($_POST["color"])) : '');
|
292 |
+
$description = (isset($_POST["description"]) ? esc_html(stripslashes($_POST["description"])) : '');
|
293 |
+
global $wpdb;
|
294 |
+
|
295 |
+
|
296 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event_category', array(
|
297 |
+
'title' => $title,
|
298 |
+
'published' => $published,
|
299 |
+
'color' => $color,
|
300 |
+
'description' => $description,
|
301 |
+
), array('id' => $_POST['id']), array(
|
302 |
+
'%s',
|
303 |
+
'%d',
|
304 |
+
'%s',
|
305 |
+
'%s'
|
306 |
+
));
|
307 |
+
|
308 |
+
}
|
309 |
+
|
310 |
// Save calendar.
|
311 |
function apply_spider_calendar($id) {
|
312 |
if (!$id) {
|
313 |
echo '<h1 style="color:#00C">Error. ID does not exist.</h1>';
|
314 |
exit;
|
315 |
}
|
316 |
+
if(isset($_POST['title'])){
|
317 |
$title = (isset($_POST["title"]) ? esc_html(stripslashes($_POST["title"])) : '');
|
318 |
$user_type = (isset($_POST["user_type"]) ? esc_html($_POST["user_type"]) : '');
|
319 |
$time_format = (isset($_POST["time_format"]) ? (int) $_POST["time_format"] : 0);
|
374 |
<?php
|
375 |
return TRUE;
|
376 |
}
|
377 |
+
}
|
378 |
}
|
379 |
|
380 |
// Publish/Unpublish calendar.
|
398 |
?>
|
399 |
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
400 |
<?php
|
401 |
+
$location_cal = admin_url('admin.php?page=SpiderCalendar');
|
402 |
+
header('Location: '.$location_cal.'');
|
403 |
}
|
404 |
}
|
405 |
|
406 |
// Event in table
|
407 |
function show_spider_event($calendar_id) {
|
408 |
+
global $wpdb;
|
409 |
$order = " ORDER BY title ASC";
|
410 |
$sort["default_style"] = "manage-column column-autor sortable desc";
|
411 |
$sort["sortid_by"] = "title";
|
412 |
$sort["custom_style"] = "manage-column column-title sorted asc";
|
413 |
$sort["1_or_2"] = "2";
|
414 |
if (isset($_POST['page_number'])) {
|
415 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
416 |
+
$sort["sortid_by"] = esc_html($_POST['order_by']);
|
417 |
+
}
|
418 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
419 |
$sort["custom_style"] = "manage-column column-title sorted asc";
|
420 |
$sort["1_or_2"] = "2";
|
421 |
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
425 |
$sort["1_or_2"] = "1";
|
426 |
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
427 |
}
|
428 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
429 |
+
$limit = (esc_html($_POST['page_number']) - 1) * 20;
|
430 |
}
|
431 |
else {
|
432 |
$limit = 0;
|
436 |
$limit = 0;
|
437 |
}
|
438 |
if (isset($_POST['search_events_by_title'])) {
|
439 |
+
$search_tag = esc_html($_POST['search_events_by_title']);
|
440 |
}
|
441 |
else {
|
442 |
$search_tag = "";
|
443 |
}
|
444 |
if ($search_tag) {
|
445 |
+
$where = ' AND ' . $wpdb->prefix . 'spidercalendar_event.title LIKE "%' . $search_tag . '%"';
|
446 |
}
|
447 |
else {
|
448 |
$where = '';
|
449 |
}
|
450 |
+
if (isset($_POST['startdate']) && esc_html($_POST['startdate'])) {
|
451 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date > \'' . esc_html($_POST['startdate']) . '\' ';
|
452 |
}
|
453 |
if (isset($_POST['enddate']) && $_POST['enddate']) {
|
454 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date < \'' . esc_html($_POST['enddate']) . '\' ';
|
455 |
}
|
456 |
// Get the total number of records.
|
457 |
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=" . $calendar_id . " " . $where . " ";
|
458 |
$total = $wpdb->get_var($query);
|
459 |
$pageNav['total'] = $total;
|
460 |
$pageNav['limit'] = $limit / 20 + 1;
|
461 |
+
|
462 |
+
$query = "SELECT " . $wpdb->prefix . "spidercalendar_event.*, " . $wpdb->prefix . "spidercalendar_event_category.title as cattitle FROM " . $wpdb->prefix . "spidercalendar_event LEFT JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id
|
463 |
+
WHERE calendar=" . $calendar_id . " " . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
|
464 |
+
|
465 |
$rows = $wpdb->get_results($query);
|
466 |
+
$cal_name = $wpdb->get_var($wpdb->prepare('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $calendar_id));
|
467 |
html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name);
|
468 |
}
|
469 |
|
488 |
// Save event.
|
489 |
function apply_spider_event($calendar_id, $id) {
|
490 |
global $wpdb;
|
491 |
+
if(isset($_POST['title'])){
|
492 |
$title = ((isset($_POST['title'])) ? esc_html(stripslashes($_POST['title'])) : '');
|
493 |
+
$category = ((isset($_POST['category'])) ? esc_html(stripslashes($_POST['category'])) : '');
|
494 |
$text_for_date = ((isset($_POST['text_for_date'])) ? stripslashes($_POST['text_for_date']) : '');
|
495 |
$published = ((isset($_POST['published'])) ? (int) $_POST['published'] : 1);
|
496 |
$repeat = ((isset($_POST['repeat'])) ? esc_html($_POST['repeat']) : '');
|
526 |
if ($id === -1) {
|
527 |
$save = $wpdb->insert($wpdb->prefix . 'spidercalendar_event', array(
|
528 |
'id' => NULL,
|
529 |
+
'category' => $category,
|
530 |
'title' => $title,
|
531 |
'time' => $time,
|
532 |
'calendar' => $calendar_id,
|
545 |
'userID' => ''
|
546 |
), array(
|
547 |
'%d',
|
548 |
+
'%s',
|
549 |
'%s',
|
550 |
'%s',
|
551 |
'%d',
|
567 |
else {
|
568 |
$save = $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
|
569 |
'title' => $title,
|
570 |
+
'category' => $category,
|
571 |
'time' => $time,
|
572 |
'calendar' => $calendar_id,
|
573 |
'date' => $date,
|
584 |
'repeat_method' => $repeat_method
|
585 |
), array('id' => $id), array(
|
586 |
'%s',
|
587 |
+
'%s',
|
588 |
'%s',
|
589 |
'%d',
|
590 |
'%s',
|
613 |
<?php
|
614 |
return FALSE;
|
615 |
}
|
616 |
+
}
|
617 |
}
|
618 |
|
619 |
// Publish/Unpublish event.
|
620 |
+
function published_spider_event($calendar_id, $id) {
|
621 |
global $wpdb;
|
622 |
$publish = $wpdb->get_var('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE `id`=' . $id);
|
623 |
if ($publish) {
|
637 |
?>
|
638 |
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
639 |
<?php
|
640 |
+
$location_cal = admin_url('admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id='.$calendar_id.'');
|
641 |
+
header('Location: '.$location_cal.'');
|
642 |
}
|
643 |
}
|
644 |
|
657 |
<?php
|
658 |
}
|
659 |
}
|
660 |
+
function remove_category_event($id) {
|
661 |
+
global $wpdb;
|
662 |
+
$sql_remove_vid = "DELETE FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE id='" . $id . "'";
|
663 |
+
if (!$wpdb->query($sql_remove_vid)) {
|
664 |
+
?>
|
665 |
+
<div id="message" class="error"><p>Event Category Not Deleted.</p></div>
|
666 |
+
<?php
|
667 |
+
}
|
668 |
+
else {
|
669 |
+
?>
|
670 |
+
<div class="updated"><p><strong>Event Category Deleted.</strong></p></div>
|
671 |
+
<?php
|
672 |
+
}
|
673 |
+
} ?>
|
elements/calendar-jos.css
CHANGED
@@ -4,6 +4,7 @@ div.calendar {
|
|
4 |
position: relative;
|
5 |
z-index: 100;
|
6 |
width: 226px;
|
|
|
7 |
}
|
8 |
|
9 |
.calendar, .calendar table {
|
4 |
position: relative;
|
5 |
z-index: 100;
|
6 |
width: 226px;
|
7 |
+
margin-left: -100px;
|
8 |
}
|
9 |
|
10 |
.calendar, .calendar table {
|
featured_plugins.css
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
#main_featured_plugins_page #featured-plugins-list {
|
3 |
+
position:relative;
|
4 |
+
margin:0px auto;
|
5 |
+
width:90%;
|
6 |
+
height:auto;
|
7 |
+
display:table;
|
8 |
+
list-style:none;
|
9 |
+
}
|
10 |
+
|
11 |
+
#main_featured_plugins_page #featured-plugins-list li {
|
12 |
+
display:block;
|
13 |
+
height:113px;
|
14 |
+
padding:15px 5% 15px 5%;
|
15 |
+
margin:0px 0px 12px 0px;
|
16 |
+
background:#ededed;
|
17 |
+
}
|
18 |
+
|
19 |
+
#main_featured_plugins_page #featured-plugins-list li .product {
|
20 |
+
position:relative;
|
21 |
+
float:left;
|
22 |
+
width:35%;
|
23 |
+
height:113px;
|
24 |
+
}
|
25 |
+
|
26 |
+
#main_featured_plugins_page #featured-plugins-list li .title {
|
27 |
+
float:left;
|
28 |
+
height:113px;
|
29 |
+
width:90%;
|
30 |
+
margin:0px 0px 0px 109px;
|
31 |
+
background:#cacaca;
|
32 |
+
border-top-right-radius:3px;
|
33 |
+
border-bottom-right-radius:3px;
|
34 |
+
}
|
35 |
+
|
36 |
+
#main_featured_plugins_page #featured-plugins-list li.form-maker .product {background:url(images/form.jpg) left center no-repeat;}
|
37 |
+
#main_featured_plugins_page #featured-plugins-list li.catalog .product {background:url(images/catalog.jpg) left center no-repeat;}
|
38 |
+
#main_featured_plugins_page #featured-plugins-list li.contact-maker .product {background:url(images/contact.maker.jpg) left center no-repeat;}
|
39 |
+
#main_featured_plugins_page #featured-plugins-list li.contacts .product {background:url(images/contacts.jpg) left center no-repeat;}
|
40 |
+
#main_featured_plugins_page #featured-plugins-list li.facebook .product {background:url(images/facebook.jpg) left center no-repeat;}
|
41 |
+
#main_featured_plugins_page #featured-plugins-list li.faq .product {background:url(images/faq.jpg) left center no-repeat;}
|
42 |
+
#main_featured_plugins_page #featured-plugins-list li.flash-calendar .product {background:url(images/flash.calendar.jpg) left center no-repeat;}
|
43 |
+
#main_featured_plugins_page #featured-plugins-list li.folder-menu .product {background:url(images/folder.menu.jpg) left center no-repeat;}
|
44 |
+
#main_featured_plugins_page #featured-plugins-list li.player .product {background:url(images/player.jpg) left center no-repeat;}
|
45 |
+
#main_featured_plugins_page #featured-plugins-list li.spider-calendar .product {background:url(images/spider.calendar.jpg) left center no-repeat;}
|
46 |
+
#main_featured_plugins_page #featured-plugins-list li.zoom .product {background:url(images/zoom.jpg) left center no-repeat;}
|
47 |
+
|
48 |
+
|
49 |
+
#main_featured_plugins_page #featured-plugins-list li .title .heading {
|
50 |
+
display:block;
|
51 |
+
position:relative;
|
52 |
+
font-size:24px;
|
53 |
+
color:#014f73;
|
54 |
+
margin:30px 0px -10px 20px;
|
55 |
+
}
|
56 |
+
|
57 |
+
#main_featured_plugins_page #featured-plugins-list li .title p {
|
58 |
+
font-size:14px;
|
59 |
+
color:#444;
|
60 |
+
margin-left:20px;
|
61 |
+
}
|
62 |
+
|
63 |
+
#main_featured_plugins_page #featured-plugins-list li .description {
|
64 |
+
float:right;
|
65 |
+
width:50%;
|
66 |
+
height:113px;
|
67 |
+
}
|
68 |
+
|
69 |
+
#main_featured_plugins_page #featured-plugins-list li .description p {
|
70 |
+
text-align:right;
|
71 |
+
}
|
72 |
+
|
73 |
+
#main_featured_plugins_page #featured-plugins-list li .description a.download, #main_featured_plugins_page #featured-plugins-list li .description a.download:link, #main_featured_plugins_page #featured-plugins-list li .description a.download:visited {
|
74 |
+
display:block;
|
75 |
+
width:106px;
|
76 |
+
height:32px;
|
77 |
+
text-indent:-9999px;
|
78 |
+
background:url(images/download.jpg) left top no-repeat;
|
79 |
+
float:right;
|
80 |
+
}
|
front_end/bigcalendarday.php
CHANGED
@@ -10,6 +10,82 @@ function big_calendar_day() {
|
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
14 |
$cal_width = $theme->width;
|
15 |
$bg_top = '#' . $theme->bg_top;
|
@@ -138,6 +214,14 @@ function big_calendar_day() {
|
|
138 |
}
|
139 |
?>
|
140 |
<style type='text/css'>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
#bigcalendar<?php echo $many_sp_calendar ?> td, #bigcalendar<?php echo $many_sp_calendar ?> tr, #spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
142 |
border: none !important;
|
143 |
}
|
@@ -148,6 +232,17 @@ function big_calendar_day() {
|
|
148 |
border-top-left-radius: <?php echo $border_radius2 ?>px !important;
|
149 |
border-top-right-radius: <?php echo $border_radius2 ?>px !important;
|
150 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
#bigcalendar<?php echo $many_sp_calendar ?> . cala_arrow a : link, #bigcalendar .cala_arrow a:visited {
|
152 |
text-decoration: none !important;
|
153 |
background: none !important;
|
@@ -270,7 +365,7 @@ function big_calendar_day() {
|
|
270 |
}
|
271 |
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
272 |
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
273 |
-
border-top-right-radius: <?php echo border_radius2; ?>px;
|
274 |
}
|
275 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
276 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
@@ -339,21 +434,68 @@ function big_calendar_day() {
|
|
339 |
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
340 |
float: right;
|
341 |
background-color: <?php echo $views_tabs_bg_color; ?>;
|
342 |
-
height: 25px;
|
343 |
-
width: 70px;
|
344 |
margin-right: 2px;
|
345 |
text-align: center;
|
346 |
cursor:pointer;
|
347 |
position: relative;
|
348 |
top: 5px;
|
349 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
350 |
</style>
|
351 |
-
<div style="
|
|
|
352 |
<table cellpadding="0" cellspacing="0">
|
353 |
<tr>
|
354 |
<td>
|
355 |
-
|
356 |
-
|
|
|
357 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
358 |
'action' => 'spiderbigcalendar_day',
|
359 |
'theme_id' => $theme_id,
|
@@ -362,10 +504,13 @@ function big_calendar_day() {
|
|
362 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
363 |
'many_sp_calendar' => $many_sp_calendar,
|
364 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
365 |
'widget' => $widget,
|
366 |
-
|
|
|
367 |
</div>
|
368 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';
|
369 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
370 |
'action' => 'spiderbigcalendar_week',
|
371 |
'theme_id' => $theme_id,
|
@@ -375,10 +520,13 @@ function big_calendar_day() {
|
|
375 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
376 |
'many_sp_calendar' => $many_sp_calendar,
|
377 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
378 |
'widget' => $widget,
|
379 |
-
|
|
|
380 |
</div>
|
381 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';
|
382 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
383 |
'action' => 'spiderbigcalendar_list',
|
384 |
'theme_id' => $theme_id,
|
@@ -387,10 +535,13 @@ function big_calendar_day() {
|
|
387 |
'date' => $year . '-' . add_0((Month_num($month))),
|
388 |
'many_sp_calendar' => $many_sp_calendar,
|
389 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
390 |
'widget' => $widget,
|
391 |
-
|
|
|
392 |
</div>
|
393 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';
|
394 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
395 |
'action' => 'spiderbigcalendar_month',
|
396 |
'theme_id' => $theme_id,
|
@@ -399,21 +550,104 @@ function big_calendar_day() {
|
|
399 |
'date' => $year . '-' . add_0((Month_num($month))),
|
400 |
'many_sp_calendar' => $many_sp_calendar,
|
401 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
402 |
'widget' => $widget,
|
403 |
-
|
|
|
404 |
</div>
|
405 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
</td>
|
407 |
</tr>
|
408 |
<tr>
|
409 |
<td>
|
410 |
-
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width
|
411 |
<tr>
|
412 |
<td width="100%" style="padding:0; margin:0;">
|
413 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width
|
414 |
-
<tr style="height:40px; width
|
415 |
-
<td class="top_table" align="center" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__) ?>');padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
416 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width
|
417 |
<tr>
|
418 |
<td width="15%">
|
419 |
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
@@ -425,9 +659,11 @@ function big_calendar_day() {
|
|
425 |
'date' => ($year - 1) . '-' . add_0((Month_num($month))) . '-' . $day,
|
426 |
'many_sp_calendar' => $many_sp_calendar,
|
427 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
428 |
'widget' => $widget,
|
429 |
-
), admin_url('admin-ajax.php'));?>')" style="text-align:center; cursor:pointer; width:
|
430 |
-
<span style="
|
431 |
</div>
|
432 |
</td>
|
433 |
<td style="width:100%;vertical-align:center">
|
@@ -435,15 +671,21 @@ function big_calendar_day() {
|
|
435 |
<tr>
|
436 |
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
437 |
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
|
|
438 |
if ($day == '01' && Month_num(Month_name(Month_num($month) - 1)) != '12') {
|
439 |
$needed_date = $year . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
440 |
}
|
441 |
-
|
|
|
|
|
|
|
|
|
442 |
$needed_date = ($year - 1) . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
|
|
447 |
echo add_query_arg(array(
|
448 |
'action' => 'spiderbigcalendar_' . $defaultview,
|
449 |
'theme_id' => $theme_id,
|
@@ -452,26 +694,39 @@ function big_calendar_day() {
|
|
452 |
'date' => $needed_date,
|
453 |
'many_sp_calendar' => $many_sp_calendar,
|
454 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
455 |
'widget' => $widget,
|
456 |
), admin_url('admin-ajax.php'));
|
457 |
-
?>')">&#
|
458 |
</a>
|
459 |
</td>
|
460 |
<td style="text-align:center; margin:0;" width="40%">
|
461 |
<input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
|
462 |
-
<span style="font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size ?>px;text-shadow: 1px 1px black;"><?php echo $day . ' ' . $month . ' ' . $year ?></span>
|
463 |
</td>
|
464 |
-
|
465 |
-
|
466 |
-
if ($day == $month_day_count && Month_num(Month_name(Month_num($month) + 1)) != '1') {
|
467 |
$needed_date = $year . '-' . add_0((Month_num($month) + 1)) . '-01';
|
|
|
468 |
}
|
469 |
-
|
|
|
|
|
|
|
470 |
$needed_date = ($year + 1) . '-' . add_0(Month_num($month + 1)) . '-01';
|
|
|
471 |
}
|
472 |
else {
|
473 |
$needed_date = $year . '-' . add_0(Month_num($month)) . '-' . add_0($day + 1);
|
474 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
475 |
echo add_query_arg(array(
|
476 |
'action' => 'spiderbigcalendar_' . $defaultview,
|
477 |
'theme_id' => $theme_id,
|
@@ -480,9 +735,11 @@ function big_calendar_day() {
|
|
480 |
'date' => $needed_date,
|
481 |
'many_sp_calendar' => $many_sp_calendar,
|
482 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
483 |
'widget' => $widget,
|
484 |
), admin_url('admin-ajax.php'));
|
485 |
-
?>')">&#
|
486 |
</a>
|
487 |
</td>
|
488 |
<td width="15%">
|
@@ -495,9 +752,11 @@ function big_calendar_day() {
|
|
495 |
'date' => ($year + 1) . '-' . add_0((Month_num($month))) . '-' . $day,
|
496 |
'many_sp_calendar' => $many_sp_calendar,
|
497 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
498 |
'widget' => $widget,
|
499 |
-
), admin_url('admin-ajax.php')); ?>')" style="text-align:center; cursor:pointer; width:
|
500 |
-
<span style="
|
501 |
</div>
|
502 |
</td>
|
503 |
</tr>
|
@@ -506,9 +765,7 @@ function big_calendar_day() {
|
|
506 |
</tr>
|
507 |
</table>
|
508 |
</td>
|
509 |
-
|
510 |
-
<?php //MONTH TABLE ?>
|
511 |
-
</td>
|
512 |
</tr>
|
513 |
</tr>
|
514 |
<tr>
|
@@ -534,6 +791,8 @@ function big_calendar_day() {
|
|
534 |
$percent = $percent + ($sum / 7);
|
535 |
$percent = 107 / $percent;
|
536 |
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
|
|
|
|
537 |
$array_days = $all_calendar_files[0]['array_days'];
|
538 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
539 |
$title = $all_calendar_files[0]['title'];
|
@@ -550,10 +809,10 @@ function big_calendar_day() {
|
|
550 |
</tr>
|
551 |
<tr>
|
552 |
<td>
|
553 |
-
<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '">
|
554 |
<tr>
|
555 |
<td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ';color:' . $event_num_color . '"></td>
|
556 |
-
<td><
|
557 |
</tr>
|
558 |
</table>
|
559 |
</td>
|
@@ -565,7 +824,7 @@ function big_calendar_day() {
|
|
565 |
echo '<table style="border-spacing:0;width:100%;border-bottom:1px solid ' . $cell_border_color . '">
|
566 |
<tr>
|
567 |
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
|
568 |
-
<span style="padding-left:10px; font-size:' . $
|
569 |
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . $month . ' ' . (int) $day . ', ' . $year . ')</span>
|
570 |
</td>
|
571 |
<tr>
|
@@ -578,6 +837,16 @@ function big_calendar_day() {
|
|
578 |
$ev_title = explode('</p>', $value);
|
579 |
array_pop($ev_title);
|
580 |
for ($j = 0; $j < count($ev_title); $j++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
if (($j + 1) % 2 == 0) {
|
582 |
$color = $event_num_bg_color2;
|
583 |
$table_color = $event_bg_color2;
|
@@ -586,9 +855,10 @@ function big_calendar_day() {
|
|
586 |
$color = $event_num_bg_color1;
|
587 |
$table_color = $event_bg_color1;
|
588 |
}
|
589 |
-
|
|
|
590 |
<tr>
|
591 |
-
<td style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color
|
592 |
<td>
|
593 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration:none;color:' . $event_title_color . '; "
|
594 |
href="' . add_query_arg(array(
|
@@ -623,8 +893,123 @@ function big_calendar_day() {
|
|
623 |
</td>
|
624 |
</tr>
|
625 |
</table>
|
626 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
627 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
628 |
die();
|
629 |
}
|
630 |
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
|
13 |
+
///////////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
|
16 |
+
if(isset($_GET['cat_id']))
|
17 |
+
$cat_id = $_GET['cat_id'];
|
18 |
+
else $cat_id = "";
|
19 |
+
|
20 |
+
if(isset($_GET['cat_ids']))
|
21 |
+
$cat_ids = $_GET['cat_ids'];
|
22 |
+
else $cat_ids = "";
|
23 |
+
|
24 |
+
|
25 |
+
if($cat_ids=='')
|
26 |
+
$cat_ids .= $cat_id.',';
|
27 |
+
else
|
28 |
+
$cat_ids .= ','.$cat_id.',';
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
33 |
+
|
34 |
+
|
35 |
+
function getelementcountinarray($array , $element)
|
36 |
+
{
|
37 |
+
$t=0;
|
38 |
+
|
39 |
+
for($i=0; $i<count($array); $i++)
|
40 |
+
{
|
41 |
+
if($element==$array[$i])
|
42 |
+
$t++;
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
return $t;
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
function getelementindexinarray($array , $element)
|
52 |
+
{
|
53 |
+
|
54 |
+
$t='';
|
55 |
+
|
56 |
+
for($i=0; $i<count($array); $i++)
|
57 |
+
{
|
58 |
+
if($element==$array[$i])
|
59 |
+
$t.=$i.',';
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
return $t;
|
64 |
+
|
65 |
+
|
66 |
+
}
|
67 |
+
$cat_ids_array = explode(',',$cat_ids);
|
68 |
+
|
69 |
+
|
70 |
+
if($cat_id!='')
|
71 |
+
{
|
72 |
+
|
73 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
+
{
|
75 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
+
$index_array = explode(',' , $index_in_line);
|
77 |
+
array_pop ($index_array);
|
78 |
+
for($j=0; $j<count($index_array); $j++)
|
79 |
+
unset($cat_ids_array[$index_array[$j]]);
|
80 |
+
$cat_ids = implode(',',$cat_ids_array);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
else
|
84 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
+
|
86 |
+
|
87 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
88 |
+
|
89 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
90 |
$cal_width = $theme->width;
|
91 |
$bg_top = '#' . $theme->bg_top;
|
214 |
}
|
215 |
?>
|
216 |
<style type='text/css'>
|
217 |
+
|
218 |
+
.day_ev{
|
219 |
+
border-top-left-radius: <?php echo $border_radius2 ?>px !important;
|
220 |
+
border-top-right-radius: <?php echo $border_radius2 ?>px !important;
|
221 |
+
border-radius: <?php echo $border_radius2 ?>px !important;
|
222 |
+
border-bottom-left-radius: <?php echo $border_radius2 ?>px !important;
|
223 |
+
}
|
224 |
+
|
225 |
#bigcalendar<?php echo $many_sp_calendar ?> td, #bigcalendar<?php echo $many_sp_calendar ?> tr, #spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
226 |
border: none !important;
|
227 |
}
|
232 |
border-top-left-radius: <?php echo $border_radius2 ?>px !important;
|
233 |
border-top-right-radius: <?php echo $border_radius2 ?>px !important;
|
234 |
}
|
235 |
+
.general_table table table:last-child .day_ev:last-child td,
|
236 |
+
.general_table table table:last-child .week_list:last-child td{
|
237 |
+
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
238 |
+
|
239 |
+
}
|
240 |
+
|
241 |
+
.general_table table tr:last-child >td:last-child{
|
242 |
+
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
243 |
+
border-top-right-radius: <?php echo $border_radius2 ?>px;
|
244 |
+
}
|
245 |
+
|
246 |
#bigcalendar<?php echo $many_sp_calendar ?> . cala_arrow a : link, #bigcalendar .cala_arrow a:visited {
|
247 |
text-decoration: none !important;
|
248 |
background: none !important;
|
365 |
}
|
366 |
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
367 |
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
368 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
369 |
}
|
370 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
371 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
434 |
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
435 |
float: right;
|
436 |
background-color: <?php echo $views_tabs_bg_color; ?>;
|
437 |
+
min-height: 25px;
|
438 |
+
min-width: 70px;
|
439 |
margin-right: 2px;
|
440 |
text-align: center;
|
441 |
cursor:pointer;
|
442 |
position: relative;
|
443 |
top: 5px;
|
444 |
}
|
445 |
+
|
446 |
+
|
447 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
448 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
449 |
+
{
|
450 |
+
|
451 |
+
background-color: <?php echo $views_tabs_bg_color?>;
|
452 |
+
width: 120px;
|
453 |
+
text-align: center;
|
454 |
+
cursor: pointer;
|
455 |
+
padding: 6px;
|
456 |
+
position: relative;
|
457 |
+
}
|
458 |
+
|
459 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
460 |
+
padding: 7px;
|
461 |
+
}
|
462 |
+
|
463 |
+
#drop_down_views
|
464 |
+
{
|
465 |
+
list-style-type:none !important;
|
466 |
+
position: absolute;
|
467 |
+
top: 46px;
|
468 |
+
left: -15px;
|
469 |
+
display:none;
|
470 |
+
z-index: 4545;
|
471 |
+
|
472 |
+
}
|
473 |
+
|
474 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
475 |
+
{
|
476 |
+
background:<?php echo $bg_top ?>;
|
477 |
+
}
|
478 |
+
|
479 |
+
#drop_down_views >li
|
480 |
+
{
|
481 |
+
border-bottom:1px solid #fff !important;
|
482 |
+
}
|
483 |
+
|
484 |
+
|
485 |
+
#views_tabs_select
|
486 |
+
{
|
487 |
+
display:none;
|
488 |
+
}
|
489 |
+
|
490 |
</style>
|
491 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
492 |
+
<div style="width:100%;">
|
493 |
<table cellpadding="0" cellspacing="0">
|
494 |
<tr>
|
495 |
<td>
|
496 |
+
|
497 |
+
<div id="views_tabs" style="width: 100%;<?php echo $display ?>">
|
498 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
499 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
500 |
'action' => 'spiderbigcalendar_day',
|
501 |
'theme_id' => $theme_id,
|
504 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
505 |
'many_sp_calendar' => $many_sp_calendar,
|
506 |
'cur_page_url' => $path_sp_cal,
|
507 |
+
'cat_id' => '',
|
508 |
+
'cat_ids' => $cat_ids,
|
509 |
'widget' => $widget,
|
510 |
+
'rand' => $many_sp_calendar,
|
511 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
512 |
</div>
|
513 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
514 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
515 |
'action' => 'spiderbigcalendar_week',
|
516 |
'theme_id' => $theme_id,
|
520 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
521 |
'many_sp_calendar' => $many_sp_calendar,
|
522 |
'cur_page_url' => $path_sp_cal,
|
523 |
+
'cat_id' => '',
|
524 |
+
'cat_ids' => $cat_ids,
|
525 |
'widget' => $widget,
|
526 |
+
'rand' => $many_sp_calendar,
|
527 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
528 |
</div>
|
529 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
530 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
531 |
'action' => 'spiderbigcalendar_list',
|
532 |
'theme_id' => $theme_id,
|
535 |
'date' => $year . '-' . add_0((Month_num($month))),
|
536 |
'many_sp_calendar' => $many_sp_calendar,
|
537 |
'cur_page_url' => $path_sp_cal,
|
538 |
+
'cat_id' => '',
|
539 |
+
'cat_ids' => $cat_ids,
|
540 |
'widget' => $widget,
|
541 |
+
'rand' => $many_sp_calendar,
|
542 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
543 |
</div>
|
544 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
545 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
546 |
'action' => 'spiderbigcalendar_month',
|
547 |
'theme_id' => $theme_id,
|
550 |
'date' => $year . '-' . add_0((Month_num($month))),
|
551 |
'many_sp_calendar' => $many_sp_calendar,
|
552 |
'cur_page_url' => $path_sp_cal,
|
553 |
+
'cat_id' => '',
|
554 |
+
'cat_ids' => $cat_ids,
|
555 |
'widget' => $widget,
|
556 |
+
'rand' => $many_sp_calendar,
|
557 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
558 |
</div>
|
559 |
</div>
|
560 |
+
<div id="views_tabs_select" style="display:none" >
|
561 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?>;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
562 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
563 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
564 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
565 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
566 |
+
<span>►</span>
|
567 |
+
</div>
|
568 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
569 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
570 |
+
<div class="views_select"
|
571 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
572 |
+
'action' => 'spiderbigcalendar_day',
|
573 |
+
'theme_id' => $theme_id,
|
574 |
+
'calendar' => $calendar_id,
|
575 |
+
'select' => $view_select,
|
576 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
577 |
+
'many_sp_calendar' => $many_sp_calendar,
|
578 |
+
'cur_page_url' => $path_sp_cal,
|
579 |
+
'cat_id' => '',
|
580 |
+
'cat_ids' => $cat_ids,
|
581 |
+
'widget' => $widget,
|
582 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
583 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
584 |
+
</div>
|
585 |
+
</li>
|
586 |
+
|
587 |
+
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
588 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
589 |
+
'action' => 'spiderbigcalendar_week',
|
590 |
+
'theme_id' => $theme_id,
|
591 |
+
'calendar' => $calendar_id,
|
592 |
+
'select' => $view_select,
|
593 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
594 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
595 |
+
'many_sp_calendar' => $many_sp_calendar,
|
596 |
+
'cur_page_url' => $path_sp_cal,
|
597 |
+
'cat_id' => '',
|
598 |
+
'cat_ids' => $cat_ids,
|
599 |
+
'widget' => $widget,
|
600 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
601 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
602 |
+
</div>
|
603 |
+
</li>
|
604 |
+
|
605 |
+
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
606 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
607 |
+
'action' => 'spiderbigcalendar_list',
|
608 |
+
'theme_id' => $theme_id,
|
609 |
+
'calendar' => $calendar_id,
|
610 |
+
'select' => $view_select,
|
611 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
612 |
+
'many_sp_calendar' => $many_sp_calendar,
|
613 |
+
'cur_page_url' => $path_sp_cal,
|
614 |
+
'cat_id' => '',
|
615 |
+
'cat_ids' => $cat_ids,
|
616 |
+
'widget' => $widget,
|
617 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
618 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
619 |
+
</div>
|
620 |
+
</li>
|
621 |
+
|
622 |
+
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
623 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
624 |
+
'action' => 'spiderbigcalendar_month',
|
625 |
+
'theme_id' => $theme_id,
|
626 |
+
'calendar' => $calendar_id,
|
627 |
+
'select' => $view_select,
|
628 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
629 |
+
'many_sp_calendar' => $many_sp_calendar,
|
630 |
+
'cur_page_url' => $path_sp_cal,
|
631 |
+
'cat_id' => '',
|
632 |
+
'cat_ids' => $cat_ids,
|
633 |
+
'widget' => $widget,
|
634 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
635 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
636 |
+
|
637 |
+
</ul>
|
638 |
+
</div>
|
639 |
+
|
640 |
</td>
|
641 |
</tr>
|
642 |
<tr>
|
643 |
<td>
|
644 |
+
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%; border:<?php echo $border_color; ?> solid <?php echo $border_width; ?>px; margin:0; padding:0; background-color:<?php echo $bg_bottom; ?>;">
|
645 |
<tr>
|
646 |
<td width="100%" style="padding:0; margin:0;">
|
647 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;" >
|
648 |
+
<tr style="height:40px; width:100%;">
|
649 |
+
<td class="top_table" align="center" colspan="7" style="z-index: 5;position: relative;background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__) ?>');padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
650 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:99.8%; height:<?php echo $top_height; ?>px;">
|
651 |
<tr>
|
652 |
<td width="15%">
|
653 |
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
659 |
'date' => ($year - 1) . '-' . add_0((Month_num($month))) . '-' . $day,
|
660 |
'many_sp_calendar' => $many_sp_calendar,
|
661 |
'cur_page_url' => $path_sp_cal,
|
662 |
+
'cat_id' => '',
|
663 |
+
'cat_ids' => $cat_ids,
|
664 |
'widget' => $widget,
|
665 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:102%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
666 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year - 1; ?></span>
|
667 |
</div>
|
668 |
</td>
|
669 |
<td style="width:100%;vertical-align:center">
|
671 |
<tr>
|
672 |
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
673 |
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
674 |
+
|
675 |
if ($day == '01' && Month_num(Month_name(Month_num($month) - 1)) != '12') {
|
676 |
$needed_date = $year . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
677 |
}
|
678 |
+
|
679 |
+
else
|
680 |
+
{
|
681 |
+
if (Month_num(Month_name(Month_num($month) - 1)) == '12' && $day == '01') {
|
682 |
+
|
683 |
$needed_date = ($year - 1) . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
684 |
+
}
|
685 |
+
else {
|
686 |
+
$needed_date = $year . '-' . add_0((Month_num($month))) . '-' . add_0($day - 1);
|
687 |
+
}
|
688 |
+
}
|
689 |
echo add_query_arg(array(
|
690 |
'action' => 'spiderbigcalendar_' . $defaultview,
|
691 |
'theme_id' => $theme_id,
|
694 |
'date' => $needed_date,
|
695 |
'many_sp_calendar' => $many_sp_calendar,
|
696 |
'cur_page_url' => $path_sp_cal,
|
697 |
+
'cat_id' => '',
|
698 |
+
'cat_ids' => $cat_ids,
|
699 |
'widget' => $widget,
|
700 |
), admin_url('admin-ajax.php'));
|
701 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◀
|
702 |
</a>
|
703 |
</td>
|
704 |
<td style="text-align:center; margin:0;" width="40%">
|
705 |
<input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
|
706 |
+
<span style="line-height: 30px;font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size ?>px;text-shadow: 1px 1px black;"><?php echo $day . ' ' . __($month,'sp_calendar') . ' ' . $year ?></span>
|
707 |
</td>
|
708 |
+
<?php
|
709 |
+
if ($day == $month_day_count && Month_num(Month_name(Month_num($month) + 1)) != '1') {
|
|
|
710 |
$needed_date = $year . '-' . add_0((Month_num($month) + 1)) . '-01';
|
711 |
+
|
712 |
}
|
713 |
+
else
|
714 |
+
{
|
715 |
+
|
716 |
+
if (Month_num(Month_name(Month_num($month) + 1)) == '1' && $day == $month_day_count) {
|
717 |
$needed_date = ($year + 1) . '-' . add_0(Month_num($month + 1)) . '-01';
|
718 |
+
|
719 |
}
|
720 |
else {
|
721 |
$needed_date = $year . '-' . add_0(Month_num($month)) . '-' . add_0($day + 1);
|
722 |
}
|
723 |
+
}
|
724 |
+
|
725 |
+
?>
|
726 |
+
|
727 |
+
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
728 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
729 |
+
|
730 |
echo add_query_arg(array(
|
731 |
'action' => 'spiderbigcalendar_' . $defaultview,
|
732 |
'theme_id' => $theme_id,
|
735 |
'date' => $needed_date,
|
736 |
'many_sp_calendar' => $many_sp_calendar,
|
737 |
'cur_page_url' => $path_sp_cal,
|
738 |
+
'cat_id' => '',
|
739 |
+
'cat_ids' => $cat_ids,
|
740 |
'widget' => $widget,
|
741 |
), admin_url('admin-ajax.php'));
|
742 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">▶
|
743 |
</a>
|
744 |
</td>
|
745 |
<td width="15%">
|
752 |
'date' => ($year + 1) . '-' . add_0((Month_num($month))) . '-' . $day,
|
753 |
'many_sp_calendar' => $many_sp_calendar,
|
754 |
'cur_page_url' => $path_sp_cal,
|
755 |
+
'cat_id' => '',
|
756 |
+
'cat_ids' => $cat_ids,
|
757 |
'widget' => $widget,
|
758 |
+
), admin_url('admin-ajax.php')); ?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:102%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
759 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
760 |
</div>
|
761 |
</td>
|
762 |
</tr>
|
765 |
</tr>
|
766 |
</table>
|
767 |
</td>
|
768 |
+
|
|
|
|
|
769 |
</tr>
|
770 |
</tr>
|
771 |
<tr>
|
791 |
$percent = $percent + ($sum / 7);
|
792 |
$percent = 107 / $percent;
|
793 |
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
794 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
795 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
796 |
$array_days = $all_calendar_files[0]['array_days'];
|
797 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
798 |
$title = $all_calendar_files[0]['title'];
|
809 |
</tr>
|
810 |
<tr>
|
811 |
<td>
|
812 |
+
<table style="border-bottom-left-radius: '.$border_radius2.'px;border-bottom-right-radius: '.$border_radius2.'px;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '" class="week_list">
|
813 |
<tr>
|
814 |
<td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ';color:' . $event_num_color . '"></td>
|
815 |
+
<td><p style="color:' . $event_title_color . ';border:none;"> ' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
|
816 |
</tr>
|
817 |
</table>
|
818 |
</td>
|
824 |
echo '<table style="border-spacing:0;width:100%;border-bottom:1px solid ' . $cell_border_color . '">
|
825 |
<tr>
|
826 |
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
|
827 |
+
<span style="padding-left:10px; font-size:' . $date_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
828 |
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . $month . ' ' . (int) $day . ', ' . $year . ')</span>
|
829 |
</td>
|
830 |
<tr>
|
837 |
$ev_title = explode('</p>', $value);
|
838 |
array_pop($ev_title);
|
839 |
for ($j = 0; $j < count($ev_title); $j++) {
|
840 |
+
|
841 |
+
|
842 |
+
$query = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
843 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
|
844 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
|
845 |
+
|
846 |
+
$cat_color = $wpdb->get_row($query);
|
847 |
+
|
848 |
+
if(!isset($cat_color->color)) $cat_color->color="";
|
849 |
+
|
850 |
if (($j + 1) % 2 == 0) {
|
851 |
$color = $event_num_bg_color2;
|
852 |
$table_color = $event_bg_color2;
|
855 |
$color = $event_num_bg_color1;
|
856 |
$table_color = $event_bg_color1;
|
857 |
}
|
858 |
+
|
859 |
+
echo '<table style="margin: 0;border-spacing:0;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . ';" class="day_ev">
|
860 |
<tr>
|
861 |
+
<td style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $event_num_color . '">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
862 |
<td>
|
863 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration:none;color:' . $event_title_color . '; "
|
864 |
href="' . add_query_arg(array(
|
893 |
</td>
|
894 |
</tr>
|
895 |
</table>
|
896 |
+
|
897 |
+
<script>
|
898 |
+
|
899 |
+
jQuery(document).ready(function (){
|
900 |
+
|
901 |
+
jQuery('#views_select').click(function () {
|
902 |
+
jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
|
903 |
+
}, function () {
|
904 |
+
jQuery('#drop_down_views').stop(true, true).slideUp(500);
|
905 |
+
});
|
906 |
+
if(jQuery(window).width() > 640 )
|
907 |
+
{
|
908 |
+
jQuery('drop_down_views').hide();
|
909 |
+
}
|
910 |
+
});
|
911 |
+
</script>
|
912 |
+
|
913 |
+
|
914 |
+
<style>
|
915 |
+
|
916 |
+
@media only screen and (max-width : 640px) {
|
917 |
+
|
918 |
+
#views_tabs ,#drop_down_views
|
919 |
+
{
|
920 |
+
display:none;
|
921 |
+
}
|
922 |
+
|
923 |
+
#views_tabs_select
|
924 |
+
{
|
925 |
+
display:block !important;
|
926 |
+
}
|
927 |
+
|
928 |
+
|
929 |
+
|
930 |
+
}
|
931 |
+
|
932 |
+
@media only screen and (max-width : 968px) {
|
933 |
+
#cats >li
|
934 |
+
{
|
935 |
+
float:none;
|
936 |
+
}
|
937 |
+
|
938 |
+
|
939 |
+
|
940 |
+
}
|
941 |
+
.categories1 , .categories2
|
942 |
+
{
|
943 |
+
display:inline-block;
|
944 |
+
}
|
945 |
+
|
946 |
+
.categories2
|
947 |
+
{
|
948 |
+
position:relative;
|
949 |
+
left: -9px;
|
950 |
+
cursor:pointer;
|
951 |
+
}
|
952 |
+
.categories2:first-letter
|
953 |
+
{
|
954 |
+
color:#fff;
|
955 |
+
|
956 |
+
}
|
957 |
+
</style>
|
958 |
<?php
|
959 |
+
|
960 |
+
//reindex cat_ids_array
|
961 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
962 |
+
|
963 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
964 |
+
{
|
965 |
+
echo'
|
966 |
+
<style>
|
967 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
968 |
+
{
|
969 |
+
text-decoration:underline;
|
970 |
+
cursor:pointer;
|
971 |
+
|
972 |
+
}
|
973 |
+
|
974 |
+
</style>';
|
975 |
+
|
976 |
+
}
|
977 |
+
|
978 |
+
|
979 |
+
|
980 |
+
if($cat_ids=='')
|
981 |
+
$cat_ids='';
|
982 |
+
|
983 |
+
|
984 |
+
echo '<ul id="cats" style="list-style-type:none;">';
|
985 |
+
|
986 |
+
|
987 |
+
foreach($categories as $category)
|
988 |
+
{
|
989 |
+
|
990 |
+
?>
|
991 |
+
|
992 |
+
<li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
993 |
+
'action' => 'spiderbigcalendar_day',
|
994 |
+
'theme_id' => $theme_id,
|
995 |
+
'calendar' => $calendar_id,
|
996 |
+
'select' => $view_select,
|
997 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
998 |
+
'many_sp_calendar' => $many_sp_calendar,
|
999 |
+
'cur_page_url' => $path_sp_cal,
|
1000 |
+
'cat_id' => $category->id,
|
1001 |
+
'cat_ids' => $cat_ids,
|
1002 |
+
'widget' => $widget,
|
1003 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1004 |
+
|
1005 |
+
|
1006 |
+
<?php
|
1007 |
+
|
1008 |
+
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
echo '</ul><br><br>';
|
1012 |
+
|
1013 |
die();
|
1014 |
}
|
1015 |
|
front_end/bigcalendarday_widget.php
CHANGED
@@ -10,6 +10,82 @@ function big_calendar_day_widget() {
|
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
14 |
$weekstart = $theme->week_start_day;
|
15 |
$bg = '#' . $theme->header_bgcolor;
|
@@ -36,7 +112,7 @@ function big_calendar_day_widget() {
|
|
36 |
$font_month = $theme->font_month;
|
37 |
$font_day = $theme->font_day;
|
38 |
$font_weekday = $theme->font_weekday;
|
39 |
-
|
40 |
$popup_width = $theme->popup_width;
|
41 |
$popup_height = $theme->popup_height;
|
42 |
|
@@ -209,13 +285,54 @@ function big_calendar_day_widget() {
|
|
209 |
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
210 |
background: transparent !important;
|
211 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
</style>
|
213 |
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
214 |
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?>">
|
215 |
<tr style="background-color:#FFFFFF;">
|
216 |
<td style="background-color:#FFFFFF;">
|
217 |
-
<div id="views_tabs" style="
|
218 |
-
<div class="views" style="
|
219 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
220 |
'action' => 'spiderbigcalendar_day_widget',
|
221 |
'theme_id' => $theme_id,
|
@@ -224,8 +341,11 @@ function big_calendar_day_widget() {
|
|
224 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
225 |
'many_sp_calendar' => $many_sp_calendar,
|
226 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
227 |
'widget' => $widget,
|
228 |
-
|
|
|
229 |
</div>
|
230 |
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
231 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
@@ -237,10 +357,13 @@ function big_calendar_day_widget() {
|
|
237 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
238 |
'many_sp_calendar' => $many_sp_calendar,
|
239 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
240 |
'widget' => $widget,
|
241 |
-
|
|
|
242 |
</div>
|
243 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'
|
244 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
245 |
'action' => 'spiderbigcalendar_list_widget',
|
246 |
'theme_id' => $theme_id,
|
@@ -249,8 +372,11 @@ function big_calendar_day_widget() {
|
|
249 |
'date' => $year . '-' . add_0((Month_num($month))),
|
250 |
'many_sp_calendar' => $many_sp_calendar,
|
251 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
252 |
'widget' => $widget,
|
253 |
-
|
|
|
254 |
</div>
|
255 |
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
256 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
@@ -261,8 +387,11 @@ function big_calendar_day_widget() {
|
|
261 |
'date' => $year . '-' . add_0((Month_num($month))),
|
262 |
'many_sp_calendar' => $many_sp_calendar,
|
263 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
264 |
'widget' => $widget,
|
265 |
-
|
|
|
266 |
</div>
|
267 |
</div>
|
268 |
</td>
|
@@ -295,9 +424,12 @@ function big_calendar_day_widget() {
|
|
295 |
'date' => $needed_date,
|
296 |
'many_sp_calendar' => $many_sp_calendar,
|
297 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
298 |
'widget' => $widget,
|
|
|
299 |
), admin_url('admin-ajax.php'));
|
300 |
-
?>')">◄
|
301 |
</a>
|
302 |
</td>
|
303 |
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
@@ -323,9 +455,12 @@ function big_calendar_day_widget() {
|
|
323 |
'date' => $needed_date,
|
324 |
'many_sp_calendar' => $many_sp_calendar,
|
325 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
326 |
'widget' => $widget,
|
|
|
327 |
), admin_url('admin-ajax.php'));
|
328 |
-
?>')">►
|
329 |
</a>
|
330 |
</td>
|
331 |
</tr>
|
@@ -356,6 +491,8 @@ function big_calendar_day_widget() {
|
|
356 |
$percent = $percent + ($sum / 7);
|
357 |
$percent = 107 / $percent;
|
358 |
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
|
|
|
|
359 |
$array_days = $all_calendar_files[0]['array_days'];
|
360 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
361 |
$title = $all_calendar_files[0]['title'];
|
@@ -375,7 +512,7 @@ function big_calendar_day_widget() {
|
|
375 |
<table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5;">
|
376 |
<tr>
|
377 |
<td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
|
378 |
-
<td><
|
379 |
</tr>
|
380 |
</table>
|
381 |
</td>
|
@@ -400,6 +537,12 @@ function big_calendar_day_widget() {
|
|
400 |
$ev_title = explode('</p>', $value);
|
401 |
array_pop($ev_title);
|
402 |
for ($j = 0; $j < count($ev_title); $j++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
if (($j + 1) % 2 == 0) {
|
404 |
$color = $bg;
|
405 |
$table_color = $calendar_bg;
|
@@ -408,11 +551,12 @@ function big_calendar_day_widget() {
|
|
408 |
$color = $bg;
|
409 |
$table_color = $calendar_bg;
|
410 |
}
|
|
|
411 |
echo '<table style="border-spacing:0;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
412 |
<tr>
|
413 |
-
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color
|
414 |
<td>
|
415 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration:none;color
|
416 |
href="' . add_query_arg(array(
|
417 |
'action' => 'spidercalendarbig',
|
418 |
'theme_id' => $theme_id,
|
@@ -446,11 +590,14 @@ function big_calendar_day_widget() {
|
|
446 |
'theme_id' => $theme_id,
|
447 |
'calendar' => $calendar_id,
|
448 |
'select' => $view_select,
|
449 |
-
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
450 |
'many_sp_calendar' => $many_sp_calendar,
|
451 |
'cur_page_url' => $path_sp_cal,
|
452 |
'widget' => $widget,
|
453 |
-
|
|
|
|
|
|
|
454 |
<?php echo ($year - 1); ?>
|
455 |
</td>
|
456 |
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
@@ -462,11 +609,14 @@ function big_calendar_day_widget() {
|
|
462 |
'theme_id' => $theme_id,
|
463 |
'calendar' => $calendar_id,
|
464 |
'select' => $view_select,
|
465 |
-
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
466 |
'many_sp_calendar' => $many_sp_calendar,
|
467 |
'cur_page_url' => $path_sp_cal,
|
468 |
'widget' => $widget,
|
469 |
-
|
|
|
|
|
|
|
470 |
<?php echo ($year + 1); ?>
|
471 |
</td>
|
472 |
</tr>
|
@@ -477,7 +627,82 @@ function big_calendar_day_widget() {
|
|
477 |
</tr>
|
478 |
</table>
|
479 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
480 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
481 |
die();
|
482 |
}
|
483 |
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
|
13 |
+
///////////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
if(isset($_GET['cat_id']))
|
16 |
+
$cat_id = $_GET['cat_id'];
|
17 |
+
else $cat_id = "";
|
18 |
+
|
19 |
+
if(isset($_GET['cat_ids']))
|
20 |
+
$cat_ids = $_GET['cat_ids'];
|
21 |
+
else $cat_ids = "";
|
22 |
+
|
23 |
+
|
24 |
+
if($cat_ids=='')
|
25 |
+
$cat_ids .= $cat_id.',';
|
26 |
+
else
|
27 |
+
$cat_ids .= ','.$cat_id.',';
|
28 |
+
|
29 |
+
|
30 |
+
|
31 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
32 |
+
|
33 |
+
|
34 |
+
function getelementcountinarray($array , $element)
|
35 |
+
{
|
36 |
+
$t=0;
|
37 |
+
|
38 |
+
for($i=0; $i<count($array); $i++)
|
39 |
+
{
|
40 |
+
if($element==$array[$i])
|
41 |
+
$t++;
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
return $t;
|
47 |
+
|
48 |
+
}
|
49 |
+
|
50 |
+
function getelementindexinarray($array , $element)
|
51 |
+
{
|
52 |
+
|
53 |
+
$t='';
|
54 |
+
|
55 |
+
for($i=0; $i<count($array); $i++)
|
56 |
+
{
|
57 |
+
if($element==$array[$i])
|
58 |
+
$t.=$i.',';
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
return $t;
|
63 |
+
|
64 |
+
|
65 |
+
}
|
66 |
+
$cat_ids_array = explode(',',$cat_ids);
|
67 |
+
|
68 |
+
|
69 |
+
if($cat_id!='')
|
70 |
+
{
|
71 |
+
|
72 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
73 |
+
{
|
74 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
75 |
+
$index_array = explode(',' , $index_in_line);
|
76 |
+
array_pop ($index_array);
|
77 |
+
for($j=0; $j<count($index_array); $j++)
|
78 |
+
unset($cat_ids_array[$index_array[$j]]);
|
79 |
+
$cat_ids = implode(',',$cat_ids_array);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
else
|
83 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
84 |
+
|
85 |
+
|
86 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
87 |
+
|
88 |
+
|
89 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
90 |
$weekstart = $theme->week_start_day;
|
91 |
$bg = '#' . $theme->header_bgcolor;
|
112 |
$font_month = $theme->font_month;
|
113 |
$font_day = $theme->font_day;
|
114 |
$font_weekday = $theme->font_weekday;
|
115 |
+
$ev_title_color = $theme->ev_title_color;
|
116 |
$popup_width = $theme->popup_width;
|
117 |
$popup_height = $theme->popup_height;
|
118 |
|
285 |
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
286 |
background: transparent !important;
|
287 |
}
|
288 |
+
|
289 |
+
|
290 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
291 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
292 |
+
{
|
293 |
+
|
294 |
+
background-color: ".$views_tabs_bg_color.";
|
295 |
+
width: 120px;
|
296 |
+
text-align: center;
|
297 |
+
cursor: pointer;
|
298 |
+
padding: 6px;
|
299 |
+
position: relative;
|
300 |
+
}
|
301 |
+
|
302 |
+
|
303 |
+
#drop_down_views
|
304 |
+
{
|
305 |
+
list-style-type:none !important;
|
306 |
+
position: absolute;
|
307 |
+
top: 46px;
|
308 |
+
left: -15px;
|
309 |
+
display:none;
|
310 |
+
z-index: 4545;
|
311 |
+
|
312 |
+
}
|
313 |
+
|
314 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
315 |
+
{
|
316 |
+
background:<?php echo $bg_top ?>;
|
317 |
+
}
|
318 |
+
|
319 |
+
#drop_down_views >li
|
320 |
+
{
|
321 |
+
border-bottom:1px solid #fff !important;
|
322 |
+
}
|
323 |
+
|
324 |
+
|
325 |
+
#views_tabs_select
|
326 |
+
{
|
327 |
+
display:none;
|
328 |
+
}
|
329 |
</style>
|
330 |
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
331 |
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?>">
|
332 |
<tr style="background-color:#FFFFFF;">
|
333 |
<td style="background-color:#FFFFFF;">
|
334 |
+
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
335 |
+
<div class="views" style="margin-left: 4px;<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
336 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
337 |
'action' => 'spiderbigcalendar_day_widget',
|
338 |
'theme_id' => $theme_id,
|
341 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
342 |
'many_sp_calendar' => $many_sp_calendar,
|
343 |
'cur_page_url' => $path_sp_cal,
|
344 |
+
'cat_id' => '',
|
345 |
+
'cat_ids' => $cat_ids,
|
346 |
'widget' => $widget,
|
347 |
+
'TB_iframe' => 1,
|
348 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
349 |
</div>
|
350 |
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
351 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
357 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
358 |
'many_sp_calendar' => $many_sp_calendar,
|
359 |
'cur_page_url' => $path_sp_cal,
|
360 |
+
'cat_id' => '',
|
361 |
+
'cat_ids' => $cat_ids,
|
362 |
'widget' => $widget,
|
363 |
+
'TB_iframe' => 1,
|
364 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
365 |
</div>
|
366 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ';height:28px;top:0;' ?>"
|
367 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
368 |
'action' => 'spiderbigcalendar_list_widget',
|
369 |
'theme_id' => $theme_id,
|
372 |
'date' => $year . '-' . add_0((Month_num($month))),
|
373 |
'many_sp_calendar' => $many_sp_calendar,
|
374 |
'cur_page_url' => $path_sp_cal,
|
375 |
+
'cat_id' => '',
|
376 |
+
'cat_ids' => $cat_ids,
|
377 |
'widget' => $widget,
|
378 |
+
'TB_iframe' => 1,
|
379 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
380 |
</div>
|
381 |
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
382 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
387 |
'date' => $year . '-' . add_0((Month_num($month))),
|
388 |
'many_sp_calendar' => $many_sp_calendar,
|
389 |
'cur_page_url' => $path_sp_cal,
|
390 |
+
'cat_id' => '',
|
391 |
+
'cat_ids' => $cat_ids,
|
392 |
'widget' => $widget,
|
393 |
+
'TB_iframe' => 1,
|
394 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
395 |
</div>
|
396 |
</div>
|
397 |
</td>
|
424 |
'date' => $needed_date,
|
425 |
'many_sp_calendar' => $many_sp_calendar,
|
426 |
'cur_page_url' => $path_sp_cal,
|
427 |
+
'cat_id' => '',
|
428 |
+
'cat_ids' => $cat_ids,
|
429 |
'widget' => $widget,
|
430 |
+
'TB_iframe' => 1,
|
431 |
), admin_url('admin-ajax.php'));
|
432 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◄
|
433 |
</a>
|
434 |
</td>
|
435 |
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
455 |
'date' => $needed_date,
|
456 |
'many_sp_calendar' => $many_sp_calendar,
|
457 |
'cur_page_url' => $path_sp_cal,
|
458 |
+
'cat_id' => '',
|
459 |
+
'cat_ids' => $cat_ids,
|
460 |
'widget' => $widget,
|
461 |
+
'TB_iframe' => 1,
|
462 |
), admin_url('admin-ajax.php'));
|
463 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">►
|
464 |
</a>
|
465 |
</td>
|
466 |
</tr>
|
491 |
$percent = $percent + ($sum / 7);
|
492 |
$percent = 107 / $percent;
|
493 |
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
494 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
495 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
496 |
$array_days = $all_calendar_files[0]['array_days'];
|
497 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
498 |
$title = $all_calendar_files[0]['title'];
|
512 |
<table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5;">
|
513 |
<tr>
|
514 |
<td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
|
515 |
+
<td><p style="font-size:12px;color:' . $bg . ';border:none;"> ' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
|
516 |
</tr>
|
517 |
</table>
|
518 |
</td>
|
537 |
$ev_title = explode('</p>', $value);
|
538 |
array_pop($ev_title);
|
539 |
for ($j = 0; $j < count($ev_title); $j++) {
|
540 |
+
$query = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
541 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
|
542 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
|
543 |
+
|
544 |
+
$cat_color = $wpdb->get_row($query);
|
545 |
+
|
546 |
if (($j + 1) % 2 == 0) {
|
547 |
$color = $bg;
|
548 |
$table_color = $calendar_bg;
|
551 |
$color = $bg;
|
552 |
$table_color = $calendar_bg;
|
553 |
}
|
554 |
+
if(!isset($cat_color->color)) $cat_color->color="";
|
555 |
echo '<table style="border-spacing:0;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
556 |
<tr>
|
557 |
+
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $calendar_bg . '">' . ($j + 1) . '</td>
|
558 |
<td>
|
559 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration:none;color:#' . $ev_title_color . '; "
|
560 |
href="' . add_query_arg(array(
|
561 |
'action' => 'spidercalendarbig',
|
562 |
'theme_id' => $theme_id,
|
590 |
'theme_id' => $theme_id,
|
591 |
'calendar' => $calendar_id,
|
592 |
'select' => $view_select,
|
593 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))). '-' . $day,
|
594 |
'many_sp_calendar' => $many_sp_calendar,
|
595 |
'cur_page_url' => $path_sp_cal,
|
596 |
'widget' => $widget,
|
597 |
+
'cat_id' => '',
|
598 |
+
'cat_ids' => $cat_ids,
|
599 |
+
'TB_iframe' => 1,
|
600 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?>">
|
601 |
<?php echo ($year - 1); ?>
|
602 |
</td>
|
603 |
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
609 |
'theme_id' => $theme_id,
|
610 |
'calendar' => $calendar_id,
|
611 |
'select' => $view_select,
|
612 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))). '-' . $day,
|
613 |
'many_sp_calendar' => $many_sp_calendar,
|
614 |
'cur_page_url' => $path_sp_cal,
|
615 |
'widget' => $widget,
|
616 |
+
'cat_id' => '',
|
617 |
+
'cat_ids' => $cat_ids,
|
618 |
+
'TB_iframe' => 1,
|
619 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?>;color:<?php echo $year_font_color; ?>">
|
620 |
<?php echo ($year + 1); ?>
|
621 |
</td>
|
622 |
</tr>
|
627 |
</tr>
|
628 |
</table>
|
629 |
</div>
|
630 |
+
<style>
|
631 |
+
table{
|
632 |
+
width: 100%;
|
633 |
+
}
|
634 |
+
.categories1 , .categories2
|
635 |
+
{
|
636 |
+
display:inline-block;
|
637 |
+
}
|
638 |
+
|
639 |
+
.categories2
|
640 |
+
{
|
641 |
+
position:relative;
|
642 |
+
left: -9px;
|
643 |
+
cursor:pointer;
|
644 |
+
}
|
645 |
+
.categories2:first-letter
|
646 |
+
{
|
647 |
+
color:#fff;
|
648 |
+
|
649 |
+
}
|
650 |
+
</style>
|
651 |
<?php
|
652 |
+
|
653 |
+
//reindex cat_ids_array
|
654 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
655 |
+
|
656 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
657 |
+
{
|
658 |
+
echo'
|
659 |
+
<style>
|
660 |
+
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
661 |
+
{
|
662 |
+
text-decoration:underline;
|
663 |
+
cursor:pointer;
|
664 |
+
|
665 |
+
}
|
666 |
+
|
667 |
+
</style>';
|
668 |
+
|
669 |
+
}
|
670 |
+
|
671 |
+
|
672 |
+
|
673 |
+
if($cat_ids=='')
|
674 |
+
$cat_ids='';
|
675 |
+
|
676 |
+
|
677 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
|
678 |
+
|
679 |
+
foreach($categories as $category)
|
680 |
+
{
|
681 |
+
|
682 |
+
?>
|
683 |
+
|
684 |
+
<li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
685 |
+
'action' => 'spiderbigcalendar_day_widget',
|
686 |
+
'theme_id' => $theme_id,
|
687 |
+
'calendar' => $calendar_id,
|
688 |
+
'select' => $view_select,
|
689 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
690 |
+
'many_sp_calendar' => $many_sp_calendar,
|
691 |
+
'cur_page_url' => $path_sp_cal,
|
692 |
+
'cat_id' => $category->id,
|
693 |
+
'cat_ids' => $cat_ids,
|
694 |
+
'widget' => $widget,
|
695 |
+
'TB_iframe' => 1,
|
696 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
697 |
+
|
698 |
+
|
699 |
+
<?php
|
700 |
+
|
701 |
+
|
702 |
+
}
|
703 |
+
|
704 |
+
echo '</ul><br><br>';
|
705 |
+
|
706 |
die();
|
707 |
}
|
708 |
|
front_end/bigcalendarlist.php
CHANGED
@@ -10,6 +10,80 @@ function big_calendar_list() {
|
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
14 |
$cal_width = $theme->width;
|
15 |
$bg_top = '#' . $theme->bg_top;
|
@@ -137,6 +211,11 @@ function big_calendar_list() {
|
|
137 |
}
|
138 |
?>
|
139 |
<style type='text/css'>
|
|
|
|
|
|
|
|
|
|
|
140 |
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
141 |
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
142 |
#spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
@@ -145,10 +224,12 @@ function big_calendar_list() {
|
|
145 |
#bigcalendar<?php echo $many_sp_calendar; ?> . general_table {
|
146 |
border-radius: <?php echo $border_radius; ?>px !important;
|
147 |
}
|
148 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .
|
149 |
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
150 |
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
151 |
}
|
|
|
|
|
152 |
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : link,
|
153 |
#bigcalendar .cala_arrow a:visited {
|
154 |
text-decoration: none !important;
|
@@ -268,7 +349,7 @@ function big_calendar_list() {
|
|
268 |
}
|
269 |
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
270 |
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
271 |
-
border-top-right-radius: <?php echo border_radius2; ?>px;
|
272 |
}
|
273 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
274 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
@@ -337,21 +418,67 @@ function big_calendar_list() {
|
|
337 |
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
338 |
float: right;
|
339 |
background-color: <?php echo $views_tabs_bg_color; ?>;
|
340 |
-
height: 25px;
|
341 |
-
width: 70px;
|
342 |
margin-right: 2px;
|
343 |
text-align: center;
|
344 |
cursor:pointer;
|
345 |
position: relative;
|
346 |
top: 5px;
|
347 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
</style>
|
349 |
-
<div style="
|
|
|
350 |
<table cellpadding="0" cellspacing="0">
|
351 |
<tr>
|
352 |
<td>
|
353 |
-
|
354 |
-
|
|
|
355 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
356 |
'action' => 'spiderbigcalendar_day',
|
357 |
'theme_id' => $theme_id,
|
@@ -360,10 +487,13 @@ function big_calendar_list() {
|
|
360 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
361 |
'many_sp_calendar' => $many_sp_calendar,
|
362 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
363 |
'widget' => $widget,
|
364 |
-
|
|
|
365 |
</div>
|
366 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';
|
367 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
368 |
'action' => 'spiderbigcalendar_week',
|
369 |
'theme_id' => $theme_id,
|
@@ -373,10 +503,13 @@ function big_calendar_list() {
|
|
373 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
374 |
'many_sp_calendar' => $many_sp_calendar,
|
375 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
376 |
'widget' => $widget,
|
377 |
-
|
|
|
378 |
</div>
|
379 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';
|
380 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
381 |
'action' => 'spiderbigcalendar_list',
|
382 |
'theme_id' => $theme_id,
|
@@ -385,10 +518,13 @@ function big_calendar_list() {
|
|
385 |
'date' => $year . '-' . add_0((Month_num($month))),
|
386 |
'many_sp_calendar' => $many_sp_calendar,
|
387 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
388 |
'widget' => $widget,
|
389 |
-
|
|
|
390 |
</div>
|
391 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';
|
392 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
393 |
'action' => 'spiderbigcalendar_month',
|
394 |
'theme_id' => $theme_id,
|
@@ -397,21 +533,104 @@ function big_calendar_list() {
|
|
397 |
'date' => $year . '-' . add_0((Month_num($month))),
|
398 |
'many_sp_calendar' => $many_sp_calendar,
|
399 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
400 |
'widget' => $widget,
|
401 |
-
|
|
|
402 |
</div>
|
403 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
404 |
</td>
|
405 |
</tr>
|
406 |
<tr>
|
407 |
<td>
|
408 |
-
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width
|
409 |
<tr>
|
410 |
<td width="100%" style=" padding:0; margin:0">
|
411 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width
|
412 |
-
<tr style="height:40px; width
|
413 |
-
<td class="top_table" align="center" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');padding:0; margin:0; background-color:<?php echo $bg_top ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%; " >
|
414 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width
|
415 |
<tr>
|
416 |
<td style="width:100%;vertical-align:center">
|
417 |
<table style="width:100%;">
|
@@ -426,9 +645,11 @@ function big_calendar_list() {
|
|
426 |
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
427 |
'many_sp_calendar' => $many_sp_calendar,
|
428 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
429 |
'widget' => $widget,
|
430 |
-
), admin_url('admin-ajax.php'));?>')" style="text-align:center; cursor:pointer; width:100%;
|
431 |
-
<span style="
|
432 |
</div>
|
433 |
</td>
|
434 |
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
@@ -447,13 +668,15 @@ function big_calendar_list() {
|
|
447 |
'date' => $needed_date,
|
448 |
'many_sp_calendar' => $many_sp_calendar,
|
449 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
450 |
'widget' => $widget,
|
451 |
-
), admin_url('admin-ajax.php'));?>')">&#
|
452 |
</a>
|
453 |
</td>
|
454 |
<td style="text-align:center; margin:0;" width="40%">
|
455 |
<input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
|
456 |
-
<span style="font-family:arial; color:<?php echo $text_color_month;?>; font-size:<?php echo $month_font_size ?>px;text-shadow: 1px 1px black;"><?php echo $year . ', ' . __($month, 'sp_calendar'); ?></span>
|
457 |
</td>
|
458 |
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
459 |
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
@@ -471,8 +694,10 @@ function big_calendar_list() {
|
|
471 |
'date' => $needed_date,
|
472 |
'many_sp_calendar' => $many_sp_calendar,
|
473 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
474 |
'widget' => $widget,
|
475 |
-
), admin_url('admin-ajax.php'));?>')">&#
|
476 |
</a>
|
477 |
</td>
|
478 |
<td width="15%">
|
@@ -485,9 +710,11 @@ function big_calendar_list() {
|
|
485 |
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
486 |
'many_sp_calendar' => $many_sp_calendar,
|
487 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
488 |
'widget' => $widget,
|
489 |
-
), admin_url('admin-ajax.php'));?>')" style="text-align:center; cursor:pointer; width:100%;
|
490 |
-
<span style="
|
491 |
</div>
|
492 |
</td>
|
493 |
</tr>
|
@@ -496,9 +723,7 @@ function big_calendar_list() {
|
|
496 |
</tr>
|
497 |
</table>
|
498 |
</td>
|
499 |
-
|
500 |
-
<?php //MONTH TABLE ?>
|
501 |
-
</td>
|
502 |
</tr>
|
503 |
</tr>
|
504 |
<tr>
|
@@ -524,16 +749,21 @@ function big_calendar_list() {
|
|
524 |
$percent = $percent + ($sum / 7);
|
525 |
$percent = 107 / $percent;
|
526 |
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
|
|
|
|
|
|
527 |
$array_days = $all_calendar_files[0]['array_days'];
|
528 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
529 |
$title = $all_calendar_files[0]['title'];
|
530 |
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
|
|
|
|
531 |
sort($array_days, SORT_NUMERIC);
|
532 |
if (!$array_days) {
|
533 |
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '">
|
534 |
<tr>
|
535 |
<td style="padding-left:10px; font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ';color:' . $event_num_color . '"></td>
|
536 |
-
<td><
|
537 |
</tr>
|
538 |
</table>';
|
539 |
}
|
@@ -542,7 +772,7 @@ function big_calendar_list() {
|
|
542 |
echo '<table style="width:100%;border-spacing:0;">
|
543 |
<tr>
|
544 |
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
|
545 |
-
<span style="padding-left:10px; font-size:' . $
|
546 |
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . add_0($array_days[$i]) . ' ' . $month . ')</span>
|
547 |
</td>
|
548 |
</tr>
|
@@ -556,6 +786,12 @@ function big_calendar_list() {
|
|
556 |
$ev_title = explode('</p>', $value);
|
557 |
array_pop($ev_title);
|
558 |
for ($j = 0; $j < count($ev_title); $j++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
559 |
if (($j + 1) % 2 == 0) {
|
560 |
$color = $event_num_bg_color2;
|
561 |
$table_color = $event_bg_color2;
|
@@ -564,9 +800,10 @@ function big_calendar_list() {
|
|
564 |
$color = $event_num_bg_color1;
|
565 |
$table_color = $event_bg_color1;
|
566 |
}
|
567 |
-
|
|
|
568 |
<tr>
|
569 |
-
<td style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color
|
570 |
<td>
|
571 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color:' . $event_title_color . ';"
|
572 |
href="' . add_query_arg(array(
|
@@ -601,8 +838,122 @@ function big_calendar_list() {
|
|
601 |
</td>
|
602 |
</tr>
|
603 |
</table>
|
604 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
605 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
606 |
die();
|
607 |
}
|
608 |
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
|
13 |
+
///////////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
|
16 |
+
if(isset($_GET['cat_id']))
|
17 |
+
$cat_id = $_GET['cat_id'];
|
18 |
+
else $cat_id = "";
|
19 |
+
|
20 |
+
if(isset($_GET['cat_ids']))
|
21 |
+
$cat_ids = $_GET['cat_ids'];
|
22 |
+
else $cat_ids = "";
|
23 |
+
|
24 |
+
|
25 |
+
if($cat_ids=='')
|
26 |
+
$cat_ids .= $cat_id.',';
|
27 |
+
else
|
28 |
+
$cat_ids .= ','.$cat_id.',';
|
29 |
+
|
30 |
+
|
31 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
32 |
+
|
33 |
+
|
34 |
+
function getelementcountinarray($array , $element)
|
35 |
+
{
|
36 |
+
$t=0;
|
37 |
+
|
38 |
+
for($i=0; $i<count($array); $i++)
|
39 |
+
{
|
40 |
+
if($element==$array[$i])
|
41 |
+
$t++;
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
return $t;
|
47 |
+
|
48 |
+
}
|
49 |
+
|
50 |
+
function getelementindexinarray($array , $element)
|
51 |
+
{
|
52 |
+
|
53 |
+
$t='';
|
54 |
+
|
55 |
+
for($i=0; $i<count($array); $i++)
|
56 |
+
{
|
57 |
+
if($element==$array[$i])
|
58 |
+
$t.=$i.',';
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
return $t;
|
63 |
+
|
64 |
+
|
65 |
+
}
|
66 |
+
$cat_ids_array = explode(',',$cat_ids);
|
67 |
+
|
68 |
+
if($cat_id!='')
|
69 |
+
{
|
70 |
+
|
71 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
72 |
+
{
|
73 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
74 |
+
$index_array = explode(',' , $index_in_line);
|
75 |
+
array_pop ($index_array);
|
76 |
+
for($j=0; $j<count($index_array); $j++)
|
77 |
+
unset($cat_ids_array[$index_array[$j]]);
|
78 |
+
$cat_ids = implode(',',$cat_ids_array);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
else
|
82 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
83 |
+
|
84 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
85 |
+
|
86 |
+
|
87 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
88 |
$cal_width = $theme->width;
|
89 |
$bg_top = '#' . $theme->bg_top;
|
211 |
}
|
212 |
?>
|
213 |
<style type='text/css'>
|
214 |
+
.general_table table table:last-child .last_table:last-child td{
|
215 |
+
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
216 |
+
|
217 |
+
}
|
218 |
+
|
219 |
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
220 |
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
221 |
#spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
224 |
#bigcalendar<?php echo $many_sp_calendar; ?> . general_table {
|
225 |
border-radius: <?php echo $border_radius; ?>px !important;
|
226 |
}
|
227 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
228 |
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
229 |
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
230 |
}
|
231 |
+
|
232 |
+
|
233 |
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : link,
|
234 |
#bigcalendar .cala_arrow a:visited {
|
235 |
text-decoration: none !important;
|
349 |
}
|
350 |
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
351 |
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
352 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
353 |
}
|
354 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
355 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
418 |
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
419 |
float: right;
|
420 |
background-color: <?php echo $views_tabs_bg_color; ?>;
|
421 |
+
min-height: 25px;
|
422 |
+
min-width: 70px;
|
423 |
margin-right: 2px;
|
424 |
text-align: center;
|
425 |
cursor:pointer;
|
426 |
position: relative;
|
427 |
top: 5px;
|
428 |
}
|
429 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
430 |
+
padding: 7px;
|
431 |
+
}
|
432 |
+
|
433 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
434 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
435 |
+
{
|
436 |
+
|
437 |
+
background-color: <?php echo $views_tabs_bg_color?>;
|
438 |
+
width: 120px;
|
439 |
+
text-align: center;
|
440 |
+
cursor: pointer;
|
441 |
+
padding: 6px;
|
442 |
+
position: relative;
|
443 |
+
}
|
444 |
+
|
445 |
+
|
446 |
+
#drop_down_views
|
447 |
+
{
|
448 |
+
list-style-type:none !important;
|
449 |
+
position: absolute;
|
450 |
+
top: 46px;
|
451 |
+
left: -15px;
|
452 |
+
display:none;
|
453 |
+
z-index: 4545;
|
454 |
+
|
455 |
+
}
|
456 |
+
|
457 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
458 |
+
{
|
459 |
+
background:<?php echo $bg_top ?>;
|
460 |
+
}
|
461 |
+
|
462 |
+
#drop_down_views >li
|
463 |
+
{
|
464 |
+
border-bottom:1px solid #fff !important;
|
465 |
+
}
|
466 |
+
|
467 |
+
|
468 |
+
#views_tabs_select
|
469 |
+
{
|
470 |
+
display:none;
|
471 |
+
}
|
472 |
+
|
473 |
</style>
|
474 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
475 |
+
<div style="width:100%;">
|
476 |
<table cellpadding="0" cellspacing="0">
|
477 |
<tr>
|
478 |
<td>
|
479 |
+
|
480 |
+
<div id="views_tabs" style="width: 100.4%;<?php echo $display; ?>">
|
481 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
482 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
483 |
'action' => 'spiderbigcalendar_day',
|
484 |
'theme_id' => $theme_id,
|
487 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
488 |
'many_sp_calendar' => $many_sp_calendar,
|
489 |
'cur_page_url' => $path_sp_cal,
|
490 |
+
'cat_id' => '',
|
491 |
+
'cat_ids' => $cat_ids,
|
492 |
'widget' => $widget,
|
493 |
+
'rand' => $many_sp_calendar,
|
494 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
495 |
</div>
|
496 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
497 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
498 |
'action' => 'spiderbigcalendar_week',
|
499 |
'theme_id' => $theme_id,
|
503 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
504 |
'many_sp_calendar' => $many_sp_calendar,
|
505 |
'cur_page_url' => $path_sp_cal,
|
506 |
+
'cat_id' => '',
|
507 |
+
'cat_ids' => $cat_ids,
|
508 |
'widget' => $widget,
|
509 |
+
'rand' => $many_sp_calendar,
|
510 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
511 |
</div>
|
512 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
513 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
514 |
'action' => 'spiderbigcalendar_list',
|
515 |
'theme_id' => $theme_id,
|
518 |
'date' => $year . '-' . add_0((Month_num($month))),
|
519 |
'many_sp_calendar' => $many_sp_calendar,
|
520 |
'cur_page_url' => $path_sp_cal,
|
521 |
+
'cat_id' => '',
|
522 |
+
'cat_ids' => $cat_ids,
|
523 |
'widget' => $widget,
|
524 |
+
'rand' => $many_sp_calendar,
|
525 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
526 |
</div>
|
527 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
528 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
529 |
'action' => 'spiderbigcalendar_month',
|
530 |
'theme_id' => $theme_id,
|
533 |
'date' => $year . '-' . add_0((Month_num($month))),
|
534 |
'many_sp_calendar' => $many_sp_calendar,
|
535 |
'cur_page_url' => $path_sp_cal,
|
536 |
+
'cat_id' => '',
|
537 |
+
'cat_ids' => $cat_ids,
|
538 |
'widget' => $widget,
|
539 |
+
'rand' => $many_sp_calendar,
|
540 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
541 |
</div>
|
542 |
</div>
|
543 |
+
|
544 |
+
<div id="views_tabs_select" style="display:none" >
|
545 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?>;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
546 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
547 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
548 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
549 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
550 |
+
<span>►</span>
|
551 |
+
</div>
|
552 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
553 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
554 |
+
<div class="views_select"
|
555 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
556 |
+
'action' => 'spiderbigcalendar_month',
|
557 |
+
'theme_id' => $theme_id,
|
558 |
+
'calendar' => $calendar_id,
|
559 |
+
'select' => $view_select,
|
560 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
561 |
+
'many_sp_calendar' => $many_sp_calendar,
|
562 |
+
'cur_page_url' => $path_sp_cal,
|
563 |
+
'cat_id' => '',
|
564 |
+
'cat_ids' => $cat_ids,
|
565 |
+
'widget' => $widget,
|
566 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
567 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
568 |
+
</div>
|
569 |
+
</li>
|
570 |
+
|
571 |
+
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
572 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
573 |
+
'action' => 'spiderbigcalendar_week',
|
574 |
+
'theme_id' => $theme_id,
|
575 |
+
'calendar' => $calendar_id,
|
576 |
+
'select' => $view_select,
|
577 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
578 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
579 |
+
'many_sp_calendar' => $many_sp_calendar,
|
580 |
+
'cur_page_url' => $path_sp_cal,
|
581 |
+
'cat_id' => '',
|
582 |
+
'cat_ids' => $cat_ids,
|
583 |
+
'widget' => $widget,
|
584 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
585 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
586 |
+
</div>
|
587 |
+
</li>
|
588 |
+
|
589 |
+
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
590 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
591 |
+
'action' => 'spiderbigcalendar_list',
|
592 |
+
'theme_id' => $theme_id,
|
593 |
+
'calendar' => $calendar_id,
|
594 |
+
'select' => $view_select,
|
595 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
596 |
+
'many_sp_calendar' => $many_sp_calendar,
|
597 |
+
'cur_page_url' => $path_sp_cal,
|
598 |
+
'cat_id' => '',
|
599 |
+
'cat_ids' => $cat_ids,
|
600 |
+
'widget' => $widget,
|
601 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
602 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
603 |
+
</div>
|
604 |
+
</li>
|
605 |
+
|
606 |
+
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
607 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
608 |
+
'action' => 'spiderbigcalendar_month',
|
609 |
+
'theme_id' => $theme_id,
|
610 |
+
'calendar' => $calendar_id,
|
611 |
+
'select' => $view_select,
|
612 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
613 |
+
'many_sp_calendar' => $many_sp_calendar,
|
614 |
+
'cur_page_url' => $path_sp_cal,
|
615 |
+
'cat_id' => '',
|
616 |
+
'cat_ids' => $cat_ids,
|
617 |
+
'widget' => $widget,
|
618 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
619 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
620 |
+
|
621 |
+
</ul>
|
622 |
+
</div>
|
623 |
</td>
|
624 |
</tr>
|
625 |
<tr>
|
626 |
<td>
|
627 |
+
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%;border:<?php echo $border_color ?> solid <?php echo $border_width ?>px; margin:0; padding:0;background-color:<?php echo $bg_bottom; ?>;">
|
628 |
<tr>
|
629 |
<td width="100%" style=" padding:0; margin:0">
|
630 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100.3%">
|
631 |
+
<tr style="height:40px; width:100%;">
|
632 |
+
<td class="top_table" align="center" colspan="7" style="z-index: 5;position: relative;background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');padding:0; margin:0; background-color:<?php echo $bg_top ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%; " >
|
633 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:100%; height:<?php echo $top_height ?>px;">
|
634 |
<tr>
|
635 |
<td style="width:100%;vertical-align:center">
|
636 |
<table style="width:100%;">
|
645 |
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
646 |
'many_sp_calendar' => $many_sp_calendar,
|
647 |
'cur_page_url' => $path_sp_cal,
|
648 |
+
'cat_id' => '',
|
649 |
+
'cat_ids' => $cat_ids,
|
650 |
'widget' => $widget,
|
651 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
652 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year-1; ?></span>
|
653 |
</div>
|
654 |
</td>
|
655 |
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
668 |
'date' => $needed_date,
|
669 |
'many_sp_calendar' => $many_sp_calendar,
|
670 |
'cur_page_url' => $path_sp_cal,
|
671 |
+
'cat_id' => '',
|
672 |
+
'cat_ids' => $cat_ids,
|
673 |
'widget' => $widget,
|
674 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◀
|
675 |
</a>
|
676 |
</td>
|
677 |
<td style="text-align:center; margin:0;" width="40%">
|
678 |
<input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
|
679 |
+
<span style="line-height: 30px;font-family:arial; color:<?php echo $text_color_month;?>; font-size:<?php echo $month_font_size ?>px;text-shadow: 1px 1px black;"><?php echo $year . ', ' . __($month, 'sp_calendar'); ?></span>
|
680 |
</td>
|
681 |
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
682 |
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
694 |
'date' => $needed_date,
|
695 |
'many_sp_calendar' => $many_sp_calendar,
|
696 |
'cur_page_url' => $path_sp_cal,
|
697 |
+
'cat_id' => '',
|
698 |
+
'cat_ids' => $cat_ids,
|
699 |
'widget' => $widget,
|
700 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">▶
|
701 |
</a>
|
702 |
</td>
|
703 |
<td width="15%">
|
710 |
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
711 |
'many_sp_calendar' => $many_sp_calendar,
|
712 |
'cur_page_url' => $path_sp_cal,
|
713 |
+
'cat_id' => '',
|
714 |
+
'cat_ids' => $cat_ids,
|
715 |
'widget' => $widget,
|
716 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
717 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
718 |
</div>
|
719 |
</td>
|
720 |
</tr>
|
723 |
</tr>
|
724 |
</table>
|
725 |
</td>
|
726 |
+
|
|
|
|
|
727 |
</tr>
|
728 |
</tr>
|
729 |
<tr>
|
749 |
$percent = $percent + ($sum / 7);
|
750 |
$percent = 107 / $percent;
|
751 |
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
752 |
+
|
753 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
754 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
755 |
$array_days = $all_calendar_files[0]['array_days'];
|
756 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
757 |
$title = $all_calendar_files[0]['title'];
|
758 |
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
759 |
+
|
760 |
+
|
761 |
sort($array_days, SORT_NUMERIC);
|
762 |
if (!$array_days) {
|
763 |
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '">
|
764 |
<tr>
|
765 |
<td style="padding-left:10px; font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ';color:' . $event_num_color . '"></td>
|
766 |
+
<td><p style="color:' . $event_title_color . '; border:none"> ' . __('There Is No Event In This Month', 'sp_calendar') . '</p></td>
|
767 |
</tr>
|
768 |
</table>';
|
769 |
}
|
772 |
echo '<table style="width:100%;border-spacing:0;">
|
773 |
<tr>
|
774 |
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
|
775 |
+
<span style="padding-left:10px; font-size:' . $date_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
776 |
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . add_0($array_days[$i]) . ' ' . $month . ')</span>
|
777 |
</td>
|
778 |
</tr>
|
786 |
$ev_title = explode('</p>', $value);
|
787 |
array_pop($ev_title);
|
788 |
for ($j = 0; $j < count($ev_title); $j++) {
|
789 |
+
$queryy = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
790 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
|
791 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
|
792 |
+
|
793 |
+
$cat_color = $wpdb->get_row($queryy);
|
794 |
+
|
795 |
if (($j + 1) % 2 == 0) {
|
796 |
$color = $event_num_bg_color2;
|
797 |
$table_color = $event_bg_color2;
|
800 |
$color = $event_num_bg_color1;
|
801 |
$table_color = $event_bg_color1;
|
802 |
}
|
803 |
+
if(!isset($cat_color->color)) $cat_color->color="";
|
804 |
+
echo '<table class="last_table" style="overflow:hidden;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . ';">
|
805 |
<tr>
|
806 |
+
<td style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $event_num_color . '">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
807 |
<td>
|
808 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color:' . $event_title_color . ';"
|
809 |
href="' . add_query_arg(array(
|
838 |
</td>
|
839 |
</tr>
|
840 |
</table>
|
841 |
+
|
842 |
+
<script>
|
843 |
+
|
844 |
+
jQuery(document).ready(function (){
|
845 |
+
|
846 |
+
jQuery('#views_select').click(function () {
|
847 |
+
jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
|
848 |
+
}, function () {
|
849 |
+
jQuery('#drop_down_views').stop(true, true).slideUp(500);
|
850 |
+
});
|
851 |
+
if(jQuery(window).width() > 640 )
|
852 |
+
{
|
853 |
+
jQuery('drop_down_views').hide();
|
854 |
+
}
|
855 |
+
});
|
856 |
+
</script>
|
857 |
+
|
858 |
+
|
859 |
+
<style>
|
860 |
+
|
861 |
+
@media only screen and (max-width : 640px) {
|
862 |
+
|
863 |
+
#views_tabs ,#drop_down_views
|
864 |
+
{
|
865 |
+
display:none;
|
866 |
+
}
|
867 |
+
|
868 |
+
#views_tabs_select
|
869 |
+
{
|
870 |
+
display:block !important;
|
871 |
+
}
|
872 |
+
|
873 |
+
|
874 |
+
|
875 |
+
}
|
876 |
+
|
877 |
+
@media only screen and (max-width : 968px) {
|
878 |
+
#cats >li
|
879 |
+
{
|
880 |
+
float:none;
|
881 |
+
}
|
882 |
+
|
883 |
+
|
884 |
+
|
885 |
+
}
|
886 |
+
.categories1 , .categories2
|
887 |
+
{
|
888 |
+
display:inline-block;
|
889 |
+
}
|
890 |
+
|
891 |
+
.categories2
|
892 |
+
{
|
893 |
+
position:relative;
|
894 |
+
left: -9px;
|
895 |
+
cursor:pointer;
|
896 |
+
}
|
897 |
+
.categories2:first-letter
|
898 |
+
{
|
899 |
+
color:#fff;
|
900 |
+
|
901 |
+
}
|
902 |
+
</style>
|
903 |
<?php
|
904 |
+
|
905 |
+
//reindex cat_ids_array
|
906 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
907 |
+
|
908 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
909 |
+
{
|
910 |
+
echo'
|
911 |
+
<style>
|
912 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
913 |
+
{
|
914 |
+
text-decoration:underline;
|
915 |
+
cursor:pointer;
|
916 |
+
|
917 |
+
}
|
918 |
+
|
919 |
+
</style>';
|
920 |
+
|
921 |
+
}
|
922 |
+
|
923 |
+
|
924 |
+
|
925 |
+
if($cat_ids=='')
|
926 |
+
$cat_ids='';
|
927 |
+
|
928 |
+
|
929 |
+
echo '<ul id="cats" style="list-style-type:none;">';
|
930 |
+
|
931 |
+
foreach($categories as $category)
|
932 |
+
{
|
933 |
+
|
934 |
+
?>
|
935 |
+
|
936 |
+
<li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
937 |
+
'action' => 'spiderbigcalendar_list',
|
938 |
+
'theme_id' => $theme_id,
|
939 |
+
'calendar' => $calendar_id,
|
940 |
+
'select' => $view_select,
|
941 |
+
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
942 |
+
'many_sp_calendar' => $many_sp_calendar,
|
943 |
+
'cur_page_url' => $path_sp_cal,
|
944 |
+
'cat_id' => $category->id,
|
945 |
+
'cat_ids' => $cat_ids,
|
946 |
+
'widget' => $widget,
|
947 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
948 |
+
|
949 |
+
|
950 |
+
<?php
|
951 |
+
|
952 |
+
|
953 |
+
}
|
954 |
+
|
955 |
+
echo '</ul><br><br>';
|
956 |
+
|
957 |
die();
|
958 |
}
|
959 |
|
front_end/bigcalendarlist_widget.php
CHANGED
@@ -10,6 +10,81 @@ function big_calendar_list_widget() {
|
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
14 |
$weekstart = $theme->week_start_day;
|
15 |
$bg = '#' . $theme->header_bgcolor;
|
@@ -36,7 +111,7 @@ function big_calendar_list_widget() {
|
|
36 |
$font_month = $theme->font_month;
|
37 |
$font_day = $theme->font_day;
|
38 |
$font_weekday = $theme->font_weekday;
|
39 |
-
|
40 |
$popup_width = $theme->popup_width;
|
41 |
$popup_height = $theme->popup_height;
|
42 |
|
@@ -90,6 +165,7 @@ function big_calendar_list_widget() {
|
|
90 |
#calendar_<?php echo $many_sp_calendar; ?> table {
|
91 |
border-collapse: initial;
|
92 |
border:0px;
|
|
|
93 |
}
|
94 |
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
95 |
padding: 0px;
|
@@ -186,12 +262,52 @@ function big_calendar_list_widget() {
|
|
186 |
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
187 |
background: transparent !important;
|
188 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
</style>
|
190 |
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
191 |
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?>">
|
192 |
<tr style="background-color:#FFFFFF;">
|
193 |
<td style="background-color:#FFFFFF;">
|
194 |
-
<div id="views_tabs" style="
|
195 |
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
196 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
197 |
'action' => 'spiderbigcalendar_day_widget',
|
@@ -201,8 +317,11 @@ function big_calendar_list_widget() {
|
|
201 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
202 |
'many_sp_calendar' => $many_sp_calendar,
|
203 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
204 |
'widget' => $widget,
|
205 |
-
|
|
|
206 |
</div>
|
207 |
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
208 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
@@ -214,10 +333,13 @@ function big_calendar_list_widget() {
|
|
214 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
215 |
'many_sp_calendar' => $many_sp_calendar,
|
216 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
217 |
'widget' => $widget,
|
218 |
-
|
|
|
219 |
</div>
|
220 |
-
<div class="views" style="
|
221 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
222 |
'action' => 'spiderbigcalendar_list_widget',
|
223 |
'theme_id' => $theme_id,
|
@@ -226,8 +348,11 @@ function big_calendar_list_widget() {
|
|
226 |
'date' => $year . '-' . add_0((Month_num($month))),
|
227 |
'many_sp_calendar' => $many_sp_calendar,
|
228 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
229 |
'widget' => $widget,
|
230 |
-
|
|
|
231 |
</div>
|
232 |
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
233 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
@@ -238,8 +363,11 @@ function big_calendar_list_widget() {
|
|
238 |
'date' => $year . '-' . add_0((Month_num($month))),
|
239 |
'many_sp_calendar' => $many_sp_calendar,
|
240 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
241 |
'widget' => $widget,
|
242 |
-
|
|
|
243 |
</div>
|
244 |
</div>
|
245 |
</td>
|
@@ -269,9 +397,12 @@ function big_calendar_list_widget() {
|
|
269 |
'date' => $needed_date,
|
270 |
'many_sp_calendar' => $many_sp_calendar,
|
271 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
272 |
'widget' => $widget,
|
|
|
273 |
), admin_url('admin-ajax.php'));
|
274 |
-
?>')">◄
|
275 |
</a>
|
276 |
</td>
|
277 |
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
@@ -294,9 +425,12 @@ function big_calendar_list_widget() {
|
|
294 |
'date' => $needed_date,
|
295 |
'many_sp_calendar' => $many_sp_calendar,
|
296 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
297 |
'widget' => $widget,
|
|
|
298 |
), admin_url('admin-ajax.php'));
|
299 |
-
?>')">►
|
300 |
</a>
|
301 |
</td>
|
302 |
</tr>
|
@@ -327,6 +461,8 @@ function big_calendar_list_widget() {
|
|
327 |
$percent = $percent + ($sum / 7);
|
328 |
$percent = 107 / $percent;
|
329 |
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
|
|
|
|
330 |
$array_days = $all_calendar_files[0]['array_days'];
|
331 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
332 |
$title = $all_calendar_files[0]['title'];
|
@@ -336,7 +472,7 @@ function big_calendar_list_widget() {
|
|
336 |
echo '<table style="height:14px;border-spacing:0;border-spacing:0;width: 100%;background-color:#D6D4D5;">
|
337 |
<tr>
|
338 |
<td style="padding-left:10px; font-size:12px;font-weight:bold;width:10px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
|
339 |
-
<td><
|
340 |
</tr>
|
341 |
</table>';
|
342 |
}
|
@@ -359,6 +495,12 @@ function big_calendar_list_widget() {
|
|
359 |
$ev_title = explode('</p>', $value);
|
360 |
array_pop($ev_title);
|
361 |
for ($j = 0; $j < count($ev_title); $j++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
362 |
if (($j + 1) % 2 == 0) {
|
363 |
$color = $bg;
|
364 |
$table_color = $calendar_bg;
|
@@ -367,11 +509,12 @@ function big_calendar_list_widget() {
|
|
367 |
$color = $bg;
|
368 |
$table_color = $calendar_bg;
|
369 |
}
|
|
|
370 |
echo '<table class="last_table" style="overflow:hidden;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
371 |
<tr>
|
372 |
-
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color
|
373 |
<td>
|
374 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color
|
375 |
href="' . add_query_arg(array(
|
376 |
'action' => 'spidercalendarbig',
|
377 |
'theme_id' => $theme_id,
|
@@ -409,7 +552,10 @@ function big_calendar_list_widget() {
|
|
409 |
'many_sp_calendar' => $many_sp_calendar,
|
410 |
'cur_page_url' => $path_sp_cal,
|
411 |
'widget' => $widget,
|
412 |
-
|
|
|
|
|
|
|
413 |
<?php echo ($year - 1); ?>
|
414 |
</td>
|
415 |
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
@@ -425,7 +571,10 @@ function big_calendar_list_widget() {
|
|
425 |
'many_sp_calendar' => $many_sp_calendar,
|
426 |
'cur_page_url' => $path_sp_cal,
|
427 |
'widget' => $widget,
|
428 |
-
|
|
|
|
|
|
|
429 |
<?php echo ($year + 1); ?>
|
430 |
</td>
|
431 |
</tr>
|
@@ -436,7 +585,82 @@ function big_calendar_list_widget() {
|
|
436 |
</tr>
|
437 |
</table>
|
438 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
439 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
die();
|
441 |
}
|
442 |
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
|
13 |
+
///////////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
if(isset($_GET['cat_id']))
|
16 |
+
$cat_id = $_GET['cat_id'];
|
17 |
+
else $cat_id = "";
|
18 |
+
|
19 |
+
if(isset($_GET['cat_ids']))
|
20 |
+
$cat_ids = $_GET['cat_ids'];
|
21 |
+
else $cat_ids = "";
|
22 |
+
|
23 |
+
if($cat_ids=='')
|
24 |
+
$cat_ids .= $cat_id.',';
|
25 |
+
else
|
26 |
+
$cat_ids .= ','.$cat_id.',';
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
31 |
+
|
32 |
+
|
33 |
+
function getelementcountinarray($array , $element)
|
34 |
+
{
|
35 |
+
$t=0;
|
36 |
+
|
37 |
+
for($i=0; $i<count($array); $i++)
|
38 |
+
{
|
39 |
+
if($element==$array[$i])
|
40 |
+
$t++;
|
41 |
+
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
return $t;
|
46 |
+
|
47 |
+
}
|
48 |
+
|
49 |
+
function getelementindexinarray($array , $element)
|
50 |
+
{
|
51 |
+
|
52 |
+
$t='';
|
53 |
+
|
54 |
+
for($i=0; $i<count($array); $i++)
|
55 |
+
{
|
56 |
+
if($element==$array[$i])
|
57 |
+
$t.=$i.',';
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
return $t;
|
62 |
+
|
63 |
+
|
64 |
+
}
|
65 |
+
$cat_ids_array = explode(',',$cat_ids);
|
66 |
+
|
67 |
+
|
68 |
+
if($cat_id!='')
|
69 |
+
{
|
70 |
+
|
71 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
72 |
+
{
|
73 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
74 |
+
$index_array = explode(',' , $index_in_line);
|
75 |
+
array_pop ($index_array);
|
76 |
+
for($j=0; $j<count($index_array); $j++)
|
77 |
+
unset($cat_ids_array[$index_array[$j]]);
|
78 |
+
$cat_ids = implode(',',$cat_ids_array);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
else
|
82 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
83 |
+
|
84 |
+
|
85 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
86 |
+
|
87 |
+
|
88 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
89 |
$weekstart = $theme->week_start_day;
|
90 |
$bg = '#' . $theme->header_bgcolor;
|
111 |
$font_month = $theme->font_month;
|
112 |
$font_day = $theme->font_day;
|
113 |
$font_weekday = $theme->font_weekday;
|
114 |
+
$ev_title_color = $theme->ev_title_color;
|
115 |
$popup_width = $theme->popup_width;
|
116 |
$popup_height = $theme->popup_height;
|
117 |
|
165 |
#calendar_<?php echo $many_sp_calendar; ?> table {
|
166 |
border-collapse: initial;
|
167 |
border:0px;
|
168 |
+
margin: 0;
|
169 |
}
|
170 |
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
171 |
padding: 0px;
|
262 |
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
263 |
background: transparent !important;
|
264 |
}
|
265 |
+
|
266 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
267 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
268 |
+
{
|
269 |
+
|
270 |
+
background-color: <?php $views_tabs_bg_color?>;
|
271 |
+
width: 120px;
|
272 |
+
text-align: center;
|
273 |
+
cursor: pointer;
|
274 |
+
padding: 6px;
|
275 |
+
position: relative;
|
276 |
+
}
|
277 |
+
|
278 |
+
|
279 |
+
#drop_down_views
|
280 |
+
{
|
281 |
+
list-style-type:none !important;
|
282 |
+
position: absolute;
|
283 |
+
top: 46px;
|
284 |
+
left: -15px;
|
285 |
+
display:none;
|
286 |
+
z-index: 4545;
|
287 |
+
|
288 |
+
}
|
289 |
+
|
290 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
291 |
+
{
|
292 |
+
background:<?php echo $bg_top ?>;
|
293 |
+
}
|
294 |
+
|
295 |
+
#drop_down_views >li
|
296 |
+
{
|
297 |
+
border-bottom:1px solid #fff !important;
|
298 |
+
}
|
299 |
+
|
300 |
+
|
301 |
+
#views_tabs_select
|
302 |
+
{
|
303 |
+
display:none;
|
304 |
+
}
|
305 |
</style>
|
306 |
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
307 |
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?>">
|
308 |
<tr style="background-color:#FFFFFF;">
|
309 |
<td style="background-color:#FFFFFF;">
|
310 |
+
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
311 |
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
312 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
313 |
'action' => 'spiderbigcalendar_day_widget',
|
317 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
318 |
'many_sp_calendar' => $many_sp_calendar,
|
319 |
'cur_page_url' => $path_sp_cal,
|
320 |
+
'cat_id' => '',
|
321 |
+
'cat_ids' => $cat_ids,
|
322 |
'widget' => $widget,
|
323 |
+
'TB_iframe' => 1,
|
324 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
325 |
</div>
|
326 |
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
327 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
333 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
334 |
'many_sp_calendar' => $many_sp_calendar,
|
335 |
'cur_page_url' => $path_sp_cal,
|
336 |
+
'cat_id' => '',
|
337 |
+
'cat_ids' => $cat_ids,
|
338 |
'widget' => $widget,
|
339 |
+
'TB_iframe' => 1,
|
340 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
341 |
</div>
|
342 |
+
<div class="views" style="margin-left: 3px;margin-right: 1px;<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ';height:28px;top:0;' ?>"
|
343 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
344 |
'action' => 'spiderbigcalendar_list_widget',
|
345 |
'theme_id' => $theme_id,
|
348 |
'date' => $year . '-' . add_0((Month_num($month))),
|
349 |
'many_sp_calendar' => $many_sp_calendar,
|
350 |
'cur_page_url' => $path_sp_cal,
|
351 |
+
'cat_id' => '',
|
352 |
+
'cat_ids' => $cat_ids,
|
353 |
'widget' => $widget,
|
354 |
+
'TB_iframe' => 1,
|
355 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
356 |
</div>
|
357 |
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
358 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
363 |
'date' => $year . '-' . add_0((Month_num($month))),
|
364 |
'many_sp_calendar' => $many_sp_calendar,
|
365 |
'cur_page_url' => $path_sp_cal,
|
366 |
+
'cat_id' => '',
|
367 |
+
'cat_ids' => $cat_ids,
|
368 |
'widget' => $widget,
|
369 |
+
'TB_iframe' => 1,
|
370 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
371 |
</div>
|
372 |
</div>
|
373 |
</td>
|
397 |
'date' => $needed_date,
|
398 |
'many_sp_calendar' => $many_sp_calendar,
|
399 |
'cur_page_url' => $path_sp_cal,
|
400 |
+
'cat_id' => '',
|
401 |
+
'cat_ids' => $cat_ids,
|
402 |
'widget' => $widget,
|
403 |
+
'TB_iframe' => 1,
|
404 |
), admin_url('admin-ajax.php'));
|
405 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◄
|
406 |
</a>
|
407 |
</td>
|
408 |
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
425 |
'date' => $needed_date,
|
426 |
'many_sp_calendar' => $many_sp_calendar,
|
427 |
'cur_page_url' => $path_sp_cal,
|
428 |
+
'cat_id' => '',
|
429 |
+
'cat_ids' => $cat_ids,
|
430 |
'widget' => $widget,
|
431 |
+
'TB_iframe' => 1,
|
432 |
), admin_url('admin-ajax.php'));
|
433 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">►
|
434 |
</a>
|
435 |
</td>
|
436 |
</tr>
|
461 |
$percent = $percent + ($sum / 7);
|
462 |
$percent = 107 / $percent;
|
463 |
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
464 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
465 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
466 |
$array_days = $all_calendar_files[0]['array_days'];
|
467 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
468 |
$title = $all_calendar_files[0]['title'];
|
472 |
echo '<table style="height:14px;border-spacing:0;border-spacing:0;width: 100%;background-color:#D6D4D5;">
|
473 |
<tr>
|
474 |
<td style="padding-left:10px; font-size:12px;font-weight:bold;width:10px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
|
475 |
+
<td><p style="font-size:12px;color:' . $bg . '; border:none"> ' . __('There Is No Event In This Month', 'sp_calendar') . '</p></td>
|
476 |
</tr>
|
477 |
</table>';
|
478 |
}
|
495 |
$ev_title = explode('</p>', $value);
|
496 |
array_pop($ev_title);
|
497 |
for ($j = 0; $j < count($ev_title); $j++) {
|
498 |
+
$queryy = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
499 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
|
500 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
|
501 |
+
|
502 |
+
$cat_color = $wpdb->get_row($queryy);
|
503 |
+
|
504 |
if (($j + 1) % 2 == 0) {
|
505 |
$color = $bg;
|
506 |
$table_color = $calendar_bg;
|
509 |
$color = $bg;
|
510 |
$table_color = $calendar_bg;
|
511 |
}
|
512 |
+
if(!isset($cat_color->color)) $cat_color->color="";
|
513 |
echo '<table class="last_table" style="overflow:hidden;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
514 |
<tr>
|
515 |
+
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $calendar_bg . '">' . ($j +1 ) . '</td>
|
516 |
<td>
|
517 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color:#' . $ev_title_color . ';"
|
518 |
href="' . add_query_arg(array(
|
519 |
'action' => 'spidercalendarbig',
|
520 |
'theme_id' => $theme_id,
|
552 |
'many_sp_calendar' => $many_sp_calendar,
|
553 |
'cur_page_url' => $path_sp_cal,
|
554 |
'widget' => $widget,
|
555 |
+
'cat_id' => '',
|
556 |
+
'cat_ids' => $cat_ids,
|
557 |
+
'TB_iframe' => 1,
|
558 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?>">
|
559 |
<?php echo ($year - 1); ?>
|
560 |
</td>
|
561 |
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
571 |
'many_sp_calendar' => $many_sp_calendar,
|
572 |
'cur_page_url' => $path_sp_cal,
|
573 |
'widget' => $widget,
|
574 |
+
'cat_id' => '',
|
575 |
+
'cat_ids' => $cat_ids,
|
576 |
+
'TB_iframe' => 1,
|
577 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?>;color:<?php echo $year_font_color; ?>">
|
578 |
<?php echo ($year + 1); ?>
|
579 |
</td>
|
580 |
</tr>
|
585 |
</tr>
|
586 |
</table>
|
587 |
</div>
|
588 |
+
<style>
|
589 |
+
table{
|
590 |
+
width: 100%;
|
591 |
+
}
|
592 |
+
.categories1 , .categories2
|
593 |
+
{
|
594 |
+
display:inline-block;
|
595 |
+
}
|
596 |
+
|
597 |
+
.categories2
|
598 |
+
{
|
599 |
+
position:relative;
|
600 |
+
left: -9px;
|
601 |
+
cursor:pointer;
|
602 |
+
}
|
603 |
+
.categories2:first-letter
|
604 |
+
{
|
605 |
+
color:#fff;
|
606 |
+
|
607 |
+
}
|
608 |
+
</style>
|
609 |
<?php
|
610 |
+
|
611 |
+
//reindex cat_ids_array
|
612 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
613 |
+
|
614 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
615 |
+
{
|
616 |
+
echo'
|
617 |
+
<style>
|
618 |
+
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
619 |
+
{
|
620 |
+
text-decoration:underline;
|
621 |
+
cursor:pointer;
|
622 |
+
|
623 |
+
}
|
624 |
+
|
625 |
+
</style>';
|
626 |
+
|
627 |
+
}
|
628 |
+
|
629 |
+
|
630 |
+
|
631 |
+
if($cat_ids=='')
|
632 |
+
$cat_ids='';
|
633 |
+
|
634 |
+
|
635 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
|
636 |
+
|
637 |
+
foreach($categories as $category)
|
638 |
+
{
|
639 |
+
|
640 |
+
?>
|
641 |
+
|
642 |
+
<li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
643 |
+
'action' => 'spiderbigcalendar_list_widget',
|
644 |
+
'theme_id' => $theme_id,
|
645 |
+
'calendar' => $calendar_id,
|
646 |
+
'select' => $view_select,
|
647 |
+
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
648 |
+
'many_sp_calendar' => $many_sp_calendar,
|
649 |
+
'cur_page_url' => $path_sp_cal,
|
650 |
+
'cat_id' => $category->id,
|
651 |
+
'cat_ids' => $cat_ids,
|
652 |
+
'widget' => $widget,
|
653 |
+
'TB_iframe' => 1,
|
654 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
655 |
+
|
656 |
+
|
657 |
+
<?php
|
658 |
+
|
659 |
+
|
660 |
+
}
|
661 |
+
|
662 |
+
echo '</ul><br><br>';
|
663 |
+
|
664 |
die();
|
665 |
}
|
666 |
|
front_end/bigcalendarmonth.php
CHANGED
@@ -9,7 +9,89 @@ function big_calendar_month() {
|
|
9 |
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
|
|
|
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
14 |
$cal_width = $theme->width;
|
15 |
$bg_top = '#' . $theme->bg_top;
|
@@ -76,6 +158,7 @@ function big_calendar_month() {
|
|
76 |
$views_tabs_text_color = '#' . $theme->views_tabs_text_color;
|
77 |
$views_tabs_font_size = $theme->views_tabs_font_size;
|
78 |
$show_numbers_for_events = $theme->day_start;
|
|
|
79 |
|
80 |
__('January', 'sp_calendar');
|
81 |
__('February', 'sp_calendar');
|
@@ -122,15 +205,44 @@ function big_calendar_month() {
|
|
122 |
$views = explode(',', $view_select);
|
123 |
$defaultview = 'month';
|
124 |
array_pop($views);
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
<style type='text/css'>
|
|
|
|
|
|
|
|
|
|
|
134 |
#TB_window {
|
135 |
z-index: 10000;
|
136 |
}
|
@@ -142,9 +254,7 @@ function big_calendar_month() {
|
|
142 |
border:0px;
|
143 |
max-width: none;
|
144 |
}
|
145 |
-
|
146 |
-
background: none;
|
147 |
-
}
|
148 |
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
149 |
padding: 0px;
|
150 |
vertical-align: none;
|
@@ -166,8 +276,17 @@ function big_calendar_month() {
|
|
166 |
}
|
167 |
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
168 |
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
169 |
-
border-top-right-radius: <?php echo border_radius2; ?>px;
|
170 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
172 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
173 |
text-decoration:none;
|
@@ -190,11 +309,11 @@ function big_calendar_month() {
|
|
190 |
background:none;
|
191 |
}
|
192 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
193 |
-
border:1px solid <?php echo $cell_border_color;
|
194 |
vertical-align:top;
|
195 |
}
|
196 |
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
197 |
-
border: 1px solid <?php echo $cell_border_color;
|
198 |
vertical-align: middle;
|
199 |
}
|
200 |
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
@@ -215,7 +334,7 @@ function big_calendar_month() {
|
|
215 |
}
|
216 |
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
217 |
color:<?php echo $text_color_other_months; ?>;
|
218 |
-
border:1px solid <?php echo $cell_border_color;
|
219 |
vertical-align:top;
|
220 |
}
|
221 |
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
@@ -228,7 +347,7 @@ function big_calendar_month() {
|
|
228 |
}
|
229 |
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
230 |
color:<?php echo $sun_days; ?>;
|
231 |
-
border:1px solid <?php echo $cell_border_color;
|
232 |
vertical-align:top;
|
233 |
text-align:left;
|
234 |
background-color: <?php echo $sundays_bg_color; ?>;
|
@@ -236,21 +355,70 @@ function big_calendar_month() {
|
|
236 |
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
237 |
float: right;
|
238 |
background-color: <?php echo $views_tabs_bg_color; ?>;
|
239 |
-
height: 25px;
|
240 |
-
width: 70px;
|
241 |
margin-right: 2px;
|
242 |
text-align: center;
|
243 |
cursor:pointer;
|
244 |
position: relative;
|
245 |
top: 5px;
|
246 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
</style>
|
248 |
-
|
|
|
|
|
249 |
<table cellpadding="0" cellspacing="0">
|
250 |
<tr>
|
251 |
-
<td>
|
252 |
-
<div id="views_tabs" style="<?php echo $display
|
253 |
-
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ';
|
254 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
255 |
'action' => 'spiderbigcalendar_day',
|
256 |
'theme_id' => $theme_id,
|
@@ -259,10 +427,13 @@ function big_calendar_month() {
|
|
259 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
260 |
'many_sp_calendar' => $many_sp_calendar,
|
261 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
262 |
'widget' => $widget,
|
263 |
-
|
|
|
264 |
</div>
|
265 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';
|
266 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
267 |
'action' => 'spiderbigcalendar_week',
|
268 |
'theme_id' => $theme_id,
|
@@ -272,10 +443,13 @@ function big_calendar_month() {
|
|
272 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
273 |
'many_sp_calendar' => $many_sp_calendar,
|
274 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
275 |
'widget' => $widget,
|
276 |
-
|
|
|
277 |
</div>
|
278 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';
|
279 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
280 |
'action' => 'spiderbigcalendar_list',
|
281 |
'theme_id' => $theme_id,
|
@@ -284,10 +458,13 @@ function big_calendar_month() {
|
|
284 |
'date' => $year . '-' . add_0((Month_num($month))),
|
285 |
'many_sp_calendar' => $many_sp_calendar,
|
286 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
287 |
'widget' => $widget,
|
288 |
-
|
|
|
289 |
</div>
|
290 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';
|
291 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
292 |
'action' => 'spiderbigcalendar_month',
|
293 |
'theme_id' => $theme_id,
|
@@ -296,21 +473,104 @@ function big_calendar_month() {
|
|
296 |
'date' => $year . '-' . add_0((Month_num($month))),
|
297 |
'many_sp_calendar' => $many_sp_calendar,
|
298 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
299 |
'widget' => $widget,
|
300 |
-
|
|
|
301 |
</div>
|
302 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
</td>
|
304 |
</tr>
|
305 |
<tr>
|
306 |
<td>
|
307 |
-
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width
|
308 |
<tr>
|
309 |
<td width="100%" style="padding:0; margin:0">
|
310 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width
|
311 |
-
<tr style="height:40px; width
|
312 |
-
<td class="top_table" align="center" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
313 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width
|
314 |
<tr>
|
315 |
<td width="15%">
|
316 |
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
@@ -322,9 +582,11 @@ function big_calendar_month() {
|
|
322 |
'date' => ($year - 1) . '-' . add_0(Month_num($month)),
|
323 |
'many_sp_calendar' => $many_sp_calendar,
|
324 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
325 |
'widget' => $widget,
|
326 |
-
), admin_url('admin-ajax.php'));?>')" style="text-align:center; cursor:pointer; width:100%;
|
327 |
-
<span style="font-size:
|
328 |
</div>
|
329 |
</td>
|
330 |
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
@@ -343,14 +605,16 @@ function big_calendar_month() {
|
|
343 |
'date' => $needed_date,
|
344 |
'many_sp_calendar' => $many_sp_calendar,
|
345 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
346 |
'widget' => $widget,
|
347 |
), admin_url('admin-ajax.php'));
|
348 |
-
?>')">&#
|
349 |
</a>
|
350 |
</td>
|
351 |
<td style="text-align:center; margin:0;" width="40%">
|
352 |
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
353 |
-
<span style="font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size; ?>px;text-shadow: 1px 1px black;"><?php echo $year . ', ' . __($month, 'sp_calendar'); ?></span>
|
354 |
</td>
|
355 |
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
356 |
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
@@ -368,9 +632,11 @@ function big_calendar_month() {
|
|
368 |
'date' => $needed_date,
|
369 |
'many_sp_calendar' => $many_sp_calendar,
|
370 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
371 |
'widget' => $widget,
|
372 |
), admin_url('admin-ajax.php'));
|
373 |
-
?>')">&#
|
374 |
</a>
|
375 |
</td>
|
376 |
<td width="15%">
|
@@ -383,9 +649,11 @@ function big_calendar_month() {
|
|
383 |
'date' => ($year + 1) . '-' . add_0(Month_num($month)),
|
384 |
'many_sp_calendar' => $many_sp_calendar,
|
385 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
386 |
'widget' => $widget,
|
387 |
-
), admin_url('admin-ajax.php'));?>')" style="text-align:center; cursor:pointer; width:100%;
|
388 |
-
<span style="font-size:
|
389 |
</div>
|
390 |
</td>
|
391 |
</tr>
|
@@ -394,35 +662,35 @@ function big_calendar_month() {
|
|
394 |
</tr>
|
395 |
<tr align="center" height="<?php echo $week_days_cell_height; ?>" style="background-color:<?php echo $weekdays_bg_color; ?>;">
|
396 |
<?php if ($weekstart == "su") { ?>
|
397 |
-
<td class="weekdays" style="width
|
398 |
-
<div class="calbottom_border" style="text-align:center;
|
399 |
</td>
|
400 |
<?php } ?>
|
401 |
-
<td class="weekdays" style="width
|
402 |
-
<div class="calbottom_border" style="text-align:center;
|
403 |
</td>
|
404 |
-
<td class="weekdays" style="width
|
405 |
-
<div class="calbottom_border" style="text-align:center;
|
406 |
</td>
|
407 |
-
<td class="weekdays" style="width
|
408 |
-
<div class="calbottom_border" style="text-align:center;
|
409 |
</td>
|
410 |
-
<td class="weekdays" style="width
|
411 |
-
<div class="calbottom_border" style="text-align:center;
|
412 |
</td>
|
413 |
-
<td class="weekdays" style="width
|
414 |
-
<div class="calbottom_border" style="text-align:center;
|
415 |
</td>
|
416 |
-
<td class="weekdays" style="width
|
417 |
-
<div class="calbottom_border" style="text-align:center;
|
418 |
</td>
|
419 |
<?php if ($weekstart == "mo") { ?>
|
420 |
-
<td class="weekdays" style="width
|
421 |
-
<div class="calbottom_border" style="text-align:center;
|
422 |
</td>
|
423 |
<?php } ?>
|
424 |
</tr>
|
425 |
-
<?php
|
426 |
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
427 |
if ($weekstart == "su") {
|
428 |
$month_first_weekday++;
|
@@ -447,6 +715,9 @@ function big_calendar_month() {
|
|
447 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
448 |
$title = $all_calendar_files[0]['title'];
|
449 |
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
|
|
|
|
|
|
450 |
echo ' <tr id="days" height="' . $cell_height . '" style="line-height:15px;">';
|
451 |
for ($i = 1; $i < $weekday_i; $i++) {
|
452 |
echo ' <td class="caltext_color_other_months" style="background-color:' . $bg_color_other_months . '">
|
@@ -454,24 +725,73 @@ function big_calendar_month() {
|
|
454 |
</td>';
|
455 |
$last_month_days = $last_month_days + 1;
|
456 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
for ($i = 1; $i <= $month_days; $i++) {
|
458 |
-
|
459 |
$ev_title = explode('</p>', $title[$i]);
|
460 |
array_pop($ev_title);
|
461 |
-
$k = count($ev_title);
|
462 |
$ev_id = explode('<br>', $ev_ids[$i]);
|
463 |
-
|
464 |
$ev_ids_inline = implode(',', $ev_id);
|
465 |
-
|
|
|
|
|
|
|
466 |
$dayevent = '';
|
467 |
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
468 |
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER ) {
|
469 |
-
echo ' <td
|
470 |
-
<div class="calborder_day" style="
|
471 |
-
<p style="color:' . $evented_color . ';line-height:1.3;font-family: tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
472 |
$r = 0;
|
473 |
echo ' <div style="background-color:' . $ev_title_bg_color . ';">';
|
474 |
for ($j = 0; $j < $k; $j++) {
|
|
|
|
|
|
|
|
|
|
|
475 |
if ($r < $number_of_shown_evetns) {
|
476 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
477 |
href="' . add_query_arg(array(
|
@@ -487,11 +807,12 @@ function big_calendar_month() {
|
|
487 |
'TB_iframe' => 1,
|
488 |
'tbWidth' => $popup_width,
|
489 |
'tbHeight' => $popup_height,
|
490 |
-
|
|
|
491 |
</a>';
|
492 |
}
|
493 |
else {
|
494 |
-
echo '
|
495 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . '; text-align:center;"
|
496 |
href="' . add_query_arg(array(
|
497 |
'action' => 'spiderseemore',
|
@@ -514,14 +835,22 @@ function big_calendar_month() {
|
|
514 |
echo ' </div>
|
515 |
</div>
|
516 |
</td>';
|
|
|
517 |
}
|
518 |
-
|
|
|
|
|
519 |
if (in_array($i,$array_days)) {
|
520 |
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px; border: px solid ' . $border_day . '">
|
521 |
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
522 |
$r = 0;
|
523 |
echo ' <div style="background-color:' . $ev_title_bg_color . '">';
|
524 |
for ($j = 0; $j < $k; $j++) {
|
|
|
|
|
|
|
|
|
|
|
525 |
if ($r < $number_of_shown_evetns) {
|
526 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
527 |
href="' . add_query_arg(array(
|
@@ -537,11 +866,11 @@ function big_calendar_month() {
|
|
537 |
'TB_iframe' => 1,
|
538 |
'tbWidth' => $popup_width,
|
539 |
'tbHeight' => $popup_height,
|
540 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
|
541 |
</a>';
|
542 |
}
|
543 |
else {
|
544 |
-
echo '
|
545 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px;background:none;color:' . $event_title_color . ';text-align:center;"
|
546 |
href="' . add_query_arg(array(
|
547 |
'action' => 'spiderseemore',
|
@@ -565,17 +894,26 @@ function big_calendar_month() {
|
|
565 |
</td>';
|
566 |
}
|
567 |
else {
|
568 |
-
|
|
|
|
|
569 |
<b>' . $i . '</b>
|
570 |
</td>';
|
571 |
}
|
572 |
}
|
573 |
-
|
|
|
|
|
574 |
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px;">
|
575 |
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
576 |
<div style="background-color:' . $ev_title_bg_color . '">';
|
577 |
$r = 0;
|
578 |
for ($j = 0; $j < $k; $j++) {
|
|
|
|
|
|
|
|
|
|
|
579 |
if ($r < $number_of_shown_evetns) {
|
580 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
581 |
href="' . add_query_arg(array(
|
@@ -591,11 +929,11 @@ function big_calendar_month() {
|
|
591 |
'TB_iframe' => 1,
|
592 |
'tbWidth' => $popup_width,
|
593 |
'tbHeight' => $popup_height,
|
594 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
|
595 |
</a>';
|
596 |
}
|
597 |
else {
|
598 |
-
echo '
|
599 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . ';text-align:center;"
|
600 |
href="' . add_query_arg(array(
|
601 |
'action' => 'spiderseemore',
|
@@ -624,13 +962,21 @@ function big_calendar_month() {
|
|
624 |
</td>';
|
625 |
}
|
626 |
}
|
627 |
-
|
628 |
-
|
629 |
-
|
|
|
|
|
|
|
630 |
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family: tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
631 |
<div style="background-color:' . $ev_title_bg_color . '">';
|
632 |
$r = 0;
|
633 |
for ($j = 0; $j < $k; $j++) {
|
|
|
|
|
|
|
|
|
|
|
634 |
if ($r < $number_of_shown_evetns) {
|
635 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
636 |
href="' . add_query_arg(array(
|
@@ -646,11 +992,11 @@ function big_calendar_month() {
|
|
646 |
'TB_iframe' => 1,
|
647 |
'tbWidth' => $popup_width,
|
648 |
'tbHeight' => $popup_height,
|
649 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
|
650 |
</a>';
|
651 |
}
|
652 |
else {
|
653 |
-
echo '
|
654 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . ';text-align:center;"
|
655 |
href="' . add_query_arg(array(
|
656 |
'action' => 'spiderseemore',
|
@@ -677,11 +1023,16 @@ function big_calendar_month() {
|
|
677 |
else {
|
678 |
if ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
679 |
if (in_array ($i,$array_days)) {
|
680 |
-
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px; border: 3px solid ' . $current_day_border_color . '">
|
681 |
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
682 |
<div style="background-color:' . $ev_title_bg_color . '">';
|
683 |
$r = 0;
|
684 |
for ($j = 0; $j < $k; $j++) {
|
|
|
|
|
|
|
|
|
|
|
685 |
if ($r < $number_of_shown_evetns) {
|
686 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
687 |
href="' . add_query_arg(array(
|
@@ -697,11 +1048,11 @@ function big_calendar_month() {
|
|
697 |
'TB_iframe' => 1,
|
698 |
'tbWidth' => $popup_width,
|
699 |
'tbHeight' => $popup_height,
|
700 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
|
701 |
</a>';
|
702 |
}
|
703 |
else {
|
704 |
-
echo '
|
705 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none;color:' . $event_title_color . ';text-align:center;"
|
706 |
href="' . add_query_arg(array(
|
707 |
'action' => 'spiderseemore',
|
@@ -725,17 +1076,25 @@ function big_calendar_month() {
|
|
725 |
</td>';
|
726 |
}
|
727 |
else {
|
728 |
-
echo ' <td style="color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px; border: 3px solid ' . $current_day_border_color . '; vertical-align:top;">
|
729 |
<p style="font-size:'.$other_days_font_size.'px;line-height:1.3;font-family: tahoma;padding-left: 5px;">' . $i . '</p>
|
730 |
</td>';
|
731 |
}
|
732 |
}
|
733 |
-
|
|
|
|
|
734 |
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px;">
|
735 |
<p style="background-color:' . $evented_color_bg . ';background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
736 |
$r = 0;
|
737 |
echo ' <div>';
|
738 |
for ($j = 0; $j < $k; $j++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
739 |
if ($r < $number_of_shown_evetns) {
|
740 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
741 |
href="' . add_query_arg(array(
|
@@ -751,7 +1110,7 @@ function big_calendar_month() {
|
|
751 |
'TB_iframe' => 1,
|
752 |
'tbWidth' => $popup_width,
|
753 |
'tbHeight' => $popup_height,
|
754 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
|
755 |
</a>';
|
756 |
}
|
757 |
else {
|
@@ -778,7 +1137,7 @@ function big_calendar_month() {
|
|
778 |
</td>';
|
779 |
}
|
780 |
else {
|
781 |
-
echo ' <td style=" color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px;border: 1px solid ' . $cell_border_color . ';vertical-align:top;">
|
782 |
<p style="font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;">' . $i . '</p>
|
783 |
</td>';
|
784 |
}
|
@@ -812,8 +1171,123 @@ function big_calendar_month() {
|
|
812 |
</td>
|
813 |
</tr>
|
814 |
</table>
|
815 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
816 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
817 |
die();
|
818 |
}
|
819 |
|
9 |
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where id=".$calendar_id."";
|
13 |
+
$calendar = $wpdb->query($query);
|
14 |
|
15 |
+
|
16 |
+
///////////////////////////////////////////////////////////////////////////////////
|
17 |
+
|
18 |
+
if(isset($_GET['cat_id']))
|
19 |
+
$cat_id = $_GET['cat_id'];
|
20 |
+
else $cat_id = "";
|
21 |
+
|
22 |
+
if(isset($_GET['cat_ids']))
|
23 |
+
$cat_ids = $_GET['cat_ids'];
|
24 |
+
else $cat_ids = "";
|
25 |
+
|
26 |
+
|
27 |
+
if($cat_ids=='')
|
28 |
+
$cat_ids .= $cat_id.',';
|
29 |
+
else
|
30 |
+
$cat_ids .= ','.$cat_id.',';
|
31 |
+
|
32 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
33 |
+
|
34 |
+
|
35 |
+
function getelementcountinarray($array , $element)
|
36 |
+
{
|
37 |
+
$t=0;
|
38 |
+
|
39 |
+
for($i=0; $i<count($array); $i++)
|
40 |
+
{
|
41 |
+
if($element==$array[$i])
|
42 |
+
$t++;
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
return $t;
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
function getelementindexinarray($array , $element)
|
52 |
+
{
|
53 |
+
|
54 |
+
$t='';
|
55 |
+
|
56 |
+
for($i=0; $i<count($array); $i++)
|
57 |
+
{
|
58 |
+
if($element==$array[$i])
|
59 |
+
$t.=$i.',';
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
return $t;
|
64 |
+
|
65 |
+
|
66 |
+
}
|
67 |
+
$cat_ids_array = explode(',',$cat_ids);
|
68 |
+
|
69 |
+
|
70 |
+
if($cat_id!='')
|
71 |
+
{
|
72 |
+
|
73 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
+
{
|
75 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
+
$index_array = explode(',' , $index_in_line);
|
77 |
+
array_pop ($index_array);
|
78 |
+
for($j=0; $j<count($index_array); $j++)
|
79 |
+
unset($cat_ids_array[$index_array[$j]]);
|
80 |
+
$cat_ids = implode(',',$cat_ids_array);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
else
|
84 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
+
|
86 |
+
|
87 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
88 |
+
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
96 |
$cal_width = $theme->width;
|
97 |
$bg_top = '#' . $theme->bg_top;
|
158 |
$views_tabs_text_color = '#' . $theme->views_tabs_text_color;
|
159 |
$views_tabs_font_size = $theme->views_tabs_font_size;
|
160 |
$show_numbers_for_events = $theme->day_start;
|
161 |
+
$ev_color = $theme->event_title_color;
|
162 |
|
163 |
__('January', 'sp_calendar');
|
164 |
__('February', 'sp_calendar');
|
205 |
$views = explode(',', $view_select);
|
206 |
$defaultview = 'month';
|
207 |
array_pop($views);
|
208 |
+
|
209 |
+
$display='';
|
210 |
+
|
211 |
+
if(count($views)==0)
|
212 |
+
{
|
213 |
+
$display="display:none";
|
214 |
+
echo '<style>
|
215 |
+
@media only screen and (max-width : 640px) {
|
216 |
+
|
217 |
+
#views_tabs_select
|
218 |
+
{
|
219 |
+
display:none !important;
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
</style>';
|
224 |
+
}
|
225 |
+
if(count($views)==1 and $views[0]==$defaultview)
|
226 |
+
{
|
227 |
+
$display="display:none";
|
228 |
+
echo '<style>
|
229 |
+
@media only screen and (max-width : 640px) {
|
230 |
+
|
231 |
+
#views_tabs_select
|
232 |
+
{
|
233 |
+
display:none !important;
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
+
</style>';
|
238 |
+
}
|
239 |
+
?>
|
240 |
<style type='text/css'>
|
241 |
+
|
242 |
+
table{
|
243 |
+
border-collapse: inherit !important;
|
244 |
+
}
|
245 |
+
|
246 |
#TB_window {
|
247 |
z-index: 10000;
|
248 |
}
|
254 |
border:0px;
|
255 |
max-width: none;
|
256 |
}
|
257 |
+
|
|
|
|
|
258 |
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
259 |
padding: 0px;
|
260 |
vertical-align: none;
|
276 |
}
|
277 |
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
278 |
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
279 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
280 |
}
|
281 |
+
|
282 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:first-child{
|
283 |
+
border-bottom-left-radius: <?php echo $border_radius2; ?>px;
|
284 |
+
}
|
285 |
+
|
286 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:last-child{
|
287 |
+
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
288 |
+
}
|
289 |
+
|
290 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
291 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
292 |
text-decoration:none;
|
309 |
background:none;
|
310 |
}
|
311 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
312 |
+
border:1px solid <?php echo $cell_border_color; ?> !important;
|
313 |
vertical-align:top;
|
314 |
}
|
315 |
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
316 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
317 |
vertical-align: middle;
|
318 |
}
|
319 |
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
334 |
}
|
335 |
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
336 |
color:<?php echo $text_color_other_months; ?>;
|
337 |
+
border:1px solid <?php echo $cell_border_color; ?> !important;
|
338 |
vertical-align:top;
|
339 |
}
|
340 |
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
347 |
}
|
348 |
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
349 |
color:<?php echo $sun_days; ?>;
|
350 |
+
border:1px solid <?php echo $cell_border_color; ?> !important;
|
351 |
vertical-align:top;
|
352 |
text-align:left;
|
353 |
background-color: <?php echo $sundays_bg_color; ?>;
|
355 |
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
356 |
float: right;
|
357 |
background-color: <?php echo $views_tabs_bg_color; ?>;
|
358 |
+
min-height: 25px;
|
359 |
+
min-width: 70px;
|
360 |
margin-right: 2px;
|
361 |
text-align: center;
|
362 |
cursor:pointer;
|
363 |
position: relative;
|
364 |
top: 5px;
|
365 |
}
|
366 |
+
|
367 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
368 |
+
padding: 7px;
|
369 |
+
}
|
370 |
+
|
371 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
372 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
373 |
+
{
|
374 |
+
background-color: <?php echo $views_tabs_bg_color ?>;
|
375 |
+
width: 120px;
|
376 |
+
text-align: center;
|
377 |
+
cursor: pointer;
|
378 |
+
padding: 6px;
|
379 |
+
position: relative;
|
380 |
+
}
|
381 |
+
|
382 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
383 |
+
{
|
384 |
+
min-height: 30px;
|
385 |
+
}
|
386 |
+
|
387 |
+
#drop_down_views
|
388 |
+
{
|
389 |
+
list-style-type:none !important;
|
390 |
+
display:none;
|
391 |
+
z-index: 4545;
|
392 |
+
|
393 |
+
}
|
394 |
+
|
395 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
396 |
+
{
|
397 |
+
background:<?php echo $bg_top ?>;
|
398 |
+
}
|
399 |
+
|
400 |
+
#drop_down_views >li
|
401 |
+
{
|
402 |
+
border-bottom:1px solid #fff !important;
|
403 |
+
}
|
404 |
+
|
405 |
+
|
406 |
+
#views_tabs_select
|
407 |
+
{
|
408 |
+
display:none;
|
409 |
+
}
|
410 |
+
#cal_event p{
|
411 |
+
color:#<?php echo $ev_color;?>
|
412 |
+
}
|
413 |
</style>
|
414 |
+
|
415 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
416 |
+
<div style="width:100%;">
|
417 |
<table cellpadding="0" cellspacing="0">
|
418 |
<tr>
|
419 |
+
<td>
|
420 |
+
<div id="views_tabs" style="<?php echo $display ?>;width: 100.3%;">
|
421 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ';top:0;' ?>"
|
422 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
423 |
'action' => 'spiderbigcalendar_day',
|
424 |
'theme_id' => $theme_id,
|
427 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
428 |
'many_sp_calendar' => $many_sp_calendar,
|
429 |
'cur_page_url' => $path_sp_cal,
|
430 |
+
'cat_id' => '',
|
431 |
+
'cat_ids' => $cat_ids,
|
432 |
'widget' => $widget,
|
433 |
+
'rand' => $many_sp_calendar,
|
434 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
435 |
</div>
|
436 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';top:0;' ?>"
|
437 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
438 |
'action' => 'spiderbigcalendar_week',
|
439 |
'theme_id' => $theme_id,
|
443 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
444 |
'many_sp_calendar' => $many_sp_calendar,
|
445 |
'cur_page_url' => $path_sp_cal,
|
446 |
+
'cat_id' => '',
|
447 |
+
'cat_ids' => $cat_ids,
|
448 |
'widget' => $widget,
|
449 |
+
'rand' => $many_sp_calendar,
|
450 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
451 |
</div>
|
452 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';top:0;' ?>"
|
453 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
454 |
'action' => 'spiderbigcalendar_list',
|
455 |
'theme_id' => $theme_id,
|
458 |
'date' => $year . '-' . add_0((Month_num($month))),
|
459 |
'many_sp_calendar' => $many_sp_calendar,
|
460 |
'cur_page_url' => $path_sp_cal,
|
461 |
+
'cat_id' => '',
|
462 |
+
'cat_ids' => $cat_ids,
|
463 |
'widget' => $widget,
|
464 |
+
'rand' => $many_sp_calendar,
|
465 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
466 |
</div>
|
467 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
468 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
469 |
'action' => 'spiderbigcalendar_month',
|
470 |
'theme_id' => $theme_id,
|
473 |
'date' => $year . '-' . add_0((Month_num($month))),
|
474 |
'many_sp_calendar' => $many_sp_calendar,
|
475 |
'cur_page_url' => $path_sp_cal,
|
476 |
+
'cat_id' => '',
|
477 |
+
'cat_ids' => $cat_ids,
|
478 |
'widget' => $widget,
|
479 |
+
'rand' => $many_sp_calendar,
|
480 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
481 |
</div>
|
482 |
</div>
|
483 |
+
|
484 |
+
<div id="views_tabs_select" style="display:none" >
|
485 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?>;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
486 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
487 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
488 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
489 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
490 |
+
<span>►</span>
|
491 |
+
</div>
|
492 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
493 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
494 |
+
<div class="views_select"
|
495 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
496 |
+
'action' => 'spiderbigcalendar_day',
|
497 |
+
'theme_id' => $theme_id,
|
498 |
+
'calendar' => $calendar_id,
|
499 |
+
'select' => $view_select,
|
500 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
501 |
+
'many_sp_calendar' => $many_sp_calendar,
|
502 |
+
'cur_page_url' => $path_sp_cal,
|
503 |
+
'cat_id' => '',
|
504 |
+
'cat_ids' => $cat_ids,
|
505 |
+
'widget' => $widget,
|
506 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
507 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
508 |
+
</div>
|
509 |
+
</li>
|
510 |
+
|
511 |
+
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
512 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
513 |
+
'action' => 'spiderbigcalendar_week',
|
514 |
+
'theme_id' => $theme_id,
|
515 |
+
'calendar' => $calendar_id,
|
516 |
+
'select' => $view_select,
|
517 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
518 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
519 |
+
'many_sp_calendar' => $many_sp_calendar,
|
520 |
+
'cur_page_url' => $path_sp_cal,
|
521 |
+
'cat_id' => '',
|
522 |
+
'cat_ids' => $cat_ids,
|
523 |
+
'widget' => $widget,
|
524 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
525 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
526 |
+
</div>
|
527 |
+
</li>
|
528 |
+
|
529 |
+
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
530 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
531 |
+
'action' => 'spiderbigcalendar_list',
|
532 |
+
'theme_id' => $theme_id,
|
533 |
+
'calendar' => $calendar_id,
|
534 |
+
'select' => $view_select,
|
535 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
536 |
+
'many_sp_calendar' => $many_sp_calendar,
|
537 |
+
'cur_page_url' => $path_sp_cal,
|
538 |
+
'cat_id' => '',
|
539 |
+
'cat_ids' => $cat_ids,
|
540 |
+
'widget' => $widget,
|
541 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
542 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
543 |
+
</div>
|
544 |
+
</li>
|
545 |
+
|
546 |
+
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
547 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
548 |
+
'action' => 'spiderbigcalendar_month',
|
549 |
+
'theme_id' => $theme_id,
|
550 |
+
'calendar' => $calendar_id,
|
551 |
+
'select' => $view_select,
|
552 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
553 |
+
'many_sp_calendar' => $many_sp_calendar,
|
554 |
+
'cur_page_url' => $path_sp_cal,
|
555 |
+
'cat_id' => '',
|
556 |
+
'cat_ids' => $cat_ids,
|
557 |
+
'widget' => $widget,
|
558 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
559 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
560 |
+
|
561 |
+
</ul>
|
562 |
+
</div>
|
563 |
</td>
|
564 |
</tr>
|
565 |
<tr>
|
566 |
<td>
|
567 |
+
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%;border:<?php echo $border_color; ?> solid <?php echo $border_width; ?>px; margin:0; padding:0;background-color:<?php echo $bg_bottom; ?>;">
|
568 |
<tr>
|
569 |
<td width="100%" style="padding:0; margin:0">
|
570 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;">
|
571 |
+
<tr style="height:40px; width:100%;">
|
572 |
+
<td class="top_table" align="center" colspan="7" style="z-index: 5;position: relative;background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
573 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:100%; height:<?php echo $top_height; ?>px;">
|
574 |
<tr>
|
575 |
<td width="15%">
|
576 |
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
582 |
'date' => ($year - 1) . '-' . add_0(Month_num($month)),
|
583 |
'many_sp_calendar' => $many_sp_calendar,
|
584 |
'cur_page_url' => $path_sp_cal,
|
585 |
+
'cat_id' => '',
|
586 |
+
'cat_ids' => $cat_ids,
|
587 |
'widget' => $widget,
|
588 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
589 |
+
<span style="font-size:18px;color:#FFF"><?php echo $year - 1; ?></span>
|
590 |
</div>
|
591 |
</td>
|
592 |
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
605 |
'date' => $needed_date,
|
606 |
'many_sp_calendar' => $many_sp_calendar,
|
607 |
'cur_page_url' => $path_sp_cal,
|
608 |
+
'cat_id' => '',
|
609 |
+
'cat_ids' => $cat_ids,
|
610 |
'widget' => $widget,
|
611 |
), admin_url('admin-ajax.php'));
|
612 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◀
|
613 |
</a>
|
614 |
</td>
|
615 |
<td style="text-align:center; margin:0;" width="40%">
|
616 |
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
617 |
+
<span style="line-height: 30px;font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size; ?>px;text-shadow: 1px 1px black;"><?php echo $year . ', ' . __($month, 'sp_calendar'); ?></span>
|
618 |
</td>
|
619 |
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
620 |
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
632 |
'date' => $needed_date,
|
633 |
'many_sp_calendar' => $many_sp_calendar,
|
634 |
'cur_page_url' => $path_sp_cal,
|
635 |
+
'cat_id' => '',
|
636 |
+
'cat_ids' => $cat_ids,
|
637 |
'widget' => $widget,
|
638 |
), admin_url('admin-ajax.php'));
|
639 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">▶
|
640 |
</a>
|
641 |
</td>
|
642 |
<td width="15%">
|
649 |
'date' => ($year + 1) . '-' . add_0(Month_num($month)),
|
650 |
'many_sp_calendar' => $many_sp_calendar,
|
651 |
'cur_page_url' => $path_sp_cal,
|
652 |
+
'cat_id' => '',
|
653 |
+
'cat_ids' => $cat_ids,
|
654 |
'widget' => $widget,
|
655 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
656 |
+
<span style="font-size:18px;color:#FFF"><?php echo $year + 1; ?></span>
|
657 |
</div>
|
658 |
</td>
|
659 |
</tr>
|
662 |
</tr>
|
663 |
<tr align="center" height="<?php echo $week_days_cell_height; ?>" style="background-color:<?php echo $weekdays_bg_color; ?>;">
|
664 |
<?php if ($weekstart == "su") { ?>
|
665 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days;?>; margin:0; padding:0;background-color:<?php echo $weekday_sunday_bg_color; ?>">
|
666 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
667 |
</td>
|
668 |
<?php } ?>
|
669 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
670 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Mo', 'sp_calendar'); ?> </b></div>
|
671 |
</td>
|
672 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
673 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Tu', 'sp_calendar'); ?> </b></div>
|
674 |
</td>
|
675 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
676 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('We', 'sp_calendar'); ?> </b></div>
|
677 |
</td>
|
678 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
679 |
+
<div class="calbottom_border" style="text-align:center;margin:0; padding:0;"><b class="week_days"><?php echo __('Th', 'sp_calendar'); ?> </b></div>
|
680 |
</td>
|
681 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
682 |
+
<div class="calbottom_border" style="text-align:center;margin:0; padding:0;"><b class="week_days"><?php echo __('Fr', 'sp_calendar'); ?> </b></div>
|
683 |
</td>
|
684 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
685 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Sa', 'sp_calendar'); ?> </b></div>
|
686 |
</td>
|
687 |
<?php if ($weekstart == "mo") { ?>
|
688 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days;?>; margin:0; padding:0;background-color:<?php echo $weekday_sunday_bg_color; ?>">
|
689 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
690 |
</td>
|
691 |
<?php } ?>
|
692 |
</tr>
|
693 |
+
<?php
|
694 |
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
695 |
if ($weekstart == "su") {
|
696 |
$month_first_weekday++;
|
715 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
716 |
$title = $all_calendar_files[0]['title'];
|
717 |
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
718 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
719 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
720 |
+
|
721 |
echo ' <tr id="days" height="' . $cell_height . '" style="line-height:15px;">';
|
722 |
for ($i = 1; $i < $weekday_i; $i++) {
|
723 |
echo ' <td class="caltext_color_other_months" style="background-color:' . $bg_color_other_months . '">
|
725 |
</td>';
|
726 |
$last_month_days = $last_month_days + 1;
|
727 |
}
|
728 |
+
///////////////////////////////////////////////////////////////////////
|
729 |
+
|
730 |
+
function category_color($event_id)
|
731 |
+
{
|
732 |
+
|
733 |
+
global $wpdb;
|
734 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
735 |
+
|
736 |
+
$query = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND " . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$event_id;
|
737 |
+
|
738 |
+
|
739 |
+
$colors=$wpdb->get_results($query);
|
740 |
+
|
741 |
+
if(!empty($colors))
|
742 |
+
$color=$colors[0]->color;
|
743 |
+
else $color = "";
|
744 |
+
|
745 |
+
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : '');
|
746 |
+
|
747 |
+
return '#'.$color;
|
748 |
+
}
|
749 |
+
|
750 |
+
|
751 |
+
function style($title, $color)
|
752 |
+
{
|
753 |
+
$new_title = html_entity_decode(strip_tags($title));
|
754 |
+
|
755 |
+
$number = $new_title[0];
|
756 |
+
$first_letter =$new_title[1];
|
757 |
+
$ev_title = $title;
|
758 |
+
$color=str_replace('#','',$color);
|
759 |
+
|
760 |
+
|
761 |
+
$bg_color='rgba('.HEXDEC(SUBSTR($color, 0, 2)).','.HEXDEC(SUBSTR($color, 2, 2)).','.HEXDEC(SUBSTR($color, 4, 2)).',0.3'.')';
|
762 |
+
$event='<div id="cal_event" style="background-color:'.$bg_color.';border-left:2px solid #'.$color.' "><p>'.$ev_title.'</p></div>';
|
763 |
+
|
764 |
+
return $event;
|
765 |
+
}
|
766 |
+
|
767 |
+
/////////////////////////////////////////////////////////////////////////////
|
768 |
+
|
769 |
for ($i = 1; $i <= $month_days; $i++) {
|
770 |
+
if (isset($title[$i])) {
|
771 |
$ev_title = explode('</p>', $title[$i]);
|
772 |
array_pop($ev_title);
|
773 |
+
$k = count($ev_title);
|
774 |
$ev_id = explode('<br>', $ev_ids[$i]);
|
775 |
+
array_pop($ev_id);
|
776 |
$ev_ids_inline = implode(',', $ev_id);
|
777 |
+
}
|
778 |
+
else
|
779 |
+
$k=0;
|
780 |
+
|
781 |
$dayevent = '';
|
782 |
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
783 |
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER ) {
|
784 |
+
echo ' <td class="cala_day" style="padding:0; margin:0;line-height:15px;">
|
785 |
+
<div class="calborder_day" style=" margin:0; padding:0;">
|
786 |
+
<p style="font-size:' . $other_days_font_size . 'px;color:' . $evented_color . ';line-height:1.3;font-family: tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
787 |
$r = 0;
|
788 |
echo ' <div style="background-color:' . $ev_title_bg_color . ';">';
|
789 |
for ($j = 0; $j < $k; $j++) {
|
790 |
+
if(category_color($ev_id[$j])=='#')
|
791 |
+
$cat_color=$bg_top;
|
792 |
+
else
|
793 |
+
$cat_color=category_color($ev_id[$j]);
|
794 |
+
|
795 |
if ($r < $number_of_shown_evetns) {
|
796 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
797 |
href="' . add_query_arg(array(
|
807 |
'TB_iframe' => 1,
|
808 |
'tbWidth' => $popup_width,
|
809 |
'tbHeight' => $popup_height,
|
810 |
+
'cat_id' => $cat_ids
|
811 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
812 |
</a>';
|
813 |
}
|
814 |
else {
|
815 |
+
echo '
|
816 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . '; text-align:center;"
|
817 |
href="' . add_query_arg(array(
|
818 |
'action' => 'spiderseemore',
|
835 |
echo ' </div>
|
836 |
</div>
|
837 |
</td>';
|
838 |
+
|
839 |
}
|
840 |
+
else
|
841 |
+
if ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
842 |
+
if(!isset($border_day)) $border_day = "";
|
843 |
if (in_array($i,$array_days)) {
|
844 |
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px; border: px solid ' . $border_day . '">
|
845 |
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
846 |
$r = 0;
|
847 |
echo ' <div style="background-color:' . $ev_title_bg_color . '">';
|
848 |
for ($j = 0; $j < $k; $j++) {
|
849 |
+
|
850 |
+
if(category_color($ev_id[$j])=='#')
|
851 |
+
$cat_color=$bg_top;
|
852 |
+
else
|
853 |
+
$cat_color=category_color($ev_id[$j]);
|
854 |
if ($r < $number_of_shown_evetns) {
|
855 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
856 |
href="' . add_query_arg(array(
|
866 |
'TB_iframe' => 1,
|
867 |
'tbWidth' => $popup_width,
|
868 |
'tbHeight' => $popup_height,
|
869 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
870 |
</a>';
|
871 |
}
|
872 |
else {
|
873 |
+
echo '
|
874 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px;background:none;color:' . $event_title_color . ';text-align:center;"
|
875 |
href="' . add_query_arg(array(
|
876 |
'action' => 'spiderseemore',
|
894 |
</td>';
|
895 |
}
|
896 |
else {
|
897 |
+
|
898 |
+
if(!isset($border_day)) $border_day = "";
|
899 |
+
echo ' <td class="calsun_days" style="padding:0; font-size:' . $sundays_font_size . 'px; margin:0;line-height:1.3;font-family:tahoma;padding-left: 5px; border: 1px solid ' . $border_day . ' !important">
|
900 |
<b>' . $i . '</b>
|
901 |
</td>';
|
902 |
}
|
903 |
}
|
904 |
+
else
|
905 |
+
|
906 |
+
if (in_array($i, $array_days)) {
|
907 |
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px;">
|
908 |
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
909 |
<div style="background-color:' . $ev_title_bg_color . '">';
|
910 |
$r = 0;
|
911 |
for ($j = 0; $j < $k; $j++) {
|
912 |
+
if(category_color($ev_id[$j])=='#')
|
913 |
+
$cat_color=$bg_top;
|
914 |
+
else
|
915 |
+
$cat_color=category_color($ev_id[$j]);
|
916 |
+
|
917 |
if ($r < $number_of_shown_evetns) {
|
918 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
919 |
href="' . add_query_arg(array(
|
929 |
'TB_iframe' => 1,
|
930 |
'tbWidth' => $popup_width,
|
931 |
'tbHeight' => $popup_height,
|
932 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
933 |
</a>';
|
934 |
}
|
935 |
else {
|
936 |
+
echo '
|
937 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . ';text-align:center;"
|
938 |
href="' . add_query_arg(array(
|
939 |
'action' => 'spiderseemore',
|
962 |
</td>';
|
963 |
}
|
964 |
}
|
965 |
+
else
|
966 |
+
|
967 |
+
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
968 |
+
|
969 |
+
echo ' <td bgcolor="' . $ev_title_bg_color . '" class="cala_day" style="border: 3px solid ' . $current_day_border_color . ' !important;padding:0; margin:0;line-height:15px;">
|
970 |
+
<div class="calborder_day" style="margin:0; padding:0;">
|
971 |
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family: tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
972 |
<div style="background-color:' . $ev_title_bg_color . '">';
|
973 |
$r = 0;
|
974 |
for ($j = 0; $j < $k; $j++) {
|
975 |
+
if(category_color($ev_id[$j])=='#')
|
976 |
+
$cat_color=$bg_top;
|
977 |
+
else
|
978 |
+
$cat_color=category_color($ev_id[$j]);
|
979 |
+
|
980 |
if ($r < $number_of_shown_evetns) {
|
981 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
982 |
href="' . add_query_arg(array(
|
992 |
'TB_iframe' => 1,
|
993 |
'tbWidth' => $popup_width,
|
994 |
'tbHeight' => $popup_height,
|
995 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
996 |
</a>';
|
997 |
}
|
998 |
else {
|
999 |
+
echo '
|
1000 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . ';text-align:center;"
|
1001 |
href="' . add_query_arg(array(
|
1002 |
'action' => 'spiderseemore',
|
1023 |
else {
|
1024 |
if ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
1025 |
if (in_array ($i,$array_days)) {
|
1026 |
+
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px; border: 3px solid ' . $current_day_border_color . ' !important;">
|
1027 |
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
1028 |
<div style="background-color:' . $ev_title_bg_color . '">';
|
1029 |
$r = 0;
|
1030 |
for ($j = 0; $j < $k; $j++) {
|
1031 |
+
if(category_color($ev_id[$j])=='#')
|
1032 |
+
$cat_color=$bg_top;
|
1033 |
+
else
|
1034 |
+
$cat_color=category_color($ev_id[$j]);
|
1035 |
+
|
1036 |
if ($r < $number_of_shown_evetns) {
|
1037 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
1038 |
href="' . add_query_arg(array(
|
1048 |
'TB_iframe' => 1,
|
1049 |
'tbWidth' => $popup_width,
|
1050 |
'tbHeight' => $popup_height,
|
1051 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
1052 |
</a>';
|
1053 |
}
|
1054 |
else {
|
1055 |
+
echo '
|
1056 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none;color:' . $event_title_color . ';text-align:center;"
|
1057 |
href="' . add_query_arg(array(
|
1058 |
'action' => 'spiderseemore',
|
1076 |
</td>';
|
1077 |
}
|
1078 |
else {
|
1079 |
+
echo ' <td style="color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px; border: 3px solid ' . $current_day_border_color . ' !important; vertical-align:top;">
|
1080 |
<p style="font-size:'.$other_days_font_size.'px;line-height:1.3;font-family: tahoma;padding-left: 5px;">' . $i . '</p>
|
1081 |
</td>';
|
1082 |
}
|
1083 |
}
|
1084 |
+
else
|
1085 |
+
|
1086 |
+
if (in_array($i, $array_days)) {
|
1087 |
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px;">
|
1088 |
<p style="background-color:' . $evented_color_bg . ';background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
1089 |
$r = 0;
|
1090 |
echo ' <div>';
|
1091 |
for ($j = 0; $j < $k; $j++) {
|
1092 |
+
|
1093 |
+
if(category_color($ev_id[$j])=='#')
|
1094 |
+
$cat_color=$bg_top;
|
1095 |
+
else
|
1096 |
+
$cat_color=category_color($ev_id[$j]);
|
1097 |
+
|
1098 |
if ($r < $number_of_shown_evetns) {
|
1099 |
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
1100 |
href="' . add_query_arg(array(
|
1110 |
'TB_iframe' => 1,
|
1111 |
'tbWidth' => $popup_width,
|
1112 |
'tbHeight' => $popup_height,
|
1113 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
1114 |
</a>';
|
1115 |
}
|
1116 |
else {
|
1137 |
</td>';
|
1138 |
}
|
1139 |
else {
|
1140 |
+
echo ' <td style=" color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px;border: 1px solid ' . $cell_border_color . ' !important;vertical-align:top;">
|
1141 |
<p style="font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;">' . $i . '</p>
|
1142 |
</td>';
|
1143 |
}
|
1171 |
</td>
|
1172 |
</tr>
|
1173 |
</table>
|
1174 |
+
|
1175 |
+
<script>
|
1176 |
+
|
1177 |
+
jQuery(document).ready(function (){
|
1178 |
+
|
1179 |
+
jQuery('#views_select').click(function () {
|
1180 |
+
jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
|
1181 |
+
}, function () {
|
1182 |
+
jQuery('#drop_down_views').stop(true, true).slideUp(500);
|
1183 |
+
});
|
1184 |
+
if(jQuery(window).width() > 640 )
|
1185 |
+
{
|
1186 |
+
jQuery('drop_down_views').hide();
|
1187 |
+
}
|
1188 |
+
});
|
1189 |
+
</script>
|
1190 |
+
|
1191 |
+
|
1192 |
+
<style>
|
1193 |
+
|
1194 |
+
@media only screen and (max-width : 640px) {
|
1195 |
+
|
1196 |
+
#views_tabs ,#drop_down_views
|
1197 |
+
{
|
1198 |
+
display:none;
|
1199 |
+
}
|
1200 |
+
|
1201 |
+
#views_tabs_select
|
1202 |
+
{
|
1203 |
+
display:block !important;
|
1204 |
+
}
|
1205 |
+
|
1206 |
+
|
1207 |
+
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
@media only screen and (max-width : 968px) {
|
1211 |
+
#cats >li
|
1212 |
+
{
|
1213 |
+
float:none;
|
1214 |
+
}
|
1215 |
+
|
1216 |
+
|
1217 |
+
|
1218 |
+
}
|
1219 |
+
|
1220 |
+
|
1221 |
+
.categories1 , .categories2
|
1222 |
+
{
|
1223 |
+
display:inline-block;
|
1224 |
+
}
|
1225 |
+
|
1226 |
+
.categories2
|
1227 |
+
{
|
1228 |
+
position:relative;
|
1229 |
+
left: -9px;
|
1230 |
+
cursor:pointer;
|
1231 |
+
}
|
1232 |
+
.categories2:first-letter
|
1233 |
+
{
|
1234 |
+
color:#fff;
|
1235 |
+
|
1236 |
+
}
|
1237 |
+
</style>
|
1238 |
<?php
|
1239 |
+
|
1240 |
+
//reindex cat_ids_array
|
1241 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
1242 |
+
|
1243 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
1244 |
+
{
|
1245 |
+
echo'
|
1246 |
+
<style>
|
1247 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
1248 |
+
{
|
1249 |
+
text-decoration:underline;
|
1250 |
+
cursor:pointer;
|
1251 |
+
|
1252 |
+
}
|
1253 |
+
|
1254 |
+
</style>';
|
1255 |
+
|
1256 |
+
}
|
1257 |
+
|
1258 |
+
|
1259 |
+
|
1260 |
+
if($cat_ids=='')
|
1261 |
+
$cat_ids='';
|
1262 |
+
|
1263 |
+
|
1264 |
+
echo '<ul id="cats" style="list-style-type:none;">';
|
1265 |
+
|
1266 |
+
foreach($categories as $category)
|
1267 |
+
{
|
1268 |
+
|
1269 |
+
?>
|
1270 |
+
|
1271 |
+
<li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1272 |
+
'action' => 'spiderbigcalendar_month',
|
1273 |
+
'theme_id' => $theme_id,
|
1274 |
+
'calendar' => $calendar_id,
|
1275 |
+
'select' => $view_select,
|
1276 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
1277 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1278 |
+
'cur_page_url' => $path_sp_cal,
|
1279 |
+
'cat_id' => $category->id,
|
1280 |
+
'cat_ids' => $cat_ids,
|
1281 |
+
'widget' => $widget,
|
1282 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1283 |
+
|
1284 |
+
|
1285 |
+
<?php
|
1286 |
+
|
1287 |
+
|
1288 |
+
}
|
1289 |
+
|
1290 |
+
echo '</ul><br><br>';
|
1291 |
die();
|
1292 |
}
|
1293 |
|
front_end/bigcalendarmonth_widget.php
CHANGED
@@ -10,6 +10,83 @@ function big_calendar_month_widget() {
|
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
14 |
$weekstart = $theme->week_start_day;
|
15 |
$bg = '#' . $theme->header_bgcolor;
|
@@ -138,6 +215,8 @@ function big_calendar_month_widget() {
|
|
138 |
text-decoration:none;
|
139 |
background:none;
|
140 |
}
|
|
|
|
|
141 |
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
142 |
border-spacing:0;
|
143 |
width:100%;
|
@@ -182,7 +261,48 @@ function big_calendar_month_widget() {
|
|
182 |
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
183 |
background: transparent !important;
|
184 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
</style>
|
|
|
186 |
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
187 |
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; height:190px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?>">
|
188 |
<tr style="background-color:#FFFFFF;">
|
@@ -197,10 +317,13 @@ function big_calendar_month_widget() {
|
|
197 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
198 |
'many_sp_calendar' => $many_sp_calendar,
|
199 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
200 |
'widget' => $widget,
|
201 |
-
|
|
|
202 |
</div>
|
203 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'
|
204 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
205 |
'action' => 'spiderbigcalendar_week_widget',
|
206 |
'theme_id' => $theme_id,
|
@@ -210,8 +333,10 @@ function big_calendar_month_widget() {
|
|
210 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
211 |
'many_sp_calendar' => $many_sp_calendar,
|
212 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
213 |
'widget' => $widget,
|
214 |
-
), admin_url('admin-ajax.php'));?>')" ><span style="
|
215 |
</div>
|
216 |
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
217 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
@@ -222,10 +347,12 @@ function big_calendar_month_widget() {
|
|
222 |
'date' => $year . '-' . add_0((Month_num($month))),
|
223 |
'many_sp_calendar' => $many_sp_calendar,
|
224 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
225 |
'widget' => $widget,
|
226 |
-
), admin_url('admin-ajax.php'));?>')"><span style="
|
227 |
</div>
|
228 |
-
<div class="views" style="
|
229 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
230 |
'action' => 'spiderbigcalendar_month_widget',
|
231 |
'theme_id' => $theme_id,
|
@@ -234,8 +361,10 @@ function big_calendar_month_widget() {
|
|
234 |
'date' => $year . '-' . add_0((Month_num($month))),
|
235 |
'many_sp_calendar' => $many_sp_calendar,
|
236 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
237 |
'widget' => $widget,
|
238 |
-
), admin_url('admin-ajax.php'));?>')" ><span style="position:relative;top:15%;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
239 |
</div>
|
240 |
</div>
|
241 |
</td>
|
@@ -265,9 +394,11 @@ function big_calendar_month_widget() {
|
|
265 |
'date' => $needed_date,
|
266 |
'many_sp_calendar' => $many_sp_calendar,
|
267 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
268 |
'widget' => $widget,
|
269 |
), admin_url('admin-ajax.php'));
|
270 |
-
?>')">◄
|
271 |
</a>
|
272 |
</td>
|
273 |
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
@@ -277,6 +408,7 @@ function big_calendar_month_widget() {
|
|
277 |
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
278 |
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
279 |
if (Month_num($month) == 12) {
|
|
|
280 |
$needed_date = ($year + 1) . '-01';
|
281 |
}
|
282 |
else {
|
@@ -290,16 +422,18 @@ function big_calendar_month_widget() {
|
|
290 |
'date' => $needed_date,
|
291 |
'many_sp_calendar' => $many_sp_calendar,
|
292 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
293 |
'widget' => $widget,
|
294 |
), admin_url('admin-ajax.php'));
|
295 |
-
?>')">►
|
296 |
</a>
|
297 |
</td>
|
298 |
</tr>
|
299 |
</table>
|
300 |
</td>
|
301 |
</tr>
|
302 |
-
<tr class="cell_body" align="center" height="10%" style="background-color:<?php echo $weekdays_bg_color;
|
303 |
<?php if ($weekstart == "su") { ?>
|
304 |
<td style="font-family:<?php echo $font_weekday; ?>;background-color:<?php echo $weekday_su_bg_color; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
305 |
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
@@ -330,6 +464,7 @@ function big_calendar_month_widget() {
|
|
330 |
<?php } ?>
|
331 |
</tr>
|
332 |
<?php
|
|
|
333 |
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
334 |
if ($weekstart == "su") {
|
335 |
$month_first_weekday++;
|
@@ -349,8 +484,12 @@ function big_calendar_month_widget() {
|
|
349 |
$sum = $sum - ($sum % 7);
|
350 |
$percent = $percent + ($sum / 7);
|
351 |
$percent = 107 / $percent;
|
|
|
352 |
$all_calendar_files = php_getdays(1, $calendar_id, $date, $theme_id, $widget);
|
|
|
|
|
353 |
$array_days = $all_calendar_files[0]['array_days'];
|
|
|
354 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
355 |
$title = $all_calendar_files[0]['title'];
|
356 |
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
@@ -359,6 +498,9 @@ function big_calendar_month_widget() {
|
|
359 |
echo ' <td class="caltext_color_other_months" style="text-align:center;">' . $last_month_days . '</td>';
|
360 |
$last_month_days = $last_month_days + 1;
|
361 |
}
|
|
|
|
|
|
|
362 |
for ($i = 1; $i <= $month_days; $i++) {
|
363 |
if (isset($title[$i])) {
|
364 |
$ev_title = explode('</p>', $title[$i]);
|
@@ -368,8 +510,23 @@ function big_calendar_month_widget() {
|
|
368 |
array_pop($ev_id);
|
369 |
$ev_ids_inline = implode(',', $ev_id);
|
370 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
372 |
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
|
|
373 |
echo ' <td class="cala_day" style="background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
374 |
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
375 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
@@ -389,7 +546,7 @@ function big_calendar_month_widget() {
|
|
389 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
390 |
</a>
|
391 |
</div>
|
392 |
-
|
393 |
}
|
394 |
elseif ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
395 |
if (in_array($i, $array_days)) {
|
@@ -411,8 +568,13 @@ function big_calendar_month_widget() {
|
|
411 |
'tbWidth' => $popup_width,
|
412 |
'tbHeight' => $popup_height,
|
413 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
414 |
-
</a>
|
415 |
-
|
|
|
|
|
|
|
|
|
|
|
416 |
}
|
417 |
else {
|
418 |
echo '
|
@@ -432,8 +594,13 @@ function big_calendar_month_widget() {
|
|
432 |
'tbWidth' => $popup_width,
|
433 |
'tbHeight' => $popup_height,
|
434 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
435 |
-
</a>
|
436 |
-
|
|
|
|
|
|
|
|
|
|
|
437 |
}
|
438 |
}
|
439 |
else {
|
@@ -446,6 +613,7 @@ function big_calendar_month_widget() {
|
|
446 |
else {
|
447 |
if (in_array ($i, $array_days)) {
|
448 |
if (in_array ($i, $array_days1)) {
|
|
|
449 |
echo '
|
450 |
<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
451 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . ';text-align:center;text-decoration:underline;"
|
@@ -462,9 +630,15 @@ function big_calendar_month_widget() {
|
|
462 |
'TB_iframe' => 1,
|
463 |
'tbWidth' => $popup_width,
|
464 |
'tbHeight' => $popup_height,
|
|
|
465 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
466 |
-
</a>
|
467 |
-
|
|
|
|
|
|
|
|
|
|
|
468 |
}
|
469 |
else {
|
470 |
echo '
|
@@ -483,9 +657,15 @@ function big_calendar_month_widget() {
|
|
483 |
'TB_iframe' => 1,
|
484 |
'tbWidth' => $popup_width,
|
485 |
'tbHeight' => $popup_height,
|
|
|
486 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
487 |
-
</a>
|
488 |
-
|
|
|
|
|
|
|
|
|
|
|
489 |
}
|
490 |
}
|
491 |
else {
|
@@ -497,6 +677,9 @@ function big_calendar_month_widget() {
|
|
497 |
}
|
498 |
}
|
499 |
elseif ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
|
|
|
|
|
|
500 |
echo ' <td style="background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
501 |
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
502 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
@@ -513,13 +696,32 @@ function big_calendar_month_widget() {
|
|
513 |
'TB_iframe' => 1,
|
514 |
'tbWidth' => $popup_width,
|
515 |
'tbHeight' => $popup_height,
|
|
|
516 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
517 |
-
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
518 |
</td>';
|
|
|
|
|
519 |
}
|
520 |
else {
|
521 |
if ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
|
|
|
|
522 |
if (in_array ($i, $array_days)) {
|
|
|
|
|
523 |
if (in_array ($i, $array_days1)) {
|
524 |
echo '
|
525 |
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
@@ -537,14 +739,20 @@ function big_calendar_month_widget() {
|
|
537 |
'TB_iframe' => 1,
|
538 |
'tbWidth' => $popup_width,
|
539 |
'tbHeight' => $popup_height,
|
|
|
540 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
541 |
-
</a>
|
542 |
-
|
|
|
|
|
|
|
|
|
|
|
543 |
}
|
544 |
else {
|
545 |
echo '
|
546 |
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
547 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-align:center;text-decoration:underline;"
|
548 |
href="' . add_query_arg(array(
|
549 |
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
550 |
'theme_id' => $theme_id,
|
@@ -558,17 +766,25 @@ function big_calendar_month_widget() {
|
|
558 |
'TB_iframe' => 1,
|
559 |
'tbWidth' => $popup_width,
|
560 |
'tbHeight' => $popup_height,
|
561 |
-
|
562 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
563 |
}
|
564 |
}
|
565 |
else {
|
|
|
566 |
echo '<td style="text-align:center; color:' . $text_color_selected . ';padding:0; margin:0; line-height:inherit; border: 2px solid ' . $border_day . '">
|
567 |
<b>' . $i . '</b>
|
568 |
</td>';
|
569 |
}
|
570 |
}
|
571 |
elseif (in_array($i, $array_days)) {
|
|
|
572 |
if (in_array ($i, $array_days1)) {
|
573 |
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
574 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . '; text-align:center;text-decoration:underline;"
|
@@ -585,9 +801,15 @@ function big_calendar_month_widget() {
|
|
585 |
'TB_iframe' => 1,
|
586 |
'tbWidth' => $popup_width,
|
587 |
'tbHeight' => $popup_height,
|
|
|
588 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
589 |
-
</a>
|
590 |
-
|
|
|
|
|
|
|
|
|
|
|
591 |
}
|
592 |
else {
|
593 |
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
@@ -605,8 +827,15 @@ function big_calendar_month_widget() {
|
|
605 |
'TB_iframe' => 1,
|
606 |
'tbWidth' => $popup_width,
|
607 |
'tbHeight' => $popup_height,
|
|
|
608 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b></a>
|
609 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
610 |
}
|
611 |
}
|
612 |
else {
|
@@ -643,7 +872,10 @@ function big_calendar_month_widget() {
|
|
643 |
'many_sp_calendar' => $many_sp_calendar,
|
644 |
'cur_page_url' => $path_sp_cal,
|
645 |
'widget' => $widget,
|
646 |
-
|
|
|
|
|
|
|
647 |
<?php echo ($year - 1); ?>
|
648 |
</td>
|
649 |
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
@@ -659,7 +891,10 @@ function big_calendar_month_widget() {
|
|
659 |
'many_sp_calendar' => $many_sp_calendar,
|
660 |
'cur_page_url' => $path_sp_cal,
|
661 |
'widget' => $widget,
|
662 |
-
|
|
|
|
|
|
|
663 |
<?php echo ($year + 1); ?>
|
664 |
</td>
|
665 |
</tr>
|
@@ -670,7 +905,83 @@ function big_calendar_month_widget() {
|
|
670 |
</tr>
|
671 |
</table>
|
672 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
673 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
die();
|
675 |
}
|
676 |
|
10 |
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
|
13 |
+
///////////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
if(isset($_GET['cat_id']))
|
18 |
+
$cat_id = $_GET['cat_id'];
|
19 |
+
else $cat_id = "";
|
20 |
+
|
21 |
+
if(isset($_GET['cat_ids']))
|
22 |
+
$cat_ids = $_GET['cat_ids'];
|
23 |
+
else $cat_ids = "";
|
24 |
+
|
25 |
+
if($cat_ids=='')
|
26 |
+
$cat_ids .= $cat_id.',';
|
27 |
+
else
|
28 |
+
$cat_ids .= ','.$cat_id.',';
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
33 |
+
|
34 |
+
function getelementcountinarray($array , $element)
|
35 |
+
{
|
36 |
+
$t=0;
|
37 |
+
|
38 |
+
for($i=0; $i<count($array); $i++)
|
39 |
+
{
|
40 |
+
if($element==$array[$i])
|
41 |
+
$t++;
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
return $t;
|
47 |
+
|
48 |
+
}
|
49 |
+
|
50 |
+
function getelementindexinarray($array , $element)
|
51 |
+
{
|
52 |
+
|
53 |
+
$t='';
|
54 |
+
|
55 |
+
for($i=0; $i<count($array); $i++)
|
56 |
+
{
|
57 |
+
if($element==$array[$i])
|
58 |
+
$t.=$i.',';
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
return $t;
|
63 |
+
|
64 |
+
|
65 |
+
}
|
66 |
+
$cat_ids_array = explode(',',$cat_ids);
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
if($cat_id!='')
|
71 |
+
{
|
72 |
+
|
73 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
+
{
|
75 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
+
$index_array = explode(',' , $index_in_line);
|
77 |
+
array_pop ($index_array);
|
78 |
+
for($j=0; $j<count($index_array); $j++)
|
79 |
+
unset($cat_ids_array[$index_array[$j]]);
|
80 |
+
$cat_ids = implode(',',$cat_ids_array);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
else
|
84 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
+
|
86 |
+
|
87 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
88 |
+
|
89 |
+
|
90 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
91 |
$weekstart = $theme->week_start_day;
|
92 |
$bg = '#' . $theme->header_bgcolor;
|
215 |
text-decoration:none;
|
216 |
background:none;
|
217 |
}
|
218 |
+
|
219 |
+
|
220 |
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
221 |
border-spacing:0;
|
222 |
width:100%;
|
261 |
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
262 |
background: transparent !important;
|
263 |
}
|
264 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
265 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
266 |
+
{
|
267 |
+
|
268 |
+
background-color: <?php echo $views_tabs_bg_color?> ;
|
269 |
+
width: 120px;
|
270 |
+
text-align: center;
|
271 |
+
cursor: pointer;
|
272 |
+
padding: 6px;
|
273 |
+
position: relative;
|
274 |
+
}
|
275 |
+
|
276 |
+
|
277 |
+
#drop_down_views
|
278 |
+
{
|
279 |
+
list-style-type:none !important;
|
280 |
+
position: absolute;
|
281 |
+
top: 46px;
|
282 |
+
left: -15px;
|
283 |
+
display:none;
|
284 |
+
z-index: 4545;
|
285 |
+
|
286 |
+
}
|
287 |
+
|
288 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
289 |
+
{
|
290 |
+
background:<?php echo $bg_top ?>;
|
291 |
+
}
|
292 |
+
|
293 |
+
#drop_down_views >li
|
294 |
+
{
|
295 |
+
border-bottom:1px solid #fff !important;
|
296 |
+
}
|
297 |
+
|
298 |
+
|
299 |
+
#views_tabs_select
|
300 |
+
{
|
301 |
+
display:none;
|
302 |
+
}
|
303 |
+
|
304 |
</style>
|
305 |
+
|
306 |
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
307 |
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; height:190px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?>">
|
308 |
<tr style="background-color:#FFFFFF;">
|
317 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
318 |
'many_sp_calendar' => $many_sp_calendar,
|
319 |
'cur_page_url' => $path_sp_cal,
|
320 |
+
'cat_id' => '',
|
321 |
+
'cat_ids' => $cat_ids,
|
322 |
'widget' => $widget,
|
323 |
+
'rand' => $many_sp_calendar,
|
324 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
325 |
</div>
|
326 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ';height:28px;top:0;' ?>"
|
327 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
328 |
'action' => 'spiderbigcalendar_week_widget',
|
329 |
'theme_id' => $theme_id,
|
333 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
334 |
'many_sp_calendar' => $many_sp_calendar,
|
335 |
'cur_page_url' => $path_sp_cal,
|
336 |
+
'cat_id' => '',
|
337 |
+
'cat_ids' => $cat_ids,
|
338 |
'widget' => $widget,
|
339 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
340 |
</div>
|
341 |
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
342 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
347 |
'date' => $year . '-' . add_0((Month_num($month))),
|
348 |
'many_sp_calendar' => $many_sp_calendar,
|
349 |
'cur_page_url' => $path_sp_cal,
|
350 |
+
'cat_id' => '',
|
351 |
+
'cat_ids' => $cat_ids,
|
352 |
'widget' => $widget,
|
353 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
354 |
</div>
|
355 |
+
<div class="views" style="margin-left: 0px;margin-right: 2px;<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
356 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
357 |
'action' => 'spiderbigcalendar_month_widget',
|
358 |
'theme_id' => $theme_id,
|
361 |
'date' => $year . '-' . add_0((Month_num($month))),
|
362 |
'many_sp_calendar' => $many_sp_calendar,
|
363 |
'cur_page_url' => $path_sp_cal,
|
364 |
+
'cat_id' => '',
|
365 |
+
'cat_ids' => $cat_ids,
|
366 |
'widget' => $widget,
|
367 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="position:relative;top:15%;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
368 |
</div>
|
369 |
</div>
|
370 |
</td>
|
394 |
'date' => $needed_date,
|
395 |
'many_sp_calendar' => $many_sp_calendar,
|
396 |
'cur_page_url' => $path_sp_cal,
|
397 |
+
'cat_id' => '',
|
398 |
+
'cat_ids' => $cat_ids,
|
399 |
'widget' => $widget,
|
400 |
), admin_url('admin-ajax.php'));
|
401 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◄
|
402 |
</a>
|
403 |
</td>
|
404 |
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
408 |
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
409 |
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
410 |
if (Month_num($month) == 12) {
|
411 |
+
|
412 |
$needed_date = ($year + 1) . '-01';
|
413 |
}
|
414 |
else {
|
422 |
'date' => $needed_date,
|
423 |
'many_sp_calendar' => $many_sp_calendar,
|
424 |
'cur_page_url' => $path_sp_cal,
|
425 |
+
'cat_id' => '',
|
426 |
+
'cat_ids' => $cat_ids,
|
427 |
'widget' => $widget,
|
428 |
), admin_url('admin-ajax.php'));
|
429 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">►
|
430 |
</a>
|
431 |
</td>
|
432 |
</tr>
|
433 |
</table>
|
434 |
</td>
|
435 |
</tr>
|
436 |
+
<tr class="cell_body" align="center" height="10%" style="background-color:<?php echo $weekdays_bg_color; ?> !important;width:<?php echo $calendar_width; ?>px">
|
437 |
<?php if ($weekstart == "su") { ?>
|
438 |
<td style="font-family:<?php echo $font_weekday; ?>;background-color:<?php echo $weekday_su_bg_color; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
439 |
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
464 |
<?php } ?>
|
465 |
</tr>
|
466 |
<?php
|
467 |
+
|
468 |
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
469 |
if ($weekstart == "su") {
|
470 |
$month_first_weekday++;
|
484 |
$sum = $sum - ($sum % 7);
|
485 |
$percent = $percent + ($sum / 7);
|
486 |
$percent = 107 / $percent;
|
487 |
+
|
488 |
$all_calendar_files = php_getdays(1, $calendar_id, $date, $theme_id, $widget);
|
489 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
490 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
491 |
$array_days = $all_calendar_files[0]['array_days'];
|
492 |
+
|
493 |
$array_days1 = $all_calendar_files[0]['array_days1'];
|
494 |
$title = $all_calendar_files[0]['title'];
|
495 |
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
498 |
echo ' <td class="caltext_color_other_months" style="text-align:center;">' . $last_month_days . '</td>';
|
499 |
$last_month_days = $last_month_days + 1;
|
500 |
}
|
501 |
+
|
502 |
+
|
503 |
+
|
504 |
for ($i = 1; $i <= $month_days; $i++) {
|
505 |
if (isset($title[$i])) {
|
506 |
$ev_title = explode('</p>', $title[$i]);
|
510 |
array_pop($ev_id);
|
511 |
$ev_ids_inline = implode(',', $ev_id);
|
512 |
}
|
513 |
+
else
|
514 |
+
$k=0;
|
515 |
+
|
516 |
+
if(isset($ev_ids_inline)){
|
517 |
+
if($cat_ids!='')
|
518 |
+
$query = "SELECT DISTINCT sec.color FROM " . $wpdb->prefix . "spidercalendar_event AS se JOIN
|
519 |
+
" . $wpdb->prefix . "spidercalendar_event_category AS sec ON se.category=sec.id WHERE se.published='1' AND sec.published='1' AND se.calendar=".$calendar_id." AND se.id IN (".$ev_ids_inline.") ";
|
520 |
+
else
|
521 |
+
$query = "SELECT DISTINCT sec.color FROM " . $wpdb->prefix . "spidercalendar_event AS se JOIN
|
522 |
+
" . $wpdb->prefix . "spidercalendar_event_category AS sec ON se.category=sec.id WHERE se.published='1' AND sec.published='1' AND se.calendar=".$calendar_id." AND se.id IN (".$ev_ids_inline.") ";
|
523 |
+
|
524 |
+
$categ_color=$wpdb->get_results($query);
|
525 |
+
}
|
526 |
+
|
527 |
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
528 |
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
529 |
+
|
530 |
echo ' <td class="cala_day" style="background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
531 |
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
532 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
546 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
547 |
</a>
|
548 |
</div>
|
549 |
+
</td>';
|
550 |
}
|
551 |
elseif ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
552 |
if (in_array($i, $array_days)) {
|
568 |
'tbWidth' => $popup_width,
|
569 |
'tbHeight' => $popup_height,
|
570 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
571 |
+
</a>';
|
572 |
+
echo '<table style="width:100%; border:0;margin: 0"><tr>';
|
573 |
+
foreach($categ_color as $color){
|
574 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
575 |
+
}
|
576 |
+
echo '</tr></table>';
|
577 |
+
echo '</td>';
|
578 |
}
|
579 |
else {
|
580 |
echo '
|
594 |
'tbWidth' => $popup_width,
|
595 |
'tbHeight' => $popup_height,
|
596 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
597 |
+
</a>';
|
598 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
599 |
+
foreach($categ_color as $color){
|
600 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
601 |
+
}
|
602 |
+
echo '</tr></table>';
|
603 |
+
echo '</td>';
|
604 |
}
|
605 |
}
|
606 |
else {
|
613 |
else {
|
614 |
if (in_array ($i, $array_days)) {
|
615 |
if (in_array ($i, $array_days1)) {
|
616 |
+
|
617 |
echo '
|
618 |
<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
619 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . ';text-align:center;text-decoration:underline;"
|
630 |
'TB_iframe' => 1,
|
631 |
'tbWidth' => $popup_width,
|
632 |
'tbHeight' => $popup_height,
|
633 |
+
'cat_id' => $cat_ids
|
634 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
635 |
+
</a>';
|
636 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
637 |
+
foreach($categ_color as $color){
|
638 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
639 |
+
}
|
640 |
+
echo '</tr></table>';
|
641 |
+
echo '</td>';
|
642 |
}
|
643 |
else {
|
644 |
echo '
|
657 |
'TB_iframe' => 1,
|
658 |
'tbWidth' => $popup_width,
|
659 |
'tbHeight' => $popup_height,
|
660 |
+
'cat_id' => $cat_ids
|
661 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
662 |
+
</a>';
|
663 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
664 |
+
foreach($categ_color as $color){
|
665 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
666 |
+
}
|
667 |
+
echo '</tr></table>';
|
668 |
+
echo '</td>';
|
669 |
}
|
670 |
}
|
671 |
else {
|
677 |
}
|
678 |
}
|
679 |
elseif ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
680 |
+
|
681 |
+
if (in_array ($i,$array_days)) {
|
682 |
+
|
683 |
echo ' <td style="background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
684 |
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
685 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
696 |
'TB_iframe' => 1,
|
697 |
'tbWidth' => $popup_width,
|
698 |
'tbHeight' => $popup_height,
|
699 |
+
'cat_id' => $cat_ids
|
700 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
701 |
+
</a>';
|
702 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
703 |
+
foreach($categ_color as $color){
|
704 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
705 |
+
}
|
706 |
+
echo '</tr></table>';
|
707 |
+
echo '</td>';
|
708 |
+
}
|
709 |
+
|
710 |
+
else {
|
711 |
+
|
712 |
+
echo '<td style="text-align:center; color:' . $text_color_selected . ';padding:0; margin:0; line-height:inherit; border: 2px solid ' . $border_day . '">
|
713 |
+
<b>' . $i . '</b>
|
714 |
</td>';
|
715 |
+
}
|
716 |
+
|
717 |
}
|
718 |
else {
|
719 |
if ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
720 |
+
|
721 |
+
|
722 |
if (in_array ($i, $array_days)) {
|
723 |
+
|
724 |
+
|
725 |
if (in_array ($i, $array_days1)) {
|
726 |
echo '
|
727 |
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
739 |
'TB_iframe' => 1,
|
740 |
'tbWidth' => $popup_width,
|
741 |
'tbHeight' => $popup_height,
|
742 |
+
'cat_id' => $cat_ids
|
743 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
744 |
+
</a>';
|
745 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
746 |
+
foreach($categ_color as $color){
|
747 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
748 |
+
}
|
749 |
+
echo '</tr></table>';
|
750 |
+
echo '</td>';
|
751 |
}
|
752 |
else {
|
753 |
echo '
|
754 |
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
755 |
+
<a id="cur_day" class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-align:center;text-decoration:underline;"
|
756 |
href="' . add_query_arg(array(
|
757 |
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
758 |
'theme_id' => $theme_id,
|
766 |
'TB_iframe' => 1,
|
767 |
'tbWidth' => $popup_width,
|
768 |
'tbHeight' => $popup_height,
|
769 |
+
'cat_id' => $cat_ids
|
770 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b></a>';
|
771 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
772 |
+
foreach($categ_color as $color){
|
773 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
774 |
+
}
|
775 |
+
echo '</tr></table>';
|
776 |
+
echo '</td>';
|
777 |
}
|
778 |
}
|
779 |
else {
|
780 |
+
|
781 |
echo '<td style="text-align:center; color:' . $text_color_selected . ';padding:0; margin:0; line-height:inherit; border: 2px solid ' . $border_day . '">
|
782 |
<b>' . $i . '</b>
|
783 |
</td>';
|
784 |
}
|
785 |
}
|
786 |
elseif (in_array($i, $array_days)) {
|
787 |
+
|
788 |
if (in_array ($i, $array_days1)) {
|
789 |
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
790 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . '; text-align:center;text-decoration:underline;"
|
801 |
'TB_iframe' => 1,
|
802 |
'tbWidth' => $popup_width,
|
803 |
'tbHeight' => $popup_height,
|
804 |
+
'cat_id' => $cat_ids
|
805 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
806 |
+
</a>';
|
807 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
808 |
+
foreach($categ_color as $color){
|
809 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
810 |
+
}
|
811 |
+
echo '</tr></table>';
|
812 |
+
echo '</td>';
|
813 |
}
|
814 |
else {
|
815 |
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
827 |
'TB_iframe' => 1,
|
828 |
'tbWidth' => $popup_width,
|
829 |
'tbHeight' => $popup_height,
|
830 |
+
'cat_id' => $cat_ids
|
831 |
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b></a>
|
832 |
+
';
|
833 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
834 |
+
foreach($categ_color as $color){
|
835 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
836 |
+
}
|
837 |
+
echo '</tr></table>';
|
838 |
+
echo '</td>';
|
839 |
}
|
840 |
}
|
841 |
else {
|
872 |
'many_sp_calendar' => $many_sp_calendar,
|
873 |
'cur_page_url' => $path_sp_cal,
|
874 |
'widget' => $widget,
|
875 |
+
'cat_id' => '',
|
876 |
+
'cat_ids' => $cat_ids,
|
877 |
+
'TB_iframe' => 1,
|
878 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?>">
|
879 |
<?php echo ($year - 1); ?>
|
880 |
</td>
|
881 |
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
891 |
'many_sp_calendar' => $many_sp_calendar,
|
892 |
'cur_page_url' => $path_sp_cal,
|
893 |
'widget' => $widget,
|
894 |
+
'cat_id' => '',
|
895 |
+
'cat_ids' => $cat_ids,
|
896 |
+
'TB_iframe' => 1,
|
897 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?>;color:<?php echo $year_font_color; ?>">
|
898 |
<?php echo ($year + 1); ?>
|
899 |
</td>
|
900 |
</tr>
|
905 |
</tr>
|
906 |
</table>
|
907 |
</div>
|
908 |
+
<style>
|
909 |
+
table{
|
910 |
+
width: 100%;
|
911 |
+
}
|
912 |
+
|
913 |
+
.categories1 , .categories2
|
914 |
+
{
|
915 |
+
display:inline-block;
|
916 |
+
}
|
917 |
+
|
918 |
+
.categories2
|
919 |
+
{
|
920 |
+
position:relative;
|
921 |
+
left: -9px;
|
922 |
+
cursor:pointer;
|
923 |
+
}
|
924 |
+
.categories2:first-letter
|
925 |
+
{
|
926 |
+
color:#fff;
|
927 |
+
|
928 |
+
}
|
929 |
+
</style>
|
930 |
<?php
|
931 |
+
|
932 |
+
//reindex cat_ids_array
|
933 |
+
|
934 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
935 |
+
|
936 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
937 |
+
{
|
938 |
+
echo'
|
939 |
+
<style>
|
940 |
+
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
941 |
+
{
|
942 |
+
text-decoration:underline;
|
943 |
+
cursor:pointer;
|
944 |
+
|
945 |
+
}
|
946 |
+
|
947 |
+
</style>';
|
948 |
+
|
949 |
+
}
|
950 |
+
|
951 |
+
|
952 |
+
|
953 |
+
if($cat_ids=='')
|
954 |
+
$cat_ids='';
|
955 |
+
|
956 |
+
|
957 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
|
958 |
+
|
959 |
+
foreach($categories as $category)
|
960 |
+
{
|
961 |
+
|
962 |
+
?>
|
963 |
+
|
964 |
+
<li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
965 |
+
'action' => 'spiderbigcalendar_month_widget',
|
966 |
+
'theme_id' => $theme_id,
|
967 |
+
'calendar' => $calendar_id,
|
968 |
+
'select' => $view_select,
|
969 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
970 |
+
'many_sp_calendar' => $many_sp_calendar,
|
971 |
+
'cur_page_url' => $path_sp_cal,
|
972 |
+
'cat_id' => $category->id,
|
973 |
+
'cat_ids' => $cat_ids,
|
974 |
+
'widget' => $widget,
|
975 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
976 |
+
|
977 |
+
|
978 |
+
<?php
|
979 |
+
|
980 |
+
|
981 |
+
}
|
982 |
+
|
983 |
+
echo '</ul><br><br>';
|
984 |
+
|
985 |
die();
|
986 |
}
|
987 |
|
front_end/bigcalendarweek.php
CHANGED
@@ -11,6 +11,80 @@ function big_calendar_week() {
|
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
15 |
$cal_width = $theme->width;
|
16 |
$bg_top = '#' . $theme->bg_top;
|
@@ -74,7 +148,8 @@ function big_calendar_week() {
|
|
74 |
$views_tabs_bg_color = '#' . $theme->views_tabs_bg_color;
|
75 |
$views_tabs_text_color = '#' . $theme->views_tabs_text_color;
|
76 |
$views_tabs_font_size = $theme->views_tabs_font_size;
|
77 |
-
|
|
|
78 |
__('January', 'sp_calendar');
|
79 |
__('February', 'sp_calendar');
|
80 |
__('March', 'sp_calendar');
|
@@ -158,6 +233,18 @@ function big_calendar_week() {
|
|
158 |
}
|
159 |
?>
|
160 |
<style type='text/css'>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
162 |
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
163 |
#spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
@@ -170,6 +257,12 @@ function big_calendar_week() {
|
|
170 |
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
171 |
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
172 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : link,
|
174 |
#bigcalendar .cala_arrow a:visited {
|
175 |
text-decoration: none !important;
|
@@ -291,7 +384,7 @@ function big_calendar_week() {
|
|
291 |
}
|
292 |
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
293 |
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
294 |
-
border-top-right-radius: <?php echo border_radius2; ?>px;
|
295 |
}
|
296 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
297 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
@@ -360,21 +453,66 @@ function big_calendar_week() {
|
|
360 |
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
361 |
float: right;
|
362 |
background-color: <?php echo $views_tabs_bg_color; ?>;
|
363 |
-
height: 25px;
|
364 |
-
width: 70px;
|
365 |
margin-right: 2px;
|
366 |
text-align: center;
|
367 |
cursor:pointer;
|
368 |
position: relative;
|
369 |
top: 5px;
|
370 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
</style>
|
372 |
-
<div style="
|
|
|
373 |
<table cellpadding="0" cellspacing="0">
|
374 |
<tr>
|
375 |
<td>
|
376 |
-
<div id="views_tabs" style="
|
377 |
-
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ';
|
378 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
379 |
'action' => 'spiderbigcalendar_day',
|
380 |
'theme_id' => $theme_id,
|
@@ -383,10 +521,13 @@ function big_calendar_week() {
|
|
383 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
384 |
'many_sp_calendar' => $many_sp_calendar,
|
385 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
386 |
'widget' => $widget,
|
387 |
-
|
|
|
388 |
</div>
|
389 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';
|
390 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
391 |
'action' => 'spiderbigcalendar_week',
|
392 |
'theme_id' => $theme_id,
|
@@ -396,10 +537,13 @@ function big_calendar_week() {
|
|
396 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
397 |
'many_sp_calendar' => $many_sp_calendar,
|
398 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
399 |
'widget' => $widget,
|
400 |
-
|
|
|
401 |
</div>
|
402 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';
|
403 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
404 |
'action' => 'spiderbigcalendar_list',
|
405 |
'theme_id' => $theme_id,
|
@@ -408,10 +552,13 @@ function big_calendar_week() {
|
|
408 |
'date' => $year . '-' . add_0((Month_num($month))),
|
409 |
'many_sp_calendar' => $many_sp_calendar,
|
410 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
411 |
'widget' => $widget,
|
412 |
-
|
|
|
413 |
</div>
|
414 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';
|
415 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
416 |
'action' => 'spiderbigcalendar_month',
|
417 |
'theme_id' => $theme_id,
|
@@ -420,21 +567,103 @@ function big_calendar_week() {
|
|
420 |
'date' => $year . '-' . add_0((Month_num($month))),
|
421 |
'many_sp_calendar' => $many_sp_calendar,
|
422 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
423 |
'widget' => $widget,
|
424 |
-
|
|
|
425 |
</div>
|
426 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
</td>
|
428 |
</tr>
|
429 |
<tr>
|
430 |
<td>
|
431 |
-
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width
|
432 |
<tr>
|
433 |
<td width="100%" style="padding:0; margin:0">
|
434 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width
|
435 |
-
<tr style="height:40px; width
|
436 |
-
<td class="top_table" align="center" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
437 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width
|
438 |
<tr>
|
439 |
<td style="width:100%;vertical-align:center">
|
440 |
<table style="width:100%;">
|
@@ -450,9 +679,11 @@ function big_calendar_week() {
|
|
450 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
451 |
'many_sp_calendar' => $many_sp_calendar,
|
452 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
453 |
'widget' => $widget,
|
454 |
-
), admin_url('admin-ajax.php'));?>')" style="text-align:center; cursor:pointer; width:100%;
|
455 |
-
<span style="
|
456 |
</div>
|
457 |
</td>
|
458 |
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
@@ -466,13 +697,15 @@ function big_calendar_week() {
|
|
466 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
467 |
'many_sp_calendar' => $many_sp_calendar,
|
468 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
469 |
'widget' => $widget,
|
470 |
-
), admin_url('admin-ajax.php'));?>')">&#
|
471 |
</a>
|
472 |
</td>
|
473 |
<td style="text-align:center; margin:0;" width="40%">
|
474 |
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
475 |
-
<span style="font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size; ?>px;text-shadow: 1px 1px black;"><?php echo __('Week', 'sp_calendar'); ?> <?php echo date('W', mktime(0, 0, 0, month_num($month), $day, $year)) . ', ' . $year; ?></span>
|
476 |
</td>
|
477 |
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
478 |
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
@@ -485,8 +718,10 @@ function big_calendar_week() {
|
|
485 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
486 |
'many_sp_calendar' => $many_sp_calendar,
|
487 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
488 |
'widget' => $widget,
|
489 |
-
), admin_url('admin-ajax.php'));?>')">&#
|
490 |
</a>
|
491 |
</td>
|
492 |
<td width="15%">
|
@@ -500,9 +735,11 @@ function big_calendar_week() {
|
|
500 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
501 |
'many_sp_calendar' => $many_sp_calendar,
|
502 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
503 |
'widget' => $widget,
|
504 |
-
), admin_url('admin-ajax.php'));?>')" style="text-align:center; cursor:pointer; width:100%;
|
505 |
-
<span style="
|
506 |
</div>
|
507 |
</td>
|
508 |
</tr>
|
@@ -511,9 +748,7 @@ function big_calendar_week() {
|
|
511 |
</tr>
|
512 |
</table>
|
513 |
</td>
|
514 |
-
|
515 |
-
<?php //MONTH TABLE ?>
|
516 |
-
</td>
|
517 |
</tr>
|
518 |
</tr>
|
519 |
<tr>
|
@@ -542,6 +777,9 @@ function big_calendar_week() {
|
|
542 |
|
543 |
$all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
|
544 |
|
|
|
|
|
|
|
545 |
$all_array_days = $all_calendar_files[0]['all_array_days'];
|
546 |
$all_array_days1 = $all_calendar_files[0]['all_array_days1'];
|
547 |
$all_title = $all_calendar_files[0]['all_title'];
|
@@ -552,37 +790,43 @@ function big_calendar_week() {
|
|
552 |
$next_month = substr($months, 6, 2);
|
553 |
|
554 |
for ($i = 0; $i <= 6; $i++) {
|
555 |
-
$day
|
556 |
-
$month
|
557 |
-
$year
|
558 |
-
|
|
|
|
|
559 |
case $prev_month:
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
|
566 |
case $this_month:
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
|
573 |
case $next_month:
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
|
|
|
|
|
|
|
|
580 |
sort($array_days, SORT_NUMERIC);
|
581 |
$week_day = date('D', mktime(0, 0, 0, $month, (int) $day, $year));
|
582 |
echo '<table style="width:100%;border-spacing:0;">
|
583 |
<tr>
|
584 |
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
|
585 |
-
<span style="padding-left:10px; font-size:' . $
|
586 |
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . month_name($month) . ' ' . (int) $day . ')</span>
|
587 |
</td>
|
588 |
<tr>
|
@@ -596,6 +840,12 @@ function big_calendar_week() {
|
|
596 |
$ev_title = explode('</p>', $value);
|
597 |
array_pop($ev_title);
|
598 |
for ($j = 0; $j < count($ev_title); $j++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
if (($j + 1) % 2 == 0) {
|
600 |
$color = $event_num_bg_color2;
|
601 |
$table_color = $event_bg_color2;
|
@@ -604,9 +854,10 @@ function big_calendar_week() {
|
|
604 |
$color = $event_num_bg_color1;
|
605 |
$table_color = $event_bg_color1;
|
606 |
}
|
607 |
-
|
|
|
608 |
<tr>
|
609 |
-
<td style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color
|
610 |
<td>
|
611 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color:' . $event_title_color . ';"
|
612 |
href="' . add_query_arg(array(
|
@@ -632,10 +883,10 @@ function big_calendar_week() {
|
|
632 |
}
|
633 |
}
|
634 |
else {
|
635 |
-
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '">
|
636 |
<tr>
|
637 |
-
<td style="font-size:22px; font-weight:bold; width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ';color:' . $event_num_color . '"></td>
|
638 |
-
<td><
|
639 |
</tr>
|
640 |
</table>';
|
641 |
}
|
@@ -651,7 +902,122 @@ function big_calendar_week() {
|
|
651 |
</tr>
|
652 |
</table>
|
653 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
654 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
655 |
die();
|
656 |
}
|
657 |
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
13 |
|
14 |
+
///////////////////////////////////////////////////////////////////////////////////
|
15 |
+
|
16 |
+
|
17 |
+
if(isset($_GET['cat_id']))
|
18 |
+
$cat_id = $_GET['cat_id'];
|
19 |
+
else $cat_id = "";
|
20 |
+
|
21 |
+
if(isset($_GET['cat_ids']))
|
22 |
+
$cat_ids = $_GET['cat_ids'];
|
23 |
+
else $cat_ids = "";
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
if($cat_ids=='')
|
28 |
+
$cat_ids .= $cat_id.',';
|
29 |
+
else
|
30 |
+
$cat_ids .= ','.$cat_id.',';
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
35 |
+
|
36 |
+
function getelementcountinarray($array , $element)
|
37 |
+
{
|
38 |
+
$t=0;
|
39 |
+
|
40 |
+
for($i=0; $i<count($array); $i++)
|
41 |
+
{
|
42 |
+
if($element==$array[$i])
|
43 |
+
$t++;
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
|
48 |
+
return $t;
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
function getelementindexinarray($array , $element)
|
53 |
+
{
|
54 |
+
|
55 |
+
$t='';
|
56 |
+
|
57 |
+
for($i=0; $i<count($array); $i++)
|
58 |
+
{
|
59 |
+
if($element==$array[$i])
|
60 |
+
$t.=$i.',';
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
return $t;
|
65 |
+
|
66 |
+
|
67 |
+
}
|
68 |
+
$cat_ids_array = explode(',',$cat_ids);
|
69 |
+
|
70 |
+
if($cat_id!='')
|
71 |
+
{
|
72 |
+
|
73 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
+
{
|
75 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
+
$index_array = explode(',' , $index_in_line);
|
77 |
+
array_pop ($index_array);
|
78 |
+
for($j=0; $j<count($index_array); $j++)
|
79 |
+
unset($cat_ids_array[$index_array[$j]]);
|
80 |
+
$cat_ids = implode(',',$cat_ids_array);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
else
|
84 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
+
|
86 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
87 |
+
|
88 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
89 |
$cal_width = $theme->width;
|
90 |
$bg_top = '#' . $theme->bg_top;
|
148 |
$views_tabs_bg_color = '#' . $theme->views_tabs_bg_color;
|
149 |
$views_tabs_text_color = '#' . $theme->views_tabs_text_color;
|
150 |
$views_tabs_font_size = $theme->views_tabs_font_size;
|
151 |
+
$show_numbers_for_events = $theme->day_start;
|
152 |
+
|
153 |
__('January', 'sp_calendar');
|
154 |
__('February', 'sp_calendar');
|
155 |
__('March', 'sp_calendar');
|
233 |
}
|
234 |
?>
|
235 |
<style type='text/css'>
|
236 |
+
.week_list:last-child{
|
237 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
238 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
239 |
+
border-radius:<?php echo $border_radius2; ?>px !important;
|
240 |
+
border-bottom-left-radius: <?php echo $border_radius2; ?>px !important;
|
241 |
+
}
|
242 |
+
|
243 |
+
.general_table table table:last-child .week_list .week_ev{
|
244 |
+
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
245 |
+
|
246 |
+
}
|
247 |
+
|
248 |
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
249 |
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
250 |
#spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
257 |
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
258 |
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
259 |
}
|
260 |
+
|
261 |
+
.general_table table tr:last-child >td:last-child{
|
262 |
+
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
263 |
+
border-top-right-radius: <?php echo $border_radius2 ?>px;
|
264 |
+
}
|
265 |
+
|
266 |
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : link,
|
267 |
#bigcalendar .cala_arrow a:visited {
|
268 |
text-decoration: none !important;
|
384 |
}
|
385 |
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
386 |
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
387 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
388 |
}
|
389 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
390 |
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
453 |
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
454 |
float: right;
|
455 |
background-color: <?php echo $views_tabs_bg_color; ?>;
|
456 |
+
min-height: 25px;
|
457 |
+
min-width: 70px;
|
458 |
margin-right: 2px;
|
459 |
text-align: center;
|
460 |
cursor:pointer;
|
461 |
position: relative;
|
462 |
top: 5px;
|
463 |
}
|
464 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
465 |
+
padding: 7px;
|
466 |
+
}
|
467 |
+
|
468 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
469 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
470 |
+
{
|
471 |
+
|
472 |
+
background-color: <?php echo $views_tabs_bg_color?> ;
|
473 |
+
width: 120px;
|
474 |
+
text-align: center;
|
475 |
+
cursor: pointer;
|
476 |
+
padding: 6px;
|
477 |
+
position: relative;
|
478 |
+
}
|
479 |
+
|
480 |
+
|
481 |
+
#drop_down_views
|
482 |
+
{
|
483 |
+
list-style-type:none !important;
|
484 |
+
position: absolute;
|
485 |
+
top: 46px;
|
486 |
+
left: -15px;
|
487 |
+
display:none;
|
488 |
+
z-index: 4545;
|
489 |
+
|
490 |
+
}
|
491 |
+
|
492 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
493 |
+
{
|
494 |
+
background:<?php echo $bg_top ?>;
|
495 |
+
}
|
496 |
+
|
497 |
+
#drop_down_views >li
|
498 |
+
{
|
499 |
+
border-bottom:1px solid #fff !important;
|
500 |
+
}
|
501 |
+
|
502 |
+
|
503 |
+
#views_tabs_select
|
504 |
+
{
|
505 |
+
display:none;
|
506 |
+
}
|
507 |
+
|
508 |
</style>
|
509 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
510 |
+
<div style="width:100%;">
|
511 |
<table cellpadding="0" cellspacing="0">
|
512 |
<tr>
|
513 |
<td>
|
514 |
+
<div id="views_tabs" style="width: 100%;<?php echo $display; ?>">
|
515 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
516 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
517 |
'action' => 'spiderbigcalendar_day',
|
518 |
'theme_id' => $theme_id,
|
521 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
522 |
'many_sp_calendar' => $many_sp_calendar,
|
523 |
'cur_page_url' => $path_sp_cal,
|
524 |
+
'cat_id' => '',
|
525 |
+
'cat_ids' => $cat_ids,
|
526 |
'widget' => $widget,
|
527 |
+
'rand' => $many_sp_calendar,
|
528 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
529 |
</div>
|
530 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
531 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
532 |
'action' => 'spiderbigcalendar_week',
|
533 |
'theme_id' => $theme_id,
|
537 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
538 |
'many_sp_calendar' => $many_sp_calendar,
|
539 |
'cur_page_url' => $path_sp_cal,
|
540 |
+
'cat_id' => '',
|
541 |
+
'cat_ids' => $cat_ids,
|
542 |
'widget' => $widget,
|
543 |
+
'rand' => $many_sp_calendar,
|
544 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
545 |
</div>
|
546 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';top:0;' ?>"
|
547 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
548 |
'action' => 'spiderbigcalendar_list',
|
549 |
'theme_id' => $theme_id,
|
552 |
'date' => $year . '-' . add_0((Month_num($month))),
|
553 |
'many_sp_calendar' => $many_sp_calendar,
|
554 |
'cur_page_url' => $path_sp_cal,
|
555 |
+
'cat_id' => '',
|
556 |
+
'cat_ids' => $cat_ids,
|
557 |
'widget' => $widget,
|
558 |
+
'rand' => $many_sp_calendar,
|
559 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
560 |
</div>
|
561 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
562 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
563 |
'action' => 'spiderbigcalendar_month',
|
564 |
'theme_id' => $theme_id,
|
567 |
'date' => $year . '-' . add_0((Month_num($month))),
|
568 |
'many_sp_calendar' => $many_sp_calendar,
|
569 |
'cur_page_url' => $path_sp_cal,
|
570 |
+
'cat_id' => '',
|
571 |
+
'cat_ids' => $cat_ids,
|
572 |
'widget' => $widget,
|
573 |
+
'rand' => $many_sp_calendar,
|
574 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color; ?>;font-size:<?php echo $views_tabs_font_size; ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
575 |
</div>
|
576 |
</div>
|
577 |
+
<div id="views_tabs_select" style="display:none" >
|
578 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?>;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
579 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
580 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
581 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
582 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
583 |
+
<span>►</span>
|
584 |
+
</div>
|
585 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
586 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
587 |
+
<div class="views_select"
|
588 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
589 |
+
'action' => 'spiderbigcalendar_day',
|
590 |
+
'theme_id' => $theme_id,
|
591 |
+
'calendar' => $calendar_id,
|
592 |
+
'select' => $view_select,
|
593 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
594 |
+
'many_sp_calendar' => $many_sp_calendar,
|
595 |
+
'cur_page_url' => $path_sp_cal,
|
596 |
+
'cat_id' => '',
|
597 |
+
'cat_ids' => $cat_ids,
|
598 |
+
'widget' => $widget,
|
599 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
600 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
601 |
+
</div>
|
602 |
+
</li>
|
603 |
+
|
604 |
+
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
605 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
606 |
+
'action' => 'spiderbigcalendar_week',
|
607 |
+
'theme_id' => $theme_id,
|
608 |
+
'calendar' => $calendar_id,
|
609 |
+
'select' => $view_select,
|
610 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
611 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
612 |
+
'many_sp_calendar' => $many_sp_calendar,
|
613 |
+
'cur_page_url' => $path_sp_cal,
|
614 |
+
'cat_id' => '',
|
615 |
+
'cat_ids' => $cat_ids,
|
616 |
+
'widget' => $widget,
|
617 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
618 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
619 |
+
</div>
|
620 |
+
</li>
|
621 |
+
|
622 |
+
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
623 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
624 |
+
'action' => 'spiderbigcalendar_list',
|
625 |
+
'theme_id' => $theme_id,
|
626 |
+
'calendar' => $calendar_id,
|
627 |
+
'select' => $view_select,
|
628 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
629 |
+
'many_sp_calendar' => $many_sp_calendar,
|
630 |
+
'cur_page_url' => $path_sp_cal,
|
631 |
+
'cat_id' => '',
|
632 |
+
'cat_ids' => $cat_ids,
|
633 |
+
'widget' => $widget,
|
634 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
635 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
636 |
+
</div>
|
637 |
+
</li>
|
638 |
+
|
639 |
+
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
640 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
641 |
+
'action' => 'spiderbigcalendar_month',
|
642 |
+
'theme_id' => $theme_id,
|
643 |
+
'calendar' => $calendar_id,
|
644 |
+
'select' => $view_select,
|
645 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
646 |
+
'many_sp_calendar' => $many_sp_calendar,
|
647 |
+
'cur_page_url' => $path_sp_cal,
|
648 |
+
'cat_id' => '',
|
649 |
+
'cat_ids' => $cat_ids,
|
650 |
+
'widget' => $widget,
|
651 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
652 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
653 |
+
|
654 |
+
</ul>
|
655 |
+
</div>
|
656 |
</td>
|
657 |
</tr>
|
658 |
<tr>
|
659 |
<td>
|
660 |
+
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%;border:<?php echo $border_color; ?> solid <?php echo $border_width; ?>px; margin:0; padding:0;background-color:<?php echo $bg_bottom; ?>;">
|
661 |
<tr>
|
662 |
<td width="100%" style="padding:0; margin:0">
|
663 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;">
|
664 |
+
<tr style="height:40px; width:100%;">
|
665 |
+
<td class="top_table" align="center" colspan="7" style="z-index: 5;position: relative;background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
666 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:100%; height:<?php echo $top_height; ?>px;">
|
667 |
<tr>
|
668 |
<td style="width:100%;vertical-align:center">
|
669 |
<table style="width:100%;">
|
679 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
680 |
'many_sp_calendar' => $many_sp_calendar,
|
681 |
'cur_page_url' => $path_sp_cal,
|
682 |
+
'cat_id' => '',
|
683 |
+
'cat_ids' => $cat_ids,
|
684 |
'widget' => $widget,
|
685 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%;background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
686 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year - 1; ?></span>
|
687 |
</div>
|
688 |
</td>
|
689 |
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
697 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
698 |
'many_sp_calendar' => $many_sp_calendar,
|
699 |
'cur_page_url' => $path_sp_cal,
|
700 |
+
'cat_id' => '',
|
701 |
+
'cat_ids' => $cat_ids,
|
702 |
'widget' => $widget,
|
703 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◀
|
704 |
</a>
|
705 |
</td>
|
706 |
<td style="text-align:center; margin:0;" width="40%">
|
707 |
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
708 |
+
<span style="line-height: 30px;font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size; ?>px;text-shadow: 1px 1px black;"><?php echo __('Week', 'sp_calendar'); ?> <?php echo date('W', mktime(0, 0, 0, month_num($month), $day, $year)) . ', ' . $year; ?></span>
|
709 |
</td>
|
710 |
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
711 |
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
718 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
719 |
'many_sp_calendar' => $many_sp_calendar,
|
720 |
'cur_page_url' => $path_sp_cal,
|
721 |
+
'cat_id' => '',
|
722 |
+
'cat_ids' => $cat_ids,
|
723 |
'widget' => $widget,
|
724 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">▶
|
725 |
</a>
|
726 |
</td>
|
727 |
<td width="15%">
|
735 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
736 |
'many_sp_calendar' => $many_sp_calendar,
|
737 |
'cur_page_url' => $path_sp_cal,
|
738 |
+
'cat_id' => '',
|
739 |
+
'cat_ids' => $cat_ids,
|
740 |
'widget' => $widget,
|
741 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
742 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
743 |
</div>
|
744 |
</td>
|
745 |
</tr>
|
748 |
</tr>
|
749 |
</table>
|
750 |
</td>
|
751 |
+
|
|
|
|
|
752 |
</tr>
|
753 |
</tr>
|
754 |
<tr>
|
777 |
|
778 |
$all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
|
779 |
|
780 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
781 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
782 |
+
|
783 |
$all_array_days = $all_calendar_files[0]['all_array_days'];
|
784 |
$all_array_days1 = $all_calendar_files[0]['all_array_days1'];
|
785 |
$all_title = $all_calendar_files[0]['all_title'];
|
790 |
$next_month = substr($months, 6, 2);
|
791 |
|
792 |
for ($i = 0; $i <= 6; $i++) {
|
793 |
+
$day=substr($week_days[$i],8,2);
|
794 |
+
$month=substr($week_days[$i],5,2);
|
795 |
+
$year=substr($week_days[$i],0,4);
|
796 |
+
|
797 |
+
switch($month)
|
798 |
+
{
|
799 |
case $prev_month:
|
800 |
+
$array_days=$all_array_days[0];
|
801 |
+
$array_days1=$all_array_days1[0];
|
802 |
+
$title=$all_title[0];
|
803 |
+
$ev_ids=$all_ev_ids[0];
|
804 |
+
break;
|
805 |
|
806 |
case $this_month:
|
807 |
+
$array_days=$all_array_days[1];
|
808 |
+
$array_days1=$all_array_days1[1];
|
809 |
+
$title=$all_title[1];
|
810 |
+
$ev_ids=$all_ev_ids[1];
|
811 |
+
break;
|
812 |
|
813 |
case $next_month:
|
814 |
+
$array_days=$all_array_days[2];
|
815 |
+
$array_days1=$all_array_days1[2];
|
816 |
+
$title=$all_title[2];
|
817 |
+
$ev_ids=$all_ev_ids[2];
|
818 |
+
break;
|
819 |
+
|
820 |
+
}
|
821 |
+
|
822 |
+
|
823 |
+
|
824 |
sort($array_days, SORT_NUMERIC);
|
825 |
$week_day = date('D', mktime(0, 0, 0, $month, (int) $day, $year));
|
826 |
echo '<table style="width:100%;border-spacing:0;">
|
827 |
<tr>
|
828 |
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
|
829 |
+
<span style="padding-left:10px; font-size:' . $date_font_size . 'px; color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
830 |
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . month_name($month) . ' ' . (int) $day . ')</span>
|
831 |
</td>
|
832 |
<tr>
|
840 |
$ev_title = explode('</p>', $value);
|
841 |
array_pop($ev_title);
|
842 |
for ($j = 0; $j < count($ev_title); $j++) {
|
843 |
+
$queryy = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
844 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
|
845 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
|
846 |
+
|
847 |
+
$cat_color = $wpdb->get_row($queryy);
|
848 |
+
|
849 |
if (($j + 1) % 2 == 0) {
|
850 |
$color = $event_num_bg_color2;
|
851 |
$table_color = $event_bg_color2;
|
854 |
$color = $event_num_bg_color1;
|
855 |
$table_color = $event_bg_color1;
|
856 |
}
|
857 |
+
if(!isset($cat_color->color)) $cat_color->color="";
|
858 |
+
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . '" class="week_list">
|
859 |
<tr>
|
860 |
+
<td class="week_ev" style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $event_num_color . '">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
861 |
<td>
|
862 |
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color:' . $event_title_color . ';"
|
863 |
href="' . add_query_arg(array(
|
883 |
}
|
884 |
}
|
885 |
else {
|
886 |
+
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '" class="week_list">
|
887 |
<tr>
|
888 |
+
<td class="week_ev" style="font-size:22px; font-weight:bold; width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ';color:' . $event_num_color . '"></td>
|
889 |
+
<td><p style="color:' . $event_title_color . '; border:none"> ' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
|
890 |
</tr>
|
891 |
</table>';
|
892 |
}
|
902 |
</tr>
|
903 |
</table>
|
904 |
</div>
|
905 |
+
<script>
|
906 |
+
|
907 |
+
jQuery(document).ready(function (){
|
908 |
+
|
909 |
+
jQuery('#views_select').click(function () {
|
910 |
+
jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
|
911 |
+
}, function () {
|
912 |
+
jQuery('#drop_down_views').stop(true, true).slideUp(500);
|
913 |
+
});
|
914 |
+
if(jQuery(window).width() > 640 )
|
915 |
+
{
|
916 |
+
jQuery('drop_down_views').hide();
|
917 |
+
}
|
918 |
+
});
|
919 |
+
</script>
|
920 |
+
|
921 |
+
|
922 |
+
<style>
|
923 |
+
|
924 |
+
@media only screen and (max-width : 640px) {
|
925 |
+
|
926 |
+
#views_tabs ,#drop_down_views
|
927 |
+
{
|
928 |
+
display:none;
|
929 |
+
}
|
930 |
+
|
931 |
+
#views_tabs_select
|
932 |
+
{
|
933 |
+
display:block !important;
|
934 |
+
}
|
935 |
+
|
936 |
+
|
937 |
+
|
938 |
+
}
|
939 |
+
|
940 |
+
@media only screen and (max-width : 968px) {
|
941 |
+
#cats >li
|
942 |
+
{
|
943 |
+
float:none;
|
944 |
+
}
|
945 |
+
|
946 |
+
|
947 |
+
|
948 |
+
}
|
949 |
+
.categories1 , .categories2
|
950 |
+
{
|
951 |
+
display:inline-block;
|
952 |
+
}
|
953 |
+
|
954 |
+
.categories2
|
955 |
+
{
|
956 |
+
position:relative;
|
957 |
+
left: -9px;
|
958 |
+
cursor:pointer;
|
959 |
+
}
|
960 |
+
.categories2:first-letter
|
961 |
+
{
|
962 |
+
color:#fff;
|
963 |
+
|
964 |
+
}
|
965 |
+
</style>
|
966 |
<?php
|
967 |
+
|
968 |
+
//reindex cat_ids_array
|
969 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
970 |
+
|
971 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
972 |
+
{
|
973 |
+
echo'
|
974 |
+
<style>
|
975 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
976 |
+
{
|
977 |
+
text-decoration:underline;
|
978 |
+
cursor:pointer;
|
979 |
+
|
980 |
+
}
|
981 |
+
|
982 |
+
</style>';
|
983 |
+
|
984 |
+
}
|
985 |
+
|
986 |
+
|
987 |
+
|
988 |
+
if($cat_ids=='')
|
989 |
+
$cat_ids='';
|
990 |
+
|
991 |
+
|
992 |
+
echo '<ul id="cats" style="list-style-type:none;">';
|
993 |
+
|
994 |
+
foreach($categories as $category)
|
995 |
+
{
|
996 |
+
|
997 |
+
?>
|
998 |
+
|
999 |
+
<li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1000 |
+
'action' => 'spiderbigcalendar_week',
|
1001 |
+
'theme_id' => $theme_id,
|
1002 |
+
'calendar' => $calendar_id,
|
1003 |
+
'select' => $view_select,
|
1004 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
1005 |
+
'date' => $year . '-' . $month . '-' . add_0($day),
|
1006 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1007 |
+
'cur_page_url' => $path_sp_cal,
|
1008 |
+
'cat_id' => $category->id,
|
1009 |
+
'cat_ids' => $cat_ids,
|
1010 |
+
'widget' => $widget,
|
1011 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1012 |
+
|
1013 |
+
|
1014 |
+
<?php
|
1015 |
+
|
1016 |
+
|
1017 |
+
}
|
1018 |
+
|
1019 |
+
echo '</ul><br><br>';
|
1020 |
+
|
1021 |
die();
|
1022 |
}
|
1023 |
|
front_end/bigcalendarweek_widget.php
CHANGED
@@ -11,6 +11,82 @@ function big_calendar_week_widget() {
|
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
15 |
$weekstart = $theme->week_start_day;
|
16 |
$bg = '#' . $theme->header_bgcolor;
|
@@ -37,7 +113,7 @@ function big_calendar_week_widget() {
|
|
37 |
$font_month = $theme->font_month;
|
38 |
$font_day = $theme->font_day;
|
39 |
$font_weekday = $theme->font_weekday;
|
40 |
-
|
41 |
$popup_width = $theme->popup_width;
|
42 |
$popup_height = $theme->popup_height;
|
43 |
|
@@ -120,6 +196,7 @@ function big_calendar_week_widget() {
|
|
120 |
#calendar_<?php echo $many_sp_calendar; ?> table {
|
121 |
border-collapse: initial;
|
122 |
border:0px;
|
|
|
123 |
}
|
124 |
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
125 |
padding: 0px;
|
@@ -216,12 +293,51 @@ function big_calendar_week_widget() {
|
|
216 |
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
217 |
background: transparent !important;
|
218 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
</style>
|
220 |
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
221 |
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?>">
|
222 |
<tr style="background-color:#FFFFFF;">
|
223 |
<td style="background-color:#FFFFFF;">
|
224 |
-
<div id="views_tabs" style="
|
225 |
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
226 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
227 |
'action' => 'spiderbigcalendar_day_widget',
|
@@ -231,10 +347,13 @@ function big_calendar_week_widget() {
|
|
231 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
232 |
'many_sp_calendar' => $many_sp_calendar,
|
233 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
234 |
'widget' => $widget,
|
235 |
-
|
|
|
236 |
</div>
|
237 |
-
<div class="views" style="
|
238 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
239 |
'action' => 'spiderbigcalendar_week_widget',
|
240 |
'theme_id' => $theme_id,
|
@@ -244,10 +363,13 @@ function big_calendar_week_widget() {
|
|
244 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
245 |
'many_sp_calendar' => $many_sp_calendar,
|
246 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
247 |
'widget' => $widget,
|
248 |
-
|
|
|
249 |
</div>
|
250 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'
|
251 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
252 |
'action' => 'spiderbigcalendar_list_widget',
|
253 |
'theme_id' => $theme_id,
|
@@ -256,8 +378,11 @@ function big_calendar_week_widget() {
|
|
256 |
'date' => $year . '-' . add_0((Month_num($month))),
|
257 |
'many_sp_calendar' => $many_sp_calendar,
|
258 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
259 |
'widget' => $widget,
|
260 |
-
|
|
|
261 |
</div>
|
262 |
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
263 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
@@ -268,8 +393,11 @@ function big_calendar_week_widget() {
|
|
268 |
'date' => $year . '-' . add_0((Month_num($month))),
|
269 |
'many_sp_calendar' => $many_sp_calendar,
|
270 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
271 |
'widget' => $widget,
|
272 |
-
|
|
|
273 |
</div>
|
274 |
</div>
|
275 |
</td>
|
@@ -300,9 +428,12 @@ function big_calendar_week_widget() {
|
|
300 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
301 |
'many_sp_calendar' => $many_sp_calendar,
|
302 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
303 |
'widget' => $widget,
|
|
|
304 |
), admin_url('admin-ajax.php'));
|
305 |
-
?>')">◄
|
306 |
</a>
|
307 |
</td>
|
308 |
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
@@ -326,9 +457,12 @@ function big_calendar_week_widget() {
|
|
326 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
327 |
'many_sp_calendar' => $many_sp_calendar,
|
328 |
'cur_page_url' => $path_sp_cal,
|
|
|
|
|
329 |
'widget' => $widget,
|
|
|
330 |
), admin_url('admin-ajax.php'));
|
331 |
-
?>')">►
|
332 |
</a>
|
333 |
</td>
|
334 |
</tr>
|
@@ -360,6 +494,8 @@ function big_calendar_week_widget() {
|
|
360 |
$percent = $percent + ($sum / 7);
|
361 |
$percent = 107 / $percent;
|
362 |
|
|
|
|
|
363 |
$all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
|
364 |
|
365 |
$all_array_days = $all_calendar_files[0]['all_array_days'];
|
@@ -416,6 +552,12 @@ function big_calendar_week_widget() {
|
|
416 |
$ev_title = explode('</p>', $value);
|
417 |
array_pop($ev_title);
|
418 |
for ($j = 0; $j < count($ev_title); $j++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
419 |
if (($j + 1) % 2 == 0) {
|
420 |
$color = $bg;
|
421 |
$table_color = $calendar_bg;
|
@@ -424,11 +566,12 @@ function big_calendar_week_widget() {
|
|
424 |
$color = $bg;
|
425 |
$table_color = $calendar_bg;
|
426 |
}
|
|
|
427 |
echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
428 |
<tr>
|
429 |
-
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color
|
430 |
<td>
|
431 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color
|
432 |
href="' . add_query_arg(array(
|
433 |
'action' => 'spidercalendarbig',
|
434 |
'theme_id' => $theme_id,
|
@@ -455,7 +598,7 @@ function big_calendar_week_widget() {
|
|
455 |
echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5;">
|
456 |
<tr>
|
457 |
<td style="font-size:22px; font-weight:bold; width:15px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
|
458 |
-
<td><
|
459 |
</tr>
|
460 |
</table>';
|
461 |
}
|
@@ -476,7 +619,10 @@ function big_calendar_week_widget() {
|
|
476 |
'many_sp_calendar' => $many_sp_calendar,
|
477 |
'cur_page_url' => $path_sp_cal,
|
478 |
'widget' => $widget,
|
479 |
-
|
|
|
|
|
|
|
480 |
<?php echo ($year - 1); ?>
|
481 |
</td>
|
482 |
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
@@ -493,7 +639,10 @@ function big_calendar_week_widget() {
|
|
493 |
'many_sp_calendar' => $many_sp_calendar,
|
494 |
'cur_page_url' => $path_sp_cal,
|
495 |
'widget' => $widget,
|
496 |
-
|
|
|
|
|
|
|
497 |
<?php echo ($year + 1); ?>
|
498 |
</td>
|
499 |
</tr>
|
@@ -504,7 +653,83 @@ function big_calendar_week_widget() {
|
|
504 |
</tr>
|
505 |
</table>
|
506 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
508 |
die();
|
509 |
}
|
510 |
|
11 |
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
13 |
|
14 |
+
///////////////////////////////////////////////////////////////////////////////////
|
15 |
+
|
16 |
+
if(isset($_GET['cat_id']))
|
17 |
+
$cat_id = $_GET['cat_id'];
|
18 |
+
else $cat_id = "";
|
19 |
+
|
20 |
+
if(isset($_GET['cat_ids']))
|
21 |
+
$cat_ids = $_GET['cat_ids'];
|
22 |
+
else $cat_ids = "";
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
if($cat_ids=='')
|
27 |
+
$cat_ids .= $cat_id.',';
|
28 |
+
else
|
29 |
+
$cat_ids .= ','.$cat_id.',';
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
34 |
+
|
35 |
+
|
36 |
+
function getelementcountinarray($array , $element)
|
37 |
+
{
|
38 |
+
$t=0;
|
39 |
+
|
40 |
+
for($i=0; $i<count($array); $i++)
|
41 |
+
{
|
42 |
+
if($element==$array[$i])
|
43 |
+
$t++;
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
|
48 |
+
return $t;
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
function getelementindexinarray($array , $element)
|
53 |
+
{
|
54 |
+
|
55 |
+
$t='';
|
56 |
+
|
57 |
+
for($i=0; $i<count($array); $i++)
|
58 |
+
{
|
59 |
+
if($element==$array[$i])
|
60 |
+
$t.=$i.',';
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
return $t;
|
65 |
+
|
66 |
+
|
67 |
+
}
|
68 |
+
$cat_ids_array = explode(',',$cat_ids);
|
69 |
+
|
70 |
+
|
71 |
+
if($cat_id!='')
|
72 |
+
{
|
73 |
+
|
74 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
75 |
+
{
|
76 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
77 |
+
$index_array = explode(',' , $index_in_line);
|
78 |
+
array_pop ($index_array);
|
79 |
+
for($j=0; $j<count($index_array); $j++)
|
80 |
+
unset($cat_ids_array[$index_array[$j]]);
|
81 |
+
$cat_ids = implode(',',$cat_ids_array);
|
82 |
+
}
|
83 |
+
}
|
84 |
+
else
|
85 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
86 |
+
|
87 |
+
|
88 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
89 |
+
|
90 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
91 |
$weekstart = $theme->week_start_day;
|
92 |
$bg = '#' . $theme->header_bgcolor;
|
113 |
$font_month = $theme->font_month;
|
114 |
$font_day = $theme->font_day;
|
115 |
$font_weekday = $theme->font_weekday;
|
116 |
+
$ev_title_color = $theme->ev_title_color;
|
117 |
$popup_width = $theme->popup_width;
|
118 |
$popup_height = $theme->popup_height;
|
119 |
|
196 |
#calendar_<?php echo $many_sp_calendar; ?> table {
|
197 |
border-collapse: initial;
|
198 |
border:0px;
|
199 |
+
margin: 0;
|
200 |
}
|
201 |
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
202 |
padding: 0px;
|
293 |
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
294 |
background: transparent !important;
|
295 |
}
|
296 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
297 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
298 |
+
{
|
299 |
+
|
300 |
+
background-color: <?php $views_tabs_bg_color?>;
|
301 |
+
width: 120px;
|
302 |
+
text-align: center;
|
303 |
+
cursor: pointer;
|
304 |
+
padding: 6px;
|
305 |
+
position: relative;
|
306 |
+
}
|
307 |
+
|
308 |
+
|
309 |
+
#drop_down_views
|
310 |
+
{
|
311 |
+
list-style-type:none !important;
|
312 |
+
position: absolute;
|
313 |
+
top: 46px;
|
314 |
+
left: -15px;
|
315 |
+
display:none;
|
316 |
+
z-index: 4545;
|
317 |
+
|
318 |
+
}
|
319 |
+
|
320 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
321 |
+
{
|
322 |
+
background:<?php echo $bg_top ?>;
|
323 |
+
}
|
324 |
+
|
325 |
+
#drop_down_views >li
|
326 |
+
{
|
327 |
+
border-bottom:1px solid #fff !important;
|
328 |
+
}
|
329 |
+
|
330 |
+
|
331 |
+
#views_tabs_select
|
332 |
+
{
|
333 |
+
display:none;
|
334 |
+
}
|
335 |
</style>
|
336 |
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
337 |
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?>">
|
338 |
<tr style="background-color:#FFFFFF;">
|
339 |
<td style="background-color:#FFFFFF;">
|
340 |
+
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
341 |
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
342 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
343 |
'action' => 'spiderbigcalendar_day_widget',
|
347 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
348 |
'many_sp_calendar' => $many_sp_calendar,
|
349 |
'cur_page_url' => $path_sp_cal,
|
350 |
+
'cat_id' => '',
|
351 |
+
'cat_ids' => $cat_ids,
|
352 |
'widget' => $widget,
|
353 |
+
'TB_iframe' => 1,
|
354 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
355 |
</div>
|
356 |
+
<div class="views" style="margin-left: 3px;margin-right: 1px;<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ';height:28px;top:0;' ?>"
|
357 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
358 |
'action' => 'spiderbigcalendar_week_widget',
|
359 |
'theme_id' => $theme_id,
|
363 |
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
364 |
'many_sp_calendar' => $many_sp_calendar,
|
365 |
'cur_page_url' => $path_sp_cal,
|
366 |
+
'cat_id' => '',
|
367 |
+
'cat_ids' => $cat_ids,
|
368 |
'widget' => $widget,
|
369 |
+
'TB_iframe' => 1,
|
370 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
371 |
</div>
|
372 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ';height:28px;top:0;' ?>"
|
373 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
374 |
'action' => 'spiderbigcalendar_list_widget',
|
375 |
'theme_id' => $theme_id,
|
378 |
'date' => $year . '-' . add_0((Month_num($month))),
|
379 |
'many_sp_calendar' => $many_sp_calendar,
|
380 |
'cur_page_url' => $path_sp_cal,
|
381 |
+
'cat_id' => '',
|
382 |
+
'cat_ids' => $cat_ids,
|
383 |
'widget' => $widget,
|
384 |
+
'TB_iframe' => 1,
|
385 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
386 |
</div>
|
387 |
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
388 |
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
393 |
'date' => $year . '-' . add_0((Month_num($month))),
|
394 |
'many_sp_calendar' => $many_sp_calendar,
|
395 |
'cur_page_url' => $path_sp_cal,
|
396 |
+
'cat_id' => '',
|
397 |
+
'cat_ids' => $cat_ids,
|
398 |
'widget' => $widget,
|
399 |
+
'TB_iframe' => 1,
|
400 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
401 |
</div>
|
402 |
</div>
|
403 |
</td>
|
428 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
429 |
'many_sp_calendar' => $many_sp_calendar,
|
430 |
'cur_page_url' => $path_sp_cal,
|
431 |
+
'cat_id' => '',
|
432 |
+
'cat_ids' => $cat_ids,
|
433 |
'widget' => $widget,
|
434 |
+
'TB_iframe' => 1,
|
435 |
), admin_url('admin-ajax.php'));
|
436 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◄
|
437 |
</a>
|
438 |
</td>
|
439 |
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
457 |
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
458 |
'many_sp_calendar' => $many_sp_calendar,
|
459 |
'cur_page_url' => $path_sp_cal,
|
460 |
+
'cat_id' => '',
|
461 |
+
'cat_ids' => $cat_ids,
|
462 |
'widget' => $widget,
|
463 |
+
'TB_iframe' => 1,
|
464 |
), admin_url('admin-ajax.php'));
|
465 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">►
|
466 |
</a>
|
467 |
</td>
|
468 |
</tr>
|
494 |
$percent = $percent + ($sum / 7);
|
495 |
$percent = 107 / $percent;
|
496 |
|
497 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
498 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
499 |
$all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
|
500 |
|
501 |
$all_array_days = $all_calendar_files[0]['all_array_days'];
|
552 |
$ev_title = explode('</p>', $value);
|
553 |
array_pop($ev_title);
|
554 |
for ($j = 0; $j < count($ev_title); $j++) {
|
555 |
+
$queryy = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
556 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
|
557 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
|
558 |
+
|
559 |
+
$cat_color = $wpdb->get_row($queryy);
|
560 |
+
|
561 |
if (($j + 1) % 2 == 0) {
|
562 |
$color = $bg;
|
563 |
$table_color = $calendar_bg;
|
566 |
$color = $bg;
|
567 |
$table_color = $calendar_bg;
|
568 |
}
|
569 |
+
if(!isset($cat_color->color)) $cat_color->color="";
|
570 |
echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
571 |
<tr>
|
572 |
+
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $calendar_bg . '">' . ($j + 1) . '</td>
|
573 |
<td>
|
574 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color:#' . $ev_title_color . ';"
|
575 |
href="' . add_query_arg(array(
|
576 |
'action' => 'spidercalendarbig',
|
577 |
'theme_id' => $theme_id,
|
598 |
echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5;">
|
599 |
<tr>
|
600 |
<td style="font-size:22px; font-weight:bold; width:15px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
|
601 |
+
<td><p style="font-size:12px;color:' . $bg . '; border:none"> ' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
|
602 |
</tr>
|
603 |
</table>';
|
604 |
}
|
619 |
'many_sp_calendar' => $many_sp_calendar,
|
620 |
'cur_page_url' => $path_sp_cal,
|
621 |
'widget' => $widget,
|
622 |
+
'cat_id' => '',
|
623 |
+
'cat_ids' => $cat_ids,
|
624 |
+
'TB_iframe' => 1,
|
625 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?>">
|
626 |
<?php echo ($year - 1); ?>
|
627 |
</td>
|
628 |
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
639 |
'many_sp_calendar' => $many_sp_calendar,
|
640 |
'cur_page_url' => $path_sp_cal,
|
641 |
'widget' => $widget,
|
642 |
+
'cat_id' => '',
|
643 |
+
'cat_ids' => $cat_ids,
|
644 |
+
'TB_iframe' => 1,
|
645 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?>;color:<?php echo $year_font_color; ?>">
|
646 |
<?php echo ($year + 1); ?>
|
647 |
</td>
|
648 |
</tr>
|
653 |
</tr>
|
654 |
</table>
|
655 |
</div>
|
656 |
+
<style>
|
657 |
+
table{
|
658 |
+
width: 100%;
|
659 |
+
}
|
660 |
+
.categories1 , .categories2
|
661 |
+
{
|
662 |
+
display:inline-block;
|
663 |
+
}
|
664 |
+
|
665 |
+
.categories2
|
666 |
+
{
|
667 |
+
position:relative;
|
668 |
+
left: -9px;
|
669 |
+
cursor:pointer;
|
670 |
+
}
|
671 |
+
.categories2:first-letter
|
672 |
+
{
|
673 |
+
color:#fff;
|
674 |
+
|
675 |
+
}
|
676 |
+
</style>
|
677 |
<?php
|
678 |
+
|
679 |
+
//reindex cat_ids_array
|
680 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
681 |
+
|
682 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
683 |
+
{
|
684 |
+
echo'
|
685 |
+
<style>
|
686 |
+
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
687 |
+
{
|
688 |
+
text-decoration:underline;
|
689 |
+
cursor:pointer;
|
690 |
+
|
691 |
+
}
|
692 |
+
|
693 |
+
</style>';
|
694 |
+
|
695 |
+
}
|
696 |
+
|
697 |
+
|
698 |
+
|
699 |
+
if($cat_ids=='')
|
700 |
+
$cat_ids='';
|
701 |
+
|
702 |
+
|
703 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
|
704 |
+
|
705 |
+
foreach($categories as $category)
|
706 |
+
{
|
707 |
+
|
708 |
+
?>
|
709 |
+
|
710 |
+
<li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
711 |
+
'action' => 'spiderbigcalendar_week_widget',
|
712 |
+
'theme_id' => $theme_id,
|
713 |
+
'calendar' => $calendar_id,
|
714 |
+
'select' => $view_select,
|
715 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
716 |
+
'date' => $year . '-' . $month . '-' . add_0($day),
|
717 |
+
'many_sp_calendar' => $many_sp_calendar,
|
718 |
+
'cur_page_url' => $path_sp_cal,
|
719 |
+
'cat_id' => $category->id,
|
720 |
+
'cat_ids' => $cat_ids,
|
721 |
+
'widget' => $widget,
|
722 |
+
'TB_iframe' => 1,
|
723 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
724 |
+
|
725 |
+
|
726 |
+
<?php
|
727 |
+
|
728 |
+
|
729 |
+
}
|
730 |
+
|
731 |
+
echo '</ul><br><br>';
|
732 |
+
|
733 |
die();
|
734 |
}
|
735 |
|
front_end/frontend_functions.php
CHANGED
@@ -58,8 +58,56 @@ function php_getdays($show_numbers_for_events, $calendar, $date, $theme_id, $wid
|
|
58 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
59 |
$show_time = $theme->show_time;
|
60 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
-
$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));
|
63 |
$id_array = array();
|
64 |
$s = count($rows);
|
65 |
$id_array = array();
|
@@ -67,7 +115,7 @@ function php_getdays($show_numbers_for_events, $calendar, $date, $theme_id, $wid
|
|
67 |
$array_days1 = array();
|
68 |
$title = array();
|
69 |
$ev_ids = array();
|
70 |
-
|
71 |
$date_month = (int)substr($rows[$i - 1]->date, 5, 2);
|
72 |
$date_end_month = (int)substr($rows[$i - 1]->date_end, 5, 2);
|
73 |
$date_day = (int)substr($rows[$i - 1]->date, 8, 2);
|
@@ -85,6 +133,7 @@ function php_getdays($show_numbers_for_events, $calendar, $date, $theme_id, $wid
|
|
85 |
$date_days = array();
|
86 |
$weekdays_start = array();
|
87 |
$weekdays = array();
|
|
|
88 |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
89 |
//////////////////////// NO Repeat /////////////////////////////////////////////////////////////////////////////////////////////
|
90 |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
@@ -123,6 +172,10 @@ function php_getdays($show_numbers_for_events, $calendar, $date, $theme_id, $wid
|
|
123 |
$start_date_array[] = $start_date;
|
124 |
$next_date = php_GetNextDate($start_date, $repeat * 7);
|
125 |
$next_date_array = explode('/', $next_date);
|
|
|
|
|
|
|
|
|
126 |
if (($next_date_array[2] . '-' . add_0($next_date_array[0]) . '-' . add_0($next_date_array[1]) > $rows[$i - 1]->date_end) || ($next_date_array[0] > (int)$month && $next_date_array[2] == (int)$year) || ($next_date_array[2] > (int)$year))
|
127 |
break;
|
128 |
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
@@ -483,7 +536,57 @@ function php_getdays_for_three_months($calendar, $date, $months, $theme_id, $wid
|
|
483 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
484 |
$show_time = $theme->show_time;
|
485 |
}
|
486 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
487 |
$all_id_array = array();
|
488 |
$all_array_days = array();
|
489 |
$all_array_days1 = array();
|
@@ -905,6 +1008,7 @@ function php_getdays_for_three_months($calendar, $date, $months, $theme_id, $wid
|
|
905 |
return array($all_calendar_files);
|
906 |
}
|
907 |
|
|
|
908 |
function Month_name($month_num) {
|
909 |
$timestamp = mktime(0, 0, 0, $month_num, 1, 2005);
|
910 |
return date("F", $timestamp);
|
58 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
59 |
$show_time = $theme->show_time;
|
60 |
}
|
61 |
+
|
62 |
+
if(isset($_GET['cat_id']))
|
63 |
+
$cat_id = $_GET['cat_id'];
|
64 |
+
else $cat_id = "";
|
65 |
+
|
66 |
+
if(isset($_GET['cat_ids']))
|
67 |
+
$cat_ids = $_GET['cat_ids'];
|
68 |
+
else $cat_ids = "";
|
69 |
+
|
70 |
+
|
71 |
+
if($cat_ids=='')
|
72 |
+
$cat_ids .= $cat_id.',';
|
73 |
+
else
|
74 |
+
$cat_ids .= ','.$cat_id.',';
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
79 |
+
|
80 |
+
$cat_ids_array = explode(',',$cat_ids);
|
81 |
+
|
82 |
+
|
83 |
+
if($cat_id!='')
|
84 |
+
{
|
85 |
+
|
86 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
87 |
+
{
|
88 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
89 |
+
$index_array = explode(',' , $index_in_line);
|
90 |
+
array_pop ($index_array);
|
91 |
+
for($j=0; $j<count($index_array); $j++)
|
92 |
+
unset($cat_ids_array[$index_array[$j]]);
|
93 |
+
$cat_ids = implode(',',$cat_ids_array);
|
94 |
+
}
|
95 |
+
}
|
96 |
+
else
|
97 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
98 |
+
|
99 |
+
|
100 |
+
if($cat_ids!=''){
|
101 |
+
$rows = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.*," . $wpdb->prefix . "spidercalendar_event_category.color from " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category = " . $wpdb->prefix . "spidercalendar_event_category.id where " . $wpdb->prefix . "spidercalendar_event_category.published=1 and " . $wpdb->prefix . "spidercalendar_event.category IN (".$cat_ids.") and " . $wpdb->prefix . "spidercalendar_event.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='0000-00-00' ) or ( date_end is Null and date like '".substr( $date,0,7)."%' ) ) and calendar='".$calendar."' ORDER BY " . $wpdb->prefix . "spidercalendar_event.time ASC ");
|
102 |
+
|
103 |
+
}
|
104 |
+
else{
|
105 |
+
$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));
|
106 |
+
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
|
|
|
111 |
$id_array = array();
|
112 |
$s = count($rows);
|
113 |
$id_array = array();
|
115 |
$array_days1 = array();
|
116 |
$title = array();
|
117 |
$ev_ids = array();
|
118 |
+
for ($i = 1; $i <= $s; $i++) {
|
119 |
$date_month = (int)substr($rows[$i - 1]->date, 5, 2);
|
120 |
$date_end_month = (int)substr($rows[$i - 1]->date_end, 5, 2);
|
121 |
$date_day = (int)substr($rows[$i - 1]->date, 8, 2);
|
133 |
$date_days = array();
|
134 |
$weekdays_start = array();
|
135 |
$weekdays = array();
|
136 |
+
|
137 |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
138 |
//////////////////////// NO Repeat /////////////////////////////////////////////////////////////////////////////////////////////
|
139 |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
172 |
$start_date_array[] = $start_date;
|
173 |
$next_date = php_GetNextDate($start_date, $repeat * 7);
|
174 |
$next_date_array = explode('/', $next_date);
|
175 |
+
|
176 |
+
|
177 |
+
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
178 |
+
$date_days[0] = $weekdays_start[$p];
|
179 |
if (($next_date_array[2] . '-' . add_0($next_date_array[0]) . '-' . add_0($next_date_array[1]) > $rows[$i - 1]->date_end) || ($next_date_array[0] > (int)$month && $next_date_array[2] == (int)$year) || ($next_date_array[2] > (int)$year))
|
180 |
break;
|
181 |
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
536 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
537 |
$show_time = $theme->show_time;
|
538 |
}
|
539 |
+
|
540 |
+
if(isset($_GET['cat_id']))
|
541 |
+
$cat_id = $_GET['cat_id'];
|
542 |
+
else $cat_id = "";
|
543 |
+
|
544 |
+
if(isset($_GET['cat_ids']))
|
545 |
+
$cat_ids = $_GET['cat_ids'];
|
546 |
+
else $cat_ids = "";
|
547 |
+
|
548 |
+
|
549 |
+
if($cat_ids=='')
|
550 |
+
$cat_ids .= $cat_id.',';
|
551 |
+
else
|
552 |
+
$cat_ids .= ','.$cat_id.',';
|
553 |
+
|
554 |
+
|
555 |
+
|
556 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
557 |
+
|
558 |
+
$cat_ids_array = explode(',',$cat_ids);
|
559 |
+
|
560 |
+
|
561 |
+
if($cat_id!='')
|
562 |
+
{
|
563 |
+
|
564 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
565 |
+
{
|
566 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
567 |
+
$index_array = explode(',' , $index_in_line);
|
568 |
+
array_pop ($index_array);
|
569 |
+
for($j=0; $j<count($index_array); $j++)
|
570 |
+
unset($cat_ids_array[$index_array[$j]]);
|
571 |
+
$cat_ids = implode(',',$cat_ids_array);
|
572 |
+
}
|
573 |
+
}
|
574 |
+
else
|
575 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
576 |
+
|
577 |
+
|
578 |
+
if($cat_ids!=''){
|
579 |
+
$rows = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.*," . $wpdb->prefix . "spidercalendar_event_category.color from " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category = " . $wpdb->prefix . "spidercalendar_event_category.id where " . $wpdb->prefix . "spidercalendar_event_category.published=1 and " . $wpdb->prefix . "spidercalendar_event.category IN (".$cat_ids.") and " . $wpdb->prefix . "spidercalendar_event.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='0000-00-00' ) or ( date_end is Null and date like '".substr( $date,0,7)."%' ) ) and calendar='".$calendar."' ORDER BY " . $wpdb->prefix . "spidercalendar_event.time ASC ");
|
580 |
+
|
581 |
+
}
|
582 |
+
else{
|
583 |
+
$rows = $wpdb->get_results($wpdb->prepare("SELECT * from " . $wpdb->prefix . "spidercalendar_event where published=1 and ((date_end>=%s) or (date_end=%s)) and calendar=%d", "" . substr($date, 0, 7) . "-01", "0000-00-00", $calendar));
|
584 |
+
}
|
585 |
+
|
586 |
+
|
587 |
+
|
588 |
+
|
589 |
+
|
590 |
$all_id_array = array();
|
591 |
$all_array_days = array();
|
592 |
$all_array_days1 = array();
|
1008 |
return array($all_calendar_files);
|
1009 |
}
|
1010 |
|
1011 |
+
|
1012 |
function Month_name($month_num) {
|
1013 |
$timestamp = mktime(0, 0, 0, $month_num, 1, 2005);
|
1014 |
return date("F", $timestamp);
|
front_end/images/add_but.png
ADDED
Binary file
|
front_end/images/delete_el.png
ADDED
Binary file
|
front_end/images/down.png
ADDED
Binary file
|
front_end/images/up.png
ADDED
Binary file
|
functions_for_xml_and_ajax.php
CHANGED
@@ -32,7 +32,7 @@ function php_window() {
|
|
32 |
<div class="panel_wrapper">
|
33 |
<div id="Single_product_panel" class="panel current">
|
34 |
<br>
|
35 |
-
<table border="0" cellpadding="4" cellspacing="0">
|
36 |
<tbody>
|
37 |
<tr>
|
38 |
<td nowrap="nowrap"><label for="spider_Calendar">Select Calendar</label></td>
|
@@ -205,7 +205,10 @@ function seemore() {
|
|
205 |
$datee = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : date("Y-m-d"));
|
206 |
$activedate = explode('-', $datee);
|
207 |
$activedatetimestamp = mktime(0, 0, 0, $activedate[1], $activedate[2], $activedate[0]);
|
208 |
-
$activedatestr =
|
|
|
|
|
|
|
209 |
$date = $datee;
|
210 |
$day = substr($date, 8);
|
211 |
$ev_id = explode(',', $ev_ids);
|
@@ -249,13 +252,46 @@ function seemore() {
|
|
249 |
}
|
250 |
};
|
251 |
</script>
|
252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
foreach ($rows as $row) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
for ($i = 0; $i < count($ev_id); $i++) {
|
|
|
|
|
|
|
|
|
|
|
256 |
if ($row->id == $ev_id[$i]) {
|
257 |
-
|
258 |
-
|
|
|
|
|
|
|
|
|
|
|
259 |
href="' . add_query_arg(array(
|
260 |
'action' => 'spidercalendarbig',
|
261 |
'theme_id' => $theme_id,
|
@@ -269,18 +305,115 @@ function seemore() {
|
|
269 |
'TB_iframe' => 1,
|
270 |
'tbWidth' => $popup_width,
|
271 |
'tbHeight' => $popup_height,
|
272 |
-
), admin_url('admin-ajax.php')) . '"
|
273 |
-
|
274 |
-
|
|
|
275 |
}
|
276 |
-
|
277 |
-
|
278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
}
|
280 |
}
|
281 |
}
|
282 |
?>
|
283 |
-
|
|
|
284 |
<?php
|
285 |
die();
|
286 |
}
|
@@ -300,6 +433,7 @@ function spiderbigcalendar() {
|
|
300 |
else {
|
301 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
302 |
}
|
|
|
303 |
$title_color = '#' . $theme->title_color;
|
304 |
$title_size = $theme->title_font_size;
|
305 |
$title_font = $theme->title_font;
|
@@ -379,7 +513,18 @@ function spiderbigcalendar() {
|
|
379 |
}
|
380 |
};
|
381 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
382 |
<?php
|
|
|
|
|
|
|
|
|
|
|
383 |
?>
|
384 |
<style>
|
385 |
#dayevent {
|
@@ -396,8 +541,12 @@ function spiderbigcalendar() {
|
|
396 |
font-size: 50px;
|
397 |
text-decoration: none;
|
398 |
}
|
|
|
|
|
|
|
|
|
399 |
</style>
|
400 |
-
<table style="height
|
401 |
<tr>
|
402 |
<td id="previous"
|
403 |
onClick="prev([<?php echo $ev_ids_inline; ?>],<?php echo $eventID; ?>,<?php echo $theme_id ?>,<?php echo $calendar_id ?>,'<?php echo $date; ?>',<?php echo $day ?>,'<?php echo $ev_ids_inline ?>')"
|
@@ -422,7 +571,7 @@ function spiderbigcalendar() {
|
|
422 |
else {
|
423 |
$date_font_style = "";
|
424 |
}
|
425 |
-
echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . $activedatestr . '</div>';
|
426 |
if ($title_style == "bold" or $title_style == "bold/italic") {
|
427 |
$font_weight = "font-weight:bold";
|
428 |
}
|
@@ -489,13 +638,13 @@ function spiderbigcalendar() {
|
|
489 |
}
|
490 |
else {
|
491 |
echo '<div style="color:' . $title_color . ';font-size:' . $title_size . 'px; font-family:' . $title_font . '; ' . $font_weight . '; ' . $font_style . ' ">' . $row->title . '</div>';
|
492 |
-
echo '<
|
493 |
}
|
494 |
echo '</div>';
|
495 |
|
496 |
?>
|
497 |
-
<div style="width:98%;text-align:right
|
498 |
-
<a style="color:<?php echo $title_color; ?>;font-size:15px; font-family:<?php echo $title_font; ?>;<?php echo $font_weight; ?>;<?php echo $font_style;
|
499 |
href="<?php echo add_query_arg(array(
|
500 |
'action' => 'spiderseemore',
|
501 |
'theme_id' => $theme_id,
|
@@ -508,7 +657,8 @@ function spiderbigcalendar() {
|
|
508 |
'tbHeight' => $popup_height,
|
509 |
), admin_url('admin-ajax.php')); ?>"><?php echo __('Back to event list', 'sp_calendar'); ?>
|
510 |
</a>
|
511 |
-
</div>
|
|
|
512 |
</td>
|
513 |
<td id="next"
|
514 |
onclick="next([<?php echo $ev_ids_inline ?>],<?php echo $eventID ?>,<?php echo $theme_id ?>,<?php echo $calendar_id ?>,'<?php echo $date ?>',<?php echo $day ?>,'<?php echo $ev_ids_inline ?>')"
|
32 |
<div class="panel_wrapper">
|
33 |
<div id="Single_product_panel" class="panel current">
|
34 |
<br>
|
35 |
+
<table border="0" cellpadding="4" cellspacing="0" style="font-size: 11px;">
|
36 |
<tbody>
|
37 |
<tr>
|
38 |
<td nowrap="nowrap"><label for="spider_Calendar">Select Calendar</label></td>
|
205 |
$datee = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : date("Y-m-d"));
|
206 |
$activedate = explode('-', $datee);
|
207 |
$activedatetimestamp = mktime(0, 0, 0, $activedate[1], $activedate[2], $activedate[0]);
|
208 |
+
$activedatestr = '';
|
209 |
+
|
210 |
+
|
211 |
+
$activedatestr = __(date("l", $activedatetimestamp), 'sp_calendar') . ', ' . __(date("d", $activedatetimestamp), 'sp_calendar') . ' ' . __(date("F", $activedatetimestamp), 'sp_calendar') . ', ' . __(date("Y", $activedatetimestamp), 'sp_calendar');
|
212 |
$date = $datee;
|
213 |
$day = substr($date, 8);
|
214 |
$ev_id = explode(',', $ev_ids);
|
252 |
}
|
253 |
};
|
254 |
</script>
|
255 |
+
<style>
|
256 |
+
body{
|
257 |
+
margin:0px;
|
258 |
+
padding:0px;
|
259 |
+
}
|
260 |
+
</style>
|
261 |
+
<div style="background-color:<?php echo $show_event_bgcolor; ?>; height:100%; padding:15px;">
|
262 |
<?php
|
263 |
+
$date_size = $theme->date_size;
|
264 |
+
$date_font = $theme->date_font;
|
265 |
+
$date_color = $theme->date_color;
|
266 |
+
if(!isset($date_font_style)) $date_font_style = "";
|
267 |
+
echo '<div style="font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_style . ';font-weight:bold;text-align:center;border-bottom:1px solid #F3F3F3;color:' . $date_color . ';">'.$activedatestr.'</div>';
|
268 |
+
|
269 |
foreach ($rows as $row) {
|
270 |
+
|
271 |
+
if($row->repeat=='1')
|
272 |
+
|
273 |
+
$repeat='';
|
274 |
+
|
275 |
+
else
|
276 |
+
|
277 |
+
$repeat=$row->repeat;
|
278 |
+
|
279 |
+
$weekdays=explode(',',$row->week);
|
280 |
+
|
281 |
for ($i = 0; $i < count($ev_id); $i++) {
|
282 |
+
|
283 |
+
$color = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.* , " . $wpdb->prefix . "spidercalendar_event_category.color
|
284 |
+
FROM " . $wpdb->prefix . "spidercalendar_event
|
285 |
+
JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category = " . $wpdb->prefix . "spidercalendar_event_category.id
|
286 |
+
WHERE " . $wpdb->prefix . "spidercalendar_event_category.published=1 AND " . $wpdb->prefix . "spidercalendar_event.id='".$row->id."'");
|
287 |
if ($row->id == $ev_id[$i]) {
|
288 |
+
|
289 |
+
if ($show_event || $widget==1) {
|
290 |
+
echo '<div >';
|
291 |
+
echo '<div style="display: table-cell;">';
|
292 |
+
if(!isset($color[0]->color)) $color[0]->color = "";
|
293 |
+
echo ' <div style="border-top: 1px solid #FFF;height: 76px;border-right: 2px solid #'.$color[0]->color.';display: table-cell;font-size: 25px;background-color: #E8E8E8;">'.($i + 1).' </div>';
|
294 |
+
echo '<a style="display: table-cell;text-decoration: none;font-size: 20px;color:' . $title_color . '; line-height:30px"
|
295 |
href="' . add_query_arg(array(
|
296 |
'action' => 'spidercalendarbig',
|
297 |
'theme_id' => $theme_id,
|
305 |
'TB_iframe' => 1,
|
306 |
'tbWidth' => $popup_width,
|
307 |
'tbHeight' => $popup_height,
|
308 |
+
), admin_url('admin-ajax.php')) . '"> ';
|
309 |
+
|
310 |
+
echo $row->title . '
|
311 |
+
</a>';
|
312 |
}
|
313 |
+
else
|
314 |
+
{
|
315 |
+
echo '<div >';
|
316 |
+
echo '<div style="display: table-cell;">';
|
317 |
+
echo '<div style="border-top: 1px solid #FFF;height: 76px;border-right: 2px solid #'.$color[0]->color.';display: table-cell;font-size: 25px;background-color: #E8E8E8;"> </div>';
|
318 |
+
echo '<a style="display: table-cell;text-decoration: none;font-size: 20px;color:' . $title_color . '; line-height:30px"
|
319 |
+
href="' . add_query_arg(array(
|
320 |
+
'action' => 'spidercalendarbig',
|
321 |
+
'theme_id' => $theme_id,
|
322 |
+
'calendar_id' => $calendar,
|
323 |
+
'ev_ids' => $ev_ids,
|
324 |
+
'eventID' => $ev_id[$i],
|
325 |
+
'date' => $date,
|
326 |
+
'day' => $day,
|
327 |
+
'cur_page_url' => $path_sp_cal,
|
328 |
+
'widget' => $widget,
|
329 |
+
'TB_iframe' => 1,
|
330 |
+
'tbWidth' => $popup_width,
|
331 |
+
'tbHeight' => $popup_height,
|
332 |
+
), admin_url('admin-ajax.php')) . '"> ';
|
333 |
+
|
334 |
+
echo $row->title . '
|
335 |
+
</a>';
|
336 |
+
|
337 |
+
}
|
338 |
+
if($row->date_end == "2070-12-12")
|
339 |
+
$date_end = '';
|
340 |
+
else
|
341 |
+
$date_end = ' - '.$row->date_end;
|
342 |
+
|
343 |
+
if ($row->repeat_method == 'daily') {
|
344 |
+
|
345 |
+
echo '<div style="margin-left: 25px;color:#6B696A;font-size:'.$date_size.'px; font-family:'.$date_font.';width: 97%;padding: 3px;background-color: #F8F8F8; margin-top: -45px; "><div style="display:table-cell"><img src="' . plugins_url( 'images/calendar1.png' , __FILE__ ) . '" /></div><div style="width:100%; display:table-cell;vertical-align:middle;padding-left:5px">Date: '.$row->date.''.$date_end.' ('. __('Repeat Every', 'sp_calendar').' ' .$repeat.' '.__('Day', 'sp_calendar').')</div></div>';
|
346 |
+
}
|
347 |
+
|
348 |
+
|
349 |
+
if($row->repeat_method=='weekly')
|
350 |
+
|
351 |
+
{
|
352 |
+
|
353 |
+
echo '<div style="margin-left: 25px;color:#6B696A;font-size:'.$date_size.'px; font-family:'.$date_font.';width: 97%;padding: 3px;background-color: #F8F8F8; margin-top: -45px; "><div style="display:table-cell"><img src="' . plugins_url( 'images/calendar1.png' , __FILE__ ) . '" /></div> <div style="width:100%; display:table-cell;vertical-align:middle;padding-left:5px">Date: '.$row->date.''.$date_end.' ('. __('Repeat Every', 'sp_calendar').' ' .$repeat.' '.__('Week(s) on', 'sp_calendar').' ';
|
354 |
+
|
355 |
+
for ($i=0;$i<count($weekdays);$i++)
|
356 |
+
|
357 |
+
{
|
358 |
+
|
359 |
+
if($weekdays[$i]!=''){
|
360 |
+
|
361 |
+
if($i!=count($weekdays)-2)
|
362 |
+
|
363 |
+
echo week_convert($weekdays[$i]).',';
|
364 |
+
|
365 |
+
else
|
366 |
+
|
367 |
+
echo week_convert($weekdays[$i]);
|
368 |
+
|
369 |
+
|
370 |
+
|
371 |
+
}
|
372 |
+
|
373 |
+
|
374 |
+
|
375 |
+
}
|
376 |
+
|
377 |
+
echo ')</div></div>';
|
378 |
+
|
379 |
+
}
|
380 |
+
|
381 |
+
if($row->repeat_method=='monthly' and $row->month_type==1)
|
382 |
+
|
383 |
+
echo '<div style="margin-left: 25px;color:#6B696A;font-size:'.$date_size.'px; font-family:'.$date_font.';width: 97%;padding: 3px;background-color: #F8F8F8; margin-top: -45px; "><div style="display:table-cell"><img src="' . plugins_url( 'images/calendar1.png' , __FILE__ ) . '" /></div> <div style="width:100%; display:table-cell;vertical-align:middle;padding-left:5px">Date: '.$row->date.''.$date_end.' ('. __('Repeat Every', 'sp_calendar').' ' .$repeat.' '.__('Month(s) on the', 'sp_calendar').' '.$row->month.')</div></div>';
|
384 |
+
|
385 |
+
|
386 |
+
|
387 |
+
if($row->repeat_method=='monthly' and $row->month_type==2)
|
388 |
+
|
389 |
+
echo '<div style="margin-left: 25px;color:#6B696A;font-size:'.$date_size.'px; font-family:'.$date_font.';width: 97%;padding: 3px;background-color: #F8F8F8; margin-top: -45px; "><div style="display:table-cell"><img src="' . plugins_url( 'images/calendar1.png' , __FILE__ ) . '" /></div> <div style="width:100%; display:table-cell;vertical-align:middle;padding-left:5px">Date: '.$row->date.''.$date_end.' ('. __('Repeat Every', 'sp_calendar').' '.$repeat.' '.__('Month(s) on the', 'sp_calendar').' '.week_number($row->monthly_list).' '.week_convert($row->month_week).')</div></div>';
|
390 |
+
|
391 |
+
|
392 |
+
|
393 |
+
if($row->repeat_method=='yearly' and $row->month_type==1)
|
394 |
+
|
395 |
+
echo '<div style="margin-left: 25px;color:#6B696A;font-size:'.$date_size.'px; font-family:'.$date_font.';width: 97%; padding: 3px; background-color: #F8F8F8;margin-top: -45px;"><div style="display:table-cell"><img src="' . plugins_url( 'images/calendar1.png' , __FILE__ ) . '"/></div> <div style="width:100%; display:table-cell;vertical-align:middle;padding-left:5px">Date: '.$row->date.''.$date_end.' ('. __('Repeat Every', 'sp_calendar').' ' .$repeat.' '.__('Year(s) in', 'sp_calendar').' '.date('F',mktime(0,0,0,$row->year_month + 1,0,0)).' '.__('on the', 'sp_calendar').' '.$row->month.')</div></div>';
|
396 |
+
|
397 |
+
|
398 |
+
|
399 |
+
if($row->repeat_method=='yearly' and $row->month_type==2)
|
400 |
+
|
401 |
+
echo '<div style="margin-left: 25px;color:#6B696A;font-size:'.$date_size.'px; font-family:'.$date_font.';width: 97%;padding: 3px;background-color: #F8F8F8;margin-top: -45px; "><div style="display:table-cell"><img src="' . plugins_url( 'images/calendar1.png' , __FILE__ ) . '" /></div> <div style="width:100%; display:table-cell;vertical-align:middle;padding-left:5px">Date: '.$row->date.''.$date_end.' ('. __('Repeat Every', 'sp_calendar').' ' .$repeat.' '.__('Year(s) in', 'sp_calendar').' '.date('F',mktime(0,0,0,$row->year_month + 1,0,0)).' '.__('on the', 'sp_calendar').' '.week_number($row->monthly_list).' '.week_convert($row->month_week).')</div></div>';
|
402 |
+
|
403 |
+
|
404 |
+
|
405 |
+
if($row->repeat_method=='no_repeat')
|
406 |
+
|
407 |
+
echo '<div style="margin-left: 25px;color:#6B696A;font-size:'.$date_size.'px; font-family:'.$date_font.';width: 97%;padding: 3px;background-color: #F8F8F8;margin-top: -45px; "><div style="display:table-cell"><img src="' . plugins_url( 'images/calendar1.png' , __FILE__ ) . '" /></div> <div style="width:100%; display:table-cell;vertical-align:middle;padding-left:5px">Date: '.$row->date.' </div></div>';
|
408 |
+
|
409 |
+
|
410 |
+
|
411 |
}
|
412 |
}
|
413 |
}
|
414 |
?>
|
415 |
+
</div>
|
416 |
+
|
417 |
<?php
|
418 |
die();
|
419 |
}
|
433 |
else {
|
434 |
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
435 |
}
|
436 |
+
|
437 |
$title_color = '#' . $theme->title_color;
|
438 |
$title_size = $theme->title_font_size;
|
439 |
$title_font = $theme->title_font;
|
513 |
}
|
514 |
};
|
515 |
</script>
|
516 |
+
<style>
|
517 |
+
body{
|
518 |
+
margin:0px;
|
519 |
+
padding:0px;
|
520 |
+
}
|
521 |
+
</style>
|
522 |
<?php
|
523 |
+
$color = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.* , " . $wpdb->prefix . "spidercalendar_event_category.color
|
524 |
+
FROM " . $wpdb->prefix . "spidercalendar_event
|
525 |
+
JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category = " . $wpdb->prefix . "spidercalendar_event_category.id
|
526 |
+
WHERE " . $wpdb->prefix . "spidercalendar_event_category.published=1 AND " . $wpdb->prefix . "spidercalendar_event.id='".$row->id."'");
|
527 |
+
|
528 |
?>
|
529 |
<style>
|
530 |
#dayevent {
|
541 |
font-size: 50px;
|
542 |
text-decoration: none;
|
543 |
}
|
544 |
+
body{
|
545 |
+
margin:0px;
|
546 |
+
padding:0px;
|
547 |
+
}
|
548 |
</style>
|
549 |
+
<table style="height:100%;width:100%;background-color:<?php echo $show_event_bgcolor; ?>; border-spacing:0" align="center">
|
550 |
<tr>
|
551 |
<td id="previous"
|
552 |
onClick="prev([<?php echo $ev_ids_inline; ?>],<?php echo $eventID; ?>,<?php echo $theme_id ?>,<?php echo $calendar_id ?>,'<?php echo $date; ?>',<?php echo $day ?>,'<?php echo $ev_ids_inline ?>')"
|
571 |
else {
|
572 |
$date_font_style = "";
|
573 |
}
|
574 |
+
echo '<div style="text-align:center;border-bottom:1px solid #F3F3F3;color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . $activedatestr . '</div>';
|
575 |
if ($title_style == "bold" or $title_style == "bold/italic") {
|
576 |
$font_weight = "font-weight:bold";
|
577 |
}
|
638 |
}
|
639 |
else {
|
640 |
echo '<div style="color:' . $title_color . ';font-size:' . $title_size . 'px; font-family:' . $title_font . '; ' . $font_weight . '; ' . $font_style . ' ">' . $row->title . '</div>';
|
641 |
+
echo '<p style="text-align:center">' . __('There Is No Text For This Event', 'sp_calendar') . '</p>';
|
642 |
}
|
643 |
echo '</div>';
|
644 |
|
645 |
?>
|
646 |
+
<div style="height:50px;width:98%;text-align:right;<?php if(count($ev_id) == 1) echo 'display:none;' ?>">
|
647 |
+
<a class="back_cal" style="color:<?php echo $title_color; ?>;font-size:15px; font-family:<?php echo $title_font; ?>;<?php echo $font_weight; ?>;<?php echo $font_style; ?>"
|
648 |
href="<?php echo add_query_arg(array(
|
649 |
'action' => 'spiderseemore',
|
650 |
'theme_id' => $theme_id,
|
657 |
'tbHeight' => $popup_height,
|
658 |
), admin_url('admin-ajax.php')); ?>"><?php echo __('Back to event list', 'sp_calendar'); ?>
|
659 |
</a>
|
660 |
+
</div><br>
|
661 |
+
<br>
|
662 |
</td>
|
663 |
<td id="next"
|
664 |
onclick="next([<?php echo $ev_ids_inline ?>],<?php echo $eventID ?>,<?php echo $theme_id ?>,<?php echo $calendar_id ?>,'<?php echo $date ?>',<?php echo $day ?>,'<?php echo $ev_ids_inline ?>')"
|
images/calendar1.png
ADDED
Binary file
|
images/catalog.jpg
ADDED
Binary file
|
images/contact.maker.jpg
ADDED
Binary file
|
images/contacts.jpg
ADDED
Binary file
|
images/delete_el.png
ADDED
Binary file
|
images/down.png
ADDED
Binary file
|
images/downarrow.png
ADDED
Binary file
|
images/download.jpg
ADDED
Binary file
|
images/facebook.jpg
ADDED
Binary file
|
images/faq.jpg
ADDED
Binary file
|
images/flash.calendar.jpg
ADDED
Binary file
|
images/folder.menu.jpg
ADDED
Binary file
|
images/form.jpg
ADDED
Binary file
|
images/player.jpg
ADDED
Binary file
|
images/spider.calendar.jpg
ADDED
Binary file
|
images/up.png
ADDED
Binary file
|
images/zoom.jpg
ADDED
Binary file
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://web-dorado.com/products/wordpress-calendar.html
|
|
4 |
Tags: Calendar, event, event calendar, event manager, events calendar,
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.7.1
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -22,9 +22,11 @@ Spider Event Calendar is a highly configurable product which allows you to have
|
|
22 |
Spider Event Calendar is a highly configurable plugin which allows you to have multiple organized events in a calendar. This plugin is one of the best WordPress Calendar available in WordPress Directory. If you have problem with organizing your WordPress Calendar events and displaying them in a calendar format, then Spider Wordpress Calendar Plugin is the best solution. Maybe you just want to have a quick look at your calendar to remind yourself about the future appointments? It will be great if calendar extension will be able to show all events, display them in a widget as a beautiful and customizable calendar on your website. Spider WordPress Calendar is an extraordinary user friendly calendar.
|
23 |
|
24 |
= Features of Spider Event Calendar: =
|
25 |
-
|
|
|
26 |
* You can add unlimited number of calendars and unlimited number of events for each calendar.
|
27 |
* [WordPress Calendar](http://web-dorado.com/products/wordpress-calendar.html) can be used as a plugin and as a widget as well.
|
|
|
28 |
* With a simple click on the date on the Calendar you will see the events and their descriptions recorded for that day.
|
29 |
* Spider Event Calendar supports events that last more than one day.
|
30 |
* Possibility to set the month and the year initially displayed on the calendar (option to display any particular month instead of the current month on the calendar).
|
@@ -32,9 +34,11 @@ Spider Event Calendar is a highly configurable plugin which allows you to have m
|
|
32 |
* You can create events in a calendar which will not repeat (and use a single time).
|
33 |
* Possibility to choose month display format in the Spider Event Calendar.
|
34 |
* Possibility to choose between four view modes (Month, List, Week and Day).
|
|
|
|
|
35 |
* Spider Event Calendar allows you to change the colors of the calendar and fit it to the colors of your website (*commercial version*).
|
36 |
-
* Spider Event Calendar has
|
37 |
-
* You can set
|
38 |
* You can change calendar date color, font size and font family in the popup (*commercial version*).
|
39 |
* Possibility to change arrow color and background color in the popup in the Spider Event Calendar (*commercial version*).
|
40 |
* Possibility to change popup background color in the Spider Event Calendar (*commercial version*).
|
4 |
Tags: Calendar, event, event calendar, event manager, events calendar,
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.7.1
|
7 |
+
Stable tag: 1.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
22 |
Spider Event Calendar is a highly configurable plugin which allows you to have multiple organized events in a calendar. This plugin is one of the best WordPress Calendar available in WordPress Directory. If you have problem with organizing your WordPress Calendar events and displaying them in a calendar format, then Spider Wordpress Calendar Plugin is the best solution. Maybe you just want to have a quick look at your calendar to remind yourself about the future appointments? It will be great if calendar extension will be able to show all events, display them in a widget as a beautiful and customizable calendar on your website. Spider WordPress Calendar is an extraordinary user friendly calendar.
|
23 |
|
24 |
= Features of Spider Event Calendar: =
|
25 |
+
|
26 |
+
* 100% responsive. Fully compatible with all mobile devices.
|
27 |
* You can add unlimited number of calendars and unlimited number of events for each calendar.
|
28 |
* [WordPress Calendar](http://web-dorado.com/products/wordpress-calendar.html) can be used as a plugin and as a widget as well.
|
29 |
+
* Separate upcoming events widget to display upcoming events in a list. The widget features are customizable.
|
30 |
* With a simple click on the date on the Calendar you will see the events and their descriptions recorded for that day.
|
31 |
* Spider Event Calendar supports events that last more than one day.
|
32 |
* Possibility to set the month and the year initially displayed on the calendar (option to display any particular month instead of the current month on the calendar).
|
34 |
* You can create events in a calendar which will not repeat (and use a single time).
|
35 |
* Possibility to choose month display format in the Spider Event Calendar.
|
36 |
* Possibility to choose between four view modes (Month, List, Week and Day).
|
37 |
+
* An option to create categories.
|
38 |
+
* Possibility to assign a category for each event, option of having different colors for each category.
|
39 |
* Spider Event Calendar allows you to change the colors of the calendar and fit it to the colors of your website (*commercial version*).
|
40 |
+
* Spider Event Calendar has 17 standard themes included in extension package for the plugin and 6 themes for the widget. (*commercial version*).
|
41 |
+
* You can set width of the Spider Event Calendar in the widget and in the [WordPress calendar plugin](http://web-dorado.com/products/wordpress-calendar.html) as well (*commercial version*).
|
42 |
* You can change calendar date color, font size and font family in the popup (*commercial version*).
|
43 |
* Possibility to change arrow color and background color in the popup in the Spider Event Calendar (*commercial version*).
|
44 |
* Possibility to change popup background color in the Spider Event Calendar (*commercial version*).
|
responsive.css
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@media only screen and (max-width : 640px) {
|
2 |
+
|
3 |
+
#views_tabs ,#drop_down_views
|
4 |
+
{
|
5 |
+
display:none;
|
6 |
+
}
|
7 |
+
|
8 |
+
#views_tabs_select
|
9 |
+
{
|
10 |
+
display:block !important;
|
11 |
+
}
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
+
@media only screen and (max-width : 968px) {
|
18 |
+
#cats >li
|
19 |
+
{
|
20 |
+
float:none;
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
}
|
responsive.js
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
jQuery(document).ready(function (){
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
jQuery('#views_select').click(function () {
|
7 |
+
|
8 |
+
jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
|
9 |
+
}, function () {
|
10 |
+
|
11 |
+
jQuery('#drop_down_views').stop(true, true).slideUp(500);
|
12 |
+
|
13 |
+
});
|
14 |
+
|
15 |
+
if(jQuery(window).width() > 640 )
|
16 |
+
{
|
17 |
+
|
18 |
+
jQuery('drop_down_views').hide();
|
19 |
+
}
|
20 |
+
|
21 |
+
|
22 |
+
});
|
23 |
+
|
24 |
+
|
spider_calendar_update.php
CHANGED
@@ -1,16 +1,54 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function spider_calendar_chech_update() {
|
4 |
global $wpdb;
|
5 |
-
if (
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
$sql = "ALTER TABLE " . $wpdb->prefix . "spidercalendar_calendar ADD start_month varchar(255);";
|
8 |
$wpdb->query($sql);
|
9 |
}
|
10 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "spidercalendar_calendar ADD `def_month` varchar(255) NOT NULL AFTER `start_month`");
|
11 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "spidercalendar_calendar CHANGE `start_month` `def_year` VARCHAR(512) NOT NULL");
|
12 |
-
|
13 |
-
$wpdb->query("DROP TABLE IF EXISTS `" . $wpdb->prefix . "spidercalendar_theme`");
|
14 |
$spider_theme_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "spidercalendar_theme` (
|
15 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
16 |
`title` varchar(255) NOT NULL,
|
@@ -101,6 +139,7 @@ function spider_calendar_chech_update() {
|
|
101 |
$spider_widget_theme_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "spidercalendar_widget_theme` (
|
102 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
103 |
`title` varchar(255) NOT NULL,
|
|
|
104 |
`width` varchar(255) NOT NULL,
|
105 |
`week_start_day` varchar(255) NOT NULL,
|
106 |
`font_year` varchar(255) NOT NULL,
|
@@ -144,10 +183,8 @@ function spider_calendar_chech_update() {
|
|
144 |
PRIMARY KEY (`id`)
|
145 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
146 |
$wpdb->query($spider_widget_theme_table);
|
147 |
-
$spider_widget_theme_rows = "INSERT INTO `" . $wpdb->prefix . "spidercalendar_widget_theme` (`id`,`title`,`width`,`week_start_day`,`font_year`,`font_month`,`font_day`,`font_weekday`,`header_bgcolor`,`footer_bgcolor`,`text_color_month`,`text_color_week_days`,`text_color_other_months`,`text_color_this_month_unevented`,`text_color_this_month_evented`,`bg_color_this_month_evented`,`bg_color_selected`,`arrow_color`,`text_color_selected`,`border_day`,`text_color_sun_days`,`weekdays_bg_color`,`su_bg_color`,`cell_border_color`,`year_font_size`,`year_font_color`,`year_tabs_bg_color`,`date_format`,`title_color`,`title_font_size`,`title_font`,`title_style`,`date_color`,`date_size`,`date_font`,`date_style`,`next_prev_event_bgcolor`,`next_prev_event_arrowcolor`,`show_event_bgcolor`,`popup_width`,`popup_height`,`show_repeat`) VALUES
|
148 |
-
(1,'Shiny Blue','200','mo','','','','','005478','E1E1E1','FFFFFF','2F647D','939699','989898','FBFFFE','005478','005478','CED1D0','FFFFFF','005478','989898','D6D6D6','B5B5B5','D2D2D2','13','ACACAC','ECECEC','w/d/m/y','FFFFFF','','','normal','262626','','','normal','00608A','97A0A6','B4C5CC','600','500','1')";
|
149 |
$wpdb->query($spider_widget_theme_rows);
|
150 |
}
|
151 |
-
}
|
152 |
-
|
153 |
-
?>
|
1 |
+
<?php function spider_calendar_chech_update() {
|
|
|
|
|
2 |
global $wpdb;
|
3 |
+
// if (get_site_option('spider_calendar_cureent_version') != '1.3' || !get_site_option('spider_calendar_cureent_version', FALSE)) {
|
4 |
+
// if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker_sessions'") != $wpdb->prefix . "formmaker_sessions") {
|
5 |
+
// if ($wpdb->query("ALTER TABLE `" . $wpdb->prefix . "spidercalendar_theme` IF EXISTS "))
|
6 |
+
|
7 |
+
$category = $wpdb->get_results("SHOW COLUMNS FROM ".$wpdb->prefix."spidercalendar_event");
|
8 |
+
$catexist=0;
|
9 |
+
for($i=0;$i<count($category);$i++){
|
10 |
+
if($category[$i]->Field=="category"){
|
11 |
+
$catexist=1;
|
12 |
+
break;
|
13 |
+
}
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
+
if($catexist==0)
|
18 |
+
{
|
19 |
+
$wpdb->query("ALTER TABLE ".$wpdb->prefix."spidercalendar_event ADD category int(11) AFTER title;");
|
20 |
+
}
|
21 |
+
|
22 |
+
|
23 |
+
$calendar = $wpdb->get_results("SHOW COLUMNS FROM ".$wpdb->prefix."spidercalendar_calendar");
|
24 |
+
$calexist=0;
|
25 |
+
for($i=0;$i<count($calendar);$i++){
|
26 |
+
if($calendar[$i]->Field=="start_month"){
|
27 |
+
$calexist=1;
|
28 |
+
break;
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
|
33 |
+
$calendar1 = $wpdb->get_results("SHOW COLUMNS FROM ".$wpdb->prefix."spidercalendar_calendar");
|
34 |
+
$calexist1=0;
|
35 |
+
for($i=0;$i<count($calendar1);$i++){
|
36 |
+
if($calendar1[$i]->Field=="def_month"){
|
37 |
+
$calexist1=1;
|
38 |
+
break;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
if ($calexist1==0) {
|
45 |
+
if ($calexist==1) {
|
46 |
$sql = "ALTER TABLE " . $wpdb->prefix . "spidercalendar_calendar ADD start_month varchar(255);";
|
47 |
$wpdb->query($sql);
|
48 |
}
|
49 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "spidercalendar_calendar ADD `def_month` varchar(255) NOT NULL AFTER `start_month`");
|
50 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "spidercalendar_calendar CHANGE `start_month` `def_year` VARCHAR(512) NOT NULL");
|
51 |
+
$wpdb->query("DROP TABLE IF EXISTS `" . $wpdb->prefix . "spidercalendar_theme`");
|
|
|
52 |
$spider_theme_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "spidercalendar_theme` (
|
53 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
54 |
`title` varchar(255) NOT NULL,
|
139 |
$spider_widget_theme_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "spidercalendar_widget_theme` (
|
140 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
141 |
`title` varchar(255) NOT NULL,
|
142 |
+
`ev_title_color` varchar(255),
|
143 |
`width` varchar(255) NOT NULL,
|
144 |
`week_start_day` varchar(255) NOT NULL,
|
145 |
`font_year` varchar(255) NOT NULL,
|
183 |
PRIMARY KEY (`id`)
|
184 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
|
185 |
$wpdb->query($spider_widget_theme_table);
|
186 |
+
$spider_widget_theme_rows = "INSERT INTO `" . $wpdb->prefix . "spidercalendar_widget_theme` (`id`,`title`,`ev_title_color`,`width`,`week_start_day`,`font_year`,`font_month`,`font_day`,`font_weekday`,`header_bgcolor`,`footer_bgcolor`,`text_color_month`,`text_color_week_days`,`text_color_other_months`,`text_color_this_month_unevented`,`text_color_this_month_evented`,`bg_color_this_month_evented`,`bg_color_selected`,`arrow_color`,`text_color_selected`,`border_day`,`text_color_sun_days`,`weekdays_bg_color`,`su_bg_color`,`cell_border_color`,`year_font_size`,`year_font_color`,`year_tabs_bg_color`,`date_format`,`title_color`,`title_font_size`,`title_font`,`title_style`,`date_color`,`date_size`,`date_font`,`date_style`,`next_prev_event_bgcolor`,`next_prev_event_arrowcolor`,`show_event_bgcolor`,`popup_width`,`popup_height`,`show_repeat`) VALUES
|
187 |
+
(1,'Shiny Blue','005478','200','mo','','','','','005478','E1E1E1','FFFFFF','2F647D','939699','989898','FBFFFE','005478','005478','CED1D0','FFFFFF','005478','989898','D6D6D6','B5B5B5','D2D2D2','13','ACACAC','ECECEC','w/d/m/y','FFFFFF','','','normal','262626','','','normal','00608A','97A0A6','B4C5CC','600','500','1')";
|
188 |
$wpdb->query($spider_widget_theme_rows);
|
189 |
}
|
190 |
+
} ?>
|
|
|
|
spidercalendar_upcoming_events_widget.php
ADDED
@@ -0,0 +1,2898 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$sonan=1;
|
3 |
+
add_action( 'wp_print_scripts', 'cal_scripts' );
|
4 |
+
|
5 |
+
|
6 |
+
function cal_scripts(){
|
7 |
+
wp_enqueue_script("Calendar", plugins_url("elements/calendar.js", __FILE__), FALSE);
|
8 |
+
wp_enqueue_script("calendar-setup", plugins_url("elements/calendar-setup.js", __FILE__), FALSE);
|
9 |
+
wp_enqueue_script("calendar_function", plugins_url("elements/calendar_function.js", __FILE__), FALSE);
|
10 |
+
wp_enqueue_style("Css", plugins_url("elements/calendar-jos.css", __FILE__), FALSE);
|
11 |
+
wp_enqueue_script('spider_color',plugins_url('jscolor/jscolor.js',__FILE__));
|
12 |
+
}
|
13 |
+
|
14 |
+
if (!class_exists('WP_Widget')) {
|
15 |
+
return;
|
16 |
+
}
|
17 |
+
|
18 |
+
class upcoming_events extends WP_Widget {
|
19 |
+
// Constructor //
|
20 |
+
function upcoming_events() {
|
21 |
+
$widget_ops = array(
|
22 |
+
'classname' => 'upcoming_events',
|
23 |
+
'description' => ''
|
24 |
+
);
|
25 |
+
$control_ops = array('id_base' => 'upcoming_events'); // Widget Control Settings.
|
26 |
+
$this->WP_Widget('upcoming_events', 'Upcoming Events', $widget_ops, $control_ops); // Create the widget.
|
27 |
+
}
|
28 |
+
|
29 |
+
// Extract Args //
|
30 |
+
function widget($args, $instance) {
|
31 |
+
extract($args);
|
32 |
+
$title = $instance['title'];
|
33 |
+
$calendar_id = $instance['calendar'];
|
34 |
+
$view_type = $instance['view_type'];
|
35 |
+
$theme_id = (($instance['theme']) ? $instance['theme'] : 1);
|
36 |
+
$event_from_current_day = $instance['event_qauntity1'];
|
37 |
+
$since = $instance['follow_quality1'];
|
38 |
+
$since1 = $instance['follow_quality3'];
|
39 |
+
$count = $instance['event_qauntity2'];
|
40 |
+
$count1 = $instance['event_qauntity22'];
|
41 |
+
$ordering = $instance['ordering'];
|
42 |
+
$ordering1 = $instance['ordering1'];
|
43 |
+
$event_select = $instance['event_select'];
|
44 |
+
$start_day_calendar = $instance['start_date'];
|
45 |
+
$event_from_day_interval = $instance['starting'];
|
46 |
+
$follow_quality2 = $instance['follow_quality2'];
|
47 |
+
$event_qauntity3 = $instance['event_qauntity3'];
|
48 |
+
|
49 |
+
$show_time = $instance['event_date'];
|
50 |
+
$show_repeat = $instance['repeat_rate'];
|
51 |
+
$show_numbering = $instance['numbering'];
|
52 |
+
$show_eventtext = $instance['ev_text'];
|
53 |
+
|
54 |
+
$width = $instance['width'];
|
55 |
+
$bg_color = $instance['bg_color'];
|
56 |
+
$title_color = $instance['title_color'];
|
57 |
+
$title_size = $instance['title_size'];
|
58 |
+
$title_font = $instance['title_font'];
|
59 |
+
$date_color = $instance['date_color'];
|
60 |
+
$date_format = $instance['date_format'];
|
61 |
+
$repeat_color = $instance['repeat_color'];
|
62 |
+
$text_color = $instance['text_color'];
|
63 |
+
$divider_color = $instance['divider_color'];
|
64 |
+
|
65 |
+
|
66 |
+
// Before widget //
|
67 |
+
echo $before_widget;
|
68 |
+
// Title of widget //
|
69 |
+
if ($title) {
|
70 |
+
echo $before_title . $title . $after_title;
|
71 |
+
}
|
72 |
+
// Widget output //
|
73 |
+
|
74 |
+
global $wpdb;
|
75 |
+
|
76 |
+
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : rand(10, 10000));
|
77 |
+
?>
|
78 |
+
<script>
|
79 |
+
|
80 |
+
var thickDims, tbWidth, tbHeight;
|
81 |
+
jQuery(document).ready(function ($) {
|
82 |
+
thickDims = function () {
|
83 |
+
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
84 |
+
if (tbWidth) {
|
85 |
+
if (tbWidth < (W - 90)) w = tbWidth; else w = W - 200;
|
86 |
+
}
|
87 |
+
else w = W - 200;
|
88 |
+
if (tbHeight) {
|
89 |
+
if (tbHeight < (H - 90)) h = tbHeight; else h = H - 200;
|
90 |
+
} else h = H - 200;
|
91 |
+
if (tbWindow.size()) {
|
92 |
+
tbWindow.width(w).height(h);
|
93 |
+
|
94 |
+
$('#TB_iframeContent').width(w).height(h - 27);
|
95 |
+
|
96 |
+
tbWindow.css({'margin-left':'-' + parseInt((w / 2), 10) + 'px'});
|
97 |
+
|
98 |
+
if (typeof document.body.style.maxWidth != 'undefined')
|
99 |
+
tbWindow.css({'top':(H - h) / 2, 'margin-top':'0'});
|
100 |
+
|
101 |
+
}
|
102 |
+
|
103 |
+
if(jQuery(window).width() < 640 ){
|
104 |
+
var tb_left = parseInt((w / 2), 10) + 20;
|
105 |
+
|
106 |
+
tbWindow.css({'left':'' + tb_left + 'px'});
|
107 |
+
jQuery('#TB_window').css('width','91%');
|
108 |
+
jQuery('#TB_window').css('height','80%');
|
109 |
+
jQuery('#TB_window').css('margin-top','-10%');
|
110 |
+
jQuery('#TB_window iframe').css('width','100%');
|
111 |
+
jQuery('#TB_window iframe').css('height','87%');
|
112 |
+
|
113 |
+
}
|
114 |
+
|
115 |
+
};
|
116 |
+
thickDims();
|
117 |
+
$(window).resize(function () {
|
118 |
+
thickDims()
|
119 |
+
});
|
120 |
+
|
121 |
+
$('a.thickbox-preview<?php echo $many_sp_calendar?>').click(function () {
|
122 |
+
|
123 |
+
tb_click.call(this);
|
124 |
+
var alink = jQuery(this).parents('.available-theme').find('.activatelink'), link = '', href = jQuery(this).attr('href'), url, text;
|
125 |
+
var reg_with = new RegExp(xx_cal_xx + "tbWidth=[0-9]+");
|
126 |
+
|
127 |
+
if (tbWidth = href.match(reg_with))
|
128 |
+
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
129 |
+
else
|
130 |
+
tbWidth = jQuery(window).width() - 90;
|
131 |
+
|
132 |
+
|
133 |
+
|
134 |
+
var reg_heght = new RegExp(xx_cal_xx + "tbHeight=[0-9]+");
|
135 |
+
if (tbHeight = href.match(reg_heght))
|
136 |
+
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
137 |
+
else
|
138 |
+
tbHeight = jQuery(window).height() - 60;
|
139 |
+
jQuery('#TB_title').css({'background-color':'#222', 'color':'#dfdfdf'});
|
140 |
+
jQuery('#TB_closeAjaxWindow').css({'float':'left'});
|
141 |
+
jQuery('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
142 |
+
jQuery('#TB_iframeContent').width('100%');
|
143 |
+
thickDims();
|
144 |
+
return false;
|
145 |
+
});
|
146 |
+
});
|
147 |
+
|
148 |
+
</script>
|
149 |
+
|
150 |
+
<?php
|
151 |
+
|
152 |
+
|
153 |
+
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 1);
|
154 |
+
|
155 |
+
$query="SELECT popup_width,popup_height FROM " . $wpdb->prefix . "spidercalendar_widget_theme WHERE id=".$theme_id;
|
156 |
+
$popup_w_hs= $wpdb->get_results($query);
|
157 |
+
|
158 |
+
$popup_w_h = array(
|
159 |
+
0 => $popup_w_hs[0]->popup_width,
|
160 |
+
1 => $popup_w_hs[0]->popup_height,
|
161 |
+
);
|
162 |
+
|
163 |
+
$popup_width = $popup_w_h[0];
|
164 |
+
$popup_height = $popup_w_h[1];
|
165 |
+
|
166 |
+
$cal= strtotime($start_day_calendar);
|
167 |
+
|
168 |
+
$id = $this->get_field_id('title');
|
169 |
+
global $callone;
|
170 |
+
$callone=$callone+1;
|
171 |
+
|
172 |
+
if($callone==1)
|
173 |
+
{
|
174 |
+
function compare_str_to_array($string,$array,$end_date)
|
175 |
+
{
|
176 |
+
|
177 |
+
foreach($array as $value)
|
178 |
+
{
|
179 |
+
if($string<=$value and $end_date>=$value)
|
180 |
+
{
|
181 |
+
return $value;
|
182 |
+
break;
|
183 |
+
}
|
184 |
+
|
185 |
+
}
|
186 |
+
|
187 |
+
|
188 |
+
}
|
189 |
+
|
190 |
+
|
191 |
+
function compare_str_to_array1($string,$array)
|
192 |
+
{
|
193 |
+
|
194 |
+
foreach($array as $value)
|
195 |
+
{
|
196 |
+
if($string<=$value)
|
197 |
+
{
|
198 |
+
return $value;
|
199 |
+
break;
|
200 |
+
}
|
201 |
+
|
202 |
+
}
|
203 |
+
|
204 |
+
|
205 |
+
}
|
206 |
+
|
207 |
+
|
208 |
+
function week_number_recent($x) {
|
209 |
+
if ($x == 1) {
|
210 |
+
return __('First', 'sp_calendar');
|
211 |
+
}
|
212 |
+
elseif ($x == 8) {
|
213 |
+
return __('Second', 'sp_calendar');
|
214 |
+
}
|
215 |
+
elseif ($x == 15) {
|
216 |
+
return __('Third', 'sp_calendar');
|
217 |
+
}
|
218 |
+
elseif ($x == 22) {
|
219 |
+
return __('Fourth', 'sp_calendar');
|
220 |
+
}
|
221 |
+
elseif ($x == 'last') {
|
222 |
+
return __('Last', 'sp_calendar');
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
|
227 |
+
function week_convert_recent($x)
|
228 |
+
|
229 |
+
{
|
230 |
+
if ($x == 'Mon') {
|
231 |
+
return __('Monday', 'sp_calendar');
|
232 |
+
}
|
233 |
+
elseif ($x == 'Tue') {
|
234 |
+
return __('Tuesday', 'sp_calendar');
|
235 |
+
}
|
236 |
+
elseif ($x == 'Wed') {
|
237 |
+
return __('Wednesday', 'sp_calendar');
|
238 |
+
}
|
239 |
+
elseif ($x == 'Thu') {
|
240 |
+
return __('Thursday', 'sp_calendar');
|
241 |
+
}
|
242 |
+
elseif ($x == 'Fri') {
|
243 |
+
return __('Friday', 'sp_calendar');
|
244 |
+
}
|
245 |
+
elseif ($x == 'Sat') {
|
246 |
+
return __('Saturday', 'sp_calendar');
|
247 |
+
}
|
248 |
+
elseif ($x == 'Sun') {
|
249 |
+
return __('Sunday', 'sp_calendar');
|
250 |
+
}
|
251 |
+
}
|
252 |
+
|
253 |
+
|
254 |
+
function sorrt($st_date,$array,$en_date)
|
255 |
+
{
|
256 |
+
$ids=array();
|
257 |
+
$dat=array();
|
258 |
+
$dats=array();
|
259 |
+
$ret_array=array();
|
260 |
+
foreach($array as $key=>$value)
|
261 |
+
{
|
262 |
+
$ids[]=$key;
|
263 |
+
$dat[]=compare_str_to_array($st_date,$value,$en_date);
|
264 |
+
$dats[]=$value;
|
265 |
+
}
|
266 |
+
|
267 |
+
asort($dat);
|
268 |
+
|
269 |
+
foreach($dat as $key=>$val)
|
270 |
+
{
|
271 |
+
$ret_array[$ids[$key]]=$dats[$key];
|
272 |
+
}
|
273 |
+
|
274 |
+
return $ret_array;
|
275 |
+
|
276 |
+
}
|
277 |
+
|
278 |
+
function sorrt1($st_date,$array)
|
279 |
+
{
|
280 |
+
$ids=array();
|
281 |
+
$dat=array();
|
282 |
+
$dats=array();
|
283 |
+
$ret_array=array();
|
284 |
+
foreach($array as $key=>$value)
|
285 |
+
{
|
286 |
+
$ids[]=$key;
|
287 |
+
$dat[]=compare_str_to_array1($st_date,$value);
|
288 |
+
$dats[]=$value;
|
289 |
+
}
|
290 |
+
|
291 |
+
asort($dat);
|
292 |
+
|
293 |
+
foreach($dat as $key=>$val)
|
294 |
+
{
|
295 |
+
$ret_array[$ids[$key]]=$dats[$key];
|
296 |
+
}
|
297 |
+
|
298 |
+
return $ret_array;
|
299 |
+
|
300 |
+
}
|
301 |
+
|
302 |
+
function add_00($str)
|
303 |
+
{
|
304 |
+
|
305 |
+
if(strlen($str)==1)
|
306 |
+
return '0'.$str;
|
307 |
+
else
|
308 |
+
return $str;
|
309 |
+
|
310 |
+
|
311 |
+
}
|
312 |
+
|
313 |
+
function num_to_str($x)
|
314 |
+
{
|
315 |
+
switch($x)
|
316 |
+
{
|
317 |
+
case '1':
|
318 |
+
return 'first';
|
319 |
+
break;
|
320 |
+
|
321 |
+
case '8':
|
322 |
+
return 'second';
|
323 |
+
break;
|
324 |
+
|
325 |
+
case '15':
|
326 |
+
return 'third';
|
327 |
+
break;
|
328 |
+
|
329 |
+
case '22':
|
330 |
+
return 'Fourth';
|
331 |
+
break;
|
332 |
+
|
333 |
+
case 'last':
|
334 |
+
return 'last';
|
335 |
+
break;
|
336 |
+
|
337 |
+
|
338 |
+
}
|
339 |
+
|
340 |
+
|
341 |
+
}
|
342 |
+
}
|
343 |
+
$id = $this->get_field_id('title');
|
344 |
+
?>
|
345 |
+
|
346 |
+
<style type="text/css">
|
347 |
+
.widget{
|
348 |
+
padding:0px !important;
|
349 |
+
}
|
350 |
+
|
351 |
+
.site-footer .widget a{
|
352 |
+
color:none;
|
353 |
+
}
|
354 |
+
|
355 |
+
|
356 |
+
#event_repeat<?php echo $id?>{
|
357 |
+
color:#<?php echo $repeat_color ?>;
|
358 |
+
padding-top:14px;
|
359 |
+
<?php if($show_eventtext==0){?>
|
360 |
+
padding-bottom:14px!important;
|
361 |
+
|
362 |
+
<?php }?>
|
363 |
+
|
364 |
+
}
|
365 |
+
#event_table<?php echo $id?>{
|
366 |
+
|
367 |
+
border:0px !important;
|
368 |
+
border-spacing:0px !important;
|
369 |
+
border-collapse:collapse;
|
370 |
+
|
371 |
+
}
|
372 |
+
|
373 |
+
#event_text<?php echo $id?>{
|
374 |
+
padding:15px;
|
375 |
+
color:#<?php echo $text_color?>;
|
376 |
+
padding-bottom:14px!important;
|
377 |
+
<?php if($show_repeat==0) {?>
|
378 |
+
padding-top:14px!important;
|
379 |
+
<?php } ?>
|
380 |
+
padding-left: 8px;
|
381 |
+
}
|
382 |
+
|
383 |
+
|
384 |
+
#event_date<?php echo $id?>
|
385 |
+
{
|
386 |
+
color:#<?php echo $date_color?>;
|
387 |
+
<?php if($show_eventtext==0){?>
|
388 |
+
padding-bottom:14px!important;
|
389 |
+
<?php } ?>
|
390 |
+
<?php if($show_repeat==0){?>
|
391 |
+
padding-bottom:14px!important;
|
392 |
+
<?php } ?>
|
393 |
+
}
|
394 |
+
|
395 |
+
|
396 |
+
|
397 |
+
#title<?php echo $id?>:link,
|
398 |
+
#see_more<?php echo $id?>
|
399 |
+
{
|
400 |
+
font-size:<?php echo $title_size?>px;
|
401 |
+
font-family:<?php echo $title_font?>;
|
402 |
+
color:#<?php echo $title_color?> !important;
|
403 |
+
text-decoration:none;
|
404 |
+
|
405 |
+
}
|
406 |
+
|
407 |
+
#title<?php echo $id?>:hover{
|
408 |
+
background:none ;
|
409 |
+
text-decoration:underline ;
|
410 |
+
|
411 |
+
}
|
412 |
+
|
413 |
+
|
414 |
+
|
415 |
+
tr, td{
|
416 |
+
border:0px;
|
417 |
+
padding-left:7px;
|
418 |
+
padding-right:12px;
|
419 |
+
padding-bottom:4px;
|
420 |
+
padding-top:2px;
|
421 |
+
}
|
422 |
+
#divider<?php echo $id?>
|
423 |
+
{
|
424 |
+
background-color:#<?php echo $instance['divider_color']?>;
|
425 |
+
border:none;
|
426 |
+
height:1px;
|
427 |
+
}
|
428 |
+
|
429 |
+
.pad
|
430 |
+
{
|
431 |
+
<?php if($show_time==0){?>
|
432 |
+
padding-bottom:14px;
|
433 |
+
<?php } ?>
|
434 |
+
}
|
435 |
+
|
436 |
+
.module<?php echo $id?>
|
437 |
+
{
|
438 |
+
background-color:#<?php echo $bg_color?>;
|
439 |
+
width:<?php echo $width?>px;
|
440 |
+
border:1px ;
|
441 |
+
border-radius:8px;
|
442 |
+
-moz-border-radius: 8px;
|
443 |
+
-webkit-border-radius: 8px;
|
444 |
+
padding-right:10px;
|
445 |
+
padding-left:10px;
|
446 |
+
border:2px solid #6A6A6A;;
|
447 |
+
|
448 |
+
}
|
449 |
+
|
450 |
+
</style>
|
451 |
+
|
452 |
+
|
453 |
+
|
454 |
+
<?php
|
455 |
+
$query1= "SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE published='1'";
|
456 |
+
$rows = $wpdb->get_results($query1);
|
457 |
+
$daysarray = array();
|
458 |
+
|
459 |
+
foreach($rows as $row)
|
460 |
+
{
|
461 |
+
if($row -> date_end!='0000-00-00')
|
462 |
+
{
|
463 |
+
$Startdate = $row->date;
|
464 |
+
$Enddate = $row->date_end ;
|
465 |
+
|
466 |
+
|
467 |
+
$ts1 = strtotime($Startdate);
|
468 |
+
$ts2 = strtotime($Enddate);
|
469 |
+
|
470 |
+
|
471 |
+
$seconds_diff = ($ts2 - $ts1);
|
472 |
+
|
473 |
+
|
474 |
+
$day_diff = floor($seconds_diff/3600/24+1);
|
475 |
+
|
476 |
+
|
477 |
+
for($i=0; $i<$day_diff; $i+=$row->repeat)
|
478 |
+
{
|
479 |
+
$Nextdate = strtotime(date("Y-m-d", strtotime($row->date)) . " +".$i." day");
|
480 |
+
|
481 |
+
$Nextdate = date("Y-m-d",$Nextdate);
|
482 |
+
array_push($daysarray,$Nextdate);
|
483 |
+
|
484 |
+
}
|
485 |
+
|
486 |
+
|
487 |
+
$weekdays = explode(',',$row->week);
|
488 |
+
$weekdays= array_slice($weekdays,0,count($weekdays)-1);
|
489 |
+
}
|
490 |
+
|
491 |
+
|
492 |
+
}//end main foreach
|
493 |
+
////////////////////////////////////////////////
|
494 |
+
|
495 |
+
echo '<div class="module'.$id.'">';
|
496 |
+
|
497 |
+
if($view_type==0)
|
498 |
+
{
|
499 |
+
$query=" SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar= ".$calendar_id." AND published='1' ORDER BY date LIMIT 0, ".$event_from_current_day;
|
500 |
+
$evs = $wpdb->get_results($query);
|
501 |
+
$st_date=date('Y-m-d');
|
502 |
+
|
503 |
+
$dates=array();
|
504 |
+
|
505 |
+
foreach($evs as $ev)
|
506 |
+
{
|
507 |
+
|
508 |
+
$st=$ev->date;
|
509 |
+
if($ev->date_end!='0000-00-00')
|
510 |
+
$en=$ev->date_end;
|
511 |
+
else
|
512 |
+
$en=date('Y-m-d', strtotime('+24 year', strtotime($st)));
|
513 |
+
|
514 |
+
|
515 |
+
$date_st=explode('-',$st);
|
516 |
+
|
517 |
+
$date_end=explode('-',$en);
|
518 |
+
|
519 |
+
$st_d= mktime(0, 0, 0, $date_st[1], $date_st[2], $date_st[0]);
|
520 |
+
$en_d = mktime(0, 0, 0, $date_end[1], $date_end[2], $date_end[0]);
|
521 |
+
$tarb=$en_d-$st_d;
|
522 |
+
|
523 |
+
|
524 |
+
$weekly_array=explode(',',$ev->week);
|
525 |
+
|
526 |
+
for($j=0; $j<=6;$j++)
|
527 |
+
{
|
528 |
+
if( in_array(date("D", mktime(0, 0, 0, $date_st[1], $date_st[2]+$j, $date_st[0])),$weekly_array))
|
529 |
+
{
|
530 |
+
|
531 |
+
$weekdays_start[]=$date_st[2]+$j;}
|
532 |
+
|
533 |
+
}
|
534 |
+
|
535 |
+
|
536 |
+
|
537 |
+
if($ev->repeat_method=="no_repeat")
|
538 |
+
{
|
539 |
+
$dates[$ev->id][0]=$ev->date;
|
540 |
+
}
|
541 |
+
|
542 |
+
///////////////////get days for daily repeat
|
543 |
+
if($ev->repeat_method=="daily")
|
544 |
+
{
|
545 |
+
if($tarb<=0)
|
546 |
+
$day_count=((($st_d-$en_d)/3600)/24)/($ev->repeat);
|
547 |
+
else
|
548 |
+
$day_count=((($en_d-$st_d)/3600)/24)/($ev->repeat);
|
549 |
+
|
550 |
+
$dates[$ev->id][0]=$ev->date;
|
551 |
+
for($i=0;$i<$day_count;$i++)
|
552 |
+
{
|
553 |
+
if($ev->repeat_method=="daily")
|
554 |
+
$dates[$ev->id][]=date('Y-m-d', strtotime('+'.($ev->repeat).' day', strtotime($dates[$ev->id][$i])));
|
555 |
+
}
|
556 |
+
}
|
557 |
+
///////////////////get days for weekly repeat
|
558 |
+
if($ev->repeat_method=="weekly")
|
559 |
+
{
|
560 |
+
|
561 |
+
$day_count=((($en_d-$st_d)/3600)/24)/($ev->repeat*7);
|
562 |
+
|
563 |
+
$d=array();
|
564 |
+
$dat=array();
|
565 |
+
for($j=0;$j<count($weekdays_start);$j++)
|
566 |
+
{
|
567 |
+
|
568 |
+
unset($dat);
|
569 |
+
$dat[0]=$date_st[0].'-'.$date_st[1].'-'.add_00($weekdays_start[$j]);
|
570 |
+
|
571 |
+
|
572 |
+
for($i=0;$i<$day_count-1;$i++)
|
573 |
+
{
|
574 |
+
$dat[]=date('Y-m-d', strtotime('+'.($ev->repeat).' week', strtotime($dat[$i])));
|
575 |
+
}
|
576 |
+
|
577 |
+
|
578 |
+
$d=array_merge($d,$dat);
|
579 |
+
}
|
580 |
+
|
581 |
+
sort($d);
|
582 |
+
$dates[$ev->id]=$d;
|
583 |
+
}
|
584 |
+
|
585 |
+
///////////////////get days for monthly repeat
|
586 |
+
if($ev->repeat_method=="monthly")
|
587 |
+
{
|
588 |
+
|
589 |
+
$start_date = strtotime($ev->date);
|
590 |
+
$end_date = strtotime($en);
|
591 |
+
$min_date = min($start_date, $end_date);
|
592 |
+
$max_date = max($start_date, $end_date);
|
593 |
+
$month_count = 0;
|
594 |
+
|
595 |
+
while (($min_date = strtotime("+1 MONTH", $min_date)) <= $max_date) {
|
596 |
+
$month_count++;
|
597 |
+
}
|
598 |
+
|
599 |
+
$month_days = date('t',mktime(0, 0, 0, $date_st[1], 1, $date_st[0]));
|
600 |
+
|
601 |
+
if($ev->month_type==1)
|
602 |
+
{
|
603 |
+
$dates[$ev->id][0]=$date_st[0].'-'.$date_st[1].'-'.add_00($ev->month);
|
604 |
+
|
605 |
+
}
|
606 |
+
else
|
607 |
+
{
|
608 |
+
if($ev->monthly_list!='last'){
|
609 |
+
for($j=$ev->monthly_list; $j<$ev->monthly_list+7;$j++)
|
610 |
+
{
|
611 |
+
if(date("D", mktime(0, 0, 0, $date_st[1], $j, $date_st[0])) == $ev->month_week)
|
612 |
+
{
|
613 |
+
|
614 |
+
|
615 |
+
$dates[$ev->id][0]=$date_st[0].'-'.$date_st[1].'-'.add_00($j);
|
616 |
+
|
617 |
+
|
618 |
+
}
|
619 |
+
}
|
620 |
+
}
|
621 |
+
else
|
622 |
+
{
|
623 |
+
for($j=1; $j<=$month_days;$j++)
|
624 |
+
{
|
625 |
+
if(date("D", mktime(0, 0, 0, $date_st[1], $j, $date_st[0])) == $ev->month_week)
|
626 |
+
{
|
627 |
+
$dates[$ev->id][0]=$date_st[0].'-'.$date_st[1].'-'.add_00($j);
|
628 |
+
|
629 |
+
}
|
630 |
+
|
631 |
+
}
|
632 |
+
}
|
633 |
+
|
634 |
+
|
635 |
+
}
|
636 |
+
|
637 |
+
for($i=0;$i<$month_count;$i++)
|
638 |
+
{
|
639 |
+
$mon=date('F', strtotime('+'.($ev->repeat).' month', strtotime($dates[$ev->id][$i])));
|
640 |
+
$year=date('Y', strtotime('+'.($ev->repeat).' month', strtotime($dates[$ev->id][$i])));
|
641 |
+
|
642 |
+
date('Y-m-d', strtotime(''.num_to_str($ev->monthly_list).' '.$ev->month_week.' of '.$mon.' '.$year.''));
|
643 |
+
|
644 |
+
if($ev->month_type==1)
|
645 |
+
$dates[$ev->id][]=date('Y-m-d', strtotime('+'.($ev->repeat).' month', strtotime($dates[$ev->id][$i])));
|
646 |
+
else
|
647 |
+
{
|
648 |
+
$mon=date('F', strtotime('+'.($ev->repeat).' month', strtotime($dates[$ev->id][$i])));
|
649 |
+
$year=date('Y', strtotime('+'.($ev->repeat).' month', strtotime($dates[$ev->id][$i])));
|
650 |
+
$dates[$ev->id][]=date('Y-m-d', strtotime(''.num_to_str($ev->monthly_list).' '.$ev->month_week.' of '.$mon.' '.$year.''));
|
651 |
+
}
|
652 |
+
}
|
653 |
+
|
654 |
+
|
655 |
+
|
656 |
+
}
|
657 |
+
|
658 |
+
|
659 |
+
if($ev->repeat_method=="yearly")
|
660 |
+
{
|
661 |
+
|
662 |
+
$start_date = strtotime($ev->date);
|
663 |
+
$end_date = strtotime($en);
|
664 |
+
$min_date = min($start_date, $end_date);
|
665 |
+
$max_date = max($start_date, $end_date);
|
666 |
+
$year_count = 0;
|
667 |
+
|
668 |
+
while (($min_date = strtotime("+1 year", $min_date)) <= $max_date) {
|
669 |
+
$year_count++;
|
670 |
+
}
|
671 |
+
|
672 |
+
$month_days = date('t',mktime(0, 0, 0, add_00($ev->year_month), 1, $date_st[0]));
|
673 |
+
|
674 |
+
if($ev->month_type==1)
|
675 |
+
{
|
676 |
+
$dates[$ev->id][0]=$date_st[0].'-'.add_00($ev->year_month).'-'.add_00($ev->month);
|
677 |
+
|
678 |
+
}
|
679 |
+
else
|
680 |
+
{
|
681 |
+
if($ev->monthly_list!='last'){
|
682 |
+
for($j=$ev->monthly_list; $j<$ev->monthly_list+7;$j++)
|
683 |
+
{
|
684 |
+
if(date("D", mktime(0, 0, 0, add_00($ev->year_month), $j, $date_st[0])) == $ev->month_week)
|
685 |
+
{
|
686 |
+
|
687 |
+
|
688 |
+
$dates[$ev->id][0]=$date_st[0].'-'.add_00($ev->year_month).'-'.add_00($j);
|
689 |
+
|
690 |
+
|
691 |
+
}
|
692 |
+
}
|
693 |
+
}
|
694 |
+
else
|
695 |
+
{
|
696 |
+
for($j=1; $j<=$month_days;$j++)
|
697 |
+
{
|
698 |
+
if(date("D", mktime(0, 0, 0, add_00($ev->year_month), $j, $date_st[0])) == $ev->month_week)
|
699 |
+
{
|
700 |
+
$dates[$ev->id][0]=$date_st[0].'-'.add_00($ev->year_month).'-'.add_00($j);
|
701 |
+
|
702 |
+
}
|
703 |
+
|
704 |
+
}
|
705 |
+
}
|
706 |
+
|
707 |
+
|
708 |
+
}
|
709 |
+
|
710 |
+
for($i=0;$i<$year_count;$i++)
|
711 |
+
{
|
712 |
+
|
713 |
+
|
714 |
+
if($ev->month_type==1)
|
715 |
+
$dates[$ev->id][]=date('Y-m-d', strtotime('+'.($ev->repeat).' year', strtotime($dates[$ev->id][$i])));
|
716 |
+
else
|
717 |
+
{
|
718 |
+
$mon=date('F', strtotime('+'.($ev->repeat).' year', strtotime($dates[$ev->id][$i])));
|
719 |
+
$year=date('Y', strtotime('+'.($ev->repeat).' year', strtotime($dates[$ev->id][$i])));
|
720 |
+
$dates[$ev->id][]=date('Y-m-d', strtotime(''.num_to_str($ev->monthly_list).' '.$ev->month_week.' of '.$mon.' '.$year.''));
|
721 |
+
}
|
722 |
+
}
|
723 |
+
|
724 |
+
|
725 |
+
|
726 |
+
}
|
727 |
+
|
728 |
+
|
729 |
+
sort($dates[$ev->id]);
|
730 |
+
}
|
731 |
+
|
732 |
+
|
733 |
+
foreach($dates as $ev_id=>$date )
|
734 |
+
{
|
735 |
+
//echo compare_str_to_array($st_date,$date,$en_date). ' ';
|
736 |
+
|
737 |
+
$gag[$ev_id]=compare_str_to_array1($st_date,$date);
|
738 |
+
}
|
739 |
+
|
740 |
+
$dates=sorrt1($st_date,$dates);
|
741 |
+
|
742 |
+
|
743 |
+
$i=1;
|
744 |
+
$j=0;
|
745 |
+
|
746 |
+
$p=0;
|
747 |
+
|
748 |
+
foreach($dates as $ev_id=>$date)
|
749 |
+
{
|
750 |
+
|
751 |
+
$query0=" SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE id=".$ev_id;
|
752 |
+
$curr_event1 = $wpdb->get_results($query0);
|
753 |
+
$curr_event=$curr_event1[0];
|
754 |
+
|
755 |
+
$event_id = $curr_event->id;
|
756 |
+
$event_title = $curr_event->title;
|
757 |
+
|
758 |
+
$event_date = compare_str_to_array1($st_date,$date);
|
759 |
+
$event_end_date = $curr_event->date_end;
|
760 |
+
$event_text = $curr_event->text_for_date;
|
761 |
+
$calendar_id = $curr_event->calendar;
|
762 |
+
$repeat = $curr_event->repeat;
|
763 |
+
$week=explode(',',$curr_event->week);
|
764 |
+
|
765 |
+
$year=substr($event_date,0,4);
|
766 |
+
$month=substr($event_date,5,-3);
|
767 |
+
$day=substr($event_date,8);
|
768 |
+
|
769 |
+
/*$month_date_year = date("F j, Y",mktime(0,0,0,$month,$day,$year));
|
770 |
+
$jd=gregoriantojd($month,$day,$year);
|
771 |
+
$weekday = jddayofweek($jd,2);
|
772 |
+
$date = $weekday.' '.$month_date_year;
|
773 |
+
echo $weekday;*/
|
774 |
+
|
775 |
+
echo '<div id="event_table'.$id.'" >';
|
776 |
+
if($show_numbering==1)
|
777 |
+
{
|
778 |
+
echo '<div style="padding-top:0px;" class="pad"><a id="title'.$id.'" class="thickbox-preview' . $many_sp_calendar . '"
|
779 |
+
href="' . add_query_arg(array(
|
780 |
+
'action' => 'spidercalendarbig',
|
781 |
+
'calendar_id' => $id,
|
782 |
+
'theme_id' => $theme_id,
|
783 |
+
'eventID' => $ev_id,
|
784 |
+
'widget' => $widget,
|
785 |
+
'TB_iframe' => 1,
|
786 |
+
'date' => $year.'-'.$month.'-'.$day,
|
787 |
+
'tbWidth' => $popup_width,
|
788 |
+
'tbHeight' => $popup_height
|
789 |
+
), admin_url('admin-ajax.php')) . '"
|
790 |
+
></br><b>'. $i++.'.'.$event_title.'</b></a></div>';
|
791 |
+
|
792 |
+
}
|
793 |
+
else
|
794 |
+
{
|
795 |
+
echo '<div style="padding-top:0px;" class="pad"><a id="title'.$id.'" class="thickbox-preview' . $many_sp_calendar . '"
|
796 |
+
href="' . add_query_arg(array(
|
797 |
+
'action' => 'spidercalendarbig',
|
798 |
+
'calendar_id' => $id,
|
799 |
+
'theme_id' => $theme_id,
|
800 |
+
'eventID' => $ev_id,
|
801 |
+
'widget' => $widget,
|
802 |
+
'TB_iframe' => 1,
|
803 |
+
'date' => $year.'-'.$month.'-'.$day,
|
804 |
+
'tbWidth' => $popup_width,
|
805 |
+
'tbHeight' => $popup_height
|
806 |
+
), admin_url('admin-ajax.php')) . '" ></br><b>'.$event_title.'</b></a></div>';
|
807 |
+
|
808 |
+
}
|
809 |
+
|
810 |
+
?>
|
811 |
+
|
812 |
+
<style>
|
813 |
+
<?php if($event_text==''){?>
|
814 |
+
td #event_date<?php echo $id?>
|
815 |
+
{
|
816 |
+
padding-bottom:14px;
|
817 |
+
|
818 |
+
}
|
819 |
+
<?php }?>
|
820 |
+
</style>
|
821 |
+
|
822 |
+
<?php
|
823 |
+
$activedatestr = '';
|
824 |
+
$date_format_array = explode(' ', $date_format);
|
825 |
+
|
826 |
+
for ($i = 0; $i < count($date_format_array); $i++) {
|
827 |
+
$activedatestr .= __(date("" . $date_format_array[$i] . "", strtotime($event_date)), 'sp_calendar') . ' ';
|
828 |
+
}
|
829 |
+
|
830 |
+
if($show_time==1)
|
831 |
+
echo '<div id="event_date'.$id.'">'.__($activedatestr, 'sp_calendar').'</div>';
|
832 |
+
|
833 |
+
|
834 |
+
if($show_repeat==1)
|
835 |
+
{
|
836 |
+
if($event_text=='')
|
837 |
+
{if($curr_event->repeat_method=="no_repeat")
|
838 |
+
echo '';
|
839 |
+
else
|
840 |
+
{
|
841 |
+
echo '<div id="event_repeat'.$id.'" >';
|
842 |
+
|
843 |
+
if($curr_event->repeat_method=='daily')
|
844 |
+
echo '<div >'.__('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Day', 'sp_calendar') . '</div>';
|
845 |
+
|
846 |
+
if($curr_event->repeat_method=='weekly')
|
847 |
+
|
848 |
+
{
|
849 |
+
|
850 |
+
echo '<div >'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Week(s) on', 'sp_calendar') . '</br>';
|
851 |
+
|
852 |
+
for ($g=0;$g<count($week);$g++)
|
853 |
+
|
854 |
+
{
|
855 |
+
|
856 |
+
if($week[$g]!=''){
|
857 |
+
|
858 |
+
if($g!=count($week)-2)
|
859 |
+
|
860 |
+
echo week_convert_recent($week[$g]).',';
|
861 |
+
|
862 |
+
else
|
863 |
+
|
864 |
+
echo week_convert_recent($week[$g]);
|
865 |
+
|
866 |
+
|
867 |
+
|
868 |
+
}
|
869 |
+
|
870 |
+
|
871 |
+
|
872 |
+
}
|
873 |
+
|
874 |
+
echo '</div>';
|
875 |
+
|
876 |
+
}
|
877 |
+
|
878 |
+
if($curr_event->repeat_method=='monthly' and $curr_event->month_type==1)
|
879 |
+
|
880 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Month(s) on the', 'sp_calendar') . ' '.$curr_event->month.'</div>';
|
881 |
+
|
882 |
+
if($curr_event->repeat_method=='monthly' and $curr_event->month_type==2)
|
883 |
+
|
884 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' '.$repeat.' ' . __('Month(s) on the', 'sp_calendar') . ' '.week_number_recent($curr_event->monthly_list).' '.week_convert_recent($curr_event->month_week).'</div>';
|
885 |
+
|
886 |
+
|
887 |
+
|
888 |
+
if($curr_event->repeat_method=='yearly' and $curr_event->month_type==1)
|
889 |
+
|
890 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Year(s) in', 'sp_calendar') . ' '.date('F',mktime(0,0,0,$curr_event->year_month + 1,0,0)).' '. __('on the', 'sp_calendar').' '.$curr_event->month.'</div>';
|
891 |
+
|
892 |
+
|
893 |
+
|
894 |
+
if($curr_event->repeat_method=='yearly' and $curr_event->month_type==2)
|
895 |
+
|
896 |
+
echo '<div >'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Year(s) in', 'sp_calendar') . ' '.date('F',mktime(0,0,0,$curr_event->year_month + 1,0,0)).' '. __('on the', 'sp_calendar').' '.week_number_recent($curr_event->monthly_list).' '.week_convert_recent($curr_event->month_week).'</div>';
|
897 |
+
|
898 |
+
|
899 |
+
|
900 |
+
|
901 |
+
|
902 |
+
|
903 |
+
echo '</div>';
|
904 |
+
}
|
905 |
+
|
906 |
+
}
|
907 |
+
else
|
908 |
+
{
|
909 |
+
if($curr_event->repeat_method=="no_repeat")
|
910 |
+
echo '';
|
911 |
+
else
|
912 |
+
{
|
913 |
+
echo '<div id="event_repeat'.$id.'" >';
|
914 |
+
|
915 |
+
if($curr_event->repeat_method=='daily')
|
916 |
+
echo '<div >'.__('Repeat Every', 'sp_calendar').' '.$repeat.' ' . __('Day', 'sp_calendar') . '</div>';
|
917 |
+
|
918 |
+
if($curr_event->repeat_method=='weekly')
|
919 |
+
|
920 |
+
{
|
921 |
+
|
922 |
+
echo '<div >'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Week(s) on', 'sp_calendar') . ' : ';
|
923 |
+
|
924 |
+
for ($g=0;$g<count($week);$g++)
|
925 |
+
|
926 |
+
{
|
927 |
+
|
928 |
+
if($week[$g]!=''){
|
929 |
+
|
930 |
+
if($g!=count($week)-2)
|
931 |
+
|
932 |
+
echo week_convert_recent($week[$g]).',';
|
933 |
+
|
934 |
+
else
|
935 |
+
|
936 |
+
echo week_convert_recent($week[$g]);
|
937 |
+
|
938 |
+
|
939 |
+
|
940 |
+
}
|
941 |
+
|
942 |
+
|
943 |
+
|
944 |
+
}
|
945 |
+
|
946 |
+
echo '</div>';
|
947 |
+
|
948 |
+
}
|
949 |
+
|
950 |
+
if($curr_event->repeat_method=='monthly' and $curr_event->month_type==1)
|
951 |
+
|
952 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' '.$repeat.' ' . __('Month(s) on the', 'sp_calendar') . ' '.$curr_event->month.'</div>';
|
953 |
+
|
954 |
+
|
955 |
+
|
956 |
+
if($curr_event->repeat_method=='monthly' and $curr_event->month_type==2)
|
957 |
+
|
958 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' '.$repeat.' ' . __('Month(s) on the', 'sp_calendar') . ' '.week_number_recent($curr_event->monthly_list).' '.week_convert_recent($curr_event->month_week).'</div>';
|
959 |
+
|
960 |
+
|
961 |
+
|
962 |
+
if($curr_event->repeat_method=='yearly' and $curr_event->month_type==1)
|
963 |
+
|
964 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Year(s) in', 'sp_calendar') . ' '.date('F',mktime(0,0,0,$curr_event->year_month + 1,0,0)).' '. __('on the', 'sp_calendar').' '.$curr_event->month.'</div>';
|
965 |
+
|
966 |
+
|
967 |
+
|
968 |
+
if($curr_event->repeat_method=='yearly' and $curr_event->month_type==2)
|
969 |
+
|
970 |
+
echo '<div >'. __('Repeat Every', 'sp_calendar').' '.$repeat.' ' . __('Year(s) in', 'sp_calendar') . ' '.date('F',mktime(0,0,0,$curr_event->year_month + 1,0,0)).' '. __('on the', 'sp_calendar').' '.week_number_recent($curr_event->monthly_list).' '.week_convert_recent($curr_event->month_week).'</div>';
|
971 |
+
|
972 |
+
|
973 |
+
|
974 |
+
|
975 |
+
|
976 |
+
|
977 |
+
echo '</div>';
|
978 |
+
}
|
979 |
+
}
|
980 |
+
}
|
981 |
+
if($show_eventtext==1)
|
982 |
+
{
|
983 |
+
if($event_text)
|
984 |
+
{
|
985 |
+
//var_dump($event_text);
|
986 |
+
//$length = strlen($event_text);
|
987 |
+
$text = mb_substr(html_entity_decode(strip_tags($event_text)), 0, 50);
|
988 |
+
|
989 |
+
echo '<div id="event_text'.$id.'" style="padding-bottom:14px;">'.$text;
|
990 |
+
|
991 |
+
echo '<br><a class="thickbox-preview' . $many_sp_calendar . '" id="see_more'.$id.'" style="text-decoration:none;"
|
992 |
+
href="' . add_query_arg(array(
|
993 |
+
'action' => 'spidercalendarbig',
|
994 |
+
'theme_id' => $theme_id,
|
995 |
+
'calendar_id' => $id,
|
996 |
+
'eventID' => $ev_id,
|
997 |
+
'widget' => $widget,
|
998 |
+
'TB_iframe' => 1,
|
999 |
+
'date' => $year.'-'.$month.'-'.$day,
|
1000 |
+
'tbWidth' => $popup_width,
|
1001 |
+
'tbHeight' => $popup_height
|
1002 |
+
), admin_url('admin-ajax.php')) . '" >'. __('See more', 'sp_calendar').'</a></div>';
|
1003 |
+
|
1004 |
+
|
1005 |
+
}
|
1006 |
+
}
|
1007 |
+
|
1008 |
+
|
1009 |
+
|
1010 |
+
echo '<div style="padding-top:6px"><hr id="divider'.$id.'"/></div>';
|
1011 |
+
$j++;
|
1012 |
+
echo'</div>';
|
1013 |
+
|
1014 |
+
|
1015 |
+
$p++;
|
1016 |
+
if($p==$event_from_current_day)
|
1017 |
+
break;
|
1018 |
+
}
|
1019 |
+
}
|
1020 |
+
|
1021 |
+
if($view_type==1)
|
1022 |
+
{
|
1023 |
+
|
1024 |
+
if($event_from_day_interval==0)
|
1025 |
+
{
|
1026 |
+
$st_date=date('Y-m-d');
|
1027 |
+
$en_date=date('Y-m-d', strtotime('+'.$since.' day', strtotime($st_date)));
|
1028 |
+
if($ordering==0)
|
1029 |
+
$order="ORDER BY title";
|
1030 |
+
else
|
1031 |
+
$order="ORDER BY RAND()";
|
1032 |
+
|
1033 |
+
$limit=$count;
|
1034 |
+
}
|
1035 |
+
else
|
1036 |
+
{
|
1037 |
+
$st_date=$start_day_calendar;
|
1038 |
+
$en_date=date('Y-m-d', strtotime('+'.$since1.' day', strtotime($st_date)));
|
1039 |
+
if($ordering1==0)
|
1040 |
+
$order="ORDER BY title";
|
1041 |
+
else
|
1042 |
+
$order="ORDER BY RAND()";
|
1043 |
+
$limit=$count1;
|
1044 |
+
}
|
1045 |
+
|
1046 |
+
|
1047 |
+
$query=" SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar= ".$calendar_id." AND published='1' ".$order." LIMIT 0, ".$limit;
|
1048 |
+
$evs= $wpdb->get_results($query);
|
1049 |
+
|
1050 |
+
$dates=array();
|
1051 |
+
foreach($evs as $ev)
|
1052 |
+
{
|
1053 |
+
|
1054 |
+
$st=$ev->date;
|
1055 |
+
if($ev->date_end!='0000-00-00' AND $ev->date_end!='')
|
1056 |
+
{
|
1057 |
+
$en=$ev->date_end;
|
1058 |
+
|
1059 |
+
}
|
1060 |
+
else
|
1061 |
+
{
|
1062 |
+
$en=date('Y-m-d', strtotime('+24 year', strtotime($st)));
|
1063 |
+
|
1064 |
+
}
|
1065 |
+
$date_st=explode('-',$st);
|
1066 |
+
|
1067 |
+
$date_end=explode('-',$en);
|
1068 |
+
|
1069 |
+
|
1070 |
+
$st_d= mktime(0, 0, 0, $date_st[1], $date_st[2], $date_st[0]);
|
1071 |
+
$en_d = mktime(0, 0, 0, $date_end[1], $date_end[2], $date_end[0]);
|
1072 |
+
$tarb=$en_d-$st_d;
|
1073 |
+
$weekly_array=explode(',',$ev->week);
|
1074 |
+
for($j=0; $j<=6;$j++)
|
1075 |
+
{
|
1076 |
+
if( in_array(date("D", mktime(0, 0, 0, $date_st[1], $date_st[2]+$j, $date_st[0])),$weekly_array))
|
1077 |
+
{
|
1078 |
+
|
1079 |
+
$weekdays_start[]=$date_st[2]+$j;}
|
1080 |
+
|
1081 |
+
}
|
1082 |
+
|
1083 |
+
|
1084 |
+
|
1085 |
+
if($ev->repeat_method=="no_repeat")
|
1086 |
+
{
|
1087 |
+
$dates[$ev->id][0]=$ev->date;
|
1088 |
+
}
|
1089 |
+
|
1090 |
+
///////////////////get days for daily repeat
|
1091 |
+
if($ev->repeat_method=="daily")
|
1092 |
+
{
|
1093 |
+
if($tarb<=0)
|
1094 |
+
$day_count=((($st_d-$en_d)/3600)/24)/($ev->repeat);
|
1095 |
+
else
|
1096 |
+
$day_count=((($en_d-$st_d)/3600)/24)/($ev->repeat);
|
1097 |
+
|
1098 |
+
$dates[$ev->id][0]=$ev->date;
|
1099 |
+
for($i=0;$i<$day_count;$i++)
|
1100 |
+
{
|
1101 |
+
if($ev->repeat_method=="daily")
|
1102 |
+
$dates[$ev->id][]=date('Y-m-d', strtotime('+'.($ev->repeat).' day', strtotime($dates[$ev->id][$i])));
|
1103 |
+
}
|
1104 |
+
}
|
1105 |
+
///////////////////get days for weekly repeat
|
1106 |
+
if($ev->repeat_method=="weekly")
|
1107 |
+
{
|
1108 |
+
$day_count=((($en_d-$st_d)/3600)/24)/($ev->repeat*7);
|
1109 |
+
|
1110 |
+
$d=array();
|
1111 |
+
$dat=array();
|
1112 |
+
for($j=0;$j<count($weekdays_start);$j++)
|
1113 |
+
{
|
1114 |
+
|
1115 |
+
unset($dat);
|
1116 |
+
$dat[0]=$date_st[0].'-'.$date_st[1].'-'.add_00($weekdays_start[$j]);
|
1117 |
+
|
1118 |
+
|
1119 |
+
for($i=0;$i<$day_count-1;$i++)
|
1120 |
+
{
|
1121 |
+
$dat[]=date('Y-m-d', strtotime('+'.($ev->repeat).' week', strtotime($dat[$i])));
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
|
1125 |
+
$d=array_merge($d,$dat);
|
1126 |
+
}
|
1127 |
+
|
1128 |
+
sort($d);
|
1129 |
+
$dates[$ev->id]=$d;
|
1130 |
+
}
|
1131 |
+
|
1132 |
+
///////////////////get days for monthly repeat
|
1133 |
+
if($ev->repeat_method=="monthly")
|
1134 |
+
{
|
1135 |
+
|
1136 |
+
$start_date = strtotime($ev->date);
|
1137 |
+
$end_date = strtotime($en);
|
1138 |
+
$min_date = min($start_date, $end_date);
|
1139 |
+
$max_date = max($start_date, $end_date);
|
1140 |
+
$month_count = 0;
|
1141 |
+
|
1142 |
+
while (($min_date = strtotime("+1 MONTH", $min_date)) <= $max_date) {
|
1143 |
+
$month_count++;
|
1144 |
+
}
|
1145 |
+
|
1146 |
+
$month_days = date('t',mktime(0, 0, 0, $date_st[1], 1, $date_st[0]));
|
1147 |
+
|
1148 |
+
if($ev->month_type==1)
|
1149 |
+
{
|
1150 |
+
$dates[$ev->id][0]=$date_st[0].'-'.$date_st[1].'-'.add_00($ev->month);
|
1151 |
+
|
1152 |
+
}
|
1153 |
+
else
|
1154 |
+
{
|
1155 |
+
if($ev->monthly_list!='last'){
|
1156 |
+
for($j=$ev->monthly_list; $j<$ev->monthly_list+7;$j++)
|
1157 |
+
{
|
1158 |
+
if(date("D", mktime(0, 0, 0, $date_st[1], $j, $date_st[0])) == $ev->month_week)
|
1159 |
+
{
|
1160 |
+
|
1161 |
+
|
1162 |
+
$dates[$ev->id][0]=$date_st[0].'-'.$date_st[1].'-'.add_00($j);
|
1163 |
+
|
1164 |
+
|
1165 |
+
}
|
1166 |
+
}
|
1167 |
+
}
|
1168 |
+
else
|
1169 |
+
{
|
1170 |
+
for($j=1; $j<=$month_days;$j++)
|
1171 |
+
{
|
1172 |
+
if(date("D", mktime(0, 0, 0, $date_st[1], $j, $date_st[0])) == $ev->month_week)
|
1173 |
+
{
|
1174 |
+
$dates[$ev->id][0]=$date_st[0].'-'.$date_st[1].'-'.add_00($j);
|
1175 |
+
|
1176 |
+
}
|
1177 |
+
|
1178 |
+
}
|
1179 |
+
}
|
1180 |
+
|
1181 |
+
|
1182 |
+
}
|
1183 |
+
|
1184 |
+
for($i=0;$i<$month_count;$i++)
|
1185 |
+
{
|
1186 |
+
$mon=date('F', strtotime('+'.($ev->repeat).' month', strtotime($dates[$ev->id][$i])));
|
1187 |
+
$year=date('Y', strtotime('+'.($ev->repeat).' month', strtotime($dates[$ev->id][$i])));
|
1188 |
+
|
1189 |
+
date('Y-m-d', strtotime(''.num_to_str($ev->monthly_list).' '.$ev->month_week.' of '.$mon.' '.$year.''));
|
1190 |
+
|
1191 |
+
if($ev->month_type==1)
|
1192 |
+
$dates[$ev->id][]=date('Y-m-d', strtotime('+'.($ev->repeat).' month', strtotime($dates[$ev->id][$i])));
|
1193 |
+
else
|
1194 |
+
{
|
1195 |
+
$mon=date('F', strtotime('+'.($ev->repeat).' month', strtotime($dates[$ev->id][$i])));
|
1196 |
+
$year=date('Y', strtotime('+'.($ev->repeat).' month', strtotime($dates[$ev->id][$i])));
|
1197 |
+
$dates[$ev->id][]=date('Y-m-d', strtotime(''.num_to_str($ev->monthly_list).' '.$ev->month_week.' of '.$mon.' '.$year.''));
|
1198 |
+
}
|
1199 |
+
}
|
1200 |
+
|
1201 |
+
|
1202 |
+
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
|
1206 |
+
if($ev->repeat_method=="yearly")
|
1207 |
+
{
|
1208 |
+
|
1209 |
+
$start_date = strtotime($ev->date);
|
1210 |
+
$end_date = strtotime($en);
|
1211 |
+
$min_date = min($start_date, $end_date);
|
1212 |
+
$max_date = max($start_date, $end_date);
|
1213 |
+
$year_count = 0;
|
1214 |
+
|
1215 |
+
while (($min_date = strtotime("+1 year", $min_date)) <= $max_date) {
|
1216 |
+
$year_count++;
|
1217 |
+
}
|
1218 |
+
|
1219 |
+
$month_days = date('t',mktime(0, 0, 0, add_00($ev->year_month), 1, $date_st[0]));
|
1220 |
+
|
1221 |
+
if($ev->month_type==1)
|
1222 |
+
{
|
1223 |
+
$dates[$ev->id][0]=$date_st[0].'-'.add_00($ev->year_month).'-'.add_00($ev->month);
|
1224 |
+
|
1225 |
+
}
|
1226 |
+
else
|
1227 |
+
{
|
1228 |
+
if($ev->monthly_list!='last'){
|
1229 |
+
for($j=$ev->monthly_list; $j<$ev->monthly_list+7;$j++)
|
1230 |
+
{
|
1231 |
+
if(date("D", mktime(0, 0, 0, add_00($ev->year_month), $j, $date_st[0])) == $ev->month_week)
|
1232 |
+
{
|
1233 |
+
|
1234 |
+
|
1235 |
+
$dates[$ev->id][0]=$date_st[0].'-'.add_00($ev->year_month).'-'.add_00($j);
|
1236 |
+
|
1237 |
+
|
1238 |
+
}
|
1239 |
+
}
|
1240 |
+
}
|
1241 |
+
else
|
1242 |
+
{
|
1243 |
+
for($j=1; $j<=$month_days;$j++)
|
1244 |
+
{
|
1245 |
+
if(date("D", mktime(0, 0, 0, add_00($ev->year_month), $j, $date_st[0])) == $ev->month_week)
|
1246 |
+
{
|
1247 |
+
$dates[$ev->id][0]=$date_st[0].'-'.add_00($ev->year_month).'-'.add_00($j);
|
1248 |
+
|
1249 |
+
}
|
1250 |
+
|
1251 |
+
}
|
1252 |
+
}
|
1253 |
+
|
1254 |
+
|
1255 |
+
}
|
1256 |
+
|
1257 |
+
for($i=0;$i<$year_count;$i++)
|
1258 |
+
{
|
1259 |
+
|
1260 |
+
|
1261 |
+
if($ev->month_type==1)
|
1262 |
+
$dates[$ev->id][]=date('Y-m-d', strtotime('+'.($ev->repeat).' year', strtotime($dates[$ev->id][$i])));
|
1263 |
+
else
|
1264 |
+
{
|
1265 |
+
$mon=date('F', strtotime('+'.($ev->repeat).' year', strtotime($dates[$ev->id][$i])));
|
1266 |
+
$year=date('Y', strtotime('+'.($ev->repeat).' year', strtotime($dates[$ev->id][$i])));
|
1267 |
+
$dates[$ev->id][]=date('Y-m-d', strtotime(''.num_to_str($ev->monthly_list).' '.$ev->month_week.' of '.$mon.' '.$year.''));
|
1268 |
+
}
|
1269 |
+
}
|
1270 |
+
|
1271 |
+
|
1272 |
+
|
1273 |
+
}
|
1274 |
+
|
1275 |
+
|
1276 |
+
sort($dates[$ev->id]);
|
1277 |
+
|
1278 |
+
}
|
1279 |
+
|
1280 |
+
|
1281 |
+
foreach($dates as $ev_id=>$date )
|
1282 |
+
{
|
1283 |
+
//echo compare_str_to_array($st_date,$date,$en_date). ' ';
|
1284 |
+
|
1285 |
+
$gag[$ev_id]=compare_str_to_array($st_date,$date,$en_date);
|
1286 |
+
}
|
1287 |
+
|
1288 |
+
if($ordering==0 or $ordering1==0)
|
1289 |
+
$dates=sorrt($st_date,$dates,$en_date);
|
1290 |
+
|
1291 |
+
|
1292 |
+
|
1293 |
+
$i=1;
|
1294 |
+
$j=0;
|
1295 |
+
|
1296 |
+
$p=0;
|
1297 |
+
|
1298 |
+
|
1299 |
+
foreach($dates as $ev_id=>$date)
|
1300 |
+
{
|
1301 |
+
|
1302 |
+
if(true)
|
1303 |
+
{
|
1304 |
+
|
1305 |
+
$query0=" SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE id=".$ev_id;
|
1306 |
+
$curr_event1 = $wpdb->get_results($query0);
|
1307 |
+
$order_event_current_day=$curr_event1[0];
|
1308 |
+
|
1309 |
+
$event_id = $order_event_current_day->id;
|
1310 |
+
$event_title = $order_event_current_day->title;
|
1311 |
+
$event_date =compare_str_to_array($st_date,$date,$en_date);
|
1312 |
+
$event_end_date = $order_event_current_day->date_end;
|
1313 |
+
$event_text = $order_event_current_day->text_for_date;
|
1314 |
+
$calendar_id = $order_event_current_day->calendar;
|
1315 |
+
$repeat = $order_event_current_day->repeat;
|
1316 |
+
|
1317 |
+
$year=substr($event_date,0,4);
|
1318 |
+
$month=substr($event_date,5,-3);
|
1319 |
+
$day=substr($event_date,8);
|
1320 |
+
|
1321 |
+
|
1322 |
+
|
1323 |
+
$week=explode(',',$order_event_current_day->week);
|
1324 |
+
|
1325 |
+
|
1326 |
+
echo '<div id="event_table'.$id.'" >';
|
1327 |
+
if($show_numbering==1)
|
1328 |
+
{
|
1329 |
+
echo '<div style="padding-top:14px;" class="pad"><a id= "title'.$id.'" class="thickbox-preview' . $many_sp_calendar . '"
|
1330 |
+
href="' . add_query_arg(array(
|
1331 |
+
'action' => 'spidercalendarbig',
|
1332 |
+
'theme_id' => $theme_id,
|
1333 |
+
'calendar_id' => $id,
|
1334 |
+
'eventID' => $ev_id,
|
1335 |
+
'widget' => $widget,
|
1336 |
+
'TB_iframe' => 1,
|
1337 |
+
'date' => $year.'-'.$month.'-'.$day,
|
1338 |
+
'tbWidth' => $popup_width,
|
1339 |
+
'tbHeight' => $popup_height
|
1340 |
+
), admin_url('admin-ajax.php')) . '" ><b>'. $i++.'.'.$event_title.'</b></a></div>';
|
1341 |
+
}
|
1342 |
+
else
|
1343 |
+
{
|
1344 |
+
echo '<div style="padding-top:14px;" class="pad" ><a id="title'.$id.'" class="thickbox-preview' . $many_sp_calendar . '"
|
1345 |
+
href="' . add_query_arg(array(
|
1346 |
+
'action' => 'spidercalendarbig',
|
1347 |
+
'theme_id' => $theme_id,
|
1348 |
+
'calendar_id' => $id,
|
1349 |
+
'eventID' => $ev_id,
|
1350 |
+
'widget' => $widget,
|
1351 |
+
'TB_iframe' => 1,
|
1352 |
+
'date' => $year.'-'.$month.'-'.$day,
|
1353 |
+
'tbWidth' => $popup_width,
|
1354 |
+
'tbHeight' => $popup_height
|
1355 |
+
), admin_url('admin-ajax.php')) . '" ><b>'.$event_title.'</b></a></div>';
|
1356 |
+
}
|
1357 |
+
|
1358 |
+
?>
|
1359 |
+
|
1360 |
+
<style>
|
1361 |
+
<?php if($event_text==''){?>
|
1362 |
+
td #event_date<?php echo $id?>
|
1363 |
+
{
|
1364 |
+
padding-bottom:14px;
|
1365 |
+
|
1366 |
+
}
|
1367 |
+
<?php }?>
|
1368 |
+
</style>
|
1369 |
+
|
1370 |
+
<?php
|
1371 |
+
|
1372 |
+
$activedatestr = '';
|
1373 |
+
$date_format_array = explode(' ', $date_format);
|
1374 |
+
|
1375 |
+
for ($i = 0; $i < count($date_format_array); $i++) {
|
1376 |
+
$activedatestr .= __(date("" . $date_format_array[$i] . "", strtotime($event_date)), 'sp_calendar') . ' ';
|
1377 |
+
}
|
1378 |
+
|
1379 |
+
if($show_time==1)
|
1380 |
+
echo '<div id="event_date'.$id.'">'.__($activedatestr, 'sp_calendar').'</div>';
|
1381 |
+
|
1382 |
+
if($show_repeat==1)
|
1383 |
+
{
|
1384 |
+
|
1385 |
+
if($order_event_current_day->repeat_method=="no_repeat")
|
1386 |
+
echo '';
|
1387 |
+
else
|
1388 |
+
{
|
1389 |
+
echo '<div id="event_repeat'.$id.'" >';
|
1390 |
+
|
1391 |
+
if($order_event_current_day->repeat_method=='daily')
|
1392 |
+
echo '<div >'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Day', 'sp_calendar') . '</div>';
|
1393 |
+
|
1394 |
+
if($order_event_current_day->repeat_method=='weekly')
|
1395 |
+
|
1396 |
+
{
|
1397 |
+
|
1398 |
+
echo '<div >'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Week(s) on', 'sp_calendar') . ' : ';
|
1399 |
+
|
1400 |
+
for ($g=0;$g<count($week);$g++)
|
1401 |
+
|
1402 |
+
{
|
1403 |
+
|
1404 |
+
if($week[$g]!=''){
|
1405 |
+
|
1406 |
+
if($g!=count($week)-2)
|
1407 |
+
|
1408 |
+
echo week_convert_recent($week[$g]).',';
|
1409 |
+
|
1410 |
+
else
|
1411 |
+
|
1412 |
+
echo week_convert_recent($week[$g]);
|
1413 |
+
|
1414 |
+
|
1415 |
+
|
1416 |
+
}
|
1417 |
+
|
1418 |
+
|
1419 |
+
|
1420 |
+
}
|
1421 |
+
|
1422 |
+
echo '</div>';
|
1423 |
+
|
1424 |
+
}
|
1425 |
+
|
1426 |
+
if($order_event_current_day->repeat_method=='monthly' and $order_event_current_day->month_type==1)
|
1427 |
+
|
1428 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' '. __('Month(s) on the', 'sp_calendar').' '.$order_event_current_day->month.'</div>';
|
1429 |
+
|
1430 |
+
|
1431 |
+
|
1432 |
+
if($order_event_current_day->repeat_method=='monthly' and $order_event_current_day->month_type==2)
|
1433 |
+
|
1434 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' '.$repeat.' '. __('Month(s) on the', 'sp_calendar').' '.week_number_recent($order_event_current_day->monthly_list).' '.week_convert_recent($order_event_current_day->month_week).'</div>';
|
1435 |
+
|
1436 |
+
|
1437 |
+
|
1438 |
+
if($order_event_current_day->repeat_method=='yearly' and $order_event_current_day->month_type==1)
|
1439 |
+
|
1440 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Year(s) in', 'sp_calendar') . ' '.date('F',mktime(0,0,0,$order_event_current_day->year_month + 1,0,0)).' '. __('on the', 'sp_calendar').' '.$order_event_current_day->month.'</div>';
|
1441 |
+
|
1442 |
+
|
1443 |
+
|
1444 |
+
if($order_event_current_day->repeat_method=='yearly' and $order_event_current_day->month_type==2)
|
1445 |
+
|
1446 |
+
echo '<div >'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Year(s) in', 'sp_calendar') . ' '.date('F',mktime(0,0,0,$order_event_current_day->year_month + 1,0,0)).' '. __('on the', 'sp_calendar').' '.week_number_recent($order_event_current_day->monthly_list).' '.week_convert_recent($order_event_current_day->month_week).'</div>';
|
1447 |
+
|
1448 |
+
|
1449 |
+
|
1450 |
+
|
1451 |
+
|
1452 |
+
|
1453 |
+
echo '</div>';
|
1454 |
+
}
|
1455 |
+
|
1456 |
+
|
1457 |
+
}
|
1458 |
+
if($show_eventtext==1)
|
1459 |
+
{
|
1460 |
+
|
1461 |
+
if($event_text)
|
1462 |
+
{
|
1463 |
+
$text = mb_substr(html_entity_decode(strip_tags($event_text)), 0, 50);
|
1464 |
+
|
1465 |
+
echo '<div id="event_text'.$id.'" >'.$text;
|
1466 |
+
echo '<br><a class="thickbox-preview' . $many_sp_calendar . '" id="see_more'.$id.'" style="text-decoration:none;"
|
1467 |
+
href="' . add_query_arg(array(
|
1468 |
+
'action' => 'spidercalendarbig',
|
1469 |
+
'theme_id' => $theme_id,
|
1470 |
+
'calendar_id' => $id,
|
1471 |
+
'eventID' => $ev_id,
|
1472 |
+
'widget' => $widget,
|
1473 |
+
'TB_iframe' => 1,
|
1474 |
+
'date' => $year.'-'.$month.'-'.$day,
|
1475 |
+
'tbWidth' => $popup_width,
|
1476 |
+
'tbHeight' => $popup_height
|
1477 |
+
), admin_url('admin-ajax.php')) . '" >'. __('See more', 'sp_calendar').'</a></div>';
|
1478 |
+
|
1479 |
+
}
|
1480 |
+
}
|
1481 |
+
|
1482 |
+
|
1483 |
+
echo '<div style="padding-top:6px"><hr id="divider'.$id.'"/></div>';
|
1484 |
+
$j++;
|
1485 |
+
echo'</div>';
|
1486 |
+
}
|
1487 |
+
|
1488 |
+
$p++;
|
1489 |
+
if($p==$limit)
|
1490 |
+
break;
|
1491 |
+
}
|
1492 |
+
|
1493 |
+
|
1494 |
+
}
|
1495 |
+
|
1496 |
+
if($view_type==2){
|
1497 |
+
$events_id=explode(',',$event_select);
|
1498 |
+
|
1499 |
+
$events_id= array_slice($events_id,1, count($events_id)-2);
|
1500 |
+
|
1501 |
+
|
1502 |
+
if(!empty($events_id)) {
|
1503 |
+
foreach($events_id as $event_id)
|
1504 |
+
{
|
1505 |
+
|
1506 |
+
$query ="SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE id=".$event_id;
|
1507 |
+
$events[] = $wpdb->get_row($query);
|
1508 |
+
|
1509 |
+
}
|
1510 |
+
|
1511 |
+
$dates=array();
|
1512 |
+
|
1513 |
+
|
1514 |
+
foreach($events as $ev)
|
1515 |
+
{
|
1516 |
+
$st=$ev->date;
|
1517 |
+
|
1518 |
+
if($ev->date_end!='0000-00-00')
|
1519 |
+
$en=$ev->date_end;
|
1520 |
+
else
|
1521 |
+
$en=date('Y-m-d', strtotime('+24 year', strtotime($st)));
|
1522 |
+
|
1523 |
+
$date_st=explode('-',$st);
|
1524 |
+
|
1525 |
+
$date_end=explode('-',$en);
|
1526 |
+
|
1527 |
+
|
1528 |
+
$st_d= mktime(0, 0, 0, $date_st[1], $date_st[2], $date_st[0]);
|
1529 |
+
$en_d = mktime(0, 0, 0, $date_end[1], $date_end[2], $date_end[0]);
|
1530 |
+
$tarb=$en_d-$st_d;
|
1531 |
+
$weekly_array=explode(',',$ev->week);
|
1532 |
+
|
1533 |
+
for($j=0; $j<=6;$j++)
|
1534 |
+
{
|
1535 |
+
if( in_array(date("D", mktime(0, 0, 0, $date_st[1], $date_st[2]+$j, $date_st[0])),$weekly_array))
|
1536 |
+
{
|
1537 |
+
|
1538 |
+
$weekdays_start[]=$date_st[2]+$j;}
|
1539 |
+
}
|
1540 |
+
|
1541 |
+
|
1542 |
+
|
1543 |
+
if($ev->repeat_method=="no_repeat")
|
1544 |
+
{
|
1545 |
+
$dates[$ev->id][0]=$ev->date;
|
1546 |
+
}
|
1547 |
+
|
1548 |
+
///////////////////get days for daily repeat
|
1549 |
+
if($ev->repeat_method=="daily")
|
1550 |
+
{
|
1551 |
+
if($tarb<=0)
|
1552 |
+
$day_count=((($st_d-$en_d)/3600)/24)/($ev->repeat);
|
1553 |
+
else
|
1554 |
+
$day_count=((($en_d-$st_d)/3600)/24)/($ev->repeat);
|
1555 |
+
|
1556 |
+
$dates[$ev->id][0]=$ev->date;
|
1557 |
+
|
1558 |
+
}
|
1559 |
+
///////////////////get days for weekly repeat
|
1560 |
+
if($ev->repeat_method=="weekly")
|
1561 |
+
{
|
1562 |
+
$day_count=((($en_d-$st_d)/3600)/24)/($ev->repeat*7);
|
1563 |
+
|
1564 |
+
$d=array();
|
1565 |
+
$dat=array();
|
1566 |
+
for($j=0;$j<count($weekdays_start);$j++)
|
1567 |
+
{
|
1568 |
+
|
1569 |
+
unset($dat);
|
1570 |
+
$dat[]=$date_st[0].'-'.$date_st[1].'-'.add_00($weekdays_start[$j]);
|
1571 |
+
|
1572 |
+
|
1573 |
+
|
1574 |
+
|
1575 |
+
$d=array_merge($d,$dat);
|
1576 |
+
}
|
1577 |
+
|
1578 |
+
sort($d);
|
1579 |
+
$dates[$ev->id]=$d;
|
1580 |
+
|
1581 |
+
}
|
1582 |
+
///////////////////get days for monthly repeat
|
1583 |
+
if($ev->repeat_method=="monthly")
|
1584 |
+
{
|
1585 |
+
|
1586 |
+
$start_date = strtotime($ev->date);
|
1587 |
+
$end_date = strtotime($en);
|
1588 |
+
$min_date = min($start_date, $end_date);
|
1589 |
+
$max_date = max($start_date, $end_date);
|
1590 |
+
$month_count = 0;
|
1591 |
+
|
1592 |
+
while (($min_date = strtotime("+1 MONTH", $min_date)) <= $max_date) {
|
1593 |
+
$month_count++;
|
1594 |
+
}
|
1595 |
+
|
1596 |
+
$month_days = date('t',mktime(0, 0, 0, $date_st[1], 1, $date_st[0]));
|
1597 |
+
|
1598 |
+
if($ev->month_type==1)
|
1599 |
+
{
|
1600 |
+
$dates[$ev->id][0]=$date_st[0].'-'.$date_st[1].'-'.add_00($ev->month);
|
1601 |
+
|
1602 |
+
}
|
1603 |
+
else
|
1604 |
+
{
|
1605 |
+
if($ev->monthly_list!='last'){
|
1606 |
+
for($j=$ev->monthly_list; $j<$ev->monthly_list+7;$j++)
|
1607 |
+
{
|
1608 |
+
if(date("D", mktime(0, 0, 0, $date_st[1], $j, $date_st[0])) == $ev->month_week)
|
1609 |
+
{
|
1610 |
+
|
1611 |
+
|
1612 |
+
$dates[$ev->id][0]=$date_st[0].'-'.$date_st[1].'-'.add_00($j);
|
1613 |
+
|
1614 |
+
|
1615 |
+
}
|
1616 |
+
}
|
1617 |
+
}
|
1618 |
+
else
|
1619 |
+
{
|
1620 |
+
for($j=1; $j<=$month_days;$j++)
|
1621 |
+
{
|
1622 |
+
if(date("D", mktime(0, 0, 0, $date_st[1], $j, $date_st[0])) == $ev->month_week)
|
1623 |
+
{
|
1624 |
+
$dates[$ev->id][0]=$date_st[0].'-'.$date_st[1].'-'.add_00($j);
|
1625 |
+
|
1626 |
+
}
|
1627 |
+
|
1628 |
+
}
|
1629 |
+
}
|
1630 |
+
|
1631 |
+
|
1632 |
+
}
|
1633 |
+
|
1634 |
+
|
1635 |
+
|
1636 |
+
|
1637 |
+
|
1638 |
+
}
|
1639 |
+
|
1640 |
+
|
1641 |
+
if($ev->repeat_method=="yearly")
|
1642 |
+
{
|
1643 |
+
|
1644 |
+
$start_date = strtotime($ev->date);
|
1645 |
+
$end_date = strtotime($en);
|
1646 |
+
$min_date = min($start_date, $end_date);
|
1647 |
+
$max_date = max($start_date, $end_date);
|
1648 |
+
$year_count = 0;
|
1649 |
+
|
1650 |
+
while (($min_date = strtotime("+1 year", $min_date)) <= $max_date) {
|
1651 |
+
$year_count++;
|
1652 |
+
}
|
1653 |
+
|
1654 |
+
$month_days = date('t',mktime(0, 0, 0, add_00($ev->year_month), 1, $date_st[0]));
|
1655 |
+
|
1656 |
+
if($ev->month_type==1)
|
1657 |
+
{
|
1658 |
+
$dates[$ev->id][0]=$date_st[0].'-'.add_00($ev->year_month).'-'.add_00($ev->month);
|
1659 |
+
|
1660 |
+
}
|
1661 |
+
else
|
1662 |
+
{
|
1663 |
+
if($ev->monthly_list!='last'){
|
1664 |
+
for($j=$ev->monthly_list; $j<$ev->monthly_list+7;$j++)
|
1665 |
+
{
|
1666 |
+
if(date("D", mktime(0, 0, 0, add_00($ev->year_month), $j, $date_st[0])) == $ev->month_week)
|
1667 |
+
{
|
1668 |
+
|
1669 |
+
|
1670 |
+
$dates[$ev->id][0]=$date_st[0].'-'.add_00($ev->year_month).'-'.add_00($j);
|
1671 |
+
|
1672 |
+
|
1673 |
+
}
|
1674 |
+
}
|
1675 |
+
}
|
1676 |
+
else
|
1677 |
+
{
|
1678 |
+
for($j=1; $j<=$month_days;$j++)
|
1679 |
+
{
|
1680 |
+
if(date("D", mktime(0, 0, 0, add_00($ev->year_month), $j, $date_st[0])) == $ev->month_week)
|
1681 |
+
{
|
1682 |
+
$dates[$ev->id][0]=$date_st[0].'-'.add_00($ev->year_month).'-'.add_00($j);
|
1683 |
+
|
1684 |
+
}
|
1685 |
+
|
1686 |
+
}
|
1687 |
+
}
|
1688 |
+
|
1689 |
+
|
1690 |
+
|
1691 |
+
}
|
1692 |
+
|
1693 |
+
|
1694 |
+
|
1695 |
+
|
1696 |
+
|
1697 |
+
}
|
1698 |
+
|
1699 |
+
|
1700 |
+
sort($dates[$ev->id]);
|
1701 |
+
|
1702 |
+
}
|
1703 |
+
|
1704 |
+
$i=1;
|
1705 |
+
$j=0;
|
1706 |
+
$ev=0;
|
1707 |
+
|
1708 |
+
foreach ($dates as $ev_id=>$date)
|
1709 |
+
{
|
1710 |
+
|
1711 |
+
|
1712 |
+
$events = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE id='.$ev_id);
|
1713 |
+
|
1714 |
+
$event=$events[0];
|
1715 |
+
|
1716 |
+
$event_id = $event->id;
|
1717 |
+
$event_title = $event->title;
|
1718 |
+
$event_date =$date[0];
|
1719 |
+
$event_end_date = $event->date_end;
|
1720 |
+
$event_text = $event->text_for_date;
|
1721 |
+
$calendar_id = $event->calendar;
|
1722 |
+
$repeat = $event->repeat;
|
1723 |
+
|
1724 |
+
$published = $event->published;
|
1725 |
+
$year=substr($event_date,0,4);
|
1726 |
+
$month=substr($event_date,5,-3);
|
1727 |
+
$day=substr($event_date,8);
|
1728 |
+
|
1729 |
+
if( $published == 1){
|
1730 |
+
echo '<div id="event_table'.$id.'" >';
|
1731 |
+
if($show_numbering==1)
|
1732 |
+
{
|
1733 |
+
echo '<div style="padding-top:0px;" class="pad"><a id="title'.$id.'" class="thickbox-preview' . $many_sp_calendar . '"
|
1734 |
+
href="' . add_query_arg(array(
|
1735 |
+
'action' => 'spidercalendarbig',
|
1736 |
+
'theme_id' => $theme_id,
|
1737 |
+
'calendar_id' => $id,
|
1738 |
+
'eventID' => $ev_id,
|
1739 |
+
'widget' => $widget,
|
1740 |
+
'date' => $year.'-'.$month.'-'.$day,
|
1741 |
+
'TB_iframe' => 1,
|
1742 |
+
'tbWidth' => $popup_width,
|
1743 |
+
'tbHeight' => $popup_height
|
1744 |
+
), admin_url('admin-ajax.php')) . '" ></br><b>'. $i++.'.'.$event_title.'</b></a></div>';
|
1745 |
+
}
|
1746 |
+
else
|
1747 |
+
{
|
1748 |
+
echo '<div style="padding-top:0px;" class="pad"><a id="title'.$id.'" class="thickbox-preview' . $many_sp_calendar . '"
|
1749 |
+
href="' . add_query_arg(array(
|
1750 |
+
'action' => 'spidercalendarbig',
|
1751 |
+
'theme_id' => $theme_id,
|
1752 |
+
'calendar_id' => $id,
|
1753 |
+
'eventID' => $ev_id,
|
1754 |
+
'widget' => $widget,
|
1755 |
+
'date' => $year.'-'.$month.'-'.$day,
|
1756 |
+
'TB_iframe' => 1,
|
1757 |
+
'tbWidth' => $popup_width,
|
1758 |
+
'tbHeight' => $popup_height
|
1759 |
+
), admin_url('admin-ajax.php')) . '" ></br><b>'.$event_title.'</b></a></div>';
|
1760 |
+
}
|
1761 |
+
|
1762 |
+
?>
|
1763 |
+
|
1764 |
+
<style>
|
1765 |
+
<?php if($event_text==''){?>
|
1766 |
+
td #event_date<?php echo $id?>
|
1767 |
+
{
|
1768 |
+
padding-bottom:14px;
|
1769 |
+
|
1770 |
+
}
|
1771 |
+
<?php }?>
|
1772 |
+
</style>
|
1773 |
+
|
1774 |
+
<?php
|
1775 |
+
|
1776 |
+
if($repeat==1)
|
1777 |
+
$repeat="";
|
1778 |
+
|
1779 |
+
$activedatestr = '';
|
1780 |
+
$date_format_array = explode(' ', $date_format);
|
1781 |
+
|
1782 |
+
for ($i = 0; $i < count($date_format_array); $i++) {
|
1783 |
+
$activedatestr .= __(date("" . $date_format_array[$i] . "", strtotime($event_date)), 'sp_calendar') . ' ';
|
1784 |
+
}
|
1785 |
+
|
1786 |
+
if($show_time==1)
|
1787 |
+
echo '<div id="event_date'.$id.'">'.__($activedatestr, 'sp_calendar').'</div>';
|
1788 |
+
|
1789 |
+
if($show_repeat==1)
|
1790 |
+
{
|
1791 |
+
|
1792 |
+
if($event->repeat_method=="no_repeat")
|
1793 |
+
echo '';
|
1794 |
+
else
|
1795 |
+
{
|
1796 |
+
echo '<div id="event_repeat'.$id.'" >';
|
1797 |
+
|
1798 |
+
if($event->repeat_method=='daily')
|
1799 |
+
echo '<div >'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Day', 'sp_calendar') . '</div>';
|
1800 |
+
|
1801 |
+
if($event->repeat_method=='weekly')
|
1802 |
+
|
1803 |
+
{
|
1804 |
+
|
1805 |
+
echo '<div >'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Week(s) on', 'sp_calendar') . ' : ';
|
1806 |
+
|
1807 |
+
$week=explode(',',$event->week);
|
1808 |
+
for ($g=0;$g<count($week);$g++)
|
1809 |
+
|
1810 |
+
{
|
1811 |
+
|
1812 |
+
if($week[$g]!=''){
|
1813 |
+
|
1814 |
+
if($g!=count($week)-2)
|
1815 |
+
|
1816 |
+
echo week_convert_recent($week[$g]).',';
|
1817 |
+
|
1818 |
+
else
|
1819 |
+
|
1820 |
+
echo week_convert_recent($week[$g]);
|
1821 |
+
|
1822 |
+
|
1823 |
+
|
1824 |
+
}
|
1825 |
+
|
1826 |
+
|
1827 |
+
|
1828 |
+
}
|
1829 |
+
|
1830 |
+
echo '</div>';
|
1831 |
+
|
1832 |
+
}
|
1833 |
+
|
1834 |
+
if($event->repeat_method=='monthly' and $event->month_type==1)
|
1835 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' '.__('Month(s) on the', 'sp_calendar').' '.$event->month.'</div>';
|
1836 |
+
|
1837 |
+
|
1838 |
+
|
1839 |
+
if($event->repeat_method=='monthly' and $event->month_type==2)
|
1840 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' '.$repeat.' '.__('Month(s) on the', 'sp_calendar').' '.week_number_recent($event->monthly_list).' '.week_convert_recent($event->month_week).'</div>';
|
1841 |
+
|
1842 |
+
|
1843 |
+
|
1844 |
+
if($event->repeat_method=='yearly' and $event->month_type==1)
|
1845 |
+
echo '<div>'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Year(s) in', 'sp_calendar') . ' '.date('F',mktime(0,0,0,$event->year_month + 1,0,0)).' '. __('on the', 'sp_calendar').' '.$event->month.'</div>';
|
1846 |
+
|
1847 |
+
|
1848 |
+
|
1849 |
+
if($event->repeat_method=='yearly' and $event->month_type==2)
|
1850 |
+
echo '<div >'. __('Repeat Every', 'sp_calendar').' ' .$repeat.' ' . __('Year(s) in', 'sp_calendar') . ' '.date('F',mktime(0,0,0,$event->year_month + 1,0,0)).' '. __('on the', 'sp_calendar').' '.week_number_recent($event->monthly_list).' '.week_convert_recent($event->month_week).'</div>';
|
1851 |
+
|
1852 |
+
|
1853 |
+
|
1854 |
+
|
1855 |
+
|
1856 |
+
|
1857 |
+
echo '</div>';
|
1858 |
+
}
|
1859 |
+
|
1860 |
+
|
1861 |
+
}
|
1862 |
+
if($show_eventtext==1)
|
1863 |
+
{
|
1864 |
+
|
1865 |
+
if($event_text)
|
1866 |
+
{
|
1867 |
+
|
1868 |
+
//$length = strlen($event_text);
|
1869 |
+
$text = mb_substr(html_entity_decode(strip_tags($event_text)), 0, 50);
|
1870 |
+
|
1871 |
+
echo '<div id="event_text'.$id.'"><span>'.$text.'</span><br>';
|
1872 |
+
echo '<a class="thickbox-preview' . $many_sp_calendar . '" id="see_more'.$id.'" style="text-decoration:none;"
|
1873 |
+
href="' . add_query_arg(array(
|
1874 |
+
'action' => 'spidercalendarbig',
|
1875 |
+
'theme_id' => $theme_id,
|
1876 |
+
'calendar_id' => $id,
|
1877 |
+
'eventID' => $ev_id,
|
1878 |
+
'widget' => $widget,
|
1879 |
+
'TB_iframe' => 1,
|
1880 |
+
'date' => $year.'-'.$month.'-'.$day,
|
1881 |
+
'tbWidth' => $popup_width,
|
1882 |
+
'tbHeight' => $popup_height
|
1883 |
+
), admin_url('admin-ajax.php')) . '" >'.__('See more', 'sp_calendar').'</a></div>';
|
1884 |
+
|
1885 |
+
}
|
1886 |
+
}
|
1887 |
+
|
1888 |
+
|
1889 |
+
echo '<div style="padding-top:6px"><hr id="divider'.$id.'"/></div>';
|
1890 |
+
$j++;
|
1891 |
+
echo'</div>';
|
1892 |
+
}
|
1893 |
+
|
1894 |
+
$ev++;
|
1895 |
+
}
|
1896 |
+
|
1897 |
+
|
1898 |
+
}
|
1899 |
+
}
|
1900 |
+
?>
|
1901 |
+
|
1902 |
+
|
1903 |
+
<?php
|
1904 |
+
|
1905 |
+
|
1906 |
+
echo '</div>';
|
1907 |
+
// After widget //
|
1908 |
+
echo $after_widget;
|
1909 |
+
}
|
1910 |
+
|
1911 |
+
// Update Settings //
|
1912 |
+
function update($new_instance, $old_instance) {
|
1913 |
+
$instance['title'] = strip_tags($new_instance['title']);
|
1914 |
+
$instance['calendar'] = $new_instance['calendar'];
|
1915 |
+
$instance['view_type'] = $new_instance['view_type'];
|
1916 |
+
$instance['event_qauntity1'] = $new_instance['event_qauntity1'];
|
1917 |
+
$instance['starting'] = $new_instance['starting'];
|
1918 |
+
$instance['follow_quality1'] = $new_instance['follow_quality1'];
|
1919 |
+
$instance['follow_quality3'] = $new_instance['follow_quality3'];
|
1920 |
+
$instance['event_qauntity2'] = $new_instance['event_qauntity2'];
|
1921 |
+
$instance['ordering'] = $new_instance['ordering'];
|
1922 |
+
$instance['event_qauntity22'] = $new_instance['event_qauntity22'];
|
1923 |
+
$instance['ordering1'] = $new_instance['ordering1'];
|
1924 |
+
$instance['event_select'] = $new_instance['event_select'];
|
1925 |
+
$instance['start_date'] = $new_instance['start_date'];
|
1926 |
+
$instance['starting'] = $new_instance['starting'];
|
1927 |
+
$instance['follow_quality2'] = $new_instance['follow_quality2'];
|
1928 |
+
$instance['event_qauntity3'] = $new_instance['event_qauntity3'];
|
1929 |
+
$instance['theme'] = $new_instance['theme'];
|
1930 |
+
$instance['event_date'] = $new_instance['event_date'];
|
1931 |
+
$instance['repeat_rate'] = $new_instance['repeat_rate'];
|
1932 |
+
$instance['numbering'] = $new_instance['numbering'];
|
1933 |
+
$instance['ev_text'] = $new_instance['ev_text'];
|
1934 |
+
$instance['width'] = $new_instance['width'];
|
1935 |
+
$instance['bg_color'] = $new_instance['bg_color'];
|
1936 |
+
$instance['title_color'] = $new_instance['title_color'];
|
1937 |
+
$instance['title_size'] = $new_instance['title_size'];
|
1938 |
+
$instance['title_font'] = $new_instance['title_font'];
|
1939 |
+
$instance['date_color'] = $new_instance['date_color'];
|
1940 |
+
$instance['date_format'] = $new_instance['date_format'];
|
1941 |
+
$instance['repeat_color'] = $new_instance['repeat_color'];
|
1942 |
+
$instance['text_color'] = $new_instance['text_color'];
|
1943 |
+
$instance['divider_color'] = $new_instance['divider_color'];
|
1944 |
+
return $instance;
|
1945 |
+
}
|
1946 |
+
|
1947 |
+
// Widget Control Panel //
|
1948 |
+
function form($instance) {
|
1949 |
+
global $wpdb;
|
1950 |
+
$defaults = array(
|
1951 |
+
'title' => '',
|
1952 |
+
'calendar' => '0',
|
1953 |
+
'theme' => '0',
|
1954 |
+
'view_type' => '0',
|
1955 |
+
'event_qauntity1' => '1',
|
1956 |
+
'follow_quality1' => '10',
|
1957 |
+
'follow_quality3' => '10',
|
1958 |
+
'event_qauntity2' => '1',
|
1959 |
+
'ordering' => '0',
|
1960 |
+
'event_qauntity22' => '1',
|
1961 |
+
'ordering1' => '0',
|
1962 |
+
'event_select' => '',
|
1963 |
+
'start_date' => '',
|
1964 |
+
'starting' => '0',
|
1965 |
+
'follow_quality2' => '10',
|
1966 |
+
'event_qauntity3' => '1',
|
1967 |
+
'event_date' => '1',
|
1968 |
+
'repeat_rate' => '1',
|
1969 |
+
'numbering' => '1',
|
1970 |
+
'ev_text' => '1',
|
1971 |
+
'width' => '200',
|
1972 |
+
'bg_color' => 'FFFFFF',
|
1973 |
+
'title_color' => '000000',
|
1974 |
+
'title_size' => '14',
|
1975 |
+
'title_font' => 'Arial',
|
1976 |
+
'date_color' => '000000',
|
1977 |
+
'date_format' => 'd F Y',
|
1978 |
+
'repeat_color' => '000000',
|
1979 |
+
'text_color' => '000000',
|
1980 |
+
'divider_color' => 'C2C2C2',
|
1981 |
+
);
|
1982 |
+
$instance = wp_parse_args((array)$instance, $defaults);
|
1983 |
+
$all_clendars = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_calendar');
|
1984 |
+
$all_themes = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme');
|
1985 |
+
|
1986 |
+
|
1987 |
+
$id = $this->get_field_id('title');
|
1988 |
+
|
1989 |
+
?>
|
1990 |
+
<script>jscolor.bind();
|
1991 |
+
|
1992 |
+
function selectcal(x)
|
1993 |
+
{
|
1994 |
+
|
1995 |
+
|
1996 |
+
|
1997 |
+
a=x.parentNode.parentNode.parentNode.childNodes[29].childNodes[3].childNodes[1]
|
1998 |
+
selectcalendarvalue=x.value;
|
1999 |
+
a.href=a.href+'&upcalendar_id='+selectcalendarvalue;
|
2000 |
+
}
|
2001 |
+
|
2002 |
+
</script>
|
2003 |
+
<style>
|
2004 |
+
.calendar .button{
|
2005 |
+
display: table-cell !important;
|
2006 |
+
}
|
2007 |
+
|
2008 |
+
div.calendar{
|
2009 |
+
margin-left: -101px;
|
2010 |
+
}
|
2011 |
+
</style>
|
2012 |
+
<p>
|
2013 |
+
|
2014 |
+
<label for="<?php echo $this->get_field_id('title'); ?>">Title:</label>
|
2015 |
+
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>'" type="text" value="<?php echo $instance['title']; ?>"/>
|
2016 |
+
</p>
|
2017 |
+
<span id="list"></span>
|
2018 |
+
<form method="get" onkeypress="doNothing()" action="calendar.php">
|
2019 |
+
<table width="100%" class="paramlist admintable" cellpadding="3">
|
2020 |
+
<tbody>
|
2021 |
+
<tr>
|
2022 |
+
<td style="width:120px" class="paramlist_key">
|
2023 |
+
<span class="editlinktip">
|
2024 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('calendar'); ?>" class="hasTip">Select Calendar:</label>
|
2025 |
+
</span>
|
2026 |
+
</td>
|
2027 |
+
<td class="paramlist_value">
|
2028 |
+
<select name="<?php echo $this->get_field_name('calendar'); ?>" id="<?php echo $this->get_field_id('calendar'); ?>" style="font-size:10px;width:120px;" class="inputbox" onchange="selectcal(this)">
|
2029 |
+
<option value="0">Select Calendar</option>
|
2030 |
+
<?php
|
2031 |
+
$sp_calendar = count($all_clendars);
|
2032 |
+
for ($i = 0; $i < $sp_calendar; $i++) {
|
2033 |
+
?>
|
2034 |
+
<option value="<?php echo $all_clendars[$i]->id; ?>" <?php if ($instance['calendar'] == $all_clendars[$i]->id) echo 'selected="selected"'; ?>><?php echo $all_clendars[$i]->title ?></option>
|
2035 |
+
<?php
|
2036 |
+
}
|
2037 |
+
?>
|
2038 |
+
</select>
|
2039 |
+
</td>
|
2040 |
+
</tr>
|
2041 |
+
<tr>
|
2042 |
+
<td style="width:120px" class="paramlist_key">
|
2043 |
+
<span class="editlinktip">
|
2044 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('theme'); ?>" class="hasTip">Select Theme:</label>
|
2045 |
+
</span>
|
2046 |
+
</td>
|
2047 |
+
<td class="paramlist_value">
|
2048 |
+
<select name="<?php echo $this->get_field_name('theme'); ?>" id="<?php echo $this->get_field_id('theme'); ?>" style="font-size:10px; width:120px;" class="inputbox">
|
2049 |
+
<option value="0">Select Theme</option>
|
2050 |
+
<?php
|
2051 |
+
$sp_theme = count($all_themes);
|
2052 |
+
for ($i = 0; $i < $sp_theme; $i++) {
|
2053 |
+
?>
|
2054 |
+
<option value="<?php echo $all_themes[$i]->id; ?>" <?php if ($instance['theme'] == $all_themes[$i]->id) echo 'selected="selected"'; ?>><?php echo $all_themes[$i]->title; ?></option>
|
2055 |
+
<?php
|
2056 |
+
}
|
2057 |
+
?>
|
2058 |
+
</select>
|
2059 |
+
</td>
|
2060 |
+
</tr>
|
2061 |
+
<tr>
|
2062 |
+
<td style="width:120px" class="paramlist_view">
|
2063 |
+
<span class="editlinktip">
|
2064 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('view_type'); ?>" class="hasTip">Events to display:</label>
|
2065 |
+
</span>
|
2066 |
+
</td>
|
2067 |
+
<td class="paramlist_value" id="<?php echo $this->get_field_id('view_type'); ?>">
|
2068 |
+
<label style="font-size:10px;" for="show0"><input type="radio" name="<?php echo $this->get_field_name('view_type'); ?>" value="0" <?php if ($instance['view_type'] == '0') echo 'checked="checked"'; ?> id="show0" onchange="show_(0)"/>
|
2069 |
+
Starting From Current Date</label><br>
|
2070 |
+
<label style="font-size:10px;" for="show1"><input type="radio" name="<?php echo $this->get_field_name('view_type'); ?>" value="1" <?php if ($instance['view_type'] == '1') echo 'checked="checked"'; ?> id="show1" onchange="show_(1)"/>
|
2071 |
+
Events In Date Interval </label><br>
|
2072 |
+
<label style="font-size:10px;" for="show2"><input type="radio" name="<?php echo $this->get_field_name('view_type'); ?>" value="2" <?php if ($instance['view_type'] == '2') echo 'checked="checked"'; ?> id="show2" onchange="show_(2)"/>
|
2073 |
+
Selected Events</label>
|
2074 |
+
</td>
|
2075 |
+
</tr>
|
2076 |
+
<tr class="event_qauntity1" >
|
2077 |
+
<td class="paramlist_quality">
|
2078 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('event_qauntity1'); ?>">Events Quantity:</label>
|
2079 |
+
</td>
|
2080 |
+
<td>
|
2081 |
+
<input class="widefat" id="<?php echo $this->get_field_id('event_qauntity1'); ?>" name="<?php echo $this->get_field_name('event_qauntity1'); ?>'" type="text" value="<?php echo $instance['event_qauntity1']; ?>"/>
|
2082 |
+
</td>
|
2083 |
+
</tr>
|
2084 |
+
|
2085 |
+
<tr class="starting" id="<?php echo $this->get_field_id('starting'); ?>">
|
2086 |
+
<td class="paramlist_quality">
|
2087 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('starting'); ?>">Strating From:</label>
|
2088 |
+
</td>
|
2089 |
+
<td>
|
2090 |
+
<label for="current" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('starting'); ?>" value="0" <?php if ($instance['starting'] == '0') echo 'checked="checked"'; ?> onchange="showd_(0)" id="current" />
|
2091 |
+
Current Date</label><br>
|
2092 |
+
<label for="starting" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('starting'); ?>" value="1" <?php if ($instance['starting'] == '1') echo 'checked="checked"'; ?> onchange="showd_(1)" id="starting" />
|
2093 |
+
Start Date</label>
|
2094 |
+
</td>
|
2095 |
+
</tr>
|
2096 |
+
|
2097 |
+
<tr class="start_date" style="display:none">
|
2098 |
+
<td class="paramlist_quality">
|
2099 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('start_date'); ?>">Select Start Date:</label>
|
2100 |
+
</td>
|
2101 |
+
<td>
|
2102 |
+
<input style="width:85px" class="inputbox" type="text" name="<?php echo $this->get_field_name('start_date'); ?>'" id="<?php echo $this->get_field_id('start_date'); ?>" size="10" maxlength="10" value="<?php echo $instance['start_date']; ?>"/>
|
2103 |
+
|
2104 |
+
<input type="reset" class="button" value="..." onclick="return showCalendar('<?php echo $this->get_field_id('start_date'); ?>','%Y-%m-%d');"/>
|
2105 |
+
</td>
|
2106 |
+
</tr>
|
2107 |
+
|
2108 |
+
<tr class="follow_quality1">
|
2109 |
+
<td class="paramlist_quality">
|
2110 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('follow_quality1'); ?>">Following Days Quantity:</label>
|
2111 |
+
</td>
|
2112 |
+
<td>
|
2113 |
+
<input class="widefat" id="<?php echo $this->get_field_id('follow_quality1'); ?>" name="<?php echo $this->get_field_name('follow_quality1'); ?>'" type="text" value="<?php echo $instance['follow_quality1']; ?>"/>
|
2114 |
+
</td>
|
2115 |
+
</tr>
|
2116 |
+
|
2117 |
+
<tr class="follow_quality3">
|
2118 |
+
<td class="paramlist_quality">
|
2119 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('follow_quality3'); ?>">Following Days Quantity:</label>
|
2120 |
+
</td>
|
2121 |
+
<td>
|
2122 |
+
<input class="widefat" id="<?php echo $this->get_field_id('follow_quality3'); ?>" name="<?php echo $this->get_field_name('follow_quality3'); ?>'" type="text" value="<?php echo $instance['follow_quality3']; ?>"/>
|
2123 |
+
</td>
|
2124 |
+
</tr>
|
2125 |
+
|
2126 |
+
<tr class="event_qauntity2">
|
2127 |
+
<td class="paramlist_quality">
|
2128 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('event_qauntity2'); ?>">Events Quantity:</label>
|
2129 |
+
</td>
|
2130 |
+
<td>
|
2131 |
+
<input class="widefat" id="<?php echo $this->get_field_id('event_qauntity2'); ?>" name="<?php echo $this->get_field_name('event_qauntity2'); ?>'" type="text" value="<?php echo $instance['event_qauntity2']; ?>"/>
|
2132 |
+
</td>
|
2133 |
+
</tr>
|
2134 |
+
|
2135 |
+
<tr class="event_qauntity22">
|
2136 |
+
<td class="paramlist_quality">
|
2137 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('event_qauntity22'); ?>">Events Quantity:</label>
|
2138 |
+
</td>
|
2139 |
+
<td>
|
2140 |
+
<input class="widefat" id="<?php echo $this->get_field_id('event_qauntity22'); ?>" name="<?php echo $this->get_field_name('event_qauntity22'); ?>'" type="text" value="<?php echo $instance['event_qauntity22']; ?>"/>
|
2141 |
+
</td>
|
2142 |
+
</tr>
|
2143 |
+
|
2144 |
+
<tr class="ordering">
|
2145 |
+
<td class="paramlist_quality">
|
2146 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('ordering'); ?>">Ordering:</label>
|
2147 |
+
</td>
|
2148 |
+
<td>
|
2149 |
+
<label for="ord" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('ordering'); ?>" value="0" <?php if ($instance['ordering'] == '0') echo 'checked="checked"'; ?> id="ord" >
|
2150 |
+
Ordering</label>
|
2151 |
+
<label for="rand" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('ordering'); ?>" value="1" <?php if ($instance['ordering'] == '1') echo 'checked="checked"';?> id="rand">
|
2152 |
+
Random</label>
|
2153 |
+
</td>
|
2154 |
+
</tr>
|
2155 |
+
|
2156 |
+
<tr class="ordering1">
|
2157 |
+
<td class="paramlist_quality">
|
2158 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('ordering1'); ?>">Ordering:</label>
|
2159 |
+
</td>
|
2160 |
+
<td>
|
2161 |
+
<input type="radio" name="<?php echo $this->get_field_name('ordering1'); ?>" value="0" <?php if ($instance['ordering1'] == '0') echo 'checked="checked"'; ?> id="ord" >
|
2162 |
+
<label for="showd0" style="font-size:10px">Ordering</label>
|
2163 |
+
<input type="radio" name="<?php echo $this->get_field_name('ordering1'); ?>" value="1" <?php if ($instance['ordering1'] == '1') echo 'checked="checked"';?> id="rand">
|
2164 |
+
<label for="showd1" style="font-size:10px">Random</label>
|
2165 |
+
</td>
|
2166 |
+
</tr>
|
2167 |
+
|
2168 |
+
<tr class="follow_quality2">
|
2169 |
+
<td class="paramlist_quality">
|
2170 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('follow_quality2'); ?>">Following Days Quantity:</label>
|
2171 |
+
</td>
|
2172 |
+
<td>
|
2173 |
+
<input class="widefat" id="<?php echo $this->get_field_id('follow_quality2'); ?>" name="<?php echo $this->get_field_name('follow_quality2'); ?>'" type="text" value="<?php echo $instance['follow_quality2']; ?>"/>
|
2174 |
+
</td>
|
2175 |
+
</tr>
|
2176 |
+
|
2177 |
+
<tr class="event_qauntity3">
|
2178 |
+
<td class="paramlist_quality">
|
2179 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('event_qauntity3'); ?>">Events Quantity:</label>
|
2180 |
+
</td>
|
2181 |
+
<td>
|
2182 |
+
<input class="widefat" id="<?php echo $this->get_field_id('event_qauntity3'); ?>" name="<?php echo $this->get_field_name('event_qauntity3'); ?>'" type="text" value="<?php echo $instance['event_qauntity3']; ?>"/>
|
2183 |
+
</td>
|
2184 |
+
</tr>
|
2185 |
+
|
2186 |
+
<tr class="follow_quality">
|
2187 |
+
<td class="paramlist_quality">
|
2188 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('follow_quality'); ?>">Select Events From List:</label>
|
2189 |
+
</td>
|
2190 |
+
<td>
|
2191 |
+
<?php global $sonan; ?>
|
2192 |
+
<a href="<?php echo admin_url('admin-ajax.php'); ?>?action=upcoming&id_input=<?php echo $this->get_field_id('event_select');?>&w_id=<?php echo $this->get_field_id('title');?>&TB_iframe=1&tbWidth=1024&tbHeight=768" class="thickbox-preview<?php echo $sonan; ?>" id="<?php echo $id?>" onclick="addcal(this,'<?php echo $this->get_field_id('calendar'); ?>','<?php echo $this->get_field_id('event_select');?>','<?php echo $this->get_field_id('title');?>')" rel="{handler: 'iframe', size: {x: 750, y: 450}}" >
|
2193 |
+
|
2194 |
+
<img src="<?php echo plugins_url(); ?>/spider-event-calendar/front_end/images/add_but.png" class="hasTip" /> </a>
|
2195 |
+
|
2196 |
+
<input type="hidden" name="boxchecked" value="0" >
|
2197 |
+
|
2198 |
+
</td>
|
2199 |
+
|
2200 |
+
</tr>
|
2201 |
+
|
2202 |
+
<tr class="event_qauntity3">
|
2203 |
+
<td class="paramlist_quality">
|
2204 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('event_qauntity3'); ?>">Events Quantity:</label>
|
2205 |
+
</td>
|
2206 |
+
<td>
|
2207 |
+
<table id="art_table_meta" width="100%">
|
2208 |
+
<tbody id="meta">
|
2209 |
+
<input class="widefat" id="<?php echo $this->get_field_id('event_qauntity3'); ?>" name="<?php echo $this->get_field_name('event_qauntity3'); ?>'" type="text" value="<?php echo $instance['event_qauntity3']; ?>" />
|
2210 |
+
</tbody>
|
2211 |
+
</table>
|
2212 |
+
|
2213 |
+
|
2214 |
+
</td>
|
2215 |
+
</tr>
|
2216 |
+
|
2217 |
+
|
2218 |
+
<tr id="event_select">
|
2219 |
+
<table width="100%">
|
2220 |
+
<tbody id="event<?php echo $id ?>">
|
2221 |
+
</tbody>
|
2222 |
+
</table>
|
2223 |
+
</tr>
|
2224 |
+
|
2225 |
+
</tbody>
|
2226 |
+
</table>
|
2227 |
+
<hr>
|
2228 |
+
<script>
|
2229 |
+
function addcal(x,y,z,f)
|
2230 |
+
{
|
2231 |
+
var calendar=document.getElementById(y).value;
|
2232 |
+
jQuery(x).attr('href','<?php echo admin_url('admin-ajax.php'); ?>?action=upcoming&id_input='+z+'&w_id='+f+'&upcalendar_id='+calendar+'&TB_iframe=1&tbWidth=1024&tbHeight=768');
|
2233 |
+
}
|
2234 |
+
</script>
|
2235 |
+
<table width="100%" class="paramlist admintable" cellpadding="3">
|
2236 |
+
<tbody>
|
2237 |
+
<tr>
|
2238 |
+
<td style="width:120px" class="paramlist_key">
|
2239 |
+
<span class="editlinktip">
|
2240 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('event_date'); ?>" class="hasTip">Show Event Date:</label>
|
2241 |
+
</span>
|
2242 |
+
</td>
|
2243 |
+
<td class="paramlist_value">
|
2244 |
+
<label for="event_date1" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('event_date'); ?>" value="1" <?php if ($instance['event_date'] == '1') echo 'checked="checked"'; ?> id="event_date1" >
|
2245 |
+
Yes</label>
|
2246 |
+
<label for="event_date2" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('event_date'); ?>" value="0" <?php if ($instance['event_date'] == '0') echo 'checked="checked"';?> id="event_date2">
|
2247 |
+
No</label>
|
2248 |
+
</td>
|
2249 |
+
</tr>
|
2250 |
+
|
2251 |
+
<tr>
|
2252 |
+
<td style="width:120px" class="paramlist_key">
|
2253 |
+
<span class="editlinktip">
|
2254 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('repeat_rate'); ?>" class="hasTip">Show Event Repeat Rate:</label>
|
2255 |
+
</span>
|
2256 |
+
</td>
|
2257 |
+
<td class="paramlist_value">
|
2258 |
+
<label for="repeat_rate1" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('repeat_rate'); ?>" value="1" <?php if ($instance['repeat_rate'] == '1') echo 'checked="checked"'; ?> id="repeat_rate1" >
|
2259 |
+
Yes</label>
|
2260 |
+
<label for="repeat_rate2" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('repeat_rate'); ?>" value="0" <?php if ($instance['repeat_rate'] == '0') echo 'checked="checked"';?> id="repeat_rate2">
|
2261 |
+
No</label>
|
2262 |
+
</td>
|
2263 |
+
</tr>
|
2264 |
+
|
2265 |
+
<tr>
|
2266 |
+
<td style="width:120px" class="paramlist_key">
|
2267 |
+
<span class="editlinktip">
|
2268 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('ev_text'); ?>" class="hasTip">Show Event Text:</label>
|
2269 |
+
</span>
|
2270 |
+
</td>
|
2271 |
+
<td class="paramlist_value">
|
2272 |
+
<label for="ev_text1" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('ev_text'); ?>" value="1" <?php if ($instance['ev_text'] == '1') echo 'checked="checked"'; ?> id="ev_text1" >
|
2273 |
+
Yes</label>
|
2274 |
+
<label for="ev_text2" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('ev_text'); ?>" value="0" <?php if ($instance['ev_text'] == '0') echo 'checked="checked"';?> id="ev_text2">
|
2275 |
+
No</label>
|
2276 |
+
</td>
|
2277 |
+
</tr>
|
2278 |
+
|
2279 |
+
<tr>
|
2280 |
+
<td style="width:120px" class="paramlist_key">
|
2281 |
+
<span class="editlinktip">
|
2282 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('numbering'); ?>" class="hasTip">Show Numbering:</label>
|
2283 |
+
</span>
|
2284 |
+
</td>
|
2285 |
+
<td class="paramlist_value">
|
2286 |
+
<label for="numbering1" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('numbering'); ?>" value="1" <?php if ($instance['numbering'] == '1') echo 'checked="checked"'; ?> id="numbering1" >
|
2287 |
+
Yes</label>
|
2288 |
+
<label for="numbering2" style="font-size:10px"><input type="radio" name="<?php echo $this->get_field_name('numbering'); ?>" value="0" <?php if ($instance['numbering'] == '0') echo 'checked="checked"';?> id="numbering2">
|
2289 |
+
No</label>
|
2290 |
+
</td>
|
2291 |
+
</tr>
|
2292 |
+
</tbody>
|
2293 |
+
</table>
|
2294 |
+
|
2295 |
+
<hr>
|
2296 |
+
|
2297 |
+
<table width="100%" class="paramlist admintable" cellpadding="3">
|
2298 |
+
<tbody>
|
2299 |
+
<tr>
|
2300 |
+
<td style="width:120px" class="paramlist_key">
|
2301 |
+
<span class="editlinktip">
|
2302 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('width'); ?>" class="hasTip">Width:</label>
|
2303 |
+
</span>
|
2304 |
+
</td>
|
2305 |
+
<td class="paramlist_value">
|
2306 |
+
<input type="text" id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" value="<?php echo $instance['width'];?>" />
|
2307 |
+
</td>
|
2308 |
+
</tr>
|
2309 |
+
<tr>
|
2310 |
+
<td style="width:120px" class="paramlist_key">
|
2311 |
+
<span class="editlinktip">
|
2312 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('bg_color'); ?>" class="hasTip">Background Color:</label>
|
2313 |
+
</span>
|
2314 |
+
</td>
|
2315 |
+
<td class="paramlist_value">
|
2316 |
+
<input class="color" id="<?php echo $this->get_field_id('bg_color'); ?>" name="<?php echo $this->get_field_name('bg_color'); ?>" value="<?php echo $instance['bg_color'];?>" />
|
2317 |
+
</td>
|
2318 |
+
</tr>
|
2319 |
+
<tr>
|
2320 |
+
<td style="width:120px" class="paramlist_key">
|
2321 |
+
<span class="editlinktip">
|
2322 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('title_color'); ?>" class="hasTip">Event Title Color:</label>
|
2323 |
+
</span>
|
2324 |
+
</td>
|
2325 |
+
<td class="paramlist_value">
|
2326 |
+
<input class="color" id="<?php echo $this->get_field_id('title_color'); ?>" name="<?php echo $this->get_field_name('title_color'); ?>" value="<?php echo $instance['title_color'];?>" />
|
2327 |
+
</td>
|
2328 |
+
</tr>
|
2329 |
+
<tr>
|
2330 |
+
<td style="width:120px" class="paramlist_key">
|
2331 |
+
<span class="editlinktip">
|
2332 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('title_size'); ?>" class="hasTip">Event Title Font Size:</label>
|
2333 |
+
</span>
|
2334 |
+
</td>
|
2335 |
+
<td class="paramlist_value">
|
2336 |
+
<input type="text" id="<?php echo $this->get_field_id('title_size'); ?>" name="<?php echo $this->get_field_name('title_size'); ?>" value="<?php echo $instance['title_size'];?>"/>
|
2337 |
+
</td>
|
2338 |
+
</tr>
|
2339 |
+
<tr>
|
2340 |
+
<td style="width:120px" class="paramlist_key">
|
2341 |
+
<span class="editlinktip">
|
2342 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('title_font'); ?>" class="hasTip">Event Title Font:</label>
|
2343 |
+
</span>
|
2344 |
+
</td>
|
2345 |
+
<td class="paramlist_value">
|
2346 |
+
<select name="<?php echo $this->get_field_name('title_font'); ?>" id="<?php echo $this->get_field_id('font'); ?>" style="font-size:10px; width:105px" class="inputbox">
|
2347 |
+
<option value="0">Select Font</option>
|
2348 |
+
<option value="Verdana" <?php if($instance['title_font']=='Verdana') echo 'selected="selected"'?>>Verdana</option>
|
2349 |
+
<option value="Lucida" <?php if($instance['title_font']=='Lucida') echo 'selected="selected"'?>>Lucida</option>
|
2350 |
+
<option value="Georgia" <?php if($instance['title_font']=='Georgia') echo 'selected="selected"'?>>Georgia</option>
|
2351 |
+
<option value="Tahoma" <?php if($instance['title_font']=='Tahoma') echo 'selected="selected"'?>>Tahoma</option>
|
2352 |
+
<option value="Arial" <?php if($instance['title_font']=='Arial') echo 'selected="selected"'?>>Arial</option>
|
2353 |
+
</select>
|
2354 |
+
</td>
|
2355 |
+
</tr>
|
2356 |
+
<tr>
|
2357 |
+
<td style="width:120px" class="paramlist_key">
|
2358 |
+
<span class="editlinktip">
|
2359 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('date_color'); ?>" class="hasTip">Event Date Color:</label>
|
2360 |
+
</span>
|
2361 |
+
</td>
|
2362 |
+
<td class="paramlist_value">
|
2363 |
+
<input class="color" id="<?php echo $this->get_field_id('date_color'); ?>" name="<?php echo $this->get_field_name('date_color'); ?>" value="<?php echo $instance['date_color'];?>" />
|
2364 |
+
</td>
|
2365 |
+
</tr>
|
2366 |
+
<tr>
|
2367 |
+
<td style="width:120px" class="paramlist_key">
|
2368 |
+
<span class="editlinktip">
|
2369 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('date_format'); ?>" class="hasTip">Event Date Format:</label>
|
2370 |
+
</span>
|
2371 |
+
</td>
|
2372 |
+
<td class="paramlist_value">
|
2373 |
+
<input type="text" id="<?php echo $this->get_field_id('date_format'); ?>" name="<?php echo $this->get_field_name('date_format'); ?>" value="<?php echo $instance['date_format'];?>" />
|
2374 |
+
</td>
|
2375 |
+
</tr>
|
2376 |
+
<tr>
|
2377 |
+
<td style="width:120px" class="paramlist_key">
|
2378 |
+
<span class="editlinktip">
|
2379 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('repeat_color'); ?>" class="hasTip">Event Repeat Rate Color:</label>
|
2380 |
+
</span>
|
2381 |
+
</td>
|
2382 |
+
<td class="paramlist_value">
|
2383 |
+
<input class="color" id="<?php echo $this->get_field_id('repeat_color'); ?>" name="<?php echo $this->get_field_name('repeat_color'); ?>" value="<?php echo $instance['repeat_color'];?>" />
|
2384 |
+
</td>
|
2385 |
+
</tr>
|
2386 |
+
|
2387 |
+
|
2388 |
+
<tr>
|
2389 |
+
<td style="width:120px" class="paramlist_key">
|
2390 |
+
<span class="editlinktip">
|
2391 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('text_color'); ?>" class="hasTip">Event Text Color:</label>
|
2392 |
+
</span>
|
2393 |
+
</td>
|
2394 |
+
<td class="paramlist_value">
|
2395 |
+
<input class="color" id="<?php echo $this->get_field_id('text_color'); ?>" name="<?php echo $this->get_field_name('text_color'); ?>" value="<?php echo $instance['text_color'];?>" />
|
2396 |
+
</td>
|
2397 |
+
</tr>
|
2398 |
+
|
2399 |
+
<tr>
|
2400 |
+
<td style="width:120px" class="paramlist_key">
|
2401 |
+
<span class="editlinktip">
|
2402 |
+
<label style="font-size:10px" for="<?php echo $this->get_field_id('divider_color'); ?>" class="hasTip">Divider Color:</label>
|
2403 |
+
</span>
|
2404 |
+
</td>
|
2405 |
+
<td class="paramlist_value">
|
2406 |
+
<input class="color" id="<?php echo $this->get_field_id('divider_color'); ?>" name="<?php echo $this->get_field_name('divider_color'); ?>" value="<?php echo $instance['divider_color'];?>" />
|
2407 |
+
</td>
|
2408 |
+
</tr>
|
2409 |
+
</tbody>
|
2410 |
+
</table>
|
2411 |
+
<input id="<?php echo $this->get_field_id('event_select'); ?>" name="<?php echo $this->get_field_name('event_select'); ?>'" type="hidden" value="<?php echo $instance['event_select'];?>"/>
|
2412 |
+
|
2413 |
+
|
2414 |
+
|
2415 |
+
<script type="text/javascript">
|
2416 |
+
|
2417 |
+
<?php if($sonan==1) {?>
|
2418 |
+
var next=0;
|
2419 |
+
var onfirsttimeload=0;
|
2420 |
+
function jSelectEvents(input_id,tbody_id,w_id,evid,title) {
|
2421 |
+
event_ids =document.getElementById(input_id).value;
|
2422 |
+
|
2423 |
+
/* input = document.getElementById(<?php echo $this->get_field_id('event_select'); ?>);
|
2424 |
+
input.setAttribute("value", "g"); */
|
2425 |
+
|
2426 |
+
tbody = document.getElementById(tbody_id);
|
2427 |
+
var str;
|
2428 |
+
str=document.getElementById(input_id).value;
|
2429 |
+
for(i=0; i<evid.length; i++)
|
2430 |
+
{
|
2431 |
+
|
2432 |
+
var var_serch=","+evid[i]+",";
|
2433 |
+
|
2434 |
+
|
2435 |
+
|
2436 |
+
if((!str)||str.indexOf(var_serch)==(-1) || onfirsttimeload==0){
|
2437 |
+
|
2438 |
+
tr = document.createElement('tr');
|
2439 |
+
tr.setAttribute('event_id'+w_id, evid[i]);
|
2440 |
+
|
2441 |
+
tr.setAttribute('id', 'event_select'+w_id+'_'+next);
|
2442 |
+
|
2443 |
+
var td_info = document.createElement('td');
|
2444 |
+
td_info.setAttribute('id','info'+w_id+'_'+next);
|
2445 |
+
//td_info.setAttribute('width','10px');
|
2446 |
+
|
2447 |
+
|
2448 |
+
b = document.createElement('b');
|
2449 |
+
b.innerHTML = title[i];
|
2450 |
+
b.style.width='100px';
|
2451 |
+
b.style.float='left';
|
2452 |
+
b.style.position="inherit";
|
2453 |
+
|
2454 |
+
|
2455 |
+
|
2456 |
+
|
2457 |
+
td_info.appendChild(b);
|
2458 |
+
|
2459 |
+
|
2460 |
+
|
2461 |
+
|
2462 |
+
|
2463 |
+
//td.appendChild(p_url);
|
2464 |
+
|
2465 |
+
var img_X = document.createElement("img");
|
2466 |
+
img_X.setAttribute("src", "<?php echo plugins_url()?>/spider-event-calendar/images/delete_el.png");
|
2467 |
+
// img_X.setAttribute("height", "17");
|
2468 |
+
img_X.style.cssText = "cursor:pointer; margin-left:60px";
|
2469 |
+
img_X.setAttribute("onclick", 'remove_row("event_select'+w_id+'_'+next+'","'+input_id+'","'+tbody_id+'","'+w_id+'")');
|
2470 |
+
|
2471 |
+
var td_X = document.createElement("td");
|
2472 |
+
td_X.setAttribute("id", "X_"+next);
|
2473 |
+
td_X.setAttribute("valign", "middle");
|
2474 |
+
// td_X.setAttribute("align", "right");
|
2475 |
+
td_X.style.width='50px';
|
2476 |
+
td_X.appendChild(img_X);
|
2477 |
+
|
2478 |
+
var img_UP = document.createElement("img");
|
2479 |
+
img_UP.setAttribute("src", "<?php echo plugins_url()?>/spider-event-calendar/images/up.png");
|
2480 |
+
// img_UP.setAttribute("height", "17");
|
2481 |
+
img_UP.style.cssText = "cursor:pointer";
|
2482 |
+
img_UP.setAttribute("onclick", 'up_row("event_select'+w_id+'_'+next+'","'+input_id+'","'+tbody_id+'","'+w_id+'")');
|
2483 |
+
|
2484 |
+
var td_UP = document.createElement("td");
|
2485 |
+
td_UP.setAttribute("id", "up_"+next);
|
2486 |
+
td_UP.setAttribute("valign", "middle");
|
2487 |
+
td_UP.style.width='20px';
|
2488 |
+
td_UP.appendChild(img_UP);
|
2489 |
+
|
2490 |
+
var img_DOWN = document.createElement("img");
|
2491 |
+
img_DOWN.setAttribute("src", "<?php echo plugins_url()?>/spider-event-calendar/images/down.png");
|
2492 |
+
// img_DOWN.setAttribute("height", "17");
|
2493 |
+
img_DOWN.style.cssText = "margin:2px;cursor:pointer";
|
2494 |
+
img_DOWN.setAttribute("onclick", 'down_row("event_select'+w_id+'_'+next+'","'+input_id+'","'+tbody_id+'","'+w_id+'")');
|
2495 |
+
|
2496 |
+
var td_DOWN = document.createElement("td");
|
2497 |
+
td_DOWN.setAttribute("id", "down_"+next);
|
2498 |
+
td_DOWN.setAttribute("valign", "middle");
|
2499 |
+
td_DOWN.style.width='20px';
|
2500 |
+
td_DOWN.appendChild(img_DOWN);
|
2501 |
+
|
2502 |
+
tr.appendChild(td_info);
|
2503 |
+
tr.appendChild(td_X);
|
2504 |
+
tr.appendChild(td_UP);
|
2505 |
+
tr.appendChild(td_DOWN);
|
2506 |
+
tbody.appendChild(tr);
|
2507 |
+
|
2508 |
+
|
2509 |
+
|
2510 |
+
//refresh
|
2511 |
+
next++;
|
2512 |
+
}
|
2513 |
+
|
2514 |
+
}
|
2515 |
+
onfirsttimeload=onfirsttimeload+1;
|
2516 |
+
document.getElementById(input_id).value=event_ids;
|
2517 |
+
|
2518 |
+
|
2519 |
+
tb_remove();
|
2520 |
+
refresh_(input_id,tbody_id,w_id);
|
2521 |
+
|
2522 |
+
}
|
2523 |
+
|
2524 |
+
|
2525 |
+
function remove_row(id,input_id,tbody_id,w_id){
|
2526 |
+
tr=document.getElementById(id);
|
2527 |
+
tr.parentNode.removeChild(tr);
|
2528 |
+
refresh_(input_id,tbody_id,w_id);
|
2529 |
+
}
|
2530 |
+
|
2531 |
+
|
2532 |
+
function up_row(id,input_id,tbody_id,w_id){
|
2533 |
+
form=document.getElementById(id).parentNode;
|
2534 |
+
k=1;
|
2535 |
+
while(form.childNodes[k])
|
2536 |
+
{
|
2537 |
+
if(form.childNodes[k].getAttribute("id"))
|
2538 |
+
if(id==form.childNodes[k].getAttribute("id"))
|
2539 |
+
break;
|
2540 |
+
k++;
|
2541 |
+
}
|
2542 |
+
if(k!=0)
|
2543 |
+
{
|
2544 |
+
up=form.childNodes[k-1];
|
2545 |
+
down=form.childNodes[k];
|
2546 |
+
form.removeChild(down);
|
2547 |
+
form.insertBefore(down, up);
|
2548 |
+
refresh_(input_id,tbody_id,w_id);
|
2549 |
+
}
|
2550 |
+
}
|
2551 |
+
|
2552 |
+
function down_row(id,input_id,tbody_id,w_id){
|
2553 |
+
form=document.getElementById(id).parentNode;
|
2554 |
+
l=form.childNodes.length;
|
2555 |
+
k=1;
|
2556 |
+
while(form.childNodes[k])
|
2557 |
+
{
|
2558 |
+
if(id==form.childNodes[k].id)
|
2559 |
+
break;
|
2560 |
+
k++;
|
2561 |
+
}
|
2562 |
+
|
2563 |
+
if(k!=l-1)
|
2564 |
+
{
|
2565 |
+
up=form.childNodes[k];
|
2566 |
+
down=form.childNodes[k+2];
|
2567 |
+
form.removeChild(up);
|
2568 |
+
if(!down)
|
2569 |
+
down=null;
|
2570 |
+
form.insertBefore(up, down);
|
2571 |
+
refresh_(input_id,tbody_id,w_id);
|
2572 |
+
}
|
2573 |
+
}
|
2574 |
+
|
2575 |
+
function refresh_(input_id,tbody_id,w_id){
|
2576 |
+
|
2577 |
+
GLOBAL_tbody=document.getElementById(tbody_id);
|
2578 |
+
|
2579 |
+
tox=',';
|
2580 |
+
for (x=1; x < GLOBAL_tbody.childNodes.length; x++)
|
2581 |
+
{
|
2582 |
+
|
2583 |
+
tr=GLOBAL_tbody.childNodes[x];
|
2584 |
+
|
2585 |
+
if(tr.getAttribute('event_id'+w_id))
|
2586 |
+
tox=tox+tr.getAttribute('event_id'+w_id)+',';
|
2587 |
+
|
2588 |
+
}
|
2589 |
+
|
2590 |
+
|
2591 |
+
document.getElementById(input_id).value=tox;
|
2592 |
+
|
2593 |
+
}
|
2594 |
+
|
2595 |
+
|
2596 |
+
<?php } ?>
|
2597 |
+
function show_(x)
|
2598 |
+
{
|
2599 |
+
if(x==0){
|
2600 |
+
jQuery('.event_qauntity1').show();
|
2601 |
+
jQuery('.starting').hide();
|
2602 |
+
jQuery('.follow_quality1').hide();
|
2603 |
+
jQuery('.event_qauntity2').hide();
|
2604 |
+
jQuery('.ordering').hide();
|
2605 |
+
jQuery('.event_qauntity22').hide();
|
2606 |
+
jQuery('.ordering1').hide();
|
2607 |
+
jQuery('.event_select').hide();
|
2608 |
+
jQuery('.follow_quality2').hide();
|
2609 |
+
jQuery('.event_qauntity3').hide();
|
2610 |
+
jQuery('.follow_quality').hide();
|
2611 |
+
jQuery('.follow_quality3').hide();
|
2612 |
+
jQuery('.start_date').attr('style','display:none');
|
2613 |
+
jQuery('.paramlist.admintable').next().hide();
|
2614 |
+
}
|
2615 |
+
else if(x==1){
|
2616 |
+
jQuery('.event_qauntity1').hide();
|
2617 |
+
jQuery('.starting').show();
|
2618 |
+
jQuery('.follow_quality1').hide();
|
2619 |
+
jQuery('.event_qauntity2').show();
|
2620 |
+
jQuery('.ordering').show();
|
2621 |
+
jQuery('.follow_quality2').hide();
|
2622 |
+
jQuery('.event_qauntity3').hide();
|
2623 |
+
jQuery('.follow_quality').hide();
|
2624 |
+
jQuery('.follow_quality3').show();
|
2625 |
+
jQuery('.event_select').hide();
|
2626 |
+
jQuery('.paramlist.admintable').next().hide();
|
2627 |
+
|
2628 |
+
var current=jQuery('#<?php echo $this->get_field_id('starting'); ?> #current').attr('checked');
|
2629 |
+
var starting=jQuery('#<?php echo $this->get_field_id('starting'); ?> #starting').attr('checked');
|
2630 |
+
|
2631 |
+
if(starting){
|
2632 |
+
jQuery('.follow_quality3').show();
|
2633 |
+
jQuery('.follow_quality1').hide();
|
2634 |
+
jQuery('.event_qauntity2').hide();
|
2635 |
+
jQuery('.ordering').hide();
|
2636 |
+
jQuery('.event_qauntity22').show();
|
2637 |
+
jQuery('.ordering1').show();
|
2638 |
+
jQuery('.start_date').removeAttr('style');
|
2639 |
+
}
|
2640 |
+
|
2641 |
+
else if(current){
|
2642 |
+
jQuery('.follow_quality1').show();
|
2643 |
+
jQuery('.follow_quality3').hide();
|
2644 |
+
jQuery('.event_qauntity2').show();
|
2645 |
+
jQuery('.ordering').show();
|
2646 |
+
jQuery('.event_qauntity22').hide();
|
2647 |
+
jQuery('.ordering1').hide();
|
2648 |
+
jQuery('.start_date').attr('style','display:none')
|
2649 |
+
}
|
2650 |
+
|
2651 |
+
}
|
2652 |
+
else if(x==2){
|
2653 |
+
jQuery('.event_qauntity1').hide();
|
2654 |
+
jQuery('.starting').hide();
|
2655 |
+
jQuery('.follow_quality1').hide();
|
2656 |
+
jQuery('.event_qauntity2').hide();
|
2657 |
+
jQuery('.ordering').hide();
|
2658 |
+
jQuery('.event_qauntity22').hide();
|
2659 |
+
jQuery('.ordering1').hide();
|
2660 |
+
jQuery('.follow_quality2').hide();
|
2661 |
+
jQuery('.event_qauntity3').hide();
|
2662 |
+
jQuery('.follow_quality').show();
|
2663 |
+
jQuery('.follow_quality3').hide();
|
2664 |
+
jQuery('.event_select').show();
|
2665 |
+
jQuery('.paramlist.admintable').next().show();
|
2666 |
+
jQuery('.start_date').attr('style','display:none')
|
2667 |
+
}
|
2668 |
+
else{
|
2669 |
+
jQuery('.start_date').attr('style','display:none')
|
2670 |
+
}
|
2671 |
+
|
2672 |
+
}
|
2673 |
+
|
2674 |
+
|
2675 |
+
function showd_(y)
|
2676 |
+
{
|
2677 |
+
if(y==0){
|
2678 |
+
jQuery('.follow_quality1').show();
|
2679 |
+
jQuery('.follow_quality3').hide();
|
2680 |
+
jQuery('.event_qauntity2').show();
|
2681 |
+
jQuery('.ordering').show();
|
2682 |
+
jQuery('.event_qauntity22').hide();
|
2683 |
+
jQuery('.ordering1').hide();
|
2684 |
+
jQuery('.start_date').attr('style','display:none');
|
2685 |
+
jQuery('.paramlist.admintable').next().hide();
|
2686 |
+
}
|
2687 |
+
|
2688 |
+
else if(y==1){
|
2689 |
+
jQuery('.follow_quality3').show();
|
2690 |
+
jQuery('.follow_quality1').hide();
|
2691 |
+
jQuery('.event_qauntity2').hide();
|
2692 |
+
jQuery('.ordering').hide();
|
2693 |
+
jQuery('.event_qauntity22').show();
|
2694 |
+
jQuery('.ordering1').show();
|
2695 |
+
jQuery('.start_date').removeAttr('style');
|
2696 |
+
jQuery('.paramlist.admintable').next().hide();
|
2697 |
+
|
2698 |
+
}
|
2699 |
+
}
|
2700 |
+
|
2701 |
+
|
2702 |
+
var show0=jQuery('#<?php echo $this->get_field_id('view_type'); ?> #show0').attr('checked');
|
2703 |
+
var show2=jQuery('#<?php echo $this->get_field_id('view_type'); ?> #show2').attr('checked');
|
2704 |
+
var show1=jQuery('#<?php echo $this->get_field_id('view_type'); ?> #show1').attr('checked');
|
2705 |
+
var current=jQuery('#<?php echo $this->get_field_id('starting'); ?> #current').attr('checked');
|
2706 |
+
var starting=jQuery('#<?php echo $this->get_field_id('starting'); ?> #starting').attr('checked');
|
2707 |
+
|
2708 |
+
if(show0)
|
2709 |
+
{
|
2710 |
+
jQuery('.event_qauntity1').show();
|
2711 |
+
jQuery('.starting').hide();
|
2712 |
+
jQuery('.follow_quality1').hide();
|
2713 |
+
jQuery('.event_qauntity2').hide();
|
2714 |
+
jQuery('.ordering').hide();
|
2715 |
+
jQuery('.follow_quality2').hide();
|
2716 |
+
jQuery('.event_qauntity3').hide();
|
2717 |
+
jQuery('.follow_quality').hide();
|
2718 |
+
jQuery('.follow_quality3').hide();
|
2719 |
+
jQuery('.event_qauntity22').hide();
|
2720 |
+
jQuery('.ordering1').hide();
|
2721 |
+
jQuery('.event_select').hide();
|
2722 |
+
jQuery('.start_date').css('display','none');
|
2723 |
+
jQuery('.paramlist.admintable').next().hide();
|
2724 |
+
}
|
2725 |
+
else if(show1)
|
2726 |
+
{
|
2727 |
+
jQuery('.event_qauntity1').hide();
|
2728 |
+
jQuery('.starting').show();
|
2729 |
+
jQuery('.follow_quality2').hide();
|
2730 |
+
jQuery('.event_qauntity3').hide();
|
2731 |
+
jQuery('.follow_quality').hide();
|
2732 |
+
jQuery('.event_select').hide();
|
2733 |
+
jQuery('.paramlist.admintable').next().hide();
|
2734 |
+
|
2735 |
+
if(starting){
|
2736 |
+
jQuery('.follow_quality3').show();
|
2737 |
+
jQuery('.follow_quality1').hide();
|
2738 |
+
jQuery('.event_qauntity2').hide();
|
2739 |
+
jQuery('.ordering').hide();
|
2740 |
+
jQuery('.event_qauntity22').show();
|
2741 |
+
jQuery('.ordering1').show();
|
2742 |
+
jQuery('.start_date').show();
|
2743 |
+
}
|
2744 |
+
|
2745 |
+
else if(current){
|
2746 |
+
jQuery('.follow_quality1').show();
|
2747 |
+
jQuery('.follow_quality3').hide();
|
2748 |
+
jQuery('.event_qauntity2').show();
|
2749 |
+
jQuery('.ordering').show();
|
2750 |
+
jQuery('.event_qauntity22').hide();
|
2751 |
+
jQuery('.ordering1').hide();
|
2752 |
+
}
|
2753 |
+
|
2754 |
+
}
|
2755 |
+
else if(show2)
|
2756 |
+
{
|
2757 |
+
jQuery('.event_qauntity1').hide();
|
2758 |
+
jQuery('.starting').hide();
|
2759 |
+
jQuery('.follow_quality1').hide();
|
2760 |
+
jQuery('.event_qauntity2').hide();
|
2761 |
+
jQuery('.ordering').hide();
|
2762 |
+
jQuery('.follow_quality2').hide();
|
2763 |
+
jQuery('.follow_quality3').hide();
|
2764 |
+
jQuery('.event_qauntity3').hide();
|
2765 |
+
jQuery('.follow_quality').show();
|
2766 |
+
jQuery('.event_qauntity22').hide();
|
2767 |
+
jQuery('.ordering1').hide();
|
2768 |
+
jQuery('.event_select').show();
|
2769 |
+
jQuery('.paramlist.admintable').next().show();
|
2770 |
+
}
|
2771 |
+
|
2772 |
+
|
2773 |
+
var thickDims, tbWidth, tbHeight;
|
2774 |
+
|
2775 |
+
jQuery(document).ready(function($) {
|
2776 |
+
thickDims = function() {
|
2777 |
+
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
2778 |
+
w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 200;
|
2779 |
+
h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 200;
|
2780 |
+
if ( tbWindow.size() ) {
|
2781 |
+
tbWindow.width(w).height(h);
|
2782 |
+
$('#TB_iframeContent').width(w).height(h - 27);
|
2783 |
+
tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
|
2784 |
+
if ( typeof document.body.style.maxWidth != 'undefined' )
|
2785 |
+
tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
|
2786 |
+
|
2787 |
+
}
|
2788 |
+
|
2789 |
+
};
|
2790 |
+
|
2791 |
+
|
2792 |
+
|
2793 |
+
thickDims();
|
2794 |
+
<?php global $sonan; ?>
|
2795 |
+
$(window).resize( function() { thickDims() } );
|
2796 |
+
|
2797 |
+
|
2798 |
+
|
2799 |
+
$('a.thickbox-preview<?php echo $sonan; ?>').click( function() {
|
2800 |
+
calendar=jQuery(this).parent().parent().parent().children()[0].childNodes[3].childNodes[1].value;
|
2801 |
+
if(calendar!=0)
|
2802 |
+
{
|
2803 |
+
tb_click.call(this);
|
2804 |
+
var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
|
2805 |
+
if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
|
2806 |
+
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
2807 |
+
else
|
2808 |
+
tbWidth = $(window).width() - 90;
|
2809 |
+
if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
|
2810 |
+
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
2811 |
+
else
|
2812 |
+
tbHeight = $(window).height() - 60;
|
2813 |
+
if ( alink.length ) {
|
2814 |
+
url = alink.attr('href') || '';
|
2815 |
+
text = alink.attr('title') || '';
|
2816 |
+
link = ' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
|
2817 |
+
} else {
|
2818 |
+
text = $(this).attr('title') || '';
|
2819 |
+
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
2820 |
+
}
|
2821 |
+
$('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
|
2822 |
+
$('#TB_closeAjaxWindow').css({'float':'left'});
|
2823 |
+
$('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
2824 |
+
$('#TB_iframeContent').width('100%');
|
2825 |
+
thickDims();
|
2826 |
+
}
|
2827 |
+
else
|
2828 |
+
{
|
2829 |
+
alert('Please select calendar')
|
2830 |
+
}
|
2831 |
+
return false;
|
2832 |
+
|
2833 |
+
} );
|
2834 |
+
// Theme details
|
2835 |
+
$('.theme-detail').click(function () {
|
2836 |
+
$(this).siblings('.themedetaildiv').toggle();
|
2837 |
+
return false;
|
2838 |
+
});
|
2839 |
+
});
|
2840 |
+
</script>
|
2841 |
+
|
2842 |
+
<?php
|
2843 |
+
$events=array();
|
2844 |
+
$events_id=explode(',',$instance['event_select']);
|
2845 |
+
$events_id= array_slice($events_id,1, count($events_id)-2);
|
2846 |
+
|
2847 |
+
foreach($events_id as $event_id)
|
2848 |
+
{
|
2849 |
+
|
2850 |
+
$query ="SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE published='1' AND id=".$event_id;
|
2851 |
+
|
2852 |
+
$is=$wpdb->get_row($query);
|
2853 |
+
if($is)
|
2854 |
+
$events[] = $wpdb->get_row($query);
|
2855 |
+
|
2856 |
+
|
2857 |
+
}
|
2858 |
+
|
2859 |
+
if($events)
|
2860 |
+
{
|
2861 |
+
foreach($events as $event)
|
2862 |
+
{
|
2863 |
+
$day = $event->date;
|
2864 |
+
$v_ids[]=$event->id;
|
2865 |
+
|
2866 |
+
$v_titles[]=addslashes($event->title.' ('.date('d M Y',strtotime($day)).')');
|
2867 |
+
|
2868 |
+
|
2869 |
+
}
|
2870 |
+
|
2871 |
+
|
2872 |
+
$v_id='["'.implode('","',$v_ids).'"]';
|
2873 |
+
$v_title='["'.implode('","',$v_titles).'"]';
|
2874 |
+
|
2875 |
+
$tbody_id ="event".$id;
|
2876 |
+
if($this->number!="__i__"){
|
2877 |
+
?>
|
2878 |
+
|
2879 |
+
<script type="text/javascript">
|
2880 |
+
|
2881 |
+
jSelectEvents('<?php echo $this->get_field_id('event_select'); ?>','<?php echo $tbody_id?>','<?php echo $id?>',<?php echo $v_id?>,<?php echo $v_title?>);
|
2882 |
+
|
2883 |
+
</script>
|
2884 |
+
<?php
|
2885 |
+
|
2886 |
+
}
|
2887 |
+
}
|
2888 |
+
?>
|
2889 |
+
|
2890 |
+
|
2891 |
+
|
2892 |
+
<?php
|
2893 |
+
$sonan = $sonan+1;
|
2894 |
+
}
|
2895 |
+
|
2896 |
+
|
2897 |
+
}
|
2898 |
+
add_action('widgets_init', create_function('', 'return register_widget("upcoming_events");'));?>
|
widget_Theme_functions.php
ADDED
@@ -0,0 +1,334 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!current_user_can('manage_options')) {
|
3 |
+
die('Access Denied');
|
4 |
+
}
|
5 |
+
function add_theme_calendar_widget() {
|
6 |
+
global $wpdb;
|
7 |
+
html_add_theme_widget();
|
8 |
+
}
|
9 |
+
|
10 |
+
function show_theme_calendar_widget() {
|
11 |
+
global $wpdb;
|
12 |
+
$order = " ORDER BY title ASC";
|
13 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
14 |
+
$sort["sortid_by"] = "title";
|
15 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
16 |
+
$sort["1_or_2"] = "2";
|
17 |
+
if (isset($_POST['page_number'])) {
|
18 |
+
if (isset($_POST['order_by']) && $_POST['order_by'] != '') {
|
19 |
+
$sort["sortid_by"] = $_POST['order_by'];
|
20 |
+
}
|
21 |
+
if (isset($_POST['asc_or_desc']) && ($_POST['asc_or_desc'] == 1)) {
|
22 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
23 |
+
$sort["1_or_2"] = "2";
|
24 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
25 |
+
}
|
26 |
+
else {
|
27 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
28 |
+
$sort["1_or_2"] = "1";
|
29 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
30 |
+
}
|
31 |
+
if ($_POST['page_number']) {
|
32 |
+
$limit = ($_POST['page_number'] - 1) * 20;
|
33 |
+
}
|
34 |
+
else {
|
35 |
+
$limit = 0;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
else {
|
39 |
+
$limit = 0;
|
40 |
+
}
|
41 |
+
if (isset($_POST['search_events_by_title'])) {
|
42 |
+
$search_tag = $_POST['search_events_by_title'];
|
43 |
+
}
|
44 |
+
else {
|
45 |
+
$search_tag = "";
|
46 |
+
}
|
47 |
+
if ($search_tag) {
|
48 |
+
$where = ' WHERE title LIKE "%' . $search_tag . '%"';
|
49 |
+
}
|
50 |
+
else {
|
51 |
+
$where = '';
|
52 |
+
}
|
53 |
+
// Get the total number of records.
|
54 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_widget_theme" . $where;
|
55 |
+
$total = $wpdb->get_var($query);
|
56 |
+
$pageNav['total'] = $total;
|
57 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
58 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_widget_theme" . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
|
59 |
+
$rows = $wpdb->get_results($query);
|
60 |
+
html_show_theme_calendar_widget($rows, $pageNav, $sort);
|
61 |
+
}
|
62 |
+
|
63 |
+
function apply_theme_calendar_widget($id) {
|
64 |
+
global $wpdb;
|
65 |
+
$title = ((isset($_POST["title"])) ? esc_html(stripslashes($_POST["title"])) : '');
|
66 |
+
$ev_title_color = ((isset($_POST["ev_title_color"])) ? esc_html(stripslashes($_POST["ev_title_color"])) : '');
|
67 |
+
$width = ((isset($_POST["width"])) ? esc_html($_POST["width"]) : '');
|
68 |
+
$week_start_day = ((isset($_POST["week_start_day"])) ? esc_html($_POST["week_start_day"]) : '');
|
69 |
+
$font_year = ((isset($_POST["font_year"])) ? esc_html($_POST["font_year"]) : '');
|
70 |
+
$font_month = ((isset($_POST["font_month"])) ? esc_html($_POST["font_month"]) : '');
|
71 |
+
$font_day = ((isset($_POST["font_day"])) ? esc_html($_POST["font_day"]) : '');
|
72 |
+
$font_weekday = ((isset($_POST["font_weekday"])) ? esc_html($_POST["font_weekday"]) : '');
|
73 |
+
$header_bgcolor = ((isset($_POST["header_bgcolor"])) ? esc_html($_POST["header_bgcolor"]) : '');
|
74 |
+
$footer_bgcolor = ((isset($_POST["footer_bgcolor"])) ? esc_html($_POST["footer_bgcolor"]) : '');
|
75 |
+
$text_color_month = ((isset($_POST["text_color_month"])) ? esc_html($_POST["text_color_month"]) : '');
|
76 |
+
$text_color_week_days = ((isset($_POST["text_color_week_days"])) ? esc_html($_POST["text_color_week_days"]) : '');
|
77 |
+
$text_color_other_months = ((isset($_POST["text_color_other_months"])) ? esc_html($_POST["text_color_other_months"]) : '');
|
78 |
+
$text_color_this_month_unevented = ((isset($_POST["text_color_this_month_unevented"])) ? esc_html($_POST["text_color_this_month_unevented"]) : '');
|
79 |
+
$text_color_this_month_evented = ((isset($_POST["text_color_this_month_evented"])) ? esc_html($_POST["text_color_this_month_evented"]) : '');
|
80 |
+
$bg_color_this_month_evented = ((isset($_POST["bg_color_this_month_evented"])) ? esc_html($_POST["bg_color_this_month_evented"]) : '');
|
81 |
+
$bg_color_selected = ((isset($_POST["bg_color_selected"])) ? esc_html($_POST["bg_color_selected"]) : '');
|
82 |
+
$arrow_color = ((isset($_POST["arrow_color"])) ? esc_html($_POST["arrow_color"]) : '');
|
83 |
+
$text_color_selected = ((isset($_POST["text_color_selected"])) ? esc_html($_POST["text_color_selected"]) : '');
|
84 |
+
$border_day = ((isset($_POST["border_day"])) ? esc_html($_POST["border_day"]) : '');
|
85 |
+
$text_color_sun_days = ((isset($_POST["text_color_sun_days"])) ? esc_html($_POST["text_color_sun_days"]) : '');
|
86 |
+
$weekdays_bg_color = ((isset($_POST["weekdays_bg_color"])) ? esc_html($_POST["weekdays_bg_color"]) : '');
|
87 |
+
$su_bg_color = ((isset($_POST["su_bg_color"])) ? esc_html($_POST["su_bg_color"]) : '');
|
88 |
+
$cell_border_color = ((isset($_POST["cell_border_color"])) ? esc_html($_POST["cell_border_color"]) : '');
|
89 |
+
$year_font_size = ((isset($_POST["year_font_size"])) ? esc_html($_POST["year_font_size"]) : '');
|
90 |
+
$year_font_color = ((isset($_POST["year_font_color"])) ? esc_html($_POST["year_font_color"]) : '');
|
91 |
+
$year_tabs_bg_color = ((isset($_POST["year_tabs_bg_color"])) ? esc_html($_POST["year_tabs_bg_color"]) : '');
|
92 |
+
|
93 |
+
$date_format = ((isset($_POST["date_format"])) ? esc_html($_POST["date_format"]) : '');
|
94 |
+
$title_color = ((isset($_POST["title_color"])) ? esc_html($_POST["title_color"]) : '');
|
95 |
+
$title_font_size = ((isset($_POST["title_font_size"])) ? esc_html($_POST["title_font_size"]) : '');
|
96 |
+
$title_font = ((isset($_POST["title_font"])) ? esc_html($_POST["title_font"]) : '');
|
97 |
+
$title_style = ((isset($_POST["title_style"])) ? esc_html($_POST["title_style"]) : '');
|
98 |
+
$date_color = ((isset($_POST["date_color"])) ? esc_html($_POST["date_color"]) : '');
|
99 |
+
$date_size = ((isset($_POST["date_size"])) ? esc_html($_POST["date_size"]) : '');
|
100 |
+
$date_font = ((isset($_POST["date_font"])) ? esc_html($_POST["date_font"]) : '');
|
101 |
+
$date_style = ((isset($_POST["date_style"])) ? esc_html($_POST["date_style"]) : '');
|
102 |
+
$next_prev_event_bgcolor = ((isset($_POST["next_prev_event_bgcolor"])) ? esc_html($_POST["next_prev_event_bgcolor"]) : '');
|
103 |
+
$next_prev_event_arrowcolor = ((isset($_POST["next_prev_event_arrowcolor"])) ? esc_html($_POST["next_prev_event_arrowcolor"]) : '');
|
104 |
+
$show_event_bgcolor = ((isset($_POST["show_event_bgcolor"])) ? esc_html($_POST["show_event_bgcolor"]) : '');
|
105 |
+
$popup_width = ((isset($_POST["popup_width"])) ? esc_html($_POST["popup_width"]) : '');
|
106 |
+
$popup_height = ((isset($_POST["popup_height"])) ? esc_html($_POST["popup_height"]) : '');
|
107 |
+
$show_repeat = ((isset($_POST["show_repeat"])) ? esc_html($_POST["show_repeat"]) : '');
|
108 |
+
if ($id === -1) {
|
109 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_widget_theme', array(
|
110 |
+
'id' => NULL,
|
111 |
+
'title' => $title,
|
112 |
+
'ev_title_color' => $ev_title_color,
|
113 |
+
'width' => $width,
|
114 |
+
'week_start_day' => $week_start_day,
|
115 |
+
'font_year' => $font_year,
|
116 |
+
'font_month' => $font_month,
|
117 |
+
'font_day' => $font_day,
|
118 |
+
'font_weekday' => $font_weekday,
|
119 |
+
'header_bgcolor' => $header_bgcolor,
|
120 |
+
'footer_bgcolor' => $footer_bgcolor,
|
121 |
+
'text_color_month' => $text_color_month,
|
122 |
+
'text_color_week_days' => $text_color_week_days,
|
123 |
+
'text_color_other_months' => $text_color_other_months,
|
124 |
+
'text_color_this_month_unevented' => $text_color_this_month_unevented,
|
125 |
+
'text_color_this_month_evented' => $text_color_this_month_evented,
|
126 |
+
'bg_color_this_month_evented' => $bg_color_this_month_evented,
|
127 |
+
'bg_color_selected' => $bg_color_selected,
|
128 |
+
'arrow_color' => $arrow_color,
|
129 |
+
'text_color_selected' => $text_color_selected,
|
130 |
+
'border_day' => $border_day,
|
131 |
+
'text_color_sun_days' => $text_color_sun_days,
|
132 |
+
'weekdays_bg_color' => $weekdays_bg_color,
|
133 |
+
'su_bg_color' => $su_bg_color,
|
134 |
+
'cell_border_color' => $cell_border_color,
|
135 |
+
'year_font_size' => $year_font_size,
|
136 |
+
'year_font_color' => $year_font_color,
|
137 |
+
'year_tabs_bg_color' => $year_tabs_bg_color,
|
138 |
+
'date_format' => $date_format,
|
139 |
+
'title_color' => $title_color,
|
140 |
+
'title_font_size' => $title_font_size,
|
141 |
+
'title_font' => $title_font,
|
142 |
+
'title_style' => $title_style,
|
143 |
+
'date_color' => $date_color,
|
144 |
+
'date_size' => $date_size,
|
145 |
+
'date_font' => $date_font,
|
146 |
+
'date_style' => $date_style,
|
147 |
+
'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
|
148 |
+
'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
|
149 |
+
'show_event_bgcolor' => $show_event_bgcolor,
|
150 |
+
'popup_width' => $popup_width,
|
151 |
+
'popup_height' => $popup_height,
|
152 |
+
'show_repeat' => $show_repeat,
|
153 |
+
), array(
|
154 |
+
'%s',
|
155 |
+
'%s',
|
156 |
+
'%s',
|
157 |
+
'%s',
|
158 |
+
'%s',
|
159 |
+
'%s',
|
160 |
+
'%s',
|
161 |
+
'%s',
|
162 |
+
'%s',
|
163 |
+
'%s',
|
164 |
+
'%s',
|
165 |
+
'%s',
|
166 |
+
'%s',
|
167 |
+
'%s',
|
168 |
+
'%s',
|
169 |
+
'%s',
|
170 |
+
'%s',
|
171 |
+
'%s',
|
172 |
+
'%s',
|
173 |
+
'%s',
|
174 |
+
'%s',
|
175 |
+
'%s',
|
176 |
+
'%s',
|
177 |
+
'%s',
|
178 |
+
'%s',
|
179 |
+
'%s',
|
180 |
+
'%s',
|
181 |
+
'%s',
|
182 |
+
'%s',
|
183 |
+
'%s',
|
184 |
+
'%s',
|
185 |
+
'%s',
|
186 |
+
'%s',
|
187 |
+
'%s',
|
188 |
+
'%s',
|
189 |
+
'%s',
|
190 |
+
'%s',
|
191 |
+
'%s',
|
192 |
+
'%s',
|
193 |
+
'%s',
|
194 |
+
'%s',
|
195 |
+
'%s',
|
196 |
+
'%s'
|
197 |
+
));
|
198 |
+
}
|
199 |
+
else {
|
200 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_widget_theme', array(
|
201 |
+
'title' => $title,
|
202 |
+
'ev_title_color' => $ev_title_color,
|
203 |
+
'width' => $width,
|
204 |
+
'week_start_day' => $week_start_day,
|
205 |
+
'font_year' => $font_year,
|
206 |
+
'font_month' => $font_month,
|
207 |
+
'font_day' => $font_day,
|
208 |
+
'font_weekday' => $font_weekday,
|
209 |
+
'header_bgcolor' => $header_bgcolor,
|
210 |
+
'footer_bgcolor' => $footer_bgcolor,
|
211 |
+
'text_color_month' => $text_color_month,
|
212 |
+
'text_color_week_days' => $text_color_week_days,
|
213 |
+
'text_color_other_months' => $text_color_other_months,
|
214 |
+
'text_color_this_month_unevented' => $text_color_this_month_unevented,
|
215 |
+
'text_color_this_month_evented' => $text_color_this_month_evented,
|
216 |
+
'bg_color_this_month_evented' => $bg_color_this_month_evented,
|
217 |
+
'bg_color_selected' => $bg_color_selected,
|
218 |
+
'arrow_color' => $arrow_color,
|
219 |
+
'text_color_selected' => $text_color_selected,
|
220 |
+
'border_day' => $border_day,
|
221 |
+
'text_color_sun_days' => $text_color_sun_days,
|
222 |
+
'weekdays_bg_color' => $weekdays_bg_color,
|
223 |
+
'su_bg_color' => $su_bg_color,
|
224 |
+
'cell_border_color' => $cell_border_color,
|
225 |
+
'year_font_size' => $year_font_size,
|
226 |
+
'year_font_color' => $year_font_color,
|
227 |
+
'year_tabs_bg_color' => $year_tabs_bg_color,
|
228 |
+
'date_format' => $date_format,
|
229 |
+
'title_color' => $title_color,
|
230 |
+
'title_font_size' => $title_font_size,
|
231 |
+
'title_font' => $title_font,
|
232 |
+
'title_style' => $title_style,
|
233 |
+
'date_color' => $date_color,
|
234 |
+
'date_size' => $date_size,
|
235 |
+
'date_font' => $date_font,
|
236 |
+
'date_style' => $date_style,
|
237 |
+
'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
|
238 |
+
'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
|
239 |
+
'show_event_bgcolor' => $show_event_bgcolor,
|
240 |
+
'popup_width' => $popup_width,
|
241 |
+
'popup_height' => $popup_height,
|
242 |
+
'show_repeat' => $show_repeat,
|
243 |
+
), array('id' => $id), array(
|
244 |
+
'%s',
|
245 |
+
'%s',
|
246 |
+
'%s',
|
247 |
+
'%s',
|
248 |
+
'%s',
|
249 |
+
'%s',
|
250 |
+
'%s',
|
251 |
+
'%s',
|
252 |
+
'%s',
|
253 |
+
'%s',
|
254 |
+
'%s',
|
255 |
+
'%s',
|
256 |
+
'%s',
|
257 |
+
'%s',
|
258 |
+
'%s',
|
259 |
+
'%s',
|
260 |
+
'%s',
|
261 |
+
'%s',
|
262 |
+
'%s',
|
263 |
+
'%s',
|
264 |
+
'%s',
|
265 |
+
'%s',
|
266 |
+
'%s',
|
267 |
+
'%s',
|
268 |
+
'%s',
|
269 |
+
'%s',
|
270 |
+
'%s',
|
271 |
+
'%s',
|
272 |
+
'%s',
|
273 |
+
'%s',
|
274 |
+
'%s',
|
275 |
+
'%s',
|
276 |
+
'%s',
|
277 |
+
'%s',
|
278 |
+
'%s',
|
279 |
+
'%s',
|
280 |
+
'%s',
|
281 |
+
'%s',
|
282 |
+
'%s',
|
283 |
+
'%s',
|
284 |
+
'%s',
|
285 |
+
'%s'
|
286 |
+
), array('%d'));
|
287 |
+
}
|
288 |
+
if ($save_or_no === FALSE) {
|
289 |
+
?>
|
290 |
+
<div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
|
291 |
+
<?php
|
292 |
+
return FALSE;
|
293 |
+
}
|
294 |
+
else {
|
295 |
+
?>
|
296 |
+
<div class="updated"><p><strong>Widget Theme Saved.</strong></p></div>
|
297 |
+
<?php
|
298 |
+
return TRUE;
|
299 |
+
}
|
300 |
+
}
|
301 |
+
|
302 |
+
function edit_theme_calendar_widget($id) {
|
303 |
+
global $wpdb;
|
304 |
+
if ($id == 0) {
|
305 |
+
$row = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=1');
|
306 |
+
}
|
307 |
+
else {
|
308 |
+
$row = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=' . $id);
|
309 |
+
}
|
310 |
+
html_edit_theme_calendar_widget($row, $id);
|
311 |
+
}
|
312 |
+
|
313 |
+
function remove_theme_calendar_widget($id) {
|
314 |
+
if ($id > 0 && $id < 7) {
|
315 |
+
?>
|
316 |
+
<div id="message" class="error"><p>You can't delete deafult theme.</p></div>
|
317 |
+
<?php
|
318 |
+
return FALSE;
|
319 |
+
}
|
320 |
+
global $wpdb;
|
321 |
+
$sql_remove_tag = "DELETE FROM " . $wpdb->prefix . "spidercalendar_widget_theme WHERE id='" . $id . "'";
|
322 |
+
if (!$wpdb->query($sql_remove_tag)) {
|
323 |
+
?>
|
324 |
+
<div id="message" class="error"><p>Spider Calendar Theme Not Deleted.</p></div>
|
325 |
+
<?php
|
326 |
+
}
|
327 |
+
else {
|
328 |
+
?>
|
329 |
+
<div class="updated"><p><strong>Item Deleted.</strong></p></div>
|
330 |
+
<?php
|
331 |
+
}
|
332 |
+
}
|
333 |
+
|
334 |
+
?>
|