WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started 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
-
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+
-
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 ]
-
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.
-
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
-
It looks like your testtags.txt template in c:\wdisplay\webfiles is missing some variables.
You can either change testtags.txt there from $chinesenewyear = '%chinesenewyear%'; // Chinese new year
$hoursofpossibledaylight = '%hoursofpossibledaylight%'; // Total hours/minutes of possible daylight for today
to $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
-
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)
-
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
-
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 $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 $jploc = './jpgraph-4.4.0/'; // relative location of jpgraph library
to the relative location of the jpgraph library you installed.
-
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.
-
That's correct. He customized my edited version. I'm just throwing it out there should anyone wish to use it.
-
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?
-
I have not tried it with Cumulus MX as I am an old, stubborn man and have yet to admit the need for change ](*,)
-
I am going to try Ken's fixes first but is that all I need is to use the "Include" file?
-
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.
-
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?
-
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!
-
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.
-
Replacing jpgraph in the same directory is just fine. You do need to change sunposa.php 'jpgraph-4.4.0' entry in
$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
-
Will do! Thanks!
-
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.
-
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):
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 define('TTF_DIR',$_SERVER['DOCUMENT_ROOT'].'/jpgraph/src/fonts/');
-
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/');
-
No need for more changes.. jpgraph is working fine now.
-
Ok, I did just check and both of those line were commented out already.
thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
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
-
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.
-
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.
-
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.
-
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
-
You can see the error now by running https://www.westland-depoel.nl/vantagevue/ws/sunposa.php?force=1
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 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.
-
Here's another update with improved diagnostics (?debug=y now shows state of allow_url_fopen)
-
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.
-
ooh you replied when I was posting.
Will download that file.
-
[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).
-
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 $SITE['dateOnlyFormat'] = 'd M Y';
to $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.
-
And.. you're missing one (or more files). sunposa.php?force=1 is showing
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)
-
Working now, path to moon images was wrong. :oops:
-
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
-
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.
-
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
-
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
-
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
-
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
-
You’re missing the semicolon at the line ending.
$SITE['latitude' ] = 47.462625
should be $SITE['latitude' ] = 47.462625;
-
Thanks Ken for the assistance. It works now.
Chuck
-
Hi,
I have always had a problem with the moontransit time showing.
I have edited this code
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
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
-
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
-
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 ]
<?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&up_clouds=1&up_proj=mercator&synd=open&w=800&h=443&title=World+Sunlight+Map&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js" type="text/javascript">
</script>
<script src="http://www.gmodules.com/ig/ifr?url=http://static.die.net/earth/gadget.xml&up_clouds=1&up_proj=hemisphere&synd=open&w=800&h=387&title=World+Sunlight+Map&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js" type="text/javascript"></script>
<script src="http://www.gmodules.com/ig/ifr?url=http://static.die.net/moon/gadget.xml&up_size=large&up_info=1&up_date=0&synd=open&w=350&h=364&title=Moon+Phase&border=%23ffffff%7C3px%2C1px+solid+%23999999&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('Current Day / Night Map')); ?></big></b><br />
<img src="<?php echo $daynightURL.$daynightImg; ?>" width="656" height="328" border="0" alt="Day / Night Map">
</td></tr>
</table>
-->
<?php }
Chuck
-
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.
-
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
$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.
-
i wonder if it's a translation issue
to test as soon as the testtags.php is created edit the
$marchequinox = '15:34 UTC 20 maart 2022'; // March equinox date
to
$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
-
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 :)
-
The server for the sun stuff appears to be down ie sunspot image and sun moon graphic
-
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.
-
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)
-
I can't get the sunposa.php to work I get this error.
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.
-
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
-
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 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)?
-
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.
-
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
-
Looking at Settings.php shows
$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 $SITE['longitude'] = '-17.194'; //East=positive, West=negative decimal degrees
and see if that helps.
Also, the first lines in Settings.php $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 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.
-
I've made those corrections and now have a black page with a white square in the middle!
I'm getting there slowly.
Thanks
-
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 ]
-
Here is a copy of my settings for sunposa.php.
#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
-
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....
-
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.
-
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!
-
Here is my wxastronomy page. Hopefully it will help.
Chuck
-
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:
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 $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.
-
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!
-
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!!
-
The moon images should be located in the Ajax-images folder in you WD-Ajax directory
-
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?
-
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!
-
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
-
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.
-
Will this work?
-
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.
<?php include("include-wxastronomy.php"); ?>
Can you also post up your include_wxastronomy.php?
-
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!
-
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
-
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
-
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
-
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
-
Cache issue cleared & working great.
Thanks to everyone for all the help.
Laissez les bon temps rouler
Alan
-
Thanks Ken, and everyone else who upgraded before me. My upgrade went without a hitch!
https://www.bismarckweather.net/wxastronomy.php
-
Trying to setup sunposa.php, but I don't know how to get or setup jpgraph V4.4.0. Thanks Joe
-
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!
-
also worth reading this https://www.wxforum.net/index.php?topic=45059.0
-
I have 30 moon old where can I find the new ones. or can I just rename them?
-
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 ]
-
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!
-
How do I unzip Jpgraph_4.4.1.tar.gz or do I have the wrong file?
-
I used the 7 Zip program from the Microsoft Store.
-
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)
-
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 ]
-
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
-
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
-
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
-
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!
-
Thanks I have it on the desktop. I will down load and start over I will make folder then unzip to folder. thanks again
-
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 ]
-
Gentlemen,
I believe I figured it out! It's beer-thirty as well! SOLVED! Thank You for all your help!
-
just for info i have mine set for every 2 hours
-
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)
-
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,
-
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.
-
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.
-
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.
-
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
-
Your sunposa.php returns
<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.
-
Ken,
Wow you are fast. That was the problem.
Thank you for all your help.
Tom
-
[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.
-
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.
-
I had the same problem, go to google and update Windows fonts and follow how to install fonts.
-
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.?
-
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,
Forgive me for my delayed response....have you resolved the font issue?
-
what version of jpgraphs? I have Jpgraphs4.4.1 and it works.
-
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.
-
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!
-
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)
-
Yeah, I noticed that too!
-
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.
-
I checked mine yesterday after the above post. Mine is showing Summer as well.
https://www.bismarckweather.net/wxastronomy.php
-
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
-
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.
-
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!
-
Have you setup lines 69 and 70 as they are to do with moondeatail
-
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!
-
Where are your editing that width? In the include?
-
Yes, I was going to start with include-wxastronomy.php first....but, not really sure....
-
A distinct possibility is they are in an image file somewhere?
-
Where are your editing that width? In the include?
in the include-astronomy.php
Line 648
Change imgsize=700 to 380
-
Thanks, Alan!
-
I fixed a couple of issues (wrong season showing, moon data to 2030 instead of ending at 2023) with V1.11 (attached)
-
Thanks, Ken!
-
Ken,
That version 1.11 changed my season back to summer.
You can see at https://www.shermanctweather.org/mb/wxastronomy.php
Tom
-
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 $SITE['WXtags'] = '../meteo/testtags.php';
I do see you've changed include-wxastronomy.php to if ((include_once "../meteo/testtags.php") == 0)
so that should be working correctly to get the data. Your testtags.php does have $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:
-
Thanks Ken for looking.
It did work with Version 20221230 so I will look at that to see what is different.
Thanks,
Tom
-
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
-
Thank you Ken!! I added the Current Sunlight maps back
-
Ken,
I just replaced the section SETUP CURRENT SEASON with
case ($date< $JunSol ): $currentSeason = $SITE['latitude' ]<0 ? 'Autumn' : 'Spring'; break;
with
case ($date< $dateJunSol): $currentSeason = $SITE['latitude' ]<0 ? 'Autumn' : 'Spring'; break;
and case ($date< $DecSol ): $currentSeason = $SITE['latitude' ]<0 ? 'Spring' : 'Autumn'; break;
with
case ($date< $dateDecSol): $currentSeason = $SITE['latitude' ]<0 ? 'Spring' : 'Autumn'; break;
It is working now.
Thanks,
Tom
-
So just an opinion. Are the Sunlight maps to much?
https://www.sporttiger.com/wxastronomy.php (https://www.sporttiger.com/wxastronomy.php)
-
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
-
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 Warning: Undefined variable $moontransittime in /home/goblesweather/www/www/include-wxastronomy.php on line 269
$moontransittime should be in your testtags.txt template:
$moontransittime = '%moontransittime%'; // Moon transit time
$moontransit = '%moontransit%'; // Moon transit date time
-
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.
$moontransittime = '%moontransittime%'; // Moon transit time
$moontransit = '%moontransit%'; // Moon transit date time
-
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';
-
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 // 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 // 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.
-
Fixed. Thanks Ken.
-
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
-
Same Here....as of 1153 Hours EDT....occurred at 1458Z
-
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
-
Yes, running current version 1.11 - 07-May-2023.......
-
Mine flipped over fine.
-
I’m running 1.11 May 7th also
-
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
-
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
-
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
-
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
-
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!
-
I'm glad that it worked. All the times I got help from here I'm glad I could return the favor. \:D/
Tom
-
That worked for me also, it flipped over to Summer.
But I am have this warning now.
"Warning: Undefined variable $dateJunSolstice in" (Line 340)
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.
-
I did the same edit and received the same warning! Remove “STICE” from both $dateJunSolstice and $dateDecSolstice and that should work.
-
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.
-
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 ]
-
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?
-
You can copy NH-moon00.gif to the missing NH-moon28.gif
Or you can change sunposa.php if ($age>28) { $age=28; }
to if ($age>27) { $age=27; }
-
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.
-
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)
-
Mine seems to be working.
https://www.bismarckweather.net/wxastronomy.php
-
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
-
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.
-
I have no earthly idea why
Very appropriate choice of words. . . :grin:
-
I have no earthly idea why
Very appropriate choice of words. . . :grin:
:cool:
-
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.
-
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!
-
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.
-
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.
-
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?
-
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?
-
During my new uploads, I noticed a JPGraph 4.4.2 for PHP8.2 compatibility. Should we update? Or leave it alone?
-
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?
-
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?
-
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
// 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
-
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
-
Your sunposa.php is getting two Deprecated errata
<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.
-
Thanks Ken. Out of town and will address when home.
Your sunposa.php is getting two Deprecated errata <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.
-
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
-
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
-
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 // 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.
-
I uploaded the testtags to the same directory but it still doesn't work (changing the path in the include-wxastronomy.php file)
-
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.
-
ok, how can I do it? Thank you
-
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
-
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?
-
Two reasons:
1) the dates in testtags.php are in Italian, not English
$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.
-
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
-
The testtags.php at https://www.meteosantangelo.it/dash/testtags.php?sce=view still shows Italian dates
$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 <?php echo get_localdate($marchequinox); ?><br/>
<small><?php echo get_utcdate($marchequinox); ?></small>
to process the dates for display.
Those functions are 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 # 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.
-
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).
-
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
-
Try the download in reply 135 in this thread
-
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