diff --git a/application/config/config.php b/application/config/config.php
index 5490eca4..b939d5c1 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -713,6 +713,7 @@ $config['css_source_yz'] = 'https://www.yangtzeriver.org/css/css3/bootstrap/boot
$config['css_source_ah'] = 'https://www.asiahighlights.com/min/?f=/css/global.min.css,/js/bootstrap-datepicker/css/bootstrap-datepicker3.standalone.css,/css/basic.css,/css/homepage.css,/css/contact.css,/css/tailor-make.css,/css/tour.css,/css/tour-detail.css,/css/inquiry-form.css,/css/missing.css';
$config['css_source_gh'] = 'https://www.globalhighlights.com/css/global.css';
$config['css_source_ct'] = 'https://data.chinatravel.com/css/min.php?f=/css/css3/bootstrap/bootstrap.css,/css/css3/style.css,/css/css3/destination-details.css';
+$config['css_source_chinatravel'] = 'http://202.103.68.104:100/css/newcss3/pc.css';
$config['css_source_ts'] = 'https://www.trainspread.com/css/bootstrap.min.css';
diff --git a/application/controllers/information.php b/application/controllers/information.php
index af937176..946dbc09 100644
--- a/application/controllers/information.php
+++ b/application/controllers/information.php
@@ -349,6 +349,14 @@ class Information extends CI_Controller
}
}
+ //CT判断是否生成静态文件
+ if ($this->config->item("site_code")=="chinatravel"){
+ //查找是否有静态文件
+ if ($this->html_file_helper('find', $data['information']->ic_url)) {
+ $data['has_html_file'] = true;
+ }
+ }
+
$this->load->view('bootstrap3/header', $data);
$this->load->view('bootstrap3/information_edit');
@@ -587,9 +595,15 @@ class Information extends CI_Controller
return false;
}
if ($this->html_file_helper('find', $information->ic_url)) {
- //用于批量更新
- $this->make_www_cache('pc', $information);
- $this->make_www_cache('mobile', $information);
+ //用于批量更新,CH和chinatravel分开 ,20210317 zp
+ if ($this->config->item('site_code') == 'ch'){
+ $this->make_www_cache('pc', $information);
+ $this->make_www_cache('mobile', $information);
+ }else if ($this->config->item('site_code') == 'chinatravel'){
+ $this->make_www_cache_ct('pc', $information);
+ $this->make_www_cache_ct('mobile', $information);
+ }
+
echo json_encode(array('name' => 'yes', 'data' => '更新成功!'));
return true;
} else {
@@ -754,94 +768,127 @@ class Information extends CI_Controller
*/
function make_www_cache_ct($device,$information){
$data = array();
- switch ($device) {
- case 'mobile':
- //获取移动优先的模板,如果有的话
- $template_path = 'mobile_first/' . $this->config->item('site_code');
- if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
- $template = $this->load->view($template_path, '', TRUE);
- $html_path_ext = '-mobile.htm';
- } else {
- return false;
- }
- break;
- case 'pc':
- //获取PC的模板,如果有的话
- $template_path = 'mobile_first/' . $this->config->item('site_code');
- if (is_file(APPPATH . 'views/' . $template_path . '-pc' . EXT)) {
- $template = $this->load->view($template_path . '-pc', '', TRUE);
- $html_path_ext = '-pc.htm';
- } else {
- return false;
- }
- break;
- default:
- }
-
- //替换模板中的标签
- $template = str_replace('', $information->ic_seo_title, $template);
- $template = str_replace('', $information->ic_seo_description, $template);
- $template = str_replace('', $information->ic_seo_keywords, $template);
- $template = str_replace('', $this->config->item('site_url') . $information->ic_url, $template);
- //非产品页面
- if (empty(get_meta($information->ic_id, 'meta_product_code'))) {
+ //先准备数据,CT采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
+ $data["TITLE"] = $information->ic_seo_title;
+ $data["DESCRIPTION"] = $information->ic_seo_description;
+ $data["KEYWORDS"] = $information->ic_seo_keywords;
+ $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
+ //详细内容
+ $data["CUSTOMCONENT"]=$information->ic_content;
+ //非产品页面
+ $data["PRODUCTJS"]="";
+ if (empty(get_meta($information->ic_id, 'meta_product_code'))) {
} else {
- $template = str_replace('', '', $template);
+ $data["PRODUCTJS"] = '';
}
+
//顶部全屏大图
+ $data["TOPBANNER"] ="";
+ $ImgText = ""; //图文字
+ $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
if($device=='mobile'){//移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
+ $bannerImg = '';
}else{
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
- }
- $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
+ $bannerImg = '
';
+ $meta_addon_picture_text = get_meta($information->ic_id,'meta_addon_picture_text');
+ if(!empty($meta_addon_picture_url)){
+ $ImgText = '
'.$meta_addon_picture_text.'