FeedForAll Forum Index ?
?Home?????FAQ????? Search ?????Memberlist ?????Register ?????Profile? ????Log in
?no items to display in rss2html View next topic
View previous topic
Post new topicReply to topic
Author Message
timothycore



Joined: 04 Jan 2006
Posts: 3

PostPosted: Wed Jan 04, 2006 7:47 pm Reply with quoteBack to top

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
View user's profileSend private message
MacSupport



Joined: 24 Feb 2005
Posts: 648

PostPosted: Wed Jan 04, 2006 9:38 pm Reply with quoteBack to top

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:

Code:

? ? $match = NULL;
? ? $allitems = NULL;
? ? $loop_limit = min(abs($FeedMaxItems), count($rss_parser->ItemTitle));


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";
? ? }

? ? $loop_limit = min(abs($FeedMaxItems), count($rss_parser->ItemTitle));


Jim[/code]
View user's profileSend private messageVisit poster's website
timothycore



Joined: 04 Jan 2006
Posts: 3

PostPosted: Thu Jan 05, 2006 2:08 pm Reply with quoteBack to top

thank you for the quick reply. i tried what you gave me but still no dice. here is what my template looks like, maybe there is something wrong there.

Code:


? ?
? ? ? ? <br> ? ? ? ? ? ? ~~~FeedTitle~~~<br> ? ? ? ?

~~~FeedMaxItems=5~~~ ~~~NoFutureItems~~~ ~~~BeginItemsRecord~~~



? ~~~ItemTitle~~~
? ~~~ItemDescription~~~
?


? ~~~EndItemsRecord~~~







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.
View user's profileSend private message
MacSupport



Joined: 24 Feb 2005
Posts: 648

PostPosted: Thu Jan 05, 2006 2:26 pm Reply with quoteBack to top

timothycore wrote:
thank you for the quick reply. i tried what you gave me but still no dice. here is what my template looks like, maybe there is something wrong there.

Code:


? ?
? ? ? ? <br> ? ? ? ? ? ? ~~~FeedTitle~~~<br> ? ? ? ?

~~~FeedMaxItems=5~~~ ~~~NoFutureItems~~~ ~~~BeginItemsRecord~~~



? ~~~ItemTitle~~~
? ~~~ItemDescription~~~
?


? ~~~EndItemsRecord~~~







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";
? ? }



Jim
View user's profileSend private messageVisit poster's website
timothycore



Joined: 04 Jan 2006
Posts: 3

PostPosted: Thu Jan 05, 2006 2:54 pm Reply with quoteBack to top

works great! thanks!
View user's profileSend private message
Display posts from previous:?? ? ?
Post new topicReply to topic


?Jump to:? ?



View next topic
View previous topic


Powered by phpBB ? 2001, 2002 phpBB Group :: FI Theme