Good morning,
I have been using Gerry Wilkins Sun Piechart code in my site's menubar.php for many years now. Today, I updated my Saratoga template and I am now getting an Undefined Error message shown in the attached. I have included the code mentioned.... line 120 is the line below that says "if ($displayYesterday) {"
It should be noted that menubar.php was not a file included in the Saratoga update.
If anyone could give me a quick hit in the head as to how to define that variable properly, I'd appreciate it.
Cheers!
Chris
<!-- Code from Gerry Wilkins to display a Sunlight Piechart
includes civil, nautical, and astronomical twilight -->
<p class="sideBarTitle"><?php langtrans('Sunlight Hours'); ?></p>
<div class="sideBarText" style="font-weight:lighter; font-size: 6.5pt; text-align: center; margin-bottom:4px; line-height:135%">
<?php
include("heavens.php");
$hrsOfSunLight = array(); // [0] = yesterday, [1] = today, [2] = tomorrow
$changeinday2 = get_changeinday();
# echo '$changeinday2 = '.$changeinday2.'<br/>'; // Debug Code
//Make piechart
$timebits = explode(":", $hrsOfSunLight[1]); // Today
$testresult = $timebits[0] + $timebits[1]/60;
$test1jus=round(($testresult/24)*100,1);
$testmorker=100-$test1jus;
?>
<span class="thisPage" style="position: relative; font-weight:lighter">
<?php
$time_arr = explode(':', $changeinday2);
$time_arr[0]>0?$cidsign = '+': $cidsign ='-';
if ($time_arr[1]< 5) {
if ($displayYesterday) {
$time_arr2 = explode(':', $hrsOfSunLight[0]); // Yesterday
echo (int)$time_arr2[0] . " hrs " . (int)$time_arr2[1] . " min " . (int)$time_arr2[2]." sec";
echo '<br/>Sunlight Yesterday<br/>';
}
$time_arr = explode(':', $hrsOfSunLight[1]); // Today
echo (int)$time_arr[0] . " hrs " . (int)$time_arr[1] . " min " . (int)$time_arr[2]." sec";
echo '<br/>of Sunlight Today';
?>
<?php echo '<br/>Which is ';
$time_arr = explode(':', $changeinday2);
echo (((int)$time_arr[1]>0)?('<br/>'.(int)$time_arr[1] . ' min '):' ') . $time_arr[2];
echo (substr($time_arr[0],0,1) != "-")?' sec Longer':' sec Shorter'; // '-' when getting shorter
echo ('<br/>Than Yesterday<br/>');
if ($displayTomorrow) {
$time_arr3 = explode(':', $hrsOfSunLight[2]); // Tomorrow
echo (int)$time_arr3[0] . " hrs " . (int)$time_arr3[1] . " min " . (int)$time_arr3[2]." sec";
echo '<br/>of Sunlight Tomorrow<br/>';
} ?>
</span>
<span class="thisPage" style="font-size:7px"><br/>(Noon)</span>
<a style="width:109px" href="<?php echo $sunLightPieLink?>" target="_blank" title="Astronomy Page in New Tab"><img style="width:109px; margin-left:auto; margin-right:auto" src="<?php echo getUniqueImageURL('./cache/heavenpie.png')?>" alt="graph"/></a>
<span class="thisPage" style="font-size:7px">(Midnight)<br/>
</span>
<span class="thisPage" style=" position:relative; font-weight:lighter">
<a style="cursor:pointer; text-align:center; width:109px" onmouseover="showspLegend('spLegend')" onmouseout="showspLegend()">Legend</a><img id="spLegend" style="display:none" src="./ajax-images/heavensLegend.png" alt="Legend"/>
</span>
<?php }
?>
<>
<!-- End of Gerry's Piechart Code -->