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

72 lines
3.2KB

  1. <?php
  2. /**
  3. *
  4. * 栏目列表/频道动态页
  5. *
  6. * @version $Id: list.php$
  7. * @package DedeBIZ.Site
  8. * @copyright Copyright (c) 2022, DedeBIZ.COM
  9. * @license https://www.dedebiz.com/license
  10. * @link https://www.dedebiz.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. $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");
  21. if (!is_array($tinfos)) die(" No catalogs in the channel! ");
  22. $tid = $tinfos['id'];
  23. } else {
  24. $tinfos = $dsql->GetOne("SELECT ch.issystem FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id='$tid' ");
  25. }
  26. if ($tinfos['issystem'] == -1) {
  27. $nativeplace = ((empty($nativeplace) || !is_numeric($nativeplace)) ? 0 : $nativeplace);
  28. $infotype = ((empty($infotype) || !is_numeric($infotype)) ? 0 : $infotype);
  29. if (!empty($keyword)) $keyword = FilterSearch($keyword);
  30. $cArr = array();
  31. if (!empty($nativeplace)) $cArr['nativeplace'] = $nativeplace;
  32. if (!empty($infotype)) $cArr['infotype'] = $infotype;
  33. if (!empty($keyword)) $cArr['keyword'] = $keyword;
  34. include(DEDEINC."/arc.sglistview.class.php");
  35. $lv = new SgListView($tid, $cArr);
  36. } else {
  37. include(DEDEINC."/arc.listview.class.php");
  38. $lv = new ListView($tid);
  39. //对设置了会员级别的栏目进行处理
  40. if (isset($lv->Fields['corank']) && $lv->Fields['corank'] > 0) {
  41. require_once(DEDEINC.'/memberlogin.class.php');
  42. $cfg_ml = new MemberLogin();
  43. if ($cfg_ml->M_Rank < $lv->Fields['corank']) {
  44. $dsql->Execute('me', "SELECT * FROM `#@__arcrank` ");
  45. while ($row = $dsql->GetObject('me')) {
  46. $memberTypes[$row->rank] = $row->membername;
  47. }
  48. $memberTypes[0] = "游客或没权限会员";
  49. $msgtitle = "您没有权限浏览栏目:{$lv->Fields['typename']} ";
  50. $moremsg = "这个栏目需要 <span style='color:#e74d58'>".$memberTypes[$lv->Fields['corank']]."</span> 才能访问,您目前是:<span style='color:#e74d58'>".$memberTypes[$cfg_ml->M_Rank]."</span> ";
  51. include_once(DEDETEMPLATE.'/plus/view_msg_catalog.htm');
  52. exit();
  53. }
  54. }
  55. }
  56. if ($lv->IsError) ParamError();
  57. $lv->Display();
  58. if (DEBUG_LEVEL === TRUE) {
  59. $queryTime = ExecTime() - $t1;
  60. 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";
  61. }