The Events Calendar - Version 1.5

Version Description

  • Fixed a whole pile of small bugs.
  • Extract Eventbrite from the Events calendar into a stand alone plugin
  • Add donate links
  • Add settings panel ** Default View (calendar or list) for categories ** Default country for events ** Donate toggle on/off
  • Upgrade for WP 2.9
Download this release

Release Info

Developer peterchester
Plugin Icon The Events Calendar
Version 1.5
Comparing to
See all releases

Version 1.5

readme.txt ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === The Events Calendar ===
2
+
3
+ Contributors: Kelsey Damas, Matt Wiebe, Justin Endler, Reid Peifer produced by Shane & Peter, Inc.
4
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=10750983
5
+ Tags: widget, events, simple, tooltips, grid, month, list, calendar, event, venue, eventbrite, registration, tickets, ticketing, eventbright, api, dates, date, plugin, posts, sidebar, template, theme, time, google maps, google, maps, conference, workshop, concert, meeting, seminar, summit, forum
6
+ Requires at least: 2.8
7
+ Tested up to: 2.9.1
8
+ Stable tag: 1.5
9
+
10
+ == Description ==
11
+
12
+ The Events Calendar plugin enables you to rapidly create and manage events using the post editor. Features include optional Eventbrite integration, Google Maps integration as well as default templates such as a calendar grid and event list for streamlined one click installation.
13
+
14
+ = The Events Calendar =
15
+
16
+ * Manage event details right from your post editor
17
+ * Upcoming Events Widget
18
+ * Provides full template out of the box (month and list view)
19
+ * Extensive template tags for customization
20
+ * MU Compatible
21
+ * Google Maps Integration
22
+ * Posts are automatically moved to the top of the loop on the day of the event
23
+ * Month view with tooltips
24
+ * Includes support for venue, cost, address, start and end time, google maps link
25
+ * Support for international addresses and time
26
+ * Optional Ticketing With Eventbrite Integration - http://www.eventbrite.com/ - though the Eventbrite for The Events Calendar plugin (http://wordpress.org/extend/plugins/eventbrite-for-the-events-calendar/).
27
+
28
+ = Upcoming Features =
29
+
30
+ * Option to disable re-posting of event
31
+ * Repeated events
32
+ * Language files
33
+ * Dynamic categories (rather than requiring the use of event)
34
+ * Event subcategories
35
+ * A bunch of UI cleanup
36
+
37
+ Please visit the forum for feature suggestions: http://wordpress.org/tags/the-events-calendar/
38
+
39
+ This plugin is actively supported and we will do our best to help you. In return we simply as 2 things:
40
+
41
+ 1. Donate - if this is generating enough revenue to support our time it makes all the difference in the world
42
+ 1. If you make a new account with Eventbrite, please use our referral code. It helps, believe me: http://www.eventbrite.com/r/simpleevents
43
+
44
+ == Installation ==
45
+
46
+ = Install =
47
+
48
+ 1. Unzip the `the-events-calendar.zip` file.
49
+ 1. Upload the the `the-events-calendar` folder (not just the files in it!) to your `wp-contents/plugins` folder. If you're using FTP, use 'binary' mode.
50
+ 1. Update your permalinks to ensure that the event specific rewrite rules take effect.
51
+
52
+ = Activate =
53
+
54
+ No setup required. Just plug and play!
55
+
56
+ = Requirements =
57
+
58
+ PHP 5 ONLY!!!
59
+
60
+ = Advanced =
61
+
62
+ The built in template can be overridden by files within your template.
63
+
64
+ = Default vs. Custom Templates =
65
+
66
+ The Events Calendar plugin now comes with default templates for the list view, grid view and single post view. If you would like to alter them, create a new folder called "events" in your template directory and copy over the following files from within the plugin folder (simple-events/views/):
67
+
68
+ * gridview.php
69
+ * list.php
70
+ * single.php
71
+
72
+ Edit the new files to your hearts content. Please do not edit the one's in the plugin folder as that will cause conflicts when you update the plugin to the latest release.
73
+
74
+ = Supported Variables and URLs =
75
+
76
+ This plugin registers the following rewrite rules, which controls which posts are available in the loop. The number of posts returned defaults to 10, but is configurable by the $count parameter to get_events().
77
+
78
+ Events/Upcoming
79
+ &cat=<eventcategory>&eventDisplay=upcoming
80
+
81
+ Displays events starting today in ascending date order.
82
+
83
+ Events/Past
84
+ &cat=<eventcategory>&eventDisplay=past
85
+
86
+ Displays events that started before today in descending date order.
87
+
88
+ Events/2010-01-02
89
+ &cat=<eventcategory>&eventDisplay=bydate&eventDate=2010-01-02
90
+
91
+ Displays only events that start on Jan 2, 2010.
92
+
93
+ = Template Tags =
94
+
95
+ **the_event_start_date( $id )**
96
+ **the_event_end_date( $id )**
97
+ **the_event_cost( $id )**
98
+ **the_event_venue( $id )**
99
+ **the_event_address( $id )**
100
+ **the_event_city( $id )**
101
+ **the_event_state( $id )**
102
+ **the_event_province( $id )**
103
+ **the_event_zip( $id )**
104
+ **the_event_country( $id )**
105
+ **the_event_phone( $id )**
106
+
107
+ These functions will return the metadata associated with the event. The ID is optional.
108
+
109
+ **event_google_map_link( $id )**
110
+ **get_event_google_map_link( $id )**
111
+
112
+ Echos or returns, respectively, an http:// link to google maps for the event's address. The ID is optional.
113
+
114
+ **get_jump_to_date_calendar( )**
115
+
116
+ Returns a string containing a javascript date calendar.
117
+
118
+ **is_event( $id )**
119
+
120
+ Returns true or false if the current post is an event. ID is optional.
121
+
122
+ **is_featured_event( $id )**
123
+
124
+ Returns true or false if the current post is a featured event. ID is optional.
125
+
126
+ **event_style( $id )**
127
+ **get_event_style( $id )**
128
+
129
+ Echos or returns, respectively, the event class specified in the admin panel. ID is optional.
130
+
131
+ **is_new_event_day()**
132
+
133
+ Called inside of the loop, returns true if the current post's meta_value (EventStartDate) is different than the previous post. Will always return true for the first event in the loop.
134
+
135
+ **get_events( $count )**
136
+
137
+ Call this function in a template to query the events and start the loop. Do not subsequently call the_post() in your template, as this will start the loop twice and then you're in trouble.
138
+
139
+ http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query#Query_based_on_Custom_Field_and_Category
140
+
141
+ **events_displaying_past()**
142
+
143
+ returns true if the query is set for past events
144
+
145
+ For those of you who have the Eventbrite plugin turned on:
146
+
147
+ **the_event_tickets( $id, $width, $height)**
148
+
149
+ This returns an EventBrite.com embedded ticket sales inline (not wordpress) widget
150
+
151
+ = Top of the Loop Cron =
152
+
153
+ On the day of the event (at midnight) the plugin runs a cron which updates the post date to show the even at the top of the loop.
154
+
155
+ == Screenshots ==
156
+
157
+ 1. Grid View Template
158
+ 1. List View Template
159
+ 1. Single Post Template
160
+ 1. Settings Panel
161
+ 1. Post (Event) Editor
162
+ 1. Widget Admin
163
+ 1. Unstyled Widget
164
+
165
+ == FAQ ==
166
+
167
+ = Where do I go to file a bug or ask a question? =
168
+
169
+ Please visit the forum for questions or comments: http://wordpress.org/tags/the-events-calendar/
170
+
171
+ == Changelog ==
172
+
173
+ = 1.5 =
174
+
175
+ * Fixed a whole pile of small bugs.
176
+ * Extract Eventbrite from the Events calendar into a stand alone plugin
177
+ * Add donate links
178
+ * Add settings panel
179
+ ** Default View (calendar or list) for categories
180
+ ** Default country for events
181
+ ** Donate toggle on/off
182
+ * Upgrade for WP 2.9
183
+
184
+ = 1.5 alpha =
185
+
186
+ * Plug and Play install including default templates (list view, grid view and post)
187
+ * Theme overwrite of default templates (see instructions)
188
+ * 12 hour / 24 hour time display options
189
+ * Work with all permalink styles
190
+ * Hide data from custom fields
191
+ * Hide Eventbrite sales box in post if there is are tickets
192
+ * Multiple javascript bug fixes
193
+ * Pull price for 1st ticket from general event price
194
+ * Add some basic error messages from Eventbrite (much more to come)
195
+ * Remove dependencies on other S&P plugins
196
+
197
+ = 1.4.1 =
198
+
199
+ * Featured event checkbox and template tag is_featured_event()
200
+
201
+ = 1.4 =
202
+
203
+ * Grid View
204
+ * Additional Internationalization support added
205
+
206
+ = 1.3 =
207
+
208
+ * Built events list widget
209
+
210
+ = 1.2 =
211
+
212
+ * Added Internationalization (translation) support
213
+ * Added international addresses
214
+ * Extracted from S&P core plugin to stand alone.
215
+
resources/events.css ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .category-events #content {
2
+ background:#fff;
3
+ width:670px;
4
+ padding:1px 35px;
5
+ margin-left:10px;
6
+ }
7
+ #eventsCalendarHeader {
8
+ position:relative;
9
+ margin-bottom:18px;
10
+ }
11
+ .calendarButtons {
12
+ position:absolute;
13
+ right:0;
14
+ top:6px;
15
+ }
16
+ h2.cal-title {
17
+ float:left;
18
+ padding-right:15px;
19
+ }
20
+ .calendarButtons a {
21
+ background:#999;
22
+ display:block;
23
+ height:27px;
24
+ width:85px;
25
+ text-align:center;
26
+ float:left;
27
+ color:#fff;
28
+ line-height:27px;
29
+ margin:21px 0 24px 10px;
30
+ font-weight:bold;
31
+ font-size:11px;
32
+ text-transform:uppercase;
33
+ text-shadow:1px 1px 0 rgba(0,0,0,.5);
34
+ -moz-border-radius:3px;
35
+ -webkit-border-radius:3px;
36
+ border-radius:3px;
37
+ }
38
+ .upcoming a.listview, .grid a.gridview {
39
+ background:#0F81BB;
40
+ }
41
+ #nav-above {
42
+ margin:5px 0 0;
43
+ }
44
+
45
+ .category-events #nav-below {
46
+ margin:21px 0;
47
+ }
48
+ select.events-dropdown {
49
+ width:auto;
50
+ font-size:11px;
51
+ margin:33px 9px 0 0;
52
+ }
53
+ .category-events .post {
54
+ padding:0 0 12px 10px;
55
+ overflow:hidden;
56
+ margin-bottom:0;
57
+ }
58
+ .category-events .upcoming .entry-title {
59
+ font-size:15px;
60
+ margin:15px 0 6px;
61
+ }
62
+ .category-events .entry-title a, .event-meta-desc, .event-day {
63
+ color:#555;
64
+ }
65
+ .category-events .post.alt {
66
+ background:#f9f9f9;
67
+ border-width:0;
68
+ }
69
+ table.calendar {
70
+ margin:18px 0 12px;
71
+ clear:both;
72
+ font-size:12px;
73
+ border-collapse:collapse;
74
+ border:1px solid #aaa;
75
+ }
76
+ .calendar .daynum {
77
+ background-color: #eee;
78
+ color:#333;
79
+ font-size:10px;
80
+ padding:3px 9px;
81
+ }
82
+ .calendar th {
83
+ width: 250px;
84
+ height: 10px;
85
+ background: #999 url(images/grid-th-bg.png) repeat-x;
86
+ color: #fff;
87
+ padding:4px 0;
88
+ text-shadow:1px 1px 0 rgba(0,0,0,.5);
89
+ text-align:center;
90
+ }
91
+ .calendar td {
92
+ height: 100px;
93
+ width:14.28%;
94
+ color: #114B7D;
95
+ vertical-align: top;
96
+ border:1px solid #aaa;
97
+ padding:0;
98
+ }
99
+ .calendar td .event {
100
+ padding:6px 9px;
101
+ line-height:1.2;
102
+ }
103
+ .calendar td a {
104
+ font-size:91.7%;
105
+ }
106
+ .calendar hr {
107
+ border:0 none !important;
108
+ display:block;
109
+ height:1px;
110
+ background-color:#D4DBCC;
111
+ margin:0 9px;
112
+ }
113
+ .calendar .event {
114
+ position:relative;
115
+ }
116
+ .calendar .tooltip {
117
+ border:1px solid #666;
118
+ position:absolute;
119
+ z-index:1001;
120
+ bottom:30px;
121
+ left:3px;
122
+ width:320px;
123
+ background-color:#f9f9f9;
124
+ color:#333;
125
+ line-height:1.4;
126
+ }
127
+ .tooltip .arrow {
128
+ width:19px;
129
+ height:11px;
130
+ display:block;
131
+ background:url(images/tooltip-arrow.png) no-repeat 0 bottom;
132
+ position:absolute;
133
+ bottom:-11px;
134
+ left:20px;
135
+ }
136
+ .calendar .right .tooltip {
137
+ left:auto;
138
+ right:3px;
139
+ }
140
+ .right .tooltip .arrow {
141
+ left:auto;
142
+ right:30px;
143
+ }
144
+ .tooltip .event-title {
145
+ margin:0;
146
+ color:#fff;
147
+ background:#418ccf url(images/tooltip-title.png) repeat-x;
148
+ font-size:12px;
149
+ padding:0 6px;
150
+ height:24px;
151
+ line-height:24px;
152
+ }
153
+ .tooltip .event-body {
154
+ font-size:11px;
155
+ padding:3px 6px 6px;
156
+ }
157
+ .tooltip .event-date {
158
+ font-style:italic;
159
+ margin:3px 0;
160
+ }
161
+
162
+ .event .post {
163
+ position:relative;
164
+ }
165
+ #event-meta {
166
+ border-width:1px 0;
167
+ border-style:solid;
168
+ border-color:#aaa;
169
+ margin:18px 0 12px;
170
+ padding:12px 0;
171
+ overflow:hidden;
172
+ clear:both;
173
+ }
174
+ #event-meta .column {
175
+ float:left;
176
+ width:45%;
177
+ padding:0 4% 0 0;
178
+ text-align:left;
179
+ margin:0;
180
+ }
181
+ #event-meta dt {
182
+ float:left;
183
+ clear:left;
184
+ font-weight:bold;
185
+ width:70px;
186
+ }
187
+ #event-meta dd {
188
+ padding:0;
189
+ margin-left:70px;
190
+ }
191
+ #event-meta .gmap, .event-meta-desc .gmap {
192
+ color:#fff;
193
+ font-size:9px;
194
+ background:#3D6294;
195
+ padding:1px 3px;
196
+ -moz-border-radius:2px;
197
+ -webkit-border-radius:2px;
198
+ border-radius:2px;
199
+ }
200
+ span.back {
201
+ margin:12px 0 0;
202
+ }
203
+ #events-loop {
204
+ font-size:13px;
205
+ clear:both;
206
+ }
207
+ .events .event-entry {
208
+ width:60%;
209
+ float:left;
210
+ padding:0 5% 0 0;
211
+ }
212
+ .events .event-list-meta {
213
+ float:right;
214
+ border-left:1px solid #ccc;
215
+ padding:0 0 0 4%;
216
+ width:30%;
217
+ font-size:12px;
218
+ margin-bottom:20px;
219
+ }
220
+ .event-list-meta table {
221
+ border-collapse:collapse;
222
+ }
223
+ .event-list-meta td {
224
+ vertical-align:top;
225
+ padding-bottom:4px;
226
+ text-align:left;
227
+ }
228
+ .event-meta-desc {
229
+ font-weight:bold;
230
+ padding-right:12px;
231
+ width:64px;
232
+ }
233
+ h4.event-day {
234
+ font-weight:bold;
235
+ font-size:18px;
236
+ margin:12px 0 -3px;
237
+ clear:both;
238
+ }
239
+ h4.event-day + .post .entry-title {
240
+ margin-top:6px;
241
+ }
242
+
243
+ #eventbrite-embed {
244
+ width:100%;
245
+ min-height:225px;
246
+ margin:24px 0;
247
+ }
248
+
249
+ .clearfix:after {
250
+ content: ".";
251
+ display: block;
252
+ height: 0;
253
+ clear: both;
254
+ visibility: hidden;
255
+ }
256
+ .clearfix {
257
+ zoom:1; /* For IE */
258
+ }
resources/events.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+ // prepare calendar for popups
3
+ $("table.calendar tbody tr").each(function(index) {
4
+ // add a class of "right" to Friday & Saturday so tooltips stay onscreen
5
+ $(this).find("td:gt(3)").addClass("right");
6
+ });
7
+
8
+
9
+ // popups
10
+ $("table.calendar .event a").hover(function() {
11
+
12
+ // one for IE6, one for everybody else
13
+ if ($.browser.msie && $.browser.version == 6.0) {
14
+ var bottomPad = $(this).parents("td").outerHeight() + 5;
15
+ }
16
+ else {
17
+ var bottomPad = $(this).outerHeight() + 18;
18
+ }
19
+
20
+ $(this).next(".tooltip").css('bottom', bottomPad).fadeIn(300);
21
+ }, function() {
22
+ $(this).next(".tooltip").fadeOut(100);
23
+ });
24
+ });
resources/events.mo ADDED
File without changes
resources/events.pot ADDED
@@ -0,0 +1,1460 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) 2009 Shane Pearlman, Kelsey Damas, Produced by Shane & Peter Inc.
3
+ # This file is distributed under the same license as the PACKAGE package.
4
+ # Kelsey Damas <kelsey.damas@gmail.com> 2009
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: Simple Events 1.3\n"
10
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/events\n"
11
+ "POT-Creation-Date: 2009-07-24 15:57-0700\n"
12
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "MIME-Version: 1.0\n"
16
+ "Content-Type: text/plain; charset=CHARSET\n"
17
+ "Content-Transfer-Encoding: 8bit\n"
18
+
19
+ #: events.php:419
20
+ msgid "Events"
21
+ msgstr ""
22
+
23
+ #: events.php:980
24
+ msgid "m.d.Y"
25
+ msgstr ""
26
+
27
+ #: events.php:1149
28
+ msgid "A widget that displays the next upcoming x events."
29
+ msgstr ""
30
+
31
+ #: events.php:1252
32
+ msgid "A calendar of your events"
33
+ msgstr ""
34
+
35
+ #: events.php:1253
36
+ msgid "Events Calendar"
37
+ msgstr ""
38
+
39
+ #: events.php:1279 views/events-list-load-widget-admin.php:3
40
+ msgid "Title:"
41
+ msgstr ""
42
+
43
+ #: views/events-list-load-widget-admin.php:8
44
+ msgid "Show:"
45
+ msgstr ""
46
+
47
+ #: views/events-list-load-widget-admin.php:20
48
+ msgid "Start Date & Time"
49
+ msgstr ""
50
+
51
+ #: views/events-list-load-widget-admin.php:21
52
+ msgid "End Date & Time"
53
+ msgstr ""
54
+
55
+ #: views/events-list-load-widget-admin.php:22
56
+ msgid "Venue"
57
+ msgstr ""
58
+
59
+ #: views/events-list-load-widget-admin.php:23
60
+ msgid "Address"
61
+ msgstr ""
62
+
63
+ #: views/events-list-load-widget-admin.php:24
64
+ msgid "City"
65
+ msgstr ""
66
+
67
+ #: views/events-list-load-widget-admin.php:25
68
+ msgid "State (US)"
69
+ msgstr ""
70
+
71
+ #: views/events-list-load-widget-admin.php:26
72
+ msgid "Province (Int)"
73
+ msgstr ""
74
+
75
+ #: views/events-list-load-widget-admin.php:27
76
+ msgid "Postal Code"
77
+ msgstr ""
78
+
79
+ #: views/events-list-load-widget-admin.php:28
80
+ msgid "Country"
81
+ msgstr ""
82
+
83
+ #: views/events-list-load-widget-admin.php:29
84
+ msgid "Phone"
85
+ msgstr ""
86
+
87
+ #: views/events-list-load-widget-admin.php:30
88
+ msgid "Price"
89
+ msgstr ""
90
+
91
+ #: views/events-meta-box.php:1
92
+ msgid "Event Details:"
93
+ msgstr ""
94
+
95
+ #: views/events-meta-box.php:3
96
+ msgid "Is this post an event?"
97
+ msgstr ""
98
+
99
+ #: views/events-meta-box.php:9
100
+ msgid "Start Date / Time:"
101
+ msgstr ""
102
+
103
+ #: views/events-meta-box.php:19 views/events-meta-box.php:42
104
+ msgid "@"
105
+ msgstr ""
106
+
107
+ #: views/events-meta-box.php:32
108
+ msgid "End Date / Time:"
109
+ msgstr ""
110
+
111
+ #: views/events-meta-box.php:55
112
+ msgid "Venue:"
113
+ msgstr ""
114
+
115
+ #: views/events-meta-box.php:59
116
+ msgid "Country:"
117
+ msgstr ""
118
+
119
+ #: views/events-meta-box.php:62
120
+ msgid "United States"
121
+ msgstr ""
122
+
123
+ #: views/events-meta-box.php:63
124
+ msgid "Afghanistan"
125
+ msgstr ""
126
+
127
+ #: views/events-meta-box.php:64
128
+ msgid "Albania"
129
+ msgstr ""
130
+
131
+ #: views/events-meta-box.php:65
132
+ msgid "Algeria"
133
+ msgstr ""
134
+
135
+ #: views/events-meta-box.php:66
136
+ msgid "American Samoa"
137
+ msgstr ""
138
+
139
+ #: views/events-meta-box.php:67
140
+ msgid "Andorra"
141
+ msgstr ""
142
+
143
+ #: views/events-meta-box.php:68
144
+ msgid "Angola"
145
+ msgstr ""
146
+
147
+ #: views/events-meta-box.php:69
148
+ msgid "Anguilla"
149
+ msgstr ""
150
+
151
+ #: views/events-meta-box.php:70
152
+ msgid "Antarctica"
153
+ msgstr ""
154
+
155
+ #: views/events-meta-box.php:71
156
+ msgid "Antigua And Barbuda"
157
+ msgstr ""
158
+
159
+ #: views/events-meta-box.php:72
160
+ msgid "Argentina"
161
+ msgstr ""
162
+
163
+ #: views/events-meta-box.php:73
164
+ msgid "Armenia"
165
+ msgstr ""
166
+
167
+ #: views/events-meta-box.php:74
168
+ msgid "Aruba"
169
+ msgstr ""
170
+
171
+ #: views/events-meta-box.php:75
172
+ msgid "Australia"
173
+ msgstr ""
174
+
175
+ #: views/events-meta-box.php:76
176
+ msgid "Austria"
177
+ msgstr ""
178
+
179
+ #: views/events-meta-box.php:77
180
+ msgid "Azerbaijan"
181
+ msgstr ""
182
+
183
+ #: views/events-meta-box.php:78
184
+ msgid "Bahamas"
185
+ msgstr ""
186
+
187
+ #: views/events-meta-box.php:79
188
+ msgid "Bahrain"
189
+ msgstr ""
190
+
191
+ #: views/events-meta-box.php:80
192
+ msgid "Bangladesh"
193
+ msgstr ""
194
+
195
+ #: views/events-meta-box.php:81
196
+ msgid "Barbados"
197
+ msgstr ""
198
+
199
+ #: views/events-meta-box.php:82
200
+ msgid "Belarus"
201
+ msgstr ""
202
+
203
+ #: views/events-meta-box.php:83
204
+ msgid "Belgium"
205
+ msgstr ""
206
+
207
+ #: views/events-meta-box.php:84
208
+ msgid "Belize"
209
+ msgstr ""
210
+
211
+ #: views/events-meta-box.php:85
212
+ msgid "Benin"
213
+ msgstr ""
214
+
215
+ #: views/events-meta-box.php:86
216
+ msgid "Bermuda"
217
+ msgstr ""
218
+
219
+ #: views/events-meta-box.php:87
220
+ msgid "Bhutan"
221
+ msgstr ""
222
+
223
+ #: views/events-meta-box.php:88
224
+ msgid "Bolivia"
225
+ msgstr ""
226
+
227
+ #: views/events-meta-box.php:89
228
+ msgid "Bosnia And Herzegowina"
229
+ msgstr ""
230
+
231
+ #: views/events-meta-box.php:90
232
+ msgid "Botswana"
233
+ msgstr ""
234
+
235
+ #: views/events-meta-box.php:91
236
+ msgid "Bouvet Island"
237
+ msgstr ""
238
+
239
+ #: views/events-meta-box.php:92
240
+ msgid "Brazil"
241
+ msgstr ""
242
+
243
+ #: views/events-meta-box.php:93
244
+ msgid "British Indian Ocean Territory"
245
+ msgstr ""
246
+
247
+ #: views/events-meta-box.php:94
248
+ msgid "Brunei Darussalam"
249
+ msgstr ""
250
+
251
+ #: views/events-meta-box.php:95
252
+ msgid "Bulgaria"
253
+ msgstr ""
254
+
255
+ #: views/events-meta-box.php:96
256
+ msgid "Burkina Faso"
257
+ msgstr ""
258
+
259
+ #: views/events-meta-box.php:97
260
+ msgid "Burundi"
261
+ msgstr ""
262
+
263
+ #: views/events-meta-box.php:98
264
+ msgid "Cambodia"
265
+ msgstr ""
266
+
267
+ #: views/events-meta-box.php:99
268
+ msgid "Cameroon"
269
+ msgstr ""
270
+
271
+ #: views/events-meta-box.php:100
272
+ msgid "Canada"
273
+ msgstr ""
274
+
275
+ #: views/events-meta-box.php:101
276
+ msgid "Cape Verde"
277
+ msgstr ""
278
+
279
+ #: views/events-meta-box.php:102
280
+ msgid "Cayman Islands"
281
+ msgstr ""
282
+
283
+ #: views/events-meta-box.php:103
284
+ msgid "Central African Republic"
285
+ msgstr ""
286
+
287
+ #: views/events-meta-box.php:104
288
+ msgid "Chad"
289
+ msgstr ""
290
+
291
+ #: views/events-meta-box.php:105
292
+ msgid "Chile"
293
+ msgstr ""
294
+
295
+ #: views/events-meta-box.php:106
296
+ msgid "China"
297
+ msgstr ""
298
+
299
+ #: views/events-meta-box.php:107
300
+ msgid "Christmas Island"
301
+ msgstr ""
302
+
303
+ #: views/events-meta-box.php:108
304
+ msgid "Cocos (Keeling) Islands"
305
+ msgstr ""
306
+
307
+ #: views/events-meta-box.php:109
308
+ msgid "Colombia"
309
+ msgstr ""
310
+
311
+ #: views/events-meta-box.php:110
312
+ msgid "Comoros"
313
+ msgstr ""
314
+
315
+ #: views/events-meta-box.php:111
316
+ msgid "Congo"
317
+ msgstr ""
318
+
319
+ #: views/events-meta-box.php:112
320
+ msgid "Congo, The Democratic Republic Of The"
321
+ msgstr ""
322
+
323
+ #: views/events-meta-box.php:113
324
+ msgid "Cook Islands"
325
+ msgstr ""
326
+
327
+ #: views/events-meta-box.php:114
328
+ msgid "Costa Rica"
329
+ msgstr ""
330
+
331
+ #: views/events-meta-box.php:115
332
+ msgid "Cote D'Ivoire"
333
+ msgstr ""
334
+
335
+ #: views/events-meta-box.php:116
336
+ msgid "Croatia (Local Name: Hrvatska)"
337
+ msgstr ""
338
+
339
+ #: views/events-meta-box.php:117
340
+ msgid "Cuba"
341
+ msgstr ""
342
+
343
+ #: views/events-meta-box.php:118
344
+ msgid "Cyprus"
345
+ msgstr ""
346
+
347
+ #: views/events-meta-box.php:119
348
+ msgid "Czech Republic"
349
+ msgstr ""
350
+
351
+ #: views/events-meta-box.php:120
352
+ msgid "Denmark"
353
+ msgstr ""
354
+
355
+ #: views/events-meta-box.php:121
356
+ msgid "Djibouti"
357
+ msgstr ""
358
+
359
+ #: views/events-meta-box.php:122
360
+ msgid "Dominica"
361
+ msgstr ""
362
+
363
+ #: views/events-meta-box.php:123
364
+ msgid "Dominican Republic"
365
+ msgstr ""
366
+
367
+ #: views/events-meta-box.php:124
368
+ msgid "East Timor"
369
+ msgstr ""
370
+
371
+ #: views/events-meta-box.php:125
372
+ msgid "Ecuador"
373
+ msgstr ""
374
+
375
+ #: views/events-meta-box.php:126
376
+ msgid "Egypt"
377
+ msgstr ""
378
+
379
+ #: views/events-meta-box.php:127
380
+ msgid "El Salvador"
381
+ msgstr ""
382
+
383
+ #: views/events-meta-box.php:128
384
+ msgid "Equatorial Guinea"
385
+ msgstr ""
386
+
387
+ #: views/events-meta-box.php:129
388
+ msgid "Eritrea"
389
+ msgstr ""
390
+
391
+ #: views/events-meta-box.php:130
392
+ msgid "Estonia"
393
+ msgstr ""
394
+
395
+ #: views/events-meta-box.php:131
396
+ msgid "Ethiopia"
397
+ msgstr ""
398
+
399
+ #: views/events-meta-box.php:132
400
+ msgid "Falkland Islands (Malvinas)"
401
+ msgstr ""
402
+
403
+ #: views/events-meta-box.php:133
404
+ msgid "Faroe Islands"
405
+ msgstr ""
406
+
407
+ #: views/events-meta-box.php:134
408
+ msgid "Fiji"
409
+ msgstr ""
410
+
411
+ #: views/events-meta-box.php:135
412
+ msgid "Finland"
413
+ msgstr ""
414
+
415
+ #: views/events-meta-box.php:136
416
+ msgid "France"
417
+ msgstr ""
418
+
419
+ #: views/events-meta-box.php:137
420
+ msgid "France, Metropolitan"
421
+ msgstr ""
422
+
423
+ #: views/events-meta-box.php:138
424
+ msgid "French Guiana"
425
+ msgstr ""
426
+
427
+ #: views/events-meta-box.php:139
428
+ msgid "French Polynesia"
429
+ msgstr ""
430
+
431
+ #: views/events-meta-box.php:140
432
+ msgid "French Southern Territories"
433
+ msgstr ""
434
+
435
+ #: views/events-meta-box.php:141
436
+ msgid "Gabon"
437
+ msgstr ""
438
+
439
+ #: views/events-meta-box.php:142
440
+ msgid "Gambia"
441
+ msgstr ""
442
+
443
+ #: views/events-meta-box.php:143 views/events-meta-box.php:335
444
+ msgid "Georgia"
445
+ msgstr ""
446
+
447
+ #: views/events-meta-box.php:144
448
+ msgid "Germany"
449
+ msgstr ""
450
+
451
+ #: views/events-meta-box.php:145
452
+ msgid "Ghana"
453
+ msgstr ""
454
+
455
+ #: views/events-meta-box.php:146
456
+ msgid "Gibraltar"
457
+ msgstr ""
458
+
459
+ #: views/events-meta-box.php:147
460
+ msgid "Greece"
461
+ msgstr ""
462
+
463
+ #: views/events-meta-box.php:148
464
+ msgid "Greenland"
465
+ msgstr ""
466
+
467
+ #: views/events-meta-box.php:149
468
+ msgid "Grenada"
469
+ msgstr ""
470
+
471
+ #: views/events-meta-box.php:150
472
+ msgid "Guadeloupe"
473
+ msgstr ""
474
+
475
+ #: views/events-meta-box.php:151
476
+ msgid "Guam"
477
+ msgstr ""
478
+
479
+ #: views/events-meta-box.php:152
480
+ msgid "Guatemala"
481
+ msgstr ""
482
+
483
+ #: views/events-meta-box.php:153
484
+ msgid "Guinea"
485
+ msgstr ""
486
+
487
+ #: views/events-meta-box.php:154
488
+ msgid "Guinea-Bissau"
489
+ msgstr ""
490
+
491
+ #: views/events-meta-box.php:155
492
+ msgid "Guyana"
493
+ msgstr ""
494
+
495
+ #: views/events-meta-box.php:156
496
+ msgid "Haiti"
497
+ msgstr ""
498
+
499
+ #: views/events-meta-box.php:157
500
+ msgid "Heard And Mc Donald Islands"
501
+ msgstr ""
502
+
503
+ #: views/events-meta-box.php:158
504
+ msgid "Holy See (Vatican City State)"
505
+ msgstr ""
506
+
507
+ #: views/events-meta-box.php:159
508
+ msgid "Honduras"
509
+ msgstr ""
510
+
511
+ #: views/events-meta-box.php:160
512
+ msgid "Hong Kong"
513
+ msgstr ""
514
+
515
+ #: views/events-meta-box.php:161
516
+ msgid "Hungary"
517
+ msgstr ""
518
+
519
+ #: views/events-meta-box.php:162
520
+ msgid "Iceland"
521
+ msgstr ""
522
+
523
+ #: views/events-meta-box.php:163
524
+ msgid "India"
525
+ msgstr ""
526
+
527
+ #: views/events-meta-box.php:164
528
+ msgid "Indonesia"
529
+ msgstr ""
530
+
531
+ #: views/events-meta-box.php:165
532
+ msgid "Iran (Islamic Republic Of)"
533
+ msgstr ""
534
+
535
+ #: views/events-meta-box.php:166
536
+ msgid "Iraq"
537
+ msgstr ""
538
+
539
+ #: views/events-meta-box.php:167
540
+ msgid "Ireland"
541
+ msgstr ""
542
+
543
+ #: views/events-meta-box.php:168
544
+ msgid "Israel"
545
+ msgstr ""
546
+
547
+ #: views/events-meta-box.php:169
548
+ msgid "Italy"
549
+ msgstr ""
550
+
551
+ #: views/events-meta-box.php:170
552
+ msgid "Jamaica"
553
+ msgstr ""
554
+
555
+ #: views/events-meta-box.php:171
556
+ msgid "Japan"
557
+ msgstr ""
558
+
559
+ #: views/events-meta-box.php:172
560
+ msgid "Jordan"
561
+ msgstr ""
562
+
563
+ #: views/events-meta-box.php:173
564
+ msgid "Kazakhstan"
565
+ msgstr ""
566
+
567
+ #: views/events-meta-box.php:174
568
+ msgid "Kenya"
569
+ msgstr ""
570
+
571
+ #: views/events-meta-box.php:175
572
+ msgid "Kiribati"
573
+ msgstr ""
574
+
575
+ #: views/events-meta-box.php:176
576
+ msgid "Korea, Democratic People's Republic Of"
577
+ msgstr ""
578
+
579
+ #: views/events-meta-box.php:177
580
+ msgid "Korea, Republic Of"
581
+ msgstr ""
582
+
583
+ #: views/events-meta-box.php:178
584
+ msgid "Kuwait"
585
+ msgstr ""
586
+
587
+ #: views/events-meta-box.php:179
588
+ msgid "Kyrgyzstan"
589
+ msgstr ""
590
+
591
+ #: views/events-meta-box.php:180
592
+ msgid "Lao People's Democratic Republic"
593
+ msgstr ""
594
+
595
+ #: views/events-meta-box.php:181
596
+ msgid "Latvia"
597
+ msgstr ""
598
+
599
+ #: views/events-meta-box.php:182
600
+ msgid "Lebanon"
601
+ msgstr ""
602
+
603
+ #: views/events-meta-box.php:183
604
+ msgid "Lesotho"
605
+ msgstr ""
606
+
607
+ #: views/events-meta-box.php:184
608
+ msgid "Liberia"
609
+ msgstr ""
610
+
611
+ #: views/events-meta-box.php:185
612
+ msgid "Libyan Arab Jamahiriya"
613
+ msgstr ""
614
+
615
+ #: views/events-meta-box.php:186
616
+ msgid "Liechtenstein"
617
+ msgstr ""
618
+
619
+ #: views/events-meta-box.php:187
620
+ msgid "Lithuania"
621
+ msgstr ""
622
+
623
+ #: views/events-meta-box.php:188
624
+ msgid "Luxembourg"
625
+ msgstr ""
626
+
627
+ #: views/events-meta-box.php:189
628
+ msgid "Macau"
629
+ msgstr ""
630
+
631
+ #: views/events-meta-box.php:190
632
+ msgid "Macedonia, Former Yugoslav Republic Of"
633
+ msgstr ""
634
+
635
+ #: views/events-meta-box.php:191
636
+ msgid "Madagascar"
637
+ msgstr ""
638
+
639
+ #: views/events-meta-box.php:192
640
+ msgid "Malawi"
641
+ msgstr ""
642
+
643
+ #: views/events-meta-box.php:193
644
+ msgid "Malaysia"
645
+ msgstr ""
646
+
647
+ #: views/events-meta-box.php:194
648
+ msgid "Maldives"
649
+ msgstr ""
650
+
651
+ #: views/events-meta-box.php:195
652
+ msgid "Mali"
653
+ msgstr ""
654
+
655
+ #: views/events-meta-box.php:196
656
+ msgid "Malta"
657
+ msgstr ""
658
+
659
+ #: views/events-meta-box.php:197
660
+ msgid "Marshall Islands"
661
+ msgstr ""
662
+
663
+ #: views/events-meta-box.php:198
664
+ msgid "Martinique"
665
+ msgstr ""
666
+
667
+ #: views/events-meta-box.php:199
668
+ msgid "Mauritania"
669
+ msgstr ""
670
+
671
+ #: views/events-meta-box.php:200
672
+ msgid "Mauritius"
673
+ msgstr ""
674
+
675
+ #: views/events-meta-box.php:201
676
+ msgid "Mayotte"
677
+ msgstr ""
678
+
679
+ #: views/events-meta-box.php:202
680
+ msgid "Mexico"
681
+ msgstr ""
682
+
683
+ #: views/events-meta-box.php:203
684
+ msgid "Micronesia, Federated States Of"
685
+ msgstr ""
686
+
687
+ #: views/events-meta-box.php:204
688
+ msgid "Moldova, Republic Of"
689
+ msgstr ""
690
+
691
+ #: views/events-meta-box.php:205
692
+ msgid "Monaco"
693
+ msgstr ""
694
+
695
+ #: views/events-meta-box.php:206
696
+ msgid "Mongolia"
697
+ msgstr ""
698
+
699
+ #: views/events-meta-box.php:207
700
+ msgid "Montserrat"
701
+ msgstr ""
702
+
703
+ #: views/events-meta-box.php:208
704
+ msgid "Morocco"
705
+ msgstr ""
706
+
707
+ #: views/events-meta-box.php:209
708
+ msgid "Mozambique"
709
+ msgstr ""
710
+
711
+ #: views/events-meta-box.php:210
712
+ msgid "Myanmar"
713
+ msgstr ""
714
+
715
+ #: views/events-meta-box.php:211
716
+ msgid "Namibia"
717
+ msgstr ""
718
+
719
+ #: views/events-meta-box.php:212
720
+ msgid "Nauru"
721
+ msgstr ""
722
+
723
+ #: views/events-meta-box.php:213
724
+ msgid "Nepal"
725
+ msgstr ""
726
+
727
+ #: views/events-meta-box.php:214
728
+ msgid "Netherlands"
729
+ msgstr ""
730
+
731
+ #: views/events-meta-box.php:215
732
+ msgid "Netherlands Antilles"
733
+ msgstr ""
734
+
735
+ #: views/events-meta-box.php:216
736
+ msgid "New Caledonia"
737
+ msgstr ""
738
+
739
+ #: views/events-meta-box.php:217
740
+ msgid "New Zealand"
741
+ msgstr ""
742
+
743
+ #: views/events-meta-box.php:218
744
+ msgid "Nicaragua"
745
+ msgstr ""
746
+
747
+ #: views/events-meta-box.php:219
748
+ msgid "Niger"
749
+ msgstr ""
750
+
751
+ #: views/events-meta-box.php:220
752
+ msgid "Nigeria"
753
+ msgstr ""
754
+
755
+ #: views/events-meta-box.php:221
756
+ msgid "Niue"
757
+ msgstr ""
758
+
759
+ #: views/events-meta-box.php:222
760
+ msgid "Norfolk Island"
761
+ msgstr ""
762
+
763
+ #: views/events-meta-box.php:223
764
+ msgid "Northern Mariana Islands"
765
+ msgstr ""
766
+
767
+ #: views/events-meta-box.php:224
768
+ msgid "Norway"
769
+ msgstr ""
770
+
771
+ #: views/events-meta-box.php:225
772
+ msgid "Oman"
773
+ msgstr ""
774
+
775
+ #: views/events-meta-box.php:226
776
+ msgid "Pakistan"
777
+ msgstr ""
778
+
779
+ #: views/events-meta-box.php:227
780
+ msgid "Palau"
781
+ msgstr ""
782
+
783
+ #: views/events-meta-box.php:228
784
+ msgid "Panama"
785
+ msgstr ""
786
+
787
+ #: views/events-meta-box.php:229
788
+ msgid "Papua New Guinea"
789
+ msgstr ""
790
+
791
+ #: views/events-meta-box.php:230
792
+ msgid "Paraguay"
793
+ msgstr ""
794
+
795
+ #: views/events-meta-box.php:231
796
+ msgid "Peru"
797
+ msgstr ""
798
+
799
+ #: views/events-meta-box.php:232
800
+ msgid "Philippines"
801
+ msgstr ""
802
+
803
+ #: views/events-meta-box.php:233
804
+ msgid "Pitcairn"
805
+ msgstr ""
806
+
807
+ #: views/events-meta-box.php:234
808
+ msgid "Poland"
809
+ msgstr ""
810
+
811
+ #: views/events-meta-box.php:235
812
+ msgid "Portugal"
813
+ msgstr ""
814
+
815
+ #: views/events-meta-box.php:236
816
+ msgid "Puerto Rico"
817
+ msgstr ""
818
+
819
+ #: views/events-meta-box.php:237
820
+ msgid "Qatar"
821
+ msgstr ""
822
+
823
+ #: views/events-meta-box.php:238
824
+ msgid "Reunion"
825
+ msgstr ""
826
+
827
+ #: views/events-meta-box.php:239
828
+ msgid "Romania"
829
+ msgstr ""
830
+
831
+ #: views/events-meta-box.php:240
832
+ msgid "Russian Federation"
833
+ msgstr ""
834
+
835
+ #: views/events-meta-box.php:241
836
+ msgid "Rwanda"
837
+ msgstr ""
838
+
839
+ #: views/events-meta-box.php:242
840
+ msgid "Saint Kitts And Nevis"
841
+ msgstr ""
842
+
843
+ #: views/events-meta-box.php:243
844
+ msgid "Saint Lucia"
845
+ msgstr ""
846
+
847
+ #: views/events-meta-box.php:244
848
+ msgid "Saint Vincent And The Grenadines"
849
+ msgstr ""
850
+
851
+ #: views/events-meta-box.php:245
852
+ msgid "Samoa"
853
+ msgstr ""
854
+
855
+ #: views/events-meta-box.php:246
856
+ msgid "San Marino"
857
+ msgstr ""
858
+
859
+ #: views/events-meta-box.php:247
860
+ msgid "Sao Tome And Principe"
861
+ msgstr ""
862
+
863
+ #: views/events-meta-box.php:248
864
+ msgid "Saudi Arabia"
865
+ msgstr ""
866
+
867
+ #: views/events-meta-box.php:249
868
+ msgid "Senegal"
869
+ msgstr ""
870
+
871
+ #: views/events-meta-box.php:250
872
+ msgid "Seychelles"
873
+ msgstr ""
874
+
875
+ #: views/events-meta-box.php:251
876
+ msgid "Sierra Leone"
877
+ msgstr ""
878
+
879
+ #: views/events-meta-box.php:252
880
+ msgid "Singapore"
881
+ msgstr ""
882
+
883
+ #: views/events-meta-box.php:253
884
+ msgid "Slovakia (Slovak Republic)"
885
+ msgstr ""
886
+
887
+ #: views/events-meta-box.php:254
888
+ msgid "Slovenia"
889
+ msgstr ""
890
+
891
+ #: views/events-meta-box.php:255
892
+ msgid "Solomon Islands"
893
+ msgstr ""
894
+
895
+ #: views/events-meta-box.php:256
896
+ msgid "Somalia"
897
+ msgstr ""
898
+
899
+ #: views/events-meta-box.php:257
900
+ msgid "South Africa"
901
+ msgstr ""
902
+
903
+ #: views/events-meta-box.php:258
904
+ msgid "South Georgia, South Sandwich Islands"
905
+ msgstr ""
906
+
907
+ #: views/events-meta-box.php:259
908
+ msgid "Spain"
909
+ msgstr ""
910
+
911
+ #: views/events-meta-box.php:260
912
+ msgid "Sri Lanka"
913
+ msgstr ""
914
+
915
+ #: views/events-meta-box.php:261
916
+ msgid "St. Helena"
917
+ msgstr ""
918
+
919
+ #: views/events-meta-box.php:262
920
+ msgid "St. Pierre And Miquelon"
921
+ msgstr ""
922
+
923
+ #: views/events-meta-box.php:263
924
+ msgid "Sudan"
925
+ msgstr ""
926
+
927
+ #: views/events-meta-box.php:264
928
+ msgid "Suriname"
929
+ msgstr ""
930
+
931
+ #: views/events-meta-box.php:265
932
+ msgid "Svalbard And Jan Mayen Islands"
933
+ msgstr ""
934
+
935
+ #: views/events-meta-box.php:266
936
+ msgid "Swaziland"
937
+ msgstr ""
938
+
939
+ #: views/events-meta-box.php:267
940
+ msgid "Sweden"
941
+ msgstr ""
942
+
943
+ #: views/events-meta-box.php:268
944
+ msgid "Switzerland"
945
+ msgstr ""
946
+
947
+ #: views/events-meta-box.php:269
948
+ msgid "Syrian Arab Republic"
949
+ msgstr ""
950
+
951
+ #: views/events-meta-box.php:270
952
+ msgid "Taiwan"
953
+ msgstr ""
954
+
955
+ #: views/events-meta-box.php:271
956
+ msgid "Tajikistan"
957
+ msgstr ""
958
+
959
+ #: views/events-meta-box.php:272
960
+ msgid "Tanzania, United Republic Of"
961
+ msgstr ""
962
+
963
+ #: views/events-meta-box.php:273
964
+ msgid "Thailand"
965
+ msgstr ""
966
+
967
+ #: views/events-meta-box.php:274
968
+ msgid "Togo"
969
+ msgstr ""
970
+
971
+ #: views/events-meta-box.php:275
972
+ msgid "Tokelau"
973
+ msgstr ""
974
+
975
+ #: views/events-meta-box.php:276
976
+ msgid "Tonga"
977
+ msgstr ""
978
+
979
+ #: views/events-meta-box.php:277
980
+ msgid "Trinidad And Tobago"
981
+ msgstr ""
982
+
983
+ #: views/events-meta-box.php:278
984
+ msgid "Tunisia"
985
+ msgstr ""
986
+
987
+ #: views/events-meta-box.php:279
988
+ msgid "Turkey"
989
+ msgstr ""
990
+
991
+ #: views/events-meta-box.php:280
992
+ msgid "Turkmenistan"
993
+ msgstr ""
994
+
995
+ #: views/events-meta-box.php:281
996
+ msgid "Turks And Caicos Islands"
997
+ msgstr ""
998
+
999
+ #: views/events-meta-box.php:282
1000
+ msgid "Tuvalu"
1001
+ msgstr ""
1002
+
1003
+ #: views/events-meta-box.php:283
1004
+ msgid "Uganda"
1005
+ msgstr ""
1006
+
1007
+ #: views/events-meta-box.php:284
1008
+ msgid "Ukraine"
1009
+ msgstr ""
1010
+
1011
+ #: views/events-meta-box.php:285
1012
+ msgid "United Arab Emirates"
1013
+ msgstr ""
1014
+
1015
+ #: views/events-meta-box.php:286
1016
+ msgid "United Kingdom"
1017
+ msgstr ""
1018
+
1019
+ #: views/events-meta-box.php:287
1020
+ msgid "United States Minor Outlying Islands"
1021
+ msgstr ""
1022
+
1023
+ #: views/events-meta-box.php:288
1024
+ msgid "Uruguay"
1025
+ msgstr ""
1026
+
1027
+ #: views/events-meta-box.php:289
1028
+ msgid "Uzbekistan"
1029
+ msgstr ""
1030
+
1031
+ #: views/events-meta-box.php:290
1032
+ msgid "Vanuatu"
1033
+ msgstr ""
1034
+
1035
+ #: views/events-meta-box.php:291
1036
+ msgid "Venezuela"
1037
+ msgstr ""
1038
+
1039
+ #: views/events-meta-box.php:292
1040
+ msgid "Viet Nam"
1041
+ msgstr ""
1042
+
1043
+ #: views/events-meta-box.php:293
1044
+ msgid "Virgin Islands (British)"
1045
+ msgstr ""
1046
+
1047
+ #: views/events-meta-box.php:294
1048
+ msgid "Virgin Islands (U.S.)"
1049
+ msgstr ""
1050
+
1051
+ #: views/events-meta-box.php:295
1052
+ msgid "Wallis And Futuna Islands"
1053
+ msgstr ""
1054
+
1055
+ #: views/events-meta-box.php:296
1056
+ msgid "Western Sahara"
1057
+ msgstr ""
1058
+
1059
+ #: views/events-meta-box.php:297
1060
+ msgid "Yemen"
1061
+ msgstr ""
1062
+
1063
+ #: views/events-meta-box.php:298
1064
+ msgid "Yugoslavia"
1065
+ msgstr ""
1066
+
1067
+ #: views/events-meta-box.php:299
1068
+ msgid "Zambia"
1069
+ msgstr ""
1070
+
1071
+ #: views/events-meta-box.php:300
1072
+ msgid "Zimbabwe"
1073
+ msgstr ""
1074
+
1075
+ #: views/events-meta-box.php:316
1076
+ msgid "Address:"
1077
+ msgstr ""
1078
+
1079
+ #: views/events-meta-box.php:317
1080
+ msgid "City:"
1081
+ msgstr ""
1082
+
1083
+ #: views/events-meta-box.php:319
1084
+ msgid "Province:"
1085
+ msgstr ""
1086
+
1087
+ #: views/events-meta-box.php:322
1088
+ msgid "State:"
1089
+ msgstr ""
1090
+
1091
+ #: views/events-meta-box.php:323
1092
+ msgid "Select a State:"
1093
+ msgstr ""
1094
+
1095
+ #: views/events-meta-box.php:325
1096
+ msgid "Alabama"
1097
+ msgstr ""
1098
+
1099
+ #: views/events-meta-box.php:326
1100
+ msgid "Alaska"
1101
+ msgstr ""
1102
+
1103
+ #: views/events-meta-box.php:327
1104
+ msgid "Arizona"
1105
+ msgstr ""
1106
+
1107
+ #: views/events-meta-box.php:328
1108
+ msgid "Arkansas"
1109
+ msgstr ""
1110
+
1111
+ #: views/events-meta-box.php:329
1112
+ msgid "California"
1113
+ msgstr ""
1114
+
1115
+ #: views/events-meta-box.php:330
1116
+ msgid "Colorado"
1117
+ msgstr ""
1118
+
1119
+ #: views/events-meta-box.php:331
1120
+ msgid "Connecticut"
1121
+ msgstr ""
1122
+
1123
+ #: views/events-meta-box.php:332
1124
+ msgid "Delaware"
1125
+ msgstr ""
1126
+
1127
+ #: views/events-meta-box.php:333
1128
+ msgid "District of Columbia"
1129
+ msgstr ""
1130
+
1131
+ #: views/events-meta-box.php:334
1132
+ msgid "Florida"
1133
+ msgstr ""
1134
+
1135
+ #: views/events-meta-box.php:336
1136
+ msgid "Hawaii"
1137
+ msgstr ""
1138
+
1139
+ #: views/events-meta-box.php:337
1140
+ msgid "Idaho"
1141
+ msgstr ""
1142
+
1143
+ #: views/events-meta-box.php:338
1144
+ msgid "Illinois"
1145
+ msgstr ""
1146
+
1147
+ #: views/events-meta-box.php:339
1148
+ msgid "Indiana"
1149
+ msgstr ""
1150
+
1151
+ #: views/events-meta-box.php:340
1152
+ msgid "Iowa"
1153
+ msgstr ""
1154
+
1155
+ #: views/events-meta-box.php:341
1156
+ msgid "Kansas"
1157
+ msgstr ""
1158
+
1159
+ #: views/events-meta-box.php:342
1160
+ msgid "Kentucky"
1161
+ msgstr ""
1162
+
1163
+ #: views/events-meta-box.php:343
1164
+ msgid "Louisiana"
1165
+ msgstr ""
1166
+
1167
+ #: views/events-meta-box.php:344
1168
+ msgid "Maine"
1169
+ msgstr ""
1170
+
1171
+ #: views/events-meta-box.php:345
1172
+ msgid "Maryland"
1173
+ msgstr ""
1174
+
1175
+ #: views/events-meta-box.php:346
1176
+ msgid "Massachusetts"
1177
+ msgstr ""
1178
+
1179
+ #: views/events-meta-box.php:347
1180
+ msgid "Michigan"
1181
+ msgstr ""
1182
+
1183
+ #: views/events-meta-box.php:348
1184
+ msgid "Minnesota"
1185
+ msgstr ""
1186
+
1187
+ #: views/events-meta-box.php:349
1188
+ msgid "Mississippi"
1189
+ msgstr ""
1190
+
1191
+ #: views/events-meta-box.php:350
1192
+ msgid "Missouri"
1193
+ msgstr ""
1194
+
1195
+ #: views/events-meta-box.php:351
1196
+ msgid "Montana"
1197
+ msgstr ""
1198
+
1199
+ #: views/events-meta-box.php:352
1200
+ msgid "Nebraska"
1201
+ msgstr ""
1202
+
1203
+ #: views/events-meta-box.php:353
1204
+ msgid "Nevada"
1205
+ msgstr ""
1206
+
1207
+ #: views/events-meta-box.php:354
1208
+ msgid "New Hampshire"
1209
+ msgstr ""
1210
+
1211
+ #: views/events-meta-box.php:355
1212
+ msgid "New Jersey"
1213
+ msgstr ""
1214
+
1215
+ #: views/events-meta-box.php:356
1216
+ msgid "New Mexico"
1217
+ msgstr ""
1218
+
1219
+ #: views/events-meta-box.php:357
1220
+ msgid "New York"
1221
+ msgstr ""
1222
+
1223
+ #: views/events-meta-box.php:358
1224
+ msgid "North Carolina"
1225
+ msgstr ""
1226
+
1227
+ #: views/events-meta-box.php:359
1228
+ msgid "North Dakota"
1229
+ msgstr ""
1230
+
1231
+ #: views/events-meta-box.php:360
1232
+ msgid "Ohio"
1233
+ msgstr ""
1234
+
1235
+ #: views/events-meta-box.php:361
1236
+ msgid "Oklahoma"
1237
+ msgstr ""
1238
+
1239
+ #: views/events-meta-box.php:362
1240
+ msgid "Oregon"
1241
+ msgstr ""
1242
+
1243
+ #: views/events-meta-box.php:363
1244
+ msgid "Pennsylvania"
1245
+ msgstr ""
1246
+
1247
+ #: views/events-meta-box.php:364
1248
+ msgid "Rhode Island"
1249
+ msgstr ""
1250
+
1251
+ #: views/events-meta-box.php:365
1252
+ msgid "South Carolina"
1253
+ msgstr ""
1254
+
1255
+ #: views/events-meta-box.php:366
1256
+ msgid "South Dakota"
1257
+ msgstr ""
1258
+
1259
+ #: views/events-meta-box.php:367
1260
+ msgid "Tennessee"
1261
+ msgstr ""
1262
+
1263
+ #: views/events-meta-box.php:368
1264
+ msgid "Texas"
1265
+ msgstr ""
1266
+
1267
+ #: views/events-meta-box.php:369
1268
+ msgid "Utah"
1269
+ msgstr ""
1270
+
1271
+ #: views/events-meta-box.php:370
1272
+ msgid "Vermont"
1273
+ msgstr ""
1274
+
1275
+ #: views/events-meta-box.php:371
1276
+ msgid "Virginia"
1277
+ msgstr ""
1278
+
1279
+ #: views/events-meta-box.php:372
1280
+ msgid "Washington"
1281
+ msgstr ""
1282
+
1283
+ #: views/events-meta-box.php:373
1284
+ msgid "West Virginia"
1285
+ msgstr ""
1286
+
1287
+ #: views/events-meta-box.php:374
1288
+ msgid "Wisconsin"
1289
+ msgstr ""
1290
+
1291
+ #: views/events-meta-box.php:375
1292
+ msgid "Wyoming"
1293
+ msgstr ""
1294
+
1295
+ #: views/events-meta-box.php:387
1296
+ msgid "Postal Code:"
1297
+ msgstr ""
1298
+
1299
+ #: views/events-meta-box.php:393
1300
+ msgid "Cost:"
1301
+ msgstr ""
1302
+
1303
+ #: views/events-meta-box.php:397
1304
+ msgid "Phone:"
1305
+ msgstr ""
1306
+
1307
+ #: views/events-meta-box.php:401
1308
+ msgid "Event Design:"
1309
+ msgstr ""
1310
+
1311
+ #: views/events-meta-box.php:407
1312
+ msgid "Event Brite Ticketing:"
1313
+ msgstr ""
1314
+
1315
+ #: views/events-meta-box.php:410
1316
+ msgid "Need registration or to sell tickets?"
1317
+ msgstr ""
1318
+
1319
+ #: views/events-meta-box.php:412
1320
+ msgid "Step 1: Enter Your Event Brite Account"
1321
+ msgstr ""
1322
+
1323
+ #: views/events-meta-box.php:413 views/events-meta-box.php:423
1324
+ msgid "Don't have one?"
1325
+ msgstr ""
1326
+
1327
+ #: views/events-meta-box.php:415 views/events-meta-box.php:466
1328
+ msgid "EB User:"
1329
+ msgstr ""
1330
+
1331
+ #: views/events-meta-box.php:419 views/events-meta-box.php:469
1332
+ msgid "EB Password:"
1333
+ msgstr ""
1334
+
1335
+ #: views/events-meta-box.php:422
1336
+ msgid "Step 2: Setup up your first ticket"
1337
+ msgstr ""
1338
+
1339
+ #: views/events-meta-box.php:426
1340
+ msgid "Name:"
1341
+ msgstr ""
1342
+
1343
+ #: views/events-meta-box.php:430
1344
+ msgid "Description:"
1345
+ msgstr ""
1346
+
1347
+ #: views/events-meta-box.php:434
1348
+ msgid "Type:"
1349
+ msgstr ""
1350
+
1351
+ #: views/events-meta-box.php:440
1352
+ msgid "Price:"
1353
+ msgstr ""
1354
+
1355
+ #: views/events-meta-box.php:444
1356
+ msgid "Quantity:"
1357
+ msgstr ""
1358
+
1359
+ #: views/events-meta-box.php:448
1360
+ msgid "Include Fee in Price:"
1361
+ msgstr ""
1362
+
1363
+ #: views/events-meta-box.php:454
1364
+ msgid "Step 3: Create the Event with EventBrite.com"
1365
+ msgstr ""
1366
+
1367
+ #: views/events-meta-box.php:455
1368
+ msgid ""
1369
+ "We can create the basic event for you. For more advanced controls and event "
1370
+ "details you will need to manage the event from the eventbrite administration "
1371
+ "system. Make sure the event dails are completely filled out."
1372
+ msgstr ""
1373
+
1374
+ #: views/events-meta-box.php:457
1375
+ msgid "Create an Event using the information above button goes here."
1376
+ msgstr ""
1377
+
1378
+ #: views/events-meta-box.php:463
1379
+ msgid "Event ID:"
1380
+ msgstr ""
1381
+
1382
+ #: views/events-meta-box.php:480
1383
+ msgid "Ticket Count:"
1384
+ msgstr ""
1385
+
1386
+ #: views/gridview.php:11
1387
+ msgid "Monday"
1388
+ msgstr ""
1389
+
1390
+ #: views/gridview.php:11
1391
+ msgid "Mon"
1392
+ msgstr ""
1393
+
1394
+ #: views/gridview.php:12
1395
+ msgid "Tuesday"
1396
+ msgstr ""
1397
+
1398
+ #: views/gridview.php:12
1399
+ msgid "Tue"
1400
+ msgstr ""
1401
+
1402
+ #: views/gridview.php:13
1403
+ msgid "Wednesday"
1404
+ msgstr ""
1405
+
1406
+ #: views/gridview.php:13
1407
+ msgid "Wed"
1408
+ msgstr ""
1409
+
1410
+ #: views/gridview.php:14
1411
+ msgid "Thursday"
1412
+ msgstr ""
1413
+
1414
+ #: views/gridview.php:14
1415
+ msgid "Thu"
1416
+ msgstr ""
1417
+
1418
+ #: views/gridview.php:15
1419
+ msgid "Friday"
1420
+ msgstr ""
1421
+
1422
+ #: views/gridview.php:15
1423
+ msgid "Fri"
1424
+ msgstr ""
1425
+
1426
+ #: views/gridview.php:16
1427
+ msgid "Saturday"
1428
+ msgstr ""
1429
+
1430
+ #: views/gridview.php:16
1431
+ msgid "Sat"
1432
+ msgstr ""
1433
+
1434
+ #: views/gridview.php:17
1435
+ msgid "Sunday"
1436
+ msgstr ""
1437
+
1438
+ #: views/gridview.php:17
1439
+ msgid "Sun"
1440
+ msgstr ""
1441
+
1442
+ #. Plugin Name of an extension
1443
+ msgid "Simple Events"
1444
+ msgstr ""
1445
+
1446
+ #. Plugin URI of an extension
1447
+ msgid "http://www.shaneandpeter.com/wordpress"
1448
+ msgstr ""
1449
+
1450
+ #. Description of an extension
1451
+ msgid "Rapidy create and manage events using posts."
1452
+ msgstr ""
1453
+
1454
+ #. Author of an extension
1455
+ msgid "Shane Pearlman, Kelsey Damas, Produced by Shane & Peter Inc."
1456
+ msgstr ""
1457
+
1458
+ #. Author URI of an extension
1459
+ msgid "http://www.shaneandpeter.com"
1460
+ msgstr ""
resources/images/tooltip-arrow.png ADDED
Binary file
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file
screenshot-5.png ADDED
Binary file
screenshot-6.png ADDED
Binary file
screenshot-7.png ADDED
Binary file
the-events-calendar.php ADDED
@@ -0,0 +1,2133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: The Events Calendar
4
+ Plugin URI: http://wordpress.org/extend/plugins/the-events-calendar/
5
+ Description: The Events Calendar plugin enables you to rapidly create and manage events using the post editor. Features include optional Eventbrite integration, Google Maps integration as well as default calendar grid and list templates for streamlined one click installation.
6
+ Version: 1.5
7
+ Author URI: http://www.shaneandpeter.com/
8
+ Text Domain: events
9
+ */
10
+ if ( !class_exists( 'The_Events_Calendar' ) ) {
11
+
12
+ class The_Events_Calendar {
13
+ const CATEGORYNAME = 'Events';
14
+ const OPTIONNAME = 'sp_events_calendar_options';
15
+ const DATEONLYFORMAT = 'F j, Y';
16
+ const DBDATEFORMAT = 'Y-m-d';
17
+ const DBDATETIMEFORMAT = 'Y-m-d H:i:s';
18
+ const DATETIMEFORMAT12 = 'F j, Y g:i A';
19
+ const DATETIMEFORMAT24 = 'F j, Y H:i';
20
+ const EVENTTIMEFORMATOPT = 'events_timeformat';
21
+
22
+ public $debug = false;
23
+ private $defaultOptions = '';
24
+ public $latestOptions;
25
+
26
+ public $displaying;
27
+ public $pluginDir;
28
+ public $pluginUrl;
29
+ public $pluginDomain = 'sp-Events';
30
+
31
+ public $metaTags = array(
32
+ '_isEvent',
33
+ '_EventAllDay',
34
+ '_EventStartDate',
35
+ '_EventEndDate',
36
+ '_EventVenue',
37
+ '_EventCountry',
38
+ '_EventAddress',
39
+ '_EventCity',
40
+ '_EventState',
41
+ '_EventProvince',
42
+ '_EventZip',
43
+ '_EventCost',
44
+ '_EventPhone',
45
+ );
46
+
47
+ public $currentPostTimestamp;
48
+
49
+ private $countries;
50
+
51
+ private function constructCountries( $useDefault = true ) {
52
+ $countries = array(
53
+ "US" => __("United States", $this->pluginDomain),
54
+ "AF" => __("Afghanistan", $this->pluginDomain),
55
+ "AL" => __("Albania", $this->pluginDomain),
56
+ "DZ" => __("Algeria", $this->pluginDomain),
57
+ "AS" => __("American Samoa", $this->pluginDomain),
58
+ "AD" => __("Andorra", $this->pluginDomain),
59
+ "AO" => __("Angola", $this->pluginDomain),
60
+ "AI" => __("Anguilla", $this->pluginDomain),
61
+ "AQ" => __("Antarctica", $this->pluginDomain),
62
+ "AG" => __("Antigua And Barbuda", $this->pluginDomain),
63
+ "AR" => __("Argentina", $this->pluginDomain),
64
+ "AM" => __("Armenia", $this->pluginDomain),
65
+ "AW" => __("Aruba", $this->pluginDomain),
66
+ "AU" => __("Australia", $this->pluginDomain),
67
+ "AT" => __("Austria", $this->pluginDomain),
68
+ "AZ" => __("Azerbaijan", $this->pluginDomain),
69
+ "BS" => __("Bahamas", $this->pluginDomain),
70
+ "BH" => __("Bahrain", $this->pluginDomain),
71
+ "BD" => __("Bangladesh", $this->pluginDomain),
72
+ "BB" => __("Barbados", $this->pluginDomain),
73
+ "BY" => __("Belarus", $this->pluginDomain),
74
+ "BE" => __("Belgium", $this->pluginDomain),
75
+ "BZ" => __("Belize", $this->pluginDomain),
76
+ "BJ" => __("Benin", $this->pluginDomain),
77
+ "BM" => __("Bermuda", $this->pluginDomain),
78
+ "BT" => __("Bhutan", $this->pluginDomain),
79
+ "BO" => __("Bolivia", $this->pluginDomain),
80
+ "BA" => __("Bosnia And Herzegowina", $this->pluginDomain),
81
+ "BW" => __("Botswana", $this->pluginDomain),
82
+ "BV" => __("Bouvet Island", $this->pluginDomain),
83
+ "BR" => __("Brazil", $this->pluginDomain),
84
+ "IO" => __("British Indian Ocean Territory", $this->pluginDomain),
85
+ "BN" => __("Brunei Darussalam", $this->pluginDomain),
86
+ "BG" => __("Bulgaria", $this->pluginDomain),
87
+ "BF" => __("Burkina Faso", $this->pluginDomain),
88
+ "BI" => __("Burundi", $this->pluginDomain),
89
+ "KH" => __("Cambodia", $this->pluginDomain),
90
+ "CM" => __("Cameroon", $this->pluginDomain),
91
+ "CA" => __("Canada", $this->pluginDomain),
92
+ "CV" => __("Cape Verde", $this->pluginDomain),
93
+ "KY" => __("Cayman Islands", $this->pluginDomain),
94
+ "CF" => __("Central African Republic", $this->pluginDomain),
95
+ "TD" => __("Chad", $this->pluginDomain),
96
+ "CL" => __("Chile", $this->pluginDomain),
97
+ "CN" => __("China", $this->pluginDomain),
98
+ "CX" => __("Christmas Island", $this->pluginDomain),
99
+ "CC" => __("Cocos (Keeling) Islands", $this->pluginDomain),
100
+ "CO" => __("Colombia", $this->pluginDomain),
101
+ "KM" => __("Comoros", $this->pluginDomain),
102
+ "CG" => __("Congo", $this->pluginDomain),
103
+ "CD" => __("Congo, The Democratic Republic Of The", $this->pluginDomain),
104
+ "CK" => __("Cook Islands", $this->pluginDomain),
105
+ "CR" => __("Costa Rica", $this->pluginDomain),
106
+ "CI" => __("Cote D'Ivoire", $this->pluginDomain),
107
+ "HR" => __("Croatia (Local Name: Hrvatska)", $this->pluginDomain),
108
+ "CU" => __("Cuba", $this->pluginDomain),
109
+ "CY" => __("Cyprus", $this->pluginDomain),
110
+ "CZ" => __("Czech Republic", $this->pluginDomain),
111
+ "DK" => __("Denmark", $this->pluginDomain),
112
+ "DJ" => __("Djibouti", $this->pluginDomain),
113
+ "DM" => __("Dominica", $this->pluginDomain),
114
+ "DO" => __("Dominican Republic", $this->pluginDomain),
115
+ "TP" => __("East Timor", $this->pluginDomain),
116
+ "EC" => __("Ecuador", $this->pluginDomain),
117
+ "EG" => __("Egypt", $this->pluginDomain),
118
+ "SV" => __("El Salvador", $this->pluginDomain),
119
+ "GQ" => __("Equatorial Guinea", $this->pluginDomain),
120
+ "ER" => __("Eritrea", $this->pluginDomain),
121
+ "EE" => __("Estonia", $this->pluginDomain),
122
+ "ET" => __("Ethiopia", $this->pluginDomain),
123
+ "FK" => __("Falkland Islands (Malvinas)", $this->pluginDomain),
124
+ "FO" => __("Faroe Islands", $this->pluginDomain),
125
+ "FJ" => __("Fiji", $this->pluginDomain),
126
+ "FI" => __("Finland", $this->pluginDomain),
127
+ "FR" => __("France", $this->pluginDomain),
128
+ "FX" => __("France, Metropolitan", $this->pluginDomain),
129
+ "GF" => __("French Guiana", $this->pluginDomain),
130
+ "PF" => __("French Polynesia", $this->pluginDomain),
131
+ "TF" => __("French Southern Territories", $this->pluginDomain),
132
+ "GA" => __("Gabon", $this->pluginDomain),
133
+ "GM" => __("Gambia", $this->pluginDomain),
134
+ "GE" => __("Georgia", $this->pluginDomain),
135
+ "DE" => __("Germany", $this->pluginDomain),
136
+ "GH" => __("Ghana", $this->pluginDomain),
137
+ "GI" => __("Gibraltar", $this->pluginDomain),
138
+ "GR" => __("Greece", $this->pluginDomain),
139
+ "GL" => __("Greenland", $this->pluginDomain),
140
+ "GD" => __("Grenada", $this->pluginDomain),
141
+ "GP" => __("Guadeloupe", $this->pluginDomain),
142
+ "GU" => __("Guam", $this->pluginDomain),
143
+ "GT" => __("Guatemala", $this->pluginDomain),
144
+ "GN" => __("Guinea", $this->pluginDomain),
145
+ "GW" => __("Guinea-Bissau", $this->pluginDomain),
146
+ "GY" => __("Guyana", $this->pluginDomain),
147
+ "HT" => __("Haiti", $this->pluginDomain),
148
+ "HM" => __("Heard And Mc Donald Islands", $this->pluginDomain),
149
+ "VA" => __("Holy See (Vatican City State)", $this->pluginDomain),
150
+ "HN" => __("Honduras", $this->pluginDomain),
151
+ "HK" => __("Hong Kong", $this->pluginDomain),
152
+ "HU" => __("Hungary", $this->pluginDomain),
153
+ "IS" => __("Iceland", $this->pluginDomain),
154
+ "IN" => __("India", $this->pluginDomain),
155
+ "ID" => __("Indonesia", $this->pluginDomain),
156
+ "IR" => __("Iran (Islamic Republic Of)", $this->pluginDomain),
157
+ "IQ" => __("Iraq", $this->pluginDomain),
158
+ "IE" => __("Ireland", $this->pluginDomain),
159
+ "IL" => __("Israel", $this->pluginDomain),
160
+ "IT" => __("Italy", $this->pluginDomain),
161
+ "JM" => __("Jamaica", $this->pluginDomain),
162
+ "JP" => __("Japan", $this->pluginDomain),
163
+ "JO" => __("Jordan", $this->pluginDomain),
164
+ "KZ" => __("Kazakhstan", $this->pluginDomain),
165
+ "KE" => __("Kenya", $this->pluginDomain),
166
+ "KI" => __("Kiribati", $this->pluginDomain),
167
+ "KP" => __("Korea, Democratic People's Republic Of", $this->pluginDomain),
168
+ "KR" => __("Korea, Republic Of", $this->pluginDomain),
169
+ "KW" => __("Kuwait", $this->pluginDomain),
170
+ "KG" => __("Kyrgyzstan", $this->pluginDomain),
171
+ "LA" => __("Lao People's Democratic Republic", $this->pluginDomain),
172
+ "LV" => __("Latvia", $this->pluginDomain),
173
+ "LB" => __("Lebanon", $this->pluginDomain),
174
+ "LS" => __("Lesotho", $this->pluginDomain),
175
+ "LR" => __("Liberia", $this->pluginDomain),
176
+ "LY" => __("Libyan Arab Jamahiriya", $this->pluginDomain),
177
+ "LI" => __("Liechtenstein", $this->pluginDomain),
178
+ "LT" => __("Lithuania", $this->pluginDomain),
179
+ "LU" => __("Luxembourg", $this->pluginDomain),
180
+ "MO" => __("Macau", $this->pluginDomain),
181
+ "MK" => __("Macedonia, Former Yugoslav Republic Of", $this->pluginDomain),
182
+ "MG" => __("Madagascar", $this->pluginDomain),
183
+ "MW" => __("Malawi", $this->pluginDomain),
184
+ "MY" => __("Malaysia", $this->pluginDomain),
185
+ "MV" => __("Maldives", $this->pluginDomain),
186
+ "ML" => __("Mali", $this->pluginDomain),
187
+ "MT" => __("Malta", $this->pluginDomain),
188
+ "MH" => __("Marshall Islands", $this->pluginDomain),
189
+ "MQ" => __("Martinique", $this->pluginDomain),
190
+ "MR" => __("Mauritania", $this->pluginDomain),
191
+ "MU" => __("Mauritius", $this->pluginDomain),
192
+ "YT" => __("Mayotte", $this->pluginDomain),
193
+ "MX" => __("Mexico", $this->pluginDomain),
194
+ "FM" => __("Micronesia, Federated States Of", $this->pluginDomain),
195
+ "MD" => __("Moldova, Republic Of", $this->pluginDomain),
196
+ "MC" => __("Monaco", $this->pluginDomain),
197
+ "MN" => __("Mongolia", $this->pluginDomain),
198
+ "MS" => __("Montserrat", $this->pluginDomain),
199
+ "MA" => __("Morocco", $this->pluginDomain),
200
+ "MZ" => __("Mozambique", $this->pluginDomain),
201
+ "MM" => __("Myanmar", $this->pluginDomain),
202
+ "NA" => __("Namibia", $this->pluginDomain),
203
+ "NR" => __("Nauru", $this->pluginDomain),
204
+ "NP" => __("Nepal", $this->pluginDomain),
205
+ "NL" => __("Netherlands", $this->pluginDomain),
206
+ "AN" => __("Netherlands Antilles", $this->pluginDomain),
207
+ "NC" => __("New Caledonia", $this->pluginDomain),
208
+ "NZ" => __("New Zealand", $this->pluginDomain),
209
+ "NI" => __("Nicaragua", $this->pluginDomain),
210
+ "NE" => __("Niger", $this->pluginDomain),
211
+ "NG" => __("Nigeria", $this->pluginDomain),
212
+ "NU" => __("Niue", $this->pluginDomain),
213
+ "NF" => __("Norfolk Island", $this->pluginDomain),
214
+ "MP" => __("Northern Mariana Islands", $this->pluginDomain),
215
+ "NO" => __("Norway", $this->pluginDomain),
216
+ "OM" => __("Oman", $this->pluginDomain),
217
+ "PK" => __("Pakistan", $this->pluginDomain),
218
+ "PW" => __("Palau", $this->pluginDomain),
219
+ "PA" => __("Panama", $this->pluginDomain),
220
+ "PG" => __("Papua New Guinea", $this->pluginDomain),
221
+ "PY" => __("Paraguay", $this->pluginDomain),
222
+ "PE" => __("Peru", $this->pluginDomain),
223
+ "PH" => __("Philippines", $this->pluginDomain),
224
+ "PN" => __("Pitcairn", $this->pluginDomain),
225
+ "PL" => __("Poland", $this->pluginDomain),
226
+ "PT" => __("Portugal", $this->pluginDomain),
227
+ "PR" => __("Puerto Rico", $this->pluginDomain),
228
+ "QA" => __("Qatar", $this->pluginDomain),
229
+ "RE" => __("Reunion", $this->pluginDomain),
230
+ "RO" => __("Romania", $this->pluginDomain),
231
+ "RU" => __("Russian Federation", $this->pluginDomain),
232
+ "RW" => __("Rwanda", $this->pluginDomain),
233
+ "KN" => __("Saint Kitts And Nevis", $this->pluginDomain),
234
+ "LC" => __("Saint Lucia", $this->pluginDomain),
235
+ "VC" => __("Saint Vincent And The Grenadines", $this->pluginDomain),
236
+ "WS" => __("Samoa", $this->pluginDomain),
237
+ "SM" => __("San Marino", $this->pluginDomain),
238
+ "ST" => __("Sao Tome And Principe", $this->pluginDomain),
239
+ "SA" => __("Saudi Arabia", $this->pluginDomain),
240
+ "SN" => __("Senegal", $this->pluginDomain),
241
+ "SC" => __("Seychelles", $this->pluginDomain),
242
+ "SL" => __("Sierra Leone", $this->pluginDomain),
243
+ "SG" => __("Singapore", $this->pluginDomain),
244
+ "SK" => __("Slovakia (Slovak Republic)", $this->pluginDomain),
245
+ "SI" => __("Slovenia", $this->pluginDomain),
246
+ "SB" => __("Solomon Islands", $this->pluginDomain),
247
+ "SO" => __("Somalia", $this->pluginDomain),
248
+ "ZA" => __("South Africa", $this->pluginDomain),
249
+ "GS" => __("South Georgia, South Sandwich Islands", $this->pluginDomain),
250
+ "ES" => __("Spain", $this->pluginDomain),
251
+ "LK" => __("Sri Lanka", $this->pluginDomain),
252
+ "SH" => __("St. Helena", $this->pluginDomain),
253
+ "PM" => __("St. Pierre And Miquelon", $this->pluginDomain),
254
+ "SD" => __("Sudan", $this->pluginDomain),
255
+ "SR" => __("Suriname", $this->pluginDomain),
256
+ "SJ" => __("Svalbard And Jan Mayen Islands", $this->pluginDomain),
257
+ "SZ" => __("Swaziland", $this->pluginDomain),
258
+ "SE" => __("Sweden", $this->pluginDomain),
259
+ "CH" => __("Switzerland", $this->pluginDomain),
260
+ "SY" => __("Syrian Arab Republic", $this->pluginDomain),
261
+ "TW" => __("Taiwan", $this->pluginDomain),
262
+ "TJ" => __("Tajikistan", $this->pluginDomain),
263
+ "TZ" => __("Tanzania, United Republic Of", $this->pluginDomain),
264
+ "TH" => __("Thailand", $this->pluginDomain),
265
+ "TG" => __("Togo", $this->pluginDomain),
266
+ "TK" => __("Tokelau", $this->pluginDomain),
267
+ "TO" => __("Tonga", $this->pluginDomain),
268
+ "TT" => __("Trinidad And Tobago", $this->pluginDomain),
269
+ "TN" => __("Tunisia", $this->pluginDomain),
270
+ "TR" => __("Turkey", $this->pluginDomain),
271
+ "TM" => __("Turkmenistan", $this->pluginDomain),
272
+ "TC" => __("Turks And Caicos Islands", $this->pluginDomain),
273
+ "TV" => __("Tuvalu", $this->pluginDomain),
274
+ "UG" => __("Uganda", $this->pluginDomain),
275
+ "UA" => __("Ukraine", $this->pluginDomain),
276
+ "AE" => __("United Arab Emirates", $this->pluginDomain),
277
+ "GB" => __("United Kingdom", $this->pluginDomain),
278
+ "UM" => __("United States Minor Outlying Islands", $this->pluginDomain),
279
+ "UY" => __("Uruguay", $this->pluginDomain),
280
+ "UZ" => __("Uzbekistan", $this->pluginDomain),
281
+ "VU" => __("Vanuatu", $this->pluginDomain),
282
+ "VE" => __("Venezuela", $this->pluginDomain),
283
+ "VN" => __("Viet Nam", $this->pluginDomain),
284
+ "VG" => __("Virgin Islands (British)", $this->pluginDomain),
285
+ "VI" => __("Virgin Islands (U.S.)", $this->pluginDomain),
286
+ "WF" => __("Wallis And Futuna Islands", $this->pluginDomain),
287
+ "EH" => __("Western Sahara", $this->pluginDomain),
288
+ "YE" => __("Yemen", $this->pluginDomain),
289
+ "YU" => __("Yugoslavia", $this->pluginDomain),
290
+ "ZM" => __("Zambia", $this->pluginDomain),
291
+ "ZW" => __("Zimbabwe", $this->pluginDomain)
292
+ );
293
+ if ($useDefault) {
294
+ $defaultCountry = eventsGetOptionValue('defaultCountry');
295
+ if($defaultCountry) {
296
+ asort($countries);
297
+ $countries = array($defaultCountry[0] => __($defaultCountry[1], $this->pluginDomain)) + $countries;
298
+ array_unique($countries);
299
+ }
300
+ $this->countries = $countries;
301
+ } else {
302
+ $this->countries = $countries;
303
+ }
304
+ }
305
+
306
+ /**
307
+ * Initializes plugin variables and sets up wordpress hooks/actions.
308
+ *
309
+ * @return void
310
+ */
311
+ function __construct( ) {
312
+ if( $this->debug ) error_log( "construct events calendar" );
313
+ $this->currentDay = '';
314
+ $this->pluginDir = basename(dirname(__FILE__));
315
+ $this->pluginUrl = WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__));
316
+ $this->errors = '';
317
+ register_activation_hook( __FILE__, array( &$this, 'on_activate' ) );
318
+ register_deactivation_hook( __FILE__, array( &$this, 'on_deactivate' ) );
319
+ add_action( 'reschedule_event_post', array( $this, 'reschedule') );
320
+ add_action( 'init', array( $this, 'loadPluginTextDomain' ) );
321
+ add_action( 'init', array( $this, 'flushRewriteRules' ) );
322
+ add_action( 'pre_get_posts', array( $this, 'setOptions' ) );
323
+ add_action( 'admin_menu', array( $this, 'addOptionsPage' ) );
324
+ add_action( 'admin_init', array( $this, 'checkForOptionsChanges' ) );
325
+ add_action( 'wp_ajax_hideDonate', array( $this, 'storeHideDonate'));
326
+ add_action( 'admin_menu', array( $this, 'addEventBox' ) );
327
+ add_action( 'save_post', array( $this, 'addEventMeta' ), 15 );
328
+ add_action( 'publish_post', array( $this, 'addEventMeta' ), 15 );
329
+ add_action( 'show_user_profile',array( $this, 'userProfilePage' ) );
330
+ add_action( 'edit_user_profile',array( $this, 'userProfilePage' ) );
331
+ add_filter( 'generate_rewrite_rules', array( $this, 'filterRewriteRules' ) );
332
+ add_filter( 'query_vars', array( $this, 'eventQueryVars' ) );
333
+ add_filter( 'posts_join', array( $this, 'events_search_join' ) );
334
+ add_filter( 'posts_where', array( $this, 'events_search_where' ) );
335
+ add_filter( 'posts_orderby', array( $this, 'events_search_orderby' ) );
336
+ add_filter( 'posts_fields', array( $this, 'events_search_fields' ) );
337
+ add_filter( 'post_limits', array( $this, 'events_search_limits' ) );
338
+ add_action( 'template_redirect', array($this, 'templateChooser' ) );
339
+ }
340
+
341
+ public function addOptionsPage() {
342
+ add_options_page('The Events Calendar', 'The Events Calendar', 'administrator', basename(__FILE__), array($this,'optionsPageView'));
343
+ }
344
+
345
+ public function optionsPageView() {
346
+ include( dirname( __FILE__ ) . '/views/events-options.php' );
347
+ }
348
+
349
+ public function userProfilePage() {
350
+ include( dirname( __FILE__ ) . '/views/user-profile.php');
351
+ }
352
+
353
+ public function checkForOptionsChanges() {
354
+ if (isset($_POST['saveEventsCalendarOptions']) && check_admin_referer('saveEventsCalendarOptions')) {
355
+ $options = $this->getOptions();
356
+ $options['viewOption'] = $_POST['viewOption'];
357
+ if($_POST['defaultCountry']) {
358
+ $this->constructCountries();
359
+ $defaultCountryKey = array_search($_POST['defaultCountry'],$this->countries);
360
+ $options['defaultCountry'] = array($defaultCountryKey,$_POST['defaultCountry']);
361
+ }
362
+
363
+ do_action( 'sp-events-save-more-options' );
364
+
365
+ $this->saveOptions($options);
366
+ $this->latestOptions = $options;
367
+
368
+ } // end if
369
+ }
370
+
371
+ public function storeHideDonate() {
372
+ if ( $_POST['donateHidden'] ) {
373
+ $options = $this->getOptions();
374
+ $options['donateHidden'] = true;
375
+
376
+ $this->saveOptions($options);
377
+
378
+ } // end if
379
+ }
380
+
381
+ /// OPTIONS DATA
382
+
383
+ public function getOptions() {
384
+ if ('' === $this->defaultOptions) {
385
+ $this->defaultOptions = get_option(The_Events_Calendar::OPTIONNAME, array());
386
+ }
387
+ return $this->defaultOptions;
388
+ }
389
+
390
+ private function saveOptions($options) {
391
+ if (!is_array($options)) {
392
+ return;
393
+ }
394
+ if ( update_option(The_Events_Calendar::OPTIONNAME, $options) ) {
395
+ $this->latestOptions = $options;
396
+ } else {
397
+ $this->latestOptions = $this->getOptions();
398
+ }
399
+ }
400
+
401
+ public function deleteOptions() {
402
+ delete_option(The_Events_Calendar::OPTIONNAME);
403
+ }
404
+
405
+ public function templateChooser() {
406
+ if( $this->debug ) error_log( "template chooser" );
407
+ // list view
408
+ if ( $this->in_event_category() && ( events_displaying_upcoming() || events_displaying_past() ) ) {
409
+ if (file_exists(TEMPLATEPATH.'/events/list.php') ) {
410
+ include (TEMPLATEPATH.'/events/list.php');
411
+ }
412
+ else {
413
+ include dirname( __FILE__ ) . '/views/list.php';
414
+ }
415
+ exit;
416
+ }
417
+
418
+ // grid view
419
+ if ( $this->in_event_category() ) {
420
+ if (file_exists(TEMPLATEPATH.'/events/gridview.php') ) {
421
+ include (TEMPLATEPATH.'/events/gridview.php');
422
+ }
423
+ else {
424
+ include dirname( __FILE__ ) . '/views/gridview.php';
425
+ }
426
+ exit;
427
+ }
428
+
429
+ // single event
430
+ if (is_single() && in_category( $this->eventCategory() ) ) {
431
+ if (file_exists(TEMPLATEPATH.'/events/single.php') ) {
432
+ include (TEMPLATEPATH.'/events/single.php');
433
+ }
434
+ else {
435
+ include trailingslashit( WP_PLUGIN_DIR ) . trailingslashit( plugin_basename( dirname( __FILE__ ) ) ) . 'views/single.php';
436
+ }
437
+ exit;
438
+ }
439
+ }
440
+
441
+ public function loadStylesAndScripts( ) {
442
+ $eventsURL = trailingslashit( WP_PLUGIN_URL ) . trailingslashit( plugin_basename( dirname( __FILE__ ) ) ) . 'resources/';
443
+
444
+ wp_enqueue_script('sp-events-calendar-script', $eventsURL.'events.js', array('jquery') );
445
+ wp_enqueue_style('sp-events-calendar-style', $eventsURL.'events.css');
446
+
447
+ }
448
+
449
+ // works around a bug where setting category base to null doesn't allow get_option to return a default value
450
+ public function getCategoryBase() {
451
+ $category_base = get_option('category_base', 'category');
452
+ return ( empty( $category_base ) ) ? 'category' : $category_base;
453
+ }
454
+
455
+ public function truncate($text, $excerpt_length = 44) {
456
+
457
+ $text = strip_shortcodes( $text );
458
+
459
+ $text = apply_filters('the_content', $text);
460
+ $text = str_replace(']]>', ']]&gt;', $text);
461
+ $text = strip_tags($text);
462
+
463
+ $words = explode(' ', $text, $excerpt_length + 1);
464
+ if (count($words) > $excerpt_length) {
465
+ array_pop($words);
466
+ $text = implode(' ', $words);
467
+ $text = rtrim($text);
468
+ $text .= '&hellip;';
469
+ }
470
+
471
+ return $text;
472
+ }
473
+
474
+ public function loadPluginTextDomain( ) {
475
+ load_plugin_textdomain( 'events', 'wp-content/plugins/' . $this->pluginDir . '/resources/', $this->pluginDir . '/resources/');
476
+ }
477
+
478
+ /**
479
+ * Helper method to return an array of 1-12 for months
480
+ */
481
+ public function months( ) {
482
+ $months = array();
483
+ foreach( range( 1, 12 ) as $month ) {
484
+ $months[ $month ] = $month;
485
+ }
486
+ return $months;
487
+ }
488
+
489
+ /**
490
+ * Helper method to return an array of month names
491
+ */
492
+ public function monthNames( ) {
493
+ $months = array( 1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December' );
494
+
495
+ return $months;
496
+ }
497
+
498
+ /**
499
+ * Helper method to return an array of 1-31 for days
500
+ */
501
+ public function days( ) {
502
+ $days = array();
503
+ foreach( range( 1, 31 ) as $day ) {
504
+ $days[ $day ] = $day;
505
+ }
506
+ return $days;
507
+ }
508
+
509
+ /**
510
+ * Helper method to return an array of years, back 2 and forward 5
511
+ */
512
+ public function years( ) {
513
+ $year = ( int )date( 'Y' );
514
+ // Back two years, forward 5
515
+ $year_list = array( $year - 5, $year - 4, $year - 3, $year - 2, $year - 1, $year, $year + 1, $year + 2, $year + 3, $year + 4, $year + 5 );
516
+ $years = array();
517
+ foreach( $year_list as $single_year ) {
518
+ $years[ $single_year ] = $single_year;
519
+ }
520
+
521
+ return $years;
522
+ }
523
+
524
+ /**
525
+ * Creates the category and sets up the theme resource folder with sample config files.
526
+ *
527
+ * @return void
528
+ */
529
+ public function on_activate( ) {
530
+ $now = time();
531
+ $firstTime = $now - ($now % 66400);
532
+ wp_schedule_event( $firstTime, 'daily', 'reschedule_event_post'); // schedule this for midnight, daily
533
+ $this->create_category_if_not_exists( );
534
+ }
535
+ /**
536
+ * This function is scheduled to run at midnight. If any posts are set with EventStartDate
537
+ * to today, update the post so that it was posted today. This will force the event to be
538
+ * displayed in the main loop on the homepage.
539
+ *
540
+ * @return void
541
+ */
542
+ public function reschedule( ) {
543
+ global $wpdb;
544
+ $query = "
545
+ SELECT * FROM $wpdb->posts
546
+ LEFT JOIN $wpdb->postmeta ON($wpdb->posts.ID = $wpdb->postmeta.post_id)
547
+ WHERE
548
+ $wpdb->postmeta.meta_key = '_EventStartDate'
549
+ AND $wpdb->postmeta.meta_value = CURRENT_DATE()";
550
+ $return = $wpdb->get_results($query, OBJECT);
551
+ if ( is_array( $return ) && count( $return ) ) {
552
+ foreach ( $return as $row ) {
553
+ $updateQuery = "UPDATE $wpdb->posts SET post_date = NOW() WHERE $wpdb->posts.ID = " . $row->ID;
554
+ $wpdb->query( $updateQuery );
555
+ }
556
+ }
557
+ }
558
+ /**
559
+ * fields filter for standard wordpress templates. Adds the start and end date to queries in the
560
+ * events category
561
+ *
562
+ * @param string fields
563
+ * @param string modified fields for events queries
564
+ */
565
+ public function events_search_fields( $fields ) {
566
+ if( !$this->in_event_category() ) {
567
+ return $fields;
568
+ }
569
+ global $wpdb;
570
+ $fields .= ', eventStart.meta_value as EventStartDate, eventEnd.meta_value as EventEndDate ';
571
+ return $fields;
572
+
573
+ }
574
+ /**
575
+ * join filter for standard wordpress templates. Adds the postmeta tables for start and end queries
576
+ *
577
+ * @param string join clause
578
+ * @return string modified join clause
579
+ */
580
+ public function events_search_join( $join ) {
581
+ if( !$this->in_event_category() ) {
582
+ return $join;
583
+ }
584
+ global $wpdb;
585
+ $join .= "LEFT JOIN {$wpdb->postmeta} as eventStart ON( {$wpdb->posts}.ID = eventStart.post_id ) ";
586
+ $join .= "LEFT JOIN {$wpdb->postmeta} as eventEnd ON( {$wpdb->posts}.ID = eventEnd.post_id ) ";
587
+ return $join;
588
+ }
589
+ /**
590
+ * where filter for standard wordpress templates. Inspects the event options and filters
591
+ * event posts for upcoming or past event loops
592
+ *
593
+ * @param string where clause
594
+ * @return string modified where clase
595
+ */
596
+ public function events_search_where( $where ) {
597
+ if( !$this->in_event_category() ) {
598
+ return $where;
599
+ }
600
+ $where .= ' AND ( eventStart.meta_key = "_EventStartDate" AND eventEnd.meta_key = "_EventEndDate" ) ';
601
+ if( events_displaying_month( ) ) {
602
+
603
+ }
604
+ if( events_displaying_upcoming( ) ) {
605
+ // Is the start date in the future?
606
+ $where .= ' AND ( eventStart.meta_value > "'.$this->date.'" ';
607
+ // Or is the start date in the past but the end date in the future? (meaning the event is currently ongoing)
608
+ $where .= ' OR ( eventStart.meta_value < "'.$this->date.'" AND eventEnd.meta_value > "'.$this->date.'" ) ) ';
609
+ }
610
+ if( events_displaying_past( ) ) {
611
+ // Is the start date in the past?
612
+ $where .= ' AND eventStart.meta_value < "'.$this->date.'" ';
613
+ }
614
+ return $where;
615
+ }
616
+ /**
617
+ * @return bool true if is_category() is on a child of the events category
618
+ */
619
+ public function in_event_category( ) {
620
+ if( is_category( The_Events_Calendar::CATEGORYNAME ) ) {
621
+ return true;
622
+ }
623
+ $cat_id = get_query_var( 'cat' );
624
+ if( $cat_id == $this->eventCategory() ) {
625
+ return true;
626
+ }
627
+ $cats = get_categories('child_of=' . $this->eventCategory());
628
+ $is_child = false;
629
+ foreach( $cats as $cat ) {
630
+ if( is_category( $cat->name ) ) {
631
+ $is_child = true;
632
+ }
633
+ }
634
+ return $is_child;
635
+ }
636
+ /**
637
+ * orderby filter for standard wordpress templates. Adds event ordering for queries that are
638
+ * in the events category and filtered according to the search parameters
639
+ *
640
+ * @param string orderby
641
+ * @return string modified orderby clause
642
+ */
643
+ public function events_search_orderby( $orderby ) {
644
+ if( !$this->in_event_category() ) {
645
+ return $orderby;
646
+ }
647
+ global $wpdb;
648
+ $orderby = ' eventStart.meta_value '.$this->order;
649
+ return $orderby;
650
+
651
+ }
652
+ /**
653
+ * limit filter for standard wordpress templates. Adds limit clauses for pagination
654
+ * for queries in the events category
655
+ *
656
+ * @param string limits clause
657
+ * @return string modified limits clause
658
+ */
659
+ public function events_search_limits( $limits ) {
660
+ if( !$this->in_event_category() ) {
661
+ return $limits;
662
+ }
663
+ global $wpdb, $wp_query, $paged;
664
+ if (empty($paged)) {
665
+ $paged = 1;
666
+ }
667
+ $posts_per_page = intval( get_option('posts_per_page') );
668
+ $paged = get_query_var('paged') ? intval( get_query_var('paged') ) : 1;
669
+ $pgstrt = ( ( $paged - 1 ) * $posts_per_page ) . ', ';
670
+ $limits = 'LIMIT ' . $pgstrt . $posts_per_page;
671
+ return $limits;
672
+ }
673
+ /**
674
+ * Gets the Category id to use for an Event
675
+ * @return int|false Category id to use or false is none is set
676
+ */
677
+ static function eventCategory() {
678
+ return get_cat_id( The_Events_Calendar::CATEGORYNAME );
679
+ }
680
+ /**
681
+ * undocumented
682
+ */
683
+ public function flushRewriteRules()
684
+ {
685
+ global $wp_rewrite;
686
+ $wp_rewrite->flush_rules();
687
+ }
688
+ /**
689
+ * Adds the event specific query vars to Wordpress
690
+ *
691
+ * @return mixed array of query variables that this plugin understands
692
+ */
693
+ public function eventQueryVars( $qvars ) {
694
+ $qvars[] = 'eventDisplay';
695
+ $qvars[] = 'eventDate';
696
+ return $qvars;
697
+ }
698
+ /**
699
+ * Adds Event specific rewrite rules.
700
+ *
701
+ * events/ => /?cat=27
702
+ * events/month => /?cat=27&eventDisplay=month
703
+ * events/upcoming => /?cat=27&eventDisplay=upcoming
704
+ * events/past => /?cat=27&eventDisplay=past
705
+ * events/2008-01/#15 => /?cat=27&eventDisplay=bydate&eventDate=2008-01-01
706
+ *
707
+ * @return void
708
+ */
709
+ public function filterRewriteRules( $wp_rewrite ) {
710
+ $categoryId = get_cat_id( The_Events_Calendar::CATEGORYNAME );
711
+ $category_base = $this->getCategoryBase();
712
+ $newRules = array(
713
+
714
+ $category_base . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/month' => 'index.php?cat=' . $categoryId . '&eventDisplay=month',
715
+ $category_base . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/upcoming/page/(\d+)' => 'index.php?cat=' . $categoryId . '&eventDisplay=upcoming&paged=' . $wp_rewrite->preg_index(1),
716
+ $category_base . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/upcoming' => 'index.php?cat=' . $categoryId . '&eventDisplay=upcoming',
717
+ $category_base . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/past/page/(\d+)' => 'index.php?cat=' . $categoryId . '&eventDisplay=past&paged=' . $wp_rewrite->preg_index(1),
718
+ $category_base . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/past' => 'index.php?cat=' . $categoryId . '&eventDisplay=past',
719
+ $category_base . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/(\d{4}-\d{2})$'
720
+ => 'index.php?cat=' . $categoryId . '&eventDisplay=month' .
721
+ '&eventDate=' . $wp_rewrite->preg_index(1),
722
+ $category_base . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/?$'=> 'index.php?cat=' . $categoryId . '&eventDisplay=' . eventsGetOptionValue('viewOption','month')
723
+
724
+ );
725
+ $wp_rewrite->rules = $newRules + $wp_rewrite->rules;
726
+ }
727
+ /**
728
+ * Creates the events category and updates the core options (if not already done)
729
+ * @return int cat_ID
730
+ */
731
+ public function create_category_if_not_exists( ) {
732
+ if ( !category_exists( The_Events_Calendar::CATEGORYNAME ) ) {
733
+ $category_id = wp_create_category( The_Events_Calendar::CATEGORYNAME );
734
+ return $category_id;
735
+ } else {
736
+ return $this->eventCategory();
737
+ }
738
+ }
739
+
740
+ /**
741
+ * This plugin does not have any deactivation functionality. Any events, categories, options and metadata are
742
+ * left behind.
743
+ *
744
+ * @return void
745
+ */
746
+ public function on_deactivate( ) {
747
+ wp_clear_scheduled_hook('reschedule_event_post');
748
+ }
749
+ /**
750
+ * Converts a set of inputs to YYYY-MM-DD HH:MM:SS format for MySQL
751
+ */
752
+ public function dateToTimeStamp( $year, $month, $day, $hour, $minute, $meridian ) {
753
+ if ( $meridian == 'PM' && $hour < 12 ) {
754
+ $hour += "12";
755
+ }
756
+ if ( $meridian == 'AM' && $hour == 12 ) {
757
+ $hour = "00";
758
+ }
759
+ return "$year-$month-$day $hour:$minute:00";
760
+ }
761
+ public function setTimeFormat( $format = self::DATETIMEFORMAT12 ) {
762
+ update_option( self::EVENTTIMEFORMATOPT, $format );
763
+ }
764
+ public function getTimeFormat( ) {
765
+ if( $format = get_option( self::EVENTTIMEFORMATOPT ) ) {
766
+ return $format;
767
+ } else {
768
+ $this->setTimeFormat( self::DATETIMEFORMAT12 );
769
+ return self::DATETIMEFORMAT12;
770
+ }
771
+ }
772
+ /**
773
+ * Adds / removes the event details as meta tags to the post.
774
+ *
775
+ * @param string $postId
776
+ * @return void
777
+ */
778
+ public function addEventMeta( $postId ) {
779
+ if ($_POST['isEvent'] == 'yes') {
780
+ $this->setTimeFormat( $_POST['EventTimeFormat'] );
781
+ $category_id = $this->create_category_if_not_exists();
782
+ // add a function blow to remove all existing categories - wp_set_post_categories(int , array )
783
+ if( $_POST['EventAllDay'] == 'yes' ) {
784
+ $_POST['EventStartDate'] = $this->dateToTimeStamp( $_POST['EventStartYear'], $_POST['EventStartMonth'], $_POST['EventStartDay'], "12", "00", "AM" );
785
+ $_POST['EventEndDate'] = $this->dateToTimeStamp( $_POST['EventEndYear'], $_POST['EventEndMonth'], $_POST['EventEndDay'], "11", "59", "PM" );
786
+ } else {
787
+ delete_post_meta( $postId, '_EventAllDay' );
788
+ $_POST['EventStartDate'] = $this->dateToTimeStamp( $_POST['EventStartYear'], $_POST['EventStartMonth'], $_POST['EventStartDay'], $_POST['EventStartHour'], $_POST['EventStartMinute'], $_POST['EventStartMeridian'] );
789
+ $_POST['EventEndDate'] = $this->dateToTimeStamp( $_POST['EventEndYear'], $_POST['EventEndMonth'], $_POST['EventEndDay'], $_POST['EventEndHour'], $_POST['EventEndMinute'], $_POST['EventEndMeridian'] );
790
+ }
791
+ // sanity check that start date < end date
792
+ $startTimestamp = strtotime( $_POST['EventStartDate'] );
793
+ $endTimestamp = strtotime( $_POST['EventEndDate'] );
794
+ if ( $startTimestamp > $endTimestamp ) {
795
+ $_POST['EventEndDate'] = $_POST['EventStartDate'];
796
+ }
797
+ // give add-on plugins a chance to cancel this meta update
798
+ try {
799
+ do_action( 'sp_events_event_save', $postId );
800
+ } catch ( Exception $e) {
801
+ // there was an error with a sub-plugin saving the post details
802
+ // make sure the error is saved somehow and displayed
803
+ update_post_meta( $postId, Eventbrite_for_The_Events_Calendar::EVENTBRITEERROPT, trim( $e->getMessage() ) );
804
+ return false;
805
+ }
806
+ //update meta fields
807
+ foreach ( $this->metaTags as $tag ) {
808
+ $htmlElement = ltrim( $tag, '_' );
809
+ if ( isset( $_POST[$htmlElement] ) ) {
810
+ update_post_meta( $postId, $tag, $_POST[$htmlElement] );
811
+ }
812
+ }
813
+ // merge event category into this post
814
+ update_post_meta( $postId, '_EventCost', the_event_cost( $postId ) ); // XXX eventbrite cost field
815
+ $cats = wp_get_object_terms($postId, 'category', array('fields' => 'ids'));
816
+ wp_set_post_categories( $postId, array( get_category( $category_id )->cat_ID ) + $cats );
817
+ }
818
+ if ($_POST['isEvent'] == 'no' && is_event( $postId ) ) {
819
+ // remove event meta tags if they exist...this post is no longer an event
820
+ foreach ( $this->metaTags as $tag ) {
821
+ delete_post_meta( $postId, $tag );
822
+ }
823
+ $event_cats[] = $this->eventCategory();
824
+ $cats = get_categories('child_of=' . $this->eventCategory());
825
+ foreach( $cats as $cat ) {
826
+ $event_cats[] = $cat->term_id;
827
+ }
828
+ // remove the event categories from this post but keep any non-event categories
829
+ $terms = wp_get_object_terms($postId, 'category');
830
+ $non_event_cats = array();
831
+ foreach ( $terms as $term ) {
832
+ if( !in_array( $term->term_id, $event_cats ) ) {
833
+ $non_event_cats[] = $term->term_id;
834
+ }
835
+ }
836
+ wp_set_post_categories( $postId, $non_event_cats );
837
+ do_action( 'sp_events_event_clear', $postId );
838
+ }
839
+ }
840
+
841
+ /**
842
+ * Adds a style chooser to the write post page
843
+ *
844
+ * @return void
845
+ */
846
+ public function EventsChooserBox( ) {
847
+ global $post;
848
+ $options = '';
849
+ $style = '';
850
+ $postId = $post->ID;
851
+
852
+ foreach ( $this->metaTags as $tag ) {
853
+ if ( $postId ) {
854
+ $$tag = get_post_meta( $postId, $tag, true );
855
+ } else {
856
+ $$tag = '';
857
+ }
858
+ }
859
+ $timeFormat = $this->getTimeFormat();
860
+ $is12HourChecked = ( $timeFormat == self::DATETIMEFORMAT12 ) ? 'checked' : '';
861
+ $is24HourChecked = ( $timeFormat == self::DATETIMEFORMAT24 ) ? 'checked' : '';
862
+ $isEventChecked = ( $_isEvent == 'yes' ) ? 'checked' : '';
863
+ $isNotEventChecked = ( $_isEvent == 'no' || $_isEvent == '' ) ? 'checked' : '';
864
+ $isEventAllDay = ( $_EventAllDay == 'yes' ) ? 'checked' : '';
865
+ $startDayOptions = $this->getDayOptions( $_EventStartDate );
866
+ $endDayOptions = $this->getDayOptions( $_EventEndDate );
867
+ $startMonthOptions = $this->getMonthOptions( $_EventStartDate );
868
+ $endMonthOptions = $this->getMonthOptions( $_EventEndDate );
869
+ $startYearOptions = $this->getYearOptions( $_EventStartDate );
870
+ $endYearOptions = $this->getYearOptions( $_EventEndDate );
871
+ $startMinuteOptions = $this->getMinuteOptions( $_EventStartDate );
872
+ $endMinuteOptions = $this->getMinuteOptions( $_EventEndDate );
873
+ $startHourOptions = $this->getHourOptions( $_EventStartDate );
874
+ $endHourOptions = $this->getHourOptions( $_EventEndDate );
875
+ $startMeridianOptions = $this->getMeridianOptions( $_EventStartDate );
876
+ $endMeridianOptions = $this->getMeridianOptions( $_EventEndDate );
877
+ include( dirname( __FILE__ ) . '/views/events-meta-box.php' );
878
+ }
879
+ /**
880
+ * Given a date (YYYY-MM-DD), returns the first of the next month
881
+ *
882
+ * @param date
883
+ * @return date
884
+ */
885
+ public function nextMonth( $date ) {
886
+ $dateParts = split( '-', $date );
887
+ if ( $dateParts[1] == 12 ) {
888
+ $dateParts[0]++;
889
+ $dateParts[1] = "01";
890
+ $dateParts[2] = "01";
891
+ } else {
892
+ $dateParts[1]++;
893
+ $dateParts[2] = "01";
894
+ }
895
+ if ( $dateParts[1] < 10 && strlen( $dateParts[1] ) == 1 ) {
896
+ $dateParts[1] = "0" . $dateParts[1];
897
+ }
898
+ $return = $dateParts[0] . '-' . $dateParts[1];
899
+ return $return;
900
+ }
901
+ /**
902
+ * Given a date (YYYY-MM-DD), return the first of the previous month
903
+ *
904
+ * @param date
905
+ * @return date
906
+ */
907
+ public function previousMonth( $date ) {
908
+ $dateParts = split( '-', $date );
909
+
910
+ if ( $dateParts[1] == 1 ) {
911
+ $dateParts[0]--;
912
+ $dateParts[1] = "12";
913
+ $dateParts[2] = "01";
914
+ } else {
915
+ $dateParts[1]--;
916
+ $dateParts[2] = "01";
917
+ }
918
+ if ( $dateParts[1] < 10 ) {
919
+ $dateParts[1] = "0" . $dateParts[1];
920
+ }
921
+ $return = $dateParts[0] . '-' . $dateParts[1];
922
+
923
+ return $return;
924
+ }
925
+
926
+ /**
927
+ * Callback for adding the Meta box to the admin page
928
+ * @return void
929
+ */
930
+ public function addEventBox( ) {
931
+ add_meta_box( 'Events', __( 'Events', 'Events_textdomain' ),
932
+ array( $this, 'EventsChooserBox' ), 'post', 'normal', 'high' );
933
+ }
934
+ /**
935
+ * Builds a set of options for diplaying a meridian chooser
936
+ *
937
+ * @param string YYYY-MM-DD HH:MM:SS to select (optional)
938
+ * @return string a set of HTML options with all meridians
939
+ */
940
+ public function getMeridianOptions( $date = "" ) {
941
+ if ( empty( $date ) ) {
942
+ $meridian = date('A');
943
+ } else {
944
+ $meridian = date('A', strtotime( $date ) );
945
+ }
946
+ $return = '';
947
+ $meridians = array( "AM", "PM" );
948
+ foreach ( $meridians as $m ) {
949
+ $return .= "<option value='$m'";
950
+ if ( $m == $meridian ) {
951
+ $return .= ' selected="selected"';
952
+ }
953
+ $return .= ">$m</option>\n";
954
+ }
955
+ return $return;
956
+ }
957
+ /**
958
+ * Builds a set of options for displaying a month chooser
959
+ * @param string the current date to select (optional)
960
+ * @return string a set of HTML options with all months (current month selected)
961
+ */
962
+ public function getMonthOptions( $date = "" ) {
963
+ $months = $this->monthNames();
964
+ $options = '';
965
+ if ( empty( $date ) ) {
966
+ $month = date( 'm' );
967
+ } else {
968
+ $month = date( 'm', strtotime( $date ) );
969
+ }
970
+ foreach ( $months as $monthNum => $monthText ) {
971
+ if ( $monthNum < 10 ) {
972
+ $monthNum = "0" . $monthNum; // need a leading zero in the month
973
+ }
974
+ if ( $month == $monthNum ) {
975
+ $selected = 'selected="selected"';
976
+ } else {
977
+ $selected = '';
978
+ }
979
+ $options .= "<option value='$monthNum' $selected>$monthText</option>\n";
980
+ }
981
+ return $options;
982
+ }
983
+ /**
984
+ * Builds a set of options for displaying a day chooser
985
+ * @param string the current date (optional)
986
+ * @return string a set of HTML options with all days (current day selected)
987
+ */
988
+ public function getDayOptions( $date = "" ) {
989
+ $days = $this->days();
990
+ $options = '';
991
+ if ( empty ( $date ) ) {
992
+ $day = date( 'd' );
993
+ } else {
994
+ $day = date( 'd', strtotime( $date) );
995
+ }
996
+ foreach ( $days as $dayText ) {
997
+ if ( $dayText < 10 ) {
998
+ $dayText = "0" . $dayText; // need a leading zero in the day
999
+ }
1000
+ if ( $day == $dayText ) {
1001
+ $selected = 'selected="selected"';
1002
+ } else {
1003
+ $selected = '';
1004
+ }
1005
+ $options .= "<option value='$dayText' $selected>$dayText</option>\n";
1006
+ }
1007
+ return $options;
1008
+ }
1009
+ /**
1010
+ * Builds a set of options for displaying a year chooser
1011
+ * @param string the current date (optional)
1012
+ * @return string a set of HTML options with adjacent years (current year selected)
1013
+ */
1014
+ public function getYearOptions( $date = "" ) {
1015
+ $years = $this->years();
1016
+ $options = '';
1017
+ if ( empty ( $date ) ) {
1018
+ $year = date( 'Y' );
1019
+ } else {
1020
+ $year = date( 'Y', strtotime( $date ) );
1021
+ }
1022
+ foreach ( $years as $yearText ) {
1023
+ if ( $year == $yearText ) {
1024
+ $selected = 'selected="selected"';
1025
+ } else {
1026
+ $selected = '';
1027
+ }
1028
+ $options .= "<option value='$yearText' $selected>$yearText</option>\n";
1029
+ }
1030
+ return $options;
1031
+ }
1032
+ /**
1033
+ * Builds a set of options for displaying an hour chooser
1034
+ * @param string the current date (optional)
1035
+ * @return string a set of HTML options with hours (current hour selected)
1036
+ */
1037
+ public function getHourOptions( $date = "" ) {
1038
+ $hours = $this->hours();
1039
+ $options = '';
1040
+ if ( empty ( $date ) ) {
1041
+ $hour = date( 'h' );
1042
+ } else {
1043
+ $hour = date( 'h', strtotime( $date ) );
1044
+ }
1045
+ foreach ( $hours as $hourText ) {
1046
+ if ( $hour == $hourText ) {
1047
+ $selected = 'selected="selected"';
1048
+ } else {
1049
+ $selected = '';
1050
+ }
1051
+ $options .= "<option value='$hourText' $selected>$hourText</option>\n";
1052
+ }
1053
+ return $options;
1054
+ }
1055
+ /**
1056
+ * Builds a set of options for displaying a minute chooser
1057
+ * @param string the current date (optional)
1058
+ * @return string a set of HTML options with minutes (current minute selected)
1059
+ */
1060
+ public function getMinuteOptions( $date = "" ) {
1061
+ $minutes = $this->minutes();
1062
+ $options = '';
1063
+ if ( empty ( $date ) ) {
1064
+ $minute = date( 'i' );
1065
+ } else {
1066
+ $minute = date( 'i', strtotime( $date ) );
1067
+ }
1068
+ foreach ( $minutes as $minuteText ) {
1069
+ if ( $minute == $minuteText ) {
1070
+ $selected = 'selected="selected"';
1071
+ } else {
1072
+ $selected = '';
1073
+ }
1074
+ $options .= "<option value='$minuteText' $selected>$minuteText</option>\n";
1075
+ }
1076
+ return $options;
1077
+ }
1078
+ /**
1079
+ * Helper method to return an array of 1-12 for hours
1080
+ */
1081
+ public function hours( ) {
1082
+ $hours = array();
1083
+ foreach(range(1,12) as $hour) {
1084
+ if ( $hour < 10 ) {
1085
+ $hour = "0".$hour;
1086
+ }
1087
+ $hours[$hour] = $hour;
1088
+ }
1089
+ return $hours;
1090
+ }
1091
+ /**
1092
+ * Helper method to return an array of 00-59 for minutes
1093
+ */
1094
+ public static function minutes( ) {
1095
+ $minutes = array();
1096
+ foreach(range(0,59) as $minute) {
1097
+ if ($minute < 10) {
1098
+ $minute = "0" . $minute;
1099
+ }
1100
+ $minutes[$minute] = $minute;
1101
+ }
1102
+ return $minutes;
1103
+ }
1104
+ /**
1105
+ * Sets event options based on the current query string
1106
+ *
1107
+ * @return void
1108
+ */
1109
+ public function setOptions( ) {
1110
+ global $wp_query;
1111
+ $display = ( isset( $wp_query->query_vars['eventDisplay'] ) ) ? $wp_query->query_vars['eventDisplay'] : eventsGetOptionValue('viewOption','month');
1112
+ switch ( $display ) {
1113
+ case "past":
1114
+ $this->displaying = "past";
1115
+ $this->startOperator = "<=";
1116
+ $this->order = "DESC";
1117
+ $this->date = date( The_Events_Calendar::DBDATETIMEFORMAT );
1118
+ break;
1119
+ case "upcoming":
1120
+ $this->displaying = "upcoming";
1121
+ $this->startOperator = ">=";
1122
+ $this->order = "ASC";
1123
+ $this->date = date( The_Events_Calendar::DBDATETIMEFORMAT );
1124
+ break;
1125
+ case "month":
1126
+ case "default":
1127
+ $this->displaying = "month";
1128
+ $this->startOperator = ">=";
1129
+ $this->order = "ASC";
1130
+ // TODO date set to YYYY-MM
1131
+ // TODO store DD as an anchor to the URL
1132
+ if ( isset ( $wp_query->query_vars['eventDate'] ) ) {
1133
+ $this->date = $wp_query->query_vars['eventDate'] . "-01";
1134
+ } else {
1135
+ $this->date = date( 'Y-m' );
1136
+ }
1137
+ break;
1138
+
1139
+ }
1140
+ }
1141
+ public function getDateString( $date )
1142
+ {
1143
+ $dateParts = split( '-', $date );
1144
+ $timestamp = mktime( 0, 0, 0, $dateParts[1], 1, $dateParts[0] );
1145
+ return date( "F Y", $timestamp );
1146
+ }
1147
+
1148
+ } // end The_Events_Calendar class
1149
+ } // end if !class_exists The_Events_Calendar
1150
+
1151
+
1152
+ if( class_exists( 'The_Events_Calendar' ) && !function_exists( 'get_event_style' ) ) {
1153
+ global $spEvents;
1154
+ $spEvents = new The_Events_Calendar();
1155
+
1156
+ /**
1157
+ * retrieve specific key from options array, optionally provide a default return value
1158
+ *
1159
+ * @param string option key
1160
+ * @param string default return value (optional)
1161
+ * @return string option value or default
1162
+ */
1163
+ function eventsGetOptionValue($optionName, $default = '') {
1164
+ global $spEvents;
1165
+ if($optionName) {
1166
+ if( $spEvents->latestOptions ) {
1167
+ return $spEvents->latestOptions[$optionName];
1168
+ }
1169
+ $options = $spEvents->getOptions();
1170
+ return ( $options[$optionName] ) ? $options[$optionName] : $default;
1171
+ }
1172
+ }
1173
+
1174
+ /**
1175
+ * Output function: Prints the events calendar 'grid view'
1176
+ *
1177
+ * @return void
1178
+ */
1179
+ function event_grid_view( ) {
1180
+ global $spEvents;
1181
+ global $wp_query;
1182
+ $wp_query->set( 'eventDisplay', 'bydate' );
1183
+ $eventPosts = get_events( );
1184
+
1185
+ $monthView = events_by_month( $eventPosts, $spEvents->date );
1186
+ require( dirname( __FILE__ ) . '/views/table.php' );
1187
+ }
1188
+ /**
1189
+ * Maps events to days
1190
+ *
1191
+ * @param array of events from get_events()
1192
+ * @param string date of the
1193
+ * @return array days of the month with events as values
1194
+ */
1195
+ function events_by_month( $results, $date ) {
1196
+ if( preg_match( '/(\d{4})-(\d{2})/', $date, $matches ) ) {
1197
+ $queryYear = $matches[1];
1198
+ $queryMonth = $matches[2];
1199
+ } else {
1200
+ return false; // second argument not a date we recognize
1201
+ }
1202
+ $monthView = array();
1203
+ for( $i = 1; $i <= 31; $i++ ) {
1204
+ $monthView[$i] = array();
1205
+ }
1206
+ foreach ( $results as $event ) {
1207
+ $started = false;
1208
+ list( $startYear, $startMonth, $startDay, $garbage ) = explode( '-', $event->EventStartDate );
1209
+ list( $endYear, $endMonth, $endDay, $garbage ) = explode( '-', $event->EventEndDate );
1210
+ list( $startDay, $garbage ) = explode( ' ', $startDay );
1211
+ list( $endDay, $garbage ) = explode( ' ', $endDay );
1212
+ for( $i = 1; $i <= 31 ; $i++ ) {
1213
+ if ( ( $i == $startDay && $startMonth == $queryMonth ) || strtotime( $startYear.'-'.$startMonth ) < strtotime( $queryYear.'-'.$queryMonth ) ) {
1214
+ $started = true;
1215
+ }
1216
+ if ( $started ) {
1217
+ $monthView[$i][] = $event;
1218
+ }
1219
+ if( $i == $endDay && $endMonth == $queryMonth ) {
1220
+ continue 2;
1221
+ }
1222
+ }
1223
+ }
1224
+ return $monthView;
1225
+ }
1226
+ /**
1227
+ * Output function: Prints the selected event style
1228
+ *
1229
+ * @param string $post_id
1230
+ * @return void
1231
+ */
1232
+ function event_style( $postId = null ) {
1233
+ echo get_event_style( $postId );
1234
+ }
1235
+
1236
+ /**
1237
+ * Template function:
1238
+ * @return boolean
1239
+ */
1240
+ function is_event( $postId = null ) {
1241
+ if ( $postId === null || !is_numeric( $postId ) ) {
1242
+ global $post;
1243
+ $postId = $post->ID;
1244
+ }
1245
+ if (get_post_meta( $postId, '_isEvent', true )) {
1246
+ return true;
1247
+ }
1248
+ return false;
1249
+ }
1250
+ /**
1251
+ * Returns a link to google maps for the given event
1252
+ *
1253
+ * @param string $postId
1254
+ * @return string a fully qualified link to http://maps.google.com/ for this event
1255
+ */
1256
+ function get_event_google_map_link( $postId = null ) {
1257
+ if ( $postId === null || !is_numeric( $postId ) ) {
1258
+ global $post;
1259
+ $postId = $post->ID;
1260
+ }
1261
+ if ( !is_event( $postId ) ) {
1262
+ return false;
1263
+ }
1264
+ $address = get_post_meta( $postId, '_EventAddress', true );
1265
+ $city = get_post_meta( $postId, '_EventCity', true );
1266
+ $state = get_post_meta( $postId, '_EventState', true );
1267
+ $province = get_post_meta($postId, '_EventProvince', true );
1268
+ $zip = get_post_meta( $postId, '_EventZip', true );
1269
+ $country = get_post_meta($postId, '_EventCountry', true );
1270
+ $google_url = "http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=";
1271
+ if ( $country == "United States" && !empty( $address ) && !empty( $city ) && !empty( $state) && !empty( $zip ) ) {
1272
+ return $google_url . urlencode( $address . " " . $city . " " . $state . " " . $zip . " " . $country);
1273
+ } elseif ( !empty( $country ) && !empty( $address ) && !empty( $city ) && !empty( $province ) && !empty( $zip ) ) {
1274
+ return $google_url . urlencode( $address . " " . $city . " " . $province . " " . $zip . " " . $country);
1275
+ }
1276
+ return "";
1277
+ }
1278
+ /**
1279
+ * Displays a link to google maps for the given event
1280
+ *
1281
+ * @param string $postId
1282
+ * @return void
1283
+ */
1284
+ function event_google_map_link( $postId = null ) {
1285
+ echo get_event_google_map_link( $postId );
1286
+ }
1287
+ /**
1288
+ * Prints out the javascript required to control the datepicker (onChange of the id='datepicker')
1289
+ *
1290
+ * @param string a prefix to add to the ID of the calendar elements. This allows you to reuse the calendar on the same page.
1291
+ * @return void
1292
+ */
1293
+ function get_jump_to_date_calendar( $prefix = '' ) {
1294
+ global $spEvents, $wp_query;
1295
+ if ( isset ( $wp_query->query_vars['eventDate'] ) ) {
1296
+ $date = $wp_query->query_vars['eventDate'] . "-01";
1297
+ } else {
1298
+ $date = date( The_Events_Calendar::DBDATEFORMAT );
1299
+ }
1300
+ $monthOptions = $spEvents->getMonthOptions( $date );
1301
+ $yearOptions = $spEvents->getYearOptions( $date );
1302
+ include('views/datepicker.php');
1303
+ }
1304
+ /**
1305
+ * Returns the event start date
1306
+ *
1307
+ * @param int post id
1308
+ * @param bool display time?
1309
+ * @return string date
1310
+ */
1311
+ function the_event_start_date( $postId = null, $showtime = 'true' ) {
1312
+ global $spEvents, $post;
1313
+ if ( $postId === null || !is_numeric( $postId ) ) {
1314
+ global $post;
1315
+ $postId = $post->ID;
1316
+ }
1317
+ if( the_event_all_day( $postId ) ) {
1318
+ $showtime = false;
1319
+ }
1320
+ if ( $showtime ) {
1321
+ $format = $spEvents->getTimeFormat();
1322
+ } else {
1323
+ $format = The_Events_Calendar::DATEONLYFORMAT;
1324
+ }
1325
+ return date ( $format, strtotime( get_post_meta( $postId, '_EventStartDate', true ) ) );
1326
+ }
1327
+ /**
1328
+ * Returns the event end date
1329
+ *
1330
+ * @return string date
1331
+ */
1332
+ function the_event_end_date( $postId = null, $showtime = 'true' ) {
1333
+ global $spEvents, $post;
1334
+ if ( $postId === null || !is_numeric( $postId ) ) {
1335
+ $postId = $post->ID;
1336
+ }
1337
+ if( the_event_all_day( $postId ) ) {
1338
+ $showtime = false;
1339
+ }
1340
+ if ( $showtime ) {
1341
+ $format = $spEvents->getTimeFormat();
1342
+ } else {
1343
+ $format = The_Events_Calendar::DATEONLYFORMAT;
1344
+ }
1345
+ return date ( $format, strtotime( get_post_meta( $postId, '_EventEndDate', true ) ) );
1346
+ }
1347
+ /**
1348
+ * If EventBrite plugin is active
1349
+ * If the event is registered in eventbrite, and has one ticket. Return the cost of that ticket.
1350
+ * If the event is registered in eventbrite, and there are many tickets, return "Varies"
1351
+ * If the event is not registered in eventbrite, and there is meta, return that.
1352
+ * If the event is not registered in eventbrite, and there is no meta, return "Free"
1353
+ *
1354
+ * @param mixed post id or null if used in the loop
1355
+ * @return string
1356
+ */
1357
+ function the_event_cost( $postId = null) {
1358
+ global $spEvents;
1359
+ if ( $postId === null || !is_numeric( $postId ) ) {
1360
+ global $post;
1361
+ $postId = $post->ID;
1362
+ }
1363
+ if( class_exists( 'Eventbrite_for_The_Events_Calendar' ) ) {
1364
+ global $spEventBrite;
1365
+ $returned = $spEventBrite->the_event_cost($postId);
1366
+ if($returned) {
1367
+ return $returned;
1368
+ }
1369
+ }
1370
+ if ( $cost = get_post_meta( $postId, '_EventCost', true ) ) {
1371
+ return $cost;
1372
+ } else {
1373
+ return __('Free');
1374
+ }
1375
+ }
1376
+ /**
1377
+ * Returns the event venue
1378
+ *
1379
+ * @return string venue
1380
+ */
1381
+ function the_event_venue( $postId = null) {
1382
+ if ( $postId === null || !is_numeric( $postId ) ) {
1383
+ global $post;
1384
+ $postId = $post->ID;
1385
+ }
1386
+ return get_post_meta( $postId, '_EventVenue', true );
1387
+ }
1388
+ /**
1389
+ * Returns the event country
1390
+ *
1391
+ * @return string country
1392
+ */
1393
+ function the_event_country( $postId = null) {
1394
+ if ( $postId === null || !is_numeric( $postId ) ) {
1395
+ global $post;
1396
+ $postId = $post->ID;
1397
+ }
1398
+ return get_post_meta( $postId, '_EventCountry', true );
1399
+ }
1400
+ /**
1401
+ * Returns the event address
1402
+ *
1403
+ * @return string address
1404
+ */
1405
+ function the_event_address( $postId = null) {
1406
+ if ( $postId === null || !is_numeric( $postId ) ) {
1407
+ global $post;
1408
+ $postId = $post->ID;
1409
+ }
1410
+ return get_post_meta( $postId, '_EventAddress', true );
1411
+ }
1412
+ /**
1413
+ * Returns the event city
1414
+ *
1415
+ * @return string city
1416
+ */
1417
+ function the_event_city( $postId = null) {
1418
+ if ( $postId === null || !is_numeric( $postId ) ) {
1419
+ global $post;
1420
+ $postId = $post->ID;
1421
+ }
1422
+ return get_post_meta( $postId, '_EventCity', true );
1423
+ }
1424
+ /**
1425
+ * Returns the event state
1426
+ *
1427
+ * @return string state
1428
+ */
1429
+ function the_event_state( $postId = null) {
1430
+ if ( $postId === null || !is_numeric( $postId ) ) {
1431
+ global $post;
1432
+ $postId = $post->ID;
1433
+ }
1434
+ return get_post_meta( $postId, '_EventState', true );
1435
+ }
1436
+ /**
1437
+ * Returns the event province
1438
+ *
1439
+ * @return string province
1440
+ */
1441
+ function the_event_province( $postId = null) {
1442
+ if ( $postId === null || !is_numeric( $postId ) ) {
1443
+ global $post;
1444
+ $postId = $post->ID;
1445
+ }
1446
+ return get_post_meta( $postId, '_EventProvince', true );
1447
+ }
1448
+ /**
1449
+ * Returns the event zip code
1450
+ *
1451
+ * @return string zip code
1452
+ */
1453
+ function the_event_zip( $postId = null) {
1454
+ if ( $postId === null || !is_numeric( $postId ) ) {
1455
+ global $post;
1456
+ $postId = $post->ID;
1457
+ }
1458
+ return get_post_meta( $postId, '_EventZip', true );
1459
+ }
1460
+ /**
1461
+ * Returns the event phone number
1462
+ *
1463
+ * @return string phone number
1464
+ */
1465
+ function the_event_phone( $postId = null) {
1466
+ if ( $postId === null || !is_numeric( $postId ) ) {
1467
+ global $post;
1468
+ $postId = $post->ID;
1469
+ }
1470
+ return get_post_meta( $postId, '_EventPhone', true );
1471
+ }
1472
+ /**
1473
+ * Returns a list of lectures that are associated with this event
1474
+ *
1475
+ * @param int optional post id
1476
+ * @return mixed array of posts or false
1477
+ */
1478
+ function the_event_lectures( $postId = null ) {
1479
+ if ( $postId === null || !is_numeric( $postId ) ) {
1480
+ global $post;
1481
+ $postId = $post->ID;
1482
+ }
1483
+ if( !is_event( $postId ) ) {
1484
+ return false;
1485
+ }
1486
+ global $wpdb;
1487
+ $query = "SELECT * FROM {$wpdb->postmeta} WHERE meta_key = '_lectureEvent' AND meta_value = '{$postId}'";
1488
+ $results = $wpdb->get_results( $query );
1489
+ if( empty( $results ) ) {
1490
+ return $results;
1491
+ }
1492
+ $lectures = array();
1493
+ foreach ( $results as $lecture ) {
1494
+ $lectures[] = $lecture->post_id;
1495
+ }
1496
+ $lectures = array_unique( $lectures );
1497
+ $results = array();
1498
+ foreach ( $lectures as $lectureId ) {
1499
+ $results[] = get_post( $lectureId );
1500
+ }
1501
+ return $results;
1502
+
1503
+ }
1504
+
1505
+ /**
1506
+ * Helper function to load XML using cURL
1507
+ *
1508
+ * @return array with xml data
1509
+ */
1510
+ function load_xml($url) {
1511
+
1512
+ $ch = curl_init($url);
1513
+
1514
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1515
+ curl_setopt($ch, CURLOPT_HEADER, 0);
1516
+
1517
+ $data = simplexml_load_string(curl_exec($ch));
1518
+
1519
+ curl_close($ch);
1520
+
1521
+ return $data;
1522
+ }
1523
+
1524
+ /**
1525
+ * Called inside of the loop, returns true if the current post's meta_value (EventStartDate)
1526
+ * is different than the previous post. Will always return true for the first event in the loop.
1527
+ *
1528
+ * @return bool
1529
+ */
1530
+ function is_new_event_day( ) {
1531
+ global $spEvents, $post;
1532
+ $retval = false;
1533
+ $now = time();
1534
+ $postTimestamp = strtotime( $post->EventStartDate, $now );
1535
+ $postTimestamp = strtotime( date( The_Events_Calendar::DBDATEFORMAT, $postTimestamp ), $now); // strip the time
1536
+ if ( $postTimestamp != $spEvents->currentPostTimestamp ) {
1537
+ $retval = true;
1538
+ }
1539
+ $spEvents->currentPostTimestamp = $postTimestamp;
1540
+ return $retval;
1541
+ }
1542
+ /**
1543
+ * Call this function in a template to query the events and start the loop. Do not
1544
+ * subsequently call the_post() in your template, as this will start the loop twice and then
1545
+ * you're in trouble.
1546
+ *
1547
+ * http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query#Query_based_on_Custom_Field_and_Category
1548
+ *
1549
+ * @param int number of results to display for upcoming or past modes (default 10)
1550
+ * @uses $wpdb
1551
+ * @uses $wp_query
1552
+ * @return array results
1553
+ */
1554
+ function get_events( $numResults = 10 ) {
1555
+ global $wpdb, $wp_query, $spEvents;
1556
+ $spEvents->setOptions();
1557
+ $categoryId = get_cat_id( The_Events_Calendar::CATEGORYNAME );
1558
+
1559
+ $extraSelectClause ='';
1560
+ $extraJoinEndDate ='';
1561
+ if ( events_displaying_month() ) {
1562
+ $extraSelectClause = ", d2.meta_value as EventEndDate ";
1563
+ $extraJoinEndDate = " LEFT JOIN $wpdb->postmeta as d2 ON($wpdb->posts.ID = d2.post_id) ";
1564
+ $whereClause = " AND d1.meta_key = '_EventStartDate' AND d2.meta_key = '_EventEndDate' ";
1565
+ // does this event start in this month?
1566
+ $whereClause .= " AND ((d1.meta_value >= '".$spEvents->date."' AND d1.meta_value < '".$spEvents->nextMonth( $spEvents->date )."') ";
1567
+ // Or does it end in this month?
1568
+ $whereClause .= " OR (d2.meta_value >= '".$spEvents->date."' AND d2.meta_value < '".$spEvents->nextMonth( $spEvents->date )."' ) ";
1569
+ // Or does the event start sometime in the past and end sometime in the distant future?
1570
+ $whereClause .= " OR (d1.meta_value <= '".$spEvents->date."' AND d2.meta_value > '".$spEvents->nextMonth( $spEvents->date )."' ) ) ";
1571
+ }
1572
+ if ( events_displaying_upcoming() ) {
1573
+ $extraSelectClause = ", d2.meta_value as EventEndDate ";
1574
+ $extraJoinEndDate = " LEFT JOIN $wpdb->postmeta as d2 ON($wpdb->posts.ID = d2.post_id) ";
1575
+ $whereClause = " AND d1.meta_key = '_EventStartDate' AND d2.meta_key = '_EventEndDate' ";
1576
+ // Is the start date in the future?
1577
+ $whereClause .= ' AND ( d1.meta_value > "'.$spEvents->date.'" ';
1578
+ // Or is the start date in the past but the end date in the future? (meaning the event is currently ongoing)
1579
+ $whereClause .= ' OR ( d1.meta_value < "'.$spEvents->date.'" AND d2.meta_value > "'.$spEvents->date.'" ) ) ';
1580
+ }
1581
+ $eventsQuery = "
1582
+ SELECT $wpdb->posts.*, d1.meta_value as EventStartDate
1583
+ $extraSelectClause
1584
+ FROM $wpdb->posts
1585
+ LEFT JOIN $wpdb->postmeta as d1 ON($wpdb->posts.ID = d1.post_id)
1586
+ $extraJoinEndDate
1587
+ LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id)
1588
+ LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
1589
+ WHERE $wpdb->term_taxonomy.term_id = $categoryId
1590
+ AND $wpdb->term_taxonomy.taxonomy = 'category'
1591
+ AND $wpdb->posts.post_status = 'publish'
1592
+ $whereClause
1593
+ ORDER BY d1.meta_value ".$spEvents->order."
1594
+ LIMIT $numResults";
1595
+ $return = $wpdb->get_results($eventsQuery, OBJECT);
1596
+ if ( $return ) {
1597
+ $wp_query->in_the_loop = true;
1598
+ do_action('loop_start');
1599
+ }
1600
+ return $return;
1601
+ }
1602
+ /**
1603
+ * template tag to get an array of all events, regardless of the current query terms
1604
+ *
1605
+ * @param string field to order by (default is start date);
1606
+ * @param string sort order (default is ASC)
1607
+ * @return array of events
1608
+ */
1609
+ function get_all_events( $orderby = 'd1.meta_value', $sort = 'DESC', $limit = 100 ) {
1610
+ global $wpdb;
1611
+ $categoryId = get_cat_id( The_Events_Calendar::CATEGORYNAME );
1612
+ $eventsQuery = "
1613
+ SELECT $wpdb->posts.*, d1.meta_value as EventStartDate
1614
+ FROM $wpdb->posts
1615
+ LEFT JOIN $wpdb->postmeta as d1 ON($wpdb->posts.ID = d1.post_id)
1616
+ LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id)
1617
+ LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
1618
+ WHERE $wpdb->term_taxonomy.term_id = $categoryId
1619
+ AND $wpdb->term_taxonomy.taxonomy = 'category'
1620
+ AND $wpdb->posts.post_status = 'publish'
1621
+ AND d1.meta_key = '_EventStartDate'
1622
+ ORDER BY $orderby $sort
1623
+ LIMIT $limit
1624
+ ";
1625
+ return $wpdb->get_results($eventsQuery, OBJECT);
1626
+ }
1627
+ /**
1628
+ * Returns true if the query is set for past events, false otherwise
1629
+ *
1630
+ * @return bool
1631
+ */
1632
+ function events_displaying_past() {
1633
+ global $spEvents;
1634
+ return ($spEvents->displaying == "past") ? true : false;
1635
+ }
1636
+ /**
1637
+ * Returns true if the query is set for upcoming events, false otherwise
1638
+ *
1639
+ * @return bool
1640
+ */
1641
+ function events_displaying_upcoming() {
1642
+ global $spEvents;
1643
+ return ($spEvents->displaying == "upcoming") ? true : false;
1644
+ }
1645
+ /**
1646
+ * Returns true if the query is set for month display (as opposed to Upcoming / Past)
1647
+ *
1648
+ * @return bool
1649
+ */
1650
+ function events_displaying_month() {
1651
+ global $spEvents;
1652
+ return ( $spEvents->displaying == "month" ) ? true : false;
1653
+ }
1654
+ /**
1655
+ * Returns a link to the previous events in list view
1656
+ *
1657
+ * @return string
1658
+ */
1659
+ function events_get_past_link() {
1660
+ global $spEvents;
1661
+ if( '' == get_option('permalink_structure') ) {
1662
+ return trailingslashit( get_bloginfo('url') ) . '?cat=' . $spEvents->eventCategory() . '&eventDisplay=past';
1663
+ } else {
1664
+ return get_bloginfo( 'url' ) . '/'. $spEvents->getCategoryBase() . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/past/';
1665
+ }
1666
+ }
1667
+ /**
1668
+ * Returns a link to the upcoming events in list view
1669
+ *
1670
+ * @return string
1671
+ */
1672
+ function events_get_upcoming_link() {
1673
+ global $spEvents;
1674
+ if( '' == get_option('permalink_structure') ) {
1675
+ return trailingslashit( get_bloginfo('url') ) . '?cat=' . $spEvents->eventCategory() . '&eventDisplay=upcoming';
1676
+ } else {
1677
+ return get_bloginfo( 'url' ) . '/'. $spEvents->getCategoryBase() . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/upcoming/';
1678
+ }
1679
+ }
1680
+ /**
1681
+ * Returns a link to the next month's events page
1682
+ *
1683
+ * @return string
1684
+ */
1685
+ function events_get_next_month_link() {
1686
+ global $spEvents;
1687
+ if( '' == get_option('permalink_structure') ) {
1688
+ return trailingslashit( get_bloginfo('url') ) . '?cat=' . $spEvents->eventCategory() . '&eventDate=' . $spEvents->nextMonth( $spEvents->date );
1689
+ } else {
1690
+ return get_bloginfo( 'url' ) . '/'. $spEvents->getCategoryBase() . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/' . $spEvents->nextMonth( $spEvents->date );
1691
+ }
1692
+ }
1693
+ /**
1694
+ * Returns a link to the previous month's events page
1695
+ *
1696
+ * @return string
1697
+ */
1698
+ function events_get_previous_month_link() {
1699
+ global $spEvents;
1700
+ if( '' == get_option('permalink_structure') ) {
1701
+ return trailingslashit( get_bloginfo('url') ) . '?cat=' . $spEvents->eventCategory() . '&eventDate=' . $spEvents->previousMonth( $spEvents->date );
1702
+ } else {
1703
+ return get_bloginfo( 'url' ) . '/' . $spEvents->getCategoryBase() . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/' . $spEvents->previousMonth( $spEvents->date );
1704
+ }
1705
+ }
1706
+ /**
1707
+ * Returns a link to the events category
1708
+ *
1709
+ * @return string
1710
+ */
1711
+ function events_get_events_link() {
1712
+ global $spEvents;
1713
+ if( '' == get_option('permalink_structure') ) {
1714
+ return trailingslashit( get_bloginfo('url') ) . '?cat=' . $spEvents->eventCategory();
1715
+ } else {
1716
+ return get_bloginfo( 'url' ) . '/' . $spEvents->getCategoryBase() . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/';
1717
+ }
1718
+ }
1719
+
1720
+ function events_get_gridview_link( ) {
1721
+ global $spEvents;
1722
+ if( '' == get_option('permalink_structure') ) {
1723
+ return trailingslashit( get_bloginfo('url') ) . '?cat=' . $spEvents->eventCategory() . '&eventDisplay=month';
1724
+ } else {
1725
+ return trailingslashit( get_bloginfo('url') ) . $spEvents->getCategoryBase() . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/month';
1726
+ }
1727
+ }
1728
+
1729
+ function events_get_listview_link( ) {
1730
+ global $spEvents;
1731
+ if( '' == get_option('permalink_structure') ) {
1732
+ return trailingslashit( get_bloginfo('url') ) . '?cat=' . $spEvents->eventCategory() . '&eventDisplay=upcoming';
1733
+ } else {
1734
+ return trailingslashit( get_bloginfo('url') ) . $spEvents->getCategoryBase() . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/upcoming';
1735
+ }
1736
+ }
1737
+ function events_get_listview_past_link( ) {
1738
+ global $spEvents;
1739
+ if( '' == get_option('permalink_structure') ) {
1740
+ return trailingslashit( get_bloginfo('url') ) . '?cat=' . $spEvents->eventCategory() . '&eventDisplay=past';
1741
+ } else {
1742
+ return trailingslashit( get_bloginfo('url') ) . $spEvents->getCategoryBase() . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/past';
1743
+ }
1744
+ }
1745
+
1746
+ /**
1747
+ * Returns a textual description of the previous month
1748
+ *
1749
+ * @return string
1750
+ */
1751
+ function events_get_previous_month_text() {
1752
+ global $spEvents;
1753
+ return $spEvents->getDateString( $spEvents->previousMonth( $spEvents->date ) );
1754
+ }
1755
+ /**
1756
+ * Returns a texual description of the current month
1757
+ *
1758
+ * @return string
1759
+ */
1760
+ function events_get_current_month_text( ){
1761
+ global $spEvents;
1762
+ return date( 'F', strtotime( $spEvents->date ) );
1763
+ }
1764
+ /**
1765
+ * Returns a textual description of the next month
1766
+ *
1767
+ * @return string
1768
+ */
1769
+ function events_get_next_month_text() {
1770
+ global $spEvents;
1771
+ return $spEvents->getDateString( $spEvents->nextMonth( $spEvents->date ) );
1772
+ }
1773
+ /**
1774
+ * Returns a formatted date string of the currently displayed month (in "jump to month" mode)
1775
+ *
1776
+ * @return string
1777
+ */
1778
+ function events_get_displayed_month() {
1779
+ global $spEvents;
1780
+ if ( $spEvents->displaying == "month" ) {
1781
+ return $spEvents->getDateString( $spEvents->date );
1782
+ }
1783
+ return " ";
1784
+ }
1785
+ /**
1786
+ * Returns a link to the currently displayed month (if in "jump to month" mode)
1787
+ *
1788
+ * @return string
1789
+ */
1790
+ function events_get_this_month_link() {
1791
+ global $spEvents;
1792
+ if ( $spEvents->displaying == "month" ) {
1793
+ return get_bloginfo( 'url' ) . '/' . strtolower( The_Events_Calendar::CATEGORYNAME ) . '/' . $spEvents->date;
1794
+ }
1795
+ return false;
1796
+ }
1797
+ /**
1798
+ * Returns the state or province for US or non-US addresses
1799
+ *
1800
+ * @return string
1801
+ */
1802
+ function the_event_region() {
1803
+ if (get_post_meta($postId, '_EventCountry', true ) == 'United States') {
1804
+ return the_event_state();
1805
+ } else {
1806
+ return the_event_province();
1807
+ }
1808
+ }
1809
+ /**
1810
+ * Returns true if the event is an all day event
1811
+ *
1812
+ * @return bool
1813
+ */
1814
+ function the_event_all_day( $postId = null ) {
1815
+ if ( $postId === null || !is_numeric( $postId ) ) {
1816
+ global $post;
1817
+ $postId = $post->ID;
1818
+ }
1819
+ return get_post_meta( $postId, '_EventAllDay', true );
1820
+ }
1821
+ /**
1822
+ * xml2array() will convert the given XML text to an array in the XML structure.
1823
+ * Link: http://www.bin-co.com/php/scripts/xml2array/
1824
+ * Arguments : $contents - The XML text
1825
+ * $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the tag values - this results in a different array structure in the return value.
1826
+ * $priority - Can be 'tag' or 'attribute'. This will change the way the resulting array sturcture. For 'tag', the tags are given more importance.
1827
+ * Return: The parsed XML in an array form. Use print_r() to see the resulting array structure.
1828
+ * Examples: $array = xml2array(file_get_contents('feed.xml'));
1829
+ * $array = xml2array(file_get_contents('feed.xml', 1, 'attribute'));
1830
+ */
1831
+ function xml2array($contents, $get_attributes=1, $priority = 'tag') {
1832
+ if(!$contents) return array();
1833
+
1834
+ if(!function_exists('xml_parser_create')) {
1835
+ //print "'xml_parser_create()' function not found!";
1836
+ return array();
1837
+ }
1838
+
1839
+ //Get the XML parser of PHP - PHP must have this module for the parser to work
1840
+ $parser = xml_parser_create('');
1841
+ xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); # http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss
1842
+ xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
1843
+ xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
1844
+ xml_parse_into_struct($parser, trim($contents), $xml_values);
1845
+ xml_parser_free($parser);
1846
+
1847
+ if(!$xml_values) return;//Hmm...
1848
+
1849
+ //Initializations
1850
+ $xml_array = array();
1851
+ $parents = array();
1852
+ $opened_tags = array();
1853
+ $arr = array();
1854
+
1855
+ $current = &$xml_array; //Refference
1856
+
1857
+ //Go through the tags.
1858
+ $repeated_tag_index = array();//Multiple tags with same name will be turned into an array
1859
+ foreach($xml_values as $data) {
1860
+ unset($attributes,$value);//Remove existing values, or there will be trouble
1861
+
1862
+ //This command will extract these variables into the foreach scope
1863
+ // tag(string), type(string), level(int), attributes(array).
1864
+ extract($data);//We could use the array by itself, but this cooler.
1865
+
1866
+ $result = array();
1867
+ $attributes_data = array();
1868
+
1869
+ if(isset($value)) {
1870
+ if($priority == 'tag') $result = $value;
1871
+ else $result['value'] = $value; //Put the value in a assoc array if we are in the 'Attribute' mode
1872
+ }
1873
+
1874
+ //Set the attributes too.
1875
+ if(isset($attributes) and $get_attributes) {
1876
+ foreach($attributes as $attr => $val) {
1877
+ if($priority == 'tag') $attributes_data[$attr] = $val;
1878
+ else $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'
1879
+ }
1880
+ }
1881
+
1882
+ //See tag status and do the needed.
1883
+ if($type == "open") {//The starting of the tag '<tag>'
1884
+ $parent[$level-1] = &$current;
1885
+ if(!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag
1886
+ $current[$tag] = $result;
1887
+ if($attributes_data) $current[$tag. '_attr'] = $attributes_data;
1888
+ $repeated_tag_index[$tag.'_'.$level] = 1;
1889
+
1890
+ $current = &$current[$tag];
1891
+
1892
+ } else { //There was another element with the same tag name
1893
+
1894
+ if(isset($current[$tag][0])) {//If there is a 0th element it is already an array
1895
+ $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;
1896
+ $repeated_tag_index[$tag.'_'.$level]++;
1897
+ } else {//This section will make the value an array if multiple tags with the same name appear together
1898
+ $current[$tag] = array($current[$tag],$result);//This will combine the existing item and the new item together to make an array
1899
+ $repeated_tag_index[$tag.'_'.$level] = 2;
1900
+
1901
+ if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well
1902
+ $current[$tag]['0_attr'] = $current[$tag.'_attr'];
1903
+ unset($current[$tag.'_attr']);
1904
+ }
1905
+
1906
+ }
1907
+ $last_item_index = $repeated_tag_index[$tag.'_'.$level]-1;
1908
+ $current = &$current[$tag][$last_item_index];
1909
+ }
1910
+
1911
+ } elseif($type == "complete") { //Tags that ends in 1 line '<tag />'
1912
+ //See if the key is already taken.
1913
+ if(!isset($current[$tag])) { //New Key
1914
+ $current[$tag] = $result;
1915
+ $repeated_tag_index[$tag.'_'.$level] = 1;
1916
+ if($priority == 'tag' and $attributes_data) $current[$tag. '_attr'] = $attributes_data;
1917
+
1918
+ } else { //If taken, put all things inside a list(array)
1919
+ if(isset($current[$tag][0]) and is_array($current[$tag])) {//If it is already an array...
1920
+
1921
+ // ...push the new element into that array.
1922
+ $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;
1923
+
1924
+ if($priority == 'tag' and $get_attributes and $attributes_data) {
1925
+ $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;
1926
+ }
1927
+ $repeated_tag_index[$tag.'_'.$level]++;
1928
+
1929
+ } else { //If it is not an array...
1930
+ $current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value
1931
+ $repeated_tag_index[$tag.'_'.$level] = 1;
1932
+ if($priority == 'tag' and $get_attributes) {
1933
+ if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well
1934
+
1935
+ $current[$tag]['0_attr'] = $current[$tag.'_attr'];
1936
+ unset($current[$tag.'_attr']);
1937
+ }
1938
+
1939
+ if($attributes_data) {
1940
+ $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;
1941
+ }
1942
+ }
1943
+ $repeated_tag_index[$tag.'_'.$level]++; //0 and 1 index is already taken
1944
+ }
1945
+ }
1946
+
1947
+ } elseif($type == 'close') { //End of tag '</tag>'
1948
+ $current = &$parent[$level-1];
1949
+ }
1950
+ }
1951
+
1952
+ return($xml_array);
1953
+ }
1954
+ }
1955
+
1956
+ if( !class_exists( 'Events_List_Widget' ) ) {
1957
+ /**
1958
+ * Event List Widget
1959
+ *
1960
+ * Creates a widget that displays the next upcoming x events
1961
+ */
1962
+
1963
+ class Events_List_Widget extends WP_Widget {
1964
+
1965
+ public $pluginDomain = 'sp-Events';
1966
+
1967
+ function Events_List_Widget() {
1968
+ /* Widget settings. */
1969
+ $widget_ops = array( 'classname' => 'eventsListWidget', 'description' => __( 'A widget that displays the next upcoming x events.') );
1970
+
1971
+ /* Widget control settings. */
1972
+ $control_ops = array( 'id_base' => 'events-list-widget' );
1973
+
1974
+ /* Create the widget. */
1975
+ $this->WP_Widget( 'events-list-widget', 'Events List Widget', $widget_ops, $control_ops );
1976
+ }
1977
+
1978
+ function widget( $args, $instance ) {
1979
+ global $wp_query;
1980
+ extract( $args );
1981
+
1982
+ /* User-selected settings. */
1983
+ $title = apply_filters('widget_title', $instance['title'] );
1984
+ $limit = $instance['limit'];
1985
+ $start = $instance['start'];
1986
+ $end = $instance['end'];
1987
+ $venue = $instance['venue'];
1988
+ $address = $instance['address'];
1989
+ $city = $instance['city'];
1990
+ $state = $instance['state'];
1991
+ $province = $instance['province'];
1992
+ $zip = $instance['zip'];
1993
+ $country = $instance['country'];
1994
+ $phone = $instance['phone'];
1995
+ $cost = $instance['cost'];
1996
+
1997
+ if ( eventsGetOptionValue('viewOption') == 'upcoming') {
1998
+ $event_url = events_get_listview_link();
1999
+ } else {
2000
+ $event_url = events_get_gridview_link();
2001
+ }
2002
+
2003
+ /* Before widget (defined by themes). */
2004
+ echo $before_widget;
2005
+
2006
+ /* Title of widget (before and after defined by themes). */
2007
+ if ( $title )
2008
+ echo $before_title . $title . $after_title;
2009
+
2010
+ /* Display link to all events */
2011
+ echo '<div class="dig-in"><a href="' . $event_url . '">View All Events</a></div>';
2012
+
2013
+ /* Display list of events. */
2014
+ if( function_exists( 'get_events' ) ) {
2015
+ $old_display = $wp_query->get('eventDisplay');
2016
+ $wp_query->set('eventDisplay', 'upcoming');
2017
+ $posts = get_events($limit);
2018
+ //print_r($posts);
2019
+ if ($posts) :
2020
+
2021
+ echo "<ul class='upcoming'>";
2022
+ foreach( $posts as $post ) :
2023
+ setup_postdata($post);
2024
+ include( dirname( __FILE__ ) . '/views/events-list-load-widget-display.php' );
2025
+ endforeach;
2026
+ echo "</ul>";
2027
+
2028
+ else:
2029
+ echo "no events";
2030
+ endif;
2031
+ $wp_query->set('eventDisplay', $old_display);
2032
+ }
2033
+
2034
+
2035
+ /* After widget (defined by themes). */
2036
+ echo $after_widget;
2037
+ }
2038
+
2039
+ function update( $new_instance, $old_instance ) {
2040
+ $instance = $old_instance;
2041
+
2042
+ /* Strip tags (if needed) and update the widget settings. */
2043
+ $instance['title'] = strip_tags( $new_instance['title'] );
2044
+ $instance['limit'] = strip_tags( $new_instance['limit'] );
2045
+ $instance['start'] = strip_tags( $new_instance['start'] );
2046
+ $instance['end'] = strip_tags( $new_instance['end'] );
2047
+ $instance['venue'] = strip_tags( $new_instance['venue'] );
2048
+ $instance['country'] = strip_tags( $new_instance['country'] );
2049
+ $instance['address'] = strip_tags( $new_instance['address'] );
2050
+ $instance['city'] = strip_tags( $new_instance['city'] );
2051
+ $instance['state'] = strip_tags( $new_instance['state'] );
2052
+ $instance['province'] = strip_tags( $new_instance['province'] );
2053
+ $instance['zip'] = strip_tags( $new_instance['zip'] );
2054
+ $instance['phone'] = strip_tags( $new_instance['phone'] );
2055
+ $instance['cost'] = strip_tags( $new_instance['cost'] );
2056
+
2057
+ return $instance;
2058
+ }
2059
+
2060
+ function form( $instance ) {
2061
+
2062
+ /* Set up default widget settings. */
2063
+ $defaults = array( 'title' => 'Upcoming Event', 'limit' => '5', 'start' => true, 'end' => false, 'venue' => false, 'country' => true, 'address' => false, 'city' => true, 'state' => true, 'province' => true, 'zip' => false, 'phone' => false, 'cost' => false);
2064
+ $instance = wp_parse_args( (array) $instance, $defaults );
2065
+ include( dirname( __FILE__ ) . '/views/events-list-load-widget-admin.php' );
2066
+ }
2067
+ }
2068
+
2069
+ /* Add function to the widgets_ hook. */
2070
+ add_action( 'widgets_init', 'events_list_load_widgets' );
2071
+
2072
+ /* Function that registers widget. */
2073
+ function events_list_load_widgets() {
2074
+ register_widget( 'Events_List_Widget' );
2075
+ }
2076
+ }
2077
+
2078
+ if( !class_exists( 'Events_Calendar_Widget') ) {
2079
+
2080
+ /**
2081
+ * Calendar widget class
2082
+ *
2083
+ *
2084
+ */
2085
+ class Events_Calendar_Widget extends WP_Widget {
2086
+
2087
+ function Events_Calendar_Widget() {
2088
+ $widget_ops = array('classname' => 'events_calendar_widget', 'description' => __( 'A calendar of your events') );
2089
+ $this->WP_Widget('calendar', __('Events Calendar'), $widget_ops);
2090
+ }
2091
+
2092
+ function widget( $args, $instance ) {
2093
+ extract($args);
2094
+ $title = apply_filters('widget_title', empty($instance['title']) ? '&nbsp;' : $instance['title']);
2095
+ echo $before_widget;
2096
+ if ( $title )
2097
+ echo $before_title . $title . $after_title;
2098
+ echo '<div id="calendar_wrap">';
2099
+ //echo get_calendar_custom(); /* 5 is the category id I have for event */
2100
+ echo '</div>';
2101
+ echo $after_widget;
2102
+ }
2103
+
2104
+ function update( $new_instance, $old_instance ) {
2105
+ $instance = $old_instance;
2106
+ $instance['title'] = strip_tags($new_instance['title']);
2107
+
2108
+ return $instance;
2109
+ }
2110
+
2111
+ function form( $instance ) {
2112
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
2113
+ $title = strip_tags($instance['title']);
2114
+ ?>
2115
+ <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
2116
+ <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
2117
+ <?php
2118
+ }
2119
+
2120
+ }
2121
+
2122
+ /* Add function to the widgets_ hook. */
2123
+ add_action( 'widgets_init', 'events_calendar_load_widgets' );
2124
+ //add_action( 'widgets_init', 'get_calendar_custom' );
2125
+
2126
+ //function get_calendar_custom(){echo "hi";}
2127
+
2128
+ /* Function that registers widget. */
2129
+ function events_calendar_load_widgets() {
2130
+ register_widget( 'Events_Calendar_Widget' );
2131
+ }
2132
+ }
2133
+ ?>
views/datepicker.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript" charset="utf-8">
2
+ jQuery(document).ready(function(){
3
+ jQuery('.<?php echo $prefix; ?>events-dropdown').change(function( ){
4
+ monthSelect = jQuery('#<?php echo $prefix; ?>events-month');
5
+ yearSelect = jQuery('#<?php echo $prefix; ?>events-year');
6
+ jumpMonth = monthSelect.attr("options")[monthSelect.attr("selectedIndex")].value;
7
+ jumpYear = yearSelect.attr("options")[yearSelect.attr("selectedIndex")].value;
8
+ location.href = '<?php echo trailingslashit( events_get_events_link() ); ?>' + jumpYear + '-' + jumpMonth + '/';
9
+ });
10
+ });
11
+ </script>
12
+ <select id='<?php echo $prefix; ?>events-month' name='EventJumpToMonth' class='<?php echo $prefix; ?>events-dropdown'>
13
+ <?php echo $monthOptions; ?>
14
+ </select>
15
+ <select id='<?php echo $prefix; ?>events-year' name='EventJumpToYear' class='events-dropdown'>
16
+ <?php echo $yearOptions; ?>
17
+ </select>
views/events-list-load-widget-admin.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p>
2
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:',$this->pluginDomain);?></label>
3
+ <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:100%;" />
4
+ </p>
5
+
6
+ <p>
7
+ <label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e('Show:',$this->pluginDomain);?></label>
8
+ <select id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" class="widefat" style="width:100%;">
9
+ <?php for ($i=1; $i<=10; $i++)
10
+ {?>
11
+ <option <?php if ( $i == $instance['limit'] ) {echo 'selected="selected"';}?> > <?php echo $i;?> </option>
12
+ <?php } ?>
13
+ </select>
14
+ </p>
15
+
16
+ <p>Display:</p>
17
+
18
+ <?php $displayoptions = array (
19
+ "start" => __("Start Date & Time", $this->pluginDomain),
20
+ "end" => __("End Date & Time", $this->pluginDomain),
21
+ "venue" => __("Venue", $this->pluginDomain),
22
+ "address" => __("Address", $this->pluginDomain),
23
+ "city" => __("City", $this->pluginDomain),
24
+ "state" => __("State (US)", $this->pluginDomain),
25
+ "province" => __("Province (Int)", $this->pluginDomain),
26
+ "zip" => __("Postal Code", $this->pluginDomain),
27
+ "country" => __("Country", $this->pluginDomain),
28
+ "phone" => __("Phone", $this->pluginDomain),
29
+ "cost" => __("Price", $this->pluginDomain),
30
+ );
31
+
32
+ foreach ($displayoptions as $option => $label) {
33
+ ?><p>
34
+ <input class="checkbox" type="checkbox" <?php checked( $instance[$option], 'on' ); ?> id="<?php echo $this->get_field_id( $option ); ?>" name="<?php echo $this->get_field_name( $option ); ?>" />
35
+ <label for="<?php echo $this->get_field_id( $option ); ?>"><?php echo $label ?></label>
36
+ </p>
37
+ <?php } ?>
views/events-list-load-widget-display.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /**
2
+ * This is the template for the output of the events list widget.
3
+ * All the items are turned on and off through the widget admin.
4
+ * There is currently no default styling, which is highly needed.
5
+ * @return string
6
+ */
7
+ // let's make time
8
+ $start_time = strtotime(get_post_meta( $post->ID, '_EventStartDate', true ));
9
+ $EventCity = get_post_meta( $post->ID, '_EventCity', true );
10
+ $EventCountry = get_post_meta( $post->ID, '_EventCountry', true );
11
+ $EventState = get_post_meta( $post->ID, '_EventState', true );
12
+ $EventProvince = get_post_meta( $post->ID, '_EventProvince', true );
13
+
14
+
15
+ ?>
16
+
17
+ <li class="<?php echo $alt_text ?>">
18
+ <div class="when">
19
+ <span class="month"><?php echo date('M', $start_time); ?></span>
20
+ <span class="date"><?php echo date('j', $start_time); ?></span>
21
+ </div>
22
+ <div class="event"><?php echo $post->post_title ?></div>
23
+ <div class="loc"><?php
24
+ $space = false;
25
+ $output = '';
26
+ if ($city == true && $EventCity != '') {
27
+ $space = true;
28
+ $output = $EventCity . ', ';
29
+ }
30
+ if ($state == true || $province == true){
31
+ if ( $EventCountry == "United States" && $EventState != '') {
32
+ $space = true;
33
+ $output .= $EventState;
34
+ } elseif ( $EventProvince != '' ) {
35
+ $space = true;
36
+ $output .= $EventProvince;
37
+ }
38
+ } else {
39
+ $output = rtrim( $output, ', ' );
40
+ }
41
+ if ( $space ) {
42
+ $output .= '<br />';
43
+ }
44
+ if ($country == true && $EventCountry != '') {
45
+ $output .= $EventCountry;
46
+ }
47
+ echo $output;
48
+ ?>
49
+ </div>
50
+ <a class="more-link" href="<?php echo get_permalink($post->ID) ?>">More Info</a>
51
+ </li>
52
+ <?php $alt_text = ( empty( $alt_text ) ) ? 'alt' : ''; ?>
views/events-meta-box.php ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript" charset="utf-8">
2
+ jQuery(document).ready(function(){
3
+ // Register event handler for the event toggle
4
+ jQuery("input[name='isEvent']").click(function(){
5
+ if ( jQuery(this).val() == 'yes' ) {
6
+ jQuery("#eventDetails").slideDown(200);
7
+ } else {
8
+ jQuery("#eventDetails").slideUp(200);
9
+ }
10
+ });
11
+ // toggle time input
12
+ jQuery('#allDayCheckbox').click(function(){
13
+ jQuery(".timeofdayoptions").toggle();
14
+ jQuery("#EventTimeFormatDiv").toggle();
15
+ });
16
+ if( jQuery('#allDayCheckbox').attr('checked') == true ) {
17
+ jQuery(".timeofdayoptions").addClass("hide")
18
+ jQuery("#EventTimeFormatDiv").addClass("hide");
19
+ }
20
+ // Set the initial state of the event detail and EB ticketing div
21
+ jQuery("input[name='isEvent']").each(function(){
22
+ if( jQuery(this).val() == 'no' && jQuery(this).attr('checked') == true ) {
23
+ jQuery('#eventDetails, #eventBriteTicketing').hide();
24
+ } else if( jQuery(this).val() == 'yes' && jQuery(this).attr('checked') == true ) {
25
+ jQuery('#eventDetails, #eventBriteTicketing').show();
26
+ }
27
+ });
28
+
29
+ //show state/province input based on first option in countries list, or based on user input of country
30
+ function spShowHideCorrectStateProvinceInput(country) {
31
+ if (country == 'United States') {
32
+ jQuery("#USA").removeClass("hide");
33
+ jQuery("#International").addClass("hide");
34
+ }
35
+ else {
36
+ jQuery("#International").removeClass("hide");
37
+ jQuery("#USA").addClass("hide");
38
+ }
39
+ }
40
+
41
+ spShowHideCorrectStateProvinceInput(jQuery("#EventCountry > option:first").val());
42
+
43
+ jQuery("#EventCountry").change(function(){
44
+ spShowHideCorrectStateProvinceInput(jQuery(this).attr("value"));
45
+ });
46
+
47
+ });
48
+ </script>
49
+ <style type="text/css">
50
+ .eventForm td {
51
+ padding:6px 6px 0 0;
52
+ font-size:11px;
53
+ vertical-align:middle;
54
+ }
55
+ .eventForm select, .eventForm input {
56
+ font-size:11px;
57
+ }
58
+ .eventForm .hide {
59
+ display:none;
60
+ }
61
+ .eventForm h4 {
62
+ font-size:1.1em;
63
+ margin:2em 0 1em;
64
+ }
65
+ .notice {
66
+ background-color: rgb(255, 255, 224);
67
+ border: 1px solid rgb(230, 219, 85);
68
+ margin: 5px 0 15px;
69
+ }
70
+ .form-table form input {border:none;}
71
+ <?php if( eventsGetOptionValue('donateHidden', false) ) : ?>
72
+ #mainDonateRow {display: none;}
73
+ <?php endif; ?>
74
+ #mainDonateRow label {line-height: 30px;}
75
+ #submitLabel {display: block;}
76
+ #submitLabel input {
77
+ display: block;
78
+ padding: 0;
79
+ }
80
+ </style>
81
+
82
+ <h2><?php _e('Event Details:',$this->pluginDomain); ?></h2>
83
+ <?php do_action('sp_events_errors', $postId ); ?>
84
+ <div>
85
+ <?php _e('Is this post an event?',$this->pluginDomain); ?>&nbsp;
86
+ <input tabindex="2001" type='radio' name='isEvent' value='yes' <?php echo $isEventChecked; ?> />&nbsp;<b>Yes</b>
87
+ <input tabindex="2002" type='radio' name='isEvent' value='no' <?php echo $isNotEventChecked; ?> />&nbsp;<b>No</b>
88
+ </div>
89
+ <br />
90
+ <div id='eventDetails' class="eventForm">
91
+ <?php do_action('sp_events_detail_top', $postId ); ?>
92
+ <table cellspacing="0" cellpadding="0" id="EventInfo">
93
+ <tr>
94
+ <td><?php _e('All day event?'); ?></td>
95
+ <td><input tabindex="2007" type='checkbox' id='allDayCheckbox' name='EventAllDay' value='yes' <?php echo $isEventAllDay; ?> /></td>
96
+ </tr>
97
+ <tr id='EventTimeFormatDiv'>
98
+ <td><?php _e('Time Format (site wide option):',$this->pluginDomain); ?></td>
99
+ <td>
100
+ <input tabindex="2008" type='radio' name='EventTimeFormat' value='<?php echo The_Events_Calendar::DATETIMEFORMAT12; ?>' <?php echo $is12HourChecked; ?> />&nbsp;
101
+ <?php _e('12 Hour'); ?>
102
+ <input tabindex="2009" type='radio' name='EventTimeFormat' value='<?php echo The_Events_Calendar::DATETIMEFORMAT24; ?>' <?php echo $is24HourChecked; ?> />&nbsp;
103
+ <?php _e('24 Hour'); ?>
104
+ </td>
105
+ </tr>
106
+ <tr>
107
+ <td style="width:100px;"><?php _e('Start Date / Time:',$this->pluginDomain); ?></td>
108
+ <td>
109
+ <select tabindex="2010" name='EventStartMonth'>
110
+ <?php echo $startMonthOptions; ?>
111
+ </select>
112
+ <select tabindex="2011" name='EventStartDay'>
113
+ <?php echo $startDayOptions; ?>
114
+ </select>
115
+ <select tabindex="2012" name='EventStartYear'>
116
+ <?php echo $startYearOptions; ?>
117
+ </select>
118
+ <span class='timeofdayoptions'>
119
+ <?php _e('@',$this->pluginDomain); ?>
120
+ <select tabindex="2013" name='EventStartHour'>
121
+ <?php echo $startHourOptions; ?>
122
+ </select>
123
+ <select tabindex="2014" name='EventStartMinute'>
124
+ <?php echo $startMinuteOptions; ?>
125
+ </select>
126
+ <select tabindex="2015" name='EventStartMeridian'>
127
+ <?php echo $startMeridianOptions; ?>
128
+ </select>
129
+ </span>
130
+ </td>
131
+ </tr>
132
+ <tr>
133
+ <td><?php _e('End Date / Time:',$this->pluginDomain); ?></td>
134
+ <td>
135
+ <select tabindex="2016" name='EventEndMonth'>
136
+ <?php echo $endMonthOptions; ?>
137
+ </select>
138
+ <select tabindex="2017" name='EventEndDay'>
139
+ <?php echo $endDayOptions; ?>
140
+ </select>
141
+ <select tabindex="2018" name='EventEndYear'>
142
+ <?php echo $endYearOptions; ?>
143
+ </select>
144
+ <span class='timeofdayoptions'>
145
+ <?php _e('@',$this->pluginDomain); ?>
146
+ <select class="spEventsInput"tabindex="2019" name='EventEndHour'>
147
+ <?php echo $endHourOptions; ?>
148
+ </select>
149
+ <select tabindex="2020" name='EventEndMinute'>
150
+ <?php echo $endMinuteOptions; ?>
151
+ </select>
152
+ <select tabindex="2021" name='EventEndMeridian'>
153
+ <?php echo $endMeridianOptions; ?>
154
+ </select>
155
+ </span>
156
+ </td>
157
+ </tr>
158
+ <tr>
159
+ <td><?php _e('Venue:',$this->pluginDomain); ?></td>
160
+ <td>
161
+ <input tabindex="2022" type='text' name='EventVenue' size='25' value='<?php echo $_EventVenue; ?>' />
162
+ </td>
163
+ </tr>
164
+ <tr>
165
+ <td><?php _e('Country:',$this->pluginDomain); ?></td>
166
+ <td>
167
+ <select tabindex="2023" name="EventCountry" id="EventCountry">
168
+ <?php
169
+ $this->constructCountries();
170
+ foreach ($this->countries as $abbr => $fullname) {
171
+ print ("<option value=\"$fullname\" ");
172
+ if ($_EventCountry == $fullname) {
173
+ print ('selected="selected" ');
174
+ }
175
+ print (">$fullname</option>\n");
176
+ }
177
+ ?>
178
+ </select>
179
+ </td>
180
+ </tr>
181
+ <tr>
182
+ <td><?php _e('Address:',$this->pluginDomain); ?></td>
183
+ <td><input tabindex="2024" type='text' name='EventAddress' size='25' value='<?php echo $_EventAddress; ?>' /></td>
184
+ </tr>
185
+ <tr>
186
+ <td><?php _e('City:',$this->pluginDomain); ?></td>
187
+ <td><input tabindex="2025" type='text' name='EventCity' size='25' value='<?php echo $_EventCity; ?>' /></td>
188
+ </tr>
189
+ <tr id="International" <?php if($_EventCountry == 'United States' || $_EventCountry == '' ){echo('class="hide"'); } ?>>
190
+ <td><?php _e('Province:',$this->pluginDomain); ?></td>
191
+ <td><input tabindex="2026" type='text' name='EventProvince' size='10' value='<?php echo $_EventProvince; ?>' /></td>
192
+ </tr>
193
+ <tr id="USA" <?php if($_EventCountry !== 'United States'){echo('class="hide"');} ?>>
194
+ <td><?php _e('State:',$this->pluginDomain); ?></td>
195
+ <td>
196
+ <select tabindex="2027" name="EventState">
197
+ <option value=""><?php _e('Select a State:',$this->pluginDomain); ?></option>
198
+ <?php $states = array (
199
+ "AL" => __("Alabama", $this->pluginDomain),
200
+ "AK" => __("Alaska", $this->pluginDomain),
201
+ "AZ" => __("Arizona", $this->pluginDomain),
202
+ "AR" => __("Arkansas", $this->pluginDomain),
203
+ "CA" => __("California", $this->pluginDomain),
204
+ "CO" => __("Colorado", $this->pluginDomain),
205
+ "CT" => __("Connecticut", $this->pluginDomain),
206
+ "DE" => __("Delaware", $this->pluginDomain),
207
+ "DC" => __("District of Columbia", $this->pluginDomain),
208
+ "FL" => __("Florida", $this->pluginDomain),
209
+ "GA" => __("Georgia", $this->pluginDomain),
210
+ "HI" => __("Hawaii", $this->pluginDomain),
211
+ "ID" => __("Idaho", $this->pluginDomain),
212
+ "IL" => __("Illinois", $this->pluginDomain),
213
+ "IN" => __("Indiana", $this->pluginDomain),
214
+ "IA" => __("Iowa", $this->pluginDomain),
215
+ "KS" => __("Kansas", $this->pluginDomain),
216
+ "KY" => __("Kentucky", $this->pluginDomain),
217
+ "LA" => __("Louisiana", $this->pluginDomain),
218
+ "ME" => __("Maine", $this->pluginDomain),
219
+ "MD" => __("Maryland", $this->pluginDomain),
220
+ "MA" => __("Massachusetts", $this->pluginDomain),
221
+ "MI" => __("Michigan", $this->pluginDomain),
222
+ "MN" => __("Minnesota", $this->pluginDomain),
223
+ "MS" => __("Mississippi", $this->pluginDomain),
224
+ "MO" => __("Missouri", $this->pluginDomain),
225
+ "MT" => __("Montana", $this->pluginDomain),
226
+ "NE" => __("Nebraska", $this->pluginDomain),
227
+ "NV" => __("Nevada", $this->pluginDomain),
228
+ "NH" => __("New Hampshire", $this->pluginDomain),
229
+ "NJ" => __("New Jersey", $this->pluginDomain),
230
+ "NM" => __("New Mexico", $this->pluginDomain),
231
+ "NY" => __("New York", $this->pluginDomain),
232
+ "NC" => __("North Carolina", $this->pluginDomain),
233
+ "ND" => __("North Dakota", $this->pluginDomain),
234
+ "OH" => __("Ohio", $this->pluginDomain),
235
+ "OK" => __("Oklahoma", $this->pluginDomain),
236
+ "OR" => __("Oregon", $this->pluginDomain),
237
+ "PA" => __("Pennsylvania", $this->pluginDomain),
238
+ "RI" => __("Rhode Island", $this->pluginDomain),
239
+ "SC" => __("South Carolina", $this->pluginDomain),
240
+ "SD" => __("South Dakota", $this->pluginDomain),
241
+ "TN" => __("Tennessee", $this->pluginDomain),
242
+ "TX" => __("Texas", $this->pluginDomain),
243
+ "UT" => __("Utah", $this->pluginDomain),
244
+ "VT" => __("Vermont", $this->pluginDomain),
245
+ "VA" => __("Virginia", $this->pluginDomain),
246
+ "WA" => __("Washington", $this->pluginDomain),
247
+ "WV" => __("West Virginia", $this->pluginDomain),
248
+ "WI" => __("Wisconsin", $this->pluginDomain),
249
+ "WY" => __("Wyoming", $this->pluginDomain),
250
+ );
251
+ foreach ($states as $abbr => $fullname) {
252
+ print ("<option value=\"$abbr\" ");
253
+ if ($_EventState == $abbr) {
254
+ print ('selected="selected" ');
255
+ }
256
+ print (">$fullname</option>\n");
257
+ }
258
+ ?>
259
+ </select>
260
+ </td>
261
+ </tr>
262
+ <tr>
263
+ <td><?php _e('Postal Code:',$this->pluginDomain); ?></td>
264
+ <td><input tabindex="2028" type='text' name='EventZip' size='6' value='<?php echo $_EventZip; ?>' /></td>
265
+ </tr>
266
+ <tr>
267
+ <td><?php _e('Cost:',$this->pluginDomain); ?></td>
268
+ <td><input tabindex="2029" type='text' name='EventCost' size='6' value='<?php echo $_EventCost; ?>' /></td>
269
+ </tr>
270
+ <tr>
271
+ <td><?php _e('Phone:',$this->pluginDomain); ?></td>
272
+ <td><input tabindex="2030" type='text' name='EventPhone' size='14' value='<?php echo $_EventPhone; ?>' /></td>
273
+ </tr>
274
+ <tr>
275
+ <td><?php _e('Sub-category:',$this->pluginDomain); ?></td>
276
+ <td><?php _e('<em>To assign this event to a custom sub-category, use the Wordpress categories chooser in the sidebar.</em>',$this->pluginDomain); ?></td>
277
+ </tr>
278
+ <tr id="mainDonateRow">
279
+ <td><?php _e('Donate:',$this->pluginDomain); ?></td>
280
+ <td>
281
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
282
+ <input type="hidden" name="cmd" value="_s-xclick">
283
+ <input type="hidden" name="hosted_button_id" value="10750983">
284
+ <input type="hidden" name="item_name" value="Events Post Editor">
285
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
286
+ <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
287
+ <label id="submitLabel" for="submit">
288
+ <?php _e('If you find this plugin useful, please consider donating to the producer of it, Shane &#38; Peter, Inc. Thank you!',$this->pluginDomain); ?>
289
+ </label>
290
+ </form>
291
+ </td>
292
+ </tr>
293
+
294
+ </table>
295
+ </div>
296
+ <?php do_action( 'sp_events_details_bottom', $postId ); ?>
views/events-options.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript">
2
+ jQuery(document).ready(function() {
3
+
4
+ function theEventsCalendarHideDonateButton() {
5
+ jQuery('#mainDonateRow').hide();
6
+ jQuery('#secondDonateRow').show();
7
+ }
8
+
9
+ jQuery('#hideDonateButton').click(function() {
10
+ jQuery.post('/wp-admin/admin-ajax.php', { donateHidden: true, action: 'hideDonate' }, theEventsCalendarHideDonateButton, 'json' );
11
+ });
12
+
13
+ });
14
+ </script>
15
+ <style type="text/css">
16
+ .form-table form input {border:none;}
17
+ <?php if( eventsGetOptionValue('donateHidden', false) ) : ?>
18
+ #mainDonateRow {display: none;}
19
+ <?php else : ?>
20
+ #mainDonateRow {background-color: #FCECA9;}
21
+ #secondDonateRow {display: none;}
22
+ <?php endif; ?>
23
+ #mainDonateRow label {line-height: 30px;}
24
+ #submitLabel {display: block;}
25
+ #submitLabel input {
26
+ display: block;
27
+ padding: 0;
28
+ }
29
+ #hideDonateButton {}
30
+ #checkBoxLabel {}
31
+ .form-table form #secondSubmit {
32
+ background-color: #F9F9F9;
33
+ border-bottom: 1px solid;
34
+ border-left: none;
35
+ border-right: none;
36
+ border-top: none;
37
+ cursor: pointer;
38
+ margin: 0;
39
+ padding: 0;
40
+ }
41
+ </style>
42
+ <h2><?php _e('The Events Calendar Settings',$this->pluginDomain); ?></h2>
43
+
44
+ <table class="form-table">
45
+ <tr id="mainDonateRow">
46
+ <th scope="row"><?php _e('Donate',$this->pluginDomain); ?></th>
47
+ <td>
48
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
49
+ <input type="hidden" name="cmd" value="_s-xclick">
50
+ <input type="hidden" name="hosted_button_id" value="10750983">
51
+ <input type="hidden" name="item_name" value="Events Options Panel Main">
52
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
53
+ <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
54
+ <label id="submitLabel" for="submit">
55
+ <?php _e('If you find this plugin useful, please consider donating to the producer of it, Shane &#38; Peter, Inc. Thank you!',$this->pluginDomain); ?>
56
+ </label>
57
+
58
+ <input id="hideDonateButton" type="checkbox" name="hideDonateButton" value="" />
59
+ <label id="checkBoxLabel" for="hideDonateButton"><?php _e('I have already donated, so please hide this button!',$this->pluginDomain); ?></label>
60
+ </form>
61
+ </td>
62
+ </tr>
63
+ <tr id="secondDonateRow">
64
+ <td>
65
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
66
+ <input type="hidden" name="cmd" value="_s-xclick">
67
+ <input type="hidden" name="hosted_button_id" value="10751527">
68
+ <input type="hidden" name="item_name" value="Events Options Panel Secondary">
69
+ <input id="secondSubmit" type="submit" value="Donate for this wonderful plugin" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
70
+ <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
71
+ </form>
72
+ </td>
73
+ </tr>
74
+ </table>
75
+
76
+ <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
77
+
78
+ <?php
79
+ if ( function_exists('wp_nonce_field') ) {
80
+ wp_nonce_field('saveEventsCalendarOptions');
81
+ }
82
+ ?>
83
+
84
+ <table class="form-table">
85
+ <tr>
86
+ <th scope="row"><?php _e('Default View for the Events',$this->pluginDomain); ?></th>
87
+ <td>
88
+ <fieldset>
89
+ <legend class="screen-reader-text">
90
+ <span><?php _e('Default View for the Events',$this->pluginDomain); ?></span>
91
+ </legend>
92
+ <label title='Grid View'>
93
+ <?php
94
+ $viewOptionValue = eventsGetOptionValue('viewOption','month');
95
+ if( $viewOptionValue == 'upcoming' ) {
96
+ $listViewStatus = 'checked="checked"';
97
+ } else {
98
+ $gridViewStatus = 'checked="checked"';
99
+ }
100
+ ?>
101
+ <input type="radio" name="viewOption" value="month" <?php echo $gridViewStatus; ?> />
102
+ <?php _e('Grid View',$this->pluginDomain); ?>
103
+ </label><br />
104
+ <label title='List View'>
105
+ <input type="radio" name="viewOption" value="upcoming" <?php echo $listViewStatus; ?> />
106
+ <?php _e('List View',$this->pluginDomain); ?>
107
+ </label><br />
108
+ </fieldset>
109
+ </td>
110
+ </tr>
111
+ <tr>
112
+ <th scope="row"><?php _e('Default Country for Events',$this->pluginDomain); ?></th>
113
+ <td>
114
+ <select name="defaultCountry" id="defaultCountry">
115
+ <?php
116
+ $this->constructCountries();
117
+ $defaultCountry = eventsGetOptionValue('defaultCountry');
118
+ foreach ($this->countries as $abbr => $fullname) {
119
+ print ("<option value=\"$fullname\" ");
120
+ if ($defaultCountry[1] == $fullname) {
121
+ print ('selected="selected" ');
122
+ }
123
+ print (">$fullname</option>\n");
124
+ }
125
+ ?>
126
+ </select>
127
+ </td>
128
+ </tr>
129
+ <?php do_action( 'sp_events_options_bottom' ); ?>
130
+ <tr>
131
+ <td>
132
+ <input id="saveEventsCalendarOptions" class="button-primary" type="submit" name="saveEventsCalendarOptions" value="Save Changes" />
133
+ </td>
134
+ </tr>
135
+
136
+ </table>
137
+
138
+ </form>
views/gridview-day.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php global $post; $post = $event; ?>
2
+ <div id='event_<?php echo $eventId; ?>' class="event">
3
+ <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
4
+
5
+ <div id='tooltip_<?php echo $eventId; ?>' class="tooltip" style="display:none;">
6
+ <h5 class="event-title"><?php _e($event->post_title); ?></h5>
7
+ <div class="event-body">
8
+ <?php if ( !the_event_all_day($event->ID) ) : ?>
9
+ <div class="event-date">
10
+ <?php if ( !empty( $start ) ) echo $start; ?>
11
+ <?php if ( !empty( $end ) && $start !== $end ) echo " – " . $end . '<br />'; ?>
12
+ </div>
13
+ <?php endif; ?>
14
+ <?php echo The_Events_Calendar::truncate($event->post_content, 30); ?>
15
+
16
+ </div>
17
+ <span class="arrow"></span>
18
+ </div>
19
+
20
+ </div>
views/gridview.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $spEvents;
3
+ $spEvents->loadStylesAndScripts();
4
+ include (TEMPLATEPATH.'/header.php'); ?>
5
+ <div id="content" class="grid">
6
+ <div id='eventsCalendarHeader' class="clearfix">
7
+ <h2 class="cal-title"><?php _e('Calendar of Events', $spEvents->pluginDomain) ?></h2>
8
+
9
+ <?php get_jump_to_date_calendar(); ?>
10
+
11
+ <span class='calendarButtons'>
12
+ <a class='listview' href='<?php echo events_get_listview_link(); ?>'>List View</a>
13
+ <a class='gridview' href='<?php echo events_get_gridview_link(); ?>'>Grid View</a>
14
+ </span>
15
+
16
+ </div><!--#eventsCalendarHeader-->
17
+
18
+ <?php event_grid_view( ); // See the plugins/the-events-calendar/views/table.php template for customization ?>
19
+ </div>
20
+
21
+
22
+ <?php
23
+ include (TEMPLATEPATH.'/footer.php');
24
+ ?>
views/list.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $spEvents;
3
+ $spEvents->loadStylesAndScripts();
4
+ include (TEMPLATEPATH.'/header.php'); ?>
5
+ <div id="content" class="upcoming">
6
+ <div id='eventsCalendarHeader' class="clearfix">
7
+ <h2 class="cal-title"><?php _e('Calendar of Events', $spEvents->pluginDomain) ?></h2>
8
+
9
+ <span class='calendarButtons'>
10
+ <a class='listview' href='<?php echo events_get_listview_link(); ?>'>List View</a>
11
+ <a class='gridview' href='<?php echo events_get_gridview_link(); ?>'>Grid View</a>
12
+ </span>
13
+
14
+ </div><!--#eventsCalendarHeader-->
15
+
16
+ <div id="events-loop" class="events post-list clearfix">
17
+ <?php while ( have_posts() ) : the_post(); ?>
18
+
19
+ <div id="post-<?php the_ID() ?>" class="event post clearfix<?php echo $alt ?>">
20
+ <div style="clear:both;"></div>
21
+ <?php if ( is_new_event_day() ) : ?>
22
+ <h4 class="event-day"><?php echo the_event_start_date( null, false ); ?></h4>
23
+ <?php endif; ?>
24
+ <?php the_title('<h2 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h2>'); ?>
25
+ <div class="entry-content event-entry">
26
+ <?php the_excerpt() ?>
27
+ </div> <!-- End event-entry -->
28
+
29
+ <div class="event-list-meta">
30
+ <table cellspacing="0">
31
+ <tr>
32
+ <td class="event-meta-desc"><?php _e('Start:', $spEvents->pluginDomain) ?></td>
33
+ <td class="event-meta-value"><?php echo the_event_start_date(); ?></td>
34
+ </tr>
35
+ <tr>
36
+ <td class="event-meta-desc"><?php _e('End:', $spEvents->pluginDomain) ?></td>
37
+ <td class="event-meta-value"><?php echo the_event_end_date(); ?></td>
38
+ </tr>
39
+ <?php
40
+ $venue = the_event_venue();
41
+ if ( !empty( $venue ) ) :
42
+ ?>
43
+ <tr>
44
+ <td class="event-meta-desc"><?php _e('Venue:', $spEvents->pluginDomain) ?></td>
45
+ <td class="event-meta-value"><?php echo $venue; ?></td>
46
+ </tr>
47
+ <?php endif; ?>
48
+ <?php
49
+ $phone = the_event_phone();
50
+ if ( !empty( $phone ) ) :
51
+ ?>
52
+ <tr>
53
+ <td class="event-meta-desc"><?php _e('Phone:', $spEvents->pluginDomain) ?></td>
54
+ <td class="event-meta-value"><?php echo $phone; ?></td>
55
+ </tr>
56
+ <?php endif; ?>
57
+ <?php
58
+ $address = the_event_address(); $city = the_event_city(); $state = the_event_state(); $zip = the_event_zip();
59
+ if (!empty( $address ) && !empty( $city ) && !empty( $state ) && !empty( $zip ) ) :
60
+ ?>
61
+ <tr>
62
+ <td class="event-meta-desc"><?php _e('Address:', $spEvents->pluginDomain) ?><br /><a class="gmap" href="<?php event_google_map_link() ?>" title="Click to view a Google Map" target="_blank"f>Google Map</a></td>
63
+ <td class="event-meta-value"><?php echo the_event_address(); ?> <br /> <?php echo the_event_city(); ?>, <?php echo the_event_state(); ?> <?php echo the_event_zip(); ?></td>
64
+ </tr>
65
+ <?php endif; ?>
66
+ <?php
67
+ $cost = the_event_cost();
68
+ if ( !empty( $cost ) ) :
69
+ ?>
70
+ <tr>
71
+ <td class="event-meta-desc"><?php _e('Cost:', $spEvents->pluginDomain) ?></td>
72
+ <td class="event-meta-value"><?php echo $cost; ?></td>
73
+ </tr>
74
+ <?php endif; ?>
75
+ </table>
76
+ </div>
77
+ <div style="clear:both;"></div>
78
+ </div> <!-- End post -->
79
+ <div class="events-list content_footer"></div>
80
+ <?php $alt = ( empty( $alt ) ) ? ' alt' : '';?>
81
+ <?php endwhile; // posts ?>
82
+
83
+
84
+
85
+ </div><!-- #events-loop -->
86
+ <div class="nav" id="nav-below">
87
+
88
+ <div class="nav-previous"><?php
89
+ // Display Previous Page Navigation
90
+ if( events_displaying_upcoming() && get_previous_posts_link( ) ) : ?>
91
+ <?php previous_posts_link( '<span>&laquo; Previous Events</span>' ); ?>
92
+ <?php elseif( events_displaying_upcoming() && !get_previous_posts_link( ) ) : ?>
93
+ <a href='<?php echo events_get_past_link(); ?>'><span>&laquo; Previous Events</span></a>
94
+ <?php elseif( events_displaying_past() && get_next_posts_link( ) ) : ?>
95
+ <?php next_posts_link( '<span>&laquo; Previous Events</span>' ); ?>
96
+ <?php endif; ?>
97
+ </div>
98
+
99
+ <div class="nav-next"><?php
100
+ // Display Next Page Navigation
101
+ if( events_displaying_upcoming() && get_next_posts_link( ) ) : ?>
102
+ <?php next_posts_link( '<span>Next Events &raquo;</span>' ); ?>
103
+ <?php elseif( events_displaying_past() && get_previous_posts_link( ) ) : ?>
104
+ <?php previous_posts_link( '<span>Next Events &raquo;</span>' ); // a little confusing but in 'past view' to see newer events you want the previous page ?>
105
+ <?php elseif( events_displaying_past() && !get_previous_posts_link( ) ) : ?>
106
+ <a href='<?php echo events_get_upcoming_link(); ?>'><span>Next Events &raquo;</span></a>
107
+ <?php endif; ?>
108
+ </div>
109
+
110
+ </div>
111
+
112
+ </div>
113
+
114
+
115
+ <?php
116
+ include (TEMPLATEPATH.'/footer.php');
117
+ ?>
views/single.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php The_Events_Calendar::loadStylesAndScripts();
2
+ include (TEMPLATEPATH.'/header.php'); ?>
3
+ <div id="content" class="event widecolumn">
4
+ <?php the_post(); global $post, $spEvents; ?>
5
+ <div id="post-<?php the_ID() ?>" <?php post_class() ?>>
6
+ <span class="back"><a href="<?php echo events_get_gridview_link(); ?>">&laquo; Back to Events</a></span>
7
+ <h2 class="entry-title"><?php the_title() ?></h2>
8
+ <div id="event-meta">
9
+ <dl class="column">
10
+ <dt><?php _e('Start:', $spEvents->pluginDomain) ?></dt>
11
+ <dd><?php echo the_event_start_date(); ?></dd>
12
+ <?php if (the_event_start_date() !== the_event_end_date() ) { ?>
13
+ <dt><?php _e('End:', $spEvents->pluginDomain) ?></dt>
14
+ <dd><?php echo the_event_end_date(); ?></dd>
15
+ <?php } ?>
16
+
17
+ <dt><?php _e('Cost:', $spEvents->pluginDomain) ?></dt>
18
+ <dd><?php if ( the_event_cost() ) { echo the_event_cost(); } else { echo "&ndash;"; } ?></dd>
19
+
20
+ </dl>
21
+ <dl class="column">
22
+
23
+ <dt><?php _e('Venue:', $spEvents->pluginDomain) ?></dt>
24
+ <dd><?php echo the_event_venue(); ?></dd>
25
+ <?php if(the_event_address()) : ?>
26
+
27
+ <dt><?php _e('Address:', $spEvents->pluginDomain) ?><br /><a class="gmap" href="<?php event_google_map_link() ?>" title="Click to view a Google Map" target="_blank">Google Map</a></dt>
28
+ <dd>
29
+ <?php $address = the_event_address();
30
+ $address .= (the_event_city())? ', ' . the_event_city() : '';
31
+ $address .= (the_event_region()) ? ', ' . the_event_region() : '';
32
+ $address .= (the_event_country()) ? ', ' . the_event_country() : '';
33
+ $address .= (the_event_zip()) ? ', ' . the_event_zip() : '';
34
+
35
+ $address = str_replace(' ,', ',', $address);
36
+ echo $address;
37
+
38
+ ?>
39
+ </dd>
40
+ <?php endif; ?>
41
+ </dl>
42
+ </div>
43
+ <div class="entry-content">
44
+ <?php the_content() ?>
45
+
46
+
47
+ <?php if ( get_post_meta($post->ID, '_EventBriteId', true) && get_post_meta($post->ID, '_EventBriteStatus', true) == 'Live' && the_event_ticket_count() > 0 ) : // is this registered with eventbrite and live? ?>
48
+
49
+ <div id="eventbrite-embed"><iframe src="http://www.eventbrite.com/tickets-external?eid=<?php echo get_post_meta($post->ID, '_EventBriteId', true) ?>&amp;ref=etckt" frameborder="0" marginwidth="5" marginheight="5" vspace="0" hspace="0" width="100%" height="207" allowtransparency="true" scrolling="auto"></iframe></div>
50
+
51
+ <?php endif; // end eventbrite?>
52
+
53
+
54
+ </div>
55
+ <?php edit_post_link('Edit', '<span class="edit-link">', '</span>'); ?>
56
+ </div><!-- .post -->
57
+
58
+ </div><!-- #content -->
59
+
60
+ <?php
61
+ include (TEMPLATEPATH.'/footer.php');
62
+ ?>
views/table.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ list( $year, $month ) = split( '-', $spEvents->date );
3
+ $date = mktime(12, 0, 0, $month, 1, $year);
4
+ $daysInMonth = date("t", $date);
5
+ $offset = date("w", $date);
6
+ $rows = 1;
7
+ ?>
8
+ <table class="calendar" id="big">
9
+
10
+ <thead>
11
+ <tr>
12
+ <th id="Sunday" abbr="<?php _e( 'Sunday' ); ?>"><?php _e( 'Sun' ); ?></th>
13
+ <th id="Monday" abbr="<?php _e( 'Monday' ); ?>"><?php _e( 'Mon' ); ?></th>
14
+ <th id="Tuesday" abbr="<?php _e( 'Tuesday' ); ?>"><?php _e( 'Tue' ); ?></th>
15
+ <th id="Wednesday" abbr="<?php _e( 'Wednesday' ); ?>"><?php _e( 'Wed' ); ?></th>
16
+ <th id="Thursday" abbr="<?php _e( 'Thursday' ); ?>"><?php _e( 'Thu' ); ?></th>
17
+ <th id="Friday" abbr="<?php _e( 'Friday' ); ?>"><?php _e( 'Fri' ); ?></th>
18
+ <th id="Saturday" abbr="<?php _e( 'Saturday' ); ?>"><?php _e( 'Sat' ); ?></th>
19
+ </tr>
20
+ </thead>
21
+
22
+ <tbody>
23
+ <tr>
24
+ <?php
25
+ // skip last month
26
+ for( $i = 1; $i <= $offset; $i++ ){
27
+ echo "<td class='othermonth'></td>";
28
+ }
29
+ // output this month
30
+ for( $day = 1; $day <= $daysInMonth; $day++ ) {
31
+ if( ($day + $offset - 1) % 7 == 0 && $day != 1) {
32
+ echo "</tr>\n\t<tr>";
33
+ $rows++;
34
+ }
35
+ echo "<td class='thismonth'><div class='daynum'>" . $day . "</div>\n";
36
+ echo display_day( $day, $monthView );
37
+ echo "</td>";
38
+ }
39
+ // skip next month
40
+ while( ($day + $offset) <= $rows * 7)
41
+ {
42
+ echo "<td class='othermonth'></td>";
43
+ $day++;
44
+ }
45
+ ?>
46
+ </tr>
47
+ </tbody>
48
+ </table>
49
+ <?php
50
+ function display_day( $day, $monthView ) {
51
+ $output = '';
52
+ for( $i = 0; $i < count( $monthView[$day] ); $i++ ) {
53
+ $event = $monthView[$day][$i];
54
+ $eventId = $event->ID.'-'.$day;
55
+ $start = the_event_start_date( $event->ID );
56
+ $end = the_event_end_date( $event->ID );
57
+ $cost = the_event_cost( $event->ID );
58
+ $address = the_event_address( $event->ID );
59
+ $city = the_event_city( $event->ID );
60
+ $state = the_event_state( $event->ID );
61
+ $province = the_event_province( $event->ID );
62
+ $country = the_event_country( $event->ID );
63
+ include( dirname( __FILE__ ) . '/gridview-day.php' );
64
+ if( $i < count( $monthView[$day] ) - 1 ) {
65
+ echo "<hr />";
66
+ }
67
+ }
68
+ }
69
+
70
+ ?>
views/user-profile.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php do_action( 'sp_events_user_profile_above' ); ?>
2
+ <style type="text/css">
3
+ .form-table form input {border:none;}
4
+ <?php if( eventsGetOptionValue('donateHidden', false) ) : ?>
5
+ #sp-events-user-profile {display: none;}
6
+ <?php endif; ?>
7
+ #mainDonateRow label {line-height: 30px;}
8
+ #submitLabel {display: block;}
9
+ #submitLabel input {
10
+ display: block;
11
+ padding: 0;
12
+ }
13
+ </style>
14
+ <div id="sp-events-user-profile">
15
+ <h3><?php _e('The Events Calendar'); ?></h3>
16
+
17
+ <table class="form-table">
18
+ <tr id="mainDonateRow">
19
+ <th scope="row"><?php _e('Donate',$this->pluginDomain); ?></th>
20
+ <td>
21
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
22
+ <input type="hidden" name="cmd" value="_s-xclick">
23
+ <input type="hidden" name="hosted_button_id" value="10750983">
24
+ <input type="hidden" name="item_name" value="Events User Profile Page">
25
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
26
+ <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
27
+ <label id="submitLabel" for="submit">
28
+ <?php _e('If you find this plugin useful, please consider donating to the producer of it, Shane &#38; Peter, Inc. Thank you!',$this->pluginDomain); ?>
29
+ </label>
30
+ </form>
31
+ </td>
32
+ </tr>
33
+ </table>
34
+ </div>
35
+
36
+ <?php do_action( 'sp_events_user_profile_below' ); ?>