1、打开 include/extend.func.php 文件,并添加如下代码:
//提取图集第一张大图(本文由CMS集中营www.cmsjzy.cn测试整理发布),供arclist标签调用
function Get_firstbigimg($aid){
global $dsql;
$imgurls=”;
$row=$dsql->getone(http://www.moke8.com/data/attachment/portal/201610/16/093455krt3x8lsuuz6dj37.attachSelect imgurls From #@__addonimages where aid=’$aid’ http://www.moke8.com/data/attachment/portal/201610/16/093455krt3x8lsuuz6dj37.attach);
$imgurls=$row[‘imgurls’];
preg_match_all(http://www.moke8.com/data/attachment/portal/201610/16/093455krt3x8lsuuz6dj37.attach/{dede:img[^>]+}(.*){/dede:img/isUhttp://www.moke8.com/data/attachment/portal/201610/16/093455krt3x8lsuuz6dj37.attach,$imgurls,$imgurlsed);
$get_firestimg = $imgurlsed[1][0]; //
return $get_firestimg;
}

2、打开 include/taglib/arclist.lib.php 文件,并在513行添加如下代码:
$row[‘first_imgurl’] = Get_firstbigimg($row[‘id’]);
3、调用方法:
{dede:arclist row=’3′ typeid=’6′ titlelen=’60’ orderby=’pubdate’}

  • [field:first_imgurl/]http://www.moke8.com/data/attachment/portal/201610/16/093455krt3x8lsuuz6dj37.attach />
    [field:title/]
  • {/dede:arclist}
    备注:如果需要限制宽、高比例可以用如下代码
    [field:first_imgurl function=’thumb(@me,450,360)’/]

    发表评论

    电子邮件地址不会被公开。 必填项已用*标注