cory_booth
01-02-2010, 03:32 PM
I created an awesome Forecast Widget using code from:
http://saratoga-weather.org/scripts-carterlake.php#advforecast
and then making a widget:
ob_start();
require_once './xxxxx/weather/forecast.php';
$output=ob_get_contents();
ob_end_clean();
I installed the weather script as instructed and then made a pre-loader (forecast.php as loaded above) with this code:
<?php
$doPrintNWS = false;
require("/your absolute path/weather/advforecast.php"); ?>
<html>
<body style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;">
<table style="font-size:9px;" width="100%">
<tr align="center" valign="top">
<?php print "<td>$forecasticons[0]</td><td>$forecasticons[1]</td><td>$forecasticons[2]</td><td>$forecasticons[3]</td><td>$forecasticons[4]</td><td>$forecasticons[5]</td><td>$forecasticons[6]</td><td>$forecasticons[7]</td>\n"; ?>
</tr>
<tr align="center" valign="top">
<?php print "<td>$forecasttemp[0]</td><td>$forecasttemp[1]</td><td>$forecasttemp[2]</td><td>$forecasttemp[3]</td><td>$forecasttemp[4]</td><td>$forecasttemp[5]</td><td>$forecasttemp[6]</td><td>$forecasttemp[7]</td>\n"; ?>
</tr>
</table>
</body>
</html>
You will need to follow the instructions on downloading the weather icon package from the script makers's site.
http://saratoga-weather.org/scripts-carterlake.php#advforecast
and then making a widget:
ob_start();
require_once './xxxxx/weather/forecast.php';
$output=ob_get_contents();
ob_end_clean();
I installed the weather script as instructed and then made a pre-loader (forecast.php as loaded above) with this code:
<?php
$doPrintNWS = false;
require("/your absolute path/weather/advforecast.php"); ?>
<html>
<body style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;">
<table style="font-size:9px;" width="100%">
<tr align="center" valign="top">
<?php print "<td>$forecasticons[0]</td><td>$forecasticons[1]</td><td>$forecasticons[2]</td><td>$forecasticons[3]</td><td>$forecasticons[4]</td><td>$forecasticons[5]</td><td>$forecasticons[6]</td><td>$forecasticons[7]</td>\n"; ?>
</tr>
<tr align="center" valign="top">
<?php print "<td>$forecasttemp[0]</td><td>$forecasttemp[1]</td><td>$forecasttemp[2]</td><td>$forecasttemp[3]</td><td>$forecasttemp[4]</td><td>$forecasttemp[5]</td><td>$forecasttemp[6]</td><td>$forecasttemp[7]</td>\n"; ?>
</tr>
</table>
</body>
</html>
You will need to follow the instructions on downloading the weather icon package from the script makers's site.