Author Topic: Modified WU-radar.php  (Read 1387 times)

0 Members and 1 Guest are viewing this topic.

Offline AZClipper

  • Member
  • *
  • Posts: 21
Modified WU-radar.php
« on: September 06, 2019, 04:27:20 PM »
I've recently redone Ken's script for my own use. You can see it in use at  www.apachejctwx.com/MiniWeb/PHP/WU-radar.php. It is stand alone capable. I've attached a copy here if anyone would like to try it out.

Latest version can always be found here.
« Last Edit: September 19, 2019, 06:40:37 PM by AZClipper »


John

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 225
    • test site
Re: Modified WU-radar.php
« Reply #1 on: September 06, 2019, 08:36:25 PM »
You have a problem with the way the code for the 'zoom' is formed ....
Code: [Select]
<a href="/MiniWeb/PHP/WU-radar.php?mode=2&amp;track=0onmouseover="rollThis('pic1','./ajax-images/radar1a.gif')" onmouseout="rollThis('pic1','./ajax-images/radar1.gif')"><img src="./ajax-images/radar1.gif" alt="Zoom In" title="Zoom In" width="24" height="28" name="pic1" border="0"/></a>&nbsp;
<a href="/MiniWeb/PHP/WU-radar.php?mode=1&amp;track=0onmouseover="rollThis('pic2','./ajax-images/radar2a.gif')" onmouseout="rollThis('pic2','./ajax-images/radar2.gif')"><img alt="Apache Junction" title="Apache Junction" src='./ajax-images/radar2.gif' width="24" height="28" name="pic2" border="0"/></a>&nbsp;
<a href="/MiniWeb/PHP/WU-radar.php?mode=2&amp;track=0onmouseover="rollThis('pic3','./ajax-images/radar3a.gif')" onmouseout="rollThis('pic3','./ajax-images/radar3.gif')"><img src='./ajax-images/radar3.gif' alt="Phoenix" title="Phoenix" width="24" height="28" name="pic3" border="0"/></a>
<a href="/MiniWeb/PHP/WU-radar.php?mode=3&amp;track=0onmouseover="rollThis('pic4','./ajax-images/radar4a.gif')" onmouseout="rollThis('pic4','./ajax-images/radar4a.gif')"><img alt="Phoenix Area" title="Phoenix Area" src='./ajax-images/radar4a.gif' width="24" height="28" name="pic4" border="0"/></a>
<a href="/MiniWeb/PHP/WU-radar.php?mode=4&amp;track=0onmouseover="rollThis('pic5','./ajax-images/radar5a.gif')" onmouseout="rollThis('pic5','./ajax-images/radar5.gif')"><img alt="Southwest US" title="Southwest US" src='./ajax-images/radar5.gif' width="24" height="28" name="pic5" border="0"/></a>

<a href="/MiniWeb/PHP/WU-radar.php?mode=5&amp;track=0onmouseover="rollThis('pic6','./ajax-images/radar6a.gif')" onmouseout="rollThis('pic6','./ajax-images/radar6.gif')"><img alt="Entire US" title="Entire US" src='./ajax-images/radar6.gif' width="24" height="28" name="pic6" border="0"/></a>

<a href="/MiniWeb/PHP/WU-radar.php?mode=4&amp;track=0onmouseover="rollThis('pic7','./ajax-images/radar7a.gif')" onmouseout="rollThis('pic7','./ajax-images/radar7.gif')"><img alt="Zoom Out" title="Zoom Out" src="./ajax-images/radar7.gif" width="29" height="28" name="pic7" border="0"/></a>

<a href="/MiniWeb/PHP/WU-radar.php?mode=3&amp;track=1" style="text-decoration:none"><span style="font-size: 14px; font-family: Arial, Helvetica, sans-serif; color:#FFFFFF" onmouseover="this.style.color = '#FFFF00'" onmouseout="this.style.color = '#FFFFFF'">Storm Track: OFF</span></a>&nbsp;&nbsp;
The url is crashing into the javascript ...
Imagine what you will KNOW tomorrow !

Offline AZClipper

  • Member
  • *
  • Posts: 21
Re: Modified WU-radar.php
« Reply #2 on: September 07, 2019, 11:18:07 AM »
OOps1 Fprgot to include the javascript. See new attachment.
« Last Edit: September 08, 2019, 09:27:18 AM by AZClipper »


John

Offline AZClipper

  • Member
  • *
  • Posts: 21
