Events Made Easy Forums How do I … Display Event-Image for the actual event

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #53728
    Anonymous
    Inactive

    At the homepage I display the next events (most of them are recurrences).
    Is it possible to display the event-image that belongs to the topmost event (that is: next event in the list)?
    For example:
    I have an recurring event called “Shakespeare: A Midummernights Dream”. It has reccurrences on March 20,21,22,23 and 28.
    Then I have another recurring event called “Amadeus”. It has recurrences on April 10,11,15,19 and 30.
    Both have an image (event-image).
    Now I want to show at my homepage the next three events (in my example March 20,21,22) and on top of the list ([eme_events scope=future limit=3 category=1 show_ongoing=0]) I want to display the event-image that belongs to the next event (in the example “Shakespeare”).
    If I look at my page on March 27 there should be displayed “March 28, April 10, April 11” and the image for “Shakespare”, because the 28th belongs to this event.
    On March 29 should be displayed the event-image that belongs to “Amadeus” and so on.

    I did not find an shortcode (or am able to write it in the functions.php, because I don’t know enought about the internals) to get this results. As there should be free text between the image and the list of the next events it should be realized by a (new?) shortcode.

    How could it be done?

    Thanks in advance.

    #53730
    Anonymous
    Inactive

    Found a solution myself:

    I created a new shortcode which looks for the next event in the event-table (uses this sql-query from Frankies code:

    SELECT * FROM event-table WHERE event_status IN (1,2) AND (event_start_date >= '2015-03-15') AND FIND_IN_SET(1,event_category_ids) ORDER BY event_start_date ASC , event_start_time ASC LIMIT 1
    

    On my page I use category 1 for the events. “2015-03-15” is “today”.
    The result gives me all the information I need, including the link to the picture (row: event_image_url) so I can display it on my page.

    Maybe somebody could find this useful, too.

    #53731
    Franky
    Keymaster

    In your case, I would’ve done this to show the image of the first one:
    [eme_events limit=1 category=1 show_ongoing=0 template_id=3 template_id_header=7 template_id_footer=9]

    Change the template_id_header/footer to a template that’s empty, and template_id to a template only containing #_EVENTIMAGE as content.
    That will show you only the event image of the next event.
    Then underneath, use your regular shortcode as before: [eme_events limit=1 category=1 show_ongoing=0]

    #53732
    Anonymous
    Inactive

    Hi Franky,

    thanks for your answer. I’ll try this.
    Its much better than my solution, because it will work in the future, even if the structure of dbs will change.

    #53803
    Anonymous
    Inactive

    Hi Franky,

    just want to say that your solutions works perfectly for me.
    Thanks again for you fast support and great plugin.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top