Merge branch 'master' of github.com:hainatravel/information-system

hotfix/paypal-note
LiaoYijun 4 years ago
commit 668dd58a91

@ -727,6 +727,7 @@ $config['cache']['ru']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\chinahighlights.
$config['cache']['it']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\viaggio-in-cina.it';
$config['cache']['ch']['cache_path'] = 'D:\wwwcache\chinahighlights.com';
$config['cache']['ah']['cache_path'] = 'D:\wwwcache\asiahighlights.com';
$config['cache']['gh']['cache_path'] = 'D:\wwwcache\globalhighlights.com';
$config['cache']['chinatravel']['cache_path'] = 'D:\wwwcache\mobile-first\chinatravel.com';
//静态文件更新接口

@ -410,16 +410,23 @@ class Information extends CI_Controller
} else if (strcasecmp($site_code, "ch") == 0 && !empty($auto_update_cache)) {
//读取模板生成PC和移动优先文件
$information_new = $this->Information_model->Detail($this->input->post('is_id'));
$this->make_www_cache('mobile', $information_new);
$this->make_www_cache('pc', $information_new);
//$this->benchmark->mark('000');
$recommand_information = $this->recommand_information($information);
//$this->benchmark->mark('111');
$this->make_www_cache('mobile', $information_new, $recommand_information);
$this->make_www_cache('pc', $information_new, $recommand_information);
//echo ' |000~111: '.$this->benchmark->elapsed_time('000', '111');
} else if (strcasecmp($site_code, "ah") == 0 && !empty($auto_update_cache)) {
//读取模板生成PC和移动优先文件
$recommand_information = $this->recommand_information($information);
$information_new = $this->Information_model->Detail($this->input->post('is_id'));
$this->make_www_cache_ah('mobile', $information_new);
$this->make_www_cache_ah('pc', $information_new);
$this->make_www_cache_ah('mobile', $information_new, $recommand_information);
$this->make_www_cache_ah('pc', $information_new, $recommand_information);
} else if (strcasecmp($site_code, "gh") == 0 && !empty($auto_update_cache)) {
$recommand_information = $this->recommand_information($information);
$information_new = $this->Information_model->Detail($this->input->post('is_id'));
$this->make_www_cache_gh($information_new);
$this->make_www_cache_gh('mobile', $information_new, $recommand_information);
$this->make_www_cache_gh('pc', $information_new, $recommand_information);
} else if (strcasecmp($site_code, "chinatravel") == 0 && !empty($auto_update_cache)) {
//chinatravel读取模板生成PC和移动优先文件
$information_new = $this->Information_model->Detail($this->input->post('is_id'));
@ -504,13 +511,14 @@ class Information extends CI_Controller
return false;
}
if ($this->html_file_helper('find', $information->ic_url)) {
$recommand_information = $this->recommand_information($information);
//用于批量更新,CH和chinatravel分开 20210317 zp
if ($this->config->item('site_code') == 'ch') {
$this->make_www_cache('pc', $information);
$this->make_www_cache('mobile', $information);
$this->make_www_cache('pc', $information,$recommand_information);
$this->make_www_cache('mobile', $information,$recommand_information);
} else if ($this->config->item('site_code') == 'ah') {
$this->make_www_cache_ah('pc', $information);
$this->make_www_cache_ah('mobile', $information);
$this->make_www_cache_ah('pc', $information,$recommand_information);
$this->make_www_cache_ah('mobile', $information,$recommand_information);
} else if ($this->config->item('site_code') == 'chinatravel') {
$this->make_www_cache_ct($information);
// $this->make_www_cache_ct('mobile', $information);
@ -565,7 +573,7 @@ class Information extends CI_Controller
}
//生成静态文件 $device='mobile' or 'pc'
function make_www_cache($device, $information)
function make_www_cache($device, $information, $recommand_information)
{
$data = array();
switch ($device) {
@ -591,7 +599,6 @@ class Information extends CI_Controller
break;
default:
}
$breadcrumb_data = $this->Information_model->get_path_exclude_self($information->is_id, $information->is_path);
$breadcrumb_structured_data_content = $this->load->view(
@ -603,7 +610,6 @@ class Information extends CI_Controller
$breadcrumb_structured_data_content,
$template);
//替换模板中的标签
$template = str_replace('<!--@TITLE@-->', $information->ic_seo_title, $template);
$template = str_replace('<!--@DESCRIPTION@-->', $information->ic_seo_description, $template);
@ -630,6 +636,7 @@ class Information extends CI_Controller
}
}
//火车票搜索框添加 -- zp
if ($information->is_parent_id == "278008234") {
//本地测试的火车父类ID为278035939 。网前为278008234
@ -637,7 +644,6 @@ class Information extends CI_Controller
$template = str_replace('<!--@TRAIN-SEARCH@-->', $template_TrainSearch, $template);
}
//非产品页面
$meta_product_code = get_meta($information->ic_id, 'meta_product_code');
if (empty($meta_product_code)) {
@ -672,8 +678,6 @@ class Information extends CI_Controller
$information->ic_content = str_replace('<!--@BREADCRUMB-BLOCK@-->', $breadcrumb_content, $information->ic_content);
}
//---day tours--- 20210922 zp
//本地 278035929
//网前 278008224
@ -741,8 +745,7 @@ class Information extends CI_Controller
$PAG_Scheme = $dataTrippest['PagDetail']->PAG_Scheme;
$dataTrippest['PAG_Scheme'] = $PAG_Scheme;
//接送
if ($dataTrippest["t_Type"]=="transfer" || 1==1)
{
if ($dataTrippest["t_Type"] == "transfer" || 1 == 1) {
$PagList = $this->trippest_model->GetTransfer($dataTrippest['PagDetail']->PAG_SN);
$dataTrippest["PagList"] = $PagList;
}
@ -774,9 +777,8 @@ class Information extends CI_Controller
//---day tours end ----
//信息推荐
$template_recommand = $this->recommand_information($information);
$template_recommand = $recommand_information; //$this->recommand_information($information); 从外面传进来pc和移动只需要查一次减少数据库负担
$template = str_replace('<!--@ARTICLENEXT@-->', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template);
// //广告改叫tips防止被插件屏蔽
if (!empty($template_recommand['Tips Right TOP'])) {
@ -785,8 +787,6 @@ class Information extends CI_Controller
if (!empty($template_recommand['Tips Right'])) {
$template = str_replace('<!--@TIPS-RIGHT@-->', "<div class='right_tour'>" . $template_recommand['Tips Right']->it_content . "</div>", $template);
}
//文中的信息推荐
if (strpos($information->ic_content, '<!--@Content-Recommends-Article@-->') !== false) {
$information->ic_content = str_replace('<!--@Content-Recommends-Article@-->', $this->load->view($template_path . '-recommends-article', array('recommands' => $template_recommand), TRUE), $information->ic_content);
@ -796,6 +796,17 @@ class Information extends CI_Controller
$information->ic_content = str_replace('<!--@Content-Recommends-Tour@-->', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), TRUE), $information->ic_content);
}
//替换内容中广告
$temp_array = array();
preg_match_all('^<!--@TIPS-[A-Z]+-([0-9]+)@-->^', $information->ic_content, $temp_array);
if (!empty($temp_array[1])) {
foreach ($temp_array[1] as $key => $item) {
$tips_detail = $this->recommends_and_tips_model->tips_detail($item);
if ($tips_detail) {
$information->ic_content = str_replace($temp_array[0][$key], $tips_detail->it_content, $information->ic_content);
}
}
}
//顶部全屏大图
if ($device == 'mobile') { //移动端读取移动大图
@ -825,15 +836,21 @@ class Information extends CI_Controller
if (!empty($meta_news_video) && !empty($meta_video_picture)) {
$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);
}
//主样式表,内联模式
if (is_file('D:/wwwroot/origin-data.chinahighlights.com/css/mobile-first.css')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
$main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-data.chinahighlights.com/css/mobile-first.css'));
} else {
$main_css_string = compress_css(GET_HTTP('https://proxy-data.chinahighlights.com/css/mobile-first.css'));
}
$template = str_replace('<!--@MAIN-CSS@-->', '<style type="text/css">' . $main_css_string . '</style>', $template);
//额外样式
$meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
if (!empty($meta_addon_css)) {
//引用方式 $template = str_replace('<!--@ADDON-CSS@-->', '<link href="' . $meta_addon_css . '" rel="stylesheet">', $template);
//内联方式
if ($meta_addon_css == 'https://proxy-data.chinahighlights.com/css/tour-detail-former.css' && is_file('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css')) {
$meta_addon_css_string = compress_css(file_get_contents('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css'));
} else {
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
}
$template = str_replace('<!--@ADDON-CSS@-->', '<style type="text/css">' . $meta_addon_css_string . '</style>', $template);
}
//额外js
@ -864,7 +881,11 @@ class Information extends CI_Controller
$template = str_replace('<!--@OG:IMAGE@-->', '<meta property="og:image" content="' . $full_ic_photo . '"><meta property="og:image:secure_url" content="' . $full_ic_photo . '"><meta property="og:image:width" content="800"><meta property="og:image:height" content="450">', $template);
}
//设置图片尺寸
if (is_dir('D:/wwwroot/origin-images.chinahighlights.com') && is_dir('D:/wwwroot/origin-www.chinahighlights.com')) {
$template = $this->html_optimize_lib->set_image_size_local($template, 'D:/wwwroot/origin-www.chinahighlights.com', 'D:/wwwroot/origin-images.chinahighlights.com');
} else {
$template = $this->html_optimize_lib->set_image_size($template);
}
// /travelguide/chinese-zodiac/monthly-fortune-for-dog.htm
$html_path = $this->config->item('cache')[$this->config->item('site_code')]['cache_path'] . $information->ic_url;
$html_path = str_replace("\\", "/", $html_path);
@ -877,48 +898,220 @@ class Information extends CI_Controller
}
function make_www_cache_gh($information){
return false;
function make_www_cache_gh($device, $information, $recommand_information)
{
$data = array();
$data['information'] = $information;
switch ($device) {
case 'mobile':
//获取移动优先的模板,如果有的话
$template_path = 'mobile_first/' . $this->config->item('site_code');
$template_mobile = $this->load->view($template_path, '', TRUE);
$template_pc = $this->load->view($template_path . '-pc', '', TRUE);
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:
}
$breadcrumb_data = $this->Information_model->get_path_exclude_self($information->is_id, $information->is_path);
$breadcrumb_structured_data_content = $this->load->view(
$template_path . '-structured-data-breadcrumb',
array('breadcrumb_data' => $breadcrumb_data, 'information' => $information),
true);
$template = str_replace(
'<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->',
$breadcrumb_structured_data_content,
$template);
//替换模板中的标签
$template_mobile = str_replace('<!--@TITLE@-->', $information->ic_seo_title, $template_mobile);
$template_pc = str_replace('<!--@TITLE@-->', $information->ic_seo_title, $template_pc);
$template_mobile = str_replace('<!--@DESCRIPTION@-->', $information->ic_seo_description, $template_mobile);
$template_pc = str_replace('<!--@DESCRIPTION@-->', $information->ic_seo_description, $template_pc);
$template_mobile = str_replace('<!--@KEYWORDS@-->', $information->ic_seo_keywords, $template_mobile);
$template_pc = str_replace('<!--@KEYWORDS@-->', $information->ic_seo_keywords, $template_pc);
$template_mobile = str_replace('<!--@CANONICAL@-->', $this->config->item('site_url') . $information->ic_url, $template_mobile);
$template_pc = str_replace('<!--@CANONICAL@-->', $this->config->item('site_url') . $information->ic_url, $template_pc);
$template = str_replace('<!--@TITLE@-->', $information->ic_seo_title, $template);
$template = str_replace('<!--@DESCRIPTION@-->', $information->ic_seo_description, $template);
$template = str_replace('<!--@KEYWORDS@-->', $information->ic_seo_keywords, $template);
$template = str_replace('<!--@CANONICAL@-->', $this->config->item('site_url') . $information->ic_url, $template);
// 动态加载反馈标签
// HTLM: <div><!--@FEEDBACK_Shanghai@--></div>
// 解析结果:<!--@FEEDBACK_Shanghai@-->, Shanghai
$feedback_array = [];
preg_match_all('^<!--@FEEDBACK_(.*)@-->^', $information->ic_content, $feedback_array);
if (!empty($feedback_array)) {
foreach ($feedback_array[0] as $index => $tag_name) {
$city_name = $feedback_array[1][$index];
$feedback_data = $this->Feedback_model->get_feedback_by_city($city_name);
$feedback_content = $this->load->view(
$template_path . '-feedback',
array('feedback_data' => $feedback_data),
true);
$information->ic_content = str_replace(
$tag_name,
$feedback_content,
$information->ic_content);
}
}
//非产品页面
$meta_product_code = get_meta($information->ic_id, 'meta_product_code');
if (empty($meta_product_code)) {
$ads_by_google = !empty(get_meta($information->ic_id, 'meta_google_ad_article'));
//H1模板替换
$data_H1 = array();
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$author = $this->Operator_model->get_author_nikename($information->ic_author);
$data_H1['author'] = $author; //获取作者信息
$data_H1['ic_title'] = $information->ic_title;
$data_H1['ic_photo'] = $information->ic_photo;
$data_H1['breadcrumb_data'] = $breadcrumb_data;
$data_H1['ads_by_google'] = $ads_by_google;
$template_H1 = $this->load->view($template_path . '-h1', $data_H1, TRUE);
$template = str_replace('<!--@HEAD_1@-->', $template_H1, $template);
// $addthis_widget = $this->load->view($template_path . '-add-this', false, true);
// $template = str_replace('<!--@ADDTHIS-WIDGET@-->', $addthis_widget, $template);
// $article_structured_data_content = $this->load->view(
// $template_path . '-structured-data-article',
// array('information' => $information, 'author' => $author),
// true);
// $template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
} else {
// $template = str_replace('<!--@PRODUCT-JS@-->', '<script src="https://data.chinahighlights.com/js/flatpickr.js"></script>', $template);
// $inquiry_form_template = $this->load->view($template_path . '-inquiry-form', array('meta_product_code' => $meta_product_code), true);
// $information->ic_content = str_replace('<!--@INQUIRY-FORM@-->', $inquiry_form_template, $information->ic_content);
//
// $breadcrumb_content = $this->load->view($template_path . '-breadcrumb', array('breadcrumb_data' => $breadcrumb_data), true);
// $information->ic_content = str_replace('<!--@BREADCRUMB-BLOCK@-->', $breadcrumb_content, $information->ic_content);
}
//信息推荐
$template_recommand = $recommand_information; //$this->recommand_information($information); 从外面传进来pc和移动只需要查一次减少数据库负担
// $template = str_replace('<!--@ARTICLENEXT@-->', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template);
// //广告改叫tips防止被插件屏蔽
if (!empty($template_recommand['Tips Right TOP'])) {
// $template = str_replace('<!--@TIPS-RIGHT-TOP@-->', "<div class='right_brand_info'><aside>" . $template_recommand['Tips Right TOP']->it_content . "</aside></div>", $template);
}
if (!empty($template_recommand['Tips Right'])) {
// $template = str_replace('<!--@TIPS-RIGHT@-->', "<div class='right_tour'>" . $template_recommand['Tips Right']->it_content . "</div>", $template);
}
//文中的信息推荐
if (strpos($information->ic_content, '<!--@Content-Recommends-Article@-->') !== false) {
// $information->ic_content = str_replace('<!--@Content-Recommends-Article@-->', $this->load->view($template_path . '-recommends-article', array('recommands' => $template_recommand), TRUE), $information->ic_content);
}
//文中的线路推荐
if (strpos($information->ic_content, '<!--@Content-Recommends-Tour@-->') !== false) {
// $information->ic_content = str_replace('<!--@Content-Recommends-Tour@-->', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), TRUE), $information->ic_content);
}
//替换内容中广告
$temp_array = array();
preg_match_all('^<!--@TIPS-[A-Z]+-([0-9]+)@-->^', $information->ic_content, $temp_array);
if (!empty($temp_array[1])) {
foreach ($temp_array[1] as $key => $item) {
$tips_detail = $this->recommends_and_tips_model->tips_detail($item);
if ($tips_detail) {
$information->ic_content = str_replace($temp_array[0][$key], $tips_detail->it_content, $information->ic_content);
}
}
}
//顶部视频
$data['meta_news_video'] = get_meta($information->ic_id, 'meta_news_video');
$data['meta_video_picture'] = get_meta($information->ic_id, 'meta_video_picture');
if (empty($data['meta_news_video']) && empty($data['meta_video_picture'])) {
//没有顶部视频时候才读取全屏大图
//顶部全屏大图
if ($device == 'mobile') { //移动端读取移动大图
$data['meta_addon_picture'] = get_meta($information->ic_id, 'meta_addon_picture_mobile');
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
} else {
$data['meta_addon_picture'] = get_meta($information->ic_id, 'meta_addon_picture');
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
}
$meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
if (!empty($meta_addon_picture)) {
if (!empty($meta_addon_picture_url)) {
// $template = str_replace('<!--@TOP-BANNER@-->', '<div class="detailtopbanner"><a href="' . $meta_addon_picture_url . '"> <img class="img-responsive" alt="' . $information->ic_title . '" src="' . $meta_addon_picture . '"></a></div>', $template);
} else {
// $template = str_replace('<!--@TOP-BANNER@-->', '<div class="detailtopbanner"><img class="img-responsive" alt="' . $information->ic_title . '" src="' . $meta_addon_picture . '">' . $template_TrainSearch . '</div>', $template);
}
$data['meta_addon_picture_url'] = get_meta($information->ic_id, 'meta_addon_picture_url');
}
//顶部视频
// $meta_news_video = get_meta($information->ic_id, 'meta_news_video');
// $meta_video_picture = get_meta($information->ic_id, 'meta_video_picture');
// if (!empty($meta_news_video) && !empty($meta_video_picture)) {
// $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);
// }
$data['author'] = $this->Operator_model->get_author_nikename($information->ic_author); //获取作者信息
$template_H1 = $this->load->view($template_path . '-h1', $data, TRUE);
$template_mobile = str_replace('<!--@HEAD_1@-->', $template_H1, $template_mobile);
$template_pc = str_replace('<!--@HEAD_1@-->', $template_H1, $template_pc);
if (is_file('D:/wwwroot/origin-www.globalhighlights.com/css/gh-global.css')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
$main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-www.globalhighlights.com/css/gh-global.css'));
} else {
$main_css_string = compress_css(GET_HTTP('https://origin-www.globalhighlights.com/css/gh-global.css'));
}
$template = str_replace('<!--@MAIN-CSS@-->', '<style type="text/css">' . $main_css_string . '</style>', $template);
//额外样式
$meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
if (!empty($meta_addon_css)) {
// if ($meta_addon_css == 'https://proxy-data.chinahighlights.com/css/tour-detail-former.css' && is_file('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css')) {
//$meta_addon_css_string = compress_css(file_get_contents('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css'));
// } else {
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
// }
$template = str_replace('<!--@ADDON-CSS@-->', '<style type="text/css">' . $meta_addon_css_string . '</style>', $template);
}
//额外js
$meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
if (!empty($meta_addon_js)) {
$template = str_replace('<!--@ADDON-JS@-->', '<script src="' . $meta_addon_js . '"></script>', $template);
}
//设置内容图片缓加载
$lazy_content = $this->html_optimize_lib->set_lazy_loader($information->ic_content, 'https://data.chinahighlights.com/grey.gif');
$template = str_replace('<!--@CUSTOM-CONENT@-->', $lazy_content, $template);
//替换内容中各种标签
//$tag_why_us = $this->load->view($template_path . '-why-us', false, true);
// $template = str_replace('<!--@TAG-WHY-US@-->', $tag_why_us, $template);
//Google广告代码
//if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) {
//$template = str_replace('<!--@Match-Content-GOOGLE@-->', '<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-4231674166786366" data-ad-slot="1447610161" data-matched-content-rows-num="2,2" data-matched-content-columns-num="1,3" data-matched-content-ui-type="image_stacked,image_stacked"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>', $template);
//}
//社媒分享图片
$full_ic_photo = '';
if (!empty($information->ic_photo)) {
$full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo;
} else {
$full_ic_photo = get_meta($information->ic_id, 'meta_addon_picture_mobile');
}
if (!empty($full_ic_photo)) {
$template = str_replace('<!--@OG:IMAGE@-->', '<meta property="og:image" content="' . $full_ic_photo . '"><meta property="og:image:secure_url" content="' . $full_ic_photo . '"><meta property="og:image:width" content="800"><meta property="og:image:height" content="450">', $template);
}
//设置图片尺寸
if (is_dir('D:/wwwroot/origin-images.chinahighlights.com') && is_dir('D:/wwwroot/origin-www.globalhighlights.com')) {
$template = $this->html_optimize_lib->set_image_size_local($template, 'D:/wwwroot/origin-www.globalhighlights.com', 'D:/wwwroot/origin-images.chinahighlights.com');
} else {
$template = $this->html_optimize_lib->set_image_size($template);
}
// /travelguide/chinese-zodiac/monthly-fortune-for-dog.htm
$html_path = $this->config->item('cache')[$this->config->item('site_code')]['cache_path'] . $information->ic_url;
$html_path = str_replace("\\", "/", $html_path);
if (substr($html_path, -1, 1) == '/') {
$html_path = $html_path . 'index.htm';
}
$html_path .= $html_path_ext;
create_folder_by_path(dirname($html_path));
file_put_contents($html_path, $template, LOCK_EX);
}
function make_www_cache_ah($device, $information)
function make_www_cache_ah($device, $information, $recommand_information)
{
$data = array();
@ -978,7 +1171,7 @@ class Information extends CI_Controller
//推荐信息或者产品
//信息推荐
$template_recommand = $this->recommand_information($information);
$template_recommand = $recommand_information;// $this->recommand_information($information);
$template = str_replace('<!--@ARTICLENEXT@-->', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template);
//广告改叫tips防止被插件屏蔽
if (!empty($template_recommand['Tips Right'])) {
@ -993,6 +1186,18 @@ class Information extends CI_Controller
$information->ic_content = str_replace('<!--@Content-Recommends-Tour@-->', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), TRUE), $information->ic_content);
}
//替换内容中广告
$temp_array = array();
preg_match_all('^<!--@TIPS-[A-Z]+-([0-9]+)@-->^', $information->ic_content, $temp_array);
if (!empty($temp_array[1])) {
foreach ($temp_array[1] as $key => $item) {
$tips_detail = $this->recommends_and_tips_model->tips_detail($item);
if ($tips_detail) {
$information->ic_content = str_replace($temp_array[0][$key], $tips_detail->it_content, $information->ic_content);
}
}
}
//非产品页面
if (empty(get_meta($information->ic_id, 'meta_product_code'))) {
$addthis_widget = $this->load->view($template_path . '-add-this', false, true);
@ -1002,7 +1207,11 @@ class Information extends CI_Controller
}
//主样式表,内联模式
if (is_file('D:/wwwroot/origin-www.asiahighlights.com/css/mobile-first.css')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
$main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-www.asiahighlights.com/css/mobile-first.css'));
} else {
$main_css_string = compress_css(GET_HTTP('https://proxy-data.asiahighlights.com/css/mobile-first.css'));
}
$template = str_replace('<!--@MAIN-CSS@-->', '<style type="text/css">' . $main_css_string . '</style>', $template);
//额外样式
$meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
@ -1020,17 +1229,6 @@ class Information extends CI_Controller
$lazy_content = $this->html_optimize_lib->set_lazy_loader($information->ic_content, 'https://data.asiahighlights.com/grey.gif');
$template = str_replace('<!--@CUSTOM-CONENT@-->', $lazy_content, $template);
//替换内容中广告
$temp_array = array();
preg_match_all('^<!--@TIPS-[A-Z]+-([0-9]+)@-->^', $template, $temp_array);
if (!empty($temp_array[1])) {
foreach ($temp_array[1] as $key => $item) {
$tips_detail = $this->recommends_and_tips_model->tips_detail($item);
if ($tips_detail) {
$template = str_replace($temp_array[0][$key], $tips_detail->it_content, $template);
}
}
}
//Google广告代码
//if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) {
@ -1049,7 +1247,11 @@ class Information extends CI_Controller
}
//设置图片尺寸
if (is_dir('D:/wwwroot/origin-images.chinahighlights.com') && is_dir('D:/wwwroot/origin-www.asiahighlights.com')) {
$template = $this->html_optimize_lib->set_image_size_local($template, 'D:/wwwroot/origin-www.asiahighlights.com', 'D:/wwwroot/origin-images.chinahighlights.com');
} else {
$template = $this->html_optimize_lib->set_image_size($template);
}
// /travelguide/chinese-zodiac/monthly-fortune-for-dog.htm
$html_path = $this->config->item('cache')[$this->config->item('site_code')]['cache_path'] . $information->ic_url;
$html_path = str_replace("\\", "/", $html_path);
@ -1081,6 +1283,18 @@ class Information extends CI_Controller
$data["KEYWORDS"] = $information->ic_seo_keywords;
$data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
//面包屑
$crumb = "";
$crumb_data = $this->Information_model->get_path_exclude_ct($information->is_id, $information->is_path);
if (count($crumb_data)>0){ //至少有一个父类面包屑才显示
$crumb = "<div class=\"crumb\"><a href=\"/\">Home</a>";
foreach ($crumb_data as $index => $item) {
$crumb .= '<a href="'.$item['ic_url'].'" data-index="'.$index.'" data-is-id="'.$item['is_id'].'">'.$item['ic_url_title'].'</a>';
}
$crumb .="</div>";
}
$data["crumb"] = $crumb;
/* 详细内容 */
$ic_content = $information->ic_content;
// /**替换详细内容里面的价格
@ -1099,7 +1313,8 @@ class Information extends CI_Controller
// return '<span class="js_getTourPrice" data="'.$matchItem.'"></span>';;
// },$ic_content);
/** 替换H1加面包屑 */
$ic_content = preg_replace('/<h1>(.*)<\/h1>/i',$crumb."\r\n".'<H1>$1</H1>',$ic_content,1);
//图片加延迟
$ic_content = $this->html_optimize_lib->set_lazy_loader($ic_content, 'https://data.chinatravel.com/images/mobile-first/grey.gif');
@ -1393,7 +1608,7 @@ class Information extends CI_Controller
$data = $this->Information_model->random(1, $root_information->is_path, $exclude_ids);
break;
case 'rule_this_node_random'://指定节点下随机
$ir_pointer = $this->Information_model->Detail($recommand->ir_pointer_is_id);
$ir_pointer = $this->Information_model->Detail($recommand->ir_pointer_is_id, 'is_path');
if (!empty($ir_pointer)) {
$data = $this->Information_model->random(1, $ir_pointer->is_path, $exclude_ids);
}
@ -1442,7 +1657,6 @@ class Information extends CI_Controller
$root_recommands = $this->recommends_and_tips_model->recommends_list($root_detail->is_id);//节点下所有的推荐规则
$exclude_ids = array($information->is_id);//需要排除的is_id防止通过页面显示相同内容默认排除本身每个推荐内容都需要排除已经推荐过的
foreach ($root_recommands as $item) {
$result = $this->recommand_information_rule($information, $root_detail, $item, $exclude_ids);
if (!empty($result)) {

@ -99,8 +99,41 @@ class html_optimize_lib
}
return $html_object->save();
}
//获取图片尺寸的本地版本,图片存在相同服务器上,速度比较快
//$dataPath data文件夹本地路径
//$imagesPath images文件夹本地路径
public function set_image_size_local($html, $dataPath, $imagesPath)
{
$html_object = str_get_html($html);
foreach ($html_object->find('img') as $image) {
$img_src = $image->src;
if (!empty($image->originalsrc)) {
$img_src = $image->originalsrc;
}
//图片已经设置了尺寸的不再修改
if (empty($image->width) && (strpos($img_src, '//data.') !== false || strpos($img_src, '//images.') !== false)) {//以data或者images开头的域名才能获取尺寸
$img_src_urls = parse_url(trim($img_src));
$request_size[$img_src_urls['host']][] = $img_src_urls['path'];
$file_path = '';
if (strpos($img_src, '//data.') !== false) {
$file_path = $dataPath . $img_src_urls['path'];
}
if (strpos($img_src, '//images.') !== false) {
$file_path = $imagesPath . $img_src_urls['path'];
}
if (is_file($file_path)) {
$properties = getimagesize($file_path);//获取图片属性
if (!empty($properties[0]) && !empty($properties[1])) {
$image->width = $properties[0];
$image->height = $properties[1];
}
}
}
}
return $html_object->save();
}
}

