CVS: phpweather/config index.php,1.8,1.9 make_config.php,1.1,1.2 make...
Brought to you by:
iridium
|
From: Martin G. <gim...@us...> - 2002-05-29 20:12:37
|
Update of /cvsroot/phpweather/phpweather/config
In directory usw-pr-cvs1:/tmp/cvs-serv3525
Modified Files:
index.php make_config.php make_db.php make_stations.php
speed_test.php
Log Message:
More cleanups. The new stylesheet is used, and I hope that the files
can be validated as XHTML documents.
Index: index.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/index.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- index.php 28 May 2002 13:40:13 -0000 1.8
+++ index.php 29 May 2002 20:12:35 -0000 1.9
@@ -1,77 +1,69 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "DTD/xhtml1-transitional.dtd">
<html>
- <head>
- <title>Configuration of PHP Weather</title>
- <style type="text/css">
-<!--
-BODY {
- font-family: Verdana, Tahoma, Geneva, Arial, Helvetica, sans-serif;
- font-size: small;
-}
-
-DT {
- font-weight: bold
-}
-
-P {
- margin-top: 0.5em;
- margin-bottom: 0.5em;
-}
-
- -->
- </style>
- </head>
- <body>
-
- <img src="../icons/phpweather-long-white.gif" alt="PHP Weather" align="right">
-
- <h1>Configuration of PHP Weather</h1>
-
- <p>This is the place where you configurate PHP Weather. You'll need
- to complete two steps to fully utilise PHP Weather: make a local
- configuration file with information about which database to use,
- and then create the database.</p>
-
- <p>It's save to leave these pages unprotected as they wont do
- anything destructive. You cannot actually change the configuration
- of PHP Weather using these pages, instead you download a new
- configuration-file which you'll have to upload to the webserver
- before it becomes effective. The <a href="make_db.php">Database
- Builder</a> will also just recreate the existing tables - nothing
- permanent will be deleted.</p>
-
- <dl>
- <dt><a href="make_config.php">Configuration Builder</a></dt>
-
- <dd><p>Use this page to build a custom configuration-file for PHP
- Weather.</p></dd>
-
- <dt><a href="make_db.php">Database Builder</a></dt>
-
- <dd><p>After you've made a custom configuration using the link
- above, you'll need to use this page to create the database and fill
- it with data.</p></dd>
-
- <dt><a href="make_stations.php">Regenerate Stations Database</a></dt>
-
- <dd><p>Use this page to update the file <code>stations.csv</code>
- with the data from your database. This file contains a list of
- stations in a human-readable format and it it used by the <a
- href="make_db.php">Database Builder</a> to populate the database
- with data.</p></dd>
-
- <dt><a href="speed_test.php">Speed Test</a></dt>
-
- <dd><p>If you've configured PHP Weather to use a database, then you
- might be interested in knowing how long it takes to access the
- data in the database. This is what this page is for, it will
- meassure the time it takes for PHP Weather to retrieve and
- display a large number of METARs.</p>
-
- <p>If you have several different databases available to you, then
- you can compare them using this page.</p>
- </dd>
+<head>
+ <link rel="stylesheet" type="text/css" href="../pw_style.css" />
+ <title>Configuration of PHP Weather</title>
+</head>
+<body>
+
+<img src="../icons/phpweather-long-white.gif" width="187" height="50"
+alt="PHP Weather" align="right" />
+
+<h1>Configuration of PHP Weather</h1>
+
+<p>This is the place where you configurate PHP Weather. You'll need to
+complete two steps to fully utilise PHP Weather: make a local
+configuration file with information about which database to use, and
+then create the database.</p>
+
+<p>It's save to leave these pages unprotected as they wont do anything
+destructive. You cannot actually change the configuration of PHP
+Weather using these pages, instead you download a new
+configuration-file which you'll have to upload to the webserver before
+it becomes effective. The <a href="make_db.php">Database Builder</a>
+will also just recreate the existing tables - nothing permanent will
+be deleted.</p>
- </dl>
+<dl>
+ <dt><a href="make_config.php">Configuration Builder</a></dt>
- </body>
+ <dd>
+ <p>Use this page to build a custom configuration-file for PHP
+ Weather.</p>
+ </dd>
+
+ <dt><a href="make_db.php">Database Builder</a></dt>
+
+ <dd>
+ <p>After you've made a custom configuration using the link
+ above, you'll need to use this page to create the database and fill
+ it with data.</p>
+ </dd>
+
+ <dt><a href="make_stations.php">Regenerate Stations Database</a></dt>
+
+ <dd>
+ <p>Use this page to update the file <code>stations.csv</code>
+ with the data from your database. This file contains a list of
+ stations in a human-readable format and it it used by the <a
+ href="make_db.php">Database Builder</a> to populate the database
+ with data.</p>
+ </dd>
+
+ <dt><a href="speed_test.php">Speed Test</a></dt>
+
+ <dd><p>If you've configured PHP Weather to use a database, then you
+ might be interested in knowing how long it takes to access the
+ data in the database. This is what this page is for, it will
+ meassure the time it takes for PHP Weather to retrieve and
+ display a large number of METARs.</p>
+
+ <p>If you have several different databases available to you, then
+ you can compare them using this page.</p>
+ </dd>
+</dl>
+
+</body>
</html>
Index: make_config.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/make_config.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- make_config.php 15 May 2002 22:26:50 -0000 1.1
+++ make_config.php 29 May 2002 20:12:35 -0000 1.2
@@ -109,7 +109,8 @@
array('en' => 'English',
'da' => 'Danish',
'hu' => 'Hungarian',
- 'no' => 'Norwegian'));
+ 'no' => 'Norwegian',
+ 'es' => 'Spanish'));
$options['offset'] =
new pw_option_integer('offset',
@@ -335,26 +336,13 @@
?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "DTD/xhtml1-transitional.dtd">
<html>
<head>
+ <link rel="stylesheet" type="text/css" href="../pw_style.css" />
<title>Configuration Builder for PHP Weather</title>
- <style type="text/css">
-<!--
-BODY {
- font-family: Verdana, Tahoma, Geneva, Arial, Helvetica, sans-serif;
- font-size: small;
-}
-
-DT {
- font-weight: bold
-}
-
-P {
- margin-top: 0.5em;
- margin-bottom: 0.5em;
-}
--->
- </style>
</head>
<body>
@@ -401,45 +389,51 @@
}
</script>
-<img src="../icons/phpweather-long-white.gif" alt="PHP Weather" align="right">
+<img src="../icons/phpweather-long-white.gif" width="187" height="50"
+alt="PHP Weather" align="right" />
+
<h1>Configuration Builder for PHP Weather</h1>
<p>This is the Configuretor shipped with PHP Weather.</p>
<p>Change the options below - when you're done, then press one of the
-'Update Configuration' buttons. Depending on your choices, more options
-might appear. Continue to change the options until they all say <span style="color: green">Input accepted.</span></p>
+'Update Configuration' buttons. Depending on your choices, more
+options might appear. Continue to change the options until they all
+say <span style="color: green">Input accepted.</span></p>
- <form action="<? echo $PHP_SELF . '?' . SID ?>" method="POST">
+<form action="<? echo $PHP_SELF . '?' . SID ?>" method="POST">
-<p>You can <input type="submit" name="download" value="Download the Configuration"> or <input type="reset" value="Reset Everything" onclick="document.location='reset_session.php'"></p>
+<p>You can <input type="submit" name="download" value="Download the
+Configuration"> or <input type="reset" value="Reset Everything"
+onclick="document.location='reset_session.php'"></p>
- <dl>
- <?php
+<dl>
+ <?php
+ $general_group->show();
+ $db_group->show();
+ $rendering_group->show();
+ ?>
+</dl>
- $general_group->show();
- $db_group->show();
- $rendering_group->show();
+<p><input type="submit" value="Update options"></p>
- ?>
- </dl>
+<p>This is a configuration file bases on your answers above:</p>
- <p><input type="submit" value="Update options"></p>
+<?php highlight_string($config); ?>
- <p>This is a configuration file bases on your answers above:</p>
+<p>You should copy the above configuration to a file called
+<code>defaults.php</code> in the root directory of your PHP Weather
+installation. It's very important that the lines with <code><font
+color="#0000CC"><?php</font></code> and <code><font
+color="#0000CC">?></font></code> are the very first and very last,
+respectively. There should be no blank lines outside these two
+tags.</p>
- <?php highlight_string($config); ?>
+<p>You can also <input type="submit" name="download" value="Download
+the Configuration"> or <input type="reset" value="Reset Everything"
+onclick="document.location='reset_session.php'"></p>
- <p>You should copy the above configuration to a file called
- <code>defaults.php</code> in the root directory of your PHP Weather
- installation. It's very important that the lines with <code><font
- color="#0000CC"><?php</font></code> and <code><font
- color="#0000CC">?></font></code> are the very first and very last,
- respectively. There should be no blank lines outside these two tags.</p>
-
-<p>You can also <input type="submit" name="download" value="Download the Configuration"> or <input type="reset" value="Reset Everything" onclick="document.location='reset_session.php'"></p>
+</form>
- </form>
-
- </body>
+</body>
</html>
Index: make_db.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/make_db.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- make_db.php 15 May 2002 22:26:50 -0000 1.1
+++ make_db.php 29 May 2002 20:12:35 -0000 1.2
@@ -1,27 +1,16 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "DTD/xhtml1-transitional.dtd">
<html>
<head>
+ <link rel="stylesheet" type="text/css" href="../pw_style.css" />
<title>Database Builder for PHP Weather</title>
- <style type="text/css">
-<!--
-BODY {
- font-family: Verdana, Tahoma, Geneva, Arial, Helvetica, sans-serif;
- font-size: small;
-}
-
-DT {
- font-weight: bold
-}
-
-P {
- margin-top: 0.5em;
- margin-bottom: 0.5em;
-}
--->
- </style>
</head>
<body>
-<img src="../icons/phpweather-long-white.gif" alt="PHP Weather" align="right">
+<img src="../icons/phpweather-long-white.gif" width="187" height="50"
+alt="PHP Weather" align="right" />
+
<h1>Database Builder for PHP Weather</h1>
<p>This is the tool you use to create the tables used by PHP Weather.
@@ -49,10 +38,9 @@
removed sooner or later anyway, so this isn't a problem.</p>
<form action="make_db.php" method="POST">
-<input type="submit" name="do_sql" value="Create or Recreate Tables">
+<input type="submit" name="do_sql" value="Create or Recreate Tables" />
</form>
-
<?php
if (!empty($HTTP_POST_VARS['do_sql'])) {
@@ -88,7 +76,7 @@
echo "<p>Data about <b>$num_rows</b> stations from " .
"<b>$num_countries</b> countries were inserted.</p>\n";
} else {
- echo "<p>The was a problem with the creation of the tables!</p>\n";
+ echo "<p>There was a problem with the creation of the tables!</p>\n";
}
echo "</blockquote>\n";
}
Index: make_stations.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/make_stations.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- make_stations.php 28 May 2002 13:40:13 -0000 1.1
+++ make_stations.php 29 May 2002 20:12:35 -0000 1.2
@@ -36,30 +36,19 @@
}
?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "DTD/xhtml1-transitional.dtd">
<html>
<head>
+ <link rel="stylesheet" type="text/css" href="../pw_style.css" />
<title>Stations Database Rebuilder for PHP Weather</title>
- <style type="text/css">
-<!--
-BODY {
- font-family: Verdana, Tahoma, Geneva, Arial, Helvetica, sans-serif;
- font-size: small;
-}
-
-DT {
- font-weight: bold
-}
-
-P {
- margin-top: 0.5em;
- margin-bottom: 0.5em;
-}
--->
- </style>
</head>
<body>
-<img src="../icons/phpweather-long-white.gif" alt="PHP Weather" align="right">
+<img src="../icons/phpweather-long-white.gif" width="187" height="50"
+alt="PHP Weather" align="right" />
+
<h1>Stations Database Rebuilder for PHP Weather</h1>
<p>You can use this page to regenerate the <code>stations.csv</code>
@@ -72,12 +61,13 @@
stations in your database, but haven't updated the
<code>stations.csv</code> file accordingly. You can then add the
updated <code>stations.csv</code> file as a <a
-href="https://sourceforge.net/tracker/?atid=377954&group_id=23245&func=browse">patch</a>.</p>
+href="https://sourceforge.net/tracker/?atid=377954&group_id=23245&func=browse">patch</a>.</p>
-<p>Click the button below to download the updated <code>stations.csv</code>:</p>
+<p>Click the button below to download the updated
+<code>stations.csv</code>:</p>
<form action="make_stations.php" method="POST">
-<input type="submit" name="make_stations" value="Download stations.cvs">
+<input type="submit" name="make_stations" value="Download stations.cvs" />
</form>
</body>
Index: speed_test.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/speed_test.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- speed_test.php 20 May 2002 15:52:59 -0000 1.1
+++ speed_test.php 29 May 2002 20:12:35 -0000 1.2
@@ -2,30 +2,14 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html>
- <head>
- <title>PHP Weather Speed Test</title>
- <style type="text/css">
-<!--
-BODY {
- font-family: Verdana, Tahoma, Geneva, Arial, Helvetica, sans-serif;
- font-size: small;
-}
-
-DT {
- font-weight: bold
-}
-
-P {
- margin-top: 0.5em;
- margin-bottom: 0.5em;
-}
-
- -->
- </style>
+<head>
+ <link rel="stylesheet" type="text/css" href="../pw_style.css" />
+ <title>PHP Weather Speed Test</title>
</head>
<body>
-<img src="../icons/phpweather-long-white.gif" alt="PHP Weather" align="right">
+<img src="../icons/phpweather-long-white.gif" width="187" height="50"
+alt="PHP Weather" align="right" />
<h1>PHP Weather Speed Test</h1>
@@ -51,8 +35,8 @@
echo $count ?> different METARs. This will take a long time at first
because PHP Weather has to retrieve the METARs from the Internet, but
the second time you use this page it should go much faster because the
-METARs can be retrieved from the database - that is, if you've configured PHP
-Weather to use a database.</p>
+METARs can be retrieved from the database - that is, if you've
+configured PHP Weather to use a database.</p>
<p>Select the number of METARs to use:
<a href="<?php echo $PHP_SELF ?>?batches=1">32</a>,
@@ -97,6 +81,9 @@
'KSPF', 'KPHN', 'KSBS', 'KTCM', 'KTPL', 'PATG', 'KTVC', 'KTCL',
'PAVD', 'KVEL', 'PAFB', 'KRYV', 'KWYS', 'PAWR', 'KILL', 'KINK'));
+echo "<h2>Processing " . ($batches * 32) . " METARs</h2>\n";
+flush();
+
$start_time = explode(' ', microtime());
require_once('../phpweather.php');
@@ -114,14 +101,19 @@
$output = "\n<!-- " . $weather->get_metar() . " -->\n";
$output = "\n<!-- " . $text->print_pretty() . " -->\n";
}
+ echo "<p>Processed " . (($i+1) * 32) . " METARs...</p>\n";
+ flush();
}
$end_time = explode(' ', microtime());
$diff = ($end_time[0] + $end_time[1]) - ($start_time[0] + $start_time[1]);
-echo "<p>Total time used to process $count METARs: <b>" . number_format($diff * 1000, 0) . " ms</b>.</p>\n";
-echo '<p>Time used per METAR: <b>' . number_format($diff * 1000 / ($batches*32), 1) . " ms</b>.</p>\n";
+echo "<p>Total time used to process $count METARs: <b>" .
+ number_format($diff * 1000, 0) . " ms</b>.</p>\n";
+
+echo '<p>Time used per METAR: <b>' .
+ number_format($diff * 1000 / ($batches*32), 1) . " ms</b>.</p>\n";
?>
|