{dede:tag row='8' getall='1' sort='month'} 支持属性 row|30 行数 sort|new 排序 getall|0 调用类型 可以查看/include/taglib/tag.lib.php
2、列表页调用每一篇文章的tag标签
[field:id runphp=yes] $tsql = new DedeSql(false); $tags = ''; $tsql->SetQuery("Select i.tag From ying_taglist t left join ying_tagindex i on i.id=t.tid where t.aid='@me'"); $tsql->Execute('t'); while($row = $tsql->GetArray('t',MYSQL_ASSOC)){ $tags .= "<a href='/tags.php?/".urlencode($row['tag'])."'>".$row['tag']."</a>"; } @me=$tags;[/field:id] |
//获得某文档的所有tagfunction GetTags($aid){ global $dsql; $tags = ''; $query = "Select tag From `ying_taglist` where aid='$aid' "; $dsql->Execute('tag',$query); while($row = $dsql->GetArray('tag')) { $tags .= ($tags=='' ? $row['tag'] : ','.$row['tag']); } return $tags;} |
//获得某文档的所有tagfunction GetTags($aid){ global $dsql; $tags = ''; $query = "Select tag From `dede_taglist` where aid='$aid' "; $dsql->Execute('tag',$query); while($row = $dsql->GetArray('tag')) { $tags.= ($tags=='' ? "<a href=/tags.php?/{$row['tag']} target=_blank>{$row['tag']}</a>" : ','."<a href=/tags.php?/{$row['tag']} target=_blank>{$row['tag']}</a>"); } return $tags;} |
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!