Changeset 1670885
- Timestamp:
- 06/05/2017 09:40:26 AM (9 years ago)
- Location:
- pdsweather
- Files:
-
- 3 added
- 2 edited
-
tags/3.2 (added)
-
tags/3.2/pdsWeather.php (added)
-
tags/3.2/readme.txt (added)
-
trunk/pdsWeather.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pdsweather/trunk/pdsWeather.php
r1407134 r1670885 12 12 /** 13 13 * @package pdsWeather 14 * @version 3. 114 * @version 3.2 15 15 */ 16 16 … … 26 26 $hour = date('H'); 27 27 28 28 29 if (!$current or count($current) <= 1) { 29 30 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'); 31 32 $resp = json_decode($fp, true); 32 33 … … 34 35 $current['time'] = date('Y-m-d H:i:s'); 35 36 update_option('pds_weather_current', $current); 37 36 38 } 37 39 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']))) { 39 41 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'); 41 43 $resp = json_decode($fp, true); 42 44 $current = $resp['current_observation']; … … 45 47 } 46 48 } 47 49 48 50 if ($current or count($current) > 1) { 49 51 $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 4 4 Tags: weather, current conditions 5 5 Requires at least: 3.0.1 6 Tested up to: 4. 57 Stable tag: 4. 56 Tested up to: 4.7 7 Stable tag: 4.7 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 55 55 == Changelog == 56 56 57 = 3.2 = 58 * solved bug for conditions after new year has started 59 * tested on 4.7 60 57 61 = 3.1 = 58 * removed print tof the results after save62 * removed print of the results after save 59 63 * tested on 4.5 60 64 * implement selective refresh for widget
Note: See TracChangeset
for help on using the changeset viewer.