Posted on: 02/22/08 11:02am
By: Anonymous (Craig)
Hi gang -
Running GL 1.4.1 with events from the standard Calendar plugin populating upcoming events in a block. My problem is that as soon as events start, the block drops the event. I would like the event to show in that block for the entire current day of the event. Anyone know how to do this?
Thanks in advance, Craig
Re: Calendar Events block help needed
Posted on: 02/25/08 07:44am
By: Anonymous (Craig)
Little bit more clarification -
Events that are listed on the sidebar block disappear on the day of the event. I simply want them to remain in the side block through the day of the event and disappear either the end of the day or at least appear through the conclusion of the event. Any ideas how to do that?
Re: Calendar Events block help needed
Posted on: 02/25/08 08:36am
By: Dirk
I think the way they work now makes sense. If you want an event to be visible all day, make it an "all day" event.
bye, Dirk
Re: Calendar Events block help needed
Posted on: 02/25/08 12:28pm
By: Anonymous (Craig)
But they aren't all day events. These are events that occur during specific times. But that doesn't matter anyhow, it still won't make the event 'stick' for the current day. For example, if I have an event on the calendar for this evening, it doesn't show up in the sidebar (calendar block). It would be there yesterday, but as soon as the day of the event arrives, the event disappears from the block. Its on the calendar itself fine, just not in the block.
Re: Calendar Events block help needed
Posted on: 02/25/08 02:55pm
By: Dirk
Sorry, I was under the impression that timed events would only disappear when they are due. Apparently, that's not the case. So at least that should be fixed ...
bye, Dirk
Re: Calendar Events block help needed
Posted on: 02/25/08 03:17pm
By: Anonymous (Craig)
Ummm. yeah.
Maybe someone could at least point me to the file containing the code that defines how those events get expired? I couldn't find it anywhere.
Re: Calendar Events block help needed
Posted on: 02/25/08 03:19pm
By: Anonymous (I'm With Craig)
I have three sites all having the same issue. Previous to the turn of this year this was not the case. Is there anything in the current events block that would have changed with the new year?
Re: Calendar Events block help needed
Posted on: 02/25/08 08:22pm
By: mx52006
More specifically, where is the code to create the events block and how does it pull the events from the calendar? Can we set a time frame, say any date that is scheduled for the next 15 days to show up?
Re: Calendar Events block help needed
Posted on: 02/26/08 01:56am
By: Dirk
The code is in function phpblock_calendar() in the Calendar's functions.inc. There already is an $_CA_CONF['upcomingeventsrange'] setting to set the number of days to look ahead.
bye, Dirk
Re: Calendar Events block help needed
Posted on: 02/26/08 08:40am
By: Anonymous (Craig)
Now we're getting somewhere. Woohoo.
I'm guessing I just need to figure out how to modify the SQL query to call the current day as well. I'm kind of a novice here so any help would be appreciated.
Text Formatted Code
$eventSql = 'SELECT eid,title,url,datestart,dateend,group_id,owner_id,perm_owner,perm_group,perm_members,perm_anon '
. "FROM {$_TABLES['events']} "
. "WHERE dateend >= NOW() AND (TO_DAYS(datestart) - TO_DAYS(NOW()) < $range) "
. 'ORDER BY datestart,timestart';
Probably need to make a change in the WHERE line somehow. Any ideas?
Re: Calendar Events block help needed
Posted on: 02/26/08 09:25am
By: Anonymous (Craig)
Well...I figured it out...at least a workaround and I'm sure its not the prettiest piece of SQL query ever, but it seems to work.
Just change the WHERE line above to
Text Formatted Code
. "WHERE dateend >= (NOW() - INTERVAL 24 HOUR) AND (TO_DAYS(datestart) - TO_DAYS(NOW()) < $range) "
Re: Calendar Events block help needed
Posted on: 03/18/08 01:17pm
By: kingsley
Quote by: CraigWell...I figured it out...at least a workaround and I'm sure its not the prettiest piece of SQL query ever, but it seems to work.
Just change the WHERE line above to
Text Formatted Code
. "WHERE dateend >= (NOW() - INTERVAL 24 HOUR) AND (TO_DAYS(datestart) - TO_DAYS(NOW()) < $range) "
Thanks for this, The fix does seem ugly as it appears the ">=" is correct. Like others this seemed to break all of a sudden around the first of the year so I am guessing the issue is elsewhere in the code but I have not been able to locate the exact source just yet. This fix is a decent temporary fix however.
-Eric
Re: Calendar Events block help needed
Posted on: 04/12/08 01:00am
By: DaveC
Quote by: CraigWell...I figured it out...at least a workaround and I'm sure its not the prettiest piece of SQL query ever, but it seems to work.
Just change the WHERE line above to
Text Formatted Code
. "WHERE dateend >= (NOW() - INTERVAL 24 HOUR) AND (TO_DAYS(datestart) - TO_DAYS(NOW()) < $range) "
FYI, today I found this bug is also in my 1.4.0sr6 websites, except the offending sql is found in the function COM_printUpcomingEvents( $help='', $title='' ) which is in lib-common.php
... and I don't think the code looks ugly :-)