• Resolved maenjuel

    (@maenjuel)


    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 ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Franky

    (@liedekef)

    First, to get the templates for an event:
    $templates_array=eme_get_templates_array_by_id('event');

    The problem is that no option exists currently to allow a select-box to show, so please make a feature request at https://www.e-dynamics.be/wordpress.

    Thread Starter maenjuel

    (@maenjuel)

    Thanks for the quick reply and clarifying things!

    Plugin Author Franky

    (@liedekef)

    Well, just thought of it that you can use eme_ui_select too:

    echo eme_ui_select(0,"event_properties[event_single_event_format_tpl]",$templates_array);

    might just work (untested, but should be ok).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Event format’ is closed to new replies.