\n");
return '*';
}
/* Check that the filename is valid: */
if (ereg("^simplicity/",$filename)) {
print ("Cannot read any file in the simplicity script directory
\n");
return '*';
}
if (ereg("\.[^/]+$",$filename)) {
print ("$filename has an extension which is not allowed.
\n");
return '*';
}
/* Save directory info on the file: */
$file_dir=BASE_DIR.dirname($filename)."/";
/* Add the directory path for our filename: */
$filename="../".$filename;
/* Make sure the file exists and is not a directory. */
if (!file_exists($filename)) {
print ("$filename does not exist.
\n");
return '*';
}
if (is_dir($filename)) {
print ("$filename is a directory.
\n");
return '*';
}
return array($file_dir, $filename);
}
/* Used by an arrayWalk in parseConfigLine to remove whitespace from around
* config variables.
*/
function trimArray(&$value, $key) {
$value=trim ($value);
}
/*
* Parses a config line into an array of config values.
*/
function parseConfigLine($line) {
/* Pull the config information into an array */
if (ereg ("",$line,$regs)) {
$info=explode(",", $regs[1], 6);
} else {
print ("Missing meta information line.
\n");
return '*';
}
/* Trim the whitespace from all the elemnts in the array */
array_walk($info,'trimArray');
return $info;
}
/*
* prints the head and body tag since those are common to all layouts.
*/
function printCommonTop($title, $background, $textcolour, $base_dir) {
?>
\n";
echo "$title\n";
?>
\n";
} else {
echo "\n";
}
return 0;
}
/*
* Print the Copyright information that is common to all layouts.
*/
function printCommonBottom($author, $copyrightdate) {
?>
©
|
| "); ?>
| "); ?>
|
|
| |
"); ?>
");
echo "$title";
return 0;
}
/*
* Prints the bottom of a poem layout.
*/
function printPoemBottom($author, $copyrightdate, $bottom_colour) {
printCommonBottom($author, $copyrightdate);
echo(" | ");
?>
|
| | |
|
|
"); ?>
| "); ?>
| | |
\n"; ?>
| \n"; ?>
|
\n"; ?>
| \n"; ?>
$title";
}
/*
* Prints the lower part of a story layout.
*/
function printStoryBottom($author, $copyrightdate, $border) {
printCommonBottom($author, $copyrightdate);
?>
|
\n"; ?>
|
| |
|