业务经理

微信扫描以上二维码

028-61286886

技术咨询

内容页关联文章标签related接口调用不显示

迅睿框架 更新 2022-04-02 09:39:01 likeren

内容页关联文章标签related接口调用不显示?

{if $tag}
{related module=news field=title,inputtime,support,hits,thumb,catid,uid tag=$tag page=1 pagesize=10 urlrule=$urlrule return=r}
{php $api['thumb'] = dr_thumb($c, 260, 195, 0, 'crop');}
{php $api['support'] = intval($r['support']);}
{php $api['title'] =  $r['title'];}
{php $api['hits'] = intval($r['hits']);}
{php $api['comments'] = dr_cat_value('works', $r['catid'], 'name');}
{php $api['inputtime'] = dr_fdate($r['_inputtime']);}
{/related}
{/if}



应用版权:官方
应用名称:API接口

方案

  • 官方插件技术-胡老师 #1 · 2022-04-02 03:45:44
    $tag 缺少来源
    $api[$key][变量]=值
  • likeren #2 · 2022-04-02 08:14:53
    官方插件技术-胡老师 辛苦了,这么晚还没休息 😁 这是内容页,没有[$key],研究了半天,现在调用出来后没有循环,求教
    {php $api['tag'] = $tag;}
    
    {php $api['relatedlist'] = [];}
    {related module=works field=title,support,thumb,upworks,uid tag=$tag page=1 pagesize=10 return=r}
    
    {php $api['relatedlist']['id'] = $r['id'];}
    {php $api['relatedlist']['author'] = dr_member_info($r['uid'])['name'];}
    {php $api['relatedlist']['thumb'] = dr_thumb($r['thumb'], 260, 195, 0, 'crop');}
    {php $api['relatedlist']['title'] =  $r['title'];}
    {php $api['relatedlist']['updatetime'] = dr_date($r['updatetime']);}
    {php $api['relatedlist']['description'] = dr_strcut($r['description'], 100, '...');}
    {php $api['relatedlist']['user_avatar'] = dr_avatar($r['uid']);}
    {php $api['relatedlist']['support'] = intval($r['support']);}
    {php $api['relatedlist']['comments'] = $r['comments'];}
    
    {/related}
    
    {php $api['relatedlist']['total'] = $total;}
    {php $api['relatedlist']['nums'] = $nums;}
    {php $api['relatedlist']['page'] = $page;}
    {php $api['relatedlist']['pagesize'] = $pagesize;}
  • likeren #3 · 2022-04-02 08:16:16
    likeren 官方插件技术-胡老师
    image
  • likeren #4 · 2022-04-02 08:22:02
    增加悬赏(设置悬赏)金:5元,希望大家给予帮助!
  • 越王 #5 · 2022-04-02 08:58:57
    你这只是定义没有输出吧
  • GoWorkRoom #6 · 2022-04-02 09:04:07
    一楼说明问题的根源了,$tag哪里来的,这是一个未知数了
  • likeren #7 · 2022-04-02 09:11:13
    GoWorkRoom
    {php $api['tag'] = $tag;}
    是这个吗?
  • 浮生半日 #8 · 2022-04-02 09:12:41
    😛 可以求助小波,我找他写过很多次api接口了,很专业的
  • 小黄人 18html #9 · 2022-04-02 09:19:47
    {if $tag}
    {related module=news field=title,inputtime,support,hits,thumb,catid,uid tag=$tag page=1 pagesize=10 urlrule=$urlrule return=r}
    {php $api[$key_r]['thumb'] = dr_thumb($c, 260, 195, 0, 'crop');}
    {php $api[$key_r]['support'] = intval($r['support']);}
    {php $api[$key_r]['title'] =  $r['title'];}
    {php $api[$key_r]['hits'] = intval($r['hits']);}
    {php $api[$key_r]['comments'] = dr_cat_value('works', $r['catid'], 'name');}
    {php $api[$key_r]['inputtime'] = dr_fdate($r['_inputtime']);}
    {/related}
    {/if}
  • LandQ #10 · 2022-04-02 09:22:30
    {php $api['tag'] = $tag;}{php $api['relatedlist'] = [];}{related module=works field=title,support,thumb,upworks,uid tag=$tag page=1 pagesize=10 return=r}{php $api['relatedlist'][$key]['id'] = $r['id'];}{php $api['relatedlist'][$key]['author'] = dr_member_info($r['uid'])['name'];}{php $api['relatedlist'][$key]['thumb'] = dr_thumb($r['thumb'], 260, 195, 0, 'crop');}{php $api['relatedlist'][$key]['title'] = $r['title'];}{php $api['relatedlist'][$key]['updatetime'] = dr_date($r['updatetime']);}{php $api['relatedlist'][$key]['description'] = dr_strcut($r['description'], 100, '...');}{php $api['relatedlist'][$key]['user_avatar'] = dr_avatar($r['uid']);}{php $api['relatedlist'][$key]['support'] = intval($r['support']);}{php $api['relatedlist'][$key]['comments'] = $r['comments'];}{/related}{php $api['relatedlist']['total'] = $total;}{php $api['relatedlist']['nums'] = $nums;}{php $api['relatedlist']['page'] = $page;}{php $api['relatedlist']['pagesize'] = $pagesize;}
  • 小黄人 18html #11 · 2022-04-02 09:29:49
    满意答案
    注意 retuen=r 下面 $key 要对应写成 $key_r
    image
  • likeren #12 · 2022-04-02 09:39:01
    @小黄人 18html:辛苦小黄人了!多谢!

迅睿系统漏洞

GEO系统
GEO系统(2026-09-15)
运营客户端,防止误触阴影处关闭对话框
独立站群系统
独立站群系统(2026-09-14)
子站独立部署时修复同步附件失败问题
在线客服
在线客服(2026-09-13)
修复删除会话报错问题 删除会话时联动删除聊天图片
在线考试竞赛系统
在线考试竞赛系统(2026-09-12)
增加投票功能 考试功能拓展 注意:更新后需要执行系统更新,更新数...
网上信箱
网上信箱(2026-09-12)
修复新版本兼容问题
GeoSeo收录宝
GeoSeo收录宝(2026-09-12)
1 优化Update.php文件,解决版本在线升级不完整问题 2 ...
GeoSeo工具箱
GeoSeo工具箱(2026-09-11)
修正历史记录推送
微信系统
微信系统(2026-09-11)
增加数据统计总览界面 账号管理增加服务和公众号的区别 菜单管理支持更...
答题系统
答题系统(2026-09-11)
一站式在线答题系统,支持真题考试、题库练习和错题本,适合培训、考证、...
阿里云滑动验证码
阿里云滑动验证码(2026-09-10)
采用阿里云验证码替换迅睿系统自带的图片验证码和滑动验证码。后台设置方...