Author Topic: Resurrecting a Weather Site  (Read 1789 times)

0 Members and 1 Guest are viewing this topic.

Offline Lucht

  • Member
  • *
  • Posts: 30
Resurrecting a Weather Site
« on: July 07, 2017, 03:06:15 PM »
I may have mentioned sometime earlier that I'm in the process of resurrecting my weather site which, due to health problems, had been offline/non-existent for over a year.

So far, most things I've been able to figure out on my own and, thanks to inspiration from a number of members sites, have started to add the odd new feature.

However, there are a few things which I have no clue whatsoever how to do.... and so am turning to the great members of this forum for help.

The first up is Space Weather script, which quite a few people use. I have the script up and running, thanks to a kind person, but I've seen on a number of sites how it's presentation can be improved. A good example is Saratoga-Weather's space weather page at http://saratoga-weather.org/space-weather.php where some of the data is presented in neat tables. I have no clue how to do this and am looking for help please.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Resurrecting a Weather Site
« Reply #1 on: July 07, 2017, 05:19:33 PM »
Martin (budgie) had released an update to Mike Challis' space weather with some URL changes for sites.  I updated the wxspace.php page in the attached to have the table-display mod that I use on my site.

If you haven't used the space-weather for a bit, just unzip and upload ALL the files to your site.  Several of the image-*.php files had URL changes also.


Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Lucht

  • Member
  • *
  • Posts: 30
Re: Resurrecting a Weather Site
« Reply #2 on: July 07, 2017, 05:26:30 PM »
Very many thanks, Ken. I'll give that a try.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Resurrecting a Weather Site
« Reply #3 on: July 07, 2017, 06:54:10 PM »
Don't forget you friend:  check-fetch-times.php?show=versions to see what you might need to update.

If it doesn't show an update list, then download https://saratoga-weather.org/wxtemplates/Test/check-fetch-times.php?sce=view and upload to your site to do the check.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Lucht

  • Member
  • *
  • Posts: 30
Re: Resurrecting a Weather Site
« Reply #4 on: July 07, 2017, 07:08:37 PM »
Don't forget you friend:  check-fetch-times.php?show=versions to see what you might need to update.

If it doesn't show an update list, then download https://saratoga-weather.org/wxtemplates/Test/check-fetch-times.php?sce=view and upload to your site to do the check.

That was the first thing I did when starting to resurrect  :-) And your space weather files have worked beautifully! Very much appreciated.

Offline Lucht

  • Member
  • *
  • Posts: 30
Re: Resurrecting a Weather Site
« Reply #5 on: July 07, 2017, 07:13:37 PM »
Next up is something that is puzzling me: on http://www.test.sanctuaryweather.info/seasons.php , the moon icon is definitely not right. It appears to be referencing moonicon.gif in the main folder, rather than the one in ajax-images as the sun icon is. Not only that, but the amount of illumination the icon is showing is wrong?

