Changeset 140192
- Timestamp:
- 07/28/2009 07:46:13 PM (17 years ago)
- Location:
- wp-google-weather/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wp-google-weather.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-google-weather/trunk/readme.txt
r139837 r140192 43 43 == Installation == 44 44 45 1. Unzip and upload files the files to wp-content/plugins/wp-google-weather 46 47 2. Activate the plugin 48 49 3. Go to Themes > Widgets and drag WP Google Weather widget to your sidebar 50 51 4. Specify title, city, country (optional), temperature as Celsius or Fahrenheit and language (ISO 639-1 code) 52 53 5. decide whether it should display only today's weather or also a 3 day forecast 45 1. Unzip and upload files the files to /wp-content/plugins/wp-google-weather 46 2. Activate the plugin 47 3. Go to Themes > Widgets and drag WP Google Weather widget to your sidebar 48 4. Specify title, city, country (optional), temperature as Celsius or Fahrenheit and language (ISO 639-1 code) 49 5. decide whether it should display only today's weather or also a 3 day forecast 54 50 55 51 56 52 == Screenshots == 57 53 58 1. Screenshot widget options59 2. Screenshot frontend view54 1. Widget options 55 2. Frontend view 60 56 61 57 … … 76 72 77 73 == Changelog == 78 no updates yet 74 = 0.2 - 28.07.2009 = 75 * checking unit_system param of Google weather API output to convert Fahrenheit to Celsius (thanks Mike) 79 76 77 = 0.1 - 25.07.2009 = 78 * initial release 79 * fixed include path (thanks Dietmar) 80 80 81 81 == Todos == 82 82 83 83 * add admin_notices after install, direct link to widget page 84 * add language packfor backend84 * add translation for backend 85 85 * choose from different styles 86 -
wp-google-weather/trunk/wp-google-weather.php
r139868 r140192 4 4 Plugin URI: http://imwill.com/wp-google-weather/ 5 5 Description: Displays a weather widget using the Google weather API. 6 Version: 0. 16 Version: 0.2 7 7 Author: Hendrik Will 8 8 Author URI: http://imwill.com … … 164 164 $xmlData = simplexml_load_string(utf8_encode($output)); 165 165 166 $unit_system = $xmlData->weather->forecast_information->unit_system['data']; 167 166 168 #define conditions array 167 169 $conditions = array(); … … 183 185 $conditions['forecast'][$i]['low'] = $xmlData->weather->forecast_conditions[$i]->low['data']; 184 186 $conditions['forecast'][$i]['condition'] = $xmlData->weather->forecast_conditions[$i]->condition['data']; 187 } 188 189 #convert Fahrenheit to Celsius if needed 190 if($unit_system=='US' AND ($temp=='c')) { 191 for($i=0; $i<=3; $i++) { 192 $conditions['forecast'][$i]['high'] = intval(($conditions['forecast'][$i]['high']-32)*5/9); 193 $conditions['forecast'][$i]['low'] = intval(($conditions['forecast'][$i]['low']-32)*5/9); 194 } 185 195 } 186 196
Note: See TracChangeset
for help on using the changeset viewer.