一、织梦arclist及list调用TAG标签代码为:
[field:id runphp='yes']
global $cfg_cmspath;
$tags = GetTags(@me);
$revalue = '';
$tags = explode(',', $tags);
foreach($tags as $key => $value){
if($value){
$revalue .= '<a href="'.$cfg_cmspath.'/tags.php?/'.$value.'/">'.$value.'</a> ';
}
}
@me = $revalue;
[/field:id]
或:
[field:id function=GetTags(@me)/]
二、处理过TAG静态化后,那么织梦arclist及list调用TAG标签代码则为:
单链接拼音版 - /tags/pinyin.html
[field:id runphp=yes]
global $dsql;
$tags = '';
$query = "SELECT tag FROM `dede_taglist` WHERE aid='@me' ";
$dsql->Execute('tag',$query);
while($row = $dsql->GetArray('tag'))
{
$tags .= "<a href='/tag/".GetPinyin($row['tag']).".html'>".$row['tag']."</a>";
}
@me=$tags;
[/field:id]
单链接id版 - /tags/id.html
[field:id runphp=yes]
global $dsql;
$tags = '';
$query = "SELECT tag FROM `dede_taglist` WHERE aid='@me' ";
$dsql->Execute('tag',$query);
while($row = $dsql->GetArray('tag'))
{
$tags .= "<a href='/tags/{$row['tid']}.html'>".$row['tag']."</a>";
}
@me=$tags;
[/field:id]
扩展阅读:
DedeCms织梦tag标签静态生成+url拼音+分页优化(支持手机版tag自动生成)