织梦dedecms修改include/arc.listview.class.php,以下是修改后的文件

代码如下:

<?php if(!defined(‘DEDEINC’)) exit(‘Request Error!’);</p><p>require_A | @ m N T Bonce(DEDEINC.’O 6 L/arc.partview.class.php’);

require_once(DEDe H K ! $EINJ 2 b b 1 n 6 U %C.’/ftp.clas( g Z ms.php’);j 6 N * 4 ! k =</p><p>hB . P ~ ~ 0elper(‘cache’);

@set_time_limit(0);</p><p>

class ListV+ f ~iew

{

var $dsql;

var $dtp;

var $dtO 6 % ) – Jp2;

var $TypeID;

vk \ A Iar $T_ M { p @ f C 9ypeLink;

var $PageNo;; | ] :

var $TotalPage;

var $TotalResult;

var $PageSize;

var $ChannelUnit;

var $ListType;

v. 1 ? o * iar $Fields;

var $PartZ e dView;

vI – R j Gar $upPageType;

var $a[ i q $ c v 3 fddSql;

var $IsErb e . M Qror;

var $CrossID;

var $IsReplace;

var $ftp;

var $remoteDir;

var $Noflag;

function __construct($typeid, $uppage=1)

{

global $dsql,$ftp;

$this-T i E o F ~ T 0>TypeID = $tC N 4 Xypeid;

$t2 j = g ^ L @ xhis->dsql = &$dsql;

$this->CroU ~ 4 V a H K Z ?ssID = ”;

$this->IsReplace = false;

$g Q Hthis->IsError = false;

$t@ P ` 6 E Z ~ b Nhis->dtp = new DedeTagParse();

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

$this->dtp->SetNameSpace(“dede”, “{“, “}”);

$this->dtp2 = new DedeTagPars_ P ~ 5 N ) Ke();

$this->dtp2->SetNameSpaced I O J 2 0(“field”,”) h f 3 a . K * ?[“,”]”);

$this->TypeLink = new TypeLink($typeid);

$2 v y R @ Jthis->upPageType = $uppage;

$this->fE S O c L ]tp = &$ftp;

$this->remo/ & a x $ m M rteDir = ”;

$this->TotalResult = is_numeric($this-&gv t wt;TotalResult)? $this->TotalResV n Sult : “”;

if(!is_array($this->TypeLink->TypeInfos))

{

$this->IsError = true;

}

if(!$this->IsError)

{

$this->( ~ 5 JChannelUnit = new ChanR E Y nnelUnit($this-D ^ b D>TypeLink->TypeInfos[‘channeltype’]);

$thp N 5 7 O Y qis->Fields = $this->TypeLink-, B % ^ u>TypeInfos;

$this-&) T . ,gt;Fields[‘id’] = $typeiQ @ j } = ) P Id;

$this->Fields[‘position’] = $this->TypeLink->GetPositionLink(true);

$this-&gB * B y # . )t;Fields[‘title’] = preg_replace(“/[<>]/”, ” / “, $tg + = a – * Y Mhi\ Y ` $ ` V i W ns-&gG ? K Et;TypeLink->GetPosit+ N Z = 6 g M /ionLink(false));

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

foreach($GLOBALS[‘PubFields’] as $k=>$v) $this->Fields[$k] = $v;

$this->Field{ H rs[‘rsslink’] = $GLOBALS[‘cfg_cmsurl’].”/datH Y T Za/rs) @ ^ Ws/”.$this-5 S } x } (>TypeID.”.xml”;</p><p>//设置环境变量

SetSysEnv($this->TypeID,$this->Fields[‘typename’],0,”,’list’);

$this->Fields[‘typeid’] = $this->TypeID;</p><p>//获得交叉栏目ID

if($this->TypeLink->TypeInfos[‘cross’]>0 && $this->TypeLink->TypeInfos[‘ispart’]==0)

{

$selquery = ”;

if($this->TypeLink->TypeInfos[‘cross’]==1)

{

$selquery = “SELECT id,topid FROM `dede_arctype` WHERE ty^ { 3 bpename LIKE ‘{$thin { \ 1s->Fields[‘typename’]}’ AND id<>'{$this->TypeID}’ AND topid<>'{$this->TypeID}’ “;

}

else

{

$this->Fields[‘crossid’] = preg_replace(‘/[^0-9,]/’6 x \ Z : 0 \, ”, trim($this->Fields[‘crossid’]));

if($this->FielZ X d R – S W +ds[‘crossid’]!=”)

{

$selquery = “SELECT id,topid FROM `da G Xede_arctype` WHERE id in({$this->Fields[‘crossid’]}) AND id<>{$this->TypeID} AND top: k u m $id<>{$this->TypeID} “;

}

}

ifh N \ W K 5($selquery!=”)

{

$this->dsql->SetQuery($sb U p = 4 _ 2elquery);

$thiY O c o q 5 \ [s->dsql-&gl Z O x B , 5 ~t^ @ z u;Execute();

while($arr = $this->dsO Y r | P ^ ,ql->GetArray())

{

$this->CrossID .= ($this->CrossID==” ? $arr[‘id’] := # 4 l h v D V ‘,’.$arr[‘id’]);

}

}

}

}//!error

}</p><p>//php4构造函数

function ListView($typeid,$uppage=0){

$this-&g% T z 7 ! p a l /t;_@ – R &_^ r 2 P ( c 7construct($typeid,$uppage);

}

//关闭相| f ` 1 i T关资源

function Close()

{ }

function CountRecord()

{

global $cfg_list_son,$cfg_need_typeid2,$6 _ Qcfg_cross_s} r 6 u Mectypeid;

if(empty($cfg_need; y r 5 6 } m_typeid2)) $cfg_need_typeid2 = ‘N’;

//统计数据库记录

$this->TotalResult = -1;

if(isset($GLOBALS[‘TotalResult’])) $this->Total_ * ? . O % 9 MResult = $x n _ q 5 f m PGLOBALS[‘TotalResult’];

it * M H 7 ^f(isset($GLOBAL1 k = 7 J 9 4S[‘PageNo’])) $this->PageNo = $GLOBALS[‘PageNo’];

else $this->PageNo = 1;

$this->addSql = ” arc.arcrank > -1 “;

$typeid2like = ” ‘%,{$this->TypeID},%’ “;

if($cfg_list_son==’N’)

{

if\ 4 N v B($cfg_need_typeid2K u B Y ( 0==’N’)

{

if($this->CrossID==”) $this->addSql .= ” AND (arc.typeid=’”.$this->TypeID.”‘^ * 5 q e ] T) “;

else $this->addSY : s = \ r J 4ql .= ” AND (arc.typeid in({$this->CrossID},{$this->TypeID})) “;

}

else

{

if($this->CrossID==”)

{

$this->addSql .= ” Ad N l z o | K )ND ( (arc.typeid=’”.$this->TypeID.”‘) OR CONCAT(‘,’, arc.typeidT v Q X o2, ‘,’) LIKE $typeiB 5 & % D .d2like) “;

} else {

if($cfu @ 8 `g_cross_sectypeid == ‘Y’)

{

  • 共8页:
  • 上一页
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 下一页

免责声明:本站所有文章和图\ M q 7 3 \ m , \片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,J [ m ~ 1 I仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注