muban大师 发表于 2021-8-18 07:35:54

织梦获取栏目和首页的时间的函数

在织梦/include/extend.func.php 文件 添加以下代码


       
               
                       
                               
//获取当前栏目的url时间
function remote_filectime($url_file){   
    $headInf = get_headers($url_file,1);   
   $time= strtotime($headInf['Last-Modified',);
$timea = date('Y-m-d',$time).'T'.date('H:i:s',$time);
return $timea;
}
                       
               
       

织梦调用方法


       
               
                       
                               
{dede:global.cfg_indexurl function='remote_filectime(@me)'/} //首页获取url时间
{dede:type}{/dede:type}//栏目页获取url时间
页: [1]
查看完整版本: 织梦获取栏目和首页的时间的函数