upfiles.html 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <!-- inc:header -->
  2. <!-- if($file_uptype == "swf") -->
  3. <script type="text/javascript" src="libs/swfupload/swfupload.js"></script>
  4. <script type="text/javascript" src="libs/swfupload/swfupload.queue.js"></script>
  5. <script type="text/javascript" src="libs/swfupload/fileprogress.js"></script>
  6. <script type="text/javascript" src="libs/swfupload/handlers.js"></script>
  7. <!-- end -->
  8. <div class="notice"><div class="p">
  9. <table width="100%" cellpadding="0" cellspacing="0">
  10. <tr>
  11. <td width="150px">
  12. <table cellpadding="0" cellspacing="0">
  13. <form id="_phpok_action_upload" action="{:$page_url}" method="post" enctype="multipart/form-data">
  14. <tr>
  15. <td><span class="lead">&nbsp;&raquo; 附件列表</span></td>
  16. <td><div id="divStatus"></div></td>
  17. <td>&nbsp;</td>
  18. <td><span id="spanButtonPlaceHolder"></span></td>
  19. <td>&nbsp;</td>
  20. <td style="display:none;"><input id="btnCancel" type="button" value="取消上传" onclick="swfu.cancelQueue();" disabled="disabled" /></td>
  21. </tr>
  22. </form>
  23. </table>
  24. </td>
  25. <td>
  26. <table>
  27. <form method="post" action="{:site_url('files')}">
  28. <tr>
  29. <td>附件搜索:</td>
  30. <td>
  31. <select name="type" id="type">
  32. <option value="">全部,不限</option>
  33. <option value="img"{if($input_type == "img")} selected{end}>图片类</option>
  34. <option value="video"{if($input_type == "video")} selected{end}>影音类</option>
  35. <option value="download"{if($input_type == "download")} selected{end}>其他</option>
  36. </select>
  37. </td>
  38. <td>上传时间:</td>
  39. <td><input type="text" name="postdate" id="postdate" onfocus="show_date('postdate')" style="width:75px;" value="{:$postdate}"></td>
  40. <td>&nbsp; 关键字:</td>
  41. <td><input type="text" name="keywords" value="{:$keywords}" id="keywords"></td>
  42. <td><input type="submit" value="搜索" class="btn2"></td>
  43. </tr>
  44. </form>
  45. </table>
  46. </td>
  47. <td align="right"><a href="{:site_url('files,set')}" class="button">附件设置</a></td>
  48. </tr>
  49. </table>
  50. </div></div>
  51. <!-- if($file_uptype != "swf") -->
  52. <div class="notice"><div class="p">
  53. <table cellpadding="0" cellspacing="0">
  54. <form method="post" action="{:site_url('open,upok','','&')}" enctype="multipart/form-data">
  55. <input type="hidden" id="_go_back_url" name="_go_back_url" value="{:$page_url}" />
  56. <tr>
  57. <td>&nbsp;&raquo; 上传附件:</td>
  58. <td><input type="file" name="upload_file" id="upload_file" size="12"></td>
  59. <td>&nbsp;</td>
  60. <td><input type="submit" value="上传" class="btn2" /></td>
  61. </tr>
  62. </form>
  63. </table>
  64. </div></div>
  65. <!-- end -->
  66. <div id="fsUploadProgress" class="swfupload_progress"></div>
  67. <div class="main">
  68. <table width="100%" style="layout:fixed;" cellpadding="0" cellspacing="0">
  69. <tr>
  70. <td class="t_sub" width="50%">名称</td>
  71. <td class="t_sub" width="50%">名称</td>
  72. </tr>
  73. <tr>
  74. <!-- $rslist AS $key=>$value -->
  75. <!-- run:$ftype = ROOT."images/filetype-large/".$value[ftype].".jpg" -->
  76. <!-- run:$thumb = file_exists($ftype) ? $value[ftype] : "unknown" -->
  77. <td class="{:($key)%2=='' ? 'tc_left' : 'tc_right'}">
  78. <table width="100%" onMouseOver="over_tr(this)" onMouseOut="out_tr(this)">
  79. <tr>
  80. <td align="center" width="90px" height="90px"><a href="javascript:phpjs_preview({:$value[id]});void(0);"><!-- if($value[thumb]) --><img src="{:$value[thumb]}" width="80px" height="80px" /><!-- else --><img src="images/filetype-large/{:$thumb}.jpg" width="80px" height="80px" /><!-- end --></a></td>
  81. <td>
  82. <!-- if($thumb == "flv") -->
  83. <div>封面:<input type="text" id="flv_pic_{:$value[id]}" value="{:$value[flv_pic]}" style="width:180px" /> <input type="button" value="选择" class="btn2" onclick="phpjs_onepic('flv_pic_{:$value[id]}')" /> <input type="button" class="btn2" value="清空" onclick="phpjs_onepic_clear('flv_pic_{:$value[id]}')">
  84. </div>
  85. <div style="padding-top:5px;">名称:<input type="text" id="tmpname_{:$value[id]}" value="{:$value[title] ? $value[title] : basename($value[filename])}" style="width:180px" /> <input type="button" value="提交" onclick="update_name({:$value[id]});" class="btn2" /></div>
  86. <!-- else -->
  87. <div>名称:<input type="text" id="tmpname_{:$value[id]}" value="{:$value[title] ? $value[title] : basename($value[filename])}" style="width:180px" /> <input type="button" value="改名" onclick="update_name({:$value[id]});" class="btn2" /></div>
  88. <!-- end -->
  89. <div style="padding-top:5px;">时间:{:date("Y-m-d H:i:s",$value[postdate])}</div>
  90. <div style="padding-top:5px;">
  91. <table cellpadding="0" cellspacing="0">
  92. <tr>
  93. <td><input type="checkbox" value="{:$value[id]}" /></td>
  94. <td><a href="javascript:update_one({:$value['id']});void(0);" class="btn pic_gd" title="更新图片规格"></a></td>
  95. <td><a href="javascript:copy_url({:$value['id']});void(0);" class="btn piclink" title="链接"></a></td>
  96. <td><a href="javascript:to_delete({:$value['id']});void(0);" class="btn pic_del" title="删除"></a></td>
  97. <td id="notice_{:$value[id]}" style="color:darkblue;"></td>
  98. </tr>
  99. </table>
  100. </div>
  101. </td>
  102. </tr>
  103. </table>
  104. </td>
  105. <!-- row:2 -->
  106. <!-- end -->
  107. </tr>
  108. </table>
  109. </div>
  110. <div class="table">
  111. <table width="100%">
  112. <tr>
  113. <td>
  114. <input type="button" value="全选" onclick="select_all()" class="btn2">
  115. <input type="button" value="全不选" onclick="select_none()" class="btn3">
  116. <input type="button" value="反选" onclick="select_anti()" class="btn2">
  117. &nbsp;
  118. <input type="button" value="批量更新" onclick="update_pl()" class="btn4">
  119. <input type="button" value="全部更新" onclick="update_all()" class="btn4">
  120. &nbsp;
  121. <input type="button" value="批量删除" onclick="del_pl()" class="btn4">
  122. </td>
  123. <td align="right">{:$pagelist}</td>
  124. </tr>
  125. </table>
  126. </div>
  127. <script type="text/javascript">
  128. var page_url = "{:$page_url}";
  129. </script>
  130. <!-- if($file_uptype == "swf") -->
  131. <script type="text/javascript">
  132. var settings = {
  133. flash_url : "libs/swfupload/swfupload.swf",
  134. upload_url: "{:site_url('open,upload','','&')}",
  135. post_params: {"{:SYS_SESSION_ID}" : "{:$sys_app->session_lib->sessid()}"},
  136. file_size_limit : "500 MB",
  137. file_types : "*.*",
  138. file_types_description : "全部文件",
  139. file_upload_limit : 100,
  140. file_queue_limit : 0,
  141. custom_settings : {
  142. progressTarget : "fsUploadProgress",
  143. cancelButtonId : "btnCancel"
  144. },
  145. debug: false,
  146. // Button settings
  147. button_image_url: "images/swfupload.png",
  148. button_placeholder_id : "spanButtonPlaceHolder",
  149. button_width: "62",
  150. button_height: "22",
  151. // The event handler functions are defined in handlers.js
  152. file_queued_handler : fileQueued,
  153. file_queue_error_handler : fileQueueError,
  154. file_dialog_complete_handler : fileDialogComplete,
  155. upload_start_handler : uploadStart,
  156. upload_progress_handler : uploadProgress,
  157. upload_error_handler : uploadError,
  158. upload_success_handler : uploadSuccess,
  159. upload_complete_handler : uploadComplete,
  160. queue_complete_handler : queueComplete // Queue plugin event
  161. };
  162. swfu = new SWFUpload(settings);
  163. </script>
  164. <!-- end -->
  165. <script type="text/javascript">
  166. function update_one(id)
  167. {
  168. var url = base_file + "?" + base_ctrl + "=open&" + base_func + "=pl&picid="+id;
  169. Layer.init(url,630,500);
  170. }
  171. function update_pl()
  172. {
  173. var id = join_checkbox();
  174. if(!id)
  175. {
  176. alert("请选择要更新的附件");
  177. return false;
  178. }
  179. var url = base_file + "?" + base_ctrl + "=open&" + base_func + "=pl&picid="+id;
  180. Layer.init(url,630,500);
  181. }
  182. function update_all()
  183. {
  184. var url = base_file + "?" + base_ctrl + "=open&" + base_func + "=pl&picid=all";
  185. Layer.init(url,630,500);
  186. }
  187. function del_pl()
  188. {
  189. var id = join_checkbox();
  190. if(!id)
  191. {
  192. alert("请选择要批量删除的附件");
  193. return false;
  194. }
  195. var qc = confirm("确定要删除这些附件吗?删除后是不能恢复的!");
  196. if(qc == "0")
  197. {
  198. return false;
  199. }
  200. var url = base_url + base_func + "=del&id="+id;
  201. var msg = get_ajax(url);
  202. if(!msg) msg = "error!";
  203. if(msg == "ok")
  204. {
  205. direct(page_url);
  206. }
  207. else
  208. {
  209. alert(msg);
  210. return false;
  211. }
  212. }
  213. function to_delete(id)
  214. {
  215. if(!id)
  216. {
  217. alert("没有指定ID!");
  218. return false;
  219. }
  220. var qc = confirm("确定要删除该附件吗?删除后是不能恢复的!");
  221. if(qc == "0")
  222. {
  223. return false;
  224. }
  225. var url = base_url + base_func + "=del&id="+id;
  226. var msg = get_ajax(url);
  227. if(!msg) msg = "error!";
  228. if(msg == "ok")
  229. {
  230. direct(page_url);
  231. }
  232. else
  233. {
  234. alert(msg);
  235. return false;
  236. }
  237. }
  238. function update_name(id)
  239. {
  240. if(!id)
  241. {
  242. alert("获取ID错误!请检查!");
  243. return false;
  244. }
  245. var tname = getid("tmpname_"+id).value;
  246. if(!tname)
  247. {
  248. alert("名称不允许为空!");
  249. return false;
  250. }
  251. var url = base_url + base_func + "=update_name&id="+id+"&tmpname="+EncodeUtf8(tname);
  252. //判断是否有封面,如有,同时更新FLV封面信息
  253. if(getid("flv_pic_"+id))
  254. {
  255. var flv_pic = getid("flv_pic_"+id).value;
  256. url += "&flv_pic="+EncodeUtf8(flv_pic);
  257. }
  258. get_ajax(url,js_update_tmpname,id);
  259. }
  260. function js_update_tmpname(msg,id)
  261. {
  262. if(msg == "ok")
  263. {
  264. getid("notice_"+id).innerHTML = "更名成功";
  265. eval_js(3,"js_clear_tmpname("+id+")");
  266. return true;
  267. }
  268. else
  269. {
  270. if(msg)
  271. {
  272. getid("notice_"+id).innerHTML = msg;
  273. return false;
  274. }
  275. }
  276. }
  277. function js_clear_tmpname(id)
  278. {
  279. getid("notice_"+id).innerHTML = "";
  280. }
  281. function copy_url(id)
  282. {
  283. var url = base_file + "?" + base_ctrl + "=open&" + base_func + "=copyurl&id="+id;
  284. Layer.init(url,630,500);
  285. }
  286. </script>
  287. <!-- inc:footer -->