Prints a bar of links to each HTML page it finds in the current directory
using the TITLE tag for the name of each link
\r";
echo "$text\r";
}
// Okay, let's open the TABLE and print the first default link
echo "\r";
echo_link("#114711", "/index.phtml", "home");
// Now, the "up" link
echo_link("#111146", "../", "up");
/* If you're including this script from a function, you'll need
to make $SCRIPT_FILENAME a global variable. */
if (!$SCRIPT_FILENAME)
global $SCRIPT_FILENAME;
// We'll have to loop through all the files in the current directory
$d = dir(dirname($SCRIPT_FILENAME));
while($file=$d->read()):
/* we don't want this file or any directories, but we do want all
.html and .phtml files */
if (($file != basename($SCRIPT_FILENAME)) && (is_file($file))
&& eregi("html$", $file)):
$fp = fopen("$file", "r");
$build = "";
$flag = 0;
for ($i = 0; !feof($fp); $i++) {
$line = fgets($fp, 1024);
/* The tag MUST be opened at the
beginning of a new line */
if (ereg("^", $line))
$flag = 1;
if ($flag == 1)
$build = $build.$line;
if (ereg("", $line))
$flag = 0;
}
if ($build > ""):
$build = ereg_replace("", "", $build);
$build = ereg_replace("", "", $build);
$build = trim($build);
echo_link("#111111", $file, $build);
endif;
endif;
endwhile;
// To finish off the bar, the other fixed link
echo_link("#114711", "/intranet/index.phtml", "intranet");
echo "
";
// and finally, close the directory
$d->close();
?>