Author Topic: Is there a wxastronomy update  (Read 2331 times)

0 Members and 1 Guest are viewing this topic.

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 384
    • Penn Lake Weather
Is there a wxastronomy update
« on: October 02, 2022, 07:40:07 PM »
Does anyone know if there is an update of the wxastronomy.php script by Ken Reed to work with PHP 8.0 and above? Or even if it is still being supported?

Thanks for any help.

yamiacaveman

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8714
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #1 on: October 02, 2022, 08:46:15 PM »
If youd zip up the page along with any non-template scripts it includes/requires, Ill take a look at updating it for PHP 8+
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 yamiacaveman

  • Forecaster
  • *****
  • Posts: 384
    • Penn Lake Weather
Re: Is there a wxastronomy update
« Reply #2 on: October 02, 2022, 09:08:35 PM »
So attached is the zp file and hopefully I included everything. The page is https://www.pennlake.us/wxastronomy.php , it was showing the depreciated files but now it is just blank.

Thanks for taking a look!!!! [ You are not allowed to view attachments ]

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8714
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #3 on: October 03, 2022, 08:49:59 PM »
Ok, it took a bit of effort, but got the three main scripts working.

It does require jpgraph V4.4.0 or above for sunposa.php, and it ONLY works with Weather-Display as it uses testtags.php and clientrawextra.txt
It assumes you had a working version before the PHP8 upgrade and the other image files are not provided.

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 yamiacaveman

  • Forecaster
  • *****
  • Posts: 384
    • Penn Lake Weather
Re: Is there a wxastronomy update
« Reply #4 on: October 04, 2022, 07:44:58 AM »
Wow thanks Ken! I Wish I knew more cause I still have this going on.

Warning: Undefined variable $moontransit in /home/hogan2/pennlake.us/include-wxastronomy.php on line 255

Warning: Undefined variable $moontransit in /home/hogan2/pennlake.us/include-wxastronomy.php on line 257

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8714
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #5 on: October 04, 2022, 08:30:19 AM »
It looks like your testtags.txt template in c:\wdisplay\webfiles is missing some variables.

You can either change testtags.txt there from
Code: [Select]
$chinesenewyear =  '%chinesenewyear%'; // Chinese new year
$hoursofpossibledaylight =  '%hoursofpossibledaylight%'; // Total hours/minutes of possible daylight for today
to
Code: [Select]
$chinesenewyear =  '%chinesenewyear%'; // Chinese new year
$suntransit = '%suntransit%';  // Sun transit date time
$moontransittime = '%moontransittime%'; // Moon transit time
$suntransittime = '%suntransittime%'; //Sun transit time
$moontransit = '%moontransit%'; // Moon transit date time
$hoursofpossibledaylight =  '%hoursofpossibledaylight%'; // Total hours/minutes of possible daylight for today
or use the attached testtags.txt to replace your current one in c:\wdisplay\webfiles
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: 366
    • Mishawaka Weather
Re: Is there a wxastronomy update
« Reply #6 on: October 04, 2022, 09:19:31 AM »
I have a modified version of wxastronomy.php that works with Cumulus and is php 8+ compatible.  It was updated by a friend who did a remarkable job adjusting the code.  I will make it available without support to anyone who wants it, just PM.

https://mymishawakaweather.com/Wxastronomy.php
« Last Edit: October 04, 2022, 09:35:42 AM by tmabell »

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 384
    • Penn Lake Weather
Re: Is there a wxastronomy update
« Reply #7 on: October 04, 2022, 09:40:51 AM »
So I replaced the testtags.txt and no change (yet). I also sent a PM to tmabell to get a copy of his version. So if you would rather wait until I get his script -- I know we are all busy and I am not in any hurry. So it's up to you Ken, and I really appreciate the work you do!

yamiacaveman

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8714
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #8 on: October 04, 2022, 09:51:51 AM »
So I replaced the testtags.txt and no change (yet). I also sent a PM to tmabell to get a copy of his version. So if you would rather wait until I get his script -- I know we are all busy and I am not in any hurry. So it's up to you Ken, and I really appreciate the work you do!

yamiacaveman
Those entries in testtags.php aren't appearing -- your current testtags.php shows
Code: [Select]
$chinesenewyear =  '31 January 2022 ()';    // Chinese new year
$hoursofpossibledaylight =  '11:37';    // Total hours/minutes of possible daylight for today
Maybe your WD is using the testtags.txt in c:\wdisplay instead .. try copying the file there.

Also, did you install jpgraph 4.4.1?  if so, you need to change sunposa.php setting
Code: [Select]
$jploc = './jpgraph-4.4.0/';  // relative location of jpgraph library
to the relative location of the jpgraph library you installed.
« Last Edit: October 04, 2022, 09:56:39 AM 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 saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8714
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #9 on: October 04, 2022, 09:52:52 AM »
I have a modified version of wxastronomy.php that works with Cumulus and is php 8+ compatible.  It was updated by a friend who did a remarkable job adjusting the code.  I will make it available without support to anyone who wants it, just PM.

https://mymishawakaweather.com/Wxastronomy.php
I see that version doesn't use the sunposa.php, but uses the FermiLab sun display instead.
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: 366
    • Mishawaka Weather
