Page 2 of 3

Re: noaa report heat deg day an cool deg day same day?

Posted: Sat 20 Aug 2011 4:56 pm
by steve
I had to change this bit:

} elseif ($Naming == 'CU') {
$year = substr($file,5,4);

to

} elseif ($Naming == 'CU') {
$year = substr($file,6,4);

and now get this: http://sanday.org.uk/NOAA-reports-test.php

Progress, at least.

Re: noaa report heat deg day an cool deg day same day?

Posted: Sat 20 Aug 2011 6:28 pm
by n9mfk
Hi Steve
does wl make all of these files

// NOAAMO.TXT, NOAAYR.TXT for current month and current year
// NOAAPRMO.TXT, NOAAPRYR.TXT for last month, last year
// NOAAyyyy.TXT for year 'yyyy' summary
// NOAAyyyy-mm.TXT for month 'mm' in year 'yyyy' summary

what in trying to figure out is if all these are made wl or by the scriot
beau

Re: noaa report heat deg day an cool deg day same day?

Posted: Sat 20 Aug 2011 6:38 pm
by steve
As far as I can tell, WL doesn't automatically generate file names based on the year or month. It defaults to NOAAMO.TXT for all monthly reports and NOAAYR.TXT for all annual reports, unless you type in a different file name, in which case you can choose anything you want.

Re: noaa report heat deg day an cool deg day same day?

Posted: Sun 21 Aug 2011 12:42 am
by beteljuice
OK - all fixed ;)

Edit:
One pilot/logic error (wrong substr)
One typo (single missing '&')

Try this http://www.beteljuice.com/NOAA/NOAA-rep ... p?sce=view (remove the ?sce=view to see it working.) For testing purposes there is one year report and four month reports in two years.

Expects Cumulus named reports in folder NOAA-reports, the script should be in the folder above. (unless you edit the script variable $NOAAdir)

The problem(s) were that indeed the script is really designed to work with (current) month and year files, and assumes they MUST exist.

The search routine, nav menu, and default display were all dependent on that premise.
Search routine also had to be modified to cope with yyyy / mmyy mixture.

This modified version will look for all (Cumulus) generated files and will display the latest file wether it is a year report OR month report even if a year report hasn't been created for that month. In otherwords copes with 'orphan' files.

Don't forget to set your timezone variable, although I believe this makes no difference to Cumulus reports.

Tested with PHP4 - so should be OK on 5 :lol:

Re: noaa report heat deg day an cool deg day same day?

Posted: Sun 21 Aug 2011 4:18 am
by Hunter362
You got it!!! Thank you!
There is one teeny problem..... if there are any 2010 reports in the dir, they do display, mine started last Oct. Shows them fine, but clicking on 2011, it says there are NO reports found.
All the changes you made are beyond my capabilities, I can't figure it out.. I tried naming NOAAYR2010.txt to NOAAPRYR2010.txt
Thanks for fixing it in advance..

Check it out at:
1st link is just 2011 reports only
2nd link is 2010 and 2011 reports, you'll see what I mean.

http://weather.cerchia.com/ajax/NOAA-reports.php
http://weather.cerchia.com/ajax/NOAA-reports2.php
NOAA-reports, dir

-rw-r--r-- 1 bill root 3481 2011-08-17 23:06 NOAAMO0111.txt
-rw-r--r-- 1 bill root 3235 2011-08-17 23:05 NOAAMO0211.txt
-rw-r--r-- 1 bill root 3482 2011-08-17 23:05 NOAAMO0311.txt
-rw-r--r-- 1 bill root 3401 2011-08-17 23:05 NOAAMO0411.txt
-rw-r--r-- 1 bill root 3481 2011-08-17 23:04 NOAAMO0511.txt
-rw-r--r-- 1 bill root 3400 2011-08-17 23:04 NOAAMO0611.txt
-rw-r--r-- 1 bill root 3481 2011-08-17 23:03 NOAAMO0711.txt
-rw-r--r-- 1 bill root 2496 2011-08-20 00:00 NOAAMO0811.txt
-rw-r--r-- 1 bill root 2690 2011-08-20 00:00 NOAAYR2011.txt

NOAA-reports/hold
NOAAMO0111.txt
-rw-r--r-- 1 bill root 3235 2011-08-17 23:05 NOAAMO0211.txt
-rw-r--r-- 1 bill root 3482 2011-08-17 23:05 NOAAMO0311.txt
-rw-r--r-- 1 bill root 3401 2011-08-17 23:05 NOAAMO0411.txt
-rw-r--r-- 1 bill root 3481 2011-08-17 23:04 NOAAMO0511.txt
-rw-r--r-- 1 bill root 3400 2011-08-17 23:04 NOAAMO0611.txt
-rw-r--r-- 1 bill root 3481 2011-08-17 23:03 NOAAMO0711.txt
-rw-r--r-- 1 bill root 2496 2011-08-20 00:00 NOAAMO0811.txt
-rw-r--r-- 1 bill root 2334 2011-08-17 23:07 NOAAMO1010.txt
-rw-r--r-- 1 bill root 3401 2011-08-17 23:07 NOAAMO1110.txt
-rw-r--r-- 1 bill root 3398 2011-08-17 23:07 NOAAMO1210.txt
-rw-r--r-- 1 bill root 2000 2011-08-20 23:30 NOAAYR2010.txt
-rw-r--r-- 1 bill root 2690 2011-08-20 00:00 NOAAYR2011.txt





