Author Topic: AjaxDashboard6.php  (Read 1267 times)

0 Members and 1 Guest are viewing this topic.

Offline ea1hmy

  • Contributor
  • ***
  • Posts: 120
    • meteotorrelavega
AjaxDashboard6.php
« on: January 01, 2019, 11:42:10 AM »
Hello, what to do so that in the template of: Scott of BurnsvilleWeather
AjaxDashboard6.php
does not appear on it the DarkSky script
DS-forecast.php

http://www.meteotorrelavega.com/saratoga/index1.php
gracias

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: AjaxDashboard6.php
« Reply #1 on: January 01, 2019, 01:15:39 PM »
Yes, several changes have to be made to ajax-dashboard6.php V6.95 to support DarkSky forecasts.

Change
Code: [Select]
if ($fcstby == 'WU') {

    $SITE['fcstscript'] = 'WU-forecast.php';    // Non-USA, Non-Canada Wunderground Forecast Script
    $SITE['fcstorg'] = 'WU';    // set to 'WU' for WeatherUnderground
    $fcstorg = $fcstby;
    $fcstscript = $SITE['fcstscript'];
}
to
Code: [Select]
if ($fcstby == 'WU') {

    $SITE['fcstscript'] = 'WU-forecast.php';    // Non-USA, Non-Canada Wunderground Forecast Script
    $SITE['fcstorg'] = 'WU';    // set to 'WU' for WeatherUnderground
    $fcstorg = $fcstby;
    $fcstscript = $SITE['fcstscript'];
}

if ($fcstby == 'DarkSky') {

$SITE['fcstscript'] = 'DS-forecast.php';    // DarkSky forecast
$SITE['fcstorg'] = 'DarkSky';    // set to 'DarkSky' for DarkSky forecast
$fcstorg = $fcstby;
$fcstscript = $SITE['fcstscript'];
}
  Then change
Code: [Select]
include_once($WXtags);   // for the bulk of our data
$doPrintNWS = false; // suppress printing of forecast by advforecast2.php
$doPrint = false; // suppress printing of ec-forecast.php
$doPrintWU = false; // suppress printing of WU-forecast.php
include_once($fcstscript); // for the forecast icon stuff
to
Code: [Select]
include_once($WXtags);   // for the bulk of our data
$doPrintNWS = false; // suppress printing of forecast by advforecast2.php
$doPrint = false; // suppress printing of ec-forecast.php
$doPrintWU = false; // suppress printing of WU-forecast.php
$doPrintDS  = false; // suppress printing of DarkSky DS-forecast.php
include_once($fcstscript); // for the forecast icon stuff
and lastly, change
Code: [Select]
if ($fcstorg == 'WU') {
    $forecasticons = $WUforecasticons;
    $forecasttemp = $WUforecasttemp;
    $forecasttitles = $WUforecasttitles;
    $forecasttext = $WUforecasttext;
} else if ($fcstorg == 'EC') {
to
Code: [Select]
if ($fcstorg == 'WU') {
    $forecasticons = $WUforecasticons;
    $forecasttemp = $WUforecasttemp;
    $forecasttitles = $WUforecasttitles;
    $forecasttext = $WUforecasttext;
} else if ($fcstorg == 'DarkSky') {
  $forecasticons = $DSforecasticons;
  $forecasttemp = $DSforecasttemp;
  $forecasttitles = $DSforecasttitles;
  $forecasttext = $DSforecasttext;

} else if ($fcstorg == 'EC') {
and that should let DarkSky be your forecast.

I've updated the Legacy scripts area with 695a version with these mods.
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 ea1hmy

  • Contributor
  • ***
  • Posts: 120
    • meteotorrelavega
Re: AjaxDashboard6.php
« Reply #2 on: January 01, 2019, 01:23:22 PM »
Thank you very much Ken

my best wishes for 2019

Offline big2000

  • Member
  • *
  • Posts: 6
    • meteotaranto.org
Re: AjaxDashboard6.php
« Reply #3 on: February 13, 2019, 08:01:01 AM »
Yes, several changes have to be made to ajax-dashboard6.php V6.95 to support DarkSky forecasts.

Change
Code: [Select]
if ($fcstby == 'WU') {

    $SITE['fcstscript'] = 'WU-forecast.php';    // Non-USA, Non-Canada Wunderground Forecast Script
    $SITE['fcstorg'] = 'WU';    // set to 'WU' for WeatherUnderground
    $fcstorg = $fcstby;
    $fcstscript = $SITE['fcstscript'];
}
to
Code: [Select]
if ($fcstby == 'WU') {

    $SITE['fcstscript'] = 'WU-forecast.php';    // Non-USA, Non-Canada Wunderground Forecast Script
    $SITE['fcstorg'] = 'WU';    // set to 'WU' for WeatherUnderground
    $fcstorg = $fcstby;
    $fcstscript = $SITE['fcstscript'];
}

if ($fcstby == 'DarkSky') {

$SITE['fcstscript'] = 'DS-forecast.php';    // DarkSky forecast
$SITE['fcstorg'] = 'DarkSky';    // set to 'DarkSky' for DarkSky forecast
$fcstorg = $fcstby;
$fcstscript = $SITE['fcstscript'];
}
  Then change
Code: [Select]
include_once($WXtags);   // for the bulk of our data
$doPrintNWS = false; // suppress printing of forecast by advforecast2.php
$doPrint = false; // suppress printing of ec-forecast.php
$doPrintWU = false; // suppress printing of WU-forecast.php
include_once($fcstscript); // for the forecast icon stuff
to
Code: [Select]
include_once($WXtags);   // for the bulk of our data
$doPrintNWS = false; // suppress printing of forecast by advforecast2.php
$doPrint = false; // suppress printing of ec-forecast.php
$doPrintWU = false; // suppress printing of WU-forecast.php
$doPrintDS  = false; // suppress printing of DarkSky DS-forecast.php
include_once($fcstscript); // for the forecast icon stuff
and lastly, change
Code: [Select]
if ($fcstorg == 'WU') {
    $forecasticons = $WUforecasticons;
    $forecasttemp = $WUforecasttemp;
    $forecasttitles = $WUforecasttitles;
    $forecasttext = $WUforecasttext;
} else if ($fcstorg == 'EC') {
to
Code: [Select]
if ($fcstorg == 'WU') {
    $forecasticons = $WUforecasticons;
    $forecasttemp = $WUforecasttemp;
    $forecasttitles = $WUforecasttitles;
    $forecasttext = $WUforecasttext;
} else if ($fcstorg == 'DarkSky') {
  $forecasticons = $DSforecasticons;
  $forecasttemp = $DSforecasttemp;
  $forecasttitles = $DSforecasttitles;
  $forecasttext = $DSforecasttext;

} else if ($fcstorg == 'EC') {
and that should let DarkSky be your forecast.

I've updated the Legacy scripts area with 695a version with these mods.

And just to let everyone else know, you can do the right same thing on the mobile version of the script.

Nice job Ken! =D>

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: AjaxDashboard6.php
« Reply #4 on: April 03, 2019, 04:07:29 PM »
I decided to take the plunge and repackage Scott's ajax-dashboard6 script set along with the needed images and support scripts into one distribution to make it easier for initial installs to use.  The dashboard was updated to allow both DarkSky and the new WU/TWC forecasts.  I took the opportunity to replace the Google charts sunpie with Gerry's version of the pie (made by heavens.php and cached in ./cache/heavenpie.png).  Also rooted around and collected the old included scripts needed, updated all for PHP7+ where needed.

Should make new installs a bit easier for folks.  Download the 6.95b package from legacy scripts page.

Best regards,
Ken
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