} ws_message('<!-- module ' . $pageFile . ' ==== ' . $SITE['wsModules'][$pageFile] . ' -->'); #------------------------------------------------------------------------------- # generate html strings to display (parts) of the forecast page #----------------------------------------------------------------------- # load the settings $script = 'ec_settings.php'; ws_message('<!-- module ec_fct_generate_html.php (' . __LINE__ . '): loading ' . $script . ' -->'); include $script; # get the data from the weather class if (!isset($ecForecast)) { // check first if the script is already loaded (for warnings) so the class = OK $script = 'ec_fct_create_arr.php'; ws_message('<!-- module ec_fct_generate_html.php (' . __LINE__ . '): loading ' . $script . ' -->'); include_once $script; $weather = new ecPlainWeather(); } $ecForecast = $weather->getWeatherData($caProvince, $caCityCode); if (!is_array($ecForecast)) { ws_message('<!-- module ec_fct_generate_html.php (' . __LINE__ . '): no good data returned, script ends -->', true); ws_message('Module ec_fct_generate_html.php (' . __LINE__ . '): No good data - ending script'); return false; } #echo '<pre>'; print_r ($ecForecast); echo '</pre>'; #------------------------------------------------------------------------------- # now we generate the html to be used for output to the screen # $fileTime = $ecForecast['information']['fileTimeStamp']; $line1 = 'Environment Canada ' . langtransstr('forecast for') . ': ' . $yourArea; $line2 = ' ' . langtransstr('Updated') . ': ' . ecLongDate($fileTime) . ' - ' . date($timeFormat, $fileTime); # These are the first line(s) on the one page city forecast
#-----------------------------END OF SETTINGS --------------------------------- $warnScriptName = $pageName; $wrnStrings = ''; if (!$SITE['warnings'] == true) { return; } # Check if we want to include warnings on every page # $script = 'ec_settings.php'; ws_message('<!-- module ' . $warnScriptName . ' (' . __LINE__ . '): loading ' . $script . ' -->'); include $script; # $script = 'ec_fct_create_arr.php'; ws_message('<!-- module ' . $warnScriptName . ' (' . __LINE__ . '): loading ' . $script . ' -->'); include_once $script; $weather = new ecPlainWeather(); $ecForecast = $weather->getWeatherData($SITE['caProvince'], $SITE['caCityCode']); # # echo '<pre>'; print_r($ecForecast); echo '</pre>'; exit; # if (!isset($ecForecast['warnings']['maxType'])) { ws_message('<!-- module ' . $warnScriptName . ' (' . __LINE__ . '): no warnings retrieved -->'); return; } if ($ecForecast['warnings']['maxType'] == -1) { $warnings = false; } else { $warnings = true; } if (!$warnings && !$SITE['warningGreen']) { // there are no warnings more severe than green and we do not display them either