惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
人人都是产品经理
人人都是产品经理
M
MIT News - Artificial intelligence
C
Cybersecurity and Infrastructure Security Agency CISA
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
爱范儿
爱范儿
Spread Privacy
Spread Privacy
P
Palo Alto Networks Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
T
The Blog of Author Tim Ferriss
The Cloudflare Blog
WordPress大学
WordPress大学
小众软件
小众软件
H
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Blog — PlanetScale
Blog — PlanetScale
V2EX - 技术
V2EX - 技术
H
Hacker News: Front Page
Last Week in AI
Last Week in AI
D
DataBreaches.Net
V
V2EX
S
Securelist
C
CXSECURITY Database RSS Feed - CXSecurity.com
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tenable Blog
Cloudbric
Cloudbric
月光博客
月光博客
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
N
News and Events Feed by Topic
K
Kaspersky official blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
S
Secure Thoughts
S
Security Affairs
W
WeLiveSecurity
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
The Last Watchdog
The Last Watchdog
AI
AI
有赞技术团队
有赞技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
罗磊的独立博客
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
Netflix TechBlog - Medium
PCI Perspectives
PCI Perspectives
SecWiki News
SecWiki News
IT之家
IT之家
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog

北门清燕

🎙️ 科技热文播报 - 2026-03-14 【vscode扩展】apis-tester Notion工具人bot VPS橱窗 - 一个简单的哪吒面板主题 ios17.0可以安装Trollstore了 windows服务器安装mysql踩坑指北 为哪吒面板增加视频背景 继续折腾astro serv00部署FreshRSS 【原创】油猴脚本:哪吒VPS橱窗后台脚本 哪吒面板终极进化之VPS橱窗 哪吒面板default主题小鸡底部增加购买同款按钮 Typecho二开魔改简单指北 【原创】油猴脚本:论坛快捷回帖 简单米表:Typecho-Simple-Mibiao Windows 11 23H2更新遇到下载错误解决方法 Microsoft 365 E5开发者订阅管理员双重认证丢失解决方法 Virtualbox安装Ubuntu不完全指北 一剑开天门 将chrome谷歌浏览器轻松打造成rss阅读器 地震云 罗刹海市 关于笑果我觉得还是罗翔老师说的好 推荐正在玩的游戏:SimpleMMO,附游戏助手SMMOHelper 集成Elog使用notion数据库 【原创】ios捷径:法定工作日打卡提醒 测试AI 再次折腾hexo docker部署freshrss apifox自动导入apidoc接口数据 node项目部署到ftp vite项目使用tinymce插件axupimgs实现多图片上传 tomcat服务器上utf8编码的文件乱码解决方法 快捷指令:图床 七牛上传视频获取视频封面和缩略图 注销网站得慎重 【原创】ios捷径:捷径库 【原创】ios捷径:自动壁纸 【原创】ios捷径:倒班闹钟 idea找回执行git pull操作后,被覆盖的本地未提交的代码 altserver跳坑指北 吐一吐三丰云免费服务器 Microsoft Store中的应用软件如何备份数据 卖盘 利用frp实现微软远程桌面管理内网电脑之不完全指北 apicloud用tortoisesvn管理代码,实现按不同分支编译打包app vscode插件提示:command 'extension.updateSettings' not found解决方法 apicloud使用alipayplus支付宝支付模块注意事项 【原创】越狱插件安装注意事项 api.closeFrameGroup的一些注意事项 【原创】ios捷径:我的心愿单 【原创】ios捷径:一键获取urlscheme 【原创】ios捷径:一键签到 【原创】ios捷径:qq群一键签到 【原创】ios捷径:百度搜索风云榜2.1.0 【原创】ios捷径:一键天气预报 【原创】ios捷径:微博热搜榜2.0强势更新 ios捷径:bmqy捷径库 自定义IntelliJ IDEA配置和插件的存放目录,以方便同步idea配置 wordpress平台next主题 vscode本地调试asp ajaxFileUpload上传成功也执行error方法 更换回wordpress。。。 一键收取熊猫守护者威力值 vscode软件窗口标题栏显示文件完整路径 微信小程序“支付签名验证失败”问题的解决参考 “idea已连接上ftp但看不到文件”的解决办法 js格式化时间显示 js实现中文转换成拼音 h5移动端ios输入法软键盘导致fixed布局bug的解决方案 生命不息,折腾不止之“hexo” echarts中tooltips自定义数据结构与样式 淘米辅助工具 聚名网辅助工具 仿站制作6 wordpress新添加页面显示评论 华为mate8(b584)root过程简要记录 asp解析json的方法 为子主题增加主题选项功能 自制chrome扩展:百度云分享链接一键登录 清燕的云集小店 Google play下载app状态栏进度显示异常的应对方法 吐槽百度翻译之离线翻译包 现在只有人民才是真正的为人民 吐槽腾讯大王卡 wordpress添加twentysixteen子主题 idea配置less自动编译 使用chrome浏览器调试移动端web页面 idea编译less并使用autoprefixer sublime自动编译less2css插件,保存时提示系统找不到指定文件 吐一吐中信的升白金 Android手机下输入框获取焦点时, 输入法挡住输入框bug的解决方法 wordpress头像不显示解决方法 用子主题functions.php添加自定义功能后访问网站报错解决方法 ueditor百度编辑器添加自定义模板并设为默认 仿站制作5 读老树画画随感 VMware-workstation 12 安装 Mac OS X 10.10 做梦想 再咏咳
dedecms使用ajax调用指定栏目文章列表
bmqy · 2015-07-03 · via 北门清燕

