Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #5725
    martijeanp
    Participant

    Firstly, just want to praise your plugin and give you five stars for a great job! :)

    I came across some missing attributes not specified in the shortcode [em-events]. I wanted to use the shortcode twice within a page – once for Upcoming Events and Another for Past Events. I would like to suggest that the Event Listing widget have the functionality to specify a date range or date filtering of sorts to allow an easy way to do this.

    In the meantime, I modified the events-maker/includes/template-functions.php to add the attributes in order to use them in the shortcode. I first added a default value to the missing date variables:

    $defaults = array(
    ‘number_of_events’ => 5,
    ‘thumbnail_size’ => ‘thumbnail’,
    ‘categories’ => array(),
    ‘locations’ => array(),
    ‘organizers’ => array(),
    ‘order_by’ => ‘start’,
    ‘order’ => ‘asc’,
    ‘show_past_events’ => $options[‘show_past_events’],
    ‘show_occurrences’ => $options[‘show_occurrences’],
    ‘show_event_thumbnail’ => true,
    ‘show_event_excerpt’ => false,
    ‘no_events_message’ => __(‘No Events’, ‘events-maker’),
    ‘date_format’ => $options[‘datetime_format’][‘date’],
    ‘time_format’ => $options[‘datetime_format’][‘time’],
    ‘event_start_before’ => ”,
    ‘event_start_after’ => ”,
    ‘event_end_before’ => ”,
    ‘event_end_after’ => ”
    );

    ..and then to the $events_args :

    $events_args = array(
    ‘post_type’ => ‘event’,
    ‘suppress_filters’ => false,
    ‘posts_per_page’ => ($args[‘number_of_events’] === 0 ? -1 : $args[‘number_of_events’]),
    ‘order’ => $args[‘order’],
    ‘event_show_past_events’ => (bool)$args[‘show_past_events’],
    ‘event_show_occurrences’ => (bool)$args[‘show_occurrences’],
    ‘event_show_featured’ => (bool)$args[‘show_featured’],
    ‘event_start_before’ => $args[‘event_start_before’]
    ‘event_start_after’ => $args[‘event_start_after’]
    ‘event_end_before’ => $args[‘event_end_before’]
    ‘event_end_after’ => $args[‘event_end_after’]
    );

    So now we can do this to display past events:

    <?php
    $args = array(
    ‘number_of_events’ => 0
    ,’order’ => ‘desc’
    ,’show_past_events’ => true
    ,’date_format’ =>’Y-m-d’
    ,” => date(“Y-m-d”, time() – 3600*24)
    ,’event_start_before’ => date(“Y-m-d”, time() – 3600*24)
    );
    echo em_display_events($args);
    ?>

    P.S. I haven’t tested whether event_start_before should use today’s date or yesterday’s date if I want all events before today.

    #5726
    Bartosz
    Keymaster

    @martijeanp, there’s no working [em-events] shortcode yet. It being released just now.

    Please check if it works for you.

    #5733
    martijeanp
    Participant

    I installed your plugin yesterday after researching EVERYONE out there :) I saw your [EM-EVENTS] shortcode in your online documentation section located at https://www.dfactory.co/docs/events-maker-plugin/shortcodes/.

    I used Genesis/Dynamik with a few other plugins and thought there was a conflict because it did not evaluate at all. Your widgets worked fine but were limited to what I wanted to used it for which was provide a listing for upcoming and past events, showing as separate sections.

    There was an update to your plugin yesterday which I installed and of course wrote over my modifications :) but it still didn’t work as I expected. There is also the issue of the missing start/end attributes.

    I had another choice which was to use WP_Query, which I tested and worked perfectly. The only cavet was the fact that I was responsible for displaying and styling the output. I was a bit swamped, so I went the way of the template-function.php modifications.

    Let me know if I can be of help ;) Thank you again for a great plugin!

    #5734
    martijeanp
    Participant

    BTW, I think it would be great to have a gallery of sites using events maker summarizing any customization’s or unique ways the developer used your product. That way developers get to showcase their skills and of course give you fuel for future implementations!

    #5735
    Bartosz
    Keymaster

    Thanks martijeanp,

    It’s a nice idea to have a showcase of sites using EM (and our other plugins as well). I’ll just need to provide a way to do submit that.

    When it comes to the issue: I see that you tried the [em-events] shortcode but I don’t really get the problems you had. Can you paste a code you used (the shortcode with attributes) to get the result you wanted? I’d check that locally.

    #5739
    martijeanp
    Participant

    i tried it and it looks like its working fine :) Maybe it was the last update but I am not complaining anymore!!!

    Here is the code to display the past events while it didn’t work. Just another way to use your wonderful plugin!

    <div class=”events-maker-custom-heading”>PAST EVENTS</div><hr>
    <?php
    $args = array(
    ‘number_of_events’ => 0
    ,’order’ => ‘desc’
    ,’show_past_events’ => true
    ,’date_format’ =>’Y-m-d’
    ,’event_start_before’ => date(“Y-m-d”, time() – 3600*24)
    );
    echo em_display_events($args);
    ?>

    …and..

    <div class=”events-maker-custom-heading”>UPCOMING EVENTS</div><hr>
    <?php
    $args = array(
    ‘number_of_events’ => 0
    ,’order’ => ‘desc’
    ,’show_past_events’ => false
    ,’date_format’ =>’Y-m-d’
    ,” => date(“Y-m-d”, time() – 3600*24)
    ,’event_start_after’ => date(“Y-m-d”, time() – 3600*24)
    );
    echo em_display_events($args);
    ?>

    I used the id to style the title and the php function to return yesterdays date. This may return yesterday date and the day before yesterday. Havent checked that yet, but I am sure someone will :)

    Maybe my friends at dFactory can put a option list for “today” and “yesterday”? Thanks for you prompt response and understanding.

    Happy Holidays!

    #5740
    martijeanp
    Participant

    By the way, for all you Genesis/Dynamik lovers out there, I put each of the PHP code into a shortcode named event-maker-past-events and event-maker-upcoming events respectively under Genesis -> Dynamik Custom -> HookBoxes.

    or for those who dont have it, you can always use one of my other favorite non-Genesis plugins – Shortcodes UI by Bainternet!

    Not affiliated with anyone of them, but kudos to all!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.