在内容页模板中统计本文作者的文章总数,用标签的方式实现不需要改动任何程序代码。
{dede:field.writer runphp="yes"}
$writer = @me;
if( empty($writer) )
{
@me = '';
}
else {
$dsql = new DedeSql(false);
$query = "Select count(*) as zpcount from `dede_archives` where writer = '".$writer."';";
$row = $dsql->GetOne($query);
@me = $row['zpcount'];
}
{/dede:field.writer}
复制代码