我们在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, $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