POST TIME:2020-03-28 16:58
最近一個(gè)喜歡采集的朋友想要修改織夢(mèng)CMS文章的錄入時(shí)間,找到我,我也不是太懂,但礙于面子,上網(wǎng)搜索,自己動(dòng)手嘗試,終于找到方法。
首先找到管理目錄(默認(rèn)是DEDE)下的article_add.php,打開(kāi)后在
</table></td>
</tr>
<tr>
<td height="24" colspan="4" class="bline"><table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="90"> 發(fā)布時(shí)間:</td>
之前添加
<tr>
<td width="90"> 錄入時(shí)間:</td>
<td>
<?php
$addtime = GetDateTimeMk($arcRow["senddate"]);
echo "<input type='text' name='senddate' value=''>";
?>
</td>
</tr>
然后再找到管理目錄DEDE目錄下的article_add.php文件后打開(kāi)在:
</table></td>
</tr>
<tr>
<td height="24" colspan="4" class="bline"><table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="90"> 發(fā)布時(shí)間:</td>
之前添加
<tr>
<td width="90"> 錄入時(shí)間:</td>
<td>
<?php
$addtime = GetDateTimeMk($arcRow["senddate"]);
echo "<input type='text' name='senddate' value=''>";
?>
</td>
</tr>
找到article_add_action.php
把
$senddate = mytime();
害我的就是這句,自動(dòng)獲取當(dāng)前服務(wù)器的時(shí)間的,所以在前面的article_add.php頁(yè)面里沒(méi)有任何添加時(shí)間的語(yǔ)句
找到
$sortrank = AddDay($senddate,$sortup);
替換成
$senddate = GetMkTime($senddate,$sortup);
然后再把插入到數(shù)據(jù)庫(kù)的INSERT INTO語(yǔ)句改下
這里已經(jīng)有了$senddate ,所以只要?jiǎng)h除$sortrank
就是把
//加入數(shù)據(jù)庫(kù)的SQL語(yǔ)句
//----------------------------------
$inQuery = "INSERT INTO dede_archives(
typeid,typeid2,sortrank,iscommend,ismake,channel,
arcrank,click,money,title,shorttitle,color,writer,source,litpic,
pubdate,senddate,arcatt,adminID,memberID,description,keywords,templet,redirecturl)
VALUES ('$typeid','$typeid2','$sortrank','$iscommend','$ismake','$channelid',
'$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','$litpic',
'$pubdate','$senddate','$arcatt','$adminID','0','$description','$keywords','$templet','$redirecturl');";
替換成
//加入數(shù)據(jù)庫(kù)的SQL語(yǔ)句
//----------------------------------
$inQuery = "INSERT INTO dede_archives(
typeid,typeid2,iscommend,ismake,channel,
arcrank,click,money,title,shorttitle,color,writer,source,litpic,
pubdate,senddate,arcatt,adminID,memberID,description,keywords,templet,redirecturl)
VALUES ('$typeid','$typeid2','$iscommend','$ismake','$channelid',
'$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','$litpic',
'$pubdate','$senddate','$arcatt','$adminID','0','$description','$keywords','$templet','$redirecturl');";
好了,添加頁(yè)面改定
然后修改頁(yè)面也參照這個(gè)方法修改
在article_edit.php
在
</table></td>
</tr>
<tr>
<td height="24" colspan="4" class="bline"><table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="90"> 發(fā)布時(shí)間:</td>
之前添加
<?php
$addtime = GetDateTimeMk($arcRow["senddate"]);
echo "<input type='text' name='senddate' value='$addtime'>";
?>