Is there a way, or is anyone willing to come up with a way, to have today's events shown on the front page?

It would also be useful if there is the choice to have today's + n day's events.

Thanks in advance

~Ad

Comments

coltrane’s picture

I second this request. While the module's hook_block() is designed for upcoming events only, it's beneficial for a user to see ongoing events, or events that have an end date greater than now.

I made this change manually for the upcoming events block by editing the sql query in event_block_upcoming() on line 1736. The edit is the SELECT returns results where the event_end is greater or equal to now.

  $result = db_query(db_rewrite_sql('SELECT n.nid, n.title, n.type, n.status, n.moderate, n.changed, e.event_start FROM {node} n INNER JOIN {event} e ON n.nid = e.nid WHERE n.status = 1 AND n.moderate = 0 AND e.event_start >= %d ORDER BY event_start'), $time);

to

  $result = db_query(db_rewrite_sql('SELECT n.nid, n.title, n.type, n.status, n.moderate, n.changed, e.event_start FROM {node} n INNER JOIN {event} e ON n.nid = e.nid WHERE n.status = 1 AND n.moderate = 0 AND e.event_end >= %d ORDER BY event_start'), $time);

adthornley, when you say the front page do you mean something different than a block that's on the front page showing todays events?

I'm willing to develop additional administrator settings for the upcoming events block, I can't guarantee I'll get to it very soon though.

BobLouis’s picture

Alternatively, you can use the Views module and easily create a View with such arguments.

jshuell’s picture

Actually what the original poster wanted was to show all of the current days events, and maybe another option to show all of the current days events + n number of days. Unfortunately the current views only allow use of "now" which is too granular for a day view. Greater than or equal to "now" is not the same as "today", and neither is "equal to now". It would be nice if we could set the granularity of the comparison to the day level, or even the month level and use the option field for +n where n is the same as the granularity chosen. I'm looking for this type of functionality as well, and unfortunately need it as a view not a block. So that rules out custom PHP to get at it. Any help would be appreciated, maybe we're overlooking the obvious here because I would have thought having the ability to show the current days events to be pretty important to such a module.

killes@www.drop.org’s picture

We probably should add a "today" filter for event_views. Anybody up for it?

hip’s picture

Definitely. That's what I've been looking for for a while. I believe for a common events calendar (or agenda) "today" like filters make more sense that seconds.

(I had just posted some related questions, but as seen here, there're not such developments)

I'll keep informed through this thread. Thanx.

hip’s picture

BTW,

I'm not (yet) much of a Drupal coder but may this bit of code has anything to do with our request?

hip’s picture

Duplicated, sorry.
BTW,

I'm not (yet) much of a Drupal coder but may this bit of code has anything to do with our request?

hip’s picture

Me again, sorry (I'm feeling a bit hyperactive this morning :-) )

I've just found the daterange.module. Well, it does serve for 'today queries' as asked in this issue with at least one exception (*). However there's still some points missing to have Drupal + views coping with a whole single solution for dates filtering AFAIK (**):

We may have some different ways of dating events:
- 'very punctual one' -> date and time
- one day (no specific time), though 'morning', 'late evening',... would fit someway
- a range o days (from january the 7th to february the 2nd)
- recursive dates (every tuesday)

Then we may have some exceptions, combinations and particularities of the above:
- various 'very punctual dates'
- various days (no time)
- various range of days, or a range of days with a few exceptions (from the 2nd to the 23rd but not the 7th)
- recursive dates within a range of time
- ...

Just a few more points I have now in mind and would like to note down, before posting this reply:

- for the admin interface, where the filters of the views are applied, I think of an AJAXed (or at least javascripted) solution where you can mark any days and day ranges over a graphical calendar. I think I've seen a similar solution in the WordPress plugin EventCalendar (http://wpcal.firetree.net/ - you may need to have WP installed in order to see the interface). I know it shouldn't rely on a client-side solution. I'm talking from an interface point of view, the problem will rely on server (PHP) coding then
- in such a leisure guide 'today' doesn't have to mean exactly today. For instance tonight 2a.m. would mean 'today'. So there should be some admin date filtering configuration where I could indicate 'today' starts at 6a.m. (young boys don't sleep much at night time nowadays)

I may like to start (or follow up) a workgroup where discuss and develop the grounds to get to a coded solution in the near future to make Drupal cope with any common kind of dates, and be able to filter them by views, the unbelievable great module. I'm just throwing the stone... Despite not being such a Drupal coder I'd like to offer my experience with the development and the problems found in my project. If there's some other place where I should start a thread, please let me know.

Thanx for the attention and have a nice day,

hip

(*) I have events in the cinema, music gigs, theater,... categories that appear at just one day, and other categories such as art exhibits that last a range of days. The daterange.module does serve to filter views only if all the filtered nodes have only punctual events or only a range of days, but not mixed up. So I need 2 separated vies to get all the events for the next 3 days, supposing theres no art exhibition lasting just one day, and no concert during 2 days :-)
(**) i'm developing a local leisure guide for my local town, and so I'm learning from practice all the needs the guide has while developing the project.

pepe roni’s picture

No, i do not agree to add a "today"-filter. Furthermore I would suggest to expose year, month, day, (hour, min, sec) as separate selectable filter fields in views. Then you can filter these values with "now", where the corresponding part of the current date/time is used for comparison. But you then must keep in mind that the query may lead to a table scan if the year is not selected.

Another way is to expose year, year-month, year-month-day and so forth.

Just my two cents

tromeros’s picture

I would like to contribute my own experience with having today's event.

I wanted to display an agenda on the frontpage with today's movies, shows and other events.
I use the cck to create the specific content types and the calendar module to have fields of starting and optional ending date.

Some events such as partys only have one date, but other events have one starting and one ending date (to_date).

The first problem was that I couldn't filter correctly the events since as I explained above some were for just one day and others for more days.

To bypass this problem I cloned the calendar view to create specific views for movies, shows and events. Each view had 3 arguments: year,month and day. So for the movies of a specific date e.g. 4 may 2008 the correspondent link is www.mysite.com/movies/2008/5/4

Then I use the panels module and added each of the views. In the settings of the views I added in the View arguments field the following

<?p0hp echo date("Y") ?>/<?p0hp echo date("n") ?>/<?p0hp echo date("j") ?>

replace above, p0hp with php, otherwise it couldn't be shown in a nice way on this comment

which automatically displays the today's date and passes it as an argument to the view.

Then you can set that panel as your homepage.

Hope it helps, regards. :)

japerry’s picture

Status: Active » Closed (outdated)

Event for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.