织梦列表页如何调用dede_img

COS、CDN
function GetOneImgUrl($img,$ftype=1){        if($img <> &#39;&#39;){            $dtp = new DedeTagParse();            $dtp->LoadSource($img);            if(is_array($dtp->CTags)){                foreach($dtp->CTags as $ctag){                    if($ctag->GetName()==&#39;img&#39;){                        $width = $ctag->GetAtt(&#39;width&#39;);                        $height = $ctag->GetAtt(&#39;height&#39;);                        $imgurl = trim($ctag->GetInnerText());                        $img = &#39;&#39;;                        if($imgurl != &#39;&#39;){                            if($ftype==1){                                $img .= $imgurl;                            }                            else{                                $img .= &#39;<img  src="&#39;.$imgurl.&#39;"    style="max-width:90%" height="&#39;.$height.&#39;" / alt="织梦列表页如何调用dede:img" >&#39;;                            }                        }                                                    }                }            }            $dtp->Clear();            return $img;            }    }

 

COS、CDN
热门