Author Topic: thermometer  (Read 8090 times)

0 Members and 1 Guest are viewing this topic.

Offline wxkpt

  • Kingsport, TN Weather
  • Senior Contributor
  • ****
  • Posts: 284
  • When The Weather Gets Tough.. Get With The Weather
    • Kingsport, TN Live and Local weather
thermometer
« on: January 13, 2009, 12:55:33 PM »
Ok I have been looking for where this error is coming from I am over looking it in the script some where
Take a look at http://wxflint.com/thermometer.php at the top it says (°F) Looks like the Max temp but I cant seem to find where this is located to fix it #-o.

KEN Help.....lol  ](*,)

Offline JOE

  • Forecaster
  • *****
  • Posts: 390
    • Centralia IL Weather
Re: thermometer
« Reply #1 on: January 13, 2009, 05:09:35 PM »
Is it supposed to be the degrees symbol?

I think that's what &#176 is supposed to give you.   Right now I don't recall all the proper syntax to produce it. 
« Last Edit: January 13, 2009, 05:13:52 PM by JOE »
Joe
www.centraliaweather.com
DW1376
KILCENTR2
K9RJN


Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: thermometer
« Reply #2 on: January 13, 2009, 05:19:42 PM »
° is the code for degrees symbol.  Not sure why its not working.   I am at work so I cant see my PHP coding, but mine does work.   The only mod I did on mine was to make it Celsius.

Andrew

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: thermometer
« Reply #3 on: January 13, 2009, 05:45:14 PM »
You could also try to use the following syntax °
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline wxkpt

  • Kingsport, TN Weather
  • Senior Contributor
  • ****
  • Posts: 284
  • When The Weather Gets Tough.. Get With The Weather
    • Kingsport, TN Live and Local weather
Re: thermometer
« Reply #4 on: January 13, 2009, 05:47:43 PM »
I have been comparing to the original and it looks fine but I have hashed the script some just dont know where I made this error come from.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: thermometer
« Reply #5 on: January 13, 2009, 09:57:40 PM »
Actually, it's fairly simple :)

Your thermometer.php has
Code: [Select]
    $cnt = '°' . $UOM; in it, and it should read
Code: [Select]
    $cnt = '°' . $UOM; for that line.

Somehow, the degree sign got replaced with a character code, instead of the literal degree sign.

Since the GD functions only understand characters (not HTML &symbols; characters), it was just producing the ° instead of ° .

Hope this helps...
Best regards,
Ken
« Last Edit: January 13, 2009, 09:59:51 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: thermometer
« Reply #6 on: January 13, 2009, 09:58:05 PM »
In the script about 62 lines from the bottom (including empty lines), you should find lines that say:

