Temperature Detail addon page for WD-AJAX-PHP-USA template

I have modified Kevin Reed’s excellent rain detail script to display daily temperatures.
You can see it in action at http://weather.wildwoodnaturist.com/wxtempdetail.php
Download at http://weather.wildwoodnaturist.com/downloads.php .

It includes two files:


Requirements to use these scripts:

o You need to be uploading the dailynoaareport*.htm files via WD to your website.

Current month file is named dailynoaareport.htm

Other months are named dailynoaareportMMYYYY.htm. Note that the
months are not padded so that Jan would simply be like
dailynoaareport12009.htm with no zero padding for the month.

Note that there was a change in format in 2007 that will require updating reports from that time before
so they can be parsed correctly. (If you are already using the Rain Detail script successfully, you have already done this.)

To recreate use View → Avg Ext/Noaa Reports → 2nd Tab for Noaa Style Reports.

Select which date you want to recreate in the Select Date to Calculate Field.

Then copy and paste the results into a new file (use notepad or some other editor)
and save the file as mentioned above.

o Need to know where they are located (default normally would be in the web root)
o PHP5


There are some settings that you can make to the script in the settings section:

$SITE[‘viewscr’] = ‘sce’;
Defines the password for the view source command. Default is sce.

$first_year_of_data = “2007”;
Set to the first year of data you have available. A dropdown box will then display an option for all years from the first year of data to the present.

$loc = “./”;
Defines where the dailynoaareport*.htm files are located. The above assumes they are in the same level as the script itself.

$range = “year” or “season”
$season_start = 7;
Defines when the season starts. 1 = Jan, 7 = July
I don’t know if temperature really has a season, but the option is there anyway.

$hot = 100;
$cold = 32;
If the temperature is at or above the $hot or at or below the $cold settings, those days will be highlighted.
If you don’t want the highlighting, set the $hot and $cold to unreasonably high or low settings.

The default location for the noday.png file is in the images subdirectory. If you place it somewhere else, you will need to edit the wxtempdetail.css file.

New in Version 1.3
$round = false; Set to true if you want temperatures rounded to the nearest whole number.

New in Version 1.4
This version allows the monthly summary averages/hi/lows to have the same color formatting as the daily temperatures.
If you do not want the summary colors to be the same as the daily colors, set $summaryformat to false.

New in Version 1.5
Monthly highs/lows/averages are now displayed on separate rows.
The starting point of the temperature colorbands can be raised or lowered with the $temprange_start setting.
The increments between the colorbands can be changed with the $temprange_increment setting.

New in Version 1.6
Added the Monthly mean temperature to the monthly summary table. Various CSS changes.

Hi, thanks, its a great addition, up and running easy peasy :smiley: here http://www.newquayweather.com/wxtempdetail.php

Just got to change the css to match rain detail colours.

Excellent idea. Works elegantly. But I had to translate into Polish.
I hope that is not a problem?


Another great addition, works first time with no hassle :slight_smile:



Phil, you must really like it hot if you consider anything less than 32 C / 89 F to be cold. :smiley:

Indeed, Phil has to like the heat :smiley:
Phil, can you help with running wordpress blog. I saw that you have a multilingual site and this script you work.
Have you had a similar problem like me?


Ok so I didn’t change the limits :oops:


I don’t have the problem you have, unfortunately I am a complete novice at all this so I suggest you post a question on the following thread

I am sure one of the many excellent people with more knowledge than me will be able to help you.


OK Phil.
Already asked in another thread about the additive wordpress. But the author of the script stated that the error may be due to the fact that the script is for the U.S. version.
Very pity. But I wait for some update script. It is possible that want to work :wink:

Thank you

Got it working here also with a few css changes: http://www.cavecountryweather.com/wxtempdetail.php

Thank you Murray…worked out of the box…still need to do some css adjustment


First of all thanks for the script.
Working Well here :smiley:
I have changed some of code so the CSS stylesheet will change when the theme changes too.


Happy New Year!!!

Thanks for the script. Worked like a charm right off.


John Sacrey

Hi Murray,
Thank you for the hard work, added some code to use more colors.
Using same colors as temp-gauge in wd-live.


EDIT:Look at 2009

Hi pinto

That looks cool, any chance on sharing please? because i struggled to get mine looking ok

You can see the code here (link removed as you can use the latest version from Murry), but it is only metric, so if someone wants to use it, look at the function at the bottom of the page, thats where I calculate the color-values.

Maybe if you ask it, Murry can make it work for everyone… :wink:

Nice script.


Be interesting to see if highs and lows for each day could be found from all the data files. So the hot for July 4 might be 2007 while the low for July 4 might be 2008.

Thanks for a really nice addon.

I have one question, if i want to have borders around the figures how should i do that?

There was borders in the beginning but when i did change to Pintos color-values so did those borders disappear.

To bounce off editing to place color as in the heatcolourword for the temp a simple modification to his script is as follows:


			if ($mark)
            	if ($put >= $hot) 
            		echo '<td class="hotday">' . sprintf("%01.1f", $put) . '</td>';
            	else if ($put < $hot && $put > $cold) 
            		echo '<td class="tempday">' . sprintf("%01.1f", $put) . '</td>';
            	else if ($put <= $cold) 
            		echo '<td class="coldday">' . sprintf("%01.1f", $put) . '</td>';
            		echo '<td class="tempdayr">' . sprintf("%01.1f", $put) . '</td>';
                echo '<td class="tempday">' . $put . '</td>';


if ($mark)
            		echo '<td bgcolor="'. ValueColor($put) .'">'. sprintf("%01.1f", $put) . '</td>';

                echo '<td class="rainday">' . $put . '</td>';


			if ($mark)
            		echo '<td bgcolor="'. ValueColor($put) .'" style="font-color: #ffffff; font-size: 75%; border: 1px solid #22464F; text-align: center; padding: 2px;">'. sprintf("%01.1f", $put) . '</td>';
                echo '<td class="tempday">' . $put . '</td>';

Notice rainday is replaced with tempday.
Also please note there are 2 locations where this code requires replacement.

If you want to change the border color simply edit the color of the border in the CSS file or the above code.

View my page at http://www.k3jae.com/wxtempdetail.php The only problem I have is my 2009 final never finaled I guess as no temps are showing for 2009. Can someone tell me how to finalize the year so the graphs are showing. 2008 is working fine.

I’m having some issues with the color on this script.

I’m using the code that K3JAE did post, and i have added a temperature color coding chart.

But even if I use the same color code so will it not be the same on the pages in the coding chart, see here http://www.axelvold.net/wd/tempdetail1.php?year=2009

Coding chart:

<tr><td width="274" bgcolor="#0000CC">&nbsp;</td><td width="44" align="center"><b>&nbsp;=&nbsp;</b></td><td align="left">Temp is/was -15