学习资料_文档下载_软件应用_程序模板

 找回密码
 立即注册

QQ登录

只需一步,快速开始

手机号码,快捷登录

搜索
查看: 1539|回复: 0

亲测可用,列表页文章页调用本文章的tag

[复制链接]

402

主题

419

帖子

554

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
554
发表于 2021-10-4 10:08:21 | 显示全部楼层 |阅读模式
include/common.func.php
最后面增加如下代码


  1. <P><SPAN style="TEXT-ALIGN: left; WIDOWS: 2; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); FONT-STYLE: normal; TEXT-INDENT: 0px; DISPLAY: inline !important; FONT-FAMILY: 'Microsoft Yahei', 'Helvetica Neue', 'Luxi Sans', 'DejaVu Sans', Tahoma, 'Hiragino Sans GB', STHeiti; WHITE-SPACE: normal; ORPHANS: 2; FLOAT: none; LETTER-SPACING: normal; COLOR: rgb(68,68,68); FONT-SIZE: 14px; FONT-WEIGHT: 400; WORD-SPACING: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"></SPAN> </P><PRE style="WIDOWS: 2; TEXT-TRANSFORM: none; FONT-STYLE: normal; TEXT-INDENT: 0px; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); FONT-WEIGHT: 400; WORD-SPACING: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial">//获得某文档的所有tag [field:id function=GetTags_list(@me)/]{dede:field.id function="GetTags_list(@me)"/}
  2. function GetTags_list($aid)
  3. {
  4.         global $dsql;
  5.         $tags = '';
  6.         $query = "SELECT tag FROM `dede_taglist` WHERE aid='$aid' ";
  7.         $dsql->Execute('tag',$query);
  8.         while($row = $dsql->GetArray('tag'))
  9.         {
  10.                 $tags .= "<a href='/tags.php?/".urlencode($row['tag'])."'>".$row['tag']."</a>";
  11.         }
  12.         return $tags;
  13. }</PRE>
复制代码
列表页调用:
  1. [field:id function=GetTags_list(@me)/]
复制代码
文章页调用:

  1. {dede:field.id function="GetTags_list(@me)"/}
复制代码

此文档仅用于学习交流使用。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

HI223.COM 举报邮箱:345306361@qq.com

GMT+8, 2024-5-18 17:43 , Processed in 0.106617 second(s), 18 queries .

Powered by HI223分享社区 2.3

© 2019-2020 Hi223 All Right Reserved

渝公网安备 50022502000358号

渝ICP备14008270号-3