
内容页中的专用图片,提取第一张作为首页,封面页,列表页的缩略图,怎么调用?下面是我调用的。请指正:
试尝一:
{category module=share pid=1 num=10 order=displayorder}
{module module=store catid=$t.id num=32 return=r}
<?php $mycat=dr_share_cat_value('thumb');?><?php if ($thumb) { $key=0; foreach ($thumb as $c) { ?>
<img src="{dr_thumb($c, 372, 279)}" alt="{php $myfile=\Phpcmf\Service::C()->get_attachment($c);}{$myfile.filename}"/>
<?php $key++;} } ?>
{/module}
{/category}尝试二:
{category module=share pid=1 num=10 order=displayorder}
{module module=store catid=$t.id num=32 return=r}
{loop $t.thumb $i $c}
<img src="{dr_get_file($c)}" style="width:285px; height:285px;" alt="{$r.title}"></a>
{/loop}
{/module}
{/category}多种试尝都调不出。请帮忙,谢谢
{category module=share pid=1 num=10 order=displayorder} {module module=t.mid catid=$t.id num=32 return=r} {loop $r.thumb $i $c} <img src="{dr_get_file($c)}" style="width:285px; height:285px;" alt="{$r.title}"></a> {php break;} {/loop} {/module}{$debug_r} {/category}{$debug}我搞出来了。但是标题显示个 8 是怎么来的。
后台是标题:
{php $i=0;} {category module=share pid=1 num=10 order=displayorder} <div class="blk-sm fr" style="width: 1200px;"> <div class="leftnav-z1 b"> <h3 class="leftnav-z1-tit"><span>{$i+1}F <a style="color:#337ab7;" >{$t.name}</span></h3> </div> {module module=store catid=$t.id num=32 return=t} <div class="leftnav-z1-list"> <dl> <dt> {loop $t.thumb $i $r} <a href="{$t.url}" > <img src="{dr_thumb($r, 285, 285)}" style="width:285px; height:285px;" alt="{$t.title}"></a> {/loop} </dt> <dd> <h4><a href="{$t.url}" >{$t.title}</a></h4> </dd> </dl> </div> {/module} </div> {php $i++;} {/category}以觖决,