<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

织梦 调用文章第一张图片 非缩略图

时间:2020-12-21

方法1:

ActionScript
//取第一张图地址 function firstimg($str_pic) { $str_sub=substr($str_pic,0,-7).".jpg";//删除缩略图字符串最后七位,然后再补上后缀.jpg return $str_sub; }

然后在模板里循环调用:

[field:litpic function=firstimg('@me')/]
 

直接调用用:
{dede:field name='litpic' function="firstimg(@me)"/}

以上方法试了下,在图片都为JPG时可以用。如果有PNG,BMP等是不好用。所以优化了下,如下。

 方法2:

 

ActionScript
function firstimg($str_pic) { $str_sub=str_replace("-lp","","$str_pic"); //把缩略图中的‘"-lp"’ 删掉就是第一张图的地址了。 return $str_sub; }

然后在模板里循环调用:

[field:litpic function=firstimg('@me')/]
 

直接调用用:
{dede:field name='litpic' function="firstimg(@me)"/}

0
首页
案例
关于
联系