Customizing SMF > SMF Coding Discussion
SSI.php 'strange behaviour'?
compa:
See also my post regarding to 'show upcoming events' using SSI.php, but while creating that function in b5 i also discovered a 'strange' bit of coding ...
reventEvents (which i used to create upcomingEvents) creates an array by 'day' or, better explained, day number ... when using the same array structure to show my events for the next year the output got messed up, eg ... (i didn't test this, but recentEvents > 30 days might cause the same effect)
08 august 2004 Event1 (3 day event)
08 december 2004 Event 16
09 august 2004 Event1 (3 day event)
09 august 2005
10 august 2004 Event1 (3 day event)
so i would suggest creating the array on eventDate (actually i needed unix_timestamp so my upcoming events is now using that and it's included in my SELECT statement) ... if using eventDate like in my example below, this should be 'returned' from the SELECT also!
smfb5
--- Quote ---$return[$row['day']][] = array(
'id' => $row['ID_EVENT'],
....
--- End quote ---
proposal
--- Quote ---$return[$row['eventDate']][] = array(
'day' => $row['day'],
'id' => $row['ID_EVENT'],
....
--- End quote ---
cheers
[Unknown]:
There are reasons for this actually, but things have been changed in Beta 6.
Regardless, upcoming is not the correct term for listing more than 30 days worth of events by any stretch.....
-[Unknown]
compa:
i agree [unknown] but since we use the calendar function as part of hour 'main site' too, we like to show the visitors the 'upcoming events' for the next 14 days, but i also liked to show 'ranged' events ... for example, if i would just 'reverse' your recentEvents to upcomingEvents i would get this
upcomingEvents(14);
->
today is 1st of july
4 july James' birthday
7 july meeting
8 july preparty weekend
9 july preparty weekend
10 july preparty weekend
13 july 14' july party in France
14 july 14' july party in France
So you would see the preparty-weekend 3 times, while (my point of view) 8-10 july would be better, but i wouldn't be able to see that the 14th july party is 4 days ... on the other hand, wouldn't it be 'nicer' to recode the calendar mod/function a little to be able to set 'ranged' events, or is this something which should be 'externally' modded for those who need it as SMFs prime function is forum?
[Unknown]:
I will repeat:
The "ranged events" issue has already been changed in Beta 6.
-[Unknown]
compa:
sorry, must have overlooked that 'ranged events' had changed in beta6 ....
Navigation
[0] Message Index
[#] Next page
Go to full version