dedecms發布圖集的具體方法如下:
1、後台建立一個image分類
2、建立文章,每個文章上傳一個圖片
3、/include/extend.func.php 檔案中加入下面程式碼
function Getimgurls($aid,$num=4) { global $dsql; $imgurls = $result = ''; $imgrow = $dsql->GetOne( "Select imgurls From `dede_addonimages` where aid='$aid' "); $imgurls = $imgrow['imgurls']; if($imgurls != '') { $dtp = new DedeTagParse(); $dtp->LoadSource($imgurls); $images = array(); if(is_array($dtp->CTags)) { foreach($dtp->CTags as $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($images as $row) { if($i == $num) break; if($row['imgsrc'] != '') { $result .= "<li><img src='{$row['imgsrc']}' alt='{$row['text']}' width='70' height='70'></li>"; } $i++; } return $result; } }
4、網頁中呼叫
{dede:arclist row=4 typeid =13} [field:id function=Getimgurls(@me,4)/] {/dede:arclist}
後者
{dede:list pagesize='10'} [field:id function=Getimgurls(@me,4)/] {/dede:list}
相關推薦:織夢cms
#以上是dedecms如何發布相簿圖集的詳細內容。更多資訊請關注PHP中文網其他相關文章!