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

73 lines
2.5KB

  1. <?php
  2. /**
  3. * @version $Id: caicai.php 1 8:38 2010年7月9日Z tianya $
  4. * @package DedeCMS.Member
  5. * @copyright Copyright (c) 2007 - 2020, DesDev, Inc.
  6. * @license http://help.dedecms.com/usersguide/license.html
  7. * @link http://www.dedecms.com
  8. */
  9. require_once(dirname(__FILE__)."/config.php");
  10. require_once(DEDEINC."/arc.caicai.class.php");
  11. $sort = trim(empty($sort) ? 'lastpost' : preg_replace("#[^0-9a-z]#i", '', $sort));
  12. if(!preg_match("#^(scores|badpost|goodpost)$#", $sort)) $sort = 'lastpost';
  13. $tid = (isset($tid) ? intval($tid) : 0);
  14. $t1 = ExecTime();
  15. $typequery = '';
  16. $menutype = 'mydede';
  17. $menutype_son = 'cc';
  18. //获取栏目的子类、交叉分类
  19. if($tid!=0)
  20. {
  21. $arr = $dsql->GetOne("SELECT * FROM `#@__arctype` WHERE id='$tid' AND corank=0 ");
  22. if($cfg_list_son=='Y')
  23. {
  24. $CrossID = GetSonIds($tid,$arr['channeltype']);
  25. }
  26. else
  27. {
  28. $CrossID = $tid;
  29. }
  30. if($arr['cross']>0)
  31. {
  32. $selquery = '';
  33. if($arr['cross']==1)
  34. {
  35. $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$arr['typename']}' AND id<>'{$tid}' AND topid<>'{$tid}' ";
  36. }
  37. else
  38. {
  39. $arr['crossid'] = preg_replace("#[^0-9,]#", '', trim($arr['crossid']));
  40. if($arr['crossid']!='')
  41. {
  42. $selquery = "SELECT id,topid FROM `#@__arctype` WHERE id in('{$arr['crossid']}') AND id<>'{$tid}' AND topid<>'{$tid}' ";
  43. }
  44. }
  45. if($selquery!='')
  46. {
  47. $dsql->SetQuery($selquery);
  48. $dsql->Execute();
  49. while($arr = $dsql->GetArray())
  50. {
  51. $CrossID .= ($CrossID=='' ? $arr['id'] : ','.$arr['id']);
  52. }
  53. }
  54. }
  55. $typequery = " arc.typeid in($CrossID) And ";
  56. }
  57. $dlist = new Caicai();
  58. $dlist->pageSize = 15;
  59. $dlist->maxPageSize = 100;
  60. $maxrc = $dlist->pageSize * $dlist->maxPageSize;
  61. $query = "Select arc.*,m.userid,m.face,
  62. tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
  63. From `#@__archives` arc left join `#@__arctype` tp on tp.id=arc.typeid left join `#@__member` m on m.mid=arc.mid
  64. where $typequery arc.arcrank>-1
  65. order by arc.`{$sort}` desc limit $maxrc ";
  66. $dlist->SetParameter('tid',$tid);
  67. $dlist->SetParameter('sort',$sort);
  68. $dlist->SetTemplate(DEDEMEMBER.'/templets/caicai.htm');
  69. $dlist->SetSource($query);
  70. $dlist->Display();
  71. //echo ExecTime() - $t1;
  72. ?>