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

76 lines
2.8KB

  1. <?php
  2. /**
  3. * 单表模型内容列表
  4. *
  5. * @version $Id: content_sg_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,typename,addtable FROM `#@__channeltype` WHERE id='$channelid'; ");
  27. if (!is_array($cInfos)) {
  28. ShowMsg('模型不存在', '-1');
  29. exit();
  30. }
  31. $arcsta = $cInfos['arcsta'];
  32. //禁止访问无权限的模型
  33. if ($cInfos['usertype'] != '' && $cInfos['usertype'] != $cfg_ml->M_MbType) {
  34. ShowMsg('您无权限访问该部分', '-1');
  35. exit();
  36. }
  37. if ($cid == 0) {
  38. $positionname = $cInfos['typename']." &gt;&gt; ";
  39. } else {
  40. $positionname = str_replace($cfg_list_symbol, " &gt;&gt; ", $tl->GetPositionName())." &gt;&gt; ";
  41. }
  42. $whereSql = " WHERE arc.channel = '$channelid' AND arc.mid='$mid' ";
  43. if ($keyword != '') {
  44. $keyword = cn_substr(trim(preg_replace("#[><\|\"\r\n\t%\*\.\?\(\)\$ ;,'%-]#", "", stripslashes($keyword))), 30);
  45. $keyword = addslashes($keyword);
  46. $whereSql .= " AND (arc.title like '%$keyword%') ";
  47. }
  48. if ($cid != 0) {
  49. $whereSql .= " AND arc.typeid in (".GetSonIds($cid).")";
  50. }
  51. if ($arcrank == '1') {
  52. $whereSql .= " And arc.arcrank >= 0";
  53. } else if ($arcrank == '-1') {
  54. $whereSql .= " And arc.arcrank = -1";
  55. } else if ($arcrank == '-2') {
  56. $whereSql .= " And arc.arcrank = -2";
  57. }
  58. $query = "SELECT arc.aid,arc.aid as id,arc.typeid,arc.senddate,arc.channel,arc.click,arc.title,arc.mid,tp.typename,arc.arcrank
  59. FROM `{$cInfos['addtable']}` arc
  60. LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid
  61. $whereSql
  62. ORDER BY arc.aid desc ";
  63. $dlist = new DataListCP();
  64. $dlist->pageSize = 20;
  65. $dlist->SetParameter("dopost", "listArchives");
  66. $dlist->SetParameter("keyword", $keyword);
  67. $dlist->SetParameter("cid", $cid);
  68. $dlist->SetParameter("channelid", $channelid);
  69. $dlist->SetTemplate(DEDEMEMBER."/templets/content_sg_list.htm");
  70. $dlist->SetSource($query);
  71. $dlist->Display();