Barand Posted March 19, 2013 Share Posted March 19, 2013 OK - I wasn't sure whether or not you wanted it. The attached zip contains three files moonpic100.gd2 - originally a 100 x 100 jpeg of the moon but cleaned up to ensure background is completely black. Saved as a gd2 for faster loading. This used as my base moon image. moon.php - php image file which uses data returned from the moonPhase class and scales and blanks out the parts of the base image according to the phase and illumination values. This file takes an optional single query string parameter (date). moonSample.php - demo program to display lunar calendar for a month (?month=N in query string). Defaults to current month. moon.zip Quote Link to comment https://forums.phpfreaks.com/topic/275717-how-to-show-a-different-image-or-percentage-of-the-moon-based-upon-the-phrase/page/2/#findComment-1419452 Share on other sites More sharing options...
MrTIMarshall Posted March 19, 2013 Author Share Posted March 19, 2013 I have not yet downloaded your .zip as I plan to do so when I am more refreshed tomorrow, however I am wondering if the image background needs to be black to show the phrase or can it be transparent to be used on a sky for example? Thank you for uploading the files. Best Regards, Tim Quote Link to comment https://forums.phpfreaks.com/topic/275717-how-to-show-a-different-image-or-percentage-of-the-moon-based-upon-the-phrase/page/2/#findComment-1419456 Share on other sites More sharing options...
Barand Posted March 19, 2013 Share Posted March 19, 2013 At the moment it needs to be on a dark background - there's still a dark fringe around the moon on a light background. All I have is Windows paint program, no photoshop, so image creation/manipulation not easy. What I need if is a bright circular image of the moon (100pix diameter) inside a black 100 pix square. Unwanted areas of the moon are then blacked out and black set to transparent colour. Quote Link to comment https://forums.phpfreaks.com/topic/275717-how-to-show-a-different-image-or-percentage-of-the-moon-based-upon-the-phrase/page/2/#findComment-1419466 Share on other sites More sharing options...
MrTIMarshall Posted March 20, 2013 Author Share Posted March 20, 2013 I'll try and create that for you and upload it soon. Quote Link to comment https://forums.phpfreaks.com/topic/275717-how-to-show-a-different-image-or-percentage-of-the-moon-based-upon-the-phrase/page/2/#findComment-1419717 Share on other sites More sharing options...
MrTIMarshall Posted March 20, 2013 Author Share Posted March 20, 2013 Hopefully this image I just made is what your looking for? Best Regards, Tim Quote Link to comment https://forums.phpfreaks.com/topic/275717-how-to-show-a-different-image-or-percentage-of-the-moon-based-upon-the-phrase/page/2/#findComment-1419724 Share on other sites More sharing options...
Barand Posted March 20, 2013 Share Posted March 20, 2013 Thanks, I'll give it a go Quote Link to comment https://forums.phpfreaks.com/topic/275717-how-to-show-a-different-image-or-percentage-of-the-moon-based-upon-the-phrase/page/2/#findComment-1419725 Share on other sites More sharing options...
MrTIMarshall Posted March 21, 2013 Author Share Posted March 21, 2013 Have you had any luck Barand? Quote Link to comment https://forums.phpfreaks.com/topic/275717-how-to-show-a-different-image-or-percentage-of-the-moon-based-upon-the-phrase/page/2/#findComment-1419979 Share on other sites More sharing options...
Barand Posted March 21, 2013 Share Posted March 21, 2013 No luck, just sheer skill . I sent you a couple of PMs yesterday. moon (2).zip Quote Link to comment https://forums.phpfreaks.com/topic/275717-how-to-show-a-different-image-or-percentage-of-the-moon-based-upon-the-phrase/page/2/#findComment-1420103 Share on other sites More sharing options...
Zaaka Posted January 16, 2014 Share Posted January 16, 2014 Hello Barand, I have been trying to use this script to show the moon phases but I just keep getting broken image links, could you assist? Quote Link to comment https://forums.phpfreaks.com/topic/275717-how-to-show-a-different-image-or-percentage-of-the-moon-based-upon-the-phrase/page/2/#findComment-1465449 Share on other sites More sharing options...
Barand Posted January 16, 2014 Share Posted January 16, 2014 (edited) As well as the three files in that zip it also requires moonphase .php which does the hard work calculating the data needed to draw the images. I didn't include it in the zip as the guy who started that topic already had it. I've attached it here. moon.php draws a single image (using moonpic100.gd2 as base image) based on the date passed in the url or today if no date passed. moonsample.php calls moon.php to draw the moon for each day of the current month. moonphase.php Edited January 16, 2014 by Barand Quote Link to comment https://forums.phpfreaks.com/topic/275717-how-to-show-a-different-image-or-percentage-of-the-moon-based-upon-the-phrase/page/2/#findComment-1465458 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.