| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /* This file is part of the wp-forecast plugin for wordpress */ |
| 3 | 3 | |
| 4 | -/* Copyright 2006-2009 Hans Matzen (email : webmaster at tuxlog dot de) | |
| 4 | +/* Copyright 2006-2011 Hans Matzen (email : webmaster at tuxlog dot de) | |
| 5 | 5 | |
| 6 | 6 | This program is free software; you can redistribute it and/or modify |
| 7 | 7 | it under the terms of the GNU General Public License as published by |
| 8 | 8 | the Free Software Foundation; either version 2 of the License, or |
| @@ -259,9 +259,9 @@ | ||
| 259 | 259 | { |
| 260 | 260 | pdebug(1,"Start of bug_get_locations ()"); |
| 261 | 261 | |
| 262 | 262 | // start_element() - wird vom XML-Parser bei öffnenden Tags aufgerufen |
| 263 | - function s_element( $parser, $name, $attribute ) | |
| 263 | + function bug_s_element( $parser, $name, $attribute ) | |
| 264 | 264 | { |
| 265 | 265 | global $loc,$i; |
| 266 | 266 | if ($name == "AWS:LOCATION") { |
| 267 | 267 | $loc[$i]=array(); |
| @@ -275,9 +275,9 @@ | ||
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | // end_element() - dummy function |
| 279 | - function e_element( $parser, $name ){} | |
| 279 | + function bug_e_element( $parser, $name ){} | |
| 280 | 280 | |
| 281 | 281 | // Instanz des XML-Parsers erzeugen |
| 282 | 282 | $parser = xml_parser_create(); |
| 283 | 283 | |
| @@ -284,9 +284,9 @@ | ||
| 284 | 284 | // Parameter des XML-Parsers setzen |
| 285 | 285 | xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, true ); |
| 286 | 286 | |
| 287 | 287 | // Handler für Elemente ( öffnende / schließende Tags ) setzen |
| 288 | - xml_set_element_handler( $parser, "s_element", "e_element" ); | |
| 288 | + xml_set_element_handler( $parser, "bug_s_element", "bug_e_element" ); | |
| 289 | 289 | |
| 290 | 290 | // try to parse the xml |
| 291 | 291 | if( !xml_parse( $parser, $xml,true ) ) |
| 292 | 292 | { |
| @@ -320,9 +320,9 @@ | ||
| 320 | 320 | $wpf_vars['wpf_language']=$language_override; |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | extract($wpf_vars); |
| 324 | - $w=unserialize(get_option("wp-forecast-cache".$wpfcid)); | |
| 324 | + $w=maybe_unserialize(wpf_get_option("wp-forecast-cache".$wpfcid)); | |
| 325 | 325 | |
| 326 | 326 | // get translations |
| 327 | 327 | if(function_exists('load_textdomain')) { |
| 328 | 328 | global $l10n; |
| @@ -340,15 +340,17 @@ | ||
| 340 | 340 | $weather_arr['locname']= $w["city"]." ".$w["state"]; |
| 341 | 341 | |
| 342 | 342 | |
| 343 | 343 | |
| 344 | - $ct = time(); // this is the GMT | |
| 344 | + $ct = time(); // this is the GMT | |
| 345 | + $ct = $ct + $wpf_vars['timeoffset'] * 60; // add or subtract time offset | |
| 345 | 346 | $weather_arr['blogdate']=date_i18n($fc_date_format, $ct); |
| 346 | 347 | $weather_arr['blogtime']=date_i18n($fc_time_format, $ct); |
| 347 | 348 | |
| 348 | 349 | $cts = $w['time']; |
| 349 | - $gmtoffset=get_option("gmt_offset"); | |
| 350 | - $ct = strtotime($cts) + ($gmtoffset * 3600); | |
| 350 | + $gmtoffset=0; // wpf_get_option("gmt_offset"); | |
| 351 | + $ct = strtotime($cts) + ($gmtoffset * 3600); | |
| 352 | + | |
| 351 | 353 | $weather_arr['bugdate']=date_i18n($fc_date_format, $ct); |
| 352 | 354 | $weather_arr['bugtime']=date_i18n($fc_time_format, $ct); |
| 353 | 355 | |
| 354 | 356 | |
| @@ -367,9 +369,9 @@ | ||
| 367 | 369 | $weather_arr['winddir']=translate_winddir($w["winddirection"],"wp-forecast_".$wpf_language); |
| 368 | 370 | $weather_arr['windgusts']=windstr($metric,$w["wgusts"],$windunit); |
| 369 | 371 | list($dummy, $weather_arr['sunrise']) = split(" ",$w['sunrise'],2); |
| 370 | 372 | list($dummy, $weather_arr['sunset'] ) = split(" ",$w['sunset'] ,2); |
| 371 | - $weather_arr['copyright']='<a href="http://www.weatherbug.com">Copyright 2009 WeatherBug</a>'; | |
| 373 | + $weather_arr['copyright']='<a href="http://www.weatherbug.com">© '.date("Y").' WeatherBug</a>'; | |
| 372 | 374 | |
| 373 | 375 | // additional info |
| 374 | 376 | $weather_arr['lat']=$w['lat']; |
| 375 | 377 | $weather_arr['lon']=$w['lon']; |