myslím že kódom to nebude
Kód:
<?php
include"google_pocasie.php";
$obrazok = imagecreatefrompng("pozadie.gif");
$gw = new GoogleWeather();
$weather[0] = $gw->getWeatherInfo("Zilina");
$weather[1] = $gw->getWeatherInfo("Kosice");
$weather[2] = $gw->getWeatherInfo("Bratislava");
//farby
$color = imagecolorallocate( $obrazok, 200, 30, 30);
$color2 = imagecolorallocate( $obrazok, 5, 5, 5);
// Font
$font = './tahoma.ttf';
$font_b = './arialbd.ttf';
////////// VPYSOVANIE TEXTU DO OBRAZKOV
//Zilina dnes
imagettftext($obrazok, 9, 0, 5, 14, $color2, $font_b, 'Žilina - aktuálne');
imagettftext($obrazok, 8, 0, 26, 24, $color2, $font, 'Teplota: ');
imagettftext($obrazok, 8, 0, 63, 24, $color, $font_b, $weather[0][0]['temp_c']."°C");
imagettftext($obrazok, 8, 0, 26, 34, $color, $font, $weather[0][0]['condition']);
// IMG
$icon = imagecreatefromgif("http://www.google.com".$weather[0][0]['icon']."");
imagecopyresampled($icon, $icon, 0, 0, 0, 0, 20, 20, 40, 40);
imagecopymerge($obrazok, $icon, 5, 15, 0, 0, 20, 20, 80);
imagedestroy($icon);
//End Zilina Dnes
//Kosice dnes
imagettftext($obrazok, 9, 0, 5, 45, $color2, $font_b, 'Košice - aktuálne');
imagettftext($obrazok, 8, 0, 26, 55, $color2, $font, 'Teplota: ');
imagettftext($obrazok, 8, 0, 63, 55, $color, $font_b, $weather[1][0]['temp_c']."°C");
imagettftext($obrazok, 8, 0, 26, 65, $color, $font, $weather[1][0]['condition']);
// IMG
$icon = imagecreatefromgif("http://www.google.com".$weather[1][0]['icon']."");
imagecopyresampled($icon, $icon, 0, 0, 0, 0, 20, 20, 40, 40);
imagecopymerge($obrazok, $icon, 5, 46, 0, 0, 20, 20, 80);
imagedestroy($icon);
//End Kosice Dnes
//Blava dnes
imagettftext($obrazok, 9, 0, 5, 77, $color2, $font_b, 'Bratislava - aktuálne');
imagettftext($obrazok, 8, 0, 26, 87, $color2, $font, 'Teplota: ');
imagettftext($obrazok, 8, 0, 63, 87, $color, $font_b, $weather[2][0]['temp_c']."°C");
imagettftext($obrazok, 8, 0, 26, 97, $color, $font, $weather[2][0]['condition']);
// IMG
$icon = imagecreatefromgif("http://www.google.com".$weather[2][0]['icon']."");
imagecopyresampled($icon, $icon, 0, 0, 0, 0, 20, 20, 40, 40);
imagecopymerge($obrazok, $icon, 5, 78, 0, 0, 20, 20, 80);
imagedestroy($icon);
//End Blava Dnes
//Zilina Zajtra
imagettftext($obrazok, 9, 0, 155, 14, $color2, $font_b, 'Žilina - zajtra');
imagettftext($obrazok, 8, 0, 176, 24, $color2, $font, 'Teplota: ');
imagettftext($obrazok, 8, 0, 213, 24, $color, $font_b, $weather[0][2]['low']."/".$weather[0][2]['high']."°C");
imagettftext($obrazok, 8, 0, 176, 34, $color, $font, $weather[0][2]['condition']);
// IMG
$icon = imagecreatefromgif("http://www.google.com".$weather[0][2]['icon']."");
imagecopyresampled($icon, $icon, 0, 0, 0, 0, 20, 20, 40, 40);
imagecopymerge($obrazok, $icon, 155, 15, 0, 0, 20, 20, 80);
imagedestroy($icon);
//End Zilina Zajtra
//Kosice Zajtra
imagettftext($obrazok, 9, 0, 155, 45, $color2, $font_b, 'Košice - zajtra');
imagettftext($obrazok, 8, 0, 176, 55, $color2, $font, 'Teplota: ');
imagettftext($obrazok, 8, 0, 213, 55, $color, $font_b, $weather[1][2]['low']."/".$weather[1][2]['high']."°C");
imagettftext($obrazok, 8, 0, 176, 65, $color, $font, $weather[1][2]['condition']);
// IMG
$icon = imagecreatefromgif("http://www.google.com".$weather[1][2]['icon']."");
imagecopyresampled($icon, $icon, 0, 0, 0, 0, 20, 20, 40, 40);
imagecopymerge($obrazok, $icon, 155, 46, 0, 0, 20, 20, 80);
imagedestroy($icon);
//End Kosice Zajtra
//Blava Zajtra
imagettftext($obrazok, 9, 0, 155, 77, $color2, $font_b, 'Bratislava - zajtra');
imagettftext($obrazok, 8, 0, 176, 87, $color2, $font, 'Teplota: ');
imagettftext($obrazok, 8, 0, 213, 87, $color, $font_b, $weather[2][2]['low']."/".$weather[2][2]['high']."°C");
imagettftext($obrazok, 8, 0, 176, 97, $color, $font, $weather[2][2]['condition']);
// IMG
$icon = imagecreatefromgif("http://www.google.com".$weather[2][2]['icon']."");
imagecopyresampled($icon, $icon, 0, 0, 0, 0, 20, 20, 40, 40);
imagecopymerge($obrazok, $icon, 155, 78, 0, 0, 20, 20, 80);
imagedestroy($icon);
//End Blava Zajtra
unset($weather);
imagegif($obrazok);
?>