diff options
| author | Patrick Seeger <pseeger@ccwn.org> | 2012-04-18 21:34:43 +0200 |
|---|---|---|
| committer | Patrick Seeger <pseeger@ccwn.org> | 2012-04-18 21:34:43 +0200 |
| commit | 25c813f5eb00d321d5096d2347363a2f58cb1c93 (patch) | |
| tree | 3d8f06ec3311e307223e762ffc0342fdb455800a | |
| parent | 6ee1ed2be48a7f3d739aed838f17a30f485851d1 (diff) | |
Wetter eingebaut
38 files changed, 129 insertions, 3 deletions
diff --git a/assets/19ae1ccf/clear_night.png b/assets/19ae1ccf/clear_night.png Binary files differnew file mode 100644 index 0000000..dfeab51 --- /dev/null +++ b/assets/19ae1ccf/clear_night.png diff --git a/assets/19ae1ccf/cloudy.png b/assets/19ae1ccf/cloudy.png Binary files differnew file mode 100644 index 0000000..c4be984 --- /dev/null +++ b/assets/19ae1ccf/cloudy.png diff --git a/assets/19ae1ccf/cold.png b/assets/19ae1ccf/cold.png Binary files differnew file mode 100644 index 0000000..478be3d --- /dev/null +++ b/assets/19ae1ccf/cold.png diff --git a/assets/19ae1ccf/drizzle.png b/assets/19ae1ccf/drizzle.png Binary files differnew file mode 100644 index 0000000..0fbd481 --- /dev/null +++ b/assets/19ae1ccf/drizzle.png diff --git a/assets/19ae1ccf/dust.png b/assets/19ae1ccf/dust.png Binary files differnew file mode 100644 index 0000000..7c29271 --- /dev/null +++ b/assets/19ae1ccf/dust.png diff --git a/assets/19ae1ccf/fog.png b/assets/19ae1ccf/fog.png Binary files differnew file mode 100644 index 0000000..aa739a3 --- /dev/null +++ b/assets/19ae1ccf/fog.png diff --git a/assets/19ae1ccf/hail.png b/assets/19ae1ccf/hail.png Binary files differnew file mode 100644 index 0000000..a5f3d72 --- /dev/null +++ b/assets/19ae1ccf/hail.png diff --git a/assets/19ae1ccf/haze.png b/assets/19ae1ccf/haze.png Binary files differnew file mode 100644 index 0000000..0fa9ae4 --- /dev/null +++ b/assets/19ae1ccf/haze.png diff --git a/assets/19ae1ccf/hot.png b/assets/19ae1ccf/hot.png Binary files differnew file mode 100644 index 0000000..6aa9af5 --- /dev/null +++ b/assets/19ae1ccf/hot.png diff --git a/assets/19ae1ccf/hurricane.png b/assets/19ae1ccf/hurricane.png Binary files differnew file mode 100644 index 0000000..daf35ec --- /dev/null +++ b/assets/19ae1ccf/hurricane.png diff --git a/assets/19ae1ccf/icy.png b/assets/19ae1ccf/icy.png Binary files differnew file mode 100644 index 0000000..dafae6c --- /dev/null +++ b/assets/19ae1ccf/icy.png diff --git a/assets/19ae1ccf/mist.png b/assets/19ae1ccf/mist.png Binary files differnew file mode 100644 index 0000000..991a88e --- /dev/null +++ b/assets/19ae1ccf/mist.png diff --git a/assets/19ae1ccf/overcast.png b/assets/19ae1ccf/overcast.png Binary files differnew file mode 100644 index 0000000..4281a5b --- /dev/null +++ b/assets/19ae1ccf/overcast.png diff --git a/assets/19ae1ccf/partly_cloudy_day.png b/assets/19ae1ccf/partly_cloudy_day.png Binary files differnew file mode 100644 index 0000000..b7ad9b1 --- /dev/null +++ b/assets/19ae1ccf/partly_cloudy_day.png diff --git a/assets/19ae1ccf/partly_cloudy_night.png b/assets/19ae1ccf/partly_cloudy_night.png Binary files differnew file mode 100644 index 0000000..f16e838 --- /dev/null +++ b/assets/19ae1ccf/partly_cloudy_night.png diff --git a/assets/19ae1ccf/rain.png b/assets/19ae1ccf/rain.png Binary files differnew file mode 100644 index 0000000..6ec85d3 --- /dev/null +++ b/assets/19ae1ccf/rain.png diff --git a/assets/19ae1ccf/rain_heavy.png b/assets/19ae1ccf/rain_heavy.png Binary files differnew file mode 100644 index 0000000..a935258 --- /dev/null +++ b/assets/19ae1ccf/rain_heavy.png diff --git a/assets/19ae1ccf/rain_light.png b/assets/19ae1ccf/rain_light.png Binary files differnew file mode 100644 index 0000000..80f200b --- /dev/null +++ b/assets/19ae1ccf/rain_light.png diff --git a/assets/19ae1ccf/showers.png b/assets/19ae1ccf/showers.png Binary files differnew file mode 100644 index 0000000..7584166 --- /dev/null +++ b/assets/19ae1ccf/showers.png diff --git a/assets/19ae1ccf/showers_heavy.png b/assets/19ae1ccf/showers_heavy.png Binary files differnew file mode 100644 index 0000000..411f729 --- /dev/null +++ b/assets/19ae1ccf/showers_heavy.png diff --git a/assets/19ae1ccf/sleet.png b/assets/19ae1ccf/sleet.png Binary files differnew file mode 100644 index 0000000..529101b --- /dev/null +++ b/assets/19ae1ccf/sleet.png diff --git a/assets/19ae1ccf/smoke.png b/assets/19ae1ccf/smoke.png Binary files differnew file mode 100644 index 0000000..623432b --- /dev/null +++ b/assets/19ae1ccf/smoke.png diff --git a/assets/19ae1ccf/snow.png b/assets/19ae1ccf/snow.png Binary files differnew file mode 100644 index 0000000..1a20be0 --- /dev/null +++ b/assets/19ae1ccf/snow.png diff --git a/assets/19ae1ccf/snow_heavy.png b/assets/19ae1ccf/snow_heavy.png Binary files differnew file mode 100644 index 0000000..ac6d9f3 --- /dev/null +++ b/assets/19ae1ccf/snow_heavy.png diff --git a/assets/19ae1ccf/snow_showers.png b/assets/19ae1ccf/snow_showers.png Binary files differnew file mode 100644 index 0000000..504d988 --- /dev/null +++ b/assets/19ae1ccf/snow_showers.png diff --git a/assets/19ae1ccf/storm.png b/assets/19ae1ccf/storm.png Binary files differnew file mode 100644 index 0000000..445ac64 --- /dev/null +++ b/assets/19ae1ccf/storm.png diff --git a/assets/19ae1ccf/sunny.png b/assets/19ae1ccf/sunny.png Binary files differnew file mode 100644 index 0000000..68b9fcf --- /dev/null +++ b/assets/19ae1ccf/sunny.png diff --git a/assets/19ae1ccf/symbols.pspimage b/assets/19ae1ccf/symbols.pspimage Binary files differnew file mode 100644 index 0000000..dacc401 --- /dev/null +++ b/assets/19ae1ccf/symbols.pspimage diff --git a/assets/19ae1ccf/thunder_showers.png b/assets/19ae1ccf/thunder_showers.png Binary files differnew file mode 100644 index 0000000..974c833 --- /dev/null +++ b/assets/19ae1ccf/thunder_showers.png diff --git a/assets/19ae1ccf/thunderstorm.png b/assets/19ae1ccf/thunderstorm.png Binary files differnew file mode 100644 index 0000000..3f19ad5 --- /dev/null +++ b/assets/19ae1ccf/thunderstorm.png diff --git a/assets/19ae1ccf/thunderstorm_severe.png b/assets/19ae1ccf/thunderstorm_severe.png Binary files differnew file mode 100644 index 0000000..7df3597 --- /dev/null +++ b/assets/19ae1ccf/thunderstorm_severe.png diff --git a/assets/19ae1ccf/tornado.png b/assets/19ae1ccf/tornado.png Binary files differnew file mode 100644 index 0000000..7d35015 --- /dev/null +++ b/assets/19ae1ccf/tornado.png diff --git a/assets/19ae1ccf/windy.png b/assets/19ae1ccf/windy.png Binary files differnew file mode 100644 index 0000000..bd9ea54 --- /dev/null +++ b/assets/19ae1ccf/windy.png diff --git a/assets/85ebad3e/weather_forecast.css b/assets/85ebad3e/weather_forecast.css new file mode 100644 index 0000000..adefaad --- /dev/null +++ b/assets/85ebad3e/weather_forecast.css @@ -0,0 +1,33 @@ +/* SVN FILE: $Id: weather_forecast.css 9 2009-10-13 13:20:24Z Chris $ */ +/** + * Weather Forecast CSS + * + * @copyright Copyright 2009 PBM Web Development - All Rights Reserved + * @package weatherForecast + * @since V1.0.0 + * @version $Revision: 9 $ + * @modifiedby $LastChangedBy: Chris $ + * @lastmodified $Date: 2009-10-13 14:20:24 +0100 (Tue, 13 Oct 2009) $ + * @license http://www.opensource.org/licenses/bsd-license.php The BSD License + */ +.weather-forecast { + float: left; + font-size: 90%; + margin-right: 0; + margin-top: 1em; + padding: 1em 1.5%; + width: 28%; +} +.weather-forecast th, +.weather-forecast td { + padding: 0.375em 5px; + text-align: center; +} +.weather-forecast tfoot tr, +.weather-forecast tr.even { + background-color: transparent; +} +.weather-forecast tfoot { + font-size: 80%; + font-style: italic; +}
\ No newline at end of file diff --git a/protected/config/main.php b/protected/config/main.php index ca66538..e9c97aa 100644 --- a/protected/config/main.php +++ b/protected/config/main.php @@ -18,6 +18,7 @@ return array( 'application.models.*', 'application.components.*', 'application.extensions.ddeditor.*', + 'application.extensions.wetter.*', ), 'modules'=>array( @@ -38,6 +39,9 @@ return array( // enable cookie-based authentication 'allowAutoLogin'=>true, ), + 'cache' => array( + 'class' => 'system.caching.CDummyCache', + ), // uncomment the following to enable URLs in path-format /* 'urlManager'=>array( diff --git a/protected/extensions/wetter/Wetter.php b/protected/extensions/wetter/Wetter.php new file mode 100644 index 0000000..de2ec93 --- /dev/null +++ b/protected/extensions/wetter/Wetter.php @@ -0,0 +1,65 @@ +<?php +class Wetter extends CWidget { + + public function run(){ + $wetter = $this->website_wetter('71332','Germany'); + $this->render('wetter', compact('wetter')); + } + + /* + Nutzung dieses Scripts nur gestattet, wenn Kommentare in PHP nicht entfernt werden oder ein Link zu folgender Adresse gesetzt wird: + URL: http://www.web-spirit.de/webdesign-tutorial/9/Wetter-auf-eigener-Website-mit-Google-Weahter-API + Beschreibung: Wettervorhersage auf der eigenen Website mit Zugriff auf die Google Weather API + Autor: Sebastian Gollus + Internet: http://www.web-spirit.de + Version: 1.0.201106 + */ + + // Funktionsaufruf z.B.: $wetter = website_wetter("46562", "Germany", "/images/wetter/icons/", "de"); + + private function website_wetter($plz, $land, $icons_src="/", $sprache="de", $ort="") + { + $icons_google = "/ig/images/weather/"; //alte Google-Version + //$icons_google = "http://g0.gstatic.com/images/icons/onebox/"; //neue Google-Version (bzw. zwischenzeitlich geändert) + + if($ort != "") + { + $station = $ort; + } + else + { + $station = $plz."-".$land; + } + + $api = simplexml_load_string(utf8_encode(file_get_contents("http://www.google.com/ig/api?weather=".$station."&hl=".$sprache))); + + $wetter = array(); + + // Allgemeine Informationen + $wetter['stadt'] = $api->weather->forecast_information->city->attributes()->data; + $wetter['datum'] = $api->weather->forecast_information->forecast_date->attributes()->data; + $wetter['zeit'] = $api->weather->forecast_information->current_date_time->attributes()->data; + + // Aktuelles Wetter + $wetter[0]['zustand'] = $api->weather->current_conditions->condition->attributes()->data; + $wetter[0]['temperatur'] = $api->weather->current_conditions->temp_c->attributes()->data; + $wetter[0]['luftfeuchtigkeit'] = $api->weather->current_conditions->humidity->attributes()->data; + $wetter[0]['wind'] = $api->weather->current_conditions->wind_condition->attributes()->data; + $wetter[0]['icon'] = str_replace($icons_google, $icons_src, $api->weather->current_conditions->icon->attributes()->data); + + // Wettervorhersage heute, morgen, in zwei und in drei Tagen ($wetter[1] bis $wetter[4]) + $i = 1; + foreach($api->weather->forecast_conditions as $weather) + { + $wetter[$i]['wochentag'] = $weather->day_of_week->attributes()->data; + $wetter[$i]['zustand'] = $weather->condition->attributes()->data; + $wetter[$i]['tiefsttemperatur'] = $weather->low->attributes()->data; + $wetter[$i]['hoechsttemperatur'] = $weather->high->attributes()->data; + $wetter[$i]['icon'] = str_replace($icons_google, $icons_src, $weather->icon->attributes()->data); + + $i++; + } + + return $wetter; + } +}
\ No newline at end of file diff --git a/protected/extensions/wetter/views/wetter.php b/protected/extensions/wetter/views/wetter.php new file mode 100644 index 0000000..0b4c831 --- /dev/null +++ b/protected/extensions/wetter/views/wetter.php @@ -0,0 +1,21 @@ + <div class="ym-grid linearize-level-2"> + <div class="ym-g50 ym-gl"> + <div class="ym-gbox-left"> + <!-- content --> + + <h6>Aktuell</h6> + <p><?php echo "<img class=\"float-left bordered\" src=\"https://www.google.com/images/weather/".$wetter[0]['icon']."\" alt=\"".$wetter[0]['zustand']."\" />".$wetter[0]['zustand']." bei ".$wetter[0]['temperatur']."° C"; ?></p> + </div> + </div> + <div class="ym-g50 ym-gr"> + <div class="ym-gbox-right"> + <!-- content --> + <h6><?php echo $wetter[2]['wochentag'];?></h6> + <p ><?php echo "<img class=\"float-left bordered\" src=\"https://www.google.com/images/weather/".$wetter[2]['icon']."\" alt=\"".$wetter[2]['zustand']."\" />".$wetter[2]['zustand']." bei min. ".$wetter[2]['tiefsttemperatur']."° C bis max. ".$wetter[2]['hoechsttemperatur']."° C"; ?></p> + </div> + </div> + </div> + + + + diff --git a/themes/astaf/views/layouts/main.php b/themes/astaf/views/layouts/main.php index 4615b50..a9d3614 100644 --- a/themes/astaf/views/layouts/main.php +++ b/themes/astaf/views/layouts/main.php @@ -127,10 +127,13 @@ <aside class="ym-g33 ym-gr"> <div class="ym-gbox-right ym-clearfix"> - <h3>A Simple Sidebar </h3> + <?php /*<h3>A Simple Sidebar </h3> <p class="box info">Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras ornare mattis nunc. Mauris venenatis, pede sed aliquet vehicula, lectus tellus pulvinar neque, non cursus sem nisi vel augue.</p> - <h3>Incremental leading</h3> - <p>Vestibulum ante ipsum primis in faucibus orci luctus vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras ornare mattis nunc. Mauris venenatis, pede sed aliquet vehicula, lectus tellus pulvinar neque, non cursus sem nisi vel augue. sed aliquet vehicula, lectus tellus.</p> + */?> + <h3>Das Wetter in Waiblingen</h3> + <p> + <?php $this->widget('application.extensions.wetter.Wetter', array());?> + </p> <p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras ornare mattis nunc. Mauris venenatis, pede sed aliquet vehicula, lectus tellus pulvinar neque, non cursus sem nisi vel augue. sed aliquet vehicula, lectus tellus pulvinar neque, non cursus sem nisi vel augue. ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras ornare mattis nunc. Mauris venenatis, pede sed aliquet vehicula, lectus tellus pulvinar neque, non cursus sem nisi vel augue. sed aliquet vehicula, lectus tellus pulvinar neque, non cursus sem nisi vel augue</p> </div> |
