最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
phpcms v9自定义HTML文件名字的二次开发
时间:2016-04-20 编辑:简简单单 来源:一聚教程网
2、打开/phpcms/modules/content/create_html.php,找到代码:
$urls = $this->url->show($r['id'], '', $r['catid'],$r['inputtime']);
批量替换为:
$urls = $this->url->show($r['id'], '', $r['catid'],$r['inputtime'], $r['prefix']);
共三处代码,目的是让生成的html页面自定义文件名。
3、打开/phpcms/modules/content/classes/url.class.php,找到代码:
$day = date('d',$time);
在其下方插入:
$tmp_id = $content_ishtml && $prefix ? $prefix : $id; //增加自定义HTML文件名支持
再找到代码
$urls = str_replace(array('{$categorydir}','{$catdir}','{$year}','{$month}','{$day}','{$catid}','{$id}','{$page}'),array($categorydir,$catdir,$year,$month,$day,$catid,$id,$page),$urlrule);
修改为:
$urls = str_replace(array('{$categorydir}','{$catdir}','{$year}','{$month}','{$day}','{$catid}','{$id}','{$page}'),array($categorydir,$catdir,$year,$month,$day,$catid,$tmp_id,$page),$urlrule);
到这里,生成HTML页面的名称就是自定义的了。后期自己配置一下URL规则,仍然使用id的形式。
-
下一个: zblog 修改后台登陆地址的教程
相关文章
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31
- html area标签解读 10-31
- html使用表单标签实现注册页面代码展示 10-31
- 使用HTML截图并保存为本地图片的代码展示 10-31