@ -117,7 +117,7 @@ class Information_model extends CI_Model {
$exclude_ids_string=implode(',',$exclude_ids);
$this->search .= " AND ic_status=1 AND is_id NOT in ($exclude_ids_string,0)";
$this->orderBy = " ORDER BY NewID() ";
return $this->GetList();
return $this->GetList('ic_id, is_id, ic_url,ic_url_title,ic_title,is_path,is_level,ic_status,ic.ic_photo');
}
//根据url搜索信息
@ -237,7 +237,7 @@ class Information_model extends CI_Model {
}
function Detail($ic_url_is_id) {
function Detail($ic_url_is_id,$filed='') {
if (empty($ic_url_is_id)) {
return false;
}
@ -303,7 +303,8 @@ class Information_model extends CI_Model {
$sql.=" $filed ";
}
//添加查询AMP发布状态
$sql.=",isnull((select top 1 CONVERT(varchar, im_value) from infoMetas where im_ic_id=ic_id and im_key='AMP_STATUS'),0) as amp_status ";
//$sql.=",isnull((select top 1 CONVERT(varchar, im_value) from infoMetas where im_ic_id=ic_id and im_key='AMP_STATUS'),0) as amp_status ";
$sql.=",0 as amp_status ";
$sql.="FROM infoStructures is1 \n"
. " INNER JOIN infoContents ic ON ic.ic_id = is1.is_ic_id \n"
. " AND ic.ic_sitecode = is1.is_sitecode \n"
@ -550,5 +551,68 @@ class Information_model extends CI_Model {
return $this->GetList();
}
/**
* CT 获取当前页面的面包屑,不包括当前节点,去除链接为空及不发布的节点
*/
function get_path_exclude_ct($is_id, $path) {
$site_code = $this->config->item('site_code');
$path_query = $this->HT->query("select
ic_id, is_id, ic_url,ic_url_title,ic_title,is_path,is_level,ic_status
from infoStructures a inner join infoContents b on a.is_ic_id=b.ic_id
where is_id in ($path 0) and is_id <> ? and is_siteCode = ? order by is_level asc", array($is_id, $site_code));
$path_result = $path_query->result();
$path_list = [];
$group_map = [
278013869 => [
'ic_url' => '/tour',
'ic_url_title' => 'China Tours'
],
278014282 => [
'ic_url' => '/citytour',
'ic_url_title' => 'China City Tours'
],
278013862 => [
'ic_url' => '/daytrip',
'ic_url_title' => 'China Day Trip'
],
278014609 => [
'ic_url' => '/china-trains',
'ic_url_title' => 'China Trains'
],
278014608 => [
'ic_url' => '/china-flights',
'ic_url_title' => 'China Flights'
]
];
foreach ($path_result as $path_row) {
if (array_key_exists($path_row->is_id, $group_map)) {
$top_group = $group_map[$path_row->is_id];
$path_array = [
'ic_id' => $path_row->ic_id,
'is_id' => $path_row->is_id,
'ic_title' => $path_row->ic_title,
'ic_url' => $top_group['ic_url'],
'ic_url_title' => $top_group['ic_url_title']
];
$path_list[] = $path_array;
}
else if ($path_row->ic_status === 1) {
$path_array = [
'ic_id' => $path_row->ic_id,
'is_id' => $path_row->is_id,
'ic_title' => $path_row->ic_title,
'ic_url' => $path_row->ic_url,
'ic_url_title' => $path_row->ic_url_title
];
$path_list[] = $path_array;
}
}
return $path_list;
}
}

@ -2312,7 +2312,7 @@
<input type="checkbox" name="ignore_url_check" id="ignore_url_check"/>忽略URL重复
</label>
<div class="clearfix"></div>
<?php if (in_array($this->config->item('site_code'), array('ch', 'cht', 'gm', 'ah', 'ct','chinatravel'))) { ?>
<?php if (in_array($this->config->item('site_code'), array('ch', 'cht', 'gm', 'ah', 'gh', 'ct','chinatravel'))) { ?>
<label class="checkbox col-xs-24" style="font-weight: normal;margin-top:0;padding-left: 21px;">
<input type="checkbox" name="auto_update_cache_checkbox" id="auto_update_cache_checkbox"
onclick="get_update_cache_url();" value="<?php echo $information->ic_url; ?>"/>静态更新

@ -89,7 +89,7 @@
<li class="start-nav-item"><a href="/tibet/tours.htm">Tibet</a></li>
<li class="start-nav-item"><a href="/xinjiang/tours/">Xinjiang</a></li>
<li class="start-nav-item"><a href="/inner-mongolia/tours/">Inner Mongolia</a></li>
<li class="start-nav-item"><a href="/harbin/tours.htm">Harbin</a></li>
</ul>
</div>
</li>
@ -149,7 +149,23 @@
</li>
<li class="dropdown"><a href="/tour/asia-tours/" class="p_topnavilink">Asia Tours</a></li>
<li class="dropdown"><a href="/day-tours/" class="p_topnavilink">Day Tours</a></li>
<li class="dropdown"><a href="/day-tours/" class="p_topnavilink">Day Tours</a>
<div class="destinationspc dropdown-content">
<ul class="list-reset sidebar">
<li class="start-nav-item"><a href="/day-tours/beijing/">Beijing</a></li>
<li class="start-nav-item"><a href="/day-tours/shanghai/">Shanghai</a></li>
<li class="start-nav-item"><a href="/day-tours/xian/">Xi&#39;an</a></li>
<li class="start-nav-item"><a href="/day-tours/chengdu/">Chengdu</a></li>
<li class="start-nav-item"><a href="/day-tours/guilin/">Guilin</a></li>
<li class="start-nav-item"><a href="/day-tours/zhangjiajie/">Zhangjiajie</a></li>
<li class="start-nav-item"><a href="/day-tours/huangshan/">Huangshan</a></li>
<li class="start-nav-item"><a href="/day-tours/yunnan/">Yunnan</a></li>
<li class="start-nav-item"><a href="/day-tours/great-wall-hiking/">Great Wall Tours</a></li>
<li class="start-nav-item"><a href="/day-tours/china-food-tours/">Food Tours</a></li>
<li class="start-nav-item"><a href="/day-tours/activities/">Fun Activities</a></li>
</ul>
</div>
</li>
</ul>
</div>
<div class="pcnavibutton">

@ -50,20 +50,12 @@
<script defer type="text/javascript" src="https://data.chinahighlights.com/js/train/StationInfo.js"></script>
</div>
<!-- Google Code for Remarketing tag -->
<!-- Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. For instructions on adding this tag and more information on the above requirements, read the setup guide: google.com/ads/remarketingsetup -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 996341496;
var google_conversion_label = "ugA2CIi7_wMQ-O2L2wM";
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
/* ]]> */
</script>
<script defer type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-31694-20"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-31694-20');
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/996341496/?value=0&amp;label=ugA2CIi7_wMQ-O2L2wM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

@ -82,7 +82,8 @@
<li class="menu__item" role="menuitem"><a class="menu__link" data-submenu="submenu-4" aria-owns="submenu-4" href="#">Chinese Culture</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" data-submenu="submenu-5" aria-owns="submenu-5"
href="#" href="/china-trains/">Trains</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/">Day Tours</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" data-submenu="submenu-6" aria-owns="submenu-6"
href="#">Day Tours</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/tour/asia-tours/">Asia Tours</a></li>
</ul>
<!-- China Tours -->
@ -123,6 +124,7 @@
<li class="menu__item" role="menuitem"><a class="menu__link" href="/tibet/tours.htm">Tibet</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/xinjiang/tours/">Xinjiang</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/inner-mongolia/tours/">Inner Mongolia</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/harbin/tours.htm">Harbin</a></li>
</ul>
<!-- Travel Guide -->
@ -173,8 +175,21 @@
<li class="menu__item" role="menuitem"><a class="menu__link" href="/china-flights/">Flight</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/china-trains/app.htm">Train App Download</a></li>
</ul>
<!-- Day Tours -->
<ul data-menu="submenu-6" id="submenu-6" class="menu__level" tabindex="-1" role="menu"
aria-label="Day-Tours">
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/beijing/">Beijing</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/shanghai/">Shanghai</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/xian/">Xi&#39;an</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/chengdu/">Chengdu</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/guilin/">Guilin</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/zhangjiajie/">Zhangjiajie</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/huangshan/">Huangshan</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/yunnan/">Yunnan</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/great-wall-hiking/">Great Wall Tours</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/china-food-tours/">Food Tours</a></li>
<li class="menu__item" role="menuitem"><a class="menu__link" href="/day-tours/activities/">Fun Activities</a></li>
</ul>
</div>

@ -0,0 +1,21 @@
<div class="pagetop">
<?php if (!empty($ic_photo)) { ?>
<img src="<?php echo 'https://images.globalhighlights.com'.$ic_photo; ?>"
alt="<?php echo !empty($ic_title)?$ic_title:'H1 title globalhighlights mobile first template'; ?>" class="img-responsive">
<?php } ?>
<div class="aboutustop">
<div class="main_content_pc" style="float: none;">
<div id="crumbNav"><a href="/" data-count="<?php echo count($breadcrumb_data) ?>">Home</a>
<?php foreach ($breadcrumb_data as $index => $item) {?>
<a href="<?php echo $item['ic_url'] ?>" data-index="<?php echo $index ?>" data-is-id="<?php echo $item['is_id'] ?>"><?php echo $item['ic_url_title'] ?></a>
<?php }?>
</div>
<div class="topinfo">
<h1><?php echo !empty($ic_title)?$ic_title:'H1 title Chinahighlights mobile first template'; ?></h1>
<div class="author_info">By <em><?php echo !empty($author)?$author->OPI_FirstName:'author nickname'; ?></em> | Updated <?php echo date("M. j, Y",time()); ?></div>
</div>
</div>
</div>
</div>

@ -0,0 +1,275 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
<!--@TITLE@-->
</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta name="apple-mobile-web-app-title" content="Global Highlights - Since 2018!">
<meta name="keywords" content="<!--@KEYWORDS@-->">
<meta name="description" content="<!--@DESCRIPTION@-->">
<!--@OG:IMAGE@-->
<link rel="canonical" href="<!--@CANONICAL@-->">
<link rel="shortcut icon" href="https://www.globalhighlights.com/favicon.ico"/>
<link rel="dns-prefetch" href="https://data.globalhighlights.com">
<link rel="dns-prefetch" href="https://images.globalhighlights.com">
<link rel="dns-prefetch" href="https://www.googletagmanager.com">
<!--@MAIN-CSS@-->
<!--@ADDON-CSS@-->
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-MNKHRM5');</script>
<!-- End Google Tag Manager -->
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MNKHRM5"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<script>
((doc, buttonId, contentId) => {
doc.addEventListener('DOMContentLoaded', () => {
var moreButton = doc.getElementById(buttonId);
var contentDiv = doc.getElementById(contentId);
if (moreButton === null || contentDiv === null) {
console.error('CHECK MORE config error');
return;
}
moreButton.addEventListener('click', () => {
moreButton.classList.add('gh-animate-fade-out');
setTimeout(() => {
moreButton.classList.add('gh-display-none');
}, 80);
contentDiv.classList.remove('gh-display-none');
setTimeout(() => {
contentDiv.classList.remove('gh-animate-slide-down');
contentDiv.classList.add('gh-animate-slide-up');
}, 0);
});
});
})(document, 'checkMoreButton', 'moreContentDiv');
</script>
<!--PC头部-->
<header class="headerbar" id="header">
<div class="topnavigation">
<a href="/" class="p_toplogo"> <img src="https://data.chinahighlights.com/image/aboutus/logo-gh.png"
alt="Global Highlights logo" class="asiahighlightslogo img-responsive"></a>
<div class="p_topnavigation">
<ul class="pctopnavi">
<li class="dropdown"><a class="p_topnavilink">Destinations</a>
<div class="destinationspc dropdown-content">
<div class="inspirationinfo">
<div class="inspirationlist besttime">
<div class="inspirationtitle">East Asia Destinations</div>
<div class="listtour">
<ul class="inspiration">
<li><a href="/china/tours" >China</a></li>
<li><a href="/japan/tours" > Japan</a></li>
</ul>
</div>
</div>
<div class="inspirationlist topthings">
<div class="inspirationtitle">Southeast Asia Destinations</div>
<div class="listtour">
<ul class="inspiration">
<li><a href="/thailand/tours" >Thailand</a></li>
<li><a href="/vietnam/tours" >Vietnam</a></li>
<li><a href="/india/tours" >India</a></li>
</ul>
</div>
</div>
<div class="inspirationlist vacationtype">
<div class="inspirationtitle">More...</div>
<ul class="inspiration">
<li><a href="/egypt/tours" >Egypt</a></li>
<li><a href="/turkey/tours" >Turkey</a></li>
<li><a href="/morocco/tours" >Morocco</a></li>
</ul>
</div>
</div>
</div>
</li>
<li class="dropdown"><a class="p_topnavilink">Tours</a>
</li>
<li class="dropdown"><a href="/about" class="p_topnavilink" >About Us</a></li>
<li class="dropdown" style="padding-top: 25px;"><a href="/contactus" class="p_topnavilink contactbutton" >Contact Us</a>
</li>
<li class="dropdown">
<div class="siteSearch">
<form class="searchtextbox" id="searchbox_001281624266240652297:cl1fy1cxepi"
name="googlesreach" action="https://www.asiahighlights.com/sitesearch">
<input type="hidden" value="001281624266240652297:cl1fy1cxepi" name="cx">
<input type="hidden" value="FORID:9" name="cof">
<input type="text" onfocus="this.value = ''" class="strkeys" placeholder="site search"
name="q" style="width: 225px;">
<input type="image" class="submits"
src="https://data.chinahighlights.com/pic/pc-top-navigation-web-search-bg.png"
width="25px">
<input type="hidden" name="__ftoken__"
value="MTU5ODMzNDc2NDQ0NA==.3664784f0395175e7de44382781cd7f7cb647e2a">
</form>
</div>
</li>
</ul>
</div>
</div>
</header>
<!--PC头部 结束-->
<!--PC和移动端头部图-->
<div class="main_content">
<div class="main_content_pc">
<div class="pc_content">
<section>
<!--PC正文-->
</section>
</div>
<!--@TIPS-RIGHT@-->
</div>
<!--@ARTICLENEXT@-->
<!--PC正文 结束-->
</div>
<!--PC底部-->
<div class="infotailor">
<div class="infotailorword">We are here to help you...<br> Start planning your tailor-made global tour with 1-1
help from our travel advisors.
<div class="infotailormade"><a href="/contactus" >Create My Trip</a></div>
</div>
</div>
<div id="footer">
<div class="footerContent">
<div class="footerFeatures">
<div class=" whyuscontent">
<div class="featureTitle">100% Tailor-made</div>
<ul>
<li>Your timetable, your pace, unlimited changes without charge.</li>
</ul>
</div>
<div class=" whyuscontent">
<div class="featureTitle">Authentic</div>
<ul>
<li>Visit local families. rural farmers, and experience local life.</li>
</ul>
</div>
<div class=" whyuscontent">
<div class="featureTitle">Quality</div>
<ul>
<li>Our award winning service is backed up by a money back guarantee. We constantly review, inspect, and train our handpicked team.</li>
</ul>
</div>
<div class=" whyuscontent">
<div class="featureTitle">Top Reviews</div>
<ul>
<li>Over 10,000 travelers choose us per year, including celebrities, royalty and Australian Geographic Magazines team. And TripAdvisor Certificate of Excellence Winner Year on Year. </li>
</ul>
</div>
<div class=" partner">
<ul class="withBorder">
<li><a href="/about" rel="nofollow">About us</a></li>
<li><a href="/contactus" rel="nofollow">Contact us</a></li>
<li>Follow Us <a class="social_media" title="Follow us on Facebook" rel="nofollow" href="https://www.facebook.com/GlobalHighlightsTravel" target="_blank"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="25px" height="25px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
<path id="facebook" fill="#ffffff" d="M17.252,11.106V8.65c0-0.922,0.611-1.138,1.041-1.138h2.643V3.459l-3.639-0.015 c-4.041,0-4.961,3.023-4.961,4.961v2.701H10v4.178h2.336v11.823h4.916V15.284h3.316l0.428-4.178H17.252z"></path>
</svg></a>
<a class="social_media" title="Share us on Twitter" rel="nofollow" href="https://twitter.com/GlobalHighligh1" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style=" fill: #fff; ">
<path d="M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z"></path>
</svg></a>
<a class="social_media" title="Share us on Instagram" rel="nofollow" href="https://www.instagram.com/globalhighlightstour/" target="_blank"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="25px" height="25px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
<path id="instagram" fill="#ffffff" d="M22.107,3.415H7.893c-2.469,0-4.479,2.007-4.479,4.477v4.73v9.486c0,2.469,2.01,4.479,4.479,4.479h14.215 c2.469,0,4.479-2.01,4.479-4.479v-9.486v-4.73C26.586,5.421,24.576,3.415,22.107,3.415 M23.393,6.086l0.512-0.004v0.511v3.416 l-3.916,0.014l-0.012-3.928L23.393,6.086z M11.693,12.622c0.742-1.028,1.945-1.7,3.307-1.7s2.564,0.672,3.307,1.7 c0.484,0.67,0.771,1.49,0.771,2.379c0,2.248-1.828,4.078-4.078,4.078c-2.248,0-4.078-1.83-4.078-4.078 C10.922,14.112,11.211,13.292,11.693,12.622 M24.328,22.107c0,1.225-0.994,2.219-2.221,2.219H7.893 c-1.225,0-2.219-0.994-2.219-2.219v-9.486h3.459C8.832,13.356,8.664,14.159,8.664,15c0,3.494,2.842,6.335,6.336,6.335 s6.336-2.842,6.336-6.335c0-0.842-0.17-1.645-0.467-2.379h3.459V22.107z"></path>
</svg></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="clear"></div>
<div class="bottomlogo">
<div class="footerbox">
<img src="https://data.asiahighlights.com/grey.gif"
originalsrc="https://data.chinahighlights.com/image/aboutus/gh-bottom-logo.png" loader="lazy" class="img-responsive bottomlogopc">
<div class="bottomcopyright">© 2016-2021 Asia Highlights — Discovery Your Way! </div>
<div class="bottomprivacy"><a href="/privacy.htm" >Privacy Policy</a> | <a
href="/terms-of-use.htm" >Terms</a></div>
</div>
</div>
<!--PC底部 结束-->
<!--@PRODUCT-JS@-->
<!--@ADDON-JS@-->
<script>eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('8.R=10;(4(){3 h=b 26();4 11(X){8.R=X&&X.1I===\'1b\'?h.1V==1:10;1c()}h.1T=11;h.1Z=11;h.S=\'1M:1R/1x;1F,1Q/1P=\'})();5(!c.g){c.g=(4(){3 1u=y.M.1S;3 P=4(l){6 I l==="4"||1u.Q(l)==="[19 1L]"};3 1j=4(D){3 f=1O(D);5(1N(f)){6 0}5(f===0||!1Y(f)){6 f}6(f>0?1:-1)*o.1X(o.20(f))};3 1y=o.1U(2,1W)-1;3 1a=4(D){3 9=1j(D);6 o.1G(o.1H(9,0),1y)};6 4 g(J){3 C=E;3 U=y(J);5(J==p){F b H("c.g 1K 1J 1E-1D 19 - V p 1k B")}3 n=j.m>1?j[1]:2o B;3 T;5(I n!=="B"){5(!P(n)){F b H("c.g: 2q 2j, 2i 2k 2l 2m 2n a 4")}5(j.m>2){T=j[2]}}3 9=1a(U.m);3 A=P(C)?y(b C(9)):b c(9);3 k=0;3 d;1l(k<9){d=U[k];5(n){A[k]=I T==="B"?n(d,k):n.Q(T,d,k)}z{A[k]=d}k+=1}A.m=9;6 A}}())}5(!c.M.v){c.M.v=4(u){3 T,k;5(E==p){F b H("E 1i p 1k V 2p")}3 O=y(E);3 9=O.m>>>0;5(I u!=="4"){F b H(u+" 1i V a 4")}5(j.m>1){T=j[1]}k=0;1l(k<9){3 d;5(k 13 O){d=O[k];u.Q(T,d,k,O)}k++}}}4 1c(2h){3 14=4(i){i.W("1b",4(){i.r.q=1});5(8.R){i.1z("S",i.1B("1A").25(\'.28\',\'.1x\'))}z{i.1z("S",i.1B("1A"))}};3 1p=c.g(e.1q("h[1C=27]"));1p.v(4(7,Y){7.r.q=0;7.r.1w="q 0.18 1e-13-1m";14(7)});3 w=1o();w();4 12(l,1s,1v){3 N=p,L=b 1r();6 4(){3 K=b 1r();22(N);5(K-L>=1v){l();L=K}z{N=21(l,1s)}}}4 1h(1n){3 16=1n.24();6{15:16.15+8.23-e.t.2e,1t:16.1t+8.2d-e.t.2g}}4 1o(){3 G=c.g(e.1q("h[1C=2f]"));G.v(4(7,Y){7.r.q=0;7.r.1w="q 0.18 1e-13-1m"});6 4(){3 1g=8.2a;3 x=(e.t&&e.t.x)||(e.1d&&e.1d.x);G=G.29(4(7,Y){3 1f=1h(7).15;3 Z=1f<1g+x;5(Z){14(7)}6!Z})}}5(8.W){8.W("2c",12(w,s,s),10)}z{5(8.17){8.17("2b",12(w,s,s))}}};',62,151,'|||var|function|if|return|element|window|len||new|Array|kValue|document|number|from|img|target|arguments||fn|length|mapFn|Math|null|opacity|style|500|documentElement|callback|forEach|lazyloader|scrollTop|Object|else||undefined||value|this|throw|lazyImageList|TypeError|typeof|arrayLike|curTime|startTime|prototype|timeout||isCallable|call|isSupportWebp|src||items|not|addEventListener|event|index|hasVisible|false|getResult|throttle|in|loadImageByUrl|top|box|attachEvent|5s|object|toLength|load|createImageLoader|body|ease|offsetTop|seeHeight|getOffset|is|toInteger|or|while|out|el|createLazyloader|imageList|querySelectorAll|Date|delay|left|toStr|atleast|transition|webp|maxSafeInteger|setAttribute|originalsrc|getAttribute|loader|like|array|base64|min|max|type|an|requires|Function|data|isNaN|Number|vuUAAA|UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA|image|toString|onerror|pow|width|53|floor|isFinite|onload|abs|setTimeout|clearTimeout|pageYOffset|getBoundingClientRect|replace|Image|ready|jpg|filter|innerHeight|onscroll|scroll|pageXOffset|clientTop|lazy|clientLeft|settings|the|provided|second|argument|must|be|void|defined|when'.split('|'),0,{}))
function loadScriptByAsync(src) {var asyncScript = document.createElement("script");asyncScript.async = true;asyncScript.crossorigin = "anonymous";asyncScript.src = src;firstScript=document.getElementsByTagName("script")[0];firstScript.parentNode.insertBefore(asyncScript, firstScript);}</script>
<!--@IN-ARTICLE-GOOGLE@-->
<!--@ADDTHIS-WIDGET@-->
</body>
</html>

@ -0,0 +1,179 @@
<h2 style="text-align: center;">Recommended Articles</h2>
<div class="swiper" id='recommendedArticles'>
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="How to Plan a 2-Week Itinerary to Visit Thailand and Cambodia" >
<div class="nextarticlename">
<a href="/thailand/2-week-trip-to-thailand-and-cambodia"> How to Plan a 2-Week Itinerary to Visit Thailand and Cambodia </a>
</div>
</div>
</div>
<div class="swiper-slide">
<div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="Best (and Worst) Time to Visit Thailand &amp; When is the Rainy Season" >
<div class="nextarticlename">
<a href="/thailand/best-time-to-visit"> Best (and Worst) Time to Visit Thailand &amp; When is the Rainy Season </a>
</div>
</div>
</div>
<div class="swiper-slide">
<div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="Top Things to Do in Thailand" >
<div class="nextarticlename">
<a href="/thailand/top-things-to-do"> Top Things to Do in Thailand </a>
</div>
</div></div>
<div class="swiper-slide"><div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="Food and Drinks in Chiang Rai" >
<div class="nextarticlename">
<a href="/thailand/chiang-rai/food-and-drinks"> Food and Drinks in Chiang Rai </a>
</div>
</div></div>
<div class="swiper-slide"><div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="Top Thai Historical Places " >
<div class="nextarticlename">
<a href="/thailand/top-historical-places"> Top Thai Historical Places </a>
</div>
</div></div>
<div class="swiper-slide"><div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="30 Famous Southeast Asian Foods That You Must Try At Least Once" >
<div class="nextarticlename">
<a href="/southeast-asia/top-dishes"> 30 Famous Southeast Asian Foods That You Must Try At Least Once </a>
</div>
</div></div>
<div class="swiper-slide"><div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="Best Places to Visit in Southeast Asia for First-Timers" >
<div class="nextarticlename">
<a href="/southeast-asia/top-places-to-visit"> Best Places to Visit in Southeast Asia for First-Timers </a>
</div>
</div></div>
<div class="swiper-slide"><div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="The 30 Most Beautiful Places in Southeast Asia: Don't Miss These!" >
<div class="nextarticlename">
<a href="/southeast-asia/most-beautiful-places"> The 30 Most Beautiful Places in Southeast Asia: Don't Miss These! </a>
</div>
</div></div>
</div>
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
<div class="swiper-pagination"></div>
</div>
<h2 style="text-align: center;">Recommended Tours</h2>
<div class="swiper" id='recommendedArticles'>
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="How to Plan a 2-Week Itinerary to Visit Thailand and Cambodia" >
<div class="nextarticlename">
<a href="/thailand/2-week-trip-to-thailand-and-cambodia"> How to Plan a 2-Week Itinerary to Visit Thailand and Cambodia </a>
</div>
</div>
</div>
<div class="swiper-slide">
<div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="Best (and Worst) Time to Visit Thailand &amp; When is the Rainy Season" >
<div class="nextarticlename">
<a href="/thailand/best-time-to-visit"> Best (and Worst) Time to Visit Thailand &amp; When is the Rainy Season </a>
</div>
</div>
</div>
<div class="swiper-slide">
<div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="Top Things to Do in Thailand" >
<div class="nextarticlename">
<a href="/thailand/top-things-to-do"> Top Things to Do in Thailand </a>
</div>
</div></div>
<div class="swiper-slide"><div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="Food and Drinks in Chiang Rai" >
<div class="nextarticlename">
<a href="/thailand/chiang-rai/food-and-drinks"> Food and Drinks in Chiang Rai </a>
</div>
</div></div>
<div class="swiper-slide"><div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="Top Thai Historical Places " >
<div class="nextarticlename">
<a href="/thailand/top-historical-places"> Top Thai Historical Places </a>
</div>
</div></div>
<div class="swiper-slide"><div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="30 Famous Southeast Asian Foods That You Must Try At Least Once" >
<div class="nextarticlename">
<a href="/southeast-asia/top-dishes"> 30 Famous Southeast Asian Foods That You Must Try At Least Once </a>
</div>
</div></div>
<div class="swiper-slide"><div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="Best Places to Visit in Southeast Asia for First-Timers" >
<div class="nextarticlename">
<a href="/southeast-asia/top-places-to-visit"> Best Places to Visit in Southeast Asia for First-Timers </a>
</div>
</div></div>
<div class="swiper-slide"><div class="nextarticle">
<img src="https://images.chinahighlights.com/allpicture/2014/08/6d9644d4ab1d466083923cea_cut_600x550_251.jpg" class="img-responsive" alt="The 30 Most Beautiful Places in Southeast Asia: Don't Miss These!" >
<div class="nextarticlename">
<a href="/southeast-asia/most-beautiful-places"> The 30 Most Beautiful Places in Southeast Asia: Don't Miss These! </a>
</div>
</div></div>
</div>
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
<div class="swiper-pagination"></div>
</div>
<!-- Swiper JS -->
<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script>
<!-- Initialize Swiper -->
<script>
var swiper = new Swiper("#recommendedArticles", {
cssMode: true,
keyboard: true,
slidesPerView: 4,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev"
},
pagination: {
el: ".swiper-pagination",
clickable: true
}
});
</script>

@ -0,0 +1,28 @@
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://www.globalhighlights.com/"
}
<?php foreach ($breadcrumb_data as $index => $item) {?>
,{
"@type": "ListItem",
"position": <?php echo ($index + 2) ?>,
"name": "<?php echo $item['ic_url_title'] ?>",
"item": "https://www.globalhighlights.com<?php echo $item['ic_url'] ?>"
}
<?php }?>
<?php if ($information->ic_url != '/') {?>
,{
"@type": "ListItem",
"position": <?php echo (count($breadcrumb_data) + 2) ?>,
"name": "<?php echo $information->ic_title ?>"
}
<?php }?>
]
}
</script>

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save