<table>
<?php
$fileList = glob('*');
foreach($fileList as $filename){
//Use the is_dir function to make sure that it is a directory.
if(is_dir($filename) and ($filename != 'icons') and ($filename != 'blurbs')){
echo '<tr><td style="min-width: 32px;">';
echo '<a href="', $filename, '/"><img src="icons/', $filename, '.gif" width="32" height="32"></a>';
echo '</td><td>';
echo '<a href="', $filename, '/">', $filename, '</a>';
echo '<br>', file_get_contents('blurbs/' . $filename . '.txt');
echo '</td></tr>';
}
}
?>
</table>
<?php
$fileList = glob('*.7z');
foreach($fileList as $filename){
//Use the is_file function to make sure that it is not a directory.
if(is_file($filename)){
echo '<a href="', $filename, '">', $filename, '</a><br>';
}
}
?>
<table>
<?php
$fileList = glob('*');
foreach($fileList as $filename){
//Use the is_dir function to make sure that it is a directory.
if(is_dir($filename) and ($filename != 'icons') and ($filename != 'blurbs')){
echo '<tr><td style="min-width: 32px;">';
echo '<a href="', $filename, '/"><img src="icons/', $filename, '.gif" width="32" height="32"></a>';
echo '</td><td>';
echo '<a href="', $filename, '/">', $filename, '</a>';
echo '<br>', file_get_contents('blurbs/' . $filename . '.txt');
echo '</td></tr>';
}
}
?>
</table>
<?php
$fileList = glob('*.7z');
foreach($fileList as $filename){
//Use the is_file function to make sure that it is not a directory.
if(is_file($filename)){
echo '<a href="', $filename, '">', $filename, '</a><br>';
}
}
?>
The small blurbs I use as category descriptions are all stored in this folder. Those get written out through the script.
As for styling the directory indices, it’s pretty basic. I use a .htaccess file so my web server uses header and footer .html files.
(I could put a readme here if need be)
</body>
</html>
(I could put a readme here if need be)
</body>
</html>
Although I would have liked to use one header.html and one footer.html for all of them (using some kind of tags similar to my own project AutoSite) this will work, at least in the interim. Things I could do in the future are adding more file descriptions to the .htaccess or put more information in the footers (possibly contact and contributing information, though that could be a hassle to update for each folder so another time, maybe).
It all also degrades gracefully in older browsers.
The Patio has been sunset, so consider this site an archive. My LiveJournal posts additionally have been relocated here for safekeeping.
You may find me at my dcb.somnol (tech) or lince.somnol (personal) web sites, and for more spur of the moment thoughts, my profile on status.ryslig.xyz. Thanks for visiting.