国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

100 Zeilen
3.4KB

  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 - 2020, 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. 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. {
  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. {
  38. ShowMsg('你无权限访问该部分', '-1');
  39. exit();
  40. }
  41. if($cid==0)
  42. {
  43. $row = $tl->dsql->GetOne("Select typename From #@__channeltype where id='$channelid'");
  44. if(is_array($row))
  45. {
  46. $positionname = $row['typename'];
  47. }
  48. }
  49. else
  50. {
  51. $positionname = str_replace($cfg_list_symbol,"",$tl->GetPositionName())." ";
  52. }
  53. $whereSql = " where arc.channel = '$channelid' And arc.mid='$mid' ";
  54. if($keyword!='')
  55. {
  56. $keyword = cn_substr(trim(preg_replace("#[><\|\"\r\n\t%\*\.\?\(\)\$ ;,'%-]#", "", stripslashes($keyword))),30);
  57. $keyword = addslashes($keyword);
  58. $whereSql .= " And (arc.title like '%$keyword%') ";
  59. }
  60. if($cid!=0) $whereSql .= " And arc.typeid in (".GetSonIds($cid).")";
  61. //增加分类查询
  62. if($arcrank == '1'){
  63. $whereSql .= " And arc.arcrank >= 0";
  64. }else if($arcrank == '-1'){
  65. $whereSql .= " And arc.arcrank = -1";
  66. }else if($arcrank == '-2'){
  67. $whereSql .= " And arc.arcrank = -2";
  68. }
  69. $classlist = '';
  70. $dsql->SetQuery("SELECT * FROM `#@__mtypes` WHERE `mid` = '$cfg_ml->M_ID';");
  71. $dsql->Execute();
  72. while ($row = $dsql->GetArray())
  73. {
  74. $classlist .= "<option value='content_list.php?channelid=".$channelid."&mtypesid=".$row['mtypeid']."'>".$row['mtypename']."</option>\r\n";
  75. }
  76. if($mtypesid != 0 )
  77. {
  78. $whereSql .= " And arc.mtype = '$mtypesid'";
  79. }
  80. $query = "select arc.id,arc.typeid,arc.senddate,arc.flag,arc.ismake,arc.channel,arc.arcrank,
  81. arc.click,arc.title,arc.color,arc.litpic,arc.pubdate,arc.mid,tp.typename,ch.typename as channelname
  82. from `#@__archives` arc
  83. left join `#@__arctype` tp on tp.id=arc.typeid
  84. left join `#@__channeltype` ch on ch.id=arc.channel
  85. $whereSql order by arc.senddate desc ";
  86. $dlist = new DataListCP();
  87. $dlist->pageSize = 20;
  88. $dlist->SetParameter("dopost","listArchives");
  89. $dlist->SetParameter("keyword",$keyword);
  90. $dlist->SetParameter("cid",$cid);
  91. $dlist->SetParameter("channelid",$channelid);
  92. $dlist->SetTemplate(DEDEMEMBER."/templets/content_list.htm");
  93. $dlist->SetSource($query);
  94. $dlist->Display();