';
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 '
';
print 'OR
';
print 'Open An Existing Map (looking in ' . $mapdir . '):
';
$titles = array();
if (is_dir($mapdir))
{
$n=0;
$dh=opendir($mapdir);
if ($dh)
{
while ($file=readdir($dh))
{
$realfile=$mapdir . DIRECTORY_SEPARATOR . $file;
// if(is_file($realfile) && ( preg_match('/\.conf$/',$file) ))
if ( (is_file($realfile)) && (is_readable($realfile)) )
{
$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;
# print "- $file -
\n";
$n++;
}
}
}
closedir ($dh);
}
else { print "- Can't Open mapdir to read
"; }
ksort($titles);
foreach ($titles as $file=>$title)
{
$title = $titles[$file];
print "- $file -
\n";
}
if ($n == 0) { print "- No files
"; }
}
else { print "- NO DIRECTORY named $mapdir
"; }
print "
";
print "
PHP Weathermap ' . $WEATHERMAP_VERSION
. ' Copyright © 2005-2007 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.