/** * 前台入口(新版渲染层) */ require_once __DIR__ . '/includes/bootstrap.php'; require_once __DIR__ . '/theme/render.php'; // 二级子域名:wps.example.com → 软件详情 $sub = current_subdomain(); if ($sub !== '' && !in_array($sub, ['www', 'admin', 'm'], true)) { $sp = get_product_by_subdomain($sub); $path = parse_url((string) ($_SERVER['REQUEST_URI'] ?? '/'), PHP_URL_PATH) ?: '/'; if ($sp && ($path === '/' || $path === '')) { gr_page_product((string) $sp['slug']); exit; } http_response_code(404); gr_head('页面不存在'); gr_topbar(); echo '
'; gr_empty('这个子域没有对应软件', '请从首页重新查找'); echo '
'; gr_foot(); gr_end(); exit; } $q = trim((string) ($_GET['q'] ?? '')); $cat = trim((string) ($_GET['cat'] ?? '')); $top = !empty($_GET['top']); $page = max(1, (int) ($_GET['page'] ?? 1)); if ($q === '' && $cat === '' && !$top && $page === 1) { gr_page_home(); } else { gr_page_list($q, $cat, $top, $page); }