InfoFrame: Digitaler Bilderrahmen (Anzeige von Anrufen, E-Mails, Termine, Wetter...)

Tschuligung ich hatte es nicht richtig verstanden.:doof:

Aber ich habe noch ne Frage ,wo wird denn Anordnung der Daten hinterlegt.
Ich möchte z.Bsp.die linke Seite der Wetterdaten etwas höher haben.

Welche Plugin's funtzen denn noch,Ich such noch Staumeldungen für Hessen und irgendwo hab ich noch ein Fernsehprogramm gesehen.
Gibt es sowas noch??

Knusterus
 
was meinst du mit linke seite?

heute
21° | 14°

das die 21 etwas höher steht?
dürfte etwas schwierig werden, denn der komplette bereich wird programmtechnisch in nur 1zeile definiert

schau es dir an im ordner /Plugins, dort dann die WheatherPlugin.php editieren mit nem linuxfähigem editor. z.b. notepad++

dann bei
// forecast for today and next 3 days
.
.
.
// output
.
.
$text = $day."\n".$high."° | ".$low."°\n".$condition; // ."ICON:".$xml->weather->forecast_conditions[$i]->icon['data'];
imagettftextboxopt($image, 15, 0, imagesx($image)-240, $offset, $style['textcolor'], $style['font'], $text, $opt);

ist die letzte zeile da.
aber mit aufwand ist auch das machbar, nur viel fummelarbeit, da du die einzelnen ausgaben aufteilen mußt

ja ich doch auch ;)
 
Zuletzt bearbeitet:
Ne ich meine die ganze Linke Seite,so das die Vorhersage mehr in der Mitte ist.
Anhang anzeigen 69013
Knusterus
 
so? dann mußt du die werte vergrößern

// output
$wicon = ImageCreateFromPNG ( $icon );
ImageCopyResampled($image, $wicon, imagesx($image)-95, $offset+5, 0, 0, imagesx($wicon)/2, imagesy($wicon)/2, imagesx($wicon), imagesy($wicon));
imageDestroy($wicon);
$opt = array(
'width' => 150,
'align' => ALIGN_RIGHT
);
$text = $day."\n".$high."° | ".$low."°\n".$condition; // ."ICON:".$xml->weather->forecast_conditions[$i]->icon['data'];
imagettftextboxopt($image, 15, 0, imagesx($image)-240, $offset, $style['textcolor'], $style['font'], $text, $opt);
 

Anhänge

  • default.jpeg
    default.jpeg
    78.2 KB · Aufrufe: 46
Zuletzt bearbeitet:
Hast du das gleiche Wetterplugin??
Bei mir fehlt ja auch Wind ,Luftfeuchte usw, und oben die aktuelle temp.
Ich glaube da muss ich nochmal an die php.
Aber nicht mehr heute.
Ich verabschiede mich jetzt
Vielen Dank für deine Hilfe

@friday kannst du mir mal bitte Deine Weatherplugin.php schicken?

Knusterus
 
Zuletzt bearbeitet:
Hallo,
darf ich mal einfach so reinplatzen? Ich habe mit großem Interesse eure Beiträge gelesen.
Folgendes Problem führt mich in dieses Forum. ( Mein erster Beitrag hier im Forum:roll:)
Ich besitze einen Kodak W1030 Pulse und eine FritzBox7390. Mein Problem ist der W1030. Es stört mich einfach das dieser die Bilder
in der Reihenfolge abspielt wie sie dem Rahmen gefällt. Umbenennen bringt nix. Die einzige Möglichkeit die Bilder in die Gewünschte Reihenfolge zu bringen
ist über eine PlayList. Das Erstellen ist aber so blöd gemacht das man auch daran schnell die Lust verliert.
Meine Frage an euch: Kann ich den Rahmen so "flashen" das dieser sich die Bilder bei der FritzBox (FritzNas) abholt? Wenn "Nein" gibt es eine Möglichkeit
dies anders zu lösen? Wenn "ja" könntet Ihr mir helfen? Ich blick da nämlich gerade nicht so wirklich durch.
Gruß Knud
 
