分享好友 资讯首页 资讯分类 切换频道

dedecms如何发布相册图集

2025-07-30 06:3010admin001

dedecms发布图集的具体方法如下:

1、后台创建一个image分类

2、建立文章,每个文章上传一个图片

3、/include/extend.func.php文件中加入下面代码

functionGetimgurls($aid,$num=4){global$dsql;$imgurls=$result='';$imgrow=$dsql->GetOne("SelectimgurlsFrom`dede_addonimages`whereaid='$aid'");$imgurls=$imgrow['imgurls'];if($imgurls!=''){$dtp=newDedeTagParse();$dtp->LoadSource($imgurls);$images=array();if(is_array($dtp->CTags)){foreach($dtp->CTagsas$ctag){if($ctag->GetName()=='img'){$row=array();$row['width']=$ctag->GetAtt('width');$row['height']=$ctag->GetAtt('height');$row['imgsrc']=trim($ctag->GetInnerText());$row['text']=$ctag->GetAtt('text');$images[]=$row;}}}$dtp->Clear();$i=0;foreach($imagesas$row){if($i==$num)break;if($row['imgsrc']!=''){$result.="<li>@@##@@</li>";}$i++;}return$result;}}
举报
收藏 0
打赏 0
评论 0
dedecms怎么添加会员功能

0评论2025-07-3128

dedecms好操作吗

0评论2025-07-3128

WordPress织梦哪个快

0评论2025-07-3128

dedecms如何修模板

0评论2025-07-3127