导航
关闭

狼王King

当前位置:首页 > 网络教程 - 正文

帝国CMS列表内容模板(list.var)调用会员头像会员名和文章标题以及连接

  人参与 |更新时间: 2020年01月12日 16:21

代码如下: 

$userr=$empire->fetch1("select userpic  from {$dbtbpre}enewsmemberadd where userid='$r[userid]' limit 1");
$listtemp='
<table width="100%" border="0" cellspacing="4" cellpadding="0">
 <tr>
   <td><a href="[!--news.url--]e/space/?userid=[!--userid--]"><img src=" '.($userr[userpic]?$userr[userpic]:$public_r[newsurl].'e/data/images/nouserpic.gif').' " width="28" height="28" border="0" /></a></td>
   <td><a href="[!--news.url--]e/space/?userid=[!--userid--]">[!--username--]</a></td>
   <td><a href="[!--titleurl--]" title="[!--oldtitle--]">[!--title--]</td>
 </tr>
</table>
';

解释: 

{$dbtbpre}enewsmemberadd  会员数据库附表,存放了会员的头像等信息

$listtemp='代码内容';    列表内容使用PHP必须使用的语法,记得勾选使用程序代码

'.($userr[userpic]?$userr[userpic]:$public_r[newsurl].'e/data/images/nouserpic.gif').'   获取头像地址,如果没有头像显示默认头像nouserpic.gif

编辑:狼王(微信/QQ:1574808)

标签:   帝国CMS   帝国CMS教程   狼王King

来源:狼王King(微信/QQ:1574808),欢迎分享!

本文链接:https://www.iwolfking.com/jiaocheng/68.html

评论专区

留言与评论(共有 0 条评论)
表情:   
验证码: