Author Topic: USA Extremes  (Read 19152 times)

0 Members and 1 Guest are viewing this topic.

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: USA Extremes
« Reply #50 on: January 30, 2014, 01:59:04 AM »
I've been running the 'Wind' stat since last Fall but I got tired of seeing Mt Washington every day (it seemed). If you follow the actual Wind array for a few days, you'll see a lot of strange results - Mt Washington being duped and the like.

What I ended up doing was pulling the data from the first non-Mt Washington if it was first (or second) and displaying the Mt Washington data in smaller font underneath (optioned).

I run it in a horizontal configuration atop of the WU radar screens in the (outdated) Saratoga template. That also had me add a feature to "auto-size" the fonts for any data over 24 characters long for those occasional airport listings that are.

If anyone is interested, I can pull out the changes I made for posting when I get a chance.

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2295
    • CNYWeather
Re: USA Extremes
« Reply #51 on: January 30, 2014, 09:53:21 AM »
I like the way you did that Pat. And yes, Mt. Washington is always on the top of the list as far as wind gusts
which is a pain.
Tony




Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: USA Extremes
« Reply #52 on: January 31, 2014, 03:19:35 PM »
If anyone is interested, I can pull out the changes I made for posting when I get a chance.
Would like to see those when you get a minute.

Thanks.
John
W7JKG

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: USA Extremes
« Reply #53 on: February 08, 2014, 07:16:13 PM »
Sorry for the time lapse - some other things got in the way and I also wanted to clean the script up a bit to be more presentable. You know how that goes...  :oops:

Another thing I've noticed since using the Wind is that, from time to time, WU would have dupes in their table as well. I ended up redoing the wind code for that and putting together a quick ReadMe for the way I use it.

I imagine the way I pull the Wind data can be adapted to the side-menu usage but the HTML usage in the file is for the Horizontal style (hence the 'H' in the file name).

« Last Edit: February 22, 2014, 02:29:35 PM by Cienega32 »

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: USA Extremes
« Reply #54 on: February 08, 2014, 10:52:16 PM »
Thanks, Pat.
John
W7JKG

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: USA Extremes
« Reply #55 on: February 09, 2014, 06:43:40 AM »
That also had me add a feature to "auto-size" the fonts for any data over 24 characters long for those occasional airport listings that are.

Perfect example of that "auto-size" tonight:

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: USA Extremes
« Reply #56 on: February 09, 2014, 08:41:09 AM »
Yeah, the 'King Cove AP, King Cove, A, AK' is quite a *mouthfull* for the script.

I stole some of your logic for the Mt. Washington hack adapting it to my homepage version of the script.

Thanks for sharing...

Brad
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: USA Extremes
« Reply #57 on: February 10, 2014, 12:37:25 AM »
Nice looking site (great color combos, IMHO) and the extremes box looks great too. I like the inclusion of the H/I and W/C.

Check your code tho' I think you're printing some at the top of your page:  "**** ?>"

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: USA Extremes
« Reply #58 on: February 10, 2014, 02:48:08 AM »
Check your code tho' I think you're printing some at the top of your page:  "**** ?>"

Thanks for that, didn't notice after I made the changes.

Brad

Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: USA Extremes
« Reply #59 on: February 10, 2014, 03:34:23 AM »
No problem.

I enjoyed your slideshow for your station. Seeing it freshly unpacked gave me some deja vu with the thrill I had when mine finally came and was unpacked.

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: USA Extremes
« Reply #60 on: February 11, 2014, 04:36:27 AM »
I enjoyed your slideshow for your station. Seeing it freshly unpacked gave me some deja vu with the thrill I had when mine finally came and was unpacked.

Almost three years to the day I unpacked that unit, went back and looked at the pictures this morning. Could probably use a new format for the images, that one was just kind of thrown together. :oops:

You had mentioned in an earlier post about the addition of 'wind chill' and 'heat index' to my extremes box on my home page, if anyone wants the coding for those two I'll be happy to provide.

