Hello,
Here is a simple PHP recursive file list (with interactive and visual FX)
[url]http://acc.jexiste.ch/
[url]http://acc.jexiste.ch/JPN/RecurciveDIR12.RAR
1. How to ignore/avoid empty folders in this PHP script ?2. How to sort files by filename (and, if possible, folders on top) ?3. Is this MAILTO hidden tool still useful against the current Spam robots ?
[url]http://www.mways.co.uk/prog/hidemail.php4. Is my SpamPoison tag useful if I set it a#SP{display:none;} in the CSS ?
No contact link in their page ;(( [url]http://spampoison.com/
Thanks and regards.
[CODE]<?PHP
//********************* RecurciveDIR 1.2 – Recursive PHP File List With Interactive & Visual Effects
//error_reporting(1);
function DirContent($Path,$Level=0){
$DEBUG=false;//***** For DEBUGGING
$ind=str_repeat(” “,$Level);
$FisrtLevel=$Level<1;
$Folders2Show=array(“JPN”);//***** CUSTOMIZE: Root Folders To Show
if($folder=opendir($Path)){
if($FisrtLevel){
echo “<H1>Sam’s Files : “.date(“Y.m.d”).”</H1>n”;//Main Title
}
while(false!==($file=readdir($folder))){
$PathS=$Path.”/”.$file;
//Recursive Traitement For Sub-Folders
if(is_dir($Path.”/”.$file) && $file!=’.’ && $file!=’..’){
if((in_array($file,$Folders2Show) && $FisrtLevel) || !$FisrtLevel){
$Fid=rand(100000,999999);
$BoderW=max(1,3-$Level);
$Hn=min(6,$Level+2);
$atH=” id=’h$Fid'”;
$inH2=substr($PathS,strrpos($PathS,”/”)+1);
echo $ind.”<H$Hn $atH>”.$inH2.”</H$Hn>n”;
$atD=”style=’border-width:”.$BoderW.”Px'”;
$atD.=” id=’d”.$Fid.”‘ class=’on'”;
echo $ind.”<DIV “.$atD.”>n”;
DirContent($PathS,$Level+1);
echo $ind.”</DIV>n”;
}
}
if(!is_dir($PathS) && $file!=”.” && $file!=”..”){
if(!$FisrtLevel){
$Ext2Hide=array(“PHP”,”HTM”,”HTML”); //Extensions To Hide = Viewable Files
$Ext=strtoupper(substr($file,strrpos($file,”.”)+1));
$Title=””;
if(in_array($Ext,$Ext2Hide)){
$Filename=substr($file,0,strrpos($file,”.”));//Hide The Extension
//$Title=”title=’ View “.$file.”‘”;
}else{
$Filename=$file; //Show The Extension
$Title=”title=’ Download “.$file.”‘”;
}
$href=$DEBUG?”#”:$PathS;
echo $ind.”<P><a href='”.$href.”‘ $Title>”.$Filename.”</a></P>n”;//Link To The File
}
}
}
closedir($folder);
}
}
//*************************************************************************************** Link List!
function LinksLIST(){
$LinkFN=”LiNKS.LOG”;
}
?>
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Sam’s Files</title>
<style type=”text/css”>
<!–
HTML,*{margin:0Px;padding:0Px}
BODY {font-family:”Trebuchet MS”,Arial,sans-serif;font-size:13Px;margin:20Px;cursor:default;}
H1,H2,H3,H4,H5,H6 {margin-top:5Px;}
H2,H3,H4,H5,H6 {cursor:pointer;}
H1{font-size:20Px;margin-bottom:15Px}
H2{font-size:17Px;}
H3{font-size:16Px;}
H4{font-size:15Px;}
H5{font-size:14Px;}
H6{font-size:13Px;}
HR{height:1Px;color:#666666;}
P {padding:4Px 0 0 0;}
A {text-decoration:none;color:#0000CC;}
A:hover {color:#993300;}
DIV {padding-left:8Px;border-color:#979748;border-left-style:solid;}
DIV.on {display:block;font-weight:normal}
DIV.off {display:none; font-weight:bold ;}
DIV.over{background-color:#F1F1E2;}
DIV.out {}
DIV#foot a#SP{display:none;}
DIV#foot a{margin:0 0 0 9Px;vertical-align:top;}
DIV#foot{font-size:14Px;text-align:right;border:solid #999999;border-width:1Px 0 0 0;margin-top:8Px}
–>
</style>
<script language=”JavaScript” type=”text/javascript”>
<!–
//Interactive Sub-Folders FX
function SwitchDIV(){
var Elems=new Array(“H2″,”H3″,”H4″,”H5″,”H6″);//Elements To Affect Rollover FX
var HideS=” Hide this folder’s content ! “;
var ShowS=” Show this folder’s content ! “;
if(document.getElementsByTagName){
for(n=0;n<Elems.length;n++){
var el=document.getElementsByTagName(Elems[n]);
for(var i=0;i<el.length;i++){
el[i].show=true;
el[i].title=HideS;
el[i].Fname=el[i].innerHTML;
el[i].innerHTML=”- “+el[i].Fname;
el[i].cible=document.getElementById(“d”+el[i].id.substr(1));//Sub-Folder’s DIV
el[i].onmouseover=function(){//Rollover FX
if(this.show){
this.cible.className=”over”;
}
}
el[i].onmouseout=function(){//Rollout FX
if(this.show){
this.cible.className=”out”;
}
}
el[i].onclick=function(){//Hide/Show Sub-Folders Content
if(this.show){
this.show=false;
this.title=ShowS;
this.cible.className=”off”;
this.innerHTML=”+ “+this.Fname;
}else{
this.show=true;
this.title=HideS;
this.cible.className=”on over”;
this.innerHTML=”- “+this.Fname;
}
}
}
}
}
}
//Blur All Links OnCLICK To Hide Dotted Borders
function BlurLNK(){
var linkE=document.getElementsByTagName(“a”);
if(document.getElementsByTagName){
for(i=0;i<linkE.length;i++){
linkE[i].onclick=function(){this.blur();}
}
}
}
// –>
</script>
</head>
<body onload=”SwitchDIV();BlurLNK()”>
<?PHP DirContent(“.”); ?>
<div id=”foot”>
<a href=”mailto:%41%6c%66%2e%30%32%32%40%47%6d%61%69%6c%2e%63%6f%6d”> Comment ?! </a>
<a id=”SP” href=”http://french-145495639767.spampoison.com”><img src=”http://pics4.inxhost.com/images/sticker.gif” border=”0″/></a>
</div>
</body>
</html>