Author Topic: New Weather Alert Program  (Read 39854 times)

0 Members and 1 Guest are viewing this topic.

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: New Weather Alert Program
« Reply #100 on: April 01, 2013, 01:44:02 AM »
There are several unclosed tags above the code interfering with the colors.
Without any alerts, the alert box has black text with a gray background. Getting the page to validate will make the alert box display like it should.

What file should I edit to change colors and size of font on alert box?




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: New Weather Alert Program
« Reply #101 on: April 01, 2013, 02:55:30 AM »
Quote
Where do I permanently change the text in the advisory box on the index page from "No alerts" to

That would be in the file nws-alerts.php
Find this line:
Code: [Select]
.'">No alerts</a></div>
Replace it with this:
Code: [Select]
.'">No Watches, Warnings or Advisories in Effect for Eastern Vermont, New Hampshire and Western Maine.</a></div>

What line is this on?




Ryan 

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

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: New Weather Alert Program
« Reply #102 on: April 01, 2013, 05:50:22 AM »
What do you use to do your coding? Can't you do a "find" or a search and replace?

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: New Weather Alert Program
« Reply #103 on: April 01, 2013, 05:58:22 AM »
Rick, how do you think the Impact Based Warning changes will make, if any, to your alert program?

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: New Weather Alert Program
« Reply #104 on: April 01, 2013, 01:01:36 PM »
 
What do you use to do your coding? Can't you do a "find" or a search and replace?

Wow. Thanks for the help. :roll:
« Last Edit: April 01, 2013, 01:12:07 PM by hayskswx »




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: New Weather Alert Program
« Reply #105 on: April 01, 2013, 01:46:27 PM »
Does anyone know how to make the text larger in the alert box? Someone has got to know.
« Last Edit: April 01, 2013, 02:42:30 PM by hayskswx »




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: New Weather Alert Program
« Reply #106 on: April 01, 2013, 05:57:00 PM »
bump




Ryan 

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

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1827
    • Maumelle Weather
Re: New Weather Alert Program
« Reply #107 on: April 01, 2013, 07:36:06 PM »
Hi Ryan,

Check your .css file for watchBox, warningBox, etc.

John
GR2AE, GR3, Cumulus

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: New Weather Alert Program
« Reply #108 on: April 01, 2013, 07:38:44 PM »
Does anyone know how to make the text larger in the alert box? Someone has got to know.

The easiest way is to change it on your index page.
Somewhere on the index page is this line:
Code: [Select]
echo $alertBox;
Replace that line with this:
Code: [Select]
echo '<div style="font-size:110%">'.$alertBox.'</div>';
Change the 110% to the size that you want.
Or you could replace the 110% with 14px.

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: New Weather Alert Program
« Reply #109 on: April 01, 2013, 08:35:33 PM »
Does anyone know how to make the text larger in the alert box? Someone has got to know.

The easiest way is to change it on your index page.
Somewhere on the index page is this line:
Code: [Select]
echo $alertBox;
Replace that line with this:
Code: [Select]
echo '<div style="font-size:110%">'.$alertBox.'</div>';
Change the 110% to the size that you want.
Or you could replace the 110% with 14px.


This doesn't work for the box with no alerts. :-(
« Last Edit: April 01, 2013, 08:50:48 PM by hayskswx »




Ryan 

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

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: New Weather Alert Program
« Reply #110 on: April 01, 2013, 09:51:19 PM »
Open nws-alerts.php.
Find both instances of this line:
Code: [Select]
.'<div style="width:'.$aBox_Width
Replace both instances with this:
Code: [Select]
.'<div style="width:'.$aBox_Width.'; font-size:110%'
That will take care of the font size for any alert.
To change the font size for a no alert message, find this line:
Code: [Select]
$box .= ' <div style=" '.$bc.' '.$tc.' padding:4px 8px 4px 8px; text-align: center"><a href="'
Change it to this:
Code: [Select]
$box .= ' <div style="font-size:110%; '.$bc.' '.$tc.' padding:4px 8px 4px 8px; text-align: center"><a href="'

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: New Weather Alert Program
« Reply #111 on: April 01, 2013, 10:11:30 PM »
This is what I put and no changes?