Hast du das gleiche Wetterplugin??
Bei mir fehlt ja auch Wind ,Luftfeuchte usw, und oben die aktuelle temp.
Knusterus
Hier nochmal der code, diesmal getestet. Du bearbeitest die php-Seiten mit notpad++, oder? Wichtig, da windows und linux andere zeilenumbrüche verwenden!!!
PHP:
<?php
/***************************************************************************
 * InfoFrame (image generator for digital picture frames)
 * Copyright (C) 2009  Tobias Kolb
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see http://www.gnu.org/licenses/
 ***************************************************************************/

class WeatherPlugin implements IPlugin
{
    private $dbconn = NULL;
	private $config = NULL;
	
	public function __construct($dbconn, $config) {
		$this->dbconn = $dbconn;
		$this->config = $config;		
	}
	
	
	public function doUpdate() {
		// download weather XML into local file for caching
		   $city = urlencode( $this->config['city'] );
		   $api_key = $this->config['api_key']; 
		   $curl = curl_init();
		   $file = fopen("cache/weather.xml", "w");
		   if ($file)
		   {
			   curl_setopt($curl, CURLOPT_URL, utf8_encode("http://api.wunderground.com/api/$api_key/geolookup/conditions/forecast/lang:DL/q/Germany/$city.xml"));
			   curl_setopt($curl, CURLOPT_FILE, $file);
			   curl_setopt($curl, CURLOPT_USERAGENT, utf8_encode("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"));
			   curl_exec($curl);
			   fclose($file);
		   }
         curl_close($curl);
      }		   


