- Oct 19, 2000
- 17,861
- 4
- 81
I have the SMF forum package installed on my site, and I'm using the SSI file to bring back info to my main homepage. The particular function that I'm having trouble with is the calendar, which reports back any upcoming holiday, birthdays, and events.
When any one of the three have an upcoming notice, everything is perfectly fine. For example, if there is an upcoming holiday, it will display "Upcoming Holidays: Christmas, Upcoming Birthdays: None, Upcoming Events: None". However, when none of the three have anything upcoming, the entire thing disappears.
I've attached the current code using the "Attach Code" button.
So what exactly is going on here? To me, I think that when that array with birthdays, holidays, and events is blank, that everything should display as "Upcoming *: None". However, I'm still starting out with PHP, and I'm not really sure what's going on with the setting of the global variables and the argument in the function.
I've attempted adding the following at the very end...
if (empty($context['calendar_holidays'] && $context['calendar_birthdays'] && $context['calendar_events'])) { echo 'nothing to display blah blah'; }
...but that only causes my entire page to not load. Errors are turned off, so I guess I could turn those on to see what the actual error is.
Can anybody give me any insight? I really wanted to figure this out on my own, but I've had no luck over the past couple of days.
EDIT: Since that attach code funciton just jumbles everything together, here's a screen cap of the function so it's easier to read and interpret:
http://pics.bbzzdd.com/users/blurredvision/code.JPG
EDIT2: Editing the first time had truncated what I put in the code box, so disregard that altogether.
When any one of the three have an upcoming notice, everything is perfectly fine. For example, if there is an upcoming holiday, it will display "Upcoming Holidays: Christmas, Upcoming Birthdays: None, Upcoming Events: None". However, when none of the three have anything upcoming, the entire thing disappears.
I've attached the current code using the "Attach Code" button.
So what exactly is going on here? To me, I think that when that array with birthdays, holidays, and events is blank, that everything should display as "Upcoming *: None". However, I'm still starting out with PHP, and I'm not really sure what's going on with the setting of the global variables and the argument in the function.
I've attempted adding the following at the very end...
if (empty($context['calendar_holidays'] && $context['calendar_birthdays'] && $context['calendar_events'])) { echo 'nothing to display blah blah'; }
...but that only causes my entire page to not load. Errors are turned off, so I guess I could turn those on to see what the actual error is.
Can anybody give me any insight? I really wanted to figure this out on my own, but I've had no luck over the past couple of days.
EDIT: Since that attach code funciton just jumbles everything together, here's a screen cap of the function so it's easier to read and interpret:
http://pics.bbzzdd.com/users/blurredvision/code.JPG
EDIT2: Editing the first time had truncated what I put in the code box, so disregard that altogether.