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

60 lines
3.2KB

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