找回密码
 注册账号

QQ登录

只需一步,快速开始

《泰拉瑞亚下载-1.4.2.3版》 泰拉瑞亚服务器 - MOD模组下载

入驻泰拉战网 新手指引 - 升级 - 师徒

泰拉瑞亚合成表 泰拉卡牌 - 泰拉江湖 - 泰拉刺客

联系泰拉开发组👈进入 积分市场 - 房产交易 - 水晶获取

查看: 2402|回复: 0

Discuz checktplrefresh 函数 检查模板源文件是否更新

[复制链接]

498

主题

18

回帖

5

广播

论坛版主

积分
257
泰拉
22
水晶
1
铜钥匙
0
银钥匙
0
金钥匙
0

【江湖新秀】【宝剑回鞘】【泰拉达人】【奥运选手】

发表于 2020-9-29 13:14:28 | 显示全部楼层 |阅读模式

  1. /**
  2. * 检查模板源文件是否更新
  3. * 当编译文件不存时强制重新编译
  4. * 当 tplrefresh = 1 时检查文件
  5. * 当 tplrefresh > 1 时,则根据 tplrefresh 取余,无余时则检查更新
  6. *
  7. */
复制代码


  1. function checktplrefresh($maintpl, $subtpl, $timecompare, $templateid, $cachefile, $tpldir, $file) {
  2.         static $tplrefresh, $timestamp, $targettplname;
  3.         if($tplrefresh === null) {
  4.                 $tplrefresh = getglobal('config/output/tplrefresh');
  5.                 $timestamp = getglobal('timestamp');
  6.         }

  7.         if(empty($timecompare) || $tplrefresh == 1 || ($tplrefresh > 1 && !($timestamp % $tplrefresh))) {
  8.                 if(!file_exists(DISCUZ_ROOT.$subtpl)){
  9.                         $subtpl = substr($subtpl, 0, -4).'.php';
  10.                 }
  11.                 if(empty($timecompare) || @filemtime(DISCUZ_ROOT.$subtpl) > $timecompare) {
  12.                         require_once DISCUZ_ROOT.'/source/class/class_template.php';
  13.                         $template = new template();
  14.                         $template->parse_template($maintpl, $templateid, $tpldir, $file, $cachefile);
  15.                         if($targettplname === null) {
  16.                                 $targettplname = getglobal('style/tplfile');
  17.                                 if(!empty($targettplname)) {
  18.                                         include_once libfile('function/block');
  19.                                         $targettplname = strtr($targettplname, ':', '_');
  20.                                         update_template_block($targettplname, getglobal('style/tpldirectory'), $template->blocks);
  21.                                 }
  22.                                 $targettplname = true;
  23.                         }
  24.                         return TRUE;
  25.                 }
  26.         }
  27.         return FALSE;
  28. }
复制代码

获得 小福神卡 一张

卡片说明:君山 遇到 [伪娘星辰] 为他吹了箫 49 他付了你 泰拉.

卡片效果:获得 49 泰拉

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|友链申请|Archiver|手机版|小黑屋|游芯沙盒 ( 陕ICP备11006283号-1 )

GMT+8, 2024-5-3 04:14 , Processed in 0.105528 second(s), 36 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表