From 7c6ae901d94df13158435e9d8f1276a57ed19f84 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 17 Jul 2015 16:46:54 +0200 Subject: [PATCH] use icon for visualisation of current weather --- curweather/curweather.css | 4 ++++ curweather/curweather.php | 4 +++- curweather/templates/widget.tpl | 10 ++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/curweather/curweather.css b/curweather/curweather.css index a0b7c8fb..adf948f0 100644 --- a/curweather/curweather.css +++ b/curweather/curweather.css @@ -1,3 +1,7 @@ +#curweather-network img { + float: left; + margin: 20px 10px; +} ul.curweather-details li { list-type: none; } diff --git a/curweather/curweather.php b/curweather/curweather.php index 58daab0b..88eee9c9 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -52,7 +52,8 @@ function getWeather( $loc, $units='metric', $lang='en', $appid='', $cachetime=0) '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)); @@ -107,6 +108,7 @@ function curweather_network_mod_init(&$fk_app,&$b) { $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'], diff --git a/curweather/templates/widget.tpl b/curweather/templates/widget.tpl index 910c0258..9c6cacd3 100644 --- a/curweather/templates/widget.tpl +++ b/curweather/templates/widget.tpl @@ -2,11 +2,13 @@

{{$title}}: {{$city}}

-

{{$description}}, {{$temp}} +

+