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

92 lines
3.9KB

  1. <?php
  2. /**
  3. * 文档管理列表
  4. *
  5. * @version $id:content_sg_list.php 14:31 2010年7月12日 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. $channelid = isset($channelid) ? intval($channelid) : 0;
  13. $mid = isset($mid) ? intval($mid) : 0;
  14. if (!isset($keyword)) $keyword = '';
  15. if (!isset($arcrank)) $arcrank = '';
  16. if (empty($cid) && empty($channelid)) {
  17. ShowMsg("该页面必须指定栏目id或文档模型id才能浏览", "javascript:;");
  18. exit();
  19. }
  20. //检查权限许可,总权限
  21. CheckPurview('a_List,a_AccList,a_MyList');
  22. //栏目浏览许可
  23. if (TestPurview('a_List')) {
  24. } else if (TestPurview('a_AccList')) {
  25. if ($cid == 0) {
  26. $ucid = $cid = $cuserLogin->getUserChannel();
  27. } else {
  28. CheckCatalog($cid, "您无权浏览非指定栏目的文档");
  29. }
  30. }
  31. $cid = isset($cid) ? intval($cid) : 0;
  32. $adminid = $cuserLogin->getUserID();
  33. $maintable = '#@__archives';
  34. require_once(DEDEINC."/typelink/typelink.class.php");
  35. require_once(DEDEINC."/datalistcp.class.php");
  36. require_once(DEDEADMIN."/inc/inc_list_functions.php");
  37. setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
  38. $tl = new TypeLink($cid);
  39. $listtable = @trim($tl->TypeInfos['addtable']);
  40. if (!empty($channelid) && !empty($ucid) && $tl->TypeInfos['channeltype'] != $channelid) {
  41. ShowMsg('您没权限浏览此页', 'javascript:;');
  42. exit();
  43. }
  44. if ($cid == 0) {
  45. $row = $tl->dsql->GetOne("SELECT typename,addtable FROM `#@__channeltype` WHERE id='$channelid'");
  46. $positionname = $row['typename']." - ";
  47. $listtable = $row['addtable'];
  48. } else {
  49. $positionname = str_replace($cfg_list_symbol, " - ", $tl->GetPositionName())." - ";
  50. }
  51. $optionarr = $tl->GetOptionArray($cid, $admin_catalogs, $channelid);
  52. $whereSql = $channelid == 0 ? " WHERE arc.channel < -1 " : " WHERE arc.channel = '$channelid' ";
  53. $stime = 0;
  54. $etime = 0;
  55. $timerange = isset($timerange)? explode(" - ",$timerange) : array();
  56. if (count($timerange) === 2) {
  57. $stime = strtotime($timerange[0]);
  58. $etime = strtotime($timerange[1]);
  59. }
  60. if ($stime > $etime) {
  61. $stime = 0;
  62. $etime = 0;
  63. }
  64. if (!empty($mid)) $whereSql .= " AND arc.mid = '$mid' ";
  65. if ($stime > 0 && $etime > 0) {
  66. $whereSql .= "AND arc.senddate>$stime AND arc.senddate<$etime";
  67. }
  68. if ($keyword != '') $whereSql .= " AND (arc.title like '%$keyword%') ";
  69. if ($cid != 0 && !empty(GetSonIds($cid))) $whereSql .= " AND arc.typeid in (".GetSonIds($cid).")";
  70. if ($arcrank != '') {
  71. $whereSql .= " AND arc.arcrank = '$arcrank' ";
  72. $CheckUserSend = "<button type='button' class='btn btn-success btn-sm' onClick=\"location='content_sg_list.php?cid={$cid}&channelid={$channelid}&dopost=listArchives';\">所有文档</button>";
  73. } else {
  74. $CheckUserSend = "<button type='button' class='btn btn-success btn-sm' onClick=\"location='content_sg_list.php?cid={$cid}&channelid={$channelid}&dopost=listArchives&arcrank=-1';\">稿件审核</button>";
  75. }
  76. $query = "SELECT arc.aid,arc.aid as id,arc.typeid,arc.arcrank,arc.flag,arc.senddate,arc.channel,arc.title,arc.mid,arc.click,tp.typename,ch.typename as channelname FROM `$listtable` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel $whereSql ORDER BY arc.aid DESC";
  77. $dlist = new DataListCP();
  78. $dlist->pagesize = 30;
  79. $dlist->SetParameter("dopost", "listArchives");
  80. $dlist->SetParameter("keyword", $keyword);
  81. $dlist->SetParameter("cid", $cid);
  82. $dlist->SetParameter("channelid", $channelid);
  83. $strTimerange = "";
  84. if ($stime > 0 && $etime > 0) {
  85. $strTimerange = implode(" - ",array(MyDate("Y-m-d H:i:s",$stime),MyDate("Y-m-d H:i:s",$etime)));
  86. $dlist->SetParameter('timerange', $strTimerange);
  87. }
  88. $dlist->SetTemplate(DEDEADMIN."/templets/content_sg_list.htm");
  89. $dlist->SetSource($query);
  90. $dlist->Display();
  91. $dlist->Close();
  92. ?>