WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: yamiacaveman on October 02, 2022, 07:40:07 PM

Title: Is there a wxastronomy update
Post by: yamiacaveman 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
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 02, 2022, 08:46:15 PM
If you’d zip up the page along with any non-template scripts it includes/requires, I’ll take a look at updating it for PHP 8+
Title: Re: Is there a wxastronomy update
Post by: yamiacaveman 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 ]
Title: Re: Is there a wxastronomy update
Post by: saratogaWX 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.

Title: Re: Is there a wxastronomy update
Post by: yamiacaveman 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
Title: Re: Is there a wxastronomy update
Post by: saratogaWX 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
Title: Re: Is there a wxastronomy update
Post by: tmabell 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 (https://mymishawakaweather.com/Wxastronomy.php)
Title: Re: Is there a wxastronomy update
Post by: yamiacaveman 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
Title: Re: Is there a wxastronomy update
Post by: saratogaWX 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.
Title: Re: Is there a wxastronomy update
Post by: saratogaWX 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 (https://mymishawakaweather.com/Wxastronomy.php)
I see that version doesn't use the sunposa.php, but uses the FermiLab sun display instead.
Title: Re: Is there a wxastronomy update
Post by: tmabell 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.
Title: Re: Is there a wxastronomy update
Post by: saratogaWX 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?
Title: Re: Is there a wxastronomy update
Post by: tmabell 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  ](*,)
Title: Re: Is there a wxastronomy update
Post by: yamiacaveman 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?
Title: Re: Is there a wxastronomy update
Post by: saratogaWX 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.
Title: Re: Is there a wxastronomy update
Post by: yamiacaveman 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?
Title: Re: Is there a wxastronomy update
Post by: saratogaWX 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!
Title: Re: Is there a wxastronomy update
Post by: yamiacaveman 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.

Title: Re: Is there a wxastronomy update
Post by: saratogaWX 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
Title: Re: Is there a wxastronomy update
Post by: yamiacaveman on October 04, 2022, 05:38:02 PM
Will do! Thanks!
Title: Re: Is there a wxastronomy update
Post by: yamiacaveman 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.
Title: Re: Is there a wxastronomy update
Post by: saratogaWX 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/');
Title: Re: Is there a wxastronomy update
Post by: yamiacaveman 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/');
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 04, 2022, 07:06:53 PM
No need for more changes.. jpgraph is working fine now. 
Title: Re: Is there a wxastronomy update
Post by: yamiacaveman on October 04, 2022, 07:09:19 PM
Ok, I did just check and both of those line were commented out already.

thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Title: Re: Is there a wxastronomy update
Post by: Weerstation on October 09, 2022, 03:49:23 AM
Thanks for all the help.

jpgraph-4.4.1

I am getting a message Can't read background image : "./cache/jpsun.png

I changed following line in jpg-config.inc.php from false to true

define('USE_CACHE',true);

https://www.westland-depoel.nl/vantagevue/ws/wxastronomy.php



Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 09, 2022, 11:01:24 AM
The likely cause is that your webserver cannot access https://umbra.nascom.nasa.gov/images/latest_solisHe_thumbnail.gif to get the sun image to cache.  It's not a jpgraph caching issue .. it's an access issue from your webserver to umbra.nascom.nasa.gov service.

Unfortunately, the original sunposa.php script didn't have any debugging code to help diagnose this issue.  I'll try to add some code later today and post it here for you to try.
Title: Re: Is there a wxastronomy update
Post by: Weerstation on October 09, 2022, 02:10:13 PM
Ok.

I did not change anything but the graph is loading now.
That's strange.

Is it because the sun image is not needed because of sunset already.
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 09, 2022, 04:49:49 PM
No, the sun image is fetched when more than 3600 seconds old.

Try the attached version.. it has debugging features added so when that happens again, better diagnostic messages will result.
Title: Re: Is there a wxastronomy update
Post by: Weerstation on October 09, 2022, 06:50:35 PM
Thanks.

Downloaded and uploaded.

It's late already, I am off to bed.
Working all day tomorrow untill 18:00 so I won't be able to respond untill then.

TIA
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 09, 2022, 07:03:42 PM
You can see the error now by running https://www.westland-depoel.nl/vantagevue/ws/sunposa.php?force=1

Quote
Warning: getimagesize(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/fordkno9/public_html/vantagevue/ws/sunposa.php on line 618

Warning: getimagesize(https://umbra.nascom.nasa.gov/images/latest_solisHe_thumbnail.gif): Failed to open stream: no suitable wrapper could be found in /home/fordkno9/public_html/vantagevue/ws/sunposa.php on line 618
-- error fetching image size from https://umbra.nascom.nasa.gov/images/latest_solisHe_thumbnail.gif. Unable to continue.

You need to add
Code: [Select]
allow_url_fopen = 1 to your php.ini (or enable it in your cPanel.

Then the script should be able to fetch the sun image and work correctly.
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 10, 2022, 12:09:48 PM
Here's another update with improved diagnostics (?debug=y now shows state of allow_url_fopen)
Title: Re: Is there a wxastronomy update
Post by: Weerstation on October 10, 2022, 12:11:10 PM
Yes  :grin: It's working now.  [tup]
Thanks

I hate to ask but I have another minor problem and that is that the monthnames are in English. :oops:
I like them to be in Dutch.
Is that possible.

I think I had that problem a long time ago also and you seemed to have fixed that too.
Title: Re: Is there a wxastronomy update
Post by: Weerstation on October 10, 2022, 12:12:32 PM
ooh you replied when I was posting.
Will download that file.
Title: Re: Is there a wxastronomy update
Post by: Weerstation on October 10, 2022, 12:19:08 PM
 [tup]

sunposa.php Version 2.02 - 10-Oct-2022
..debug=y debugging output for sunposa.php.  PHP version 8.1.10
  php.ini setting 'allow_url_fopen = true;'  (Note: this enables fetch of sun image).
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 10, 2022, 12:34:37 PM
Alas, the author of the enhanced astronomy page didn't include the auto-translation of text month names in the code.

I suggest you change include-wxastronomy.php entry
Code: [Select]
$SITE['dateOnlyFormat'] = 'd M Y'; to
Code: [Select]
$SITE['dateOnlyFormat'] = 'd/m/Y'; to be consistent and avoid the English month names.  Sorry...

Glad that the sunposa.php issue was fixed by you having allow_url_fopen = true so the sun image could be fetched/resized/cached.
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 10, 2022, 10:22:27 PM
And.. you're missing one (or more files).  sunposa.php?force=1 is showing
Quote
Warning: getimagesize(./ajax-images/moon/w/NH-moon16.gif): Failed to open stream: No such file or directory in /home/fordkno9/public_html/vantagevue/ws/sunposa.php on line 617

Warning: imagecreatefromgif(./ajax-images/moon/w/NH-moon16.gif): Failed to open stream: No such file or directory in /home/fordkno9/public_html/vantagevue/ws/sunposa.php on line 618
Make sure you have ALL the NH-moon*.gif files on your site (there are 28 of them)
Title: Re: Is there a wxastronomy update
Post by: Weerstation on October 11, 2022, 04:55:07 PM
Working now, path to moon images was wrong.  :oops:
Title: Re: Is there a wxastronomy update
Post by: hcorrin on October 12, 2022, 05:43:21 PM
I tried this one but i got a red not secure and although it worked ok in edge the ipad did not display the sunspot image
So went through the scripts and changed all http to https and that sorted the red not secure not even a grey one
https://www.hc-iom.co.uk/WD-AJAX1/wxastronomy.php and the missing sunspot image showed on the ipad
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 12, 2022, 10:00:17 PM
That's a good catch.. thanks.

I think that removal of the <script> entries for invoking the world daylight map sets should likely be removed.. I get some major CORS errors with Firefox and could likely do without the error messages in the console log.  The 'big earth' view already shows the day/night terminator on the globe.
Title: Re: Is there a wxastronomy update
Post by: hcorrin on October 13, 2022, 04:30:58 PM
the only thing i have not figured out is what is causing the Equinox/Solstice globes showing night on the left instead of the right side and have not found a setting in the include-wxastronomy.php that effects it
https://www.hc-iom.co.uk/WD-AJAX1/wxastronomy.php

tmabell reworked version shows them ok
https://mymishawakaweather.com/Wxastronomy.php
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 13, 2022, 08:30:58 PM
mymishawakaweather is using the ./ajax-images/ versions of the season images.
The include-wxastronomy.php uses the fourmilab.ch dynamically generated images.

The fourmilab earth viewer (https://www.fourmilab.ch/earthview/custom.html) uses lat,long and UTC time of the season change to display the view
Title: Re: Is there a wxastronomy update
Post by: hcorrin on October 14, 2022, 02:46:48 PM
i got this working with the images from the ajax-images folder but updated the images for my location and using the times on the web page using the link Ken posted above and this is the result https://www.hc-iom.co.uk/WD-AJAX1/wxastronomy.php
Title: Re: Is there a wxastronomy update
Post by: andro700 on October 15, 2022, 04:08:08 AM
For some reason I can not get my graphics-sunchart.php to work. I am getting a http 500 error. I have attached all scripts.

https://www.goblesweather.com/wxastronomy.php (https://www.goblesweather.com/wxastronomy.php)

Chuck
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 15, 2022, 09:07:04 AM
You’re missing the semicolon at the line ending. 
Code: [Select]
$SITE['latitude' ]      = 47.462625 should be
Code: [Select]
$SITE['latitude' ]      = 47.462625;
Title: Re: Is there a wxastronomy update
Post by: andro700 on October 15, 2022, 11:54:33 AM
Thanks Ken for the assistance. It works now.

Chuck
Title: Re: Is there a wxastronomy update
Post by: Weerstation on October 16, 2022, 10:24:47 AM
Hi,

I have always had a problem with the moontransit time showing.
I have edited this code
 
Code: [Select]
echo '
         <span style="color:'.$mC[0].'">'.langtransstr($mN[0]).': '.$mS[0].'</span><br />
         <span style="color:'.$mC[1].'">'.langtransstr($mN[1]).': '.$mS[1].'</span><br />
         <span style="color:'.$mC[2].'">'.langtransstr($mN[2]).': '.$mS[2].'</span><br /><br />
         <span style="color:gray;">';

to

Code: [Select]
echo '
         <span style="color:'.$mC[0].'">'.langtransstr($mN[0]).': '.$moontransittime.'</span><br />
         <span style="color:'.$mC[1].'">'.langtransstr($mN[1]).': '.$mS[1].'</span><br />
         <span style="color:'.$mC[2].'">'.langtransstr($mN[2]).': '.$mS[2].'</span><br /><br />
         <span style="color:gray;">';

$mS[0] subtituted by $moontransittime
The time is showing now but would this piece of code be a problem or incorrect?

*****
One other error that I got is the date for the beginning of spring.
It says March 20 2009

TIA
Title: Re: Is there a wxastronomy update
Post by: hcorrin on October 17, 2022, 06:15:17 PM
that date for start of spring is the default if the testtags.php is not found or the "$marchequinox =  '%marchequinox%';" is missing from the testtags.txt that creates the php this is assuming you have WD generating it
Title: Re: Is there a wxastronomy update
Post by: andro700 on October 18, 2022, 02:50:24 PM
This section of the include-wxastronomy is not working. It worked before I updated to the newest update to the script. [ You are not allowed to view attachments ]

Code: [Select]
<?php
if($includeDayNightMap) { ?>

<!-- DAY / NIGHT MAP -->

<div align="center">
<h2>Current Sunlight Map</h2>

<script src="http://www.gmodules.com/ig/ifr?url=http://static.die.net/earth/gadget.xml&amp;up_clouds=1&amp;up_proj=mercator&amp;synd=open&amp;w=800&amp;h=443&amp;title=World+Sunlight+Map&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js" type="text/javascript">
</script>

<script src="http://www.gmodules.com/ig/ifr?url=http://static.die.net/earth/gadget.xml&amp;up_clouds=1&amp;up_proj=hemisphere&amp;synd=open&amp;w=800&amp;h=387&amp;title=World+Sunlight+Map&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js" type="text/javascript"></script>
<script src="http://www.gmodules.com/ig/ifr?url=http://static.die.net/moon/gadget.xml&amp;up_size=large&amp;up_info=1&amp;up_date=0&amp;synd=open&amp;w=350&amp;h=364&amp;title=Moon+Phase&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js" type="text/javascript"></script>
<!--
<table align="center" width="656" cellpadding="0" border="0" cellspacing="0" style="border: 2px solid gray; margin-top: 14px; background: black; color: white; font: 12px Arial;">
   <tr><td align="center">
      <b><big><?php echo strtoupper(langtransstr(&#39;Current Day / Night Map&#39;)); ?></big></b><br />
      <img src="<?php echo $daynightURL.$daynightImg?>" width="656" height="328" border="0" alt="Day / Night Map">
   </td></tr>
</table>
-->
<?php }

Chuck
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 18, 2022, 04:20:11 PM
Yes, that wouldn't work for me either (in https), so I just turned it off.  Made for a busy page and was somewhat redundant with the earth globe showing clouds and day/night terminator.

I just set $includeDayNightMap = false; in the settings and it cleared up some http/https issues.
Title: Re: Is there a wxastronomy update
Post by: Weerstation on October 27, 2022, 08:34:20 AM
that date for start of spring is the default if the testtags.php is not found or the "$marchequinox =  '%marchequinox%';" is missing from the testtags.txt that creates the php this is assuming you have WD generating it

Code: [Select]
$marchequinox =  '15:34 UTC 20 maart 2022'; // March equinox date

$junesolstice =  '09:15 UTC 21 juni 2022'; // June solstice date

$sepequinox =  '01:04 UTC 23 september 2022'; // September equinox date

$decsolstice =  '21:49 UTC 21 december 2022'; // December solstice date

It seems to be present and all other dates are correct.
Title: Re: Is there a wxastronomy update
Post by: hcorrin on October 27, 2022, 06:17:30 PM
i wonder if it's a translation issue
to test as soon as the testtags.php is created edit the
Code: [Select]
$marchequinox =  '15:34 UTC 20 maart 2022'; // March equinox dateto
Code: [Select]
$marchequinox =  '15:34 UTC 20 march 2022'; // March equinox date
and upload and check you site before the next normal upload overwrite it, if the correct info is displayed before you next normal update then the translation is the cause
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 27, 2022, 09:51:35 PM
There's a simple remedy for WD users.. WD, Setup, Language, Use English for Reports for web files => Yes will ensure that the dates appear in testtags.php with English names.

The alt wxastronomy.php may not handle reverse translation to non-English language.  Guess I'll have to refactor that in :)
Title: Re: Is there a wxastronomy update
Post by: hcorrin on October 31, 2022, 06:06:48 AM
The server for the sun stuff appears to be down ie sunspot image and sun moon graphic
Title: Re: Is there a wxastronomy update
Post by: K6GKM on November 23, 2022, 12:32:05 PM
Really liking this version of wxastromony, thanks for uploading it.  One issue I've run into, though, is my script saying it's already Winter in the middle of November beneath the sunlit earth.  Dates are correct in testtags.php (as far as I can tell) so I'm not quite sure where the foul-up is.  Any input?  Script at CamWX.com/wxastronomy.php (http://CamWX.com/wxastronomy.php).

Thanks all.
Title: Re: Is there a wxastronomy update
Post by: tmabell on November 23, 2022, 02:06:29 PM
I had issues with the seasons showing up correctly which is why I used my own code for that.

https://mymishawakaweather.com/Wxastronomy.php (https://mymishawakaweather.com/Wxastronomy.php)
Title: Re: Is there a wxastronomy update
Post by: youngros on November 26, 2022, 12:20:10 PM
I can't get the sunposa.php to work I get this error.

Quote
Catchable fatal error: Argument 1 passed to JpGraphException::defaultHandler() must be an instance of Throwable, instance of JpGraphExceptionL given in /home/madweather/public_html/jpgraph-4.4.1/src/jpgraph_errhandler.inc.php on line 158

I don't seem to have the sunlight map anymore either. Not sure when these stopped working. The rest of it is working.
Title: Re: Is there a wxastronomy update
Post by: hcorrin on November 26, 2022, 12:42:06 PM
Are you using the sunposa 2.0.2 see post 31 on page 2 of this thread and is it pointing to the latest jpgragh version
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on November 26, 2022, 12:47:15 PM
You're running some of the Saratoga scripts, but your check-fetch-times.php is so old, it doesn't have additional diagnostics in it to help resolve the problems.

Running  http://www.mad-weather.com/sunposa.php?debug=y

shows
Code: [Select]
Notice: Undefined index: REMOTE_HOST in /home/madweather/public_html/Settings.php on line 35

Notice: Undefined index: allowThemeSwitch in /home/madweather/public_html/Settings.php on line 174

Notice: A non well formed numeric value encountered in /home/madweather/public_html/sunposa.php on line 299

Notice: A non well formed numeric value encountered in /home/madweather/public_html/sunposa.php on line 333

Notice: A non well formed numeric value encountered in /home/madweather/public_html/sunposa.php on line 347

Notice: A non well formed numeric value encountered in /home/madweather/public_html/sunposa.php on line 361

Catchable fatal error: Argument 1 passed to JpGraphException::defaultHandler() must be an instance of Throwable, instance of JpGraphExceptionL given in /home/madweather/public_html/jpgraph-4.4.1/src/jpgraph_errhandler.inc.php on line 158

The "A non well formed numeric value encountered" are likely caused by entries in your Settings.php for $SITE['latitude'] and/or $SITE['longitude'] .. are those entries with decimal period notation (not decimal comma notation)?
Title: Re: Is there a wxastronomy update
Post by: youngros on November 26, 2022, 12:57:52 PM
Latitude and longitude are the correct notation.
Some parts have been updated, but I think I started doing standalone before some of the scripts became standalone!
I know enough to make a real mess of things!
This is still running php5.6. I switched it back after testing my homepage as I wanted to work through other things and also to let people know that the topsites would no longer work after I make the final switch.
Title: Re: Is there a wxastronomy update
Post by: youngros on November 26, 2022, 04:42:33 PM
I've updated the check-fetch-times.php to the latest one.
When I first started building this site, which would have been 2009/2010 I'm not sure there was  a standalone or all the languages, not that I use them. I have thought sometimes that it might be better to start again, but, if I can keep it working I will.
I guess the scripting has got harder now and less people are willing to spend the time.
Enjoy the rest of your weekend everyone.
Rosalind
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on November 26, 2022, 05:12:27 PM
Looking at Settings.php shows
Code: [Select]
$SITE['longitude']        = '-17.194 ';  //East=positive, West=negative decimal degrees  The space at the end of the number (before the closing single-quote) may be what is causing the problem with sunposa.php
Try changing it to
Code: [Select]
$SITE['longitude']        = '-17.194';  //East=positive, West=negative decimal degrees and see if that helps.

Also, the first lines in Settings.php
Code: [Select]
$SITE['REMOTE_ADDR']    = $_SERVER['REMOTE_ADDR'];
$SITE['REMOTE_HOST']    = $_SERVER['REMOTE_HOST'];
$SITE['WEBROOT']        = $_SERVER['DOCUMENT_ROOT'];
$SITE['REQURI']            = $_SERVER['REQUEST_URI'];
$SITE['SERVERNAME']        = $_SERVER['SERVER_NAME'];
should be changed to
Code: [Select]
if(isset($_SERVER['REMOTE_ADDR']))   {$SITE['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];}
if(isset($_SERVER['REMOTE_HOST']))   {$SITE['REMOTE_HOST'] = $_SERVER['REMOTE_HOST'];}
if(isset($_SERVER['DOCUMENT_ROOT'])) {$SITE['WEBROOT'] = $_SERVER['DOCUMENT_ROOT'];}
if(isset($_SERVER['REQUEST_URI']))   {$SITE['REQURI'] = $_SERVER['REQUEST_URI'];}
if(isset($_SERVER['SERVER_NAME']))   {$SITE['SERVERNAME'] = $_SERVER['SERVER_NAME'];}
to avoid the other 'Undefined' Notice errata.
Title: Re: Is there a wxastronomy update
Post by: youngros on November 28, 2022, 06:21:54 AM
I've made those corrections and now have a black page with a white square in the middle!
I'm getting there slowly.
Thanks
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 08, 2023, 11:14:34 AM
 Greetings From The CSRA!  Gentlemen, I have read and studied the messages in this thread and have tried to follow Ken's instructions.  I downloaded the files, unzipped the jpgraph file and uploaded all files to my webserver at https://csraweather.org/wxastronomy.php  I am encountering difficulty with the images and the sunposa.php script.  I checked WD/webfiles/testtags.txt and testtags.php and believe the correct tags are there.  Could someone consider pointing me to a resolution of what I obviously did not do correct...SMH...Refer to the attached zip file as reference.  Thank You in advance! [ You are not allowed to view attachments ]
Title: Re: Is there a wxastronomy update
Post by: andro700 on February 08, 2023, 01:02:16 PM
Here is a copy of my settings for sunposa.php.

Code: [Select]
#Settings                                                     #
###############################################################
#
$jploc = './jpgraph-4.4.0/';  // relative location of jpgraph library

/*  GLOBAL VARIABLES */
$lat = 47.462625;              //overridden by $SITE['latitude']
//Note! longitude is west negative
$lon = -122.202057;           //overridden by $SITE['longitude'];
$tz = "America/Los_Angeles"; //overridden by $SITE['tz']
$cacheFileDir = './';        //overridden by $SITE['cacheFileDir']
//
$crextrafile = "./clientrawextra.txt"; // set location of WD clientrawextra file
$moonImagePath = './ajax-images/moon/w/NH-moon'; //alternative dashboard moon images
$dtstring   = "M j Y g:ia";         // format for the date & time
#
# you likely do not have to configure the following:
$daycolor   = 'lightskyblue';
$ctlcolor   = 'skyblue:0.6';           // Civil Twilight
$ntlcolor   = 'skyblue:0.6';           // Nautical Twilight
$atlcolor   = 'midnightblue:0.9';           // Astronomical Twilight
$nightcolor = 'midnightblue:0.7';
$dawncolor  = 'lightskyblue:0.4';
$zenith = 90.83333;
###############################################################
#End of settings                                              #
###############################################################

Chuck
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 08, 2023, 03:31:56 PM
Many Thanks, Chuck!  Checked my sunposa.php and all settings are similar to yours.  Moon and sun images??  Might go and check the moon icon images?  Also, WD/webfiles/clientrawextra.txt is being uploaded by WD....
Title: Re: Is there a wxastronomy update
Post by: K6GKM on February 08, 2023, 03:47:10 PM
I want to say I had similar problems when I implemented this wxastronomy page a while back.  I recall having to track down several sun/moon icon images and tweak the code for the sunposa a bit to get it happy.  I honestly don't really exactly what I did to pacify it. 

BUT...

I can help with the icons. Unzip these five images into your /ajax-images/ folder.  That should fix the broken sun/moon image links.  I'll take a look at the rest of it to see if I can figure out what I tweaked to get the rest of it working.

Also-
Consider embedding the code into a wxnewpage.php to integrate it with the rest of your website.  There's no way to navigate off the page with it standing alone like it is.
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 08, 2023, 03:58:26 PM
Thank You, K6GKM!!....I will download these icon images momentarily....also, yeah, I will change and embed code in wxnewpage.php once I get the darned thing up and running!  Thanks again!
Title: Re: Is there a wxastronomy update
Post by: andro700 on February 08, 2023, 04:07:06 PM
Here is my wxastronomy page. Hopefully it will help.

Chuck
Title: Re: Is there a wxastronomy update
Post by: K6GKM on February 08, 2023, 04:09:06 PM
So a bit more information... in trying to run your sunposa.php script (https://csraweather.org/sunposa.php (https://csraweather.org/sunposa.php)), I get the following PHP warnings:
Code: [Select]
Warning: include(./jpgraph-4.4.0/src/jpgraph.php): failed to open stream: No such file or directory in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 126

Warning: include(./jpgraph-4.4.0/src/jpgraph.php): failed to open stream: No such file or directory in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 126

Warning: include(): Failed opening './jpgraph-4.4.0/src/jpgraph.php' for inclusion (include_path='.:/opt/plesk/php/7.4/share/pear') in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 126

Warning: include(./jpgraph-4.4.0/src/jpgraph_scatter.php): failed to open stream: No such file or directory in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 127

Warning: include(./jpgraph-4.4.0/src/jpgraph_scatter.php): failed to open stream: No such file or directory in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 127

Warning: include(): Failed opening './jpgraph-4.4.0/src/jpgraph_scatter.php' for inclusion (include_path='.:/opt/plesk/php/7.4/share/pear') in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 127

Warning: include(./jpgraph-4.4.0/src/jpgraph_line.php): failed to open stream: No such file or directory in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 128

Warning: include(./jpgraph-4.4.0/src/jpgraph_line.php): failed to open stream: No such file or directory in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 128

Warning: include(): Failed opening './jpgraph-4.4.0/src/jpgraph_line.php' for inclusion (include_path='.:/opt/plesk/php/7.4/share/pear') in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 128

Warning: include(./jpgraph-4.4.0/src/jpgraph_date.php): failed to open stream: No such file or directory in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 129

Warning: include(./jpgraph-4.4.0/src/jpgraph_date.php): failed to open stream: No such file or directory in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 129

Warning: include(): Failed opening './jpgraph-4.4.0/src/jpgraph_date.php' for inclusion (include_path='.:/opt/plesk/php/7.4/share/pear') in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 129

Fatal error: Uncaught Error: Class 'Graph' not found in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php:443 Stack trace: #0 {main} thrown in /var/www/vhosts/csrawxaq.com/csrawxorg/sunposa.php on line 443

Is it possible the directory where jpgraph is living is different than what sunposa.php is configured for?  Check
Code: [Select]
$jploc = './jpgraph-4.4.0/';  // relative location of jpgraph library
in your sunposa.php file and make sure it's pointing to the right place.  The script comes preconfigured for jpgraph-4.4.0.  Not sure what you installed, but the current version is 4.4.1  Methinks that might be the issue.
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 08, 2023, 06:03:59 PM
Chuck and K6GKM,  Thank You both for your help.  I believe I screwed up by renaming include-wxastronomy.php to wxastronomy.php and uploaded to my server.  I will fix that on my end, when I set up wxnewpage.php.  receiving these warnings when I run sunposa.php now:

Warning: file_exists(): open_basedir restriction in effect. File(/usr/share/fonts/truetype/arialbd.ttf) is not within the allowed path(s): (/var/www/vhosts/csrawxaq.com/:/tmp/) in /var/www/vhosts/csrawxaq.com/csrawxorg/jpgraph-4.4.1/src/jpgraph_ttf.inc.php on line 505

Warning: file_exists(): open_basedir restriction in effect. File(/usr/share/fonts/truetype/arialbd.ttf) is not within the allowed path(s): (/var/www/vhosts/csrawxaq.com/:/tmp/) in /var/www/vhosts/csrawxaq.com/csrawxorg/jpgraph-4.4.1/src/jpgraph_ttf.inc.php on line 510
JpGraph Error: 25049 Font file "/usr/share/fonts/truetype/arialbd.ttf" is not readable or does not exist.

I will go to Ken's site and download the instructed font files.  I am trying here....Thanks for your help!
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 08, 2023, 06:50:09 PM
Well, I have got this script up and running at https://csraweather.org/wxastronomy.php.  Struggling with the sun and moon images....SMH, done for the evening...tomorrow is another day....thank you all for your help!!
Title: Re: Is there a wxastronomy update
Post by: hcorrin on February 09, 2023, 05:11:59 AM
The moon images should be located in the Ajax-images folder in you WD-Ajax directory
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 09, 2023, 06:26:07 AM
hcorrin,
  Thank You for your response!  I realize I do not have the sun and moon images in the Ajax-images directory!  Where do I download the sun-arrow.gif and the moon NH images?
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 09, 2023, 06:38:29 AM
Good Morning Gentlemen,
  I have found that the moon NH and sun-arrow.gif images were not located in my ajax-images directory!  I downloaded the images from CHUCK (I could have sworn I did this yesterday!) and uploaded to my webserver at https://csraweather.org/wxastronomy.php  I am up and running!  Thanks to all who have helped!
Title: Re: Is there a wxastronomy update
Post by: tigerbait on February 09, 2023, 04:32:28 PM
Good afternoon,
I have been trying to get my wxastronomy page to populate also with nothing but a black page.
http://www.sporttiger.com/wxastronomy.php (http://www.sporttiger.com/wxastronomy.php)
My old page works fine except can't figure out why date is not up to date. http://www.sporttiger.com/wxastronomybak.php (http://www.sporttiger.com/wxastronomybak.php)
I have jpgraphs installed in a jpgraphs-4.4.1 folder off my root.  Not sure if that is correct. 
Any help appreciated in advance.

Alan
Title: Re: Is there a wxastronomy update
Post by: K6GKM on February 09, 2023, 04:36:03 PM
Can you please post your wxastronomy.php file for us to take a look at?  Not much to go off of looking at your page source.
Title: Re: Is there a wxastronomy update
Post by: tigerbait on February 09, 2023, 04:44:17 PM
Will this work?
Title: Re: Is there a wxastronomy update
Post by: K6GKM on February 09, 2023, 04:55:24 PM
Yep, perfect.  Assuming you have include-wxastronomy.php in the right place, this looks ok.  I use include_once rather than include, but i think include should work just fine.

Code: [Select]
<?php include("include-wxastronomy.php"); ?>
Can you also post up your include_wxastronomy.php?
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 09, 2023, 04:58:28 PM
GEAUX TIGAHS!  Alan, may I suggest you start by reading this thread from the beginning (really helped me get my page up and cruising).  Please pay attention to Mr. Ken True's instructions and be sure to download sunposa.php V2, make sure the moon NH and sun-arrow.gif images are in your ajax-images folder!  These guys here will certainly help you.  They really helped me!
Title: Re: Is there a wxastronomy update
Post by: tigerbait on February 09, 2023, 06:01:31 PM
Thanks for all the direction guys!! Can't thank you enough as it works like a champ.
One question does the page have to be refreshed by the browser in order to update? Or is there a setting to update the page?

Alan
Title: Re: Is there a wxastronomy update
Post by: tigerbait on February 09, 2023, 11:16:48 PM
Ok my moondetail1.gif will not update.  I have deleted the file from the root.  That part of the page goes away. Then I recreated in WD & uploaded which it does every 5 minutes.  File attached.
Why does my page still show the moondetail.gif date as 1-24-23?
Thank you,
Alan
Title: Re: Is there a wxastronomy update
Post by: hcorrin on February 10, 2023, 12:35:34 PM
Tigerbait you moondetail images look update to me
Read reply #46 in this thread to sort the —- under then main moon image

Scudwatcher your moondetail imaged are showing 2021 dates so that needs looking into also you need to read reply #46 in this thread

I thought Ken had tweaked the Wxastronomy and the sunspot image works as on mine https://www.hc-iom.co.uk/WD-AJAX1/wxastronomy.php.  But that may be the include-wxastronomy
Title: Re: Is there a wxastronomy update
Post by: K6GKM on February 10, 2023, 12:55:21 PM
Might be an image cache issue?

Ok my moondetail1.gif will not update.  I have deleted the file from the root.  That part of the page goes away. Then I recreated in WD & uploaded which it does every 5 minutes.  File attached.
Why does my page still show the moondetail.gif date as 1-24-23?
Thank you,
Alan
Title: Re: Is there a wxastronomy update
Post by: tigerbait on February 10, 2023, 03:49:29 PM
Cache issue cleared & working great. 
Thanks to everyone for all the help.

Laissez les bon temps rouler

Alan
Title: Re: Is there a wxastronomy update
Post by: 92merc on February 10, 2023, 06:10:42 PM
Thanks Ken, and everyone else who upgraded before me.  My upgrade went without a hitch!

https://www.bismarckweather.net/wxastronomy.php
Title: Re: Is there a wxastronomy update
Post by: zeppline on February 11, 2023, 04:46:21 PM
Trying to setup  sunposa.php, but I don't know how to get or setup jpgraph V4.4.0. Thanks Joe
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 11, 2023, 05:34:43 PM
Hey Joe,
  GOOGLE Search jpgraph 4.4.1 and download.  Also, may I suggest reading ALL pages of this thread (really helped me).  Follow Ken True's instructions and download sunposa V2.php (located on PAGE 2).  Hope this gets you on the right track!
Title: Re: Is there a wxastronomy update
Post by: hcorrin on February 11, 2023, 06:06:51 PM
also worth reading this https://www.wxforum.net/index.php?topic=45059.0
Title: Re: Is there a wxastronomy update
Post by: zeppline on February 12, 2023, 04:23:35 PM
I have 30 moon old where can I find the new ones. or can I just rename them?
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 15, 2023, 04:58:27 PM
zeppline,
Download the attached file, unzip to your ajax-images file, then upload to your webserver.  This should work. [ You are not allowed to view attachments ]
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 15, 2023, 05:13:38 PM
Gentlemen,
  I have revised my include-wxastronomy.php file as instructed in message # 46, on Line # 459:

FROM:  <span style="color:'.$mC[0].'">'.langtransstr($mN[0]).': '.$mS[0].'</span><br />

TO:  <span style="color:'.$mC[0].'">'.langtransstr($mN[0]).': '.$moontransittime.'</span><br />

In WD, created uploaded moondetail1.gif and moondetail2.gif every 5 minutes.  CLEARED CACHE/COOKIES on GOOGLE CHROME....still not uploading per WD upload schedule...SMH.... Thank you all for your help!
Title: Re: Is there a wxastronomy update
Post by: zeppline on February 16, 2023, 04:11:43 PM
How do I unzip Jpgraph_4.4.1.tar.gz or do I have the wrong file?
Title: Re: Is there a wxastronomy update
Post by: 92merc on February 16, 2023, 04:18:38 PM
I used the 7 Zip program from the Microsoft Store.
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on February 16, 2023, 04:19:01 PM
Unless you have WinZip or 7Zip installed, you're better off downloading the Jpgraph_4.4.1.zip distribution on Windows.
Keep in mind that 4.4.1 works up to PHP 8.1, but breaks on PHP 8.2+ (I have some fixes for that)
Title: Re: Is there a wxastronomy update
Post by: SteveFitz1 on February 16, 2023, 05:32:34 PM
Not to hijack the thread, but since the discussion is about updating wxastronomy.php, I wanted to mention an issue that will impact lots of users of include-wxastronomy.php beginning in 2024.

There is a function in include-wxastronomy.php called getMoonInfo. Within this function is a list of ALL unix timestamps for New Moons, Q1 Moons, Full Moons, and Q3 Moons. In older versions of this script, the years covered by this function are 2009 through 2023. Unless you update that script before the end of 2023, your wxastronomy.php script will fail in 2024. But, there is an easy solution that will take you through 2030. If you have the cloud-base.php script v2.1 (and possible some earlier versions) on your system, simply edit that script and copy the entire getMoonInfo function starting with "function getMoonInfo" and ending with with "// ------------- end of USNO moon data -----------------------------". Then replace this same section of code in your include-wxastronomy.php with the new code. If you don't have a newer cloud-base.php script on your system, I've attached the necessary section of code here. Use it to replace your existing getMoonInfo function.

I checked 4 URLs mentioned in this thread alone to see how many of those sites had updated moon times in their include-wxastronomy.php scripts, and none of then had the updated times. That's why I thought it important enough to bring this to everyone's attention.

Steve

 [ You are not allowed to view attachments ]
Title: Re: Is there a wxastronomy update
Post by: hcorrin on February 16, 2023, 05:48:58 PM
Hi
Ken updated the include-wxastronomy.php for php 8.2 and it includes moon info till 2030, post #3 in this thread clearly a lot have not updated yet
Title: Re: Is there a wxastronomy update
Post by: SteveFitz1 on February 16, 2023, 06:16:30 PM
Thanks for that update. Since I'm not moving to PHP 8.2 yet, I haven't looked at Ken's updated version. Good to know.

Steve
Title: Re: Is there a wxastronomy update
Post by: zeppline on February 17, 2023, 02:40:45 PM
I have unziped Jpgraph_4.4.1.tar.gz with 7zip and now have Jpgraph_4.4.1.tar do I just rename Jpgraph_4.4.1 then upload to my web site. I am way over my head. Trying to learn. Thanks
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 17, 2023, 04:17:21 PM
zeppline,
  The .tar.gz file is a compressed archive of individual files within its intended hierarchy.  In other laymen's terms, when the .tar.gz file is unzipped, it should maintain the intended file structure (archive).  When you go to : https://jpgraph.net/download/, you will download the jpgraph-4.4.1.tar.gz (in your post, you have Jpgraph_4.4.1.tar.gz which is Incorrect file name).  When you OPEN the jpgraph.4.4.1.tar.gz ZIPFILE, somewhere in your unzip utility (WINZIP or 7zip), it will say "EXTRACT".  You want to extract (unzip) the .tar.gz file to an assigned folder on your computer.  Once this file is unzipped, to a folder you've assigned on your computer, the unzipped folder name should be "jpgraph-4.4.1" with the associated files and file structure and NOT "Jpgraph_4.4.1.tar".  Somewhere down the line, a mistake was made.  Once you have the folder named "jpgraph-4.4.1", then upload the entire folder with contents to your webserver.  I do not have any experience utilizing 7zip.  I have always utilized WINZIP for my system is WINDOWS based (Windows 11)  I hope this helps!
Title: Re: Is there a wxastronomy update
Post by: zeppline on February 17, 2023, 05:08:38 PM
Thanks I have it on the desktop. I will down load and start over I will make folder then unzip to folder. thanks again
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 17, 2023, 05:14:25 PM
Ok Gentlemen,
  I am trying to figure out the proper "click" and/or "tick" for WD Internet File Creation and Upload of moondetail1.gif!  Do I tick "upload every 5 min?, every 30 seconds? or every minute?, JEEZ, to many options in WD!  Also, before I view https://csraweather.org/wxastronomy.php, I clear out cache in GOOGLE CHROME.  Could someone please assist?  Refer to the attached screenshots.....THANK YOU!


 [ You are not allowed to view attachments ]
 [ You are not allowed to view attachments ]
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 17, 2023, 05:22:47 PM
Gentlemen,
  I believe I figured it out!  It's beer-thirty as well!  SOLVED!  Thank You for all your help!
Title: Re: Is there a wxastronomy update
Post by: hcorrin on February 17, 2023, 05:38:45 PM
just for info i have mine set for every 2 hours
Title: Re: Is there a wxastronomy update
Post by: zeppline on February 18, 2023, 04:22:55 PM
Another success only four days and my eyes are falling out. Thank you to all for the help. Joe

https://lasvegaswx.com/wxastronomy1.php (https://lasvegaswx.com/wxastronomy1.php)
Title: Re: Is there a wxastronomy update
Post by: W3DRM on February 22, 2023, 06:53:57 PM
Perhaps I have missed something here but I can't seem to find a current version of wxastronomy for USA usage in the Saratoga template. The version I am running (Version 1.01 - 22-Jan-2012) doesn't work nor does it make any reference to the "include-wxastronomy.php" file. I'm lost and need some help figuring this out.

Thanks,
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on February 22, 2023, 08:24:27 PM
Hey Don,
  Really enjoyed viewing your page!

  1.  Please read this ENTIRE message thread for doing that really helped me get mine up and running at:
       https://csraweather.org/wxastronomy.php
       Pay close attention to Ken True's specific instructions.

  2.  Reply # 3  Download "wxastonomy-php8.zip", unzip to your local file, then upload to your website server after configuration to your site
       specifics.

  3.  Reply #5   Check your c:/wdisplay/webfiles/testtags.txt file to ensure the required testtags are there.  If not, download testtags.txt.

  4.  Reply #8  Go to https://jpgraph.net/download/ and download "jpgraph-4.4.1.tar.gz, unzip to your local file maintaining file structure, then
       upload to webserver.

  4.  Reply #31  Download "sunposa-V2.02.zip", unzip to your local file and upload to your webserver after configuration to your site specifics.

  5.  Reply #66  Download "astronomyicons.zip", unzip to your /ajax/images/ folder then upload to your webserver.

  6.  Reply#68  Look at "wxastronomy.txt" and download if needed.

  7.  Reply #81 and #101:
      Go to your WD/CONTROL PANEL/INTERNET FILE CREATION SETUP
      Scroll down to file #31 "EXTRA MOON DETAILS"
      Click on "SET"
      Click on "CREATE THIS FILE NOW"
      Click/Check "UPLOAD EVERY 1 MIN OR 5 MIN (YOUR PREFERENCE)
      Click "UPLOAD FILE NOW"
      Click  "SAVE NOW"
      Click  "OK"

I am here if you have any questions.....hopefully, this will help.
     
       
Title: Re: Is there a wxastronomy update
Post by: W3DRM on February 22, 2023, 11:10:04 PM
Thanks for the detailed sequence for getting wxastronomy running again. I must have missed a lot while I was in the process of moving late last year. I am currently trying to get my new website up and running and it's taking me a lot of time going through each of the menu items one at a time and bringing them up-to-date.

I'll start working on this tomorrow.

Best regards,
Don

Hey Don,
  Really enjoyed viewing your page!

  1.  Please read this ENTIRE message thread for doing that really helped me get mine up and running at:
       https://csraweather.org/wxastronomy.php (https://csraweather.org/wxastronomy.php)
       Pay close attention to Ken True's specific instructions.

  2.  Reply # 3  Download "wxastonomy-php8.zip", unzip to your local file, then upload to your website server after configuration to your site
       specifics.

  3.  Reply #5   Check your c:/wdisplay/webfiles/testtags.txt file to ensure the required testtags are there.  If not, download testtags.txt.

  4.  Reply #8  Go to https://jpgraph.net/download/ (https://jpgraph.net/download/) and download "jpgraph-4.4.1.tar.gz, unzip to your local file maintaining file structure, then
       upload to webserver.

  4.  Reply #31  Download "sunposa-V2.02.zip", unzip to your local file and upload to your webserver after configuration to your site specifics.

  5.  Reply #66  Download "astronomyicons.zip", unzip to your /ajax/images/ folder then upload to your webserver.

  6.  Reply#68  Look at "wxastronomy.txt" and download if needed.

  7.  Reply #81 and #101:
      Go to your WD/CONTROL PANEL/INTERNET FILE CREATION SETUP
      Scroll down to file #31 "EXTRA MOON DETAILS"
      Click on "SET"
      Click on "CREATE THIS FILE NOW"
      Click/Check "UPLOAD EVERY 1 MIN OR 5 MIN (YOUR PREFERENCE)
      Click "UPLOAD FILE NOW"
      Click  "SAVE NOW"
      Click  "OK"

I am here if you have any questions.....hopefully, this will help.
     
     
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on February 23, 2023, 01:30:58 PM
Perhaps I have missed something here but I can't seem to find a current version of wxastronomy for USA usage in the Saratoga template. The version I am running (Version 1.01 - 22-Jan-2012) doesn't work nor does it make any reference to the "include-wxastronomy.php" file. I'm lost and need some help figuring this out.

Thanks,
Hi Don,
The 'stock' wxastronomy.php page distributed in the Base-*.zip files is Version 1.01 - 22-Jan-2012 and is 'all-in-one'.  Only needs info from other scripts (like common.php, and tags file) to display.  It has no other includes.

The alternative wxastronomy.php page uses include-wxastronomy.php for it's displays.. that script was written by Bashewa weather, and updated by various folks over the years. 

So.. two different scripts, unfortunately named the same.

Use @scudwatcher's post above to get the alternative one working instead of the stock one.
Title: Re: Is there a wxastronomy update
Post by: weatherbee on April 15, 2023, 10:29:55 AM
I've read all the posts and I think made all the changes, but I still can't get sunposa.php to work in the astronomy page.
It's here at https://www.shermanctweather.org/mb/wxastronomy.php
Thanks,
Tom
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on April 15, 2023, 11:00:19 AM
Your sunposa.php returns
Quote
<br />
<b>Warning</b>:  imagecreatefromgif(): './ajax-images/moon/w/NH-moon24.gif' is not a valid GIF file in <b>/home/shermanc/public_html/mb/sunposa.php</b> on line <b>618</b><br />
<br />
<b>Warning</b>:  imagecopyresized() expects parameter 2 to be resource, bool given in <b>/home/shermanc/public_html/mb/sunposa.php</b> on line <b>620</b><br />
<br />
<b>Warning</b>:  imageinterlace() expects parameter 1 to be resource, bool given in <b>/home/shermanc/public_html/mb/sunposa.php</b> on line <b>621</b><br />
<br />
<b>Warning</b>:  imagepng() expects parameter 1 to be resource, bool given in <b>/home/shermanc/public_html/mb/sunposa.php</b> on line <b>622</b><br />
before the actual image.

I'd suggest re-uploading mb/ajax-images/moon/w/NH-moon*.gif from the .zip using FTP binary mode.
Title: Re: Is there a wxastronomy update
Post by: weatherbee on April 15, 2023, 11:08:13 AM
Ken,
Wow you are fast.  That was the problem.
Thank you for all your help.
Tom
Title: Re: Is there a wxastronomy update
Post by: W3DRM on April 26, 2023, 06:41:11 PM
[scudwatcher] I have gone over all of the steps you and others have posted in this thread. I have made a little progress but still can't get the sun graphic to display. Everything else appears to be working fine.
You can see the results here: https://emmettweather.com/wxastronomy.php (https://emmettweather.com/wxastronomy.php)

Initially I would only see a line across the screen but now I see an error message for jpgraph. I must have changed something but don't know what it was that caused the apparent error.

Thanks for any help or suggestions in advance...
 
Hey Don,
  Really enjoyed viewing your page!

  1.  Please read this ENTIRE message thread for doing that really helped me get mine up and running at:
       https://csraweather.org/wxastronomy.php (https://csraweather.org/wxastronomy.php)
       Pay close attention to Ken True's specific instructions.

  2.  Reply # 3  Download "wxastonomy-php8.zip", unzip to your local file, then upload to your website server after configuration to your site
       specifics.

  3.  Reply #5   Check your c:/wdisplay/webfiles/testtags.txt file to ensure the required testtags are there.  If not, download testtags.txt.

  4.  Reply #8  Go to https://jpgraph.net/download/ (https://jpgraph.net/download/) and download "jpgraph-4.4.1.tar.gz, unzip to your local file maintaining file structure, then
       upload to webserver.

  4.  Reply #31  Download "sunposa-V2.02.zip", unzip to your local file and upload to your webserver after configuration to your site specifics.

  5.  Reply #66  Download "astronomyicons.zip", unzip to your /ajax/images/ folder then upload to your webserver.

  6.  Reply#68  Look at "wxastronomy.txt" and download if needed.

  7.  Reply #81 and #101:
      Go to your WD/CONTROL PANEL/INTERNET FILE CREATION SETUP
      Scroll down to file #31 "EXTRA MOON DETAILS"
      Click on "SET"
      Click on "CREATE THIS FILE NOW"
      Click/Check "UPLOAD EVERY 1 MIN OR 5 MIN (YOUR PREFERENCE)
      Click "UPLOAD FILE NOW"
      Click  "SAVE NOW"
      Click  "OK"

I am here if you have any questions.....hopefully, this will help.
     
     
Title: Re: Is there a wxastronomy update
Post by: Vasco on April 26, 2023, 06:52:42 PM
Initially I would only see a line across the screen but now I see an error message for jpgraph.

From my limited experience of JpGraph the message means that the font file arialbd.ttf is not present in the location expected. It's not included in the JpGraph download.

You can upload it from Windows fonts.
Title: Re: Is there a wxastronomy update
Post by: zeppline on April 26, 2023, 10:45:37 PM
I had the same problem, go to google and update Windows fonts and follow how to install fonts.
Title: Re: Is there a wxastronomy update
Post by: W3DRM on April 27, 2023, 12:03:33 AM
That font is and has been installed on all of my windows computers for a long time. I have two desktops and three laptops plus an iPad. All of them exhibit the same issue when viewing the wxastronomy webpage.

Unless I misunderstand how a browser works, it uses the configuration of the viewers computer to display a font. Font display is not controlled by the web server.

Additionally, when I Inspect the page in Chrome, I am getting errors regarding the code attempting to open http:// websites and are being blocked by the browser. Perhaps I have some old code in the routines.?
Title: Re: Is there a wxastronomy update
Post by: hcorrin on April 27, 2023, 04:57:30 AM
The arial font needs to be down loaded and installed in the fonts folder in the src folder in the jpgragh folder on your server as that is were it is being directed to, not the fonts on the browsers computer
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on April 27, 2023, 07:40:28 AM
W3DRM,
  Forgive me for my delayed response....have you resolved the font issue?
Title: Re: Is there a wxastronomy update
Post by: zeppline on April 27, 2023, 11:00:19 AM
what version of jpgraphs? I have Jpgraphs4.4.1 and it works.
Title: Re: Is there a wxastronomy update
Post by: K6GKM on April 27, 2023, 09:42:17 PM
The arial font needs to be down loaded and installed in the fonts folder in the src folder in the jpgragh folder on your server as that is were it is being directed to, not the fonts on the browsers computer

W3DRM,
If I'm remembering correctly, I had the same issue when implementing this alternative wxastronomy script set.  I also had to find and upload the arial.ttf font.  Something to do with the way the script is rendering the information requires the font to be on the web hosting server.  It looks like you got that done, but your moon phase images also seem to be missing.  Broken image link in the Sun, Moon, & Seasons box.  Adding the atttached directory and contents to your /ajax-images/ folder on your webserver should take care of it.
Title: Re: Is there a wxastronomy update
Post by: W3DRM on April 28, 2023, 11:20:53 PM
K6GKM,

Thanks for the file. I’ll look into it this weekend. I’ve been very busy with unpacking from our move and have limited time to work on my website and the many nagging issues in getting things running again. Plus, as a ham, you’ll understand that my having moved into a new home with an HOA and very rigid CCR’s are making the installation of both weather instruments and ham radio antennas/devices very challenging.

I’ll update what happens after I work on the file.

Thanks again!
Title: Re: Is there a wxastronomy update
Post by: tigerbait on May 06, 2023, 02:18:43 PM
Any one explain why the astronomy page is showing Summer?  I looked at fellow friends pages and it shows Summer as well. https://www.sporttiger.com/wxastronomy.php (https://www.sporttiger.com/wxastronomy.php)

Title: Re: Is there a wxastronomy update
Post by: scudwatcher on May 07, 2023, 06:16:26 AM
Yeah, I noticed that too!
Title: Re: Is there a wxastronomy update
Post by: DW7240 on May 07, 2023, 12:23:30 PM
Hmm, mine is showing Spring still, but have noticed that the timing of the seasons changing has been off in the past months, so I'm waiting for mine to change automatically.  In the past have had to make it change manually by swapping the season names on the default season line of the script.
Title: Re: Is there a wxastronomy update
Post by: 92merc on May 07, 2023, 12:55:34 PM
I checked mine yesterday after the above post.  Mine is showing Summer as well.

https://www.bismarckweather.net/wxastronomy.php
Title: Re: Is there a wxastronomy update
Post by: hcorrin on May 07, 2023, 06:08:28 PM
which version of the include-wxastronomy.php are you using lines 34 to 36 show it depending on version
if line 34 has #  Version 1.10 - 02-Oct-2022 - adapted for PHP8+ by saratoga-weather.org
and line 35 has //--self downloader --
then that shows summer

if line 35 has # updated by Saratoga-Weather.org for PHP 8.2
and line 36 has ############ Version 20221230 ################
 then that shows spring
the latter is the latest version which is on post 52 of https://www.wxforum.net/index.php?topic=43337.50
Title: Re: Is there a wxastronomy update
Post by: tigerbait on May 07, 2023, 09:00:28 PM
Thanks hcorrin. Had the older version. Made changes  to line #240 from CUtags.php to testtags.php and worked perfectly with some additional earth views.

Thanks again.
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on May 08, 2023, 06:06:48 AM
Good Morning!  Ok, so I have downloaded, configured the script and uploaded to my webserver.  Now, the moondetail1.gif and moondetail2.gif are not displayed.  I did change on Line 240ish from CUTags to testtags.  Any Ideas?  Thank You in advance!
Title: Re: Is there a wxastronomy update
Post by: hcorrin on May 08, 2023, 06:31:41 AM
Have you setup lines 69 and 70 as they are to do with moondeatail
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on May 08, 2023, 07:06:01 AM
hcorrin,
  Thank You!  Up and running at https://csraweather.org/wxastronomy.php

I did notice that the additional earth views are wider than the standard Saratoga legacy page of 800px.  I will go and configure the widthpx of those images later today.

Cheers!
Title: Re: Is there a wxastronomy update
Post by: 92merc on May 08, 2023, 08:53:05 AM
Where are your editing that width?  In the include?
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on May 08, 2023, 09:03:28 AM
Yes, I was going to start with include-wxastronomy.php first....but, not really sure....
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on May 08, 2023, 09:05:53 AM
A distinct possibility is they are in an image file somewhere?
Title: Re: Is there a wxastronomy update
Post by: tigerbait on May 08, 2023, 09:37:38 AM
Where are your editing that width?  In the include?
in the include-astronomy.php
Line 648
Change imgsize=700 to 380
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on May 08, 2023, 09:38:45 AM
Thanks, Alan!
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on May 08, 2023, 03:57:52 PM
I fixed a couple of issues (wrong season showing, moon data to 2030 instead of ending at 2023) with V1.11 (attached)
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on May 08, 2023, 04:17:15 PM
Thanks, Ken!
Title: Re: Is there a wxastronomy update
Post by: weatherbee on May 08, 2023, 04:24:01 PM
Ken,
That version 1.11 changed my season back to summer.
You can see at https://www.shermanctweather.org/mb/wxastronomy.php
Tom
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on May 08, 2023, 04:42:44 PM
Ken,
That version 1.11 changed my season back to summer.
You can see at https://www.shermanctweather.org/mb/wxastronomy.php
Tom
I thought it might be caused by your site not having testtags.php in the same directory as the page.  Your Settings-weather.php has
Code: [Select]
$SITE['WXtags']            = '../meteo/testtags.php';
I do see you've changed include-wxastronomy.php to
Code: [Select]
if ((include_once "../meteo/testtags.php") == 0)
so that should be working correctly to get the data.  Your testtags.php does have
Code: [Select]
$marchequinox =  '21:25 UTC March 20 2023';    // March equinox date
$junesolstice =  '14:58 UTC June 21 2023';    // June solstice date
$sepequinox =  '06:51 UTC September 23 2023';    // September equinox date
$decsolstice =  '03:28 UTC December 22 2023';    // December solstice date
which is the same as mine (which is working (https://saratoga-weather.org/wxtemplates/USA/wxastronomy-alt.php))
So I'm at a loss as to why your instance isn't working  :???:  :shock:
Title: Re: Is there a wxastronomy update
Post by: weatherbee on May 08, 2023, 04:54:18 PM
Thanks Ken for looking.
It did work with Version 20221230 so I will look at that to see what is different.
Thanks,
Tom
Title: Re: Is there a wxastronomy update
Post by: 92merc on May 08, 2023, 05:00:53 PM
Only thing I'm seeing is an issue with my moon transit and moonrise.  Showing dashes.  Ken, yours shows the data.  Does that need to come from WD in my testtags?  Because my graphics at the bottom shows the info.

https://www.bismarckweather.net/wxastronomy.php
Title: Re: Is there a wxastronomy update
Post by: tigerbait on May 08, 2023, 05:09:31 PM
Thank you Ken!!  I added the Current Sunlight maps back
Title: Re: Is there a wxastronomy update
Post by: weatherbee on May 08, 2023, 05:34:49 PM
Ken,
I just replaced the section SETUP CURRENT SEASON with
Code: [Select]
    case ($date< $JunSol     ): $currentSeason = $SITE['latitude' ]<0 ? 'Autumn' : 'Spring'; break;with
Code: [Select]
   case ($date< $dateJunSol): $currentSeason = $SITE['latitude' ]<0 ? 'Autumn' : 'Spring'; break;
   
and
Code: [Select]
   case ($date< $DecSol     ): $currentSeason = $SITE['latitude' ]<0 ? 'Spring' : 'Autumn'; break; with
Code: [Select]
case ($date< $dateDecSol): $currentSeason = $SITE['latitude' ]<0 ? 'Spring' : 'Autumn'; break;
 
It is working now.
Thanks,
Tom
Title: Re: Is there a wxastronomy update
Post by: tigerbait on May 08, 2023, 11:29:03 PM
So just an opinion.  Are the Sunlight maps to much?
https://www.sporttiger.com/wxastronomy.php (https://www.sporttiger.com/wxastronomy.php)
Title: Re: Is there a wxastronomy update
Post by: andro700 on May 09, 2023, 05:24:16 PM
My transit is also has dashes as well with version 1.11.

https://www.goblesweather.com/wxastronomy.php (https://www.goblesweather.com/wxastronomy.php)

Chuck
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on May 09, 2023, 07:10:20 PM
My transit is also has dashes as well with version 1.11.

https://www.goblesweather.com/wxastronomy.php (https://www.goblesweather.com/wxastronomy.php)

Chuck
looks like you're getting a error
Quote
Warning: Undefined variable $moontransittime in /home/goblesweather/www/www/include-wxastronomy.php on line 269

$moontransittime should be in your testtags.txt template:

Code: [Select]
$moontransittime = '%moontransittime%'; // Moon transit time
$moontransit = '%moontransit%'; // Moon transit date time
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on May 09, 2023, 07:13:16 PM
Only thing I'm seeing is an issue with my moon transit and moonrise.  Showing dashes.  Ken, yours shows the data.  Does that need to come from WD in my testtags?  Because my graphics at the bottom shows the info.

https://www.bismarckweather.net/wxastronomy.php
Same issue as above .. missing entries in testtags.txt template.
Code: [Select]
$moontransittime = '%moontransittime%'; // Moon transit time
$moontransit = '%moontransit%'; // Moon transit date time
Title: Re: Is there a wxastronomy update
Post by: 92merc on May 10, 2023, 09:22:07 AM
I looked at my testtags.php file that is uploaded.  I have these in there.

$moontransittime = '06:05'; // Moon transit time
$suntransittime = '13:39'; //Sun transit time
$moontransit = '06:05 05 10 2023'; // Moon transit date time
$hoursofpossibledaylight =  '14:49';
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on May 10, 2023, 11:06:27 AM
I looked at my testtags.php file that is uploaded.  I have these in there.

$moontransittime = '06:05'; // Moon transit time
$suntransittime = '13:39'; //Sun transit time
$moontransit = '06:05 05 10 2023'; // Moon transit date time
$hoursofpossibledaylight =  '14:49';

It seems your include-wxastronomy.php has  this
Code: [Select]
// SETUP MOON INFO ... from WD testtags.php and include-mooninfo.php
   $mr   = strtotime($moonrise);
   $mt   = isset($moontransit)?strtotime($moontransit):'';
   $ms   = strtotime($moonset);
if(isset($moontransit)) {
   $mtt  = explode("Local",$moontransit);
   $mt   = strtotime($mtt[0]);
} else {
$mt = '';
}
instead of my release with
Code: [Select]
// SETUP MOON INFO ... from WD testtags.php and include-mooninfo.php
   $mr   = strtotime($moonrise);
   $mt   = strtotime($moontransittime);
   $ms   = strtotime($moonset);
   #$mtt  = explode("Local",$moontransit);
   #$mt   = strtotime($mtt[0]);
and that's likely the cause of the '-----' issue.
Title: Re: Is there a wxastronomy update
Post by: 92merc on May 10, 2023, 11:53:19 AM
Fixed.  Thanks Ken.
Title: Re: Is there a wxastronomy update
Post by: tigerbait on June 21, 2023, 11:30:50 AM
Good morning,
My  https://www.sporttiger.com/wxastronomy.php (https://www.sporttiger.com/wxastronomy.php) did not roll over to Summer on the map.  Any others have this issue?
Thanks ,
Alan
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on June 21, 2023, 11:54:43 AM
Same Here....as of 1153 Hours EDT....occurred at 1458Z
Title: Re: Is there a wxastronomy update
Post by: weatherbee on June 21, 2023, 12:02:07 PM
Mine changed.
https://www.shermanctweather.org/mb/wxastronomy.php
Are you sure you have the latest update?
Mine is #  Version 1.11 - 07-May-2023 - fixed seasons display + moon data to 2030
Tom
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on June 21, 2023, 12:09:18 PM
Yes, running current version 1.11 - 07-May-2023.......
Title: Re: Is there a wxastronomy update
Post by: 92merc on June 21, 2023, 12:17:09 PM
Mine flipped over fine.
Title: Re: Is there a wxastronomy update
Post by: tigerbait on June 21, 2023, 01:31:06 PM
I’m running 1.11 May 7th also
Title: Re: Is there a wxastronomy update
Post by: andro700 on June 21, 2023, 01:49:29 PM
I am also running version 1.11 7 May 2023 but mine did not roll over to summer.

https://www.goblesweather.com/wxastronomy.php (https://www.goblesweather.com/wxastronomy.php)

Chuck
Title: Re: Is there a wxastronomy update
Post by: weatherbee on June 21, 2023, 02:00:09 PM
I was having problems with this showing "Summer" in the spring but I made a few changes to the script and it went to the correct season.
Look at Reply #142 for the changes I made, it might fix it.
Tom
Title: Re: Is there a wxastronomy update
Post by: K6GKM on June 21, 2023, 02:04:20 PM
Gold star for you.   [tup]

Thanks!

I was having problems with this showing "Summer" in the spring but I made a few changes to the script and it went to the correct season.
Look at Reply #142 for the changes I made, it might fix it.
Tom
Title: Re: Is there a wxastronomy update
Post by: tigerbait on June 21, 2023, 03:52:25 PM
Money Tom!! [tup]
Cheers Alan



I was having problems with this showing "Summer" in the spring but I made a few changes to the script and it went to the correct season.
Look at Reply #142 for the changes I made, it might fix it.
Tom
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on June 21, 2023, 03:53:49 PM
I took weatherbee's advice....go to reply number 142 within this thread and edit include-wxastronomy.php as follows:

Line 340 change to:

case ($date< $dateJunSol     ): $currentSeason = $SITE['latitude' ]<0 ? 'Autumn' : 'Spring'; break;

Line 342 change to:

case ($date< $dateDecSol     ): $currentSeason = $SITE['latitude' ]<0 ? 'Spring' : 'Autumn'; break;

Mine is working now at:  https://csraweather.org/wxastronomy.php

Thank You!

Title: Re: Is there a wxastronomy update
Post by: weatherbee on June 21, 2023, 04:30:32 PM
I'm glad that it worked.  All the times I got help from here I'm glad I could return the favor. \:D/
Tom
Title: Re: Is there a wxastronomy update
Post by: Weerstation on June 25, 2023, 12:43:30 AM
That worked for me also, it flipped over to Summer.

But I am have this warning now.

"Warning: Undefined variable $dateJunSolstice in" (Line 340)

Code: [Select]
case ($date< $dateMarEqu      ): $currentSeason = $SITE['latitude' ]<0 ? 'Zomer' : 'Winter'; break;
   case ($date< $JunSolstice     ): $currentSeason = $SITE['latitude' ]<0 ? 'Herfst' : 'Lente'; break;
   case ($date< $dateSepEqu      ): $currentSeason = $SITE['latitude' ]<0 ? 'Winter' : 'Zomer'; break;
   case ($date< $DecSolstice     ): $currentSeason = $SITE['latitude' ]<0 ? 'Lente' : 'Herfst'; break;

As you can see my line reads $JunSolstice, not $JunSol.

include-wxastronomy version 1.11 of 07 May 2023.
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on June 25, 2023, 05:31:26 AM
I did the same edit and received the same warning!  Remove “STICE” from both $dateJunSolstice and $dateDecSolstice and that should work.
Title: Re: Is there a wxastronomy update
Post by: Cienega32 on July 05, 2023, 05:57:45 AM
I'm glad that it worked.  All the times I got help from here I'm glad I could return the favor. \:D/
Tom

Thanks Tom! I hadn't even noticed it on my page until I read the new posts here. Works for me now as well. Quick & easy-peasy. Just match them to the 4 used starting at line 318.
Title: Re: Is there a wxastronomy update
Post by: Cienega32 on July 05, 2023, 06:03:36 AM
Is this an oddity? Looks like the seasonal earth views are represented in UTC not 'local' time. Seems backwards.
 [ You are not allowed to view attachments ]
Title: Re: Is there a wxastronomy update
Post by: K6GKM on October 14, 2023, 12:29:15 PM
This morning my sunposa.php is asking for a NH-moon28.gif.  I was under the impression that there were only 28 moon images required. (NH-moon00.gif - NH-moon27.gif).  Does anyone possess this mythical NH-moon28.gif? 
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on October 14, 2023, 12:56:35 PM
You can copy NH-moon00.gif to the missing NH-moon28.gif

Or you can change sunposa.php
Code: [Select]
if ($age>28) { $age=28; }
to
Code: [Select]
if ($age>27) { $age=27; }
Title: Re: Is there a wxastronomy update
Post by: K6GKM on October 14, 2023, 01:06:17 PM
As always, thank you, Ken.  Went with option #1.  Kicking myself for not coming up with that on my own.   #-o

Hope you've been enjoying the show in the sky.
Title: Re: Is there a wxastronomy update
Post by: tigerbait on December 15, 2023, 09:30:51 AM
Good morning,
Anyone else having issues with the sun spot image on the astronomy page?

https://www.sporttiger.com/wxastronomy.php (https://www.sporttiger.com/wxastronomy.php)
Title: Re: Is there a wxastronomy update
Post by: 92merc on December 15, 2023, 11:12:38 AM
Mine seems to be working.

https://www.bismarckweather.net/wxastronomy.php
Title: Re: Is there a wxastronomy update
Post by: hcorrin on December 15, 2023, 11:49:06 AM
Mine is not showing it https://www.hc-iom.co.uk/WD-AJAX1/wxastronomy.php
I think we’re using a different image to 92merc
Title: Re: Is there a wxastronomy update
Post by: K6GKM on December 15, 2023, 01:01:47 PM
I have no earthly idea why, but for some reason https://umbra.nascom.nasa.gov has started taking issue with the cache-busting URL parameter that the script tacks on to the end of the image link in order to keep the image fresh.

I changed Line 414 in include-astronomy.php from

<img border="0" src="<?php echo $sunURL.$sunImg.'?'.time(); ?>" width="120" height="120"

to

<img border="0" src="<?php echo $sunURL.$sunImg; ?>" width="120" height="120"

And that cleared up the issue.
Title: Re: Is there a wxastronomy update
Post by: Vasco on December 15, 2023, 02:14:17 PM
I have no earthly idea why

Very appropriate choice of words. . .  :grin:
Title: Re: Is there a wxastronomy update
Post by: K6GKM on December 15, 2023, 02:18:05 PM
I have no earthly idea why

Very appropriate choice of words. . .  :grin:

 :cool:
Title: Re: Is there a wxastronomy update
Post by: tigerbait on December 15, 2023, 04:58:39 PM
Thanks Grant, works now. 

Alan


I have no earthly idea why, but for some reason https://umbra.nascom.nasa.gov has started taking issue with the cache-busting URL parameter that the script tacks on to the end of the image link in order to keep the image fresh.

I changed Line 414 in include-astronomy.php from

<img border="0" src="<?php echo $sunURL.$sunImg.'?'.time(); ?>" width="120" height="120"

to

<img border="0" src="<?php echo $sunURL.$sunImg; ?>" width="120" height="120"

And that cleared up the issue.
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on December 22, 2023, 06:48:29 AM
Good Morning or Good Day across the pond,
  I am having a slight moon image issue on my wxastronomy page at:  https://csraweather.info/wxastronomy.php
I have checked my "ajax-images" file both local copy and webserver copy and the moon images are there.  I am sure it pertains to something I did or did not do.  Any help would be appreciated and MERRY CHRISTMAS!
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on December 22, 2023, 09:01:03 AM
Your background image at https://csraweather.info/ajax-images/moon/stars4.gif is missing (404-Not Found).

The specific Moon image (https://csraweather.info/ajax-images/moon/b/NH-moon10.gif) is also 404-Not Found.

I suggest you upload the ./ajax-images/moon/ directory (and subdirectories) to your website again.
Title: Re: Is there a wxastronomy update
Post by: tigerbait on December 22, 2023, 09:39:02 AM
Good morning all,
The Sun spot issue has returned with the change over to the Winter Solstice.  Any ideas?

Happy Holiday's & Merry Christmas,
Alan


I have no earthly idea why, but for some reason https://umbra.nascom.nasa.gov has started taking issue with the cache-busting URL parameter that the script tacks on to the end of the image link in order to keep the image fresh.

I changed Line 414 in include-astronomy.php from

<img border="0" src="<?php echo $sunURL.$sunImg.'?'.time(); ?>" width="120" height="120"

to

<img border="0" src="<?php echo $sunURL.$sunImg; ?>" width="120" height="120"

And that cleared up the issue.
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on December 22, 2023, 09:51:39 AM
Thanks Ken.  I don't know why the ajax-images moon folder was not automatically uploaded.  Thanks for the fix and all you do!  Tigerbait, I am viewing the same sunspot image on your site as well as mine?  Could you clarify your issue?
Title: Re: Is there a wxastronomy update
Post by: tigerbait on December 22, 2023, 09:54:51 AM
I have no image just like you.


Thanks Ken.  I don't know why the ajax-images moon folder was not automatically uploaded.  Thanks for the fix and all you do!  Tigerbait, I am viewing the same sunspot image on your site as well as mine?  Could you clarify your issue?
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on December 22, 2023, 10:02:24 AM
During my new uploads, I noticed a JPGraph 4.4.2 for PHP8.2 compatibility.  Should we update?  Or leave it alone?
Title: Re: Is there a wxastronomy update
Post by: scudwatcher on December 22, 2023, 10:06:35 AM
Tigerbait,
  On both my pages at https://csraweather.org/wxastronomy.php and https://csraweather.info/wxastronomy.php, I am viewing all images.  When I log on to your webpage at https://www.sporttiger.com/wxastronomy.php, I am viewing all images......could it be a cache issue?
Title: Re: Is there a wxastronomy update
Post by: tigerbait on December 22, 2023, 12:14:06 PM
Working now!!


Tigerbait,
  On both my pages at https://csraweather.org/wxastronomy.php and https://csraweather.info/wxastronomy.php, I am viewing all images.  When I log on to your webpage at https://www.sporttiger.com/wxastronomy.php, I am viewing all images......could it be a cache issue?
Title: Re: Is there a wxastronomy update
Post by: hcorrin on January 02, 2024, 05:28:47 PM
for some reason the equinox / solstice values are not seen from the WD testtags.php despite being in it I had to update the second part of the code below to get it to work
Code: [Select]

// seasons dates ... from WD testtags.php
   $dateMarEqu = strtotime( get_localdate($marchequinox)); // March equinox date
   $dateJunSol = strtotime( get_localdate($junesolstice)); // June solstice date
   $dateSepEqu = strtotime( get_localdate($sepequinox)  ); // September equinox date
   $dateDecSol = strtotime( get_localdate($decsolstice) ); // December solstice date

   // if this happens then testtags.php has not been set up !!
   if ($dateMarEqu===false) $dateMarEqu = strtotime("03:07 UTC 20 March 2024");
   if ($dateJunSol===false) $dateJunSol = strtotime("20:52 UTC 20 June 2024");
   if ($dateSepEqu===false) $dateSepEqu = strtotime("12:44 UTC 22 September 2024");
   if ($dateDecSol===false) $dateDecSol = strtotime("09:21 UTC 21 December 2024");
the values I used are the ones in the testtag file had it imported them so although it now works I have no idea why its not seeing the 4 tags the moon tags appear to be seen and update ok
https://www.hc-iom.co.uk/WD-AJAX1/wxastronomy.php
Title: Re: Is there a wxastronomy update
Post by: tigerbait on February 03, 2024, 12:53:01 PM
Hello friends

Can you look at my astronomy page?  The sunposa image is not loading on my end. Any ideas?

https://www.sporttiger.com/wxastronomy.php

Thank you
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on February 03, 2024, 01:01:38 PM
Your sunposa.php is getting two Deprecated errata
Quote
<br />
<b>Deprecated</b>:  Creation of dynamic property LinearTicks::$ticks_label is deprecated in <b>/var/www/vhosts/sporttiger.com/httpdocs/jpgraph-4.4.1/src/jpgraph.php</b> on line <b>4442</b><br />
<br />
<b>Deprecated</b>:  Creation of dynamic property LinearTicks::$ticks_label is deprecated in <b>/var/www/vhosts/sporttiger.com/httpdocs/jpgraph-4.4.1/src/jpgraph.php</b> on line <b>4462</b><br />
which 'disturbs' the PNG image output.
I'd suggest updating to JpGraph-4.4.2 for PHP 8.2 proper operation.
Title: Re: Is there a wxastronomy update
Post by: tigerbait on February 03, 2024, 01:04:30 PM
Thanks Ken. Out of town and will address when home.

Your sunposa.php is getting two Deprecated errata
Quote
<br />
<b>Deprecated</b>:  Creation of dynamic property LinearTicks::$ticks_label is deprecated in <b>/var/www/vhosts/sporttiger.com/httpdocs/jpgraph-4.4.1/src/jpgraph.php</b> on line <b>4442</b><br />
<br />
<b>Deprecated</b>:  Creation of dynamic property LinearTicks::$ticks_label is deprecated in <b>/var/www/vhosts/sporttiger.com/httpdocs/jpgraph-4.4.1/src/jpgraph.php</b> on line <b>4462</b><br />
which 'disturbs' the PNG image output.
I'd suggest updating to JpGraph-4.4.2 for PHP 8.2 proper operation.
Title: Re: Is there a wxastronomy update
Post by: meteosa on February 13, 2024, 05:48:53 AM
hello everyone,
I can't understand why the date doesn't change in the substitution and euinox, in the testtags it's written like this:

$marchequinox = '%marchequinox%'; // March equinox date
$junesolstice = '%junesolstice%'; // June solstice date
$sepequinox = '%sepequinox%'; // September equinox date
$decsolstice = '%decsolstice%'; // December solstice date

is this correct?
Why doesn't the date change?
https://www.meteosantangelo.it/wxspace_new/wxastronomy.php
Thank you
Title: Re: Is there a wxastronomy update
Post by: hcorrin on February 13, 2024, 06:50:12 AM
I had this I just took the values from the testtags.php and changed the dates in the include-wxastromony.php file lines 298 to 320, don't know why the file is not seeing those particular tags as it see the rest ok
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on February 13, 2024, 08:00:57 AM
hello everyone,
I can't understand why the date doesn't change in the substitution and euinox, in the testtags it's written like this:

$marchequinox = '%marchequinox%'; // March equinox date
$junesolstice = '%junesolstice%'; // June solstice date
$sepequinox = '%sepequinox%'; // September equinox date
$decsolstice = '%decsolstice%'; // December solstice date

is this correct?
Why doesn't the date change?
https://www.meteosantangelo.it/wxspace_new/wxastronomy.php
Thank you
In the include-wxastronomy.php there is
Code: [Select]
   // seasons dates ... from WD testtags.php
   $dateMarEqu = strtotime( get_localdate($marchequinox)); // March equinox date
   $dateJunSol = strtotime( get_localdate($junesolstice)); // June solstice date
   $dateSepEqu = strtotime( get_localdate($sepequinox)  ); // September equinox date
   $dateDecSol = strtotime( get_localdate($decsolstice) ); // December solstice date

   // if this happens then testtags.php has not been set up !!
   if ($dateMarEqu===false) $dateMarEqu = strtotime("21:25 UTC March 20 2023");
   if ($dateJunSol===false) $dateJunSol = strtotime("14:58 UTC June 21 2023");
   if ($dateSepEqu===false) $dateSepEqu = strtotime("06:51 UTC September 23 2023");
   if ($dateDecSol===false) $dateDecSol = strtotime("03:28 UTC December 22 2023");
There isn't a testtags.php in the same directory with the Weather-Display uploaded values, so the 2023 values are used instead.
Get Weather-Display to process testtags.txt template and upload testtags.php to the same directory and it should show the correct dates.
Title: Re: Is there a wxastronomy update
Post by: meteosa on February 13, 2024, 09:19:35 AM
I uploaded the testtags to the same directory but it still doesn't work (changing the path in the include-wxastronomy.php file)
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on February 13, 2024, 09:43:03 AM
Your testtags.php (https://www.meteosantangelo.it/wxspace_new/testtags.php?sce=view) seems to be empty .. that link should display the contents but it just shows a null page.
Title: Re: Is there a wxastronomy update
Post by: meteosa on February 14, 2024, 08:23:52 AM
ok, how can I do it? Thank you
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on February 14, 2024, 09:34:21 AM
Use https://saratoga-weather.org/wxtemplates/setup-WD.php for how to configure Weather-Display.
Use the attached as the testtags.txt template file that WD will process to generate and upload testtags.php
Title: Re: Is there a wxastronomy update
Post by: meteosa on February 14, 2024, 12:40:04 PM
ok,
Maybe I had an old testtags file that wasn't working properly, loaded now you can see it but the seasons aren't updating, why?
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on February 14, 2024, 01:46:22 PM
Two reasons:
1) the dates in testtags.php are in Italian, not English
Code: [Select]
$marchequinox =  '03:07 UTC 20 marzo 2024'; // March equinox date
$junesolstice =  '20:52 UTC 20 giugno 2024'; // June solstice date
$sepequinox =  '12:44 UTC 22 settembre 2024'; // September equinox date
$decsolstice =  '09:21 UTC 21 dicembre 2024'; // December solstice date
2) you're operating the script 'standalone' (that is, outside the Saratoga template set), so the translation functions are not present to convert Italian to English for PHP, then back to Italian).

You can use WD, Setup, Language, Use English for Web reports, Yes  to force WD to use English in testtags.php.

Keep in mind, that without the Saratoga template infrastructure, the dates in your wxastronomy.php page will show only in English if month name displays are selected.  Wouldn't be an issue if you select dd/mm/yyyy as the format.
Title: Re: Is there a wxastronomy update
Post by: meteosa on February 14, 2024, 03:35:40 PM
ok, I did everything as you told me but it still doesn't work and the language in the testags doesn't change, now I brought everything to the saratoga folder, but nothing
https://www.meteosantangelo.it/dash/wxastronomy1.php
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on February 14, 2024, 04:16:17 PM
The testtags.php at https://www.meteosantangelo.it/dash/testtags.php?sce=view still shows Italian dates
Code: [Select]
$marchequinox =  '03:07 UTC 20 marzo 2024'; // March equinox date
$junesolstice =  '20:52 UTC 20 giugno 2024'; // June solstice date
$sepequinox =  '12:44 UTC 22 settembre 2024'; // September equinox date
$decsolstice =  '09:21 UTC 21 dicembre 2024'; // December solstice date
The template page https://www.meteosantangelo.it/dash/wxastronomy.php does show correctly with the dates as the Italian-English-Italian translation is working.  The issue is that include-wxastronomy.php doesn't include the functions used in wxastronomy.php to do that translation (I didn't write the include-wxastronomy.php page).

In my wxastronomy.php page, it uses
Code: [Select]
<?php echo get_localdate($marchequinox); ?><br/>
  <small><?php echo get_utcdate($marchequinox); ?></small>
to process the dates for display.
Those functions are
Code: [Select]
function get_localdate ( $indate) {
  global $SITE;
  $EnglishMonths = array(
   'January','February','March','April','May','June',
   'July','August','September','October','November','December');
   
// Change '02:33 UTC 4 September 2007' to
//        specified date by 
  $timeFormat = 'D, d-M-Y h:ia T';  // Fri, 31-Mar-2006 14:03 TZone
//  $timeFormat = 'h:ia T D, d-M-Y ';  // Fri, 31-Mar-2006 14:03 TZone
  if(isset($SITE['timeFormat'])) { $timeFormat = $SITE['timeFormat']; }
 
  $utcstr = substr($indate,10) . " " . substr($indate,0,9); // move formats
  echo "<!-- input utcstr='$utcstr' -->\n";

 // input dates are assumed to be in English only
 if (isset($SITE['monthNames'])) {
    // convert TO English for strtotime()
    echo "<!-- before utcstr='$utcstr' -->\n";
foreach ($EnglishMonths as $i => $monthEN) {
#    $utcstr = preg_replace('|'.$SITE['monthNames'][$i].'|i',$monthEN,$utcstr);
   $utcstr = str_ireplace($SITE['monthNames'][$i],$monthEN,$utcstr);

    echo "<!-- after utcstr='$utcstr' -->\n";
  }

  $utc = strtotime($utcstr);
  $lclstr = date($timeFormat,$utc);
  if (isset($SITE['langMonths'])) {
    // convert From English for return (will only work if long-format month names in $timeFormat) 
    echo "<!-- before lclstr='$lclstr' -->\n";
foreach ($EnglishMonths as $i => $monthEN) {
#    $lclstr = preg_replace('|'.$monthEN.'|i',$SITE['langMonths'][$i],$lclstr);
   $lclstr = str_ireplace($monthEN,$SITE['langMonths'][$i],$lclstr);

    echo "<!-- after lclstr='$lclstr' -->\n";
  }
  return ($lclstr);
}
and
Code: [Select]
# perform two-way translation on UTC String from WD  for astronomical dates
#  first, change from WD UTC date format (possibly in non-English) to English
#  second, change from English to targeted language (possibly leave in English)

function get_utcdate ( $indate ) {
  global $SITE, $sourceMonths;
  $EnglishMonths = array(
   'January','February','March','April','May','June',
   'July','August','September','October','November','December');

  $utcstr = substr($indate,10) . " " . substr($indate,0,9); // move formats

  if (isset($SITE['monthNames'])) {
    // convert TO English for strtotime()
    echo "<!-- before utcstr='$utcstr' -->\n";
foreach ($EnglishMonths as $i => $monthEN) {
#    $utcstr = preg_replace('|'.$SITE['monthNames'][$i].'|i',$monthEN,$utcstr);
   $utcstr = str_ireplace($SITE['monthNames'][$i],$monthEN,$utcstr);

    echo "<!-- after utcstr='$utcstr' -->\n";
  }
    $lclstr = $utcstr;

    if (isset($SITE['langMonths'])) {
    // convert From English for return (will only work if long-format month names in $timeFormat) 
    echo "<!-- before lclstr='$lclstr' -->\n";
foreach ($EnglishMonths as $i => $monthEN) {
#    $lclstr = preg_replace('|'.$monthEN.'|i',$SITE['langMonths'][$i],$lclstr);
   $lclstr = str_ireplace($monthEN,$SITE['langMonths'][$i],$lclstr);

    echo "<!-- after lclstr='$lclstr' -->\n";
  }
  return ($lclstr);

}
Those would have to be used in include-wxastronomy.php to get the language correct when starting with non-English month names.
Title: Re: Is there a wxastronomy update
Post by: saratogaWX on February 14, 2024, 08:50:05 PM
An add-on note:

Using WD, Setup, Language, Use English for Web reports, Yes forces all the WD 'boilerplate' text in uploaded files to be English (as required by wxreports.php for translations in the Base-World/Base-Canada pages).

The dates in the date/time stamps will use the Language preference of the system that WD runs on.  Since you're likely running with a locale of Italy on the operating system, that is what WD uses to format dates with month names in it (like the moon and season dates).
Title: Re: Is there a wxastronomy update
Post by: Scobey on February 15, 2024, 03:58:54 AM
I've read this entire post but I don't see the solution to my problem;

"Date must be before Mon, 13 Nov 2023 00:27:00 -0900"

Thanks!

http://scoblic.net/wd/wxindex.php
Title: Re: Is there a wxastronomy update
Post by: hcorrin on February 15, 2024, 04:20:12 AM
Try the download in reply 135 in this thread
Title: Re: Is there a wxastronomy update
Post by: meteosa on February 15, 2024, 07:37:29 AM
An add-on note:

Using WD, Setup, Language, Use English for Web reports, Yes forces all the WD 'boilerplate' text in uploaded files to be English (as required by wxreports.php for translations in the Base-World/Base-Canada pages).

The dates in the date/time stamps will use the Language preference of the system that WD runs on.  Since you're likely running with a locale of Italy on the operating system, that is what WD uses to format dates with month names in it (like the moon and season dates).

so I can't do anything? I can't understand, sorry.
Isn't there a way to make the seasons update automatically?
Sorry, the page is this: https://www.meteosantangelo.it/dash/wxastronomy1.php