Changeset 132985
- Timestamp:
- 07/08/2009 11:06:35 AM (17 years ago)
- Location:
- myweather
- Files:
-
- 10 added
- 2 edited
- 11 copied
-
tags/2.4.9 (added)
-
tags/2.4.9/admin.myweather.php (copied) (copied from myweather/trunk/admin.myweather.php)
-
tags/2.4.9/cache (copied) (copied from myweather/trunk/cache)
-
tags/2.4.9/gpl.txt (copied) (copied from myweather/trunk/gpl.txt)
-
tags/2.4.9/languages (copied) (copied from myweather/trunk/languages)
-
tags/2.4.9/minixml (copied) (copied from myweather/trunk/minixml)
-
tags/2.4.9/myweather.php (copied) (copied from myweather/trunk/myweather.php) (4 diffs)
-
tags/2.4.9/readme.txt (copied) (copied from myweather/trunk/readme.txt) (1 diff)
-
tags/2.4.9/screenshot-1.png (copied) (copied from myweather/trunk/screenshot-1.png)
-
tags/2.4.9/screenshot-2.png (copied) (copied from myweather/trunk/screenshot-2.png)
-
tags/2.4.9/systems (added)
-
tags/2.4.9/systems/weather.com.php (added)
-
tags/2.4.9/systems/yahoo.php (added)
-
tags/2.4.9/templates (added)
-
tags/2.4.9/templates/default (copied) (copied from myweather/trunk/templates/default)
-
tags/2.4.9/templates/default/template.html (copied) (copied from myweather/trunk/templates/default/template.html)
-
tags/2.4.9/weather.com.php (added)
-
tags/2.4.9/yahoo.php (added)
-
trunk/myweather.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/systems (added)
-
trunk/systems/weather.com.php (added)
-
trunk/systems/yahoo.php (added)
Legend:
- Unmodified
- Added
- Removed
-
myweather/tags/2.4.9/myweather.php
r90200 r132985 2 2 /* 3 3 Plugin Name: myWeather 4 Version: 2.4. 84 Version: 2.4.9 5 5 Plugin URI: http://www.thedeveloperinside.com/blog/myweather-20-released 6 6 Author: Eduardo … … 70 70 function wp_myweather(){ 71 71 require_once(dirname(__FILE__).'/minixml/minixml.inc.php'); 72 require_once(dirname(__FILE__)."/systems/yahoo.php"); 72 73 global $plugin_directory; 73 74 $city=get_option('wp_weather_city'); … … 88 89 } 89 90 91 90 92 $citylist=unserialize($city); 91 93 if(is_array($citylist)){ … … 98 100 $t_type="C"; 99 101 } 100 $fdata = "http://xoap.weather.com/weather/local/".$code."?cc=*&dayf=0"; 101 102 $file=search_file_cached($code,$fdata); 103 104 $xmlObj = new MiniXMLDoc(); 105 106 $xmlObj->fromString($file); 107 $xml = $xmlObj->getRoot(); 108 109 $template=array(); 110 111 $head = $xml->getElement('head'); 112 if($head){ 113 $locale = $head->getElement('locale'); 114 115 $template['locale']=$locale->getValue(); //lingua 102 $template=myWeatherGetData($code,$t_type); 116 103 117 $form = $head->getElement('form'); 118 119 $template['form']=$form->getValue(); //formato 120 121 $ut = $head->getElement('ut'); 122 123 $template['ut']=$ut->getValue(); //scala temperatura 124 125 $ud = $head->getElement('ud'); 126 127 $template['ud']=$ud->getValue(); //scala distanza 128 129 $us = $head->getElement('us'); 130 131 $template['us']=$us->getValue(); //scala velocita/tempo 132 133 $up = $head->getElement('up'); 134 135 $template['up']=$up->getValue(); //scala pressione 136 137 $ur = $head->getElement('ur'); 138 139 $template['ur']=$ur->getValue(); // 140 141 $loc = $xml->getElement('loc'); 142 $dnam = $loc->getElement('dnam'); 143 144 $template['city']=$dnam->getValue(); //nome citta 145 146 $tm = $loc->getElement('tm'); 147 148 $template['time']=$tm->getValue(); //orario 149 150 $lat = $loc->getElement('lat'); 151 152 $template['lat']=$lat->getValue(); //latitudine 153 154 $lon = $loc->getElement('lon'); 155 156 $template['lon']=$lon->getValue(); //longitudine 157 158 $suns = $loc->getElement('suns'); 159 160 $template['suns']=$suns->getValue(); //alba 161 162 $sunr = $loc->getElement('sunr'); 163 164 $template['sunr']=$sunr->getValue(); //tramonto 165 166 $zone = $loc->getElement('zone'); 167 168 $template['zone']=$zone->getValue(); //zona 169 170 $cc = $xml->getElement('cc'); 171 $lsup = $cc->getElement('lsup'); 172 173 $template['lsup']=$lsup->getValue(); //data rilevamento 174 175 $obst = $cc->getElement('obst'); 176 177 $template['obst']=$obst->getValue(); //osservatorio 178 179 $tmp = $cc->getElement('tmp'); 180 181 $template['tmp']=$tmp->getValue(); //temperatura 182 183 $flik = $cc->getElement('flik'); 184 185 $template['flik']=$flik->getValue(); //feel like 186 187 $t = $cc->getElement('t'); 188 189 $template['weather']=$t->getValue(); //meteo 190 191 $icon = $cc->getElement('icon'); 192 193 $template['icon']=$icon->getValue(); //icona tempo 194 195 $bar = $cc->getElement('bar'); 196 $r = $bar->getElement('r'); 197 198 $template['bar_r']=$r->getValue(); //pressione 199 200 $bar = $cc->getElement('bar'); 201 $d = $bar->getElement('d'); 202 203 $template['bar_d']=$d->getValue(); //tipo pressione 204 205 $wind = $cc->getElement('wind'); 206 $s = $wind->getElement('s'); 207 208 $template['wind_s']=$s->getValue(); //velocità vento 209 210 $wind = $cc->getElement('wind'); 211 $gust = $wind->getElement('gust'); 212 213 $template['wind_gust']=$gust->getValue(); //raffica 214 215 $wind = $cc->getElement('wind'); 216 $d = $wind->getElement('d'); 217 218 $template['wind_d']=$d->getValue(); // 219 220 $wind = $cc->getElement('wind'); 221 $t = $wind->getElement('t'); 222 223 $template['wind_t']=$t->getValue(); //direzione vento (N,S,E,W) 224 225 $hmid = $cc->getElement('hmid'); 226 227 $template['hmid']=$hmid->getValue(); //umidità in % 228 229 $vis = $cc->getElement('vis'); 230 231 $template['vis']=$vis->getValue(); //visibilità (distanza) 232 233 $uv = $cc->getElement('uv'); 234 $i = $uv->getElement('i'); 235 236 $template['uv_i']=$i->getValue(); // raggi uv 237 238 $uv = $cc->getElement('uv'); 239 $t = $uv->getElement('t'); 240 241 $template['uv_t']=$t->getValue(); // tipo raggi 242 243 $dewp = $cc->getElement('dewp'); 244 245 $template['dewp']=$dewp->getValue(); //Punto di rugiada (in temp) 246 247 $moon = $cc->getElement('moon'); 248 $icon = $moon->getElement('icon'); 249 250 $template['moon_icon']=$icon->getValue(); //icona luna 251 252 $moon = $cc->getElement('moon'); 253 $t = $moon->getElement('t'); 254 255 $template['moon_t']=$t->getValue(); //tipo luna 256 257 list($template['city'])=explode(",",$template['city']); 258 list($template['city'])=explode("/",$template['city']); 259 260 switch($t_type){ 261 default: 262 case "F": 263 $template['tmp']=$template['tmp']."°"; 264 $template['flick']=$template['flick']."°"; 265 $template['dewp']=round(($template['dewp']-32)/(1.8))."°"; 266 $template['wind_s']=$template['wind_s']." mph"; 267 $template['vis']=$template['vis']." miles"; 268 break; 269 case "C": 270 $template['tmp']=round(($template['tmp']-32)/(1.8))."°"; 271 $template['flick']=round(($template['flick']-32)/(1.8))."°"; 272 $template['dewp']=round(($template['dewp']-32)/(1.8))."°"; 273 $template['wind_s']=round($template['wind_s']*(1.6))." km/h"; 274 $template['vis']=round($template['vis']*(1.6))." km"; 275 break; 276 } 277 switch($template['icon']){ 278 default: 279 case 44: 280 $icon=0; 281 break; 282 case 5: 283 case 8: 284 case 9: 285 case 11: 286 $icon=1; 287 break; 288 case 15: 289 case 25: 290 $icon=2; 291 break; 292 case 20: 293 $icon=3; 294 break; 295 case 32: 296 case 36: 297 $icon=4; 298 break; 299 case 19: 300 case 21: 301 case 22: 302 $icon=5; 303 break; 304 case 0: 305 case 1: 306 case 2: 307 case 3: 308 case 4: 309 case 17: 310 case 35: 311 case 37: 312 case 38: 313 case 47: 314 $icon=6; 315 break; 316 case 39: 317 $icon=7; 318 break; 319 case 13: 320 $icon=8; 321 break; 322 case 23: 323 case 24: 324 $icon=9; 325 break; 326 case 14: 327 $icon=10; 328 break; 329 case 14: 330 case 16: 331 case 18: 332 case 41: 333 case 42: 334 case 43: 335 case 46: 336 $icon=11; 337 break; 338 case 10: 339 case 12: 340 case 40: 341 case 45: 342 $icon=12; 343 break; 344 case 26: 345 $icon=13; 346 break; 347 case 6: 348 case 7: 349 $icon=14; 350 break; 351 case 28: 352 case 30: 353 case 34: 354 $icon=15; 355 break; 356 case 27: 357 case 29: 358 case 31: 359 case 33: 360 $icon=16; 361 break; 362 } 104 if(is_array($template)){ 363 105 364 365 $template['icon']=$plugin_directory .'templates/'.$usedtemplate.'/icon/'.$icon.''; 106 $template['icon']=$plugin_directory .'templates/'.$usedtemplate.'/icon/'.$template['icon'].'.gif'; 366 107 367 108 $loadfile=file_get_contents(dirname(__FILE__).'/templates/'.$usedtemplate.'/template.html'); -
myweather/tags/2.4.9/readme.txt
r90200 r132985 5 5 Requires at least: 2.2 6 6 Tested up to: 2.5.1 7 Stable tag: 2.4. 87 Stable tag: 2.4.9 8 8 9 9 myWeather plugin allows you to set up displays for cities of your choice. -
myweather/trunk/myweather.php
r90200 r132985 2 2 /* 3 3 Plugin Name: myWeather 4 Version: 2.4. 84 Version: 2.4.9 5 5 Plugin URI: http://www.thedeveloperinside.com/blog/myweather-20-released 6 6 Author: Eduardo … … 70 70 function wp_myweather(){ 71 71 require_once(dirname(__FILE__).'/minixml/minixml.inc.php'); 72 require_once(dirname(__FILE__)."/systems/yahoo.php"); 72 73 global $plugin_directory; 73 74 $city=get_option('wp_weather_city'); … … 88 89 } 89 90 91 90 92 $citylist=unserialize($city); 91 93 if(is_array($citylist)){ … … 98 100 $t_type="C"; 99 101 } 100 $fdata = "http://xoap.weather.com/weather/local/".$code."?cc=*&dayf=0"; 101 102 $file=search_file_cached($code,$fdata); 103 104 $xmlObj = new MiniXMLDoc(); 105 106 $xmlObj->fromString($file); 107 $xml = $xmlObj->getRoot(); 108 109 $template=array(); 110 111 $head = $xml->getElement('head'); 112 if($head){ 113 $locale = $head->getElement('locale'); 114 115 $template['locale']=$locale->getValue(); //lingua 102 $template=myWeatherGetData($code,$t_type); 116 103 117 $form = $head->getElement('form'); 118 119 $template['form']=$form->getValue(); //formato 120 121 $ut = $head->getElement('ut'); 122 123 $template['ut']=$ut->getValue(); //scala temperatura 124 125 $ud = $head->getElement('ud'); 126 127 $template['ud']=$ud->getValue(); //scala distanza 128 129 $us = $head->getElement('us'); 130 131 $template['us']=$us->getValue(); //scala velocita/tempo 132 133 $up = $head->getElement('up'); 134 135 $template['up']=$up->getValue(); //scala pressione 136 137 $ur = $head->getElement('ur'); 138 139 $template['ur']=$ur->getValue(); // 140 141 $loc = $xml->getElement('loc'); 142 $dnam = $loc->getElement('dnam'); 143 144 $template['city']=$dnam->getValue(); //nome citta 145 146 $tm = $loc->getElement('tm'); 147 148 $template['time']=$tm->getValue(); //orario 149 150 $lat = $loc->getElement('lat'); 151 152 $template['lat']=$lat->getValue(); //latitudine 153 154 $lon = $loc->getElement('lon'); 155 156 $template['lon']=$lon->getValue(); //longitudine 157 158 $suns = $loc->getElement('suns'); 159 160 $template['suns']=$suns->getValue(); //alba 161 162 $sunr = $loc->getElement('sunr'); 163 164 $template['sunr']=$sunr->getValue(); //tramonto 165 166 $zone = $loc->getElement('zone'); 167 168 $template['zone']=$zone->getValue(); //zona 169 170 $cc = $xml->getElement('cc'); 171 $lsup = $cc->getElement('lsup'); 172 173 $template['lsup']=$lsup->getValue(); //data rilevamento 174 175 $obst = $cc->getElement('obst'); 176 177 $template['obst']=$obst->getValue(); //osservatorio 178 179 $tmp = $cc->getElement('tmp'); 180 181 $template['tmp']=$tmp->getValue(); //temperatura 182 183 $flik = $cc->getElement('flik'); 184 185 $template['flik']=$flik->getValue(); //feel like 186 187 $t = $cc->getElement('t'); 188 189 $template['weather']=$t->getValue(); //meteo 190 191 $icon = $cc->getElement('icon'); 192 193 $template['icon']=$icon->getValue(); //icona tempo 194 195 $bar = $cc->getElement('bar'); 196 $r = $bar->getElement('r'); 197 198 $template['bar_r']=$r->getValue(); //pressione 199 200 $bar = $cc->getElement('bar'); 201 $d = $bar->getElement('d'); 202 203 $template['bar_d']=$d->getValue(); //tipo pressione 204 205 $wind = $cc->getElement('wind'); 206 $s = $wind->getElement('s'); 207 208 $template['wind_s']=$s->getValue(); //velocità vento 209 210 $wind = $cc->getElement('wind'); 211 $gust = $wind->getElement('gust'); 212 213 $template['wind_gust']=$gust->getValue(); //raffica 214 215 $wind = $cc->getElement('wind'); 216 $d = $wind->getElement('d'); 217 218 $template['wind_d']=$d->getValue(); // 219 220 $wind = $cc->getElement('wind'); 221 $t = $wind->getElement('t'); 222 223 $template['wind_t']=$t->getValue(); //direzione vento (N,S,E,W) 224 225 $hmid = $cc->getElement('hmid'); 226 227 $template['hmid']=$hmid->getValue(); //umidità in % 228 229 $vis = $cc->getElement('vis'); 230 231 $template['vis']=$vis->getValue(); //visibilità (distanza) 232 233 $uv = $cc->getElement('uv'); 234 $i = $uv->getElement('i'); 235 236 $template['uv_i']=$i->getValue(); // raggi uv 237 238 $uv = $cc->getElement('uv'); 239 $t = $uv->getElement('t'); 240 241 $template['uv_t']=$t->getValue(); // tipo raggi 242 243 $dewp = $cc->getElement('dewp'); 244 245 $template['dewp']=$dewp->getValue(); //Punto di rugiada (in temp) 246 247 $moon = $cc->getElement('moon'); 248 $icon = $moon->getElement('icon'); 249 250 $template['moon_icon']=$icon->getValue(); //icona luna 251 252 $moon = $cc->getElement('moon'); 253 $t = $moon->getElement('t'); 254 255 $template['moon_t']=$t->getValue(); //tipo luna 256 257 list($template['city'])=explode(",",$template['city']); 258 list($template['city'])=explode("/",$template['city']); 259 260 switch($t_type){ 261 default: 262 case "F": 263 $template['tmp']=$template['tmp']."°"; 264 $template['flick']=$template['flick']."°"; 265 $template['dewp']=round(($template['dewp']-32)/(1.8))."°"; 266 $template['wind_s']=$template['wind_s']." mph"; 267 $template['vis']=$template['vis']." miles"; 268 break; 269 case "C": 270 $template['tmp']=round(($template['tmp']-32)/(1.8))."°"; 271 $template['flick']=round(($template['flick']-32)/(1.8))."°"; 272 $template['dewp']=round(($template['dewp']-32)/(1.8))."°"; 273 $template['wind_s']=round($template['wind_s']*(1.6))." km/h"; 274 $template['vis']=round($template['vis']*(1.6))." km"; 275 break; 276 } 277 switch($template['icon']){ 278 default: 279 case 44: 280 $icon=0; 281 break; 282 case 5: 283 case 8: 284 case 9: 285 case 11: 286 $icon=1; 287 break; 288 case 15: 289 case 25: 290 $icon=2; 291 break; 292 case 20: 293 $icon=3; 294 break; 295 case 32: 296 case 36: 297 $icon=4; 298 break; 299 case 19: 300 case 21: 301 case 22: 302 $icon=5; 303 break; 304 case 0: 305 case 1: 306 case 2: 307 case 3: 308 case 4: 309 case 17: 310 case 35: 311 case 37: 312 case 38: 313 case 47: 314 $icon=6; 315 break; 316 case 39: 317 $icon=7; 318 break; 319 case 13: 320 $icon=8; 321 break; 322 case 23: 323 case 24: 324 $icon=9; 325 break; 326 case 14: 327 $icon=10; 328 break; 329 case 14: 330 case 16: 331 case 18: 332 case 41: 333 case 42: 334 case 43: 335 case 46: 336 $icon=11; 337 break; 338 case 10: 339 case 12: 340 case 40: 341 case 45: 342 $icon=12; 343 break; 344 case 26: 345 $icon=13; 346 break; 347 case 6: 348 case 7: 349 $icon=14; 350 break; 351 case 28: 352 case 30: 353 case 34: 354 $icon=15; 355 break; 356 case 27: 357 case 29: 358 case 31: 359 case 33: 360 $icon=16; 361 break; 362 } 104 if(is_array($template)){ 363 105 364 365 $template['icon']=$plugin_directory .'templates/'.$usedtemplate.'/icon/'.$icon.''; 106 $template['icon']=$plugin_directory .'templates/'.$usedtemplate.'/icon/'.$template['icon'].'.gif'; 366 107 367 108 $loadfile=file_get_contents(dirname(__FILE__).'/templates/'.$usedtemplate.'/template.html'); -
myweather/trunk/readme.txt
r90200 r132985 5 5 Requires at least: 2.2 6 6 Tested up to: 2.5.1 7 Stable tag: 2.4. 87 Stable tag: 2.4.9 8 8 9 9 myWeather plugin allows you to set up displays for cities of your choice.
Note: See TracChangeset
for help on using the changeset viewer.