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

110 lines
5.7KB

  1. <?php
  2. require_once(dirname(__FILE__)."/../system/common.inc.php");
  3. require_once(DEDEINC.'/channelunit.class.php');
  4. require_once(DEDEINC.'/taglib/arcpagelist.lib.php');
  5. $mtype = empty($mtype)? 0 : intval(preg_replace("/[^\d]/",'', $mtype));
  6. $pnum = empty($pnum)? 0 : intval(preg_replace("/[^\d]/",'', $pnum));
  7. $tagid = empty($tagid)? '' : (preg_replace("/[^a-z0-9]/",'', $tagid));
  8. if ($tagid=='' || $pnum==0) die("dedebiz");
  9. if ($tagid !='')
  10. {
  11. $row = $dsql->GetOne("SELECT * FROM `#@__arcmulti` WHERE tagid='$tagid'");
  12. $ids = explode(',', $row['arcids']);
  13. $totalnum = $line = count($ids);
  14. //取出属性并解析为变量
  15. $attarray = unserialize($row['attstr']);
  16. extract($attarray, EXTR_SKIP);
  17. $artlist = '';
  18. //通过页面及总数解析当前页面数据范围
  19. $strnum = ($pnum-1) * $row['pagesize'];
  20. $limitsql = " LIMIT $strnum,{$row['pagesize']} ";
  21. if ($mtype == 0)
  22. {
  23. //处理列表文档项
  24. $query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath {$row['addfieldsSql']} FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id {$row['addfieldsSqlJoin']} WHERE arc.id IN({$row['arcids']}) {$row['ordersql']} $limitsql";
  25. $dsql->SetQuery($query);
  26. $dsql->Execute('al');
  27. $dtp2 = new DedeTagParse();
  28. $dtp2->SetNameSpace('field', '[', ']');
  29. $dtp2->LoadString($row['innertext']);
  30. $GLOBALS['autoindex'] = 0;
  31. $ids = array();
  32. for ($i=0; $i<$line; $i++)
  33. {
  34. if ($col>1) $artlist .= "<tr>\r\n";
  35. for ($j=0; $j<$col; $j++)
  36. {
  37. if ($col>1) $artlist .= "<td width='$colWidth'>\r\n";
  38. if ($row = $dsql->GetArray("al")) {
  39. $ids[] = $row['id'];
  40. //处理一些特殊字段
  41. $row['info'] = $row['infos'] = cn_substr($row['description'],$infolen);
  42. $row['id'] = $row['id'];
  43. if ($row['corank'] > 0 && $row['arcrank']==0)
  44. {
  45. $row['arcrank'] = $row['corank'];
  46. }
  47. $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],
  48. $row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']);
  49. $row['typeurl'] = GetTypeUrl($row['typeid'],$row['typedir'],$row['isdefault'],$row['defaultname'],$row['ispart'],
  50. $row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']);
  51. if ($row['litpic'] == '-' || $row['litpic'] == '')
  52. {
  53. $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg';
  54. }
  55. if (!preg_match("#^http:\/\/#", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y')
  56. {
  57. $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic'];
  58. }
  59. $row['picname'] = $row['litpic'];
  60. $row['stime'] = GetDateMK($row['pubdate']);
  61. $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>";
  62. $row['image'] = "<img src='".$row['picname']."' width='$imgwidth' height='$imgheight' title='".preg_replace("#['><]#", "", $row['title'])."'>";
  63. $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>";
  64. $row['fulltitle'] = $row['title'];
  65. $row['title'] = cn_substr($row['title'],$titlelen);
  66. if ($row['color']!='') $row['title'] = "<span style='color:".$row['color']."'>".$row['title']."</span>";
  67. if (preg_match('#b#', $row['flag'])) $row['title'] = "".$row['title']."";
  68. //$row['title'] = "".$row['title']."";
  69. $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>";
  70. $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
  71. $row['memberurl'] = $GLOBALS['cfg_memberurl'];
  72. $row['templeturl'] = $GLOBALS['cfg_templeturl'];
  73. if (is_array($dtp2->CTags))
  74. {
  75. foreach($dtp2->CTags as $k=>$ctag)
  76. {
  77. if ($ctag->GetName()=='array')
  78. {
  79. //传递整个数组,在runphp模式中有特殊作用
  80. $dtp2->Assign($k,$row);
  81. } else {
  82. if (isset($row[$ctag->GetName()])) $dtp2->Assign($k,$row[$ctag->GetName()]);
  83. else $dtp2->Assign($k,'');
  84. }
  85. }
  86. $GLOBALS['autoindex']++;
  87. }
  88. $artlist .= $dtp2->GetResult()."\r\n";
  89. }//if hasRow
  90. else {
  91. $artlist .= '';
  92. }
  93. if ($col>1) $artlist .= " </td>\r\n";
  94. }//Loop Col
  95. if ($col>1) $i += $col - 1;
  96. if ($col>1) $artlist .= " </tr>\r\n";
  97. }//loop line
  98. if ($col>1) $artlist .= " </table>\r\n";
  99. $dsql->FreeResult("al");
  100. } else {
  101. //处理分页字段
  102. $artlist .= '<div id="page_'.$tagid.'">';
  103. $artlist .= multipage($totalnum, $pnum, $row['pagesize'], $tagid);
  104. $artlist .= '</div>';
  105. }
  106. }
  107. AjaxHead();
  108. echo $artlist;
  109. exit();
  110. ?>