Author Topic: CarterLake AJAX/PHP templates question  (Read 3361 times)

0 Members and 1 Guest are viewing this topic.

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
CarterLake AJAX/PHP templates question
« on: July 16, 2008, 07:33:30 AM »
I am no longer seeing any advisories on the main page, this was working as of Saturday.  If you click on Advisories there is one there. (07:30 EST)  Any ideas???

http://www.rockycreekweather.com/

Thanks!

Al...

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: CarterLake AJAX/PHP templates question
« Reply #1 on: July 16, 2008, 12:49:46 PM »


If you have $useTopWarning = true; you'll use the rss-top-warning.php script to do the display on your home page.
That script will categorize Watches, Warnings and Advisories, but won't display 'alerts' such as you have now on your wxadvisory.php page
Quote
Air Quality Alert - Barrow (Georgia)

Updated: 07/16/2008 8:37am
CODE ORANGE AIR QUALITY ALERT IS IN EFFECT FOR ATLANTA FOR
WEDNESDAY JULY 16...

THE GEORGIA DEPARTMENT OF NATURAL RESOURCES...ENVIRONMENTAL
PROTECTION DIVISION HAS ISSUED A CODE ORANGE (UNHEALTHY FOR
SENSITIVE GROUPS) AIR QUALITY ALERT FOR ATLANTA FOR
WEDNESDAY JULY 16.

UNDER CODE ORANGE CONDITIONS...THE OUTDOOR AIR IS LIKELY TO BE
UNHEALTHY FOR SOME PEOPLE. CHILDREN...PEOPLE WHO ARE SENSITIVE TO
OZONE...AND PEOPLE WITH HEART OR LUNG DISEASE SHOULD LIMIT
PROLONGED OUTDOOR EXERTION DURING THE LATE AFTERNOON OR EARLY
EVENING WHEN OZONE CONCENTRATIONS ARE HIGHEST.

FOR ADDITIONAL INFORMATION ON THE AIR QUALITY INDEX PLEASE VISIT
WWW.AIR.DNR.STATE.GA.US/SMOGFORECAST/

$$

If you want it to display, you'll need to set $useTopWarning = false; , then the rss-advisory.php script will show that headline on the home page.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Re: CarterLake AJAX/PHP templates question
« Reply #2 on: July 16, 2008, 05:11:42 PM »
Once again, many thanks!

Al...



If you have $useTopWarning = true; you'll use the rss-top-warning.php script to do the display on your home page.
That script will categorize Watches, Warnings and Advisories, but won't display 'alerts' such as you have now on your wxadvisory.php page
Quote
Air Quality Alert - Barrow (Georgia)

Updated: 07/16/2008 8:37am
CODE ORANGE AIR QUALITY ALERT IS IN EFFECT FOR ATLANTA FOR
WEDNESDAY JULY 16...

THE GEORGIA DEPARTMENT OF NATURAL RESOURCES...ENVIRONMENTAL
PROTECTION DIVISION HAS ISSUED A CODE ORANGE (UNHEALTHY FOR
SENSITIVE GROUPS) AIR QUALITY ALERT FOR ATLANTA FOR
WEDNESDAY JULY 16.

UNDER CODE ORANGE CONDITIONS...THE OUTDOOR AIR IS LIKELY TO BE
UNHEALTHY FOR SOME PEOPLE. CHILDREN...PEOPLE WHO ARE SENSITIVE TO
OZONE...AND PEOPLE WITH HEART OR LUNG DISEASE SHOULD LIMIT
PROLONGED OUTDOOR EXERTION DURING THE LATE AFTERNOON OR EARLY
EVENING WHEN OZONE CONCENTRATIONS ARE HIGHEST.

FOR ADDITIONAL INFORMATION ON THE AIR QUALITY INDEX PLEASE VISIT
WWW.AIR.DNR.STATE.GA.US/SMOGFORECAST/

$$

