2026-06-14 14:00:24 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
require_once __DIR__ . '/../FpUrlHelper.php';
|
2026-06-22 21:55:33 +08:00
|
|
|
|
require_once dirname(__DIR__, 3) . '/config/ConfigLoader.php';
|
2026-06-14 14:00:24 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 真实页输出(原 page_6.php)
|
|
|
|
|
|
*/
|
|
|
|
|
|
class FpPageRenderer
|
|
|
|
|
|
{
|
|
|
|
|
|
/**
|
2026-06-16 04:58:56 +08:00
|
|
|
|
* @param array $ctx 必须包含 logs 数组;可选 skip_log
|
2026-06-14 14:00:24 +08:00
|
|
|
|
*/
|
|
|
|
|
|
public static function render(array $ctx)
|
|
|
|
|
|
{
|
|
|
|
|
|
$logs = $ctx['logs'];
|
|
|
|
|
|
|
|
|
|
|
|
$my_url = $_SERVER['PHP_SELF'];
|
|
|
|
|
|
$my_file_name = substr($my_url, strrpos($my_url, '/') + 1);
|
2026-06-22 21:55:33 +08:00
|
|
|
|
$cong_name = !empty($ctx['config_name'])
|
|
|
|
|
|
? ConfigLoader::sanitizeConfigName($ctx['config_name'])
|
|
|
|
|
|
: str_replace('.php', '', $my_file_name);
|
2026-06-14 14:00:24 +08:00
|
|
|
|
|
2026-06-16 04:58:56 +08:00
|
|
|
|
$resolved = FpUrlHelper::resolve($cong_name, true);
|
|
|
|
|
|
$fp_url = $resolved['url'];
|
2026-06-14 14:00:24 +08:00
|
|
|
|
$logs['fp_url'] = $fp_url;
|
2026-06-16 04:58:56 +08:00
|
|
|
|
if (empty($ctx['skip_log'])) {
|
|
|
|
|
|
write_log_db($logs);
|
|
|
|
|
|
}
|
2026-06-14 14:00:24 +08:00
|
|
|
|
|
|
|
|
|
|
$show_content = CLOAK_SHOW_CONTENT;
|
|
|
|
|
|
if ($show_content == 'curl') {
|
|
|
|
|
|
$html = file_get_content_sstr($fp_url);
|
|
|
|
|
|
$_html = caiji_lujing_buquan_fp($html, $fp_url, $_SERVER['HTTP_HOST']);
|
|
|
|
|
|
echo $_html;
|
|
|
|
|
|
exit;
|
|
|
|
|
|
}
|
|
|
|
|
|
if ($show_content == '302') {
|
2026-06-27 23:58:54 +08:00
|
|
|
|
header('Referrer-Policy: origin-when-cross-origin');
|
|
|
|
|
|
header('Location: ' . $fp_url, true, 302);
|
2026-06-14 14:00:24 +08:00
|
|
|
|
exit;
|
|
|
|
|
|
}
|
|
|
|
|
|
if ($show_content == 'js') {
|
2026-06-27 23:58:54 +08:00
|
|
|
|
$fp_url_js = htmlspecialchars($fp_url, ENT_QUOTES, 'UTF-8');
|
2026-06-14 14:00:24 +08:00
|
|
|
|
?>
|
|
|
|
|
|
<SCRIPT LANGUAGE="JavaScript">
|
|
|
|
|
|
var time = 1;
|
|
|
|
|
|
var timelong = 0;
|
|
|
|
|
|
function diplaytime(){
|
|
|
|
|
|
document.all.his.innerHTML = time -timelong ;
|
|
|
|
|
|
timelong ++;
|
|
|
|
|
|
}
|
|
|
|
|
|
function redirect(){
|
2026-06-27 23:58:54 +08:00
|
|
|
|
window.location.href="<?php echo $fp_url_js; ?>";
|
2026-06-14 14:00:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
timer=setInterval('diplaytime()', 300);
|
|
|
|
|
|
timer=setTimeout('redirect()',time * 300);
|
|
|
|
|
|
</SCRIPT>
|
|
|
|
|
|
<?php
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|