国内流行的内容管理系统(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.

324 lines
18KB

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