Today's event not displaying.

  • Sherry
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
13 years 3 months ago #6819 by Sherry
Today's event not displaying. was created by Sherry
There is an event on today's event calendar, but it is not displaying in the upcoming events module. Shouldn't it display as upcoming until the event end time, or at the very least event start time? Otherwise people might look at the site and think, "No events today!" when there is in fact an event.

Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #6821 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Today's event not displaying.
Hi

The up-coming events module uses to display future events. So if one event starts at 8:am today, and now It is 9:am, It won't be displayed. However, If now it is 7:am, then the event will still be displayed .

If you want all today's events displayed in the module, we will need to modify the code alitle . Here are instructions :

1. Open the file modules/mod_eb_events/mod_eb_events.php .

2. Look at the code in line 12 :
Code:
$where[] = 'event_date >= NOW()' ;

3. Change it to
Code:
$where[] = '(DATEDIFF(NOW(), event_date) >=0)' ;

4. Upload the file to server .

After that It will work as expected .

Thanks,

Tuan

PS : Attached is the modified version of the file. You can simply download, unzip it and upload the file to modules/mod_eb_events folder of your site .

Attachment mod_eb_events-20110111.zip not found

Attachments:

Please Log in or Create an account to join the conversation.

  • Sherry
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
13 years 3 months ago #6834 by Sherry
Replied by Sherry on topic Re: Today's event not displaying.
Hi Tuan,

Thanks so much for the code tweak. I will use it.

However, the problem I was having was the upcoming events module was not showing an event that was in the future. It showed all future events except the one that was today. It was 2pm and the event was at 7pm, but not showing in the upcoming events.

Maybe the code is only using the date to calculate what is in the future instead of the date and time?

Thanks.

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #6837 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Today's event not displaying.
Hi

You can use the code I gave you in the above post and It will meet your requirement .

Thanks,

Tuan

Please Log in or Create an account to join the conversation.

  • Sherry
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
13 years 1 month ago #8473 by Sherry
Replied by Sherry on topic Re: Today's event not displaying.
Hi Tuan,

That code tweak did not work for some reason. Now the Upcoming Events module displays events starting in January. This is the website:
www.awcoslo.org/

Please let me know what I can do. :unsure:

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc