I downloaded tman1991’s ‘sunposa.php’ script with ‘?sce=view’, and using ‘Compare It!’ found NO significant differences other than localization information between his code and mine. It’s part of his ‘wxastronomy.php’ package discussed in this thread.
Thanks, Ken! Is there anything we can to do about it? I just tried to load it from the computer on my DSL IP address and got the same problem, so it looks like a maybe it’s a server problem responding to queries outside a certain IP address range?
This problem was identified before I think in a thread that was lost in the server crash so it has been going on a while (someone said access had been restricted especially to those outside the US) and it would cause my graph not to show. I changed to use WD’s moonicon which doesn’t show the dark part of the moon when made transparent but loads instantly on the graph.
I’ve put a band-aid on it by using my pre-existing ‘/ajax-images/moon/w/NH-moon’ gif’s and selecting the proper moon age by using ‘/Solaris/moonage.php’. You can get the code by using ‘?sce=view’ and the Solaris moonage.php is available at Github.
The white moon gif’s already have a transparent background, so resizing, converting to png, and saving the image is all that is needed. The need for resizing is questionable since my images are already 50x50px. These images are from Bashewa Weather, and just to be safe I added age 28 and age 29 images by copying 27 and 0, then renaming them.
#-o I thought I would take the route less traveled. I thought about the %moonage% tag, but wanted the extra challenge of calculating it on the fly. (Yeah, right.)
The ‘moontest.php’ script was also broken in two places by using ‘(($age<9&&!strpos($age,‘0’))?‘0’.$age:$age)’ in two places rather than ‘(($age<10&&!strpos($age,‘0’))?‘0’.$age:$age)’. The corrected script can now be downloaded in this post above.
There is one further problem with the ‘sunposa.php’ and the ‘moontest.php’ I posted. I was unaware that the number of the ‘/ajax-images/moon’ gif’s was two days behind the moon age. This became apparent during the current waning of the moon as the crescent on my ‘sunposa.php’ graph was noticeably smaller than that displayed on my Astronomy Page and in Weather Display’s ‘moondetail1.gif’. The code of these scripts should now be correct and the moon crescent on the Astronomy Page, WeatherDisplay’s ‘moondetail1.gif’, and ‘sunposa.php’ graphic are identical.
Because the moon image for ‘sunposa.php’ is cached daily as ‘jpmoon.png’ unless you delete this image from your site the new code won’t take effect until tomorrow. After deletion on my site I had to reload my Astronomy Page twice before the new image and sunposa graphic appeared.
I’m trying to change my page to reflect your changes, but so far my images aren’t transparent and the age is wrong. I guess I’m not sure where the moontest script is inserted. Thanks in advance.
jp http://www.jolietwx.com/sunposa.php
I’m sorry if I confused you with my ‘test’ script. It does nothing but verify that you’ve set up the /Solaris/moonphase.php properly. The transparency issue was mentioned by the ‘heavens.php’ authors, and I’m not sure why that is. The moon phase on your ‘sunposa.php’ graphic is also incorrect, so you need to keep working on it.
There’s something on your site that’s got ‘moontest.php’ hung up and therefore ‘sunposa.php’ is displaying an incorrect moon image. I can’t get any output from ‘moontest.php’ nor can I display the script with ‘moontest.php?sce=view’. Be sure you have the ‘/Solaris/moonphase.php’ script in place and properly referenced. Sometimes web hosts are fussy about whether or not to use ‘./’ in local directory references, and you might try modifying those in ‘moontest.php’.
If that doesn’t work, it may have to do with ‘.htaccess’ or ‘php.ini’ permissions, but you’ll need to sort it out with your web host’s tech gurus. Sorry I can’t be more helpful.
If you do resolve the problem, please share the details with us. Thanks!
Working now, with the Original sunposa.php I never got the moon to appear.
Only problem now is that I am using the black moon images and these are not transparent.
Does anyone know how one can make these gif’s with black background transparent in an easy way, like in photoshop.
Use the white moon images? Once they’re rendered transparent it shouldn’t make much difference, although I understand that there’s a chance of a small white border remaining.