帝国CMS列表内容模板(list.var)调用会员头像、会员名称、文章标题和连接的方法!
帝国CMS列表内容模板(list.var)调用会员头像、会员名、文章标题和连接的方法!
帝国CMS列表内容模板的list.var里面怎么调用会员头像。会员名称,文章标题和文章链接呢?其实方法也很简单,下面帝国CMS模板网就来为大家分享:
标签代码如下:
$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网站地图sitemap.xml的制作方法2022年03月07日88
-
帝国CMS信息提示页美化模板(分享一个帝2022年03月09日55
-
帝国CMS怎么提高网页打开速度?(帝国CMS提2022年04月06日54
-
帝国CMS内容模板获取所有分页数和当前2022年04月05日49
-
帝国cms列表页调用文章关键词与tag的方2022年03月07日46
-
帝国CMS列表页文章怎么升序降序排列文2022年03月11日46