Page 4 of 54

Re: Now available: AJAX/PHP multilingual website templates

Posted: Fri 11 Feb 2011 11:51 pm
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

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 12 Feb 2011 12:52 am
by n9mfk
Hi Ken,
did that a still just see 2 lines
http://www.n9mfk.com/cu/
Beau

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 12 Feb 2011 7:03 am
by saratogaWX
Try using http://saratoga-weather.org/wxtemplates ... p?sce=view to fix the double-line problem.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 12 Feb 2011 2:27 pm
by n9mfk
Hi ken that did the trick
Thanks

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 12 Feb 2011 5:44 pm
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

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 12 Feb 2011 7:12 pm
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

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 12 Feb 2011 10:09 pm
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

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 12 Feb 2011 11:06 pm
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

Re: Now available: AJAX/PHP multilingual website templates

Posted: Mon 14 Feb 2011 12:16 am
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

Re: Now available: AJAX/PHP multilingual website templates

Posted: Mon 14 Feb 2011 4:05 am
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

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 15 Feb 2011 8:24 pm
by n9mfk
hi ken on you las ajax-dashboard it was missing a </div> at the end
it wood not pass w3c
beau

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 15 Feb 2011 11:57 pm
by saratogaWX
That wasn't a ajax-dashboard issue, it was a missing </div> in the old wxindex.php .. just replace that file.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 17 Feb 2011 1:11 am
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.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 17 Feb 2011 1:23 am
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

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 17 Feb 2011 6:47 pm
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?