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

111 lines
5.8KB

  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. {
  40. $ids[] = $row['id'];
  41. //处理一些特殊字段
  42. $row['info'] = $row['infos'] = cn_substr($row['description'],$infolen);
  43. $row['id'] = $row['id'];
  44. if ($row['corank'] > 0 && $row['arcrank']==0)
  45. {
  46. $row['arcrank'] = $row['corank'];
  47. }
  48. $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],
  49. $row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']);
  50. $row['typeurl'] = GetTypeUrl($row['typeid'],$row['typedir'],$row['isdefault'],$row['defaultname'],$row['ispart'],
  51. $row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']);
  52. if ($row['litpic'] == '-' || $row['litpic'] == '')
  53. {
  54. $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg';
  55. }
  56. if (!preg_match("#^http:\/\/#", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y')
  57. {
  58. $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic'];
  59. }
  60. $row['picname'] = $row['litpic'];
  61. $row['stime'] = GetDateMK($row['pubdate']);
  62. $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>";
  63. $row['image'] = "<img src='".$row['picname']."' width='$imgwidth' height='$imgheight' title='".preg_replace("#['><]#", "", $row['title'])."'>";
  64. $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>";
  65. $row['fulltitle'] = $row['title'];
  66. $row['title'] = cn_substr($row['title'],$titlelen);
  67. if ($row['color']!='') $row['title'] = "<span style='color:".$row['color']."'>".$row['title']."</span>";
  68. if (preg_match('#b#', $row['flag'])) $row['title'] = "".$row['title']."";
  69. //$row['title'] = "".$row['title']."";
  70. $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>";
  71. $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
  72. $row['memberurl'] = $GLOBALS['cfg_memberurl'];
  73. $row['templeturl'] = $GLOBALS['cfg_templeturl'];
  74. if (is_array($dtp2->CTags))
  75. {
  76. foreach($dtp2->CTags as $k=>$ctag)
  77. {
  78. if ($ctag->GetName()=='array')
  79. {
  80. //传递整个数组,在runphp模式中有特殊作用
  81. $dtp2->Assign($k,$row);
  82. } else {
  83. if (isset($row[$ctag->GetName()])) $dtp2->Assign($k,$row[$ctag->GetName()]);
  84. else $dtp2->Assign($k,'');
  85. }
  86. }
  87. $GLOBALS['autoindex']++;
  88. }
  89. $artlist .= $dtp2->GetResult()."\r\n";
  90. }//if hasRow
  91. else {
  92. $artlist .= '';
  93. }
  94. if ($col>1) $artlist .= " </td>\r\n";
  95. }//Loop Col
  96. if ($col>1) $i += $col - 1;
  97. if ($col>1) $artlist .= " </tr>\r\n";
  98. }//loop line
  99. if ($col>1) $artlist .= " </table>\r\n";
  100. $dsql->FreeResult("al");
  101. } else {
  102. //处理分页字段
  103. $artlist .= '<div id="page_'.$tagid.'">';
  104. $artlist .= multipage($totalnum, $pnum, $row['pagesize'], $tagid);
  105. $artlist .= '</div>';
  106. }
  107. }
  108. AjaxHead();
  109. echo $artlist;
  110. exit();
  111. ?>