刪除文章的同時(shí)自動刪除生成的html文件_DedeCms教程
功能:刪除文章的同時(shí)自動刪除生成的html文件
前兩天改的忘記改刪除文章分頁了,這回修正一下:)
可以刪除文章分頁HTML了
第一步:
archives表建立一字段:arcurl
第二步:打開inc_archives_view.php
找到
//循環(huán)生成HTML文件
//-------------------------------------------------
改為
//循環(huán)生成HTML文件
//-------------------------------------------------
for($i=1;$i<=$this->TotalPage;$i++)
{
if($i>1){ $truefilename = $cfg_basedir.$fileFirst."_".$i.".".$this->ShortName;
$filenamefy = $fileFirst."_".$i.".".$this->ShortName;
$filenameall = $filenameall.':'.$filenamefy;
}
else{ $truefilename = $cfg_basedir.$filename;
$filenameall = $filename.$filenameall;
}
$this->ParseDMFields($i,1);
$this->dtp->SaveTo($truefilename);
}
$this->dsql->SetQuery("Update dede_archives set ismake=1,arcurl='$filenameall' where ID='".$this->ArcID."'");
$this->dsql->ExecuteNoneQuery();
$this->Close();
return $filename;
}
第三步:打開archives_do.php
找到
//讀取文檔信息
$arctitle = "";
$arcurl = "";
$arcQuery = "
Select dede_archives.title,dede_channeltype.addtable From dede_archives
left join dede_channeltype on dede_channeltype.ID=dede_archives.channel where dede_archives.ID='$aid'
";
$arcRow = $dsql->GetOne($arcQuery);
。。。
。。到。。
}//foreach
改為
//讀取文檔信息
$arcQuery = "
Select dede_archives.title,dede_archives.arcurl,dede_channeltype.addtable From dede_archives
left join dede_channeltype on dede_channeltype.ID=dede_archives.channel where dede_archives.ID='$aid'
";
$arcRow = $dsql->GetOne($arcQuery);
$arcurl = $arcRow['arcurl'];
$arcurls = explode(":",$arcurl);
$num_arcurls = count($arcurls)-1;
if(!is_array($arcRow)){ continue; }
$dsql->SetQuery("Delete From dede_archives where ID='$aid'");
$dsql->ExecuteNoneQuery();
if($arcRow['addtable']!=""){
$dsql->SetQuery("Delete From ".$arcRow['addtable']." where aid='$aid'");
$dsql->ExecuteNoneQuery();
}
$dsql->SetQuery("Delete From dede_feedback where aid='$aid'");
$dsql->ExecuteNoneQuery();
if(!ereg("?",$arcurl)){
if ($num_arcurls <2){
$htmlfile = $cfg_basedir.$arcurl;
if(file_exists($htmlfile) && !is_dir($htmlfile)) unlink($htmlfile);
}
else {
for($i=0;$i<=$num_arcurls;$i++){
$htmlfile = $cfg_basedir.$arcurls[$i];
if(file_exists($htmlfile) && !is_dir($htmlfile)) unlink($htmlfile);}
}
}
}//foreach
- Dedecms生成百度地圖圖文教程
- 織夢dedecms生成下拉式友情鏈接列表
- DEDECMS使用拼音首字母做欄目名稱
- 織夢DEDECMS站群增強(qiáng)版 DedeCMS搭建站群首選
- DedeCMS Error:Tag disabled:php錯(cuò)誤的完整處理方法
- dedecms編碼轉(zhuǎn)換方法 gbk轉(zhuǎn)UTF-8,UTF-8轉(zhuǎn)GBK
- 防XSS,sql注射,代碼執(zhí)行,文件包含的通用代碼
- DedeCms教程:優(yōu)化DedeCMS搜索結(jié)果
- DedeCms教程:Linux+Apache+PHP+MySQL服務(wù)器環(huán)境(CentOS篇)
- DedeCms教程:LuManager服務(wù)器管理軟件安裝DEDECMS軟件
- DedeCms教程:Ubuntu/Debian上安裝 PHP 5.3, Nginx 和 PHP-fpm
- DedeCms教程:windows server 2003 php 環(huán)境搭建
DedeCms教程教程Rss訂閱Cms教程搜索
DedeCms教程推薦
猜你也喜歡看這些
- 織夢網(wǎng)絡(luò)工作室/廣告公司網(wǎng)站模板下載(含數(shù)據(jù))
- 非主流官方網(wǎng) 整站模版
- dedecms水處理科技企業(yè)模板(二次開發(fā),織夢整站)
- 原創(chuàng)dedecms大氣裝修公司模板
- dedecms電氣公司企業(yè)模板(清新簡潔)
- 中英繁日文四語企業(yè)網(wǎng)站,大氣企業(yè)網(wǎng)站,通用機(jī)電類網(wǎng)站,外貿(mào)企業(yè)站
- 織夢文章/新聞資訊/博客模板(仿chinaz最新版,藍(lán)色簡潔大氣)
- 織夢CMS清爽手機(jī)商場官方網(wǎng)站模板
- dedecms清新大氣的企業(yè)網(wǎng)站模板
- Kid模板風(fēng)格【藍(lán)易】
- 相關(guān)鏈接:
復(fù)制本頁鏈接| 搜索刪除文章的同時(shí)自動刪除生成的html文件| DedeCms模板| Dede模板| 織夢模板| dedecms
- 教程說明:
DedeCms教程-刪除文章的同時(shí)自動刪除生成的html文件
。