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

62 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. $mod = (isset($mod) && is_numeric($mod) ? $mod : 0);
  15. $channelid = (isset($channelid) && is_numeric($channelid) ? $channelid : 0);
  16. if ($tid == 0 && $channelid == 0) die("dedebiz");
  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."/archive/sglistview.class.php");
  35. $lv = new SgListView($tid, $cArr, $mod);
  36. } else {
  37. include(DEDEINC."/archive/listview.class.php");
  38. $lv = new ListView($tid, 1, $mod);
  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 class='text-primary'>".$memberTypes[$lv->Fields['corank']]."</span>才能浏览,您目前等级是<span class='text-primary'>".$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:#f8d7da;border-color:#f5c6cb;position:relative;padding:.75rem 1.25rem;border:1px solid transparent;border-radius:.5rem'>页面加载总消耗时间:{$queryTime}</div>\r\n";
  61. }
  62. ?>