CVS: phpweather index.php,1.16,1.17
Brought to you by:
iridium
From: Martin G. <gim...@us...> - 2002-03-17 13:59:31
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv26852 Modified Files: index.php Log Message: The images found by pw_images are now also part of the output. Index: index.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/index.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- index.php 8 Jul 2001 17:09:24 -0000 1.16 +++ index.php 17 Mar 2002 13:59:26 -0000 1.17 @@ -76,7 +76,7 @@ echo ' <select name="language"> '; - $languages = $GLOBALS['obj']->get_languages(); + $languages = $GLOBALS['obj']->get_languages('text'); if (!empty($GLOBALS['language'])) { $selected = $GLOBALS['language']; @@ -102,7 +102,7 @@ echo ' <p> -<form action="index.php" method="post"> +<form action="index.php" method="get"> <input type="hidden" name="action" value="show_stations"> '; @@ -120,7 +120,7 @@ echo ' <p> -<form action="index.php" method="post"> +<form action="index.php" method="get"> <input type="hidden" name="action" value="show_weather"> '; @@ -142,7 +142,7 @@ echo ' <p> -<form action="index.php" method="post"> +<form action="index.php" method="get"> <input type="hidden" name="action" value="show_weather"> '; @@ -162,12 +162,34 @@ /* We should only display the current weather is the country isn't changed */ $obj->set_icao($icao); - $obj->set_language($language); + include(PHPWEATHER_BASE_DIR . "/output/pw_text_$language.php"); + $type = 'pw_text_' . $language; + $text = new $type($obj, array()); echo "<p>This is the current weather in " . $obj->get_location() . ":</p>\n"; - $obj->print_pretty(); + $text->print_pretty(); + + echo "<p>The same information in a table:</p>\n"; + $text->print_table(); + + echo "<p>The matching icons are:</p>\n"; + + include(PHPWEATHER_BASE_DIR . "/output/pw_icons.php"); + + $icons = new pw_icons($obj, array()); + + echo "<blockquote>\n"; + echo '<img src="' . $icons->get_sky_image() . + '" height="50" width="80" border="1"> '; + echo '<img src="' . $icons->get_winddir_image() . + '" height="40" width="40" border="1"> '; + echo '<img src="' . $icons->get_temp_image() . + '" height="50" width="20" border="1">'; + echo "</blockquote>\n"; + + echo "<p>The raw METAR is <code>" . $obj->get_metar() . "</code></p>\n"; } |