hotfix/paypal-note
LMR 2 years ago
parent 7b4025739c
commit 31b4b18d77

@ -364,9 +364,9 @@ class Information extends CI_Controller
echo json_encode($data); echo json_encode($data);
} else { } else {
$ic_content = $this->input->post('ic_content'); $ic_content = $this->input->post('ic_content');
if (strcasecmp($this->config->item('site_code'), "chinatravel") == 0){ //ct站替换中国大陆的英文 if (strcasecmp($this->config->item('site_code'), "chinatravel") == 0) { //ct站替换中国大陆的英文
if (stripos($ic_content, 'mainland china') !== false){ if (stripos($ic_content, 'mainland china') !== false) {
$ic_content = str_ireplace('mainland china','the mainland of china',$ic_content); $ic_content = str_ireplace('mainland china', 'the mainland of china', $ic_content);
} }
} }
@ -614,11 +614,13 @@ class Information extends CI_Controller
$breadcrumb_structured_data_content = $this->load->view( $breadcrumb_structured_data_content = $this->load->view(
$template_path . '-structured-data-breadcrumb', $template_path . '-structured-data-breadcrumb',
array('breadcrumb_data' => $breadcrumb_data, 'information' => $information), array('breadcrumb_data' => $breadcrumb_data, 'information' => $information),
true); true
);
$template = str_replace( $template = str_replace(
'<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->', '<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->',
$breadcrumb_structured_data_content, $breadcrumb_structured_data_content,
$template); $template
);
//替换模板中的标签 //替换模板中的标签
$template = str_replace('<!--@TITLE@-->', $information->ic_seo_title, $template); $template = str_replace('<!--@TITLE@-->', $information->ic_seo_title, $template);
@ -639,11 +641,13 @@ class Information extends CI_Controller
$feedback_content = $this->load->view( $feedback_content = $this->load->view(
$template_path . '-feedback-list', $template_path . '-feedback-list',
array('feedback_list' => $feedback_list), array('feedback_list' => $feedback_list),
true); true
);
$information->ic_content = str_replace( $information->ic_content = str_replace(
$tag_name, $tag_name,
$feedback_content, $feedback_content,
$information->ic_content); $information->ic_content
);
} }
} }
@ -651,11 +655,13 @@ class Information extends CI_Controller
$weather_forecast_content = $this->load->view( $weather_forecast_content = $this->load->view(
$template_path . '-weather-forecast', $template_path . '-weather-forecast',
array(), array(),
true); true
);
$information->ic_content = str_replace( $information->ic_content = str_replace(
'<!--@WEATHER-FORECAST-BLOCK@-->', '<!--@WEATHER-FORECAST-BLOCK@-->',
$weather_forecast_content, $weather_forecast_content,
$information->ic_content); $information->ic_content
);
//火车票搜索框添加 -- zp //火车票搜索框添加 -- zp
if ($information->is_parent_id == "278008234") { if ($information->is_parent_id == "278008234") {
@ -675,11 +681,11 @@ class Information extends CI_Controller
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容 $data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$data_H1['author'] = ''; //获取作者信息 $data_H1['author'] = ''; //获取作者信息
$author = $this->Operator_model->get_author_nikename($information->ic_author); $author = $this->Operator_model->get_author_nikename($information->ic_author);
if(!empty($author)){ if (!empty($author)) {
$data_H1['author']=$author->OPI_FirstName; $data_H1['author'] = $author->OPI_FirstName;
}else{ } else {
$author_web =$this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等 $author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if(!empty($author_web)){ if (!empty($author_web)) {
$data_H1['author'] = $author_web->a_name; $data_H1['author'] = $author_web->a_name;
} }
} }
@ -698,14 +704,16 @@ class Information extends CI_Controller
$article_structured_data_content = $this->load->view( $article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article', $template_path . '-structured-data-article',
array('information' => $information, 'author' => $author), array('information' => $information, 'author' => $author),
true); true
);
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template); $template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
$article_top_image_content = $this->load->view( $article_top_image_content = $this->load->view(
$template_path . '-info-top-img', $template_path . '-info-top-img',
array('information' => $information), array('information' => $information),
true); true
);
$template = str_replace('<!--@INFO-TOP-IMAGE@-->', $article_top_image_content, $template); $template = str_replace('<!--@INFO-TOP-IMAGE@-->', $article_top_image_content, $template);
$info_page_form_content = $this->load->view($template_path . '-info-page-form', false, true); $info_page_form_content = $this->load->view($template_path . '-info-page-form', false, true);
@ -811,7 +819,6 @@ class Information extends CI_Controller
// print_r($trippest_detail_template); // print_r($trippest_detail_template);
// die(); // die();
$information->ic_content = str_replace('<!--@TRIPPEST-FORM@-->', $trippest_detail_template, $information->ic_content); $information->ic_content = str_replace('<!--@TRIPPEST-FORM@-->', $trippest_detail_template, $information->ic_content);
} }
} }
@ -820,7 +827,7 @@ class Information extends CI_Controller
//信息推荐 //信息推荐
$template_recommand = $recommand_information; //$this->recommand_information($information); 从外面传进来pc和移动只需要查一次减少数据库负担 $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); $template = str_replace('<!--@ARTICLENEXT@-->', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template);
// //广告改叫tips防止被插件屏蔽 // //广告改叫tips防止被插件屏蔽
if (!empty($template_recommand['Tips Right TOP'])) { 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); $template = str_replace('<!--@TIPS-RIGHT-TOP@-->', "<div class='right_brand_info'><aside>" . $template_recommand['Tips Right TOP']->it_content . "</aside></div>", $template);
} }
@ -838,15 +845,17 @@ class Information extends CI_Controller
// 未勾选In Article 广告时,加入标签 <meta name="ezoic" content="noads"/>,让 ezoic 识别出该页面不展示广告。 // 未勾选In Article 广告时,加入标签 <meta name="ezoic" content="noads"/>,让 ezoic 识别出该页面不展示广告。
if (empty($meta_google_ad_article) || !$meta_google_ad_article) { if (empty($meta_google_ad_article) || !$meta_google_ad_article) {
$template = str_replace( $template = str_replace(
'<!--@Meta-Ezoic-NoAds@-->', '<!--@Meta-Ezoic-NoAds@-->',
'<meta name="ezoic" content="noads"/>', '<meta name="ezoic" content="noads"/>',
$template); $template
);
} else { } else {
$template = str_replace( $template = str_replace(
'<!--@Meta-Ezoic-NoAds@-->', '<!--@Meta-Ezoic-NoAds@-->',
'', '',
$template); $template
);
} }
//替换内容中广告 //替换内容中广告
@ -872,7 +881,7 @@ class Information extends CI_Controller
$template_TrainSearch = ""; $template_TrainSearch = "";
if ($information->ic_url == "/china-trains/hometest.htm" || $information->ic_url == "/china-trains/") { if ($information->ic_url == "/china-trains/hometest.htm" || $information->ic_url == "/china-trains/") {
$template_TrainSearch = $this->load->view($template_path . '-train-index', null, TRUE); $template_TrainSearch = $this->load->view($template_path . '-train-index', null, TRUE);
if ($device=="mobile"){ if ($device == "mobile") {
//手机端的搜索框直接显示不再加背景图这样可以保证CLS分数。 //手机端的搜索框直接显示不再加背景图这样可以保证CLS分数。
$template = str_replace('<!--@TOP-BANNER@-->', '<div class="detailtopbanner">' . $template_TrainSearch . '</div>', $template); $template = str_replace('<!--@TOP-BANNER@-->', '<div class="detailtopbanner">' . $template_TrainSearch . '</div>', $template);
} }
@ -894,7 +903,7 @@ class Information extends CI_Controller
$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); $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')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速 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')); $main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-data.chinahighlights.com/css/mobile-first.css'));
} else { } else {
$main_css_string = compress_css(GET_HTTP('https://proxy-data.chinahighlights.com/css/mobile-first.css')); $main_css_string = compress_css(GET_HTTP('https://proxy-data.chinahighlights.com/css/mobile-first.css'));
@ -998,20 +1007,24 @@ class Information extends CI_Controller
$breadcrumb_structured_data_content = $this->load->view( $breadcrumb_structured_data_content = $this->load->view(
$template_path . '-structured-data-breadcrumb', $template_path . '-structured-data-breadcrumb',
array('breadcrumb_data' => $breadcrumb_data, 'information' => $information), array('breadcrumb_data' => $breadcrumb_data, 'information' => $information),
true); true
);
$template = str_replace( $template = str_replace(
'<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->', '<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->',
$breadcrumb_structured_data_content, $breadcrumb_structured_data_content,
$template); $template
);
$tour_form_content = $this->load->view( $tour_form_content = $this->load->view(
$template_path . '-tour-form', $template_path . '-tour-form',
array('information' => $information), array('information' => $information),
true); true
);
$template = str_replace( $template = str_replace(
'<!--@TOUR-FORM-TAG@-->', '<!--@TOUR-FORM-TAG@-->',
$tour_form_content, $tour_form_content,
$template); $template
);
//替换模板中的标签 //替换模板中的标签
$template = str_replace('<!--@TITLE@-->', $information->ic_seo_title, $template); $template = str_replace('<!--@TITLE@-->', $information->ic_seo_title, $template);
@ -1033,17 +1046,17 @@ class Information extends CI_Controller
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容 $data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$data_H1['author'] = ''; //获取作者信息 $data_H1['author'] = ''; //获取作者信息
$author = $this->Operator_model->get_author_nikename($information->ic_author); $author = $this->Operator_model->get_author_nikename($information->ic_author);
if(!empty($author)){ if (!empty($author)) {
$data_H1['author']=$author->OPI_FirstName; $data_H1['author'] = $author->OPI_FirstName;
}else{ } else {
$author_web =$this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等 $author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if(!empty($author_web)){ if (!empty($author_web)) {
$data_H1['author'] = $author_web->a_name; $data_H1['author'] = $author_web->a_name;
} }
} }
$data_H1['ic_title'] = $information->ic_title; $data_H1['ic_title'] = $information->ic_title;
$data_H1['ic_photo'] = $meta_addon_picture;//$information->ic_photo; 用额外设置的图片替代 $data_H1['ic_photo'] = $meta_addon_picture; //$information->ic_photo; 用额外设置的图片替代
$data_H1['breadcrumb_data'] = $breadcrumb_data; $data_H1['breadcrumb_data'] = $breadcrumb_data;
$data_H1['ads_by_google'] = $ads_by_google; $data_H1['ads_by_google'] = $ads_by_google;
$template_H1 = $this->load->view($template_path . '-h1', $data_H1, TRUE); $template_H1 = $this->load->view($template_path . '-h1', $data_H1, TRUE);
@ -1057,7 +1070,8 @@ class Information extends CI_Controller
$article_structured_data_content = $this->load->view( $article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article', $template_path . '-structured-data-article',
array('information' => $information, 'author_name' => $data_H1['author']), array('information' => $information, 'author_name' => $data_H1['author']),
true); true
);
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template); $template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
if (!empty($meta_product_code)) { if (!empty($meta_product_code)) {
@ -1069,7 +1083,7 @@ class Information extends CI_Controller
//信息推荐 //信息推荐
$template_recommand = $recommand_information; //$this->recommand_information($information); 从外面传进来pc和移动只需要查一次减少数据库负担 $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); $template = str_replace('<!--@ARTICLENEXT@-->', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template);
// //广告改叫tips防止被插件屏蔽 // //广告改叫tips防止被插件屏蔽
if (!empty($template_recommand['Tips Right TOP'])) { 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); // $template = str_replace('<!--@TIPS-RIGHT-TOP@-->', "<div class='right_brand_info'><aside>" . $template_recommand['Tips Right TOP']->it_content . "</aside></div>", $template);
} }
@ -1096,18 +1110,24 @@ class Information extends CI_Controller
} }
} }
} }
$why_us_covid_list_pc = $this->load->view( $why_us_covid_list_pc = $this->load->view(
$template_path . '-why-us-covid-list-pc', array(), true); $template_path . '-why-us-covid-list-pc',
array(),
true
);
$information->ic_content = str_replace('<!--@WHY-US-COVID-LIST-PC@-->', $why_us_covid_list_pc, $information->ic_content); $information->ic_content = str_replace('<!--@WHY-US-COVID-LIST-PC@-->', $why_us_covid_list_pc, $information->ic_content);
$why_us_covid_list_mobile = $this->load->view( $why_us_covid_list_mobile = $this->load->view(
$template_path . '-why-us-covid-mobile', array(), true); $template_path . '-why-us-covid-mobile',
array(),
true
);
$information->ic_content = str_replace('<!--@WHY-US-COVID-MOBILE@-->', $why_us_covid_list_mobile, $information->ic_content); $information->ic_content = str_replace('<!--@WHY-US-COVID-MOBILE@-->', $why_us_covid_list_mobile, $information->ic_content);
$info_page_form_content = $this->load->view($template_path . '-info-page-form', false, true); $info_page_form_content = $this->load->view($template_path . '-info-page-form', false, true);
$information->ic_content = str_replace('<!--@INFO-PAGE-FORM@-->', $info_page_form_content, $information->ic_content); $information->ic_content = str_replace('<!--@INFO-PAGE-FORM@-->', $info_page_form_content, $information->ic_content);
if (is_file('D:/wwwroot/origin-www.globalhighlights.com/css/gh-global.css')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速 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')); $main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-www.globalhighlights.com/css/gh-global.css'));
} else { } else {
$main_css_string = compress_css(GET_HTTP('https://www.globalhighlights.com/css/gh-global.css')); $main_css_string = compress_css(GET_HTTP('https://www.globalhighlights.com/css/gh-global.css'));
@ -1131,7 +1151,7 @@ class Information extends CI_Controller
//设置内容图片缓加载 //设置内容图片缓加载
$lazy_content = $this->html_optimize_lib->set_lazy_loader($information->ic_content, 'https://data.chinahighlights.com/grey.gif'); $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); $template = str_replace('<!--@CUSTOM-CONENT@-->', $lazy_content, $template);
//社媒分享图片 //社媒分享图片
$full_ic_photo = ''; $full_ic_photo = '';
if (!empty($information->ic_photo)) { if (!empty($information->ic_photo)) {
@ -1226,11 +1246,11 @@ class Information extends CI_Controller
$data['ads_by_google'] = $ads_by_google; $data['ads_by_google'] = $ads_by_google;
$data['author'] = ''; //获取作者信息 $data['author'] = ''; //获取作者信息
$author = $this->Operator_model->get_author_nikename($information->ic_author); $author = $this->Operator_model->get_author_nikename($information->ic_author);
if(!empty($author)){ if (!empty($author)) {
$data['author']=$author->OPI_FirstName; $data['author'] = $author->OPI_FirstName;
}else{ } else {
$author_web =$this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等 $author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if(!empty($author_web)){ if (!empty($author_web)) {
$data['author'] = $author_web->a_name; $data['author'] = $author_web->a_name;
} }
} }
@ -1241,21 +1261,24 @@ class Information extends CI_Controller
$article_structured_data_content = $this->load->view( $article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article', $template_path . '-structured-data-article',
array('information' => $information, 'author' => $author), array('information' => $information, 'author' => $author),
true); true
);
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template); $template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
// 结构化标签BreadcrumbList // 结构化标签BreadcrumbList
$breadcrumb_structured_data_content = $this->load->view( $breadcrumb_structured_data_content = $this->load->view(
$template_path . '-structured-data-breadcrumb', $template_path . '-structured-data-breadcrumb',
array('breadcrumb_data' => $breadcrumb_data, 'information' => $information), array('breadcrumb_data' => $breadcrumb_data, 'information' => $information),
true); true
);
$template = str_replace( $template = str_replace(
'<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->', '<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->',
$breadcrumb_structured_data_content, $breadcrumb_structured_data_content,
$template); $template
);
//推荐信息或者产品 //推荐信息或者产品
//信息推荐 //信息推荐
$template_recommand = $recommand_information;// $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); $template = str_replace('<!--@ARTICLENEXT@-->', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template);
//广告改叫tips防止被插件屏蔽 //广告改叫tips防止被插件屏蔽
if (!empty($template_recommand['Tips Right'])) { if (!empty($template_recommand['Tips Right'])) {
@ -1289,28 +1312,31 @@ class Information extends CI_Controller
$template = str_replace('<!--@ADDTHIS-WIDGET@-->', $addthis_widget, $template); $template = str_replace('<!--@ADDTHIS-WIDGET@-->', $addthis_widget, $template);
$template = str_replace('?product_code=', '', $template); $template = str_replace('?product_code=', '', $template);
} else { } else {
$template = str_replace('?product_code=', '?product_code='.$meta_product_code, $template); $template = str_replace('?product_code=', '?product_code=' . $meta_product_code, $template);
$inquiry_form_template = $this->load->view( $inquiry_form_template = $this->load->view(
$template_path . '-inquiry-form', $template_path . '-inquiry-form',
array('meta_product_code' => $meta_product_code, 'information' => $information), array('meta_product_code' => $meta_product_code, 'information' => $information),
true); true
);
$information->ic_content = str_replace('<!--@INQUIRY-FORM@-->', $inquiry_form_template, $information->ic_content); $information->ic_content = str_replace('<!--@INQUIRY-FORM@-->', $inquiry_form_template, $information->ic_content);
// GP 表单 // GP 表单
$gp_form_content = $this->load->view( $gp_form_content = $this->load->view(
$template_path . '-gp-form', $template_path . '-gp-form',
array('meta_product_code' => $meta_product_code, 'information' => $information), array('meta_product_code' => $meta_product_code, 'information' => $information),
true); true
);
$information->ic_content = str_replace('<!--@GP-FORM@-->', $gp_form_content, $information->ic_content); $information->ic_content = str_replace('<!--@GP-FORM@-->', $gp_form_content, $information->ic_content);
// 水灯节 GP 线路表单 // 水灯节 GP 线路表单
$gp_form_content = $this->load->view( $gp_form_content = $this->load->view(
$template_path . '-lantern-festival-gp-form', $template_path . '-lantern-festival-gp-form',
array('meta_product_code' => $meta_product_code, 'information' => $information), array('meta_product_code' => $meta_product_code, 'information' => $information),
true); true
$information->ic_content = str_replace('<!--@LANTERN-GP-FORM@-->', $gp_form_content, $information->ic_content); );
$information->ic_content = str_replace('<!--@LANTERN-GP-FORM@-->', $gp_form_content, $information->ic_content);
} }
// why-us 相关的标签 // why-us 相关的标签
$why_us_mobile = $this->load->view($template_path . '-why-us-mobile', false, true); $why_us_mobile = $this->load->view($template_path . '-why-us-mobile', false, true);
$information->ic_content = str_replace('<!--@WHY_US_MOBILE@-->', $why_us_mobile, $information->ic_content); $information->ic_content = str_replace('<!--@WHY_US_MOBILE@-->', $why_us_mobile, $information->ic_content);
@ -1325,15 +1351,17 @@ class Information extends CI_Controller
// 水灯节表单 // 水灯节表单
$lantern_form_content = $this->load->view( $lantern_form_content = $this->load->view(
$template_path . '-lantern-form', $template_path . '-lantern-form',
array('information' => $information), array('information' => $information),
true); true
);
$information->ic_content = str_replace('<!--@LANTERN-FORM@-->', $lantern_form_content, $information->ic_content); $information->ic_content = str_replace('<!--@LANTERN-FORM@-->', $lantern_form_content, $information->ic_content);
// 水灯节在信息页面表单 // 水灯节在信息页面表单
$lantern_form_info_page_content = $this->load->view( $lantern_form_info_page_content = $this->load->view(
$template_path . '-lantern-form-info-page', $template_path . '-lantern-form-info-page',
array('information' => $information), array('information' => $information),
true); true
);
$information->ic_content = str_replace('<!--@LANTERN-FORM-INFO-PAGE@-->', $lantern_form_info_page_content, $information->ic_content); $information->ic_content = str_replace('<!--@LANTERN-FORM-INFO-PAGE@-->', $lantern_form_info_page_content, $information->ic_content);
// 动态加载反馈标签,第一个城市不足八条,使用第二城市数据。 // 动态加载反馈标签,第一个城市不足八条,使用第二城市数据。
@ -1349,16 +1377,18 @@ class Information extends CI_Controller
$feedback_content = $this->load->view( $feedback_content = $this->load->view(
$template_path . '-feedback-list', $template_path . '-feedback-list',
array('feedback_list' => $feedback_list), array('feedback_list' => $feedback_list),
true); true
);
$information->ic_content = str_replace( $information->ic_content = str_replace(
$tag_name, $tag_name,
$feedback_content, $feedback_content,
$information->ic_content); $information->ic_content
);
} }
} }
//主样式表,内联模式 //主样式表,内联模式
if (is_file('D:/wwwroot/origin-www.asiahighlights.com/css/mobile-first.css')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速 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')); $main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-www.asiahighlights.com/css/mobile-first.css'));
} else { } else {
$main_css_string = compress_css(GET_HTTP('https://proxy-data.asiahighlights.com/css/mobile-first.css')); $main_css_string = compress_css(GET_HTTP('https://proxy-data.asiahighlights.com/css/mobile-first.css'));
@ -1414,7 +1444,8 @@ class Information extends CI_Controller
file_put_contents($html_path, $template, LOCK_EX); file_put_contents($html_path, $template, LOCK_EX);
} }
public function test_ah_feedback() { public function test_ah_feedback()
{
$feedback_array = []; $feedback_array = [];
preg_match_all('^<!--@FEEDBACK_(.*)@-->^', '<div><!--@FEEDBACK_Siem Reap,Bangkok@--></div>', $feedback_array); preg_match_all('^<!--@FEEDBACK_(.*)@-->^', '<div><!--@FEEDBACK_Siem Reap,Bangkok@--></div>', $feedback_array);
if (!empty($feedback_array)) { if (!empty($feedback_array)) {
@ -1426,7 +1457,8 @@ class Information extends CI_Controller
$feedback_content = $this->load->view( $feedback_content = $this->load->view(
'mobile_first/ah' . '-feedback-list', 'mobile_first/ah' . '-feedback-list',
array('feedback_list' => $feedback_list), array('feedback_list' => $feedback_list),
true); true
);
echo $feedback_content; echo $feedback_content;
// $information->ic_content = str_replace( // $information->ic_content = str_replace(
// $tag_name, // $tag_name,
@ -1471,12 +1503,12 @@ class Information extends CI_Controller
} }
$data["crumb"] = $crumb; $data["crumb"] = $crumb;
//作者字符串,信息页或者城市天气页加载 2022-7-26 //作者字符串,信息页或者城市天气页加载 2022-7-26
$str_author=""; $str_author = "";
$author = $this->Operator_model->get_author_nikename($information->ic_author); $author = $this->Operator_model->get_author_nikename($information->ic_author);
if ((empty($meta_product_code) && !($meta_ct_page_type !== false && $meta_ct_page_type != "")) || $meta_ct_page_type=="weatherpage"){ if ((empty($meta_product_code) && !($meta_ct_page_type !== false && $meta_ct_page_type != "")) || $meta_ct_page_type == "weatherpage") {
$OPI_FirstName = !empty($author)?$author->OPI_FirstName:'author nickname'; $OPI_FirstName = !empty($author) ? $author->OPI_FirstName : 'author nickname';
$str_author = '<div class="authorupdate">Written by <strong>'.$OPI_FirstName.'</strong> Updated <span>' . date("M. j, Y",strtotime($information->ic_datetime)) . '</span></div>' ; $str_author = '<div class="authorupdate">Written by <strong>' . $OPI_FirstName . '</strong> Updated <span>' . date("M. j, Y", strtotime($information->ic_datetime)) . '</span></div>';
} }
/* 详细内容 */ /* 详细内容 */
@ -1498,11 +1530,11 @@ class Information extends CI_Controller
// },$ic_content); // },$ic_content);
/** 替换H1加面包屑,加作者 */ /** 替换H1加面包屑,加作者 */
$ic_content = preg_replace('/<h1>(.*)<\/h1>/i', $crumb . "\r\n" . '<H1>$1</H1>' . "\r\n" .$str_author, $ic_content, 1); $ic_content = preg_replace('/<h1>(.*)<\/h1>/i', $crumb . "\r\n" . '<H1>$1</H1>' . "\r\n" . $str_author, $ic_content, 1);
/**替换zodiac标签 */ /**替换zodiac标签 */
if (strpos($ic_content, '<!--@ZODIAC-CALC@-->') !== false){ if (strpos($ic_content, '<!--@ZODIAC-CALC@-->') !== false) {
$zodiacCalc = $this->load->view('mobile_first/' . $this->config->item('site_code').'-zodiac-calc',false,true); $zodiacCalc = $this->load->view('mobile_first/' . $this->config->item('site_code') . '-zodiac-calc', false, true);
$ic_content = str_replace('<!--@ZODIAC-CALC@-->', $zodiacCalc, $ic_content); $ic_content = str_replace('<!--@ZODIAC-CALC@-->', $zodiacCalc, $ic_content);
} }
@ -1575,7 +1607,7 @@ class Information extends CI_Controller
$addBaseJs = false; $addBaseJs = false;
$addonJs = ""; $addonJs = "";
$meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格 $meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
if ($meta_ct_page_price == "yes") { if ($meta_ct_page_price == "yes") {
$addBaseJs = true; $addBaseJs = true;
} else if ($meta_ct_page_type !== false && $meta_ct_page_type != "") { } else if ($meta_ct_page_type !== false && $meta_ct_page_type != "") {
@ -1667,19 +1699,19 @@ class Information extends CI_Controller
} }
//游船详细页 //游船详细页
if ($meta_ct_page_type == "cruisedetails"){ if ($meta_ct_page_type == "cruisedetails") {
$productType = $meta_ct_page_type; $productType = $meta_ct_page_type;
$meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value'); $meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value');
if (!empty($meta_ct_page_value)) { if (!empty($meta_ct_page_value)) {
$productCode = $meta_ct_page_value; $productCode = $meta_ct_page_value;
} }
$dataCruise["shipname"]=$productCode; $dataCruise["shipname"] = $productCode;
$template_curisedetails = $this->load->view($template_path . '-cruisedetails-form', $dataCruise, TRUE); $template_curisedetails = $this->load->view($template_path . '-cruisedetails-form', $dataCruise, TRUE);
$data["template_curisedetails"] = $template_curisedetails; $data["template_curisedetails"] = $template_curisedetails;
} }
//表单页 //表单页
if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform","tourdetail"))) { if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform", "tourdetail"))) {
$productType = $meta_ct_page_type; $productType = $meta_ct_page_type;
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/form.js" defer></script>'; $addonJs .= '<script src="' . $apiweb . '/js/mobile-first/form.js" defer></script>';
$data["ADDONCSS"] .= '<link href="' . $apiweb . '/css/newcss3/flatpickr.css" rel="preload" as="style" onload="this.rel=\'stylesheet\'" />'; $data["ADDONCSS"] .= '<link href="' . $apiweb . '/css/newcss3/flatpickr.css" rel="preload" as="style" onload="this.rel=\'stylesheet\'" />';
@ -1732,13 +1764,12 @@ class Information extends CI_Controller
$meta_addon_picture = ""; $meta_addon_picture = "";
$data["TOPBANNER"] = '<div class="banner">' . $template_TrainSearch . '</div>'; $data["TOPBANNER"] = '<div class="banner">' . $template_TrainSearch . '</div>';
} }
} else if ($information->ic_url == "/china-flights") { } else if ($information->ic_url == "/china-flights") {
//机票首页 //机票首页
$template_TrainSearch = $this->load->view($template_path . '-flight-index', null, TRUE); $template_TrainSearch = $this->load->view($template_path . '-flight-index', null, TRUE);
$ImgText = ""; $ImgText = "";
//飞机票移动端去掉头部图片保证搜索框CLS //飞机票移动端去掉头部图片保证搜索框CLS
if ($device == 'mobile') { if ($device == 'mobile') {
$meta_addon_picture = ""; $meta_addon_picture = "";
$data["TOPBANNER"] = '<div class="banner">' . $template_TrainSearch . '</div>'; $data["TOPBANNER"] = '<div class="banner">' . $template_TrainSearch . '</div>';
} }
@ -1788,7 +1819,6 @@ class Information extends CI_Controller
$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);
} }
#endregion #endregion
@ -1813,41 +1843,41 @@ class Information extends CI_Controller
{ {
$data = array(); $data = array();
switch ($recommand->ir_rule) { switch ($recommand->ir_rule) {
case 'rule_same_node_keyword'://同节点关键词 case 'rule_same_node_keyword': //同节点关键词
$keywords = explode(',', $recommand->ir_keyword); $keywords = explode(',', $recommand->ir_keyword);
$data = $this->Information_model->search_by_words_2($root_information->is_path, $keywords, $exclude_ids); $data = $this->Information_model->search_by_words_2($root_information->is_path, $keywords, $exclude_ids);
break; break;
case 'rule_same_url_keyword'://同URL关键词 case 'rule_same_url_keyword': //同URL关键词
$keywords = explode(',', $recommand->ir_keyword); $keywords = explode(',', $recommand->ir_keyword);
$url = trim($information->ic_url); $url = trim($information->ic_url);
$url = substr($url, 0, strpos($url, '/', 1) + 1); $url = substr($url, 0, strpos($url, '/', 1) + 1);
$data = $this->Information_model->search_by_words($url, $keywords, $exclude_ids); $data = $this->Information_model->search_by_words($url, $keywords, $exclude_ids);
break; break;
case 'rule_same_node_random'://同节点随机 case 'rule_same_node_random': //同节点随机
$data = $this->Information_model->random(1, $root_information->is_path, $exclude_ids); $data = $this->Information_model->random(1, $root_information->is_path, $exclude_ids);
break; break;
case 'rule_this_node_random'://指定节点下随机 case 'rule_this_node_random': //指定节点下随机
$ir_pointer = $this->Information_model->Detail($recommand->ir_pointer_is_id, 'is_path'); $ir_pointer = $this->Information_model->Detail($recommand->ir_pointer_is_id, 'is_path');
if (!empty($ir_pointer)) { if (!empty($ir_pointer)) {
$data = $this->Information_model->random(1, $ir_pointer->is_path, $exclude_ids); $data = $this->Information_model->random(1, $ir_pointer->is_path, $exclude_ids);
} }
break; break;
case 'rule_range_random'://范围内随机,同读取备用节点 case 'rule_range_random': //范围内随机,同读取备用节点
break; break;
case 'rule_show_tips'://显示广告 case 'rule_show_tips': //显示广告
$data = $this->recommends_and_tips_model->tips_detail($recommand->ir_pointer_it_id); $data = $this->recommends_and_tips_model->tips_detail($recommand->ir_pointer_it_id);
return array($recommand->ir_name => $data); return array($recommand->ir_name => $data);
break; break;
case 'rule_no_show'://不显示 case 'rule_no_show': //不显示
return array($recommand->ir_name => false); return array($recommand->ir_name => false);
break; break;
default: //'rule_parent'://继承上级规则则留空,程序会循环一遍分组的规则 default: //'rule_parent'://继承上级规则则留空,程序会循环一遍分组的规则
return false;; return false;;
} }
//读取备用节点 //读取备用节点
if (empty($data) && !empty($recommand->ir_urls)) {//查不到信息并且备选urls不为空则随机选一条 if (empty($data) && !empty($recommand->ir_urls)) { //查不到信息并且备选urls不为空则随机选一条
// $url_array = explode("\n", $recommand->ir_urls); // $url_array = explode("\n", $recommand->ir_urls);
// $data = $this->Information_model->Detail(trim($url_array[rand(0, count($url_array) - 1)])); // $data = $this->Information_model->Detail(trim($url_array[rand(0, count($url_array) - 1)]));
$url_array = explode("\n", $recommand->ir_urls); $url_array = explode("\n", $recommand->ir_urls);
$data = $this->Information_model->random_range(1, $url_array, $exclude_ids); $data = $this->Information_model->random_range(1, $url_array, $exclude_ids);
} }
@ -1871,11 +1901,11 @@ class Information extends CI_Controller
{ {
$data = array(); $data = array();
$group_detail = $this->Information_model->get_detail_by_path($information->is_path, 0); //信息所属分组,根据分组进行不同推荐 $group_detail = $this->Information_model->get_detail_by_path($information->is_path, 0); //信息所属分组,根据分组进行不同推荐
$group_recommands = $this->recommends_and_tips_model->recommends_list($group_detail->is_id);//节点下所有的推荐规则 $group_recommands = $this->recommends_and_tips_model->recommends_list($group_detail->is_id); //节点下所有的推荐规则
$root_detail = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容 $root_detail = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$root_recommands = $this->recommends_and_tips_model->recommends_list($root_detail->is_id);//节点下所有的推荐规则 $root_recommands = $this->recommends_and_tips_model->recommends_list($root_detail->is_id); //节点下所有的推荐规则
$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) {
$result = $this->recommand_information_rule($information, $root_detail, $item, $exclude_ids); $result = $this->recommand_information_rule($information, $root_detail, $item, $exclude_ids);
if (!empty($result)) { if (!empty($result)) {
@ -1903,7 +1933,7 @@ class Information extends CI_Controller
$data['root_detail'] = $this->Information_model->get_detail_by_path($data['detail']->is_path, 1); //信息所属分类,获取信息顶级节点内容 $data['root_detail'] = $this->Information_model->get_detail_by_path($data['detail']->is_path, 1); //信息所属分类,获取信息顶级节点内容
switch (strtolower($data['type_detail']->is_id)) { switch (strtolower($data['type_detail']->is_id)) {
case 278008010://Inspiration case 278008010: //Inspiration
//随机获取两个同级节点内容 //随机获取两个同级节点内容
$random_array = $this->Information_model->random(2, $data['root_detail']->is_path, array($data['detail']->is_id)); $random_array = $this->Information_model->random(2, $data['root_detail']->is_path, array($data['detail']->is_id));
if (!empty($random_array[0])) { if (!empty($random_array[0])) {
@ -1952,9 +1982,9 @@ class Information extends CI_Controller
$data['info_hotel']->ic_photo = $this->set_photo_content($data['info_hotel']->ic_photo, $data['info_hotel']->ic_content); $data['info_hotel']->ic_photo = $this->set_photo_content($data['info_hotel']->ic_photo, $data['info_hotel']->ic_content);
} }
break; break;
case 278008012://'planing-1(guide)': case 278008012: //'planing-1(guide)':
case 278008013://'planning-2 (decision tips)': case 278008013: //'planning-2 (decision tips)':
case 278008011://'destination': //url的第一段表示地区根据第一段来搜索相关数据如/beijing/ 而不是根据is_parent_id因为可能信息和线路是在不同的分类下 case 278008011: //'destination': //url的第一段表示地区根据第一段来搜索相关数据如/beijing/ 而不是根据is_parent_id因为可能信息和线路是在不同的分类下
$destination_url = trim($data['detail']->ic_url); $destination_url = trim($data['detail']->ic_url);
$destination_url = substr($destination_url, 0, strpos($destination_url, '/', 1) + 1); $destination_url = substr($destination_url, 0, strpos($destination_url, '/', 1) + 1);
//how to plan //how to plan
@ -2057,7 +2087,7 @@ class Information extends CI_Controller
case 'ru': case 'ru':
case 'jp': case 'jp':
$information = $this->Information_model->Detail($url); $information = $this->Information_model->Detail($url);
if ($delete_only || !$information || $information->ic_ht_area_type === 'q') { if ($delete_only) {
//只删除操作在url修改和不发布信息的时候使用 //只删除操作在url修改和不发布信息的时候使用
$url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $url; $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $url;
} else { } else {
@ -2083,8 +2113,8 @@ class Information extends CI_Controller
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //禁止直接显示获取的内容 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //禁止直接显示获取的内容
curl_setopt($ch, CURLOPT_HEADER, 0); //不需要HEAD curl_setopt($ch, CURLOPT_HEADER, 0); //不需要HEAD
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);

Loading…
Cancel
Save