I have resorted to including the entire fwi.php file in the cater lake template page. But that still does not get me past it.
On the site the original page works and displays the gif fine but as soon as it is in carter lake template in fails and just shows the text of the file.
The fwi.php file works file
http://tokoroaweatherlive.dyndns.org/fwi.phpThe file I want it to display in
http://tokoroaweatherlive.dyndns.org/wxfwi.phpBelow is the content of my body section of the code
<body>
<?php
############################################################################
include("header.php");
############################################################################
include("menubar.php");
############################################################################
?>
<!--start main content-->
<div id="main-copy">
<?php
// Based on firedanger script by SLOweather.com, modified to use Weather
// Display clientraw.txt data file. Release 08/25/07 by W7RSW
// Initial release 070625 (YYMMDD) by SLOweather.com
// This script uses temperature in F and relative Humidity to
// calculate the Chandler Burning index and then select the
// appropriate graphic to display. It also selects the proper
// adjective for the current conditions, but this feature is not
// currently used for anything.
// As written, it requires an image pack of 5 graphics for each of
// the 5 danger levels, in the same directory as the script.
// Based on data from Anole's stickertags.txt file.
// For more information on the Chandler Burning Index:
// http://www.fs.fed.us/psw/topics/fire_science/fire_weather/mfwf/MFWFDesc.shtml
// For the Adjective Fire Danger text for each CBI level
// http://famweb.nwcg.gov/pocketcards/adjective.htm
// DATA FILE: defines the path to the data file.
// The path can be absolute or relative or a URL)!!
$data_file_path = 'clientraw.txt';
// get the data file
$dataraw = file_get_contents($data_file_path);
// see if the data file is a WD clientraw.txt file and set
// the WD flag for those specific routines to be executed.
if (preg_match('|clientraw.txt|', $data_file_path)){
$use_wd_clientraw = '1';
} //end if
// clean up any blank lines
$dataraw = trim($dataraw);
$dataraw = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/","\n",$dataraw);
// if we're using the WD clientraw.txt we have a lot of work to do to make it
// pretty. So here we go:
// put the clientraw.txt data into an array and define the data points
if ($use_wd_clientraw == '1') {
$data = explode(" ", $dataraw);
// clean up and define
(float)$cTemp = "$data[4]";
(float)$rh = "$data[5]";
function tempToFahrenheit ($cTemp, $prec=0)
// Given a temperature in degrees Fahrenheit, convert it
// to Celsius and return the value. Use an integer for
// precision ($prec) to round the converted value.
// Returns FALSE on error.
{
if (!isset($cTemp)) {
return false;
}
$prec = (integer)$prec;
$fTemp = (float)(1.8 * $cTemp) + 32;
return round($fTemp, $prec);
}
$ftemp = tempToFahrenheit ($cTemp);
// Start Index Calcs
// Chandler Index
$cbi = (((110 - 1.373 * $rh) - 0.54 * (10.20 - $cTemp)) * (124 * pow(10,(-0.0142*"$rh"))))/60;
// CBI = (((110 - 1.373*RH) - 0.54 * (10.20 - T)) * (124 * 10**(-0.0142*RH)))/60
//Sort out the Chandler Index
if ($cbi > "97.5") {
$cbitxt = "EXTREME";
$cbiimg= "fdl_extreme.gif";
} elseif ($cbi >="90") {
$cbitxt = "VERY HIGH";
$cbiimg= "fdl_vhigh.gif";
} elseif ($cbi >= "75") {
$cbitxt = "HIGH";
$cbiimg= "fdl_high.gif";
} elseif ($cbi >= "50") {
$cbitxt = "MODERATE";
$cbiimg= "fdl_moderate.gif";
} else
if ($cbi < "50") {
$cbitxt="LOW";
$cbiimg= "fdl_low.gif";
}
$img = imagecreatefromgif($cbiimg);
// additions by Saratoga-Weather.org
$degree_units = '°C';
$color_red = imagecolorallocate($img,255,0,0); // RED
$color_green = imagecolorallocate($img,0,128,0); // GREEN
// If Celsius units desired, use
$ntemp = round($cTemp,1);
// $ntemp = round($ftemp,1);
$nrh = round($rh,0);
$ncbi = round($cbi,0);
imagestring($img, 2, 90, 116, "$ntemp$degree_units", $color_green);
imagestring($img, 2, 130, 116, "$nrh%", $color_green);
imagestring($img, 2, 98, 127, "CBI: $ncbi", $color_red);
// ---------------------------------
//header("Content-type: image/gif"); //defined in ajax-gizmo
imageGIF($img);
imagedestroy($img);
}
</div>
<!-- end main-copy -->