dedecms 織夢5.7 圖集實現(xiàn)分頁功能
來源:本站原創(chuàng)|時間:2021-08-05|欄目:dedecms|點擊: 次
第一步:在圖集模板里加入分頁代碼:{dede:pagebreak/}
第二步:打開arc_archives_class.php,在include目錄下,在結尾處加上以下代碼:
/**
* 獲得動態(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;
}
欄 目:dedecms
下一篇:織夢CMS調用問答欄目文章到首頁實現(xiàn)方法
本文標題:dedecms 織夢5.7 圖集實現(xiàn)分頁功能
本文地址:http://mengdiqiu.com.cn/a1/dedecms/14252.html
您可能感興趣的文章
- 08-05Dedecms文件目錄結構解說(能知道織夢每個文件有什么用)
- 08-05Dedecms5.7版ckeditor網頁編輯器添加中文字體
- 08-05織夢DedeCMS獲取當前欄目文章數(shù)量
- 08-05織夢模板如何添加和調用自定義字段的方法
- 08-05DedeCMS后臺模塊列表顯示空白的解決辦法
- 08-05DedeCMS自定義字段圖片調用的問題{dede:img ...}解決方法
- 08-05織夢DedeCMS調用顯示discuz里面主題的方法
- 08-05限制織夢會員每天投稿數(shù)量方法
- 08-05常用的織夢dedecms安全設置集合整理
- 08-05織夢教程:后臺編輯器添加中文字體方法