template_dir = TP_PATH . $_confing['web_template'] . '/'. $_confing['web_tpl_html'].'/'; }else{ $tpl -> template_dir = TP_PATH . $_confing['web_template'] . '/'; } $tpl -> template_lang = $lang; if ($_confing['is_cache']) { $tpl -> template_is_cache = 1; //缓存 $tpl -> template_time = $_confing['cache_time']?$_confing['cache_time']:30; //开启缓存但不存在缓存时间使用30秒 } else { $tpl -> template_is_cache = 0; } // 单页频道 $page = empty($page)?1:intval($page); // 文章分页 $arc_id = $mysql -> fetch_asc("select id from " . DB_PRE . "maintb where category={$cat_id}"); $arc_id = isset($arc_id[0]['id'])?$arc_id[0]['id']:''; // 存在内容 // if(!empty($arc_id)){ $channel_table = $channel_info['channel_table']; $content = get_content($arc_id, $channel_info['channel_table'], $cate_info['id']); $content = $content[0]; // 获取第一个关键词作为相关产品调用 $key_arr = empty($content['keywords'])?'':explode(',', $content['keywords']); $relave_key = $key_arr[0]; if ($content['verify'] && !adminlogin()) { die($language['msg_info8'] . "【Back】"); } //判断权限 $view_is = isset($_SESSION['purview'])?$_SESSION['purview']:''; if ($content['purview'] != $view_is && $content['purview'] && !adminlogin()) { die($language['msg_info8'] . "【back】"); } //判断权限 $body_content = $content['content']; $content_arr = preg_split('/##分页符号##/i', $body_content); $content_arr_num = count($content_arr); $content_arr_num = ($content_arr_num > 1)?$content_arr_num:0; $ishtml = 1; $id = $cate_info['id']; if ($content_arr_num) { for($i = 0;$i < $content_arr_num;$i++) { if ($page == ($i + 1)) { $content_focus = $i; $content['content'] = $content_arr[$i]; $content['title'] = $content['title'] . '(' . ($i + 1) . ')'; $content['style_title'] = $content['style_title'] . '(' . ($i + 1) . ')'; $tpl_rel = explode('.', $cate_info['cate_tpl_list']); if ( IS_MB && $_confing['is_mobile'] ) { header("location: http://".$_SERVER['SERVER_NAME']."/m".$_SERVER["REQUEST_URI"]); exit; }else{ $tpl->display($tpl_rel[0]);//载入缓存文件 } } } } else { $tpl_rel = explode('.', $cate_info['cate_tpl_list']); if ( IS_MB && $_confing['is_mobile'] ) { header("location: http://".$_SERVER['SERVER_NAME']."/m".$_SERVER["REQUEST_URI"]); exit; }else{ $tpl->display($tpl_rel[0]);//载入缓存文件 } } if ( $_GET['language']=="hk" ) { ob_end_flush(); } ?>