最新更新 sitemap 网站制作设计本站搜索
网页设计
国外网站 韩国网站 个人主页 手提袋设计 CSS 网页特效 平面设计 网站设计 Flash CMS技巧 服装网站 php教程 photoshop 画册 服务器选用 数据库 Office
虚拟主机 域名注册 云主机 网页设计 客服QQ:8208442
当前位置:首页 > 网站综合 > CMS系统技巧

dede文章列表页调用TAG标签技巧

日期:07-14    来源:中国设计秀    作者:cnwebshow.com

 9wO中国设计秀

dedecms默认在列表是无法调用tag标签的,经过各位版主们的帮助,现给大家提供出种方法9wO中国设计秀
方法1:9wO中国设计秀
在列表需要的位置加入下列代码9wO中国设计秀

[field:id runphp=yes]9wO中国设计秀
                    $tsql = new DedeSql(false);9wO中国设计秀
    $tags = '';9wO中国设计秀
    $tsql->SetQuery("Select i.tagname From dede_tag_list t left join dede_tag_index i on i.id=t.tid where t.aid='@me'");9wO中国设计秀
    $tsql->Execute('t');9wO中国设计秀
    while($row = $tsql->GetArray('t',MYSQL_ASSOC)){9wO中国设计秀
       $tags .= "<a href='/tag.php?/".urlencode($row['tagname'])."'>".$row['tagname']."</a>";9wO中国设计秀
       9wO中国设计秀
      9wO中国设计秀
    }9wO中国设计秀
    @me=$tags;9wO中国设计秀

                [/field:id] 9wO中国设计秀
 9wO中国设计秀

方法2:9wO中国设计秀
在inc_functions.php文件里加入9wO中国设计秀

function listtag($aid){9wO中国设计秀
    $tsql = new DedeSql(false);9wO中国设计秀
    $tags = '';9wO中国设计秀
    $tsql->SetQuery("Select i.tagname From dede_tag_list t left join dede_tag_index i on i.id=t.tid where t.aid='$aid'");9wO中国设计秀
    $tsql->Execute('t');9wO中国设计秀
    while($row = $tsql->GetArray('t',MYSQL_ASSOC)){9wO中国设计秀
       $tags .= "<a href='/tag.php?/".urlencode($row['tagname'])."'>".$row['tagname']."</a>";9wO中国设计秀
    }9wO中国设计秀
    return $tags;9wO中国设计秀
}9wO中国设计秀

9wO中国设计秀
然后在列表页相应位置加入9wO中国设计秀

[field:ID function="listtag(@me)"/]标记9wO中国设计秀

在这里对无法显示,天工及各位版主的帮助表示感谢9wO中国设计秀

本文引用地址:/site/article_63968.html
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明