[phpcms二次开发]给url规则添加可用更多自定义可用变量

我的博客:www.while0.com

默认url规则中没有时分秒,于是自己添加一个[phpcms V9.2.2]


在phpcms根目录下边的 phpcms\modules\content\classes\url.class.php 中修改以下片段:

1 $categorydir = $this->get_categorydir($catid);

2             $catdir = $category['catdir'];

3             $year = date('Y',$time);

4             $month = date('m',$time);

5             $day = date('d',$time);

6             $hour = date('H',$time);

7             $minute = date('i',$time);

8             $second = date('s',$time);

9             $urls = str_replace(array('{$categorydir}','{$catdir}','{$year}','{$month}','{$day}','{$hour}','{$minute}','{$second}','{$catid}','{$id}','{$page}'),array($categorydir,$catdir,$year,$month,$day,$hour,$minute,$second,$catid,$id,$page),$urlrule);

到此即可使用了!

 

你可能感兴趣的:(phpcms)