找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 106|回复: 0

[cms教程] dedecms 织梦5.7 图集实现分页功能

[复制链接]

该用户从未签到

发表于 2021-1-25 09:45:00 | 显示全部楼层 |阅读模式

您需要 登录 才可以下载或查看,没有账号?立即注册

×
第一步:在图集模板里加入分页代码:{dede:pagebreak/}
         
        第二步:打开arc_archives_class.php]在include目录下,在结尾处加上以下代码:
         
        /**
        * 获得动态页面图集中图片缩略列表
        *
        * @access public
        * @param int $totalPage 总页数
        * @param int $nowPage 当前页数
        * @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.='[*,
        GetAtt('text').'"
        href="view.php?aid='.$aid.'&pageno='.$pagenum.'">[I,
        style="BACKGROUND-IMAGE: url('.$ctag1->GetAtt('ddimg').')"
        src="'.$GLOBALS['cfg_templets_skin',.'/tukustyle/blankBg.gif" >
        href="view.php?aid='.$aid.'&pageno='.$pagenum.'">'.substr($ctag1->GetAtt('text')] 30).' ';
         
        $pagenum++;
        }
        }
        }
         
        return $litpic;
        }
        /**
        * 获得静态页面图集中图片缩略列表
        *
        * @access public
        * @param int $totalPage 总页数
        * @param int $nowPage 当前页数
        * @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.='[*,
        GetAtt('text').'"
        href="'.$this->NameFirst.'.'.$this->ShortName.'">[I,
        style="BACKGROUND-IMAGE: url('.$ctag1->GetAtt('ddimg').')"
        src="'.$GLOBALS['cfg_templets_skin',.'/tukustyle/blankBg.gif" >
        href="'.$this->NameFirst.'_'.$pagenum.'.'.$this->ShortName.'">'.substr($ctag1->GetAtt('text'),0]30).' ';
        }
        else
        {
        $litpic.='[*,
        GetAtt('text').'"
        href="'.$this->NameFirst.'_'.$pagenum.'.'.$this->ShortName.'">[I,
        style="BACKGROUND-IMAGE: url('.$ctag1->GetAtt('ddimg').')"
        src="'.$GLOBALS['cfg_templets_skin',.'/tukustyle/blankBg.gif" >
        href="'.$this->NameFirst.'_'.$pagenum.'.'.$this->ShortName.'">'.substr($ctag1->GetAtt('text'),0]30).' ';
        }
        $pagenum++;
        }
        }
        }
         
        return $litpic;
        }
回复

使用道具 举报

网站地图|页面地图|文字地图|Archiver|手机版|小黑屋|找资源 |网站地图

GMT+8, 2024-10-9 07:18

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表