网站之家技术交流论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1576|回复: 0

帖子列表调用简介和图片的代码分享---phpwind9.0

[复制链接]
发表于 2013-4-25 19:14:35 | 显示全部楼层 |阅读模式
主要作用:在thread 也就是帖子列表调用出该贴的简介和图片
涉及文件:thread_run.htm  widget_thread.htm
phpwind9.0列表页调用图片和简介的最新方法
在thread_run.htm找到
<!--# if ($threaddb) { #-->
在下面添加
  1. <!--#
  2.     $threadtids = array();
  3.     foreach ($threaddb as $value) {
  4.         $threadtids[] = $value['tid'];
  5.     }
  6. #-->
  7. <component class='SRV:forum.PwThread' method='fetchThread' args='$threadtids,2'/>
  8. <!--# $threadContent = $__tpl_data; #-->
  9. <component class='SRV:attach.PwThreadAttach' method='fetchAttachByTidsAndPid' args='$threadtids' />
  10. <!--#
  11.     $threadthumb = array();
  12.     foreach ($__tpl_data as $value) {
  13.         if ($value['ifthumb']) $threadthumb[$value['tid']][] = $value['path'];
  14.     }
  15. #-->
复制代码
在widget_thread.htm内需要调用的位置添加代码
  1. <!--# if (is_array($threadthumb[$value['tid']])){ #-->
  2. <div class="fl mr10" style="padding-top:3px;">
  3. <!--#
  4.     foreach ($threadthumb[$value['tid']] as $k=>$thumb) {if(1 == $k)break;
  5. #-->
  6. <img src="{@Pw::getPath($thumb,2)}" width="80" align="top" />
  7. <!--# } #-->
  8. </div>
  9. <!--# } #-->
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|网站之家技术交流论坛 ( 粤ICP备09092995号 )

GMT+8, 2024-5-17 18:46 , Processed in 0.085907 second(s), 8 queries , File On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表