织梦 新建 php arclist,织梦arclist按照自定义字段来调用相关文章

news/2024/7/5 1:41:28

织梦arclist按照自定义字段来调用相关文章,这对于想要在首页调用某个自定义字段的文章的同学来讲,非常不错,接下来看教程

打开 include aglibrclist.lib.php 找到:

//时间限制(用于调用最近热门文章、热门评论之类),这里的时间只能计算到天,否则缓存功能将无效

if($subday > 0){

$ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y'));

$limitday = $ntime - ($subday * 24 * 3600);

$orwheres[] = " arc.senddate > $limitday ";

}

在下面添加下面代码:

//自定义字段关键字条件

if($ctag->GetAtt('addk')!='')

{

$addkeywords = explode(',' , trim($ctag->GetAtt('addk')));

$addf = $ctag->GetAtt('addf') ? $ctag->GetAtt('addf') : "body";

$filtersql = '';

$n = 1;

foreach($addkeywords as $k)

{

if(trim($k)=='') continue;

else $k = addslashes($k);

$filtersql .= ($filtersql=='' ? " find_in_set('$k', addf.$addf) " : " OR find_in_set('$k', addf.$addf) ");

$n++;

}

$orwheres[] = $filtersql;

}

模板调用标签:

{dede:arclist typeid='1' row='10' channelid='3' addfields='adda,addb,addc' addk='测试字段' addf='adda'}

你的循环代码

{/dede:arclist}

标签说明:

channelid='3' //模型id号

addfields='adda,addb,addc' //自定义字段

addk='测试字段' //要调用的自定义字段值

addf='adda' //要调用的自定义字段


http://lihuaxi.xjx100.cn/news/239175.html

相关文章

CES上百度无人车队炫技,陆奇要用“China speed”改变世界

本文由 「AI前线」原创,原文链接:CES上百度无人车队炫技,陆奇要用“China speed”改变世界编辑|EmilyAI 前线导读:“美国当地时间 1 月 8 日,百度在拉斯维加斯举办了主题为“AI is Changing the World, Chi…

卸载linux系统装win,如何在计算机上删除 Linux 并安装 Windows

多个 IDE 驱动器Device Boot Start End Blocks Id System/dev/hda1 * 1 500 4016218 83 Linux native (IDE hard drive 1, partition 1)/dev/hda2 501 522 176715 82 Linux swap (IDE hard drive 1, partition 2)/dev/hdb1 1 500 4016218 83 Linux native (IDE hard drive 2, p…

latex 插图解释_大O符号-只需插图和视频即可解释

latex 插图解释Big O notation is used to communicate how fast an algorithm is. This can be important when evaluating other people’s algorithms, and when evaluating your own! In this article, I’ll explain what Big O notation is and give you a list of the m…

IntelliJ IDEA控制台输出中文乱码问题解决

如果还不行,那么再极端的设置,在IDEA启动的时候强制设置为UTF-8: 打开增加-Dfile.encodingUTF-8,重启Intellij IDEA 再或者直接在项目运行的时候加入UTF-8的设置 如果还是不行,那么你可能装了一个假的IDEA。

[算法] [常微分方程] [欧拉法 改进欧拉法 经典R-K算法]

1 #include<iostream>2 #include<cmath>3 #include<cstdio>4 #include<iomanip>5 using namespace std;6 double h0.1;//步差7 double xi[11]{0};8 double ol_yi[11]{1};9 double gol_yi[11]{1}; 10 double rk_yi[11]{1}; 11 double real_yi[11]{1}; 1…

linux 端口 流量统计,Linux下如何对端口流量进行统计

在不修改源代码的情况下对程序暴露端口流量进行监控统计&#xff0c;可以利用Linux中自带的Iptable添加简单的规则让其起到端口流量统计的作用。但是需要注意的是在服务器重启、Iptable服务重启的时候统计数据会被重置清零。添加需要统计的端口1、输入监控下面示例是监控目标端…

HTML添加上传图片并进行预览

使用说明&#xff1a;新建文件&#xff0c;直接复制粘贴&#xff0c;保存文件为html 格式&#xff0c;在浏览器运行即可&#xff1b; 第一种&#xff1a; <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loos…