帝国CMS内容页模板调用当前信息作者会员相关信息

MoBan5源码 | 2021-05-19 11:44:33 |
帝国cms模板内容页调用当前会员投稿相关信息,比如发布者名称,发布者头像。

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

<?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内容页模板调用当前信息作者会员相关信息的方法。
 


标签:内容页模板 会员信息