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

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

梁尉寒2023-09-11DedeCMS教程已有人查阅

导读打开文件 /dede/inc/inc_archives_functions.php1、在最后增加方法2、找到function GetUpdateTest() 方法,在 return $revalue;前调用上面新增方法。

打开文件 /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采集 

很赞哦! ()

相关源码

  • (自适应)家政保洁保姆打扫卫生清灰服务pbootcms模板免费下载采用手工编写的DIV+CSS架构,代码结构清晰无冗余,加载速度优异。响应式设计适配各类终端设备,保障手机、平板、电脑端的一致浏览体验。查看源码
  • (PC+WAP)绿色日志美文文学说说博客网站pbootcms模板除日志博客类网站外,通过替换图文内容可快速适配:心情日记分享平台、文学创作社区、朋友圈内容聚合站、美文鉴赏网站、读书笔记平台等应用场景。查看源码
  • (PC+WAP)餐饮奶茶美食小吃招商加盟pbootcms模板源码下载为茶饮烘焙、小吃快餐等餐饮品牌打造的招商加盟系统,助力品牌快速拓展市场;双端pc+wap设计呈现加盟政策对比表。支持后台实时更新菜品图片、加盟费用等关键信息。查看源码
  • (自适应)中英双语配线器材扎带线卡网站pbootcms模板免费下载为线缆管理、电气配线领域打造的响应式网站模板,采用PbootCMS内核开发,可快速搭建企业级产品展示平台,数据实时同步管理。查看源码
  • 响应式茶叶茶道pbootcms网站模板源码(自适应手机端)棕色复古茶具主题的响应式网站模板,为茶叶茶道企业设计,同时支持古玩字画、艺术文化等行业的快速适配,通过替换文字图片即可转型为其他行业官网,大幅降低开发成本。查看源码
  • (自适应)蓝色厨卫厨房水龙头阀门水槽设备源码下载基于PbootCMS内核开发,深度适配厨卫设备行业特性。通过精准的产品展示模块与水效标识专区设计,有效呈现五金件工艺细节。响应式布局确保从手机到平板都能展示金属质感与水流动态效果。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