Welcome to the Cumulus Support forum.

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

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.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

New Script that displays a selected daily statistic for every day

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

Moderator: daj

User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: New Script that displays a selected daily statistic for every day

Post by kocher »

Thank you very much sfws

I just installed the new version of your script.

http://kocher.es/cumulusMX/dailypick_2_12.php

However, an error occurs:

"PHP Fatal error: Call to undefined function print_array() in H:\webspace\hostings\kocher.es\hosting\www\cumulusMX\dailypick_2_12.php on line 336"

The code of my file is:

http://kocher.es/cumulusMX/dailypick_2_12.php.txt
Image
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: New Script that displays a selected daily statistic for every day

Post by sfws »

rogerthn wrote:Many thanks sfws
Thank you. Well done for successfully using my script.
I hope you don't mind me suggesting that a consistent set of navigation links across all the pages on your site would improve it. You need to choose between the "standard Cumulus links" and your various styles of buttons that I assume are more recent additions. You could look at other sites for inspiration, or just copy one of your button styles onto all your pages.
With your two weather stations it would be nice if you had a page that showed numbers from both, then you could compare one against the other, but otherwise your site looks good.
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: New Script that displays a selected daily statistic for every day

Post by sfws »

kocher wrote:"PHP Fatal error: Call to undefined function print_array() in H:\webspace\hostings\kocher.es\hosting\www\cumulusMX\dailypick_2_12.php on line 336"
Ok, that is one of my many shared functions that appears in the script mentioned in the first include https://cumulus.hosiene.co.uk/viewtopic.p ... 65#p126065. I use it instead of "print_r" for arrays, and I am sorry use of it caused you to see an error. As I said what you have now is actually basically an old script that I have not rewritten for sharing. But thanks for trying my daily summary script, the includes that I quote in my scripts list the common functions and variables they contain, so if you still have a problem after adding code below, let me know and I will dig out more.

Code: Select all

	
 #---------------------------------------------------------------------------------#
 #  The novel sub-function that follows is a more friendly way		
 #  of displaying the contents of an array for easy diagnosis.		
 #	 Intellectual Property of SPAWS -  last updated October 2017		
 #  The first input parameter is the actual array to be output.		
 #  The second input parameter is an optional string to describe the array.		
 #  (It can be the actual array name enclosed in single quotes).		
 #---------------------------------------------------------------------------------#
function print_array($array_input,$array_name = 'Array')
{
    if(!count($array_input)) echo '<br><span class="red"> '. $array_name . '( )</span> &nbsp; &nbsp;<span class="blue">is Empty</span>';
	else{
			echo '<br><span class="red"> '. $array_name . '( </span> &nbsp; &nbsp; ';
			foreach ($array_input as $key_input => $value_input)
			{				
				if (is_array($value_input)) {
						echo ' <span class="red">[' . $key_input . ']</span> &rarr; ';
						print_array($value_input,'Sub-array');
				} else {   
						echo " [$key_input]".' => ';
						echo ' <span class="blue">' . $array_input[$key_input] . '</span>,&nbsp; &nbsp; &nbsp; &nbsp; ';
				}
			}
			echo '<span class="red">);</span> &nbsp; &nbsp;';
	}
	echo '<br>';
} 
Last edited by sfws on Wed 16 May 2018 6:19 am, edited 1 time in total.
User avatar
rogerthn
Posts: 489
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: New Script that displays a selected daily statistic for every day

Post by rogerthn »

sfws wrote:Thank you. Well done for successfully using my script.
I hope you don't mind me suggesting that a consistent set of navigation links across all the pages on your site would improve it. You need to choose between the "standard Cumulus links" and your various styles of buttons that I assume are more recent additions. You could look at other sites for inspiration, or just copy one of your button styles onto all your pages.
With your two weather stations it would be nice if you had a page that showed numbers from both, then you could compare one against the other, but otherwise your site looks good.
I do NOT mind, improving my web-site has been on the to-do list for some years now :bash:
Regarding my two stations
The National Geographic 265 NE was in operation using Cumulus from 2008-10-12 until 2017-12-19 but is now dead.
The Oregon Scientific WMR88 was started on 2013-04-07 and is still running fine, I've replaced the rain gauge once.
Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: New Script that displays a selected daily statistic for every day

Post by kocher »

Now it seems to work well, thank you very much :D

I will do tests with the css file to try to improve the vision of the data.

Saludos desde San sebastian
Image
Post Reply