Events Manager - Version 2.0b4

Version Description

Download this release

Release Info

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

Code changes from version 2.0b3 to 2.0b4

Files changed (5) hide show
  1. dbem_events.php +2 -3
  2. dbem_locations.php +1 -1
  3. dbem_rsvp.php +1 -1
  4. events-manager.php +42 -6
  5. readme.txt +9 -1
dbem_events.php CHANGED
@@ -1003,9 +1003,9 @@ function dbem_events_table($events, $limit, $title) {
1003
  echo "COUNT = $count BACKWARD = $backward FORWARD = $forward<br> -- OFFSET = $offset" ;
1004
  echo "<div id='events-pagination'> ";
1005
  if ($backward < $events_count)
1006
- echo "<a style='float: left' href='".get_bloginfo('url')."/wp-admin/edit.php?page=eventmanager.php&amp;scope=$scope&offset=$backward'>&lt;&lt;</a>" ;
1007
  if ($forward >= 0)
1008
- echo "<a style='float: right' href='".get_bloginfo('url')."/wp-admin/edit.php?page=eventmanager.php&amp;scope=$scope&offset=$forward'>&gt;&gt;</a>";
1009
  echo "</div>" ;
1010
  }
1011
  ?>
@@ -1764,7 +1764,6 @@ function dbem_rss() {
1764
 
1765
  </channel>
1766
  </rss>
1767
- </code>
1768
 
1769
  <?php
1770
  die();
1003
  echo "COUNT = $count BACKWARD = $backward FORWARD = $forward<br> -- OFFSET = $offset" ;
1004
  echo "<div id='events-pagination'> ";
1005
  if ($backward < $events_count)
1006
+ 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>" ;
1007
  if ($forward >= 0)
1008
+ 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>";
1009
  echo "</div>" ;
1010
  }
1011
  ?>
1764
 
1765
  </channel>
1766
  </rss>
 
1767
 
1768
  <?php
1769
  die();
dbem_locations.php CHANGED
@@ -495,7 +495,7 @@ function dbem_global_map($atts) {
495
  ), $atts));
496
  $events_page = dbem_get_events_page(true, false);
497
  $gmaps_key = get_option('dbem_gmap_key');
498
- $result = "<h3>Mappa totale</h3>";
499
  $result .= "<div id='dbem_global_map' style='width: {$width}px; height: {$height}px'>map</div>";
500
  $result .= "<script type='text/javascript'>
501
  <!--//
495
  ), $atts));
496
  $events_page = dbem_get_events_page(true, false);
497
  $gmaps_key = get_option('dbem_gmap_key');
498
+ $result = "";
499
  $result .= "<div id='dbem_global_map' style='width: {$width}px; height: {$height}px'>map</div>";
500
  $result .= "<script type='text/javascript'>
501
  <!--//
dbem_rsvp.php CHANGED
@@ -151,7 +151,7 @@ function dbem_record_booking($event_id, $person_id, $seats) {
151
  if(true) {
152
  $sql = "INSERT INTO $bookings_table (event_id, person_id, booking_seats) VALUES ($event_id, $person_id, $seats)";
153
  $wpdb->query($sql);
154
- echo $sql;
155
  }
156
  }
157
  }
151
  if(true) {
152
  $sql = "INSERT INTO $bookings_table (event_id, person_id, booking_seats) VALUES ($event_id, $person_id, $seats)";
153
  $wpdb->query($sql);
154
+ // echo $sql;
155
  }
156
  }
157
  }
events-manager.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
- Version: 2.0b3
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
@@ -177,13 +177,13 @@ function dbem_create_events_table() {
177
  // Creating the events table
178
  $sql = "CREATE TABLE ".$table_name." (
179
  event_id mediumint(9) NOT NULL AUTO_INCREMENT,
180
- event_author mediumint(9) NOT NULL,
181
  event_name tinytext NOT NULL,
182
  event_start_time time NOT NULL,
183
  event_end_time time NOT NULL,
184
  event_start_date date NOT NULL,
185
  event_end_date date NULL,
186
- event_notes text NOT NULL,
187
  event_rsvp bool NOT NULL DEFAULT 0,
188
  event_seats tinyint,
189
  event_contactperson_id mediumint(9) NULL,
@@ -227,7 +227,11 @@ function dbem_create_events_table() {
227
  maybe_add_column($table_name, 'event_seats', "alter table $table_name add event_seats tinyint NULL;");
228
  maybe_add_column($table_name, 'location_id', "alter table $table_name add location_id mediumint(9) NOT NULL;");
229
  maybe_add_column($table_name, 'recurrence_id', "alter table $table_name add recurrence_id mediumint(9) NULL;");
230
- maybe_add_column($table_name, 'event_contactperson_id', "alter table $table_name add event_contactperson_id mediumint(9) NULL;");
 
 
 
 
231
  }
232
  }
233
 
