在评论列表中判断发布作者就显示发部者

迅睿框架 更新 2024-12-31 13:40:50 学习狂人

{php $user=dr_member_info($t.uid);}

{if $user.is_admin}

    <span class="label label-success" style="font-size: 12px">官方</span> {$t.author}

{elseif $user.author}

    <span class="label label-primary" style="font-size: 12px">发布者</span> {$t.author}

{else}

    <span class="label label-warning" style="font-size: 12px">网友</span> {$t.author}

{/if}


这是前台判断评论时的语句,在评论列表里,请问一下我要判断如果是这篇文章的作者评论的话就显示“发布者”,应该怎么写?

方案

  • 外聘专员-明矾软件 #1 · 2024-12-31 13:16:50
    {if $index.uid==$t.uid}
  • 学习狂人 #2 · 2024-12-31 13:26:57
    外聘专员-明矾软件
    360截图20241231132554963
    我的代码如下:
    {php $user = dr_member_info($t.uid);}
    {if $user.is_admin}
        <span class="label label-success" style="font-size: 12px">官方</span> {$t.author}
    {elseif $index.uid==$t.uid}
        <span class="label label-primary" style="font-size: 12px">发布者</span> {$t.author}
    {else}
        <span class="label label-warning" style="font-size: 12px">网友</span> {$t.author}
    {/if}
  • 外聘专员-明矾软件 #3 · 2024-12-31 13:34:33
    满意答案
    {if $index.uid==$t.uid}
        <span class="label label-primary" style="font-size: 12px">发布者</span> {$t.author}
    {elseif $user.is_admin}
        <span class="label label-success" style="font-size: 12px">官方</span> {$t.author}
    {else}
        <span class="label label-warning" style="font-size: 12px">网友</span> {$t.author}
    {/if}
  • 学习狂人 #4 · 2024-12-31 13:40:31

    360截图20241231133947199
    完美解决
  • 学习狂人 #5 · 2024-12-31 13:40:50
    @外聘专员-明矾软件:结帖,完美解决

迅睿系统漏洞

站群分站系统
站群分站系统(2026-10-15)
子站域名新增llms.txt访问
GEO系统
GEO系统(2026-10-14)
修复下载zip空白地址问题 修复流量复刻和任务队列错误
GeoSeo收录宝
GeoSeo收录宝(2026-10-14)
新增 站长工具箱 前端首页自动调用meta 数据
滑块验证码 Gocaptcha
滑块验证码 Gocaptcha(2026-10-13)
基于开源项目 go-captcha 的行为验证码插件,滑动拼图、区域...
GeoSeo工具箱
GeoSeo工具箱(2026-10-13)
优化巡检任务
GeoSeo排名助手
GeoSeo排名助手(2026-10-11)
加入大模型自定义
SEO聚合关键字
SEO聚合关键字(2026-10-11)
优化关键字列表页最多支持1万篇文章,过多会导致服务器扛不住;
CMS内容同步复制
CMS内容同步复制(2026-10-10)
增加时间是否更新的开关