';
print 'Welcome to the PHP Weathermap '.$WEATHERMAP_VERSION.' editor.
';
print '
NOTE: This editor is not finished! There are many features of ';
print 'Weathermap that you will be missing out on if you choose to use the editor only.';
print 'These include: curves, node offsets, font definitions, colour changing, per-node/per-link settings and image uploading. You CAN use the editor without damaging these features if you added them by hand, however.
';
print 'Do you want to:
';
print 'Create A New Map:
';
print '
';
$titles = array();
$errorstring="";
if (is_dir($mapdir)) {
$n=0;
$dh=opendir($mapdir);
if ($dh) {
while (false !== ($file = readdir($dh))) {
$realfile=$mapdir . DIRECTORY_SEPARATOR . $file;
$note = "";
if ( (is_file($realfile)) && (is_readable($realfile)) && (!preg_match("/^\./",$file) ) ) {
if (!is_writable($realfile)) {
$note .= "(read-only)";
}
$title='(no title)';
$fd=fopen($realfile, "r");
if ($fd) {
while (!feof($fd)) {
$buffer=fgets($fd, 4096);
if (preg_match("/^\s*TITLE\s+(.*)/i", $buffer, $matches)) {
$title=$matches[1];
}
}
fclose ($fd);
$titles[$file] = $title;
$notes[$file] = $note;
$n++;
}
}
}
closedir ($dh);
} else {
$errorstring = "Can't open mapdir to read.";
}
ksort($titles);
if ($n == 0) {
$errorstring = "No files in mapdir";
}
} else {
$errorstring = "NO DIRECTORY named $mapdir";
}
print 'OR
Create A New Map as a copy of an existing map:
';
print '
';
print 'OR
';
print 'Open An Existing Map (looking in ' . $mapdir . '):
';
if ($errorstring == '') {
foreach ($titles as $file=>$title) {
$title = $titles[$file];
$note = $notes[$file];
$nicefile = htmlspecialchars($file);
print "- $note$nicefile -
\n";
}
} else {
print '- '.$errorstring.'
';
}
print "
";
print "
PHP Weathermap ' . $WEATHERMAP_VERSION
. ' Copyright © 2005-2010 Howard Jones - howie@thingy.com
The current version should always be
available here, along with other related software. PHP Weathermap is licensed under the GNU Public License, version 2. See COPYING for details. This distribution also includes the Overlib library by Erik Bosrup.