关于织梦将文章审核时间与发布日期同步的修改方法

最近将织梦5.6更新后就发现了一系列的问题,其中发现将文章审核后发布时间依然不变,还是文章的录入时间,而以前文章的发布时间是文章的审核时间,这给我带来了很大的不便,下面给大家介绍一下将文章的审核时间和发布时间同步的修改方法。

打开织梦后台所在目录(默认为dede),修改archives_do.php文件(别忘了备份哦!),将光标定位到”审核文档”附近,寻找以下代码:

 $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', dutyadmin='".$cuserLogin->getUserID()."' where id='$aid' ");
          }
          $pageurl = MakeArt($aid,false);

将以上代码替换为:

 $maintable = ( trim($row['maintable'])=='' ? 'dede_archives' : trim($row['maintable']) );
                  $newdate = time();
          $dsql->ExecuteNoneQuery("Update `dede_arctiny` set pubdate='$newdate',sortrank='$newdate',senddate='$newdate',arcrank='0' where id='$aid' ");
          if($row['issystem']==-1)
          { 
              $dsql->ExecuteNoneQuery("Update `".trim($row['addtable'])."` set pubdate='$newdate',sortrank='$newdate',senddate='$newdate',arcrank='0' where aid='$aid' "); 
          }    
          else 
          {   
              $dsql->ExecuteNoneQuery("Update `$maintable` set pubdate='$newdate',sortrank='$newdate',senddate='$newdate',arcrank='0' where id='$aid' "); 
          }   
          $pageurl = MakeArt($aid,false);

如此,当你审核文章时,发布时间就会变成当前审核时间。

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

给TA打赏
共{{data.count}}人
人已打赏
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索