setup.php
上传用户:yttaitong
上传日期:2009-05-10
资源大小:128k
文件大小:3k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

PHP

  1. <?php
  2. if(!isset($T_haveico,$T_editext,$T_perrows,$path,$currentpath,$ifdelete)){
  3. //header('HTTP/1.1 404 not found');
  4. exit("Access Denied!");
  5. }
  6. $treeid=$_GET['id'];
  7. $dir   = array();
  8. $files = array();
  9. $allparent = historypath($path);
  10. $realpath  = truepath($path);
  11. //获得文件及文件夹数组
  12. $handle = opendir($realpath);
  13. do{
  14. $file = readdir($handle);
  15. clearstatcache();
  16. if($file=="."||$file=="..") continue;
  17. if(is_dir($realpath."/".$file)&&$file!=""){
  18. $dir[]=$path."/".$file;
  19. }elseif(is_file($realpath."/".$file)){
  20. $files[] =$path."/".$file;
  21. }
  22. }while($file!="");
  23. closedir($handle);
  24. $IdValue = 1;
  25. /*输出文件夹开始*/
  26. $num_dir = 0;
  27. if($dir){
  28. $dirlist .= "<tr>";
  29. foreach($dir as $path){
  30. $fulldirname = basename($path);  
  31. $dirname     = limitname($fulldirname);
  32. if(($num_dir%$T_perrows)==0&&$num_dir!=0){
  33. $dirlist .= "</tr><tr>";
  34. }
  35. if(strtolower(truepath($path))==strtolower(truepath($T_Recycled,2))){
  36. $dirlist .= "
  37. <td width="{$T_percent}" style="white-space:nowrap;" >
  38. <a href="javascript:;" id="element_".$IdValue."" class="default" title="{$fulldirname}" onmouseover="setvars(3,'".urlencode($path)."',".$IdValue.")" onmouseout="setvars(0,'{$currentpath}',null)" ondblclick="window.location='{$T_main}?path=".urlencode($path)."'">
  39. <img src="{$T_images}/Recycled.gif" height="32" width="32" align=absmiddle>{$dirname}
  40. </a>
  41. </td>
  42. ";
  43. }else{
  44. $dirlist .= "
  45. <td width="{$T_percent}" style="white-space:nowrap;">
  46. <a href="javascript:;" id="element_".$IdValue."" class="default" title="{$fulldirname}" onmouseover="setvars(".(2+$ifdelete).",'".urlencode($path)."',".$IdValue.")" onmouseout="setvars(0,'{$currentpath}',null)" ondblclick="window.location='{$T_main}?path=".urlencode($path)."'">
  47.   <img src="{$T_images}/folder.gif" height="32" width="32" align=absmiddle>{$dirname}
  48. </a>
  49. </td>
  50. ";
  51. }
  52. $num_dir++;
  53. $IdValue++;
  54. }
  55. if($num_dir%$T_perrows){
  56. $colspan  = $T_perrows-$num_dir%$T_perrows;
  57. $colwidth = ((int)(100/$T_perrows)*$colspan)."%";
  58. $dirlist .= "<td colspan="{$colspan}" width="$colwidth">&nbsp;</td>";
  59. }
  60. $dirlist .= "</tr>";
  61. }
  62. /*输出文件夹结束*/
  63. /*输出文件开始*/
  64. $num_file = 0;
  65. if($files){
  66. $filelist .= "<tr>";
  67. foreach($files as $path){
  68. $fulldirname = basename($path);  
  69. $dirname     = limitname($fulldirname);
  70. if(($num_file%$T_perrows)==0&&$num_file!=0){
  71. $filelist .= "</tr><tr>";
  72. }
  73. $ext = strtolower(fileext($fulldirname));
  74. if(in_array($ext,$T_haveico)){
  75. $thisico = $ext;
  76. }else{
  77. $thisico = "none";
  78. }
  79. $filelist .= "
  80. <td width="{$T_percent}">
  81.  <a href="javascript:;" id="element_".$IdValue."" class="default" title="{$fulldirname}" onmouseover="setvars(".(1+$ifdelete).",'".urlencode($path)."',".$IdValue.")" onmouseout="setvars(0,'{$currentpath}',null)" ondblclick="Tasks('".urlencode($path)."','rewrite')">
  82.   <img src={$T_images}/".$thisico.".gif border=0 align=absmiddle>&nbsp;$dirname
  83.  </a>
  84. </td>
  85. ";
  86. $num_file++;
  87. $IdValue++;
  88. }
  89. if($num_file%$T_perrows){
  90. $colspan = $T_perrows-$num_file%$T_perrows;
  91. $colwidth = ((int)(100/$T_perrows)*$colspan)."%";
  92. $filelist .= "<td colspan="{$colspan}" width="$colwidth">&nbsp;</td>";
  93. }
  94. $filelist .= "</tr>";
  95. }
  96. /*输出文件结束*/
  97. $T_URL_RC    = urlencode(visualpath(truepath($T_Recycled,2)));//路径URL编码
  98. //调用模版
  99. require_once($T_index);
  100. ?>