加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > CMS系统 > 正文

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

发布时间:2020-05-23 18:57:18 所属栏目:CMS系统 来源:互联网
导读:我们在dedecms做模板时候,列表页有li代码,会引起页面变形 这个修改具体是要修改arc.archives.class.php于arc.listview.class.php文件 以下附件是V5.6UTF8版本修改后的文件 arc.archives.class.php ?php if(!defined(DEDEINC)) { exit(Request Error!); } r

我们在dedecms做模板时候,列表页有<li>代码,会引起页面变形

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

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

arc.archives.class.php

<?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 `zuimoban_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 `zuimoban_archives` arc

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

left join zuimoban_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,$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

上一篇:dedecms站内链接(描文本)的增强与优化

下一篇:dede列表页输入数字,跳转指定页面

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读