Re: Is there a wxastronomy update
« Reply #10 on: October 04, 2022, 09:56:33 AM »
That's correct.  He customized my edited version.  I'm just throwing it out there should anyone wish to use it.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8714
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #11 on: October 04, 2022, 09:57:47 AM »
That's correct.  He customized my edited version.  I'm just throwing it out there should anyone wish to use it.
That's cool.. does it only work with Cumulus/CumulusMX?
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: 366
    • Mishawaka Weather
Re: Is there a wxastronomy update
« Reply #12 on: October 04, 2022, 10:02:20 AM »
I have not tried it with Cumulus MX as I am an old, stubborn man and have yet to admit the need for change  ](*,)

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 384
    • Penn Lake Weather
Re: Is there a wxastronomy update
« Reply #13 on: October 04, 2022, 10:06:42 AM »
I am going to try Ken's fixes first but is that all I need is to use the "Include" file?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8714
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #14 on: October 04, 2022, 10:08:29 AM »
I am going to try Ken's fixes first but is that all I need is to use the "Include" file?
Download the testtags.txt from the post above.
Install in c:\wdisplay and c:\wdisplay\webfiles .. no changes are needed.

The next upload cycle should have the missing tags included in testtags.php automatically.
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 yamiacaveman

  • Forecaster
  • *****
  • Posts: 384
    • Penn Lake Weather
Re: Is there a wxastronomy update
« Reply #15 on: October 04, 2022, 10:44:08 AM »
Yes, I put them in both places and it seems to be working now. I guess while I'm at it I should upgrade the jpgraph files, but then I have to update the sunposa.php setting, with  $jploc = './jpgraph-4.4.0/';  // relative location of jpgraph library right?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8714
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #16 on: October 04, 2022, 10:49:14 AM »
Yes, I put them in both places and it seems to be working now. I guess while I'm at it I should upgrade the jpgraph files, but then I have to update the sunposa.php setting, with  $jploc = './jpgraph-4.4.0/';  // relative location of jpgraph library right?

Correct!
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 yamiacaveman

  • Forecaster
  • *****
  • Posts: 384
    • Penn Lake Weather
Re: Is there a wxastronomy update
« Reply #17 on: October 04, 2022, 04:34:19 PM »
Thanks Ken I believe that did it!!!

Instead of changing this $jploc = './jpgraph-4.4.0/';  / in the sunposa.php setting I just replaced the old jpgraph files with the new 4.4.1 files. It seems to be working alright. I don't know what else might be using the jpgraph folder so instead of adding a 4.4.1 folder and then having to track down and point other scripts there, I just replaced the contents of the jpgragh folder with the new jpgraph files, again everthing seems to be working, even when I put my hands to it, lol.

Again Thanks to all!!!

I do have 1 more question I will put in a separate post about screen size.


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8714
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #18 on: October 04, 2022, 05:18:17 PM »
Replacing jpgraph in the same directory is just fine.  You do need to change sunposa.php 'jpgraph-4.4.0' entry in
Code: [Select]
$jploc = './jpgraph-4.4.0/';  // relative location of jpgraph library with the name of the directory that jpgraph is installed in.

Then sunposa.php will work on the page and as a standalone at http://www.pennlake.us/sunposa.php
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 yamiacaveman

  • Forecaster
  • *****
  • Posts: 384
    • Penn Lake Weather
Re: Is there a wxastronomy update
« Reply #19 on: October 04, 2022, 05:38:02 PM »
Will do! Thanks!

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 384
    • Penn Lake Weather
Re: Is there a wxastronomy update
« Reply #20 on: October 04, 2022, 05:56:15 PM »
Oh boy never ending -- so I replaced this  $jploc = './jpgraph-4.4.0/';  // relative location of jpgraph library,    $jploc = './jpgraph/';  // relative location of jpgraph library

And then checking this http://www.pennlake.us/sunposa.php I get an jpgraph error 25049 that a font file is missing.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8714
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #21 on: October 04, 2022, 06:36:16 PM »
You'll need to do two things:
1) download from my site https://saratoga-weather.org/ttfonts.zip and unzip it to the ./jpgraph/src/fonts directory and upload the files to your website.
2) change ./jpgraph/src/jpg-config.inc.php to comment out two lines (with # or // at the beginning of the line):
Code: [Select]
define('TTF_DIR','/usr/share/fonts/truetype/');
 define('MBTTF_DIR','/usr/share/fonts/truetype/');

then jpgraph should assume the fonts are available in ./jpgraph/src/fonts directory

If it still doesn't work, then tell jpgraph by adding to ./jpgraph/src/jpg-config.inc.php
Code: [Select]
  define('TTF_DIR',$_SERVER['DOCUMENT_ROOT'].'/jpgraph/src/fonts/');
« Last Edit: October 04, 2022, 06:46:55 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 yamiacaveman

  • Forecaster
  • *****
  • Posts: 384
    • Penn Lake Weather
Re: Is there a wxastronomy update
« Reply #22 on: October 04, 2022, 07:03:35 PM »
Hi Ken, I added your file in and it seems to be working, do I still new to change the files define('TTF_DIR','/usr/share/fonts/truetype/');
 define('MBTTF_DIR','/usr/share/fonts/truetype/');

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8714
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Is there a wxastronomy update
« Reply #23 on: October 04, 2022, 07:06:53 PM »
No need for more changes.. jpgraph is working fine now. 
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 yamiacaveman

  • Forecaster
  • *****
  • Posts: 384
    • Penn Lake Weather
Re: Is there a wxastronomy update
« Reply #24 on: October 04, 2022, 07:09:19 PM »
Ok, I did just check and both of those line were commented out already.

thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!