* Date: 2026-5-20
*/
if (!defined('ROOT_PATH')) { exit('Access Denied'); }
require_once __DIR__ . '/../_functions.php';
if (empty($article) && !empty($id)) {
$article = $db->fetch("SELECT a.*, c.channel_name, c.channel_thumb FROM {$db->table('article')} a LEFT JOIN {$db->table('channel')} c ON a.channel_id = c.id WHERE a.id = ? AND a.status = 1 LIMIT 1", [intval($id)]);
}
if (empty($article)) {
echo 'Article not found';
return;
}
$pageTitle = (string) ($article['title'] ?? '文章详情');
$currentChannel = !empty($article['channel_id']) ? k607_channel_by_id($db, intval($article['channel_id'])) : null;
$heroImage = k607_channel_hero_image($currentChannel, !empty($article['litpic']) ? $article['litpic'] : (!empty($slides[0]['litpic']) ? $slides[0]['litpic'] : ''));
require_once __DIR__ . '/../_header.php';
?>