您现在的位置是:首页 > cms教程 > DedeCMS教程DedeCMS教程

织梦火车采集器采集完文章并更新栏目页

天荷2023-09-12DedeCMS教程已有人查阅

导读打开文件 /dede/inc/inc_archives_functions.php1、在之后增加方法/*火车头采集自动更新主页*/function Mak

打开文件 /dede/inc/inc_archives_functions.php
1、在之后增加方法
/*火车头采集自动更新主页*/
function MakeIndex()
{
global $dsql,$cfg_basedir,$cfg_templets_dir,$cfg_df_style;
require_once(DEDEINC.'/arc.partview.class.php');
$envs = $_sys_globals = array();
$envs['aid'] = 0;
$pv = new PartView();
$row = $pv->dsql->GetOne('SELECT * FROM `dede_homepageset`');
$templet = str_replace("{style}", $cfg_df_style, $row['templet']);
$homeFile = dirname(__FILE__).'/../'.$row['position'];
$homeFile = str_replace("//", "/", str_replace("\\", "/", $homeFile));
$fp = fopen($homeFile, 'w') or die("无法更新网站主页到:$homeFile 位置");
fclose($fp);
$tpl = $cfg_basedir.$cfg_templets_dir.'/'.$templet;
if(!file_exists($tpl))
{
$tpl = $cfg_basedir.$cfg_templets_dir.'/default/index.htm';
if(!file_exists($tpl)) exit("无法找到主页模板:$tpl ");
}
$GLOBALS['_arclistEnv'] = 'index';
$pv->SetTemplet($tpl);
$pv->SaveToHtml($homeFile);
$pv->Close();
}
/*火车头采集自动更新栏目*/
function MakeParentType($typeid)
{
global $dsql;
$typediarr = array();
array_push($typediarr,$typeid);
$row3 = $dsql->GetOne("Select reid,topid From `dede_arctype` where id=".$typeid);
if(!in_array($row3['reid'],$typediarr) and $row3['reid']!=0) array_push($typediarr,$row3['reid']);
if(!in_array($row3['topid'],$typediarr) and $row3['topid']!=0) array_push($typediarr,$row3['topid']);
require_once(DEDEDATA."/cache/inc_catalog_base.inc");
require_once(DEDEINC."/channelunit.func.php");
require_once(DEDEINC."/arc.listview.class.php");
foreach($typediarr as $typeid)
{
$lv = new ListView($typeid);
$lv->MakeHtml(1,$maxpagesize);
}
}
/*火车头采集自动更新上下篇*/
function MakePreNext($aid,$typeid)
{
global $dsql;
require_once(DEDEINC.'/arc.archives.class.php');
$aid = intval($aid);
$preRow = $dsql->GetOne("SELECT id FROM `dede_arctiny` WHERE id<$aid AND arcrank>-1 AND typeid='$typeid' ORDER BY id DESC");
$nextRow = $dsql->GetOne("SELECT id FROM `dede_arctiny` WHERE id>$aid AND arcrank>-1 AND typeid='$typeid' ORDER BY id ASC");
if(is_array($preRow))
{
$envs['aid'] = $preRow['id'];
$arc = new Archives($preRow['id']);
$arc->MakeHtml();
}
if(is_array($nextRow))
{
$envs['aid'] = $nextRow['id'];
$arc = new Archives($nextRow['id']);
$arc->MakeHtml();
}
}
2、找到function GetUpdateTest() 方法,在 return $revalue;前调用上面新增方法。
MakePreNext($arcID,$typeid);
MakeIndex();
MakeParentType($typeid);
return $revalue;

本文标签:织梦cms采集 

很赞哦! ()

相关源码

  • 帝国cms7.5商城模板带图片视频广告位功能本模板基于帝国CMS7.5内核开发,为内容电商平台设计,集成文章、图片、视频多媒体展示与广告位管理功能。采用智能响应式技术,确保商品内容在不同设备上获得较优呈现效果,帮助快速构建专业的内容营销平台。查看源码
  • 手机软件APP游戏软件下载网站Pbootcms模板(自适应)基于PbootCMS内核深度开发的网站模板,为移动互联网时代打造。无论是手机APP推广、游戏软件展示,还是各类企业官网需求,本模板都能通过简单的图文替换实现行业无缝切换查看源码
  • 响应式高端家居家具装修类pbootcms模板网站源码家居装修、空间设计企业打造的营销型网站解决方案,基于PbootCMS内核深度开发。采用前沿响应式架构,适配手机端与PC端浏览体验查看源码
  • (自适应)家政保洁保姆打扫卫生清灰服务pbootcms模板免费下载采用手工编写的DIV+CSS架构,代码结构清晰无冗余,加载速度优异。响应式设计适配各类终端设备,保障手机、平板、电脑端的一致浏览体验。查看源码
  • (PC+WAP)货运物流快递仓储货架pbootcms网站模板下载本模板基于PbootCMS开发,为货运物流、快递配送、仓储货架等行业设计,支持PC+WAP自适应,确保在电脑、手机、平板等设备上均能流畅访问。适用于物流公司、仓储企业查看源码
  • 帝国CMS7.5小说推荐公众号导航带wap手机站+带采集工具本模板为小说导航类网站设计开发,基于帝国CMS7.5内核构建,针对小说阅读领域的分类聚合需求进行深度优化。通过智能分类系统和用户行为分析,实现小说资源的精准推荐与导航功能。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