http://weather.cerchia.com/ajax/NOAA-reports.php

Re: noaa report heat deg day an cool deg day same day?

Posted: Sun 21 Aug 2011 5:09 am
by beteljuice
... There is one teeny problem.....
Hmm .... a tad more than teeny !
I have a nap and think about it (06:12 local :o )

Re: noaa report heat deg day an cool deg day same day?

Posted: Sun 21 Aug 2011 9:40 am
by steve
Hey - well done beteljuice :clap:

Re: noaa report heat deg day an cool deg day same day?

Posted: Sun 21 Aug 2011 10:48 am
by beteljuice
It will work now :?

One pilot/logic error (wrong substr)
One typo (single missing '&')

As before: http://www.beteljuice.com/NOAA/NOAA-rep ... p?sce=view

Re: noaa report heat deg day an cool deg day same day?

Posted: Sun 21 Aug 2011 1:41 pm
by Hunter362
Great job!! Thank you
That's what I love about this, post a problem and usually within 24hrs someone has a fix!
You guys are awesome!

Re: noaa report heat deg day an cool deg day same day?

Posted: Sun 21 Aug 2011 2:57 pm
by n9mfk
Hi beteljuice
is there way to fix these
2011:
Notice: Undefined index: NOAAMO0111.txt in C:\c_n9mfk\www\noaa.php on line 237
Jan |
Notice: Undefined index: NOAAMO0211.txt in C:\c_n9mfk\www\noaa.php on line 237
Feb |
Notice: Undefined index: NOAAMO0311.txt in C:\c_n9mfk\www\noaa.php on line 237
Mar |
Notice: Undefined index: NOAAMO0411.txt in C:\c_n9mfk\www\noaa.php on line 237
Apr |
Notice: Undefined index: NOAAMO0511.txt in C:\c_n9mfk\www\noaa.php on line 237
May |
Notice: Undefined index: NOAAMO0611.txt in C:\c_n9mfk\www\noaa.php on line 237
Jun |
Notice: Undefined index: NOAAMO0711.txt in C:\c_n9mfk\www\noaa.php on line 237
Jul | Aug |
Notice: Undefined index: NOAAMO0911.txt in C:\c_n9mfk\www\noaa.php on line 237
Sep |
Notice: Undefined index: NOAAMO1011.txt in C:\c_n9mfk\www\noaa.php on line 237
Oct |
Notice: Undefined index: NOAAMO1111.txt in C:\c_n9mfk\www\noaa.php on line 237
Nov |
Notice: Undefined index: NOAAMO1211.txt in C:\c_n9mfk\www\noaa.php on line 237

thanks beau

Re: noaa report heat deg day an cool deg day same day?

Posted: Sun 21 Aug 2011 5:01 pm
by beteljuice
I don't even begin to understand this "C:\c_n9mfk\www\noaa.php "
Are you running your own server ?

As usual a link would be more than useful ....

Re: noaa report heat deg day an cool deg day same day?

Posted: Sun 21 Aug 2011 6:30 pm
by n9mfk
Hi beteljuice,
sorry I forgot it
99.148.159.206/noaa.php
thanks Beau

Re: noaa report heat deg day an cool deg day same day?

Posted: Sun 21 Aug 2011 10:13 pm
by beteljuice
OK - checking with the web, it suggests your PHP error settings are "Fart At A Thousand Paces" level.

The easy way around this is to add at the top of the coding:

Code: Select all

error_reporting (E_ALL ^ E_NOTICE);
See this article: http://www.dmxzone.com/go?13811

It seems to be complaining about checks on variables that may not have been declared.
One of these is an original coding error by Ken T ( :o ), this is the 'mo' error you get when asking for the year report.

Code: Select all

$yr = 	isset($_REQUEST['yr']) ? $_REQUEST['yr'] : '';
$mo =   isset($_REQUEST['yr']) ? $_REQUEST['mo'] : '';
Should read:

Code: Select all

$yr = 	isset($_REQUEST['yr']) ? $_REQUEST['yr'] : '';
$mo =   isset($_REQUEST['mo']) ? $_REQUEST['mo'] : '';
The other variable is proving more elusive (The line refs don't exactly match).

Code now has the error reporting line, the $mo correction, and the extra space in front of an empty year removed.

Should now work even for you Beau ;)

Re: noaa report heat deg day an cool deg day same day?

Posted: Sun 21 Aug 2011 10:55 pm
by n9mfk
Hi beteljuice,
thanks works great
Beau

Re: noaa report heat deg day an cool deg day same day?

Posted: Mon 22 Aug 2011 10:17 am
by nking
Having these reports on the website looks great! Just a thought as to whether anyone that has implemented this would be prepared to issue step instructions to achieve this, quite understand if the answer is No but thought I would ask as I'm sure there are others like me that are technically challenged but can follow instructions.