If you want it to display, you'll need to set $useTopWarning = false; , then the rss-advisory.php script will show that headline on the home page.

Best regards,
Ken

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Re: CarterLake AJAX/PHP templates question
« Reply #3 on: July 17, 2008, 03:47:06 PM »
Ken,

Still have a question.  At one time I did not have the "top warning" being display and it would only display a message if there was an actual alert.  For some reason I began seeing alerts on the advisory page but no message on the top of the index page.  If I set to true as you suggested I always have a message box even if there are no advisories.  Hope that was not to confusing :)

What I want is an actual alert display on the index page only and if there is an actual alert.  It worked at one time and I don't know what I may have inadvertantly changed.

Thanks!

Al...

Once again, many thanks!

Al...



If you have $useTopWarning = true; you'll use the rss-top-warning.php script to do the display on your home page.
That script will categorize Watches, Warnings and Advisories, but won't display 'alerts' such as you have now on your wxadvisory.php page
Quote
Air Quality Alert - Barrow (Georgia)

Updated: 07/16/2008 8:37am
CODE ORANGE AIR QUALITY ALERT IS IN EFFECT FOR ATLANTA FOR
WEDNESDAY JULY 16...

THE GEORGIA DEPARTMENT OF NATURAL RESOURCES...ENVIRONMENTAL
PROTECTION DIVISION HAS ISSUED A CODE ORANGE (UNHEALTHY FOR
SENSITIVE GROUPS) AIR QUALITY ALERT FOR ATLANTA FOR
WEDNESDAY JULY 16.

UNDER CODE ORANGE CONDITIONS...THE OUTDOOR AIR IS LIKELY TO BE
UNHEALTHY FOR SOME PEOPLE. CHILDREN...PEOPLE WHO ARE SENSITIVE TO
OZONE...AND PEOPLE WITH HEART OR LUNG DISEASE SHOULD LIMIT
PROLONGED OUTDOOR EXERTION DURING THE LATE AFTERNOON OR EARLY
EVENING WHEN OZONE CONCENTRATIONS ARE HIGHEST.

FOR ADDITIONAL INFORMATION ON THE AIR QUALITY INDEX PLEASE VISIT
WWW.AIR.DNR.STATE.GA.US/SMOGFORECAST/

$$

If you want it to display, you'll need to set $useTopWarning = false; , then the rss-advisory.php script will show that headline on the home page.

Best regards,
Ken

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: CarterLake AJAX/PHP templates question
« Reply #4 on: July 17, 2008, 05:11:03 PM »
Al,
The difference is in the type of info the NWS is giving out.

the rss-top-warning.php script processes only "Advisory", "Warning" and "Watch" types .. not "Alert".  So it displays nothing for an "Alert" as it is written.

The rss-advisory displays 'No watches, warnings or advisories for zone ssZnnn' if there are no entries in the rss feed for that zone, then will display the title/link for each "Advisory", "Warning", "Watch", or "Alert" is issued.  Since the RSS feeds don't contain "Short Term Forecast" or "Hazardous Weather Outlook", neither script can display that (not the script's fault, NOAA just doesn't include them in their RSS feed).