Re: Modified WU-radar.php
« Reply #3 on: September 07, 2019, 12:53:57 PM »
Sorry. I'm new at this. Forgot the images in the zip file. Maybe the third try will finally get it.
« Last Edit: September 08, 2019, 09:27:40 AM by AZClipper »


John

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 225
    • test site
Re: Modified WU-radar.php
« Reply #4 on: September 07, 2019, 04:00:30 PM »
You still have the 'link format' problem for the << in your page ..
Imagine what you will KNOW tomorrow !

Offline AZClipper

  • Member
  • *
  • Posts: 21
Re: Modified WU-radar.php
« Reply #5 on: September 07, 2019, 05:49:19 PM »
Well I'm here to learn so..
Quote
The url is crashing into the javascript ...
This code is from Ken's original script.
<a href="<?php echo $PHP_SELF; ?>?<?php echo $doShow; ?>mode=<?php echo $ModeMinus; ?>&amp;animated=<?php echo $Animated; ?>&amp;track=<?php echo $Track; ?>&amp;advisories=<?php echo $Advisories; ?>&amp;lightning=<?php echo $Lightning; ?>&amp;national=<?php echo $National; ?>#WUtop" onmouseover="rollThis('pic1','<?php echo $imagesDir; ?>radar1a.gif')" onmouseout="rollThis('pic1','<?php echo $imagesDir; ?>radar1.gif')"><img src="<?php echo $imagesDir; ?>radar1.gif" alt="Zoom In" title="Zoom In" width="24" height="28" name="pic1" border="0"/></a>&nbsp;

<a href="<?php echo $PHP_SELF; ?>?<?php echo $doShow; ?>mode=1&amp;animated=<?php echo $Animated; ?>&amp;track=<?php echo $Track; ?>&amp;advisories=<?php echo $Advisories; ?>&amp;lightning=<?php echo $Lightning; ?>&amp;national=<?php echo $National; ?>#WUtop" onmouseover="rollThis('pic2','<?php echo $imagesDir; ?>radar2a.gif')" onmouseout="rollThis('pic2',<?php echo $mode1HL;?>)"><img alt="<?php echo $WUname1; ?>" title="<?php echo $WUname1; ?>" src=<?php echo $mode1HL;?> width="24" height="28" name="pic2" border="0"/></a>&nbsp;

This is the code after my modification. I removed the parts in red as being of no use to me.
<a href="<?php echo $PHP_SELF; ?>?mode=<?php echo $ModeMinus; ?>&amp;track=<?php echo $Track; ?>onmouseover="rollThis('pic1','<?php echo $imagesDir; ?>radar1a.gif')" onmouseout="rollThis('pic1','<?php echo $imagesDir; ?>radar1.gif')"><img src="<?php echo $imagesDir; ?>radar1.gif" alt="Zoom In" title="Zoom In" width="24" height="28" name="pic1" border="0"/></a>&nbsp;

<a href="<?php echo $PHP_SELF; ?>?mode=1&amp;track=<?php echo $Track; ?>onmouseover="rollThis('pic2','<?php echo $imagesDir; ?>radar2a.gif')" onmouseout="rollThis('pic2',<?php echo $mode1HL;?>)"><img alt="<?php echo $WUname1; ?>" title="<?php echo $WUname1; ?>" src=<?php echo $mode1HL;?> width="24" height="28" name="pic2" border="0"/></a>&nbsp;

This is the Javascript.
<script>
function rollThis(whichImage,whichPic){
document.images[whichImage].src = whichPic;
}
</script>

Honestly I cannot find a problem and don't see an issue on my site. I am willing to learn. Perhaps a little more verbose explanation of what you're seeing may help me track it down.


John

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 225
    • test site
Re: Modified WU-radar.php
« Reply #6 on: September 07, 2019, 09:19:56 PM »
Quote from: you
This is the code after my modification. I removed the parts in red as being of no use to me.

<a href="<?php echo $PHP_SELF; ?>?mode=<?php echo $ModeMinus; ?>&amp;track=<?php echo $Track; ?>" onmouseover="rollThis('pic1','<?php echo $imagesDir; ?>radar1a.gif')" onmouseout="rollThis('pic1','<?php echo $imagesDir; ?>radar1.gif')"><img src="<?php echo $imagesDir; ?>radar1.gif" alt="Zoom In" title="Zoom In" width="24" height="28" name="pic1" border="0"/></a>&nbsp;

