栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP > php开源框架 > dedecms

dedecms列表页分页效果变形的问题解决

dedecms 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

dedecms列表页分页效果变形的问题解决

我们在dedecms做模板时候,列表页有

  • 代码,会引起页面变形

     

    这个修改具体是要修改arc.archives.class.php于arc.listview.class.php文件

     

     

     

    以下附件是V5.6UTF8版本修改后的文件

     

    arc.archives.class.php

     

    if(!defined('DEDEINC'))  

    {  

        exit("Request Error!");  

    }  

    require_once(DEDEINC."/typelink.class.php");  

    require_once(DEDEINC."/channelunit.class.php");  

    require_once(DEDEINC."/downmix.inc.php");  

    require_once(DEDEINC.'/ftp.class.php');  

     

    @set_time_limit(0);  

    class Archives  

    {  

        var $Typelink;  

        var $ChannelUnit;  

        var $dsql;  

        var $Fields;  

        var $dtp;  

        var $ArcID;  

        var $SplitPageField;  

        var $SplitFields;  

        var $NowPage;  

        var $TotalPage;  

        var $NameFirst;  

        var $ShortName;  

        var $FixedValues;  

        var $TempSource;  

        var $IsError;  

        var $SplitTitles;  

        var $PreNext;  

        var $addTableRow;  

        var $ftp;  

        var $remoteDir;  

     

        //php5构造函数  

        function __construct($aid)  

        {  

            global $dsql,$ftp;  

            $this->IsError = false;  

            $this->ArcID = $aid;  

            $this->PreNext = array();  

     

            $this->dsql = $dsql;  

            $query = "Select channel,typeid from `dede58_arctiny` where id='$aid' ";  

            $arr = $this->dsql->GetOne($query);  

            if(!is_array($arr))  

            {  

                $this->IsError = true;  

            }  

            else  

            {  

                if($arr['channel']==0) { $arr['channel']=1; }  

                $this->ChannelUnit = new ChannelUnit($arr['channel'],$aid);  

                $this->Typelink = new Typelink($arr['typeid']);  

                if($this->ChannelUnit->ChannelInfos['issystem']!=-1)  

                {  

                    $query = "Select arc.*,tp.reid,tp.typedir,ch.addtable  

                    from `dede58_archives` arc  

                            left join dede58_arctype tp on tp.id=arc.typeid  

                            left join dede58_channeltype as ch on arc.channel = ch.id  

                            where arc.id='$aid' ";  

                    $this->Fields = $this->dsql->GetOne($query);  

                }  

                else  

                {  

                    $this->Fields['title'] = '';  

                    $this->Fields['money'] = $this->Fields['arcrank'] = 0;  

                    $this->Fields['senddate'] = $this->Fields['pubdate'] = $this->Fields['mid'] = $this->Fields['adminid'] = 0;  

                    $this->Fields['ismake'] = 1;  

                    $this->Fields['filename'] = '';  

                }  

     

                if($this->Typelink->TypeInfos['corank'] > 0 && $this->Fields['arcrank']==0)  

                {  

                    $this->Fields['arcrank'] = $this->Typelink->TypeInfos['corank'];  

                }  

     

                $this->Fields['tags'] = GetTags($aid);  

                $this->dtp = new DedeTagParse();  

                $this->dtp->SetRefObj($this);  

                $this->SplitPageField = $this->ChannelUnit->SplitPageField;  

                $this->SplitFields = '';  

                $this->TotalPage = 1;  

                $this->NameFirst = '';  

                $this->ShortName = 'html';  

                $this->FixedValues = '';  

                $this->TempSource = '';  

                $this->ftp = &$ftp;  

                $this->remoteDir = '';  

                if(empty($GLOBALS['pageno']))  

                {  

                    $this->NowPage = 1;  

                }  

                else  

                {  

                    $this->NowPage = $GLOBALS['pageno'];  

                }  

     

                //特殊的字段数据处理  

                $this->Fields['aid'] = $aid;  

                $this->Fields['id'] = $aid;  

                $this->Fields['position'] = $this->Typelink->GetPositionlink(true);  

                $this->Fields['typeid'] = $arr['typeid'];  

     

                //设置一些全局参数的值  

                foreach($GLOBALS['PubFields'] as $k=>$v)  

                {  

                    $this->Fields[$k] = $v;  

                }  

     

                //为了减少重复查询,这里直接把附加表查询记录放在 $this->addTableRow 中,在 ParAddTable() 不再查询  

                if($this->ChannelUnit->ChannelInfos['addtable']!='')  

                {  

                    $query = "SELECt * FROM `{$this->ChannelUnit->ChannelInfos['addtable']}` WHERe `aid` = '$aid'";  

                    $this->addTableRow = $this->dsql->GetOne($query);  

                }  

     

                //issystem==-1 表示单表模型,单表模型不支持redirecturl这类参数,因此限定内容普通模型才进行下面查询  

                if($this->ChannelUnit->ChannelInfos['addtable']!='' && $this->ChannelUnit->ChannelInfos['issystem']!=-1)  

                {  

                    if(is_array($this->addTableRow))  

                    {  

                        $this->Fields['redirecturl'] = $this->addTableRow['redirecturl'];  

                        $this->Fields['templet'] = $this->addTableRow['templet'];  

                        $this->Fields['userip'] = $this->addTableRow['userip'];  

                    }  

                    $this->Fields['templet'] = (empty($this->Fields['templet']) ? '' : trim($this->Fields['templet']));  

                    $this->Fields['redirecturl'] = (empty($this->Fields['redirecturl']) ? '' : trim($this->Fields['redirecturl']));  

                    $this->Fields['userip'] = (empty($this->Fields['userip']) ? '' : trim($this->Fields['userip']));  

                }  

                else  

                {  

                    $this->Fields['templet'] = $this->Fields['redirecturl'] = '';  

                }  

            }//!error  

        }  

     

        //php4构造函数  

        function Archives($aid)  

        {  

            $this->__construct($aid);  

        }  

     

        //解析附加表的内容  

        function ParAddTable()  

        {  

            //读取附加表信息,并把附加表的资料经过编译处理后导入到$this->Fields中,以方便在模板中用 {dede:field name='fieldname' /} 标记统一调用  

            if($this->ChannelUnit->ChannelInfos['addtable']!='')  

            {  

                $row = $this->addTableRow;  

                if($this->ChannelUnit->ChannelInfos['issystem']==-1)  

                {  

                    $this->Fields['title'] = $row['title'];  

                    $this->Fields['senddate'] = $this->Fields['pubdate'] = $row['senddate'];  

                    $this->Fields['mid'] = $this->Fields['adminid'] = $row['mid'];  

                    $this->Fields['ismake'] = 1;  

                    $this->Fields['arcrank'] = 0;  

                    $this->Fields['money']=0;  

                    $this->Fields['filename'] = '';  

                }  

     

                if(is_array($row))  

                {  

                    foreach($row as $k=>$v) $row[strtolower($k)] = $v;  

                }  

                if(is_array($this->ChannelUnit->ChannelFields) && !empty($this->ChannelUnit->ChannelFields))  

                {  

                    foreach($this->ChannelUnit->ChannelFields as $k=>$arr)  

                    {  

                        if(isset($row[$k]))  

                        {  

                            if(!empty($arr['rename']))  

                            {  

                                $nk = $arr['rename'];  

                            }  

                            else  

                            {  

                                $nk = $k;  

                            }  

                            $cobj = $this->GetCurTag($k);  

                            if(is_object($cobj))  

                            {  

                                    foreach($this->dtp->CTags as $ctag)  

                                    {  

                                            if($ctag->GetTagName()=='field' && $ctag->GetAtt('name')==$k)  

                                            {  

                                                //带标识的专题节点  

                                                if($ctag->GetAtt('noteid') != '') {  

                                                    $this->Fields[$k.'_'.$ctag->GetAtt('noteid')] = $this->ChannelUnit->MakeField($k, $row[$k], $ctag);  

                                                }  

                                                //其它字段  

                                                else {  

                                                    $this->Fields[$nk] = $this->ChannelUnit->MakeField($k, $row[$k], $ctag);  

                                                }  

                                            }  

                                    }  

                            }  

                            else  

                            {  

                                $this->Fields[$nk] = $row[$k];  

                            }  

                            if($arr['type']=='htmltext' && $GLOBALS['cfg_keyword_replace']=='Y' && !empty($this->Fields['keywords']))  

                            {  

                                $this->Fields[$nk] = $this->ReplaceKeyword($this->Fields['keywords'],$this->Fields[$nk]);  

                            }  

                        }  

                    }//End foreach  

                }  

                //设置全局环境变量  

                $this->Fields['typename'] = $this->Typelink->TypeInfos['typename'];  

                @SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives');  

            }  

            //完成附加表信息读取  

            unset($row);  

     

            //处理要分页显示的字段  

            $this->SplitTitles = Array();  

            if($this->SplitPageField!='' && $GLOBALS['cfg_arcsptitle']='Y'  

            && isset($this->Fields[$this->SplitPageField]))  

            {  

                $this->SplitFields = explode

  • 转载请注明:文章转载自 www.mshxw.com
    本文地址:https://www.mshxw.com/it/5676.html
    我们一直用心在做
    关于我们 文章归档 网站地图 联系我们

    版权所有 (c)2021-2022 MSHXW.COM

    ICP备案号:晋ICP备2021003244-6号