Page 13 of 19

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Tue 13 Aug 2013 9:46 am
by beteljuice
Yours is configured for CUmulus Laurent, wetter-pocking is configured for VWS which has a different naming scheme and has a 'fixed' title for current year / month files.

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Thu 15 Aug 2013 11:18 pm
by GraemeT
Hi all,
Not sure if this has been covered before.

It seems that some server/php configurations implement certain $_SERVER and $_ENV variables in a manner which causes their values to be incorrect.
One of these is the $_SERVER['PHP_SELF'] variable, used in the NOAA-reports.php script.
In my case this was returning /noaarep.php/noaarep.php instead of /noaarep.php
I found a description of the cause of this and a solution at http://php.net/manual/en/reserved.variables.php

The solution is to change the code at about line 158 from:

Code: Select all

$PHP_SELF = $_SERVER['PHP_SELF'];
to

Code: Select all

$PHP_SELF = $_ENV['SCRIPT_URL'];
Since this change I've had no more problems.

Here's a link to my test page: http://weather.gktnet.com/noaarep.php

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Fri 16 Aug 2013 10:51 pm
by beteljuice
@wetter-pocking

I've copied some of your files and directory settings and replicated the problem, which only becomes obvious when there is more than 'this' years data, although the bug is deeper than that !

I continue to investigate ...
... but I do have other commitments ATM .............

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 17 Aug 2013 1:16 pm
by nitrx
wetter-pocking wrote:There is no "2013_08.txt", because this is the current month and the data is written to "noaamo.txt".

And there is no "2013.txt"-file, data of 2013 is written to "noaayr.txt".
Can't you do an automatic rename on the serversite for those 2 files ? or upload these two with right names in a batch ftp ?

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 17 Aug 2013 2:35 pm
by beteljuice
Update affecting non CUmulus users

Menu bug fix

Many thanks to wetter-pocking for making me find a logic 'hole' that no one else has mentioned :clap:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 17 Aug 2013 3:28 pm
by nitrx
Hi I've never followed this but does the script handles NOAA-reports wit a comma as decimal separator ?

like this ?

Monthly Climatological Summary for aug 2013

Name: Apeldoornmeteo City: Apeldoorn State: The Netherlands
Elevation: 10 m Lat: N 52° 13' 12" Lon: E 006° 00' 02"

Temperature (°C), Rain (mm), Wind Speed (m/s)

Heat Cool Avg
Mean Deg Deg Wind Dom
Day Temp High Time Low Time Days Days Rain Speed High Time Dir
----------------------------------------------------------------------------------
1 24,7 30,7 18:04 18,1 05:59 0,0 6,6 0,0 1,4 6,6 15:17 ZZW
2 26,6 34,7 17:03 17,4 05:59 0,2 8,9 0,0 1,3 6,6 14:47 ZZW
3 22,2 27,9 00:00 16,2 23:58 0,0 4,1 0,0 2,1 8,7 13:54 WZW
4 20,1 26,4 17:32 12,5 05:52 1,4 3,3 0,0 0,9 5,1 19:48 WZW
5 22,2 29,3 16:10 14,0 05:56 1,0 5,0 0,0 1,1 8,7 13:10 ZZW
6 18,8 22,3 14:22 15,5 23:49 0,7 1,3 6,6 1,8 6,6 00:09 NW
7 14,5 16,6 10:16 12,1 05:40 3,8 0,0 11,0 3,2 11,7 15:52 NNO
8 16,7 21,7 16:54 13,1 23:55 2,4 0,7 1,5 1,9 8,1 16:34 NNO
9 17,4 23,3 15:23 10,6 05:38 2,6 1,7 0,0 0,9 5,1 14:43 WZW
10 16,8 21,0 16:21 11,6 23:47 1,9 0,4 0,0 1,7 8,1 18:35 WZW
11 16,1 22,8 17:10 10,3 03:08 3,0 0,8 0,3 1,4 6,6 15:48 WZW
12 16,5 22,3 16:35 12,1 23:58 2,3 0,6 0,0 1,2 6,1 17:50 WZW
13 14,5 19,6 17:47 10,3 06:25 3,8 0,1 3,0 1,7 8,1 16:56 W
14 15,3 21,3 16:37 9,3 05:13 3,6 0,6 0,0 1,2 7,2 13:27 N
15 15,1 20,2 19:22 8,2 06:07 3,5 0,2 0,5 1,0 6,1 11:16 ZW
16 19,5 27,3 15:46 12,7 06:14 1,6 2,8 0,5 1,4 8,1 13:55 ZW
----------------------------------------------------------------------------------
18,6 34,7 2 8,2 15 31,8 37,1 23,4 1,5 11,7 7 W

Max >= 25,0: 6
Max <= 30,0: 14
Min <= 0,0: 0
Min <= -10,0: 0
Max Rain: 11,0 on day 7
Days of Rain: 7 (>= 0,2 mm) 3 (>= 2,0 mm) 0 (>= 20,0 mm)
Heat Base: 18,3 Cool Base: 18,3 Method: Integration

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 17 Aug 2013 4:06 pm
by mcrossley
Ron, it doesn't look at the content of the reports, it just displays them, so yes it will work fine with a comma decimal.

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 17 Aug 2013 6:17 pm
by nitrx
mcrossley wrote:Ron, it doesn't look at the content of the reports, it just displays them, so yes it will work fine with a comma decimal.
Thanks Mark I will give it a try soon.

Ron

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 17 Aug 2013 6:56 pm
by wetter-pocking
@ beteljuice

:clap: Thanks for your work! :clap:

Everything works fine now!

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Tue 17 Sep 2013 4:38 pm
by stewart45
Got this working even with my limited knowledge, http://www.rainman.me.uk/month-reports.php
only problem the website is displaying the degree symbol wrong, looks OK on the original report any ideas where to look to correct this
thanks in anticipation

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Tue 17 Sep 2013 5:07 pm
by steve
stewart45 wrote:only problem the website is displaying the degree symbol wrong, looks OK on the original report any ideas where to look to correct this
Your web page is utf-8, so I think you need to select the utf-8 option in Cumulus in the NOAA setup.

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Wed 18 Sep 2013 7:52 am
by stewart45
Hi Steve
Can't see that option on the NOAA setup under configeration or am I looking in the wrong place

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Wed 18 Sep 2013 7:55 am
by steve
It was an addition to 1.9.4, it sounds like you have 1.9.3.

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Wed 18 Sep 2013 9:25 am
by stewart45
Thanks Steve
upgraded and problem sorted

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Wed 18 Sep 2013 12:27 pm
by beteljuice
stewart45 wrote:Got this working even with my limited knowledge, http://www.rainman.me.uk/month-reports.php
....
You have multiple <doctype> , <head><body><html> statements in your page !

I am assuming you didn't follow the instructions on including and have created a html page within a html page.