Brad

Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: USA Extremes
« Reply #61 on: February 11, 2014, 05:27:53 AM »
They do fit nicely on the side-bar styling and make perfect sense to have.

I'm closing in on 7 years when I received my hardware and it still seems fresh in my mind.



Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: USA Extremes
« Reply #62 on: February 11, 2014, 08:46:11 AM »
They do fit nicely on the side-bar styling and make perfect sense to have.

Using Ken's script $usaextremesverion = "2.01"; all you have to do is add the 'copycat' logic to pull the wind chill and heat index from the cache file as that data is already present in the file.

This is currently in the script

Code: [Select]
//Finds USA High
preg_match_all('|<div id="highTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
//  print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $hightable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$hightable,$matches);
  //  print "<pre>\n".print_r($matches,true)."</pre>\n";
  $usahigh = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0]))); 
  print "<!-- usahigh='$usahigh' -->\n";
} else {
$usahigh = 'N/A';
}

//Finds USA Low
preg_match_all('|<div id="lowTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
//  print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $lowtable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$lowtable,$matches);
  //  print "<pre>\n".print_r($matches,true)."</pre>\n";
$usalow = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0]))); 
  print "<!-- usalow='$usalow'-->\n";
} else {
$usalow = 'N/A';
}

Then add the logic for the wind chill and heat index

Code: [Select]
//Finds USA High
preg_match_all('|<div id="highTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
//  print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $hightable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$hightable,$matches);
//  print "<pre>\n".print_r($matches,true)."</pre>\n";
  $usahigh = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0]))); 
  print "<!-- usahigh='$usahigh' -->\n";
} else {
$usahigh = 'N/A';
}

//Finds USA High Heat Index
preg_match_all('|<div id="heatIndex"[^>]*>(.*)</div>|Uis', $html2, $matches);
 // print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $heatIndextable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$heatIndextable,$matches);
  //  print "<pre>\n".print_r($matches,true)."</pre>\n";
  $usaheatIndex = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'&nbsp;<br/>'.strip_tags($matches[1][0]))); 
  print "<!-- usaheatIndex='$usaheatIndex' -->\n";
} else {

$usaheatIndex = 'N/A';
}
//Finds USA High Wind Chill
preg_match_all('|<div id="windChill"[^>]*>(.*)</div>|Uis', $html2, $matches);
 // print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $windChilltable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$windChilltable,$matches);
  //  print "<pre>\n".print_r($matches,true)."</pre>\n";
  $usawindChill = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'&nbsp;<br/>'.strip_tags($matches[1][0]))); 
  print "<!-- usawindChill='$usawindChill' -->\n";
} else {
$usawindChill = 'N/A';
}

//Finds USA Low
preg_match_all('|<div id="lowTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
//  print "<pre>\n".print_r($matches,true)."</pre>\n";

if(isset($matches[1][0])) {
  $lowtable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$lowtable,$matches);
 
//  print "<pre>\n".print_r($matches,true)."</pre>\n";

  $usalow = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0]))); 
  print "<!-- usalow='$usalow'-->\n";
} else {
$usalow = 'N/A';
}

Of course, then who ever uses those snippets will also have to add them where the extremes show up on the page, whether in the sidebar or horizontal like yours.

This is what I use on my homepage
Code: [Select]
  <div class="extremes">
<?php include_once('mwextremes.php')?>       
     High Temperature= <?php echo $usahigh ?>  <br/>****<br/>
     High Heat Index= <?php echo $usaheatIndex ?>  <br/>****<br/>
     Low Temperature= <?php echo $usalow ?>  <br/> **** <br/>
     Lowest Wind Chill= <?php echo $usawindChill ?>  <br/> **** <br/>
     High Wind Gust= <?php echo $usawind ?>  <br/><?php echo $usawind ?>  <br/> **** <br/>
     Rainfall= <?php echo $usaprecip ?> <br/>****<br/>
         <small> Data from WeatherUnderground</small>
 </div>

