$level = colorLookup($value); if (!($value === $empty || $value === $noValue)) { $value = round($value, $round); $value = sprintf($numFormat, $value); } echo '<td class="' . $level . '" colspan="' . $valuesMonth . '">' . $value . '</td>'; } echo '</tr>' . PHP_EOL; } echo '</table>'; # # legenda # echo '<table id="legend" class="genericTable" style="width: 100%;">' . PHP_EOL; echo '<tr class="separator"><td colspan="' . ($increments + 1) . '"> </td></tr>' . PHP_EOL; $text = wsReporttransstr($trans . 'Color key'); echo '<tr class="table-top"><td colspan="' . ($increments + 1) . '">' . $text . '</td></tr>' . PHP_EOL; echo '<tr>'; $width = 'style="width: ' . round(100 / ($increments + 1), 3) . '%;"'; for ($i = 0; $i <= $increments; $i++) { if ($i == 0) { $from = '< '; $to = ${$levelArr}[$i]; } elseif ($i == $increments) { $from = ${$levelArr}[$i - 1]; $to = ' > '; } else { $from = ${$levelArr}[$i - 1] . ' - '; $to = ${$levelArr}[$i]; } echo '<td class="level_' . $i . '" ' . $width . '>' . $from . $to . '</td>';
if ($type == 'summonthly' || $type == 'sumseasonal') { include $wsreportsDir . 'wsReportsSum.php'; } elseif ($type == 'freezedays') { include $wsreportsDir . 'wsReportsFreeze.php'; } else { include $wsreportsDir . 'wsReportsDaily.php'; } # echo '</div>' . PHP_EOL; # credits $link_leuven = 'http://leuven-template.eu/'; $link_wildwoodweather = 'http://weather.wildwoodnaturist.com/'; $link_wundergroundsite = 'http://www.wunderground.com/personal-weather-station/dashboard?ID=' . $SITE['wuID']; $stringCredit = '<br /><p class="blockHead" style="text-align: center"><small>'; $stringCredit .= wsReporttransstr($trans . 'Script developed by Wim van der Kuil of') . ' <a href="' . $link_leuven . '" target="_blank">Weerstation Leuven</a>. '; $stringCredit .= wsReporttransstr($trans . 'The script uses the data from this station which is uploaded to') . ' <a href="' . $link_wundergroundsite . '" target="_blank">Weather Underground</a>. '; $stringCredit .= wsReporttransstr($trans . 'The idea for this script came from a similar kind of script using NOAA data, written by Murry Conarroe of') . ' <a href="' . $link_wildwoodweather . '" target="_blank" >Wildwood Weather</a>. '; $stringCredit .= '</small></p>' . PHP_EOL; echo $stringCredit; # missing language translations if (isset($ownTranslate) && count($missingTrans) != 0) { $string = ''; echo '<!-- wsreport_start.php missing langlookup entries for lang=' . $lang . PHP_EOL; foreach ($missingTrans as $key => $val) { $string .= "langlookup|{$key}|{$val}|" . PHP_EOL; } if (strlen($string) > 0) { echo $string; } echo count($missingTrans) . ' entries.' . PHP_EOL . 'End of missing langlookup entries -->' . PHP_EOL; }
function freezes_longdate($time, $year = true) { global $SITE, $trans; $int_time = strtotime($time . 'T000000'); $freezeLong = $SITE['dateLongFormat']; # 'l d F Y'; Vrijdag, 5 februari 2013 US 'l M j Y'; $longDays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); $longMonths = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); # $longDate = date($freezeLong, $int_time); if ($year == false) { $longDate = str_replace(date('Y', $int_time), '', $longDate); } $from = array(); $to = array(); for ($i = 0; $i < count($longDays); $i++) { if (freezesFound($longDate, $longDays[$i])) { $from[] = $longDays[$i]; if ($year) { $to[] = wsReporttransstr($longDays[$i]); } else { $to[] = ''; } break; } } for ($i = 0; $i < count($longMonths); $i++) { if (freezesFound($longDate, $longMonths[$i])) { $from[] = $longMonths[$i]; $to[] = wsReporttransstr($trans . $longMonths[$i]); break; } } $longDate = str_replace($from, $to, $longDate); return $longDate; }