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

75 lines
3.0KB

  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. define('DEDEMOB', 'Y');
  13. require_once(dirname(__FILE__)."/../include/common.inc.php");
  14. //$t1 = ExecTime();
  15. $tid = (isset($tid) && is_numeric($tid) ? $tid : 0);
  16. $channelid = (isset($channelid) && is_numeric($channelid) ? $channelid : 0);
  17. if($tid==0 && $channelid==0) die(" Request Error! ");
  18. if(isset($TotalResult)) $TotalResult = intval(preg_replace("/[^\d]/", '', $TotalResult));
  19. //如果指定了内容模型ID但没有指定栏目ID,那么自动获得为这个内容模型的第一个顶级栏目作为频道默认栏目
  20. if(!empty($channelid) && empty($tid))
  21. {
  22. $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");
  23. if(!is_array($tinfos)) die(" No catalogs in the channel! ");
  24. $tid = $tinfos['id'];
  25. }
  26. else
  27. {
  28. $tinfos = $dsql->GetOne("SELECT ch.issystem FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id='$tid' ");
  29. }
  30. if($tinfos['issystem']==-1)
  31. {
  32. $nativeplace = ( (empty($nativeplace) || !is_numeric($nativeplace)) ? 0 : $nativeplace );
  33. $infotype = ( (empty($infotype) || !is_numeric($infotype)) ? 0 : $infotype );
  34. if(!empty($keyword)) $keyword = FilterSearch($keyword);
  35. $cArr = array();
  36. if(!empty($nativeplace)) $cArr['nativeplace'] = $nativeplace;
  37. if(!empty($infotype)) $cArr['infotype'] = $infotype;
  38. if(!empty($keyword)) $cArr['keyword'] = $keyword;
  39. include(DEDEINC."/arc.sglistview.class.php");
  40. $lv = new SgListView($tid,$cArr);
  41. } else {
  42. include(DEDEINC."/arc.listview.class.php");
  43. $lv = new ListView($tid);
  44. //对设置了会员级别的栏目进行处理
  45. if(isset($lv->Fields['corank']) && $lv->Fields['corank'] > 0)
  46. {
  47. require_once(DEDEINC.'/memberlogin.class.php');
  48. $cfg_ml = new MemberLogin();
  49. if( $cfg_ml->M_Rank < $lv->Fields['corank'] )
  50. {
  51. $dsql->Execute('me' , "SELECT * FROM `#@__arcrank` ");
  52. while($row = $dsql->GetObject('me'))
  53. {
  54. $memberTypes[$row->rank] = $row->membername;
  55. }
  56. $memberTypes[0] = "游客或没权限会员";
  57. $msgtitle = "你没有权限浏览栏目:{$lv->Fields['typename']} !";
  58. $moremsg = "这个栏目需要 <font color='red'>".$memberTypes[$lv->Fields['corank']]."</font> 才能访问,你目前是:<font color='red'>".$memberTypes[$cfg_ml->M_Rank]."</font> !";
  59. include_once(DEDETEMPLATE.'/plus/view_msg_catalog.htm');
  60. exit();
  61. }
  62. }
  63. }
  64. if($lv->IsError) ParamError();
  65. $lv->Display();