WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started by: MackerelSky on December 14, 2021, 06:24:42 PM
-
Hi All,
I've had this script at the bottom of my homepage since it was first put out, at least the revision that Gwilks put to it. About three weeks ago, it began throwing a 'No Thunderstorm Forecast' message across day two and three, while the current day was correct.
Didn't see anyone else mention it here on the forums, so thought it might clear itself up on my site. It didn't, and this past Saturday, I went looking for an answer. From the minor changes I made, it seems to have been working thru the weekend and up thru today's cycle.
Code in the original script
<td>Today: <?php $today = mktime(0,0,0,date("m"),date("d")+$next_day,date("Y")); echo date("D", $today).', '; echo date("M j, Y", $today);?><a class="hvr-glow hvr-grow" onmouseover="show_tab('day1')"><img src="https://www.spc.noaa.gov/products/outlook/day1otlk_1200.gif" width="<?php echo $divWidth!=$maxWidth?'210':'285'?>" alt="todays map"/></a></td>
<td>Tomorrow: <?php $tomorrow = mktime(0,0,0,date("m"),date("d")+1+$next_day,date("Y")); echo date("D", $tomorrow).', '; echo date("M j, Y", $tomorrow);?><a class="hvr-glow hvr-grow" onmouseover="show_tab('day2')"><img src="https://www.spc.noaa.gov/products/outlook/day2otlk_0600.gif" width="<?php echo $divWidth!=$maxWidth?'210':'285'?>" alt="tomorrows map"/></a></td>
<td>In 2 Days: <?php $datomorrow = mktime(0,0,0,date("m"),date("d")+2+$next_day,date("Y")); echo date("D", $datomorrow).', '; echo date("M j, Y", $datomorrow);?><a class="hvr-glow hvr-grow" onmouseover="show_tab('day3')"><img src="https://www.spc.noaa.gov/products/outlook/day3otlk_0730.gif" width="<?php echo $divWidth!=$maxWidth?'210':'285'?>" alt="day after tomorrows map"/></a></td></tr>
</table>
<div class="center" style="text-height:100%">(Hover over a thumbnail to display a new chart.)</div>
</div><hr/>
<div class="center" style="width:<?php echo $divWidth ?>px; position:relative">
<?php echo ($divWidth!=$maxWidth?'<a href="https://www.spc.noaa.gov/products/outlook/day1otlk_1200.gif" target="_blank" title="Larger Image">':'')?><img src="https://www.spc.noaa.gov/products/outlook/day1otlk_1200.gif" id="day1" class="hidden" style="width:<?php echo $divWidth ?>px" alt="Day 1"/><?php echo ($divWidth!=$maxWidth?'</a>':'')?>
<?php echo ($divWidth!=$maxWidth?'<a href="https://www.spc.noaa.gov/products/outlook/day2otlk_0600.gif" target="_blank" title="Larger Image">':'')?><img src="https://www.spc.noaa.gov/products/outlook/day2otlk_0600.gif" id="day2" class="hidden" style="width:<?php echo $divWidth ?>px" alt="Day 2"/><?php echo ($divWidth!=$maxWidth?'</a>':'')?>
<?php echo ($divWidth!=$maxWidth?'<a href="https://www.spc.noaa.gov/products/outlook/day3otlk_0730.gif" target="_blank" title="Larger Image">':'')?><img src="https://www.spc.noaa.gov/products/outlook/day3otlk_0730.gif" id="day3" class="hidden" style="width:<?php echo $divWidth ?>px" alt="Day 3"/><?php echo ($divWidth!=$maxWidth?'</a>':'')?>
<div class="center" style="width:<?php echo $divWidth ?>px; display:block">
<?php echo ($divWidth!=$maxWidth?'<a href="https://www.spc.noaa.gov/products/outlook/day1otlk_1200.gif" target="_blank" title="Larger Image">':'')?><img src="https://www.spc.noaa.gov/products/outlook/day1otlk_1200.gif" style="width:<?php echo $divWidth ?>px" alt="Day 1"/><?php echo ($divWidth!=$maxWidth?'</a>':'')?>
Basically, it's changing day2otlk_0600.gif to this, day2otlk_0700.gif and changing the 3rd day, day3otlk_0730.gif to this, day3otlk_0830.gif
<td>Today: <?php $today = mktime(0,0,0,date("m"),date("d")+$next_day,date("Y")); echo date("D", $today).', '; echo date("M j, Y", $today);?><a class="hvr-glow hvr-grow" onmouseover="show_tab('day1')"><img src="https://www.spc.noaa.gov/products/outlook/day1otlk_1200.gif" width="<?php echo $divWidth!=$maxWidth?'210':'185'?>" alt="todays map"/></a></td>
<td>Tomorrow: <?php $tomorrow = mktime(0,0,0,date("m"),date("d")+1+$next_day,date("Y")); echo date("D", $tomorrow).', '; echo date("M j, Y", $tomorrow);?><a class="hvr-glow hvr-grow" onmouseover="show_tab('day2')"><img src="https://www.spc.noaa.gov/products/outlook/day2otlk_0700.gif" width="<?php echo $divWidth!=$maxWidth?'210':'185'?>" alt="tomorrows map"/></a></td>
<td>In 2 Days: <?php $datomorrow = mktime(0,0,0,date("m"),date("d")+2+$next_day,date("Y")); echo date("D", $datomorrow).', '; echo date("M j, Y", $datomorrow);?><a class="hvr-glow hvr-grow" onmouseover="show_tab('day3')"><img src="https://www.spc.noaa.gov/products/outlook/day3otlk_0830.gif" width="<?php echo $divWidth!=$maxWidth?'210':'185'?>" alt="day after tomorrows map"/></a></td></tr>
</table>
<div class="center" style="text-height:100%">(Hover over a thumbnail to display a new chart.)</div>
</div><hr/>
<div class="center" style="width:<?php echo $divWidth ?>px; position:relative">
<?php echo ($divWidth!=$maxWidth?'<a href="https://www.spc.noaa.gov/products/outlook/day1otlk_1200.gif" target="_blank" title="Larger Image">':'')?><img src="https://www.spc.noaa.gov/products/outlook/day1otlk_1200.gif" id="day1" class="hidden" style="width:<?php echo $divWidth ?>px" alt="Day 1"/><?php echo ($divWidth!=$maxWidth?'</a>':'')?>
<?php echo ($divWidth!=$maxWidth?'<a href="https://www.spc.noaa.gov/products/outlook/day2otlk_0700.gif" target="_blank" title="Larger Image">':'')?><img src="https://www.spc.noaa.gov/products/outlook/day2otlk_0700.gif" id="day2" class="hidden" style="width:<?php echo $divWidth ?>px" alt="Day 2"/><?php echo ($divWidth!=$maxWidth?'</a>':'')?>
<?php echo ($divWidth!=$maxWidth?'<a href="https://www.spc.noaa.gov/products/outlook/day3otlk_0830.gif" target="_blank" title="Larger Image">':'')?><img src="https://www.spc.noaa.gov/products/outlook/day3otlk_0830.gif" id="day3" class="hidden" style="width:<?php echo $divWidth ?>px" alt="Day 3"/><?php echo ($divWidth!=$maxWidth?'</a>':'')?>
<div class="center" style="width:<?php echo $divWidth ?>px; display:block">
<?php echo ($divWidth!=$maxWidth?'<a href="https://www.spc.noaa.gov/products/outlook/day1otlk_1200.gif" target="_blank" title="Larger Image">':'')?><img src="https://www.spc.noaa.gov/products/outlook/day1otlk_1200.gif" style="width:<?php echo $divWidth ?>px" alt="Day 1"/><?php echo ($divWidth!=$maxWidth?'</a>':'')?>
There could easily be a 'better fix', but for now this one seems to be working for me, as I copied the ones that worked on the SPC site. Looks like a time change thingy on the photos. Jerry has this script listed as the wxus3dconvotlk.zip. The 'view' on his script page is throwing the same 'No Thunderstorms Forecast' I that I was getting until I made the changes.
Hope this helps...
All the Best!
Brad
-
Thanks, Brad, for pointing out the updated URL's this script points to. [tup]
An updated script is available on my scripts page (https://www.gwwilkins.org/gwwScripts.php).
I must admit I abandoned this script in favor of a much more complete, albeit iframed, 3 day outlook (https://www.gwwilkins.org/wxspc3doutlook.php).
-
I must admit I abandoned this script in favor of a much more complete, albeit iframed, 3 day outlook (https://www.gwwilkins.org/wxspc3doutlook.php).
Probably why no one had mentioned it, I'm the only one using it, *grin*
Just works for me at the bottom of the main page.
Take Care,
Brad
-
The 3 day convective outlook script (https://www.gwwilkins.org/wxus3dconvotlk.php) has been displaying stale 2 and 3 day graphics apparently since standard times went to DST's. Thanks to Bill B. for pointing out the problem.
A revised script is available on my scripts page (https://www.gwwilkins.org/gwwScripts.php). This script automatically detects DST and compensates for it in the image source names. May or may not work this fall, but it works now.
Incidentally, the SPC no longer allows i-framing of their 3 day outlook page, so that page (https://www.gwwilkins.org/wxspc3doutlook.php) is no longer functional.
-
Thanks Jerry
MikeyM
www.mikeymsweather.com