cloudy

Author Topic: NOAA RSS Top Warning 2.0 PHP Script  (Read 12343 times)

0 Members and 1 Guest are viewing this topic.

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Top Warning 2009 PHP Script (Beta - Stable)
« Reply #30 on: July 21, 2009, 11:19:52 PM »
V2.00 20-Jul-2009 BETA .009

Added alert icons with permission from Curly (I borrowed some of his code)

Alert icons (new in version V2.00 20-Jul-2009 BETA .009)
Each alert will display along with an icon image to indicate the type and severity of the alert.
To use this feature, you must download the icons from here:
www.642weather.com/weather/scripts/noaa-advisory-images.zip
$enable_alert_icons = true; // this feature is optional

Alert icons directory. Only needed if Alert icons are enabled.
This setting is so you can name the images folder to what ever you like.
$icons_folder = './alert-images'; // No slash on end

Some active alerts today:
http://www.642weather.com/weather/rss-top-warning.php?zone=PAZ024

Download
http://www.642weather.com/weather/rss-top-warning.php?sce=view
« Last Edit: August 05, 2009, 06:32:04 AM by MCHALLIS »

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Top Warning 2009 PHP Script (Beta - Stable)
« Reply #31 on: July 26, 2009, 08:21:03 PM »
V2.00 26-Jul-2009 BETA .010

Added missing code for Flash Flood Watches and Flash Flood Advisories in the icons selection function.

abaldish

  • Guest
Re: NOAA RSS Top Warning 2009 PHP Script (Beta - Stable)
« Reply #32 on: July 26, 2009, 09:14:47 PM »
Hi Mike,

Figure i would also post this, The NOAA RSS Top Warning 2009 script name is rss-top-warning-2009.php, And is also named rss-top-warning.php.




Offline Bigbaywx

  • Posts: 132
  • Big Bay, Michigan
    • Big Bay, Michigan Local Weather
Re: NOAA RSS Top Warning 2009 PHP Script (Beta - Stable)
« Reply #33 on: July 28, 2009, 01:06:12 PM »
I'm not seeing the 'alert images' show up in the warning box.  Shouldn't the 'none' image be showing in the box along with the no active watches, warnings or advisories tag?  I made a folder in the root called alert-images and set the permissions to 755 and uploaded all the icons.  I've got the lastest copy of the script and as defaulted in the script the icons display is set to true.  I must be missing something yet.  Can you take a look when you get a second Mike? 

www.bigbaywx.com

The source viewing is showing....

Quote
<!-- rss-top-warning-2009.php - V2.00 26-Jul-2009 BETA .010 -->
<!-- using cached version from rss-advisory-2009-MIZ005.txt - age=182 secs. Next fetch in 418 secs. -->
<div class="advisoryBoxnoactive">There are no active watches, warnings or advisories for zone MIZ005.</div>
<!-- zone=MIZ005 -->

Thanks in advance,

Doug

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Top Warning 2009 PHP Script (Beta - Stable)
« Reply #34 on: July 28, 2009, 08:54:50 PM »
This script does not have a "none" icon in the code.
Curly's muti zone script does. When I have time I am going to work on this script a little more.

Offline Bigbaywx

  • Posts: 132
  • Big Bay, Michigan
    • Big Bay, Michigan Local Weather
Re: NOAA RSS Top Warning 2009 PHP Script (Beta - Stable)
« Reply #35 on: July 29, 2009, 11:36:53 AM »
Ah...that explains it.  When I was going through the image folder on the upload I looked at a few of the icons and saw the 'none' icon in there so I had supposed that this was going to show. 

Thanks!!

Doug

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Top Warning 2.0 PHP Script (Beta - Stable)
« Reply #36 on: August 05, 2009, 06:40:57 AM »
V2.00 04-Aug-2009 BETA .011

- improved the alert icons function to accommodate a larger list of alert names
- script no longer uses the file name rss-top-warning-2009.php, renamed to rss-top-warning.php


Offline K3JAE

  • Posts: 691
  • Fayette County, PA., USA
    • K3JAE's Weather Station
Re: NOAA RSS Top Warning 2.0 PHP Script (Beta - Stable)
« Reply #37 on: August 09, 2009, 12:09:44 PM »
My top warning script quit working.  I get no errors but I also get no display.

Currently we are under a "Air Quality Alert" until 10PM this date.

I use the following script to call the top warning script:

Code: [Select]
<?php // insert desired warning box at top of page
  
if ($useTopWarning) {
   @include_once(
"rss-top-warning.php");
  } else {
   print 
"      <div class=\"advisoryBox\">\n";
   
$_REQUEST['inc'] = 'y';
   
$_REQUEST['summary'] = 'Y';
   @include_once(
"rss-advisory.php");
   print 
"      </div>\n";
  }
?>


I am using V2.00 04-Aug-2009 BETA .011 for the Top Warning and double checked all my zones are correct (PA032). Additionally am using the new rss-advisory script V2.00 04-Aug-2009 BETA .027. Would someone be so kind as to review things and tell me where I am going wrong?I have been fighting this for a few days and unsure where I am making my mistake.


73's de K3JAE

John
K3JAE Weather Station

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Top Warning 2.0 PHP Script (Beta - Stable)
« Reply #38 on: August 09, 2009, 02:25:20 PM »
Quote