If you want the rss-top-warning.php script to display "Alert" type messages, then change it's code from
Code: [Select]
//Next if there are none of the above found. Display the first statement message.
if ($flag == 0) {
$i = 0;
while ($i < count($warnheaders)):
    $WLink = $i-1;
if (preg_match("/Statement/i", $warnheaders[$i]) and !preg_match("/National/i", $warnheaders[$i])) { 
$warnscroll = '<div class="advisoryBox"><a href="' . $myadvisorypage . "#WL$WLink" . '" style="color: #000000;">' . $warnheaders[$i] .' In Effect ... [Click here for more]</a></div>';
$flag = 1;
break;
}
$i++;
endwhile;
}
to
Code: [Select]
//Next if there are none of the above found. Display the first statement message.
if ($flag == 0) {
$i = 0;
while ($i < count($warnheaders)):
    $WLink = $i-1;
if (preg_match("/Statement/i", $warnheaders[$i]) and !preg_match("/National/i", $warnheaders[$i])) { 
$warnscroll = '<div class="advisoryBox"><a href="' . $myadvisorypage . "#WL$WLink" . '" style="color: #000000;">' . $warnheaders[$i] .' In Effect ... [Click here for more]</a></div>';
$flag = 1;
break;
}
$i++;
endwhile;
}
//Next if there are none of the above found. Display the first statement message.
if ($flag == 0) {
$i = 0;
while ($i < count($warnheaders)):
    $WLink = $i-1;
if (preg_match("/Alert/i", $warnheaders[$i]) and !preg_match("/National/i", $warnheaders[$i])) { 
$warnscroll = '<div class="advisoryBox"><a href="' . $myadvisorypage . "#WL$WLink" . '" style="color: #000000;">' . $warnheaders[$i] .' In Effect ... [Click here for more]</a></div>';
$flag = 1;
break;
}
$i++;
endwhile;
}
and reset your wxindex.php to have $useTopWarning = true;

Best regards,
Ken

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Re: CarterLake AJAX/PHP templates question
« Reply #5 on: July 17, 2008, 07:14:39 PM »
Ken,

Thank you for the clarification!

Al...

Al,
The difference is in the type of info the NWS is giving out.

the rss-top-warning.php script processes only "Advisory", "Warning" and "Watch" types .. not "Alert".  So it displays nothing for an "Alert" as it is written.

The rss-advisory displays 'No watches, warnings or advisories for zone ssZnnn' if there are no entries in the rss feed for that zone, then will display the title/link for each "Advisory", "Warning", "Watch", or "Alert" is issued.  Since the RSS feeds don't contain "Short Term Forecast" or "Hazardous Weather Outlook", neither script can display that (not the script's fault, NOAA just doesn't include them in their RSS feed).

If you want the rss-top-warning.php script to display "Alert" type messages, then change it's code from
Code: [Select]
//Next if there are none of the above found. Display the first statement message.
if ($flag == 0) {
$i = 0;
while ($i < count($warnheaders)):
    $WLink = $i-1;
if (preg_match("/Statement/i", $warnheaders[$i]) and !preg_match("/National/i", $warnheaders[$i])) { 
$warnscroll = '<div class="advisoryBox"><a href="' . $myadvisorypage . "#WL$WLink" . '" style="color: #000000;">' . $warnheaders[$i] .' In Effect ... [Click here for more]</a></div>';
$flag = 1;
break;
}
$i++;
endwhile;
}
to
Code: [Select]
//Next if there are none of the above found. Display the first statement message.
if ($flag == 0) {
$i = 0;
while ($i < count($warnheaders)):
    $WLink = $i-1;
if (preg_match("/Statement/i", $warnheaders[$i]) and !preg_match("/National/i", $warnheaders[$i])) { 
$warnscroll = '<div class="advisoryBox"><a href="' . $myadvisorypage . "#WL$WLink" . '" style="color: #000000;">' . $warnheaders[$i] .' In Effect ... [Click here for more]</a></div>';
$flag = 1;
break;
}
$i++;
endwhile;
}
//Next if there are none of the above found. Display the first statement message.
if ($flag == 0) {
$i = 0;
while ($i < count($warnheaders)):
    $WLink = $i-1;
if (preg_match("/Alert/i", $warnheaders[$i]) and !preg_match("/National/i", $warnheaders[$i])) { 
$warnscroll = '<div class="advisoryBox"><a href="' . $myadvisorypage . "#WL$WLink" . '" style="color: #000000;">' . $warnheaders[$i] .' In Effect ... [Click here for more]</a></div>';
$flag = 1;
break;
}
$i++;
endwhile;
}
and reset your wxindex.php to have $useTopWarning = true;

Best regards,
Ken



 

anything