Event format
-
I was trying to add the option to choose the event format (event_single_event_format_tpl). I tried to do so by adding the following line:
<?php EMEFS::property(‘event_single_event_format_tpl’); ?>
An emtpy textbox appears, but it should be a select box with the saved templates.
The relevant code in eme_events.php (I think, my PHP knowedge is limited):
function eme_display_single_event($event_id,$template_id=0,$ignore_url=0) {
$page_body=””;
$event = eme_get_event($event_id);
// also take into account the generic option for using the external url
if (!$ignore_url) $ignore_url=!get_option(’eme_use_external_url’);
if ($event[‘event_url’] != ” && !$ignore_url) {
// url not empty, so we redirect to it
$page_body = ‘<script type=”text/javascript”>window.location.href=”‘.$event[‘event_url’].'”;</script>’;
return $page_body;
} elseif ($template_id) {
$single_event_format= eme_get_template_format($template_id);
} else {
if (!empty($event[‘event_single_event_format’]))
$single_event_format = $event[‘event_single_event_format’];
elseif ($event[‘event_properties’][‘event_single_event_format_tpl’]>0)
$single_event_format = eme_get_template_format($event[‘event_properties’][‘event_single_event_format_tpl’]);
else
$single_event_format = get_option(’eme_single_event_format’ );
}
if ((!is_user_logged_in() && $event[‘event_status’] == STATUS_PUBLIC) || is_user_logged_in())
$page_body = eme_replace_placeholders ($single_event_format, $event);
return $page_body;
}And (for the backend form, I think):
<?php _e(‘Either choose from a template: ‘,’events-made-easy’); echo eme_ui_select($event[‘event_properties’][‘event_single_event_format_tpl’],’eme_prop_event_single_event_format_tpl’,$templates_array); ?>
I appreciate a hint into the right direction ??
- The topic ‘Event format’ is closed to new replies.