Author Topic: uv-index.php  (Read 1838 times)

0 Members and 1 Guest are viewing this topic.

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
uv-index.php
« on: February 25, 2021, 01:18:16 PM »
I've seen this layout on several sites and am attempting to add it to mine.  It's based on Ken's uv-index.php http://saratoga-weather.org/uv-index.php.  I really like it because it looks aesthetically pleasing and it has the "Estimated time to sunburn".  I have it down pretty well except the $burntime is not being populated.  I am using Cumulus so I suspect that may be the root of the problem.  Also, I realize that there are validation issues ](*,)

https://mymishawakaweather.com/Work21.php
https://mymishawakaweather.com/uv-index-new.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: uv-index.php
« Reply #1 on: February 25, 2021, 02:00:54 PM »
$burntime is a WD-only variable AFAIK
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 tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: uv-index.php
« Reply #2 on: February 25, 2021, 02:02:17 PM »
I was afraid of that.   #-o Thank you Ken.

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 519
    • Tyler Texas Weather
Re: uv-index.php
« Reply #3 on: February 25, 2021, 02:36:04 PM »

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: uv-index.php
« Reply #4 on: February 25, 2021, 03:35:44 PM »
Thanks Steve!  That is a great solution.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: uv-index.php
« Reply #5 on: February 25, 2021, 04:18:52 PM »
I've added a (conditional) $burntime calc to CU-defs.php and created a wxuvinfo.php page that displays what my uv-info.php page does (minus the graphs generated by WeatherLink).  Attached is a copy of the set :)

Added to CU-defs.php was
Code: [Select]
if(isset($VPuv) and $VPuv > 0.0) {
$burntime = (0.8/((3/7)*$VPuv))*60; # Weather-Display formula for burn time
$burntime = round($burntime,0);
} else {
$burntime = '---';
}
to make it work like Weather-Display.
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 tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: uv-index.php
« Reply #6 on: February 26, 2021, 09:53:19 AM »
I haven't had much luck with this so far.  In full disclosure, my site is using PHP 8.  I've updated CU-Defs.php and after doing that, this is the script live:

https://mymishawakaweather.com/wxuvinfo.php

I'm seeing a number un undefined variables in the server logs:

Quote
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $VPuv in C:\\www\\wxuvinfo.php on line 79
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $time in C:\\www\\wxuvinfo.php on line 79
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $VPuv in C:\\www\\wxuvinfo.php on line 80
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $burntime in C:\\www\\wxuvinfo.php on line 83
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $burntime in C:\\www\\wxuvinfo.php on line 84
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $highuv in C:\\www\\wxuvinfo.php on line 90
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $highuvtime in C:\\www\\wxuvinfo.php on line 90
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $highuv in C:\\www\\wxuvinfo.php on line 91
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $highuvyest in C:\\www\\wxuvinfo.php on line 96
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $highuvyesttime in C:\\www\\wxuvinfo.php on line 96
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $highuvyest in C:\\www\\wxuvinfo.php on line 96
[Fri Feb 26 09:49:00.427912 2021] [php:warn] [pid 6092:tid 784] [client 192.168.10.1:61962] PHP Warning:  Undefined variable $burntime in C:\\www\\wxuvinfo.php on line 142

EDIT:  It does not seem to be loading any of the data.
« Last Edit: February 26, 2021, 10:34:17 AM by tmabell »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: uv-index.php
« Reply #7 on: February 26, 2021, 10:46:58 AM »
Your site is not quite running a Saratoga template, so there may be issues that crop up.

I see you have CUtags.php?sce=dump with UV values, but it appears that the CUdefs.php is not also being loaded, so the $variables cited in your message are all set in the CUdefs.php script (adapter for CU to WD variable names).

Make sure your page does an include_once("CUtags.php"); on it, the bottom of the CUtags.php page will do an include_once("CU-defs.php"); for you.
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 tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: uv-index.php
« Reply #8 on: February 26, 2021, 11:56:22 AM »
That did it!  I looked past that because settings.php calls setting-weather.php which, in turn, calls CU-Defs.  It's easy to become confused because, as you mentioned I am not using the Saratoga Template per-say.  That said, your help with it anyway is much-appreciated so thank you!

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: uv-index.php
« Reply #9 on: March 01, 2021, 07:37:13 AM »
Hello ken,

