导航
关闭

狼王King

当前位置:首页 > 网络教程 - 正文

帝国CMS会员中心模板改造之用户自己查看评论过的文章

  人参与 |更新时间: 2020年01月13日 20:57

会员中心改造的时候需要用到调用用户评论过的文章列表功能,也就是说会员自己评论过的文章所形成的列表!

代码如下:

<div style="border:1px solid #ddd; ">
<div class="header"  style="border-bottom:1px solid #ddd">我的评论</div>
<ul style=" ">

<?php
$sql=$empire->query("select A.id,A.saytime,B.title,B.titleurl  from {$dbtbpre}enewspl_1 as A, {$dbtbpre}ecms_news  as B where A.id=B.id && A.userid=$user[userid] order by A.saytime desc  limit 100");        //查询评论
while($r=$empire->fetch($sql))        //循环获取查询记录
{
echo "<li style='height:26px;line-height:26px;text-indent:10px;border-top:1px solid #eee;'><a target=_blank href=".$r['titleurl'].">".$r['title']."(".date('Y-m-d',$r[saytime]).")</a></li>";
}
?>

<ul>
</div>

注意:{$dbtbpre}ecms_news 数据表名

编辑:狼王(微信/QQ:1574808)

来源:狼王King(微信/QQ:1574808),欢迎分享!

本文链接:https://www.iwolfking.com/jiaocheng/102.html

评论专区

留言与评论(共有 0 条评论)
表情:   
验证码: