Installing the Saratoga template in a subdirectory

A post about today’s solar eclipse got me wondering why I didn’t get that info on my wxastronomy.php page, so I looked at the code. And then the penny dropped: Ken’s notes say that as distributed it is expected that the template files are located in the root directory, so you may be required to make additional undocumented changes if you install in a subdirectory - as I did.

So, lines 278-83 need to specify the path to WD’s moondetail1.gif and moondetail2.gif. In my case they are in the root:

<?php if(file_exists("../moondetail1.gif")) { ?>
<img src="../moondetail1.gif" alt="Moon Details from Weather-Display" style="border: white 1px solid" /><br/><br/>
<?php }
      if(file_exists("../moondetail2.gif")) { ?>
<img src="../moondetail2.gif" alt="Additional Moon facts from Weather-Display"  style="border: white 1px solid"/>
<?php } ?>

I wonder how many others I have yet to find :slightly_frowning_face:

According to Agent Ransack, there are no more in my setup :wink:

Also change ajaxWDwx.js to have the clientraw.txt file be /clientraw.txt if it is also in your document root directory. :grinning:

Yes, I found that one early on :grinning:

Further up (line 140). . .

<td width="50%" align="center"> <?php if(file_exists('moonicon.gif')) { ?> <img src="moonicon.gif" width="104" height="72" alt="<?php print $moonage; ?>" title="<?php print $moonage; ?>"/></td>

For moonicon.gif read ../moonicon.gif . . . I’ve only just found it :roll_eyes:

P.S. Current moonicon gif seems to be 83 x 72 px, not 104 x 72?

P.P.S. for title $moonage is best replaced by:

str_replace(",",", ",$moonage)