i just started using rss2html. it works great. ive pretty much got down all the features. however i have a sliggght problem. and this may just be with the php. i have a calender at work which populates an xml file for the events for the next two weeks. i have the feedmaxitems set to 5 so it shows the newest 5. however the month of january and febuary is very slow almost dead and i never have any events. therefore just a blank box pops up. is there anyway so that when there are no events to display that it just gives a generic "No Upcoming Events" message in the box on the page. i tried looking at it from the feeds perspective, but i do not have permission to change how the feed operates or touch it even. so i need to do it from my end. i was thinking that somewhere in the php should be an if where if the itemtitle is null then it replaces the item title with the statement. however i dont think there even is an item title to be null. please help. thanks in advance
MacSupport
Joined: 24 Feb 2005
Posts: 648
Posted: Wed Jan 04, 2006 9:38 pm
timothycore wrote:
i just started using rss2html. it works great. ive pretty much got down all the features. however i have a sliggght problem. and this may just be with the php. i have a calender at work which populates an xml file for the events for the next two weeks. i have the feedmaxitems set to 5 so it shows the newest 5. however the month of january and febuary is very slow almost dead and i never have any events. therefore just a blank box pops up. is there anyway so that when there are no events to display that it just gives a generic "No Upcoming Events" message in the box on the page. i tried looking at it from the feeds perspective, but i do not have permission to change how the feed operates or touch it even. so i need to do it from my end. i was thinking that somewhere in the php should be an if where if the itemtitle is null then it replaces the item title with the statement. however i dont think there even is an item title to be null. please help. thanks in advance
Not really knowing what your template looks like you might be able to modify the script like this. On about line number 670 you should find the following code:
I have not tested this but here is my thought. As long as you template is simple and doesn't use tables you can try something along these lines.
Code:
? ? $match = NULL;
? ? $allitems = NULL;
? ? if (count($rss_parser->ItemTitle) == 0) {
? ? ? ? // There are no items so make $allitems a value to be used
? ? ? ? $allitems = "There are no calendar events";
? ? }
oh and here is a sample of what the rss feed looks like when there are no calender events to populate items.
Code:
?
-
-
? R25/WebViewer Hot Events
? This is the list of current hot events
? http://mydomain.com
? Thu, 05 Jan 2006 08:55:00 GMT
?
?
thats it. thank you again. see if there is anything else i can try.
You are right, the following code does work. It goes at the same place
Code:
? ? if (is_array($rss_parser->ItemTitle) == 0) {
? ? ? ? // There are no items so make $allitems a value to be used
? ? ? ? $allitems = "There are no calendar events";
? ? }