While it is perfectly ok to modify any of my scripts for your own use, I'd like to suggest a couple of ideas to help minimize your efforts to keep your template-based site working with new releases of the scripts as they become available.
I do tend to treat all the support scripts in the templates as 'just replaceable' without mods on your site since the major configuration is done in Settings.php for things like advforecast2.php.
So.. to simplify your future maintenance, consider a slight mod to wxforecast.php to replace <div id="main-copy">
<?php
$doIncludeNWS = true; // handle advforecast2.php include
$doIncludeWU = true; // handle WU-forecast include also
$doInclude = true; // handle ec-forecast and WXSIM include also
$doPrint = true; // ec-forecast.php setting
include_once($SITE['fcstscript']); ?>
with <div id="main-copy">
<?php
$doIncludeNWS = true; // handle advforecast2.php include
$doIncludeWU = true; // handle WU-forecast include also
$doInclude = true; // handle ec-forecast and WXSIM include also
$doPrint = false; // ec-forecast.php setting
$doPrintNWS = false; // suppress printing of advforecast2.php
include_once($SITE['fcstscript']); ?>
which will give all $forecast... variables filled in for you to print yourself.
In the bottom of advforecast2.php, the code to print can be copied to the wxforecast.php page and you can play around with the layout all you like AND not have to refit your mods when a newer advforecast2.php gets released (as it will when the NWS website changes...).
Here's the 'printing-part' of the advforecast2.php script you can include in your page <?php
}
print $Status;
// if the forecast text is blank, prompt the visitor to force an update
if (strlen($forecasttext[0])<2 and $PrintMode ) {
if(!isset($PHP_SELF)) { $PHP_SELF = $_SERVER['PHP_SELF']; }
echo '<br/><br/>Forecast blank? <a href="' . $PHP_SELF . '?force=1">Force Update</a><br/><br/>';
}
?>
<table width="640" style="border: none;">
<tr align="center">
<td><b>National Weather Service Forecast for: </b><span style="color: green;">
<?php echo $forecastcity; ?></span><br />
Issued by: <?php echo $forecastoffice; ?>
</td>
</tr>
<tr>
<td align="center">Updated: <?php echo $forecastupdated; ?>
</td><!--end forecastupdated-->
</tr>
<?php echo $ddMenu ?>
<tr>
<td align="center" style="font-size: 18px; margin: 0px auto;"><b><?php echo $NOAAlocation; ?></b></td>
</tr>
<tr>
<td align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign ="top" align="center">
<?php
for ($i=0;$i<count($forecasticons);$i++) {
print "<td style=\"width: 11%;\"><span style=\"font-size: 8pt;\">$forecasticons[$i]</span></td>\n";
}
?>
</tr>
<tr valign ="top" align="center">
<?php
for ($i=0;$i<count($forecasticons);$i++) {
print "<td style=\"width: 11%;\">$forecasttemp[$i]</td>\n";
}
?>
</tr>
</table>
</td>
</tr>
</table>
<p><?php
if($forecastwarnings <> '') {
print $forecastwarnings;
}
?> </p>
<table style="border: 0" width="640">
<?php
for ($i=0;$i<count($forecasttitles);$i++) {
print "<tr valign =\"top\" align=\"left\">\n";
print "<td style=\"width: 20%;\"><b>$forecasttitles[$i]</b><br /> <br /></td>\n";
print "<td style=\"width: 80%;\">$forecasttext[$i]</td>\n";
print "</tr>\n";
}
?>
</table>
<p> </p>
<p>Forecast from <a href="<?php if($usingFile) {
echo htmlspecialchars($backupfileName);
} else {
echo htmlspecialchars($fileName);
} ?>">NOAA-NWS</a>
for <?php echo $forecastcity; ?>. <?php echo $usingFile; ?>
<?php if($iconType <> '.jpg') {
print "<br/>Animated forecast icons courtesy of <a href=\"http://www.meteotreviglio.com/\">www.meteotreviglio.com</a>.";
}
?>
</p>
Hope this helps...
Best regards,
Ken