Quantcast
Channel: Display text after empty RSS feed - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Display text after empty RSS feed

0
0

I am new to php and hoping someone can help.
I have been able to get an RSS feed up and running by pulling different code from over the internet.
What I am trying to achieve is, if the RSS feed is empty, I would like it to display a message "There are no current warnings"
If there are items in the RSS feed, I would like it to display the Item, along with a div below that is set to hidden.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr" lang="en"><head><title>Weather Warnings for Queensland - Issued by the Bureau of Meteorology</title></head><link type="text/css" href="rss-style.css" rel="stylesheet"></head><script type="text/javascript">    window.setInterval (BlinkIt, 500);    var color = "#0000FF";    function BlinkIt () {        var blink = document.getElementById ("blink");        color = (color == "#FA000C")? "#0000FF" : "#FA000C";        blink.style.color = color;    }</script><body bgcolor="#999"><h1>Weather Warnings for Queensland - Issued by the Bureau of Meteorology</h1><hr><br><!-- display current weather warnings --><fieldset class="rsslib"><?phprequire_once("rsslib.php");$url = "http://www.bom.gov.au/fwo/IDZ00056.warnings_qld.xml";    echo RSS_Display($url, 3, false,  true)     //if there is no warning, i would like to display text saying "There are no current warnings"    // if there are warnings, I would like it to display the RSS, and also display the below wrapper blinking text.?></fieldset><!---------------------------- echo "There are no current weather warnings" ----------------------------------><!-- this is where I put my blinking text, this is not currently set to only display when there is a warning-->     <div id='wrapper' style="display: none"><div id="blink">        Current Weather Warning!</div><div id="direction">        Please go to www.bom.gov.au for more details.</div></div></body></html>

Any help would be much appreciated, I can copy in the rsslib.php if need be??


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images