帝国CMS调用最新评论自己发布的文章信息
<?php $sql1=$empire->query("select * from {$dbtbpre}enewspl_1 order by saytime desc limit 10"); while($r1=$empire->fetch($sql1)){ $t1=$empire->query("select * from {$dbtbpre}ecms_news where id='$r1[id]' and classid='$r1[classid]' and userid='$user[userid]' order by '$sql1[saytime]' desc limit 10"); while($r11=$empire->fetch($t1)){ ?> <ul id="dt_list" class="dt_list"> <li><span><?=date('Y-m-d H:i:s',$sql1[saytime])?></span><a class="link" href="[!--news.url--]e/space/?userid=<?=$r1[userid]?>" target="_blank"><?=$r1[username]?></a>评论了您的 <a href="<?=$r11[titleurl]?>" target="_blank"><?=$r11[title]?></a> 文章</li> </ul> <? } }
首先调用10条评论,在过滤一次,吧发布者信息ID为当前登录用户的ID的信息在循环一次。