您现在的位置是:首页 > 教程 > dedecms教程dedecms教程
让织梦arclist支持notypeid属性的方法
从寒2023-09-19 17:20:53dedecms教程已有人查阅
导读织梦默认的arclist标签支持typeid的调用,也就是给文章列表指定来源栏目,有时候栏目过多,一个一个写就很复杂,所以用排除的方法写更方便
织梦默认的arclist标签支持typeid的调用,也就是给文章列表指定来源栏目,有时候栏目过多,一个一个写就很复杂,所以用排除的方法写更方便,以此引入notypeid属性。
主要修改文件是/include/taglib/下的arclist.lib.php文件,首先搜索:
return lib_arclistDone
在函数末尾加上:,$ctag->GetAtt('notypeid'),原来的代码变成如下的样子:
主要修改文件是/include/taglib/下的arclist.lib.php文件,首先搜索:
return lib_arclistDone
在函数末尾加上:,$ctag->GetAtt('notypeid'),原来的代码变成如下的样子:
return lib_arclistDone
(
$refObj, $ctag, $typeid, $ctag->GetAtt('row'), $ctag->GetAtt('col'), $titlelen, $infolen,
$ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), $listtype, $orderby,
$ctag->GetAtt('keyword'), $innertext, $envs['aid'], $ctag->GetAtt('idlist'), $channelid,
$ctag->GetAtt('limit'), $flag,$ctag->GetAtt('orderway'), $ctag->GetAtt('subday'), $ctag->GetAtt('noflag'),
$tagid,$pagesize,$isweight,
$ctag->GetAtt('notypeid')
);
然后再搜索function lib_arclistDone,同样在这个函数的后面加上一句代码:,$notypeid=0,修改后的函数变成下面的样子:
function lib_arclistDone(&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlelen=30, $infolen=160,
$imgwidth=120, $imgheight=90, $listtype='all', $orderby='default', $keyword='',
$innertext='', $arcid=0, $idlist='', $channelid=0, $limit='', $att='', $order='desc', $subday=0, $noflag='',$tagid='', $pagesize=0, $isweight='N',$notypeid=0)
之后,搜索以下代码:$orwheres[] = ' arc.arcrank > -1 ';,在这个代码的前面加入如下代码:
if(!empty($notypeid))
{
$orwheres[] = " and arc.typeid NOT IN (".GetSonIds($notypeid).")";
}
上传覆盖之后即可使用arclist的notypeid属性,使用方法如下:
{dede:arclist row=6 orderby=pubdate notypeid='7,8,9'}
意思是按更新时间,调用除了栏目id是7,8,9的其余栏目中的6条数据。
本文标签:
很赞哦! ()
相关文章
- 织梦dedecms网站栏目自动添加nofollow的实现方法
- 织梦dedecms5.7tags标签显示未审核,字母大写就找不到文章
- 织梦系统dedecms栏目及文档登录后跳转到登陆前页面的方法
- dedecms友情链接中去掉织梦链投放修改方法
- 织梦dedecms系统后台安全提示怎么去除
- dedecms织梦专题节点列表内容实现分页的步骤方法
- dedecms织梦系统内容页英文字母不换行的解决方法
- 织梦dedecms站点data目录位置变动调整验证码不显示怎么办
- 织梦dedecms时间格式代码汇总
- 织梦dedecms近三天发布文章显示红色日期或加上new图标的方法
- 织梦dedecms实现三级栏目_二级栏目_一级栏目_网站名称效果代
- 织梦dedecms中怎么删除指定IP的评论
随机图文
-
织梦dedecms修改上一篇、下一篇文字字数的方法
打开/include/arc.archives.class.php文件找到$this->PreNext[pre]="上一篇:{$preRow[titl -
dedecms官方网站或演示地址字段长度的修改方法
在DEDE后台的SQL运行器里,执行以下语句:官方网站字段officialUrl:演示地址字段officialDemo:注意:前台读取的时候是小写字母: -
织梦dedecms网页中直接显示pdf文档方法
我们在用dedecms织梦建站时候,需要在网页中直接加载pdf文档,这个需要怎么操作呢?其实有一些浏览器中你打开一个pdf的链接是可以直接预览的,比如谷歌 -
织梦内容管理系统dedecms文章列表动态调用示例
啥都不说了,这个页面就是用于ajax的,直接上代码,哈哈,喜欢的人到时候送我几个IP就行了
留言与评论 (共有 条评论) |