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

发布时间:2021-03-09 09:08:50

代码如下:$userr=$empire->fetch1("select userpic  from {$dbtbpre}enewsmemberadd where userid='$r[userid]' limit 1");$listtemp='<table width="100%" border="0" cel...

您的位置:仿站网 > 帝国教程 > 帝国CMS列表内容模板(list.var)调用会员头像会员名和文章标题以及连接

代码如下:

$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

转载请注明本文地址:帝国CMS列表内容模板(list.var)调用会员头像会员名和文章标题以及连接 https://www.ecmsw.cn/html/5973.html
帝国CMS模板
帝国CMS插件
仿站常见问题

仿站网专注于帝国CMS仿站及二次开发、模板定制等各种有关帝国CMS程序疑难杂症!
Copyright@2016-2023 汇鑫网络工作室 版权所有 仿站网 www.ecmsw.cn
鲁ICP备17005488号-1 鲁公网安备 37018102000481号