国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 織夢DEDE > 正文

織夢dedecms實現(xiàn)圖集縮略圖的分頁樣式

2024-07-12 08:56:56
字體:
供稿:網(wǎng)友
織夢dedeCMS  5.7版本里默認(rèn)自帶有三種圖集樣式,模板名稱分別為article_image.htm、article_image_cl.htm(新浪樣式)、article_image_new.htm(這個是5.7才有的圖文幻燈樣式)。最近在做女人說的圖集模板時發(fā)現(xiàn)dede默認(rèn)的圖集模板無法像文章一樣實現(xiàn)分頁樣式,多次問度娘、谷哥均無果,于是仔細(xì)的對織夢的文件研究了一下發(fā)現(xiàn)織夢是可以實現(xiàn)這種樣式的(如下圖)。現(xiàn)將方法分享給大家,這也是織夢dedecms 論壇上大家最熱關(guān)注的焦點哦!

織夢dedecms實現(xiàn)圖集縮略圖的分頁樣式
 
問題分析:
若要實現(xiàn)這種分頁方式,第一在要在分頁時把縮略圖的地址也調(diào)用進(jìn)去,可是打開分頁標(biāo)簽文件一看,沒有縮略圖數(shù)據(jù)。那怎么辦。我們只能通過二次開發(fā)進(jìn)行新建一個專門用來圖集分頁調(diào)用的一個函數(shù),如果要改動{dede:pagebreak/}的話,在文章的相關(guān)分頁方式上可能會出現(xiàn)問題。因此建議我們自己新建函數(shù)以免出現(xiàn)其他問題。
解決方法:
第一步:打開arc_archives_class.php,在include目錄下,在結(jié)尾處加上以下代碼:
/**
* 獲得動態(tài)頁面圖集中圖片縮略列表
*
* @access public
* @param int $totalPage 總頁數(shù)
* @param int $nowPage 當(dāng)前頁數(shù)
* @param int $aid 文檔id
* @return string
*/
function GetlitpicDM_list($totalPage,$nowPage,$aid)
{
global $dsql,$sqlCt;
$attlist="desclen|80";
FillAttsDefault($ctag->CAttribute->Items,$attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
if(!isset($this->addTableRow['imgurls'])) return ;
$revalue = '';
$dtp = new DedeTagParse();
$dtp->LoadSource($this->addTableRow['imgurls']);
$images = array();
if(is_array($dtp->CTags))
{
$pagenum=1;
foreach($dtp->CTags as $ctag1)
{
if($ctag1->GetName()=="img")
{
$litpic.='<LI>
<DIV class=img><A title="'. $ctag1->GetAtt('text').'"
href="view.php?aid='.$aid.'&pageno='.$pagenum.'"><IMG
style="BACKGROUND-IMAGE: url('.$ctag1->GetAtt('ddimg').')"
src="'.$GLOBALS['cfg_templets_skin'].'/tukustyle/blankBg.gif" ></A></DIV><A
href="view.php?aid='.$aid.'&pageno='.$pagenum.'">'.substr($ctag1->GetAtt('text'), 30).'</A> </LI>';

$pagenum++;
}
}
}

return $litpic;
}
/**
* 獲得靜態(tài)頁面圖集中圖片縮略列表
*
* @access public
* @param int $totalPage 總頁數(shù)
* @param int $nowPage 當(dāng)前頁數(shù)
* @param int $aid 文檔id
* @return string
*/
function Getlitpic_list($totalPage,$nowPage,$aid)
{
global $dsql,$sqlCt;
$attlist="desclen|80";
FillAttsDefault($ctag->CAttribute->Items,$attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
if(!isset($this->addTableRow['imgurls'])) return ;
$revalue = '';
$dtp = new DedeTagParse();
$dtp->LoadSource($this->addTableRow['imgurls']);
$images = array();
if(is_array($dtp->CTags))
{
$pagenum=1;
foreach($dtp->CTags as $ctag1)
{
if($ctag1->GetName()=="img")
{
if($pagenum==1)
{
$litpic.='<LI>
<DIV class=img><A title="'. $ctag1->GetAtt('text').'"
href="'.$this->NameFirst.'.'.$this->ShortName.'"><IMG
style="BACKGROUND-IMAGE: url('.$ctag1->GetAtt('ddimg').')"
src="'.$GLOBALS['cfg_templets_skin'].'/tukustyle/blankBg.gif" ></A></DIV><A
href="'.$this->NameFirst.'_'.$pagenum.'.'.$this->ShortName.'">'.substr($ctag1->GetAtt('text'),0,30).'</A> </LI>';
}
else
{
$litpic.='<LI>
<DIV class=img><A title="'. $ctag1->GetAtt('text').'"
href="'.$this->NameFirst.'_'.$pagenum.'.'.$this->ShortName.'"><IMG
style="BACKGROUND-IMAGE: url('.$ctag1->GetAtt('ddimg').')"
src="'.$GLOBALS['cfg_templets_skin'].'/tukustyle/blankBg.gif" ></A></DIV><A
href="'.$this->NameFirst.'_'.$pagenum.'.'.$this->ShortName.'">'.substr($ctag1->GetAtt('text'),0,30).'</A> </LI>';
}
$pagenum++;
}
}
}

return $litpic;
}

最后就是模板的調(diào)用了,這就不再細(xì)說了,當(dāng)然這只是一種方法! 
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 信丰县| 留坝县| 界首市| 盐城市| 清水河县| 贵阳市| 平舆县| 惠东县| 孟村| 扎鲁特旗| 莫力| 康定县| 大关县| 个旧市| 平乐县| 安化县| 清流县| 万全县| 林周县| 军事| 县级市| 托克逊县| 沾益县| 含山县| 长沙市| 墨玉县| 黑山县| 贵溪市| 常宁市| 襄樊市| 威远县| 祁门县| 都昌县| 天长市| 台湾省| 赫章县| 南郑县| 蓝山县| 邵阳县| 大竹县| 报价|