织梦栏目列表页dede:list按flag属性调用文章方法

织梦栏目列表页dede:list按flag属性调用文章方法,跟着下面的教程来操作

打开 include/arc.listview.class.php 找到,大概在45行

var $remoteDir;

在它下面加入一行

var $Flag;

织梦栏目列表页dede:list按flag属性调用文章方法,织梦栏目列表页dede:list按flag属性调用文章方法,第1张

继续找到

$this->remoteDir = '';

在它下面加入一行

$this->Flag = '';

 

继续找到,大概在227行 至 267行的全部

//初始化列表模板,并统计页面总数...

织梦栏目列表页dede:list按flag属性调用文章方法,织梦栏目列表页dede:list按flag属性调用文章方法,第2张

把他们剪切放到,大概在155行的下面

$this->addSql  = " arc.arcrank > -1 ";

放它的下面来

如图

织梦栏目列表页dede:list按flag属性调用文章方法,织梦栏目列表页dede:list按flag属性调用文章方法,第3张

继续找到

if($ctag->GetAtt("pagesize")!="")

在它上面加入

if($ctag->GetAtt("flag")!="") {$this->Flag = 1; $flags = explode(',', $ctag->GetAtt("flag"));for($i=0; isset($flags[$i]); $i++) $this->addSql .= " AND FIND_IN_SET('{$flags[$i]}', arc.flag)>0 "; }

织梦栏目列表页dede:list按flag属性调用文章方法,织梦栏目列表页dede:list按flag属性调用文章方法,第4张

继续找到

$row = $this->dsql->GetOne($cquery);

在它上面加入

if($this->Flag != "") { $cquery = "SELECT COUNT(*) AS dd FROM `dede_archives` arc WHERE ".$this->addSql; }

织梦栏目列表页dede:list按flag属性调用文章方法,织梦栏目列表页dede:list按flag属性调用文章方法,第5张

最后找到

if(preg_match('/hot|click|lastpost/', $orderby))

改成

if(preg_match('/hot|click|lastpost|weight/', $orderby) || $this->Flag != "")

织梦栏目列表页dede:list按flag属性调用文章方法,织梦栏目列表页dede:list按flag属性调用文章方法,第6张

织梦栏目列表页flag标签的写法

{dede:list pagesize='10' titlelen='250' flag='c,p'}

{/dede:list}

flag='c,p'  支持一个属性和多个属性同时调用


1、本网站名称:源码村资源网
2、本站永久网址:https://www.yuanmacun.com
3、本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长进行删除处理。
4、本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
5、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
6、本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
源码村资源网 » 织梦栏目列表页dede:list按flag属性调用文章方法
您需要 登录账户 后才能发表评论

发表评论

欢迎 访客 发表评论