對于有些經常大批量更新文章的站點,可能后臺會一次性發布很多文章,然后狀態設置為未審核,然后每天放出一些文章來,但是這樣的話,審核完的文章,前臺顯示的發布時間會顯示你第一次發布的時間,而不是審核時的時間,就會給訪客造成一種印象,你這些文章很早就有了,最近沒更新的印象,因此很有必要在審核文章的時候,自動同步文章發布時間為審核的時間。
方法如下:
打開DEDE后臺所在目錄(默認為dede)的archives_do.php文件,大概在200行開始:
$maintable = ( trim($row['maintable'])=='' ? 'dede_archives' : trim($row['maintable']) ); $dsql->ExecuteNoneQuery("Update `dede_arctiny` set arcrank='0' where id='$aid' "); if($row['issystem']==-1) { $dsql->ExecuteNoneQuery("Update `".trim($row['addtable'])."` set arcrank='0' where aid='$aid' "); } else { $dsql->ExecuteNoneQuery("Update `$maintable` set arcrank='0' where id='$aid' "); } $pageurl = MakeArt($aid,false); } ShowMsg("成功審核指定的文檔!",$ENV_GOBACK_URL);修改為:
$maintable = ( trim($row['maintable'])=='' ? 'dede_archives' : trim($row['maintable']) ); $newdate = time(); $dsql->ExecuteNoneQuery("Update `dede_arctiny` set pubdate='$newdate',senddate='$newdate',arcrank='0' where id='$aid' "); if($row['issystem']==-1) { $dsql->ExecuteNoneQuery("Update `".trim($row['addtable'])."` set pubdate='$newdate',senddate='$newdate',arcrank='0' where aid='$aid' "); } else { $dsql->ExecuteNoneQuery("Update `$maintable` set pubdate='$newdate',senddate='$newdate',arcrank='0' where id='$aid' "); } $pageurl = MakeArt($aid,false); } ShowMsg("成功審核指定的文檔!",$ENV_GOBACK_URL);當使用后臺“審核”按鈕審核文章時,同步更新該文章的發布時間為審核的時間。這樣如果按發布時間排序,文章也能排在前面。
以上就是織夢審核文章時同步更新文章發布時間的實現辦法的全部內容,希望對大家的學習和解決疑問有所幫助,也希望大家多多支持武林網。新聞熱點
疑難解答