织梦DedeCMS网站内容模型普通文章调用自定义图片字段的方法:
我们首先需要创建一个自定义函数,
找到:/include/extend.func.php ,在
function GetOneImgUrl($img,$ftype=1){
if($img <> ''){
$dtp = new DedeTagParse();
$dtp->LoadSource($img);
if(is_array($dtp->CTags)){
foreach($dtp->CTags as $ctag){
if($ctag->GetName()=='img'){
$width = $ctag->GetAtt('width');
$height = $ctag->GetAtt('height');
$imgurl = trim($ctag->GetInnerText());
$img = '';
if($imgurl != ''){
if($ftype==1){
$img .= $imgurl;
}
else{
$img .= '';
标签:
本文地址:织梦dede网站内容模型普通文章调用自定义图片字段的方法(和调用 https://www.shenqiu123.com/a/jianzhan/rumen/7899.html