I am using V2.00 04-Aug-2009 BETA .011 for the Top Warning and double checked all my zones are correct (PA032). Additionally am using the new rss-advisory script V2.00 04-Aug-2009 BETA .027. Would someone be so kind as to review things and tell me where I am going wrong?I have been fighting this for a few days and unsure where I am making my mistake.


Above the code you quoted inside your wxindex.php, do you have $useTopWarning = false; ??
Because top warning is not being used on your front page, rss-advisory.php is and that would cause it.

Code: [Select]
//
$useTopWarning = true;  // set to true to use only the rss-top-warning script
//    
                    set to false to use the rss-advisory script instead

Offline K3JAE

  • Posts: 691
  • Fayette County, PA., USA
    • K3JAE's Weather Station
Re: NOAA RSS Top Warning 2.0 PHP Script (Beta - Stable)
« Reply #39 on: August 09, 2009, 03:37:02 PM »
Above the code you quoted inside your wxindex.php, do you have $useTopWarning = false; ??
Because top warning is not being used on your front page, rss-advisory.php is and that would cause it.

Code: [Select]
//
$useTopWarning = true;  // set to true to use only the rss-top-warning script
//    
                    set to false to use the rss-advisory script instead

My setting is as you note it is to be: $useTopWarning = false;

I use the following to call the code:

Code: [Select]
<?php // insert desired warning box at top of page
  
if ($useTopWarning) {
   @include_once(
"rss-top-warning.php");
  } else {
   print 
"<div class=\"advisoryBox\">\n";
   
$_REQUEST['inc'] = 'y';
   
$_REQUEST['summary'] = 'Y';
   @include_once(
"rss-advisory.php");
   print 
"      </div>\n";
  }

Should I call this diifferently? IE: Using a simple include statement?
« Last Edit: August 09, 2009, 03:39:45 PM by K3JAE »


73's de K3JAE

John
K3JAE Weather Station

Offline K3JAE

  • Posts: 691
  • Fayette County, PA., USA
    • K3JAE's Weather Station
Re: NOAA RSS Top Warning 2.0 PHP Script (Beta - Stable)
« Reply #40 on: August 09, 2009, 03:46:03 PM »
In reference to above:  I changed my original include call from:

Code: [Select]
<?php // insert desired warning box at top of page
  
if ($useTopWarning) {
   @include_once(
"rss-top-warning.php");
  } else {
   print 
"<div class=\"advisoryBox\">\n";
   
$_REQUEST['inc'] = 'y';
   
$_REQUEST['summary'] = 'Y';
   @include_once(
"rss-advisory.php");
   print 
"      </div>\n";
  }

to the following simple include call:

Code: [Select]
<?php 
@include_once("rss-top-warning.php");
?>


This brought my alert box up in the CSS color I have set. Although the TEXT color is not correct I can work with that.

Now will this work correctly from this point forward or is this still an incorrect call?


73's de K3JAE

John
K3JAE Weather Station

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Top Warning 2.0 PHP Script (Beta - Stable)
« Reply #41 on: August 09, 2009, 08:08:17 PM »
That code is fine. you could have set
$useTopWarning = true;
to switch from the raa-advisory to the rss-top-warning.

I was in a hurry to go out the door when I posted my last post, sorry if it was not clear..

Offline Fox_Of_The_Wind

  • Anthony
  • Posts: 1,163
  • C:\DOS C:\DOS\RUN RUN\DOS\RUN
  • De Soto Wisconsin USA
    • De Soto Valley Weather
Re: NOAA RSS Top Warning 2009 PHP Script (Beta - Stable)
« Reply #42 on: August 11, 2009, 12:46:58 AM »
I found a link color Specificity issue in the PHP carterlake template CSS compatibility with RSS Top Warning 2009

The solution:
PHP carterlake template users need to update to the latest css files Version: 1.22  14-Jun-2009 here:              
http://www.642weather.com/weather/scripts/css-theme-switcher.zip

The RSS Top Warning 2.0 PHP Script does not need updating.

I was just looking at my site and I just seen that there are no  watches, warnings or advisories but the script is just puting it as text and it is not in a box. Is the above quote the reason why mine is not showing right? I do know that the rest of the template site is old....I should update it.. Thanks for any help anyone can give.


Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Top Warning 2009 PHP Script (Beta - Stable)
« Reply #43 on: August 11, 2009, 12:58:14 AM »
I was just looking at my site and I just seen that there are no  watches, warnings or advisories but the script is just puting it as text and it is not in a box. Is the above quote the reason why mine is not showing right? I do know that the rest of the template site is old....I should update it.. Thanks for any help anyone can give.

Yes, if you update the css files it should have the box

Offline Fox_Of_The_Wind

  • Anthony
  • Posts: 1,163
  • C:\DOS C:\DOS\RUN RUN\DOS\RUN
  • De Soto Wisconsin USA
    • De Soto Valley Weather
Re: NOAA RSS Top Warning 2009 PHP Script (Beta - Stable)
« Reply #44 on: August 11, 2009, 12:59:11 AM »
Yes, if you update the css files it should have the box

Thank you so much!!! such a fast reply. I will update it when I get home from work. Thanks again!!