Plugin Directory

Changeset 1670885


Ignore:
Timestamp:
06/05/2017 09:40:26 AM (9 years ago)
Author:
proodos
Message:

bugfix for the break of the year

Location:
pdsweather
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • pdsweather/trunk/pdsWeather.php

    r1407134 r1670885  
    1212/**
    1313 * @package pdsWeather
    14  * @version 3.1
     14 * @version 3.2
    1515 */
    1616
     
    2626        $hour = date('H');
    2727
     28
    2829        if (!$current or count($current) <= 1) {
    2930            if (get_option('locid')) {
    30                 $fp = file_get_contents('http://api.wunderground.com/api/' . $api_key . '/conditions/' . get_option('locid') . '.json', 'r');
     31                $fp = file_get_contents('http://api.wunderground.com/api/' . $api_key . '/conditions' . get_option('locid') . '.json', 'r');
    3132                $resp = json_decode($fp, true);
    3233
     
    3435                $current['time'] = date('Y-m-d H:i:s');
    3536                update_option('pds_weather_current', $current);
     37
    3638            }
    3739
    38         } elseif ($hour > date('H', strtotime($current['time'])) || date('md') > date('md', strtotime($current['time']))) {
     40        } elseif ($hour > date('H', strtotime($current['time'])) || date('Ymd') > date('Ymd', strtotime($current['time']))) {
    3941            if (get_option('locid')) {
    40                 $fp = file_get_contents('http://api.wunderground.com/api/' . $api_key . '/conditions/' . get_option('locid') . '.json', 'r');
     42                $fp = file_get_contents('http://api.wunderground.com/api/' . $api_key . '/conditions' . get_option('locid') . '.json', 'r');
    4143                $resp = json_decode($fp, true);
    4244                $current = $resp['current_observation'];
     
    4547            }
    4648        }
    47 
     49       
    4850        if ($current or count($current) > 1) {
    4951            $sunset = date_sunset(time(), SUNFUNCS_RET_TIMESTAMP, $current['display_location']['latitude'], $current['display_location']['longitude'], $current['display_location']['elevation'], 1);
  • pdsweather/trunk/readme.txt

    r1407132 r1670885  
    44Tags: weather, current conditions
    55Requires at least: 3.0.1
    6 Tested up to: 4.5
    7 Stable tag: 4.5
     6Tested up to: 4.7
     7Stable tag: 4.7
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5555== Changelog ==
    5656
     57= 3.2 =
     58* solved bug for conditions after new year has started
     59* tested on 4.7
     60
    5761= 3.1 =
    58 * removed printt of the results after save
     62* removed print of the results after save
    5963* tested on 4.5
    6064* implement selective refresh for widget
Note: See TracChangeset for help on using the changeset viewer.