您现在的位置: 万盛学电脑网 >> 程序编程 >> CMS教程 >> 正文

phpwind教程

作者:佚名    责任编辑:admin    更新时间:2022-06-22

class="area"> 主要作用:在thread 也就是帖子列表调用出该贴的简介和图片
涉及文件:thread_run.htm  widget_thread.htm


首先,用文档编辑器打开 thread_run.htm


找到<!--# if ($threadList) { #-->
在下面加上
<!--#
$threadtids = array();
foreach ($threadList as $value) {
$threadtids[] = $value['tid'];
}
#-->
<component class='SRV:forum.PwThread' method='fetchThread' args='$threadtids,2'/>
<!--# $threadContent = $__tpl_data; #-->
<component class='SRV:attach.PwThreadAttach' method='fetchAttach' args='$threadtids' />
<!--# $threadthumb = $__tpl_data; #-->



打开  widget_thread.htm  在 <p class="info">上面加上
<p class="mb5">
{@Pw::substrs(Pw::stripWindCode($threadContent[$value['tid']]['content'],true),120)}
<!--# if ($threadthumb[$value['tid']]['path']['ifthumb']){ #-->
<div><img src="{@Pw::getPath($threadthumb[$value['tid']]['path'],2)}" /></div>
<!--# } #-->
</p>

其中
{@Pw::substrs(Pw::stripWindCode($threadContent[$value['tid']]['content'],true),120)}是简介,120是字数
{@Pw::getPath($threadthumb[$value['tid']]['path'],2)} 是调用图片缩略图,把2改成1就会变成大图,0应该就是原图了