您的位置:首页 > 帝国cms教程

帝国CMS内容页模板调用当前信息作者会员相关信息的代码和教程

2020-10-18 18:20:05 帝国cms教程 214
帝国CMS模板内容页调用当前会员投稿相关信息,比如发布者名称,发布者头像。

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

<?php$userid=$navinfor[userid];$userinfo=sys_ShowMemberInfo($userid,'');?>当前发布者头像:<arel="nofollow"href="[!--news.url--]e/space/?userid=<?=$userinfo[userid]?>"target="_blank"><imgsrc="<?=$userinfo[userpic]?$userinfo[userpic]:$public_r[newsurl].'e/data/images/nouserpic.gif'?>"></a>当前发布者名称:<arel="nofollow"href="[!--news.url--]e/space/?userid=<?=$userinfo[userid]?>"target="_blank"><?=$userinfo[username]?></a>
会员信息调用ShowMemberInfo函数,格式为:sys_ShowMemberInfo(用户ID,查询字段)。

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

相关推荐