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

  1. <?php
  2. /**
  3. * 内容列表
  4. *
  5. * @version $Id: content_list.php 1 13:52 2010年7月9日Z tianya $
  6. * @package DedeBIZ.Member
  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. CheckRank(0, 0);
  13. require_once(DEDEINC."/typelink.class.php");
  14. require_once(DEDEINC."/datalistcp.class.php");
  15. require_once(DEDEMEMBER."/inc/inc_list_functions.php");
  16. setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
  17. $cid = isset($cid) && is_numeric($cid) ? $cid : 0;
  18. $channelid = isset($channelid) && is_numeric($channelid) ? $channelid : 0;
  19. $mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0;
  20. if (!isset($keyword)) $keyword = '';
  21. if (!isset($arcrank)) $arcrank = '';
  22. $positionname = '';
  23. $menutype = 'content';
  24. $mid = $cfg_ml->M_ID;
  25. $tl = new TypeLink($cid);
  26. $cInfos = $tl->dsql->GetOne("SELECT arcsta,issend,issystem,usertype FROM `#@__channeltype` WHERE id='$channelid'; ");
  27. if (!is_array($cInfos)) {
  28. ShowMsg('模型不存在', '-1');
  29. exit();
  30. }
  31. $arcsta = $cInfos['arcsta'];
  32. $dtime = time();
  33. $maxtime = $cfg_mb_editday * 24 * 3600;
  34. //禁止访问无权限的模型
  35. if ($cInfos['usertype'] != '' && $cInfos['usertype'] != $cfg_ml->M_MbType) {
  36. ShowMsg('您无权限访问该部分', '-1');
  37. exit();
  38. }
  39. if ($cid == 0) {
  40. $row = $tl->dsql->GetOne("Select typename From #@__channeltype where id='$channelid'");
  41. if (is_array($row)) {
  42. $positionname = $row['typename'];
  43. }
  44. } else {
  45. $positionname = str_replace($cfg_list_symbol, "", $tl->GetPositionName())." ";
  46. }
  47. $whereSql = " where arc.channel = '$channelid' And arc.mid='$mid' ";
  48. if ($keyword != '') {
  49. $keyword = cn_substr(trim(preg_replace("#[><\|\"\r\n\t%\*\.\?\(\)\$ ;,'%-]#", "", stripslashes($keyword))), 30);
  50. $keyword = addslashes($keyword);
  51. $whereSql .= " And (arc.title like '%$keyword%') ";
  52. }
  53. if ($cid != 0) $whereSql .= " And arc.typeid in (".GetSonIds($cid).")";
  54. //增加分类查询
  55. if ($arcrank == '1') {
  56. $whereSql .= " And arc.arcrank >= 0";
  57. } else if ($arcrank == '-1') {
  58. $whereSql .= " And arc.arcrank = -1";
  59. } else if ($arcrank == '-2') {
  60. $whereSql .= " And arc.arcrank = -2";
  61. }
  62. $classlist = '';
  63. $dsql->SetQuery("SELECT * FROM `#@__mtypes` WHERE `mid` = '$cfg_ml->M_ID';");
  64. $dsql->Execute();
  65. while ($row = $dsql->GetArray()) {
  66. $classlist .= "<option value='content_list.php?channelid=".$channelid."&mtypesid=".$row['mtypeid']."'>".$row['mtypename']."</option>\r\n";
  67. }
  68. if ($mtypesid != 0) {
  69. $whereSql .= " And arc.mtype = '$mtypesid'";
  70. }
  71. $query = "SELECT arc.id,arc.typeid,arc.senddate,arc.flag,arc.ismake,arc.channel,arc.arcrank,
  72. arc.click,arc.title,arc.color,arc.litpic,arc.pubdate,arc.mid,tp.typename,ch.typename as channelname
  73. from `#@__archives` arc
  74. left join `#@__arctype` tp on tp.id=arc.typeid
  75. left join `#@__channeltype` ch on ch.id=arc.channel
  76. $whereSql order by arc.senddate desc ";
  77. $dlist = new DataListCP();
  78. $dlist->pageSize = 20;
  79. $dlist->SetParameter("dopost", "listArchives");
  80. $dlist->SetParameter("keyword", $keyword);
  81. $dlist->SetParameter("cid", $cid);
  82. $dlist->SetParameter("channelid", $channelid);
  83. $dlist->SetTemplate(DEDEMEMBER."/templets/content_list.htm");
  84. $dlist->SetSource($query);
  85. $dlist->Display();