打开include/extend.func.php文件
在最下面加入代码
<span style="font-size:14px;">//取案例第一张地址function GetFirstImg($arcid){global $dsql;$query= "SELECT anlsm FROM `dede_addon17` where aid='$arcid'";$row = $dsql->GetOne($query);$preg = "/<img.*?src=[\'\"](.+?)[\'\"].*?>/i";preg_match_all($preg, $row['anlsm'], $match);//print_r($match);return $match[1][0];}</span>
再打开/include/taglib/arclist.lib.php文件
找到
<span style="font-size:14px;"> $row['fulltitle'] = $row['title'];</span>
在它下面加入
<span style="font-size:14px;">$row['firstimgurl'] = GetFirstImg($row['id']);
</span>
调用标签
<span style="font-size:14px;"><img src="[field:firstimgurl /]" /></span>
调用自定义字段中的第二张、第三章图片方法
打开include/extend.func.php文件
在最下面加入代码
<span style="font-size:14px;">//取案例第一张地址function GetFirstImg($arcid){global $dsql;$query= "SELECT anlsm FROM `dede_addon17` where aid='$arcid'";$row = $dsql->GetOne($query);$preg = "/<img.*?src=[\'\"](.+?)[\'\"].*?>/i";preg_match_all($preg, $row['anlsm'], $match);//print_r($match);return $match[1][0];}</span><span style="font-size:14px;">//取案例第三张地址function GetThirImg($arcid){global $dsql;$query= "SELECT anlsm FROM `dede_addon17` where aid='$arcid'";$row = $dsql->GetOne($query);$preg = "/<img.*?src=[\'\"](.+?)[\'\"].*?>/i";preg_match_all($preg, $row['anlsm'], $match);//print_r($match);return $match[1][2];}</span>
再打开/include/taglib/arclist.lib.php文件
找到
<span style="font-size:14px;"> $row['fulltitle'] = $row['title'];</span>
在它下面加入
<span style="font-size:14px;">$row['secondimgurl'] = GetSecImg($row['id']);$row['thirdimgurl'] = GetThirImg($row['id']);</span>
调用标签
<img src="[field:secondimgurl/]"/>//第二张图片的调用<img src="[field:thirdimgurl/]"/>//第三张图片的调用