Code: [Select]
// put legend on top with UOM
 
    $cnt = '°' . $UOM;
    imagestring( $image, $font+2, ($width/2)-((strlen($cnt)/2)*ImageFontWidth($font+2)),

I think the line you need is (copy and paste):

Code: [Select]
   $cnt = '°' . $UOM;
Kevin...

EDIT:  Oops! Ken beat me. :oops:
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

Offline wxkpt

  • Kingsport, TN Weather
  • Senior Contributor
  • ****
  • Posts: 284
  • When The Weather Gets Tough.. Get With The Weather
    • Kingsport, TN Live and Local weather
Re: thermometer
« Reply #7 on: January 13, 2009, 10:40:03 PM »
Strange every time I replace the code it reverts rite back to the character code
Also does this in the settings.php
Code: [Select]
$SITE['WDdateMDY'] = true; // for WD date format of month/day/year.  =false for day/month/year
$SITE['uomTemp'] = '°F';
$SITE['uomBaro'] = ' inHg';
$SITE['uomWind'] = ' mph';
$SITE['uomRain'] = ' in';
« Last Edit: January 13, 2009, 10:54:57 PM by wxflint »

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: thermometer
« Reply #8 on: January 13, 2009, 10:43:02 PM »

Strange every time I replace the code it reverts rite back to the character code

Maybe the editor you're using? Have you tried using NotePad? Perhaps try the editor on your webhost?

Kevin...
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: thermometer
« Reply #9 on: January 13, 2009, 11:21:09 PM »
Good idea, Kevin!  Use notepad to edit the file.. it won't substitute characters on you :)
Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline wxkpt

  • Kingsport, TN Weather
  • Senior Contributor
  • ****
  • Posts: 284
  • When The Weather Gets Tough.. Get With The Weather
    • Kingsport, TN Live and Local weather
Re: thermometer
« Reply #10 on: January 13, 2009, 11:39:31 PM »

Strange every time I replace the code it reverts rite back to the character code

Maybe the editor you're using? Have you tried using NotePad? Perhaps try the editor on your webhost?

Kevin...

Looks like that did it Thanks Kevin and Ken.

 I did use the cPanel Editor's to change some code Its kind of crazy it just happened I use the cPanel editor all the time to add and change code in the scripts. Guess i wont be using that any more ](*,)

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: thermometer
« Reply #11 on: January 14, 2009, 11:26:13 PM »

Looks like that did it Thanks Kevin and Ken.

Good deal!
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

Offline John Sacrey

  • Member
  • *
  • Posts: 23
    • Saline Weather
Re: thermometer
« Reply #12 on: January 16, 2009, 08:25:35 PM »
Hi folks,

First off, I love this webpage software.  I cannot get the thermometer to show.  I've tried everything you all have listed and still no luck.  I am open to ideas.

Thanks,

John Sacrey

http://sacreysouthern.com/ssrweather/wxindex.php
Benton/Salem, AR
Vantage Pro 2, GR2AE, GR3,

Offline wxkpt

  • Kingsport, TN Weather
  • Senior Contributor
  • ****
  • Posts: 284
  • When The Weather Gets Tough.. Get With The Weather
    • Kingsport, TN Live and Local weather
Re: thermometer
« Reply #13 on: January 16, 2009, 08:29:54 PM »
Hi john your thermometer is pointing to the wrong url You have (ssrweather) twice in there as seen below

http://sacreysouthern.com/ssrweather/ssrweather/thermometer.php?t=31.6

Offline John Sacrey

  • Member
  • *
  • Posts: 23
    • Saline Weather
Re: thermometer
« Reply #14 on: January 16, 2009, 08:42:51 PM »
Thank for the help wxflint. 

I changed everything back to its original setting and I'm still not seeing it.  I even checked the permissions on the file and that is okay. Hmmmmmm....got me stumped.
Benton/Salem, AR
Vantage Pro 2, GR2AE, GR3,

Offline wxkpt

  • Kingsport, TN Weather
  • Senior Contributor
  • ****
  • Posts: 284
  • When The Weather Gets Tough.. Get With The Weather
    • Kingsport, TN Live and Local weather
Re: thermometer
« Reply #15 on: January 16, 2009, 08:49:55 PM »
Warning: file_get_contents(./ssrweather/clientraw.txt): failed to open stream: No such file or directory in /home/content/s/a/c/sacreysouthern/html/ssrweather/thermometer.php on line 110

Take the . out of the code so it looks like this
Warning: file_get_contents(/ssrweather/clientraw.txt)

Offline John Sacrey

  • Member
  • *
  • Posts: 23
    • Saline Weather
Re: thermometer
« Reply #16 on: January 16, 2009, 08:57:30 PM »
That didn't work either, unfortunately.  I took the period out of and thermometer.php, no luck.  Then I tried taking the period out of settings.php also.  No luck. I put the period back into settings.php after I tried that.

I appreciate the help.

John
Benton/Salem, AR
Vantage Pro 2, GR2AE, GR3,

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: thermometer
« Reply #17 on: January 16, 2009, 10:30:33 PM »
Hi folks,

First off, I love this webpage software.  I cannot get the thermometer to show.  I've tried everything you all have listed and still no luck.  I am open to ideas.

Thanks,

John Sacrey

http://sacreysouthern.com/ssrweather/wxindex.php

Hi John,

I'm pleased you like the template set :)

In your Settings.php, you need to have
Code: [Select]
$SITE['clientrawfile'] = './clientraw.txt'; to use the clientraw.txt in the same directory as the template set is located.  The Settings.php entries for files all have to be relative FILE addresses so PHP can find them.

Your ajaxWDwx.js
Code: [Select]
var clientrawFile = '/ssrweather/clientraw.txt'; // location of clientraw.txt relative to this page on website is correct as the JavaScript uses the URL address for finding the clientraw.txt file.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline John Sacrey

  • Member
  • *
  • Posts: 23
    • Saline Weather
Re: thermometer
« Reply #18 on: January 16, 2009, 11:05:39 PM »
Hi Ken,

Thanks for the help.  I have both files with clientraw set to /ssrweather/clientraw.txt.  Unfortunately I am no closer to getting the thermometer to show. 

The address for the thermometer is:  http://sacreysouthern.com/ssrweather/thermometer.php?t=31.8

I take it this correct?  I have the BlankGraphic in thermometer.php set to './ssrweather/thermometer-blank.png'.

Is this setting correct?

John
Benton/Salem, AR
Vantage Pro 2, GR2AE, GR3,

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: thermometer
« Reply #19 on: January 16, 2009, 11:13:35 PM »
John,
For the BlankGraphic, you should have it set as './thermometer-blank.png' since it's in the ssrweather directory already.

The PHP pages know what directory they are located in, so './thermometer-blank.png' specifies "use the thermometer-blank.png in this directory".  Settings.php should also have only './clientraw.txt' for the $SITE['clientrawfile'] setting for the same reason.

JavaScript (ajaxWDwx.js) doesn't know about file addresses in the filesystem .. it uses relative or absolute URL addresses, so it should have '/ssrweather/clientraw.txt' in it.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline John Sacrey

  • Member
  • *
  • Posts: 23
    • Saline Weather
Re: thermometer
« Reply #20 on: January 16, 2009, 11:23:53 PM »
Ken,

Thank you, SIR!!!!!  That worked.  I knew it had to be something relatively simple that I wasn't seeing.

Thanks again,

John
Benton/Salem, AR
Vantage Pro 2, GR2AE, GR3,

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: thermometer
« Reply #21 on: January 16, 2009, 11:28:26 PM »
You're very welcome John!

That difference in addressing in PHP v.s. JavaScript is very confusing.  I keep it straight (hopefully) by remembering
1) PHP only knows about FILES and the filesystem addresses, and using relative addressing with ./ (for here) ../ (for one directory above) etc lets me navigate without worrying about the FULL path to the file.
2) JavaScript only knows about URLS and the URL paths, so I try to start at '/' for the website's main directory, and include the full URL path info.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: thermometer
« Reply #22 on: January 17, 2009, 04:12:01 AM »
is it possible to use this script with VWS?
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline John Sacrey

  • Member
  • *
  • Posts: 23
    • Saline Weather
Re: thermometer
« Reply #23 on: January 17, 2009, 08:43:56 AM »
Hi Lars,

Yes, I believe you can.  There are some VWS settings I have seen listed within the various pages for VWS.

John
Benton/Salem, AR
Vantage Pro 2, GR2AE, GR3,

Offline John Sacrey

  • Member
  • *
  • Posts: 23
    • Saline Weather
Re: thermometer
« Reply #24 on: January 17, 2009, 08:52:58 AM »
Morning Folks,

Thanks to wxflint and saratogaWX for the assistance last night.  I have one other issue.  There is some other characters besides the "F" on top of the thermometer.  How do I remove those?

Thanks,

John
Benton/Salem, AR
Vantage Pro 2, GR2AE, GR3,

 

anything