国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

74 Zeilen
2.2KB

  1. <?php
  2. /**
  3. * 附件管理
  4. *
  5. * @version $id:media_main.php 11:17 2010年7月19日 tianya $
  6. * @package DedeBIZ.Administrator
  7. * @copyright Copyright (c) 2022 DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. require_once(DEDEINC."/datalistcp.class.php");
  13. require_once(DEDEINC."/common.func.php");
  14. setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
  15. if (empty($dopost)) $dopost = '';
  16. //文件式管理器
  17. if ($dopost == 'filemanager') {
  18. if (file_exists('./file_manage_main.php')) {
  19. header("location:file_manage_main.php?activepath=$cfg_medias_dir");
  20. } else {
  21. ShowMsg("找不到文件管理器,可能已经卸载", "-1");
  22. }
  23. exit();
  24. }
  25. //数据库管理
  26. if (empty($keyword)) $keyword = "";
  27. $addsql = " WHERE (u.title LIKE '%$keyword%' OR u.url LIKE '%$keyword%') ";
  28. if (empty($membertype)) {
  29. $membertype = 0;
  30. }
  31. if ($membertype == 1) {
  32. $addsql .= " AND u.mid>0 ";
  33. } else if ($membertype == 2) {
  34. $addsql .= " AND u.mid>0 ";
  35. }
  36. if (empty($mediatype)) {
  37. $mediatype = 0;
  38. }
  39. if ($mediatype > 1) {
  40. $addsql .= " AND u.mediatype='$membertype' ";
  41. }
  42. $sql = "SELECT u.aid,u.title,u.url,u.mediatype,u.filesize,u.mid,u.uptime,a.userid AS adminname,m.userid AS membername FROM `#@__uploads` u LEFT JOIN `#@__admin` a ON a.id = u.mid LEFT JOIN `#@__member` m ON m.mid = u.mid $addsql ORDER BY u.aid DESC";
  43. $dlist = new DataListCP();
  44. $dlist->pagesize = 30;
  45. $dlist->SetParameter("mediatype", $mediatype);
  46. $dlist->SetParameter("keyword", $keyword);
  47. $dlist->SetParameter("membertype", $membertype);
  48. $dlist->SetTemplate(DEDEADMIN."/templets/media_main.htm");
  49. $dlist->SetSource($sql);
  50. $dlist->Display();
  51. function MediaType($tid, $nurl)
  52. {
  53. if ($tid == 1) {
  54. return "<a href=\"$nurl\" target=\"_blank\">图片</a>";
  55. } else if ($tid == 2) {
  56. return "FLASH";
  57. } else if ($tid == 3) {
  58. return "视频音频";
  59. } else {
  60. return "附件其它";
  61. }
  62. }
  63. function GetFileSize($fs)
  64. {
  65. $fs = $fs / 1024;
  66. return trim(sprintf("%10.1f", $fs)." K");
  67. }
  68. function UploadAdmin($adminid, $mid)
  69. {
  70. if ($adminid != '') return $adminid;
  71. else return $mid;
  72. }
  73. ?>