论坛帖子列表页调用帖子摘要教程
2017-10-08 23:50
375 查看
欢迎使用Markdown编辑器写博客
增加到 module/forum/forum_forumdisplay.php line 810前一句是 threadids[threadindex] = $thread[‘tid’];
//内容摘要 include_once libfile('function/post'); include_once libfile('function/attachment'); $thread['post'] = C::t('forum_post')->fetch_all_by_tid_position($thread['posttableid'],$thread['tid'],1); $thread['post'] = array_shift($thread['post']); $thread['preview'] = messagecutstr($thread['post']['message'], 200); $attachments = C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$thread['post']['tid'], 'pid', $thread['post']['pid']); $attachs = $imgattachs = array(); foreach(C::t('forum_attachment')->fetch_all_by_id('pid', $thread['post']['pid'], 'aid') as $attach) { $attach = array_merge($attach, $attachments[$attach['aid']]); $attach['filenametitle'] = $attach['filename']; $attach['ext'] = fileext($attach['filename']); getattach_row($attach, $attachs, $imgattachs); } $thread['attachments'] = $imgattachs; //内容摘要END
模板调用代码:
$thread[‘preview’]
后一句是 G[′forumthreadlist′][threadindex] = $thread;
两个之间. 获取主题内容以及附件
相关文章推荐
- discuzX3.2论坛帖子列表页调用帖子摘要实例
- Discuz!论坛教程之去掉帖子列表页的附件图标的方法
- 不定期更新dede修改教程之"调用论坛帖子"
- discuz 帖子列表页调用封面图片
- destoon调用discuz论坛中带图片帖子的实现方法
- DEDECMS5.7首页列表页调用TAG标签(带链接)教程
- discuz帖子列表页调用帖子作者头像
- 海河写的 Discuz论坛帖子调用js的php代码
- 织梦列表页调用文章标题和摘要
- 论坛帖子放js代码不让混淆功能影响js运行的方式,如discuz的管理员调用其它数据到帖子中
- destoon调用discuz论坛中带图片帖子的方法
- DEDECMS5.7首页列表页调用TAG标签(带链接)教程
- jsp开发教程之 仿MOP论坛 四(帖子信息显示1)
- 海河写的 Discuz论坛帖子调用js的php代码
- Discuz!教程之X3.4/X3.3/3.2/3.1/X3/X2.5论坛外部调用数据实现伪静态
- jsp开发教程之 仿MOP论坛 四(帖子信息显示2)
- PHPCMS V9调用dz x1.5 论坛数据教程
- DEDE调用DZ X1.5或者DZ论坛帖子的N种方法
- jsp开发教程之 仿MOP论坛 三(帖子列表-上)
- DeDecms 调用论坛帖子