Many thanks in advance for any help.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Resurrecting a Weather Site
« Reply #6 on: July 07, 2017, 10:02:02 PM »
With the Weather-Display plugin, the template uses only the stuff included in testtags.php for astronomical data, including the WD-produced moonicon.gif graphic via this code
Code: [Select]
    <?php if(file_exists('moonicon.gif')) { ?>
    <img src="moonicon.gif" width="104" height="72"
  alt="<?php print $moonage?>" title="<?php print $moonage?>"/></td>
     <?php } else { // ?>
    <img src="<?php echo $imagesDir 'moon' $moonagedays?>.gif" width="72" height="72"
  alt="<?php print $moonage?>" title="<?php print $moonage?>"/></td>
     <?php ?>
If you want to FORCE it to use the images from ajax-images/ instead, just change
Code: [Select]
    <?php if(file_exists('moonicon.gif')) { ?> to
Code: [Select]
    <?php if(false and file_exists('moonicon.gif')) { ?> and the ajax-images/ moon display will result and WD's moonicon.gif will be ignored.

The illumination % is determined by WD.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Lucht

  • Member
  • *
  • Posts: 30
Re: Resurrecting a Weather Site
« Reply #7 on: July 07, 2017, 11:16:26 PM »
With the Weather-Display plugin, the template uses only the stuff included in testtags.php for astronomical data, including the WD-produced moonicon.gif graphic via this code
Code: [Select]
    <?php if(file_exists('moonicon.gif')) { ?>
    <img src="moonicon.gif" width="104" height="72"
  alt="<?php print $moonage?>" title="<?php print $moonage?>"/></td>
     <?php } else { // ?>
    <img src="<?php echo $imagesDir 'moon' $moonagedays?>.gif" width="72" height="72"
  alt="<?php print $moonage?>" title="<?php print $moonage?>"/></td>
     <?php ?>
If you want to FORCE it to use the images from ajax-images/ instead, just change
Code: [Select]
    <?php if(file_exists('moonicon.gif')) { ?> to
Code: [Select]
    <?php if(false and file_exists('moonicon.gif')) { ?> and the ajax-images/ moon display will result and WD's moonicon.gif will be ignored.

The illumination % is determined by WD.

And all is now as it should be. Again, my thanks to you. So how would I get it to pull the sun and moon images direct from NASA and USNO?
« Last Edit: July 07, 2017, 11:20:50 PM by Lucht »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Resurrecting a Weather Site
« Reply #8 on: July 07, 2017, 11:49:07 PM »
You could replace the 'stock' code of
Code: [Select]
  <tr>
    <td width="50%" align="center">
    <img src="<?php print $SITE['imagesDir']; ?>sunicon.jpg" width="104" height="72" alt="<?php langtrans('Sun'); ?>" style="border: 0;"/></td>
    <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>
     <?php } else { // ?>
    <img src="<?php echo $imagesDir 'moon' $moonagedays?>.gif" width="72" height="72"
  alt="<?php print $moonage?>" title="<?php print $moonage?>"/></td>
     <?php ?>
  </tr>
with what I use on my sunmoon.php page on my site
Code: [Select]
  <tr>
    <td align="center"><a href="http://umbra.nascom.nasa.gov/eit/images/latest_eit_304.gif"
title="Click for larger picture">NASA Sun Image</a><br/>
    <img src="https://umbra.nascom.nasa.gov/images/latest_eit_304_thumbnail.gif" width="100" height="100"
    alt="Today's Sun image from NASA Goddard Space Flight Center"
    title="Today's Sun image from NASA Goddard Space Flight Center"  />
</td>
    <td align="center"><a href="http://aa.usno.navy.mil/data/docs/RS_OneDay.html"
title="Click for details">USNO Moon Image</a><br/>
    <img src="http://tycho.usno.navy.mil/cgi-bin/phase.gif" width="100" height="100"
    alt="Today's Moon illumination from U.S. Naval Observatory"
    title="Today's Moon illumination from U.S. Naval Observatory" />
</td>
  </tr>
Although, for the USNO, I use an image cache program to fetch the image and save it locally (by cron) so I can make the page https compatible, otherwise, the 'padlock' will break due to the http access for the image.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Lucht

  • Member
  • *
  • Posts: 30
Re: Resurrecting a Weather Site
« Reply #9 on: July 07, 2017, 11:53:16 PM »
I'm running out of "thank you's", Ken. I think I now have enough to keep myself going for the next few days. I hope you have a very pleasant weekend!

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Resurrecting a Weather Site
« Reply #10 on: July 07, 2017, 11:58:03 PM »
Thanks, you enjoy the website 'resurrection' too...  :grin:
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Lucht

  • Member
  • *
  • Posts: 30
Re: Resurrecting a Weather Site
« Reply #11 on: July 09, 2017, 12:39:21 PM »

Although, for the USNO, I use an image cache program to fetch the image and save it locally (by cron) so I can make the page https compatible, otherwise, the 'padlock' will break due to the http access for the image.

I'm curious. I have heard the term "cron" and have the vaguest idea of what it is.... but would that solve the problem for most, if not all, content being drawn from outside sources?

There have been discussions elsewhere about the difficulty of using https, due to a lot of content being 'pulled' from another source. For example: on http://test.sanctuaryweather.info/satellite.php and also on http://test.sanctuaryweather.info/stormtrack.php, I have content drawn from other sites and thus 'breaking' https (I went back to http because of it).

Would something like you've described above help fix that?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Resurrecting a Weather Site
« Reply #12 on: July 09, 2017, 04:36:14 PM »
Cron is a server-based process that allows you to run 'jobs' at specified times or intervals.  A job is usually a bash script (enough to set the working directory to your http directory and run a PHP script).  If you have cPanel hosting, there's a screen to have you set up cron jobs to run on the webserver on your behalf.

No, cron in itself wouldn't solve the https website using http external resources on a page.  You would need a script to grab/cache the external image periodically, then have cron run that script -- the webpage could then use the local cached image file and you'd keep the 'green padlock' on your https page.

You should replace the Flash control on your satellite page with a JavaScript-based one (HAnIS ?) -- Flash is now disabled automatically by multiple browsers as it was subject to a large number of malware exploits in the last years.  Not that JavaScript is free of malware, it's just Flash has now been deprecated on most modern websites.

The stormtrack page uses an iframe to embed a google map and the source of the page can't really be cached.  Sorry...

Hope this helps...
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Lucht

  • Member
  • *
  • Posts: 30
Re: Resurrecting a Weather Site
« Reply #13 on: July 09, 2017, 10:47:01 PM »
At least it has given me food for thought.

Offline Lucht

  • Member
  • *
  • Posts: 30
Re: Resurrecting a Weather Site
« Reply #14 on: July 15, 2017, 06:35:10 PM »
Next on my list: changing the size of the text inside the cloud-base graphic.

I've seen on a couple of sites where the text of e.g. the temp inside the cloud and the height of the cloud base has somehow been made bolder, so that it is easier to read. I have no clue how that has been done and would greatly appreciate any help with that.

 

anything