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

94 lines
3.5KB

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