濮阳杆衣贸易有限公司

主頁 > 網(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 當前頁數(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 當前頁數(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
文安县| 手机| 大姚县| 额济纳旗| 威海市| 永泰县| 永嘉县| 呼伦贝尔市| 射阳县| 临洮县| 泗洪县| 巴里| 从化市| 乌审旗| 岳西县| 松桃| 四平市| 南岸区| 搜索| 朝阳区| 江源县| 西乌珠穆沁旗| 绥宁县| 丰原市| 赫章县| 昌黎县| 皮山县| 凤庆县| 内江市| 琼结县| 休宁县| 苗栗县| 安仁县| 山西省| 类乌齐县| 柘荣县| 益阳市| 金沙县| 昌宁县| 礼泉县| 凤庆县|