* Date: 2026-6-2 */ if (!defined('ROOT_PATH')) exit; $currentChannel = null; if ($module == 'channel' || $module == 'page' || $module == 'article' || $module == 'product' || $module == 'image' || $module == 'download' || $module == 'video' || $module == 'recruit') { if ($module == 'channel') { $currentChannel = $db->fetch("SELECT * FROM {$db->table('channel')} WHERE id=".intval($id)); } } if (!$currentChannel && $module=='channel' && $id>0) $currentChannel = $db->fetch("SELECT * FROM {$db->table('channel')} WHERE id=".intval($id)); if (!$currentChannel) $currentChannel = $db->fetch("SELECT * FROM {$db->table('channel')} WHERE id=".intval($id)); if (!$currentChannel) { $currentChannel = $db->fetch("SELECT * FROM {$db->table('channel')} WHERE is_show=1 ORDER BY list_order ASC,id ASC LIMIT 1"); } if (!$currentChannel || !is_array($currentChannel)) { $currentChannel = array( 'id' => 0, 'parent_id' => 0, 'channel_type' => 1, 'channel_name' => '栏目列表', 'channel_thumb' => '', 'channel_dir' => '' ); } $parentId = isset($currentChannel['parent_id']) ? intval($currentChannel['parent_id']) : 0; $topId = $parentId>0 ? $parentId : intval($currentChannel['id']); $topChannel = $parentId>0 ? $db->fetch("SELECT * FROM {$db->table('channel')} WHERE id=".$parentId) : $currentChannel; if (!$topChannel || !is_array($topChannel)) { $topChannel = $currentChannel; } $subChannels = $topId > 0 ? $db->fetchAll("SELECT * FROM {$db->table('channel')} WHERE parent_id=".$topId." AND is_show=1 ORDER BY list_order ASC,id ASC") : array(); $page = isset($_GET['page']) ? max(1,intval($_GET['page'])) : 1; $pagesize = 12; $offset = ($page-1)*$pagesize; $list = array(); $total = 0; $ids = array(intval($currentChannel['id'])); $children = intval($currentChannel['id']) > 0 ? $db->fetchAll("SELECT id FROM {$db->table('channel')} WHERE parent_id=".intval($currentChannel['id'])." AND is_show=1") : array(); foreach($children as $c){ $ids[] = intval($c['id']); } $idSql = implode(',', $ids); $ctype = intval($currentChannel['channel_type']); if ($ctype==1) { $row=$db->fetch("SELECT COUNT(*) c FROM {$db->table('article')} WHERE channel_id IN ($idSql) AND status=1"); $total=intval($row['c']); $list=$db->fetchAll("SELECT * FROM {$db->table('article')} WHERE channel_id IN ($idSql) AND status=1 ORDER BY create_time DESC LIMIT $offset,$pagesize"); } elseif ($ctype==2) { $row=$db->fetch("SELECT COUNT(*) c FROM {$db->table('product')} WHERE channel_id IN ($idSql) AND status=1"); $total=intval($row['c']); $list=$db->fetchAll("SELECT * FROM {$db->table('product')} WHERE channel_id IN ($idSql) AND status=1 ORDER BY create_time DESC LIMIT $offset,$pagesize"); } elseif ($ctype==4) { $row=$db->fetch("SELECT COUNT(*) c FROM {$db->table('image')} WHERE channel_id IN ($idSql) AND status=1"); $total=intval($row['c']); $list=$db->fetchAll("SELECT * FROM {$db->table('image')} WHERE channel_id IN ($idSql) AND status=1 ORDER BY create_time DESC LIMIT $offset,$pagesize"); } elseif ($ctype==5) { $row=$db->fetch("SELECT COUNT(*) c FROM {$db->table('download')} WHERE channel_id IN ($idSql) AND status=1"); $total=intval($row['c']); $list=$db->fetchAll("SELECT * FROM {$db->table('download')} WHERE channel_id IN ($idSql) AND status=1 ORDER BY create_time DESC LIMIT $offset,$pagesize"); } elseif ($ctype==7) { $row=$db->fetch("SELECT COUNT(*) c FROM {$db->table('video')} WHERE channel_id IN ($idSql) AND status=1"); $total=intval($row['c']); $list=$db->fetchAll("SELECT * FROM {$db->table('video')} WHERE channel_id IN ($idSql) AND status=1 ORDER BY create_time DESC LIMIT $offset,$pagesize"); } elseif ($ctype==8) { $row=$db->fetch("SELECT COUNT(*) c FROM {$db->table('guestbook')} WHERE is_show=1"); $total=intval($row['c']); $list=$db->fetchAll("SELECT * FROM {$db->table('guestbook')} WHERE is_show=1 ORDER BY create_time DESC LIMIT $offset,$pagesize"); } elseif ($ctype==9) { $row=$db->fetch("SELECT COUNT(*) c FROM {$db->table('recruit')} WHERE channel_id IN ($idSql) AND status=1"); $total=intval($row['c']); $list=$db->fetchAll("SELECT * FROM {$db->table('recruit')} WHERE channel_id IN ($idSql) AND status=1 ORDER BY create_time DESC LIMIT $offset,$pagesize"); } $pages = $total>0 ? ceil($total/$pagesize) : 1; $bannerPic = !empty($slides[0]['slide_pic']) ? $slides[0]['slide_pic'] : (!empty($currentChannel['channel_thumb']) ? $currentChannel['channel_thumb'] : 'https://picsum.photos/1600/500?random='.intval($currentChannel['id'])); $mobileBannerPic = !empty($slides[0]['slide_pic']) ? $slides[0]['slide_pic'] : (!empty($currentChannel['channel_thumb']) ? $currentChannel['channel_thumb'] : 'https://picsum.photos/1200/400?random='.intval($currentChannel['id'])); ?><?php echo htmlspecialchars($currentChannel['channel_name']); ?>-<?php echo htmlspecialchars($site['site_name']); ?>
当前位置 首页 >>

<?php echo htmlspecialchars($itemTitle); ?>
1) { ?>