1 [field:id function="Getimg(@me,80,80,7)" /]
1 {dede:field.id function="Getimg(@me,80,80,7)" /}
01 function Getimg($aid,$imgwith=110,$imgheight=110,$num=0) 02 { 03 global $dsql; 04 $imgurls = ''; 05 $row =$dsql->getone( "Select aid,imgurls From `dede_addonimages` where aid='$aid' "); 06 $id=$row['aid']; 07 $imgurls= $row['imgurls']; 08 $dtp = new DedeTagParse(); 09 $dtp->LoadSource($imgurls); 10 if(is_array($dtp->CTags)) 11 { 12 $i=0; 13 foreach($dtp->CTags as $ctag) 14 { 15 if($i<$num){ 16 if($ctag->GetName()=="img") 17 { 18 $bigimg = trim($ctag->GetInnerText()); 19 if($ctag->GetAtt('ddimg') != $bigimg && $ctag->GetAtt('ddimg')!='') 20 { 21 $litimg = $ctag->GetAtt('ddimg'); 22 } 23 $title=$ctag->GetAtt('text'); 24 $imglist.=''; 25 $i++; 26 } 27 } 28 } 29 } 30 return $imglist; 31 32 }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)