Author Topic: alert box text  (Read 4498 times)

0 Members and 1 Guest are viewing this topic.

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
alert box text
« on: December 04, 2012, 05:06:33 PM »
Does anyone know how I can change what it says in the alert box on the top of the page? Right now my says There are no active watches, warnings or advisories for Ellis (Kansas).




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1825
    • Maumelle Weather
Re: alert box text
« Reply #1 on: December 04, 2012, 07:43:39 PM »
Ryan,

Are you wanting to change the wording or not show anything if there aren't any alerts?

To change where it has nothing there go to your AtomFeed-config.php file and look for this line:  Around line 99:

$always_show = true;           // true=display message if no alerts   false=display message only when alert is active

Change that to false and it will not show anything unless there is an alert.

If you want to change the wording itself, look in the AtomFeed.php file around line 501 for this:

   array('N'=>'There are no active watches, warnings or advisories', 'C'=>'#333', 'S'=>'13',   'I'=>'')

Only change what is in the single quotes, otherwise you will have a screwed up alert.

Hope that helps,

John


GR2AE, GR3, Cumulus

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #2 on: December 04, 2012, 08:23:07 PM »
Ryan,

Are you wanting to change the wording or not show anything if there aren't any alerts?

To change where it has nothing there go to your AtomFeed-config.php file and look for this line:  Around line 99:

$always_show = true;           // true=display message if no alerts   false=display message only when alert is active

Change that to false and it will not show anything unless there is an alert.

If you want to change the wording itself, look in the AtomFeed.php file around line 501 for this:

   array('N'=>'There are no active watches, warnings or advisories', 'C'=>'#333', 'S'=>'13',   'I'=>'')

Only change what is in the single quotes, otherwise you will have a screwed up alert.

Hope that helps,

John




I don't have a AtomFeed-config.php file




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1825
    • Maumelle Weather
Re: alert box text
« Reply #3 on: December 04, 2012, 08:28:05 PM »
Oops, my bad.  Just saw where you are using the NWS-alert script.
GR2AE, GR3, Cumulus

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #4 on: December 04, 2012, 08:30:12 PM »
Oops, my bad.  Just saw where you are using the NWS-alert script.

I'm about to remove it cause I can't get it like I want it. Guess ill stick with the other one. Shouldn't I have this atom-feed.php file?




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2297
    • CNYWeather
Re: alert box text
« Reply #5 on: December 05, 2012, 07:41:11 AM »
What you looking to do Ryan?

I put together a little different presentation of the alert box on my site.
This worked with the SWSPAlertBox before, so this is my NWSAlertBOX.php:

Code: [Select]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>NWS Alert Box</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" style="margin: 0px auto 0px auto;">
 <div>
<table border="0" cellspacing="0" cellpadding="0" style="width: 705px; margin: 2px auto 0px auto;">

In nws-alerts
<tr>
<td style="color: #000000; background-color: #C5C55B; text-align: center">CENTRAL NEW YORK SEVERE WEATHER ALERTS
<?php
// Add nws-alerts alert box cache file
include_once("nws-alerts-config.php");
include(
$cacheFileDir.$aboxFileName);
// Insert nws-alerts alert box
echo $alertBox;
?>

<script type="text/javascript" src="nws-alertmap.js"></script>
</tr></td>
</body>
</html>

And I just call the NWSAlertBOX.php on the index page.

On line 289 of nws-alerts.php you can change that line to whatever you'd like.
Mine is No Watches, Warnings or Advisories in Effect for Central New York.

The only thing I miss on the NWS vs the SWSP alerts are Short Term and Hazardous Outlooks
that were with the SWSP alert box script.

Tony
« Last Edit: December 05, 2012, 07:43:29 AM by CNYWeather »
Tony




Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #6 on: December 05, 2012, 11:08:51 AM »
I went back to using the atom. I can't figure out how u change the wording in the alert box.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2297
    • CNYWeather
Re: alert box text
« Reply #7 on: December 05, 2012, 11:24:05 AM »
What wording did you want to change Ryan?
Tony




Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #8 on: December 05, 2012, 11:37:46 AM »
Right now it says no active watches warnings or advisories for Ellis (Kansas). What file do I need to edit to change that to say something else? I'm using the atom.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2297
    • CNYWeather
Re: alert box text
« Reply #9 on: December 05, 2012, 12:01:03 PM »
I'm not sure. I dont have that one anymore.

Look in the config file for it and search for no active watches warnings or advisories for Ellis (Kansas).
Tony




Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #10 on: December 05, 2012, 12:32:59 PM »
Ok thanks Tony! I can't find it. I'll keep looking. Making me mad lol.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: alert box text
« Reply #11 on: December 05, 2012, 12:36:33 PM »
Ok thanks Tony! I can't find it. I'll keep looking. Making me mad lol.

Makes me mad too, when these things happen! :D
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #12 on: December 05, 2012, 12:41:39 PM »
Does anyone on this forum know how to change that?




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline katlon

  • LONNIE'S WEATHER STATION
  • Contributor
  • ***
  • Posts: 142
  • GO HEELS!!!
    • LONNIE'S WEATHER STATION
