Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Trend Arrow

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

Moderators: daj, TNETWeather

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

Trend Arrow

Postby rp4111 » Mon Feb 15, 2010 11:36 pm

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 Jan 28, 2010 7:53 pm
Weather Station: W-8681 (WH-1080)
Operating System: Windows 7
Location: Carnkie, Helston, Cornwall
Contact:

Re: Trend Arrow

Postby Mark19 » Tue Feb 16, 2010 12:03 am

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 Dec 30, 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Trend Arrow

Postby rp4111 » Tue Feb 16, 2010 1:23 am

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

User avatar
TNETWeather
Posts: 663
Joined: Wed Sep 17, 2008 1:34 pm
Weather Station: Davis VP2 Plus w/24 FARS
Operating System: WinX Pro SP3 Dedicated wstn
Location: Mesa, AZ USA
Contact:

Re: Trend Arrow

Postby TNETWeather » Tue Feb 16, 2010 1:28 am

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"/>';
Kevin
Image
All you need is Time, Aptitude and Desire ... and you can build just about anything...

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

Re: Trend Arrow

Postby rp4111 » Tue Feb 16, 2010 1:32 am

I ended up figuring it out. Thank you for sharing the script.

User avatar
beteljuice
Posts: 2457
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Trend Arrow

Postby beteljuice » Tue Feb 16, 2010 1:34 am

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 Dec 30, 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Trend Arrow

Postby rp4111 » Tue Feb 16, 2010 1:35 am

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 Jan 28, 2010 7:53 pm
Weather Station: W-8681 (WH-1080)
Operating System: Windows 7
Location: Carnkie, Helston, Cornwall
Contact:

Re: Trend Arrow

Postby Mark19 » Tue Feb 16, 2010 2:31 am

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.

User avatar
TNETWeather
Posts: 663
Joined: Wed Sep 17, 2008 1:34 pm
Weather Station: Davis VP2 Plus w/24 FARS
Operating System: WinX Pro SP3 Dedicated wstn
Location: Mesa, AZ USA
Contact:

Re: Trend Arrow

Postby TNETWeather » Tue Feb 16, 2010 2:50 am

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....
Kevin
Image
All you need is Time, Aptitude and Desire ... and you can build just about anything...

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

Re: Trend Arrow

Postby rp4111 » Tue Feb 16, 2010 3:14 am

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 Dec 30, 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Trend Arrow

Postby rp4111 » Wed Feb 17, 2010 3:16 am

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.

User avatar
TNETWeather
Posts: 663
Joined: Wed Sep 17, 2008 1:34 pm
Weather Station: Davis VP2 Plus w/24 FARS
Operating System: WinX Pro SP3 Dedicated wstn
Location: Mesa, AZ USA
Contact:

Re: Trend Arrow

Postby TNETWeather » Wed Feb 17, 2010 3:20 am

Looks good
Kevin
Image
All you need is Time, Aptitude and Desire ... and you can build just about anything...

User avatar
beteljuice
Posts: 2457
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Trend Arrow

Postby beteljuice » Wed Feb 17, 2010 5:07 am

:clap:
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
nitrx
Posts: 1303
Joined: Sun Dec 13, 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Trend Arrow

Postby nitrx » Wed Feb 17, 2010 7:00 am

there is a question mark before the F (Fahrenheit) ... in FFox and IE8 instead of a degree

User avatar
GraemeT
Posts: 308
Joined: Wed Oct 21, 2009 11:19 am
Weather Station: La Crosse WS-2355 & WS-2306
Operating System: Windoze 7
Location: Bayswater, Australia
Contact:

Re: Trend Arrow

Postby GraemeT » Wed Feb 17, 2010 7:46 am

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.

Image


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 6 guests