Author Topic: Radar Status  (Read 210 times)

0 Members and 1 Guest are viewing this topic.

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 368
Radar Status
« on: April 07, 2022, 03:02:46 PM »
Is there a way to run two different radar status scripts with two different radar sites? Just wondering

Chuck

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8621
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Radar Status
« Reply #1 on: April 07, 2022, 03:34:44 PM »
Yes.  But.. you can't just include() a differently named copy of the script (you'll get a fatal error when the second copy tries to redefine a function defined in the first copy).

You may have to use it like
Code: [Select]
readfile('https://your.website.com/radar-status.php?nexrad=RRRR&inc=Y&show=active'); where you'd like the second one (radar RRRR) to appear on the page. 

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 andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 368
Re: Radar Status
« Reply #2 on: April 07, 2022, 03:36:17 PM »
Where would I put that in the script?

Chuck

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8621
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Radar Status
« Reply #3 on: April 07, 2022, 03:38:24 PM »
You don't put it in the radar-status.php script.  You put it on a wxsomename.php page script where you want to display a second radar site status.
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 saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8621
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Radar Status
« Reply #4 on: April 07, 2022, 03:57:43 PM »
For example, in a copy of wxnewpage.php (I called wxradarstatus.php) you can put
Code: [Select]
<div id="main-copy">
 
<h1><?php langtrans(&#39;Status of Nearby Radar Sites&#39;); ?></h1>
   
   <p>Our local site<br/>
   <?php include_once("radar-status.php"); ?>
   </p>
   
   <p>Sacramento area<br/>
   <?php readfile("https://saratoga-weather.org/radar-status.php?nexrad=KDAX&inc=Y&show=active"); ?>
   </p>

   <p>Hanford area<br/>
   <?php readfile("https://saratoga-weather.org/radar-status.php?nexrad=KHNX&inc=Y&show=active"); ?>
   </p>
   
   
   
</div><!-- end main-copy -->
to display the three radars.
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 andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 368
Re: Radar Status
« Reply #5 on: April 07, 2022, 04:49:31 PM »
Will work on it tomorrow. Thanks for the help.

Chuck

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 368
Re: Radar Status
« Reply #6 on: April 08, 2022, 12:44:46 PM »
Got it up and running here https://www.goblesweather.com/wxradarstatus.php

Another question. Is there any way that you can put in the radar page? https://www.goblesweather.com/wxgr3hanisklgx-dbZ.php

Chuck