Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:<strong>// Get a handle on the folder being browsed
$FolderHandle = opendir($Config->CurrentBrowsingDirectory);</strong>
$CurrentExtension = "";
$RecordItem = true;
$ThumbnailCollection = array();
while (false !== ($Item = readdir($FolderHandle))) {
$RecordItem = true;
if ($Item == "."
|| $Item == ".."
|| in_array($Config->CurrentBrowsingDirectory."/".$Item, $Config->FullyQualifiedHideFiles)
) $RecordItem = false;
if ($Config->DisplayHiddenFiles == "false" && $Item == $Config->SelfUrl) $RecordItem = false;
if ($Config->DisplayHiddenFiles == "false" && substr($Item,0,1) == "_") $RecordItem = false;
if ($Config->UseThumbnails && substr($Item,0,7) == "_thumb.") {
// Don't record the current item in the regular file collections, dump it into a thumbnail collection
$RecordItem = false;
$ThumbnailCollection[] = $Item;
}
if ($RecordItem) {
<strong>// If dealing with a folder, add it to the folder collection
if (is_dir($Config->CurrentBrowsingDirectory."/".$Item)) {
$FolderCollection[] = $Item;</strong>
// If not dealing with a folder, add it to the proper file collection
} else {
// Match the current file extension with an item in the extension library
$CurrentExtension = GetExtension($Item);
$KeyMatch = @$ExtensionLibrary[$CurrentExtension];
// If the match came back positive, add the file to the collection
if ($KeyMatch) {
$FileCollections[$ExtensionLibrary[$CurrentExtension][0]]->AddFile($Item, filesize($Config->CurrentBrowsingDirectory."/".$Item), filemtime($Config->CurrentBrowsingDirectory."/".$Item), $ExtensionLibrary[$CurrentExtension][1]);
// If the match came back false, attempt to add this file to the wildcard group
} elseif ($ExtensionLibrary["*"]) {
$FileCollections[$ExtensionLibrary["*"][0]]->AddFile($Item, filesize($Config->CurrentBrowsingDirectory."/".$Item), filemtime($Config->CurrentBrowsingDirectory."/".$Item), $ExtensionLibrary["*"][1], $ExtensionLibrary["*"]);
} // Ignore all other files
}
}
}1 to 5 of 5