Macc Dany, al secolo Daniela, di sť: "...ho due serie di vignette: gli insulti e le vignette, appunto. Non so neppure se possono essere definite cartoline... Sono nate per caso una sera, davanti ad un documento che riportava le battute degli sms. Quando me ne sono trovate un tot, ho contattato un paio di amici che sono stati disposti ad inserirle nei loro siti. A me basta come soddisfazione. Ogni tanto aggiungo qualcosa di nuovo.".



$thisPageFilesDir."images/file.gif", 'height' => '13', 'width' => '13'); $dirImageProps = array('filepath' => $thisPageFilesDir."dir.gif", 'height' => '13', 'width' => '13'); $bulletImgsArr = array('fileImg' => $fileImgProps, 'dirImg' => $dirImageProps); #--------------------------------------------------- /* Add the name of this file and the namess of the files and dirs used with it to arrays. When the files and directories are read in, files and dirs in these 2 arrays will not by listed or counted when this page is viewed. If there are any other files other than those actually used by this page that you'd rather not have so readily available to others through this page, you can add them into these arrays */ #--------------------------------------------------- $dontListFiles = array($thisFileName, $bulletImgsArr['dirImg']['filepath'], $bulletImgsArr['fileImg']['filepath'], $thisPageCssFile); $dontListDirs = array($thisPageFilesDir, "cgi-bin", "indexerfiles"); function getThisDirName($url) { #--------------------------------------------------- /* getThisDirName : Accepts the path to the directory either in the form of $REQUEST_URI or a string value and pulls out the directory name */ #--------------------------------------------------- $afterCutOne = substr($url, 0, strrpos($url, "/")); $afterCutTwo = substr($afterCutOne, strrpos($afterCutOne, "/") - strlen($afterCutOne) + 1); return $afterCutTwo; } #--------------------------------------------------- /* isort and isortMultiD are 2 sorting functions used to add pseudo alphabetical order to the list of directory names and file names */ #--------------------------------------------------- function isort($a,$b) { #--------------------------------------------------- /* isort : ord (http://www.php.net/manual/en/function.ord.php) returns the ASCII value of the first character in a string (the ASCII value of a capital letter is different from that of a lower case letter) strtolower (http://www.php.net/manual/en/function.strtolower.php) converts all uppercase chrs in a string to lowercase This function compares the lower-cased first letter in one string to that in another. We'll use it to compare directory names */ #--------------------------------------------------- if(ord(strtolower($a)) == ord(strtolower($b))) return 0; return (ord(strtolower($a))< ord(strtolower($b))) ? -1: 1; } function isortMultiD($a,$b) { #--------------------------------------------------- /* isortMultiD : This function basically is the same as issort, except that it runs the comparison between the 2nd row in each array, then the first. We'll be using it to sort the filenames, where the j in $filesArr[i][j] is the extension (bmp, gif, jpg, etc) and the i is the name itself. */ #--------------------------------------------------- if(ord(strtolower($a[count($a) - 1])) == ord(strtolower($b[count ($b) - 1]))) { if(ord(strtolower($a[0])) == ord(strtolower($b[0]))) return 0; return (ord(strtolower($a[0]))< ord(strtolower($b[0]))) ? -1: 1; } return (ord(strtolower($a[count ($a) - 1])) < ord(strtolower($b[count ($b)]))) ? -1: 1; } function indexdirThisDir() { #--------------------------------------------------- /* indexdirThisDir : This function scours through the current directory (regardless of which directory u specify via the getThisDirName call) and makes a list of directories and does the same for files, first by their extensions and then by their names. Remember that since it's only alphabetical on the first char php and phtml or php3 and php files will be jumbled together, as will html and htm (the same logic holds for file names). */ #--------------------------------------------------- global $bulletImgsArr; global $dontListFiles; global $dontListDirs; $numHiddenDirs = 0; $numHiddenFiles = 0; $dirsArr = array(); $filesArr = array(); $this_dir_handle=opendir('.'); # get a handle on the current directory while (false!==($fileORdir = readdir($this_dir_handle))) { if ($fileORdir != "." && $fileORdir != "..") { if(is_dir($fileORdir)== false) { $thisFileNoShow = 0; for ($i = 0; $i < count($dontListFiles); $i++) { if($fileORdir == $dontListFiles[$i]) { $thisFileNoShow = 1; $numHiddenFiles++; break; } } if($thisFileNoShow == 0) { $fileNameAndextensionArr = explode(".", $fileORdir); array_push ($filesArr, $fileNameAndextensionArr); } } else { $thisDirNoShow = 0; for ($i = 0; $i < count($dontListDirs); $i++) { if($fileORdir == $dontListDirs[$i]) { $thisDirNoShow = 1; $numHiddenDirs++; break; } } if($thisDirNoShow == 0) { array_push ($dirsArr, $fileORdir); } } } } closedir($this_dir_handle); $listingHTML .= "
contains ".count($dirsArr)." subdirectories and ".count($filesArr)." files
\n"; usort($dirsArr, 'isort'); usort($filesArr, 'isortMultiD'); $listingHTML .="\n
\n"; for ($i = 0; $i < count($dirsArr); $i++) { $listingHTML .= "\"file\"".$dirsArr[$i]."
\n"; } $listingHTML .="
\n\n"; $listingHTML .="
\n\n\n"; for ($i = 0; $i < count($filesArr); $i++) { $filesArr[$i] = join (".", $filesArr[$i]); $fileStats = stat($filesArr[$i]); $fileSizeInKb = round(($fileStats[7]/1024),2); $fileLastMod = date("H : i M dS Y", $fileStats[9]); $listingHTML .= " \n"; } $listingHTML .='
filesize (kb)last modified
\"file\"".$filesArr[$i]."".$fileSizeInKb."".$fileLastMod."
'; return $listingHTML; } $thisDirName = getThisDirName($thisDirectoryPath); $listingHTMLstring = indexdirThisDir(); header( "Content-type: text/html" ); print (" index of $thisDirName

$thisDirName

$listingHTMLstring
lophty directory indexer copyright © 2001 indexer-script@lophty.com - brian donovan


HEOOS.it HEOOS.org HEOOS.net FANTASITALY.com
"); ?>