How can I update this to my seratoga ajax-dashboard version since I try to change into https from tramis web source and still not working since my dashboard version not working anymore on my UV summary on my ajax dashboard :(


Thanks and Regards
-Mike-
« Last Edit: March 01, 2021, 09:43:16 PM by pimohdaimaoh »

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: uv-index.php
« Reply #10 on: March 01, 2021, 09:14:00 AM »
if the UV Summary/Forecast module uses get-UV-forecast-inc.php   then it may need updating since your using an older version:

I know you may use custom scripts, but they also need updating from time to time so things do not break.

http://www.pimohweather.com//check-fetch-times.php?show=versions
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: uv-index.php
« Reply #11 on: March 01, 2021, 09:19:24 AM »
Also

what software are you really using?

Weewx or WD?  I ask as the version number is from WD.

Weewx is v4.xx

WD is version 10.37S Build 124

http://www.pimohweather.com/check-fetch-times.php?show=wxTags

shows two different softwares???
« Last Edit: March 01, 2021, 09:20:56 AM by ConligWX »
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: uv-index.php
« Reply #12 on: March 01, 2021, 09:25:08 PM »
Also

what software are you really using?

Weewx or WD?  I ask as the version number is from WD.

Weewx is v4.xx

WD is version 10.37S Build 124

http://www.pimohweather.com/check-fetch-times.php?show=wxTags

shows two different softwares???


Hello there, thank you for your reply, well IM using both WD and weewx and also meteobridge, however even in weewx it has a weewx-WD feed scripts so it can also send feed that supported to my seratoga version page scripts but the file on my seratoga page data feeds currently are from WD data (clientraw.tx, testtags.php etc), and yes it is latest updated WD version 10.37S Build 124 but I forgot to update its fetch on my page, thats why it looks confusing when u look at it, so no problems about that but my script version is too old now to be honest, I want to update these scripts but for now I have no time since im more busy on my site job, so I have no time as of now to update my whole script page, so for a moment, Im just updating specific page which showing problems like these UV index script not working at all. I already changes tramis site source from http to https and its working fine http://www.pimohweather.com/UVforecast2020.php , but the script doesnt integrate anymore to my tabs without using <iframe> to work, and maybe this is the reason why my UV index forecast on my ajax-dashboard doesnt showing anymore during at night time similar to your page on your seratoga page and it seems it doesnt working too, it shows zero UV index on your ajax dashboard too as I look on your ajaxdashboard page.

I also downloaded the latest scripts for get-UV-forecast-inc.php from ken to try to update my UV page and still not work except here http://www.pimohweather.com/UVforecast2020.php it shows the updated is working but NOT on my ajax-dashboard, dont know why

Thank you and regards

-Mike-
« Last Edit: March 01, 2021, 09:41:23 PM by pimohdaimaoh »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: uv-index.php
« Reply #13 on: March 02, 2021, 12:41:33 PM »
Your index.php page is including an old version of the get-UV-forecast-inc.php script
Quote
<!-- get-UV-forecast-inc.php V1.07 - 30-Mar-2012 -->
and that's why the display there is not working.  The include may be in your modified weewx-dashboard.php code.
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 pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: uv-index.php
« Reply #14 on: March 05, 2021, 04:30:33 AM »
Your index.php page is including an old version of the get-UV-forecast-inc.php script
Quote
<!-- get-UV-forecast-inc.php V1.07 - 30-Mar-2012 -->
and that's why the display there is not working.  The include may be in your modified weewx-dashboard.php code.

Oh I see Ken, thanks so much for pointing that out. . . will recheck it later when im home. . . .  sometimes I forgot other part to do when this kind of Update happened after many years of my webpage stable.

UPDATE: its working now Ken, yeah I forgot to change the get-UV-forecast-inc.php and still at OLD version hehehe, and now its updated. Thanks so much Ken
http://www.pimohweather.com/wxuvforecast.php


Regards

-Mike-
« Last Edit: March 05, 2021, 05:09:28 AM by pimohdaimaoh »

 

anything