显示plan的推荐信息

ct-mobile-first
ycc 5 years ago
parent 5397aa7b95
commit da5e06f0e0

@ -490,9 +490,9 @@ class Information extends CI_Controller
$update_info_log = $this->update_cache($ic_url, true); $update_info_log = $this->update_cache($ic_url, true);
} else if (strcasecmp($site_code, "ch") == 0 && !empty($auto_update_cache)) { } else if (strcasecmp($site_code, "ch") == 0 && !empty($auto_update_cache)) {
//读取模板生成PC和移动优先文件 //读取模板生成PC和移动优先文件
$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('mobile',$information_new); $this->make_www_cache('mobile', $information_new);
$this->make_www_cache('pc',$information_new); $this->make_www_cache('pc', $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, "ah") == 0 && !empty($auto_update_cache)) {
@ -564,25 +564,26 @@ class Information extends CI_Controller
return true; return true;
} }
public function update_www_cache($ic_id){ public function update_www_cache($ic_id)
{
$information = $this->Information_model->detail_by_ic_id($ic_id); $information = $this->Information_model->detail_by_ic_id($ic_id);
if(empty($information)){ if (empty($information)) {
echo json_encode(array('name' => 'no', 'data' => '找不到这个页面')); echo json_encode(array('name' => 'no', 'data' => '找不到这个页面'));
return false; return false;
} }
if($this->html_file_helper('find',$information->ic_url)){ if ($this->html_file_helper('find', $information->ic_url)) {
$this->make_www_cache('pc',$information); $this->make_www_cache('pc', $information);
$this->make_www_cache('mobile',$information); $this->make_www_cache('mobile', $information);
echo json_encode(array('name' => 'yes', 'data' => '更新成功!')); echo json_encode(array('name' => 'yes', 'data' => '更新成功!'));
return true; return true;
}else{ } else {
echo json_encode(array('name' => 'no', 'data' => '没有发布静态页面')); echo json_encode(array('name' => 'no', 'data' => '没有发布静态页面'));
return false; return false;
} }
} }
//静态文件操作 //静态文件操作
function html_file_helper($active = 'find', $ic_url = false) function html_file_helper($active = 'find', $ic_url = false)
{ {
if (empty($ic_url)) { if (empty($ic_url)) {
$ic_url = $this->input->get_post('ic_url'); $ic_url = $this->input->get_post('ic_url');
@ -662,19 +663,19 @@ class Information extends CI_Controller
$template_NEXT = $this->call_mobile_template_NEXT($template_path, $information->is_id); $template_NEXT = $this->call_mobile_template_NEXT($template_path, $information->is_id);
$template = str_replace('<!--@ARTICLENEXT@-->', $template_NEXT, $template); $template = str_replace('<!--@ARTICLENEXT@-->', $template_NEXT, $template);
$template = str_replace('<!--@ADDTHIS-WIDGET@-->', '<script async src="https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-52170b0a4a301edc"></script>', $template); $template = str_replace('<!--@ADDTHIS-WIDGET@-->', '<script async src="https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-52170b0a4a301edc"></script>', $template);
}else{ } else {
$template = str_replace('<!--@PRODUCT-JS@-->', '<script src="https://data.chinahighlights.com/js/flatpickr.js"></script>', $template); $template = str_replace('<!--@PRODUCT-JS@-->', '<script src="https://data.chinahighlights.com/js/flatpickr.js"></script>', $template);
} }
//顶部全屏大图 //顶部全屏大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
if(!empty($meta_addon_picture)){ if (!empty($meta_addon_picture)) {
$template = str_replace('<!--@TOP-BANNER@-->', '<div class="detailtopbanner"><img class="img-responsive" alt="'.$information->ic_title.'" src="'.$meta_addon_picture.'"></div>', $template); $template = str_replace('<!--@TOP-BANNER@-->', '<div class="detailtopbanner"><img class="img-responsive" alt="' . $information->ic_title . '" src="' . $meta_addon_picture . '"></div>', $template);
} }
//顶部视频 //顶部视频
$meta_news_video = get_meta($information->ic_id, 'meta_news_video'); $meta_news_video = get_meta($information->ic_id, 'meta_news_video');
$meta_video_picture = get_meta($information->ic_id, 'meta_video_picture'); $meta_video_picture = get_meta($information->ic_id, 'meta_video_picture');
if(!empty($meta_news_video) && !empty($meta_video_picture)){ if (!empty($meta_news_video) && !empty($meta_video_picture)) {
$template = str_replace('<!--@TOP-VIDEO@-->', '<div class="videoBg" style="margin-top: 120px;"><video autoplay="" controls="controls" id="bgvid" poster="'.$meta_video_picture.'" src="'.$meta_news_video.'" style="position: inherit;"> </video></div>', $template); $template = str_replace('<!--@TOP-VIDEO@-->', '<div class="detailtopbanner"><video autoplay="" controls="controls" id="bgvid" poster="' . $meta_video_picture . '" src="' . $meta_news_video . '" style="position: inherit;"> </video></div>', $template);
} }
//额外样式 //额外样式
$meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
@ -705,7 +706,7 @@ class Information extends CI_Controller
if (substr($html_path, -1, 1) == '/') { if (substr($html_path, -1, 1) == '/') {
$html_path = $html_path . 'index.htm'; $html_path = $html_path . 'index.htm';
} }
$html_path.=$html_path_ext; $html_path .= $html_path_ext;
create_folder_by_path(dirname($html_path)); create_folder_by_path(dirname($html_path));
file_put_contents($html_path, $template, LOCK_EX); file_put_contents($html_path, $template, LOCK_EX);
} }
@ -840,6 +841,26 @@ class Information extends CI_Controller
'/aboutus/no-shops.htm', '/aboutus/no-shops.htm',
'/aboutus/company-history.htm' '/aboutus/company-history.htm'
); );
$data['info_howtoplan'] = $this->Information_model->Detail('/travelguide/article-private-tour-vs-group-tour.htm');
if (!empty($data['info_howtoplan'])) {
$data['info_howtoplan_root'] = $this->Information_model->get_detail_by_path($data['info_howtoplan']->is_path, 1);//信息所属分类,获取信息顶级节点内容
$data['info_howtoplan']->ic_photo = $this->set_photo_content($data['info_howtoplan']->ic_photo, $data['info_howtoplan']->ic_content);
}
$data['info_besttime'] = $this->Information_model->Detail('/travelguide/how-chinahighlights-selects-your-hotel.htm');
if (!empty($data['info_besttime'])) {
$data['info_besttime_root'] = $this->Information_model->get_detail_by_path($data['info_besttime']->is_path, 1);//信息所属分类,获取信息顶级节点内容
$data['info_besttime']->ic_photo = $this->set_photo_content($data['info_besttime']->ic_photo, $data['info_besttime']->ic_content);
}
$data['info_topthings'] = $this->Information_model->Detail('/aboutus/who-recommended.htm');
if (!empty($data['info_topthings'])) {
$data['info_topthings_root'] = $this->Information_model->get_detail_by_path($data['info_topthings']->is_path, 1);//信息所属分类,获取信息顶级节点内容
$data['info_topthings']->ic_photo = $this->set_photo_content($data['info_topthings']->ic_photo, $data['info_topthings']->ic_content);
}
$data['info_hotel'] = $this->Information_model->Detail('/aboutus/no-shops.htm');
if (!empty($data['info_hotel'])) {
$data['info_hotel_root'] = $this->Information_model->get_detail_by_path($data['info_hotel']->is_path, 1);//信息所属分类,获取信息顶级节点内容
$data['info_hotel']->ic_photo = $this->set_photo_content($data['info_hotel']->ic_photo, $data['info_hotel']->ic_content);
}
break; break;
default: default:
} }

Loading…
Cancel
Save