phpweather-checkins Mailing List for PHP Weather (Page 17)
Brought to you by:
iridium
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(1) |
Feb
(1) |
Mar
(184) |
Apr
(31) |
May
(45) |
Jun
(15) |
Jul
(11) |
Aug
(40) |
Sep
(19) |
Oct
(8) |
Nov
(6) |
Dec
(17) |
2003 |
Jan
(5) |
Feb
|
Mar
(12) |
Apr
(5) |
May
(2) |
Jun
(3) |
Jul
(3) |
Aug
(3) |
Sep
(17) |
Oct
(10) |
Nov
|
Dec
(4) |
2004 |
Jan
(21) |
Feb
(11) |
Mar
|
Apr
|
May
(3) |
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Max H. <ir...@us...> - 2002-03-24 22:49:55
|
Update of /cvsroot/phpweather/web In directory usw-pr-cvs1:/tmp/cvs-serv31163 Modified Files: index.php Log Message: Show a sample output, rather than nothing at all :) Index: index.php =================================================================== RCS file: /cvsroot/phpweather/web/index.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- index.php 23 Mar 2002 12:50:58 -0000 1.10 +++ index.php 24 Mar 2002 22:49:52 -0000 1.11 @@ -9,29 +9,30 @@ <p>This is the homepage of PHP Weather at <a href="http://www.sourceforge.net/">SourceForge</a>. You should go <a href="http://sourceforge.net/project/showfiles.php?group_id=23245">here to download</a> files.</p> -<!-- PHP Weather doesn't do anything as long as we can't get data to -it on SourceForge :-( So I've commented out the code below, so that -the page can load more quickly. <p>PHP Weather helps you do this on your webpages:</p> +<? $weather = new phpweather(array()); +$weather->set_metar("EGBE 242120Z 21005KT 200V270 CAVOK 08/03 Q1031"); $text = new pw_text_en($weather, array('mark_begin' => '<font color="blue">', 'mark_end' => '</font>')); $images = new pw_images($weather, array('icons_path' => 'phpweather/icons/')); -echo '<p>Current weather in ' . $weather->get_location() . ': ' . +echo '<p>Current weather in ' . $weather->get_location() . ': <br />' . '<img src="' . $images->get_sky_image() . '" height="50" width="80" border="1"> ' . '<img src="' . $images->get_winddir_image() . '" height="40" width="40" border="1"> ' . '<img src="' . $images->get_temp_image() . - '" height="50" width="20" border="1">'; + '" height="50" width="20" border="1"></p>'; -echo ". A textual report looks like this:</p>\n"; +echo "<p>A textual report looks like this:</p>\n"; $text->print_pretty(); +?> +<!-- echo "<p>Now try it yourself:</p>\n"; if (empty($action)) { @@ -131,7 +132,10 @@ --> -<?php +Due to limitations of the SourceForge server, we can not load the most up-to-date information here. To see +PHPWeather working properly, you can go <a href="http://www.warwick.ac.uk/~msufi/phpweather" target="new">here</a>. +<? + require_once('include/footer.php'); ?> |
From: Martin G. <gim...@us...> - 2002-03-24 20:13:06
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv8856 Modified Files: AUTHORS Log Message: I removed the entries for people who have translations for the old version. Hint: make a translation for the new version, and I'll add you to the list again :-) Index: AUTHORS =================================================================== RCS file: /cvsroot/phpweather/phpweather/AUTHORS,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- AUTHORS 17 Mar 2002 21:57:59 -0000 1.2 +++ AUTHORS 24 Mar 2002 20:13:01 -0000 1.3 @@ -40,12 +40,6 @@ Translated PHP Weather into Spanish, and thereby forced me to add support for multiply languages. (Which was a Good Thing :-) -Nicky Haan <ni...@ne...> - Translated PHP Weather into Dutch. - -Antoine Bajolet <ant...@fr...> - Translated PHP Weather into French. - Sven-Erik <sve...@an...> Translated PHP Weather into Norwegian. He also sat down and did the boring work, when he manually compiled @@ -56,16 +50,24 @@ just $cloud_coverage - which, of cause, didn't work. Ing. Vladimir Kotala <ko...@in...> - Made a Czech translation, and suggested that I changed the long text - '... degrees Celsius' into the more compact '... °C', which is much - better. - -Christian Ruetgers <ch...@1k...> - Made a German translation of PHP Weather. - -Carlo Gulin <ka...@ad...> - Translated PHP Weather into Italian. + Suggested that I changed the long text '... degrees Celsius' into + the more compact '... °C', which is much better. Gyulai Mihály http://gyulai.freeyellow.com/ Made the Hungarian translation for PHP Weather. He has also corrected tons of spelling errors. + +Johnny Funder <jh...@sl...> + Lots of explanations and suggestions. He also gave a much simpler + formula for calculating the relative humidity. + +Ray van Beek <r_v...@ho...> + Helped me spot a little error with the current weather. He has also + written code that displays the current weather as an image. + +David Kjellquist <da...@kj...> + Added support for windchill. + +Max Hammond <ma...@fl...> + Lots of different things: bugfixes, clever suggestions, and general + maintenance. |
From: Max H. <ir...@us...> - 2002-03-24 20:12:30
|
Update of /cvsroot/phpweather/phpweather-1.x In directory usw-pr-cvs1:/tmp/cvs-serv8975 Modified Files: locale_de.inc Log Message: Fixed windchill with a good german word, 'der Wind-chill-Index' :) Index: locale_de.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_de.inc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- locale_de.inc 24 Mar 2002 19:52:32 -0000 1.2 +++ locale_de.inc 24 Mar 2002 20:12:24 -0000 1.3 @@ -38,7 +38,7 @@ 'wind_str_calm' => '<b>Ruhe</b>', 'wind_vrb_long' => 'verschiedene Richtungen', 'wind_vrb_short' => 'VAR', - 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', + 'windchill' => ' Die Temperature einschliesslich des Wind-chill-Index war <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'in der letzten Stunde. ', 'precip_last_6_hours' => 'in den letzten 3 bis 6 Stunden. ', 'precip_last_24_hours' => 'in den letzten 24 Stunden. ', |
From: Martin G. <gim...@us...> - 2002-03-24 19:53:24
|
Update of /cvsroot/phpweather/phpweather-1.x In directory usw-pr-cvs1:/tmp/cvs-serv4033 Modified Files: AUTHORS Log Message: Yet another contribution - thanks! Index: AUTHORS =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/AUTHORS,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- AUTHORS 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ AUTHORS 24 Mar 2002 19:53:21 -0000 1.2 @@ -94,3 +94,6 @@ Ray van Beek <r_v...@ho...> Helped me spot a little error with the current weather. He has also written code that displays the current weather as an image. + +David Kjellquist <da...@kj...> + Added support for windchill. |
From: Martin G. <gim...@us...> - 2002-03-24 19:52:37
|
Update of /cvsroot/phpweather/phpweather-1.x In directory usw-pr-cvs1:/tmp/cvs-serv3761 Modified Files: locale_cz.inc locale_da.inc locale_de.inc locale_en.inc locale_es.inc locale_fr.inc locale_hu.inc locale_it.inc locale_mt.inc locale_nl.inc locale_no.inc locale_po_br.inc phpweather.inc Log Message: Thanks to David Kjellquist <da...@kj...> PHP Weather now has support for windchill. Index: locale_cz.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_cz.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_cz.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_cz.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -42,6 +42,7 @@ 'wind_str_calm' => '<b>bezvìtøí</b>', 'wind_vrb_long' => 'variable directions', 'wind_vrb_short' => 'VAR', + 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'za poslední hodinu. ', 'precip_last_6_hours' => 'za posledních 3 a¾ 6 hodin. ', 'precip_last_24_hours' => 'za posledních 24 hodin. ', @@ -57,7 +58,7 @@ 'Heavy' => 'tì¾ký ', 'nearby' => 'blízký ', 'current_weather' => 'Aktuální poèasí je <b>%s</b>. ', - 'pretty_print_metar' => '<blockquote><p>Pøed <b>%s</b> minutami, v <b>%s</b> UTC, byl vítr %s v %s. Teplota byla <b>%s</b> °C (<b>%s</b> F), tlak byl <b>%s</b> hPa (<b>%s</b> palcù Hg). Relativní vlhkost byla <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' + 'pretty_print_metar' => '<blockquote><p>Pøed <b>%s</b> minutami, v <b>%s</b> UTC, byl vítr %s v %s. Teplota byla <b>%s</b> °C (<b>%s</b> °F), %s tlak byl <b>%s</b> hPa (<b>%s</b> palcù Hg). Relativní vlhkost byla <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' ); $wind_dir_text_short_array = array( Index: locale_da.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_da.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_da.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_da.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -37,14 +37,15 @@ 'wind_str_calm' => '<b>stille</b>', 'wind_vrb_long' => 'forskellige retninger', 'wind_vrb_short' => 'VAR', + 'windchill' => ' afkølingsfaktoren var <b>%s</b> °C (<b>%s</b> °F)', 'precip_last_hour' => 'i den sidste time. ', 'precip_last_6_hours' => 'i de sidste 3 til 6 timer. ', 'precip_last_24_hours' => 'i de sidste 24 timer. ', 'precip_snow' => 'Der er <b>%s</b> mm (<b>%s</b> tommer) sne på jorden. ', - 'temp_min_max_6_hours' => 'Maksimum og minimums temperaturene i de sidste 6 timer var <b>%s</b> og <b>%s</b> grader Celsius (<b>%s</b> og <b>%s</b> grader Fahrenheit).', - 'temp_max_6_hours' => 'Maksimums temperaturen i de sidste 6 timer var <b>%s</b> grader Celsius (<b>%s</b> grader Fahrenheit). ', - 'temp_min_6_hours' => 'Minimums temperaturen i de sidste 6 var <b>%s</b> grader Celsius (<b>%s</b> grader Fahrenheit). ', - 'temp_min_max_24_hours' => 'Maksimums og minimumstemperaturene i de sidste 24 timer var <b>%s</b> og <b>%s</b> grader Celsius (<b>%s</b> og <b>%s</b> grader Fahrenheit). ', + 'temp_min_max_6_hours' => 'Maksimum og minimums temperaturene i de sidste 6 timer var <b>%s</b> og <b>%s</b> °C (<b>%s</b> og <b>%s</b> °F).', + 'temp_max_6_hours' => 'Maksimums temperaturen i de sidste 6 timer var <b>%s</b> °C (<b>%s</b> °F). ', + 'temp_min_6_hours' => 'Minimums temperaturen i de sidste 6 var <b>%s</b> °C (<b>%s</b> °F). ', + 'temp_min_max_24_hours' => 'Maksimums og minimumstemperaturene i de sidste 24 timer var <b>%s</b> og <b>%s</b> °C (<b>%s</b> og <b>%s</b> °F). ', 'runway_vis' => 'Sigtbarheden for bane <b>%s</b> er <b>%s</b> meter (<b>%s</b> fod).', 'runway_vis_min_max' => 'Sigtbarheden for bane <b>%s</b> varierer imellem <b>%s</b> meter (<b>%s</b> fod) og <b>%s</b> meter (<b>%s</b> fod).', 'light' => 'Let ', @@ -52,7 +53,7 @@ 'Heavy' => 'Kraftig ', 'nearby' => 'Tætliggende ', 'current_weather' => 'De aktuelle vejrforhold er: <b>%s</b>. ', - 'pretty_print_metar' => '<blockquote><p>For <b>%s</b> minutter siden, kl. <b>%s</b> UTC, blæste vinden %s i %s. Temperaturen var <b>%s</b> grader Celsius (<b>%s</b> grader Fahrenheit), og lufttrykket var <b>%s</b> hPa (<b>%s</b> inHg). Den relative luftfugtighed var <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' + 'pretty_print_metar' => '<blockquote><p>For <b>%s</b> minutter siden, kl. <b>%s</b> UTC, blæste vinden %s i %s. Temperaturen var <b>%s</b> °C (<b>%s</b> °F), %s og lufttrykket var <b>%s</b> hPa (<b>%s</b> inHg). Den relative luftfugtighed var <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' ); $wind_dir_text_short_array = array( Index: locale_de.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_de.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_de.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_de.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -38,6 +38,7 @@ 'wind_str_calm' => '<b>Ruhe</b>', 'wind_vrb_long' => 'verschiedene Richtungen', 'wind_vrb_short' => 'VAR', + 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'in der letzten Stunde. ', 'precip_last_6_hours' => 'in den letzten 3 bis 6 Stunden. ', 'precip_last_24_hours' => 'in den letzten 24 Stunden. ', @@ -53,7 +54,7 @@ 'Heavy' => 'schwerer ', 'nearby' => 'nahezu ', 'current_weather' => 'Das aktuelle Wetter ist <b>%s</b>. ', - 'pretty_print_metar' => '<blockquote><p>Vor <b>%s</b> minuten, um <b>%s</b> UTC, der Wind %s in %s. Die Temperatur war <b>%s</b> Grad Celsius (<b>%s</b> degrees Fahrenheit), und der Luftdruck war <b>%s</b> hPa (<b>%s</b> inHg). Die relative Luftfeuchtigkeit war <b>%s%%</b>. %s %s %s %s %s %s</p></blockquote>' + 'pretty_print_metar' => '<blockquote><p>Vor <b>%s</b> minuten, um <b>%s</b> UTC, der Wind %s in %s. Die Temperatur war <b>%s</b> Grad Celsius (<b>%s</b> degrees Fahrenheit), %s und der Luftdruck war <b>%s</b> hPa (<b>%s</b> inHg). Die relative Luftfeuchtigkeit war <b>%s%%</b>. %s %s %s %s %s %s</p></blockquote>' ); $wind_dir_text_short_array = array( Index: locale_en.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_en.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_en.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_en.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -37,14 +37,15 @@ 'wind_str_calm' => '<b>calm</b>', 'wind_vrb_long' => 'variable directions', 'wind_vrb_short' => 'VAR', + 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'in the last hour. ', 'precip_last_6_hours' => 'in the last 3 to 6 hours. ', 'precip_last_24_hours' => 'in the last 24 hours. ', 'precip_snow' => 'There is <b>%s</b> mm (<b>%s</b> inches) of snow on the ground. ', - 'temp_min_max_6_hours' => 'The maximum and minimum temperatures over the last 6 hours were <b>%s</b> and <b>%s</b> degrees Celsius (<b>%s</b> and <b>%s</b> degrees Fahrenheit).', - 'temp_max_6_hours' => 'The maximum temperature over the last 6 hours was <b>%s</b> degrees Celsius (<b>%s</b> degrees Fahrenheit). ', - 'temp_min_6_hours' => 'The minimum temperature over the last 6 hours was <b>%s</b> degrees Celsius (<b>%s</b> degrees Fahrenheit). ', - 'temp_min_max_24_hours' => 'The maximum and minimum temperatures over the last 24 hours were <b>%s</b> and <b>%s</b> degrees Celsius (<b>%s</b> and <b>%s</b> degrees Fahrenheit). ', + 'temp_min_max_6_hours' => 'The maximum and minimum temperatures over the last 6 hours were <b>%s</b> and <b>%s</b> °C (<b>%s</b> and <b>%s</b> °F).', + 'temp_max_6_hours' => 'The maximum temperature over the last 6 hours was <b>%s</b> °C (<b>%s</b> °F). ', + 'temp_min_6_hours' => 'The minimum temperature over the last 6 hours was <b>%s</b> °C (<b>%s</b> °F). ', + 'temp_min_max_24_hours' => 'The maximum and minimum temperatures over the last 24 hours were <b>%s</b> and <b>%s</b> °C (<b>%s</b> and <b>%s</b> °F). ', 'runway_vis' => 'The visibility for runway <b>%s</b> is <b>%s</b> meters (<b>%s</b> feet).', 'runway_vis_min_max' => 'The visibility for runway <b>%s</b> varies between <b>%s</b> meters (<b>%s</b> feet) and <b>%s</b> meters (<b>%s</b> feet).', 'light' => 'Light ', @@ -52,7 +53,7 @@ 'Heavy' => 'Heavy ', 'nearby' => 'Nearby ', 'current_weather' => 'Current weather is <b>%s</b>. ', - 'pretty_print_metar' => '<blockquote><p><b>%s</b> minutes ago, at <b>%s</b> UTC, the wind was %s in %s. The temperature was <b>%s</b> degrees Celsius (<b>%s</b> degrees Fahrenheit), and the pressure was <b>%s</b> hPa (<b>%s</b> inHg). The relative humidity was <b>%s%%</b>. %s %s %s %s %s %s</p></blockquote>' + 'pretty_print_metar' => '<blockquote><p><b>%s</b> minutes ago, at <b>%s</b> UTC, the wind was %s in %s. The temperature was <b>%s</b> °C (<b>%s</b> °F), %s and the pressure was <b>%s</b> hPa (<b>%s</b> inHg). The relative humidity was <b>%s%%</b>. %s %s %s %s %s %s</p></blockquote>' ); $wind_dir_text_short_array = array( Index: locale_es.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_es.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_es.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_es.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -37,6 +37,7 @@ 'wind_str_calm' => '<b>calmo</b>', 'wind_vrb_long' => 'variable directions', 'wind_vrb_short' => 'VAR', + 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'en la última hora. ', 'precip_last_6_hours' => 'durante las últimas 3 a 6 horas. ', 'precip_last_24_hours' => 'durante las últimas 24 horas. ', @@ -52,7 +53,7 @@ 'Heavy' => 'Severo ', 'nearby' => 'Cercano ', 'current_weather' => 'El clima actual es <b>%s</b>. ', - 'pretty_print_metar' => '<blockquote><p><b>%s</b> minutos atrás, de las <b>%s</b> UTC, el viento %s en %s. La temperatura era de <b>%s</b> grados Celsius (<b>%s</b> grados Fahrenheit), y la presión de <b>%s</b> hectopascales (hPa) (<b>%s</b> milibares (inHg)). La humedad relativa era de <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' + 'pretty_print_metar' => '<blockquote><p><b>%s</b> minutos atrás, de las <b>%s</b> UTC, el viento %s en %s. La temperatura era de <b>%s</b> grados Celsius (<b>%s</b> grados Fahrenheit), %s y la presión de <b>%s</b> hectopascales (hPa) (<b>%s</b> milibares (inHg)). La humedad relativa era de <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' ); $wind_dir_text_short_array = array( Index: locale_fr.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_fr.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_fr.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_fr.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -37,6 +37,7 @@ 'wind_str_calm' => '<b>calme</b>', 'wind_vrb_long' => 'variable directions', 'wind_vrb_short' => 'VAR', + 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'au cours de la dernière heure. ', 'precip_last_6_hours' => 'au cours des 3 à 6 dernières heures. ', 'precip_last_24_hours' => 'au cours des dernières 24 heures. ', @@ -52,7 +53,7 @@ 'Heavy' => 'Fort ', 'nearby' => 'Proche de ', 'current_weather' => 'La météo actuelle est <b>%s</b>. ', - 'pretty_print_metar' => '<blockquote><p>Il y a <b>%s</b> minutes, à <b>%s</b> UTC, le vent %s à %s. La température était de <b>%s</b> degrés Celsius (<b>%s</b> degrés Fahrenheit), et la pression atmosphérique était de <b>%s</b> hPa (<b>%s</b> inHg). Il y avait une humidité relative de <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' + 'pretty_print_metar' => '<blockquote><p>Il y a <b>%s</b> minutes, à <b>%s</b> UTC, le vent %s à %s. La température était de <b>%s</b> degrés Celsius (<b>%s</b> degrés Fahrenheit), %s et la pression atmosphérique était de <b>%s</b> hPa (<b>%s</b> inHg). Il y avait une humidité relative de <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' ); $wind_dir_text_short_array = array( Index: locale_hu.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_hu.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_hu.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_hu.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -44,6 +44,7 @@ 'wind_str_calm' => '<b>nem fúj</b>', 'wind_vrb_long' => 'változó', 'wind_vrb_short' => 'VAR', + 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'az utolsó órában. ', 'precip_last_6_hours' => 'az utóbbi 3-6 órában. ', 'precip_last_24_hours' => 'az utóbbi 24 órában. ', @@ -61,7 +62,7 @@ 'current_weather' => 'A pillanatnyi idõjárási jellemzõ: <b>%s</b>. ', 'pretty_print_metar' => '<blockquote><p><b>%s</b> perccel ezelõtt, <b>%s</b> UTC-kor, a szél %s (%s). A hõmérséklet <b>%s</b> Celsius fok -(<b>%s</b> Fahrenheit fok), a légnyomás <b>%s</b> hPa (<b>%s</b> +(<b>%s</b> Fahrenheit fok), %s a légnyomás <b>%s</b> hPa (<b>%s</b> Hgmm). Relatív páratartalom <b>%s%%</b>. %s %s %s %s %s %s</p></blockquote>' ); Index: locale_it.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_it.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_it.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_it.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -37,6 +37,7 @@ 'wind_str_calm' => '<b>calma</b>', 'wind_vrb_long' => 'direzione variabile', 'wind_vrb_short' => 'VAR', + 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'nella ultima ora. ', 'precip_last_6_hours' => 'nelle ultime 3 fino 6 ore. ', 'precip_last_24_hours' => 'nelle ultime 24 ore. ', @@ -52,7 +53,7 @@ 'Heavy' => 'Intenso ', 'nearby' => 'Vicino ', 'current_weather' => 'Le condizioni attuali sono <b>%s</b>. ', - 'pretty_print_metar' => '<blockquote><p><b>%s</b> minuti fa, alle <b>%s</b> UTC, il vento era %s in %s. La temperatura era <b>%s</b> gradi Celsius (<b>%s</b> gradi Fahrenheit), e la pressione era <b>%s</b> hPa (<b>%s</b> inHg). Umiditá relativa era <b>%s%%</b>. %s %s %s %s %s %s</p></blockquote>' + 'pretty_print_metar' => '<blockquote><p><b>%s</b> minuti fa, alle <b>%s</b> UTC, il vento era %s in %s. La temperatura era <b>%s</b> gradi Celsius (<b>%s</b> gradi Fahrenheit), %s e la pressione era <b>%s</b> hPa (<b>%s</b> inHg). Umiditá relativa era <b>%s%%</b>. %s %s %s %s %s %s</p></blockquote>' ); $wind_dir_text_short_array = array( Index: locale_mt.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_mt.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_mt.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_mt.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -40,6 +40,7 @@ 'wind_str_calm' => '<b>kalm</b>', 'wind_vrb_long' => 'direzzjoni varjabbli', 'wind_vrb_short' => 'VAR', + 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'fl-ahhar siegha. ', 'precip_last_6_hours' => 'fl-ahhar 3 sa 6 sieghat. ', 'precip_last_24_hours' => 'fl-ahhar 24 siegha. ', @@ -55,7 +56,7 @@ 'Heavy' => 'Qawwi ', 'nearby' => 'Qrib ', 'current_weather' => 'It-temp bhalissa huwa <b>%s</b>. ', - 'pretty_print_metar' => '<blockquote><p><b>%s</b> minuti ilu, ghall-habta ta\' <b>%s</b> UTC, ir-rih kien %s gewwa %s. It-temperatura kienet <b>%s</b> grad Celsius (<b>%s</b> grad Fahrenheit), u l-pressjoni kienet <b>%s</b> hPa (<b>%s</b> inHg). L-umdita\' kienet <b>%s%%</b>. %s %s %s %s %s %s</p></blockquote>' + 'pretty_print_metar' => '<blockquote><p><b>%s</b> minuti ilu, ghall-habta ta\' <b>%s</b> UTC, ir-rih kien %s gewwa %s. It-temperatura kienet <b>%s</b> grad Celsius (<b>%s</b> grad Fahrenheit), %s u l-pressjoni kienet <b>%s</b> hPa (<b>%s</b> inHg). L-umdita\' kienet <b>%s%%</b>. %s %s %s %s %s %s</p></blockquote>' ); $wind_dir_text_short_array = array( Index: locale_nl.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_nl.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_nl.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_nl.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -37,6 +37,7 @@ 'wind_str_calm' => '<b>kalm</b>', 'wind_vrb_long' => 'variable richtingen', 'wind_vrb_short' => 'VAR', + 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'in het laatste uur. ', 'precip_last_6_hours' => 'in de laatste 3 tot 6 uur. ', 'precip_last_24_hours' => 'in de laatste 24 uur. ', @@ -52,7 +53,7 @@ 'Heavy' => 'Zwaar ', 'nearby' => 'Dichtbij ', 'current_weather' => 'Het huidige weer is <b>%s</b>. ', - 'pretty_print_metar' => '<blockquote><p><b>%s</b> minuten geleden, om <b>%s</b> UTC, de wind blies %s nabij %s. De temperatuur was <b>%s</b> graden Celsius (<b>%s</b> graden Fahrenheit), en de barometerdruk was <b>%s</b> hPa (<b>%s</b> inHg). De relatieve vochtigheid was <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' + 'pretty_print_metar' => '<blockquote><p><b>%s</b> minuten geleden, om <b>%s</b> UTC, de wind blies %s nabij %s. De temperatuur was <b>%s</b> graden Celsius (<b>%s</b> graden Fahrenheit), %s en de barometerdruk was <b>%s</b> hPa (<b>%s</b> inHg). De relatieve vochtigheid was <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' ); $wind_dir_text_short_array = array( Index: locale_no.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_no.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_no.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_no.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -37,6 +37,7 @@ 'wind_str_calm' => '<b>stille</b>', 'wind_vrb_long' => 'variable retninger', 'wind_vrb_short' => 'VAR', + 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'i den siste timen. ', 'precip_last_6_hours' => 'i de siste 3 til 6 timer. ', 'precip_last_24_hours' => 'i de siste 24 timer. ', @@ -52,7 +53,7 @@ 'Heavy' => 'Kraftig ', 'nearby' => 'Nær ', 'current_weather' => 'Nåværende vær er <b>%s</b>. ', - 'pretty_print_metar' => '<blockquote><p><b>%s</b> minutter siden, klokka <b>%s</b> UTC, blåste vinden %s i %s. Temperaturen var <b>%s</b> grader Celsius (<b>%s</b> grader Fahrenheit), og lufttrykket var <b>%s</b> hPa (<b>%s</b> inHg). Den relative luftfuktigheten var <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' + 'pretty_print_metar' => '<blockquote><p><b>%s</b> minutter siden, klokka <b>%s</b> UTC, blåste vinden %s i %s. Temperaturen var <b>%s</b> grader Celsius (<b>%s</b> grader Fahrenheit), %s og lufttrykket var <b>%s</b> hPa (<b>%s</b> inHg). Den relative luftfuktigheten var <b>%s%%</b>. %s %s %s %s %s</p></blockquote>' ); Index: locale_po_br.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_po_br.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- locale_po_br.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ locale_po_br.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -47,6 +47,7 @@ 'wind_str_calm' => '<b>calmo</b>', 'wind_vrb_long' => 'direção variável', 'wind_vrb_short' => 'VAR', + 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'na última hora. ', 'precip_last_6_hours' => 'nas últimas 3 a 6 horas. ', 'precip_last_24_hours' => 'na últimas horas 24 horas. ', @@ -73,7 +74,7 @@ 'current_weather' => 'Tempo atual é <b>%s</b>. ', 'pretty_print_metar' => '<blockquote><p><b>%s</b> minutos atrás, às <b>%s</b> UTC, o vento estava %s em %s. A temperatura era de <b>%s</b> graus -Celsius (<b>%s</b> graus Fahrenheit), e a pressão do ar estava em <b>%s</b> +Celsius (<b>%s</b> graus Fahrenheit), %s e a pressão do ar estava em <b>%s</b> hPa (<b>%s</b> inHg). A umidade relativa era de <b>%s%%</b>. %s %s %s %s %s %s</p></blockquote>' ); Index: phpweather.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/phpweather.inc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- phpweather.inc 7 Mar 2002 09:49:11 -0000 1.1.1.1 +++ phpweather.inc 24 Mar 2002 19:52:32 -0000 1.2 @@ -294,6 +294,15 @@ $wind_str = $strings['wind_str_calm']; } + /* Windchill */ + if (isset($data['windchill_c'])) { + $windchill_str = sprintf($strings['windchill'], + $data['windchill_c'], + $data['windchill_f']); + } else { + $windchill_str = ''; + } + /* Precipitation. */ $prec_str = ''; if (isset($data['precip_in'])) { @@ -371,6 +380,7 @@ $location, $data['temp_c'], $data['temp_f'], + $windchill_str, $data['altimeter_hpa'], $data['altimeter_inhg'], $data['rel_humidity'], @@ -964,6 +974,25 @@ ((237.3 + $decoded_metar['dew_c']) * (237.3 + $decoded_metar['temp_c'])) + 2)), 1); + /* + * Windchill. + * + * This is only appropriate if temp < 40f and windspeed > 3 mph + */ + if ($decoded_metar['temp_f'] <= '40' && + $decoded_metar['wind_miles_per_hour'] > '3'){ + $decoded_metar['windchill_f'] = + number_format(35.74 + 0.6215 * $decoded_metar['temp_f'] - + 35.75 * pow($decoded_metar['wind_miles_per_hour'], 0.16) + + 0.4275 * $decoded_metar['temp_f'] * + pow($decoded_metar['wind_miles_per_hour'],0.16)); + $decoded_metar['windchill_c'] = + number_format(13.112 + 0.6215 * $decoded_metar['temp_c'] - + 13.37 * pow(($decoded_metar['wind_miles_per_hour']/1.609), 0.16) + + 0.3965 * $decoded_metar['temp_c'] * + pow(($decoded_metar['wind_miles_per_hour']/1.609),0.16)); + } + return $decoded_metar; } |
From: Martin G. <gim...@us...> - 2002-03-24 19:18:19
|
Update of /cvsroot/phpweather/phpweather/output In directory usw-pr-cvs1:/tmp/cvs-serv29771 Modified Files: pw_text_da.php Log Message: Updated windchill. Index: pw_text_da.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text_da.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- pw_text_da.php 24 Mar 2002 17:25:48 -0000 1.2 +++ pw_text_da.php 24 Mar 2002 19:18:16 -0000 1.3 @@ -96,7 +96,7 @@ $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'Den relative luftfugtigheden var '; - $this->strings['windchill'] = 'Temperaturen, med vindkylde, var '; + $this->strings['windchill'] = 'Temperaturen, inklusiv afkølingsfaktoren, var '; $this->strings['cloud_group_beg'] = 'Der var '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'Himlen var %sskyfri%s.'; |
From: Max H. <ir...@us...> - 2002-03-24 17:25:51
|
Update of /cvsroot/phpweather/phpweather/output In directory usw-pr-cvs1:/tmp/cvs-serv3062 Modified Files: pw_text.php pw_text_da.php pw_text_en.php pw_text_hu.php pw_text_no.php Log Message: Added windchill factor Index: pw_text.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- pw_text.php 20 Mar 2002 19:26:50 -0000 1.3 +++ pw_text.php 24 Mar 2002 17:25:48 -0000 1.4 @@ -766,6 +766,15 @@ $this->properties['mark_end'] . '.'; } + function print_pretty_windchill($windchill) { + extract($windchill); + $output = $this->strings['windchill'] . + $this->pref_units($this->properties['mark_begin'] . $windchill_c . + $this->properties['mark_end'] . ' °C', + $this->properties['mark_begin'] . $windchill_f . + $this->properties['mark_end'] . ' °F') . '.'; + return $output; + } function print_pretty_clouds($clouds) { if (empty($clouds[0]) || @@ -1004,6 +1013,14 @@ if (!in_array('temperature', $this->properties['exclude']) && !empty($temperature)) { $output['temperature'] = $this->print_pretty_temperature($temperature); + } + + /********************************* + * Windchill * + *********************************/ + if (!in_array('windchill', $this->properties['exclude']) && + !empty($windchill)) { + $output['windchill'] = $this->print_pretty_windchill($windchill); } /**************************** Index: pw_text_da.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text_da.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- pw_text_da.php 17 Mar 2002 13:39:04 -0000 1.1 +++ pw_text_da.php 24 Mar 2002 17:25:48 -0000 1.2 @@ -96,6 +96,7 @@ $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'Den relative luftfugtigheden var '; + $this->strings['windchill'] = 'Temperaturen, med vindkylde, var '; $this->strings['cloud_group_beg'] = 'Der var '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'Himlen var %sskyfri%s.'; Index: pw_text_en.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text_en.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- pw_text_en.php 18 Mar 2002 16:14:31 -0000 1.2 +++ pw_text_en.php 24 Mar 2002 17:25:48 -0000 1.3 @@ -98,6 +98,7 @@ $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'The relative humidity was '; + $this->strings['windchill'] = 'The temperature including windchill was '; $this->strings['cloud_group_beg'] = 'There were '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'The sky was %sclear%s.'; Index: pw_text_hu.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text_hu.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- pw_text_hu.php 20 Mar 2002 19:26:50 -0000 1.2 +++ pw_text_hu.php 24 Mar 2002 17:25:48 -0000 1.3 @@ -106,6 +106,7 @@ $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'A relatív páratartalom '; + $this->strings['windchill'] = 'The temperature including windchill was '; $this->strings['cloud_group_beg'] = 'Az égbolton'; $this->strings['cloud_group_end'] = ' magasságban.'; $this->strings['cloud_clear'] = 'Az égbolt %sfelhõtlen%s volt.'; Index: pw_text_no.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text_no.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- pw_text_no.php 17 Mar 2002 13:39:04 -0000 1.1 +++ pw_text_no.php 24 Mar 2002 17:25:48 -0000 1.2 @@ -97,6 +97,7 @@ $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'Den relative fuktigheten var '; + $this->strings['windchill'] = 'Temperaturen, med vindkylde, var '; $this->strings['cloud_group_beg'] = 'Det var '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'Himmelen var %sclear%s.'; |
From: Max H. <ir...@us...> - 2002-03-24 17:25:38
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv3016 Modified Files: phpweather.php Log Message: Added windchill factor Index: phpweather.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/phpweather.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- phpweather.php 20 Mar 2002 19:26:50 -0000 1.17 +++ phpweather.php 24 Mar 2002 17:25:35 -0000 1.18 @@ -681,6 +681,21 @@ + 2)), 1); } + + /* + * Compute windchill if temp < 40f and windspeed > 3 mph + */ + if ($decoded_metar['temperature']['temp_f'] <= '40' && $decoded_metar['wind']['miles_per_hour'] > '3'){ + $decoded_metar['windchill']['windchill_f'] = + number_format(35.74 + 0.6215*$decoded_metar['temperature']['temp_f'] + - 35.75*pow($decoded_metar['wind']['miles_per_hour'],0.16) + + 0.4275*$decoded_metar['temperature']['temp_f']*pow($decoded_metar['wind']['miles_per_hour'],0.16)); + $decoded_metar['windchill']['windchill_c'] = + number_format(13.112 + 0.6215*$decoded_metar['temperature']['temp_c'] + - 13.37*pow(($decoded_metar['wind']['miles_per_hour']/1.609),0.16) + + 0.3965*$decoded_metar['temperature']['temp_c']*pow(($decoded_metar['wind']['miles_per_hour']/1.609),0.16)); + } + /* Finally we store our decoded METAR in $this->decoded_metar so * that other methods can use it. */ |
From: Max H. <ir...@us...> - 2002-03-24 16:44:54
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv25761 Modified Files: .cvsignore Log Message: ignore test.php file Index: .cvsignore =================================================================== RCS file: /cvsroot/phpweather/phpweather/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- .cvsignore 19 May 2001 10:17:22 -0000 1.3 +++ .cvsignore 24 Mar 2002 16:44:51 -0000 1.4 @@ -2,3 +2,4 @@ defaults.*.php metars.db stations.db +test.php |
From: Max H. <ir...@us...> - 2002-03-24 16:43:28
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv25439 Modified Files: test.php Log Message: Might as well get it right *sigh* Index: test.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/test.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- test.php 24 Mar 2002 16:40:41 -0000 1.1 +++ test.php 24 Mar 2002 16:43:24 -0000 1.2 @@ -9,9 +9,6 @@ <?php error_reporting(E_ERROR); -/* Checkpoint, we store the time */ -$time[] = array(microtime(), 'start'); - require('phpweather.php'); require('pw_utilities.php'); |
From: Max H. <ir...@us...> - 2002-03-24 16:40:44
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv24817 Added Files: test.php Log Message: A file to make testing weather parsing easier and quicker for developers. --- NEW FILE --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>PHPWeather test configuration file</title> </head> <body> <?php error_reporting(E_ERROR); /* Checkpoint, we store the time */ $time[] = array(microtime(), 'start'); require('phpweather.php'); require('pw_utilities.php'); $weather = new phpweather(array()); $weather->set_metar('EGBE 241450Z 18030KT 140V230 9000 FEW025 M10/M15 Q1032'); $language = "en"; include(PHPWEATHER_BASE_DIR . "/output/pw_text_$language.php"); $type = 'pw_text_' . $language; $text = new $type($weather, array()); $text->print_pretty(); ?> </body> </html> |
From: Martin G. <gim...@us...> - 2002-03-23 12:51:01
|
Update of /cvsroot/phpweather/web In directory usw-pr-cvs1:/tmp/cvs-serv31680 Modified Files: index.php Log Message: This is just a temporary fix until we figure out a way to get data into SourceForge. Index: index.php =================================================================== RCS file: /cvsroot/phpweather/web/index.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- index.php 18 Mar 2002 17:57:07 -0000 1.9 +++ index.php 23 Mar 2002 12:50:58 -0000 1.10 @@ -9,9 +9,12 @@ <p>This is the homepage of PHP Weather at <a href="http://www.sourceforge.net/">SourceForge</a>. You should go <a href="http://sourceforge.net/project/showfiles.php?group_id=23245">here to download</a> files.</p> - <p>PHP Weather helps you do this on your webpages:</p> +<!-- PHP Weather doesn't do anything as long as we can't get data to +it on SourceForge :-( So I've commented out the code below, so that +the page can load more quickly. + +<p>PHP Weather helps you do this on your webpages:</p> -<?php $weather = new phpweather(array()); $text = new pw_text_en($weather, array('mark_begin' => '<font color="blue">', 'mark_end' => '</font>')); @@ -126,6 +129,9 @@ } } +--> + +<?php require_once('include/footer.php'); ?> |
From: Martin G. <gim...@us...> - 2002-03-23 12:47:45
|
Update of /cvsroot/phpweather/web/docs/1.x In directory usw-pr-cvs1:/tmp/cvs-serv30821/1.x Modified Files: dbcaching.php Log Message: Fix. Index: dbcaching.php =================================================================== RCS file: /cvsroot/phpweather/web/docs/1.x/dbcaching.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- dbcaching.php 18 Mar 2002 17:36:39 -0000 1.1 +++ dbcaching.php 23 Mar 2002 12:47:43 -0000 1.2 @@ -97,5 +97,5 @@ expected that the station has made a new observation, so we should update our data.</p> -<?php require('../../include/header.php'); ?> +<?php require('../../include/footer.php'); ?> |
From: Martin G. <gim...@gi...> - 2002-03-22 21:51:25
|
Max Hammond <ir...@us...> writes: > Update of /cvsroot/phpweather/phpweather > In directory usw-pr-cvs1:/tmp/cvs-serv27556 >=20 > Modified Files: > data_retrieval.php=20 > Log Message: > Typo? Was broken, now fixed. Sorry about that - my mistake! Thanks for looking after me :-) =2D-=20 Martin Geisler My GnuPG Key: 0xF7F6B57B See my homepage at http://www.gimpster.com/ for: PHP Weather =3D> Shows the current weather on your webpage. PHP Shell =3D> A telnet-connection (almost :-) in a PHP page. |
From: Max H. <ir...@us...> - 2002-03-22 17:54:12
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv27556 Modified Files: data_retrieval.php Log Message: Typo? Was broken, now fixed. Index: data_retrieval.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/data_retrieval.php,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- data_retrieval.php 20 Mar 2002 19:26:50 -0000 1.20 +++ data_retrieval.php 22 Mar 2002 17:54:08 -0000 1.21 @@ -233,18 +233,19 @@ /* We use the @file notation here because it might fail. */ $file = @file('http://weather.noaa.gov/pub/data/' . "observations/metar/stations/$icao.TXT"); + } /* Here we test to see if we actually got a METAR. */ if (is_array($file)) { /* The first line in the file is the date */ - $date = trim(array_shift($lines)); + $date = trim(array_shift($file)); /* The remaining lines are the METAR itself. This will merge the * remaining lines into one line by removing new-lines: */ - $metar = ereg_replace("[\n\r ]+", ' ', trim(implode(' ', $lines))); + $metar = ereg_replace("[\n\r ]+", ' ', trim(implode(' ', $file))); $date = explode(':', strtr($date, '/ ', '::')); if ($date[2] > gmdate('j')) { @@ -299,6 +300,7 @@ } /* We update and return the METAR */ $this->metar = $metar; + return $metar; } |
From: Martin G. <gim...@us...> - 2002-03-20 19:26:54
|
Update of /cvsroot/phpweather/phpweather/db In directory usw-pr-cvs1:/tmp/cvs-serv31666/db Modified Files: pw_db_common.php pw_db_dba.php pw_db_mysql.php pw_db_null.php pw_db_pgsql.php Log Message: All files now use require_once() instead of just require() - this means, that there's no need for those 'if defined('...') return ...' statements at the top of each file any more. Index: pw_db_common.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/db/pw_db_common.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- pw_db_common.php 7 Mar 2002 09:40:38 -0000 1.1 +++ pw_db_common.php 20 Mar 2002 19:26:50 -0000 1.2 @@ -1,12 +1,6 @@ <?php -/* This code makes sure that the file is only included once. */ -if (defined('PW_DB_COMMON')) { - return; -} else { - define('PW_DB_COMMON', true); -} -require(PHPWEATHER_BASE_DIR . '/base_object.php'); +require_once(PHPWEATHER_BASE_DIR . '/base_object.php'); /** * Common class for all the database-types. Index: pw_db_dba.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/db/pw_db_dba.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- pw_db_dba.php 18 Mar 2002 16:57:54 -0000 1.2 +++ pw_db_dba.php 20 Mar 2002 19:26:50 -0000 1.3 @@ -1,12 +1,6 @@ <?php -/* This code makes sure that the file is only included once. */ -if (defined('PW_DB_DBA')) { - return; -} else { - define('PW_DB_DBA', true); -} -require(PHPWEATHER_BASE_DIR . '/db/pw_db_common.php'); +require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_common.php'); /** * This class is the 'dba' database-type. This type of database is a Index: pw_db_mysql.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/db/pw_db_mysql.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- pw_db_mysql.php 7 Mar 2002 09:40:38 -0000 1.1 +++ pw_db_mysql.php 20 Mar 2002 19:26:50 -0000 1.2 @@ -1,12 +1,6 @@ <?php -/* This code makes sure that the file is only included once. */ -if (defined('PW_DB_MYSQL')) { - return; -} else { - define('PW_DB_MYSQL', true); -} -require(PHPWEATHER_BASE_DIR . '/db/pw_db_common.php'); +require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_common.php'); /** * This class is the 'mysql' database-type. Index: pw_db_null.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/db/pw_db_null.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- pw_db_null.php 7 Mar 2002 09:40:38 -0000 1.1 +++ pw_db_null.php 20 Mar 2002 19:26:50 -0000 1.2 @@ -1,12 +1,6 @@ <?php -/* This code makes sure that the file is only included once. */ -if (defined('PW_DB_NULL')) { - return; -} else { - define('PW_DB_NULL', true); -} -require(PHPWEATHER_BASE_DIR . '/db/pw_db_common.php'); +require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_common.php'); /** * This class is the 'null' database-type Index: pw_db_pgsql.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/db/pw_db_pgsql.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- pw_db_pgsql.php 7 Mar 2002 09:40:38 -0000 1.1 +++ pw_db_pgsql.php 20 Mar 2002 19:26:50 -0000 1.2 @@ -1,12 +1,6 @@ <?php -/* This code makes sure that the file is only included once. */ -if (defined('PW_DB_PGSQL')) { - return; -} else { - define('PW_DB_PGSQL', true); -} -require(PHPWEATHER_BASE_DIR . '/db/pw_db_common.php'); +require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_common.php'); /** * This class is the 'pgsql' database-type |
From: Martin G. <gim...@us...> - 2002-03-20 19:26:54
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv31666 Modified Files: base_object.php configurator.php data_retrieval.php db_layer.php images-test.php phpweather.php Log Message: All files now use require_once() instead of just require() - this means, that there's no need for those 'if defined('...') return ...' statements at the top of each file any more. Index: base_object.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/base_object.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- base_object.php 17 Jul 2001 12:12:03 -0000 1.11 +++ base_object.php 20 Mar 2002 19:26:50 -0000 1.12 @@ -1,10 +1,4 @@ <?php -/* This code makes sure that the file is only included once. */ -if (defined('BASE_OBJECT')) { - return; -} else { - define('BASE_OBJECT', true); -} /** * Provides some basic capabilities like error-handling and handling Index: configurator.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/configurator.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- configurator.php 19 Aug 2001 13:58:50 -0000 1.14 +++ configurator.php 20 Mar 2002 19:26:50 -0000 1.15 @@ -443,7 +443,7 @@ } elseif ($action == 'do_sql') { define('PHPWEATHER_BASE_DIR', dirname(__FILE__)); -require(PHPWEATHER_BASE_DIR . '/db_layer.php'); +require_once(PHPWEATHER_BASE_DIR . '/db_layer.php'); $db = new db_layer(array()); if ($db->db->create_tables()) { Index: data_retrieval.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/data_retrieval.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- data_retrieval.php 15 Mar 2002 12:01:48 -0000 1.19 +++ data_retrieval.php 20 Mar 2002 19:26:50 -0000 1.20 @@ -1,12 +1,6 @@ <?php -/* This code makes sure that the file is only included once. */ -if (defined('DATA_RETRIEVAL')) { - return; -} else { - define('DATA_RETRIEVAL', true); -} -require(PHPWEATHER_BASE_DIR . '/db_layer.php'); +require_once(PHPWEATHER_BASE_DIR . '/db_layer.php'); /** * This class contains all the logic needed to get and store METARs. @@ -22,11 +16,12 @@ * The METAR is stored here. * * The property is used whenever someone wants access to the raw - * METAR. Although you shouldn't do it, it is possible to set this - * directly. But that is only something the developers should do for - * testing... :-) + * METAR. This should be used for reading only, if you want to + * change the METAR (for testing purposes etc.), then use + * set_metar() instead. * * @var string + * @see set_metar() */ var $metar; @@ -46,10 +41,10 @@ * @param array The initial properties of the object. */ function data_retrieval($input) { - /* We start by calling the parent constructor. */ + /* We start by calling the parent constructor. */ $this->db_layer($input); - - /* Then we set the station. */ + + /* Then we set the station. */ $this->set_icao($this->properties['icao']); } @@ -75,11 +70,10 @@ * @param string The ICAO of the new station. */ function set_icao($new_icao) { - - /* We start by adding slashes, since $new_icao might come directly - * from the user. - */ - + + /* We start by adding slashes, since $new_icao might come directly + * from the user. + */ $new_icao = addslashes($new_icao); if ($new_icao != $this->get_icao()) { $this->properties['icao'] = strtoupper($new_icao); @@ -99,7 +93,6 @@ * @access public * @return string The raw METAR. */ - function get_metar() { if (empty($this->metar)) { /* The METAR is not set - we try to load it */ @@ -112,13 +105,13 @@ } /** - * Sets the metar directly, for testing etc + * Sets the METAR directly, for testing etc * - * It loads and decodes the metar if it is - * different from the old one. If the new metar is the same as - * the old one, nothing is changed. + * It loads and decodes the METAR if it is different from the old + * one. If the new METAR is the same as the old one, nothing is + * changed. * - * Also sets the ICAO to be correct for this metar + * Also sets the ICAO to be correct for this METAR. * * @access public * @param string The METAR we want decoded. @@ -150,7 +143,6 @@ * @access public * @return string The raw METAR. */ - function get_metar_from_db() { if (!$this->db->connect()) { return false; @@ -160,28 +152,32 @@ $this->debug('get_metar_from_db(): Found the METAR in the database'); list($metar, $timestamp) = $data; - /* We set the METAR right away, and then count on - * get_metar_from_web() to set it to something else, if - * necessary. - */ + /* We set the METAR right away, and then count on + * get_metar_from_web() to set it to something else, if + * necessary. + */ $this->metar = $metar; if ($this->properties['always_use_db'] || $timestamp > time() - 3600) { - /* We have asked explicit for a cached METAR, or the METAR is - * still fresh. Either way - we return the METAR we found in - * the database. - */ - - $this->debug('get_metar_from_db(): Using previously cached METAR for <code>' . $this->get_location() . '</code>. The METAR expires in ' . ($timestamp + 3600 - time()) . ' seconds.'); + /* We have asked explicit for a cached METAR, or the METAR is + * still fresh. Either way - we return the METAR we found in + * the database. + */ + $this->debug('get_metar_from_db(): Using previously cached METAR for <code>' . + $this->get_location() . '</code>. The METAR expires in ' . + ($timestamp + 3600 - time()) . ' seconds.'); return $metar; } else { - /* The METAR is too old, so we fetch new */ - $this->debug('get_metar_from_db(): The METAR for <code>' . $this->get_location() . '</code> was ' . (time() - 3600 - $timestamp) . ' seconds too old.'); + /* The METAR is too old, so we fetch new */ + $this->debug('get_metar_from_db(): The METAR for <code>' . + $this->get_location() . '</code> was ' . + (time() - 3600 - $timestamp) . ' seconds too old.'); return $this->get_metar_from_web(false); } } else { - /* We need to get a new METAR from the web. */ - $this->debug('get_metar_from_db(): New station <code>' . $this->get_location() . '</code> - fetching a new METAR.'); + /* We need to get a new METAR from the web. */ + $this->debug('get_metar_from_db(): New station <code>' . + $this->get_location() . '</code> - fetching a new METAR.'); return $this->get_metar_from_web(true); } } @@ -190,21 +186,22 @@ * Fetches a METAR from the Internet. * * The METAR is fetched via HTTP from the National Weather Services - * public server at http://weather.noaa.gov . + * public server. The files can be found under the + * http://weather.noaa.gov/pub/data/observations/metar/stations/ + * directory as ICAO.TXT where ICAO is replaced by the actual ICAO. * * @param boolean Should the station be inserted into the database, * or should we update an already existing entry? * @access public * @return string The raw METAR. */ - function get_metar_from_web($new_station) { $metar = ''; $icao = $this->get_icao(); if ($this->properties['use_proxy']) { - /* We use a proxy */ - /* Inspirated by code from Paul Kairis <Pau...@sa...> */ + /* We use a proxy */ + /* Inspirated by code from Paul Kairis <Pau...@sa...> */ $fp = fsockopen($this->properties['proxy_host'], $this->properties['proxy_port']); @@ -215,15 +212,15 @@ "Pragma: no-cache\r\n". "Cache-Contol: no-cache\r\n\r\n"); - /* We check the status line */ + /* We check the status line */ if (strpos(fgets($fp, 1024), '200 ')) { - /* Then we seek until we find the empty line between the - * headers and the contents. - */ + /* Then we seek until we find the empty line between the + * headers and the contents. + */ do { $line = fgets($fp, 1024); } while ($line != "\r\n"); - /* We know now, that the following lines are the contents. */ + /* We know now, that the following lines are the contents. */ unset($file); while ($line = fgets($fp, 1024)) { $file[] = $line; @@ -232,61 +229,56 @@ } } } else { - /* No proxy - we just fetch the file the normal way. */ - /* We use the @file notation here because it might fail. */ + /* No proxy - we just fetch the file the normal way. */ + /* We use the @file notation here because it might fail. */ $file = @file('http://weather.noaa.gov/pub/data/' . "observations/metar/stations/$icao.TXT"); } - /* Here we test to see if we actually got a METAR. */ + + /* Here we test to see if we actually got a METAR. */ if (is_array($file)) { - /* The first line in the file is the date */ - list(, $date) = each($file); - $date = trim($date); - /* The next lines are the METAR itself. We make sure that we - * don't put a space in front of the first line. - */ - list(, $line) = each($file); - $metar = trim($line); - /* Then the rest of the lines... */ - while (list(, $line) = each($file)) { - $metar .= ' ' . trim($line); - } + + /* The first line in the file is the date */ + $date = trim(array_shift($lines)); - /* We don't want any double-spaces in our METAR */ - $metar = ereg_replace('[ ]+', ' ', $metar); + /* The remaining lines are the METAR itself. This will merge the + * remaining lines into one line by removing new-lines: + */ + $metar = ereg_replace("[\n\r ]+", ' ', trim(implode(' ', $lines))); $date = explode(':', strtr($date, '/ ', '::')); if ($date[2] > gmdate('j')) { - /* The day is greater that the current day of month - * => the report is from last month. - */ - $date[1]--; + /* The day is greater that the current day of month. This + * implies, that the report is from last month. + */ + $date[1]--; } - $timestamp = gmmktime($date[3], $date[4], 0, $date[1], $date[2], $date[0]); + $timestamp = gmmktime($date[3], $date[4], 0, $date[1], + $date[2], $date[0]); if (!ereg('[0-9]{6}Z', $metar)) { - /* Some reports don't even have a time-part, so we insert the - * current time. This might not be the time of the report, but - * it was broken anyway :-) - */ - $metar = gmdate('dHi', $timestamp) . 'Z ' . $metar; + /* Some reports don't even have a time-part, so we insert the + * current time. This might not be the time of the report, but + * it was broken anyway :-) + */ + $metar = gmdate('dHi', $timestamp) . 'Z ' . $metar; } - + if ($timestamp < (time() - 3300)) { - /* The timestamp in the METAR is more than 55 minutes old. We - * adjust the timestamp, so that we won't try to fetch a new - * METAR within the next 5 minutes. After 5 minutes, the - * timestamp will again be more than 1 hour old. - */ + /* The timestamp in the METAR is more than 55 minutes old. We + * adjust the timestamp, so that we won't try to fetch a new + * METAR within the next 5 minutes. After 5 minutes, the + * timestamp will again be more than 1 hour old. + */ $timestamp = time() - 3300; } } else { - /* If we end up here, it means that there was no file. If the - * station was a new station, we set the metar to an empty - * string, else we just use the old METAR. We adjust the time - * stored in the database in both cases, so that the server - * isn't stressed too much. - */ + /* If we end up here, it means that there was no file. If the + * station was a new station, we set the metar to an empty + * string, else we just use the old METAR. We adjust the time + * stored in the database in both cases, so that the server + * isn't stressed too much. + */ if ($new_station) { $metar = ''; } else { @@ -295,15 +287,17 @@ $timestamp = time() - 3000; } - /* We then cache the METAR in our database */ + /* We then cache the METAR in our database */ if ($new_station) { - $this->debug('get_metar_from_web(): Inserting new METAR for <code>' . $this->get_location() . '</code>'); + $this->debug('get_metar_from_web(): Inserting new METAR for <code>' . + $this->get_location() . '</code>'); $this->db->insert_metar($icao, $metar, $timestamp); } else { - $this->debug('get_metar_from_web(): Updating METAR for <code>' . $this->get_location() . '</code>'); + $this->debug('get_metar_from_web(): Updating METAR for <code>' . + $this->get_location() . '</code>'); $this->db->update_metar($icao, $metar, $timestamp); } - /* We update and return the METAR */ + /* We update and return the METAR */ $this->metar = $metar; return $metar; } Index: db_layer.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/db_layer.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- db_layer.php 7 Mar 2002 09:42:41 -0000 1.11 +++ db_layer.php 20 Mar 2002 19:26:50 -0000 1.12 @@ -1,16 +1,10 @@ <?php -/* This code makes sure that the file is only included once. */ -if (defined('DB_LAYER')) { - return; -} else { - define('DB_LAYER', true); -} -require(PHPWEATHER_BASE_DIR . '/base_object.php'); -require(PHPWEATHER_BASE_DIR . '/db/pw_db_null.php'); -require(PHPWEATHER_BASE_DIR . '/db/pw_db_dba.php'); -require(PHPWEATHER_BASE_DIR . '/db/pw_db_mysql.php'); -require(PHPWEATHER_BASE_DIR . '/db/pw_db_pgsql.php'); +require_once(PHPWEATHER_BASE_DIR . '/base_object.php'); +require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_null.php'); +require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_dba.php'); +require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_mysql.php'); +require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_pgsql.php'); /** * This class is used to maintain the database-object. Index: images-test.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/images-test.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- images-test.php 17 Mar 2002 14:02:15 -0000 1.1 +++ images-test.php 20 Mar 2002 19:26:50 -0000 1.2 @@ -8,12 +8,12 @@ error_reporting(E_ALL); -require('phpweather.php'); +require_once('phpweather.php'); -require('output/pw_text_en.php'); -require('output/pw_text_da.php'); +require_once('output/pw_text_en.php'); +require_once('output/pw_text_da.php'); -require('output/pw_images.php'); +require_once('output/pw_images.php'); $weather = new phpweather(array('icao' => 'EHEH')); Index: phpweather.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/phpweather.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- phpweather.php 17 Mar 2002 13:32:25 -0000 1.16 +++ phpweather.php 20 Mar 2002 19:26:50 -0000 1.17 @@ -3,7 +3,7 @@ /* The location of this file defines the base directory */ define('PHPWEATHER_BASE_DIR', dirname(__FILE__)); -require(PHPWEATHER_BASE_DIR . '/data_retrieval.php'); +require_once(PHPWEATHER_BASE_DIR . '/data_retrieval.php'); /** * PHP Weather is a class that understands how to parse a raw METAR. |
From: Martin G. <gim...@us...> - 2002-03-20 19:26:54
|
Update of /cvsroot/phpweather/phpweather/output In directory usw-pr-cvs1:/tmp/cvs-serv31666/output Modified Files: pw_images.php pw_text.php pw_text_hu.php Log Message: All files now use require_once() instead of just require() - this means, that there's no need for those 'if defined('...') return ...' statements at the top of each file any more. Index: pw_images.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_images.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- pw_images.php 18 Mar 2002 16:19:59 -0000 1.2 +++ pw_images.php 20 Mar 2002 19:26:50 -0000 1.3 @@ -1,4 +1,7 @@ <?php + +require_once(PHPWEATHER_BASE_DIR . '/base_object.php'); + /* Copyright (c) 2002 Raymond van Beek <ra...@de...>. Licensed under the GPL, see the file COPYING. Index: pw_text.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- pw_text.php 18 Mar 2002 16:14:31 -0000 1.2 +++ pw_text.php 20 Mar 2002 19:26:50 -0000 1.3 @@ -1,5 +1,7 @@ <?php +require_once(PHPWEATHER_BASE_DIR . '/base_object.php'); + /** * Provides all the function needed to generate text output. * Index: pw_text_hu.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text_hu.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- pw_text_hu.php 17 Mar 2002 13:39:04 -0000 1.1 +++ pw_text_hu.php 20 Mar 2002 19:26:50 -0000 1.2 @@ -1,4 +1,5 @@ <?php + require_once(PHPWEATHER_BASE_DIR . '/output/pw_text.php'); /** |
From: Martin G. <gim...@us...> - 2002-03-18 18:10:19
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv2062 Modified Files: index.php Log Message: Cleanups. Index: index.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/index.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- index.php 17 Mar 2002 14:52:56 -0000 1.18 +++ index.php 18 Mar 2002 18:10:15 -0000 1.19 @@ -13,88 +13,9 @@ $time[] = array(microtime(), 'start'); require('phpweather.php'); +require('pw_utilities.php'); -//define('DEBUG', true); - -$obj = new phpweather(array()); - -function make_countries_select() { - echo' -<select name="cc"> -'; - - if (!empty($GLOBALS['cc'])) { - $selected = $GLOBALS['cc']; - } else { - $selected = ''; - } - - $countries = $GLOBALS['obj']->db->get_countries(); - while (list($cc, $country) = each($countries)) { - if ($cc == $selected) { - echo "<option value=\"$cc\" selected>$country</option>\n"; - } else { - echo "<option value=\"$cc\">$country</option>\n"; - } - } - echo "</select>\n"; - echo '<input type="hidden" name="old_cc" value="' . $selected . '">'; - -} - - -function make_stations_select() { - - $country = ''; - $icaos = $GLOBALS['obj']->db->get_icaos($GLOBALS['cc'], $country); - - echo ' -<select name="icao"> -'; - - if (!empty($GLOBALS['icao'])) { - $selected = $GLOBALS['icao']; - } else { - $selected = ''; - } - - while (list($icao, $name) = each($icaos)) { - if ($icao == $selected) { - echo "<option value=\"$icao\" selected>$name</option>\n"; - } else { - echo "<option value=\"$icao\">$name</option>\n"; - } - } - echo "</select>\n"; - echo '<input type="hidden" name="old_icao" value="' . $selected . '">'; - -} - - -function make_languages_select() { - - echo ' -<select name="language"> -'; - $languages = $GLOBALS['obj']->get_languages('text'); - - if (!empty($GLOBALS['language'])) { - $selected = $GLOBALS['language']; - } else { - $selected = ''; - } - - while (list($lc, $language) = each($languages)) { - if ($lc == $selected) { - echo "<option value=\"$lc\" selected>$language</option>\n"; - } else { - echo "<option value=\"$lc\">$language</option>\n"; - } - } - echo "</select>\n"; - echo '<input type="hidden" name="old_language" value="' . $selected . '">'; -} - +$weather = new phpweather(array()); if (empty($action)) { /* No action - we display a form from which the user can select a @@ -106,7 +27,7 @@ <input type="hidden" name="action" value="show_stations"> '; - make_countries_select(); + make_countries_select($weather, ''); echo ' <input type="submit"> @@ -124,11 +45,13 @@ <input type="hidden" name="action" value="show_weather"> '; - make_countries_select(); - - make_stations_select(); + if (empty($icao)) $icao = ''; + if (empty($language)) $language = ''; + - make_languages_select(); + make_countries_select($weather, $cc); + make_stations_select($weather, $cc, $icao); + make_languages_select($weather, $language); echo ' <input type="submit"> @@ -137,20 +60,16 @@ '; } elseif ($action == 'show_weather' && !empty($language)) { - /* A station has just been selected - we print the weather. */ - echo ' <p> <form action="index.php" method="get"> <input type="hidden" name="action" value="show_weather"> '; - make_countries_select(); - - make_stations_select(); - - make_languages_select(); + make_countries_select($weather, $cc); + make_stations_select($weather, $cc, $icao); + make_languages_select($weather, $language); echo ' <input type="submit"> @@ -159,26 +78,23 @@ '; if ($cc == $old_cc) { - /* We should only display the current weather is the country - isn't changed */ - $obj->set_icao($icao); + /* We should only display the current weather is the country isn't + changed */ + $weather->set_icao($icao); include(PHPWEATHER_BASE_DIR . "/output/pw_text_$language.php"); $type = 'pw_text_' . $language; - $text = new $type($obj, array()); + $text = new $type($weather, array()); - echo "<p>This is the current weather in " . $obj->get_location() . ":</p>\n"; + echo "<p>This is the current weather in " . + $weather->get_location() . ":</p>\n"; $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_images.php"); - $icons = new pw_images($obj, array()); + $icons = new pw_images($weather, array()); echo "<blockquote>\n"; echo '<img src="' . $icons->get_sky_image() . @@ -190,7 +106,7 @@ echo "</blockquote>\n"; - echo "<p>The raw METAR is <code>" . $obj->get_metar() . "</code></p>\n"; + echo "<p>The raw METAR is <code>" . $weather->get_metar() . "</code></p>\n"; } } |
From: Martin G. <gim...@us...> - 2002-03-18 17:57:11
|
Update of /cvsroot/phpweather/web In directory usw-pr-cvs1:/tmp/cvs-serv29234 Modified Files: index.php Log Message: Those long GET URLs were quite annoying to look at. Index: index.php =================================================================== RCS file: /cvsroot/phpweather/web/index.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- index.php 18 Mar 2002 17:06:44 -0000 1.8 +++ index.php 18 Mar 2002 17:57:07 -0000 1.9 @@ -37,7 +37,7 @@ echo ' <p> -<form action="index.php" method="get"> +<form action="index.php" method="post"> <input type="hidden" name="action" value="show_stations"> '; @@ -55,7 +55,7 @@ echo ' <p> -<form action="index.php" method="get"> +<form action="index.php" method="post"> <input type="hidden" name="action" value="show_weather"> '; @@ -77,7 +77,7 @@ /* A station has just been selected - we print the weather. */ echo ' <p> -<form action="index.php" method="get"> +<form action="index.php" method="post"> <input type="hidden" name="action" value="show_weather"> '; |
From: Martin G. <gim...@us...> - 2002-03-18 17:56:01
|
Update of /cvsroot/phpweather/web/include In directory usw-pr-cvs1:/tmp/cvs-serv25146/include Modified Files: header.php Log Message: Hmm Index: header.php =================================================================== RCS file: /cvsroot/phpweather/web/include/header.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- header.php 18 Mar 2002 17:46:21 -0000 1.4 +++ header.php 18 Mar 2002 17:46:57 -0000 1.5 @@ -6,7 +6,7 @@ define('ROOT', ''); } -include(dirname(__FILE__) . '/include/navigation.php'); +include(dirname(__FILE__) . '/navigation.php'); ?> <html> |
From: Martin G. <gim...@us...> - 2002-03-18 17:56:01
|
Update of /cvsroot/phpweather/web/include In directory usw-pr-cvs1:/tmp/cvs-serv23219/include Modified Files: header.php Log Message: Argh! Stupid includes... We'll have to fix this somehow... Index: header.php =================================================================== RCS file: /cvsroot/phpweather/web/include/header.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- header.php 18 Mar 2002 17:06:44 -0000 1.2 +++ header.php 18 Mar 2002 17:41:48 -0000 1.3 @@ -6,7 +6,7 @@ define('ROOT', ''); } -include('include/navigation.php'); +include($DOCUMENT_ROOT . ROOT . '/include/navigation.php'); ?> <html> |
From: Martin G. <gim...@us...> - 2002-03-18 17:56:01
|
Update of /cvsroot/phpweather/web/include In directory usw-pr-cvs1:/tmp/cvs-serv24794/include Modified Files: header.php Log Message: This is weird... Index: header.php =================================================================== RCS file: /cvsroot/phpweather/web/include/header.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- header.php 18 Mar 2002 17:41:48 -0000 1.3 +++ header.php 18 Mar 2002 17:46:21 -0000 1.4 @@ -6,7 +6,7 @@ define('ROOT', ''); } -include($DOCUMENT_ROOT . ROOT . '/include/navigation.php'); +include(dirname(__FILE__) . '/include/navigation.php'); ?> <html> |
From: Martin G. <gim...@us...> - 2002-03-18 17:54:00
|
Update of /cvsroot/phpweather/web/images In directory usw-pr-cvs1:/tmp/cvs-serv27729 Added Files: phpweather.jpg Log Message: Our logo or something like that. If anybody has a better idea, then please let me know. --- NEW FILE --- ÿØÿà Author: Wells, Rhea Illustrator: Wells, Rhea Publisher: Doubleday Doran & Co. Copyright (c) 1996 Zedcor Inc. All Rights Reserved. Keywords: drawing circa 1917 apparatus meteorology weather instrument anemometer, b/w ÿÀ ÿÄ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÚ :ƪ¯Loí·µ©`'¶Fñ)àWa4I$g(êO¨4ê(¬gþë²£8 ë Ø3»ÈN£Ú¯J*;æÚX$I©ú\^§Þ<§K»¼ku·o/ñöÚ; Û½Õôûmr~Ï@;¬mÃéªÆ·1=¼ Ç^R:¹ôã½iU±ñ-ÕI\çdÃzw¥bê ¨Þ\K£gFcov¢¿Ý`wrr?Zn²j¶ZÍÆ!µ2ÂLò8 ²»×cü@lVr§û0NñÑV¼2CxvÄÜZUã[GºÐ\ÆFba!ú ÒÒ/bÔ4Ë{Hà ÈÂqÈ®nòÖ)<QtÆ#vÃ.HÛ"ÇãÅÔî5K³hng21ª'vî8õèZm¨²Óí?u©Çr5b³|Gk%Þ:B 1"Ô à~U«]ZZG§jVp,×KÝy)À9aþEFdE¼R×üÙoçûuF{zÖ¶y«}ªßw ¶Ì°ÁÜÍä þ"Ä]Wþ½n?ôOðnðÕ²ù1zFAí\õÎyat÷zëÚ_õlOqéTomµYR9tmåO1&óFïÇ9ϦènÔæûUïðÿ é(¢(¢(¢¹ÿ :àÀ®Ê(¢(¢+Y×tBz $ÿ |
From: Martin G. <gim...@us...> - 2002-03-18 17:37:07
|
Update of /cvsroot/phpweather/web/docs In directory usw-pr-cvs1:/tmp/cvs-serv21623 Added Files: index.php Log Message: A couple of index-files. --- NEW FILE --- <?php require('../include/header.php'); ?> <p>There are two major version of PHP Weather: 1.x and 2.x. Versions greater than 2 are a rewrite of the code found in PHP Weather version 1.x, so the documentation is split into two catagories.</p> <?php require('../include/footer.php'); ?> |