Results 1 to 9 of 9

Thread: RSS Display Boxes Help

  1. #1
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default RSS Display Boxes Help

    1) Script Title: RSS Display Boxes

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Attachment 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:

    Code:
    // -------------------------------------------------------------------
    // 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.
    Last edited by jscheuer1; 02-17-2012 at 04:59 PM. Reason: annotate script
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi john,

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

    Cheers,
    GT

  4. #4
    Join Date
    Jan 2014
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That particular attachment was:

    rssdisplaybox.js
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jan 2014
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  7. #7
    Join Date
    Jan 2014
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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)

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Use the updated script in place of your current rssdisplaybox.js file (right click and 'Save As'):

    rssdisplaybox.js
    Last edited by jscheuer1; 01-10-2014 at 03:37 PM. Reason: English
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Jan 2014
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •