Author Topic: New Site - Some questions for small adjustments  (Read 326 times)

0 Members and 1 Guest are viewing this topic.

Offline Stryder87

  • Member
  • *
  • Posts: 38
    • Moody Weather
New Site - Some questions for small adjustments
« on: July 05, 2018, 07:08:10 PM »
Hi all

So I finally got my web site up and running (www.moodyweather.ca) using the awesome templates from Ken True @ Saratogo Weather.  After a couple weeks figuring out how to make the necessary alterations, I got it close to what I'm happy with.  However, there's a few questions I have and I was hoping someone could help me with.

1) The main page seems to stop updating after a while.  I'm not sure how long it keeps updating, I did make an adjustment in one of the files but it doesn't seem to be affecting it, and I'm wondering if there's a way to make it keep updating, even if the page isn't my focused web page?

2) On the main page, I'd like to add a 3-4 day forecast at the bottom like Ken has on his site (https://saratoga-weather.org/index.php).  Could someone help me figure out how to do this?

3) Ken's site has really nice rounded edges.  Is it easy to alter to get that affect?

4) On the 'Radar/Local Radar' page, the map size seems to be off; it's cutting off the bottom of the map, as seen by the missing information at the bottom of the rain metre bar.  How do I change the map size?

5) Is it possible to add to the Radar fly-out menu to offer Regional and National maps (and the related pages of course)?  The current one is local only.

6) How do I add WXSIM forecasts?  On Ken's page it seems to be integrated, and there is a link to it in 'Forecast & Advisories/WXSIM Forecast Details' menu, but it says it's not available.  Is it available for Canada?

7) I'm currently trying to get the Yesterday Data cron job to work, but I haven't figured it out yet.  I'm hosting with GoDaddy because it was the only one of all my options I had looked at that allowed cron jobs.  My current job is "59 23 * * * /home/<name>/saveYesterday.php >/dev/null 2>&1".  Does this seem right?

Thanks for any help.  I'm loving having a weather station now and setting up a web site is such a fun way to share my hobby.   \:D/

Ray

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6740
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: New Site - Some questions for small adjustments
« Reply #1 on: July 05, 2018, 09:22:00 PM »
Hi all

So I finally got my web site up and running (www.moodyweather.ca) using the awesome templates from Ken True @ Saratogo Weather.  After a couple weeks figuring out how to make the necessary alterations, I got it close to what I'm happy with.  However, there's a few questions I have and I was hoping someone could help me with.

1) The main page seems to stop updating after a while.  I'm not sure how long it keeps updating, I did make an adjustment in one of the files but it doesn't seem to be affecting it, and I'm wondering if there's a way to make it keep updating, even if the page isn't my focused web page?

Hi Ray,
I'm glad you're enjoying fiddling with the template set :)

That setting is in ajaxWLCOMwx.js
Code: [Select]
var maxupdates = 10;          // Maxium Number of updates allowed (set to zero for unlimited)
change it to
Code: [Select]
var maxupdates = 0;          // Maxium Number of updates allowed (set to zero for unlimited)
and the updates will not 'pause' after 10 cycles.

Quote
2) On the main page, I'd like to add a 3-4 day forecast at the bottom like Ken has on his site (https://saratoga-weather.org/index.php).  Could someone help me figure out how to do this?

Yes, but I'll have to dig out the example code to post later.

Quote
3) Ken's site has really nice rounded edges.  Is it easy to alter to get that affect?

My site cheats a bit.. it's using a image for the top and bottom to achieve the rounded effect.  You can change the CSS for your site (weather-screen-blue-narrow.css) by adding this
Code: [Select]
/************************************************************
 * Steve Jenkins' Rounded Corners for Saratoga WX Templates *
 * https://github.com/stevejenkins/saratoga-rounded-corners *
 * http://weather.lakewebster.com/                          *
 * Version 1.2 (Feb 9, 2015)                                *
 ***********************************************************/

/* Comment out any of the CSS formatting you don't want /*

/* Sitewide Header Corners */
#header {border-radius: 11px;}

/* Sitewide Outer Border Corners */
#page {border-radius: 12px;}

/* Sitewide Footer Corners */
#footer {
  border-bottom-left-radius: 11px;
  border-bottom-right-radius: 11px;
}

/* Homepage Icon Corners */
.ajaxDashboard img {border-radius:5px;}
to the end of that file.

Quote
4) On the 'Radar/Local Radar' page, the map size seems to be off; it's cutting off the bottom of the map, as seen by the missing information at the bottom of the rain metre bar.  How do I change the map size?

You seemed to have changed a line in ec-radar.php which now reads
Code: [Select]
if (! preg_match('|^[WX]|',$siteID) || ($siteID == 'WUJ') ) {
and that is incorrect.  The line should read
Code: [Select]
if (! preg_match('|^[WX]|',$siteID) || ($siteID == 'WRN') ) {
and that will fix the 'short' map display on wxradar.php
Note.. you should do customization in Settings.php and Settings-weather.php, not in the individual support scripts like ec-radar.php or ec-forecast.php -- that way, when a new version of the support script is released, you can just replace it as the customization is already saved in Settings.php/Settings-weather.php

Quote
5) Is it possible to add to the Radar fly-out menu to offer Regional and National maps (and the related pages of course)?  The current one is local only.

Sure.  Copy wxradar.php to a new name (wxradarregional.php).  Edit the page and where it says
Code: [Select]
<?php
    $doInclude 
true;
$doPrint true;
    include_once(
"ec-radar.php");
?>

just change that to
Code: [Select]
<?php
// fetch fresh national radar image if needed .. you can chang it to
// 'NAT' = National radar view
// 'PAC' = Pacific region
// 'WRN' = Praries region
// 'ONT' = Ontario
// 'QUE' = Quebec
// 'ERN' = Atlantic region
  
$_REQUEST['site'] = 'NAT'// one of the sites above, or your radar designator
  
$doInclude true;
  
$doPrint true;
  include_once(
"ec-radar.php");
?>
and the national radar will be shown on the page.

Quote
6) How do I add WXSIM forecasts?  On Ken's page it seems to be integrated, and there is a link to it in 'Forecast & Advisories/WXSIM Forecast Details' menu, but it says it's not available.  Is it available for Canada?

WXSIM is a purchased product from www.wxsim.com -- if you elect to buy it, then the WXSIM forecast can display.
If you don't have WXSIM installed, you can turn off the note by changing Settings.php
Code: [Select]
$SITE['WXSIM'] = true;  // Set to false if you have not installed WXSIM
to
Code: [Select]
$SITE['WXSIM'] = false;  // Set to false if you have not installed WXSIM

Quote
7) I'm currently trying to get the Yesterday Data cron job to work, but I haven't figured it out yet.  I'm hosting with GoDaddy because it was the only one of all my options I had looked at that allowed cron jobs.  My current job is "59 23 * * * /home/<name>/saveYesterday.php >/dev/null 2>&1".  Does this seem right?

On GoDaddy, you'll have to use a different format to run the PHP interpreter .. the PHP script is not directly executable in linux.  Try
Code: [Select]
59 23 * * * /usr/bin/php -q $HOME/public_html/saveYesterday.php >/dev/null 2>&1
Note.. the shell variable $HOME will expand to be the filesystem path to your account's home directory when the cron is run, so no other change is needed to that code.
Quote
Thanks for any help.  I'm loving having a weather station now and setting up a web site is such a fun way to share my hobby.   \:D/

Ray

 :grin:  \:D/
« Last Edit: July 05, 2018, 09:26:01 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Stryder87

  • Member
  • *
  • Posts: 38
    • Moody Weather
Re: New Site - Some questions for small adjustments
« Reply #2 on: July 06, 2018, 12:16:58 PM »
Thanks for all the info Ken!

So I managed to go through a number of the items last night.

Item 1) I made the change to the file for the updating change, but the page still seems to be pausing.  I'm not sure why, but I know I had made that change in a different file a couple days ago thinking it was the place to do it.  Now I'm wondering if that may be what's causing it to not perform as expected.  Unfortunately I can't remember which file it was.  The list of files I've altered is rather long.   :oops:

Item 3) I'll work on this on the weekend.

Item 4) In my original attempt to change that radar map to WUJ, I had gone through and replaced WRN with WUJ everywhere I could find it ec-radar.php, hoping to get the radar map correct.  While I did manage to get the map I wanted (I think it was simply by having changed it in Settings.php), I didn't realize it altered the map size.  As you suggested, I changed all the edits in ec-radar.php back to WRN.  Seems fixed now and looks much better.  Thanks!   :-)

Item 5) I created the files for Regional and National radars.  It took me quite some time to figure out what file to edit to be able to insert those options in the Radar fly-out.  I eventually figured it out using Inspect Elements in Firefox.  It's working great now!  Big win for me (since I know nothing about web coding)!  :grin:

Item 6) Turned it off (for now).

Item 7) I changed my cron job command line to the one you supplied.  Looks like it worked!  Thanks a ton for that!   :-P  I had visions of that being a real headache.

I really appreciate your help.  I can only imagine that you spend a crazy amount of time helping people with their sites, so I appreciate you taking time to help me.

I'm still wondering why the site pauses though.  For some reason that's a big one to me.

One item that I forgot to ask before: what file has the text on the main page layout?  I want to change 'EC Weather Forecast' to be Environment Canada Weather Forecast (I'd actually like to change all instances of EC on the front page to Environment Canada).  I thought it would be in ajax-dashboard.php, but I can't find it.

Thanks again for your help!

Ray

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6740
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: New Site - Some questions for small adjustments
« Reply #3 on: July 06, 2018, 01:00:59 PM »
For 1) (updating) .. D'Oh.. I gave you the wrong file name to edit.. it is ajaxAWNwx.js since you're using the ambientweather.com plugin, not the WeatherLink.com plugin.  Same advice applies just in a different script filename:

That setting is in ajaxAWNwx.js
Code: [Select]
var maxupdates = 10;          // Maxium Number of updates allowed (set to zero for unlimited)
change it to
Code: [Select]
var maxupdates = 0;          // Maxium Number of updates allowed (set to zero for unlimited)
and the updates will not 'pause' after 10 cycles.

Glad that the other suggestions worked.  Happy coding!


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

Offline Stryder87

  • Member
  • *
  • Posts: 38
    • Moody Weather
Re: New Site - Some questions for small adjustments
« Reply #4 on: July 06, 2018, 03:06:19 PM »
Thanks Ken.

I made the change to ajaxAWNwx.js and it seems to be working now.  Awesome!  Thanks.

I'm still hoping you can tell me which file to edit to change the headings and forecast names on the main page (I'd like to change the instances of EC to be Environment Canada).

If possible, I'd still like to include the 3-4 day forecast like you have on your site.

Just a couple things left....  \:D/

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6740
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: New Site - Some questions for small adjustments
« Reply #5 on: July 06, 2018, 03:58:06 PM »
Try changing ajax-dashboard.php
Code: [Select]
   <tr>
     <td style="text-align: left" class="datahead">&nbsp;<?php print $fcstorg?> <?php langtrans('Weather Forecast'); ?>&nbsp; -  <?php langtrans('Outlook'); ?>:&nbsp;<?php echo $forecasttitles[0]; ?> &amp; <?php echo $forecasttitles[1]; ?></td>
     </tr>
to
Code: [Select]
   <?php if ($fcstorg == 'EC') {$fcstorg $ECNAME; } ?>
   <tr>
     <td style="text-align: left" class="datahead">&nbsp;<?php print $fcstorg?> <?php langtrans('Weather Forecast'); ?>&nbsp; -  <?php langtrans('Outlook'); ?>:&nbsp;<?php echo $forecasttitles[0]; ?> &amp; <?php echo $forecasttitles[1]; ?></td>
     </tr>
then it will display the full name in either English or French based on the current language selection.  Note that only the line
Code: [Select]
   <?php if ($fcstorg == 'EC') {$fcstorg $ECNAME; } ?> was added.. the second line just shows the position in the script (around line 964 )

For the additional days forcecast, it's a bit more complicated.  Also in ajax-dashboard.php replace
Code: [Select]
   </tr>
 </table>
<?php if($condIconType <> '.jpg') {
with
Code: [Select]
   </tr>
    <tr>
        <td style="text-align: left" class="datahead">&nbsp;<?php print $fcstorg?> <?php langtrans('Short Term Weather Forecast'); ?></td>
    </tr>
    <tr>
      <td class="data1">
        <table style="text-align:center;" width="100%" border="1" cellpadding="2" cellspacing="2">
        <tr>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasticons[2]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasticons[3]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasticons[4]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasticons[5]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasticons[6]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasticons[7]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasticons[8]; ?>
          </td>
        </tr>   
        <tr>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasttemp[2]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasttemp[3]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasttemp[4]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasttemp[5]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasttemp[6]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasttemp[7]; ?>
          </td>
          <td valign="top" style="font-size: 10px;">
              <?php echo $forecasttemp[8]; ?>
          </td>
        </tr>   
      </table>
    </td>
  </tr>
 </table>
<?php if($condIconType <> '.jpg') {

You can see the effect at https://saratoga-weather.org/wxtemplates/Canada/wxindex.php

I've attached the updated ajax-dashboard.php with these mods.
Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Stryder87

  • Member
  • *
  • Posts: 38
    • Moody Weather
Re: New Site - Some questions for small adjustments
« Reply #6 on: July 06, 2018, 10:47:43 PM »
Ken, thank you so much for including the altered file!  I was worried I'd be overwhelmed trying to figure out all the editing I would need to do.  As it was, all I had to do was compare it to my (previously) current one and make the minor changes I had already done.  It works beautifully!

I do have one question, unrelated to the above: is it possible to have the radar on my main page be a live radar not static?  I love how you have a live rain and lightening radars on your front page.

Thanks again!

Ray
« Last Edit: July 06, 2018, 10:51:09 PM by Stryder87 »

 

anything