Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.6.5 (build 3081) - 28 May 2020 (please see important announcement regarding releases since 3.5.0)
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 the NOAA report and Snow Index drop-down menus to 2030)

See the Wiki to download the software or click on the Downloads link in the Forum Banner.

Now available: AJAX/PHP multilingual website templates

Discussion of Ken True's web site templates

Moderator: saratogaWX

User avatar
saratogaWX
Posts: 1031
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

n9mfk wrote:Hi ken
I can i get $dayswithnorain on the dashboard?
but look ant my image a few post back an there no number of day without rain
an if you look her it show month but no number
also not here http://www.n9mfk.com/cu/
any idea beau
You may need to update your CU-defs.php file and your ajax-dashboard from the current distributions .. then you should see the dayswithnorain value on your dashboard.

Best regards,
Ken

n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Now available: AJAX/PHP multilingual website templates

Post by n9mfk »

Hi Ken,
did that a still just see 2 lines
http://www.n9mfk.com/cu/
Beau

User avatar
saratogaWX
Posts: 1031
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

Try using http://saratoga-weather.org/wxtemplates ... p?sce=view to fix the double-line problem.

n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Now available: AJAX/PHP multilingual website templates

Post by n9mfk »

Hi ken that did the trick
Thanks

n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Now available: AJAX/PHP multilingual website templates

Post by n9mfk »

Hi Ken,
why are these no longer the settings.php?

Code: Select all

$SITE['WUname1']	= 'City Level';		// tooltip label for mode=1
$SITE['WUname2']	= 'State';	// tooltip label for mode=2
$SITE['WUname3']	= 'Sate an other areas';	// tooltip label for mode=3
$SITE['WUname4']	= 'Midwest US';	// tooltip label for mode=4
$SITE['WUname5']	= 'Entire US';		// tooltip label for mode=5
thanks Beau

User avatar
saratogaWX
Posts: 1031
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

n9mfk wrote:Hi Ken,
why are these no longer the settings.php?

Code: Select all

$SITE['WUname1']	= 'City Level';		// tooltip label for mode=1
$SITE['WUname2']	= 'State';	// tooltip label for mode=2
$SITE['WUname3']	= 'Sate an other areas';	// tooltip label for mode=3
$SITE['WUname4']	= 'Midwest US';	// tooltip label for mode=4
$SITE['WUname5']	= 'Entire US';		// tooltip label for mode=5
thanks Beau
With this V3 release of the templates, I removed those WU-radar-inc.php settings from Settings.php, and only kept the settings needed for running the maps on the main page. All the settings for WU-radar-inc.php are now done in that script itself (using the WU-radar-testpage.php?show=loc ), and it was proving hard for folks to do the setup there, then copy back 'some' of the settings into Settings.php, so I dropped the entries in Settings.php and the directions.

Best regards,
Ken

n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Now available: AJAX/PHP multilingual website templates

Post by n9mfk »

hi Ken,
you may went to use outdoor temp an hum not indoor

Code: Select all

#-------------------------------------------------------------------------------------
# CU support function - CU_CBI - Chandler Burning Index
#-------------------------------------------------------------------------------------

function CU_CBI($inTemp,$inTempUOM,$inHumidity) {
	// thanks to Chris from sloweather.com for the CBI calculation script
	// modified by Ken True for template usage
	
	preg_match('/([\d\.\+\-]+)/',$inTemp,$t); // strip non-numeric from inTemp if any
	$ctemp = $t[1];
	if(!preg_match('|C|i',$inTempUOM)) {
	  $ctemp = ($ctemp-32.0) / 1.8; // convert from Fahrenheit	
	}
	preg_match('/([\d\.\+\-]+)/',$inHumidity,$t); // strip non-numeric from inHumidity if any
	$rh = $t[1];

	// Start Index Calcs
	
	// Chandler Index
	$cbi = (((110 - 1.373 * $rh) - 0.54 * (10.20 - $ctemp)) * (124 * pow(10,-0.0142 * $rh) ))/60;
	// CBI = (((110 - 1.373*RH) - 0.54 * (10.20 - T)) * (124 * 10**(-0.0142*RH)))/60
	
	//Sort out the Chandler Index
	$cbi = round($cbi,1);
	if ($cbi > "97.5") {
		$cbitxt = "EXTREME";
		$cbiimg= "fdl_extreme.gif";
	
	} elseif ($cbi >="90") {
		$cbitxt = "VERY HIGH";
		$cbiimg= "fdl_vhigh.gif";
	
	} elseif ($cbi >= "75") {
		$cbitxt = "HIGH";
		$cbiimg= "fdl_high.gif";
	
	} elseif ($cbi >= "50") {
		$cbitxt = "MODERATE";
		$cbiimg= "fdl_moderate.gif";
	
	} else {
		$cbitxt="LOW";
		$cbiimg= "fdl_low.gif";
	}
	 $data = array($cbi,$cbitxt,$cbiimg);
	 return $data;
	 
} // end CU_CBI




