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

Trend Arrow

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

Moderator: daj

rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Trend Arrow

Post by rp4111 »

I've seen a few websites from people on here that have an arrow to show the temperature trend. What is required to make that work? I assume it's a script that reads the cumulus webtag and calls the appropriate image?
Mark19
Posts: 17
Joined: Thu 28 Jan 2010 7:53 pm
Weather Station: W-8681 (WH-1080)
Operating System: Windows 7
Location: Carnkie, Helston, Cornwall
Contact:

Re: Trend Arrow

Post by Mark19 »

Here is the one I use on mine which I coded myself:

Code: Select all

$temp_trend="<#temptrendtext>";

if($temp_trend == 'Rising'){$temp_arrow = 'trendup.gif';}
elseif($temp_trend == 'Falling'){$temp_arrow = 'trenddwn.gif';}
else {$temp_arrow = 'steady.gif';}

echo"<b>$temp °C </b><img src='images/$temp_arrow'>";
Hope this is useful.

Mark
Carnkie Weather Station & Webcam: http://carnkieweather.co.uk
Live from Carnkie, Nr Helston, Cornwall.
rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Trend Arrow

Post by rp4111 »

Thank you! How would I set this up though? Would I paste the code in a new PHP document?
TNETWeather

Re: Trend Arrow

Post by TNETWeather »

If you are using webtags, wouldn't the values be in variables already?

So that <#temptrendtext> would actually be in $temptrendtxt ?

Something like:

Code: Select all

echo '<b>' . $temp . ' ' . $tempunits . '</b> ';
if ($temptrendtext == 'Rising') echo '<img src="images/trendup.gif"/>';
if ($temptrendtext == 'Falling') echo  '<img src="images/trenddwn.gif"/>';
rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Trend Arrow

Post by rp4111 »

I ended up figuring it out. Thank you for sharing the script.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Trend Arrow

Post by beteljuice »

Oops ... IE8
spring.jpg
You do not have the required permissions to view the files attached to this post.
Image
......................Imagine, what you will KNOW tomorrow !
rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Trend Arrow

Post by rp4111 »

Yikes! I'm using Firefox as my browser. So I guess anyone using IE8 will have an issue viewing my page?
Mark19
Posts: 17
Joined: Thu 28 Jan 2010 7:53 pm
Weather Station: W-8681 (WH-1080)
Operating System: Windows 7
Location: Carnkie, Helston, Cornwall
Contact:

Re: Trend Arrow

Post by Mark19 »

I'm using Opera, but just loaded your site in IE8, and get the same thing happen.
Carnkie Weather Station & Webcam: http://carnkieweather.co.uk
Live from Carnkie, Nr Helston, Cornwall.
TNETWeather

Re: Trend Arrow

Post by TNETWeather »

I haven't played with these before as I don't normally have issues between browsers (except ancient ie 6 which I don't support any longer).

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

This forces IE 8 to use the !DOCTYPE declaration in the page to determine the rendering mode.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

This forces IE 8 to use the !DOCTYPE declaration in the page to determine the rendering mode.

Seem they do the same thing. The latter seems redundant since that is what IE8 is supposed to do by default.

don't recall seeing a site have both but that may not be the issue.

Looks like IE8 is confused on your font-sizes....
rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Trend Arrow

Post by rp4111 »

Kevin,
I put those tags in but still no luck with IE8. Doing a google search I found you may have to re-write a CSS code just for IE8 viewers and insert some sort of tag to call that CSS when an IE8 user views your page. That's something I really don't want to do as I have a hard enough time understanding the CSS I currently have. It would make things easier if everyone used Firefox wouldn't it!
rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Trend Arrow

Post by rp4111 »

Can someone using IE please try my website http://www.westspringfieldwx.com. I ran it through the W3C validator and used a program on there called HTML Tidy. Hopefully this worked.
TNETWeather

Re: Trend Arrow

Post by TNETWeather »

Looks good
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Trend Arrow

Post by beteljuice »

:clap:
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Trend Arrow

Post by nitrx »

there is a question mark before the F (Fahrenheit) ... in FFox and IE8 instead of a degree
User avatar
GraemeT
Posts: 312
Joined: Wed 21 Oct 2009 11:19 am
Weather Station: La Crosse WS-2355 & WS-2306
Operating System: Windoze 7, 10, 11
Location: Bayswater, Australia
Contact:

Re: Trend Arrow

Post by GraemeT »

Hi Ryan

In Firefox 3.6 and IE8 I get a q-mark in front of the F
Otherwise all pages display ok in Firefox - except today and yesterday, which has a black panel instead of data

In IE 8
Home page, Advisories, Storm reports, and Yearly Summary pages display ok.
On Homepage the corners of the box around your data are square, where in FF they're rounded.

Forecast page, Today and Yesterday, Radar, Monthly Summary, and Records pages - alphabet soup!

I hope this is useful.
Cheers,
Graeme.
Post Reply