国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

280 lignes
18KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
  6. <title>文件管理器</title>
  7. <link rel="stylesheet" href="/static/web/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. <div class="container-fluid">
  13. <ol class="breadcrumb">
  14. <li class="breadcrumb-item"><a href="index_body.php">后台面板</a></li>
  15. <li class="breadcrumb-item active">文件管理器</li>
  16. </ol>
  17. <div class="card shadow-sm">
  18. <div class="card-header">文件管理器</div>
  19. <div class="card-body">
  20. <div class="table-responsive">
  21. <table class="table table-borderless table-hover">
  22. <thead>
  23. <tr>
  24. <td scope="col">文件名称</td>
  25. <td scope="col">文件大小</td>
  26. <td scope="col">修改时间</td>
  27. <td scope="col">操作</td>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. <?php
  32. $dh = scandir($inpath);
  33. $ty1 = '';
  34. $ty2 = '';
  35. $files = $dirs = array();
  36. foreach ($dh as $file) {
  37. if ($file!="." && $file!=".." && !is_dir("$inpath/$file")) {
  38. @$filesize = filesize("$inpath/$file");
  39. @$filesize = $filesize/1024;
  40. @$filetime = filemtime("$inpath/$file");
  41. @$filetime = MyDate("Y-m-d H:i:s",$filetime);
  42. if ($filesize<0.1) {
  43. @list($ty1,$ty2)=explode(".",$filesize);
  44. $filesize=$ty1.".".substr($ty2,0,2);
  45. } else {
  46. @list($ty1,$ty2)=explode(".",$filesize);
  47. $filesize=$ty1.".".substr($ty2,0,1);
  48. }
  49. }
  50. if ($file == ".") {
  51. continue;
  52. }
  53. else if ($file == "..")
  54. {
  55. if ($activepath == "") {
  56. continue;
  57. }
  58. $tmp = preg_replace("#[\/][^\/]*$#i","",$activepath);
  59. $line = "\n<tr>
  60. <td><a href='file_manage_main.php?activepath=".urlencode($tmp)."'><img src='/static/web/img/icon_dir2.png'> 返回上级</a></td>
  61. <td colspan='3'>当前目录:$activepath</td>
  62. </tr>";
  63. $dirs[] = $line;
  64. } else if (is_dir("$inpath/$file")) {
  65. if (preg_match("#^_(.*)$#i",$file)) continue;
  66. if (preg_match("#^\.(.*)$#i",$file)) continue;
  67. $line = "\n<tr>
  68. <td><a href='file_manage_main.php?activepath=".urlencode("$activepath/$file")."'><img src='/static/web/img/icon_dir.png'> $file</a></td>
  69. <td></td>
  70. <td></td>
  71. <td align='left'>
  72. <a href='file_manage_view.php?filename=".urlencode($file)."&activepath=".urlencode($activepath)."&fmdo=rename' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  73. <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' title='删除'></i></a>
  74. </td>
  75. </tr>";
  76. $dirs[] = $line;
  77. } else if (preg_match("#\.(gif|png)#i",$file)) {
  78. $line = "\n<tr>
  79. <td><a href='$activeurl/$file' target='_blank'><img src='$activeurl/$file' style='width:20px'> $file</a></td>
  80. <td>$filesize KB</td>
  81. <td>$filetime</td>
  82. <td align='left'>
  83. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  84. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  85. <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' title='删除'></i></a>
  86. </td>
  87. </tr>";
  88. $files[] = $line;
  89. } else if (preg_match("#\.(jpg)#i",$file)) {
  90. $line = "\n<tr>
  91. <td><a href='$activeurl/$file' target='_blank'><img src='$activeurl/$file' style='width:20px'> $file</a></td>
  92. <td>$filesize KB</td>
  93. <td>$filetime</td>
  94. <td align='left'>
  95. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  96. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></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' title='删除'></i></a>
  98. </td>
  99. </tr>";
  100. $files[] = $line;
  101. } else if (preg_match("#\.(swf|fla|fly)#i",$file)) {
  102. $line = "\n<tr>
  103. <td><a href='$activeurl/$file' target='_blank'><img src='/static/web/img/icon_flash.png'> $file</a></td>
  104. <td>$filesize KB</td>
  105. <td>$filetime</td>
  106. <td align='left'>
  107. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  108. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  109. <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' title='删除'></i></a>
  110. </td>
  111. </tr>";
  112. $files[] = $line;
  113. } else if (preg_match("#\.(zip|rar|tar.gz)#i",$file)) {
  114. $line = "\n<tr>
  115. <td><a href='$activeurl/$file' target='_blank'><img src='/static/web/img/icon_zip.png'> $file</a></td>
  116. <td>$filesize KB</td>
  117. <td>$filetime</td>
  118. <td align='left'>
  119. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  120. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  121. <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' title='删除'></i></a>
  122. </td>
  123. </tr>";
  124. $files[] = $line;
  125. } else if (preg_match("#\.(exe)#i",$file)) {
  126. $line = "\n<tr>
  127. <td><a href='$activeurl/$file' target='_blank'><img src='/static/web/img/icon_exe.png'> $file</a></td>
  128. <td>$filesize KB</td>
  129. <td>$filetime</td>
  130. <td align='left'>
  131. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  132. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  133. <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' title='删除'></i></a>
  134. </td>
  135. </tr>";
  136. $files[] = $line;
  137. } else if (preg_match("#\.(mp3|wma)#i",$file)) {
  138. $line = "\n<tr >
  139. <td><a href='$activeurl/$file' target='_blank'><img src='/static/web/img/icon_music.png'> $file</a></td>
  140. <td>$filesize KB</td>
  141. <td>$filetime</td>
  142. <td align='left'>
  143. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  144. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  145. <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' title='删除'></i></a>
  146. </td>
  147. </tr>";
  148. $files[] = $line;
  149. } else if (preg_match("#\.(wmv|api)#i",$file)) {
  150. $line = "\n<tr>
  151. <td><a href='$activeurl/$file' target='_blank'><img src='/static/web/img/icon_video.png'> $file</a></td>
  152. <td>$filesize KB</td>
  153. <td>$filetime</td>
  154. <td align='left'>
  155. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  156. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  157. <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' title='删除'></i></a>
  158. </td>
  159. </tr>";
  160. $files[] = $line;
  161. } else if (preg_match("#\.(rm|rmvb)#i",$file)) {
  162. $line = "\n<tr>
  163. <td><a href='$activeurl/$file' target='_blank'><img src='/static/web/img/icon_rm.png'> $file</a></td>
  164. <td>$filesize KB</td>
  165. <td>$filetime</td>
  166. <td align='left'>
  167. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  168. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  169. <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' title='删除'></i></a>
  170. </td>
  171. </tr>";
  172. $files[] = $line;
  173. } else if (preg_match("#\.(txt|inc|pl|cgi|asp|xml|xsl|aspx|cfm)#",$file)) {
  174. $edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
  175. $line = "\n<tr>
  176. <td><a href='$activeurl/$file' target='_blank'><img src='/static/web/img/icon_text.png'> $file</a></td>
  177. <td>$filesize KB</td>
  178. <td>$filetime</td>
  179. <td align='left'>
  180. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  181. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  182. <a href='$edurl' class='btn btn-light btn-sm'><i class='fa fa-pencil-square' title='修改'></i></a>
  183. <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' title='删除'></i></a>
  184. </td>
  185. </tr>";
  186. $files[] = $line;
  187. } else if (preg_match("#\.(htm|html)#i",$file)) {
  188. $edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
  189. $line = "\n<tr>
  190. <td><a href='$activeurl/$file' target='_blank'><img src='/static/web/img/icon_htm.png'> $file</a></td>
  191. <td>$filesize KB</td>
  192. <td>$filetime</td>
  193. <td align='left'>
  194. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  195. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  196. <a href='$edurl' class='btn btn-light btn-sm'><i class='fa fa-pencil-square' title='修改'></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' title='删除'></i></a>
  198. </td>
  199. </tr>";
  200. $files[] = $line;
  201. } else if (preg_match("#\.(php)#i",$file)) {
  202. $edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
  203. $line = "\n<tr>
  204. <td><a href='$activeurl/$file' target='_blank'><img src='/static/web/img/icon_php.png'> $file</a></td>
  205. <td>$filesize KB</td>
  206. <td>$filetime</td>
  207. <td align='left'>
  208. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  209. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  210. <a href='$edurl' class='btn btn-light btn-sm'><i class='fa fa-pencil-square' title='修改'></i></a>
  211. <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' title='删除'></i></a>
  212. </td>
  213. </tr>";
  214. $files[] = $line;
  215. } else if (preg_match("#\.(js)#i",$file)) {
  216. $edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
  217. $line = "\n<tr>
  218. <td><a href='$activeurl/$file' target='_blank'><img src='/static/web/img/icon_js.png'> $file</a></td>
  219. <td>$filesize KB</td>
  220. <td>$filetime</td>
  221. <td align='left'>
  222. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  223. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  224. <a href='$edurl' class='btn btn-light btn-sm'><i class='fa fa-pencil-square' title='修改'></i></a>
  225. <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' title='删除'></i></a>
  226. </td>
  227. </tr>";
  228. $files[] = $line;
  229. } else if (preg_match("#\.(css)#i",$file)) {
  230. $edurl = "file_manage_view.php?fmdo=edit&filename=".urlencode($file)."&activepath=".urlencode($activepath);
  231. $line = "\n<tr>
  232. <td><a href='$activeurl/$file' target='_blank'><img src='/static/web/img/icon_css.png'> $file</a></td>
  233. <td>$filesize KB</td>
  234. <td>$filetime</td>
  235. <td align='left'>
  236. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  237. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  238. <a href='$edurl' class='btn btn-light btn-sm'><i class='fa fa-pencil-square' title='修改'></i></a>
  239. <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' title='删除'></i></a>
  240. </td>
  241. </tr>";
  242. $files[] = $line;
  243. } else {
  244. $line = "\n<tr>
  245. <td><a href='$activeurl/$file' target='_blank'> $file</td>
  246. <td>$filesize KB</td>
  247. <td>$filetime</td>
  248. <td align='left'>
  249. <a href='file_manage_view.php?fmdo=move&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-share-square' title='移动'></i></a>
  250. <a href='file_manage_view.php?fmdo=rename&filename=".urlencode($file)."&activepath=".urlencode($activepath)."' class='btn btn-light btn-sm'><i class='fa fa-folder' title='改名'></i></a>
  251. <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' title='删除'></i></a>
  252. </td>
  253. </tr>";
  254. $files[] = $line;
  255. }
  256. }
  257. foreach ($dirs as $dir) {
  258. echo $dir;
  259. }
  260. foreach ($files as $file) {
  261. echo $file;
  262. }
  263. ?>
  264. <tr>
  265. <td colspan="4" align="center">
  266. <?php if (!DEDEBIZ_SAFE_MODE) {?><a href="file_manage_main.php" class="btn btn-success btn-sm">根目录</a><?php }?>
  267. <a href="file_manage_view.php?fmdo=newfile&activepath=<?php echo urlencode($activepath)?>" class="btn btn-success btn-sm">新建文件</a>
  268. <a href="file_manage_view.php?fmdo=newdir&activepath=<?php echo urlencode($activepath)?>" class="btn btn-success btn-sm">新建目录</a>
  269. <a href="file_manage_view.php?fmdo=upload&activepath=<?php echo urlencode($activepath)?>" class="btn btn-success btn-sm">文件上传</a>
  270. <a href="file_manage_control.php?fmdo=space&activepath=<?php echo urlencode($activepath)?>" class="btn btn-success btn-sm">空间检查</a>
  271. </td>
  272. </tr>
  273. </tbody>
  274. </table>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. </body>
  280. </html>