国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

file_manage_main.htm 18KB

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