// we're forgetting all of the other stuff now and starting from scratch.
// there is going to be unnecessary stuff in here, but we don't care
// if we end up in the right plade it will be worth it.
// 1. list all contents of directory
// first, I want php to figure out where is is, and call that $thedir
$thedir = getcwd();
// then we want to open it and read what's in it.
// but we went it to ignore the . and .. files so we use Jades bit for that
$dircont = opendir($thedir);
$dir = readdir($dircont);
while ($dir) {
if ($dir == ".") {
$dir = readdir($dircont);
}
if ($dir == "..") {
$dir = readdir($dircont);
}
if ($dir == "index.php") {
$dir = readdir($dircont);
}
$filename = $dir;
$filename = explode('.',$filename);
$files[] = $filename[0] . "." . $filename[1];
$dir = readdir($dircont);
}
sort($files);
for ($j = 0; $j < count($files); $j++) {
print "";
if (strpos($files[$j]," by ") !== false) {
$ljuser_s = strpos($files[$j]," by ") + 4;
if (substr($files[$j],-6,2) == "lj") {
$ljuser = substr($files[$j],$ljuser_s,-7);
print "
\nby " . $ljuser . "";
} elseif (substr($files[$j],-6,2) == "gj") {
$ljuser = substr($files[$j],$ljuser_s,-7);
print "
\nby " . $ljuser . "";
}
}
print "
";
}
?>