<a href="<?php echo $PHP_SELF; ?>?mode=1&amp;track=<?php echo $Track; ?>" onmouseover="rollThis('pic2','<?php echo $imagesDir; ?>radar2a.gif')" onmouseout="rollThis('pic2',<?php echo $mode1HL;?>)"><img alt="<?php echo $WUname1; ?>" title="<?php echo $WUname1; ?>" src=<?php echo $mode1HL;?> width="24" height="28" name="pic2" border="0"/></a>&nbsp;
Note: There is a space after "

As posted earlier, your 'stitch' resulted in :
<a href="/MiniWeb/PHP/WU-radar.php?mode=2&amp;track=0onmouseover="rollThis('

... rather than:
<a href="/MiniWeb/PHP/WU-radar.php?mode=2&amp;track=0" onmouseover="rollThis('
« Last Edit: September 07, 2019, 09:21:54 PM by the beteljuice »
Imagine what you will KNOW tomorrow !

Offline AZClipper

  • Member
  • *
  • Posts: 21
Re: Modified WU-radar.php
« Reply #7 on: September 08, 2019, 01:38:29 AM »
Thank You! Thank You! I must have went through that code fifty times and never saw that. One of the things that threw me was that there were no error messages of any kind. I've corrected the code and attached it again to the first post. Without your help I might have been blissfully unaware for ages. Thank you again.
« Last Edit: September 08, 2019, 09:32:04 AM by AZClipper »


John

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 225
    • test site
Re: Modified WU-radar.php
« Reply #8 on: September 08, 2019, 07:40:38 AM »
Not a problem ... the beteljuice wishes he could 'sixth sense' his own typos / syntax errors as easily  :???:

Tip:
Edit all your previous posts and remove redundant zips.

Put the latest zip in the first post, and any updates just post and say it's 'there'  ;)
Imagine what you will KNOW tomorrow !

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 332
    • Penn Lake Weather
Re: Modified WU-radar.php
« Reply #9 on: September 09, 2019, 03:18:42 PM »
Is it there in the first post, or is that still the old zip?

Offline AZClipper

  • Member
  • *
  • Posts: 21
Re: Modified WU-radar.php
« Reply #10 on: September 09, 2019, 03:38:11 PM »
Latest zip is in first post.


John

Offline AZClipper

  • Member
  • *
  • Posts: 21
Re: Modified WU-radar.php
« Reply #11 on: September 19, 2019, 06:44:05 PM »
Version 2.1 -  Reworked for new WU radar urls and region codes.  Should be smooth until WU starts playing again. Latest version in first post.


John

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2471
  • Space Academy for Educators
    • Robbinsdale Middle School Weather
Re: Modified WU-radar.php
« Reply #12 on: September 19, 2019, 07:23:40 PM »
this is great. Thank you ......

Hopefully I can put it in next week.
« Last Edit: September 19, 2019, 07:27:38 PM by chief-david »
Vantage Pro Plus 6163
Robbinsdale, MN 55422@ 45 degrees North Latitude.

You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2471
  • Space Academy for Educators
    • Robbinsdale Middle School Weather
Re: Modified WU-radar.php
« Reply #13 on: February 23, 2020, 04:30:49 PM »
finally done.

All looks fine except I still have a southwest map on the regional radar.

nope-got it.... anything else-let me know

« Last Edit: February 23, 2020, 07:36:54 PM by chief-david »
Vantage Pro Plus 6163
Robbinsdale, MN 55422@ 45 degrees North Latitude.

You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2471
  • Space Academy for Educators
    • Robbinsdale Middle School Weather
« Last Edit: April 14, 2020, 08:02:45 PM by chief-david »
Vantage Pro Plus 6163
Robbinsdale, MN 55422@ 45 degrees North Latitude.

You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline AZClipper

  • Member
  • *
  • Posts: 21
Re: Modified WU-radar.php
« Reply #15 on: April 14, 2020, 09:56:02 PM »
Quote
1. Can I replace the maps
A. from this
https://radblast.wunderground.com/cgi-bin/radar/WUNIDS_map?num=6&type=N0R&mapx=400&mapy=240&brand=wui&delay=50&frame=0&scale=0.25&transx=0&transy=0&severe=0&smooth=0&centerx=400&centery=240&station=MPX&rainsnow=1&lightning=0&noclutter=1&showlabels=1&showstorms=0&rand=26072263

to this-
https://radblast-mi.wunderground.com/cgi-bin/radar/WUNIDS_map?station=MPX&brand=wui&num=6&delay=60&type=N0R&frame=0&noclutter=0&t=1586908921&lat=45.00822067&lon=-93.33930206&label=Robbinsdale+Middle+School&showstorms=0&map.x=400&map.y=240&scale=0.125&centerx=270&centery=382&transx=-130&transy=142&showlabels=1&severe=0&rainsnow=1&lightning=0

the second one is a little closer-zoomed into the city.  I just need to know if I can copy/paste in without screwing anything up.

Yes, you should be able to just paste the new address into place.

Quote
2. My other maps will not zoom in when I click on them.
Could I have missed putting something in the folder?

Make sure jquery.zoom.js & jquery.zoom.min.js are in the same folder as WU-radar.php.


John

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2471
  • Space Academy for Educators
    • Robbinsdale Middle School Weather
Re: Modified WU-radar.php
« Reply #16 on: April 15, 2020, 12:50:53 PM »
The radar is working the way I want.

Zoom is not. Still not sure why not. All are in the same folder
Vantage Pro Plus 6163
Robbinsdale, MN 55422@ 45 degrees North Latitude.

You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline AZClipper

  • Member
  • *
  • Posts: 21
Re: Modified WU-radar.php
« Reply #17 on: April 15, 2020, 03:37:14 PM »
Inspecting your site shows this:
Mixed Content: The page at 'https://rms-weather.rdale.org/' was loaded over HTTPS, but requested an insecure script 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'. This request has been blocked; the content must be served over HTTPS.

That line is 278 in the script. I think you need to change http:   to   https:


John

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2471
  • Space Academy for Educators
    • Robbinsdale Middle School Weather
Re: Modified WU-radar.php
« Reply #18 on: April 15, 2020, 04:11:11 PM »
That was it. Thanks for the help.
Vantage Pro Plus 6163
Robbinsdale, MN 55422@ 45 degrees North Latitude.

You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline AZClipper

  • Member
  • *
  • Posts: 21
Re: Modified WU-radar.php
« Reply #19 on: April 29, 2020, 10:11:51 AM »
The humidity map is no longer available. You can turn it off in configuration.


John

Online Bunty

  • Forecaster
  • *****
  • Posts: 2201
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: Modified WU-radar.php
« Reply #20 on: April 29, 2020, 12:45:33 PM »
So WU isn't going to drop that radar?  It doesn't work all the time for me.  The same with stickers.  I wish WU would make up its mind to either get rid of them permanently or keep them.
« Last Edit: April 29, 2020, 01:14:07 PM by Bunty »

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

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2471
  • Space Academy for Educators
    • Robbinsdale Middle School Weather
« Last Edit: May 25, 2020, 10:31:43 AM by chief-david »
Vantage Pro Plus 6163
Robbinsdale, MN 55422@ 45 degrees North Latitude.

You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline AZClipper

  • Member
  • *
  • Posts: 21
Re: Modified WU-radar.php
« Reply #22 on: May 25, 2020, 10:33:14 AM »
Quote
This is what should come up.
https://radblast-mi.wunderground.com/cgi-bin/radar/WUNIDS_map?station=MPX&brand=wui&num=6&delay=60&type=N0R&frame=0&noclutter=0&t=1586908921&lat=45.00822067&lon=-93.33930206&label=Robbinsdale+Middle+School&showstorms=0&map.x=400&map.y=240&scale=0.125&centerx=270&centery=382&transx=-130&transy=142&showlabels=1&severe=0&rainsnow=1&lightning=0
That works fine. The following is from your script:
Code: [Select]
https://radblast-mi.wunderground.comcgi-bin/radar/WUNIDS_map?station=MPX&brand=wui&num=6&delay=60&type=N0R&frame=0&noclutter=1&t=1590369445&lat=45.00822067&lon=-93.33930206&label=Robbinsdale+Middle+School&showstorms=31&map.x=400&map.y=240&scale=0.125&centerx=270&centery=382&transx=-130&transy=142&showlabels=1&severe=0&rainsnow=1&lightning=0%20width=It doesn"t work.

Also if you inspect the page in Chrome you'll see you are trying to serve some http over https.

Hope this helps.


John

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2471
  • Space Academy for Educators
    • Robbinsdale Middle School Weather
Re: Modified WU-radar.php
« Reply #23 on: May 25, 2020, 11:34:39 AM »
I think I have everything going now....The way I like it.

I always say my very amature coding means my site is held together with duct tape, chicken wire and super glue.
Vantage Pro Plus 6163
Robbinsdale, MN 55422@ 45 degrees North Latitude.

You can't phase me-I teach Middle School.
It's not you-It's WU.