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

71 lines
3.0KB

  1. <?php
  2. if (!defined('DEDEINC')) exit ('dedebiz');
  3. /**
  4. * 动态模板文档列表标签
  5. *
  6. * @version $id:plus_userarclist.php tianya $
  7. * @package DedeBIZ.Tpllib
  8. * @copyright Copyright (c) 2023 DedeBIZ.COM
  9. * @license GNU GPL v2 (https://www.dedebiz.com/license)
  10. * @link https://www.dedebiz.com
  11. */
  12. function plus_userarclist(&$atts, &$refObj, &$fields)
  13. {
  14. global $dsql,$_vars;
  15. $attlist = "channel=1,titlelen=30,infolen=200,row=8,imgwidth=120,imgheight=90";
  16. FillAtts($atts,$attlist);
  17. FillFields($atts,$fields,$refObj);
  18. extract($atts, EXTR_OVERWRITE);
  19. $sql = "SELECT arc.*,mt.mtypename,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,
  20. tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
  21. FROM `#@__archives` arc
  22. LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id
  23. LEFT JOIN `#@__mtypes` mt ON mt.mtypeid=arc.mtype
  24. WHERE arc.mid='{$_vars['mid']}' AND arc.channel=$channel AND arc.arcrank=0
  25. ORDER BY id DESC LIMIT 0,$row";
  26. $dsql->SetQuery($sql);
  27. $dsql->Execute("ul");
  28. $rearr = array();
  29. while($row = $dsql->GetArray("ul"))
  30. {
  31. //处理一些特殊字段
  32. $row['infos'] = cn_substr($row['description'],$infolen);
  33. $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],
  34. $row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']);
  35. $row['typeurl'] = GetTypeUrl($row['typeid'],$row['typedir'],$row['isdefault'],$row['defaultname'],$row['ispart'],
  36. $row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']);
  37. if($row['litpic']=='') $row['litpic'] = '/images/defaultpic.gif';
  38. if(!preg_match("#^(http|https):\/\/#i", $row['litpic']))
  39. {
  40. $row['picname'] = $row['litpic'] = $GLOBALS['cfg_cmsurl'].$row['litpic'];
  41. } else {
  42. $row['picname'] = $row['litpic'];
  43. }
  44. $row['stime'] = GetDateMK($row['pubdate']);
  45. $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>";
  46. $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".preg_replace("#['><]#", "", $row['title'])."'>";
  47. $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>";
  48. $row['fulltitle'] = $row['title'];
  49. $row['title'] = cn_substr($row['title'],$titlelen);
  50. if($row['color']!='') {
  51. $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>";
  52. }
  53. if(preg_match('#b#', $row['flag']))
  54. {
  55. $row['title'] = "<strong>".$row['title']."</strong>";
  56. }
  57. $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>";
  58. $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
  59. $row['memberurl'] = $GLOBALS['cfg_memberurl'];
  60. $row['templeturl'] = $GLOBALS['cfg_templeturl'];
  61. $rearr[] = $row;
  62. }
  63. $dsql->FreeResult("ul");
  64. return $rearr;
  65. }
  66. ?>