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

78 lines
3.3KB

  1. <?php
  2. /**
  3. *
  4. * 栏目列表/频道动态页
  5. *
  6. * @version $Id: list.php 1 15:38 2010年7月8日Z tianya $
  7. * @package DedeCMS.Site
  8. * @copyright Copyright (c) 2007 - 2020, DesDev, Inc.
  9. * @license http://help.dedecms.com/usersguide/license.html
  10. * @link http://www.dedecms.com
  11. */
  12. require_once(dirname(__FILE__)."/../include/common.inc.php");
  13. $t1 = ExecTime();
  14. $tid = (isset($tid) && is_numeric($tid) ? $tid : 0);
  15. $channelid = (isset($channelid) && is_numeric($channelid) ? $channelid : 0);
  16. if($tid==0 && $channelid==0) die(" Request Error! ");
  17. if(isset($TotalResult)) $TotalResult = intval(preg_replace("/[^\d]/", '', $TotalResult));
  18. //如果指定了内容模型ID但没有指定栏目ID,那么自动获得为这个内容模型的第一个顶级栏目作为频道默认栏目
  19. if(!empty($channelid) && empty($tid))
  20. {
  21. $tinfos = $dsql->GetOne("SELECT tp.id,ch.issystem FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.channeltype='$channelid' And tp.reid=0 order by sortrank asc");
  22. if(!is_array($tinfos)) die(" No catalogs in the channel! ");
  23. $tid = $tinfos['id'];
  24. }
  25. else
  26. {
  27. $tinfos = $dsql->GetOne("SELECT ch.issystem FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id='$tid' ");
  28. }
  29. if($tinfos['issystem']==-1)
  30. {
  31. $nativeplace = ( (empty($nativeplace) || !is_numeric($nativeplace)) ? 0 : $nativeplace );
  32. $infotype = ( (empty($infotype) || !is_numeric($infotype)) ? 0 : $infotype );
  33. if(!empty($keyword)) $keyword = FilterSearch($keyword);
  34. $cArr = array();
  35. if(!empty($nativeplace)) $cArr['nativeplace'] = $nativeplace;
  36. if(!empty($infotype)) $cArr['infotype'] = $infotype;
  37. if(!empty($keyword)) $cArr['keyword'] = $keyword;
  38. include(DEDEINC."/arc.sglistview.class.php");
  39. $lv = new SgListView($tid,$cArr);
  40. } else {
  41. include(DEDEINC."/arc.listview.class.php");
  42. $lv = new ListView($tid);
  43. //对设置了会员级别的栏目进行处理
  44. if(isset($lv->Fields['corank']) && $lv->Fields['corank'] > 0)
  45. {
  46. require_once(DEDEINC.'/memberlogin.class.php');
  47. $cfg_ml = new MemberLogin();
  48. if( $cfg_ml->M_Rank < $lv->Fields['corank'] )
  49. {
  50. $dsql->Execute('me' , "SELECT * FROM `#@__arcrank` ");
  51. while($row = $dsql->GetObject('me'))
  52. {
  53. $memberTypes[$row->rank] = $row->membername;
  54. }
  55. $memberTypes[0] = "游客或没权限会员";
  56. $msgtitle = "你没有权限浏览栏目:{$lv->Fields['typename']} !";
  57. $moremsg = "这个栏目需要 <font color='red'>".$memberTypes[$lv->Fields['corank']]."</font> 才能访问,你目前是:<font color='red'>".$memberTypes[$cfg_ml->M_Rank]."</font> !";
  58. include_once(DEDETEMPLATE.'/plus/view_msg_catalog.htm');
  59. exit();
  60. }
  61. }
  62. }
  63. if($lv->IsError) ParamError();
  64. $lv->Display();
  65. if (DEBUG_LEVEL===TRUE) {
  66. $queryTime = ExecTime() - $t1;
  67. echo "<div style='width:98%;margin:1rem auto;color: #721c24;background-color: #f8d7da;border-color: #f5c6cb;position: relative;padding: .75rem 1.25rem;border: 1px solid transparent;border-radius: .25rem;'>页面加载总消耗时间:<b>{$queryTime}</b></div>\r\n";
  68. }