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

88 lines
3.4KB

  1. <?php
  2. /**
  3. * 单表模型列表
  4. *
  5. * @version $Id: content_sg_list.php 1 14:31 2010年7月12日Z tianya $
  6. * @package DedeBIZ.Administrator
  7. * @copyright Copyright (c) 2020, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__) . "/config.php");
  12. $cid = isset($cid) ? intval($cid) : 0;
  13. $channelid = isset($channelid) ? intval($channelid) : 0;
  14. $mid = isset($mid) ? intval($mid) : 0;
  15. if (!isset($keyword)) $keyword = '';
  16. if (!isset($arcrank)) $arcrank = '';
  17. if (empty($cid) && empty($channelid)) {
  18. ShowMsg("该页面必须指定栏目ID或内容模型ID才能浏览!", "javascript:;");
  19. exit();
  20. }
  21. //检查权限许可,总权限
  22. CheckPurview('a_List,a_AccList,a_MyList');
  23. //栏目浏览许可
  24. if (TestPurview('a_List')) {
  25. } else if (TestPurview('a_AccList')) {
  26. if ($cid == 0) {
  27. $ucid = $cid = $cuserLogin->getUserChannel();
  28. } else {
  29. CheckCatalog($cid, "你无权浏览非指定栏目的内容!");
  30. }
  31. }
  32. $adminid = $cuserLogin->getUserID();
  33. $maintable = '#@__archives';
  34. require_once(DEDEINC . "/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'] . " &gt; ";
  47. $listtable = $row['addtable'];
  48. } else {
  49. $positionname = str_replace($cfg_list_symbol, " &gt; ", $tl->GetPositionName()) . " &gt; ";
  50. }
  51. $optionarr = $tl->GetOptionArray($cid, $admin_catalogs, $channelid);
  52. $whereSql = $channelid == 0 ? " WHERE arc.channel < -1 " : " WHERE arc.channel = '$channelid' ";
  53. if (!empty($mid)) $whereSql .= " AND arc.mid = '$mid' ";
  54. if ($keyword != '') $whereSql .= " AND (arc.title like '%$keyword%') ";
  55. if ($cid != 0) $whereSql .= " AND arc.typeid in (" . GetSonIds($cid) . ")";
  56. if ($arcrank != '') {
  57. $whereSql .= " AND arc.arcrank = '$arcrank' ";
  58. $CheckUserSend = "<button type='button' class='btn btn-secondary btn-sm' onClick=\"location='content_sg_list.php?cid={$cid}&channelid={$channelid}&dopost=listArchives';\">所有文档</button>";
  59. } else {
  60. $CheckUserSend = "<button type='button' class='btn btn-secondary btn-sm' onClick=\"location='content_sg_list.php?cid={$cid}&channelid={$channelid}&dopost=listArchives&arcrank=-1';\">稿件审核</button>";
  61. }
  62. $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
  63. FROM `$listtable` arc
  64. LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid
  65. LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel
  66. $whereSql
  67. ORDER BY arc.aid DESC";
  68. $dlist = new DataListCP();
  69. $dlist->pageSize = 20;
  70. $dlist->SetParameter("dopost", "listArchives");
  71. $dlist->SetParameter("keyword", $keyword);
  72. $dlist->SetParameter("cid", $cid);
  73. $dlist->SetParameter("channelid", $channelid);
  74. $dlist->SetTemplate(DEDEADMIN . "/templets/content_sg_list.htm");
  75. $dlist->SetSource($query);
  76. $dlist->Display();
  77. $dlist->Close();