Author Topic: New Moon Phase Images for WB2_2b  (Read 772 times)

Offline Andy9164

  • Full Member
  • ***
  • Posts: 73
    • Midlifedad
New Moon Phase Images for WB2_2b
« on: July 27, 2017, 12:15:34 PM »
Hi everyone,

I have created some detailed moon images for use on WB2_2b template. It may work on others but I have only tested it on the above but if you know how to adjust those templates then they could work for you. It will ONLY work on php templates. There are 200+ images which show the moon in every visible percentage and it uses the $moonphase and $MoonPercentAbs to select the correct image so you get a very accurate view of the visible moon.

I have uploaded a demo to although this image wont change or you can see the idea fully working / changing version on my website at

To install is very simple. Download the attached zip folder, unzip and place the unzipped "moon" folder which contains the images in your style folder. (There should already be a folder in there called "forecast".)

Then using a text editor edit the index.php file in your main directory as follows:

Look for this piece of code:

div class="pan night" style="margin-bottom:5px;">
                  <h2><?php echo $Tr_moonphase; ?></h2>
                  <img src="images/moon.bmp" style="padding: 50px 0px 52px 120px" alt="Forecast icon" title="Forecast icon" />
                  <p style="text-align:center">Phase : <strong><?php echo $moonphase; ?></strong><br />
                  <?php echo $Tr_MoonPercent; ?> <strong><?php echo $MoonPercentAbs; ?>%</strong></p>

Change the line in red above to the following:

<img src="style/moon/<?php echo $moonphase. ' ' .$MoonPercentAbs; ?>.png" style="padding: 33px 0px 25px 50px" />

Any questions or problems then reply back in the forum.

I will soon be posting a second set of images which are "cartoon like" but work on the same principle.

Hope you enjoy.


Offline Andy9164

  • Full Member
  • ***
  • Posts: 73
    • Midlifedad
Re: New Moon Phase Images for WB2_2b
« Reply #1 on: July 28, 2017, 05:49:22 AM »
Adding a second set of moon images.

Follow instructions above to use making sure the unzipped folder is renamed to moon.

If you have already uploaded and are using the first set then I suggest you rename your style/moon folder to style/old_moon and then unzip the attached file, rename the folder to moon and upload into your style folder.

These images are 110px x 110px if you need a smaller version then let me know what size and I can use a batch file in Photoshop to make them smaller quite easily. Not too many requests though  ;)

If you do use a smaller size then you will need to adjust the "padding" in the above code to get them to work.

Looking at other Weather By You templates that use php I think they will work in the same way although the images will need to be made smaller and the "padding" changed to get things looking nice. Happy to help if you need it.

Comments and questions welcome.