andermurks
Forum Replies Created
-
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] File UploadHi,
in order to do that, you would need to make several changes in the events manager source files. Note however that this wouldn’t at all compatible with future EM updates.
If you want to do this, you can trace the relevant code bits by starting to look inside \events-manager\templates\forms\event\featured-image-public.php, \events-manager\templates\forms\event-editor.php and \events-manager\classes\EM-Event.php
You might be able to introduce a separate file upload form alongside the existing form, which could be significantly easier and upgrade safe, but you would still need to start looking into the files I have lined out.
I was able to solve this, since all of the groundwork has already been done, just the shortcode wasn’t implemented.
If anyone needs it, just create a small php plugin file and add this:
function my_em_get_location_form_shortcode( $args = array() ){ return em_get_location_form( (array) $args ); } add_shortcode ( 'location_form', 'my_em_get_location_form_shortcode');
Add the shortcode [location_form] anywhere on your site.
I’ve found the problem.
In em-location.php on line 205-219 there was a change from 5.9.2 which rendered #_LATT into empty strings.
Code in question:// old code foreach($location_meta as $location_meta_key => $location_meta_val){ $found = false; foreach($this->fields as $field_name => $field_info){ if( $location_meta_key == '_'.$field_name){ $this->$field_name = $location_meta_val[0]; $found = true; } } if(!$found && $location_meta_key[0] != '_'){ $this->location_attributes[$location_meta_key] = ( is_array($location_meta_val) ) ? $location_meta_val[0]:$location_meta_val; } } // new code (which doesnt work) foreach($location_meta as $location_meta_key => $location_meta_val){ $field_name = substr($location_meta_key, 1); if($location_meta_key[0] != '_'){ $this->event_attributes[$location_meta_key] = ( is_array($location_meta_val) ) ? $location_meta_val[0]:$location_meta_val; }elseif( is_string($field_name) && !in_array($field_name, $this->post_fields) ){ if( array_key_exists($field_name, $this->fields) ){ $this->$field_name = $location_meta_val[0]; }elseif( in_array($field_name, array('owner_name','owner_anonymous','owner_email')) ){ $this->$field_name = $location_meta_val[0]; } } }
I’ve simply replaced the relevant lines in the 5.9.4 em-locations-php and it works.
That’s good to know, thanks. Unfortunately, I’ve only installed EM recently and have no older version available. Do you know where I could find a v5.9.2 download?