|
include/common.func.php 最后面增加如下代码
- <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)"/}
- function GetTags_list($aid)
- {
- global $dsql;
- $tags = '';
- $query = "SELECT tag FROM `dede_taglist` WHERE aid='$aid' ";
- $dsql->Execute('tag',$query);
- while($row = $dsql->GetArray('tag'))
- {
- $tags .= "<a href='/tags.php?/".urlencode($row['tag'])."'>".$row['tag']."</a>";
- }
- return $tags;
- }</PRE>
复制代码 列表页调用:
- [field:id function=GetTags_list(@me)/]
复制代码 文章页调用:
- {dede:field.id function="GetTags_list(@me)"/}
复制代码
|
|