if($file == ".") continue; else if($file == "..") { if($activepath == "") continue; $tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); $line = "\n<tr> <td class='linerow' colspan='2'> <a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=".urlencode($tmp).$addparm."'><img src=img/dir2.gif border=0 width=16 height=16 align=absmiddle>上级目录</a></td> <td colspan='2' class='linerow'> 当前目录:$activepath</td> </tr> "; $sort[$file]=$line; // echo $line; } else if(is_dir("$inpath/$file")) { if(preg_match("#^_(.*)$#i", $file)) continue; #屏蔽FrontPage扩展目录和linux隐蔽目录 if(preg_match("#^\.(.*)$#i", $file)) continue; $line = "\n<tr> <td bgcolor='#F9FBF0' class='linerow' colspan='2'> <a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=".urlencode("$activepath/$file").$addparm."'><img src=img/dir.gif border=0 width=16 height=16 align=absmiddle>$file</a> </td> <td class='linerow'> </td> <td bgcolor='#F9FBF0' class='linerow'> </td> </tr>"; $sort[$file]=$line; // echo "$line"; } else if(preg_match("#\.(gif|png)#i", $file)) { $reurl = "$activeurl/$file"; $reurl = preg_replace("#^\.\.#", "", $reurl); if($cfg_remote_site=='Y' && $remoteuploads == 1) { $reurl = $remoteupUrl.$reurl; }else{ $reurl = $reurl; } if($file==$comeback) $lstyle = " style='color:blue' "; else $lstyle = ""; $line = "\n<tr> <td align='center' class='linerow' bgcolor='#F9FBF0'> <a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='img/picviewnone.gif' width='16' height='16' border='0' align=absmiddle></a> </td> <td class='linerow' bgcolor='#F9FBF0'> <a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src=img/gif.gif border=0 width=16 height=16 align=absmiddle>$file</a></td> <td class='linerow'>$filesize KB</td> <td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> </tr>"; $sort[$file]=$line; // echo "$line"; } else if(preg_match("#\.(jpg)#i", $file)) { $reurl = "$activeurl/$file"; $reurl = preg_replace("#^\.\.#", "", $reurl); if($cfg_remote_site=='Y' && $remoteuploads == 1) { $reurl = $remoteupUrl.$reurl; }else{ $reurl = $reurl; } if($file==$comeback) $lstyle = " style='color:blue' "; else $lstyle = ""; $line = "\n<tr> <td align='center' class='linerow' bgcolor='#F9FBF0'> <a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='img/picviewnone.gif' width='16' height='16' border='0' align=absmiddle></a> </td> <td class='linerow' bgcolor='#F9FBF0'> <a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src=img/jpg.gif border=0 width=16 height=16 align=absmiddle>$file</a> </td> <td class='linerow'>$filesize KB</td> <td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> </tr>"; $sort[$file]=$line; // echo "$line"; }else if(preg_match("#\.(jpeg)#i", $file)) { $reurl = "$activeurl/$file"; $reurl = preg_replace("#^\.\.#", "", $reurl); if($cfg_remote_site=='Y' && $remoteuploads == 1) { $reurl = $remoteupUrl.$reurl; }else{ $reurl = $reurl; } if($file==$comeback) $lstyle = " style='color:blue' "; else $lstyle = ""; $line = "\n<tr> <td align='center' class='linerow' bgcolor='#F9FBF0'> <a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='img/picviewnone.gif' width='16' height='16' border='0' align=absmiddle></a> </td> <td class='linerow' bgcolor='#F9FBF0'> <a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src=img/jpg.gif border=0 width=16 height=16 align=absmiddle>$file</a> </td> <td class='linerow'>$filesize KB</td> <td align='center' class='linerow' bgcolor='#F9FBF0'>$filetime</td> </tr>"; $sort[$file]=$line; // echo "$line"; } }//End Loop $dh->close(); ksort($sort); foreach ($sort as $key => $value) { echo $value; }
下一篇:没有了