All the Best

Brad

PS, did you happen to snap any pics of your unpacking 7yrs ago?
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline tnwxman

  • Forecaster
  • *****
  • Posts: 423
  • KK4QXH
    • Weather for Lebanon, TN 37087
Re: USA Extremes
« Reply #63 on: February 11, 2014, 06:15:30 PM »
Hi,

Thank you for sharing your code. Just wondering is there a reading for snowfall?

Let me know. Thanks.

Bob
Bob
KK4QXH

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: USA Extremes
« Reply #64 on: February 12, 2014, 03:57:01 AM »

PS, did you happen to snap any pics of your unpacking 7yrs ago?

Oddly enough, no. I'm the type that takes pics of everything along the way but somehow that escaped me. I think I was too excited at the time to remember. I had wanted a station for a few years and finally pulled the trigger on the Davis a year after moving to this part of the country (from Las Vegas NV) and going thru torrential rain my first summer here. I was pretty thrilled when it arrived.

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline tnwxman

  • Forecaster
  • *****
  • Posts: 423
  • KK4QXH
    • Weather for Lebanon, TN 37087
Re: USA Extremes
« Reply #65 on: February 12, 2014, 02:03:14 PM »
Just checking back to see if there is a snowfall reading that can be captured and displayed.

Let me know.

Thanks.

Bob
Bob
KK4QXH

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: USA Extremes
« Reply #66 on: February 12, 2014, 02:49:26 PM »
Hey Bob,

If you look at the page http://www.wunderground.com/climate/extremes.asp that the script gets its data from there is nothing about snowfall, just the other extremes in the World and US.

I did happen to pick up the World High and Low temps from the same script to add to my extremes box on my homepage. If you or anyone else is interested in that coding, I'll post it...

Brad
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline tnwxman

  • Forecaster
  • *****
  • Posts: 423
  • KK4QXH
    • Weather for Lebanon, TN 37087
Re: USA Extremes
« Reply #67 on: February 12, 2014, 04:28:24 PM »
Hi Brad,

Thanks, I see what you mean. Yes, I am interested in the world high and low temperatures also.

Thanks again.

Bob
Bob
KK4QXH

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: USA Extremes
« Reply #68 on: February 12, 2014, 06:34:16 PM »
Here ya go...

These are the Eight routines that pull the data the page

Code: [Select]
//Finds USA High Heat Index
preg_match_all('|<div id="heatIndex"[^>]*>(.*)</div>|Uis', $html2, $matches);
 // print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $heatIndextable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$heatIndextable,$matches);
  //  print "<pre>\n".print_r($matches,true)."</pre>\n";
  $usaheatIndex = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'&nbsp;<br/>'.strip_tags($matches[1][0]))); 
  print "<!-- usaheatIndex='$usaheatIndex' -->\n";
} else {
$usaheatIndex = 'N/A';
}
//Finds USA High Wind Chill
preg_match_all('|<div id="windChill"[^>]*>(.*)</div>|Uis', $html2, $matches);
 // print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $windChilltable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$windChilltable,$matches);
  //  print "<pre>\n".print_r($matches,true)."</pre>\n";
  $usawindChill = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'&nbsp;<br/>'.strip_tags($matches[1][0]))); 
  print "<!-- usawindChill='$usawindChill' -->\n";
} else {
$usawindChill = 'N/A';
}
//Finds USA High Wind
preg_match_all('|<div id="wind"[^>]*>(.*)</div>|Uis', $html2, $matches);
 // print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $windtable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$windtable,$matches);
  //  print "<pre>\n".print_r($matches,true)."</pre>\n";
  $usawind = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'&nbsp;<br/>'.strip_tags($matches[1][0]))); 
  print "<!-- usawind='$usawind' -->\n";
} else {
$usawind = 'N/A';
}
//Finds USA High
preg_match_all('|<div id="highTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
 // print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $hightable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$hightable,$matches);
  //  print "<pre>\n".print_r($matches,true)."</pre>\n";
  $usahigh = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'&nbsp;<br/>'.strip_tags($matches[1][0]))); 
  print "<!-- usahigh='$usahigh' -->\n";
} else {
$usahigh = 'N/A';
}
//Finds USA Low
preg_match_all('|<div id="lowTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
 // print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $lowtable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$lowtable,$matches);
    //print "<pre>\n".print_r($matches,true)."</pre>\n";
  $usalow = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0]))); 
 print "<!-- usalow='$usalow'-->\n";
} else {
$usalow = 'N/A';
}
//Finds USA High Precip
preg_match_all('|<div id="precip"[^>]*>(.*)</div>|Uis', $html2, $matches);
  //print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $raintable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$raintable,$matches);
   // print "<pre>\n".print_r($matches,true)."</pre>\n";
  $usaprecip = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0]))); 
 print "<!-- usaprecip='$usaprecip' -->\n";
} else {
$usaprecip = 'N/A';
}
//Finds World High
preg_match_all('|<div id="worldHighTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
 // print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $Whightable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$Whightable,$matches);
    //print "<pre>\n".print_r($matches,true)."</pre>\n";
  $worldhigh = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0]))); 
 print "<!-- worldhigh='$worldhigh'-->\n";
} else {
$worldhigh = 'N/A';
}

