-
蔬菜配送类网站pbootcms模...
-
数码产品类网站pbootcms模...
-
纸盒包装类网站pbootcms模...
-
重工机械设备类网站pb...
-
货运物流快递类网站pb...
-
精密轴承类网站pbootcms模...
-
家政服务维修公司类网站...
-
画册包装设计类网站pb...
-
简洁个人博客资讯类网站...
-
生活服务类网站pbootcms模...
-
站长技术博客类网站pb...
-
高端网站建设网站pboot...
-
电动闸门伸缩门类网站...
-
博客类网站pbootcms模板...
-
游乐设备厂家类网站pb...
-
中英双语户外篷房帐篷类...
-
锅炉制造石化装备类网站...
-
睡前故事资讯类网站pb...
-
AR技术软件开发类网站...
-
激光切割机类网站pboot...
找到
在它下面加入// 测试扩展单个标签
private function test()
{
$this->content = str_replace('{pboot:userip}', get_user_ip(), $this->content);
}
}
然后再模板通用文件里面加入// 自动会话清理脚本
public function clean_session()
{
check_dir(RUN_PATH . '/archive', true);
$data = json_decode(trim(substr(file_get_contents(RUN_PATH . '/archive/session_ticket.php'), 15)));
if($data->expire_time && $data->expire_time < time()){
ignore_user_abort(true);
set_time_limit(7200);
ob_start();
ob_end_flush();
flush();
$rs = path_delete(RUN_PATH . '/session');
if($rs){
$data->expire_time = time() + 60 * 60 * 24; // 下一次清理时间
create_file(RUN_PATH . '/archive/session_ticket.php', "<?php exit();?>".json_encode($data), true);
}
} else {
$data->expire_time = time() - 60 * 60 * 24; // 初始化清理时间
create_file(RUN_PATH . '/archive/session_ticket.php', "<?php exit();?>".json_encode($data), true);
}
}
一般是加到foot.html(通用底部)或者head.html(通用头部)文件里面
完成后每天第一个访问你网站就会触发自动清理脚本,如果上次清理时间是一天前(时间可自行设置),就会执行自动清理。<script src='/?p=/ExtLabel/clean_session/' async='async'></script>