@@ -450,7 +454,7 @@ function dbem_create_events_submenu () {
450
 
451
  function dbem_replace_placeholders($format, $event, $target="html") {
452
  $event_string = $format;
453
- preg_match_all("/#@?_?[A-Za-z]+/", $format, $placeholders);
454
  foreach($placeholders[0] as $result) {
455
  // echo "RESULT: $result <br>";
456
  // matches alla fields placeholder
@@ -459,9 +463,41 @@ function dbem_replace_placeholders($format, $event, $target="html") {
459
  if (preg_match('/#_JCCSTARTTIME/', $result)) {
460
  $time = substr($event['event_start_time'], 0,5);
461
  $event_string = str_replace($result, $time , $event_string );
462
- }
463
  // END of REMOVE
464
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
465
  if (preg_match('/#_MAP/', $result)) {
466
  $location = dbem_get_location($event['location_id']);
467
  $map_div = dbem_single_location_map($location);
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
+ Version: 2.0b4
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
177
  // Creating the events table
178
  $sql = "CREATE TABLE ".$table_name." (
179
  event_id mediumint(9) NOT NULL AUTO_INCREMENT,
180
+ event_author mediumint(9) DEFAULT NULL,
181
  event_name tinytext NOT NULL,
182
  event_start_time time NOT NULL,
183
  event_end_time time NOT NULL,
184
  event_start_date date NOT NULL,
185
  event_end_date date NULL,
186
+ event_notes text DEFAULT NULL,
187
  event_rsvp bool NOT NULL DEFAULT 0,
188
  event_seats tinyint,
189
  event_contactperson_id mediumint(9) NULL,
227
  maybe_add_column($table_name, 'event_seats', "alter table $table_name add event_seats tinyint NULL;");
228
  maybe_add_column($table_name, 'location_id', "alter table $table_name add location_id mediumint(9) NOT NULL;");
229
  maybe_add_column($table_name, 'recurrence_id', "alter table $table_name add recurrence_id mediumint(9) NULL;");
230
+ maybe_add_column($table_name, 'event_contactperson_id', "alter table $table_name add event_contactperson_id mediumint(9) NULL;");
231
+
232
+ // Fix buggy columns
233
+ $wpdb->query("ALTER TABLE $table_name MODIFY event_notes text ;");
234
+ $wpdb->query("ALTER TABLE $table_name MODIFY event_author mediumint(9);");
235
  }
236
  }
237
 
454
 
455
  function dbem_replace_placeholders($format, $event, $target="html") {
456
  $event_string = $format;
457
+ preg_match_all("/#@?_?[A-Za-z0-9]+/", $format, $placeholders);
458
  foreach($placeholders[0] as $result) {
459
  // echo "RESULT: $result <br>";
460
  // matches alla fields placeholder
463
  if (preg_match('/#_JCCSTARTTIME/', $result)) {
464
  $time = substr($event['event_start_time'], 0,5);
465
  $event_string = str_replace($result, $time , $event_string );
466
+ }
467
  // END of REMOVE
468
 
469
+ if (preg_match('/#_24HSTARTTIME/', $result)) {
470
+ $time = substr($event['event_start_time'], 0,5);
471
+ $event_string = str_replace($result, $time , $event_string );
472
+ }
473
+ if (preg_match('/#_24HENDTIME/', $result)) {
474
+ $time = substr($event['event_end_time'], 0,5);
475
+ $event_string = str_replace($result, $time , $event_string );
476
+ }
477
+
478
+ if (preg_match('/#_12HSTARTTIME/', $result)) {
479
+ $AMorPM = "AM";
480
+ $hour = substr($event['event_start_time'], 0,2);
481
+ $minute = substr($event['event_start_time'], 3,2);
482
+ if ($hour > 12) {
483
+ $hour = $hour -12;
484
+ $AMorPM = "PM";
485
+ }
486
+ $time = "$hour:$minute $AMorPM";
487
+ $event_string = str_replace($result, $time , $event_string );
488
+ }
489
+ if (preg_match('/#_12HENDTIME/', $result)) {
490
+ $AMorPM = "AM";
491
+ $hour = substr($event['event_end_time'], 0,2);
492
+ $minute = substr($event['event_end_time'], 3,2);
493
+ if ($hour > 12) {
494
+ $hour = $hour -12;
495
+ $AMorPM = "PM";
496
+ }
497
+ $time = "$hour:$minute $AMorPM";
498
+ $event_string = str_replace($result, $time , $event_string );
499
+ }
500
+
501
  if (preg_match('/#_MAP/', $result)) {
502
  $location = dbem_get_location($event['location_id']);
503
  $map_div = dbem_single_location_map($location);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://davidebenini.it
4
  Tags: events, manager, calendar, gigs, concert, maps, geotagging
5
  Requires at least: 2.5.1
6
  Tested up to: 2.7.1
7
- Stable tag: 2.0b3
8
 
9
  Manage events and display them in your blog. Includes recurring events, location management, calendar, Google map integration, RSVP.
10
 
@@ -149,3 +149,11 @@ Fixed some bugs
149
  Fixed some bugs affecting EM 1.0 users
150
  Added 2 settings: EM page as calendar and change EM page
151
  Added Swedish and German localisations
 
 
 
 
 
 
 
 
4
  Tags: events, manager, calendar, gigs, concert, maps, geotagging
5
  Requires at least: 2.5.1
6
  Tested up to: 2.7.1
7
+ Stable tag: 2.0b4
8
 
9
  Manage events and display them in your blog. Includes recurring events, location management, calendar, Google map integration, RSVP.
10
 
149
  Fixed some bugs affecting EM 1.0 users
150
  Added 2 settings: EM page as calendar and change EM page
151
  Added Swedish and German localisations
152
+
153
+ 2.0b4
154
+ Fixed a bug in the RSS generator
155
+ Added alternate start and end time selector for those installs not supporting the default system
156
+ Removed "Mappa totale" from the gloabl map code
157
+ Fixed a problem in the back button in the events table
158
+ Removed some debug "echo" from the RSVP form
159
+ Hopefully fixed a database scheme bug that some users signalled