//Finds World Low
preg_match_all('|<div id="worldLowTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
 // print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
  $Wlowtable = $matches[1][0];
  preg_match_all('|<td>(.*)</td>|Uis',$Wlowtable,$matches);
    //print "<pre>\n".print_r($matches,true)."</pre>\n";
  $worldlow = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0]))); 
 print "<!-- worldlow='$worldlow'-->\n";
} else {
$worldlow = 'N/A';
}

Then these are the Eight 'echo' statements you need in your page where you place them

Code: [Select]
     High Temperature= <?php echo $usahigh ?>
     High Heat Index= <?php echo $usaheatIndex ?>
     Low Temperature= <?php echo $usalow ?>
     Lowest Wind Chill= <?php echo $usawindChill ?>
     High Wind Gust= <?php echo $usawind ?>   
     Rainfall= <?php echo $usaprecip ?>
     World High Temp= <?php echo $worldhigh ?>
     World Low Temp= <?php echo $worldlow ?>

If you have any problems, post your code that you use in your sidebar for the extremes, most likely a table?

Brad

*edit* this does not include Pats Mt. Washington changes so don't change the High Wind Gust if you've already added his routine.
« Last Edit: February 12, 2014, 06:39:27 PM by MackerelSky »
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline tnwxman

  • Forecaster
  • *****
  • Posts: 423
  • KK4QXH
    • Weather for Lebanon, TN 37087
Re: USA Extremes
« Reply #69 on: February 12, 2014, 06:54:15 PM »
Thanks Brad.

I do not have Pat's Mt. Washington routine for the wind. Is it in the post but earlier on?

Thanks again.

Bob
Bob
KK4QXH

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: USA Extremes
« Reply #70 on: February 13, 2014, 06:44:43 AM »
reply #53 Bob

*edit* I see you've made progress on your home page with the extremes
« Last Edit: February 13, 2014, 06:48:53 AM by MackerelSky »
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline Saunookweather

  • Member
  • *
  • Posts: 26
    • Saunookweather
Re: USA Extremes
« Reply #71 on: February 13, 2014, 08:21:08 AM »
For what it's worth here is my menu bar

Code: [Select]
<!-- US Extremes --> 
  <ul>
  <p class="sideBarTitle style5">&nbsp;</p>
  </ul>
  <p class="sideBarTitle">
    <?php langtrans('Weather Extremes'); ?>
  </p>
