Events Manager - Version 3.0.1

Version Description

Download this release

Release Info

Developer netweblogic
Plugin Icon 128x128 Events Manager
Version 3.0.1
Comparing to
See all releases

Code changes from version 3.0 to 3.0.1

admin/locations.php CHANGED
@@ -1,25 +1,28 @@
1
  <?php
2
- function dbem_intercept_locations_actions() {
 
 
 
 
 
 
 
 
3
  if(isset($_GET['page']) && $_GET['page'] == "locations") {
4
  if(isset($_GET['doaction2']) && $_GET['doaction2'] == "Delete") {
5
  if(isset($_GET['action2']) && $_GET['action2'] == "delete") {
6
  $locations = $_GET['locations'];
7
  foreach($locations as $location_id) {
8
- dbem_delete_location($location_id);
 
9
  }
 
 
 
10
  }
11
  }
12
  }
13
- }
14
- add_action('init', 'dbem_intercept_locations_actions');
15
-
16
- /**
17
- * Looks at the request values, saves/updates and then displays the right menu in the admin
18
- * @return null
19
- */
20
- function dbem_locations_page() {
21
- //TODO EM_Location is globalized, use it fully here
22
- global $EM_Location;
23
  if(isset($_GET['action']) && $_GET['action'] == "edit") {
24
  // edit location
25
  dbem_admin_location();
@@ -32,9 +35,16 @@ function dbem_locations_page() {
32
  $EM_Location->save();
33
  $message = __('The location has been updated.', 'dbem');
34
  $locations = EM_Locations::get();
35
- dbem_admin_locations($locations, null, $message);
36
  } else {
37
- $message = $validation_result;
 
 
 
 
 
 
 
38
  dbem_admin_location($message);
39
  }
40
  } elseif(isset($_POST['action']) && $_POST['action'] == "addlocation") {
@@ -42,14 +52,8 @@ function dbem_locations_page() {
42
  $EM_Location->get_post();
43
  $validation_result = $EM_Location->validate();
44
  if ($validation_result) {
45
- $EM_Location->save();
46
- ?>
47
- <div id='message' class='updated fade below-h2' style='background-color: rgb(255, 251, 204);'>
48
- <p><?php _e('The location has been added.', 'dbem') ?></p>
49
- </div>
50
- <?php
51
- $locations = EM_Locations::get();
52
- dbem_admin_locations($locations, null);
53
  } else {
54
  ?>
55
  <div id='message' class='error '>
@@ -58,27 +62,33 @@ function dbem_locations_page() {
58
  </p>
59
  </div>
60
  <?php
61
- $locations = EM_Locations::get();
62
- dbem_admin_locations($locations, $EM_Location, $message);
63
  }
64
  } else {
65
  // no action, just a locations list
66
- $locations = EM_Locations::get();
67
- dbem_admin_locations($locations, $message);
68
  }
69
  }
70
  }
71
 
72
- function dbem_admin_locations($locations, $new_location, $message = "") {
 
 
 
73
  $destination = get_bloginfo('wpurl')."/wp-admin/admin.php";
74
- $new_location = (get_class($new_location) == 'EM_Location') ? $new_location->to_array() : array();
75
  ?>
76
  <div class='wrap'>
77
  <div id='icon-edit' class='icon32'>
78
  <br/>
79
  </div>
80
  <h2><?php _e('Locations', 'dbem'); ?></h2>
81
-
 
 
 
 
 
 
82
  <div id='col-container'>
83
  <div id='col-right'>
84
  <div class='col-wrap'>
1
  <?php
2
+ /**
3
+ * Looks at the request values, saves/updates and then displays the right menu in the admin
4
+ * @return null
5
+ */
6
+ function dbem_locations_page() {
7
+ //TODO EM_Location is globalized, use it fully here
8
+ global $EM_Location;
9
+
10
+ //First Delete any locations
11
  if(isset($_GET['page']) && $_GET['page'] == "locations") {
12
  if(isset($_GET['doaction2']) && $_GET['doaction2'] == "Delete") {
13
  if(isset($_GET['action2']) && $_GET['action2'] == "delete") {
14
  $locations = $_GET['locations'];
15
  foreach($locations as $location_id) {
16
+ $EM_Location = new EM_Location($location_id);
17
+ $EM_Location->delete();
18
  }
19
+ ?>
20
+ <div id='message' class='updated'><p><?php _e( "Locations Deleted", "dbem" ) ?></p></div>
21
+ <?php
22
  }
23
  }
24
  }
25
+ //Now take further actions
 
 
 
 
 
 
 
 
 
26
  if(isset($_GET['action']) && $_GET['action'] == "edit") {
27
  // edit location
28
  dbem_admin_location();
35
  $EM_Location->save();
36
  $message = __('The location has been updated.', 'dbem');
37
  $locations = EM_Locations::get();
38
+ dbem_admin_locations($message);
39
  } else {
40
+ ?>
41
+ <div id='message' class='error '>
42
+ <p>
43
+ <strong><?php _e( "Ach, there's a problem here:", "dbem" ) ?></strong><br /><br /><?php echo implode('<br />', $EM_Location->errors); ?>
44
+ </p>
45
+ </div>
46
+ <?php
47
+ unset($EM_Location);
48
  dbem_admin_location($message);
49
  }
50
  } elseif(isset($_POST['action']) && $_POST['action'] == "addlocation") {
52
  $EM_Location->get_post();
53
  $validation_result = $EM_Location->validate();
54
  if ($validation_result) {
55
+ $EM_Location->save();
56
+ dbem_admin_locations(__('The location has been added.', 'dbem'));
 
 
 
 
 
 
57
  } else {
58
  ?>
59
  <div id='message' class='error '>
62
  </p>
63
  </div>
64
  <?php
65
+ dbem_admin_locations('', true);
 
66
  }
67
  } else {
68
  // no action, just a locations list
69
+ dbem_admin_locations();
 
70
  }
71
  }
72
  }
