Page 2 of 2

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

Posted: Sat 12 May 2018 6:13 pm
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

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

Posted: Sat 12 May 2018 6:16 pm
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.

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

Posted: Sat 12 May 2018 6:21 pm
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>';
} 

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

Posted: Sat 12 May 2018 7:24 pm
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.

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

Posted: Sat 12 May 2018 7:30 pm
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