<!-- Weather Underground -->
<?php include_once('usaextremes.php')?>
<p align="center" style="font-size:100%; font-weight:bold; color:#181008">Past 24 Hours</p>
<p align="center" style="font-size:90%; font-weight:lighter; color:#F00"><span class="style8">USA High:</span>&nbsp;<?php echo $usahigh ?></p>
<p align="center" style="font-size:90%; font-weight:lighter; color:#F00"><span class="style9">USA High Heat Index:</span>&nbsp;<?php echo $usaheatIndex ?></p>
<p align="center" style="font-size:90%; font-weight:lighter; color:#0000FF">USA Low:&nbsp;<?php echo $usalow ?></p>
<p align="center" style="font-size:90%; font-weight:lighter; color:#0000FF">USA Low Windchill Low:&nbsp;<?php echo $usawindChill ?></p>
<p align="center" style="font-size:90%; font-weight:lighter; color:#CC9900">High Wind:&nbsp;<?php echo $usawind ?>
<p align="center" style="font-size:90%; font-weight:lighter; color:#33CC00">Max Precip:&nbsp;<?php echo $usaprecip ?> </p>
============
 <p align="center" style="font-size:90%; font-weight:lighter; color:#F00"><span class="style8">World High Temp:</span>&nbsp;<?php echo $worldhigh ?>
 <p align="center" style="font-size:90%; font-weight:lighter; color:#F00"><span class="style12">World Low Temp:&nbsp;<?php echo $worldlow ?></span>
<center>
<span class="style11"><small> Data from WeatherUnderground </small></span> </p>
  <!--- end US Extremes -->

Offline tnwxman

  • Forecaster
  • *****
  • Posts: 423
  • KK4QXH
    • Weather for Lebanon, TN 37087
Re: USA Extremes
« Reply #72 on: February 13, 2014, 10:46:38 AM »
Brad and Saunookweather,

Thank you for your sharing and help.

A few of questions (mostly cosmetic questions).

Is there a way to reduce the amount of space from the section above to where it says weather extremes? Looks like weather extremes starts two lines down from the previous section adding to the background space?

From where the 'Data from Weather Undgerground' is and the next section which is the Style section there seems to be extra space there also. Can that be reduced?

Finally since there is world high and low temperature can the world high rain be added?

Again thank you.

Bob

lebanontnwx.org

Bob
KK4QXH

Offline Saunookweather

  • Member
  • *
  • Posts: 26
    • Saunookweather
Re: USA Extremes
« Reply #73 on: February 13, 2014, 12:04:12 PM »
See if this works for you tnwxman, don't know about the world high rain.
Don't use the Style Options on my site so don't know about that space issue.

Code: [Select]
<!-- US Extremes -->
  <center><p class="sideBarTitle">
    <?php langtrans('Weather Extremes'); ?>
<!-- Weather Underground -->
<?php include_once('usaextremes.php')?>
<p align="center" style="font-size:100%; font-weight:bold; color:#181008">Past 24 Hours</p>
<p align="center" style="font-size:90%; font-weight:lighter; color:#F00"><span class="style8">USA High:</span>&nbsp;<?php echo $usahigh ?></p>
<p align="center" style="font-size:90%; font-weight:lighter; color:#F00"><span class="style9">USA High Heat Index:</span>&nbsp;<?php echo $usaheatIndex ?></p>
<p align="center" style="font-size:90%; font-weight:lighter; color:#0000FF">USA Low:&nbsp;<?php echo $usalow ?></p>
<p align="center" style="font-size:90%; font-weight:lighter; color:#0000FF">USA Low Windchill Low:&nbsp;<?php echo $usawindChill ?></p>
<p align="center" style="font-size:90%; font-weight:lighter; color:#CC9900">High Wind:&nbsp;<?php echo $usawind ?>
<p align="center" style="font-size:90%; font-weight:lighter; color:#33CC00">Max Precip:&nbsp;<?php echo $usaprecip ?> </p>
---------------------
 <p align="center" style="font-size:90%; font-weight:lighter; color:#F00"><span class="style8">World High Temp:</span>&nbsp;<?php echo $worldhigh ?>
 <p align="center" style="font-size:90%; font-weight:lighter; color:#F00"><span class="style12">World Low Temp:&nbsp;<?php echo $worldlow ?></span>
