Events Manager - Version 2.0rc2

Version Description

Download this release

Release Info

Developer nutsmuggler
Plugin Icon 128x128 Events Manager
Version 2.0rc2
Comparing to
See all releases

Code changes from version 2.0rc1 to 2.0rc2

Files changed (7) hide show
  1. dbem_calendar.php +47 -8
  2. dbem_events.php +1491 -1173
  3. events-manager.php +43 -10
  4. langs/dbem-cs_CZ.mo +0 -0
  5. langs/dbem-cs_CZ.po +1217 -0
  6. marcus-extras.php +279 -0
  7. readme.txt +18 -5
dbem_calendar.php CHANGED
@@ -123,7 +123,7 @@ function dbem_get_calendar($args="") {
123
 
124
 
125
  // Build Previous and Next Links
126
- $base_link = "?".$_SERVER['QUERY_STRING']."&";
127
 
128
  if($month == 1){
129
  $back_month = 12;
@@ -132,7 +132,7 @@ function dbem_get_calendar($args="") {
132
  $back_month = $month -1;
133
  $back_year = $year;
134
  }
135
- $previous_link = "<a class='prev-month' href=\"".$base_link."calmonth={$back_month}&calyear={$back_year} \">&lt;&lt;</a>";
136
 
137
  if($month == 12){
138
  $next_month = 1;
@@ -141,7 +141,7 @@ function dbem_get_calendar($args="") {
141
  $next_month = $month + 1;
142
  $next_year = $year;
143
  }
144
- $next_link = "<a class='next-month' href=\"".$base_link."calmonth={$next_month}&calyear={$next_year} \">&gt;&gt;</a>";
145
  $random = (rand(100,200));
146
  $calendar="<div class='dbem-calendar' id='dbem-calendar-$random'><div style='display:none' class='month_n'>$month</div><div class='year_n' style='display:none' >$year</div>";
147
 
@@ -150,7 +150,7 @@ function dbem_get_calendar($args="") {
150
  // Build the heading portion of the calendar table
151
  $calendar .= "<table class='dbem-calendar-table'>\n".
152
  "<thead>\n<tr>\n".
153
- "<td>$previous_link</td><td colspan='5'>$month_name $year</td><td>$next_link\n".
154
  "</tr>\n</thead>\n".
155
  "<tr class='days-names'>\n".
156
  $days_initials.
@@ -170,8 +170,10 @@ function dbem_get_calendar($args="") {
170
  if(($i >= $offset_count) && ($i < ($num_weeks * 7) - $outset)){ // if it is THIS month
171
  $fullday=$d;
172
  $d=date('j', $d);
173
- $day_link = "$d";
174
- if($date == mktime(0,0,0,$month,$d,$year)){
 
 
175
  $calendar .= "<td class='eventless-today'>$d</td>\n";
176
  } else {
177
  $calendar .= "<td class='eventless'>$day_link</td>\n";
@@ -227,7 +229,36 @@ function dbem_get_calendar($args="") {
227
  //}
228
  // ------------------
229
  // inserts the events
230
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  $events_page = get_option('dbem_events_page');
232
  if($events){
233
  foreach($events as $event) {
@@ -378,5 +409,13 @@ function dbem_filter_calendar_ajax() {
378
  die();
379
  }
380
  }
381
- add_action('init','dbem_filter_calendar_ajax');
 
 
 
 
 
 
 
 
382
  ?>
123
 
124
 
125
  // Build Previous and Next Links
126
+ $base_link = "?".$_SERVER['QUERY_STRING']."&amp;";
127
 
128
  if($month == 1){
129
  $back_month = 12;
132
  $back_month = $month -1;
133
  $back_year = $year;
134
  }
135
+ $previous_link = "<a class='prev-month' href=\"".$base_link."calmonth={$back_month}&amp;calyear={$back_year} \">&lt;&lt;</a>";
136
 
137
  if($month == 12){
138
  $next_month = 1;
141
  $next_month = $month + 1;
142
  $next_year = $year;
143
  }
144
+ $next_link = "<a class='next-month' href=\"".$base_link."calmonth={$next_month}&amp;calyear={$next_year} \">&gt;&gt;</a>";
145
  $random = (rand(100,200));
146
  $calendar="<div class='dbem-calendar' id='dbem-calendar-$random'><div style='display:none' class='month_n'>$month</div><div class='year_n' style='display:none' >$year</div>";
147
 
150
  // Build the heading portion of the calendar table
151
  $calendar .= "<table class='dbem-calendar-table'>\n".
152
  "<thead>\n<tr>\n".
153
+ "<td>$previous_link</td><td class='month_name' colspan='5'>$month_name $year</td><td>$next_link</td>\n".
154
  "</tr>\n</thead>\n".
155
  "<tr class='days-names'>\n".
156
  $days_initials.
170
  if(($i >= $offset_count) && ($i < ($num_weeks * 7) - $outset)){ // if it is THIS month
171
  $fullday=$d;
172
  $d=date('j', $d);
173
+ $day_link = "$d";
174
+ // Apllying this patch http://davidebenini.it/events-manager-forum/topic.php?id=73; was
175
+ //if($date == mktime(0,0,0,$month,$d,$year)){
176
+ if(($date == mktime(0,0,0,$month,$d,$year)) && (date('F') == $month_name)) {
177
  $calendar .= "<td class='eventless-today'>$d</td>\n";
178
  } else {
179
  $calendar .= "<td class='eventless'>$day_link</td>\n";
229
  //}
230
  // ------------------
231
  // inserts the events
232
+ // $eventful_months= array();
233
+ // if($events){
234
+ // foreach($events as $event) {
235
+ // if($eventful_months[$event->event_month_n]){
236
+ // $eventful_months[$event->event_month_n][] = $event;
237
+ // } else {
238
+ // $eventful_months[$event->event_month_n] = array($event);
239
+ // }
240
+ // }
241
+ // $eventful_days = array();
242
+ // foreach($eventful_months as $month) {
243
+ // print_r($month);
244
+ // $eventful_days[$month] = array();
245
+ //
246
+ // foreach($month as $event) {
247
+ // // if($eventful_days[$month][$event->event_day]){
248
+ // // $eventful_days[$month][$event->event_day][] = $event;
249
+ // // } else {
250
+ // // $eventful_days[$month][$event->event_day] = array($event);
251
+ // // }
252
+ //
253
+ // }
254
+ // }
255
+ //
256
+ //
257
+ //
258
+ // }
259
+ // print_r("ECCO: <br/><pre>");
260
+ // print_r($eventful_days);
261
+ // print_r("</pre>");
262
  $events_page = get_option('dbem_events_page');
263
  if($events){
264
  foreach($events as $event) {
409
  die();
410
  }
411
  }
412
+ add_action('init','dbem_filter_calendar_ajax');
413
+
414
+ function dbem_full_calendar() {
415
+ echo "<p>Demo di <code>dbem_full_calendar</code></p>" ;
416
+ echo '<div id="jMonthCalendar"></div>';
417
+ dbem_get_calendar();
418
+ }
419
+
420
+
421
  ?>
dbem_events.php CHANGED
@@ -1,410 +1,452 @@
1
  <?php
2
 
3
-
4
  function dbem_new_event_page() {
5
-
6
- $title=__("Insert New Event", 'dbem');
7
- dbem_event_form($event, $title, $element);
8
 
 
 
 
9
  }
10
 
11
- function dbem_events_subpanel() {
12
- global $wpdb;
13
- $action=$_GET['action'];
14
- $action2 =$_GET['action2'];
15
- $event_ID=$_GET['event_id'];
16
- $recurrence_ID=$_GET['recurrence_id'];
17
- $scope=$_GET['scope'];
18
- $offset=$_GET['offset'];
19
- $order=$_GET['order'];
20
- $selectedEvents = $_GET['events'];
21
 
22
  // Disable Hello to new user if requested
23
- if(isset($_GET['disable_hello_to_user']) && $_GET['disable_hello_to_user'] == 'true')
24
- update_option('dbem_hello_to_user', 0);
25
 
26
  if ($order == "")
27
- $order = "ASC";
28
- if ($offset=="")
29
- $offset = "0";
30
- $event_table_name = $wpdb->prefix.EVENTS_TBNAME;
31
  // Debug code, to make sure I get the correct page
32
-
33
-
34
-
35
 
36
  // DELETE action
37
  if ($action == 'deleteEvents') {
38
- // $sql="DELETE FROM ".$event_table_name." WHERE event_id='"."$event_ID"."'";
39
-
 
40
  // TODO eventual error if ID in non-existant
41
  //$wpdb->query($sql);
42
- foreach($selectedEvents as $event_ID) {
43
- dbem_delete_event($event_ID);
44
  }
45
-
46
- $events = dbem_get_events("", "future");
47
- dbem_events_table($events, 10,"Future events");
48
  }
49
  // UPDATE or CREATE action
50
  if ($action == 'update_event' || $action == 'update_recurrence') {
51
-
52
- $event = array();
53
- $location = array();
54
-
55
- $event['event_name']=stripslashes($_POST[event_name]);
56
  // Set event end time to event time if not valid
57
  // if (!_dbem_is_date_valid($event['event_end_date']))
58
  // $event['event_end_date'] = $event['event-date'];
59
- $event['event_start_date'] = $_POST[event_date];
60
- $event['event_end_date'] = $_POST[event_end_date];
61
  //$event['event_start_time'] = $_POST[event_hh].":".$_POST[event_mm].":00";
62
  //$event['event_end_time'] = $_POST[event_end_hh].":".$_POST[event_end_mm].":00";
63
- $event['event_start_time'] = date("G:i:00", strtotime($_POST['event_start_time']));
64
- $event['event_end_time'] = date("G:i:00", strtotime($_POST['event_end_time']));
65
- $recurrence['recurrence_name'] = $event['event_name'];
66
- $recurrence['recurrence_start_date'] = $event['event_start_date'];
67
- $recurrence['recurrence_end_date'] = $event['event_end_date'];
68
- $recurrence['recurrence_start_time'] = $event['event_start_time'];
69
- $recurrence['recurrence_end_time'] = $event['event_end_time'];
70
- $recurrence['recurrence_id'] = $_POST[recurrence_id];
71
- $recurrence['recurrence_freq'] = $_POST[recurrence_freq];
72
- $recurrence['recurrence_freq'] == 'weekly'
73
- ? $recurrence[recurrence_byday] = implode(",", $_POST['recurrence_bydays'])
74
- : $recurrence['recurrence_byday'] = $_POST[recurrence_byday];
75
- $_POST['recurrence_interval'] == "" ? $recurrence['recurrence_interval'] = 1 : $recurrence['recurrence_interval'] = $_POST['recurrence_interval'];
76
- $recurrence['recurrence_byweekno'] = $_POST[recurrence_byweekno];
77
 
 
 
78
 
79
- $event['event_rsvp'] = $_POST['event_rsvp'];
80
- $event['event_seats'] = $_POST['event_seats'];
81
-
82
- if(isset($_POST['event_contactperson_id']) && $_POST['event_contactperson_id'] != '' && $_POST['event_contactperson_id'] != '-1') {
83
 
84
- $event['event_contactperson_id'] = $_POST['event_contactperson_id'];
85
- $recurrence['event_contactperson_id'] = $_POST['event_contactperson_id'];
86
  }
87
-
88
- if(!_dbem_is_time_valid($event_end_time))
89
- $event_end_time = $event_time;
90
 
91
- $location['location_name']=$_POST[location_name];
92
- $location['location_address']=$_POST[location_address];
93
- $location['location_town']=$_POST[location_town];
94
- $location['location_latitude']=$_POST[location_latitude];
95
- $location['location_longitude']=$_POST[location_longitude];
96
- $location['location_description']="";
97
- $event['event_notes']=stripslashes($_POST[event_notes]);
98
- $recurrence['recurrence_notes']=$event['event_notes'];
99
- $validation_result = dbem_validate_event($event);
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
- if ($validation_result == "OK") {
103
  // validation successful
104
-
105
- $related_location = dbem_get_identical_location($location);
106
- // print_r($related_location);
107
- if ($related_location) {
108
- $event['location_id'] = $related_location['location_id'];
109
- $recurrence['location_id'] = $related_location['location_id'];
110
- }
111
- else {
112
 
113
- $new_location = dbem_insert_location($location);
114
- $event['location_id']= $new_location['location_id'];
115
- $recurrence['location_id'] = $new_location['location_id'];
116
  //print_r($new_location);
117
-
118
- }
119
-
120
- if(!$event_ID && !$recurrence_ID ) {
121
- // there isn't anything
122
- if ($_POST['repeated_event']) {
123
-
124
- //insert new recurrence
125
- dbem_insert_recurrent_event($event,$recurrence);
126
- $feedback_message = __('New recurrent event inserted!','dbem');
127
- } else {
128
- // INSERT new event
129
- $wpdb->insert($event_table_name, $event);
130
- $feedback_message = __('New event successfully inserted!','dbem');
131
- }
132
- } else {
133
- // something exists
134
- if($recurrence_ID) {
135
- // UPDATE old recurrence
136
- $recurrence['recurrence_id'] = $recurrence_ID;
137
- //print_r($recurrence);
138
- if(dbem_update_recurrence($recurrence))
139
- $feedback_message = __('Recurrence updated!','dbem');
140
- else
141
- $feedback_message = __('Something went wrong with the recurrence update...','dbem');
142
-
143
- } else {
144
- // UPDATE old event
145
- // unlink from recurrence in case it was generated by one
146
- $event['recurrence_id'] = null;
147
- $where['event_id'] = $event_ID;
148
- $wpdb->update($event_table_name, $event, $where);
149
- $feedback_message = "'".$event['event_name']."' ".__('updated','dbem')."!";
150
- }
151
- }
152
 
153
-
154
 
155
-
156
- //$wpdb->query($sql);
157
- echo "<div id='message' class='updated fade'>
158
- <p>$feedback_message</p>
159
- </div>";
160
- $events = dbem_get_events("", "future");
161
- dbem_events_table($events, 10, "Future events");
162
- } else {
163
- // validation unsuccessful
164
-
165
- echo "<div id='message' class='error '>
166
- <p>".__("Ach, there's a problem here:","dbem")." $validation_result</p>
167
- </div>";
168
- dbem_event_form($event,"Edit event $event_ID" ,$event_ID);
169
-
170
  }
171
- }
172
- if ($action == 'edit_event') {
173
- if (!$event_ID) {
174
- $title=__("Insert New Event", 'dbem');
 
 
 
 
175
  } else {
176
- $event = dbem_get_event($event_ID);
177
- $title=__("Edit Event", 'dbem')." '".$event['event_name']."'";
 
178
  }
179
-
180
- //$event=$wpdb->get_row($sql, ARRAY_A);
181
- // Enter new events and updates old ones
182
- // DEBUG: echo"Nome: $event->event_name";
183
-
184
-
185
- dbem_event_form($event, $title, $event_ID);
186
-
187
- }
188
- if ($action == 'edit_recurrence') {
189
-
190
- $event_ID = $_GET['recurrence_id'];
191
- $recurrence = dbem_get_recurrence($event_ID);
192
- $title=__("Reschedule", 'dbem'). " '" .$recurrence['recurrence_name']."'";
193
- dbem_event_form($recurrence, $title, $event_ID);
194
-
195
- }
196
-
197
- if ($action == 'update_recurrence') {
198
- //print_r($recurrence);
199
- //die('update recurrence!');
200
- }
201
-
202
- if ($action == "-1" || $action ==""){
203
- // No action, only showing the events list
204
-
205
 
206
-
207
- switch ($scope) {
208
- case "past":
209
- $title = __('Past Events','dbem');
210
- break;
211
- case "all":
212
- $title = __('All Events','dbem');
213
- break;
214
- default:
215
- $title = __('Future Events','dbem');
216
- $scope = "future";
217
  }
218
- $limit = 20;
219
- $events = dbem_get_events($limit, $scope, $order,$offset);
220
 
221
- dbem_events_table($events, $limit, $title);
 
 
 
 
 
 
222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  }
224
 
225
-
226
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  // array of all pages, bypasses the filter I set up :)
228
  function dbem_get_all_pages() {
229
  global $wpdb;
230
- $query = "SELECT id, post_title FROM ".$wpdb->prefix."posts WHERE post_type = 'page';";
231
- $pages = $wpdb->get_results($query, ARRAY_A);
232
- $output = array();
233
- foreach($pages as $page) {
234
- $output[$page['id']] = $page['post_title'];
235
  }
236
  return $output;
237
  }
238
 
239
  // Function composing the options subpanel
240
  function dbem_options_subpanel() {
241
- // dbem_options_register();
242
 
243
- ?>
244
- <div class="wrap">
245
-
246
- <div id='icon-options-general' class='icon32'>
247
- <br/>
248
- </div>
249
- <h2><?php _e('Event Manager Options','dbem'); ?></h2>
250
- <form id="dbem_options_form" method="post" action="options.php">
251
- <h3><?php _e('Events page', 'dbem');?></h3>
252
- <table class="form-table">
253
- <?php dbem_options_select(__('Events page'), 'dbem_events_page', dbem_get_all_pages(), __('This option allows you to select which page to use as an events page')) ;
254
- dbem_options_radio_binary(__('Display calendar in events page?', 'dbem'), 'dbem_display_calendar_in_events_page', __('This options allows to display the calendar in the events page, instead of the default list. It is recommended not to display both the calendar widget and a calendar page.'))?>
 
 
 
 
255
  </table>
256
- <h3><?php _e('Events format', 'dbem');?></h3>
257
- <table class="form-table">
258
- <?php
259
- dbem_options_textarea(__('Default event list format', 'dbem'), 'dbem_event_list_item_format', __('The format of any events in a list.<br/>Insert one or more of the following placeholders: <code>#_NAME</code>, <code>#_LOCATION</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_NOTES</code>.<br/> Use <code>#_LINKEDNAME</code> for the event name with a link to the given event page.<br/> Use <code>#_EVENTPAGEURL</code> to print the event page URL and make your own customised links.<br/> Use <code>#_LOCATIONPAGEURL</code> to print the location page URL and make your own customised links.<br/>To insert date and time values, use <a href="http://www.php.net/manual/en/function.date.php">PHP time format characters</a> with a <code>#</code> symbol before them, i.e. <code>#m</code>, <code>#M</code>, <code>#j</code>, etc.<br/> For the end time, put <code>#@</code> in front of the character, ie. <code>#@h</code>, <code>#@i</code>, etc.<br/> Feel free to use HTML tags as <code>li</code>, <code>br</code> and so on.', 'dbem'));
260
- dbem_options_input_text(__('Single event page title format','dbem'), 'dbem_event_page_title_format', __('The format of a single event page title. Follow the previous formatting instructions.','dbem'));
261
- dbem_options_textarea(__('Default single event format','dbem'), 'dbem_single_event_format',__('The format of a single event page.<br/>Follow the previous formatting instructions. <br/>Use <code>#_MAP</code> to insert a map.<br/>Use <code>#_CONTACTNAME</code>, <code>#_CONTACTEMAIL</code>, <code>#_CONTACTPHONE</code> to insert respectively the name, e-mail address and phone number of the designated contact person. <br/>Use <code>#_ADDBOOKINGFORM</code> to insert a form to allow the user to respond to your events reserving one or more places (RSVP).<br/> Use <code>#_REMOVEBOOKINGFORM</code> to insert a form where users, inserting their name and e-mail address, can remove their bookings.','dbem'));
262
- dbem_options_radio_binary(__('Show events page in lists?','dbem'), 'dbem_list_events_page', __('Check this option if you want the events page to appear together with other pages in pages lists.','dbem'));
263
- dbem_options_input_text(__('Events page title','dbem'),'dbem_events_page_title',__('The title on the multiple events page.','dbem'));
264
- dbem_options_input_text(__('No events message','dbem'), 'dbem_no_events_message',__('The message displayed when no events are available.','dbem'));
265
- dbem_options_textarea(__('Map text format','dbem'),'dbem_map_text_format',__('The format the text appearing in the event page map cloud.<br/>Follow the previous formatting instructions.','dbem'));
266
- ?>
267
- </table>
268
-
269
- <h3><?php _e('Locations format', 'dbem');?></h3>
270
- <table class="form-table"><?php
271
- dbem_options_input_text(__('Single location page title format','dbem'),'dbem_location_page_title_format',__('The format of a single location page title.<br/>Follow the previous formatting instructions.','dbem'));
272
- dbem_options_textarea(__('Default single location page format','dbem'),'dbem_single_location_format',__('The format of a single location page.<br/>Insert one or more of the following placeholders: <code>#_NAME</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_DESCRIPTION</code>.<br/> Use <code>#_MAP</code> to display a map of the event location, and <code>#_IMAGE</code> to display an image of the location.<br/> Use <code>#_NEXTEVENTS</code> to insert a list of the upcoming events, <code>#_PASTEVENTS</code> for a list of past events, <code>#_ALLEVENTS</code> for a list of all events taking place in this location.','dbem'));
273
- dbem_options_textarea(__('Default location baloon format','dbem'),'dbem_location_baloon_format', __('The format of of the text appearing in the baloon describing the location in the map.<br/>Insert one or more of the following placeholders: <code>#_NAME</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_DESCRIPTION</code> or <code>#_IMAGE</code>.','dbem'));
274
- dbem_options_textarea(__('Default location event list format','dbem'), 'dbem_location_event_list_item_format', __('The format of the events the list inserted in the location page through the <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> and <code>#_ALLEVENTS</code> element. <br/> Follow the events formatting instructions','dbem'));
275
- dbem_options_textarea(__('Default no events message', 'dbem'),'dbem_location_no_events_message', __('The message to be displayed in the list generated by <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> and <code>#_ALLEVENTS</code> when no events are available.','dbem'));
276
-
277
- ?>
 
 
 
 
 
 
278
  </table>
279
-
280
- <h3><?php _e('RSS feed format', 'dbem');?></h3>
281
- <table class="form-table"><?php
282
-
283
- dbem_options_input_text(__('RSS main title','dbem'),'dbem_rss_main_title',__('The main title of your RSS events feed.','dbem'));
284
- dbem_options_input_text(__('RSS main description','dbem'),'dbem_rss_main_description',__('The main description of your RSS events feed.','dbem'));
285
- dbem_options_input_text(__('RSS title format','dbem'),'dbem_rss_title_format',__('The format of the title of each item in the events RSS feed.','dbem'));
286
- dbem_options_input_text(__('RSS description format','dbem'),'dbem_rss_description_format',__('The format of the description of each item in the events RSS feed. Follow the previous formatting instructions.','dbem')); ?>
 
 
 
287
  </table>
288
-
289
- <h3><?php _e('Maps and geotagging', 'dbem');?></h3>
290
- <table class='form-table'>
291
- <?php $gmap_is_active = get_option('dbem_gmap_is_active'); ?>
 
 
 
 
292
 
293
  <tr valign="top">
294
- <th scope="row"><?php _e('Enable Google Maps integration?','dbem'); ?></th>
295
- <td>
296
- <input id="dbem_gmap_is_active_yes" name="dbem_gmap_is_active" type="radio" value="1" <?php if($gmap_is_active) echo "checked='checked'"; ?> /><?php _e('Yes'); ?> <br />
297
- <input name="dbem_gmap_is_active" type="radio" value="0" <?php if(!$gmap_is_active) echo "checked='checked'"; ?> /> <?php _e('No'); ?> <br />
298
- <?php _e('Check this option to enable Goggle Map integration.','dbem')?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  </td>
300
- </tr>
301
- <?php
302
- dbem_options_input_text(__('Google Maps API Key','dbem'), 'dbem_gmap_key', sprintf (__("To display Google Maps you need a Google Maps API key. Don't worry, it's free, you can get one <a href='%s'>here</a>.",'dbem'), 'http://code.google.com/apis/maps/signup.html'));
303
- ?>
304
  </table>
305
-
306
- <h3><?php _e('RSVP and bookings', 'dbem');?></h3>
307
- <table class='form-table'>
 
 
308
  <?php
309
- dbem_options_select(__('Default contact person','dbem'), 'dbem_default_contact_person', dbem_get_indexed_users(), __('Select the default contact person. This user will be employed whenever a contact person is not explicitly specified for an event','dbem'));
310
- dbem_options_radio_binary(__('Enable the RSVP e-mail notifications?','dbem'),'dbem_rsvp_mail_notify_is_active', __('Check this option if you want to receive an email when someone books places for your events.','dbem') );
311
- dbem_options_textarea(__('Contact person email format','dbem'),'dbem_contactperson_email_body',__('The format or the email which will be sent to the contact person. Follow the events formatting instructions. <br/>Use <code>#_RESPNAME</code>, <code>#_RESPEMAIL</code> and <code>#_RESPPHONE</code> to display respectively the name, e-mail, address and phone of the respondent.<br/>Use <code>#_SPACES</code> to display the number of spaces reserved by the respondent.<br/> Use <code>#_BOOKEDSEATS</code> and <code>#_AVAILABLESEATS</code> to display respectively the number of booked and available seats.','dbem'));
312
- dbem_options_textarea(__('Contact person email format','dbem'),'dbem_respondent_email_body',__('The format or the email which will be sent to reposdent. Follow the events formatting instructions. <br/>Use <code>#_RESPNAME</code> to display the name of the respondent.<br/>Use <code>#_CONTACTNAME</code> and <code>#_CONTACTMAIL</code> a to display respectively the name and e-mail of the contact person.<br/>Use <code>#_SPACES</code> to display the number of spaces reserved by the respondent.','dbem'));
313
- dbem_options_input_text(__('Notification sender name','dbem'),'dbem_mail_sender_name', __("Insert the display name of the notification sender.",'dbem'));
314
- dbem_options_input_text(__('Notification sender address','dbem'),'dbem_mail_sender_address', __("Insert the address of the notification sender. It must corresponds with your gmail account user",'dbem'));
315
- dbem_options_input_text(__('Default notification receiver address','dbem'),'dbem_mail_receiver_address',__("Insert the address of the receiver of your notifications",'dbem'));
316
- dbem_options_input_text('Mail sending port','dbem_rsvp_mail_port',__("The port through which you e-mail notifications will be sent. Make sure the firewall doesn't block this port",'dbem'));
317
- dbem_options_select(__('Mail sending method','dbem'), 'dbem_rsvp_mail_send_method', array('smtp'=>'SMTP','mail'=>__('PHP mail function', 'dbem'), 'sendmail' => 'Sendmail', 'qmail' => 'Qmail'), __('Select the method to send email notification.','dbem'));
318
- dbem_options_radio_binary(__('Use SMTP authentication?','dbem'),'dbem_rsvp_mail_SMTPAuth', __('SMTP authenticatio is often needed. If you use GMail, make sure to set this parameter to Yes','dbem'));
319
- dbem_options_input_text('SMTP host','dbem_smtp_host',__("The SMTP host. Usually it corresponds to 'localhost'. If you use GMail, set this value to 'ssl://smtp.gmail.com:465'.",'dbem'));
320
- dbem_options_input_text(__('SMTP username','dbem'),'dbem_smtp_username', __("Insert the username to be used to access your SMTP server.",'dbem'));
321
- dbem_options_input_password(__('SMTP password','dbem'),"dbem_smtp_password", __("Insert the password to be used to access your SMTP server",'dbem'));?>
 
322
 
323
 
324
 
325
  </table>
326
-
327
- <h3><?php _e('Images size', 'dbem');?></h3>
328
- <table class='form-table'> <?php
329
- dbem_options_input_text(__('Maximum width (px)','dbem'),'dbem_image_max_width',__('The maximum allowed width for images uploades','dbem'));
330
- dbem_options_input_text(__('Maximum height (px)','dbem'),'dbem_image_max_height', __("The maximum allowed width for images uploaded, in pixels",'dbem'));
331
- dbem_options_input_text(__('Maximum size (bytes)','dbem'),'dbem_image_max_size', __("The maximum allowed size for images uploaded, in pixels",'dbem'));
332
- ?>
333
- </table>
334
-
335
-
336
-
337
- <p class="submit">
338
- <input type="submit" id="dbem_options_submit" name="Submit" value="<?php _e('Save Changes') ?>" />
339
- </p>
340
 
341
-
342
- <?php settings_fields('dbem-options'); ?>
343
- </form>
344
- </div>
345
- <?php
 
 
 
 
346
 
347
-
348
- }
349
 
350
 
 
 
 
351
 
 
 
 
 
 
 
 
 
 
352
 
353
  //This is the content of the event page
354
  function dbem_events_page_content() {
355
  global $wpdb;
356
- if (isset($_REQUEST['location_id']) && $_REQUEST['location_id'] |= '') {
357
 
358
- $location= dbem_get_location($_REQUEST['location_id']);
359
- $single_location_format = get_option('dbem_single_location_format');
360
- $page_body = dbem_replace_locations_placeholders($single_location_format, $location);
361
  return $page_body;
362
 
363
  }
364
- if (isset($_REQUEST['event_id']) && $_REQUEST['event_id'] != '') {
365
  // single event page
366
- $event_ID=$_REQUEST['event_id'];
367
- $event= dbem_get_event($event_ID);
368
- $single_event_format = get_option('dbem_single_event_format');
369
- $page_body = dbem_replace_placeholders($single_event_format, $event);
370
- return $page_body;
371
- } elseif (isset($_REQUEST['calendar_day']) && $_REQUEST['calendar_day'] != ''){
372
-
373
- $date = $_REQUEST['calendar_day'];
374
- $events_N = dbem_events_count_for($date);
375
- // $_GET['scope'] ? $scope = $_GET['scope']: $scope = "future";
376
- // $stored_format = get_option('dbem_event_list_item_format');
377
- // $events_body = dbem_get_events_list(10, $scope, "ASC", $stored_format, $false);
378
- if ($events_N > 1) {
379
- $_GET['calendar_day'] ? $scope = $_GET['calendar_day']: $scope = "future";
380
- $stored_format = get_option('dbem_event_list_item_format');
381
- $events_body = "<ul class='dbem_events_list'>".dbem_get_events_list(10, $scope, "ASC", $stored_format, $false)."</ul>";
382
- return $events_body;
383
- } else {
384
- $events = dbem_get_events("",$_REQUEST['calendar_day']);
385
- $event= $events[0];
386
- $single_event_format = get_option('dbem_single_event_format');
387
- $page_body = dbem_replace_placeholders($single_event_format, $event);
388
- return $page_body;
389
- }
390
  return $events_body;
391
- } else {
 
 
 
 
 
 
 
 
392
  // Multiple events page
393
- $_GET['scope'] ? $scope = $_GET['scope']: $scope = "future";
394
- $stored_format = get_option('dbem_event_list_item_format');
395
- if(get_option('dbem_display_calendar_in_events_page'))
396
- $events_body = dbem_get_calendar();
397
  else
398
- $events_body = $events_body = "<ul class='dbem_events_list'>".dbem_get_events_list(10, $scope, "ASC", $stored_format, $false)."</ul>";
399
- return $events_body;
400
-
401
  }
402
- }
403
  function dbem_events_count_for($date) {
404
- global $wpdb;
405
- $table_name = $wpdb->prefix .EVENTS_TBNAME;
406
  $sql = "SELECT COUNT(*) FROM $table_name WHERE event_start_date like '$date';";
407
- return $wpdb->get_var($sql);
408
  }
409
 
410
  // filter function to call the event page when appropriate
@@ -413,93 +455,84 @@ function dbem_filter_events_page($data) {
413
  // $table_name = $wpdb->prefix .EVENTS_TBNAME;
414
  // $start = strpos($data, DBEM_PAGE);
415
 
416
- $is_events_post = (get_the_ID() == get_option('dbem_events_page'));
417
- $events_page_id = get_option('dbem_events_page');
418
- if (is_page($events_page_id) && $is_events_post) {
419
- return dbem_events_page_content();
 
420
  } else {
421
  return $data;
422
- }
423
  }
424
- add_filter('the_content','dbem_filter_events_page');
425
 
426
  function dbem_events_page_title($data) {
427
- $events_page_id = get_option('dbem_events_page');
428
- $events_page = get_page($events_page_id);
429
- $events_page_title = $events_page->post_title;
430
-
431
-
432
-
433
- if (($data == $events_page_title) && (is_page($events_page_id))) {
434
- if (isset($_REQUEST['calendar_day']) && $_REQUEST['calendar_day'] != ''){
435
-
436
- $date = $_REQUEST['calendar_day'];
437
- $events_N = dbem_events_count_for($date);
438
-
439
- if ($events_N == 1) {
440
- $events = dbem_get_events("",$_REQUEST['calendar_day']);
441
- $event= $events[0];
442
- $stored_page_title_format = get_option('dbem_event_page_title_format');
443
- $page_title = dbem_replace_placeholders($stored_page_title_format, $event);
444
- return $page_title;
445
- }
446
-
447
- }
448
-
449
-
450
 
 
451
 
452
- if (isset($_REQUEST['location_id']) && $_REQUEST['location_id'] |= '') {
453
- $location= dbem_get_location($_REQUEST['location_id']);
454
- $stored_page_title_format = get_option('dbem_location_page_title_format');
455
- $page_title = dbem_replace_locations_placeholders($stored_page_title_format, $location);
456
  return $page_title;
457
  }
458
- if (isset($_REQUEST['event_id']) && $_REQUEST['event_id'] != '') {
459
  // single event page
460
- $event_ID=$_REQUEST['event_id'];
461
- $event= dbem_get_event($event_ID);
462
- $stored_page_title_format = get_option('dbem_event_page_title_format');
463
- $page_title = dbem_replace_placeholders($stored_page_title_format, $event);
464
  return $page_title;
465
- } else {
466
  // Multiple events page
467
- $page_title = get_option('dbem_events_page_title');
468
- return $page_title;
469
-
470
- }
471
-
472
-
473
 
 
474
 
475
  } else {
476
  return $data;
477
- }
478
-
479
- }
480
  // to make sure that in pages lists the title is dbem_events_page_title, and not overwritten by the previous filter
481
- add_filter('the_title','dbem_events_page_title');
482
- add_filter('single_post_title','dbem_events_page_title');
483
 
484
  function dbem_filter_get_pages($data) {
485
- $output = array();
486
- $events_page_id = get_option('dbem_events_page');
487
- for ($i = 0; $i < count($data); ++$i) {
488
- if ($data[$i]->ID == $events_page_id) {
489
- $list_events_page = get_option('dbem_list_events_page');
490
- if($list_events_page) {
491
- $data[$i]->post_title = get_option('dbem_events_page_title')."&nbsp;";
492
- $output[] = $data[$i];
493
- }
494
  } else {
495
- $output[] = $data[$i];
496
- }
497
- }
498
- return $output;
499
- }
500
- add_filter('get_pages', 'dbem_filter_get_pages');
501
-
502
-
503
 
504
  //
505
  // TODO: ROBA NUOVA DA RIORDINARE
@@ -551,178 +584,170 @@ function dbem_admin_css() {
551
  echo $css;
552
  }
553
 
554
- add_action('admin_print_scripts','dbem_admin_css');
555
 
556
  // TEMPLATE TAGS
557
 
 
558
  // exposed function, for theme makers
559
- function dbem_get_events_list($limit="3", $scope="future", $order="ASC", $format='', $echo=1) {
560
- if(strpos($limit, "=")) {
 
 
561
  // allows the use of arguments without breaking the legacy code
562
- $defaults = array(
563
- 'limit' => 3,
564
- 'scope' => 'future',
565
- 'order' => 'ASC',
566
- 'format' => '',
567
- 'echo' => 1
568
- );
569
-
570
- $r = wp_parse_args( $limit, $defaults );
571
- extract( $r, EXTR_SKIP );
572
- $limit = $r['limit'];
573
- $scope = $r['scope'];
574
- $order = $r['order'];
575
- $format = $r['format'];
576
- $echo = $r['echo'];
577
  }
578
- if ($scope == "")
579
  $scope = "future";
580
- if ($order != "DESC")
581
- $order = "ASC";
582
  if ($format == '')
583
- $format = get_option('dbem_event_list_item_format');
584
- $events = dbem_get_events($limit, $scope, $order);
585
  $output = "";
586
- if (!empty($events)) {
587
- foreach ($events as $event){
588
- // $localised_date = mysql2date("j M Y", $event->event_time);
589
-
590
-
591
 
592
- $output .= dbem_replace_placeholders($format, $event);
593
- }
 
594
  } else {
595
- $output = "<li class='dbem-no-events'>".get_option('dbem_no_events_message')."</li>";
596
  }
597
  if ($echo)
598
  echo $output;
599
  else
600
  return $output;
601
- }
602
-
603
- function dbem_get_events_list_shortcode($atts) {
604
- extract(shortcode_atts(array(
605
- 'limit' => 3,
606
- 'scope' => 'future',
607
- 'order' => 'ASC',
608
- 'format'=> '',
609
- ), $atts));
610
- $result = dbem_get_events_list("limit=$limit&scope=$scope&order=$order&format=$format&echo=0") ;
611
- return $result;
612
  }
613
- add_shortcode('events_list', 'dbem_get_events_list_shortcode');
614
-
615
-
616
 
 
 
 
 
 
 
 
617
 
618
- function dbem_get_events_page($justurl=0, $echo=1, $text='') {
619
- if(strpos($justurl, "=")) {
620
  // allows the use of arguments without breaking the legacy code
621
- $defaults = array(
622
- 'justurl' => 0,
623
- 'text' => '',
624
- 'echo' => 1,
625
- );
626
-
627
- $r = wp_parse_args( $justurl, $defaults );
628
- extract( $r, EXTR_SKIP );
629
- $justurl = $r['justurl'];
630
- $text = $r['text'];
631
- $echo = $r['echo'];
632
  }
633
-
634
- $page_link = get_permalink(get_option("dbem_events_page")) ;
635
- if($justurl) {
636
  $result = $page_link;
637
  } else {
638
- if ($text=='')
639
- $text = get_option("dbem_events_page_title") ;
640
  $result = "<a href='$page_link' title='$text'>$text</a>";
641
  }
642
  if ($echo)
643
  echo $result;
644
  else
645
  return $result;
646
-
647
- }
648
- function dbem_get_events_page_shortcode($atts) {
649
- extract(shortcode_atts(array(
650
- 'justurl' => 0,
651
- 'text' => '',
652
- ), $atts));
653
- $result = dbem_get_events_page("justurl=$justurl&text=$text&echo=0") ;
654
  return $result;
655
  }
656
- add_shortcode('events_page', 'dbem_get_events_page_shortcode');
657
-
658
-
659
 
660
- function dbem_are_events_available($scope="future") {
661
- if ($scope == "")
662
  $scope = "future";
663
- $events = dbem_get_events(1, $scope);
664
 
665
- if (empty($events))
666
  return FALSE;
667
- else
668
- return TRUE ;
669
  }
670
-
671
  // Returns true if the page in question is the events page
672
  function dbem_is_events_page() {
673
- $events_page_id = get_option('dbem_events_page');
674
- return is_page($events_page_id);
675
- }
676
 
677
  function dbem_is_single_event_page() {
678
- return (dbem_is_events_page() && (isset($_REQUEST['event_id']) && $_REQUEST['event_id'] != '')) ;
679
  }
680
 
681
  function dbem_is_multiple_events_page() {
682
- return (dbem_is_events_page() && !(isset($_REQUEST['event_id']) && $_REQUEST['event_id'] != '')) ;
683
  }
684
 
685
-
686
  // main function querying the database event table
687
- function dbem_get_events($limit="",$scope="future",$order="ASC", $offset="", $location_id = "") {
688
- global $wpdb;
 
 
 
689
 
690
- $events_table = $wpdb->prefix.EVENTS_TBNAME;
691
  if ($limit != "")
692
  $limit = "LIMIT $limit";
693
  if ($offset != "")
694
- $offset = "OFFSET $offset";
695
- if($order="")
696
- $order="ASC";
697
-
698
- $timestamp = time();
699
- $date_time_array = getdate($timestamp);
700
- $hours = $date_time_array['hours'];
701
- $minutes = $date_time_array['minutes'];
702
- $seconds = $date_time_array['seconds'];
703
- $month = $date_time_array['mon'];
704
- $day = $date_time_array['mday'];
705
- $year = $date_time_array['year'];
706
- $today = strftime('%Y-%m-%d', mktime($hours,$minutes,$seconds,$month,$day,$year));
707
 
708
- $conditions = array();
709
- if(preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $scope)) {
710
- $conditions[] = " event_start_date like '$scope'" ;
711
- } else {
712
- if (($scope != "past") && ($scope !="all"))
713
- $scope = "future";
714
- if ($scope == "future")
715
- $conditions[] = " event_start_date >= '$today'" ;
716
- if ($scope == "past")
717
- $conditions[] = " event_start_date < '$today'" ;
 
 
 
 
 
 
 
 
 
 
 
718
  }
719
-
720
- if($location_id != "")
721
- $conditions[] = " location_id = $location_id";
722
-
723
- $where = implode(" AND ", $conditions);
724
  if ($where != "")
725
- $where = " WHERE ".$where;
726
 
727
  $sql = "SELECT event_id,
728
  event_name,
@@ -747,30 +772,31 @@ function dbem_get_events($limit="",$scope="future",$order="ASC", $offset="", $lo
747
  $where
748
  ORDER BY event_start_date $order
749
  $limit
750
- $offset";
751
-
752
- $wpdb->show_errors = true;
753
- $events = $wpdb->get_results($sql, ARRAY_A);
754
- if (!empty($events)) {
755
  //$wpdb->print_error();
756
- $inflated_events = array();
757
- foreach($events as $this_event) {
758
-
759
- $this_location = dbem_get_location($this_event['location_id']);
760
- $this_event['location_name'] = $this_location['location_name'];
761
- $this_event['location_address'] = $this_location['location_address'];
762
- $this_event['location_town'] = $this_location['location_town'];
763
- array_push($inflated_events, $this_event);
764
  }
765
-
766
  return $inflated_events;
767
  } else {
768
  return null;
769
  }
770
- }
 
771
  function dbem_get_event($event_id) {
772
  global $wpdb;
773
- $events_table = $wpdb->prefix.EVENTS_TBNAME;
774
  $sql = "SELECT event_id,
775
  event_name,
776
  DATE_FORMAT(event_start_date, '%Y-%m-%e') AS 'event_date',
@@ -800,591 +826,880 @@ function dbem_get_event($event_id) {
800
  location_id,
801
  event_contactperson_id
802
  FROM $events_table
803
- WHERE event_id = $event_id";
804
-
805
  //$wpdb->show_errors(true);
806
- $event = $wpdb->get_row($sql,ARRAY_A);
807
  //$wpdb->print_error();
808
- $location = dbem_get_location($event['location_id']);
809
- $event['location_name'] = $location['location_name'];
810
- $event['location_address'] = $location['location_address'];
811
- $event['location_town'] = $location['location_town'];
812
- $event['location_latitude'] = $location['location_latitude'];
813
- $event['location_longitude'] = $location['location_longitude'];
814
- $event['location_image_url'] = $location['location_image_url'];
815
  return $event;
816
- }
817
 
818
  function dbem_hello_to_new_user() {
819
- $current_user = wp_get_current_user();
820
- $advice = sprintf(__("<p>Hey, <strong>%s</strong>, welcome to <strong>Events Manager</strong>! We hope you like it around here.</p>
821
  <p>Now it's time to insert events lists through <a href='%s' title='Widgets page'>widgets</a>, <a href='%s' title='Template tags documentation'>template tags</a> or <a href='%s' title='Shortcodes documentation'>shortcodes</a>.</p>
822
  <p>By the way, have you taken a look at the <a href='%s' title='Change settings'>Settings page</a>? That's where you customize the way events and locations are displayed.</p>
823
- <p>What? Tired of seeing this advice? I hear you, <a href='%s' title='Don't show this advice again'>click here</a> and you won't see this again!</p>", 'dbem'),
824
- $current_user->display_name,
825
- get_bloginfo('url').'/wp-admin/widgets.php',
826
- 'http://davidebenini.it/wordpress-plugins/events-manager#template-tags',
827
- 'http://davidebenini.it/wordpress-plugins/events-manager#shortcodes',
828
- get_bloginfo('url').'/wp-admin/admin.php?page=events-manager-options',
829
- get_bloginfo('url').'/wp-admin/admin.php?page=events-manager/events-manager.php&disable_hello_to_user=true');
830
  ?>
831
- <div id="message" class="updated">
832
- <?php echo $advice; ?>
833
  </div>
834
- <?php
835
  }
836
 
837
- function dbem_events_table($events, $limit, $title) {
838
- if (isset($_GET['scope']))
839
- $scope = $_GET['scope'];
840
- else
841
  $scope = "future";
842
- if (($scope != "past") && ($scope != "all"))
843
  $scope = "future";
844
- $events_count = count(dbem_get_events("",$scope));
845
 
846
- if (isset($_GET['offset']))
847
- $offset = $_GET['offset'];
 
 
848
 
849
- $use_events_end = get_option('dbem_use_event_end');
850
-
851
  ?>
852
-
853
- <div class="wrap">
854
- <div id="icon-events" class="icon32"><br/></div>
855
- <h2><?php echo $title; ?></h2>
 
 
 
856
 
857
- <?php
858
- $say_hello = get_option('dbem_hello_to_user');
859
- if ($say_hello == 1)
860
- dbem_hello_to_new_user();
861
-
862
- ?>
863
- <!--<div id='new-event' class='switch-tab'><a href="<?php bloginfo('wpurl')?>/wp-admin/edit.php?page=events-manager/events-manager.php&amp;action=edit_event"><?php _e('New Event ...', 'dbem');?></a></div>-->
864
  <?php
865
-
866
- $link = array();
867
- $link['past'] = "<a href='".get_bloginfo('url')."/wp-admin/edit.php?page=events-manager/events-manager.php&amp;scope=past&amp;order=desc'>".__('Past events','dbem')."</a>";
868
- $link['all'] = " <a href='".get_bloginfo('url')."/wp-admin/edit.php?page=events-manager/events-manager.php&amp;scope=all&amp;order=desc'>".__('All events','dbem')."</a>";
869
- $link['future'] = " <a href='".get_bloginfo('url')."/wp-admin/edit.php?page=events-manager/events-manager.php&amp;scope=future'>".__('Future events','dbem')."</a>";
870
-
871
- $scope_names = array();
872
- $scope_names['past'] = __('Past events','dbem');
873
- $scope_names['all'] = __('All events','dbem');
874
- $scope_names['future'] = __('Future events','dbem');
875
-
876
- ?>
 
 
 
 
 
 
 
 
 
 
877
 
878
- <form id="posts-filter" action="" method="get">
879
- <input type='hidden' name='page' value='events-manager/events-manager.php'/>
880
- <ul class="subsubsub">
881
- <li><a href='edit.php' class="current"><?php _e('Total', 'dbem');?> <span class="count">(<?php echo (count($events));?>)</span></a> </li></ul>
882
-
883
-
884
- <div class="tablenav">
885
-
886
- <div class="alignleft actions">
887
- <select name="action">
888
- <option value="-1" selected="selected"><?php _e('Bulk Actions');?></option>
889
- <option value="deleteEvents"><?php _e('Delete selected');?></option>
890
-
891
- </select>
892
- <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
893
- <select name="scope">
 
 
 
 
 
 
 
 
 
 
 
894
 
895
  <?php
896
- foreach ($scope_names as $key => $value) {
897
- $selected = "";
898
- if ($key == $scope)
899
- $selected = "selected='selected'";
900
- echo "<option value='$key' $selected>$value</option> ";
901
- }
902
- ?>
903
- </select>
904
- <input id="post-query-submit" class="button-secondary" type="submit" value="<?php _e('Filter')?>"/>
905
- </div>
906
- <div class="clear">
907
- </div>
908
- <?php
909
- if (empty($events)) {
910
- // TODO localize
911
- echo "no events";
912
- } else {
913
- ?>
914
 
915
  <table class="widefat">
916
- <thead>
917
- <tr>
918
- <th class='manage-column column-cb check-column' scope='col'><input class='select-all' type="checkbox" value='1'/></th>
919
- <th><?php _e('Name', 'dbem');?></th>
920
- <th><?php _e('Location', 'dbem');?></th>
921
-
922
-
923
- <th colspan="2"><?php _e('Date and time', 'dbem');?></th>
924
-
925
-
926
-
927
- </tr>
928
- </thead>
929
- <tbody>
 
 
 
 
 
930
  <?php
931
- $i =1;
932
- foreach ($events as $event){
933
- $class = ($i % 2) ? ' class="alternate"' : '';
934
- // FIXME set to american
935
- $localised_date = mysql2date(__('D d M Y'), $event['event_start_date']);
936
- $style = "";
937
- $today = date("Y-m-d");
938
-
939
- $location_summary = "<b>".$event['location_name']."</b><br/>".$event['location_address']." - ".$event['location_town'];
940
-
941
-
942
- if ($event['event_start_date'] < $today )
943
- $style= "style ='background-color: #FADDB7;'";
944
  ?>
945
- <tr <?php echo"$class $style"; ?> >
946
-
947
- <td>
948
- <input type='checkbox' class='row-selector' value='<?php echo $event['event_id'];?>' name='events[]'/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
949
  </td>
950
- <td>
951
- <strong><a class="row-title" href="<?php bloginfo('wpurl')?>/wp-admin/edit.php?page=events-manager/events-manager.php&amp;action=edit_event&amp;event_id=<?php echo $event['event_id']; ?>"><?php echo ($event['event_name']); ?></a></strong>
952
- </td>
953
- <td>
954
 
955
- <?php echo $location_summary; ?>
 
 
956
 
957
  </td>
958
-
959
- <td>
960
- <?php echo $localised_date ; ?><br/>
 
 
961
 
962
- <?php echo substr($event['event_start_time'],0,5)." - ".substr($event['event_end_time'],0,5) ; ?>
 
 
963
  </td>
964
- <td>
965
- <?php if($event['recurrence_id']) {
966
- $recurrence = dbem_get_recurrence($event[recurrence_id]); ?>
 
 
967
 
968
- <b><?php echo $recurrence['recurrence_description'];?> <br/> <a href="<?php bloginfo('wpurl')?>/wp-admin/edit.php?page=events-manager/events-manager.php&amp;action=edit_recurrence&amp;recurrence_id=<?php echo $recurrence['recurrence_id'];?>"><?php _e('Reschedule','dbem');?></a></b>
 
 
 
 
 
 
 
 
 
969
 
970
 
971
- <?php } ?>
 
 
972
  </td>
973
 
974
 
975
  <?php
976
- echo'</tr>';
977
- $i++;
978
  }
979
- ?>
980
 
981
- </tbody>
982
- </table>
983
- <?php } // end of table?>
 
 
 
 
 
984
 
985
  <div class='tablenav'>
986
- <div class="alignleft actions">
987
-
988
-
989
- <br class='clear'/>
990
- </div>
991
- <br class='clear'/>
992
- </div>
993
- </form>
994
- </div>
995
- </div>
996
-
997
- <?php
998
- if ($events_count > $limit) {
999
- $backward = $offset + $limit;
1000
- $forward = $offset - $limit;
1001
- if (DEBUG)
1002
- echo "COUNT = $count BACKWARD = $backward FORWARD = $forward<br> -- OFFSET = $offset" ;
1003
- echo "<div id='events-pagination'> ";
1004
- if ($backward < $events_count)
1005
- echo "<a style='float: left' href='".get_bloginfo('url')."/wp-admin/edit.php?page=events-manager/events-manager.php&amp;scope=$scope&offset=$backward'>&lt;&lt;</a>" ;
1006
- if ($forward >= 0)
1007
- echo "<a style='float: right' href='".get_bloginfo('url')."/wp-admin/edit.php?page=events-manager/events-manager.php&amp;scope=$scope&offset=$forward'>&gt;&gt;</a>";
1008
- echo "</div>" ;
1009
- }
1010
- ?>
1011
-
1012
- </div>
1013
  <?php
1014
  }
1015
- function dbem_event_form($event, $title, $element) {
1016
 
1017
  global $localised_date_formats;
1018
  // change prefix according to event/recurrence
1019
- $_GET['action'] == "edit_recurrence" ? $pref = "recurrence_" : $pref = "event_";
1020
 
1021
- $_GET['action'] == "edit_recurrence"
1022
- ? $form_destination= "edit.php?page=events-manager/events-manager.php&amp;action=update_recurrence&amp;recurrence_id=".$element
1023
- : $form_destination = "edit.php?page=events-manager/events-manager.php&amp;action=update_event&amp;event_id=".$element;
1024
-
1025
 
1026
- $locale_code = substr(get_locale(), 0, 2);
1027
- $localised_date_format = $localised_date_formats[$locale_code];
1028
 
1029
- $hours_locale = "24";
1030
  // Setting 12 hours format for those countries using it
1031
- if(preg_match("/en|sk|zh|us|uk/",$locale_code))
1032
- $hours_locale = "12";
1033
-
1034
-
1035
-
1036
- $localised_example = str_replace("yy", "2008", str_replace("mm", "11", str_replace("dd", "28", $localised_date_format)));
1037
- $localised_end_example = str_replace("yy", "2008", str_replace("mm", "11", str_replace("dd", "28", $localised_date_format)));
1038
 
1039
- if ($event[$pref.'start_date'] != "") {
1040
- preg_match("/(\d{4})-(\d{2})-(\d{2})/",$event[$pref.'start_date'], $matches );
1041
- $year = $matches[1];
1042
- $month = $matches[2];
1043
- $day = $matches[3];
1044
- $localised_date = str_replace("yy", $year, str_replace("mm", $month, str_replace("dd", $day, $localised_date_format)));
1045
  } else {
1046
  $localised_date = "";
1047
  }
1048
- if ($event[$pref.'end_date'] != "") {
1049
- preg_match("/(\d{4})-(\d{2})-(\d{2})/",$event[$pref.'end_date'], $matches );
1050
- $end_year = $matches[1];
1051
- $end_month = $matches[2];
1052
- $end_day = $matches[3];
1053
- $localised_end_date = str_replace("yy", $end_year, str_replace("mm", $end_month, str_replace("dd", $end_day, $localised_date_format)));
1054
  } else {
1055
  $localised_end_date = "";
1056
- }
1057
  // if($event[$pref.'rsvp'])
1058
  // echo (dbem_bookings_table($event[$pref.'id']));
1059
-
1060
-
1061
- $freq_options = array("daily" => __('Daily', 'dbem'), "weekly" => __('Weekly','dbem'),"monthly" => __('Monthly','dbem'));
1062
- $days_names = array(1 => __('Mon'), 2 => __('Tue'), 3 =>__('Wed'), 4 =>__('Thu'), 5 =>__('Fri'), 6 =>__('Sat'), 7 =>__('Sun'));
1063
- $saved_bydays = explode(",", $event['recurrence_byday']);
1064
- $weekno_options = array("1" => __('first', 'dbem'), '2' => __('second','dbem'),'3'=>__('third','dbem'),'4'=>__('fourth', 'dbem'), '-1'=>__('last','dbem'));
1065
 
1066
- $event[$pref.'rsvp'] ? $event_RSVP_checked = "checked='checked'" : $event_RSVP_checked ='';
 
 
 
 
1067
 
1068
- ?>
1069
- <form id="eventForm" method="post" action="<?php echo $form_destination; ?>">
1070
- <div class="wrap">
1071
- <div id="icon-events" class="icon32"><br/></div>
1072
- <h2><?php echo $title; ?></h2>
1073
- <?php
1074
- if($event['recurrence_id']) { ?>
 
 
 
1075
  <p id='recurrence_warning'>
1076
- <?php if(isset($_GET['action']) && ($_GET['action'] == 'edit_recurrence')) {
1077
- _e('WARNING: This is a recurrence.', 'dbem')?><br/>
1078
- <?php _e('Modifying these data all the events linked to this recurrence will be rescheduled','dbem');
1079
-
1080
- } else {
1081
- _e('WARNING: This is a recurring event.', 'dbem');
1082
- _e('If you change these data and save, this will become an independent event.','dbem');
1083
- }?></p>
1084
- <?php } ?>
1085
- <div id="poststuff" class="metabox-holder">
1086
-
1087
-
1088
- <!-- SIDEBAR -->
1089
- <div id="side-info-column" class="inner-sidebar">
1090
- <div id='side-sortables' class='meta-box-sortables'>
1091
- <!-- recurrence postbox -->
1092
- <div class="postbox " >
1093
- <div class="handlediv" title="Fare clic per cambiare."><br /></div>
1094
- <h3 class='hndle'><span><?php _e("Recurrence",'dbem');?></span></h3>
1095
-
1096
- <div class="inside">
1097
- <?php
1098
- if(!$event['event_id']) {
1099
- ?>
1100
- <?php if($event['recurrence_id'] != "")
1101
- $recurrence_YES = "checked='checked'";
1102
-
1103
-
1104
- ?>
1105
- <p><input id="event-recurrence" type="checkbox" name="repeated_event" value="1" <?php echo $recurrence_YES;?> /> <?php _e('Repeated event', 'dbem');?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1106
  <div id="event_recurrence_pattern">
1107
- <p>Frequency:
1108
- <select id="recurrence-frequency" name="recurrence_freq">
1109
- <?php dbem_option_items($freq_options, $event[$pref.'freq']); ?>
1110
- </select></p>
1111
- <p>
1112
- <?php _e('Every', 'dbem')?>
1113
- <input id="recurrence-interval" name='recurrence_interval' size='2' value='<?php echo $event['recurrence_interval'];?>'></input>
1114
- <span class='interval-desc' id="interval-daily-singular"><?php _e('day', 'dbem') ?></span>
1115
- <span class='interval-desc' id="interval-daily-plural"><?php _e('days', 'dbem') ?></span>
1116
- <span class='interval-desc' id="interval-weekly-singular"><?php _e('week', 'dbem') ?></span>
1117
- <span class='interval-desc' id="interval-weekly-plural"><?php _e('weeks', 'dbem') ?></span>
1118
- <span class='interval-desc' id="interval-monthly-singular"><?php _e('month', 'dbem') ?></span>
1119
- <span class='interval-desc' id="interval-monthly-plural"><?php _e('months', 'dbem') ?></span>
1120
  </p>
1121
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1122
  <p class="alternate-selector" id="weekly-selector">
1123
- <?php dbem_checkbox_items('recurrence_bydays[]', $days_names, $saved_bydays); ?>
1124
- </p>
1125
-
1126
  <p class="alternate-selector" id="monthly-selector">
1127
- <?php _e('Every','dbem')?>
1128
- <select id="monthly-modifier" name="recurrence_byweekno">
1129
- <?php dbem_option_items($weekno_options, $event['recurrence_byweekno']);?>
1130
- </select>
1131
- <select id="recurrence-weekday" name="recurrence_byday">
1132
- <?php dbem_option_items($days_names, $event['recurrence_byday']); ?>
1133
- </select>&nbsp;
1134
- </p>
1135
- </div>
1136
- <p id="recurrence-tip"><?php _e('Check if your event happens more than once according to a regular pattern', 'dbem') ?></p>
1137
-
1138
- <?php } else {
1139
-
1140
- if(!$event['recurrence_id']) {
1141
- echo "<p>".__('This is\'t a recurrent event','dbem').".</p>";
1142
- } else {
1143
-
1144
- $recurrence = dbem_get_recurrence($event['recurrence_id']); ?>
1145
- <p><?php echo $recurrence['recurrence_description'];?><br/><a href="<?php bloginfo('wpurl')?>/wp-admin/edit.php?page=events-manager/events-manager.php&amp;action=edit_recurrence&amp;recurrence_id=<?php echo $recurrence['recurrence_id'];?>"><?php _e('Reschedule', 'dbem');?></a></p>
1146
-
1147
- <?php } ?>
1148
-
1149
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1150
  </div>
1151
-
1152
-
1153
-
1154
  </div>
1155
-
1156
- <div class="postbox " >
1157
- <div class="handlediv" title="Fare clic per cambiare."><br /></div>
1158
- <h3 class='hndle'><span><?php _e('Contact Person','dbem');?></span></h3>
1159
- <div class="inside">
1160
- <p>Contact: <?php wp_dropdown_users(array('name'=>'event_contactperson_id', 'show_option_none'=>__("Select...",'dbem'),'selected'=>$event['event_contactperson_id'])) ; ?></p>
 
 
 
 
 
 
 
 
 
1161
  </div>
1162
- </div>
1163
-
1164
-
1165
-
1166
- <div class="postbox " >
1167
- <div class="handlediv" title="Fare clic per cambiare."><br /></div>
1168
  <h3 class='hndle'><span>RSVP</span></h3>
1169
  <div class="inside">
1170
-
1171
- <p><input id="rsvp-checkbox" name='event_rsvp' value='1' type='checkbox' <?php echo $event_RSVP_checked ?> /> <?php _e('Enable registration for this event', 'dbem')?></p>
 
 
 
 
 
1172
  <div id='rsvp-data'>
1173
-
1174
- <?php
1175
- if ($event['event_contactperson_id'] != NULL)
1176
- $selected = $event['event_contactperson_id'];
1177
- else
1178
- $selected = '0';?>
1179
- <p> <?php _e('Spaces');?>: <input id="seats-input" type="text" name="event_seats" size='5' value="<?php echo $event[$pref.'seats']?>" /></p>
1180
- <?php if($event['event_rsvp']){?>
1181
- <?php dbem_bookings_compact_table($event[$pref.'id']); ?>
1182
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1183
  </div>
1184
- </div>
1185
- </div>
1186
- </div>
1187
- </div>
1188
-
1189
-
1190
-
1191
- <!-- END OF SIDEBAR -->
1192
-
1193
-
1194
-
1195
- <div id="post-body" class="has-sidebar">
1196
- <div id="post-body-content" class="has-sidebar-content">
1197
- <div id="event_name" class="stuffbox">
1198
- <h3><?php _e('Name','dbem'); ?></h3>
1199
- <div class="inside">
1200
- <input type="text" name="event_name" value="<?php echo $event[$pref.'name'] ?>" /><br/>
1201
- <?php _e('The event name. Example: Birthday party', 'dbem') ?>
1202
- </div>
1203
- </div>
1204
-
1205
-
1206
-
1207
- <div id="event_start_date" class="stuffbox">
1208
- <h3 id='event-date-title'><?php _e('Event date','dbem'); ?></h3><h3 id='recurrence-dates-title'><?php _e('Recurrence dates','dbem'); ?></h3>
1209
- <div class="inside">
1210
- <input id="localised-date" type="text" name="localised_event_date" value="<?php echo $localised_date ?>" style ="display: none;" />
1211
- <input id="date-to-submit" type="text" name="event_date" value="<?php echo $event[$pref.'start_date'] ?>" style="background: #FCFFAA" /> <input id="localised-end-date" type="text" name="localised_event_end_date" value="<?php echo $localised_end_date ?>" style ="display: none; " />
1212
-
1213
- <input id="end-date-to-submit" type="text" name="event_end_date" value="<?php echo $event[$pref.'end_date'] ?>" style="background: #FCFFAA" />
1214
-
1215
-
1216
- <br/>
1217
- <span id='event-date-explanation'><?php _e('The event date.', 'dbem'); ?></span><span id='recurrence-dates-explanation'><?php _e('The recurrence beginning and end date.', 'dbem'); ?></span>
1218
-
1219
  </div>
 
1220
  </div>
1221
-
1222
-
1223
-
1224
-
1225
-
1226
- <div id="event_end_day" class="stuffbox">
1227
- <h3><?php _e('Event time','dbem'); ?></h3>
 
 
 
1228
  <div class="inside">
1229
- <input id="start-time" type="text" size="8" maxlength="8" name="event_start_time" value="<?php echo $event[$pref.'start_'.$hours_locale."h_time"]; ?>" /> -
1230
- <input id="end-time" type="text" size="8" maxlength="8" name="event_end_time" value="<?php echo $event[$pref.'end_'.$hours_locale."h_time"]; ?>" /> <br/>
1231
-
1232
-
1233
- <?php _e('The time of the event beginning and end', 'dbem') ?>.
1234
-
1235
  </div>
1236
- </div>
1237
-
1238
-
1239
-
1240
- <div id="location_coordinates" class="stuffbox" style='display:none;'>
1241
- <h3><?php _e('Coordinates','dbem'); ?></h3>
 
 
 
 
 
 
1242
  <div class="inside">
1243
- <input id='location-latitude' name='location_latitude' type='text' value='<?php echo $event['location_latitude']; ?>' size='15' /> - <input id='location-longitude' name='location_longitude' type='text' value='<?php echo $event['location_longitude']; ?>' size='15' />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1244
  </div>
1245
  </div>
1246
-
1247
-
1248
-
1249
-
1250
- <div id="location_name" class="stuffbox">
1251
- <h3><?php _e('Location','dbem'); ?></h3>
1252
- <div class="inside">
1253
- <table id="dbem-location-data">
1254
- <tr>
1255
- <th><?php _e('Name:') ?>&nbsp;</th><td><input id="location-name" type="text" name="location_name" value="<?php echo $event['location_name']?>" /></td>
1256
- <?php $gmap_is_active = get_option('dbem_gmap_is_active'); ?>
1257
-
1258
- <?php if ($gmap_is_active) { ?>
1259
- <td rowspan='6'>
1260
- <div id='map-not-found' style='width: 400px; font-size: 140%; text-align: center; margin-top: 100px; display: hide'><p><?php _e('Map not found');?></p></div>
1261
- <div id='event-map' style='width: 400px; height: 300px; background: green; display: hide; margin-right:8px'></div>
1262
- </td>
1263
- <?php } ; // end of IF_GMAP_ACTIVE?>
1264
- </tr>
1265
- <tr>
1266
- <td colspan='2'>
1267
- <p><?php _e('The name of the location where the event takes place. You can use the name of a venue, a square, etc','dbem') ?> </p>
1268
- </td>
1269
- </tr>
1270
- <tr>
1271
- <th><?php _e('Address:') ?>&nbsp;</th><td><input id="location-address" type="text" name="location_address" value="<?php echo $event['location_address']; ?>" /></td>
1272
- </tr>
1273
- <tr>
1274
- <td colspan='2'>
1275
- <p><?php _e('The address of the location where the event takes place. Example: 21, Dominick Street','dbem') ?> </p>
1276
- </td>
1277
- </tr>
1278
- <tr>
1279
- <th><?php _e('Town:') ?>&nbsp;</th><td> <input id="location-town" type="text" name="location_town" value="<?php echo $event['location_town']?>" /></td>
1280
- </tr>
1281
- <tr>
1282
- <td colspan='2'>
1283
- <p><?php _e('The town where the location is located. If you\'re using the Google Map integration and want to avoid geotagging ambiguities include the country in the town field. Example: Verona, Italy.', 'dbem') ?></p>
1284
- </td>
1285
- </tr>
1286
- </table>
1287
- </div>
1288
- </div>
1289
-
1290
-
1291
-
1292
-
1293
-
1294
- <div id="event_notes" class="postbox">
1295
- <h3><?php _e('Details','dbem'); ?></h3>
1296
- <div class="inside">
1297
- <textarea name="event_notes" rows="8" cols="60"><?php echo $event[$pref.'notes']; ?></textarea><br/>
1298
- <?php _e('Details about the event', 'dbem') ?>
1299
- </div>
1300
  </div>
1301
  </div>
1302
- <p class="submit"><input type="submit" name="events_update" value="<?php _e('Submit Event','dbem'); ?> &raquo;" /></p>
1303
  </div>
1304
-
1305
- </div>
1306
- </div>
1307
- </form>
1308
- <?php
1309
- }
1310
 
1311
  function dbem_validate_event($event) {
1312
  // Only for emergencies, when JS is disabled
1313
  // TODO make it fully functional without JS
1314
  global $required_fields;
1315
- $errors = Array();
1316
- foreach ($required_fields as $field) {
1317
- if ($event[$field] == "" ) {
1318
- $errors[] = $field;
1319
- }
1320
  }
1321
  $error_message = "";
1322
- if (count($errors) >0)
1323
- $error_message = __('Missing fields: ').implode(", ", $errors).". ";
1324
- if($_POST['repeated_event'] == "1" && $_POST['event_end_date'] == "")
1325
- $error_message .= __('Since the event is repeated, you must specify an event date.','dbem');
1326
  if ($error_message != "")
1327
- return $error_message;
1328
- else
1329
  return "OK";
1330
-
1331
  }
1332
 
1333
  function _dbem_is_date_valid($date) {
1334
- $year = substr($date,0,4);
1335
- $month = substr($date,5,2);
1336
- $day = substr($date,8,2);
1337
- return (checkdate($month, $day, $year));
1338
- }
1339
- function _dbem_is_time_valid($time) {
1340
- $result = preg_match ("/([01]\d|2[0-3])(:[0-5]\d)/", $time);
1341
-
1342
  return ($result);
1343
  }
1344
  // Enqueing jQuery script to make sure it's loaded
1345
- function dbem_enque_scripts(){
1346
- wp_enqueue_script( 'jquery' );
1347
  // wp_enqueue_script('datepicker','/wp-content/plugins/events-manager/jquery-ui-datepicker/jquery-ui-personalized-1.6b.js', array('jquery') );
1348
  }
1349
- add_action ('template_redirect', 'dbem_enque_scripts');
1350
 
1351
  function url_exists($url) {
1352
-
1353
- if ((strpos($url, "http")) === false) $url = "http://" . $url;
1354
- // FIXME ripristina la linea seguente e VEDI DI SISTEMARE!!!!
 
1355
  // if (is_array(@get_headers($url))) {
1356
  if (true)
1357
- return true;
1358
- else
1359
  return false;
1360
  }
1361
 
1362
  // General script to make sure hidden fields are shown when containing data
1363
- function dbem_admin_general_script(){ ?>
1364
- <script src="<?php bloginfo('url');?>/wp-content/plugins/events-manager/dbem.js" type="text/javascript"></script>
1365
- <script src="<?php bloginfo('url');?>/wp-content/plugins/events-manager/js/jquery-ui-datepicker/ui.datepicker.js" type="text/javascript"></script>
1366
- <script src="<?php bloginfo('url');?>/wp-content/plugins/events-manager/js/timeentry/jquery.timeentry.js" type="text/javascript"></script>
1367
- <?php
1368
-
 
 
 
 
 
 
 
 
 
 
 
 
 
1369
  // Check if the locale is there and loads it
1370
- $locale_code = substr(get_locale(), 0, 2);
1371
-
1372
- $show24Hours = 'true';
1373
- // Setting 12 hours format for those countries using it
1374
- if(preg_match("/en|sk|zh|us|uk/",$locale_code))
1375
- $show24Hours = 'false';
1376
-
1377
-
1378
- $locale_file = get_bloginfo('url')."/wp-content/plugins/events-manager/js/jquery-ui-datepicker/i18n/ui.datepicker-$locale_code.js";
1379
- if(url_exists($locale_file)) { ?>
1380
- <script src="<?php bloginfo('url');?>/wp-content/plugins/events-manager/js/jquery-ui-datepicker/i18n/ui.datepicker-<?php echo $locale_code;?>.js" type="text/javascript"></script>
1381
- <?php } ?>
1382
 
 
 
 
 
1383
 
1384
- <style type='text/css' media='all'>
1385
- @import "<?php bloginfo('url');?>/wp-content/plugins/events-manager/js/jquery-ui-datepicker/ui.datepicker.css";
1386
- </style>
1387
- <script type="text/javascript">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1388
  //<![CDATA[
1389
  // TODO: make more general, to support also latitude and longitude (when added)
1390
  $j=jQuery.noConflict();
@@ -1406,14 +1721,19 @@ function updateIntervalSelectors () {
1406
  function updateShowHideRecurrence () {
1407
  if($j('input#event-recurrence').attr("checked")) {
1408
  $j("#event_recurrence_pattern").fadeIn();
1409
- $j("input#localised-end-date").fadeIn();
 
 
 
1410
  $j("#event-date-explanation").hide();
1411
  $j("#recurrence-dates-explanation").show();
1412
  $j("h3#recurrence-dates-title").show();
1413
  $j("h3#event-date-title").hide();
1414
  } else {
1415
  $j("#event_recurrence_pattern").hide();
1416
- $j("input#localised-end-date").hide();
 
 
1417
  $j("#recurrence-dates-explanation").hide();
1418
  $j("#event-date-explanation").show();
1419
  $j("h3#recurrence-dates-title").hide();
@@ -1434,6 +1754,9 @@ $j(document).ready( function() {
1434
 
1435
  $j("#recurrence-dates-explanation").hide();
1436
  $j("#localised-date").show();
 
 
 
1437
 
1438
  $j("#date-to-submit").hide();
1439
  $j("#end-date-to-submit").hide();
@@ -1451,8 +1774,12 @@ $j(document).ready( function() {
1451
 
1452
 
1453
 
1454
- $j("#start-time").timeEntry({spinnerImage: '', show24Hours: <?php echo $show24Hours;?> });
1455
- $j("#end-time").timeEntry({spinnerImage: '', show24Hours: <?php echo $show24Hours;?>});
 
 
 
 
1456
 
1457
 
1458
 
@@ -1513,7 +1840,12 @@ $j(document).ready( function() {
1513
  errors = "";
1514
  var recurring = $j("input[@name=repeated_event]:checked").val();
1515
  requiredFields= new Array('event_name', 'localised_event_date', 'location_name','location_address','location_town');
1516
- var localisedRequiredFields = {'event_name':"<?php _e('Name','dbem')?>", 'localised_event_date':"<?php _e('Date','dbem')?>", 'location_name':"<?php _e('Location','dbem')?>",'location_address':"<?php _e('Address','dbem')?>",'location_town':"<?php _e('Town','dbem')?>"};
 
 
 
 
 
1517
 
1518
  missingFields = new Array;
1519
  for (var i in requiredFields) {
@@ -1530,10 +1862,12 @@ $j(document).ready( function() {
1530
  // alert('ciao ' + recurring+ " end: " + $j("input[@name=localised_event_end_date]").val());
1531
  if (missingFields.length > 0) {
1532
 
1533
- errors = "<?php echo _e('Some required fields are missing:','dbem' )?> " + missingFields.join(", ") + ".\n";
 
1534
  }
1535
  if(recurring && $j("input[@name=localised_event_end_date]").val() == "") {
1536
- errors = errors + "<?php _e('Since the event is repeated, you must specify an end date','dbem')?>.";
 
1537
  $j("input[@name=localised_event_end_date]").css('border','2px solid red');
1538
  } else {
1539
  $j("input[@name=localised_event_end_date]").css('border','1px solid #DFDFDF');
@@ -1551,42 +1885,43 @@ $j(document).ready( function() {
1551
  });
1552
  //]]>
1553
  </script>
1554
-
1555
- <?php
1556
- }
1557
- add_action ('admin_head', 'dbem_admin_general_script');
1558
-
1559
-
1560
 
 
 
 
1561
 
1562
- function dbem_admin_map_script() {
1563
- if ((isset($_REQUEST['event_id']) && $_REQUEST['event_id'] != '') || (isset($_REQUEST['page']) && $_REQUEST['page'] == 'locations') || (isset($_REQUEST['page']) && $_REQUEST['page'] == 'new_event') || (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit_recurrence') ) {
1564
- if (!(isset($_REQUEST['action']) && $_REQUEST['action'] == 'dbem_delete')) {
1565
  // single event page
1566
 
1567
-
1568
- $event_ID=$_REQUEST['event_id'];
1569
- $event = dbem_get_event($event_ID);
1570
 
1571
- if ($event['location_town'] != '' || (isset($_REQUEST['page']) && $_REQUEST['page'] = 'locations')) {
1572
- $gmap_key = get_option('dbem_gmap_key');
1573
- if($event['location_address'] != "") {
1574
- $search_key = $event['location_address'].", ".$event['location_town'];
1575
  } else {
1576
- $search_key = $event['location_name'].", ".$event['location_town'];
1577
  }
1578
-
1579
- ?>
1580
- <style type="text/css">
1581
- /* div#location_town, div#location_address, div#location_name {
1582
  width: 480px;
1583
  }
1584
  table.form-table {
1585
  width: 50%;
1586
  } */
1587
- </style>
1588
- <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?php echo $gmap_key;?>" type="text/javascript"></script>
1589
- <script type="text/javascript">
 
 
 
 
1590
  //<![CDATA[
1591
  $j=jQuery.noConflict();
1592
 
@@ -1602,7 +1937,8 @@ function dbem_admin_map_script() {
1602
  searchKey = location + ", " + town;
1603
  }
1604
 
1605
- var search = "<?php echo $search_key ?>" ;
 
1606
  geocoder.getLatLng(
1607
  searchKey,
1608
  function(point) {
@@ -1666,22 +2002,22 @@ function dbem_admin_map_script() {
1666
  });
1667
  //]]>
1668
  </script>
1669
- <?php
1670
- }
1671
  }
1672
- }
1673
  }
1674
- $gmap_is_active = get_option('dbem_gmap_is_active');
1675
  if ($gmap_is_active) {
1676
- add_action ('admin_head', 'dbem_admin_map_script');
1677
-
1678
  }
1679
 
1680
  // Script to validate map options
1681
- function dbem_admin_options_script() {
1682
- if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'events-manager-options') {
1683
- ?>
1684
- <script type="text/javascript">
1685
  //<![CDATA[
1686
  $j=jQuery.noConflict();
1687
 
@@ -1692,7 +2028,9 @@ function dbem_admin_options_script() {
1692
  var gmap_is_active = $j("input[@name=dbem_gmap_is_active]:checked").val();
1693
  var gmap_key = $j("input[@name=dbem_gmap_key]").val();
1694
  if(gmap_is_active == '1' && (gmap_key == '')){
1695
- alert("<?php _e('You cannot enable Google Maps integration without setting an appropriate API key.');?>");
 
 
1696
  $j("input[@name='dbem_gmap_is_active']:nth(1)").attr("checked","checked");
1697
 
1698
  return false;
@@ -1709,188 +2047,168 @@ function dbem_admin_options_script() {
1709
 
1710
  //]]>
1711
  </script>
 
 
1712
 
1713
- <?php
1714
-
1715
  }
1716
-
1717
  }
1718
- add_action ('admin_head', 'dbem_admin_options_script');
1719
 
1720
- function dbem_rss_link($justurl=0, $echo=1, $text="RSS") {
1721
- if(strpos($justurl, "=")) {
1722
  // allows the use of arguments without breaking the legacy code
1723
- $defaults = array(
1724
- 'justurl' => 0,
1725
- 'echo' => 1,
1726
- 'text' => 'RSS',
1727
- );
1728
-
1729
- $r = wp_parse_args( $justurl, $defaults );
1730
- extract( $r, EXTR_SKIP );
1731
- $justurl = $r['justurl'];
1732
- $echo = $r['echo'];
1733
- $text = $r['text'];
1734
  }
1735
- if ($text == '')
1736
  $text = "RSS";
1737
- $rss_title = get_option('dbem_events_page_title');
1738
- $url = get_bloginfo('url')."/?dbem_rss=main";
1739
  $link = "<a href='$url'>$text</a>";
1740
-
1741
  if ($justurl)
1742
- $result = $url;
1743
  else
1744
  $result = $link;
1745
- if($echo)
1746
  echo $result;
1747
  else
1748
  return $result;
1749
- }
1750
-
1751
- function dbem_rss_link_shortcode($atts) {
1752
- extract(shortcode_atts(array(
1753
- 'justurl' => 0,
1754
- 'text' => 'RSS',
1755
- ), $atts));
1756
- $result = dbem_rss_link("justurl=$justurl&echo=0&text=$text") ;
1757
- return $result;
1758
  }
1759
- add_shortcode('events_rss_link', 'dbem_rss_link_shortcode');
1760
-
1761
 
 
 
 
 
 
 
1762
 
1763
  function dbem_rss() {
1764
- if (isset($_REQUEST['dbem_rss']) && $_REQUEST['dbem_rss'] == 'main') {
1765
- header("Content-type: text/xml");
1766
  echo "<?xml version='1.0'?>\n";
1767
 
1768
- $events_page_id = get_option('dbem_events_page');
1769
- $events_page_link = get_permalink($events_page_id);
1770
- if (stristr($events_page_link, "?"))
1771
- $joiner = "&amp;";
1772
  else
1773
  $joiner = "?";
1774
 
1775
-
1776
  ?>
1777
- <rss version="2.0">
1778
- <channel>
1779
- <title><?php echo get_option('dbem_rss_main_title');?></title>
1780
- <link><?php echo $events_page_link; ?></link>
1781
- <description><?php echo get_option('dbem_rss_main_description');?></description>
1782
- <docs>http://blogs.law.harvard.edu/tech/rss</docs>
1783
- <generator>Weblog Editor 2.0</generator>
1784
- <?php
1785
- $title_format = get_option('dbem_rss_title_format');
1786
- $description_format = str_replace(">","&gt;",str_replace("<","&lt;",get_option('dbem_rss_description_format')));
1787
- $events = dbem_get_events(5);
1788
- foreach ($events as $event) {
1789
- $title = dbem_replace_placeholders($title_format, $event, "rss");
1790
- $description = dbem_replace_placeholders($description_format, $event, "rss");
1791
- echo "<item>";
1792
- echo "<title>$title</title>\n";
1793
- echo "<link>$events_page_link".$joiner."event_id=".$event['event_id']."</link>\n ";
1794
- echo "<description>$description </description>\n";
1795
- echo "</item>";
1796
- }
1797
- ?>
 
 
 
 
 
 
 
 
 
 
1798
 
1799
- </channel>
1800
- </rss>
1801
-
1802
- <?php
1803
- die();
1804
  }
1805
  }
1806
- add_action('init','dbem_rss');
1807
  function substitute_rss($data) {
1808
- if (isset($_REQUEST['event_id']))
1809
- return get_bloginfo('url')."/?dbem_rss=main";
1810
  else
1811
  return $data;
1812
- }
1813
- function dbem_general_css() {
1814
- $base_url = get_bloginfo('url');
1815
  echo "<link rel='stylesheet' href='$base_url/wp-content/plugins/events-manager/events_manager.css' type='text/css'/>";
1816
-
1817
  }
1818
- add_action('wp_head','dbem_general_css');
1819
- add_action('admin_head','dbem_general_css');
1820
  //add_filter('feed_link','substitute_rss')
1821
-
 
1822
  // TODO roba da mettere nell'ordine giusto
1823
  function dbem_delete_event($event_id) {
1824
- global $wpdb;
1825
- $table_name = $wpdb->prefix.EVENTS_TBNAME;
1826
- $sql = "DELETE FROM $table_name WHERE event_id = '$event_id';";
1827
- $wpdb->query($sql);
1828
 
1829
  }
1830
- add_filter('favorite_actions', 'dbem_favorite_menu');
1831
-
1832
  function dbem_favorite_menu($actions) {
1833
- // add quick link to our favorite plugin
1834
- $actions['admin.php?page=new_event'] = array(__('Add an event', 'dbem'), MIN_CAPABILITY);
1835
- return $actions;
1836
- }
1837
 
1838
  ////////////////////////////////////
1839
  // WP 2.7 options registration
1840
  function dbem_options_register() {
1841
- $options = array(
1842
- 'dbem_events_page',
1843
- 'dbem_display_calendar_in_events_page',
1844
- 'dbem_use_event_end',
1845
- 'dbem_event_list_item_format',
1846
- 'dbem_event_page_title_format',
1847
- 'dbem_single_event_format',
1848
- 'dbem_list_events_page',
1849
- 'dbem_events_page_title',
1850
- 'dbem_no_events_message',
1851
- 'dbem_location_page_title_format','dbem_location_baloon_format',
1852
- 'dbem_single_location_format',
1853
- 'dbem_location_event_list_item_format',
1854
- 'dbem_location_no_events_message',
1855
- 'dbem_gmap_is_active',
1856
- 'dbem_rss_main_title',
1857
- 'dbem_rss_main_description',
1858
- 'dbem_rss_title_format',
1859
- 'dbem_rss_description_format',
1860
- 'dbem_gmap_key',
1861
- 'dbem_map_text_format',
1862
- 'dbem_rsvp_mail_notify_is_active',
1863
- 'dbem_contactperson_email_body',
1864
- 'dbem_respondent_email_body',
1865
- 'dbem_mail_sender_name',
1866
- 'dbem_smtp_username',
1867
- 'dbem_smtp_password',
1868
- 'dbem_default_contact_person',
1869
- 'dbem_mail_sender_address',
1870
- 'dbem_mail_receiver_address',
1871
- 'dbem_smtp_host',
1872
- 'dbem_rsvp_mail_send_method',
1873
- 'dbem_rsvp_mail_port',
1874
- 'dbem_rsvp_mail_SMTPAuth',
1875
- 'dbem_image_max_width',
1876
- 'dbem_image_max_height',
1877
- 'dbem_image_max_size',
1878
- );
1879
- foreach($options as $opt) {
1880
- register_setting('dbem-options',$opt,'');
1881
- }
1882
 
1883
  }
1884
- add_action( 'admin_init', 'dbem_options_register' );
1885
 
1886
- function dbem_alert_events_page() {
1887
- $events_page_id = get_option('dbem_events_page');
1888
- if(strpos($_SERVER['SCRIPT_NAME'], 'page.php') && isset($_GET['action']) && $_GET['action'] == 'edit' && isset($_GET['post']) && $_GET['post'] == "$events_page_id" ) {
1889
- $message = sprintf(__("This page corresponds to <strong>Events Manager</strong> events page. Its content will be overriden by <strong>Events Manager</strong>. If you want to display your content, you can can assign another page to <strong>Events Manager</strong> in the the <a href='%s'>Settings</a>. ", 'dbem'), 'admin.php?page=events-manager-options');
1890
  $notice = "<div class='error'><p>$message</p></div>";
1891
  echo $notice;
1892
  }
1893
 
1894
- }
1895
- add_action('admin_notices', 'dbem_alert_events_page');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1896
  ?>
1
  <?php
2
 
 
3
  function dbem_new_event_page() {
 
 
 
4
 
5
+ $title = __ ( "Insert New Event", 'dbem' );
6
+ dbem_event_form ( $event, $title, $element );
7
+
8
  }
9
 
10
+ function dbem_events_subpanel() {
11
+ global $wpdb;
12
+ $action = $_GET ['action'];
13
+ $action2 = $_GET ['action2'];
14
+ $event_ID = $_GET ['event_id'];
15
+ $recurrence_ID = $_GET ['recurrence_id'];
16
+ $scope = $_GET ['scope'];
17
+ $offset = $_GET ['offset'];
18
+ $order = $_GET ['order'];
19
+ $selectedEvents = $_GET ['events'];
20
 
21
  // Disable Hello to new user if requested
22
+ if (isset ( $_GET ['disable_hello_to_user'] ) && $_GET ['disable_hello_to_user'] == 'true')
23
+ update_option ( 'dbem_hello_to_user', 0 );
24
 
25
  if ($order == "")
26
+ $order = "ASC";
27
+ if ($offset == "")
28
+ $offset = "0";
29
+ $event_table_name = $wpdb->prefix . EVENTS_TBNAME;
30
  // Debug code, to make sure I get the correct page
31
+
 
 
32
 
33
  // DELETE action
34
  if ($action == 'deleteEvents') {
35
+ // $sql="DELETE FROM ".$event_table_name." WHERE event_id='"."$event_ID"."'";
36
+
37
+
38
  // TODO eventual error if ID in non-existant
39
  //$wpdb->query($sql);
40
+ foreach ( $selectedEvents as $event_ID ) {
41
+ dbem_delete_event ( $event_ID );
42
  }
43
+
44
+ $events = dbem_get_events ( "", "future" );
45
+ dbem_events_table ( $events, 10, "Future events" );
46
  }
47
  // UPDATE or CREATE action
48
  if ($action == 'update_event' || $action == 'update_recurrence') {
49
+
50
+ $event = array ();
51
+ $location = array ();
52
+
53
+ $event ['event_name'] = stripslashes ( $_POST [event_name] );
54
  // Set event end time to event time if not valid
55
  // if (!_dbem_is_date_valid($event['event_end_date']))
56
  // $event['event_end_date'] = $event['event-date'];
57
+ $event ['event_start_date'] = $_POST [event_date];
58
+ $event ['event_end_date'] = $_POST [event_end_date];
59
  //$event['event_start_time'] = $_POST[event_hh].":".$_POST[event_mm].":00";
60
  //$event['event_end_time'] = $_POST[event_end_hh].":".$_POST[event_end_mm].":00";
61
+ $event ['event_start_time'] = date ( "G:i:00", strtotime ( $_POST ['event_start_time'] ) );
62
+ $event ['event_end_time'] = date ( "G:i:00", strtotime ( $_POST ['event_end_time'] ) );
63
+ $recurrence ['recurrence_name'] = $event ['event_name'];
64
+ $recurrence ['recurrence_start_date'] = $event ['event_start_date'];
65
+ $recurrence ['recurrence_end_date'] = $event ['event_end_date'];
66
+ $recurrence ['recurrence_start_time'] = $event ['event_start_time'];
67
+ $recurrence ['recurrence_end_time'] = $event ['event_end_time'];
68
+ $recurrence ['recurrence_id'] = $_POST [recurrence_id];
69
+ $recurrence ['recurrence_freq'] = $_POST [recurrence_freq];
70
+ $recurrence ['recurrence_freq'] == 'weekly' ? $recurrence [recurrence_byday] = implode ( ",", $_POST ['recurrence_bydays'] ) : $recurrence ['recurrence_byday'] = $_POST [recurrence_byday];
71
+ $_POST ['recurrence_interval'] == "" ? $recurrence ['recurrence_interval'] = 1 : $recurrence ['recurrence_interval'] = $_POST ['recurrence_interval'];
72
+ $recurrence ['recurrence_byweekno'] = $_POST [recurrence_byweekno];
 
 
73
 
74
+ $event ['event_rsvp'] = $_POST ['event_rsvp'];
75
+ $event ['event_seats'] = $_POST ['event_seats'];
76
 
77
+ if (isset ( $_POST ['event_contactperson_id'] ) && $_POST ['event_contactperson_id'] != '' && $_POST ['event_contactperson_id'] != '-1') {
 
 
 
78
 
79
+ $event ['event_contactperson_id'] = $_POST ['event_contactperson_id'];
80
+ $recurrence ['event_contactperson_id'] = $_POST ['event_contactperson_id'];
81
  }
 
 
 
82
 
83
+ if (! _dbem_is_time_valid ( $event_end_time ))
84
+ $event_end_time = $event_time;
 
 
 
 
 
 
 
85
 
86
+ $location ['location_name'] = $_POST [location_name];
87
+ $location ['location_address'] = $_POST [location_address];
88
+ $location ['location_town'] = $_POST [location_town];
89
+ $location ['location_latitude'] = $_POST [location_latitude];
90
+ $location ['location_longitude'] = $_POST [location_longitude];
91
+ $location ['location_description'] = "";
92
+ /* Marcus Begin Edit */
93
+ //switched to WP TinyMCE field
94
+ //$event ['event_notes'] = stripslashes ( $_POST [event_notes] );
95
+ $event ['event_notes'] = stripslashes ( $_POST ['content'] );
96
+ /* Marcus End Edit */
97
+ $recurrence ['recurrence_notes'] = $event ['event_notes'];
98
+ $validation_result = dbem_validate_event ( $event );
99
 
100
+ if ($validation_result == "OK") {
101
  // validation successful
102
+
103
+ $related_location = dbem_get_identical_location ( $location );
104
+ // print_r($related_location);
105
+ if ($related_location) {
106
+ $event ['location_id'] = $related_location ['location_id'];
107
+ $recurrence ['location_id'] = $related_location ['location_id'];
108
+ } else {
 
109
 
110
+ $new_location = dbem_insert_location ( $location );
111
+ $event ['location_id'] = $new_location ['location_id'];
112
+ $recurrence ['location_id'] = $new_location ['location_id'];
113
  //print_r($new_location);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
 
 
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  }
117
+
118
+ if (! $event_ID && ! $recurrence_ID) {
119
+ // there isn't anything
120
+ if ($_POST ['repeated_event']) {
121
+
122
+ //insert new recurrence
123
+ dbem_insert_recurrent_event ( $event, $recurrence );
124
+ $feedback_message = __ ( 'New recurrent event inserted!', 'dbem' );
125
  } else {
126
+ // INSERT new event
127
+ $wpdb->insert ( $event_table_name, $event );
128
+ $feedback_message = __ ( 'New event successfully inserted!', 'dbem' );
129
  }
130
+ } else {
131
+ // something exists
132
+ if ($recurrence_ID) {
133
+ // UPDATE old recurrence
134
+ $recurrence ['recurrence_id'] = $recurrence_ID;
135
+ //print_r($recurrence);
136
+ if (dbem_update_recurrence ( $recurrence ))
137
+ $feedback_message = __ ( 'Recurrence updated!', 'dbem' );
138
+ else
139
+ $feedback_message = __ ( 'Something went wrong with the recurrence update...', 'dbem' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
 
141
+ } else {
142
+ // UPDATE old event
143
+ // unlink from recurrence in case it was generated by one
144
+ $event ['recurrence_id'] = null;
145
+ $where ['event_id'] = $event_ID;
146
+ $wpdb->update ( $event_table_name, $event, $where );
147
+ $feedback_message = "'" . $event ['event_name'] . "' " . __ ( 'updated', 'dbem' ) . "!";
148
+ }
 
 
 
149
  }
 
 
150
 
151
+ /* Marcus Begin Edit */
152
+ //Save the category if selected
153
+ if( is_numeric($_POST['event_category_id']) ){
154
+ $insert_id = (! $event_ID && ! $recurrence_ID) ? $wpdb->insert_id : $event_ID;
155
+ $wpdb->update ( $event_table_name, array("event_category_id" => $_POST['event_category_id']), array('event_id' => $insert_id) );
156
+ }
157
+ /* Marcus End Edit */
158
 
159
+ //$wpdb->query($sql);
160
+ echo "<div id='message' class='updated fade'>
161
+ <p>$feedback_message</p>
162
+ </div>";
163
+ $events = dbem_get_events ( "", "future" );
164
+ dbem_events_table ( $events, 10, "Future events" );
165
+ } else {
166
+ // validation unsuccessful
167
+
168
+ echo "<div id='message' class='error '>
169
+ <p>" . __ ( "Ach, there's a problem here:", "dbem" ) . " $validation_result</p>
170
+ </div>";
171
+ dbem_event_form ( $event, "Edit event $event_ID", $event_ID );
172
+
173
+ }
174
+ }
175
+ if ($action == 'edit_event') {
176
+ if (! $event_ID) {
177
+ $title = __ ( "Insert New Event", 'dbem' );
178
+ } else {
179
+ $event = dbem_get_event ( $event_ID );
180
+ $title = __ ( "Edit Event", 'dbem' ) . " '" . $event ['event_name'] . "'";
181
+ }
182
+
183
+ //$event=$wpdb->get_row($sql, ARRAY_A);
184
+ // Enter new events and updates old ones
185
+ // DEBUG: echo"Nome: $event->event_name";
186
+
187
+
188
+ dbem_event_form ( $event, $title, $event_ID );
189
+
190
+ }
191
+ /* Marcus Begin Edit */
192
+ //Add duplicate event if requested
193
+ if ($action == 'duplicate_event') {
194
+ dbem_duplicate_event ( $event_ID );
195
+ }
196
+ /* Marcus End Edit */
197
+ if ($action == 'edit_recurrence') {
198
+
199
+ $event_ID = $_GET ['recurrence_id'];
200
+ $recurrence = dbem_get_recurrence ( $event_ID );
201
+ $title = __ ( "Reschedule", 'dbem' ) . " '" . $recurrence ['recurrence_name'] . "'";
202
+ dbem_event_form ( $recurrence, $title, $event_ID );
203
+
204
+ }
205
+
206
+ if ($action == 'update_recurrence') {
207
+ //print_r($recurrence);
208
+ //die('update recurrence!');
209
  }
210
 
211
+ if ($action == "-1" || $action == "") {
212
+ // No action, only showing the events list
213
+
214
+
215
+ switch ($scope) {
216
+ case "past" :
217
+ $title = __ ( 'Past Events', 'dbem' );
218
+ break;
219
+ case "all" :
220
+ $title = __ ( 'All Events', 'dbem' );
221
+ break;
222
+ default :
223
+ $title = __ ( 'Future Events', 'dbem' );
224
+ $scope = "future";
225
+ }
226
+ $limit = 20;
227
+ $events = dbem_get_events ( $limit, $scope, $order, $offset );
228
+
229
+ dbem_events_table ( $events, $limit, $title );
230
+
231
+ }
232
+
233
+ }
234
  // array of all pages, bypasses the filter I set up :)
235
  function dbem_get_all_pages() {
236
  global $wpdb;
237
+ $query = "SELECT id, post_title FROM " . $wpdb->prefix . "posts WHERE post_type = 'page';";
238
+ $pages = $wpdb->get_results ( $query, ARRAY_A );
239
+ $output = array ();
240
+ foreach ( $pages as $page ) {
241
+ $output [$page ['id']] = $page ['post_title'];
242
  }
243
  return $output;
244
  }
245
 
246
  // Function composing the options subpanel
247
  function dbem_options_subpanel() {
248
+ // dbem_options_register();
249
 
250
+
251
+ ?>
252
+ <div class="wrap">
253
+ <div id='icon-options-general' class='icon32'><br />
254
+ </div>
255
+ <h2><?php
256
+ _e ( 'Event Manager Options', 'dbem' );
257
+ ?></h2>
258
+ <form id="dbem_options_form" method="post" action="options.php">
259
+ <h3><?php
260
+ _e ( 'Events page', 'dbem' );
261
+ ?></h3>
262
+ <table class="form-table">
263
+ <?php
264
+ dbem_options_select ( __ ( 'Events page' ), 'dbem_events_page', dbem_get_all_pages (), __ ( 'This option allows you to select which page to use as an events page' ) );
265
+ dbem_options_radio_binary ( __ ( 'Display calendar in events page?', 'dbem' ), 'dbem_display_calendar_in_events_page', __ ( 'This options allows to display the calendar in the events page, instead of the default list. It is recommended not to display both the calendar widget and a calendar page.' ) )?>
266
  </table>
267
+ <h3><?php
268
+ _e ( 'Events format', 'dbem' );
269
+ ?></h3>
270
+ <table class="form-table">
271
+ <?php
272
+ /* Marcus Begin Edit */
273
+ dbem_options_textarea ( __ ( 'Default event list format', 'dbem' ), 'dbem_event_list_item_format', __ ( 'The format of any events in a list.<br/>Insert one or more of the following placeholders: <code>#_NAME</code>, <code>#_LOCATION</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_NOTES</code>.<br/> Use <code>#_LINKEDNAME</code> for the event name with a link to the given event page.<br/> Use <code>#_EVENTPAGEURL</code> to print the event page URL and make your own customised links.<br/> Use <code>#_LOCATIONPAGEURL</code> to print the location page URL and make your own customised links.<br/>To insert date and time values, use <a href="http://www.php.net/manual/en/function.date.php">PHP time format characters</a> with a <code>#</code> symbol before them, i.e. <code>#m</code>, <code>#M</code>, <code>#j</code>, etc.<br/> For the end time, put <code>#@</code> in front of the character, ie. <code>#@h</code>, <code>#@i</code>, etc.<br/> You can also create a date format without prepending <code>#</code> by wrapping it in #_{} or #@_{} (e.g. <code>#_{d/m/Y}</code>). If there is no end date, the value is not shown.<br/> Feel free to use HTML tags as <code>li</code>, <code>br</code> and so on.', 'dbem' ) );
274
+ /* Marcus End Edit */
275
+ dbem_options_input_text ( __ ( 'Single event page title format', 'dbem' ), 'dbem_event_page_title_format', __ ( 'The format of a single event page title. Follow the previous formatting instructions.', 'dbem' ) );
276
+ dbem_options_textarea ( __ ( 'Default single event format', 'dbem' ), 'dbem_single_event_format', __ ( 'The format of a single event page.<br/>Follow the previous formatting instructions. <br/>Use <code>#_MAP</code> to insert a map.<br/>Use <code>#_CONTACTNAME</code>, <code>#_CONTACTEMAIL</code>, <code>#_CONTACTPHONE</code> to insert respectively the name, e-mail address and phone number of the designated contact person. <br/>Use <code>#_ADDBOOKINGFORM</code> to insert a form to allow the user to respond to your events reserving one or more places (RSVP).<br/> Use <code>#_REMOVEBOOKINGFORM</code> to insert a form where users, inserting their name and e-mail address, can remove their bookings.', 'dbem' ) );
277
+ dbem_options_radio_binary ( __ ( 'Show events page in lists?', 'dbem' ), 'dbem_list_events_page', __ ( 'Check this option if you want the events page to appear together with other pages in pages lists.', 'dbem' ) );
278
+ dbem_options_input_text ( __ ( 'Events page title', 'dbem' ), 'dbem_events_page_title', __ ( 'The title on the multiple events page.', 'dbem' ) );
279
+ dbem_options_input_text ( __ ( 'No events message', 'dbem' ), 'dbem_no_events_message', __ ( 'The message displayed when no events are available.', 'dbem' ) );
280
+ dbem_options_textarea ( __ ( 'Map text format', 'dbem' ), 'dbem_map_text_format', __ ( 'The format the text appearing in the event page map cloud.<br/>Follow the previous formatting instructions.', 'dbem' ) );
281
+ ?>
282
+ </table>
283
+
284
+ <h3><?php
285
+ _e ( 'Locations format', 'dbem' );
286
+ ?></h3>
287
+ <table class="form-table"><?php
288
+ dbem_options_input_text ( __ ( 'Single location page title format', 'dbem' ), 'dbem_location_page_title_format', __ ( 'The format of a single location page title.<br/>Follow the previous formatting instructions.', 'dbem' ) );
289
+ dbem_options_textarea ( __ ( 'Default single location page format', 'dbem' ), 'dbem_single_location_format', __ ( 'The format of a single location page.<br/>Insert one or more of the following placeholders: <code>#_NAME</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_DESCRIPTION</code>.<br/> Use <code>#_MAP</code> to display a map of the event location, and <code>#_IMAGE</code> to display an image of the location.<br/> Use <code>#_NEXTEVENTS</code> to insert a list of the upcoming events, <code>#_PASTEVENTS</code> for a list of past events, <code>#_ALLEVENTS</code> for a list of all events taking place in this location.', 'dbem' ) );
290
+ dbem_options_textarea ( __ ( 'Default location baloon format', 'dbem' ), 'dbem_location_baloon_format', __ ( 'The format of of the text appearing in the baloon describing the location in the map.<br/>Insert one or more of the following placeholders: <code>#_NAME</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_DESCRIPTION</code> or <code>#_IMAGE</code>.', 'dbem' ) );
291
+ dbem_options_textarea ( __ ( 'Default location event list format', 'dbem' ), 'dbem_location_event_list_item_format', __ ( 'The format of the events the list inserted in the location page through the <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> and <code>#_ALLEVENTS</code> element. <br/> Follow the events formatting instructions', 'dbem' ) );
292
+ dbem_options_textarea ( __ ( 'Default no events message', 'dbem' ), 'dbem_location_no_events_message', __ ( 'The message to be displayed in the list generated by <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> and <code>#_ALLEVENTS</code> when no events are available.', 'dbem' ) );
293
+
294
+ ?>
295
  </table>
296
+
297
+ <h3><?php
298
+ _e ( 'RSS feed format', 'dbem' );
299
+ ?></h3>
300
+ <table class="form-table"><?php
301
+
302
+ dbem_options_input_text ( __ ( 'RSS main title', 'dbem' ), 'dbem_rss_main_title', __ ( 'The main title of your RSS events feed.', 'dbem' ) );
303
+ dbem_options_input_text ( __ ( 'RSS main description', 'dbem' ), 'dbem_rss_main_description', __ ( 'The main description of your RSS events feed.', 'dbem' ) );
304
+ dbem_options_input_text ( __ ( 'RSS title format', 'dbem' ), 'dbem_rss_title_format', __ ( 'The format of the title of each item in the events RSS feed.', 'dbem' ) );
305
+ dbem_options_input_text ( __ ( 'RSS description format', 'dbem' ), 'dbem_rss_description_format', __ ( 'The format of the description of each item in the events RSS feed. Follow the previous formatting instructions.', 'dbem' ) );
306
+ ?>
307
  </table>
308
+
309
+ <h3><?php
310
+ _e ( 'Maps and geotagging', 'dbem' );
311
+ ?></h3>
312
+ <table class='form-table'>
313
+ <?php
314
+ $gmap_is_active = get_option ( 'dbem_gmap_is_active' );
315
+ ?>
316
 
317
  <tr valign="top">
318
+ <th scope="row"><?php
319
+ _e ( 'Enable Google Maps integration?', 'dbem' );
320
+ ?></th>
321
+ <td><input id="dbem_gmap_is_active_yes" name="dbem_gmap_is_active"
322
+ type="radio" value="1"
323
+ <?php
324
+ if ($gmap_is_active)
325
+ echo "checked='checked'";
326
+ ?> /><?php
327
+ _e ( 'Yes' );
328
+ ?> <br />
329
+ <input name="dbem_gmap_is_active" type="radio" value="0"
330
+ <?php
331
+ if (! $gmap_is_active)
332
+ echo "checked='checked'";
333
+ ?> /> <?php
334
+ _e ( 'No' );
335
+ ?> <br />
336
+ <?php
337
+ _e ( 'Check this option to enable Goggle Map integration.', 'dbem' )?>
338
  </td>
339
+ </tr>
340
+ <?php
341
+ dbem_options_input_text ( __ ( 'Google Maps API Key', 'dbem' ), 'dbem_gmap_key', sprintf ( __ ( "To display Google Maps you need a Google Maps API key. Don't worry, it's free, you can get one <a href='%s'>here</a>.", 'dbem' ), 'http://code.google.com/apis/maps/signup.html' ) );
342
+ ?>
343
  </table>
344
+
345
+ <h3><?php
346
+ _e ( 'RSVP and bookings', 'dbem' );
347
+ ?></h3>
348
+ <table class='form-table'>
349
  <?php
350
+ dbem_options_select ( __ ( 'Default contact person', 'dbem' ), 'dbem_default_contact_person', dbem_get_indexed_users (), __ ( 'Select the default contact person. This user will be employed whenever a contact person is not explicitly specified for an event', 'dbem' ) );
351
+ dbem_options_radio_binary ( __ ( 'Enable the RSVP e-mail notifications?', 'dbem' ), 'dbem_rsvp_mail_notify_is_active', __ ( 'Check this option if you want to receive an email when someone books places for your events.', 'dbem' ) );
352
+ dbem_options_textarea ( __ ( 'Contact person email format', 'dbem' ), 'dbem_contactperson_email_body', __ ( 'The format or the email which will be sent to the contact person. Follow the events formatting instructions. <br/>Use <code>#_RESPNAME</code>, <code>#_RESPEMAIL</code> and <code>#_RESPPHONE</code> to display respectively the name, e-mail, address and phone of the respondent.<br/>Use <code>#_SPACES</code> to display the number of spaces reserved by the respondent.<br/> Use <code>#_BOOKEDSEATS</code> and <code>#_AVAILABLESEATS</code> to display respectively the number of booked and available seats.', 'dbem' ) );
353
+ dbem_options_textarea ( __ ( 'Contact person email format', 'dbem' ), 'dbem_respondent_email_body', __ ( 'The format or the email which will be sent to reposdent. Follow the events formatting instructions. <br/>Use <code>#_RESPNAME</code> to display the name of the respondent.<br/>Use <code>#_CONTACTNAME</code> and <code>#_CONTACTMAIL</code> a to display respectively the name and e-mail of the contact person.<br/>Use <code>#_SPACES</code> to display the number of spaces reserved by the respondent.', 'dbem' ) );
354
+ dbem_options_input_text ( __ ( 'Notification sender name', 'dbem' ), 'dbem_mail_sender_name', __ ( "Insert the display name of the notification sender.", 'dbem' ) );
355
+ dbem_options_input_text ( __ ( 'Notification sender address', 'dbem' ), 'dbem_mail_sender_address', __ ( "Insert the address of the notification sender. It must corresponds with your gmail account user", 'dbem' ) );
356
+ dbem_options_input_text ( __ ( 'Default notification receiver address', 'dbem' ), 'dbem_mail_receiver_address', __ ( "Insert the address of the receiver of your notifications", 'dbem' ) );
357
+ dbem_options_input_text ( 'Mail sending port', 'dbem_rsvp_mail_port', __ ( "The port through which you e-mail notifications will be sent. Make sure the firewall doesn't block this port", 'dbem' ) );
358
+ dbem_options_select ( __ ( 'Mail sending method', 'dbem' ), 'dbem_rsvp_mail_send_method', array ('smtp' => 'SMTP', 'mail' => __ ( 'PHP mail function', 'dbem' ), 'sendmail' => 'Sendmail', 'qmail' => 'Qmail' ), __ ( 'Select the method to send email notification.', 'dbem' ) );
359
+ dbem_options_radio_binary ( __ ( 'Use SMTP authentication?', 'dbem' ), 'dbem_rsvp_mail_SMTPAuth', __ ( 'SMTP authenticatio is often needed. If you use GMail, make sure to set this parameter to Yes', 'dbem' ) );
360
+ dbem_options_input_text ( 'SMTP host', 'dbem_smtp_host', __ ( "The SMTP host. Usually it corresponds to 'localhost'. If you use GMail, set this value to 'ssl://smtp.gmail.com:465'.", 'dbem' ) );
361
+ dbem_options_input_text ( __ ( 'SMTP username', 'dbem' ), 'dbem_smtp_username', __ ( "Insert the username to be used to access your SMTP server.", 'dbem' ) );
362
+ dbem_options_input_password ( __ ( 'SMTP password', 'dbem' ), "dbem_smtp_password", __ ( "Insert the password to be used to access your SMTP server", 'dbem' ) );
363
+ ?>
364
 
365
 
366
 
367
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
368
 
369
+ <h3><?php
370
+ _e ( 'Images size', 'dbem' );
371
+ ?></h3>
372
+ <table class='form-table'> <?php
373
+ dbem_options_input_text ( __ ( 'Maximum width (px)', 'dbem' ), 'dbem_image_max_width', __ ( 'The maximum allowed width for images uploades', 'dbem' ) );
374
+ dbem_options_input_text ( __ ( 'Maximum height (px)', 'dbem' ), 'dbem_image_max_height', __ ( "The maximum allowed width for images uploaded, in pixels", 'dbem' ) );
375
+ dbem_options_input_text ( __ ( 'Maximum size (bytes)', 'dbem' ), 'dbem_image_max_size', __ ( "The maximum allowed size for images uploaded, in pixels", 'dbem' ) );
376
+ ?>
377
+ </table>
378
 
 
 
379
 
380
 
381
+ <p class="submit"><input type="submit" id="dbem_options_submit"
382
+ name="Submit" value="<?php
383
+ _e ( 'Save Changes' )?>" /></p>
384
 
385
+
386
+ <?php
387
+ settings_fields ( 'dbem-options' );
388
+ ?>
389
+ </form>
390
+ </div>
391
+ <?php
392
+
393
+ }
394
 
395
  //This is the content of the event page
396
  function dbem_events_page_content() {
397
  global $wpdb;
398
+ if (isset ( $_REQUEST ['location_id'] ) && $_REQUEST ['location_id'] |= '') {
399
 
400
+ $location = dbem_get_location ( $_REQUEST ['location_id'] );
401
+ $single_location_format = get_option ( 'dbem_single_location_format' );
402
+ $page_body = dbem_replace_locations_placeholders ( $single_location_format, $location );
403
  return $page_body;
404
 
405
  }
406
+ if (isset ( $_REQUEST ['event_id'] ) && $_REQUEST ['event_id'] != '') {
407
  // single event page
408
+ $event_ID = $_REQUEST ['event_id'];
409
+ $event = dbem_get_event ( $event_ID );
410
+ $single_event_format = get_option ( 'dbem_single_event_format' );
411
+ $page_body = dbem_replace_placeholders ( $single_event_format, $event );
412
+ return $page_body;
413
+ } elseif (isset ( $_REQUEST ['calendar_day'] ) && $_REQUEST ['calendar_day'] != '') {
414
+
415
+ $date = $_REQUEST ['calendar_day'];
416
+ $events_N = dbem_events_count_for ( $date );
417
+ // $_GET['scope'] ? $scope = $_GET['scope']: $scope = "future";
418
+ // $stored_format = get_option('dbem_event_list_item_format');
419
+ // $events_body = dbem_get_events_list(10, $scope, "ASC", $stored_format, $false);
420
+ if ($events_N > 1) {
421
+ $_GET ['calendar_day'] ? $scope = $_GET ['calendar_day'] : $scope = "future";
422
+ $stored_format = get_option ( 'dbem_event_list_item_format' );
423
+ $events_body = "<ul class='dbem_events_list'>" . dbem_get_events_list ( 10, $scope, "ASC", $stored_format, $false ) . "</ul>";
 
 
 
 
 
 
 
 
424
  return $events_body;
425
+ } else {
426
+ $events = dbem_get_events ( "", $_REQUEST ['calendar_day'] );
427
+ $event = $events [0];
428
+ $single_event_format = get_option ( 'dbem_single_event_format' );
429
+ $page_body = dbem_replace_placeholders ( $single_event_format, $event );
430
+ return $page_body;
431
+ }
432
+ return $events_body;
433
+ } else {
434
  // Multiple events page
435
+ $_GET ['scope'] ? $scope = $_GET ['scope'] : $scope = "future";
436
+ $stored_format = get_option ( 'dbem_event_list_item_format' );
437
+ if (get_option ( 'dbem_display_calendar_in_events_page' ))
438
+ $events_body = dbem_get_calendar ();
439
  else
440
+ $events_body = $events_body = "<ul class='dbem_events_list'>" . dbem_get_events_list ( 10, $scope, "ASC", $stored_format, $false ) . "</ul>";
441
+ return $events_body;
442
+
443
  }
444
+ }
445
  function dbem_events_count_for($date) {
446
+ global $wpdb;
447
+ $table_name = $wpdb->prefix . EVENTS_TBNAME;
448
  $sql = "SELECT COUNT(*) FROM $table_name WHERE event_start_date like '$date';";
449
+ return $wpdb->get_var ( $sql );
450
  }
451
 
452
  // filter function to call the event page when appropriate
455
  // $table_name = $wpdb->prefix .EVENTS_TBNAME;
456
  // $start = strpos($data, DBEM_PAGE);
457
 
458
+
459
+ $is_events_post = (get_the_ID () == get_option ( 'dbem_events_page' ));
460
+ $events_page_id = get_option ( 'dbem_events_page' );
461
+ if (is_page ( $events_page_id ) && $is_events_post) {
462
+ return dbem_events_page_content ();
463
  } else {
464
  return $data;
465
+ }
466
  }
467
+ add_filter ( 'the_content', 'dbem_filter_events_page' );
468
 
469
  function dbem_events_page_title($data) {
470
+ $events_page_id = get_option ( 'dbem_events_page' );
471
+ $events_page = get_page ( $events_page_id );
472
+ $events_page_title = $events_page->post_title;
473
+
474
+ if (($data == $events_page_title) && (is_page ( $events_page_id ))) {
475
+ if (isset ( $_REQUEST ['calendar_day'] ) && $_REQUEST ['calendar_day'] != '') {
476
+
477
+ $date = $_REQUEST ['calendar_day'];
478
+ $events_N = dbem_events_count_for ( $date );
479
+
480
+ if ($events_N == 1) {
481
+ $events = dbem_get_events ( "", $_REQUEST ['calendar_day'] );
482
+ $event = $events [0];
483
+ $stored_page_title_format = get_option ( 'dbem_event_page_title_format' );
484
+ $page_title = dbem_replace_placeholders ( $stored_page_title_format, $event );
485
+ return $page_title;
486
+ }
 
 
 
 
 
 
487
 
488
+ }
489
 
490
+ if (isset ( $_REQUEST ['location_id'] ) && $_REQUEST ['location_id'] |= '') {
491
+ $location = dbem_get_location ( $_REQUEST ['location_id'] );
492
+ $stored_page_title_format = get_option ( 'dbem_location_page_title_format' );
493
+ $page_title = dbem_replace_locations_placeholders ( $stored_page_title_format, $location );
494
  return $page_title;
495
  }
496
+ if (isset ( $_REQUEST ['event_id'] ) && $_REQUEST ['event_id'] != '') {
497
  // single event page
498
+ $event_ID = $_REQUEST ['event_id'];
499
+ $event = dbem_get_event ( $event_ID );
500
+ $stored_page_title_format = get_option ( 'dbem_event_page_title_format' );
501
+ $page_title = dbem_replace_placeholders ( $stored_page_title_format, $event );
502
  return $page_title;
503
+ } else {
504
  // Multiple events page
505
+ $page_title = get_option ( 'dbem_events_page_title' );
506
+ return $page_title;
 
 
 
 
507
 
508
+ }
509
 
510
  } else {
511
  return $data;
512
+ }
513
+
514
+ }
515
  // to make sure that in pages lists the title is dbem_events_page_title, and not overwritten by the previous filter
516
+ add_filter ( 'the_title', 'dbem_events_page_title' );
517
+ add_filter ( 'single_post_title', 'dbem_events_page_title' );
518
 
519
  function dbem_filter_get_pages($data) {
520
+ $output = array ();
521
+ $events_page_id = get_option ( 'dbem_events_page' );
522
+ for($i = 0; $i < count ( $data ); ++ $i) {
523
+ if ($data [$i]->ID == $events_page_id) {
524
+ $list_events_page = get_option ( 'dbem_list_events_page' );
525
+ if ($list_events_page) {
526
+ $data [$i]->post_title = get_option ( 'dbem_events_page_title' ) . "&nbsp;";
527
+ $output [] = $data [$i];
528
+ }
529
  } else {
530
+ $output [] = $data [$i];
531
+ }
532
+ }
533
+ return $output;
534
+ }
535
+ add_filter ( 'get_pages', 'dbem_filter_get_pages' );
 
 
536
 
537
  //
538
  // TODO: ROBA NUOVA DA RIORDINARE
584
  echo $css;
585
  }
586
 
587
+ add_action ( 'admin_print_scripts', 'dbem_admin_css' );
588
 
589
  // TEMPLATE TAGS
590
 
591
+
592
  // exposed function, for theme makers
593
+ /* Marcus Begin Edit */
594
+ //Added a category option to the get events list method and shortcode
595
+ function dbem_get_events_list($limit = "3", $scope = "future", $order = "ASC", $format = '', $echo = 1, $category = '') {
596
+ if (strpos ( $limit, "=" )) {
597
  // allows the use of arguments without breaking the legacy code
598
+ $defaults = array ('limit' => 3, 'scope' => 'future', 'order' => 'ASC', 'format' => '', 'echo' => 1 , 'category' => '');
599
+
600
+ $r = wp_parse_args ( $limit, $defaults );
601
+ extract ( $r, EXTR_SKIP );
602
+ $limit = $r ['limit'];
603
+ $scope = $r ['scope'];
604
+ $order = $r ['order'];
605
+ $format = $r ['format'];
606
+ $echo = $r ['echo'];
607
+ $category = (is_numeric($r ['category'])) ? $r ['category'] : '' ;
 
 
 
 
 
608
  }
609
+ if ($scope == "")
610
  $scope = "future";
611
+ if ($order != "DESC")
612
+ $order = "ASC";
613
  if ($format == '')
614
+ $format = get_option ( 'dbem_event_list_item_format' );
615
+ $events = dbem_get_events ( $limit, $scope, $order, '', '', $category );
616
  $output = "";
617
+ if (! empty ( $events )) {
618
+ foreach ( $events as $event ) {
619
+ // $localised_date = mysql2date("j M Y", $event->event_time);
 
 
620
 
621
+
622
+ $output .= dbem_replace_placeholders ( $format, $event );
623
+ }
624
  } else {
625
+ $output = "<li class='dbem-no-events'>" . get_option ( 'dbem_no_events_message' ) . "</li>";
626
  }
627
  if ($echo)
628
  echo $output;
629
  else
630
  return $output;
 
 
 
 
 
 
 
 
 
 
 
631
  }
 
 
 
632
 
633
+ function dbem_get_events_list_shortcode($atts) {
634
+ extract ( shortcode_atts ( array ('limit' => 3, 'scope' => 'future', 'order' => 'ASC', 'format' => '', 'category' => '' ), $atts ) );
635
+ $result = dbem_get_events_list ( "limit=$limit&scope=$scope&order=$order&format=$format&echo=0&category=$category" );
636
+ return $result;
637
+ }
638
+ add_shortcode ( 'events_list', 'dbem_get_events_list_shortcode' );
639
+ /* Marcus End Edit*/
640
 
641
+ function dbem_get_events_page($justurl = 0, $echo = 1, $text = '') {
642
+ if (strpos ( $justurl, "=" )) {
643
  // allows the use of arguments without breaking the legacy code
644
+ $defaults = array ('justurl' => 0, 'text' => '', 'echo' => 1 );
645
+
646
+ $r = wp_parse_args ( $justurl, $defaults );
647
+ extract ( $r, EXTR_SKIP );
648
+ $justurl = $r ['justurl'];
649
+ $text = $r ['text'];
650
+ $echo = $r ['echo'];
 
 
 
 
651
  }
652
+
653
+ $page_link = get_permalink ( get_option ( "dbem_events_page" ) );
654
+ if ($justurl) {
655
  $result = $page_link;
656
  } else {
657
+ if ($text == '')
658
+ $text = get_option ( "dbem_events_page_title" );
659
  $result = "<a href='$page_link' title='$text'>$text</a>";
660
  }
661
  if ($echo)
662
  echo $result;
663
  else
664
  return $result;
665
+
666
+ }
667
+ function dbem_get_events_page_shortcode($atts) {
668
+ extract ( shortcode_atts ( array ('justurl' => 0, 'text' => '' ), $atts ) );
669
+ $result = dbem_get_events_page ( "justurl=$justurl&text=$text&echo=0" );
 
 
 
670
  return $result;
671
  }
672
+ add_shortcode ( 'events_page', 'dbem_get_events_page_shortcode' );
 
 
673
 
674
+ function dbem_are_events_available($scope = "future") {
675
+ if ($scope == "")
676
  $scope = "future";
677
+ $events = dbem_get_events ( 1, $scope );
678
 
679
+ if (empty ( $events ))
680
  return FALSE;
681
+ else
682
+ return TRUE;
683
  }
684
+
685
  // Returns true if the page in question is the events page
686
  function dbem_is_events_page() {
687
+ $events_page_id = get_option ( 'dbem_events_page' );
688
+ return is_page ( $events_page_id );
689
+ }
690
 
691
  function dbem_is_single_event_page() {
692
+ return (dbem_is_events_page () && (isset ( $_REQUEST ['event_id'] ) && $_REQUEST ['event_id'] != ''));
693
  }
694
 
695
  function dbem_is_multiple_events_page() {
696
+ return (dbem_is_events_page () && ! (isset ( $_REQUEST ['event_id'] ) && $_REQUEST ['event_id'] != ''));
697
  }
698
 
 
699
  // main function querying the database event table
700
+ /* Marcus Begin Edit */
701
+ //Added extra method option for cateogry
702
+ function dbem_get_events($limit = "", $scope = "future", $order = "ASC", $offset = "", $location_id = "", $category = '') {
703
+ /* Marcus End Edit */
704
+ global $wpdb;
705
 
706
+ $events_table = $wpdb->prefix . EVENTS_TBNAME;
707
  if ($limit != "")
708
  $limit = "LIMIT $limit";
709
  if ($offset != "")
710
+ $offset = "OFFSET $offset";
711
+ if ($order = "")
712
+ $order = "ASC";
713
+
714
+ $timestamp = time ();
715
+ $date_time_array = getdate ( $timestamp );
716
+ $hours = $date_time_array ['hours'];
717
+ $minutes = $date_time_array ['minutes'];
718
+ $seconds = $date_time_array ['seconds'];
719
+ $month = $date_time_array ['mon'];
720
+ $day = $date_time_array ['mday'];
721
+ $year = $date_time_array ['year'];
722
+ $today = strftime ( '%Y-%m-%d', mktime ( $hours, $minutes, $seconds, $month, $day, $year ) );
723
 
724
+ $conditions = array ();
725
+ if (preg_match ( "/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $scope )) {
726
+ $conditions [] = " event_start_date like '$scope'";
727
+ } else {
728
+ if (($scope != "past") && ($scope != "all"))
729
+ $scope = "future";
730
+ if ($scope == "future")
731
+ /* Marcus Begin Edit */
732
+ //This is so events with future dates are counted too
733
+ $conditions [] = " event_start_date >= '$today' OR (event_end_date >= '$today' AND event_end_date != '0000-00-00' AND event_end_date IS NOT NULL)";
734
+ /* Marcus End Edit */
735
+ if ($scope == "past")
736
+ $conditions [] = " event_start_date < '$today'";
737
+ }
738
+
739
+ if ($location_id != "")
740
+ $conditions [] = " location_id = $location_id";
741
+
742
+ /* Marcus Begin Edit */
743
+ if ($category != '' && is_numeric($category)){
744
+ $conditions [] = " event_category_id = $category";
745
  }
746
+ /* Marcus End Edit */
747
+
748
+ $where = implode ( " AND ", $conditions );
 
 
749
  if ($where != "")
750
+ $where = " WHERE " . $where;
751
 
752
  $sql = "SELECT event_id,
753
  event_name,
772
  $where
773
  ORDER BY event_start_date $order
774
  $limit
775
+ $offset";
776
+
777
+ $wpdb->show_errors = true;
778
+ $events = $wpdb->get_results ( $sql, ARRAY_A );
779
+ if (! empty ( $events )) {
780
  //$wpdb->print_error();
781
+ $inflated_events = array ();
782
+ foreach ( $events as $this_event ) {
783
+
784
+ $this_location = dbem_get_location ( $this_event ['location_id'] );
785
+ $this_event ['location_name'] = $this_location ['location_name'];
786
+ $this_event ['location_address'] = $this_location ['location_address'];
787
+ $this_event ['location_town'] = $this_location ['location_town'];
788
+ array_push ( $inflated_events, $this_event );
789
  }
790
+
791
  return $inflated_events;
792
  } else {
793
  return null;
794
  }
795
+ }
796
+
797
  function dbem_get_event($event_id) {
798
  global $wpdb;
799
+ $events_table = $wpdb->prefix . EVENTS_TBNAME;
800
  $sql = "SELECT event_id,
801
  event_name,
802
  DATE_FORMAT(event_start_date, '%Y-%m-%e') AS 'event_date',
826
  location_id,
827
  event_contactperson_id
828
  FROM $events_table
829
+ WHERE event_id = $event_id";
830
+
831
  //$wpdb->show_errors(true);
832
+ $event = $wpdb->get_row ( $sql, ARRAY_A );
833
  //$wpdb->print_error();
834
+ $location = dbem_get_location ( $event ['location_id'] );
835
+ $event ['location_name'] = $location ['location_name'];
836
+ $event ['location_address'] = $location ['location_address'];
837
+ $event ['location_town'] = $location ['location_town'];
838
+ $event ['location_latitude'] = $location ['location_latitude'];
839
+ $event ['location_longitude'] = $location ['location_longitude'];
840
+ $event ['location_image_url'] = $location ['location_image_url'];
841
  return $event;
842
+ }
843
 
844
  function dbem_hello_to_new_user() {
845
+ $current_user = wp_get_current_user ();
846
+ $advice = sprintf ( __ ( "<p>Hey, <strong>%s</strong>, welcome to <strong>Events Manager</strong>! We hope you like it around here.</p>
847
  <p>Now it's time to insert events lists through <a href='%s' title='Widgets page'>widgets</a>, <a href='%s' title='Template tags documentation'>template tags</a> or <a href='%s' title='Shortcodes documentation'>shortcodes</a>.</p>
848
  <p>By the way, have you taken a look at the <a href='%s' title='Change settings'>Settings page</a>? That's where you customize the way events and locations are displayed.</p>
849
+ <p>What? Tired of seeing this advice? I hear you, <a href='%s' title='Don't show this advice again'>click here</a> and you won't see this again!</p>", 'dbem' ), $current_user->display_name, get_bloginfo ( 'url' ) . '/wp-admin/widgets.php', 'http://davidebenini.it/wordpress-plugins/events-manager#template-tags', 'http://davidebenini.it/wordpress-plugins/events-manager#shortcodes', get_bloginfo ( 'url' ) . '/wp-admin/admin.php?page=events-manager-options', get_bloginfo ( 'url' ) . '/wp-admin/admin.php?page=events-manager/events-manager.php&disable_hello_to_user=true' );
850
+ ?>
851
+ <div id="message" class="updated">
852
+ <?php
853
+ echo $advice;
 
 
854
  ?>
 
 
855
  </div>
856
+ <?php
857
  }
858
 
859
+ function dbem_events_table($events, $limit, $title) {
860
+ if (isset ( $_GET ['scope'] ))
861
+ $scope = $_GET ['scope'];
862
+ else
863
  $scope = "future";
864
+ if (($scope != "past") && ($scope != "all"))
865
  $scope = "future";
866
+ $events_count = count ( dbem_get_events ( "", $scope ) );
867
 
868
+ if (isset ( $_GET ['offset'] ))
869
+ $offset = $_GET ['offset'];
870
+
871
+ $use_events_end = get_option ( 'dbem_use_event_end' );
872
 
 
 
873
  ?>
874
+
875
+ <div class="wrap">
876
+ <div id="icon-events" class="icon32"><br />
877
+ </div>
878
+ <h2><?php
879
+ echo $title;
880
+ ?></h2>
881
 
 
 
 
 
 
 
 
882
  <?php
883
+ $say_hello = get_option ( 'dbem_hello_to_user' );
884
+ if ($say_hello == 1)
885
+ dbem_hello_to_new_user ();
886
+
887
+ ?>
888
+ <!--<div id='new-event' class='switch-tab'><a href="<?php
889
+ bloginfo ( 'wpurl' )?>/wp-admin/edit.php?page=events-manager/events-manager.php&amp;action=edit_event"><?php
890
+ _e ( 'New Event ...', 'dbem' );
891
+ ?></a></div>-->
892
+ <?php
893
+
894
+ $link = array ();
895
+ $link ['past'] = "<a href='" . get_bloginfo ( 'url' ) . "/wp-admin/edit.php?page=events-manager/events-manager.php&amp;scope=past&amp;order=desc'>" . __ ( 'Past events', 'dbem' ) . "</a>";
896
+ $link ['all'] = " <a href='" . get_bloginfo ( 'url' ) . "/wp-admin/edit.php?page=events-manager/events-manager.php&amp;scope=all&amp;order=desc'>" . __ ( 'All events', 'dbem' ) . "</a>";
897
+ $link ['future'] = " <a href='" . get_bloginfo ( 'url' ) . "/wp-admin/edit.php?page=events-manager/events-manager.php&amp;scope=future'>" . __ ( 'Future events', 'dbem' ) . "</a>";
898
+
899
+ $scope_names = array ();
900
+ $scope_names ['past'] = __ ( 'Past events', 'dbem' );
901
+ $scope_names ['all'] = __ ( 'All events', 'dbem' );
902
+ $scope_names ['future'] = __ ( 'Future events', 'dbem' );
903
+
904
+ ?>
905
 
906
+ <form id="posts-filter" action="" method="get"><input type='hidden'
907
+ name='page' value='events-manager/events-manager.php' />
908
+ <ul class="subsubsub">
909
+ <li><a href='edit.php' class="current"><?php
910
+ _e ( 'Total', 'dbem' );
911
+ ?> <span
912
+ class="count">(<?php
913
+ echo (count ( $events ));
914
+ ?>)</span></a></li>
915
+ </ul>
916
+
917
+
918
+ <div class="tablenav">
919
+
920
+ <div class="alignleft actions"><select name="action">
921
+ <option value="-1" selected="selected"><?php
922
+ _e ( 'Bulk Actions' );
923
+ ?></option>
924
+ <option value="deleteEvents"><?php
925
+ _e ( 'Delete selected' );
926
+ ?></option>
927
+
928
+ </select> <input type="submit" value="<?php
929
+ _e ( 'Apply' );
930
+ ?>"
931
+ name="doaction2" id="doaction2" class="button-secondary action" /> <select
932
+ name="scope">
933
 
934
  <?php
935
+ foreach ( $scope_names as $key => $value ) {
936
+ $selected = "";
937
+ if ($key == $scope)
938
+ $selected = "selected='selected'";
939
+ echo "<option value='$key' $selected>$value</option> ";
940
+ }
941
+ ?>
942
+ </select> <input id="post-query-submit" class="button-secondary"
943
+ type="submit" value="<?php
944
+ _e ( 'Filter' )?>" /></div>
945
+ <div class="clear"></div>
946
+ <?php
947
+ if (empty ( $events )) {
948
+ // TODO localize
949
+ echo "no events";
950
+ } else {
951
+ ?>
 
952
 
953
  <table class="widefat">
954
+ <thead>
955
+ <tr>
956
+ <th class='manage-column column-cb check-column' scope='col'><input
957
+ class='select-all' type="checkbox" value='1' /></th>
958
+ <th><?php
959
+ _e ( 'Name', 'dbem' );
960
+ ?></th>
961
+ <?php /* Marcus Begin Edit */ ?>
962
+ <th></th>
963
+ <?php /* Marcus End Edit */ ?>
964
+ <th><?php
965
+ _e ( 'Location', 'dbem' );
966
+ ?></th>
967
+ <th colspan="2"><?php
968
+ _e ( 'Date and time', 'dbem' );
969
+ ?></th>
970
+ </tr>
971
+ </thead>
972
+ <tbody>
973
  <?php
974
+ $i = 1;
975
+ foreach ( $events as $event ) {
976
+ $class = ($i % 2) ? ' class="alternate"' : '';
977
+ // FIXME set to american
978
+ $localised_date = mysql2date ( __ ( 'D d M Y' ), $event ['event_start_date'] );
979
+ $style = "";
980
+ $today = date ( "Y-m-d" );
981
+
982
+ $location_summary = "<b>" . $event ['location_name'] . "</b><br/>" . $event ['location_address'] . " - " . $event ['location_town'];
983
+
984
+ if ($event ['event_start_date'] < $today)
985
+ $style = "style ='background-color: #FADDB7;'";
 
986
  ?>
987
+ <tr <?php
988
+ echo "$class $style";
989
+ ?>>
990
+
991
+ <td><input type='checkbox' class='row-selector'
992
+ value='<?php
993
+ echo $event ['event_id'];
994
+ ?>' name='events[]' /></td>
995
+ <td><strong><a class="row-title"
996
+ href="<?php
997
+ bloginfo ( 'wpurl' )?>/wp-admin/edit.php?page=events-manager/events-manager.php&amp;action=edit_event&amp;event_id=<?php
998
+ echo $event ['event_id'];
999
+ ?>"><?php
1000
+ echo ($event ['event_name']);
1001
+ ?></a></strong>
1002
+ </td>
1003
+ <td>
1004
+ <?php /* Marcus Begin Edit */ ?>
1005
+ <a
1006
+ href="<?php
1007
+ bloginfo ( 'wpurl' )?>/wp-admin/edit.php?page=events-manager/events-manager.php&amp;action=duplicate_event&amp;event_id=<?php
1008
+ echo $event ['event_id'];
1009
+ ?>"
1010
+ title="<?php
1011
+ _e ( 'Duplicate this event', 'dbem' );
1012
+ ?>"><strong>+</strong></a>
1013
+ <?php /* Marcus End Edit */ ?>
1014
  </td>
1015
+ <td>
 
 
 
1016
 
1017
+ <?php
1018
+ echo $location_summary;
1019
+ ?>
1020
 
1021
  </td>
1022
+
1023
+ <td>
1024
+ <?php
1025
+ echo $localised_date;
1026
+ ?><br />
1027
 
1028
+ <?php
1029
+ echo substr ( $event ['event_start_time'], 0, 5 ) . " - " . substr ( $event ['event_end_time'], 0, 5 );
1030
+ ?>
1031
  </td>
1032
+ <td>
1033
+ <?php
1034
+ if ($event ['recurrence_id']) {
1035
+ $recurrence = dbem_get_recurrence ( $event [recurrence_id] );
1036
+ ?>
1037
 
1038
+ <b><?php
1039
+ echo $recurrence ['recurrence_description'];
1040
+ ?> <br />
1041
+ <a
1042
+ href="<?php
1043
+ bloginfo ( 'wpurl' )?>/wp-admin/edit.php?page=events-manager/events-manager.php&amp;action=edit_recurrence&amp;recurrence_id=<?php
1044
+ echo $recurrence ['recurrence_id'];
1045
+ ?>"><?php
1046
+ _e ( 'Reschedule', 'dbem' );
1047
+ ?></a></b>
1048
 
1049
 
1050
+ <?php
1051
+ }
1052
+ ?>
1053
  </td>
1054
 
1055
 
1056
  <?php
1057
+ echo '</tr>';
1058
+ $i ++;
1059
  }
1060
+ ?>
1061
 
1062
+
1063
+
1064
+
1065
+
1066
+ </tbody>
1067
+ </table>
1068
+ <?php
1069
+ } // end of table ?>
1070
 
1071
  <div class='tablenav'>
1072
+ <div class="alignleft actions"><br class='clear' />
1073
+ </div>
1074
+ <br class='clear' />
1075
+ </div>
1076
+
1077
+ </form>
1078
+ </div>
1079
+ </div>
1080
+
1081
+ <?php
1082
+ if ($events_count > $limit) {
1083
+ $backward = $offset + $limit;
1084
+ $forward = $offset - $limit;
1085
+ if (DEBUG)
1086
+ echo "COUNT = $count BACKWARD = $backward FORWARD = $forward<br> -- OFFSET = $offset";
1087
+ echo "<div id='events-pagination'> ";
1088
+ if ($backward < $events_count)
1089
+ echo "<a style='float: left' href='" . get_bloginfo ( 'url' ) . "/wp-admin/edit.php?page=events-manager/events-manager.php&amp;scope=$scope&offset=$backward'>&lt;&lt;</a>";
1090
+ if ($forward >= 0)
1091
+ echo "<a style='float: right' href='" . get_bloginfo ( 'url' ) . "/wp-admin/edit.php?page=events-manager/events-manager.php&amp;scope=$scope&offset=$forward'>&gt;&gt;</a>";
1092
+ echo "</div>";
1093
+ }
1094
+ ?>
1095
+
1096
+ </div>
 
 
1097
  <?php
1098
  }
1099
+ function dbem_event_form($event, $title, $element) {
1100
 
1101
  global $localised_date_formats;
1102
  // change prefix according to event/recurrence
1103
+ $_GET ['action'] == "edit_recurrence" ? $pref = "recurrence_" : $pref = "event_";
1104
 
1105
+ $_GET ['action'] == "edit_recurrence" ? $form_destination = "edit.php?page=events-manager/events-manager.php&amp;action=update_recurrence&amp;recurrence_id=" . $element : $form_destination = "edit.php?page=events-manager/events-manager.php&amp;action=update_event&amp;event_id=" . $element;
 
 
 
1106
 
1107
+ $locale_code = substr ( get_locale (), 0, 2 );
1108
+ $localised_date_format = $localised_date_formats [$locale_code];
1109
 
1110
+ $hours_locale = "24";
1111
  // Setting 12 hours format for those countries using it
1112
+ if (preg_match ( "/en|sk|zh|us|uk/", $locale_code ))
1113
+ $hours_locale = "12";
1114
+
1115
+ $localised_example = str_replace ( "yy", "2008", str_replace ( "mm", "11", str_replace ( "dd", "28", $localised_date_format ) ) );
1116
+ $localised_end_example = str_replace ( "yy", "2008", str_replace ( "mm", "11", str_replace ( "dd", "28", $localised_date_format ) ) );
 
 
1117
 
1118
+ if ($event [$pref . 'start_date'] != "") {
1119
+ preg_match ( "/(\d{4})-(\d{2})-(\d{2})/", $event [$pref . 'start_date'], $matches );
1120
+ $year = $matches [1];
1121
+ $month = $matches [2];
1122
+ $day = $matches [3];
1123
+ $localised_date = str_replace ( "yy", $year, str_replace ( "mm", $month, str_replace ( "dd", $day, $localised_date_format ) ) );
1124
  } else {
1125
  $localised_date = "";
1126
  }
1127
+ if ($event [$pref . 'end_date'] != "") {
1128
+ preg_match ( "/(\d{4})-(\d{2})-(\d{2})/", $event [$pref . 'end_date'], $matches );
1129
+ $end_year = $matches [1];
1130
+ $end_month = $matches [2];
1131
+ $end_day = $matches [3];
1132
+ $localised_end_date = str_replace ( "yy", $end_year, str_replace ( "mm", $end_month, str_replace ( "dd", $end_day, $localised_date_format ) ) );
1133
  } else {
1134
  $localised_end_date = "";
1135
+ }
1136
  // if($event[$pref.'rsvp'])
1137
  // echo (dbem_bookings_table($event[$pref.'id']));
 
 
 
 
 
 
1138
 
1139
+
1140
+ $freq_options = array ("daily" => __ ( 'Daily', 'dbem' ), "weekly" => __ ( 'Weekly', 'dbem' ), "monthly" => __ ( 'Monthly', 'dbem' ) );
1141
+ $days_names = array (1 => __ ( 'Mon' ), 2 => __ ( 'Tue' ), 3 => __ ( 'Wed' ), 4 => __ ( 'Thu' ), 5 => __ ( 'Fri' ), 6 => __ ( 'Sat' ), 7 => __ ( 'Sun' ) );
1142
+ $saved_bydays = explode ( ",", $event ['recurrence_byday'] );
1143
+ $weekno_options = array ("1" => __ ( 'first', 'dbem' ), '2' => __ ( 'second', 'dbem' ), '3' => __ ( 'third', 'dbem' ), '4' => __ ( 'fourth', 'dbem' ), '-1' => __ ( 'last', 'dbem' ) );
1144
 
1145
+ $event [$pref . 'rsvp'] ? $event_RSVP_checked = "checked='checked'" : $event_RSVP_checked = '';
1146
+
1147
+ ?>
1148
+ <form id="eventForm" method="post" action="<?php echo $form_destination; ?>">
1149
+ <div class="wrap">
1150
+ <div id="icon-events" class="icon32"><br /></div>
1151
+ <h2><?php echo $title; ?></h2>
1152
+ <?php
1153
+ if ($event ['recurrence_id']) {
1154
+ ?>
1155
  <p id='recurrence_warning'>
1156
+ <?php
1157
+ if (isset ( $_GET ['action'] ) && ($_GET ['action'] == 'edit_recurrence')) {
1158
+ _e ( 'WARNING: This is a recurrence.', 'dbem' )?>
1159
+ <br />
1160
+ <?php
1161
+ _e ( 'Modifying these data all the events linked to this recurrence will be rescheduled', 'dbem' );
1162
+
1163
+ } else {
1164
+ _e ( 'WARNING: This is a recurring event.', 'dbem' );
1165
+ _e ( 'If you change these data and save, this will become an independent event.', 'dbem' );
1166
+ }
1167
+ ?>
1168
+ </p>
1169
+ <?php
1170
+ }
1171
+ ?>
1172
+ <?php
1173
+ /* Marcus Begin Edit */
1174
+ //This is an edit for WP 2.8 for styling fix
1175
+ ?>
1176
+ <div id="poststuff" class="metabox-holder has-right-sidebar">
1177
+ <!-- SIDEBAR -->
1178
+ <div id="side-info-column" class='inner-sidebar'>
1179
+ <div id='side-sortables'>
1180
+ <!-- recurrence postbox -->
1181
+ <div class="postbox ">
1182
+ <div class="handlediv" title="Fare clic per cambiare."><br />
1183
+ </div>
1184
+ <h3 class='hndle'><span>
1185
+ <?php
1186
+ _e ( "Recurrence", 'dbem' );
1187
+ ?>
1188
+ </span></h3>
1189
+ <div class="inside">
1190
+ <?php
1191
+ if (! $event ['event_id']) {
1192
+ ?>
1193
+ <?php
1194
+ if ($event ['recurrence_id'] != "")
1195
+ $recurrence_YES = "checked='checked'";
1196
+
1197
+ ?>
1198
+ <p>
1199
+ <input id="event-recurrence" type="checkbox"
1200
+ name="repeated_event" value="1" <?php
1201
+ echo $recurrence_YES;
1202
+ ?> />
1203
+ <?php
1204
+ _e ( 'Repeated event', 'dbem' );
1205
+ ?>
1206
+ </p>
1207
  <div id="event_recurrence_pattern">
1208
+ <p>Frequency:
1209
+ <select id="recurrence-frequency" name="recurrence_freq">
1210
+ <?php
1211
+ dbem_option_items ( $freq_options, $event [$pref . 'freq'] );
1212
+ ?>
1213
+ </select>
 
 
 
 
 
 
 
1214
  </p>
1215
+ <p>
1216
+ <?php
1217
+ _e ( 'Every', 'dbem' )?>
1218
+ <input id="recurrence-interval" name='recurrence_interval'
1219
+ size='2' value='<?php
1220
+ echo $event ['recurrence_interval'];
1221
+ ?>'>
1222
+ </input>
1223
+ <span class='interval-desc' id="interval-daily-singular">
1224
+ <?php _e ( 'day', 'dbem' )?>
1225
+ </span> <span class='interval-desc' id="interval-daily-plural">
1226
+ <?php _e ( 'days', 'dbem' ) ?>
1227
+ </span> <span class='interval-desc' id="interval-weekly-singular">
1228
+ <?php _e ( 'week', 'dbem' )?>
1229
+ </span> <span class='interval-desc' id="interval-weekly-plural">
1230
+ <?php _e ( 'weeks', 'dbem' )?>
1231
+ </span> <span class='interval-desc' id="interval-monthly-singular">
1232
+ <?php _e ( 'month', 'dbem' )?>
1233
+ </span> <span class='interval-desc' id="interval-monthly-plural">
1234
+ <?php _e ( 'months', 'dbem' )?>
1235
+ </span> </p>
1236
  <p class="alternate-selector" id="weekly-selector">
1237
+ <?php dbem_checkbox_items ( 'recurrence_bydays[]', $days_names, $saved_bydays );
1238
+ ?>
1239
+ </p>
1240
  <p class="alternate-selector" id="monthly-selector">
1241
+ <?php
1242
+ _e ( 'Every', 'dbem' )?>
1243
+ <select id="monthly-modifier" name="recurrence_byweekno">
1244
+ <?php
1245
+ dbem_option_items ( $weekno_options, $event ['recurrence_byweekno'] );
1246
+ ?>
1247
+ </select>
1248
+ <select id="recurrence-weekday"
1249
+ name="recurrence_byday">
1250
+ <?php
1251
+ dbem_option_items ( $days_names, $event ['recurrence_byday'] );
1252
+ ?>
1253
+ </select>
1254
+ &nbsp;</p>
1255
+ </div>
1256
+ <p id="recurrence-tip">
1257
+ <?php
1258
+ _e ( 'Check if your event happens more than once according to a regular pattern', 'dbem' )?>
1259
+ </p>
1260
+ <?php
1261
+ } else {
1262
+
1263
+ if (! $event ['recurrence_id']) {
1264
+ echo "<p>" . __ ( 'This is\'t a recurrent event', 'dbem' ) . ".</p>";
1265
+ } else {
1266
+
1267
+ $recurrence = dbem_get_recurrence ( $event ['recurrence_id'] );
1268
+ ?>
1269
+ <p>
1270
+ <?php
1271
+ echo $recurrence ['recurrence_description'];
1272
+ ?>
1273
+ <br />
1274
+ <a
1275
+ href="<?php
1276
+ bloginfo ( 'wpurl' )?>/wp-admin/edit.php?page=events-manager/events-manager.php&amp;action=edit_recurrence&amp;recurrence_id=<?php
1277
+ echo $recurrence ['recurrence_id'];
1278
+ ?>">
1279
+ <?php
1280
+ _e ( 'Reschedule', 'dbem' );
1281
+ ?>
1282
+ </a></p>
1283
+ <?php
1284
+ }
1285
+ ?>
1286
+ <?php
1287
+ }
1288
+ ?>
1289
  </div>
 
 
 
1290
  </div>
1291
+ <div class="postbox ">
1292
+ <div class="handlediv" title="Fare clic per cambiare."><br />
1293
+ </div>
1294
+ <h3 class='hndle'><span>
1295
+ <?php
1296
+ _e ( 'Contact Person', 'dbem' );
1297
+ ?>
1298
+ </span></h3>
1299
+ <div class="inside">
1300
+ <p>Contact:
1301
+ <?php
1302
+ wp_dropdown_users ( array ('name' => 'event_contactperson_id', 'show_option_none' => __ ( "Select...", 'dbem' ), 'selected' => $event ['event_contactperson_id'] ) );
1303
+ ?>
1304
+ </p>
1305
+ </div>
1306
  </div>
1307
+ <div class="postbox ">
1308
+ <div class="handlediv" title="Fare clic per cambiare."><br />
1309
+ </div>
 
 
 
1310
  <h3 class='hndle'><span>RSVP</span></h3>
1311
  <div class="inside">
1312
+ <p>
1313
+ <input id="rsvp-checkbox" name='event_rsvp' value='1' type='checkbox'
1314
+ <?php
1315
+ echo $event_RSVP_checked?> />
1316
+ <?php
1317
+ _e ( 'Enable registration for this event', 'dbem' )?>
1318
+ </p>
1319
  <div id='rsvp-data'>
1320
+ <?php
1321
+ if ($event ['event_contactperson_id'] != NULL)
1322
+ $selected = $event ['event_contactperson_id'];
1323
+ else
1324
+ $selected = '0';
1325
+ ?>
1326
+ <p>
1327
+ <?php
1328
+ _e ( 'Spaces' );
1329
+ ?>
1330
+ :
1331
+ <input id="seats-input" type="text"
1332
+ name="event_seats" size='5' value="<?php
1333
+ echo $event [$pref . 'seats']?>" />
1334
+ </p>
1335
+ <?php
1336
+ if ($event ['event_rsvp']) {
1337
+ ?>
1338
+ <?php
1339
+ dbem_bookings_compact_table ( $event [$pref . 'id'] );
1340
+ ?>
1341
+ <?php
1342
+ }
1343
+ ?>
1344
+ </div>
1345
  </div>
1346
+ </div>
1347
+ <?
1348
+ /* Marcus Begin Edit */
1349
+ //adding the category selection box
1350
+ ?>
1351
+ <div class="postbox ">
1352
+ <div class="handlediv" title="Fare clic per cambiare."><br />
1353
+ </div>
1354
+ <h3 class='hndle'><span>
1355
+ <?php _e ( 'Category', 'dbem' ); ?>
1356
+ </span></h3>
1357
+ <div class="inside">
1358
+ <p>Category:
1359
+ <select name="event_category_id">
1360
+ <?php
1361
+ $categories = dbem_get_categories();
1362
+ ?>
1363
+ <option value="">Select...</option>
1364
+ <?php
1365
+ foreach ( $categories as $category ){
1366
+ $event_category = dbem_get_event_category($event['event_id']);
1367
+ $selected = ($category['category_id'] == $event_category['category_id']) ? "selected='selected'": '';
1368
+ ?>
1369
+ <option value="<?= $category['category_id'] ?>" <?= $selected ?>>
1370
+ <?= $category['category_name'] ?>
1371
+ </option>
1372
+ <?
1373
+ }
1374
+ ?>
1375
+ </select>
1376
+ </p>
1377
+ </div>
1378
+ </div>
 
 
1379
  </div>
1380
+ <? /* Marcus End Edit */ ?>
1381
  </div>
1382
+ <!-- END OF SIDEBAR -->
1383
+ <div id="post-body">
1384
+ <div id="post-body-content">
1385
+ <? /* Marcus End Edit */ ?>
1386
+ <div id="event_name" class="stuffbox">
1387
+ <h3>
1388
+ <?php
1389
+ _e ( 'Name', 'dbem' );
1390
+ ?>
1391
+ </h3>
1392
  <div class="inside">
1393
+ <input type="text" name="event_name"
1394
+ value="<?php
1395
+ echo $event [$pref . 'name']?>" />
1396
+ <br />
1397
+ <?php
1398
+ _e ( 'The event name. Example: Birthday party', 'dbem' )?>
1399
  </div>
1400
+ </div>
1401
+ <div id="event_start_date" class="stuffbox">
1402
+ <h3 id='event-date-title'>
1403
+ <?php
1404
+ _e ( 'Event date', 'dbem' );
1405
+ ?>
1406
+ </h3>
1407
+ <h3 id='recurrence-dates-title'>
1408
+ <?php
1409
+ _e ( 'Recurrence dates', 'dbem' );
1410
+ ?>
1411
+ </h3>
1412
  <div class="inside">
1413
+ <input id="localised-date" type="text"
1414
+ name="localised_event_date" value="<?php
1415
+ echo $localised_date?>"
1416
+ style="display: none;" />
1417
+ <input id="date-to-submit" type="text"
1418
+ name="event_date" value="<?php
1419
+ echo $event [$pref . 'start_date']?>"
1420
+ style="background: #FCFFAA" />
1421
+ <input id="localised-end-date"
1422
+ type="text" name="localised_event_end_date"
1423
+ value="<?php
1424
+ echo $localised_end_date?>" style="display: none;" />
1425
+ <input
1426
+ id="end-date-to-submit" type="text" name="event_end_date"
1427
+ value="<?php
1428
+ echo $event [$pref . 'end_date']?>"
1429
+ style="background: #FCFFAA" />
1430
+ <br />
1431
+ <span id='event-date-explanation'>
1432
+ <?php
1433
+ _e ( 'The event date.', 'dbem' );
1434
+ /* Marcus Begin Edit */
1435
+ echo " ";
1436
+ _e ( 'When not reoccurring, this event spans between the beginning and end date.', 'dbem' );
1437
+ /* Marcus End Edit */
1438
+ ?>
1439
+ </span><span
1440
+ id='recurrence-dates-explanation'>
1441
+ <?php
1442
+ _e ( 'The recurrence beginning and end date.', 'dbem' );
1443
+ ?>
1444
+ </span> </div>
1445
+ </div>
1446
+ <div id="event_end_day" class="stuffbox">
1447
+ <h3>
1448
+ <?php
1449
+ _e ( 'Event time', 'dbem' );
1450
+ ?>
1451
+ </h3>
1452
+ <div class="inside">
1453
+ <input id="start-time" type="text" size="8"
1454
+ maxlength="8" name="event_start_time"
1455
+ value="<?php
1456
+ echo $event [$pref . 'start_' . $hours_locale . "h_time"];
1457
+ ?>" />
1458
+ -
1459
+ <input id="end-time" type="text" size="8" maxlength="8"
1460
+ name="event_end_time"
1461
+ value="<?php
1462
+ echo $event [$pref . 'end_' . $hours_locale . "h_time"];
1463
+ ?>" />
1464
+ <br />
1465
+ <?php
1466
+ _e ( 'The time of the event beginning and end', 'dbem' )?>
1467
+ . </div>
1468
+ </div>
1469
+ <div id="location_coordinates" class="stuffbox" style='display: none;'>
1470
+ <h3>
1471
+ <?php
1472
+ _e ( 'Coordinates', 'dbem' );
1473
+ ?>
1474
+ </h3>
1475
+ <div class="inside">
1476
+ <input id='location-latitude'
1477
+ name='location_latitude' type='text'
1478
+ value='<?php
1479
+ echo $event ['location_latitude'];
1480
+ ?>' size='15' />
1481
+ -
1482
+ <input
1483
+ id='location-longitude' name='location_longitude' type='text'
1484
+ value='<?php
1485
+ echo $event ['location_longitude'];
1486
+ ?>' size='15' />
1487
+ </div>
1488
+ </div>
1489
+ <div id="location_name" class="stuffbox">
1490
+ <h3>
1491
+ <?php
1492
+ _e ( 'Location', 'dbem' );
1493
+ ?>
1494
+ </h3>
1495
+ <div class="inside">
1496
+ <table id="dbem-location-data">
1497
+ <tr>
1498
+ <th><?php
1499
+ _e ( 'Name:' )?>
1500
+ &nbsp;</th>
1501
+ <td><input id="location-name" type="text" name="location_name"
1502
+ value="<?php
1503
+ echo $event ['location_name']?>" /></td>
1504
+ <?php
1505
+ $gmap_is_active = get_option ( 'dbem_gmap_is_active' );
1506
+ ?>
1507
+ <?php
1508
+ if ($gmap_is_active) {
1509
+ ?>
1510
+ <td rowspan='6'><div id='map-not-found'
1511
+ style='width: 400px; font-size: 140%; text-align: center; margin-top: 100px; display: hide'>
1512
+ <p>
1513
+ <?php
1514
+ _e ( 'Map not found' );
1515
+ ?>
1516
+ </p>
1517
+ </div>
1518
+ <div id='event-map'
1519
+ style='width: 400px; height: 300px; background: green; display: hide; margin-right: 8px'></div></td>
1520
+ <?php
1521
+ }
1522
+ ; // end of IF_GMAP_ACTIVE ?>
1523
+ </tr>
1524
+ <tr>
1525
+ <td colspan='2'><p>
1526
+ <?php
1527
+ _e ( 'The name of the location where the event takes place. You can use the name of a venue, a square, etc', 'dbem' )?>
1528
+ </p></td>
1529
+ </tr>
1530
+ <tr>
1531
+ <th><?php
1532
+ _e ( 'Address:' )?>
1533
+ &nbsp;</th>
1534
+ <td><input id="location-address" type="text" name="location_address"
1535
+ value="<?php
1536
+ echo $event ['location_address'];
1537
+ ?>" /></td>
1538
+ </tr>
1539
+ <tr>
1540
+ <td colspan='2'><p>
1541
+ <?php
1542
+ _e ( 'The address of the location where the event takes place. Example: 21, Dominick Street', 'dbem' )?>
1543
+ </p></td>
1544
+ </tr>
1545
+ <tr>
1546
+ <th><?php
1547
+ _e ( 'Town:' )?>
1548
+ &nbsp;</th>
1549
+ <td><input id="location-town" type="text" name="location_town"
1550
+ value="<?php
1551
+ echo $event ['location_town']?>" /></td>
1552
+ </tr>
1553
+ <tr>
1554
+ <td colspan='2'><p>
1555
+ <?php
1556
+ _e ( 'The town where the location is located. If you\'re using the Google Map integration and want to avoid geotagging ambiguities include the country in the town field. Example: Verona, Italy.', 'dbem' )?>
1557
+ </p></td>
1558
+ </tr>
1559
+ </table>
1560
+ </div>
1561
+ </div>
1562
+ <div id="event_notes" class="postbox">
1563
+ <h3>
1564
+ <?php
1565
+ _e ( 'Details', 'dbem' );
1566
+ ?>
1567
+ </h3>
1568
+ <div class="inside">
1569
+ <? /* Marcus Begin Edit */ ?>
1570
+ <!-- Currently deactivated for editor test
1571
+ <textarea name="event_notes" rows="8" cols="60">
1572
+ <?php
1573
+ echo $event [$pref . 'notes'];
1574
+ ?>
1575
+ </textarea>
1576
+ -->
1577
+ <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
1578
+ <?php the_editor($event [$pref . 'notes']); ?>
1579
+ </div>
1580
+ <? /* Marcus End Edit */ ?>
1581
+ <br />
1582
+ <?php
1583
+ _e ( 'Details about the event', 'dbem' )?>
1584
+ </div>
1585
  </div>
1586
  </div>
1587
+ <p class="submit">
1588
+ <input type="submit" name="events_update"
1589
+ value="<?php
1590
+ _e ( 'Submit Event', 'dbem' );
1591
+ ?> &raquo;" />
1592
+ </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1593
  </div>
1594
  </div>
 
1595
  </div>
1596
+ </form>
1597
+ <?php
1598
+ }
 
 
 
1599
 
1600
  function dbem_validate_event($event) {
1601
  // Only for emergencies, when JS is disabled
1602
  // TODO make it fully functional without JS
1603
  global $required_fields;
1604
+ $errors = Array ();
1605
+ foreach ( $required_fields as $field ) {
1606
+ if ($event [$field] == "") {
1607
+ $errors [] = $field;
1608
+ }
1609
  }
1610
  $error_message = "";
1611
+ if (count ( $errors ) > 0)
1612
+ $error_message = __ ( 'Missing fields: ' ) . implode ( ", ", $errors ) . ". ";
1613
+ if ($_POST ['repeated_event'] == "1" && $_POST ['event_end_date'] == "")
1614
+ $error_message .= __ ( 'Since the event is repeated, you must specify an event date.', 'dbem' );
1615
  if ($error_message != "")
1616
+ return $error_message;
1617
+ else
1618
  return "OK";
1619
+
1620
  }
1621
 
1622
  function _dbem_is_date_valid($date) {
1623
+ $year = substr ( $date, 0, 4 );
1624
+ $month = substr ( $date, 5, 2 );
1625
+ $day = substr ( $date, 8, 2 );
1626
+ return (checkdate ( $month, $day, $year ));
1627
+ }
1628
+ function _dbem_is_time_valid($time) {
1629
+ $result = preg_match ( "/([01]\d|2[0-3])(:[0-5]\d)/", $time );
1630
+
1631
  return ($result);
1632
  }
1633
  // Enqueing jQuery script to make sure it's loaded
1634
+ function dbem_enque_scripts() {
1635
+ wp_enqueue_script ( 'jquery' );
1636
  // wp_enqueue_script('datepicker','/wp-content/plugins/events-manager/jquery-ui-datepicker/jquery-ui-personalized-1.6b.js', array('jquery') );
1637
  }
1638
+ add_action ( 'template_redirect', 'dbem_enque_scripts' );
1639
 
1640
  function url_exists($url) {
1641
+
1642
+ if ((strpos ( $url, "http" )) === false)
1643
+ $url = "http://" . $url;
1644
+ // FIXME ripristina la linea seguente e VEDI DI SISTEMARE!!!!
1645
  // if (is_array(@get_headers($url))) {
1646
  if (true)
1647
+ return true;
1648
+ else
1649
  return false;
1650
  }
1651
 
1652
  // General script to make sure hidden fields are shown when containing data
1653
+ function dbem_admin_general_script() {
1654
+ ?>
1655
+ <script
1656
+ src="<?php
1657
+ bloginfo ( 'url' );
1658
+ ?>/wp-content/plugins/events-manager/dbem.js"
1659
+ type="text/javascript"></script>
1660
+ <script
1661
+ src="<?php
1662
+ bloginfo ( 'url' );
1663
+ ?>/wp-content/plugins/events-manager/js/jquery-ui-datepicker/ui.datepicker.js"
1664
+ type="text/javascript"></script>
1665
+ <script
1666
+ src="<?php
1667
+ bloginfo ( 'url' );
1668
+ ?>/wp-content/plugins/events-manager/js/timeentry/jquery.timeentry.js"
1669
+ type="text/javascript"></script>
1670
+ <?php
1671
+
1672
  // Check if the locale is there and loads it
1673
+ $locale_code = substr ( get_locale (), 0, 2 );
 
 
 
 
 
 
 
 
 
 
 
1674
 
1675
+ $show24Hours = 'true';
1676
+ // Setting 12 hours format for those countries using it
1677
+ if (preg_match ( "/en|sk|zh|us|uk/", $locale_code ))
1678
+ $show24Hours = 'false';
1679
 
1680
+ $locale_file = get_bloginfo ( 'url' ) . "/wp-content/plugins/events-manager/js/jquery-ui-datepicker/i18n/ui.datepicker-$locale_code.js";
1681
+ if (url_exists ( $locale_file )) {
1682
+ ?>
1683
+ <script
1684
+ src="<?php
1685
+ bloginfo ( 'url' );
1686
+ ?>/wp-content/plugins/events-manager/js/jquery-ui-datepicker/i18n/ui.datepicker-<?php
1687
+ echo $locale_code;
1688
+ ?>.js"
1689
+ type="text/javascript"></script>
1690
+ <?php
1691
+ }
1692
+ ?>
1693
+
1694
+
1695
+ <style type='text/css' media='all'>
1696
+ @import
1697
+ "<?php
1698
+ bloginfo ( 'url' );
1699
+ ?>/wp-content/plugins/events-manager/js/jquery-ui-datepicker/ui.datepicker.css"
1700
+ ;
1701
+ </style>
1702
+ <script type="text/javascript">
1703
  //<![CDATA[
1704
  // TODO: make more general, to support also latitude and longitude (when added)
1705
  $j=jQuery.noConflict();
1721
  function updateShowHideRecurrence () {
1722
  if($j('input#event-recurrence').attr("checked")) {
1723
  $j("#event_recurrence_pattern").fadeIn();
1724
+ /* Marcus Begin Edit */
1725
+ //Edited this and the one below so dates always can have an end date
1726
+ //$j("input#localised-end-date").fadeIn();
1727
+ /* Marcus End Edit */
1728
  $j("#event-date-explanation").hide();
1729
  $j("#recurrence-dates-explanation").show();
1730
  $j("h3#recurrence-dates-title").show();
1731
  $j("h3#event-date-title").hide();
1732
  } else {
1733
  $j("#event_recurrence_pattern").hide();
1734
+ /* Marcus Begin Edit */
1735
+ //$j("input#localised-end-date").hide();
1736
+ /* Marcus End Edit */
1737
  $j("#recurrence-dates-explanation").hide();
1738
  $j("#event-date-explanation").show();
1739
  $j("h3#recurrence-dates-title").hide();
1754
 
1755
  $j("#recurrence-dates-explanation").hide();
1756
  $j("#localised-date").show();
1757
+ /* Marcus Begin Edit */
1758
+ $j("#localised-end-date").show();
1759
+ /* Marcus End Edit */
1760
 
1761
  $j("#date-to-submit").hide();
1762
  $j("#end-date-to-submit").hide();
1774
 
1775
 
1776
 
1777
+ $j("#start-time").timeEntry({spinnerImage: '', show24Hours: <?php
1778
+ echo $show24Hours;
1779
+ ?> });
1780
+ $j("#end-time").timeEntry({spinnerImage: '', show24Hours: <?php
1781
+ echo $show24Hours;
1782
+ ?>});
1783
 
1784
 
1785
 
1840
  errors = "";
1841
  var recurring = $j("input[@name=repeated_event]:checked").val();
1842
  requiredFields= new Array('event_name', 'localised_event_date', 'location_name','location_address','location_town');
1843
+ var localisedRequiredFields = {'event_name':"<?php
1844
+ _e ( 'Name', 'dbem' )?>", 'localised_event_date':"<?php
1845
+ _e ( 'Date', 'dbem' )?>", 'location_name':"<?php
1846
+ _e ( 'Location', 'dbem' )?>",'location_address':"<?php
1847
+ _e ( 'Address', 'dbem' )?>",'location_town':"<?php
1848
+ _e ( 'Town', 'dbem' )?>"};
1849
 
1850
  missingFields = new Array;
1851
  for (var i in requiredFields) {
1862
  // alert('ciao ' + recurring+ " end: " + $j("input[@name=localised_event_end_date]").val());
1863
  if (missingFields.length > 0) {
1864
 
1865
+ errors = "<?php
1866
+ echo _e ( 'Some required fields are missing:', 'dbem' )?> " + missingFields.join(", ") + ".\n";
1867
  }
1868
  if(recurring && $j("input[@name=localised_event_end_date]").val() == "") {
1869
+ errors = errors + "<?php
1870
+ _e ( 'Since the event is repeated, you must specify an end date', 'dbem' )?>.";
1871
  $j("input[@name=localised_event_end_date]").css('border','2px solid red');
1872
  } else {
1873
  $j("input[@name=localised_event_end_date]").css('border','1px solid #DFDFDF');
1885
  });
1886
  //]]>
1887
  </script>
 
 
 
 
 
 
1888
 
1889
+ <?php
1890
+ }
1891
+ add_action ( 'admin_head', 'dbem_admin_general_script' );
1892
 
1893
+ function dbem_admin_map_script() {
1894
+ if ((isset ( $_REQUEST ['event_id'] ) && $_REQUEST ['event_id'] != '') || (isset ( $_REQUEST ['page'] ) && $_REQUEST ['page'] == 'locations') || (isset ( $_REQUEST ['page'] ) && $_REQUEST ['page'] == 'new_event') || (isset ( $_REQUEST ['action'] ) && $_REQUEST ['action'] == 'edit_recurrence')) {
1895
+ if (! (isset ( $_REQUEST ['action'] ) && $_REQUEST ['action'] == 'dbem_delete')) {
1896
  // single event page
1897
 
1898
+
1899
+ $event_ID = $_REQUEST ['event_id'];
1900
+ $event = dbem_get_event ( $event_ID );
1901
 
1902
+ if ($event ['location_town'] != '' || (isset ( $_REQUEST ['page'] ) && $_REQUEST ['page'] = 'locations')) {
1903
+ $gmap_key = get_option ( 'dbem_gmap_key' );
1904
+ if ($event ['location_address'] != "") {
1905
+ $search_key = $event ['location_address'] . ", " . $event ['location_town'];
1906
  } else {
1907
+ $search_key = $event ['location_name'] . ", " . $event ['location_town'];
1908
  }
1909
+
1910
+ ?>
1911
+ <style type="text/css">
1912
+ /* div#location_town, div#location_address, div#location_name {
1913
  width: 480px;
1914
  }
1915
  table.form-table {
1916
  width: 50%;
1917
  } */
1918
+ </style>
1919
+ <script
1920
+ src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?php
1921
+ echo $gmap_key;
1922
+ ?>"
1923
+ type="text/javascript"></script>
1924
+ <script type="text/javascript">
1925
  //<![CDATA[
1926
  $j=jQuery.noConflict();
1927
 
1937
  searchKey = location + ", " + town;
1938
  }
1939
 
1940
+ var search = "<?php
1941
+ echo $search_key?>" ;
1942
  geocoder.getLatLng(
1943
  searchKey,
1944
  function(point) {
2002
  });
2003
  //]]>
2004
  </script>
2005
+ <?php
2006
+ }
2007
  }
2008
+ }
2009
  }
2010
+ $gmap_is_active = get_option ( 'dbem_gmap_is_active' );
2011
  if ($gmap_is_active) {
2012
+ add_action ( 'admin_head', 'dbem_admin_map_script' );
2013
+
2014
  }
2015
 
2016
  // Script to validate map options
2017
+ function dbem_admin_options_script() {
2018
+ if (isset ( $_REQUEST ['page'] ) && $_REQUEST ['page'] == 'events-manager-options') {
2019
+ ?>
2020
+ <script type="text/javascript">
2021
  //<![CDATA[
2022
  $j=jQuery.noConflict();
2023
 
2028
  var gmap_is_active = $j("input[@name=dbem_gmap_is_active]:checked").val();
2029
  var gmap_key = $j("input[@name=dbem_gmap_key]").val();
2030
  if(gmap_is_active == '1' && (gmap_key == '')){
2031
+ alert("<?php
2032
+ _e ( 'You cannot enable Google Maps integration without setting an appropriate API key.' );
2033
+ ?>");
2034
  $j("input[@name='dbem_gmap_is_active']:nth(1)").attr("checked","checked");
2035
 
2036
  return false;
2047
 
2048
  //]]>
2049
  </script>
2050
+
2051
+ <?php
2052
 
 
 
2053
  }
2054
+
2055
  }
2056
+ add_action ( 'admin_head', 'dbem_admin_options_script' );
2057
 
2058
+ function dbem_rss_link($justurl = 0, $echo = 1, $text = "RSS") {
2059
+ if (strpos ( $justurl, "=" )) {
2060
  // allows the use of arguments without breaking the legacy code
2061
+ $defaults = array ('justurl' => 0, 'echo' => 1, 'text' => 'RSS' );
2062
+
2063
+ $r = wp_parse_args ( $justurl, $defaults );
2064
+ extract ( $r, EXTR_SKIP );
2065
+ $justurl = $r ['justurl'];
2066
+ $echo = $r ['echo'];
2067
+ $text = $r ['text'];
 
 
 
 
2068
  }
2069
+ if ($text == '')
2070
  $text = "RSS";
2071
+ $rss_title = get_option ( 'dbem_events_page_title' );
2072
+ $url = get_bloginfo ( 'url' ) . "/?dbem_rss=main";
2073
  $link = "<a href='$url'>$text</a>";
2074
+
2075
  if ($justurl)
2076
+ $result = $url;
2077
  else
2078
  $result = $link;
2079
+ if ($echo)
2080
  echo $result;
2081
  else
2082
  return $result;
 
 
 
 
 
 
 
 
 
2083
  }
 
 
2084
 
2085
+ function dbem_rss_link_shortcode($atts) {
2086
+ extract ( shortcode_atts ( array ('justurl' => 0, 'text' => 'RSS' ), $atts ) );
2087
+ $result = dbem_rss_link ( "justurl=$justurl&echo=0&text=$text" );
2088
+ return $result;
2089
+ }
2090
+ add_shortcode ( 'events_rss_link', 'dbem_rss_link_shortcode' );
2091
 
2092
  function dbem_rss() {
2093
+ if (isset ( $_REQUEST ['dbem_rss'] ) && $_REQUEST ['dbem_rss'] == 'main') {
2094
+ header ( "Content-type: text/xml" );
2095
  echo "<?xml version='1.0'?>\n";
2096
 
2097
+ $events_page_id = get_option ( 'dbem_events_page' );
2098
+ $events_page_link = get_permalink ( $events_page_id );
2099
+ if (stristr ( $events_page_link, "?" ))
2100
+ $joiner = "&amp;";
2101
  else
2102
  $joiner = "?";
2103
 
 
2104
  ?>
2105
+ <rss version="2.0">
2106
+ <channel>
2107
+ <title><?php
2108
+ echo get_option ( 'dbem_rss_main_title' );
2109
+ ?></title>
2110
+ <link><?php
2111
+ echo $events_page_link;
2112
+ ?></link>
2113
+ <description><?php
2114
+ echo get_option ( 'dbem_rss_main_description' );
2115
+ ?></description>
2116
+ <docs>
2117
+ http://blogs.law.harvard.edu/tech/rss
2118
+ </docs>
2119
+ <generator>
2120
+ Weblog Editor 2.0
2121
+ </generator>
2122
+ <?php
2123
+ $title_format = get_option ( 'dbem_rss_title_format' );
2124
+ $description_format = str_replace ( ">", "&gt;", str_replace ( "<", "&lt;", get_option ( 'dbem_rss_description_format' ) ) );
2125
+ $events = dbem_get_events ( 5 );
2126
+ foreach ( $events as $event ) {
2127
+ $title = dbem_replace_placeholders ( $title_format, $event, "rss" );
2128
+ $description = dbem_replace_placeholders ( $description_format, $event, "rss" );
2129
+ echo "<item>";
2130
+ echo "<title>$title</title>\n";
2131
+ echo "<link>$events_page_link" . $joiner . "event_id=" . $event ['event_id'] . "</link>\n ";
2132
+ echo "<description>$description </description>\n";
2133
+ echo "</item>";
2134
+ }
2135
+ ?>
2136
 
2137
+ </channel>
2138
+ </rss>
2139
+
2140
+ <?php
2141
+ die ();
2142
  }
2143
  }
2144
+ add_action ( 'init', 'dbem_rss' );
2145
  function substitute_rss($data) {
2146
+ if (isset ( $_REQUEST ['event_id'] ))
2147
+ return get_bloginfo ( 'url' ) . "/?dbem_rss=main";
2148
  else
2149
  return $data;
2150
+ }
2151
+ function dbem_general_css() {
2152
+ $base_url = get_bloginfo ( 'url' );
2153
  echo "<link rel='stylesheet' href='$base_url/wp-content/plugins/events-manager/events_manager.css' type='text/css'/>";
2154
+
2155
  }
2156
+ add_action ( 'wp_head', 'dbem_general_css' );
2157
+ add_action ( 'admin_head', 'dbem_general_css' );
2158
  //add_filter('feed_link','substitute_rss')
2159
+
2160
+
2161
  // TODO roba da mettere nell'ordine giusto
2162
  function dbem_delete_event($event_id) {
2163
+ global $wpdb;
2164
+ $table_name = $wpdb->prefix . EVENTS_TBNAME;
2165
+ $sql = "DELETE FROM $table_name WHERE event_id = '$event_id';";
2166
+ $wpdb->query ( $sql );
2167
 
2168
  }
2169
+ add_filter ( 'favorite_actions', 'dbem_favorite_menu' );
2170
+
2171
  function dbem_favorite_menu($actions) {
2172
+ // add quick link to our favorite plugin
2173
+ $actions ['admin.php?page=new_event'] = array (__ ( 'Add an event', 'dbem' ), MIN_CAPABILITY );
2174
+ return $actions;
2175
+ }
2176
 
2177
  ////////////////////////////////////
2178
  // WP 2.7 options registration
2179
  function dbem_options_register() {
2180
+ $options = array ('dbem_events_page', 'dbem_display_calendar_in_events_page', 'dbem_use_event_end', 'dbem_event_list_item_format', 'dbem_event_page_title_format', 'dbem_single_event_format', 'dbem_list_events_page', 'dbem_events_page_title', 'dbem_no_events_message', 'dbem_location_page_title_format', 'dbem_location_baloon_format', 'dbem_single_location_format', 'dbem_location_event_list_item_format', 'dbem_location_no_events_message', 'dbem_gmap_is_active', 'dbem_rss_main_title', 'dbem_rss_main_description', 'dbem_rss_title_format', 'dbem_rss_description_format', 'dbem_gmap_key', 'dbem_map_text_format', 'dbem_rsvp_mail_notify_is_active', 'dbem_contactperson_email_body', 'dbem_respondent_email_body', 'dbem_mail_sender_name', 'dbem_smtp_username', 'dbem_smtp_password', 'dbem_default_contact_person', 'dbem_mail_sender_address', 'dbem_mail_receiver_address', 'dbem_smtp_host', 'dbem_rsvp_mail_send_method', 'dbem_rsvp_mail_port', 'dbem_rsvp_mail_SMTPAuth', 'dbem_image_max_width', 'dbem_image_max_height', 'dbem_image_max_size' );
2181
+ foreach ( $options as $opt ) {
2182
+ register_setting ( 'dbem-options', $opt, '' );
2183
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2184
 
2185
  }
2186
+ add_action ( 'admin_init', 'dbem_options_register' );
2187
 
2188
+ function dbem_alert_events_page() {
2189
+ $events_page_id = get_option ( 'dbem_events_page' );
2190
+ if (strpos ( $_SERVER ['SCRIPT_NAME'], 'page.php' ) && isset ( $_GET ['action'] ) && $_GET ['action'] == 'edit' && isset ( $_GET ['post'] ) && $_GET ['post'] == "$events_page_id") {
2191
+ $message = sprintf ( __ ( "This page corresponds to <strong>Events Manager</strong> events page. Its content will be overriden by <strong>Events Manager</strong>. If you want to display your content, you can can assign another page to <strong>Events Manager</strong> in the the <a href='%s'>Settings</a>. ", 'dbem' ), 'admin.php?page=events-manager-options' );
2192
  $notice = "<div class='error'><p>$message</p></div>";
2193
  echo $notice;
2194
  }
2195
 
2196
+ }
2197
+ add_action ( 'admin_notices', 'dbem_alert_events_page' );
2198
+
2199
+ /* Marcus Begin Edit */
2200
+ //This adds the tinymce editor
2201
+ function dbem_tinymce(){
2202
+ add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 );
2203
+ wp_enqueue_script('post');
2204
+ if ( user_can_richedit() )
2205
+ wp_enqueue_script('editor');
2206
+ add_thickbox();
2207
+ wp_enqueue_script('media-upload');
2208
+ wp_enqueue_script('word-count');
2209
+ wp_enqueue_script('quicktags');
2210
+ }
2211
+ add_action ( 'admin_init', 'dbem_tinymce' );
2212
+ /* Marcus End Edit */
2213
+
2214
  ?>
events-manager.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
- Version: 2.0rc1
5
  Plugin URI: http://davidebenini.it/wordpress-plugins/events-manager/
6
  Description: Manage events specifying precise spatial data (Location, Town, Province, etc).
7
- Author: Davide Benini
8
  Author URI: http://www.davidebenini.it/blog
9
  */
10
 
@@ -61,7 +61,10 @@ define('DEFAULT_IMAGE_MAX_SIZE', 204800);
61
  // if you are hacking this plugin, set to TRUE, a log will show in admin pages
62
  define('DEBUG', false);
63
 
64
- // INCLUDES
 
 
 
65
  include("dbem_events.php");
66
  include("dbem_calendar.php");
67
  include("dbem_widgets.php");
@@ -119,6 +122,9 @@ function dbem_install() {
119
  dbem_create_bookings_table();
120
  dbem_create_people_table();
121
  dbem_add_options();
 
 
 
122
  // if ANY 1.0 option is there AND the version options hasn't been set yet THEN launch the updat script
123
  if (get_option('dbem_events_page') && !get_option('dbem_version'))
124
  dbem_migrate_old_events();
@@ -166,6 +172,8 @@ function dbem_create_events_table() {
166
  // if ($user_level < 8) { return; }
167
 
168
  // Creating the events table
 
 
169
  $sql = "CREATE TABLE ".$table_name." (
170
  event_id mediumint(9) NOT NULL AUTO_INCREMENT,
171
  event_author mediumint(9) DEFAULT NULL,
@@ -180,8 +188,10 @@ function dbem_create_events_table() {
180
  event_contactperson_id mediumint(9) NULL,
181
  location_id mediumint(9) NOT NULL,
182
  recurrence_id mediumint(9) NULL,
 
183
  UNIQUE KEY (event_id)
184
  );";
 
185
 
186
  dbDelta($sql);
187
  //-------------- DEBUG CODE to insert a few events n the new table
@@ -590,19 +600,19 @@ function dbem_replace_placeholders($format, $event, $target="html") {
590
 
591
  $event_string = str_replace($result, $field_value , $event_string );
592
  }
593
- if (preg_match('/#_CONTACTNAME$/', $result)) {
594
- $event['event_contactperson_id'] ? $user_id = $event['event_contactperson_id'] : $user_id = get_option('dbem_default_contact_person');
595
  $name = dbem_get_user_name($user_id);
596
  $event_string = str_replace($result, $name, $event_string );
597
  }
598
  if (preg_match('/#_CONTACTEMAIL$/', $result)) {
599
  $event['event_contactperson_id'] ? $user_id = $event['event_contactperson_id'] : $user_id = get_option('dbem_default_contact_person');
600
- $email = dbem_get_user_email($user_id);
601
  $event_string = str_replace($result, dbem_ascii_encode($email), $event_string );
602
  }
603
  if (preg_match('/#_CONTACTPHONE$/', $result)) {
604
  $event['event_contactperson_id'] ? $user_id = $event['event_contactperson_id'] : $user_id = get_option('dbem_default_contact_person');
605
- $phone = dbem_get_user_phone($user_id);
606
  $event_string = str_replace($result, dbem_ascii_encode($phone), $event_string );
607
  }
608
  if (preg_match('/#_(IMAGE)/', $result)) {
@@ -626,15 +636,16 @@ function dbem_replace_placeholders($format, $event, $target="html") {
626
  // matches all PHP time placeholders for endtime
627
  if (preg_match('/^#@[dDjlNSwzWFmMntLoYy]$/', $result)) {
628
  $event_string = str_replace($result, mysql2date(ltrim($result, "#@"), $event['event_end_date']), $event_string );
629
- }
630
-
631
 
632
  // matches all PHP date placeholders
633
  if (preg_match('/^#[dDjlNSwzWFmMntLoYy]$/', $result)) {
634
  // echo "-inizio-";
635
  $event_string = str_replace($result, mysql2date(ltrim($result, "#"), $event['event_start_date']),$event_string );
636
  // echo $event_string;
637
- }
 
 
638
 
639
  // matches all PHP time placeholders
640
  if (preg_match('/^#@[aABgGhHisueIOPTZcrU]$/', $result)) {
@@ -647,8 +658,30 @@ function dbem_replace_placeholders($format, $event, $target="html") {
647
  // echo $event_string;
648
  }
649
 
 
 
 
 
 
 
 
 
650
 
651
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
652
  return $event_string;
653
 
654
  }
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
+ Version: 2.0rc2
5
  Plugin URI: http://davidebenini.it/wordpress-plugins/events-manager/
6
  Description: Manage events specifying precise spatial data (Location, Town, Province, etc).
7
+ Author: Davide Benini, Marcus Skyes
8
  Author URI: http://www.davidebenini.it/blog
9
  */
10
 
61
  // if you are hacking this plugin, set to TRUE, a log will show in admin pages
62
  define('DEBUG', false);
63
 
64
+ // INCLUDES
65
+ /* Marcus Begin Edit */
66
+ include("marcus-extras.php");
67
+ /* Marcus End Edit */
68
  include("dbem_events.php");
69
  include("dbem_calendar.php");
70
  include("dbem_widgets.php");
122
  dbem_create_bookings_table();
123
  dbem_create_people_table();
124
  dbem_add_options();
125
+ /* Marcus Begin Edit */
126
+ dbem_create_categories_table();
127
+ /* Marcus End Edit */
128
  // if ANY 1.0 option is there AND the version options hasn't been set yet THEN launch the updat script
129
  if (get_option('dbem_events_page') && !get_option('dbem_version'))
130
  dbem_migrate_old_events();
172
  // if ($user_level < 8) { return; }
173
 
174
  // Creating the events table
175
+ /* Marcus Begin Edit*/
176
+ //Added Category FK Field
177
  $sql = "CREATE TABLE ".$table_name." (
178
  event_id mediumint(9) NOT NULL AUTO_INCREMENT,
179
  event_author mediumint(9) DEFAULT NULL,
188
  event_contactperson_id mediumint(9) NULL,
189
  location_id mediumint(9) NOT NULL,
190
  recurrence_id mediumint(9) NULL,
191
+ event_category_id int(11) default NULL,
192
  UNIQUE KEY (event_id)
193
  );";
194
+ /* Marcus End Edit */
195
 
196
  dbDelta($sql);
197
  //-------------- DEBUG CODE to insert a few events n the new table
600
 
601
  $event_string = str_replace($result, $field_value , $event_string );
602
  }
603
+ if (preg_match('/#_CONTACTNAME$/', $result)) {
604
+ $event['event_contactperson_id'] ? $user_id = $event['event_contactperson_id'] : $user_id = get_option('dbem_default_contact_person');
605
  $name = dbem_get_user_name($user_id);
606
  $event_string = str_replace($result, $name, $event_string );
607
  }
608
  if (preg_match('/#_CONTACTEMAIL$/', $result)) {
609
  $event['event_contactperson_id'] ? $user_id = $event['event_contactperson_id'] : $user_id = get_option('dbem_default_contact_person');
610
+ $email = dbem_get_user_email($user_id);
611
  $event_string = str_replace($result, dbem_ascii_encode($email), $event_string );
612
  }
613
  if (preg_match('/#_CONTACTPHONE$/', $result)) {
614
  $event['event_contactperson_id'] ? $user_id = $event['event_contactperson_id'] : $user_id = get_option('dbem_default_contact_person');
615
+ $phone = dbem_get_user_phone($user_id);
616
  $event_string = str_replace($result, dbem_ascii_encode($phone), $event_string );
617
  }
618
  if (preg_match('/#_(IMAGE)/', $result)) {
636
  // matches all PHP time placeholders for endtime
637
  if (preg_match('/^#@[dDjlNSwzWFmMntLoYy]$/', $result)) {
638
  $event_string = str_replace($result, mysql2date(ltrim($result, "#@"), $event['event_end_date']), $event_string );
639
+ }
 
640
 
641
  // matches all PHP date placeholders
642
  if (preg_match('/^#[dDjlNSwzWFmMntLoYy]$/', $result)) {
643
  // echo "-inizio-";
644
  $event_string = str_replace($result, mysql2date(ltrim($result, "#"), $event['event_start_date']),$event_string );
645
  // echo $event_string;
646
+ }
647
+
648
+
649
 
650
  // matches all PHP time placeholders
651
  if (preg_match('/^#@[aABgGhHisueIOPTZcrU]$/', $result)) {
658
  // echo $event_string;
659
  }
660
 
661
+ /* Marcus Begin Edit*/
662
+ //Add a placeholder for categories
663
+ if (preg_match('/#_CATEGORY$/', $result)) {
664
+ $category = (dbem_get_event_category($event['event_id']));
665
+ $event_string = str_replace($result, $category['category_name'], $event_string );
666
+ }
667
+ /* Marcus End Edit */
668
+
669
 
670
  }
671
+ /* Marcus Begin Edit */
672
+ preg_match_all("/#@?_\{[A-Za-z0-9 -\/,\.\\\]+\}/", $format, $placeholders);
673
+ foreach($placeholders[0] as $result) {
674
+ if(substr($result, 0, 3 ) == "#@_"){
675
+ $date = 'event_end_date';
676
+ $offset = 4;
677
+ }else{
678
+ $date = 'event_start_date';
679
+ $offset = 3;
680
+ }
681
+ $event_string = str_replace($result, mysql2date(substr($result, $offset, (strlen($result)-($offset+1)) ), $event[$date]),$event_string );
682
+ }
683
+ /* Marcus End Edit */
684
+
685
  return $event_string;
686
 
687
  }
langs/dbem-cs_CZ.mo ADDED
Binary file
langs/dbem-cs_CZ.po ADDED
@@ -0,0 +1,1217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: events-manager_CZ\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2009-03-30 19:56+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Vladimír Šlachta <vladimir.slachta@slachta.cz>\n"
8
+ "Language-Team: Vladimír Šlachta <vladimir.slachta@slachta.cz>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-Language: Czech\n"
13
+ "X-Poedit-Country: CZECH REPUBLIC\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-Basepath: /Users/davidebenini/Sites/testblog/wp-content/plugins/events-manager/\n"
16
+ "X-Poedit-KeywordsList: _e;__\n"
17
+ "Plural-Forms: nplurals=3; plural=n>=2 && n<=4 ? 1 : n==1 ? 0 : 2;\n"
18
+ "X-Poedit-Bookmarks: -1,-1,10,-1,-1,-1,-1,-1,-1,-1\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ #: dbem-recurrence.php:225
22
+ msgid "Monday"
23
+ msgstr "Pondělí"
24
+
25
+ #: dbem-recurrence.php:225
26
+ msgid "Tuesday"
27
+ msgstr "Úterý"
28
+
29
+ #: dbem-recurrence.php:225
30
+ msgid "Wednesday"
31
+ msgstr "Středa"
32
+
33
+ #: dbem-recurrence.php:225
34
+ msgid "Thursday"
35
+ msgstr "Čtvrtek"
36
+
37
+ #: dbem-recurrence.php:225
38
+ msgid "Friday"
39
+ msgstr "Pátek"
40
+
41
+ #: dbem-recurrence.php:225
42
+ msgid "Saturday"
43
+ msgstr "Sobota"
44
+
45
+ #: dbem-recurrence.php:225
46
+ msgid "Sunday"
47
+ msgstr "Neděle"
48
+
49
+ #: dbem-recurrence.php:226
50
+ #, php-format
51
+ msgid "the first %s of the month"
52
+ msgstr "první %s v měsíci"
53
+
54
+ #: dbem-recurrence.php:226
55
+ #, php-format
56
+ msgid "the second %s of the month"
57
+ msgstr "druhé % v měsíci"
58
+
59
+ #: dbem-recurrence.php:226
60
+ #, php-format
61
+ msgid "the third %s of the month"
62
+ msgstr "třetí %s v měsíci"
63
+
64
+ #: dbem-recurrence.php:226
65
+ #, php-format
66
+ msgid "the fourth %s of the month"
67
+ msgstr "the fourth %s of the month"
68
+
69
+ #: dbem-recurrence.php:226
70
+ #, php-format
71
+ msgid "the last %s of the month"
72
+ msgstr "poslední %s v měsíci"
73
+
74
+ #: dbem-recurrence.php:227
75
+ #, php-format
76
+ msgid "From %1$s to %2$s"
77
+ msgstr "Od %1$s do %2$s"
78
+
79
+ #: dbem-recurrence.php:230
80
+ msgid "everyday"
81
+ msgstr "každý den"
82
+
83
+ #: dbem-recurrence.php:232
84
+ #, php-format
85
+ msgid "every %s days"
86
+ msgstr "Každé %s dny"
87
+
88
+ #: dbem-recurrence.php:242
89
+ #, php-format
90
+ msgid "every %s weeks"
91
+ msgstr "každé %s týdny"
92
+
93
+ #: dbem-recurrence.php:253
94
+ #, php-format
95
+ msgid "every %s months"
96
+ msgstr "každé %s měsíce"
97
+
98
+ #: dbem_events.php:6
99
+ #: dbem_events.php:175
100
+ msgid "Insert New Event"
101
+ msgstr "Vložit novou událost"
102
+
103
+ #: dbem_events.php:127
104
+ msgid "New recurrent event inserted!"
105
+ msgstr "Nová opakovaná událost byla vložena!"
106
+
107
+ #: dbem_events.php:131
108
+ msgid "New event successfully inserted!"
109
+ msgstr "Nová událost byla úspěšně vložena!"
110
+
111
+ #: dbem_events.php:140
112
+ msgid "Recurrence updated!"
113
+ msgstr "Opakování bylo aktualizováno!"
114
+
115
+ #: dbem_events.php:142
116
+ msgid "Something went wrong with the recurrence update..."
117
+ msgstr "Aktualizace opakování se nezdařila..."
118
+
119
+ #: dbem_events.php:150
120
+ msgid "updated"
121
+ msgstr "změněno"
122
+
123
+ #: dbem_events.php:167
124
+ msgid "Ach, there's a problem here:"
125
+ msgstr "Houstone, máme problém:"
126
+
127
+ #: dbem_events.php:178
128
+ msgid "Edit Event"
129
+ msgstr "Upravit událost"
130
+
131
+ #: dbem_events.php:193
132
+ #: dbem_events.php:969
133
+ #: dbem_events.php:1146
134
+ msgid "Reschedule"
135
+ msgstr "Přeplánovat"
136
+
137
+ #: dbem_events.php:210
138
+ msgid "Past Events"
139
+ msgstr "Minulé události"
140
+
141
+ #: dbem_events.php:213
142
+ msgid "All Events"
143
+ msgstr "Všechny události"
144
+
145
+ #: dbem_events.php:216
146
+ msgid "Future Events"
147
+ msgstr "Budoucí události"
148
+
149
+ #: dbem_events.php:250
150
+ msgid "Event Manager Options"
151
+ msgstr "Možnosti Events Manageru"
152
+
153
+ #: dbem_events.php:252
154
+ #: dbem_events.php:254
155
+ msgid "Events page"
156
+ msgstr "Strana událostí"
157
+
158
+ #: dbem_events.php:254
159
+ msgid "This option allows you to select which page to use as an events page"
160
+ msgstr "Tato volba umožňuje vybrat, která stránka bude použita jako stránka událostí"
161
+
162
+ #: dbem_events.php:255
163
+ msgid "Display calendar in events page?"
164
+ msgstr "Zobrazit kalendář na stránce s událostmi?"
165
+
166
+ #: dbem_events.php:255
167
+ msgid "This options allows to display the calendar in the events page, instead of the default list. It is recommended not to display both the calendar widget and a calendar page."
168
+ msgstr "Tato volba umožňuje zobrazit kalendář na stránce s událostmi místo předvoleného seznamu. Doporučujeme nezobrazovat současně kalendář na stránce a ve widgetu."
169
+
170
+ #: dbem_events.php:257
171
+ msgid "Events format"
172
+ msgstr "Formát událostí"
173
+
174
+ #: dbem_events.php:260
175
+ msgid "Default event list format"
176
+ msgstr "Předvolený formát seznamu událostí"
177
+
178
+ #: dbem_events.php:260
179
+ msgid "The format of any events in a list.<br/>Insert one or more of the following placeholders: <code>#_NAME</code>, <code>#_LOCATION</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_NOTES</code>.<br/> Use <code>#_LINKEDNAME</code> for the event name with a link to the given event page.<br/> Use <code>#_EVENTPAGEURL</code> to print the event page URL and make your own customised links.<br/> Use <code>#_LOCATIONPAGEURL</code> to print the location page URL and make your own customised links.<br/>To insert date and time values, use <a href=\"http://www.php.net/manual/en/function.date.php\">PHP time format characters</a> with a <code>#</code> symbol before them, i.e. <code>#m</code>, <code>#M</code>, <code>#j</code>, etc.<br/> For the end time, put <code>#@</code> in front of the character, ie. <code>#@h</code>, <code>#@i</code>, etc.<br/> Feel free to use HTML tags as <code>li</code>, <code>br</code> and so on."
180
+ msgstr "Formát všech událostí na seznamu.<br/>Vložte jeden nebo více z následujících příkazů: <code>#_NAME</code>, <code>#_LOCATION</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_NOTES</code>.<br/> Použijte <code>#_LINKEDNAME</code> pro název události s odkazem na příslušnou stránku události.<br/> Použijte <code>#_EVENTPAGEURL</code> ke zobrazení adresy stránky s událostí a vytvořte svůj vlastní přizpůsobený odkaz.<br/> Použijte <code>#_LOCATIONPAGEURL</code> ke zobrazení adresy stránky s místem konání vytvořte svůj vlastní přizpůsobený odkaz.<br/>Pro vložení datumu a času použijte <a href=\"http://www.php.net/manual/cs/function.date.php\">řetězce PHP pro formátování času</a> se symbolem<code>#</code> vpředu, např. <code>#m</code>, <code>#M</code>, <code>#j</code>, apod.<br/> Pro čas ukončení vložte <code>#@</code> vpředu, např. <code>#@h</code>, <code>#@i</code>, apod.<br/> Bez obav můžete použít HTML tagy <code>li</code>, <code>br</code> a tak dále."
181
+
182
+ #: dbem_events.php:261
183
+ msgid "Single event page title format"
184
+ msgstr "Formát stránky jednotlivé události"
185
+
186
+ #: dbem_events.php:261
187
+ msgid "The format of a single event page title. Follow the previous formatting instructions."
188
+ msgstr "Formát nadpisu stránky jednotlivé události. Dodržujte příkazy pro formátování událostí."
189
+
190
+ #: dbem_events.php:262
191
+ msgid "Default single event format"
192
+ msgstr "Přednastavený formát stránky jednotlivé události"
193
+
194
+ #: dbem_events.php:262
195
+ msgid "The format of a single event page.<br/>Follow the previous formatting instructions. <br/>Use <code>#_MAP</code> to insert a map.<br/>Use <code>#_CONTACTNAME</code>, <code>#_CONTACTEMAIL</code>, <code>#_CONTACTPHONE</code> to insert respectively the name, e-mail address and phone number of the designated contact person. <br/>Use <code>#_ADDBOOKINGFORM</code> to insert a form to allow the user to respond to your events reserving one or more places (RSVP).<br/> Use <code>#_REMOVEBOOKINGFORM</code> to insert a form where users, inserting their name and e-mail address, can remove their bookings."
196
+ msgstr "Formát stránky s jednotlivou událostí.<br/>Dodržujte příkazy pro formátování událostí. <br/>Použijte <code>#_MAP</code> pro vložení mapy.<br/>Použijte <code>#_CONTACTNAME</code>, <code>#_CONTACTEMAIL</code>, <code>#_CONTACTPHONE</code> k vložení příslušného jména, e-mailové adresy a telefonního čísla kontaktní osoby. <br/>Použijte <code>#_ADDBOOKINGFORM</code> pro vložení formuláře, který umožní zájemcům rezervovat jedno nebo více míst.<br/> Použijte <code>#_REMOVEBOOKINGFORM</code> k vložení formuláře, kde zájemci po uvedení jejich jména a e-mailové adresy budou moci zrušit rezervaci."
197
+
198
+ #: dbem_events.php:263
199
+ msgid "Show events page in lists?"
200
+ msgstr "Zobrazit stránku s událostmi na seznamu?"
201
+
202
+ #: dbem_events.php:263
203
+ msgid "Check this option if you want the events page to appear together with other pages in pages lists."
204
+ msgstr "Tuto možnost zvolte pokud budete chtít zobrazit stránku s událostmi společně s ostatními stránkami na seznamu stránek."
205
+
206
+ #: dbem_events.php:264
207
+ msgid "Events page title"
208
+ msgstr "Nadpis stránky s událostmi"
209
+
210
+ #: dbem_events.php:264
211
+ msgid "The title on the multiple events page."
212
+ msgstr "Nadpis stránky se seznamem událostí."
213
+
214
+ #: dbem_events.php:265
215
+ msgid "No events message"
216
+ msgstr "Zpráva, která se zobrazí pokud nejsou žádné události"
217
+
218
+ #: dbem_events.php:265
219
+ msgid "The message displayed when no events are available."
220
+ msgstr "Tato zpráva se zobrazí, pokud nebudou k dispozici žádné události."
221
+
222
+ #: dbem_events.php:266
223
+ msgid "Map text format"
224
+ msgstr "Formát textu na mapě"
225
+
226
+ #: dbem_events.php:266
227
+ msgid "The format the text appearing in the event page map cloud.<br/>Follow the previous formatting instructions."
228
+ msgstr "Formát textu, který se objeví na stránce události v bublině na mapě. <br/>Dodržujte příkazy pro formátování událostí."
229
+
230
+ #: dbem_events.php:270
231
+ msgid "Locations format"
232
+ msgstr "Formát místa konání"
233
+
234
+ #: dbem_events.php:272
235
+ msgid "Single location page title format"
236
+ msgstr "Formát stránky s jednotlivým místem konání"
237
+
238
+ #: dbem_events.php:272
239
+ msgid "The format of a single location page title.<br/>Follow the previous formatting instructions."
240
+ msgstr "Formát nadpisu jednotlivého místa konání.<br/>Dodržujte příkazy pro formátování událostí."
241
+
242
+ #: dbem_events.php:273
243
+ msgid "Default single location page format"
244
+ msgstr "Přednastavený formát stránky pro jednotlivá místa konání"
245
+
246
+ #: dbem_events.php:273
247
+ msgid "The format of a single location page.<br/>Insert one or more of the following placeholders: <code>#_NAME</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_DESCRIPTION</code>.<br/> Use <code>#_MAP</code> to display a map of the event location, and <code>#_IMAGE</code> to display an image of the location.<br/> Use <code>#_NEXTEVENTS</code> to insert a list of the upcoming events, <code>#_PASTEVENTS</code> for a list of past events, <code>#_ALLEVENTS</code> for a list of all events taking place in this location."
248
+ msgstr "Formát stránky jednotlivého místa konání.<br/>Vložte jeden nebo více z příkazů: <code>#_NAME</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_DESCRIPTION</code>.<br/> Použijte <code>#_MAP</code> ke zobrazení mapy místa konání a <code>#_IMAGE</code> pro obrázek.<br/> Použijte <code>#_NEXTEVENTS</code> pro vložení seznamu budoucích událostí, <code>#_PASTEVENTS</code> pro seznam minulých událostí, <code>#_ALLEVENTS</code> pro seznam všech událostí konaných v tomto místě."
249
+
250
+ #: dbem_events.php:274
251
+ msgid "Default location baloon format"
252
+ msgstr "Přednastavený formát bubliny místa konání"
253
+
254
+ #: dbem_events.php:274
255
+ msgid "The format of of the text appearing in the baloon describing the location in the map.<br/>Insert one or more of the following placeholders: <code>#_NAME</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_DESCRIPTION</code> or <code>#_IMAGE</code>."
256
+ msgstr "Formát textu, který se objeví na stránce události v bublině na mapě. <br/>Vložte jeden nebo více z příkazů: <code>#_NAME</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_DESCRIPTION</code> či <code>#_IMAGE</code>."
257
+
258
+ #: dbem_events.php:275
259
+ msgid "Default location event list format"
260
+ msgstr "Přednastavený formát seznamu událostí v daném místě"
261
+
262
+ #: dbem_events.php:275
263
+ msgid "The format of the events the list inserted in the location page through the <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> and <code>#_ALLEVENTS</code> element. <br/> Follow the events formatting instructions"
264
+ msgstr "Formát seznamu míst vložený do stránky s místy konání pomocí příkazů <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> a <code>#_ALLEVENTS</code> . <br/> Dodržujte příkazy pro formátování událostí."
265
+
266
+ #: dbem_events.php:276
267
+ msgid "Default no events message"
268
+ msgstr "Přednastavená zpráva, která se zobrazí pokud nejsou žádné událos"
269
+
270
+ #: dbem_events.php:276
271
+ msgid "The message to be displayed in the list generated by <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> and <code>#_ALLEVENTS</code> when no events are available."
272
+ msgstr "Zpráva, která se zobrazí v seznamu generované příkazy <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> a <code>#_ALLEVENTS</code> , pokud nebudou dostupné žádné události."
273
+
274
+ #: dbem_events.php:281
275
+ msgid "RSS feed format"
276
+ msgstr "Formát zasílání RSS"
277
+
278
+ #: dbem_events.php:284
279
+ msgid "RSS main title"
280
+ msgstr "Hlavní nadpis RSS"
281
+
282
+ #: dbem_events.php:284
283
+ msgid "The main title of your RSS events feed."
284
+ msgstr "Hlavní nadpis vašeho RSS kanálu pro události."
285
+
286
+ #: dbem_events.php:285
287
+ msgid "RSS main description"
288
+ msgstr "Hlavní popis RSS"
289
+
290
+ #: dbem_events.php:285
291
+ msgid "The main description of your RSS events feed."
292
+ msgstr "Hlavní popis vašeho RSS kanálu pro události"
293
+
294
+ #: dbem_events.php:286
295
+ msgid "RSS title format"
296
+ msgstr "Formát RSS nadpisu"
297
+
298
+ #: dbem_events.php:286
299
+ msgid "The format of the title of each item in the events RSS feed."
300
+ msgstr "Formát nadpisu konkrétní položky RSS události."
301
+
302
+ #: dbem_events.php:287
303
+ msgid "RSS description format"
304
+ msgstr "Formát popisu RSS"
305
+
306
+ #: dbem_events.php:287
307
+ msgid "The format of the description of each item in the events RSS feed. Follow the previous formatting instructions."
308
+ msgstr "Formát popisu konkrétní položky RSS události. Dbejte výše zmíněných pokynů pro formátování."
309
+
310
+ #: dbem_events.php:290
311
+ msgid "Maps and geotagging"
312
+ msgstr "Mapy a označování míst"
313
+
314
+ #: dbem_events.php:295
315
+ msgid "Enable Google Maps integration?"
316
+ msgstr "Povolit použití Google Maps?"
317
+
318
+ #: dbem_events.php:297
319
+ #: dbem_UI_helpers.php:68
320
+ msgid "Yes"
321
+ msgstr "Ano"
322
+
323
+ #: dbem_events.php:298
324
+ #: dbem_UI_helpers.php:69
325
+ msgid "No"
326
+ msgstr "Ne"
327
+
328
+ #: dbem_events.php:299
329
+ msgid "Check this option to enable Goggle Map integration."
330
+ msgstr "Zaškrtnout pro propojení s Google Maps."
331
+
332
+ #: dbem_events.php:303
333
+ msgid "Google Maps API Key"
334
+ msgstr "Google Maps API"
335
+
336
+ #: dbem_events.php:303
337
+ #, php-format
338
+ msgid "To display Google Maps you need a Google Maps API key. Don't worry, it's free, you can get one <a href='%s'>here</a>."
339
+ msgstr "Pro zobrazení Google Maps potřebujete klíč Google Maps API. Nebojte, je to zdarma a můžete jej získat <a href='%s'>zde</a>."
340
+
341
+ #: dbem_events.php:307
342
+ msgid "RSVP and bookings"
343
+ msgstr "Odpovědi a rezervace"
344
+
345
+ #: dbem_events.php:310
346
+ msgid "Default contact person"
347
+ msgstr "Předvolená kontaktní osoba"
348
+
349
+ #: dbem_events.php:310
350
+ msgid "Select the default contact person. This user will be employed whenever a contact person is not explicitly specified for an event"
351
+ msgstr "Vyberte předvolenou kontaktní osobu"
352
+
353
+ #: dbem_events.php:311
354
+ msgid "Enable the RSVP e-mail notifications?"
355
+ msgstr "Umožnit oznámení odpovědí e-mailem?"
356
+
357
+ #: dbem_events.php:311
358
+ msgid "Check this option if you want to receive an email when someone books places for your events."
359
+ msgstr "Zvol tuto možnost, pokud chceš zasílat e-maily po té, co si někdo rezervuje místa."
360
+
361
+ #: dbem_events.php:312
362
+ #: dbem_events.php:313
363
+ msgid "Contact person email format"
364
+ msgstr "Formát emailu pro kontaktní osobu"
365
+
366
+ #: dbem_events.php:312
367
+ msgid "The format or the email which will be sent to the contact person. Follow the events formatting instructions. <br/>Use <code>#_RESPNAME</code>, <code>#_RESPEMAIL</code> and <code>#_RESPPHONE</code> to display respectively the name, e-mail, address and phone of the respondent.<br/>Use <code>#_SPACES</code> to display the number of spaces reserved by the respondent.<br/> Use <code>#_BOOKEDSEATS</code> and <code>#_AVAILABLESEATS</code> to display respectively the number of booked and available seats."
368
+ msgstr "Formát e-mailu, který bude zaslán kontaktní osobě. Dodržujte příkazy pro formátování událostí. <br/>Použijte <code>#_RESPNAME</code>, <code>#_RESPEMAIL</code> a <code>#_RESPPHONE</code> pro zobrazení jména, e-mailu, adresy a telefonu daného zájemce.<br/>Použijte <code>#_SPACES</code> pro zobrazení počtu zájemcem rezervovaných míst.<br/> Použijte <code>#_BOOKEDSEATS</code> a <code>#_AVAILABLESEATS</code> pro zobrazení aktuálního počtu rezervovaných a volných míst."
369
+
370
+ #: dbem_events.php:313
371
+ msgid "The format or the email which will be sent to reposdent. Follow the events formatting instructions. <br/>Use <code>#_RESPNAME</code> to display the name of the respondent.<br/>Use <code>#_CONTACTNAME</code> and <code>#_CONTACTMAIL</code> a to display respectively the name and e-mail of the contact person.<br/>Use <code>#_SPACES</code> to display the number of spaces reserved by the respondent."
372
+ msgstr "Formát e-mailu, který bude zaslán zájemci. Dodržujte příkazy pro formátování událostí.<br/>Použijte <code>#_RESPNAME</code> pro zobrazení jména zájemce.<br/>Použijte <code>#_CONTACTNAME</code> a <code>#_CONTACTMAIL</code> pro zobrazení jména a e-mailu kontaktní osoby.<br/>Použijte <code>#_SPACES</code> počtu respondentem rezervovaných míst."
373
+
374
+ #: dbem_events.php:314
375
+ msgid "Notification sender name"
376
+ msgstr "Jméno odesílatele potvrzení"
377
+
378
+ #: dbem_events.php:314
379
+ msgid "Insert the display name of the notification sender."
380
+ msgstr "Vložte zobrazované jméno odesílatele potvrzení."
381
+
382
+ #: dbem_events.php:315
383
+ msgid "Notification sender address"
384
+ msgstr "E-mailová adresa odesílatele potvrzení"
385
+
386
+ #: dbem_events.php:315
387
+ msgid "Insert the address of the notification sender. It must corresponds with your gmail account user"
388
+ msgstr "Vložte adresu příjemce potvrzení."
389
+
390
+ #: dbem_events.php:316
391
+ msgid "Default notification receiver address"
392
+ msgstr "Předvolená adresa příjemce potvrzení"
393
+
394
+ #: dbem_events.php:316
395
+ msgid "Insert the address of the receiver of your notifications"
396
+ msgstr "Vložte adresu příjemce potvrzení"
397
+
398
+ #: dbem_events.php:317
399
+ msgid "The port through which you e-mail notifications will be sent. Make sure the firewall doesn't block this port"
400
+ msgstr "Port skrze který bude potvrzení odesíláno. Ujistěte se, že tento port není blokován firewallem"
401
+
402
+ #: dbem_events.php:318
403
+ msgid "Mail sending method"
404
+ msgstr "Způsob odesílání e-mailu"
405
+
406
+ #: dbem_events.php:318
407
+ msgid "PHP mail function"
408
+ msgstr "PHP mail"
409
+
410
+ #: dbem_events.php:318
411
+ msgid "Select the method to send email notification."
412
+ msgstr "Zvolte způsob zasílání potvrzovacího e-mailu"
413
+
414
+ #: dbem_events.php:319
415
+ msgid "Use SMTP authentication?"
416
+ msgstr "Vyžaduje SMTP ověření?"
417
+
418
+ #: dbem_events.php:319
419
+ msgid "SMTP authenticatio is often needed. If you use GMail, make sure to set this parameter to Yes"
420
+ msgstr "SMTP ověření je často vyžadováno. Pokud používáte GMail, ověřte si, že parametr je nastaven na Ano."
421
+
422
+ #: dbem_events.php:320
423
+ msgid "The SMTP host. Usually it corresponds to 'localhost'. If you use GMail, set this value to 'ssl://smtp.gmail.com:465'."
424
+ msgstr "SMTP host. Obvykle odpovídá 'localhost'. Pokud používáte GMail, nastavte jej 'ssl://smtp.gmail.com:465'."
425
+
426
+ #: dbem_events.php:321
427
+ msgid "SMTP username"
428
+ msgstr "SMTP uživatelské jméno"
429
+
430
+ #: dbem_events.php:321
431
+ msgid "Insert the username to be used to access your SMTP server."
432
+ msgstr "Vlož uživatelské jméno pro přístup k Tvému SMTP serveru."
433
+
434
+ #: dbem_events.php:322
435
+ msgid "SMTP password"
436
+ msgstr "Heslo pro SMTP"
437
+
438
+ #: dbem_events.php:322
439
+ msgid "Insert the password to be used to access your SMTP server"
440
+ msgstr "Vlož heslo používané pro komunikaci s SMTP serverem."
441
+
442
+ #: dbem_events.php:328
443
+ msgid "Images size"
444
+ msgstr "Velikost obrázku"
445
+
446
+ #: dbem_events.php:330
447
+ msgid "Maximum width (px)"
448
+ msgstr "Maximální šířka (px)"
449
+
450
+ #: dbem_events.php:330
451
+ msgid "The maximum allowed width for images uploades"
452
+ msgstr "Maximální dovolená šířka přidávaných obrázků"
453
+
454
+ #: dbem_events.php:331
455
+ msgid "Maximum height (px)"
456
+ msgstr "Maximální výška (px)"
457
+
458
+ #: dbem_events.php:331
459
+ msgid "The maximum allowed width for images uploaded, in pixels"
460
+ msgstr "Maximální dovolená šířka přidávaných obrázků v pixelech"
461
+
462
+ #: dbem_events.php:332
463
+ msgid "Maximum size (bytes)"
464
+ msgstr "Maximální velikost (v bytech)"
465
+
466
+ #: dbem_events.php:332
467
+ msgid "The maximum allowed size for images uploaded, in pixels"
468
+ msgstr "Maximální dovolená velikost přidávaných obrázků v pixelech"
469
+
470
+ #: dbem_events.php:339
471
+ msgid "Save Changes"
472
+ msgstr "Uložit změny"
473
+
474
+ #: dbem_events.php:821
475
+ #, php-format
476
+ msgid ""
477
+ "<p>Hey, <strong>%s</strong>, welcome to <strong>Events Manager</strong>! We hope you like it around here.</p> \n"
478
+ "\t<p>Now it's time to insert events lists through <a href='%s' title='Widgets page'>widgets</a>, <a href='%s' title='Template tags documentation'>template tags</a> or <a href='%s' title='Shortcodes documentation'>shortcodes</a>.</p>\n"
479
+ "\t<p>By the way, have you taken a look at the <a href='%s' title='Change settings'>Settings page</a>? That's where you customize the way events and locations are displayed.</p>\n"
480
+ "\t<p>What? Tired of seeing this advice? I hear you, <a href='%s' title='Don't show this advice again'>click here</a> and you won't see this again!</p>"
481
+ msgstr ""
482
+ "<p>Dobrý den <strong>%s</strong>, <strong>Events Manager</strong> Vás vítá! </p> \n"
483
+ "\t<p>Nastal čas vložit seznam událostí přes <a href='%s' title='stránku Widgetů'>widgets</a>, <a href='%s' title='Template tags documentation'>template tags</a> nebo <a href='%s' title='Shortcodes documentation'>shortcodes</a>.</p>\n"
484
+ "\t<p>Mimochodem, podíval si se na <a href='%s' title='Nastavení'>Settings page</a>? Na tomto místě si můžeš přizpůsobit zobrazení událostí a míst konání.</p>\n"
485
+ "\t<p>Copak? Lezou Ti už rady krkem? Slyším Tě, <a href='%s' title='Víckrát nezobrazovat'>klikne zde</a> a příště už to neuvidíš!</p>"
486
+
487
+ #: dbem_events.php:864
488
+ msgid "New Event ..."
489
+ msgstr "Nová událost..."
490
+
491
+ #: dbem_events.php:868
492
+ #: dbem_events.php:873
493
+ #: dbem_widgets.php:90
494
+ msgid "Past events"
495
+ msgstr "Minulé události"
496
+
497
+ #: dbem_events.php:869
498
+ #: dbem_events.php:874
499
+ #: dbem_widgets.php:89
500
+ msgid "All events"
501
+ msgstr "Všechny události"
502
+
503
+ #: dbem_events.php:870
504
+ #: dbem_events.php:875
505
+ #: dbem_widgets.php:88
506
+ msgid "Future events"
507
+ msgstr "Budoucí události"
508
+
509
+ #: dbem_events.php:882
510
+ msgid "Total"
511
+ msgstr "Celkem"
512
+
513
+ #: dbem_events.php:889
514
+ msgid "Bulk Actions"
515
+ msgstr "Hromadná akce"
516
+
517
+ #: dbem_events.php:890
518
+ msgid "Delete selected"
519
+ msgstr "Odstranit vybrané"
520
+
521
+ #: dbem_events.php:893
522
+ msgid "Apply"
523
+ msgstr "Použít"
524
+
525
+ #: dbem_events.php:905
526
+ msgid "Filter"
527
+ msgstr "Filtr"
528
+
529
+ #: dbem_events.php:920
530
+ #: dbem_events.php:1196
531
+ #: dbem_events.php:1514
532
+ #: dbem_locations.php:225
533
+ #: dbem_locations.php:233
534
+ #: dbem_people.php:90
535
+ #: dbem_rsvp.php:18
536
+ #: dbem_rsvp.php:52
537
+ msgid "Name"
538
+ msgstr "Jméno"
539
+
540
+ #: dbem_events.php:921
541
+ #: dbem_events.php:1249
542
+ #: dbem_events.php:1514
543
+ msgid "Location"
544
+ msgstr "Místo"
545
+
546
+ #: dbem_events.php:924
547
+ msgid "Date and time"
548
+ msgstr "Datum a čas"
549
+
550
+ #: dbem_events.php:936
551
+ msgid "D d M Y"
552
+ msgstr "D d M Y"
553
+
554
+ #: dbem_events.php:1062
555
+ msgid "Daily"
556
+ msgstr "Denně"
557
+
558
+ #: dbem_events.php:1062
559
+ msgid "Weekly"
560
+ msgstr "Týdně"
561
+
562
+ #: dbem_events.php:1062
563
+ msgid "Monthly"
564
+ msgstr "Měsíčně"
565
+
566
+ #: dbem_events.php:1063
567
+ msgid "Mon"
568
+ msgstr "Po"
569
+
570
+ #: dbem_events.php:1063
571
+ msgid "Tue"
572
+ msgstr "Út"
573
+
574
+ #: dbem_events.php:1063
575
+ msgid "Wed"
576
+ msgstr "St"
577
+
578
+ #: dbem_events.php:1063
579
+ msgid "Thu"
580
+ msgstr "Čt"
581
+
582
+ #: dbem_events.php:1063
583
+ msgid "Fri"
584
+ msgstr "Pá"
585
+
586
+ #: dbem_events.php:1063
587
+ msgid "Sat"
588
+ msgstr "So"
589
+
590
+ #: dbem_events.php:1063
591
+ msgid "Sun"
592
+ msgstr "Ne"
593
+
594
+ #: dbem_events.php:1065
595
+ msgid "first"
596
+ msgstr "první"
597
+
598
+ #: dbem_events.php:1065
599
+ msgid "second"
600
+ msgstr "druhý"
601
+
602
+ #: dbem_events.php:1065
603
+ msgid "third"
604
+ msgstr "třetí"
605
+
606
+ #: dbem_events.php:1065
607
+ msgid "fourth"
608
+ msgstr "čtvrtý"
609
+
610
+ #: dbem_events.php:1065
611
+ msgid "last"
612
+ msgstr "poslední"
613
+
614
+ #: dbem_events.php:1078
615
+ msgid "WARNING: This is a recurrence."
616
+ msgstr "POZOR: jedná se o opakování."
617
+
618
+ #: dbem_events.php:1079
619
+ msgid "Modifying these data all the events linked to this recurrence will be rescheduled"
620
+ msgstr "Změnou datumu budou přeplánovány všechny související opakované události"
621
+
622
+ #: dbem_events.php:1082
623
+ msgid "WARNING: This is a recurring event."
624
+ msgstr "POZOR: jedná se o opakovanou událost."
625
+
626
+ #: dbem_events.php:1083
627
+ msgid "If you change these data and save, this will become an independent event."
628
+ msgstr "Pokud změníte tyto údaje a uložíte je, změní se na nezávislou událost."
629
+
630
+ #: dbem_events.php:1095
631
+ msgid "Recurrence"
632
+ msgstr "Opakování"
633
+
634
+ #: dbem_events.php:1106
635
+ msgid "Repeated event"
636
+ msgstr "Opakovaná událost"
637
+
638
+ #: dbem_events.php:1113
639
+ #: dbem_events.php:1128
640
+ msgid "Every"
641
+ msgstr "Každý"
642
+
643
+ #: dbem_events.php:1115
644
+ msgid "day"
645
+ msgstr "den"
646
+
647
+ #: dbem_events.php:1116
648
+ msgid "days"
649
+ msgstr "dny"
650
+
651
+ #: dbem_events.php:1117
652
+ msgid "week"
653
+ msgstr "týden"
654
+
655
+ #: dbem_events.php:1118
656
+ msgid "weeks"
657
+ msgstr "týdny"
658
+
659
+ #: dbem_events.php:1119
660
+ msgid "month"
661
+ msgstr "měsíc"
662
+
663
+ #: dbem_events.php:1120
664
+ msgid "months"
665
+ msgstr "měsíce"
666
+
667
+ #: dbem_events.php:1137
668
+ msgid "Check if your event happens more than once according to a regular pattern"
669
+ msgstr "Zkontroluj, jestli se událost nekoná více než jednou v pravidelných intervalech"
670
+
671
+ #: dbem_events.php:1142
672
+ msgid "This is't a recurrent event"
673
+ msgstr "Toto je opakující se událost"
674
+
675
+ #: dbem_events.php:1159
676
+ msgid "Contact Person"
677
+ msgstr "Kontaktní osoba"
678
+
679
+ #: dbem_events.php:1161
680
+ msgid "Select..."
681
+ msgstr "Vyber..."
682
+
683
+ #: dbem_events.php:1172
684
+ msgid "Enable registration for this event"
685
+ msgstr "Povolit registraci události"
686
+
687
+ #: dbem_events.php:1179
688
+ #: dbem_rsvp.php:247
689
+ msgid "Spaces"
690
+ msgstr "Počet míst"
691
+
692
+ #: dbem_events.php:1199
693
+ msgid "The event name. Example: Birthday party"
694
+ msgstr "Název události. Např.: narozeninová oslava"
695
+
696
+ #: dbem_events.php:1206
697
+ msgid "Event date"
698
+ msgstr "Datum události"
699
+
700
+ #: dbem_events.php:1206
701
+ msgid "Recurrence dates"
702
+ msgstr "Datumy opakování"
703
+
704
+ #: dbem_events.php:1215
705
+ msgid "The event date."
706
+ msgstr "Datum události"
707
+
708
+ #: dbem_events.php:1215
709
+ msgid "The recurrence beginning and end date."
710
+ msgstr "Datum prvního a posledního konání opakované události"
711
+
712
+ #: dbem_events.php:1225
713
+ msgid "Event time"
714
+ msgstr "Čas události"
715
+
716
+ #: dbem_events.php:1231
717
+ msgid "The time of the event beginning and end"
718
+ msgstr "Čas začátku a konce události"
719
+
720
+ #: dbem_events.php:1239
721
+ msgid "Coordinates"
722
+ msgstr "Souřadnice"
723
+
724
+ #: dbem_events.php:1253
725
+ msgid "Name:"
726
+ msgstr "Název:"
727
+
728
+ #: dbem_events.php:1258
729
+ #: dbem_locations.php:160
730
+ #: dbem_locations.php:312
731
+ msgid "Map not found"
732
+ msgstr "Mapa nebyla nalezena"
733
+
734
+ #: dbem_events.php:1265
735
+ msgid "The name of the location where the event takes place. You can use the name of a venue, a square, etc"
736
+ msgstr "Název místa, kde se událost bude konat. Můžete použít např. název podniku, náměstí a pod."
737
+
738
+ #: dbem_events.php:1269
739
+ msgid "Address:"
740
+ msgstr "Adresa:"
741
+
742
+ #: dbem_events.php:1273
743
+ msgid "The address of the location where the event takes place. Example: 21, Dominick Street"
744
+ msgstr "Adresa místa, kde se akce bude konat. Příklad: Jungmanova 22"
745
+
746
+ #: dbem_events.php:1277
747
+ msgid "Town:"
748
+ msgstr "Město:"
749
+
750
+ #: dbem_events.php:1281
751
+ msgid "The town where the location is located. If you're using the Google Map integration and want to avoid geotagging ambiguities include the country in the town field. Example: Verona, Italy."
752
+ msgstr "Město, kde se událost bude konat. Pokud využíváte integraci s Google Map a chcete předejít nejednoznačnosti umístění, přidejte zemi do pole s městem. Např.: Praha, Česká republika"
753
+
754
+ #: dbem_events.php:1293
755
+ msgid "Details"
756
+ msgstr "Podrobnosti"
757
+
758
+ #: dbem_events.php:1296
759
+ msgid "Details about the event"
760
+ msgstr "Podrobnosti týkající se události"
761
+
762
+ #: dbem_events.php:1300
763
+ msgid "Submit Event"
764
+ msgstr "Uložit událost"
765
+
766
+ #: dbem_events.php:1321
767
+ msgid "Missing fields: "
768
+ msgstr "Chybějící položky:"
769
+
770
+ #: dbem_events.php:1323
771
+ msgid "Since the event is repeated, you must specify an event date."
772
+ msgstr "Jelikož se jedná o opakovanou událost, musíte upřesnit její datum."
773
+
774
+ #: dbem_events.php:1514
775
+ msgid "Date"
776
+ msgstr "Datum"
777
+
778
+ #: dbem_events.php:1514
779
+ #: dbem_locations.php:226
780
+ #: dbem_locations.php:234
781
+ msgid "Address"
782
+ msgstr "Adresa"
783
+
784
+ #: dbem_events.php:1514
785
+ #: dbem_locations.php:227
786
+ #: dbem_locations.php:235
787
+ msgid "Town"
788
+ msgstr "město"
789
+
790
+ #: dbem_events.php:1531
791
+ msgid "Some required fields are missing:"
792
+ msgstr "Některé požadované údaje chybí:"
793
+
794
+ #: dbem_events.php:1534
795
+ msgid "Since the event is repeated, you must specify an end date"
796
+ msgstr "Jelikož se událost opakuje, musíte upřesnit závěrečné datum"
797
+
798
+ #: dbem_events.php:1689
799
+ msgid "You cannot enable Google Maps integration without setting an appropriate API key."
800
+ msgstr "Nemůžete povolit použití Google Maps bez nastavení příslušného API"
801
+
802
+ #: dbem_events.php:1828
803
+ msgid "Add an event"
804
+ msgstr "Přidat událost"
805
+
806
+ #: dbem_events.php:1883
807
+ #, php-format
808
+ msgid "This page corresponds to <strong>Events Manager</strong> events page. Its content will be overriden by <strong>Events Manager</strong>. If you want to display your content, you can can assign another page to <strong>Events Manager</strong> in the the <a href='%s'>Settings</a>. "
809
+ msgstr "Tato stránka je svázána se stránkou <strong>Events Manageru</strong>. Její obsah bude přepsán<strong>Events Managerem</strong>. Pokud na ní budete chtít zobrazit Váš obsah, musíte přiřadit <strong>Events Manageru</strong> v <a href='%s'>Nastavení</a> jinou stránku. "
810
+
811
+ #: dbem_locations.php:4
812
+ msgid "The location name"
813
+ msgstr "Název místa"
814
+
815
+ #: dbem_locations.php:4
816
+ msgid "The location address"
817
+ msgstr "Adresa místa"
818
+
819
+ #: dbem_locations.php:4
820
+ msgid "The location town"
821
+ msgstr "Město"
822
+
823
+ #: dbem_locations.php:53
824
+ msgid "The location has been updated."
825
+ msgstr "Místo bylo změněno."
826
+
827
+ #: dbem_locations.php:112
828
+ msgid "Edit location"
829
+ msgstr "Upravit místo"
830
+
831
+ #: dbem_locations.php:129
832
+ #: dbem_locations.php:278
833
+ msgid "Location name"
834
+ msgstr "Název místa"
835
+
836
+ #: dbem_locations.php:131
837
+ #: dbem_locations.php:280
838
+ msgid "The name of the location"
839
+ msgstr "Název místa"
840
+
841
+ #: dbem_locations.php:135
842
+ #: dbem_locations.php:284
843
+ msgid "Location address"
844
+ msgstr "Adresa místa"
845
+
846
+ #: dbem_locations.php:137
847
+ #: dbem_locations.php:286
848
+ msgid "The address of the location"
849
+ msgstr "Adresa místa"
850
+
851
+ #: dbem_locations.php:142
852
+ #: dbem_locations.php:290
853
+ msgid "Location town"
854
+ msgstr "Město"
855
+
856
+ #: dbem_locations.php:144
857
+ msgid "The town where the location is located"
858
+ msgstr "Město, kde se událost koná"
859
+
860
+ #: dbem_locations.php:158
861
+ msgid "Location map"
862
+ msgstr "Mapa místa konání"
863
+
864
+ #: dbem_locations.php:165
865
+ #: dbem_locations.php:317
866
+ msgid "Location description"
867
+ msgstr "Popis místa konání"
868
+
869
+ #: dbem_locations.php:167
870
+ msgid "A description of the Location. You may include any kind of info here."
871
+ msgstr "Popis místa. Zde můžeš přidat jakékoliv informace."
872
+
873
+ #: dbem_locations.php:171
874
+ #: dbem_locations.php:305
875
+ msgid "Location image"
876
+ msgstr "Obrázek místa konání"
877
+
878
+ #: dbem_locations.php:176
879
+ msgid "No image uploaded for this location yet"
880
+ msgstr "Zatím nebyl k místu přidán žádný obrázek"
881
+
882
+ #: dbem_locations.php:182
883
+ msgid "Upload/change picture"
884
+ msgstr "Přidat/změnit obrázek"
885
+
886
+ #: dbem_locations.php:186
887
+ msgid "Update location"
888
+ msgstr "Aktualizovat místo"
889
+
890
+ #: dbem_locations.php:203
891
+ #: events-manager.php:448
892
+ msgid "Locations"
893
+ msgstr "Místa konání"
894
+
895
+ #: dbem_locations.php:262
896
+ msgid "No venues have been inserted yet!"
897
+ msgstr "Žádné místo zatím nebylo vloženo!"
898
+
899
+ #: dbem_locations.php:273
900
+ #: dbem_locations.php:322
901
+ msgid "Add location"
902
+ msgstr "Přidat místo"
903
+
904
+ #: dbem_locations.php:292
905
+ msgid "The town of the location"
906
+ msgstr "Město, kde se událost koná"
907
+
908
+ #: dbem_locations.php:307
909
+ msgid "Select an image to upload"
910
+ msgstr "Vyber obrázek k uložení."
911
+
912
+ #: dbem_locations.php:319
913
+ msgid "A description of the location. You may include any kind of info here."
914
+ msgstr "Popis místa. Zde můžeš přidat jakékoliv informace."
915
+
916
+ #: dbem_locations.php:392
917
+ msgid " is missing!"
918
+ msgstr " chybí!"
919
+
920
+ #: dbem_locations.php:400
921
+ msgid "The image file is too big! Maximum size:"
922
+ msgstr "soubor s obrázkem je příliš veliký! Maximální velikost může být::"
923
+
924
+ #: dbem_locations.php:405
925
+ msgid "The image is too big! Maximum size allowed:"
926
+ msgstr "Obrázek je příliš veliký! Maximální rozměry jsou:"
927
+
928
+ #: dbem_locations.php:407
929
+ msgid "The image is in a wrong format!"
930
+ msgstr "Obrázek je ve špatném formátu!"
931
+
932
+ #: dbem_locations.php:414
933
+ msgid "Ach, some problems here:"
934
+ msgstr "Ajé, tady jsou nějaké problémy:"
935
+
936
+ #: dbem_locations.php:475
937
+ msgid "The image could not be loaded"
938
+ msgstr "Obrázek nejde načíst"
939
+
940
+ #: dbem_people.php:87
941
+ msgid "Bookings data"
942
+ msgstr "Rezervační údaje"
943
+
944
+ #: dbem_people.php:91
945
+ msgid "E-mail"
946
+ msgstr "E-mail"
947
+
948
+ #: dbem_people.php:92
949
+ #: dbem_people.php:194
950
+ #: dbem_people.php:197
951
+ #: dbem_rsvp.php:20
952
+ msgid "Phone number"
953
+ msgstr "Telefon"
954
+
955
+ #: dbem_people.php:93
956
+ #: dbem_rsvp.php:21
957
+ msgid "Seats"
958
+ msgstr "Počet míst"
959
+
960
+ #: dbem_people.php:106
961
+ msgid "Booked"
962
+ msgstr "Rezervováno"
963
+
964
+ #: dbem_people.php:111
965
+ msgid "Available"
966
+ msgstr "Volných"
967
+
968
+ #: dbem_people.php:126
969
+ msgid "No people have responded to your events yet!"
970
+ msgstr "Zatím nikdo na událost nereagoval!"
971
+
972
+ #: dbem_people.php:128
973
+ msgid "This table collects the data about the people who responded to your events"
974
+ msgstr "Tato tabulka obsahuje data o lidech, kteří reagovali na událost"
975
+
976
+ #: dbem_people.php:199
977
+ msgid "The phone number used by Events Manager when the user is indicated as the contact person for an event."
978
+ msgstr "Telefonní číslo použité Events Mangerem, pokud je uživatel označen jako kontaktní osoba události."
979
+
980
+ #: dbem_rsvp.php:9
981
+ msgid "Book now!"
982
+ msgstr "Objednat!"
983
+
984
+ #: dbem_rsvp.php:19
985
+ #: dbem_rsvp.php:53
986
+ msgid "E-Mail"
987
+ msgstr "E-Mail"
988
+
989
+ #: dbem_rsvp.php:27
990
+ msgid "Send your booking"
991
+ msgstr "Odeslat rezervaci"
992
+
993
+ #: dbem_rsvp.php:44
994
+ #: dbem_rsvp.php:56
995
+ msgid "Cancel your booking"
996
+ msgstr "Zrušit rezervaci"
997
+
998
+ #: dbem_rsvp.php:88
999
+ msgid "There are no bookings associated to this name and e-mail"
1000
+ msgstr "Neexistuje rezervaci přiřazená k tomuto jménu a e-mailu"
1001
+
1002
+ #: dbem_rsvp.php:113
1003
+ msgid "Your booking has been recorded"
1004
+ msgstr "Vaše rezervace byla přijata"
1005
+
1006
+ #: dbem_rsvp.php:120
1007
+ msgid "Sorry, there aren't so many seats available!"
1008
+ msgstr "Bohužel, již nejsou volná místa!"
1009
+
1010
+ #: dbem_rsvp.php:163
1011
+ msgid "Booking deleted"
1012
+ msgstr "Rezervace byla zrušena."
1013
+
1014
+ #: dbem_rsvp.php:240
1015
+ msgid "responses so far"
1016
+ msgstr "Odpovědí do teď"
1017
+
1018
+ #: dbem_rsvp.php:246
1019
+ msgid "Responder"
1020
+ msgstr "Zájemce"
1021
+
1022
+ #: dbem_rsvp.php:252
1023
+ msgid "Booked spaces"
1024
+ msgstr "Rezervovaných míst"
1025
+
1026
+ #: dbem_rsvp.php:253
1027
+ msgid "Available spaces"
1028
+ msgstr "Volných míst"
1029
+
1030
+ #: dbem_rsvp.php:274
1031
+ msgid "Printable view"
1032
+ msgstr "Tiskový náhled"
1033
+
1034
+ #: dbem_rsvp.php:282
1035
+ msgid "No responses yet!"
1036
+ msgstr "Zatím žádné odpovědi!"
1037
+
1038
+ #: dbem_rsvp.php:353
1039
+ msgid "New booking"
1040
+ msgstr "Nová rezervace"
1041
+
1042
+ #: dbem_rsvp.php:354
1043
+ msgid "Reservation confirmed"
1044
+ msgstr "Rezervace potvrzena"
1045
+
1046
+ #: dbem_widgets.php:10
1047
+ #: dbem_widgets.php:35
1048
+ #: events-manager.php:44
1049
+ #: events-manager.php:398
1050
+ #: events-manager.php:399
1051
+ #: events-manager.php:444
1052
+ msgid "Events"
1053
+ msgstr "Události"
1054
+
1055
+ #: dbem_widgets.php:19
1056
+ #: events-manager.php:50
1057
+ #: events-manager.php:391
1058
+ msgid "No events"
1059
+ msgstr "Žádné události"
1060
+
1061
+ #: dbem_widgets.php:78
1062
+ #: dbem_widgets.php:156
1063
+ msgid "Title"
1064
+ msgstr "Název"
1065
+
1066
+ #: dbem_widgets.php:82
1067
+ msgid "Number of events"
1068
+ msgstr "Počet událostí"
1069
+
1070
+ #: dbem_widgets.php:86
1071
+ msgid "Scope of the events"
1072
+ msgstr "Zaměření událostí"
1073
+
1074
+ #: dbem_widgets.php:94
1075
+ msgid "Order of the events"
1076
+ msgstr "Pořadí událostí"
1077
+
1078
+ #: dbem_widgets.php:96
1079
+ msgid "Ascendant"
1080
+ msgstr "Předchozí"
1081
+
1082
+ #: dbem_widgets.php:97
1083
+ msgid "Descendant"
1084
+ msgstr "Následující"
1085
+
1086
+ #: dbem_widgets.php:101
1087
+ msgid "List item format"
1088
+ msgstr "Formát výpisu"
1089
+
1090
+ #: dbem_widgets.php:122
1091
+ msgid "calendar"
1092
+ msgstr "kalendář"
1093
+
1094
+ #: dbem_widgets.php:176
1095
+ #: dbem_widgets.php:177
1096
+ msgid "Events List"
1097
+ msgstr "Seznam událostí"
1098
+
1099
+ #: dbem_widgets.php:178
1100
+ #: dbem_widgets.php:179
1101
+ msgid "Events Calendar"
1102
+ msgstr "Kalendář událostí"
1103
+
1104
+ #: events-manager.php:55
1105
+ msgid "<li>No events in this location</li>"
1106
+ msgstr "<li>V tomto místě není bohužel zatím plánována žádná událost</li>"
1107
+
1108
+ #: events-manager.php:382
1109
+ msgid "#_RESPNAME (#_RESPEMAIL) will attend #_NAME on #m #d, #Y. He wants to reserve #_SPACES spaces.<br/> Now there are #_RESERVEDSPACES spaces reserved, #_AVAILABLESPACES are still available.<br/>Yours faithfully,<br/>Events Manager"
1110
+ msgstr "#_RESPNAME (#_RESPEMAIL) se zúčastní #_NAME dne #m #d, #Y. Požaduje rezervaci #_SPACES míst.<br/> Nyní je rezervováno #_RESERVEDSPACES míst, #_AVAILABLESPACES je stále volných.<br/>S pozdravem,<br/>Events Manager"
1111
+
1112
+ #: events-manager.php:383
1113
+ msgid "Dear #_RESPNAME, <br/>you have successfully reserved #_SPACES space/spaces for #_NAME.<br/>Yours faithfully,<br/> #_CONTACTPERSON"
1114
+ msgstr "Vážená/ý #_RESPNAME, <br/>úspěšně jste rezervoval #_SPACES místo pro #_NAME.<br/>Děkujeme za rezervaci!<br/><br/>S pozdravem,<br/> #_CONTACTPERSON"
1115
+
1116
+ #: events-manager.php:433
1117
+ msgid "events"
1118
+ msgstr "Události"
1119
+
1120
+ #: events-manager.php:446
1121
+ msgid "Edit"
1122
+ msgstr "Upravit"
1123
+
1124
+ #: events-manager.php:447
1125
+ msgid "Add new"
1126
+ msgstr "Přidat nový"
1127
+
1128
+ #: events-manager.php:449
1129
+ msgid "People"
1130
+ msgstr "Účastníci"
1131
+
1132
+ #: events-manager.php:451
1133
+ msgid "Events Manager Settings"
1134
+ msgstr "Nastavení Events Managera"
1135
+
1136
+ #: events-manager.php:451
1137
+ msgid "Settings"
1138
+ msgstr "Nastavení"
1139
+
1140
+ #~ msgid "end date before begin date"
1141
+ #~ msgstr "la data finale precede quella iniziale"
1142
+ #~ msgid "Example:"
1143
+ #~ msgstr "Esempio: "
1144
+ #~ msgid "Example: 2008-11-28"
1145
+ #~ msgstr "Esempio: 2008-11-28"
1146
+ #~ msgid "The format the text appearing in the map cloud."
1147
+ #~ msgstr "Il fomato del testo del fumetto che appare sulla mappa."
1148
+ #~ msgid "Follow the previous formatting instructions."
1149
+ #~ msgstr "Seguire le istruzioni di formattazione precedenti."
1150
+ #~ msgid "here"
1151
+ #~ msgstr "questa pagina"
1152
+ #~ msgid "The format of a single location page title."
1153
+ #~ msgstr "Il formato del titolo della pagina di un singolo luogo."
1154
+
1155
+ #, fuzzy
1156
+ #~ msgid "Location picture"
1157
+ #~ msgstr "Luogo"
1158
+ #~ msgid "M_Monday_initial"
1159
+ #~ msgstr "L"
1160
+ #~ msgid "T_Tuesday_initial"
1161
+ #~ msgstr "M"
1162
+ #~ msgid "F_Friday_initial"
1163
+ #~ msgstr "V"
1164
+ #~ msgid "S_Sunday_initial"
1165
+ #~ msgstr "D"
1166
+ #~ msgid "The format of any events in a list."
1167
+ #~ msgstr "Il formato di ciascun evento della lista."
1168
+ #~ msgid ""
1169
+ #~ "Insert one or more of the following placeholders: <code>#_NAME</code>, "
1170
+ #~ "<code>#_LOCATION</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, "
1171
+ #~ "<code>#_NOTES</code>. Use <code>#_LINKEDNAME</code> for the event name "
1172
+ #~ "with a link to the given event page. Use #_URL to print the event URL and "
1173
+ #~ "make your own customised links."
1174
+ #~ msgstr ""
1175
+ #~ "Inserire uno o più dei seguenti segnaposto: <code>#_NAME</code>, "
1176
+ #~ "<code>#_LOCATION</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, "
1177
+ #~ "<code>#_NOTES</code>. Utilizzare <code>#_LINKEDNAME</code> per il nome "
1178
+ #~ "dell'evento con un link alla pagina corrispondente. Utilizzare #_URL per "
1179
+ #~ "visualizzare l'URL dell'evento e creare link personalizzati."
1180
+ #~ msgid ""
1181
+ #~ "To insert date and time values, use <a href=\"http://www.php.net/manual/"
1182
+ #~ "en/function.date.php\">PHP time format characters</a> with a # symbol "
1183
+ #~ "before them, i.e. #m. #M, #j, etc. "
1184
+ #~ msgstr ""
1185
+ #~ "Per inserire valori di data e ora, utilizzare i <a href=\"http://www.php."
1186
+ #~ "net/manual/it/function.date.php\">caratteri di stringa formato PHP</a> "
1187
+ #~ "anteponendo ad essi un #, ad esempio #m. #M, #j, etc. "
1188
+ #~ msgid "Use HTML tags as <code>li</code>, <code>br</code>, etc."
1189
+ #~ msgstr ""
1190
+ #~ "Utilizzare liberamente tag HTML come <code>li</code>, <code>br</code>, "
1191
+ #~ "ecc."
1192
+ #~ msgid "Use <code>#_MAP</code> to insert a map."
1193
+ #~ msgstr "Utilizzare <code>#_MAP</code> per inserire una mappa."
1194
+ #~ msgid "The format of the description of each item in the events RSS feed."
1195
+ #~ msgstr "Il formato della descrizione di ciascun elemento nel feed RSS."
1196
+ #~ msgid "ID"
1197
+ #~ msgstr "ID"
1198
+ #~ msgid "Time"
1199
+ #~ msgstr "Ora"
1200
+ #~ msgid "Latitude"
1201
+ #~ msgstr "Latitudine"
1202
+ #~ msgid "Longitude"
1203
+ #~ msgstr "Longitudine"
1204
+ #~ msgid "Are you sure?"
1205
+ #~ msgstr "Sei sicuro?"
1206
+ #~ msgid "Delete"
1207
+ #~ msgstr "Elimina"
1208
+ #~ msgid "Notes"
1209
+ #~ msgstr "Note"
1210
+ #~ msgid ""
1211
+ #~ "You are about to delete this event.\\n 'Cancel' to stop, 'OK' to delete."
1212
+ #~ msgstr ""
1213
+ #~ "Stai per cancellare questo evento.\\n \\'Cancel\\' per annullare "
1214
+ #~ "l'opererazione, \\'Ok\\' per cancellare."
1215
+ #~ msgid "Widget Title"
1216
+ #~ msgstr "Titolo"
1217
+
marcus-extras.php ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ define('DBEM_CATEGORIES_TBNAME', 'dbem_categories');
3
+
4
+ //Add the categories table
5
+ function dbem_create_categories_table() {
6
+
7
+ global $wpdb, $user_level;
8
+ $table_name = $wpdb->prefix.DBEM_CATEGORIES_TBNAME;
9
+
10
+ if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
11
+ // Creating the events table
12
+ $sql = "CREATE TABLE ".$table_name." (
13
+ category_id int(11) NOT NULL auto_increment,
14
+ category_name tinytext NOT NULL,
15
+ PRIMARY KEY (category_id)
16
+ );";
17
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
18
+ dbDelta($sql);
19
+ }
20
+ }
21
+
22
+ // Create the Manage Events and the Options submenus
23
+ add_action('admin_menu','dbem_add_to_events_submenu', 100);
24
+ function dbem_add_to_events_submenu () {
25
+ if(function_exists('add_submenu_page')) {
26
+ $file = dirname(__FILE__).DIRECTORY_SEPARATOR."events-manager.php";
27
+ add_submenu_page($file, __('Event Categories','dbem'),__('Categories','dbem'), SETTING_CAPABILITY, "events-manager-categories", dbem_categories_subpanel);
28
+ }
29
+ }
30
+
31
+
32
+ function dbem_duplicate_event($event_ID) {
33
+ global $wpdb, $EZSQL_ERROR;
34
+ //First, duplicate.
35
+ $event_table_name = $wpdb->prefix . EVENTS_TBNAME;
36
+ $eventArray = $wpdb->get_row("SELECT * FROM {$event_table_name} WHERE event_id={$event_ID}", ARRAY_A );
37
+ unset($eventArray['event_id']);
38
+ $result = $wpdb->insert($event_table_name, $eventArray);
39
+ if($result !== false){
40
+ //Get the ID of the new item
41
+ $event_ID = $wpdb->insert_id;
42
+ $event = dbem_get_event ( $event_ID );
43
+ $event['event_id'] = $event_ID;
44
+ //Now we edit the duplicated item
45
+ $title = __ ( "Edit Event", 'dbem' ) . " '" . $event ['event_name'] . "'";
46
+ echo "<div id='message' class='updated below-h2'>You are now editing the duplicated event.</div>";
47
+ dbem_event_form ( $event, $title, $event_ID );
48
+ }else{
49
+ echo "<div class='error'><p>There was an error duplicating the event. Try again maybe? Here are the errors:</p>";
50
+ foreach($EZSQL_ERROR as $errorArray){
51
+ echo "<p>{$errorArray['error_str']}</p>";
52
+ }
53
+ echo "</div>";
54
+ $scope = $_GET ['scope'];
55
+ $offset = $_GET ['offset'];
56
+ $order = $_GET ['order'];
57
+ $limit = 20;
58
+ $events = dbem_get_events ( $limit, $scope, $order, $offset );
59
+ dbem_events_table ( $events, $limit, $title );
60
+ }
61
+ }
62
+
63
+ function dbem_categories_subpanel() {
64
+ global $wpdb;
65
+
66
+ if(isset($_GET['action']) && $_GET['action'] == "edit") {
67
+ // edit category
68
+ dbem_categories_edit_layout();
69
+ } else {
70
+ // Insert/Update/Delete Record
71
+ $categories_table = $wpdb->prefix.DBEM_CATEGORIES_TBNAME;
72
+ if( isset($_POST['action']) && $_POST['action'] == "edit" ) {
73
+ // category update required
74
+ $category = array();
75
+ $category['category_name'] = $_POST['category_name'];
76
+ $validation_result = $wpdb->update( $categories_table, $category, array('category_id' => $_POST['category_ID']) );
77
+ } elseif( isset($_POST['action']) && $_POST['action'] == "add" ) {
78
+ // Add a new category
79
+ $category = array();
80
+ $category['category_name'] = $_POST['category_name'];
81
+ $validation_result = $wpdb->insert($categories_table, $category);
82
+ } elseif( isset($_POST['action']) && $_POST['action'] == "delete" ) {
83
+ // Delete category or multiple
84
+ $categories = $_POST['categories'];
85
+ if(is_array($categories)){
86
+ //Make sure the array is only numbers
87
+ foreach ($categories as $cat_id){
88
+ if(is_numeric($cat_id)){
89
+ $cats[] = "category_id = $cat_id";
90
+ }
91
+ }
92
+ //Run the query if we have an array of category ids
93
+ if(count($cats > 0)){
94
+ $validation_result = $wpdb->query( "DELETE FROM $categories_table WHERE ". implode(" OR ", $cats) );
95
+ }else{
96
+ $validation_result = false;
97
+ $message = "Couldn't delete the categories. Incorrect category IDs supplied. Please try agian.";
98
+ }
99
+ }
100
+ }
101
+ //die(print_r($_POST));
102
+ if ( is_numeric($validation_result) ) {
103
+ $message = (isset($message)) ? $message : __("Successfully {$_POST['action']}ed category", "dbem");
104
+ dbem_categories_table_layout($message);
105
+ } elseif ( $validation_result === false ) {
106
+ $message = (isset($message)) ? $message : __("There was a problem {$_POST['action']}ing your category, please try again.");
107
+ dbem_categories_table_layout($message);
108
+ } else {
109
+ // no action, just a categories list
110
+ dbem_categories_table_layout();
111
+ }
112
+ }
113
+ }
114
+
115
+ function dbem_categories_table_layout($message = "") {
116
+ $categories = dbem_get_categories();
117
+ $destination = get_bloginfo('url')."/wp-admin/admin.php";
118
+ $table = "
119
+ <div class='wrap nosubsub'>\n
120
+ <div id='icon-edit' class='icon32'>
121
+ <br/>
122
+ </div>
123
+ <h2>".__('Categories', 'dbem')."</h2>\n ";
124
+
125
+ if($message != "") {
126
+ $table .= "
127
+ <div id='message' class='updated fade below-h2' style='background-color: rgb(255, 251, 204);'>
128
+ <p>$message</p>
129
+ </div>";
130
+ }
131
+
132
+ $table .= "
133
+ <div id='col-container'>\n
134
+
135
+ <?-- begin col-right -->\n
136
+ <div id='col-right'>\n
137
+ <div class='col-wrap'>\n
138
+ <form id='bookings-filter' method='post' action='".get_bloginfo('url')."/wp-admin/admin.php?page=events-manager-categories'>\n
139
+ <input type='hidden' name='action' value='delete'/>\n";
140
+
141
+ if (count($categories)>0) {
142
+ $table .= "<table class='widefat'>\n
143
+ <thead>\n
144
+ <tr>\n
145
+ <th class='manage-column column-cb check-column' scope='col'><input type='checkbox' class='select-all' value='1'/></th>\n
146
+ <th>".__('ID', 'dbem')."</th>\n
147
+ <th>".__('Name', 'dbem')."</th>\n
148
+ </tr>\n
149
+ </thead>\n
150
+ <tfoot>\n
151
+ <tr>\n
152
+ <th class='manage-column column-cb check-column' scope='col'><input type='checkbox' class='select-all' value='1'/></th>\n
153
+ <th>".__('ID', 'dbem')."</th>\n
154
+ <th>".__('Name', 'dbem')."</th>\n
155
+ </tr>\n
156
+ </tfoot>\n
157
+ <tbody>\n";
158
+ foreach ($categories as $this_category) {
159
+ $table .= "
160
+ <tr>\n
161
+ <td><input type='checkbox' class ='row-selector' value='".$this_category['category_id']."' name='categories[]'/></td>\n
162
+ <td><a href='".get_bloginfo('url')."/wp-admin/admin.php?page=events-manager-categories&amp;action=edit&amp;category_ID=".$this_category['category_id']."'>".$this_category['category_id']."</a></td>\n
163
+ <td><a href='".get_bloginfo('url')."/wp-admin/admin.php?page=events-manager-categories&amp;action=edit&amp;category_ID=".$this_category['category_id']."'>".$this_category['category_name']."</a></td>\n
164
+ </tr>\n
165
+ ";
166
+ }
167
+ $table .= "
168
+ </tbody>\n
169
+
170
+ </table>\n
171
+
172
+ <div class='tablenav'>\n
173
+ <div class='alignleft actions'>\n
174
+ <input class='button-secondary action' type='submit' name='doaction2' value='Delete'/>\n
175
+ <br class='clear'/>\n
176
+ </div>\n
177
+ <br class='clear'/>\n
178
+ </div>\n";
179
+ } else {
180
+ $table .= "<p>".__('No categories have been inserted yet!', 'dbem');
181
+ }
182
+ $table .= "
183
+ </form>\n
184
+ </div>\n
185
+ </div>
186
+ <?-- end col-right -->\n
187
+
188
+ <?-- begin col-left -->
189
+ <div id='col-left'>\n
190
+ <div class='col-wrap'>\n
191
+ <div class='form-wrap'>\n
192
+ <div id='ajax-response'/>
193
+ <h3>".__('Add category', 'dbem')."</h3>\n
194
+ <form name='add' id='add' method='post' action='admin.php?page=events-manager-categories' class='add:the-list: validate'>\n
195
+ <input type='hidden' name='action' value='add' />\n
196
+ <div class='form-field form-required'>\n
197
+ <label for='category_name'>".__('Category name', 'dbem')."</label>\n
198
+ <input id='category-name' name='category_name' id='category_name' type='text' value='".$new_category['category_name']."' size='40' />\n
199
+ <p>".__('The name of the category', 'dbem').".</p>\n
200
+ </div>\n
201
+ <p class='submit'><input type='submit' class='button' name='submit' value='".__('Add category', 'dbem')."' /></p>\n
202
+ </form>\n
203
+
204
+ </div>\n
205
+ </div>\n
206
+ </div>
207
+ <?-- end col-left -->\n
208
+ </div>\n
209
+ </div>\n";
210
+
211
+ echo $table;
212
+ }
213
+
214
+
215
+ function dbem_categories_edit_layout($message = "") {
216
+ $category_id = $_GET['category_ID'];
217
+ $category = dbem_get_category($category_id);
218
+ $layout = "
219
+ <div class='wrap'>
220
+ <div id='icon-edit' class='icon32'>
221
+ <br/>
222
+ </div>
223
+
224
+ <h2>".__('Edit category', 'dbem')."</h2>";
225
+
226
+ if($message != "") {
227
+ $layout .= "
228
+ <div id='message' class='updated fade below-h2' style='background-color: rgb(255, 251, 204);'>
229
+ <p>$message</p>
230
+ </div>";
231
+ }
232
+ $layout .= "
233
+ <div id='ajax-response'></div>
234
+
235
+ <form name='editcat' id='editcat' method='post' action='admin.php?page=events-manager-categories' class='validate'>
236
+ <input type='hidden' name='action' value='edit' />
237
+ <input type='hidden' name='category_ID' value='".$category['category_id']."'/>";
238
+
239
+ $layout .= "
240
+ <table class='form-table'>
241
+ <tr class='form-field form-required'>
242
+ <th scope='row' valign='top'><label for='category_name'>".__('Category name', 'dbem')."</label></th>
243
+ <td><input name='category_name' id='category-name' type='text' value='".$category['category_name']."' size='40' /><br />
244
+ ".__('The name of the category', 'dbem')."</td>
245
+ </tr>
246
+ </table>
247
+ <p class='submit'><input type='submit' class='button-primary' name='submit' value='".__('Update category', 'dbem')."' /></p>
248
+ </form>
249
+
250
+
251
+ </div>
252
+
253
+ ";
254
+ echo $layout;
255
+ }
256
+
257
+ function dbem_get_categories(){
258
+ global $wpdb;
259
+ $categories_table = $wpdb->prefix.DBEM_CATEGORIES_TBNAME;
260
+ return $wpdb->get_results("SELECT * FROM $categories_table", ARRAY_A);
261
+ }
262
+
263
+ function dbem_get_category($category_id) {
264
+ global $wpdb;
265
+ $categories_table = $wpdb->prefix.DBEM_CATEGORIES_TBNAME;
266
+ $sql = "SELECT * FROM $categories_table WHERE category_id ='$category_id'";
267
+ $category = $wpdb->get_row($sql, ARRAY_A);
268
+ return $category;
269
+ }
270
+
271
+ function dbem_get_event_category($event_id) {
272
+ global $wpdb;
273
+ $event_table = $wpdb->prefix.EVENTS_TBNAME;
274
+ $sql = "SELECT category_id, category_name FROM $event_table LEFT JOIN ".$wpdb->prefix.DBEM_CATEGORIES_TBNAME." ON category_id=event_category_id WHERE event_id ='$event_id'";
275
+ $category = $wpdb->get_row($sql, ARRAY_A);
276
+ return $category;
277
+ }
278
+
279
+ ?>
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Events Manager ===
2
- Contributors: nutsmuggler
3
  Donate link: http://davidebenini.it
4
  Tags: events, manager, calendar, gigs, concert, maps, geotagging
5
  Requires at least: 2.7
6
- Tested up to: 2.7.1
7
- Stable tag: 2.0rc1
8
 
9
  Manage events and display them in your blog. Includes recurring events, location management, calendar, Google map integration, RSVP.
10
 
@@ -18,7 +18,7 @@ Events Manager provides also a RSS feed, to keep your subscribers updated about
18
 
19
  Events manager is fully customisable; you can customise the amount of data displayed and their format in events lists, pages and in the RSS feed. You can choose to show or hide the events page, and change its title.
20
 
21
- Events Manager is fully localisable and aòlready localised in Italian, Spanish, German and Swedish.
22
 
23
  For more information visit the [Documentation Page](http://davidebenini.it/wordpress-plugins/events-manager/) and [Support Forum](http://davidebenini.it/events-manager-forum/).
24
 
@@ -166,4 +166,17 @@ Added a dbem\_is\_rsvpable() conditional template tag
166
  Fixed a css bug with some themes, preventing the correct visualisation of the map.
167
  Fixed MySql bugs in the main view and in the activation page
168
  Added the proper expanded PHP tags
169
- Fixed links in the RSS feed
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  === Events Manager ===
2
+ Contributors: nutsmuggler, netweblogic
3
  Donate link: http://davidebenini.it
4
  Tags: events, manager, calendar, gigs, concert, maps, geotagging
5
  Requires at least: 2.7
6
+ Tested up to: 2.8.3
7
+ Stable tag: 2.0rc2
8
 
9
  Manage events and display them in your blog. Includes recurring events, location management, calendar, Google map integration, RSVP.
10
 
18
 
19
  Events manager is fully customisable; you can customise the amount of data displayed and their format in events lists, pages and in the RSS feed. You can choose to show or hide the events page, and change its title.
20
 
21
+ Events Manager is fully localisable and already localised in Italian, Spanish, German and Swedish.
22
 
23
  For more information visit the [Documentation Page](http://davidebenini.it/wordpress-plugins/events-manager/) and [Support Forum](http://davidebenini.it/events-manager-forum/).
24
 
166
  Fixed a css bug with some themes, preventing the correct visualisation of the map.
167
  Fixed MySql bugs in the main view and in the activation page
168
  Added the proper expanded PHP tags
169
+ Fixed links in the RSS feed
170
+
171
+ 2.0rc2
172
+ Marcus Skies jumps in as a contributor
173
+ Made the edit page WP 2.8 compatible (CSS tags)
174
+ Added a "Duplicate Event", since your reoccurring event doesn't give perfect date flexibility
175
+ Added a Category option, so you can categorize each event
176
+ Manage categories with own subpanel
177
+ DDM available in event page (like with people)
178
+ Added shortcode option in event_list, so category=ID is an option now
179
+ Added #_CATEGORY as a placeholder
180
+ Added the TinyMCE of wordpress to the description of the event. That solves the problem of adding pictures!
181
+ Added an end date option always on for multi-day events.
182
+ Added a new placeholder format to deal with the end date. You can now wrap dates in #_{} or #@_{} . The values inside will have a format of date(). For example #_{Y-m-d} #@_{ \u\n\t\i\l Y-m-d} will show as "2009-03-23 until 2009-03-28" (only for end dates with no recurrence) or just "2009-03-23" for normal events.