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

101 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 DedeCMS.Administrator
  7. * @copyright Copyright (c) 2007 - 2019, DesDev, Inc.
  8. * @license http://help.dedecms.com/usersguide/license.html
  9. * @link http://www.dedecms.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. {
  19. ShowMsg("该页面必须指定栏目ID或内容模型ID才能浏览!","javascript:;");
  20. exit();
  21. }
  22. //检查权限许可,总权限
  23. CheckPurview('a_List,a_AccList,a_MyList');
  24. //栏目浏览许可
  25. if(TestPurview('a_List'))
  26. {
  27. }
  28. else if(TestPurview('a_AccList'))
  29. {
  30. if($cid==0)
  31. {
  32. $ucid = $cid = $cuserLogin->getUserChannel();
  33. }
  34. else
  35. {
  36. CheckCatalog($cid,"你无权浏览非指定栏目的内容!");
  37. }
  38. }
  39. $adminid = $cuserLogin->getUserID();
  40. $maintable = '#@__archives';
  41. require_once(DEDEINC."/typelink.class.php");
  42. require_once(DEDEINC."/datalistcp.class.php");
  43. require_once(DEDEADMIN."/inc/inc_list_functions.php");
  44. setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
  45. $tl = new TypeLink($cid);
  46. $listtable = trim($tl->TypeInfos['addtable']);
  47. if( !empty($channelid) && !empty($ucid) && $tl->TypeInfos['channeltype'] != $channelid)
  48. {
  49. ShowMsg('你没权限访问此页!','javascript:;');
  50. exit();
  51. }
  52. if($cid==0)
  53. {
  54. $row = $tl->dsql->GetOne("SELECT typename,addtable FROM `#@__channeltype` WHERE id='$channelid'");
  55. $positionname = $row['typename']." &gt; ";
  56. $listtable = $row['addtable'];
  57. }
  58. else
  59. {
  60. $positionname = str_replace($cfg_list_symbol, " &gt; ", $tl->GetPositionName())." &gt; ";
  61. }
  62. $optionarr = $tl->GetOptionArray($cid, $admin_catalogs, $channelid);
  63. $whereSql = $channelid==0 ? " WHERE arc.channel < -1 " : " WHERE arc.channel = '$channelid' ";
  64. if(!empty($mid)) $whereSql .= " AND arc.mid = '$mid' ";
  65. if($keyword!='') $whereSql .= " AND (arc.title like '%$keyword%') ";
  66. if($cid!=0) $whereSql .= " AND arc.typeid in (".GetSonIds($cid).")";
  67. if($arcrank!='')
  68. {
  69. $whereSql .= " AND arc.arcrank = '$arcrank' ";
  70. $CheckUserSend = "<input type='button' class='coolbg np' onClick=\"location='content_sg_list.php?cid={$cid}&channelid={$channelid}&dopost=listArchives';\" value='所有文档' />";
  71. }
  72. else
  73. {
  74. $CheckUserSend = "<input type='button' class='coolbg np' onClick=\"location='content_sg_list.php?cid={$cid}&channelid={$channelid}&dopost=listArchives&arcrank=-1';\" value='稿件审核' />";
  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
  77. FROM `$listtable` arc
  78. LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid
  79. LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel
  80. $whereSql
  81. ORDER BY arc.aid DESC";
  82. $dlist = new DataListCP();
  83. $dlist->pageSize = 20;
  84. $dlist->SetParameter("dopost", "listArchives");
  85. $dlist->SetParameter("keyword", $keyword);
  86. $dlist->SetParameter("cid", $cid);
  87. $dlist->SetParameter("channelid", $channelid);
  88. $dlist->SetTemplate(DEDEADMIN."/templets/content_sg_list.htm");
  89. $dlist->SetSource($query);
  90. $dlist->Display();
  91. $dlist->Close();