diff --git a/.gitignore b/.gitignore index 6f1c4033..72a5dd56 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .idea -.phpintel -.*.json.bak +.phpintel +/info.php +.*.json.bak .ftp-deploy-sync-state.json .svn/* */logs/log* @@ -17,4 +18,4 @@ /application/config/database.php - + diff --git a/application/controllers/information.php b/application/controllers/information.php index f69e48f2..5754cf89 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -931,9 +931,11 @@ class Information extends CI_Controller $city_name_string = $feedback_array[1][$index]; $city_name_list = explode(',', $city_name_string); $feedback_list = $this->Feedback_model->get_feedback_by_city_list($city_name_list); + // 防止触发 Google 网络垃圾政策只返回前三条 + $top3_feedback_list = array_slice($feedback_list, 0, 3); $feedback_content = $this->load->view( - $template_path . '-feedback-list', - array('feedback_list' => $feedback_list), + 'mobile_first/ch-feedback-list', + array('feedback_list' => $top3_feedback_list), true ); $information->ic_content = str_replace( @@ -993,18 +995,6 @@ class Information extends CI_Controller } } - $feedback_newest = $this->Feedback_model->get_feedback_newest(); - $feedback_newest_content = $this->load->view( - $template_path . '-feedback-newest', - array('feedback_list' => $feedback_newest), - true - ); - $information->ic_content = str_replace( - '', - $feedback_newest_content, - $information->ic_content - ); - // 天气预报模板 $weather_forecast_content = $this->load->view( $template_path . '-weather-forecast', @@ -1017,7 +1007,6 @@ class Information extends CI_Controller $information->ic_content ); - // 火车票首页搜索框 --zp $template_TrainSearch = ""; if ($information->ic_url == "/china-trains/hometest.htm" || $information->ic_url == "/china-trains/") { @@ -1050,43 +1039,41 @@ class Information extends CI_Controller $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); $meta_google_ad_article = get_meta($information->ic_id, 'meta_google_ad_article'); - //非产品页面 - if (empty ($meta_product_code)) { - $ads_by_google = !empty ($meta_google_ad_article); - //H1模板替换 - $data_H1 = array(); - $data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容 - $data_H1['author'] = ''; //获取作者信息 - $author = $this->Operator_model->get_author_nikename($information->ic_author); - if (!empty ($author)) { - $data_H1['author'] = $author->OPI_FirstName; - } else { - $author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等 - if (!empty ($author_web)) { - $data_H1['author'] = $author_web->a_name; - } - } - - // 检查图片地址格式 - $parsed_photo = $information->ic_photo; - $parsed_photo_url = parse_url($information->ic_photo); - if ( - (!isset ($parsed_photo_url['host']) || !isset ($parsed_photo_url['scheme'])) && isset ($parsed_photo_url['path']) - ) { - $parsed_photo = 'https://images.chinahighlights.com' . $parsed_photo_url['path']; + $ads_by_google = !empty($meta_google_ad_article); + //H1模板替换 + $data_H1 = array(); + $data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容 + $data_H1['author'] = ''; //获取作者信息 + $author = $this->Operator_model->get_author_nikename($information->ic_author); + if (!empty ($author)) { + $data_H1['author'] = $author->OPI_FirstName; + } else { + $author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等 + if (!empty ($author_web)) { + $data_H1['author'] = $author_web->a_name; } + } - $data_H1['ic_title'] = $information->ic_title; - $data_H1['ic_photo'] = $parsed_photo; - $data_H1['breadcrumb_data'] = $breadcrumb_data; - $data_H1['ads_by_google'] = $ads_by_google; - $data_H1['ic_datetime'] = $information->ic_datetime; - $template_H1 = $this->load->view($template_path . '-h1', $data_H1, true); - $template = str_replace('', $template_H1, $template); + // 检查图片地址格式 + $parsed_photo = $information->ic_photo; + $parsed_photo_url = parse_url($information->ic_photo); + if ( + (!isset ($parsed_photo_url['host']) || !isset ($parsed_photo_url['scheme'])) && isset ($parsed_photo_url['path']) + ) { + $parsed_photo = 'https://images.chinahighlights.com' . $parsed_photo_url['path']; + } - $addthis_widget = $this->load->view($template_path . '-add-this', false, true); - $template = str_replace('', $addthis_widget, $template); + $data_H1['ic_title'] = $information->ic_title; + $data_H1['ic_photo'] = $parsed_photo; + $data_H1['breadcrumb_data'] = $breadcrumb_data; + $data_H1['ads_by_google'] = $ads_by_google; + $data_H1['ic_datetime'] = $information->ic_datetime; + $template_H1 = $this->load->view($template_path . '-h1', $data_H1, true); + $template = str_replace('', $template_H1, $template); + + //非产品页面 + if (empty ($meta_product_code)) { $template = str_replace('?product_code=', '', $template); $article_structured_data_content = $this->load->view( @@ -1105,38 +1092,6 @@ class Information extends CI_Controller $inquiry_form_template = $this->load->view($template_path . '-inquiry-form', array('meta_product_code' => $meta_product_code), true); $template = str_replace('?product_code=', '?product_code=' . $meta_product_code, $template); $information->ic_content = str_replace('', $inquiry_form_template, $information->ic_content); - - $ads_by_google = !empty ($meta_google_ad_article); - //H1模板替换 - $data_H1 = array(); - $data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容 - $data_H1['author'] = ''; //获取作者信息 - $author = $this->Operator_model->get_author_nikename($information->ic_author); - if (!empty ($author)) { - $data_H1['author'] = $author->OPI_FirstName; - } else { - $author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等 - if (!empty ($author_web)) { - $data_H1['author'] = $author_web->a_name; - } - } - - // 检查图片地址格式 - $parsed_photo = $information->ic_photo; - $parsed_photo_url = parse_url($information->ic_photo); - if ( - (!isset ($parsed_photo_url['host']) || !isset ($parsed_photo_url['scheme'])) && isset ($parsed_photo_url['path']) - ) { - $parsed_photo = 'https://images.chinahighlights.com' . $parsed_photo_url['path']; - } - - $data_H1['ic_title'] = $information->ic_title; - $data_H1['ic_photo'] = $parsed_photo; - $data_H1['breadcrumb_data'] = $breadcrumb_data; - $data_H1['ads_by_google'] = $ads_by_google; - $data_H1['ic_datetime'] = $information->ic_datetime; - $template_H1 = $this->load->view($template_path . '-h1', $data_H1, true); - $template = str_replace('', $template_H1, $template); } // CH: 1; AH: 28; GH : 33 @@ -1341,7 +1296,6 @@ class Information extends CI_Controller $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); } - //顶部视频 $meta_news_video = get_meta($information->ic_id, 'meta_news_video'); $meta_video_picture = get_meta($information->ic_id, 'meta_video_picture'); @@ -1380,6 +1334,11 @@ class Information extends CI_Controller if (!empty ($meta_addon_js)) { $template = str_replace('', '', $template); } + + $meta_index_set = get_meta($information->ic_id, 'meta_index_set'); + if (!empty ($meta_index_set)) { + $template = str_replace('', '', $template); + } //设置内容图片缓加载 $lazy_content = $this->html_optimize_lib->set_lazy_loader($information->ic_content, 'https://data.chinahighlights.com/grey.gif'); $template = str_replace('', $lazy_content, $template); @@ -1971,17 +1930,30 @@ class Information extends CI_Controller } } - $feedback_newest = $this->Feedback_model->get_feedback_newest(); - $feedback_newest_content = $this->load->view( - $template_path . '-feedback-newest', - array('feedback_list' => $feedback_newest), - true - ); - $information->ic_content = str_replace( - '', - $feedback_newest_content, - $information->ic_content - ); + // 动态加载反馈标签,第一个城市不足八条,使用第二城市数据。 + // HTLM:
+ // 解析结果:; Siem Reap,Bangkok + $feedback_array = []; + preg_match_all('^^', $information->ic_content, $feedback_array); + if (!empty ($feedback_array)) { + foreach ($feedback_array[0] as $index => $tag_name) { + $city_name_string = $feedback_array[1][$index]; + $city_name_list = explode(',', $city_name_string); + $feedback_list = $this->Feedback_model->get_feedback_by_city_list($city_name_list); + // 防止触发 Google 网络垃圾政策只返回前三条 + $top3_feedback_list = array_slice($feedback_list, 0, 3); + $feedback_content = $this->load->view( + 'mobile_first/gh-feedback-list', + array('feedback_list' => $top3_feedback_list), + true + ); + $information->ic_content = str_replace( + $tag_name, + $feedback_content, + $information->ic_content + ); + } + } 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')); @@ -2004,6 +1976,11 @@ class Information extends CI_Controller if (!empty ($meta_addon_js)) { $template = str_replace('', '', $template); } + + $meta_index_set = get_meta($information->ic_id, 'meta_index_set'); + if (!empty ($meta_index_set)) { + $template = str_replace('', '', $template); + } //设置内容图片缓加载 $lazy_content = $this->html_optimize_lib->set_lazy_loader($information->ic_content, 'https://data.chinahighlights.com/grey.gif'); $template = str_replace('', $lazy_content, $template); @@ -2176,19 +2153,6 @@ class Information extends CI_Controller $template = str_replace('', $tips_right_list_content, $template); - // - $feedback_newest_10 = $this->Feedback_model->get_feedback_newest(10); - $feedback_newest_10_content = $this->load->view( - 'mobile_first/ah-feedback-newest-10', - array('feedback_list' => $feedback_newest_10), - true - ); - $template = str_replace( - '', - $feedback_newest_10_content, - $template - ); - //文中的信息推荐 if (strpos($information->ic_content, '') !== false) { $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-article', array('recommands' => $template_recommand), true), $information->ic_content); @@ -2297,9 +2261,11 @@ class Information extends CI_Controller $city_name_string = $feedback_array[1][$index]; $city_name_list = explode(',', $city_name_string); $feedback_list = $this->Feedback_model->get_feedback_by_city_list($city_name_list); + // 防止触发 Google 网络垃圾政策只返回前三条 + $top3_feedback_list = array_slice($feedback_list, 0, 3); $feedback_content = $this->load->view( - $template_path . '-feedback-list', - array('feedback_list' => $feedback_list), + 'mobile_first/ah-feedback-list', + array('feedback_list' => $top3_feedback_list), true ); $information->ic_content = str_replace( @@ -2359,19 +2325,6 @@ class Information extends CI_Controller } } - // - $feedback_newest = $this->Feedback_model->get_feedback_newest(); - $feedback_newest_content = $this->load->view( - 'mobile_first/ah-feedback-newest', - array('feedback_list' => $feedback_newest), - true - ); - $information->ic_content = str_replace( - '', - $feedback_newest_content, - $information->ic_content - ); - //主样式表,内联模式 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')); @@ -2391,6 +2344,11 @@ class Information extends CI_Controller if (!empty ($meta_addon_js)) { $template = str_replace('', '', $template); } + + $meta_index_set = get_meta($information->ic_id, 'meta_index_set'); + if (!empty ($meta_index_set)) { + $template = str_replace('', '', $template); + } //设置内容图片缓加载 $lazy_content = $this->html_optimize_lib->set_lazy_loader($information->ic_content, 'https://data.asiahighlights.com/grey.gif'); $template = str_replace('', $lazy_content, $template); diff --git a/application/views/mobile_first/ah-next-mobile.php b/application/views/mobile_first/ah-next-mobile.php index 351c79a5..5023f40a 100644 --- a/application/views/mobile_first/ah-next-mobile.php +++ b/application/views/mobile_first/ah-next-mobile.php @@ -49,65 +49,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -174,73 +116,6 @@ ic_title; ?> - - - - - - - -Discover real reviews of Highlights Travel Family's best-rated service across trusted platforms.
+
+
+
+ ![]() ![]() |
+ $feedback) {?>
+
+
+
+
+
+
+ |
+
+