首页 > 教程 >
织梦标签dede:list中增加noflag属性的方法支持5.7版本
2023-02-24教程围观次
简介织梦dedecms修改include/arc.listview.class.php,以下是修改后的文件代码如下:
织梦dedecms修改include/arc.listview.class.php,以下是修改后的文件
代码如下:
<?php if(!defined(‘DEDEINC’)) exit(‘Request Error!’);</p><p>require_once(DEDEINC.’/arc.partview.class.php’);
require_once(DEDEINC.’/ftp.class.php’);</p><p>helper(‘cache’);
@set_time_limit(0);</p><p>
class ListView
{
var $dsql;
var $dtp;
var $dtp2;
var $TypeID;
var $Type ;
var $PageNo;
var $TotalPage;
var $TotalResult;
var $PageSize;
var $ChannelUnit;
var $ListType;
var $Fields;
var $PartView;
var $upPageType;
var $addSql;
var $IsError;
var $CrossID;
var $IsReplace;
var $ftp;
var $remoteDir;
var $Noflag;
function __construct($typeid, $uppage=1)
{
global $dsql,$ftp;
$this->TypeID = $typeid;
$this->dsql = &$dsql;
$this->CrossID = ”;
$this->IsReplace = false;
$this->IsError = false;
$this->dtp = new DedeTagParse();
$this->dtp->SetRefObj($this);
$this->dtp->SetNameSpace(“dede”, “{“, “}”);
$this->dtp2 = new DedeTagParse();
$this->dtp2->SetNameSpace(“field”,”[“,”]”);
$this->Type = new Type ($typeid);
$this->upPageType = $uppage;
$this->ftp = &$ftp;
$this->remoteDir = ”;
$this->TotalResult = is_numeric($this->TotalResult)? $this->TotalResult : “”;
if(!is_array($this->Type ->TypeInfos))
{
$this->IsError = true;
}
if(!$this->IsError)
{
$this->ChannelUnit = new ChannelUnit($this->Type ->TypeInfos[‘channeltype’]);
$this->Fields = $this->Type ->TypeInfos;
$this->Fields[‘id’] = $typeid;
$this->Fields[‘position’] = $this->Type ->GetPosition (true);
$this->Fields[‘ ’] = preg_replace(“/[<>]/”, ” / “, $this->Type ->GetPosition (false));
//设置一些全局参数的值
foreach($GLOBALS[‘PubFields’] as $k=>$v) $this->Fields[$k] = $v;
$this->Fields[‘rss ’] = $GLOBALS[‘cfg_cmsurl’].”/data/rss/”.$this->TypeID.”. ”;</p><p>//设置环境变量
SetSysEnv($this->TypeID,$this->Fields[‘typename’],0,”,’list’);
$this->Fields[‘typeid’] = $this->TypeID;</p><p>//获得交叉栏目ID
if($this->Type ->TypeInfos[‘cross’]>0 && $this->Type ->TypeInfos[‘ispart’]==0)
{
$selquery = ”;
if($this->Type ->TypeInfos[‘cross’]==1)
{
$selquery = “SELECT id,topid FROM `dede_arctype` WHERE typename LIKE ‘{$this->Fields[‘typename’]}’ AND id<>'{$this->TypeID}’ AND topid<>'{$this->TypeID}’ “;
}
else
{
$this->Fields[‘crossid’] = preg_replace(‘/[^0-9,]/’, ”, trim($this->Fields[‘crossid’]));
if($this->Fields[‘crossid’]!=”)
{
$selquery = “SELECT id,topid FROM `dede_arctype` WHERE id in({$this->Fields[‘crossid’]}) AND id<>{$this->TypeID} AND topid<>{$this->TypeID} “;
}
}
if($selquery!=”)
{
$this->dsql->SetQuery($selquery);
$this->dsql->Execute();
while($arr = $this->dsql->GetArray())
{
$this->CrossID .= ($this->CrossID==” ? $arr[‘id’] : ‘,’.$arr[‘id’]);
}
}
}
}//!error
}</p><p>//php4构造函数
function ListView($typeid,$uppage=0){
$this->__construct($typeid,$uppage);
}
//关闭相关资源
function Close()
{ }
function CountRecord()
{
global $cfg_list_son,$cfg_need_typeid2,$cfg_cross_sectypeid;
if(empty($cfg_need_typeid2)) $cfg_need_typeid2 = ‘N’;
//统计数据库记录
$this->TotalResult = -1;
if(isset($GLOBALS[‘TotalResult’])) $this->TotalResult = $GLOBALS[‘TotalResult’];
if(isset($GLOBALS[‘PageNo’])) $this->PageNo = $GLOBALS[‘PageNo’];
else $this->PageNo = 1;
$this->addSql = ” arc.arcrank > -1 “;
$typeid2like = ” ‘%,{$this->TypeID},%’ “;
if($cfg_list_son==’N’)
{
if($cfg_need_typeid2==’N’)
{
if($this->CrossID==”) $this->addSql .= ” AND (arc.typeid='”.$this->TypeID.”‘) “;
else $this->addSql .= ” AND (arc.typeid in({$this->CrossID},{$this->TypeID})) “;
}
else
{
if($this->CrossID==”)
{
$this->addSql .= ” AND ( (arc.typeid='”.$this->TypeID.”‘) OR CONCAT(‘,’, arc.typeid2, ‘,’) LIKE $typeid2like) “;
} else {
if($cfg_cross_sectypeid == ‘Y’)
{
下载链接:网站源码/小程序源码/网站模板下载
下载排行
- WordPress主题 JustNews5.2.2 + QAPress问答插件适合源码站虚拟资源站个人博客
- ThinkPHP高仿蓝奏云网盘系统源码/对接易支付系统程序
- 最新JustMedia V2.7.3主题破解版去授权WordPress主题模板
- 最新去水印小程序源码分享/无需后台/对接接口/支持全网去水印功能
- 自带多平台解析接口短视频去水印图集水印小程序源码下载
- TooNaughty网址导航主题/WordPress主题下载
- 最新短视频去水印小程序源码/带流量主/外卖CPS系统/批量解析/修改MD5
- 某鱼最近卖的很火蓝色版微信去水印小程序源码+接口
- 最新版去水印小程序源码/基于WordPress的短视频去水印小程序源码
- 起点导航系统源码最新V2.6开源可运营版