	public function doOutput($image, $style, $updateData, &$yoffset) {
		$filename = 'cache/weather.xml';

		if ($updateData || !file_exists($filename))
			$this->doUpdate();
		
		if(file_exists($filename) && (filesize($filename) > 0)) {
			
			$xml = simplexml_load_file($filename);
			if($xml) {
				// parse weather data
				// ===================
				// current conditions
				$current_condition = $xml->current_observation->weather;
				$current_temp = $xml->current_observation->temp_c;
				$current_humidity = $xml->current_observation->relative_humidity;
				$current_wind_condition = $xml->current_observation->wind_kph;
        $current_wind_dir = $xml->current_observation->wind_dir;
        $current_pressure = $xml->current_observation->pressure_mb;				
				$night = !isDaylight();
				$current_icon = $this->getLocalWeatherImage($xml->current_observation->icon, $night);
			//	 roundbox_trans_neu($image, imagesx($image)-220, 80, imagesx($image)-5, imagesy($image)-395-100, 2, 0, 0, 0, 10,0);
				$wicon = ImageCreateFromPNG ( $current_icon );
				ImageCopy($image, $wicon, imagesx($image)-190, 0, 0, 0, imagesx($wicon), imagesy($wicon));
				ImageDestroy($wicon);
				$opt = array(
					'width' => 280,
					'align' => ALIGN_RIGHT
				);
				
       /************************* Halbtransparentbox **************************
        *   roundbox_trans_neu($image, imagesx($image)-220, 80, imagesx($image)-5, imagesy($image)-15-290, 2, 0, 0, 0, 130,0);
        ***********************************************************************/
        
				$text = $current_temp."°C";
				imagettftextboxopt($image, 22, 0, imagesx($image)-300, 85, $style['textcolor'], $style['fontb'], $text, $opt);
				$text = "Aktuell: $current_condition\nLuftfeuchte: $current_humidity\nWind: $current_wind_condition km/h $current_wind_dir \nLuftdruck: $current_pressure mbar";
				imagettftextboxopt($image, 12, 0, imagesx($image)-300, 130, $style['textcolor'], $style['fontb'], $text, $opt);
      
        /*********************** Halbtransparentbox *************************
        * roundbox_trans_neu($image, imagesx($image)-230, 0, imagesx($image)-5, imagesy($image)-15-330, 2, 0, 0, 0, 230,0);
        *********************************************************************/

				// forecast for today and next 3 days
				for ($i = 0; $i <= 3; $i++) {
					// pixel offset for placing day 0-3 in different rows from top to bottom
					if (imagesy($image) <= 500) {
						$offset = 225+(85*$i); // smaller spacing for low resolution displays (vertical=480px)
					} else {
						$offset = 200+80*$i; // normal spacing for high resolution diplays (vertical=600px)
					}
					if ($offset > (imagesy($image)-80))
						break; // offset out of range, skip output of further weather forecast days

					// format data
					$day = $xml->forecast->simpleforecast->forecastdays->forecastday[$i]->date->weekday_short;
					if ($i == 0)
						$day = 'Heute';
					if ($i == 1)
						$day = 'Morgen';
					$low = $xml->forecast->simpleforecast->forecastdays->forecastday[$i]->low->celsius;
					$high = $xml->forecast->simpleforecast->forecastdays->forecastday[$i]->high->celsius;
					$condition = $xml->forecast->simpleforecast->forecastdays->forecastday[$i]->conditions;
					$icon = $this->getLocalWeatherImage($xml->forecast->simpleforecast->forecastdays->forecastday[$i]->icon, false);
					
					// output
					$wicon = ImageCreateFromPNG ( $icon );
					ImageCopyResampled($image, $wicon, imagesx($image)-95, $offset+5, 0, 0, imagesx($wicon)/2, imagesy($wicon)/2, imagesx($wicon), imagesy($wicon));
					ImageDestroy($wicon);
					$opt = array(
						'width' => 150,
						'align' => ALIGN_RIGHT
					);
					$text = $day."\n".$high."° | ".$low."°\n".$condition;
					imagettftextboxopt($image, 13, 0, imagesx($image)-245, $offset, $style['textcolor'], $style['fontb'], $text, $opt);		

				}
			}
		}
		        // display sunrise and sunset
          date_default_timezone_set('Europe/Berlin');
          $longitude = 48.562728; // longitude
          $latitude = 10.424322;   // latitude
          if (date("I") == 1) $dst = 2;       // Sommerzeit
          if (date("I") == 0) $dst = 1;       // Winterzeit
          $sunrise =  date_sunrise(time(), SUNFUNCS_RET_STRING, $longitude, $latitude, 90, $dst);
          $sunset = date_sunset(time(), SUNFUNCS_RET_STRING, $longitude, $latitude, 90, $dst);
          $text = $sunrise."          ".$sunset;
          $opt = array(
            'width' => 370,
            'align' => ALIGN_LEFT
          );
          imagettftextboxopt($image, 10, 0, 700, 586, $style['textcolor'], $style['font'], $text, $opt);  
     
          $icon = ImageCreateFromPNG ( 'resources/icons/sunup.png' );
                  ImageCopy($image, $icon, 680, 582, 0, 0, imagesx($icon), imagesy($icon));
                   ImageDestroy($icon);
                   $icon = ImageCreateFromPNG ( 'resources/icons/sundown.png' );
                  ImageCopy($image, $icon, 742, 582, 0, 0, imagesx($icon), imagesy($icon));
                   ImageDestroy($icon);
        // display sunrise and sunset ende  
}
	private function getLocalWeatherImage($googleWeatherImage, $night) {
    $localImagePath = 'resources/weather/'.$googleWeatherImage.".png";
    $localImagePathNight = 'resources/weather/'.$googleWeatherImage."_night.png";
		// if parameter $night is true and night image exist use it
		if ($night && file_exists($localImagePathNight))
			$localImagePath = $localImagePathNight;
		else if (!file_exists($localImagePath))
			// if daylight image doesn't exist display N/A image
			$localImagePath = 'resources/weather/na.png';
		return $localImagePath;
	}
}

?>
 
Hi Spoo3er
Danke für Deine Hilfe.Mit Deiner php bekomme ich ne Fehlermeldung Grafik kann nicht angezeigt werden.
Ich versuch mal die fehlenden Sachen zu übertragen.Die Bearbeitung mache ich mit EditPad Lite 7 und speichere es unter Linux ab.
Ich versuch mal mein Glück

Knusterus
 
Meine Frage an euch: Kann ich den Rahmen so "flashen" das dieser sich die Bilder bei der FritzBox (FritzNas) abholt? Wenn "Nein" gibt es eine Möglichkeit
dies anders zu lösen? Wenn "ja" könntet Ihr mir helfen? Ich blick da nämlich gerade nicht so wirklich durch.
Gruß Knud
Hallo Knud und willkommen bei den Postern :D
Weis nicht ob du diesen Beitrag schon kennst?
http://www.ip-phone-forum.de/showthread.php?t=206194&page=38&p=1667062&viewfull=1#post1667062
 
ka... habe es getestet bevor ich es hier gepostet habe.... lief bei mir ohne probleme

