Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Need help modifying NOAA-reports.php

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
XBower
Posts: 55
Joined: Fri 09 Aug 2013 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10 64b
Location: Gothenburg, SE

Need help modifying NOAA-reports.php

Post by XBower »

Hi guys.

I'm not very much into php programming, so I could do with a little help modifying the NOAA-reports.php script.
I have been running this script on my site for almost a year, and it works just fine for every newly produced report that gets uploaded.

What I'm trying to do now is displaying a bunch of reports that I have generated from data from an old station I had running back in the 90s.
No problem uploading these reports to a seperate directory and modifying the script to read from that directory.
But the menu generated is not a pretty sight.
I have reports from 1994 up 2000 in my directory.
The menu shows all greyed out years/months all the way up till today.

Is there any way that I can modify the script to only show the years that I actually have reports from in the menu?
Perhaps hardcode the years 1994-2000 somewhere would also work.
I have tried to fiddle a bit with the $first_year and $last_year, but I can't get it right.

Any help will be highly appreciated.

Regards
XBower
----------------------------------------------------------------------
--- There IS intelligent life on Earth, but I'm only visiting ---
----------------------------------------------------------------------
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Need help modifying NOAA-reports.php

Post by beteljuice »

This should be posted under the right topic.

You don't modify the php file - you modify (if necessary) your old data files content to be in the same format as the Cumulus generated ones and make sure they have the correct name format.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
SpaceWalker
Posts: 67
Joined: Sun 04 Mar 2012 2:54 am
Weather Station: Davis Vantage
Operating System: Windows XP
Location: Eastern-Canada
Contact:

Re: Need help modifying NOAA-reports.php

Post by SpaceWalker »

It is possible to modify the 'include-NOAA-reports.php' script to specifically read (and process) the data format of the reports from 1994 up 2000 - I have modify my script to also read the data produced by Weather Display.
XBower
Posts: 55
Joined: Fri 09 Aug 2013 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10 64b
Location: Gothenburg, SE

Re: Need help modifying NOAA-reports.php

Post by XBower »

Hi.

Sorry if I posted this in the wrong place, moderator - please free to relocate as appropriate.

I don't have any problems with the data format.
The reports in question are created and uploaded OK, they display fine.
But when I run the script to display them it looks like:

http://berand.net/weather/cumtest/NOAA-reports-old.php

Expand the menu, and I think You get my point.
All those greyed out lines from 2001-2014 are naturally because I don't have any reports for these years in this directory.
I just want to get rid of these lines from the menu.
Can I do it?

Regards
XBower
----------------------------------------------------------------------
--- There IS intelligent life on Earth, but I'm only visiting ---
----------------------------------------------------------------------
XBower
Posts: 55
Joined: Fri 09 Aug 2013 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10 64b
Location: Gothenburg, SE

Re: Need help modifying NOAA-reports.php

Post by XBower »

Hi.

Just solved this.
Line 166 in the script reads: $now_year = $now['year'];
I simply changed this to: $now_year = 2000;

Now, the 'menu' only shows years 2000-1994, just as I wanted it.

Thanks guys.
XBower
----------------------------------------------------------------------
--- There IS intelligent life on Earth, but I'm only visiting ---
----------------------------------------------------------------------
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Need help modifying NOAA-reports.php

Post by beteljuice »

Err ... 'now' is 2014

Why are you trying to run two versions of the script instead of one ?
Image
......................Imagine, what you will KNOW tomorrow !
XBower
Posts: 55
Joined: Fri 09 Aug 2013 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10 64b
Location: Gothenburg, SE

Re: Need help modifying NOAA-reports.php

Post by XBower »

beteljuice wrote: Why are you trying to run two versions of the script instead of one ?
Hi.

I ran into some problems with the reports 'menu' if I just put my old reports together with the newer ones.
It turned out that the script shows some "empty" rows for the years I don't have any reports for.
Naturally it would be better to modify the script to ONLY show rows for the years that I actually HAVE reports for, but I just don't know how.
Using two scripts with seperate report directories do offer a somewhat useable, but not very elegant solution.
Any ideas on how I can modify the script not so show "empty" rows in the menu is welcome.

Regards
XBower
----------------------------------------------------------------------
--- There IS intelligent life on Earth, but I'm only visiting ---
----------------------------------------------------------------------
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Need help modifying NOAA-reports.php

Post by beteljuice »

No gaurantees and should only work with CU option.
Should be good for all records. - maybe !
Edit: download link removed - superceded by below:
Last edited by beteljuice on Mon 17 Feb 2014 10:38 pm, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !
XBower
Posts: 55
Joined: Fri 09 Aug 2013 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10 64b
Location: Gothenburg, SE

Re: Need help modifying NOAA-reports.php

Post by XBower »

Hi.

Can't tell You how much I appreciate Your help with this.
I moved all my reports (old and new) to my 'normal' directory, uploaded Your modified script, and the result You can see here:
http://berand.net/weather/cumtest/NOAA-reports-MOD.php
You can see it's almost perfect, just some rows 2099-2094, don't know where these came from.

Regards
XBower
----------------------------------------------------------------------
--- There IS intelligent life on Earth, but I'm only visiting ---
----------------------------------------------------------------------
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Need help modifying NOAA-reports.php

Post by beteljuice »

Aha !!!!

CUmulus stores month reports with a 2 digit year in the name - thus only good for one century then they will overwrite each other :lol:

Try this - should give you 1990 => 2089 (hope that's long enough)
NOAA-reports-MOD.zip
You do not have the required permissions to view the files attached to this post.
Image
......................Imagine, what you will KNOW tomorrow !
XBower
Posts: 55
Joined: Fri 09 Aug 2013 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10 64b
Location: Gothenburg, SE

Re: Need help modifying NOAA-reports.php

Post by XBower »

Hi.

Thanks a million......
Well, as they say, "I don't plan to live forever"... not even to 2089 for that matter.
This one works perfect, just the way I wanted it, no 'empty' rows in sight, great.

Once again, thanks a lot, appreciate it.

Regards
XBower
----------------------------------------------------------------------
--- There IS intelligent life on Earth, but I'm only visiting ---
----------------------------------------------------------------------
Post Reply