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 4017) - 17 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

WU Forecast Temp?

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

WU Forecast Temp?

Post by William Grimsley »

Hi Ken,

Is it possible, like on the NWS forecast script, to include C, after the Low of 1?

For example: Low of 1 to Low of 1C?

This is the bits of code, I have being trying to figure, but knowing me, it never works! :lol:

Code: Select all

if (isset($uomTemp) and $showTempsAs <> 'B') { // use Settings.php Temp units only
   $showTempAs = preg_match('|C|i',$uomTemp) ? 'C' : 'F';
   $Status .= "<!-- temps in $showTempAs -->\n";
}

Code: Select all

$doESfixup = false;
	preg_match_all('!\.\s+([^:]+)\:{0,1}\s+([\d|-]+)(&#176;|&deg;|°|C|F)!Uis',$WUforecasttext[$n],$temp);
	
	if(isset($temp[1][0]) and strpos($temp[1][0],'.') !== false) {
	   if( $doDebug) { $Status .= "<!-- prune temperature text from '".$temp[1][0]."'"; }	
	   $t = trim(substr($temp[1][0],strpos($temp[1][0],'.')+1));
	   $temp[1][0] = $t;	
	   if( $doDebug) { $Status .= " to '$t' -->\n"; }	
	}
Is it possible, to make my "request" possible changing one of these pieces of code, or am I looking at the wrong code, or is it not possible, at all?

Thanks,

William
Last edited by William Grimsley on Tue 12 Mar 2013 6:52 pm, edited 1 time in total.
User avatar
saratogaWX
Posts: 1170
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: WU Forecast Temp?

Post by saratogaWX »

Possible, Yes.
A trivial cosmetic change, and as I've said, no more assistance will be given on such matters.

Is it possible that your viewers would not assume that the temperatures are in C already (without the additional change).

You are on another trivial pursuit.. enjoy your coding/learning.
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: WU Forecast Temp?

Post by William Grimsley »

saratogaWX wrote:A trivial cosmetic change
You are on another trivial pursuit
What does that mean?
User avatar
saratogaWX
Posts: 1170
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: WU Forecast Temp?

Post by saratogaWX »

It means you seem to be on a never-ending quest to slightly tweak what is presented on your website without actually improving either the data presented or the style of presentation. A font change here, a line there, a 'missing' unit here; all amounting to much fiddling and not any substantive improvement (except in your eyes).

You create issues for your future maintenance of your website by modifying the support scripts to your liking -- when new versions are released, you'll need to merge in those modifications or loose them in the process of maintenance, but that is your choice.

As I said before, I am not your personal coding docent and will not substantively answer questions regarding cosmetic coding mods to support scripts (which are the same versions on 700+ websites around the world).

For your reference, the units are NOT included since the WU-forecast.php is multilingual and in some languages, the words for 'High' and 'Low' are quite long (like in German which uses on the WU website 'Höchsttemperatur' and 'Tiefsttemperatur') so to make best use of space in the icons, it doesn't include either the degree sign or 'C' after the temperature .. thereby saving 10 characters width in the presentation of a 5-icon row.
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: WU Forecast Temp?

Post by William Grimsley »

saratogaWX wrote:For your reference, the units are NOT included since the WU-forecast.php is multilingual and in some languages, the words for 'High' and 'Low' are quite long (like in German which uses on the WU website 'Höchsttemperatur' and 'Tiefsttemperatur') so to make best use of space in the icons, it doesn't include either the degree sign or 'C' after the temperature .. thereby saving 10 characters width in the presentation of a 5-icon row.
Oh, I see! Sorry, for messing you around, again! :oops:
Post Reply