帝国cms模板ref="https://xwenw.com/tag/%e5%86%85%e5%ae%b9" target="_blank">内容页调用当前会员投稿相关信息,比如发布者名称,发布者头像

只需要在模板相应位置加入对应的代码即可,具体样式可以根据自己实际情况进行修改,当没有上传头像时显示默认头像图片。

<?php
$userid=$navinfor[userid];
$userinfo=sys_ShowMemberInfo($userid,'');
?>

当前发布者头像:<a rel="nofollow" href="[!–news.url–]e/space/?userid=<?=$userinfo[userid]?>" target="_blank"><img src="<?=$userinfo[userpic]?$userinfo[userpic]:$public_r[newsurl].'e/data/images/nouserpic.gif'?>"></a>

当前发布者名称:<a rel="nofollow" href="[!–news.url–]e/space/?userid=<?=$userinfo[userid]?>" target="_blank"><?=$userinfo[username]?></a>

会员信息调用ShowMemberInfo函数,格式为:sys_ShowMemberInfo(用户ID,查询字段)。

以上就是帝国CMS内容页模板调用当前信息作者会员相关信息的方法。

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。