濮阳杆衣贸易有限公司

主頁 > 網(wǎng)站建設(shè) > 建站知識 > dedecms 織夢5.7 圖集實現(xiàn)分頁功能

dedecms 織夢5.7 圖集實現(xiàn)分頁功能

POST TIME:2020-04-12 22:25

第一步:在圖集模板里加入分頁代碼:{dede:pagebreak/}

第二步:打開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;
}



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
安仁县| 平利县| 黎川县| 通山县| 天峨县| 岳阳市| 太仓市| 平顺县| 茂名市| 缙云县| 荣昌县| 唐海县| 夏津县| 陕西省| 西藏| 临沂市| 玛曲县| 汝南县| 黄石市| 长白| 陵川县| 彰武县| 包头市| 翁牛特旗| 花垣县| 开平市| 舒城县| 青龙| 织金县| 九江市| 五河县| 隆化县| 丹寨县| 长葛市| 华亭县| 岫岩| 汉寿县| 开远市| 西乌| 兴安盟| 河间市|