<center>
<span class="style11"><small> Data from WeatherUnderground </small></span>
  <!--- end US Extremes -->
« Last Edit: February 13, 2014, 12:14:16 PM by Saunookweather »

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: USA Extremes
« Reply #74 on: February 13, 2014, 12:23:30 PM »
I ordinarily avoid tables in order to use the 'more modern' css formatting.  In this case however, the table works better for me:
Code: [Select]
<!-- US Extremes -->
<!-- Weather Underground -->
<?php include_once('usaextremes.php')?>
<div class="thisPage" style="font-weight:lighter">
  <p class="sideBarTitle">
    <?php langtrans('Weather Extremes');?><br/><?php langtrans('Past 24 Hours'); ?>
  </p>
  <table class="center" style="text-align:center; width:110px; padding-top:0; padding-bottom:0">
  <tr><td><span style="font-size: 95%; font-weight:bold">==========</span></td></tr>
  <tr><td><span style="font-size: 110%; font-weight:bold">USA</span></td></tr>
  <tr><td><span style="font-size: 90%; font-weight:bold; color: red;">High Temp</span></td></tr>
  <tr><td><span style="font-size: 80%"><?php print $usahigh?></span></td></tr>
  <tr><td><span style="font-size: 90%; font-weight:bold; color: red;">High Heat Index</span></td></tr>
  <tr><td><span style="font-size: 80%"><?php print $usaheatIndex?></span></td></tr>
  <tr><td><span style="font-size: 90%; font-weight:bold; color: blue;">Low Temp</span></td></tr>
  <tr><td><span style="font-size: 80%"><?php print $usalow?></span></td></tr>
  <tr><td><span style="font-size: 90%; font-weight:bold; color: blue;">Low Wind Chill</span></td></tr>
  <tr><td><span style="font-size: 80%"><?php print $usawindChill?></span></td></tr>
  <tr><td><span style="font-size: 90%; font-weight:bold; color: green;">Precipitation</span></td></tr>
  <tr><td><span style="font-size: 80%"><?php print $usaprecip?></span></td></tr>
  <tr><td><span style="font-size: 90%; font-weight:bold; color: orange;">High Wind</span></td></tr>
  <tr><td><span style="font-size: 80%"><?php print $usawind?></span></td></tr>
  <tr><td><span style="font-size: 95%; font-weight:bold">==========</span></td></tr>
  <tr><td><span style="font-size: 110%; font-weight:bold">World</span></td></tr>
  <tr><td><span style="font-size: 90%; font-weight:bold; color: red;">High Temp</span></td></tr>
  <tr><td><span style="font-size: 80%"><?php print $worldhigh?></span></td></tr>
  <tr><td><span style="font-size: 90%; font-weight:bold; color: blue;">Low Temp</span></td></tr>
  <tr><td><span style="font-size: 80%"><?php print $worldlow?></span></td></tr>
  <tr><td><span style="font-size: 95%; font-weight:bold">==========</span></td></tr>
  <tr><td><span style="font-size: 70%">Data from Weather Underground</span></td></tr>
</table>
</div>
<!--- end US Extremes -->
This helps eliminate empty vertical space.  I've also created 'USA' and 'World' titles for those sections so I could eliminate repetitious language.

Another advantage of this approach is that the data text is displayed in the appropriate default by the 'thisPage' class when style switching.

Edit:  I've changed the 'font-size' to 110% on 'USA' and 'World' for larger headings on these sections.  You can also squeeze the display into even less space by changing
Code: [Select]
  <table class="center" style="text-align:center; width:110px; padding-top:0; padding-bottom:0">
to
Code: [Select]
  <table class="center" style="text-align:center; width:110px; padding-top:0; padding-bottom:0; line-height:90%">
« Last Edit: February 14, 2014, 12:23:11 AM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com