discuz

推荐列表 站点导航

当前位置:首页 > 建站教程 > discuz >

discuz 帖子列表页调用封面图片代码

来源:网络整理  作者:网络  发布时间:2020-12-10 19:55
打开文件: source/module/forum/forum_forumdisplay.php 找到如下代码 if($thread[rushreply]) { $rushtids[$thread[tid]] = $thread[tid]; } 复制代...

打开文件: source/module/forum/forum_forumdisplay.php 找到如下代码 if($thread['rushreply']) {         $rushtids[$thread['tid']] = $thread['tid']; } 复制代码 在这段代码下面添加如下代码: $threada= C::t('forum_attachment')->fetch_all_by_id('tid', $thread['tid'], 'aid'); $threadaid = reset($threada); $threadpic = C::t('forum_attachment_n')->fetch_by_aid_uid($threadaid['tableid'], $threadaid['aid'], $thread['authorid']); $thread['pic'] = $threadpic['attachment'];  
这样就可以在列表页模板中使用 $thread['pic'] $thread['pic']所调用的是“附件”不分格式,也就是说,有可能调用到.rar/.zip之类的附件,并不是专调图片,算是个弊端。

相关热词: 调用 discuz

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://www.juheyunku.com/jz/discuz/2285.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

discuz 帖子列表页调用封面图片代码

2020-12-10 编辑:网络

打开文件: source/module/forum/forum_forumdisplay.php 找到如下代码 if($thread['rushreply']) {         $rushtids[$thread['tid']] = $thread['tid']; } 复制代码 在这段代码下面添加如下代码: $threada= C::t('forum_attachment')->fetch_all_by_id('tid', $thread['tid'], 'aid'); $threadaid = reset($threada); $threadpic = C::t('forum_attachment_n')->fetch_by_aid_uid($threadaid['tableid'], $threadaid['aid'], $thread['authorid']); $thread['pic'] = $threadpic['attachment'];  
这样就可以在列表页模板中使用 $thread['pic'] $thread['pic']所调用的是“附件”不分格式,也就是说,有可能调用到.rar/.zip之类的附件,并不是专调图片,算是个弊端。

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://www.juheyunku.com/jz/discuz/2285.shtml

相关文章

风云图片

推荐阅读

返回discuz频道首页