Showing Average Daily Max & Min in wxhistory.php

I noticed the values in are in the monthly .htm files created by WD, but they don’t appear on the wxhistory.php page. Is it possible to put them in, or can someone tell me what I need to change?
Thanks. :slight_smile:

Would you mind giving a link to your website so we can see the issue?
Also, which values in monthly .htm files are not appearing in the wxhistory.php page?

Best regards,
Ken

Hi Ken,

I’m mainly concerned with these values:

Avg daily max temp :8.1

Yes, here is a fix to add to your include-wxhistory.php to display those values:

part 1: find

            array('Growing degrees days',5),
            array('Frost days',3), # mchallis added 'Frost days' support 04/21/08

and replace with

            array('Growing degrees days',5),
	    array('Avg daily min temp',5), # ktrue added 'Avg daily min temp' support 24-Nov-2010
	    array('Avg daily max temp',5), # ktrue added 'Avg daily max temp' support 24-Nov-2010
            array('Frost days',3), # mchallis added 'Frost days' support 04/21/08

part 2: find

                // Check for data lines

                output_data($value, $LEVEL);

            }

            if ($LEVEL == 2 ) {

and replace with

                // Check for data lines
		# ktrue added 'Avg daily min/max temp' support 24-Nov-2010
		if(preg_match('|Avg daily \S+ temp :|is',$value)) {
			$value = preg_replace('|\:|','  =',$value);
		}
                output_data($value, $LEVEL);

            }

            if ($LEVEL == 2 ) {

Best regards,
Ken

Thanks Ken, it works perfectly.

For those prefering to just download and go, I’ve updated the WD/AJAX/PHP template distributions with these changes.

Or… you can just download the attached version appropriate for your template.

Use the include-wxhistory.php.txt (renamed to include-wxhistory.php) if your have the English-only Canada, USA, World template.

Use the include-wxhistory-ML.php.txt (renamed to include-wxhistory.php) if you have the Multilingual Canada-ML or World-ML template.
You’ll need to add translations for

langlookup|Avg daily max temp|Avg daily max temp|
langlookup|Avg daily min temp|Avg daily min temp|

to each of the language-LL.txt translation files supported in your template.

Best regards,
Ken


include-wxhistory.php.txt (14.5 KB)

include-wxhistory-ML.php.txt (15.9 KB)