DEDECMS首页和列表页调用单个图片集里的多张图片

/**DEDECMS首页和列表页调用单个图片集里的多张图片 
function Getimg($aid,$imgwith=110,$imgheight=110,$num=0)  
{  
global $dsql;  
$imgurls = '';  
$row =$dsql->getone( "Select aid,imgurls From `js_addonimages` where aid='$aid' ");  
$id=$row['aid']; 
$imgurls= $row['imgurls'];  
$dtp = new DedeTagParse(); 
$dtp->LoadSource($imgurls); 
if(is_array($dtp->CTags)) 
{ 
    $i=0; 
    foreach($dtp->CTags as $ctag) 
         { 
            if($i<$num){ 
                if($ctag->GetName()=="img") 
                 { 
                     $bigimg = trim($ctag->GetInnerText()); 
                     if($ctag->GetAtt('ddimg') != $bigimg && $ctag->GetAtt('ddimg')!='') 
                     { 
                            $litimg = $ctag->GetAtt('ddimg'); 
                     } 
                     $title=$ctag->GetAtt('text'); 
                     $imglist.='<li><a title="'.$title.'" href="/plus/view.php?aid='.$id.'"><img src="'.$bigimg.'" width="'.$imgwith.'" height="'.$imgheight.'" alt="'.$title.'"></a></li>';  
                     $i++; 
                 } 
            } 
        } 
    } 
return $imglist;  
 
} 
原文地址:https://www.cnblogs.com/happig/p/4685465.html