@ -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) {