73
 
74
+ function dbem_admin_locations($message='', $fill_fields = false) {
75
+ global $EM_Location;
76
+ $locations = EM_Locations::get();
77
+ $new_location = (get_class($EM_Location) == 'EM_Location' && $fill_fields ) ? $EM_Location->to_array() : array(); //let's avoid php warning for empty object
78
  $destination = get_bloginfo('wpurl')."/wp-admin/admin.php";
 
79
  ?>
80
  <div class='wrap'>
81
  <div id='icon-edit' class='icon32'>
82
  <br/>
83
  </div>
84
  <h2><?php _e('Locations', 'dbem'); ?></h2>
85
+
86
+ <?php if($message != "") : ?>
87
+ <div id='message' class='updated fade below-h2'>
88
+ <p><?php echo $message ?></p>
89
+ </div>
90
+ <?php endif; ?>
91
+
92
  <div id='col-container'>
93
  <div id='col-right'>
94
  <div class='col-wrap'>
admin/options.php CHANGED
@@ -74,7 +74,7 @@ function dbem_options_subpanel() {
74
  <?php
75
  dbem_options_radio_binary ( __( 'Use dropdown for locations?' ), 'dbem_use_select_for_locations', __( 'Select yes to select location from a drow-down menu; location selection will be faster, but you will lose the ability to insert locations with events','dbem' ) );
76
  dbem_options_radio_binary ( __( 'Use recurrence?' ), 'dbem_recurrence_enabled', __( 'Select yes to enable the recurrence features feature','dbem' ) );
77
- dbem_options_radio_binary ( __( 'Use RSVP?' ), 'dbem_rsvp_enabled', __( 'Select yes to enable the recurrence features feature','dbem' ) );
78
  dbem_options_radio_binary ( __( 'Use categories?' ), 'dbem_categories_enabled', __( 'Select yes to enable the category features','dbem' ) );
79
  dbem_options_radio_binary ( __( 'Use attributes?' ), 'dbem_attributes_enabled', __( 'Select yes to enable the attributes feature','dbem' ) );
80
  echo $save_button;
74
  <?php
75
  dbem_options_radio_binary ( __( 'Use dropdown for locations?' ), 'dbem_use_select_for_locations', __( 'Select yes to select location from a drow-down menu; location selection will be faster, but you will lose the ability to insert locations with events','dbem' ) );
76
  dbem_options_radio_binary ( __( 'Use recurrence?' ), 'dbem_recurrence_enabled', __( 'Select yes to enable the recurrence features feature','dbem' ) );
77
+ dbem_options_radio_binary ( __( 'Use RSVP?' ), 'dbem_rsvp_enabled', __( 'Select yes to enable the RSVP feature','dbem' ) );
78
  dbem_options_radio_binary ( __( 'Use categories?' ), 'dbem_categories_enabled', __( 'Select yes to enable the category features','dbem' ) );
79
  dbem_options_radio_binary ( __( 'Use attributes?' ), 'dbem_attributes_enabled', __( 'Select yes to enable the attributes feature','dbem' ) );
80
  echo $save_button;
classes/event.php CHANGED
@@ -487,7 +487,7 @@ class EM_Event extends EM_Object{
487
  if ($field == "notes" || $field == "excerpt") {
488
  if ($target == "html"){
489
  //If excerpt, we use more link text
490
- if($field == "event_excerpt"){
491
  $matches = explode('<!--more-->', $this->notes);
492
  $field_value = $matches[0];
493
  $field_value = apply_filters('dbem_notes_excerpt', $field_value);
487
  if ($field == "notes" || $field == "excerpt") {
488
  if ($target == "html"){
489
  //If excerpt, we use more link text
490
+ if($field == "excerpt"){
491
  $matches = explode('<!--more-->', $this->notes);
492
  $field_value = $matches[0];
493
  $field_value = apply_filters('dbem_notes_excerpt', $field_value);
classes/location.php CHANGED
@@ -72,7 +72,6 @@ class EM_Location extends EM_Object {
72
  }
73
 
74
  function save(){
75
- //FIXME location images not working
76
  global $wpdb;
77
  $table = $wpdb->prefix.LOCATIONS_TBNAME;
78
  $data = $this->to_array();
72
  }
73
 
74
  function save(){
 
75
  global $wpdb;
76
  $table = $wpdb->prefix.LOCATIONS_TBNAME;
77
  $data = $this->to_array();
classes/object.php CHANGED
@@ -31,32 +31,32 @@ class EM_Object {
31
  //TODO decide on search defaults shared across all objects and then validate here
32
  $defaults = array_merge($super_defaults, $defaults);
33
 
34
- //TODO accept all objects as search options as well as ids (e.g. location vs. location_id, person vs. person_id)
35
- //If there's a location, then remove it and turn it into location_id
36
- if( array_key_exists('location', $array)){
37
- if ( is_numeric($array['location']) ) {
38
- $array['location'] = (int) $array['location'];
39
- } elseif( preg_match('/^([0-9],?)+$/', $array['location']) ) {
40
- $array['location'] = explode(',', $array['location']);
41
- }else{
42
- //No format we accept
43
- unset($array['location']);
 
 
44
  }
45
- }
46
- //Category - for now we just make both keys have an id number
47
- if( array_key_exists('category', $array)){
48
- if ( is_numeric($array['category']) ) {
49
- $array['category'] = (int) $array['category'];
50
- } elseif( preg_match('/^([0-9],?)+$/', $array['category']) ) {
51
- $array['category'] = explode(',', $array['category']);
52
- }else{
53
- //No format we accept
54
- unset($array['category']);
55
  }
56
- }
57
- //TODO validate search query array
58
- //Clean the supplied array, so we only have allowed keys
59
- if(is_array($array)){
60
  foreach( array_keys($array) as $key){
61
  if( !array_key_exists($key, $defaults) ) unset($array[$key]);
62
  }
31
  //TODO decide on search defaults shared across all objects and then validate here
32
  $defaults = array_merge($super_defaults, $defaults);
33
 
34
+ if(is_array($array)){
35
+ //TODO accept all objects as search options as well as ids (e.g. location vs. location_id, person vs. person_id)
36
+ //If there's a location, then remove it and turn it into location_id
37
+ if( array_key_exists('location', $array)){
38
+ if ( is_numeric($array['location']) ) {
39
+ $array['location'] = (int) $array['location'];
40
+ } elseif( preg_match('/^([0-9],?)+$/', $array['location']) ) {
41
+ $array['location'] = explode(',', $array['location']);
42
+ }else{
43
+ //No format we accept
44
+ unset($array['location']);
45
+ }
46
  }
47
+ //Category - for now we just make both keys have an id number
48
+ if( array_key_exists('category', $array)){
49
+ if ( is_numeric($array['category']) ) {
50
+ $array['category'] = (int) $array['category'];
51
+ } elseif( preg_match('/^([0-9],?)+$/', $array['category']) ) {
52
+ $array['category'] = explode(',', $array['category']);
53
+ }else{
54
+ //No format we accept
55
+ unset($array['category']);
56
+ }
57
  }
58
+ //TODO validate search query array
59
+ //Clean the supplied array, so we only have allowed keys
 
 
60
  foreach( array_keys($array) as $key){
61
  if( !array_key_exists($key, $defaults) ) unset($array[$key]);
62
  }
classes/phpmailer/class.phpmailer.php CHANGED
File without changes
classes/phpmailer/class.smtp.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-br.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-ca.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-cz.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-de.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-dk.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-en.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-es.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-fi.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-fo.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-fr.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-hu.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-it.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-ja.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-nl.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-no.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-pl.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-ro.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-ru.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-se.php CHANGED
File without changes
classes/phpmailer/language/phpmailer.lang-tr.php CHANGED
File without changes
events-manager.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
- Version: 3.0
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 Sykes
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
+ Version: 3.0.1
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 Sykes
events.php CHANGED
@@ -34,7 +34,7 @@ function em_content($data) {
34
  // Multiple events page
35
  $scope = ($_REQUEST['scope']) ? EM_Object::sanitize($_REQUEST['scope']) : "future";
36
  if (get_option ( 'dbem_display_calendar_in_events_page' )){
37
- return EM_Calendar::get('full=1');
38
  }else{
39
  return EM_Events::output ( array('limit'=>10,'scope'=>$scope, 'order'=>"ASC") );
40
  }
34
  // Multiple events page
35
  $scope = ($_REQUEST['scope']) ? EM_Object::sanitize($_REQUEST['scope']) : "future";
36
  if (get_option ( 'dbem_display_calendar_in_events_page' )){
37
+ return EM_Calendar::get( array('full'=>1) );
38
  }else{
39
  return EM_Events::output ( array('limit'=>10,'scope'=>$scope, 'order'=>"ASC") );
40
  }
locations.php CHANGED
@@ -42,12 +42,7 @@ function dbem_insert_location($location) {
42
  $EM_Location = new EM_Location($location);
43
  $EM_Location->insert();
44
  return $EM_Location->to_array();
45
- }
46
-
47
- function dbem_delete_location($location) {
48
- $EM_Location = new EM_Location($location);
49
- $EM_Location->delete();
50
- }
51
 
52
  function dbem_location_has_events($location_id) {
53
  $EM_Location = new EM_Location($location_id);
42
  $EM_Location = new EM_Location($location);
43
  $EM_Location->insert();
44
  return $EM_Location->to_array();
45
+ }
 
 
 
 
 
46
 
47
  function dbem_location_has_events($location_id) {
48
  $EM_Location = new EM_Location($location_id);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://davidebenini.it
4
  Tags: events, manager, calendar, gigs, concert, maps, geotagging, rsvp
5
  Requires at least: 2.7
6
  Tested up to: 3.0.1
7
- Stable tag: 3.0
8
 
9
  Manage events and display them in your blog. Includes recurring events, location management, calendar, Google map integration, RSVP.
10
 
4
  Tags: events, manager, calendar, gigs, concert, maps, geotagging, rsvp
5
  Requires at least: 2.7
6
  Tested up to: 3.0.1
7
+ Stable tag: 3.0.1
8
 
9
  Manage events and display them in your blog. Includes recurring events, location management, calendar, Google map integration, RSVP.
10