Welcome to Geeklog, Anonymous Saturday, August 31 2024 @ 11:12 pm EDT
Geeklog Forums
Calendar Events block help needed
Craig
Anonymous
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
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
12
12
Quote
Craig
Anonymous
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?
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?
12
18
Quote
Craig
Anonymous
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.
13
13
Quote
Craig
Anonymous
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.
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.
13
15
Quote
I'm With Craig
Anonymous
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?
12
17
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
bye, Dirk
14
12
Quote
Craig
Anonymous
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.
. "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?
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?
14
11
Quote
Craig
Anonymous
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
Just change the WHERE line above to
Text Formatted Code
. "WHERE dateend >= (NOW() - INTERVAL 24 HOUR) AND (TO_DAYS(datestart) - TO_DAYS(NOW()) < $range) "
16
14
Quote
Status: offline
kingsley
Forum User
Junior
Registered: 03/17/05
Posts: 29
Quote by: 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) "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
12
15
Quote
Quote by: 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) "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 :-)
12
15
Quote
All times are EDT. The time is now 11:12 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content