Re: alert box text
« Reply #13 on: December 05, 2012, 01:04:06 PM »
What do you want the heading to say?

Open atom-top-warning.php

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2297
    • CNYWeather
Re: alert box text
« Reply #14 on: December 05, 2012, 01:07:06 PM »
Ok thanks Tony! I can't find it. I'll keep looking. Making me mad lol.

Why'd you give up on the NWS-Alert too Ryan? Just curious.
Tony




Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #15 on: December 05, 2012, 01:10:43 PM »
Ok thanks Tony! I can't find it. I'll keep looking. Making me mad lol.

Why'd you give up on the NWS-Alert too Ryan? Just curious.

Seems like they have too many issues.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #16 on: December 05, 2012, 01:12:18 PM »
What do you want the heading to say?

Open atom-top-warning.php

Looks like your using the one I have. I want it to say the same as yours but for my county in KS




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline katlon

  • LONNIE'S WEATHER STATION
  • Contributor
  • ***
  • Posts: 142
  • GO HEELS!!!
    • LONNIE'S WEATHER STATION
Re: alert box text
« Reply #17 on: December 05, 2012, 03:32:31 PM »
Open atom-top-warning.

Down around line 430 you will see this

Quote
$Summary = '<div class="advisoryBoxnoactive">'.$icons_warning.$title . " for zone $Zone.</div>\n";

change to:

Quote
$Summary = '<div class="advisoryBoxnoactive">'.$icons_warning.$title . " for Your County, Your State</div>\n";

Lonnie

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #18 on: December 05, 2012, 03:37:46 PM »
Open atom-top-warning.

Down around line 430 you will see this

Quote
$Summary = '<div class="advisoryBoxnoactive">'.$icons_warning.$title . " for zone $Zone.</div>\n";

change to:

Quote
$Summary = '<div class="advisoryBoxnoactive">'.$icons_warning.$title . " for Your County, Your State</div>\n";

Lonnie

I did and this didn't work for me.
Code: [Select]
   $Summary = '<div class="advisoryBoxnoactive">'.$icons_warning.$title . " for Ellis County Kansas.</div>\n";
       } else {
          $string .= '<!-- '.$title . " for zone $Zone. -->\n";




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline katlon

  • LONNIE'S WEATHER STATION
  • Contributor
  • ***
  • Posts: 142
  • GO HEELS!!!
    • LONNIE'S WEATHER STATION
Re: alert box text
« Reply #19 on: December 05, 2012, 03:59:01 PM »
When you call for the script on your index page it should say:
Quote
<?php include("/atom-top-warning.php"); ?>

and not:
Quote
<?php include("/atom-advisory.php"); ?>

for it to look like what's on my page.

Lonnie



Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #20 on: December 05, 2012, 04:01:24 PM »
I see. Looks like I got all kinds of problems. ](*,)

Here is what my index.php looks like

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

<div id="main-copy">
   
<?php // insert desired warning box at top of page
  
if ($useTopWarning) {
 if (phpversion() < 5.0) { 
       include_once(
"rss-top-warning.php");
 } else {
   include_once("atom-top-warning.php");
 }
  } else {
   print 
"      <div class=\"advisoryBox\">\n";
   
$_REQUEST['inc'] = 'y';
   
$_REQUEST['summary'] = 'Y';
   if (
phpversion() < 5.0) {
     include_once(
"rss-advisory.php");
   } else { 
     include_once(
"atom-advisory.php");
   }
   print 
"      </div>\n";
  }
?>
« Last Edit: December 05, 2012, 04:03:04 PM by hayskswx »




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline katlon

  • LONNIE'S WEATHER STATION
  • Contributor
  • ***
  • Posts: 142
  • GO HEELS!!!
    • LONNIE'S WEATHER STATION
Re: alert box text
« Reply #21 on: December 05, 2012, 04:13:58 PM »
It appears as though you are using a template page. I have never used one of them so don't want to screw you up. You would be better off letting someone using a template like yours help you out. Sorry.

Lonnie

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #22 on: December 05, 2012, 04:21:51 PM »
It appears as though you are using a template page. I have never used one of them so don't want to screw you up. You would be better off letting someone using a template like yours help you out. Sorry.

Lonnie

Ok Thanks for your help Lonnie.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline capeweather

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 1309
    • http://www.capeweather.com
Re: alert box text
« Reply #23 on: December 05, 2012, 08:12:57 PM »
Does anyone know how to change the top warning to display the county name instead of the zone code? I run another website and you can see at the top the zone is FLC071 but would like to call Lee (Florida) instead? You can see it here. Ideas?

http://fortmyersweather.net/

Chris
Cape Coral, Florida
Website: http://www.capeweather.com
Website: http://www.fortmyersweather.net

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: alert box text
« Reply #24 on: December 05, 2012, 08:42:34 PM »
That's pretty much the same thing I'm trying to do but can't figure it out.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera