Author Topic: Alternative ajax-dashboard6 6.95c released  (Read 1191 times)

0 Members and 1 Guest are viewing this topic.

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Alternative ajax-dashboard6 6.95c released
« on: April 19, 2019, 03:07:22 PM »
For users of the alternative dashboard for Weather-Display, V6.95c of ajax-dashboard6.php and ajaxWDwx3.js are available with moon phase data extended to year 2030 (old versions stopped at year 2020 end)

Download from: https://saratoga-weather.org/scripts-legacy.php#scott

Only the two scripts are changed from V6.95b
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 gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternative ajax-dashboard6 6.95c released
« Reply #1 on: April 19, 2019, 11:11:05 PM »
Thanks, Ken!

Using 'Compare It!' I incorporated the changes into my modified ajaxWDwx3.js without any problems, but my highly modified ajax-dashboard6.php is a little more problematic.  Were any changes made there that impact the moon phase data, and if so where?  Never mind.  I see the changes I need to make. :oops:
« Last Edit: April 19, 2019, 11:49:13 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Alternative ajax-dashboard6 6.95c released
« Reply #2 on: April 20, 2019, 12:55:32 AM »
The major change was the complete replacement of the function getMoonInfo() and the rewrite of the code around the moon display in the table to use $mooninfo->xxx calls instead of invoking getMoonInfo() over and over again.
Code: [Select]
                    <tr>
                        <td class="data2" style="text-align: center; font-size: 12px;">
                        <?php echo '<br/>';
$mooninfo getMoonInfo();
if($DebugMode) { print "<!-- mooninfo \n".print_r($mooninfo,true)." -->\n";}
?>

                            <span class="ajax" id="ajaxmoonphase"><?php langtrans($mooninfo->phase); ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: center;"><span id="ajaxmoonimg"><?php
                            
echo '<img src="' $imagesDir 'moon/w/' $moonHemisphere '-moon' str_pad($mooninfo->pic2"0"STR_PAD_LEFT) . '.gif"
                  alt  ="' 
$mooninfo->phase ', ' $mooninfo->age ' in cycle"
                  title="' 
$mooninfo->phase ', ' $mooninfo->age ' in cycle"
                        width="60" height="60" style="border: 0;" />'
?>
</span>
                        </td>
                    </tr>
                    <tr>
                    <td class="data2" style="text-align: center; font-size: 12px;" >
                        <span class="ajax" id="ajaxmoonpct"><?php echo $mooninfo->ill "%"?></span><br/>
                        <?php langtrans(' Illuminated'); ?>
                        </td>
                    </tr>

and the functions
Code: [Select]
function getMoonAge() {
    $mooninfo = getMoonInfo();
    return $mooninfo->age;
}

function getMoonPic() {
    $mooninfo = getMoonInfo();
    return $mooninfo->pic;
}

function getMoonIll() {
    $mooninfo = getMoonInfo();
    return $mooninfo->ill;
}

function getMoonPhase() {
    $mooninfo = getMoonInfo();
    return $mooninfo->phase;
}
were no longer needed, so deleted from 6.95c dashboard.

The ajaxWDwx3.js just had the JavaScript version of the moon info routine updated.
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 gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternative ajax-dashboard6 6.95c released
« Reply #3 on: April 20, 2019, 08:18:14 AM »
Thanks again, Ken!  Those changes solved the problem I and others were having with an erroneous moon image displaying on initial load of the dashboard until AJAX took over.  Great work as usual. =D&gt; \:D/ =D&gt;
Regards, Jerry Wilkins
gwwilk@gmail.com

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Alternative ajax-dashboard6 6.95c released
« Reply #4 on: April 20, 2019, 11:02:43 AM »
Yes, I'd noticed the odd moon image/illumination/phase display on initial load -- turns out Scott had used some older code for that than I'd used in the more recent common.php for cGetMoonInfo() function, so I just cloned that with a name change .. now it displays what the AJAX script updates with.  Given the fairly slow changes in moon, I'd always wondered why Ranier had done an AJAX update for it anyway.. likely no visible changes between page refreshes.   :???:
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 lddaly

  • Forecaster
  • *****
  • Posts: 490
Re: Alternative ajax-dashboard6 6.95c released
« Reply #5 on: April 23, 2019, 03:47:31 PM »
A very minor change to version 3.08 of the ajaxWDwx3.js file... line 1901:
Code: [Select]
set_ajax_obs("ajaxvers"    , "| Ajax 3.07");  //Set for Alt-Dashboard Ver 6.90+ by Burnsville Weather LiveShould be updated to read 3.08 for reporting on the dashboard.

Offline Bunty

  • Forecaster
  • *****
  • Posts: 2432
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: Alternative ajax-dashboard6 6.95c released
« Reply #6 on: May 07, 2019, 12:13:12 PM »
Those changes solved the problem I and others were having with an erroneous moon image displaying on initial load of the dashboard until AJAX took over.  Great work as usual. =D&gt; \:D/ =D&gt;

Are you using php 7, rather than 5.6?  I see your AQI index is working fine, while mine isn't, so I had to ask.
« Last Edit: May 07, 2019, 12:14:59 PM by Bunty »

Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/2ndhome.php

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Alternative ajax-dashboard6 6.95c released
« Reply #7 on: May 07, 2019, 12:28:30 PM »
Those changes solved the problem I and others were having with an erroneous moon image displaying on initial load of the dashboard until AJAX took over.  Great work as usual. =D&gt; \:D/ =D&gt;

Are you using php 7, rather than 5.6?  I see your AQI index is working fine, while mine isn't, so I had to ask.
Bunty, your PHP 7 issue is caused by having allow_url_fopen = off
in your php.ini

The AQI script (and others) need to have:

allow_url_fopen = on

to work correctly.
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 Bunty

  • Forecaster
  • *****
  • Posts: 2432
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: Alternative ajax-dashboard6 6.95c released
« Reply #8 on: May 07, 2019, 01:36:17 PM »
Those changes solved the problem I and others were having with an erroneous moon image displaying on initial load of the dashboard until AJAX took over.  Great work as usual. =D&gt; \:D/ =D&gt;

Are you using php 7, rather than 5.6?  I see your AQI index is working fine, while mine isn't, so I had to ask.
Bunty, your PHP 7 issue is caused by having allow_url_fopen = off
in your php.ini

The AQI script (and others) need to have:

allow_url_fopen = on

to work correctly.

LOL, I should have mentioned I tried doing that, but it didn't work.  I also tried placing "ini_set('allow_url_fopen',1);" on line 1 of get-aqi-rss-with-link.php.  Still no go.  So I'm still left wondering what dumb thing I'm doing or not doing.  If I had to make a guess it's on the web space provider's side as it has been in the past on several different issues.

PHP Warning:  DOMDocument::load(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/public_html/wx/get-aqi-rss-with-link.php on line 19
« Last Edit: May 07, 2019, 01:52:38 PM by Bunty »

Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/2ndhome.php

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Alternative ajax-dashboard6 6.95c released
« Reply #9 on: May 07, 2019, 01:57:21 PM »
If putting it in your php.ini doesn't work, call the tech support for your hosting provider and ask that it be fixed.
There's generally no good reason to disallow allow_url_fopen  (and very good reasons to disallow allow_url_include).
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 Bunty

  • Forecaster
  • *****
  • Posts: 2432
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: Alternative ajax-dashboard6 6.95c released
« Reply #10 on: May 07, 2019, 03:03:37 PM »
If putting it in your php.ini doesn't work, call the tech support for your hosting provider and ask that it be fixed.
There's generally no good reason to disallow allow_url_fopen  (and very good reasons to disallow allow_url_include).

Okay, I reported it, and the setting was promptly enabled.  So it was what we thought it was.  Thanks.  It's overall a good cheap web space provider-KVC Hosting--except when their default settings won't run my files.

Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/2ndhome.php

 

anything