Page 12 of 19

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

Posted: Sat 25 May 2013 7:35 pm
by kingqueen
Beteljuice

Thank you for your script. It's great.

There's something wrong with the anglicised code though. I've tried multiple times, copying it precisely, and I always end up with the following error.

Code: Select all

Warning:  Division by zero in /home/wetherby/public_html/noaa-inc.php on line 433

Warning:  preg_replace() [function.preg-replace]: Empty regular expression in /home/wetherby/public_html/noaa-inc.php on line 433
I've commented out Line 433 for now and the result is at http://www.wetherbyweather.org.uk/climate.php . PHP attached

Thanks

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

Posted: Sat 25 May 2013 10:29 pm
by beteljuice
That's an old oops :oops: - corrected syntax was mentioned here: https://cumulus.hosiene.co.uk/viewtopic.p ... 4&start=80

Your code should be:

Code: Select all

	 $rpt = preg_replace('/State: West Yorkshire/'i, 'County: West Yorkshire   Country: UK', $rpt, 1);
I have re-edited the original post - thank you for bringing it to my attention.

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

Posted: Sun 26 May 2013 12:17 am
by kingqueen
beteljuice wrote:

Code: Select all

	 $rpt = preg_replace('/State: West Yorkshire/'i, 'County: West Yorkshire   Country: UK', $rpt, 1);
Thanks! I hardly dare say it, as I know absolutey zilch about Javascript etc., but to get it to work actually I had to have the i before the ':

Code: Select all

$rpt = preg_replace('/State: West Yorkshire/i', 'County: West Yorkshire   Country: UK', $rpt, 1);
Cheers

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

Posted: Sun 26 May 2013 1:14 am
by beteljuice
kingqueen wrote: ..Thanks! I hardly dare say it, as I know absolutey zilch about Javascript etc., but to get it to work actually I had to have the i before the ': ...
Arrgh ... the beteljuice had a bad bald day then and now.

You are correct of course :clap:

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

Posted: Wed 29 May 2013 10:08 am
by pernaczy
steve wrote:That's impossible! I tested it and it works! :lol:

But actually, I only tested the 'manual' saving, I forgot that the automatic saving is separate code :oops:

I'll change the other code and upload a new build later today.
Hi Steve,
It's me again. :oops: Today I had to regenerate my 2012 annual NOAA report file. From Cumulus menu I ask to generate this file then to save it. From drop-down menu I chose an option UTF-8. When editing this newly saved file under Notepad++ it says the format is ANSI.
I did the same with monthly file and here all is OK.
So it looks like the manual saving of (annual only) NOAA reports in UTF-8 format doesn't work. I have not checked other formats.
An automatic saving in UTF-8 format works fine.

Best Regards,
Piotr

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

Posted: Wed 29 May 2013 12:56 pm
by steve
Yes, there's a typo in the code for manual saving of the annual report - fixed in the next build.

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

Posted: Sun 11 Aug 2013 3:46 pm
by wetter-pocking
Does anybody know why the menu is invisible when current month is selected?
You can find my reports here: http://noaa.wetter-pocking.de/index.php

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

Posted: Sun 11 Aug 2013 4:22 pm
by mcrossley
I think we'd have to see the source PHP to figure that one out - I suspect the month offset, zero verses 1 for January is to blame somewhere.

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

Posted: Sun 11 Aug 2013 10:21 pm
by beteljuice
I must admit to being a bit bemused .....

It seems to only happen for the current month.
You have set the 'system' to look for VWS type file formats, and the program seems to be finding them, but when I try to 'see' a named month or year file I get a 404 !

Could you please confirm your file formats please ?

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

Posted: Mon 12 Aug 2013 6:11 am
by wetter-pocking
Attached you will find the file format and php code.

This is a sample link to the files directory: http://noaa.wetter-pocking.de/reports/noaamo.txt

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

Posted: Mon 12 Aug 2013 1:10 pm
by beteljuice

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

Posted: Mon 12 Aug 2013 6:38 pm
by wetter-pocking
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".

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

Posted: Mon 12 Aug 2013 8:24 pm
by BigOkie
wetter-pocking wrote:Attached you will find the file format and php code.

This is a sample link to the files directory: http://noaa.wetter-pocking.de/reports/noaamo.txt
I'm not sure if this is relevant to your problem or not, but adding the mean baro and mean humidity columns takes this file format and invalidates it (NOAA format) as they do not include that data.

Just pointing that out. If you're using it for other things, then continue on.

:)

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

Posted: Mon 12 Aug 2013 10:00 pm
by beteljuice
There is no "2013_08.txt", because this is the current month and the data is written to "noaamo.txt".
True - however your screenshot shows one !
I'm not sure if this is relevant to your problem or not, but adding the mean baro and mean humidity columns takes this file format and invalidates it (NOAA format) as they do not include that data.
The content of the report is unimportant as far as this program is concerned as it merely displays it without any kind of processing.

ATM I can't understand why the 'dropdown' part of the menu is correctly populated but the 'current' isn't :?

The code is essentially the same as the original one by Ken True, it maybe that my Cumulus tweaks 'broke' the VWS functionality somehow - I will continue to investigate ....

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

Posted: Tue 13 Aug 2013 5:58 am
by laulau