PDA

View Full Version : RSS Display Boxes Help



gradtouch
02-17-2012, 12:39 PM
1) Script Title: RSS Display Boxes

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex18/rssdisplaybox/

3) Describe problem:
Hi guys, I dont have a problem as such with the script but I'd like to know if its possible to edit it such that it will display a text string or output a text string when the RSS Box doesn't see any entries on the RSS feed.

At the moment it just outputs nothing (aka blank) so rather than just blank I'd like it to display "No RSS entries found" for example.

I dont really know PHP enough to do it, could anyone point me to the right direction?

Thanks,
GT

jscheuer1
02-17-2012, 04:22 PM
It seems easier to me to take care of this on the javascript side, otherwise it looks like we would need to edit the simplepie.inc file.

Use this modified version of the rssdisplaybox.js file:

4358

Replace the original with it.

If you needed to edit it before for the path to main.php, you will need to again.

The browser cache may need to be cleared and/or the page refreshed to see changes.

Try it like that first to make sure it's working, it does here.

If there's a problem at that point, please post a link to the page on your site that contains the problematic code so we can check it out. And give me the address of the empty feed you're talking about.



But, if that all works out and you want to customize the empty feed message, use a text only editor like NotePad. Near the top rssdisplaybox.js now includes the highlighted line:


// -------------------------------------------------------------------
// RSS Display Box (Ajax invocation)- Created Dec 2nd 2006 | Last updated Dec 18th, 2006
// Author: Dynamic Drive (http://www.dynamicdrive.com)
// -------------------------------------------------------------------

//Unofficial update for "Message for Empty Feed" Feb 17th, 2012 see: http://www.dynamicdrive.com/forums/showthread.php?p=269803#post269803

//Path to "main.php" *relative* to "demo.htm", or the HTML page on your server displaying the RSS Box:

var rssoutputscript="rssbox/main.php"

//Message for Empty Feed
var rssnoitemshtml = '<div><b style="color: red;">No Items Found</b> - Feed is Empty or not a Feed</div>'

//Switch to full URL to "main.php" on your server . . .

You can change it to whatever message you like.

gradtouch
02-20-2012, 09:39 AM
Hi john,

Thanks very much for your reply and advice. I will try it out as soon as I can.

Cheers,
GT

redpis
01-09-2014, 12:48 PM
Hi John,

I'm trying to do essencially the same as GT, unfortunatly Attachment 4358 won't download for me, if the attachment has been withdrawn, I simply want to display 'Alerts to this region'centred text in the display box.

Ian

jscheuer1
01-09-2014, 03:03 PM
That particular attachment was:

5329

redpis
01-09-2014, 04:52 PM
Oh OK, I did enter the highlighted text to see if it would work for me before mailing, but it didn't, I'll give it another go though.

Cheers

Ian

redpis
01-10-2014, 11:00 AM
Hi John,

Re-entered the text in rssdisplaybox.js but it is not displaying the message' Feed is Empty', is their a step I've missed? I have chaged the 'Advisory' background colour, could it me the message is obscured by that?

Any help as always is really apreachiated

The rss boxin on the home page of www.chatteris.biz (rss starts from line 143 if viewing source)

jscheuer1
01-10-2014, 03:05 PM
Use the updated script in place of your current rssdisplaybox.js file (right click and 'Save As'):

5330

redpis
01-10-2014, 05:57 PM
John,

Your a STAR, the file downloads as a .php saved and uploaded as .js after tweaking the narrative, and it worked sweet as a nut.

Many thanks

Ian