精简CH、GH网站reviews个数

master
Jimmy Liow 1 year ago
parent 14e3d0e7cb
commit cfc08936bc

@ -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(
'<!--@NEWEST_FEEDBACK@-->',
$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('<!--@HEAD_1@-->', $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@-->', $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('<!--@HEAD_1@-->', $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@-->', $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('<!--@HEAD_1@-->', $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');
@ -1976,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(
'<!--@NEWEST_FEEDBACK@-->',
$feedback_newest_content,
$information->ic_content
);
// 动态加载反馈标签,第一个城市不足八条,使用第二城市数据。
// HTLM: <div><!--@FEEDBACK_Siem Reap,Bangkok@--></div>
// 解析结果:<!--@FEEDBACK_Siem Reap,Bangkok@-->; Siem Reap,Bangkok
$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_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'));
@ -2293,11 +2260,11 @@ class Information extends CI_Controller
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);
$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',
'mobile_first/ah-feedback-list',
array('feedback_list' => $top3_feedback_list),
true
);

@ -0,0 +1,40 @@
<p style="text-align: center;margin-top: 80px;margin-bottom: 0;clear:both;">Discover real reviews of <a href="/about-us/highlights-travel-family">Highlights Travel Family</a>'s best-rated service across trusted platforms. </p>
<div class="visible-xs" style="margin: 20px 20px 90px 20px; ">
<img class="img-responsive" height="69" src="https://data.asiahighlights.com/image/forms/ah-ta-2023-certificate.png" style="float: left; width: 150px; margin: 0 auto;
display: block;" width="175">
<img height="40" src="https://data.asiahighlights.com/image/forms/ah-ch-gh-tp-rating.png" style="width: 120px; height: auto; display: block;
float: right;" width="211">
</div>
<div class="table-responsive" style="margin-bottom: 20px;" rel="nofollow">
<table>
<tbody>
<tr>
<td class="hidden-xs">
<div class="feedback_logo">
<img class="img-responsive" height="69" src="https://data.asiahighlights.com/image/forms/ah-ta-2023-certificate.png" style="margin: 0px auto; " width="175"> <img alt="Tour Review" class="img-responsive" height="278" src="https://data.asiahighlights.com/image/forms/ah-ch-gh-tp-rating.png" style="width: 170px; display: block; margin: 10px auto 0px; " width="1133"></div>
</td>
<?php foreach ($feedback_list as $index => $feedback) {?>
<td>
<div class="tour_feedback">
<div class="feedback_content">
<strong>
<?php echo $feedback['title'] ?>
</strong>
<p class="feedback_rating"><img src="<?php if (strpos($feedback['url'], 'trustpilot.com') == true) { echo 'https://data.asiahighlights.com/pic/trustpilot-new-icon.png'; } else if (strpos($feedback['url'], 'tripadvisor.com') == true) { echo 'https://data.chinahighlights.com/image/aboutus/feedback/five-star.png'; } ?>"></p>
<p>
<?php echo $feedback['content'] ?>
</p>
<a href="<?php echo $feedback['url'] ?>" target="_blank" rel="nofollow">More</a>
<div class="customer_name">
<?php echo $feedback['customer'] ?>, <?php echo $feedback['createdOn'] ?>
</div>
</div>
</div>
</td>
<?php }?>
</tr>
</tbody>
</table>
</div>
Loading…
Cancel
Save