帝國CMS列表內(nèi)容模板(list.var)調(diào)用會員頭像會員名和文章標題以及連接
代碼如下:
$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 會員數(shù)據(jù)庫附表,存放了會員的頭像等信息
$listtemp='代碼內(nèi)容'; 列表內(nèi)容使用PHP必須使用的語法,記得勾選使用程序代碼
'.($userr[userpic]?$userr[userpic]:$public_r[newsurl].'e/data/images/nouserpic.gif').' 獲取頭像地址,如果沒有頭像顯示默認頭像nouserpic.gif