百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>织梦CMS教程> dedecms织梦栏目列表页dede:list按flag属性调用文章方法
分享文章到:

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

发布时间:02/15 来源:未知 浏览: 关键词:

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

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

var $remoteDir;

在它下面加入一行

var $Flag;

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

继续找到

$this->remoteDir = '';

在它下面加入一行

$this->Flag = '';

 

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

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

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

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

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

放它的下面来

如图

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

继续找到

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属性调用文章方法

继续找到

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

在它上面加入

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

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

最后找到

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

改成

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

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

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

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

{/dede:list}

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

 
打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

相关文章

共有116人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板