打开文件 /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
打开文件 /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 `wmd_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 `wmd_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 `wmd_arctiny` WHERE id<$aid AND arcrank>-1 AND typeid='$typeid' ORDER BY id DESC");
$nextRow = $dsql->GetOne("SELECT id FROM `wmd_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;
版权声明:本站部分内容来源互联网,如果文章中所涉及的图片或者文字内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!
php模板建站
织梦火车采集器采集完文章并更新栏目页
最新VIP资源
猜你喜欢
- 织梦自定义php页面调用include引用模板 2021-04-08
- 织梦dedecms如何调用三级栏目名称和链接 2021-02-24
- 织梦dedecms自定义表单发送邮件(QQ、163、126邮箱)教程 2021-03-11
- 判断文章是否被百度/360/搜狗收录的PHP示例代码 2023-07-12
- dedecms织梦生成Google Sitemap的方法 2021-03-29
- DedeCms错误警告,连接数据库失败 2020-08-05
- 织梦dedecms还原数据后数据全部是空的 2021-04-08
- 织梦tags标签怎么显示标签的文档数 2020-12-23
- Dedecms织梦后台上传提示你没有选择上传的文件 2020-09-18
- 织梦dedecms搜索结果页伪静态教程 2021-06-15