I think I know what is different.
Is this line: $filename = get_noaa_filename($year,$m,$SITE['WXsoftware'],$current_month);
This will overwrite the declaration I have for the noaa files. This makes the script thinks is not running in a Saratoga template and brakes.
If I run standalone all of the data shows correctly BUT... All I get is one wide page and not the template.
How can I overwrite that line so it can ignore SITE and WXsoftware?
To be precise here is why wxsunhourdetail works:
// Check for current year and current month
if ($year == date("Y") && $m == ( date("n") - 1) && ((date("j") != 1 ) OR $show_today)) {
$filename = "climatedataout.html";
$current_month = 1;
} else {
$filename = "climatedataout" . ( $m + 1 ) . $year . ".html";
$current_month = 0;
}
if ($current_month AND $show_today AND date("j")==1){
$raw[$m][0][0] = $hours_today;
} else {
$raw[$m][0] = getclimatefile($locmc . $filename,'Sun Hours',$year,$m);
}
if ($current_month AND $show_today){
$raw[$m][0][date("j")-1] = $hours_today;
}
}
}
Where in wxtempdetail looks like this:
// Check for current year and current month
if ($year == date("Y") && $m == ( date("n") - 1) && ((date("j") != 1 ) OR $show_today)) {
$current_month = 1;
} else {
$current_month = 0;
}
$filename = get_noaa_filename($year,$m,$SITE['WXsoftware'],$current_month);
if ($current_month AND $show_today AND date("j")==1){
$raw[$m][0][0][8] = strip_units($dayrn);
} else {
$raw[$m][0] = getnoaafile($locmc . $filename,$year,$m);
}
if ($current_month AND $show_today){
$raw[$m][0][date("j")-1][8] = strip_units($dayrn);
}
if ($current_month AND (date("j")==2) AND ('WDxxx' == $SITE['WXsoftware'])){ // Fix for WD rain on first day of month not listed in NOAA report until the 3rd day of the month.
if ((strip_units($yesterdayrain))>0){
$raw[$m][0][date("j")-2][8] = strip_units($yesterdayrain);
}
}
}
sundetail has no declaration of $SITE['WXsoftware']
Ideas?