<?php
	defined('IN_TS') or die('Access Denied.');

	//初始化翻页字段P
	$page = isset($_GET['p']) ? intval($_GET['p']) : '1';

	//画报
		$huabao_im_arrs = $db->once_fetch_assoc("select * from ".dbprefix."p_str where is_im=1 order by pictorialId desc");
		if(is_array($huabao_im_arrs)){
		$p_id_im_arr = explode('_',$huabao_im_arrs['p_str']);
		$pictorial_im = $db->once_fetch_assoc("select * from ".dbprefix."pictorial where id =".$p_id_im_arr[0]);
		}
	if($huabao_im_arrs[pictorialId])
	$huabao_arrs = $db->fetch_all_assoc("select * from ".dbprefix."p_str where pictorialId<> ".$huabao_im_arrs[pictorialId]." order by pictorialId desc limit 15");
	
	if(is_array($huabao_arrs)){
	foreach($huabao_arrs as $key=>$item){
		
		$p_id_arr = explode('_',$item['p_str']);
		
		$huabao_arrs[$key]['f_pictorial'] = $db->once_fetch_assoc("select * from ".dbprefix."pictorial where id =".$p_id_arr[0]);
		
		if(count($p_id_arr)>4){
			array_shift($p_id_arr);
		}
		$pictorial_img = '';
		foreach($p_id_arr as $kkey=>$iitem){
			
			if($kkey<4){
				$pictorial = $db->once_fetch_assoc("select * from ".dbprefix."pictorial where id =".$iitem);
				$pictorial_img[] = $pictorial['photo'].'_200x300.jpg';
			}
		}
		$huabao_arrs[$key]['thumb-img'] = $pictorial_img;
}
}
	
	//可根据SEO需求进行优化，如需帮助请到论坛讨论：bbs.tuntron.com
	$title =$tag?$tag." - ".$strcate['cate_name'].' - '.$TS_SITE['base']['site_title']:$strcate['cate_name'].' - '.$TS_SITE['base']['site_title'];
	
	
	//4.26伪静态修复
	
	
	$TS_SITE['base']['site_key']   = !empty($tag)?$tag.",".$strcate['seo_keywords']:$strcate['seo_keywords'];
	$TS_SITE['base']['site_desc']  = $strcate['seo_desc'];
	$title = '画报 - '.$TS_SITE['base']['site_title'];
	include template("index");