phpcms v9首页调用最新留言(留言板模块)内容的方法
调用最新留言:
{pc:get sql="SELECT guestid,name,introduce,typeid,tel,mail,addtime FROM ss_guestbook ORDER BY guestid DESC" num="10" page="$page"}
{loop $data $r}
<table class="ltable" width="95%" border="0" align="center">
<tr>
<td width="30%">姓名:{$r[name]}</td>
<td>时间:{date('Y-m-d H:i:s',$r[addtime])} </td>
</tr>
<tr>
<td colspan="2">留言内容: {$r[introduce]}</td>
</tr>
</table>
{/loop}
{$pages}
{/pc}
调用通过审核的最新留言:
{pc:get sql="SELECT guestid,name,introduce,typeid,tel,mail,addtime,passed FROM ss_guestbook where Passed=1 ORDER BY guestid DESC" num="10" page="$page"}
{loop $data $r}
<table class="ltable" width="95%" border="0" align="center">
<tr>
<td width="30%">署名:{$r[name]}</td>
<td>时间:{date('Y-m-d H:i:s',$r[addtime])} </td>
</tr>
<tr>
<td colspan="2">来信内容: {$r[introduce]}</td>
</tr>
</table>
{/loop}
{$pages}
{/pc}
|
|