国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

82 satır
2.7KB

  1. <?php
  2. /**
  3. * 单表模型内容列表
  4. *
  5. * @version $Id: content_sg_list.php 1 13:52 2010年7月9日Z tianya $
  6. * @package DedeCMS.Member
  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. 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. {
  29. ShowMsg('模型不存在', '-1');
  30. exit();
  31. }
  32. $arcsta = $cInfos['arcsta'];
  33. //禁止访问无权限的模型
  34. if($cInfos['usertype'] !='' && $cInfos['usertype']!=$cfg_ml->M_MbType)
  35. {
  36. ShowMsg('你无权限访问该部分', '-1');
  37. exit();
  38. }
  39. if($cid==0)
  40. {
  41. $positionname = $cInfos['typename']." &gt;&gt; ";
  42. }
  43. else
  44. {
  45. $positionname = str_replace($cfg_list_symbol," &gt;&gt; ",$tl->GetPositionName())." &gt;&gt; ";
  46. }
  47. $whereSql = " WHERE arc.channel = '$channelid' AND arc.mid='$mid' ";
  48. if($keyword!='')
  49. {
  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)
  55. {
  56. $whereSql .= " AND arc.typeid in (".GetSonIds($cid).")";
  57. }
  58. if ($arcrank == '1') {
  59. $whereSql .= " And arc.arcrank >= 0";
  60. } else if ($arcrank == '-1') {
  61. $whereSql .= " And arc.arcrank = -1";
  62. } else if ($arcrank == '-2') {
  63. $whereSql .= " And arc.arcrank = -2";
  64. }
  65. $query = "SELECT arc.aid,arc.aid as id,arc.typeid,arc.senddate,arc.channel,arc.click,arc.title,arc.mid,tp.typename,arc.arcrank
  66. FROM `{$cInfos['addtable']}` arc
  67. LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid
  68. $whereSql
  69. ORDER BY arc.aid desc ";
  70. $dlist = new DataListCP();
  71. $dlist->pageSize = 20;
  72. $dlist->SetParameter("dopost","listArchives");
  73. $dlist->SetParameter("keyword",$keyword);
  74. $dlist->SetParameter("cid",$cid);
  75. $dlist->SetParameter("channelid",$channelid);
  76. $dlist->SetTemplate(DEDEMEMBER."/templets/content_sg_list.htm");
  77. $dlist->SetSource($query);
  78. $dlist->Display();