Hello,
I'm using event & event_repeat cvs modules with drupal 4.7
I can easily create events and repeats for them
But I cannot see any way to do the following
I am developing a site for a local theatre club part of which promotes the shows they are putting on
If I have a show which is on for six nights say from Monday to Saturday from 19:00hrs to 22:00hrs each day
I can do either of the following
A) create one event with a start time of Monday 19:00 and an end time of Saturday 22:00hrs
or
B) create one event with the start time of Monday 19:00 and an end time of Monday 22:00 hrs and set the repeat to 6 daily repeats
either of these options has a downside
if I choose option A the event will run 24 hours a day for 6 days which is really incorrect as the theatre may have other events on during the day
If I choose option B the events are in the calendar correctly but if the event is promoted to the front page by default, then all 6 events show up on the front page which looks stupid
what I have done so far is to choose option B but not automatically promote the event to the front page, and then I have promoted only the first node/event of the repeat sequence to the front page.
this looks better in that the start and end times are correct but obviously it looks at first glance as though the show is only on for one day.
Having this oddity pointed out to me, I had thought that when the page was created, I would be able query the database to check for repeats and display something like "6 performances from Monday 29th at 19:00" and that would be the problem solved !!
but having had a look at the database there does not seem to any way to find out if an event has any repeats from the first event in the sequence, subsequent events have the field rid to link then together, but the first event has nothing obvious, so even if I used the last event as the one promoted to the front page I dont think there is any way to discover the first event.
to see an example have a look at http://demo.dibbletree.com and look at the first item on the front page "One Flew over the Cuckoos Nest" it has been created as a daily show with a repeat of 6 days with only the first node promoted to the front page, but as you will realise the start and end times are quite correctly displayed for that event only
the only work round I have thought of so far is to actually create a repeat of 7 days with the first show being a day early so that I can promte the second show to the front page, which then with a bit of coding allows me to access the rid to find the rest of the shows, but if I do this once the repeat cycle is created, can I delete the first show from the events so that people dont find it through the calendar and try and come a day early ?
any suggestions greatfully received
Tkgafs
Comments
Comment #1
tkgafs commentedSince posting this message i have applied the following workaround
I have updated the template so that it checks if it is page == 0 and node->nid == 9999 it then outputs different date info, whilst this gives the sort of output I'm after its not really a workable solution as the .tpl.php file would needed edited for every different show
tkgafs
Comment #2
hunmonk commentedi'm a bit confused by your request. however, looking at the event_repeat_nodes table, the rid is present for all events in a repeat sequence, including the first event. so you can work backwards from the nid, query for the respective rid, then do a SELECT count(rid) WHERE rid = [the rid you obtained]. that gives you the total number of repeat events in the sequence. you could also inner join the events table and restrict by event start time if you only wanted to display the number of repeat events remaining.
this is not a feature that i have any interest in developing, but you're welcome to submit a patch for it and i'll look at it for possible inclusion in the module.
Comment #3
tkgafs commentedI'm equally confused, I have just created a new test repeat to check if I had done something wrong when creating the node, and just as you say the rid is there on the first node as well, but I also checked the other repeat I created [the only one so far] and it quite definatley does not have the rid set for the first node in the repeat sequence.
Can you think of any sequence of events I could have done which would created this anomoly ?
thankfully your code does work as I would have expected so I can easily sort the display out in the template
once again thanks a lot for both your module and you patience
tkgafs
Comment #4
tkgafs commentedOk I have worked out what is going on
I create a event with say 5 repeats of an event which by default is a node type which is not automatically promoted to the front page,
when I am ready I have gone in admin/content and edited the first node in the sequence to change its published status to promoted to front page [as I dont want 5 articles basically the same on the front page]
your code quite clearly states on the screen if I had read it properly that any edit to an individual node removes it from the repeat sequence
this is what is clearing the rid for the node from event_repeat_nodes table, before the changing the published status the rid for the node appears in event_repeat_nodes after changing the published status it does not
Would it be possible to change the module so that a change to the published status does not clear the rid field
Tkgafs
Comment #5
tkgafs commentedSorry to keep updating this topic,
I now agree with you the code is correct
If I use the admin content and promote the node to the front page it works as I would expect, If I choose the edit link to edit the node to change the published status then you remove from the repeat sequence as you state on the screen
I'm quite happy now I understand just what is going on, and how I can exploit the repeat module
thanks for you time and expertise
Tkgafs
Comment #6
hunmonk commentedif you had created the first node before you enabled eventrepeat, that might have done it. not sure, though... :)
Comment #7
hunmonk commentedah, i hadn't read your other replies first. yep, that would do it. btw, if i recall correctly, there is a setting in admin/settings/event/eventrepeat: "Leave individual edits in sequence". this should also accomplish the same thing.
Comment #8
rmiddle commented4.7 Branch is being moved to unsupported. If this is still an issue with 5.x-1.x or 5.x-2.x please reopen.
Thanks
Robert