国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

299 lines
19KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="<?php echo $cfg_soft_lang;?>">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  6. <title>文件管理器</title>
  7. <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="../static/web/css/admin.css">
  10. </head>
  11. <body>
  12. <table width="98%" cellspacing="1" cellpadding="2" align="center" class="table maintable icon my-3">
  13. <tr align="center">
  14. <td width="36%" bgcolor="#f5f5f5">文件名称</td>
  15. <td width="12%" bgcolor="#f5f5f5">文件大小</td>
  16. <td width="20%" bgcolor="#f5f5f5">修改时间</td>
  17. <td width="30%" bgcolor="#f5f5f5">操作</td>
  18. </tr>
  19. <?php
  20. $dh = scandir($inpath);
  21. $ty1 = "";
  22. $ty2 = "";
  23. $files = $dirs = array();
  24. foreach ($dh as $file)
  25. {
  26. if ($file!="." && $file!=".." && !is_dir("$inpath/$file"))
  27. {
  28. @$filesize = filesize("$inpath/$file");
  29. @$filesize = $filesize/1024;
  30. @$filetime = filemtime("$inpath/$file");
  31. @$filetime = MyDate("Y-m-d H:i:s",$filetime);
  32. if ($filesize<0.1)
  33. {
  34. @list($ty1,$ty2)=explode(".",$filesize);
  35. $filesize=$ty1.".".substr($ty2,0,2);
  36. } else {
  37. @list($ty1,$ty2)=explode(".",$filesize);
  38. $filesize=$ty1.".".substr($ty2,0,1);
  39. }
  40. }
  41. if ($file == ".")
  42. {
  43. continue;
  44. }
  45. else if ($file == "..")
  46. {
  47. if ($activepath == "")
  48. {
  49. continue;
  50. }
  51. $tmp = preg_replace("#[\/][^\/]*$#i","",$activepath);
  52. $line = "\n<tr>
  53. <td><a href='file_manage_main.php?activepath=".urlencode($tmp)."'><img src='../static/web/img/dir2.gif'>上级目录</a></td>
  54. <td colspan='3'>当前目录:$activepath</td>
  55. </tr>";
  56. $dirs[] = $line;
  57. }
  58. else if (is_dir("$inpath/$file"))
  59. {
  60. if (preg_match("#^_(.*)$#i",$file)) continue;
  61. if (preg_match("#^\.(.*)$#i",$file)) continue;
  62. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  63. <td><a href='file_manage_main.php?activepath=".urlencode("$activepath/$file")."'><img src='../static/web/img/dir.gif'>$file</a></td>
  64. <td></td>
  65. <td></td>
  66. <td>
  67. <a href='file_manage_view.php?filename=".urlencode($file)."&activepath=".urlencode($activepath)."&fmdo=rename' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  68. <a href='file_manage_view.php?filename=".urlencode($file)."&activepath=".urlencode($activepath)."&type=dir&fmdo=del' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  69. </td>
  70. </td>
  71. </tr>";
  72. $dirs[] = $line;
  73. }
  74. else if (preg_match("#\.(gif|png)#i",$file))
  75. {
  76. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  77. <td><a href='$activeurl/$file' target='_blank'><img src='$activeurl/$file'>$file</a></td>
  78. <td>$filesize KB</td>
  79. <td align='center'>$filetime</td>
  80. <td>
  81. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  82. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  83. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  84. </td>
  85. </tr>";
  86. $files[] = $line;
  87. }
  88. else if (preg_match("#\.(jpg)#i",$file))
  89. {
  90. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  91. <td><a href='$activeurl/$file' target='_blank'><img src='$activeurl/$file'>$file</a></td>
  92. <td>$filesize KB</td>
  93. <td align='center' class='biz-td'>$filetime</td>
  94. <td>
  95. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  96. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  97. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  98. </td>
  99. </tr>";
  100. $files[] = $line;
  101. }
  102. else if (preg_match("#\.(swf|fla|fly)#i",$file))
  103. {
  104. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  105. <td><a href='$activeurl/$file' target='_blank'><img src='../static/web/img/flash.gif'>$file</a></td>
  106. <td>$filesize KB</td>
  107. <td align='center'>$filetime</td>
  108. <td>
  109. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  110. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  111. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  112. </td>
  113. </tr>";
  114. $files[] = $line;
  115. }
  116. else if (preg_match("#\.(zip|rar|tar.gz)#i",$file))
  117. {
  118. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  119. <td><a href='$activeurl/$file' target='_blank'><img src='../static/web/img/zip.gif'>$file</a></td>
  120. <td>$filesize KB</td>
  121. <td align='center'>$filetime</td>
  122. <td>
  123. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  124. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  125. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  126. </td>
  127. </tr>";
  128. $files[] = $line;
  129. }
  130. else if (preg_match("#\.(exe)#i",$file))
  131. {
  132. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  133. <td><a href='$activeurl/$file' target='_blank'><img src='../static/web/img/exe.gif'>$file</a></td>
  134. <td>$filesize KB</td>
  135. <td align='center'>$filetime</td>
  136. <td>
  137. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  138. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  139. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  140. </td>
  141. </tr>";
  142. $files[] = $line;
  143. }
  144. else if (preg_match("#\.(mp3|wma)#i",$file))
  145. {
  146. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  147. <td><a href='$activeurl/$file' target='_blank'><img src='../static/web/img/mp3.gif'>$file</a></td>
  148. <td>$filesize KB</td>
  149. <td align='center'>$filetime</td>
  150. <td>
  151. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  152. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  153. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  154. </td>
  155. </tr>";
  156. $files[] = $line;
  157. }
  158. else if (preg_match("#\.(wmv|api)#i",$file))
  159. {
  160. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  161. <td><a href='$activeurl/$file' target='_blank'><img src='../static/web/img/wmv.gif'>$file</a></td>
  162. <td>$filesize KB</td>
  163. <td align='center'>$filetime</td>
  164. <td>
  165. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  166. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  167. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  168. </td>
  169. </tr>";
  170. $files[] = $line;
  171. }
  172. else if (preg_match("#\.(rm|rmvb)#i",$file))
  173. {
  174. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  175. <td><a href='$activeurl/$file' target='_blank'><img src='../static/web/img/rm.gif'>$file</a></td>
  176. <td>$filesize KB</td>
  177. <td align='center' class='biz-td'>$filetime</td>
  178. <td>
  179. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  180. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  181. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  182. </td>
  183. </tr>";
  184. $files[] = $line;
  185. }
  186. else if (preg_match("#\.(txt|inc|pl|cgi|asp|xml|xsl|aspx|cfm)#",$file))
  187. {
  188. $edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
  189. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  190. <td><a href='$activeurl/$file' target='_blank'><img src='../static/web/img/txt.gif'>$file</a></td>
  191. <td>$filesize KB</td>
  192. <td align='center'>$filetime</td>
  193. <td>
  194. <a href='$edurl' class='btn btn-success btn-sm'><i class='fa fa-pencil-square-o'></i> 编辑</a>
  195. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  196. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  197. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  198. </td>
  199. </tr>";
  200. $files[] = $line;
  201. }
  202. else if (preg_match("#\.(htm|html)#i",$file))
  203. {
  204. $edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
  205. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  206. <td><a href='$activeurl/$file' target='_blank'><img src='../static/web/img/htm.gif'>$file</a></td>
  207. <td>$filesize KB</td>
  208. <td align='center'>$filetime</td>
  209. <td>
  210. <a href='$edurl' class='btn btn-success btn-sm'><i class='fa fa-pencil-square-o'></i> 编辑</a>
  211. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  212. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  213. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  214. </td>
  215. </tr>";
  216. $files[] = $line;
  217. }
  218. else if (preg_match("#\.(php)#i",$file))
  219. {
  220. $edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
  221. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  222. <td><a href='$activeurl/$file' target='_blank'><img src='../static/web/img/php.gif'>$file</a></td>
  223. <td>$filesize KB</td>
  224. <td align='center'>$filetime</td>
  225. <td>
  226. <a href='$edurl' class='btn btn-success btn-sm'><i class='fa fa-pencil-square-o'></i> 编辑</a>
  227. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  228. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  229. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  230. </td>
  231. </tr>";
  232. $files[] = $line;
  233. }
  234. else if (preg_match("#\.(js)#i",$file))
  235. {
  236. $edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
  237. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  238. <td><a href='$activeurl/$file' target='_blank'><img src='../static/web/img/js.gif'>$file</a></td>
  239. <td>$filesize KB</td>
  240. <td align='center'>$filetime</td>
  241. <td>
  242. <a href='$edurl' class='btn btn-success btn-sm'><i class='fa fa-pencil-square-o'></i> 编辑</a>
  243. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  244. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  245. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  246. </td>
  247. </tr>";
  248. $files[] = $line;
  249. }
  250. else if (preg_match("#\.(css)#i",$file))
  251. {
  252. $edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
  253. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  254. <td><a href='$activeurl/$file' target='_blank'><img src='../static/web/img/css.gif'>$file</a></td>
  255. <td>$filesize KB</td>
  256. <td align='center'>$filetime</td>
  257. <td>
  258. <a href='$edurl' class='btn btn-success btn-sm'><i class='fa fa-pencil-square-o'></i> 编辑</a>
  259. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  260. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  261. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  262. </td>
  263. </tr>";
  264. $files[] = $line;
  265. } else {
  266. $line = "\n<tr onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  267. <td><a href='$activeurl/$file' target='_blank'>$file</td>
  268. <td>$filesize KB</td>
  269. <td align='center'>$filetime</td>
  270. <td>
  271. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-address-card-o'></i> 改名</a>
  272. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-success btn-sm'><i class='fa fa-share-square'></i> 移动</a>
  273. <a href='file_manage_view.php?fmdo=del&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-danger btn-sm'><i class='fa fa-trash'></i> 删除</a>
  274. </td>
  275. </tr>";
  276. $files[] = $line;
  277. }
  278. }
  279. foreach ($dirs as $dir)
  280. {
  281. echo $dir;
  282. }
  283. foreach ($files as $file)
  284. {
  285. echo $file;
  286. }
  287. ?>
  288. <tr>
  289. <td colspan="4" bgcolor="#f5f5f5">
  290. <?php if (!DEDEBIZ_SAFE_MODE) {?><a href="file_manage_main.php" class="btn btn-success btn-sm">根目录</a><?php }?>
  291. <a href="file_manage_view.php?fmdo=newfile&activepath=<?php echo urlencode($activepath)?>" class="btn btn-success btn-sm">新建文件</a>
  292. <a href="file_manage_view.php?fmdo=newdir&activepath=<?php echo urlencode($activepath)?>" class="btn btn-success btn-sm">新建目录</a>
  293. <a href="file_manage_view.php?fmdo=upload&activepath=<?php echo urlencode($activepath)?>" class="btn btn-success btn-sm">文件上传</a>
  294. <a href="file_manage_control.php?fmdo=space&activepath=<?php echo urlencode($activepath)?>" class="btn btn-success btn-sm">空间检查</a>
  295. </td>
  296. </tr>
  297. </table>
  298. </body>
  299. </html>