Author Topic: wxnwsradar.php  (Read 598 times)

0 Members and 1 Guest are viewing this topic.

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
wxnwsradar.php
« on: July 21, 2021, 07:39:10 AM »
Ken,

I'm suddenly seeing a few notices in my server's logs that are being thrown by this script.

PHP Warning:  Undefined variable $btnColor
PHP Warning:  Undefined variable $btnTextColor

I am running php version 8.0.8.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9277
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxnwsradar.php
« Reply #1 on: July 21, 2021, 09:42:30 AM »
A link to your site would be most helpful.. You don't have one in your profile.
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 tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: wxnwsradar.php
« Reply #2 on: July 21, 2021, 09:51:13 AM »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9277
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxnwsradar.php
« Reply #3 on: July 21, 2021, 11:23:38 AM »
You seem to not be using the stand-alone (non-Saratoga template) version for that page.. it has incomplete HTML.
You should use the wxnwsradarSA.php page as the base for use in your template.

I don't see on the page where it shows
Quote
PHP Warning:  Undefined variable $btnColor
PHP Warning:  Undefined variable $btnTextColor
, but that could be caused by not using the starting SA page in your site.
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 tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: wxnwsradar.php
« Reply #4 on: July 21, 2021, 11:28:31 AM »
I wasn't able to find the stand-alone version so I set the options within to run as stand-alone.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9277
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxnwsradar.php
« Reply #5 on: July 21, 2021, 11:46:07 AM »
Hmmm.. maybe I'd not created a SA version of the page.  I've really only distributed it on the Base-USA.zip Saratoga template set.  Guess I'm getting old...

Make sure that your copy has
Code: [Select]
############################################################################
/************************* Settings *****************************/
$radarLoc = 'mux'; // IMPORTAMT!!! Default radar location is set here
// NOTE: use last 3 characters for Kxxx sites,
// use ALL 4 characters for Pxxx/Txxx sites (AK, HI, Guam, Puerto Rico)
$imageWidth = 600; // Width of radar images
$iframeWidth = 617; // Default IFrame Width -- adjust as needed
$iframeHeight = 620; // Default IFrame Height -- adjust as needed
$autoRefresh = true; // Use Autorefresh? true or false -- Determines whether AutoRefresh even appears
$autoRefreshTime = 8; // Number of minutes between autorefreshes.  IMPORTANT: use 2, 3, 4, 5, 6, 8, 10, 15, 20, or 30 ONLY!!!
$autoRefreshOff = false; // Begin with Autorefresh Off? true or false -- 'OFF' or 'ON"
$bgndColor = 'silver'; // Set HAniS Background Color Here
$btnColor = 'darkslategray'; // Set Button Color here
$btnTextColor = 'white'; // Set Button Text Color here
############################ New in Version 2 ##########################
$pauseSeconds = 2; // Pause on last image, in seconds
$animRate = 20; // Frame Rate of animation: 5 is glacial, 10 is slow, 15 is leisurely, 20 is good, and 50 is fast - set with integer
$numbImages = 10; // Number of Radar Images to Animate - 3 to 10
############################ New in Version 3 ##########################
$smoothingOn = false; // Enable image smoothing - new in HAniS 2.5
/*********************** End Settings ***************************/
if(isset($SITE['noaaradar'])) { $radarLoc = strtolower($SITE['noaaradar']);}
$radar = 'N0R'; //  'N0R' is the only type available at /ridge/lite/

?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript"> {
var $jq = jQuery.noConflict();
function showRadarjs(radar,radarLoc,imageWidth,iframeWidth,iframeHeight,autoRefresh,autoRefreshTime,bgndColor,autoRefreshOff,btnColor,btnTextColor,pauseSeconds,animRate,numbImages,smoothingOn) {
$jq('#selectorsarea').load('wxnwsradar-inc.php', {radar:radar,radarLoc:radarLoc,imageWidth:imageWidth,iframeWidth:iframeWidth,iframeHeight:iframeHeight,autoRefresh:autoRefresh,autoRefreshTime:autoRefreshTime,bgndColor:bgndColor,autoRefreshOff:autoRefreshOff,btnColor:btnColor,btnTextColor:btnTextColor,pauseSeconds:pauseSeconds,animRate:animRate,numbImages:numbImages,smoothingOn:smoothingOn});
}
}
</script>
<style type="text/css">
#selectorsarea optgroup {
  color: black;
  background: white;
}
#selectorsarea option {
  background-color:<?php echo $btnColor?>;
  border-radius:7px;
  color:<?php echo $btnTextColor?>;
}
#selectorsarea select {
  background-color:<?php echo $btnColor?>;
  border-radius:7px;
  color:<?php echo $btnTextColor?>;
}
</style>
</head>
in it, before the
Code: [Select]
<?php include_once('wxnwsradar-inc.php');?>
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 tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: wxnwsradar.php
« Reply #6 on: July 21, 2021, 03:20:07 PM »
I do have those settings in my version.  What I just noticed, however, is that when loaded by the "calling" page https://mymishawakaweather.com/Local_Radars.php the buttons are not colored.  But, if we load the script directly https://mymishawakaweather.com/wxnwsradar.php then everything looks right.  I can work around this the hard way but I'm hoping you have a better solution  :-)

 

anything