AH模板改为HTravel

master
Ycc 10 months ago
parent 155c2599c8
commit 56a015cb96

@ -395,7 +395,7 @@ $config['site'] = [
'ch' => ['site_code' => 'ch', 'site_id' => 14, 'site_lgc' => '1', 'site_url' => 'https://www.chinahighlights.com', 'site_image_url' => 'https://images.chinahighlights.com', 'site_authors' => ['TDJ', 'ycc'], 'site_user' => ',ycc,'], 'ch' => ['site_code' => 'ch', 'site_id' => 14, 'site_lgc' => '1', 'site_url' => 'https://www.chinahighlights.com', 'site_image_url' => 'https://images.chinahighlights.com', 'site_authors' => ['TDJ', 'ycc'], 'site_user' => ',ycc,'],
'ah' => ['site_code' => 'ah', 'site_id' => 141, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => 'https://images.asiahighlights.com', 'site_url' => 'https://www.asiahighlights.com', 'site_sitemap' => '', 'site_authors' => ['X', 'sfx'], 'site_user' => [',ycc,sfx,X,']], 'ah' => ['site_code' => 'ah', 'site_id' => 141, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => 'https://images.asiahighlights.com', 'site_url' => 'https://www.asiahighlights.com', 'site_sitemap' => '', 'site_authors' => ['X', 'sfx'], 'site_user' => [',ycc,sfx,X,']],
'jh' => ['site_code' => 'jh', 'site_id' => 186, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => 'https://images.japanhighlights.com', 'site_url' => 'https://www.japanhighlights.com', 'site_sitemap' => '', 'site_authors' => ['X', 'sfx'], 'site_user' => [',ycc,sfx,X,']], 'jh' => ['site_code' => 'jh', 'site_id' => 186, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => 'https://images.japanhighlights.com', 'site_url' => 'https://www.japanhighlights.com', 'site_sitemap' => '', 'site_authors' => ['X', 'sfx'], 'site_user' => [',ycc,sfx,X,']],
'HTravel' => ['site_code' => 'htravel', 'site_id' => 187, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => 'https://images.highlightstravel.com', 'site_url' => 'https://www.highlightstravel.com', 'site_sitemap' => '', 'site_authors' => ['X', 'sfx'], 'site_user' => [',ycc,sfx,X,']], 'HTravel' => ['site_code' => 'htravel', 'site_id' => 187, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => 'https://images.highlightstravel.com', 'site_url' => 'https://www.highlightstravel.com', 'site_sitemap' => '', 'site_authors' => ['X', 'sfx'], 'site_user' => [',ycc,sfx,X,']],
'gh' => ['site_code' => 'gh', 'site_id' => 163, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => 'https://images.globalhighlights.com', 'site_url' => 'https://www.globalhighlights.com', 'site_sitemap' => '', 'site_authors' => ['X', 'sfx'], 'site_user' => [',ycc,sfx,X,']], 'gh' => ['site_code' => 'gh', 'site_id' => 163, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => 'https://images.globalhighlights.com', 'site_url' => 'https://www.globalhighlights.com', 'site_sitemap' => '', 'site_authors' => ['X', 'sfx'], 'site_user' => [',ycc,sfx,X,']],
'gm' => ['site_code' => 'gm', 'site_id' => 22, 'site_lgc' => '4', 'site_url' => 'https://www.chinarundreisen.com', 'site_image_url' => '//bilder.chinarundreisen.com', 'site_authors' => ['DX', 'X', 'K', 'Lan', 'lmr', 'zyh', 'ZYHL', 'TDJ'], 'site_user' => ',ycc,lmr,B,zyh,DX,X,K,htc,zm,bhn,Lan,Tony,zyh,J,v,ZYHL,TDJ,LYY,shw,'], 'gm' => ['site_code' => 'gm', 'site_id' => 22, 'site_lgc' => '4', 'site_url' => 'https://www.chinarundreisen.com', 'site_image_url' => '//bilder.chinarundreisen.com', 'site_authors' => ['DX', 'X', 'K', 'Lan', 'lmr', 'zyh', 'ZYHL', 'TDJ'], 'site_user' => ',ycc,lmr,B,zyh,DX,X,K,htc,zm,bhn,Lan,Tony,zyh,J,v,ZYHL,TDJ,LYY,shw,'],
'gh_gm' => ['site_code' => 'gh_gm', 'site_id' => 178, 'site_lgc' => '4', 'site_url' => 'https://www.globalhighlights.de', 'site_image_url' => '//www.globalhighlights.de', 'site_authors' => ['DX', 'X', 'K', 'Lan', 'lmr', 'zyh', 'ZYHL', 'TDJ'], 'site_user' => ',ycc,lmr,B,zyh,DX,X,K,htc,zm,bhn,Lan,Tony,zyh,J,v,ZYHL,TDJ,LYY,shw,'], 'gh_gm' => ['site_code' => 'gh_gm', 'site_id' => 178, 'site_lgc' => '4', 'site_url' => 'https://www.globalhighlights.de', 'site_image_url' => '//www.globalhighlights.de', 'site_authors' => ['DX', 'X', 'K', 'Lan', 'lmr', 'zyh', 'ZYHL', 'TDJ'], 'site_user' => ',ycc,lmr,B,zyh,DX,X,K,htc,zm,bhn,Lan,Tony,zyh,J,v,ZYHL,TDJ,LYY,shw,'],
@ -793,7 +793,7 @@ $config['InfoType_ct'] = [
]; ];
//AH站点用到了 //AH站点用到了
$config['InfoType_ah'] = [ $config['InfoType_htravel'] = [
'国家信息' => 'country_info', '国家信息' => 'country_info',
'区域信息' => 'area_info', '区域信息' => 'area_info',
'国家信息列表页' => 'country_info_list', '国家信息列表页' => 'country_info_list',

@ -484,6 +484,9 @@ class Information extends CI_Controller
if (in_array($this->config->item('site_code'), array('ah'))) { if (in_array($this->config->item('site_code'), array('ah'))) {
$this->config->set_item('templates', $this->config->item('templates_ah')); $this->config->set_item('templates', $this->config->item('templates_ah'));
} }
if (in_array($this->config->item('site_code'), array('htravel'))) {
$this->config->set_item('templates', $this->config->item('templates_htravel'));
}
if (in_array($this->config->item('site_code'), array('pgr'))) { if (in_array($this->config->item('site_code'), array('pgr'))) {
$this->config->set_item('templates', $this->config->item('templates_pgr')); $this->config->set_item('templates', $this->config->item('templates_pgr'));
} }
@ -499,8 +502,8 @@ class Information extends CI_Controller
if ($Structure->is_sitecode == 'ct') { if ($Structure->is_sitecode == 'ct') {
$data['infoTypeList'] = $this->config->item('InfoType_ct'); $data['infoTypeList'] = $this->config->item('InfoType_ct');
} elseif ($Structure->is_sitecode == 'ah') { } elseif ($Structure->is_sitecode == 'htravel') {
$data['infoTypeList'] = $this->config->item('InfoType_ah'); $data['infoTypeList'] = $this->config->item('InfoType_htravel');
} else { } else {
switch ($data['rootInformation']->ic_ht_area_type) { switch ($data['rootInformation']->ic_ht_area_type) {
case 'c': //城市 case 'c': //城市
@ -710,12 +713,12 @@ class Information extends CI_Controller
$this->make_www_cache('mobile', $information_new, $recommand_information); $this->make_www_cache('mobile', $information_new, $recommand_information);
$this->make_www_cache('pc', $information_new, $recommand_information); $this->make_www_cache('pc', $information_new, $recommand_information);
//echo ' |000~111: '.$this->benchmark->elapsed_time('000', '111'); //echo ' |000~111: '.$this->benchmark->elapsed_time('000', '111');
} else if (strcasecmp($site_code, "ah") == 0 && !empty($auto_update_cache)) { } else if (strcasecmp($site_code, "htravel") == 0 && !empty($auto_update_cache)) {
//读取模板生成PC和移动优先文件 //读取模板生成PC和移动优先文件
$recommand_information = $this->recommand_information($information); $recommand_information = $this->recommand_information($information);
$information_new = $this->Information_model->Detail($this->input->post('is_id')); $information_new = $this->Information_model->Detail($this->input->post('is_id'));
$this->make_www_cache_ah('mobile', $information_new, $recommand_information); $this->make_www_cache_htravel('mobile', $information_new, $recommand_information);
$this->make_www_cache_ah('pc', $information_new, $recommand_information); $this->make_www_cache_htravel('pc', $information_new, $recommand_information);
} else if (strcasecmp($site_code, "gh") == 0 && !empty($auto_update_cache)) { } else if (strcasecmp($site_code, "gh") == 0 && !empty($auto_update_cache)) {
$recommand_information = $this->recommand_information($information); $recommand_information = $this->recommand_information($information);
$information_new = $this->Information_model->Detail($this->input->post('is_id')); $information_new = $this->Information_model->Detail($this->input->post('is_id'));
@ -748,9 +751,9 @@ class Information extends CI_Controller
$this->make_www_cache_hly($information_new); $this->make_www_cache_hly($information_new);
} else if (strcasecmp($site_code, "cht") == 0 && !empty($auto_update_cache)) { } else if (strcasecmp($site_code, "cht") == 0 && !empty($auto_update_cache)) {
$update_info_log = $this->update_cache($ic_url); $update_info_log = $this->update_cache($ic_url);
} else if (strcasecmp($site_code, "ah") == 0 && !empty($auto_update_cache)) { } else if (strcasecmp($site_code, "htravel") == 0 && !empty($auto_update_cache)) {
//$update_info_log = $this->update_cache($ic_url); //$update_info_log = $this->update_cache($ic_url);
} else if (strcasecmp($site_code, "cht") != 0 && strcasecmp($site_code, "gm") != 0 && strcasecmp($site_code, "ah") != 0) { //非cht站点并且非GM并且非AH } else if (strcasecmp($site_code, "cht") != 0 && strcasecmp($site_code, "gm") != 0 && strcasecmp($site_code, "htravel") != 0) { //非cht站点并且非GM并且非AH
$update_info_log = $this->update_cache($ic_url); $update_info_log = $this->update_cache($ic_url);
} else if (strcasecmp($site_code, "ct") == 0 && !empty($auto_update_cache)) { } else if (strcasecmp($site_code, "ct") == 0 && !empty($auto_update_cache)) {
$update_info_log = $this->update_cache($ic_url); $update_info_log = $this->update_cache($ic_url);
@ -830,9 +833,9 @@ class Information extends CI_Controller
if ($this->config->item('site_code') == 'ch') { if ($this->config->item('site_code') == 'ch') {
$this->make_www_cache('pc', $information, $recommand_information); $this->make_www_cache('pc', $information, $recommand_information);
$this->make_www_cache('mobile', $information, $recommand_information); $this->make_www_cache('mobile', $information, $recommand_information);
} else if ($this->config->item('site_code') == 'ah') { } else if ($this->config->item('site_code') == 'htravel') {
$this->make_www_cache_ah('pc', $information, $recommand_information); $this->make_www_cache_htravel('pc', $information, $recommand_information);
$this->make_www_cache_ah('mobile', $information, $recommand_information); $this->make_www_cache_htravel('mobile', $information, $recommand_information);
}else if ($this->config->item('site_code') == 'jh') { }else if ($this->config->item('site_code') == 'jh') {
$this->make_www_cache_jh('pc', $information, $recommand_information); $this->make_www_cache_jh('pc', $information, $recommand_information);
$this->make_www_cache_jh('mobile', $information, $recommand_information); $this->make_www_cache_jh('mobile', $information, $recommand_information);
@ -2179,7 +2182,7 @@ class Information extends CI_Controller
file_put_contents($html_path, $template, LOCK_EX); file_put_contents($html_path, $template, LOCK_EX);
} }
public function make_www_cache_ah($device, $information, $recommand_information) public function make_www_cache_htravel($device, $information, $recommand_information)
{ {
$data = array(); $data = array();
@ -5638,7 +5641,7 @@ class Information extends CI_Controller
$exclude_ids = array($information->is_id); //需要排除的is_id防止通过页面显示相同内容默认排除本身每个推荐内容都需要排除已经推荐过的 $exclude_ids = array($information->is_id); //需要排除的is_id防止通过页面显示相同内容默认排除本身每个推荐内容都需要排除已经推荐过的
foreach ($root_recommands as $item) { foreach ($root_recommands as $item) {
if ($this->config->item('site_code') == 'ah' or $this->config->item('site_code') == 'ch' or $this->config->item('site_code') == 'gh' or $this->config->item('site_code') == 'jh') { //如果是AH CH GH的页面取消重复检测 if ($this->config->item('site_code') == 'ah' or $this->config->item('site_code') == 'ch' or $this->config->item('site_code') == 'gh' or $this->config->item('site_code') == 'jh' or $this->config->item('site_code') == 'htravel') { //如果是AH CH GH的页面取消重复检测
$exclude_ids = array(0); $exclude_ids = array(0);
} }
$result = $this->recommand_information_rule($information, $root_detail, $item, $exclude_ids); $result = $this->recommand_information_rule($information, $root_detail, $item, $exclude_ids);
@ -5648,7 +5651,7 @@ class Information extends CI_Controller
} }
foreach ($group_recommands as $item) { foreach ($group_recommands as $item) {
if ($this->config->item('site_code') == 'ah' or $this->config->item('site_code') == 'ch' or $this->config->item('site_code') == 'gh' or $this->config->item('site_code') == 'jh') { //如果是AH CH GH JH的页面取消重复检测 if ($this->config->item('site_code') == 'ah' or $this->config->item('site_code') == 'ch' or $this->config->item('site_code') == 'gh' or $this->config->item('site_code') == 'jh' or $this->config->item('site_code') == 'htravel') { //如果是AH CH GH JH的页面取消重复检测
$exclude_ids = array(0); $exclude_ids = array(0);
} }
if (empty($data[$item->ir_name])) { if (empty($data[$item->ir_name])) {
@ -5805,7 +5808,13 @@ class Information extends CI_Controller
$url = 'https://www.asiahighlights.com/index.php/information/detail/?static_html_url=' . $url . '&static_html_optimize=comeon'; $url = 'https://www.asiahighlights.com/index.php/information/detail/?static_html_url=' . $url . '&static_html_optimize=comeon';
} }
break; break;
case 'htravel':
if ($delete_only === true) {
$url = 'https://www.highlightstravel.com/index.php/information/delete_cache_8X913mksJ/?static_html_url=' . $url;
} else { // static_html_optimize=comeon 启用静态化压缩和js、css延迟加载
$url = 'https://www.highlightstravel.com/index.php/information/detail/?static_html_url=' . $url . '&static_html_optimize=comeon';
}
break;
case 'gm': case 'gm':
//GET_HTTP("http://148.251.35.42:3300/create-cache/?url=" . urlencode($url)); //请求nodejs静态化更新页面删除缓存因为部分页面没有进入信息平台 //GET_HTTP("http://148.251.35.42:3300/create-cache/?url=" . urlencode($url)); //请求nodejs静态化更新页面删除缓存因为部分页面没有进入信息平台
//if ($delete_only) { //if ($delete_only) {

Loading…
Cancel
Save