ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Previous events still displaying

January 05, 2011 12:43pm

Subscribe [5]
  • #1 / Jan 05, 2011 12:43pm

    Lorna70

    24 posts

    How do I ensure that only events from today’s date onwards are displayed.  My events are currently displaying in event order, however I am also getting events in this list which have already taken place. Please help!

  • #2 / Jan 05, 2011 1:16pm

    Crnaovca

    627 posts

    Maybe you cuuld use this to show future entries

    show_futurE_entries

    and limit current entries by end date/time and use this

    show expired

    set to NO.
    Maybe there is better solution from someone else?

  • #3 / Jan 05, 2011 2:22pm

    Lorna70

    24 posts

    Hi

    Thanks but tried show_expired=“no”  and it doesn’t work because the date is the date the user will input for the event, not the date that it was posted/added.  Any other ideas would be appreciated.

    Thanks

  • #4 / Jan 05, 2011 2:24pm

    Crnaovca

    627 posts

    if for example some entry is visible from monday to wednesday and you see list of entries at thursday it will not be shown at all because you set end date, and you will see all future entries .. doesn’t that do the trick?

  • #5 / Jan 06, 2011 2:11am

    John Henry Donovan

    12339 posts

    Lorna70,
    What version and build of EE are you using?

    Thanks but tried show_expired=“no”  and it doesn’t work because the date is the date the user will input for the event, not the date that it was posted/added.

    What are are you using to get your user to add an event. A SAEF? Can you not get them to use the actual entry date instead as opposed to a custom field?

  • #6 / Jan 12, 2011 9:46am

    Lorna70

    24 posts

    Hi John

    I’m using version 2.

    I’m a newbie but as I understand it, the actual entry date is simply the date when the user posts an event is it not??  I need the date in which the event is going to take place to appear, so presumably my only option is a custom field?  Am I missing something??  What is a SAEF.

    Thanks
    Lorna

  • #7 / Jan 12, 2011 6:50pm

    Sue Crocker

    26054 posts

    Hi, Lorna.

    SAEF stands for Stand Alone Entry Form. It’s a method for adding content from the front end of the site, instead of the back end (EE control panel.)

    The actual entry date can also be the date for when an event is going to occur. I then change the exp:channel:entries loop to include show_future_events.

    I’d also use start_on too.

    Does that help?

  • #8 / Jan 19, 2011 7:21am

    Lorna70

    24 posts

    Thanks.  This is what I have so far:

    {exp:channel:entries channel="events" orderby="event_date" show_expired="no" disable="categories|member_data|pagination" sort="asc" show_future_entries="yes" start_on="<?php echo $current_time; ?>" show_expired="no"} 
    <li class="{switch='first|second'}">
    <h3><a href="http://{title_permalink=">{event_date format='%d/%m/%Y'}_{if event_to_date}_ to {event_to_date format='%d/%m/%Y'}_{/if}__{title} </a></h3>
    <p>{if event_venue}<br />
    {event_venue}<br />
    {/if}</p>
    
    <p><a href="http://{title_permalink=">More information…</a></p>
    
    
    
    <p></li><br />
    {/exp:channel:entries}

    Please can someone tell me what I have to change my code to prevent events from appearing with event_to_date which has expired??

  • #9 / Jan 19, 2011 4:56pm

    Ingmar

    29245 posts

    Please can someone tell me what I have to change my code to prevent events from appearing with event_to_date which has expired?

    You aren’t showing any expired entries, so setting an appropriate expiration date for your entries is all that it should take. Makes sense?

  • #10 / Jan 20, 2011 6:33am

    Lorna70

    24 posts

    Hi I’m not a PHP programmer so please bear with me 😊.  I have event_to_date so I only want those events where the event_to_date is on or after today’s date.  So I need to write an if statement presumably. Is there a EE current_date var and if so, is it just:

    {if event_to_date >= current_date}
    display entries…

  • #11 / Jan 20, 2011 10:55am

    Sue Crocker

    26054 posts

    Hi, Lorna. You’d need to set your template to parse PHP on input, and do the following:

    <?php
    $start_time = $this->EE->localize->decode_date('%Y-%m-%d %H:%i', $this->EE->localize->now);
    ?>
    
    {exp:channel:entries channel="events" orderby="event_date" show_expired="no" start_on="<?php echo $start_time; ?>" show_future_entries="yes"}
    
    {title}
    
    {/exp:channel:entries}

    Does that help?

  • #12 / Jan 28, 2011 6:10am

    Lorna70

    24 posts

    Thanks but I thought there would be a way to do this without having to write php.  There are so many sites out there displaying events and the public doesn’t normally want to see the events which have already taken place!  Anyway, I need to do this for other sites so perhaps a rethink is necessary.  I am using EE2 and it looks like the Weblog implementation may work. However, I will take advice on this because I don’t to waste time developing an events section which I also hit a brick wall on as I know Weblogs use expiry dates.  My question therefore is: when my cient enters an event and enters the finish date, is there a way I can make the expiry date for this event to equal the finish date? Also, what about the start date of the event - can I make this equal to the publish date?  Any advice would be good.  I know there are calendar add-ons out there but my client doesn’t want the events displayed in calendar format, just in list format with events being displayed by event date (in ascending order).

  • #13 / Jan 28, 2011 6:13am

    Lorna70

    24 posts

    Meant to say, I am using SAEFs 😊

  • #14 / Jan 28, 2011 3:40pm

    Sue Crocker

    26054 posts

    Hi, Lorna. There is a third party add-on SafeCracker which might help. I’ve not tried it myself.. but you could ask the authors if it has the functionality you need.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases