好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 網站建設 > 建站知識 > 織夢dede網站內容模型普通文章調用自定義圖片字

織夢dede網站內容模型普通文章調用自定義圖片字

POST TIME:2020-03-30 16:19

織夢DedeCMS網站內容模型普通文章調用自定義圖片字段的方法:

我們首先需要創建一個自定義函數,

找到:/include/extend.func.php ,在< ?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 .= '<img src="'.$imgurl.'" width="'.$width.'" height="'.$height.'" />';   




收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266