'humidity' => (string) $res->humidity['value'].(string)$res->humidity['unit'],
'descripion' => $desc,
'wind' => (string)$res->wind->speed['name'].' ('.(string)$res->wind->speed['value'].$wunit.')',
- 'update' => (string)$res->lastupdate['value']
+ 'update' => (string)$res->lastupdate['value'],
+ 'icon' => (string)$res->weather['icon']
);
set_pconfig(local_user(), 'curweather', 'last', $now->getTimestamp());
Cache::set('curweather'.md5($url), serialize($r));
$t = get_markup_template("widget.tpl", "addon/curweather/" );
$curweather = replace_macros ($t, array(
'$title' => t("Current Weather"),
+ '$icon' => $res['icon'],
'$city' => $res['city'],
'$lon' => $res['lon'],
'$lat' => $res['lat'],
<div class="title tool">
<h4 title="{{$lastupdate}}">{{$title}}: {{$city}}</h4>
</div>
- <p>{{$description}}, {{$temp}}
+ <p>
+ <img src="http://openweathermap.org/img/w/{{$icon}}.png" title="{{$description}}">
<ul class="curweather-details">
- <li>{{$relhumidity['caption']}}: {{$relhumidity['val']}}</li>
- <li>{{$pressure['caption']}}: {{$pressure['val']}}</li>
- <li>{{$wind['caption']}}: {{$wind['val']}}</li>
+ <li><strong>{{$temp}}</strong></li>
+ <li>{{$relhumidity['caption']}}: {{$relhumidity['val']}}</li>
+ <li>{{$pressure['caption']}}: {{$pressure['val']}}</li>
+ <li>{{$wind['caption']}}: {{$wind['val']}}</li>
</ul></p>
<p class="curweather-footer">
{{$databy}}: <a href="http://openweathermap.org">OpenWeatherMap</a>. <a href="http://openweathermap.org/Maps?zoom=7&lat={{$lat}}&lon={{$lon}}&layers=B0FTTFF">{{$showonmap}}</a>