function GetAddField($aid,$addField)
{
global $dsql;
$row = $dsql->GetOne("SELECT c.addtable FROM 58pic_archives AS a LEFT JOIN 58pic_channeltype AS c ON a.channel=c.id where a.id='$aid'");
$addtable = trim($row['addtable']);
$row = $dsql->GetOne("SELECT $addField FROM `$addtable` WHERE aid=$aid");
return $row["$addField"];
}
1
2
3
4
5
6
7
8
search.htm 搜索结果页模板调用标签
[field:id function=GetAddField(@me,"自定义字段名")/]
1
什么?不喜欢添加自定义方法,那就直接用runphp吧
[field:id runphp=yes]global $dsql;$row = $dsql->GetOne("SELECT c.addtable FROM 58pic_archives AS a LEFT JOIN 58pic_channeltype AS c ON a.channel=c.id where a.id=@me");$result = $dsql->GetOne("SELECT body FROM `$row[addtable]` WHERE aid=@me");@me = cn_substr(html2text($result['body']),500);[/field:id]