帝国cms调用好友动态信息
2020-04-10 站长 站长日志
帝国CMS二次开发后的效果
帝国CMS调用好友动态代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?php $fsql = $empire ->query( "select * from {$dbtbpre}enewshy where userid='$user[userid]' order by fid desc limit 10" ); while ( $fr = $empire ->fetch( $fsql )){ $t = $empire ->query( "select * from {$dbtbpre}ecms_news where username='$fr[fname]' order by newstime desc limit 10" ); while ( $r = $empire ->fetch( $t )){ ?> <ul id= "dt_list" class = "dt_list" > <li><span><?= date ( 'Y-m-d H:i:s' , $r [newstime])?></span><a class = "link" href= "[!--news.url--]e/space/?userid=<?=$r[userid]?>" target= "_blank" ><?= $r [username]?></a>发布了文章 <a href= "<?=$r[titleurl]?>" target= "_blank" ><?= $r [title]?></a></li> </ul> <? } } ?> |
首先查询一次当前用户ID的好友列表,然后循环出来,在到循环内查询好友发布的最新信息。