Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv14346 Modified Files: configurator.php index.php Log Message: Index: configurator.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/configurator.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- configurator.php 2001/06/29 09:42:36 1.7 +++ configurator.php 2001/07/08 17:09:24 1.8 @@ -7,10 +7,10 @@ <?php -/** - * A basic property. - * - */ + /** + * A basic property. + * + */ class property { /** @@ -32,9 +32,11 @@ var $description; /** - * The data of the property + * The data of the property. * - * If the property can one out of several different values, then this should be an array, where the first entry is the default. Else it should be a string. + * If the property can one out of several different values, + * then this should be an array, where the first entry is + * the default. Else it should be a string. * * @var mixed * @access private @@ -44,7 +46,10 @@ /** * A header used in the each line in the config-file. * - * All lines in the file start with '$this->properties['property'] = '. This variable holds a string like that, where 'property' is replaced as apropriate. + * All lines in the file start with + * '$this->properties['property'] =' + * This variable holds a string like that, where 'property' is + * replaced as apropriate. * * @var string * @access private @@ -54,11 +59,12 @@ /** * The constructor. * - * It takes care of storing the input in the object, and generates the config_header. + * It takes care of storing the input in the object, and generates + * the config_header. * - * @param string the name of the property - * @param mixed the data the property should hold - * @param string the description + * @param string name of the property + * @param mixed data what the property should hold + * @param string description * @access public */ function property($name, $data, $description) { @@ -174,10 +180,10 @@ function get_html() { $output = '<select name="' . $this->name . "\">\n"; - /* The first option is the default */ + /* The first option is the default */ list($option, $label) = each($this->data); $output .= " <option value=\"$option\" selected>$label</option>\n"; - /* There can only be two options. */ + /* There can only be two options */ list($option, $label) = each($this->data); $output .= " <option value=\"$option\">$label</option>\n"; $output .= "</select>\n </td>\n"; @@ -215,7 +221,7 @@ array('false' => 'No', 'true' => 'Yes'), "Set this option to 'Yes' to enable support for " . - "proxy servers. If you do, you'll have to set the " . + "proxy servers. If you do so, you'll have to set the " . "next two options as well."); $properties['proxy_host'] = @@ -274,20 +280,20 @@ new text('db_metars', 'metars', 'This is the name of the database/table that is used ' . - 'to cache the METARs.'); + 'to cache the METARs. [default name: \'metars\']'); $properties['db_stations'] = new text('db_stations', 'stations', 'This is the name of the database/table that is used ' . - 'to store the names of the stations.'); + 'to store the names of the stations. [default name: \'stations\']'); $properties['db_countries'] = new text('db_countries', 'countries', 'This is the name of the database that is used to ' . 'store the names of the countries together with ' . - 'country-codes.'); + 'country-codes. [default name: \'countries\']'); $properties['db_type'] = new select('db_type', @@ -312,45 +318,47 @@ $properties['pref_units'] = new select('pref_units', - array('both_metric' => 'Metric first, then imperical', + array('both_metric' => 'Metric first, then imperial', 'both_imperial' => 'Imperial first, then metric', 'only_metric' => 'Only metric', 'only_imperial' => 'Only imperial'), 'You can choose to display the data in several ' . - 'formats. Pleace choose one that fits your need.'); + 'formats. Please choose one that fits your need.'); $properties['mark_begin'] = new text('mark_begin', '<b>', - 'This string will be placed infront of all the ' . + 'This string will be placed in front of all the ' . 'changable parts of the output. If you don\'t want ' . ' this to happen, then just use an empty string. ' . 'Other good choices include \'<i>\', \'<font ' . - 'color="red">, etc.'); + 'color="red">, etc. [default string: \'<b>\']'); $properties['mark_end'] = new text('mark_end', '</b>', - 'This string is places after all the changable parts. ' . + 'This string is placed after all the changable parts. ' . 'You should make sure, that it closes any tags ' . - ' you\'ve opened in <code>mark_begin</code>'); + ' you\'ve opened in <code>mark_begin</code>. [default string: +\'</b>\']'); $properties['exclude'] = new multi_select('exclude', - array('time' => 'The time part', - 'wind' => 'The wind part', - 'runway' => 'Information about runways'), + array('time' => 'Leave out the time part', + 'wind' => 'Leave out the wind part', + 'runway' => 'Leave out information about runways'), 'You can disable some of the output produced. If ' . 'you\'re not interested in information about ' . ' runways-visibility, then select it in this list. ' . - 'You can select severel options at once by holding ' . - 'down Ctrl while clicking on the option in Netscape.'); + 'You can select several options at once in Netscape ' . + ' by holding down Ctrl while clicking on the option.'); $properties['language'] = new select('language', - array('en' => 'English'), - 'PHP Weather can produce output in several langauges ' . - '- pleace select the default from the list.'); + array('en' => 'English', + 'da' => 'Danish', + 'hu' => 'Hungarian'), + 'PHP Weather can produce output in several languages ' . + '- please select the default from the list.'); if ($action == 'make_config') { @@ -362,8 +370,8 @@ echo "</pre>\n"; $config = "<?php -/* This is a local configurations file for PHP Weather. - It was generated on the $timestamp. */\n\n"; +/* This is a local configuration file for PHP Weather. + It was generated on $timestamp. */\n\n"; while(list($option, $value) = each($GLOBALS['HTTP_POST_VARS'])) { if (!empty($properties[$option])) { @@ -392,14 +400,18 @@ if ($fp) { fputs($fp, $config); fclose($fp); - echo "<p>The configuration was written to <code>defaults.php</code>. A backup was made to <code>$new_filename</code>.</p>\n"; + echo "<p>The configuration was written to +<code>defaults.php</code>. A backup was made to +<code>$new_filename</code>.</p>\n"; } else { - echo "<p>A configuration file could <b>not</b> be written. You should copy the above configuration to a file, and manually save it as <code>default.php</code>.\n"; + echo "<p>A configuration file could <b>not</b> be written. You +should copy the above configuration to a file, and manually save it as +<code>default.php</code>.\n"; } - echo '<p>Click <a href="configurator.php?action=do_sql&time=' . time() . "\">here</a> to create the necessary databases.</p>\n"; + echo '<p>Click <a href="configurator.php?action=do_sql&time=' +. time() . "\">here</a> to create the necessary databases.</p>\n"; - } elseif ($action == 'do_sql') { @@ -415,7 +427,7 @@ while ($row = fgets($fp, 1024)) { $row = trim($row); if (substr($row, 0, 2) == '##' && substr($row, -2) == '##') { - /* We've found a country */ + /* We've found a country */ $cc = substr($row, 3, 2); // The country-code. $country = substr($row, 6, -3); // The name of the country. $countries[$cc] = $country; @@ -429,14 +441,14 @@ } $db->db->insert_stations($data, $countries); - echo "<p>Data about $num_rows stations from $num_countries countries were inserted.</p>\n"; + echo "<p>Data about $num_rows stations from $num_countries +countries were inserted.</p>\n"; } else { echo "<p>The database was <b>not</b> configured!</p>\n"; } } else { /* No action has been specified - we make a form. */ - echo ' <form action="configurator.php" method="post"> Index: index.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/index.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- index.php 2001/06/30 19:24:02 1.15 +++ index.php 2001/07/08 17:09:24 1.16 @@ -182,14 +182,14 @@ $start_time = explode(' ', $time[$i][0]); $end_time = explode(' ', $time[$i+1][0]); $diff = ($end_time[0] + $end_time[1]) - ($start_time[0] + $start_time[1]); - echo '<p>Time taken to go from "' . ($time[$i][1]) . '" to "' . ($time[$i+1][1]) . '": ' . number_format($diff * 1000, 2) . " miliseconds.</p>\n"; + echo '<p>Time taken to go from "' . ($time[$i][1]) . '" to "' . +($time[$i+1][1]) . '": ' . number_format($diff * 1000, 0) . " ms.</p>\n"; } */ $start_time = explode(' ', $time[0][0]); $end_time = explode(' ', $time[$max][0]); $diff = ($end_time[0] + $end_time[1]) - ($start_time[0] + $start_time[1]); -echo '<p>Total time used to generate page: ' . number_format($diff * 1000, 2) . " miliseconds.</p>\n"; +echo '<p>Total time used to generate page: ' . number_format($diff * 1000, 0) . " +ms.</p>\n"; ?> _______________________________________________ PHPWeather-checkins mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/phpweather-checkins