-
中英雙語律師事務所類網(wǎng)...
-
營銷型無縫鋼管定制生產(chǎn)...
-
貂絨大衣服裝設計類網(wǎng)站...
-
電子元件電路板類網(wǎng)站織...
-
網(wǎng)站模板資源下載類網(wǎng)站...
-
裝飾建材公司類網(wǎng)站織夢...
-
手游APP軟件下載類網(wǎng)站織...
-
水利工程施工類網(wǎng)站織夢...
-
財稅記賬工商注冊認證類...
-
玩具動漫類網(wǎng)站織夢模板...
-
展覽展會信息類網(wǎng)站織夢...
-
電腦系統(tǒng)軟件下載類網(wǎng)站...
-
食品百貨英文外貿(mào)類網(wǎng)站...
-
鋼結構崗亭營銷型織夢網(wǎng)...
-
人力資源管理類網(wǎng)站織夢...
-
物流快運速遞類網(wǎng)站織夢...
-
儀器分析儀類網(wǎng)站織夢模...
-
蔬菜鮮果配送類網(wǎng)站織夢...
-
精工機械軸承生產(chǎn)廠家類...
-
儀器儀表科技公司類網(wǎng)站...
織夢使用火車頭采集器采集數(shù)據(jù),發(fā)布文檔后是不會自動生成首頁、上下篇、欄目頁的,我們可以給織夢添加自動生成代碼來實現(xiàn)
實現(xiàn)教程
打開 /dede/inc/inc_archives_functions.php 最下面加入3個函數(shù)
/*火車頭采集自動更新主頁*/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("無法更新網(wǎng)站主頁到:$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();}}
繼續(xù)在這個文件中找到
return $revalue;
在它的上面加入
MakePreNext($arcID,$typeid);MakeIndex();MakeParentType($typeid);
添加完后是這樣的

這樣添加好后,無論你用火車頭免登錄接口還是WEB發(fā)布模塊,無論是普通文章模型還是圖集模型還是軟件模型,都可以自動生成相關靜態(tài)文件了。