打开或复制一份plus目录下的list.php文件,在require_once(dirname( FILE).“/../include/common.inc.php”);

这段代码后加入以下代码:

| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | if(isset($_GET['ajax'])){ $typeid = isset($_GET['typeid']) ? intval($_GET['typeid']): 0;//传递过来的分类ID $page = isset($_GET['page']) ? intval($_GET['page']): 0;//页码 $pagesize = isset($_GET['pagesize']) ? intval($_GET['pagesize']): 15;//每页多少条,也就是一次加载多少条数据 $start = $page>0 ? ($page-1)*$pagesize : 0;//数据获取的起始位置。即limit条件的第一个参数。 $typesql = $typeid ? " WHERE typeid='$typeid" : '';//这个是用于首页实现瀑布流加载,因为首页加载数据是无需分类的,所以要加以判断,如果无需 $total_sql = "SELECT COUNT(id) as num FROM '#@__archives' $typesql "; $temp = $dsql->GetOne($total_sql); $total = 0;//数据总数 $load_num =0; if(is_array($temp)){ $load_num= round(($temp['num']-15)/$pagesize);//要加载的次数,因为默认已经加载了 $total = $temp['num']; } $sql = "SELECT a.*,t.typedir,t.typename,t.isdefault,t.defaultname,t.namerule, t.namerule2,t.ispart, t.moresite,t.siteurl,t.sitepath FROM '#@__archives' as a JOIN '#@__arctype' AS t ON a.typeid=t.id $typesql ORDER BY id DESC LIMIT $start,$pagesize"; $dsql->SetQuery($sql); $dsql->Execute('list'); $statu = 0;//是否有数据,默认没有数据 $data = array(); } | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | $index = 0; while($row = $dsql->GetArray("list")){ $row['info'] = $row['info'] = $row['infos'] = cn_substr($row['description'],160); $row['id'] = $row['id']; $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'], $row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']); $row['typeurl'] = GetTypeUrl($row['typeid'],$row['typedir'],$row['isdefault'],$row['defaultname'],$row['ispart'], $row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']); if($row['litpic'] == '-' '' $row['litpic'] == ''){ $row['litpic'] = $GLOBALS['cfg_cmspath'].'/images/defaultpic.gif'; } if(!preg_match("#^http:\/\/#i", $row['litpic']) &&$GLOBALS['cfg_multi_site'] == 'Y'){ $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; } $row['picname'] = $row['litpic'];//缩略图 $row['stime'] = GetDateMK($row['pubdate']); $row['typelink'] = ".$row[" typeurl'< span>]."'>".$row['typename']."";//分类链 $row['fulltitle'] = $row['title'];//完整的标题 $row['title'] = cn_substr($row['title'], 60);//截取后的标题 $data[$index] = $row; $index++; } if(!empty($data)){ $statu = 1;//有数据} $result =array('statu'=>$statu,'list'=>$data,'total'=>$total,'load_num'=>$load_num); echo json_encode($result);//返回数据exit(); | | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

以上代码摘自: 百度经验

js代码输出获取到的内容:

| 1 2 3 4 5 6 7 8 9 10 | $('.btn').on("click",function(){ $("#content-box").hide(); $("#content-box").html("数据加载中..."); $("#content-box").show(); var htmlobj= $.ajax({ url:"/plus/list.php?tid="+$(this).attr("data-typeid"), async:false}); $("#content-box").html(htmlobj.responseText); }); | | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

欢迎关注我的其它发布渠道

公众号小程序

文章标题:dedecms使用ajax调用指定栏目文章列表

文章作者:bmqy

文章链接:https://bmqy.net/1501.html[复制]

最后修改时间:


商业转载请联系站长获得授权,非商业转载请注明本文出处及文章链接,您可以自由地在任何媒体以任何形式复制和分发作品,也可以修改和创作,但是分发衍生作品时必须采用相同的许可协议。
本文采用CC BY-NC-SA 4.0进行许可。