Beau

User avatar
saratogaWX
Posts: 1031
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

Beau,
I think you may have a misunderstanding of the role the variables named in a function definition actually do.

In the line

Code: Select all

function CU_CBI($inTemp,$inTempUOM,$inHumidity) {
the CU_CBI function has three arguments with symbolic names (used ONLY inside the function itself) of $inTemp,$inTempUOM,$inHumidity . When the function is actually called (earlier in the CU-defs.php script by

Code: Select all

list($chandler,$chandlertxt,$chandlerimg) = CU_CBI($temperature,$uomtemp,$humidity);
The current value of $temperature is assigned to the function's $inTemp variable, the value of $uomtemp is assigned to the function's $inTempUOM variable, and the value of $humidity is assigned to the function's $inHumidity variable.

The assignments for $temperature,$uomtemp,$humidity happen further up the CU-defs.php source at

Code: Select all

$uomtemp = $WX['tempunit'];

$temperature = $WX['temp'];

$humidity = $WX['hum'];
So the function is really calculating the CBI based on the outside temperature and unit-of-measure and outside relative humidity.

Using functions allow you to isolate calculations and pass information to the function from different sources. The function definition statement just serves to declare the function name, and the internal(to the function) variable names that will receive argument values when the function is called.

Best regards,
Ken

User avatar
PaulMy
Posts: 2130
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis Vantage Pro 2+ w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by PaulMy »

Any one using Cumulus with Ken's templates would you post the link here? I'd like to get some ideas on adding Cumulus features. My test is http://www.komokaweather.com/wxindex.php

Paul

User avatar
saratogaWX
Posts: 1031
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

Now available .. a updates page you can query to find out what's changed since you downloaded the Beta or Release versions of the template sets. If your query results in changed files being listed, you can also click on a link to download a .zip file with all the changed scripts. The page also allows you to save the selections for easy use next time (requires browser cookies to be enabled).

Enjoy!

http://saratoga-weather.org/wxtemplates/updates.php

BTW.. I strongly recommend that all Beta testers and new Release users try the page and download the fixes :)

Best regards,
Ken

n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Now available: AJAX/PHP multilingual website templates

Post by n9mfk »

hi ken on you las ajax-dashboard it was missing a </div> at the end
it wood not pass w3c
beau

User avatar
saratogaWX
Posts: 1031
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

That wasn't a ajax-dashboard issue, it was a missing </div> in the old wxindex.php .. just replace that file.

User avatar
actioman
Posts: 118
Joined: Sat 20 Mar 2010 1:01 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows XP SP3
Location: Elvas, Portugal
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by actioman »

Hello Cumulus colleagues!

I have been testing this amazing template from Ken! With Ken help of course ;), and now I have found a problem.

I want to send to my web host a file: CUtags.txt. But when upload this file hte cumulus have to rename that file to CUtags.php. Then in my web the Ken script work with it.

The problem is cumulus do not upload and rename that file. I'm using the Cumulus beta release v1.9.1 (build 974).

Thank you in advance.
Kind Regards, Manuel.

Image

User avatar
beteljuice
Posts: 2918
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: ex XP SP3 - now W10 laptop grr
Location: Dudley, West Midlands, UK

Re: Now available: AJAX/PHP multilingual website templates

Post by beteljuice »

If it's a 'realtime' (often uploaded) type file;

Internet options => Files

Left-hand panel - Local (PC) file
Right-hand panel - webhost/newfilename

Realtime - checked, ftp - checked, and if processed by Cumulus - checked
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
actioman
Posts: 118
Joined: Sat 20 Mar 2010 1:01 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows XP SP3
Location: Elvas, Portugal
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by actioman »

beteljuice wrote:If it's a 'realtime' (often uploaded) type file;

Internet options => Files

Left-hand panel - Local (PC) file
Right-hand panel - webhost/newfilename

Realtime - checked, ftp - checked, and if processed by Cumulus - checked

But it's like you have said that I have cumulus configured.

Look at my print screens:

Image

Image

Somebody have an answer?
Kind Regards, Manuel.

Image

Post Reply