summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Seeger <pseeger@ccwn.org>2012-04-18 21:34:43 +0200
committerPatrick Seeger <pseeger@ccwn.org>2012-04-18 21:34:43 +0200
commit25c813f5eb00d321d5096d2347363a2f58cb1c93 (patch)
tree3d8f06ec3311e307223e762ffc0342fdb455800a
parent6ee1ed2be48a7f3d739aed838f17a30f485851d1 (diff)
Wetter eingebaut
-rw-r--r--assets/19ae1ccf/clear_night.pngbin0 -> 838 bytes
-rw-r--r--assets/19ae1ccf/cloudy.pngbin0 -> 710 bytes
-rw-r--r--assets/19ae1ccf/cold.pngbin0 -> 511 bytes
-rw-r--r--assets/19ae1ccf/drizzle.pngbin0 -> 753 bytes
-rw-r--r--assets/19ae1ccf/dust.pngbin0 -> 1024 bytes
-rw-r--r--assets/19ae1ccf/fog.pngbin0 -> 500 bytes
-rw-r--r--assets/19ae1ccf/hail.pngbin0 -> 970 bytes
-rw-r--r--assets/19ae1ccf/haze.pngbin0 -> 521 bytes
-rw-r--r--assets/19ae1ccf/hot.pngbin0 -> 426 bytes
-rw-r--r--assets/19ae1ccf/hurricane.pngbin0 -> 1102 bytes
-rw-r--r--assets/19ae1ccf/icy.pngbin0 -> 420 bytes
-rw-r--r--assets/19ae1ccf/mist.pngbin0 -> 488 bytes
-rw-r--r--assets/19ae1ccf/overcast.pngbin0 -> 803 bytes
-rw-r--r--assets/19ae1ccf/partly_cloudy_day.pngbin0 -> 970 bytes
-rw-r--r--assets/19ae1ccf/partly_cloudy_night.pngbin0 -> 981 bytes
-rw-r--r--assets/19ae1ccf/rain.pngbin0 -> 1115 bytes
-rw-r--r--assets/19ae1ccf/rain_heavy.pngbin0 -> 1200 bytes
-rw-r--r--assets/19ae1ccf/rain_light.pngbin0 -> 921 bytes
-rw-r--r--assets/19ae1ccf/showers.pngbin0 -> 1171 bytes
-rw-r--r--assets/19ae1ccf/showers_heavy.pngbin0 -> 1277 bytes
-rw-r--r--assets/19ae1ccf/sleet.pngbin0 -> 1103 bytes
-rw-r--r--assets/19ae1ccf/smoke.pngbin0 -> 627 bytes
-rw-r--r--assets/19ae1ccf/snow.pngbin0 -> 881 bytes
-rw-r--r--assets/19ae1ccf/snow_heavy.pngbin0 -> 957 bytes
-rw-r--r--assets/19ae1ccf/snow_showers.pngbin0 -> 1164 bytes
-rw-r--r--assets/19ae1ccf/storm.pngbin0 -> 1430 bytes
-rw-r--r--assets/19ae1ccf/sunny.pngbin0 -> 936 bytes
-rw-r--r--assets/19ae1ccf/symbols.pspimagebin0 -> 19565 bytes
-rw-r--r--assets/19ae1ccf/thunder_showers.pngbin0 -> 1557 bytes
-rw-r--r--assets/19ae1ccf/thunderstorm.pngbin0 -> 1123 bytes
-rw-r--r--assets/19ae1ccf/thunderstorm_severe.pngbin0 -> 1231 bytes
-rw-r--r--assets/19ae1ccf/tornado.pngbin0 -> 1105 bytes
-rw-r--r--assets/19ae1ccf/windy.pngbin0 -> 599 bytes
-rw-r--r--assets/85ebad3e/weather_forecast.css33
-rw-r--r--protected/config/main.php4
-rw-r--r--protected/extensions/wetter/Wetter.php65
-rw-r--r--protected/extensions/wetter/views/wetter.php21
-rw-r--r--themes/astaf/views/layouts/main.php9
38 files changed, 129 insertions, 3 deletions
diff --git a/assets/19ae1ccf/clear_night.png b/assets/19ae1ccf/clear_night.png
new file mode 100644
index 0000000..dfeab51
--- /dev/null
+++ b/assets/19ae1ccf/clear_night.png
Binary files differ
diff --git a/assets/19ae1ccf/cloudy.png b/assets/19ae1ccf/cloudy.png
new file mode 100644
index 0000000..c4be984
--- /dev/null
+++ b/assets/19ae1ccf/cloudy.png
Binary files differ
diff --git a/assets/19ae1ccf/cold.png b/assets/19ae1ccf/cold.png
new file mode 100644
index 0000000..478be3d
--- /dev/null
+++ b/assets/19ae1ccf/cold.png
Binary files differ
diff --git a/assets/19ae1ccf/drizzle.png b/assets/19ae1ccf/drizzle.png
new file mode 100644
index 0000000..0fbd481
--- /dev/null
+++ b/assets/19ae1ccf/drizzle.png
Binary files differ
diff --git a/assets/19ae1ccf/dust.png b/assets/19ae1ccf/dust.png
new file mode 100644
index 0000000..7c29271
--- /dev/null
+++ b/assets/19ae1ccf/dust.png
Binary files differ
diff --git a/assets/19ae1ccf/fog.png b/assets/19ae1ccf/fog.png
new file mode 100644
index 0000000..aa739a3
--- /dev/null
+++ b/assets/19ae1ccf/fog.png
Binary files differ
diff --git a/assets/19ae1ccf/hail.png b/assets/19ae1ccf/hail.png
new file mode 100644
index 0000000..a5f3d72
--- /dev/null
+++ b/assets/19ae1ccf/hail.png
Binary files differ
diff --git a/assets/19ae1ccf/haze.png b/assets/19ae1ccf/haze.png
new file mode 100644
index 0000000..0fa9ae4
--- /dev/null
+++ b/assets/19ae1ccf/haze.png
Binary files differ
diff --git a/assets/19ae1ccf/hot.png b/assets/19ae1ccf/hot.png
new file mode 100644
index 0000000..6aa9af5
--- /dev/null
+++ b/assets/19ae1ccf/hot.png
Binary files differ
diff --git a/assets/19ae1ccf/hurricane.png b/assets/19ae1ccf/hurricane.png
new file mode 100644
index 0000000..daf35ec
--- /dev/null
+++ b/assets/19ae1ccf/hurricane.png
Binary files differ
diff --git a/assets/19ae1ccf/icy.png b/assets/19ae1ccf/icy.png
new file mode 100644
index 0000000..dafae6c
--- /dev/null
+++ b/assets/19ae1ccf/icy.png
Binary files differ
diff --git a/assets/19ae1ccf/mist.png b/assets/19ae1ccf/mist.png
new file mode 100644
index 0000000..991a88e
--- /dev/null
+++ b/assets/19ae1ccf/mist.png
Binary files differ
diff --git a/assets/19ae1ccf/overcast.png b/assets/19ae1ccf/overcast.png
new file mode 100644
index 0000000..4281a5b
--- /dev/null
+++ b/assets/19ae1ccf/overcast.png
Binary files differ
diff --git a/assets/19ae1ccf/partly_cloudy_day.png b/assets/19ae1ccf/partly_cloudy_day.png
new file mode 100644
index 0000000..b7ad9b1
--- /dev/null
+++ b/assets/19ae1ccf/partly_cloudy_day.png
Binary files differ
diff --git a/assets/19ae1ccf/partly_cloudy_night.png b/assets/19ae1ccf/partly_cloudy_night.png
new file mode 100644
index 0000000..f16e838
--- /dev/null
+++ b/assets/19ae1ccf/partly_cloudy_night.png
Binary files differ
diff --git a/assets/19ae1ccf/rain.png b/assets/19ae1ccf/rain.png
new file mode 100644
index 0000000..6ec85d3
--- /dev/null
+++ b/assets/19ae1ccf/rain.png
Binary files differ
diff --git a/assets/19ae1ccf/rain_heavy.png b/assets/19ae1ccf/rain_heavy.png
new file mode 100644
index 0000000..a935258
--- /dev/null
+++ b/assets/19ae1ccf/rain_heavy.png
Binary files differ
diff --git a/assets/19ae1ccf/rain_light.png b/assets/19ae1ccf/rain_light.png
new file mode 100644
index 0000000..80f200b
--- /dev/null
+++ b/assets/19ae1ccf/rain_light.png
Binary files differ
diff --git a/assets/19ae1ccf/showers.png b/assets/19ae1ccf/showers.png
new file mode 100644
index 0000000..7584166
--- /dev/null
+++ b/assets/19ae1ccf/showers.png
Binary files differ
diff --git a/assets/19ae1ccf/showers_heavy.png b/assets/19ae1ccf/showers_heavy.png
new file mode 100644
index 0000000..411f729
--- /dev/null
+++ b/assets/19ae1ccf/showers_heavy.png
Binary files differ
diff --git a/assets/19ae1ccf/sleet.png b/assets/19ae1ccf/sleet.png
new file mode 100644
index 0000000..529101b
--- /dev/null
+++ b/assets/19ae1ccf/sleet.png
Binary files differ
diff --git a/assets/19ae1ccf/smoke.png b/assets/19ae1ccf/smoke.png
new file mode 100644
index 0000000..623432b
--- /dev/null
+++ b/assets/19ae1ccf/smoke.png
Binary files differ
diff --git a/assets/19ae1ccf/snow.png b/assets/19ae1ccf/snow.png
new file mode 100644
index 0000000..1a20be0
--- /dev/null
+++ b/assets/19ae1ccf/snow.png
Binary files differ
diff --git a/assets/19ae1ccf/snow_heavy.png b/assets/19ae1ccf/snow_heavy.png
new file mode 100644
index 0000000..ac6d9f3
--- /dev/null
+++ b/assets/19ae1ccf/snow_heavy.png
Binary files differ
diff --git a/assets/19ae1ccf/snow_showers.png b/assets/19ae1ccf/snow_showers.png
new file mode 100644
index 0000000..504d988
--- /dev/null
+++ b/assets/19ae1ccf/snow_showers.png
Binary files differ
diff --git a/assets/19ae1ccf/storm.png b/assets/19ae1ccf/storm.png
new file mode 100644
index 0000000..445ac64
--- /dev/null
+++ b/assets/19ae1ccf/storm.png
Binary files differ
diff --git a/assets/19ae1ccf/sunny.png b/assets/19ae1ccf/sunny.png
new file mode 100644
index 0000000..68b9fcf
--- /dev/null
+++ b/assets/19ae1ccf/sunny.png
Binary files differ
diff --git a/assets/19ae1ccf/symbols.pspimage b/assets/19ae1ccf/symbols.pspimage
new file mode 100644
index 0000000..dacc401
--- /dev/null
+++ b/assets/19ae1ccf/symbols.pspimage
Binary files differ
diff --git a/assets/19ae1ccf/thunder_showers.png b/assets/19ae1ccf/thunder_showers.png
new file mode 100644
index 0000000..974c833
--- /dev/null
+++ b/assets/19ae1ccf/thunder_showers.png
Binary files differ
diff --git a/assets/19ae1ccf/thunderstorm.png b/assets/19ae1ccf/thunderstorm.png
new file mode 100644
index 0000000..3f19ad5
--- /dev/null
+++ b/assets/19ae1ccf/thunderstorm.png
Binary files differ
diff --git a/assets/19ae1ccf/thunderstorm_severe.png b/assets/19ae1ccf/thunderstorm_severe.png
new file mode 100644
index 0000000..7df3597
--- /dev/null
+++ b/assets/19ae1ccf/thunderstorm_severe.png
Binary files differ
diff --git a/assets/19ae1ccf/tornado.png b/assets/19ae1ccf/tornado.png
new file mode 100644
index 0000000..7d35015
--- /dev/null
+++ b/assets/19ae1ccf/tornado.png
Binary files differ
diff --git a/assets/19ae1ccf/windy.png b/assets/19ae1ccf/windy.png
new file mode 100644
index 0000000..bd9ea54
--- /dev/null
+++ b/assets/19ae1ccf/windy.png
Binary files differ
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']."&deg; 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']."&deg; C bis max. ".$wetter[2]['hoechsttemperatur']."&deg; 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>