include/extend.func.php里添加函数
function GetTopTags($str){
$dsql = new Dedesql(false);
$row = $dsql->GetOne("
SELECT t.aid,t.tag,a.id,a.title,a.description FROM dede_taglist as t left join dede_archives a on t.aid = a.id where t.tag='$str' LIMIT 0 , 1");
return $row[description];
}
function GetTagId($str){
$dsql = new Dedesql(false);
$row = $dsql->GetOne("select tid from dede_taglist where tag='$str' limit 0,1");
return $row[tid];
}
模板页调用
{dede:field name='title' function=GetTagId('@me')/}
可能需要在页面头部加载函数页(比如tags.php)
require_once (dirname(__FILE__) . "/include/extend.func.php");
(dede5.6下测试通过。)