das forum verschiebt eine zeile beim posten:
die zeile $text =
muss so aussehen:
PHP:
$text = "Aktuell: $current_condition\nLuftfeuchte: $current_humidity\nWind: $current_wind_condition km/h $current_wind_dir \nLuftdruck: $current_pressure mbar";
und nicht so:
PHP:
                $text = "Aktuell: $current_condition\nLuftfeuchte: $current_humidity
\nWind: $current_wind_condition km/h $current_wind_dir \nLuftdruck: $current_pressure mbar";
evtl ist das der fehele. wie gesagt das muss laufen. Das von gestern MUSS theoretisch auch laufen...
 
Zuletzt bearbeitet:
So, habs hinbekommen,das
PHP:
    /************************* Halbtransparentbox **************************
        *   roundbox_trans_neu($image, imagesx($image)-220, 80, imagesx($image)-5, imagesy($image)-15-290, 2, 0, 0, 0, 130,0);
        ***********************************************************************/
        
                $text = $current_temp."°C";
                imagettftextboxopt($image, 22, 0, imagesx($image)-300, 115, $style['textcolor'], $style['fontb'], $text, $opt);
                $text = "Aktuell: $current_condition\nLuftfeuchte: $current_humidity\nWind: $current_wind_condition km/h $current_wind_dir \nLuftdruck: $current_pressure mbar";
                imagettftextboxopt($image, 12, 0, imagesx($image)-300, 155, $style['textcolor'], $style['fontb'], $text, $opt);
      
        /*********************** Halbtransparentbox *************************
        * roundbox_trans_neu($image, imagesx($image)-230, 0, imagesx($image)-5, imagesy($image)-15-330, 2, 0, 0, 0, 230,0);
        *********************************************************************/

Hat gefehlt.Dann hab ich die 3-er Box noch was nach oben geschoben und jetzt sieht es so aus.
Anhang anzeigen 69031

Also mir gefällt es so.
Danke an alle die geholfen haben.
Knusterus

Was gibts denn noch an Feeds ,was mich noch interessiert Staumeldungen von Hessen und das Fernsehprogramm.Gibt es da schon was Fertiges??
 
XBMC Infos im Infoframe

Zur Info ich hab mittlerweile auf meinem Infoframe die Anzeige eingebaut welche Musik bei mir im Moment per XBMC läuft inkl. Cover! ;-)

Die XBMC-Integration würde ich auch gerne im Infoframe haben! Wärest du so nett deinen Code mit einer kurzen Anleitung zu teilen?
 
tach
Ich versuche gerade eigene Feeds einzubauen aber irgendwie klappt es nicht,das einzige was funtzt ist Mydeals.das interessiert mich aber nicht.
Ich habe es mit dem TV Movie
Code:
 Tv Vorschau
feed_url_1 = "http://www.tvmovie.de/rss/tv2015?format=xml"
max_displayed_items_1 = 6
getestet aber der bildschirm bleibt leer.was mache ich falsch??

Knusterus:gruebel:
 
hast du denn oben bei
[FeedPlugin]
auch das ; rausgenommen?
 
hast du denn oben bei
[FeedPlugin]
auch das ; rausgenommen?
Jo hab ich.

@spoo3ner
Bei deinem Link bleibt es auch leer.
Wenn ich in die gleiche Linkzeile den Link
HTML:
http://feeds.feedburner.com/myDealZ?format=xml
einfüge geht es, aber wirklich nur dieser funktioniert,aber warum??
Knusterus
 
also der hier geht auch

TV Spielfilm
feed_url_1 = "http://www.tvspielfilm.de/tv-programm/rss/heute2015.xml"
max_displayed_items_3 = 3
 
Code:
; ARD-News
feed_url_1 = "http://www.tagesschau.de/xml/rss2/"
max_displayed_items_1 = 4

; TV-Movie
feed_url_2 = "http://www.tvmovie.de/rss/tvjetzt.xml"
max_displayed_items_2 = 4

Bei max_displayed _items _* must du angeben obs der 1. 2. usw feed ist
 
Kostenlos!

Neueste Beiträge

Statistik des Forums

Themen
248,890
Beiträge
2,304,176
Mitglieder
378,575
Neuestes Mitglied
King Manaka