Code: [Select]
     .'<div style="width:'.$aBox_Width.'; font-size:17px'
         .'; border:solid thin #000; margin:0px auto 0px auto;">'."\n";
    if($showNone) {                                                                          //   IF showing "NONE', create alert box with No Alert
      $box .= ' <div style="font-size:19px; '.$bc.' '.$tc.' padding:4px 8px 4px 8px; text-align: center"><a href="'
           .$summaryURL.'" title=" &nbsp;View summary" style="text-decoration:none; '.$tc
           .'">There are currently no active warnings, watches, or advisories in effect</a></div>




Ryan 

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

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: New Weather Alert Program
« Reply #112 on: April 01, 2013, 10:13:13 PM »
Any changes won't take affect until nws-alerts.php is ran.
Did you wait?

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: New Weather Alert Program
« Reply #113 on: April 01, 2013, 10:13:42 PM »
Last update was at 9:03CST




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: New Weather Alert Program
« Reply #114 on: April 01, 2013, 10:14:39 PM »
Thanks Curly. One last thing.How  do I put text above like shown here http://www.cnyweather.com/index.php where his Central New York Severe Weather Alerts is?
« Last Edit: April 02, 2013, 12:56:32 AM by hayskswx »




Ryan 

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

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2297
    • CNYWeather
Re: New Weather Alert Program
« Reply #115 on: April 02, 2013, 07:42:37 AM »
Ryan, I modified my NWSAlertBOX.php like so:

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;">
<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>

Here's what it looks like: http://www.cnyweather.com/NWSAlertBOX.php

Then I just do a php include on my main page.
Tony




Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: New Weather Alert Program
« Reply #116 on: April 02, 2013, 12:21:41 PM »
I didn't have a NWSALERTBOX.php on my server so I made one. Is this correct?   Is there anything else to edit? Then what?

http://hayskansasweather.com/nwsalertbox.php
« Last Edit: April 03, 2013, 12:43:01 PM by hayskswx »




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: New Weather Alert Program
« Reply #117 on: April 02, 2013, 03:08:19 PM »
Here is my index.php where the box is. What do I need to edit in this section?

Code: [Select]
?>

</head>
<body>
<?php include("nws-alerts.php"); ?>
<?php
############################################################################
include("header.php");
############################################################################
include("menubar.php");
############################################################################
//
$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(isset($SITE['NWSalertsCodes']) and count($SITE['NWSalertsCodes']) > 0) {
// Add nws-alerts alert box cache file
include_once("nws-alerts-config.php");
include(
$cacheFileDir.$aboxFileName);
// Insert nws-alerts alert box
echo '<div style="font-size:14px">'.$alertBox.'</div>';
?>

<script type="text/javascript" src="nws-alertmap.js"></script>
<?php
} else { // use atom scripts of choice
if ($useTopWarning) {
include_once(
"atom-top-warning.php");
} else {
print 
" <div class=\"advisoryBox\">\n";
$_REQUEST['inc'] = 'y';
$_REQUEST['summary'] = 'Y';
include_once(
"atom-advisory.php");
print 
" </div>\n";
}
}
?>




Ryan 

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

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2297
    • CNYWeather
Re: New Weather Alert Program
« Reply #118 on: April 03, 2013, 03:45:48 PM »
SRY, busy day here Ryan.

Did you check out the index.php I sent you?

Tony




Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: New Weather Alert Program
« Reply #119 on: April 03, 2013, 04:30:45 PM »
Yes. Mine shows  only the top of it and not the bottom part. Can't figure it out.  Figured out windows task scheduler to add multiple counties.




Ryan 

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

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2297
    • CNYWeather
Re: New Weather Alert Program
« Reply #120 on: April 03, 2013, 04:54:19 PM »
put the snippet of your index up for me to look at later Ryan.

Where the <div id="main-copy"> after your sidebar in the index.php file begins
I think you're missing something because it doesnt look like my source code.
Tony




Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: New Weather Alert Program
« Reply #121 on: April 04, 2013, 04:02:39 AM »
I think I got it here http://hayskansasweather.com/index.php
Thanks Tony for the help. I didn't do a php include I put a code in and it worked.
« Last Edit: April 04, 2013, 04:17:01 AM by hayskswx »




Ryan 

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

Offline Saunookweather

  • Member
  • *
  • Posts: 26
    • Saunookweather
Re: New Weather Alert Program
« Reply #122 on: April 04, 2013, 08:40:05 AM »
Got it working on my site. Hope you don't mind me using it Tony.
Thanks for coming up with that code.


Jeff
www.saunookweather.com

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2297
    • CNYWeather
Re: New Weather Alert Program
« Reply #123 on: April 04, 2013, 09:10:55 AM »
Yep, not a problem guys. There's probably a better way to do it
and maybe one of the wizards of php will figure it out.

 :grin:
Tony




Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: New Weather Alert Program
« Reply #124 on: April 05, 2013, 01:07:42 PM »
What does everyone have the setting set to on line 52 on nws-alerts-config? In other words how to you just have the advisory listed and the counties follow besides every county with duplicate advisories?


Code: [Select]
$sortbyEvent   = 0;                         // sort titles by severity in alert box & then by number listed below
//                                             0 = location - duplicate events will be displayed
//                                             1 = location - duplicate events removed
//                                             2 = event - duplicate events will be displayed
//                                             3 = event - duplicate events removed
« Last Edit: April 05, 2013, 01:14:10 PM by hayskswx »




Ryan 

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

 

anything