From 7fe372f5567a9c6063fe35af221c03e4f047f06d Mon Sep 17 00:00:00 2001
From: LMR <59361885@qq.com>
Date: Thu, 21 Aug 2025 13:41:11 +0800
Subject: [PATCH 1/5] fix new gm domain
---
application/config/config.php | 6 +-
application/controllers/welcome.php | 735 +++++++++---------
application/libraries/Amplib.php | 257 +++---
.../htmlcompressor/controllers/index_ah.php | 725 ++++++++---------
.../htmlcompressor/controllers/index_gm.php | 725 ++++++++---------
.../htmlcompressor/views/amp-template/gm.php | 6 +-
.../order/views/gm/confirm_order.php | 84 +-
.../order/views/gm/confirm_order_back.php | 66 +-
.../third_party/order/views/gm/link_tips.php | 16 +-
application/views/bootstrap/footer.php | 8 +-
application/views/bootstrap3/footer.php | 2 +-
application/views/bootstrap3/header.php | 120 +--
.../views/bootstrap3/information_edit.php | 642 +++++++--------
application/views/mobile_first/gh.php | 2 +-
author/config/config.php | 109 ++-
splunk/order/search.php | 424 +++++-----
webht/config/config.php | 92 ++-
.../pay/language/de/ipl_common_lang.php | 4 +-
wysiwyg/ckfinder/config.php | 257 +++---
19 files changed, 2137 insertions(+), 2143 deletions(-)
diff --git a/application/config/config.php b/application/config/config.php
index 2e55c145..f793a0c3 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -397,7 +397,7 @@ $config['site'] = [
'jh' => ['site_code' => 'jh', 'site_id' => 186, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => 'https://images.japanhighlights.com', 'site_url' => 'https://www.japanhighlights.com', 'site_sitemap' => '', 'site_authors' => ['X', 'sfx'], 'site_user' => [',ycc,sfx,X,']],
'htravel' => ['site_code' => 'htravel', 'site_id' => 187, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => 'https://images.highlightstravel.com', 'site_url' => 'https://www.highlightstravel.com', 'site_sitemap' => '', 'site_authors' => ['X', 'sfx'], 'site_user' => [',ycc,sfx,X,']],
'gh' => ['site_code' => 'gh', 'site_id' => 163, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => 'https://images.globalhighlights.com', 'site_url' => 'https://www.globalhighlights.com', 'site_sitemap' => '', 'site_authors' => ['X', 'sfx'], 'site_user' => [',ycc,sfx,X,']],
- 'gm' => ['site_code' => 'gm', 'site_id' => 22, 'site_lgc' => '4', 'site_url' => 'https://www.chinarundreisen.com', 'site_image_url' => '//bilder.chinarundreisen.com', 'site_authors' => ['DX', 'X', 'K', 'Lan', 'lmr', 'zyh', 'ZYHL', 'TDJ'], 'site_user' => ',ycc,lmr,B,zyh,DX,X,K,htc,zm,bhn,Lan,Tony,zyh,J,v,ZYHL,TDJ,LYY,shw,'],
+ 'gm' => ['site_code' => 'gm', 'site_id' => 22, 'site_lgc' => '4', 'site_url' => 'https://www.chinahighlightstravel.de', 'site_image_url' => '//images.chinahighlightstravel.de', 'site_authors' => ['DX', 'X', 'K', 'Lan', 'lmr', 'zyh', 'ZYHL', 'TDJ'], 'site_user' => ',ycc,lmr,B,zyh,DX,X,K,htc,zm,bhn,Lan,Tony,zyh,J,v,ZYHL,TDJ,LYY,shw,'],
'gh_gm' => ['site_code' => 'gh_gm', 'site_id' => 178, 'site_lgc' => '4', 'site_url' => 'https://www.globalhighlights.de', 'site_image_url' => '//www.globalhighlights.de', 'site_authors' => ['DX', 'X', 'K', 'Lan', 'lmr', 'zyh', 'ZYHL', 'TDJ'], 'site_user' => ',ycc,lmr,B,zyh,DX,X,K,htc,zm,bhn,Lan,Tony,zyh,J,v,ZYHL,TDJ,LYY,shw,'],
'vc' => ['site_code' => 'vc', 'site_id' => 30, 'site_lgc' => '5', 'site_url' => 'https://www.chinahighlights.fr', 'site_image_url' => '//images.chinahighlights.fr', 'site_authors' => ['JE', 'kq', 'lya', 'lyz', 'zyh'], 'site_user' => ',ycc,lmr, zyh,JE,htc,kq,lya,bhn,Tony,zyh,B,J,lyz,LYY,'],
'gh_vc' => ['site_code' => 'gh_vc', 'site_id' => 180, 'site_lgc' => '5', 'site_url' => 'https://www.globalhighlights.fr', 'site_image_url' => '//www.globalhighlights.fr', 'site_authors' => ['JE', 'kq', 'lya', 'lyz', 'zyh'], 'site_user' => ',ycc,lmr, zyh,JE,htc,kq,lya,bhn,Tony,zyh,B,J,lyz,LYY,'],
@@ -450,7 +450,7 @@ $config['cache']['gh_it']['cache_path'] = 'D:\wwwcache-intl\globalhighlights.it
//静态文件站点域名
$config['cache']['jp']['site_url'] = 'https://www.arachina.com';
-$config['cache']['gm']['site_url'] = 'https://www.chinarundreisen.com';
+$config['cache']['gm']['site_url'] = 'https://www.chinahighlightstravel.de';
$config['cache']['vc']['site_url'] = 'https://www.chinahighlights.fr';
$config['cache']['vac']['site_url'] = 'https://www.chinahighlights.es';
$config['cache']['ru']['site_url'] = 'https://www.chinahighlights.ru';
@@ -534,7 +534,7 @@ $config['access_super_manage'] = ['ycc', 'lmr', 'lyj', 'rz', 'zp'];
$config['css_source_cht'] = 'https://data.chinahighlights.com/css/min.php?f=/public/css/global.min.css,/css/festival-detail.css';
$config['css_source_ch'] = 'https://data.chinahighlights.com/css/mobile-first.css';
-$config['css_source_gm'] = 'https://data.chinarundreisen.com/public/pkg/css/baselAlRkXMnl750806T065919409Z.css';
+$config['css_source_gm'] = 'https://data.chinahighlightstravel.de/public/pkg/css/baselAlRkXMnl750806T065919409Z.css';
$config['css_source_vc'] = 'https://data.chinahighlights.fr/information-view/tools/min/?v=20150611&f=/bootstrap/css/bootstrap.min.css,/information/css/base.css,/information/css/r/Header.css,/information/css/r/PublicContent.css,/information/css/r/footergray.css,/information/js/i18n/jquery.ui.datepicker/smoothness/jquery.min.css,/information/css/tip-yellowsimple/tip-yellowsimple.css,/information/css/private-vc.css';
$config['css_source_vac'] = 'https://data.viaje-a-china.com/information-view/tools/min/?v=20150611&f=/bootstrap/css/bootstrap.min.css,/information/css/base.css,/information/css/r/Header.css,/information/css/r/PublicContent.css,/information/css/r/footergray.css,/information/js/i18n/jquery.ui.datepicker/smoothness/jquery.min.css,/information/css/tip-yellowsimple/tip-yellowsimple.css,/information/css/private-vac.css';
diff --git a/application/controllers/welcome.php b/application/controllers/welcome.php
index 7a1471c4..2883a175 100644
--- a/application/controllers/welcome.php
+++ b/application/controllers/welcome.php
@@ -1,408 +1,405 @@
permission->is_admin();
- //$this->output->enable_profiler(TRUE);
- $this->load->model('Area_model');
- $this->load->model('InfoStructures_model');
- $this->load->model('Information_model');
- $this->load->model('InfoContents_model');
- $this->load->model('Coupon_model');
- $this->load->model('Logs_model');
+ function __construct() {
+ parent::__construct();
+ $this->permission->is_admin();
+ //$this->output->enable_profiler(TRUE);
+ $this->load->model('Area_model');
+ $this->load->model('InfoStructures_model');
+ $this->load->model('Information_model');
+ $this->load->model('InfoContents_model');
+ $this->load->model('Coupon_model');
+ $this->load->model('Logs_model');
+ }
+
+ public function index() {
+ $data = [];
+ $data['countryList'] = $this->Area_model->get_country_list();
+ $data['provinceList'] = $this->Area_model->get_province_list();
+ $data['city_list'] = $this->Area_model->get_municipalities_list();
+ $data['lastEditList'] = $this->Information_model->get_last_edit_list();
+ $data['last_city_list'] = $this->Area_model->get_last_edit_city();
+
+ $data['groupList'] = $this->Information_model->group_list();
+
+ if (is_mobile_first()) {
+
+ $this->load->view('bootstrap3/header', $data);
+ $this->load->view('bootstrap3/welcome');
+ $this->load->view('bootstrap3/footer');
+ return;
}
- public function index() {
- $data=array();
- $data['countryList'] = $this->Area_model->get_country_list();
- $data['provinceList'] = $this->Area_model->get_province_list();
- $data['city_list'] = $this->Area_model->get_municipalities_list();
- $data['lastEditList'] = $this->Information_model->get_last_edit_list();
- $data['last_city_list'] = $this->Area_model->get_last_edit_city();
-
- $data['groupList']=$this->Information_model->group_list();
-
- if(is_mobile_first() ){
-
- $this->load->view('bootstrap3/header', $data);
- $this->load->view('bootstrap3/welcome');
- $this->load->view('bootstrap3/footer');
- return;
- }
-
-
-
-
- if ($this->config->item('site_code') == 'pgr') {
- $data['countryList'] = $this->Area_model->get_country_list_for_site("'589','645','632','517','31','28','609','630','9','708','709'");
- }
-
- $this->load->view('bootstrap/header', $data);
- $this->load->view('bootstrap/welcome');
- $this->load->view('bootstrap/footer');
+ if ($this->config->item('site_code') == 'pgr') {
+ $data['countryList'] = $this->Area_model->get_country_list_for_site("'589','645','632','517','31','28','609','630','9','708','709'");
}
-
-
-
-
- public function search($isrecommend = false) {
- //先搜索url,如果找到唯一就跳走,多于一条的则列出来,一条没有的就去搜索信息
- $data['keywords'] = $this->input->post('keywords');
- $data['all_text_search'] = $this->input->post('all_text_search'); //全文搜索
- $search_url = str_replace($this->config->item('site_url'), "", $data['keywords']);
- $data['search_list'] = $this->Information_model->search_url($search_url);
- if (count($data['search_list']) === 0) {
- if (!empty($data['all_text_search']) && $data['all_text_search'] == 'true') {
- $data['search_list'] = $this->Information_model->search_all_text($data['keywords'],48);
- } else {
- $data['search_list'] = $this->Information_model->search($data['keywords']);
- }
- }
-
- if ($isrecommend) {
- $data['ic_id_list'] = $this->input->post('ic_id_list') == '' ? '0' : $this->input->post('ic_id_list');
- $this->load->view('bootstrap3/recommendlist', $data);
- return TRUE;
- } else if (count($data['search_list']) === 1) {
- redirect(site_url('information/edit/' . $data['search_list'][0]->is_id));
- }
- $data['countryList'] = $this->Area_model->get_country_list();
- $data['provinceList'] = $this->Area_model->get_province_list();
- $data['city_list'] = $this->Area_model->get_municipalities_list();
-
- $this->load->view('bootstrap/header', $data);
- $this->load->view('bootstrap/welcome');
- $this->load->view('bootstrap/footer');
+ $this->load->view('bootstrap/header', $data);
+ $this->load->view('bootstrap/welcome');
+ $this->load->view('bootstrap/footer');
+ }
+
+ public function search($isrecommend = false) {
+ //先搜索url,如果找到唯一就跳走,多于一条的则列出来,一条没有的就去搜索信息
+ $data['keywords'] = $this->input->post('keywords');
+ $data['all_text_search'] = $this->input->post('all_text_search'); //全文搜索
+ $search_url = str_replace($this->config->item('site_url'), "", $data['keywords']);
+ $data['search_list'] = $this->Information_model->search_url($search_url);
+ if (count($data['search_list']) === 0) {
+ if (! empty($data['all_text_search']) && $data['all_text_search'] == 'true') {
+ $data['search_list'] = $this->Information_model->search_all_text($data['keywords'], 48);
+ } else {
+ $data['search_list'] = $this->Information_model->search($data['keywords']);
+ }
}
- //获取所有信息URL,用来批量静态化更新
- public function create_all_urls($view=false) {
- set_time_limit(0);
- $this->output->enable_profiler(false);
- $data['all_information'] = $this->Information_model->GetList('ic_status,ic_id,ic_url,ic_sitecode,is_id');
- if ($view == 'amp') {
- $this->load->view('bootstrap3/header', $data);
- $this->load->view('bootstrap3/refresh_amp_urls');
- $this->load->view('bootstrap3/footer');
- } else {
- $this->load->view('bootstrap/header', $data);
- $this->load->view('bootstrap/cache_url', $data);
- $this->load->view('bootstrap/footer');
- }
+ if ($isrecommend) {
+ $data['ic_id_list'] = $this->input->post('ic_id_list') == '' ? '0' : $this->input->post('ic_id_list');
+ $this->load->view('bootstrap3/recommendlist', $data);
+ return TRUE;
+ } else if (count($data['search_list']) === 1) {
+ redirect(site_url('information/edit/' . $data['search_list'][0]->is_id));
}
- //获取某个信息节点和子节点url
- //$is_parent_id 结构id或者是url
- public function create_infomation_urls($is_parent_id, $view = false) {
- $ic_url=$this->input->get_post('ic_url');
- if(!empty($ic_url)){
- $structure = $this->Information_model->Detail($ic_url);
- }else{
- $structure = $this->InfoStructures_model->Detail($is_parent_id);
- }
-
- if (empty($structure)) {
- show_404();
- return false;
- }
- $data['all_information'] = $this->Information_model->get_list_by_path($structure->is_path,false,false,'is_id,ic_url,ic_id,ic_status');
- $this->load->view('bootstrap3/header', $data);
- switch ($view){
- case 'amp':
- $this->load->view('bootstrap3/refresh_amp_urls');
- break;
- case 'mobile-first':
- $this->load->view('bootstrap3/refresh_mobile_first_urls');
- break;
- default:
- $this->load->view('bootstrap/cache_url', $data);
-
- }
- $this->load->view('bootstrap/footer');
+ $data['countryList'] = $this->Area_model->get_country_list();
+ $data['provinceList'] = $this->Area_model->get_province_list();
+ $data['city_list'] = $this->Area_model->get_municipalities_list();
+
+ $this->load->view('bootstrap/header', $data);
+ $this->load->view('bootstrap/welcome');
+ $this->load->view('bootstrap/footer');
+ }
+
+ //获取所有信息URL,用来批量静态化更新
+ public function create_all_urls($view = false) {
+ set_time_limit(0);
+ $this->output->enable_profiler(false);
+ $data['all_information'] = $this->Information_model->GetList('ic_status,ic_id,ic_url,ic_sitecode,is_id');
+ if ($view == 'amp') {
+ $this->load->view('bootstrap3/header', $data);
+ $this->load->view('bootstrap3/refresh_amp_urls');
+ $this->load->view('bootstrap3/footer');
+ } else {
+ $this->load->view('bootstrap/header', $data);
+ $this->load->view('bootstrap/cache_url', $data);
+ $this->load->view('bootstrap/footer');
}
-
- //根据信息节点ID获取信息,用于搜索结果的批量更新静态页面
- public function create_infomation_urls_by_ids($view = false){
- $is_ids=$this->input->get('key');
- if (empty($is_ids)) {
- show_404();
- return false;
- }
- $data['all_information'] = $this->Information_model->get_detail_by_ids($is_ids);
- if ($view == 'amp') {
- $this->load->view('bootstrap3/header', $data);
- $this->load->view('bootstrap3/refresh_amp_urls');
- $this->load->view('bootstrap3/footer');
- } else {
- $this->load->view('bootstrap/header', $data);
- $this->load->view('bootstrap/cache_url', $data);
- $this->load->view('bootstrap/footer');
- }
- }
-
- public function get_infomation_urls($is_parent_id) {
- $this->output->enable_profiler(FALSE);
- $structure = $this->InfoStructures_model->Detail($is_parent_id);
- if (empty($structure)) {
- show_404();
- return false;
- }
- $data['all_information'] = $this->Information_model->get_list_by_path($structure->is_path);
-
- $this->load->view('bootstrap/header', $data);
- $this->load->view('bootstrap/static_url', $data);
- $this->load->view('bootstrap/footer');
+ }
+
+ //获取某个信息节点和子节点url
+ //$is_parent_id 结构id或者是url
+ public function create_infomation_urls($is_parent_id, $view = false) {
+ $ic_url = $this->input->get_post('ic_url');
+ if (! empty($ic_url)) {
+ $structure = $this->Information_model->Detail($ic_url);
+ } else {
+ $structure = $this->InfoStructures_model->Detail($is_parent_id);
}
- public function get_info_backup_id($info_id) {
- $last_backup = $this->Logs_model->get_last_backup($info_id);
- if (empty($last_backup)) {
- $this->echo_json(array(
- 'status' => 'error',
- 'logId' => 0,
- 'datetime' => 0,
- 'username' => 0
- ));
- } else {
- $this->echo_json(array(
- 'status' => 'success',
- 'logId' => $last_backup->log_id,
- 'datetime' => $last_backup->log_datetime,
- 'username' => $last_backup->log_ht_username
- ));
- }
+ if (empty($structure)) {
+ show_404();
+ return false;
}
-
- public function change_static_url($info_id) {
- $information = $this->Information_model->Detail($info_id);
- $htm_doc = new DOMDocument();
- $htm_doc->encoding = 'UTF-8';
- libxml_use_internal_errors(true);
- $htm_doc->strictErrorChecking = false;
- if (empty($information->ic_content)) {
- $this->echo_json(array(
- 'status' => 'error',
- 'infoId' => $info_id,
- 'message' => 'info content is empty'
- ));
- return;
- }
- $htm_doc->loadHTML(
- mb_convert_encoding($information->ic_content, 'HTML-ENTITIES', 'UTF-8'));
- $htm_doc->normalizeDocument();
- $img_list = $htm_doc->getElementsByTagName('img');
- foreach ($img_list as $img) {
- $img_src = $img->getAttribute('src');
- $img_src = $this->check_url($img_src);
- $img->setAttribute('src', $img_src);
- }
-
- $anchor_list = $htm_doc->getElementsByTagName('a');
- foreach ($anchor_list as $anchor) {
- $a_href = $anchor->getAttribute('href');
- echo 'a.href: ' . $a_href . ' ';
-
- $match_result = array();
- preg_match('/^http:\/\/www.chinahighlights.com(.*)/', $a_href, $match_result);
- $result_count = count($match_result);
- if ($result_count == 2) {
- $result = '//www.chinahighlights.com' . $match_result[1];
- $anchor->setAttribute('href', $result);
- echo $result . ' ';
- }
- }
+ $data['all_information'] = $this->Information_model->get_list_by_path($structure->is_path, false, false, 'is_id,ic_url,ic_id,ic_status');
+ $this->load->view('bootstrap3/header', $data);
+ switch ($view) {
+ case 'amp':
+ $this->load->view('bootstrap3/refresh_amp_urls');
+ break;
+ case 'mobile-first':
+ $this->load->view('bootstrap3/refresh_mobile_first_urls');
+ break;
+ default:
+ $this->load->view('bootstrap/cache_url', $data);
}
-
- public function count_redirect_nofollow() {
- $include_redirece_info = $this->Information_model->search_all_text('&t=78002', 2000);
- echo 'redirect count: ' . count($include_redirece_info) . ' ';
- $redirect_nofollow_list = array();
- $htm_doc = new DOMDocument();
- $htm_doc->encoding = 'UTF-8';
- libxml_use_internal_errors(true);
- $htm_doc->strictErrorChecking = false;
- foreach ($include_redirece_info as $info) {
- $htm_doc->loadHTML(
- mb_convert_encoding($info->ic_content, 'HTML-ENTITIES', 'UTF-8'));
- $htm_doc->normalizeDocument();
- $anchor_list = $htm_doc->getElementsByTagName('a');
- foreach ($anchor_list as $anchor) {
- $a_href = $anchor->getAttribute('href');
- $a_rel = $anchor->getAttribute('rel');
-
- $match_result = array();
- preg_match('/.*&t=78002$/', $a_href, $match_result);
- $result_count = count($match_result);
- if ($result_count > 0 && $a_rel != 'nofollow') {
- echo $info->ic_url . ' | ' . '(' . $info->ic_id . ',' . $info->is_id . ')' . ' ';
- echo 'a.href: ' . $a_href . '; rel: ' . $a_rel . ' ';
- $redirect_nofollow_list[] = $info;
- }
- }
- }
- echo 'nofollow_count: ' . count($redirect_nofollow_list) . ' ';
- return $redirect_nofollow_list;
+ $this->load->view('bootstrap/footer');
+ }
+
+ //根据信息节点ID获取信息,用于搜索结果的批量更新静态页面
+ public function create_infomation_urls_by_ids($view = false) {
+ $is_ids = $this->input->get('key');
+ if (empty($is_ids)) {
+ show_404();
+ return false;
}
-
- public function transform_redirect_nofollow() {
- $redirect_nofollow_list = $this->count_redirect_nofollow();
- $htm_doc = new DOMDocument();
- $htm_doc->encoding = 'UTF-8';
- libxml_use_internal_errors(true);
- $htm_doc->strictErrorChecking = false;
-
- foreach ($redirect_nofollow_list as $info) {
- $htm_doc->loadHTML(
- mb_convert_encoding($info->ic_content, 'HTML-ENTITIES', 'UTF-8'));
- $htm_doc->normalizeDocument();
- $anchor_list = $htm_doc->getElementsByTagName('a');
- foreach ($anchor_list as $anchor) {
- $a_rel = $anchor->getAttribute('rel');
- $anchor->setAttribute('rel', 'nofollow');
- $this->Logs_model->backup($info->is_id, $info->ic_content);
- $info->ic_content = $htm_doc->saveHTML();
- $this->InfoContents_model->Update(
- $info->ic_id, $info->ic_url, $info->ic_url_title, $info->ic_type, $info->ic_title, $info->ic_content, $info->ic_summary, $info->ic_seo_title, $info->ic_seo_description, $info->ic_seo_keywords, $info->ic_show_bread_crumbs, $info->ic_status, $info->ic_template, $info->ic_photo, $info->ic_photo_width, $info->ic_photo_height, $info->ic_recommend_tours, $info->ic_recommend_packages, $info->ic_ht_area_id, $info->ic_ht_area_type, $info->ic_ht_product_id, $info->ic_ht_product_type, $info->ic_author);
- }
- }
-
- echo 'update_nofollow_count: ' . count($redirect_nofollow_list) . ' ';
+ $data['all_information'] = $this->Information_model->get_detail_by_ids($is_ids);
+ if ($view == 'amp') {
+ $this->load->view('bootstrap3/header', $data);
+ $this->load->view('bootstrap3/refresh_amp_urls');
+ $this->load->view('bootstrap3/footer');
+ } else {
+ $this->load->view('bootstrap/header', $data);
+ $this->load->view('bootstrap/cache_url', $data);
+ $this->load->view('bootstrap/footer');
}
-
- public function count_http_of_href() {
- $data['all_information'] = $this->Information_model->search_all_text('http://www.chinahighlights.com/', 2000);
- echo 'count: ' . count($data['all_information']) . ' ';
- var_dump($data['all_information']);
+ }
+
+ public function get_infomation_urls($is_parent_id) {
+ $this->output->enable_profiler(FALSE);
+ $structure = $this->InfoStructures_model->Detail($is_parent_id);
+ if (empty($structure)) {
+ show_404();
+ return false;
}
-
- public function transform_href_to_https() {
- $http_host = 'http://www.chinahighlights.com/';
- $https_host = 'https://www.chinahighlights.com/';
- $data['all_information'] = $this->Information_model->search_all_text($http_host, 200);
- echo 'count: ' . count($data['all_information']) . ' ';
- if (empty($data['all_information'])) {
- echo 'nothing transform to https';
- } else {
- foreach ($data['all_information'] as $item) {
-
- if (empty($item->ic_url)) {
- echo '[' . $item->ic_title . '] [' . $item->ic_url . '] ';
- continue;
- } else {
- echo $item->ic_url . ' | ' . $item->ic_title . ' ';
- }
-
- $this->Logs_model->backup($item->is_id, $item->ic_content);
- $item->ic_content = str_replace($http_host, $https_host, $item->ic_content);
- $this->InfoContents_model->Update(
- $item->ic_id, $item->ic_url, $item->ic_url_title, $item->ic_type, $item->ic_title, $item->ic_content, $item->ic_summary, $item->ic_seo_title, $item->ic_seo_description, $item->ic_seo_keywords, $item->ic_show_bread_crumbs, $item->ic_status, $item->ic_template, $item->ic_photo, $item->ic_photo_width, $item->ic_photo_height, $item->ic_recommend_tours, $item->ic_recommend_packages, $item->ic_ht_area_id, $item->ic_ht_area_type, $item->ic_ht_product_id, $item->ic_ht_product_type, $item->ic_author
- );
- }
- }
+ $data['all_information'] = $this->Information_model->get_list_by_path($structure->is_path);
+
+ $this->load->view('bootstrap/header', $data);
+ $this->load->view('bootstrap/static_url', $data);
+ $this->load->view('bootstrap/footer');
+ }
+
+ public function get_info_backup_id($info_id) {
+ $last_backup = $this->Logs_model->get_last_backup($info_id);
+ if (empty($last_backup)) {
+ $this->echo_json([
+ 'status' => 'error',
+ 'logId' => 0,
+ 'datetime' => 0,
+ 'username' => 0,
+ ]);
+ } else {
+ $this->echo_json([
+ 'status' => 'success',
+ 'logId' => $last_backup->log_id,
+ 'datetime' => $last_backup->log_datetime,
+ 'username' => $last_backup->log_ht_username,
+ ]);
}
-
- private function echo_json($obj) {
- $this->output
- ->set_content_type('application/json')
- ->set_output(json_encode($obj));
+ }
+
+ public function change_static_url($info_id) {
+ $information = $this->Information_model->Detail($info_id);
+ $htm_doc = new DOMDocument();
+ $htm_doc->encoding = 'UTF-8';
+ libxml_use_internal_errors(true);
+ $htm_doc->strictErrorChecking = false;
+ if (empty($information->ic_content)) {
+ $this->echo_json([
+ 'status' => 'error',
+ 'infoId' => $info_id,
+ 'message' => 'info content is empty',
+ ]);
+ return;
}
-
- //批量替换二级域名,如图片或者data域名
- function replace_hostname($topnum) {
- $data = array();
- $find_host = 'http://data.chinarundreisen.com/'; //http://bilder.chinarundreisen.com/
- $new_host = '//data.chinarundreisen.com/';
- $data['all_information'] = $this->Information_model->search_all_text($find_host, $topnum);
- if ($data['all_information']) {
- foreach ($data['all_information'] as $item) {
- echo $item->ic_url . ' ';
- $item->ic_content = str_replace($find_host, $new_host, $item->ic_content);
- $this->InfoContents_model->Update(
- $item->ic_id, $item->ic_url, $item->ic_url_title, $item->ic_type, $item->ic_title, $item->ic_content, $item->ic_summary, $item->ic_seo_title, $item->ic_seo_description, $item->ic_seo_keywords, $item->ic_show_bread_crumbs, $item->ic_status, $item->ic_template, $item->ic_photo, $item->ic_photo_width, $item->ic_photo_height, $item->ic_recommend_tours, $item->ic_recommend_packages, $item->ic_ht_area_id, $item->ic_ht_area_type, $item->ic_ht_product_id, $item->ic_ht_product_type, $item->ic_author
- );
- }
- } else {
- echo 'all done';
- }
+ $htm_doc->loadHTML(
+ mb_convert_encoding($information->ic_content, 'HTML-ENTITIES', 'UTF-8'));
+ $htm_doc->normalizeDocument();
+ $img_list = $htm_doc->getElementsByTagName('img');
+ foreach ($img_list as $img) {
+ $img_src = $img->getAttribute('src');
+ $img_src = $this->check_url($img_src);
+ $img->setAttribute('src', $img_src);
}
- private function check_url($subject) {
- $result = $subject;
- $check_rules = array(
- '/^\/image\/(.*)/' => '//data.chinahighlights.com/image/',
- '/^\/pic\/(.*)/' => '//data.chinahighlights.com/pic/',
- '/^\/allpicture\/(.*)/' => '//data.chinahighlights.com/allpicture/',
- '/^http:\/\/images.chinahighlights.com(.*)/' => '//images.chinahighlights.com',
- '/^http:\/\/data.chinahighlights.com(.*)/' => '//data.chinahighlights.com',
- '/^http:\/\/www.chinahighlights.com(.*)/' => '//www.chinahighlights.com');
-
- foreach ($check_rules as $pattern => $replace) {
- $result = $this->replace_url($pattern, $replace, $result);
- }
- return $result;
+ $anchor_list = $htm_doc->getElementsByTagName('a');
+ foreach ($anchor_list as $anchor) {
+ $a_href = $anchor->getAttribute('href');
+ echo 'a.href: ' . $a_href . ' ';
+
+ $match_result = [];
+ preg_match('/^http:\/\/www.chinahighlights.com(.*)/', $a_href, $match_result);
+ $result_count = count($match_result);
+ if ($result_count == 2) {
+ $result = '//www.chinahighlights.com' . $match_result[1];
+ $anchor->setAttribute('href', $result);
+ echo $result . ' ';
+ }
}
- private function replace_url($pattern, $replace, $subject) {
- $result = $subject;
- $match_result = array();
- preg_match($pattern, $subject, $match_result);
+ }
+
+ public function count_redirect_nofollow() {
+ $include_redirece_info = $this->Information_model->search_all_text('&t=78002', 2000);
+ echo 'redirect count: ' . count($include_redirece_info) . ' ';
+ $redirect_nofollow_list = [];
+ $htm_doc = new DOMDocument();
+ $htm_doc->encoding = 'UTF-8';
+ libxml_use_internal_errors(true);
+ $htm_doc->strictErrorChecking = false;
+ foreach ($include_redirece_info as $info) {
+ $htm_doc->loadHTML(
+ mb_convert_encoding($info->ic_content, 'HTML-ENTITIES', 'UTF-8'));
+ $htm_doc->normalizeDocument();
+ $anchor_list = $htm_doc->getElementsByTagName('a');
+ foreach ($anchor_list as $anchor) {
+ $a_href = $anchor->getAttribute('href');
+ $a_rel = $anchor->getAttribute('rel');
+
+ $match_result = [];
+ preg_match('/.*&t=78002$/', $a_href, $match_result);
$result_count = count($match_result);
- if ($result_count == 2) {
- $result = $replace . $match_result[1];
+ if ($result_count > 0 && $a_rel != 'nofollow') {
+ echo $info->ic_url . ' | ' . '(' . $info->ic_id . ',' . $info->is_id . ')' . ' ';
+ echo 'a.href: ' . $a_href . '; rel: ' . $a_rel . ' ';
+ $redirect_nofollow_list[] = $info;
}
- return $result;
+ }
+ }
+ echo 'nofollow_count: ' . count($redirect_nofollow_list) . ' ';
+ return $redirect_nofollow_list;
+ }
+
+ public function transform_redirect_nofollow() {
+ $redirect_nofollow_list = $this->count_redirect_nofollow();
+ $htm_doc = new DOMDocument();
+ $htm_doc->encoding = 'UTF-8';
+ libxml_use_internal_errors(true);
+ $htm_doc->strictErrorChecking = false;
+
+ foreach ($redirect_nofollow_list as $info) {
+ $htm_doc->loadHTML(
+ mb_convert_encoding($info->ic_content, 'HTML-ENTITIES', 'UTF-8'));
+ $htm_doc->normalizeDocument();
+ $anchor_list = $htm_doc->getElementsByTagName('a');
+ foreach ($anchor_list as $anchor) {
+ $a_rel = $anchor->getAttribute('rel');
+ $anchor->setAttribute('rel', 'nofollow');
+ $this->Logs_model->backup($info->is_id, $info->ic_content);
+ $info->ic_content = $htm_doc->saveHTML();
+ $this->InfoContents_model->Update(
+ $info->ic_id, $info->ic_url, $info->ic_url_title, $info->ic_type, $info->ic_title, $info->ic_content, $info->ic_summary, $info->ic_seo_title, $info->ic_seo_description, $info->ic_seo_keywords, $info->ic_show_bread_crumbs, $info->ic_status, $info->ic_template, $info->ic_photo, $info->ic_photo_width, $info->ic_photo_height, $info->ic_recommend_tours, $info->ic_recommend_packages, $info->ic_ht_area_id, $info->ic_ht_area_type, $info->ic_ht_product_id, $info->ic_ht_product_type, $info->ic_author);
+ }
}
- //生肖促销订单查询
- public function coupon() {
- $data['countryList'] = $this->Area_model->get_country_list();
- $data['provinceList'] = $this->Area_model->get_province_list();
- $data['city_list'] = $this->Area_model->get_municipalities_list();
- $data['coupon'] = $this->Coupon_model->getlist();
+ echo 'update_nofollow_count: ' . count($redirect_nofollow_list) . ' ';
+ }
+
+ public function count_http_of_href() {
+ $data['all_information'] = $this->Information_model->search_all_text('http://www.chinahighlights.com/', 2000);
+ echo 'count: ' . count($data['all_information']) . ' ';
+ var_dump($data['all_information']);
+ }
+
+ public function transform_href_to_https() {
+ $http_host = 'http://www.chinahighlights.com/';
+ $https_host = 'https://www.chinahighlights.com/';
+ $data['all_information'] = $this->Information_model->search_all_text($http_host, 200);
+ echo 'count: ' . count($data['all_information']) . ' ';
+ if (empty($data['all_information'])) {
+ echo 'nothing transform to https';
+ } else {
+ foreach ($data['all_information'] as $item) {
+
+ if (empty($item->ic_url)) {
+ echo '[' . $item->ic_title . '] [' . $item->ic_url . '] ';
+ continue;
+ } else {
+ echo $item->ic_url . ' | ' . $item->ic_title . ' ';
+ }
- $this->load->view('bootstrap/header', $data);
- $this->load->view('bootstrap/welcome');
- $this->load->view('bootstrap/footer');
+ $this->Logs_model->backup($item->is_id, $item->ic_content);
+ $item->ic_content = str_replace($http_host, $https_host, $item->ic_content);
+ $this->InfoContents_model->Update(
+ $item->ic_id, $item->ic_url, $item->ic_url_title, $item->ic_type, $item->ic_title, $item->ic_content, $item->ic_summary, $item->ic_seo_title, $item->ic_seo_description, $item->ic_seo_keywords, $item->ic_show_bread_crumbs, $item->ic_status, $item->ic_template, $item->ic_photo, $item->ic_photo_width, $item->ic_photo_height, $item->ic_recommend_tours, $item->ic_recommend_packages, $item->ic_ht_area_id, $item->ic_ht_area_type, $item->ic_ht_product_id, $item->ic_ht_product_type, $item->ic_author
+ );
+ }
}
-
- public function set_path($is_id, $parent_path = '') {
- $parent_path = str_replace('-', ',', $parent_path);
- $parent_path = trim($parent_path, ',');
- if ($parent_path != '')
- $parent_path .= ',';
- $this->load->model('Import_model');
- $this->Import_model->set_path($is_id, $parent_path);
- echo 'ok';
+ }
+
+ private function echo_json($obj) {
+ $this->output
+ ->set_content_type('application/json')
+ ->set_output(json_encode($obj));
+ }
+
+ //批量替换二级域名,如图片或者data域名
+ function replace_hostname($topnum) {
+ $data = [];
+ $find_host = 'http://data.chinahighlightstravel.de/'; //http://images.chinahighlightstravel.de/
+ $new_host = '//data.chinahighlightstravel.de/';
+ $data['all_information'] = $this->Information_model->search_all_text($find_host, $topnum);
+ if ($data['all_information']) {
+ foreach ($data['all_information'] as $item) {
+ echo $item->ic_url . ' ';
+ $item->ic_content = str_replace($find_host, $new_host, $item->ic_content);
+ $this->InfoContents_model->Update(
+ $item->ic_id, $item->ic_url, $item->ic_url_title, $item->ic_type, $item->ic_title, $item->ic_content, $item->ic_summary, $item->ic_seo_title, $item->ic_seo_description, $item->ic_seo_keywords, $item->ic_show_bread_crumbs, $item->ic_status, $item->ic_template, $item->ic_photo, $item->ic_photo_width, $item->ic_photo_height, $item->ic_recommend_tours, $item->ic_recommend_packages, $item->ic_ht_area_id, $item->ic_ht_area_type, $item->ic_ht_product_id, $item->ic_ht_product_type, $item->ic_author
+ );
+ }
+ } else {
+ echo 'all done';
}
-
- public function search_by_icid() {
- $ic_id_list = $this->input->post('ic_id_list');
- $ic_id_list = rtrim(trim($ic_id_list), ',') . ',';
- $this->load->model('InfoContents_model');
- $data['search_list'] = $this->InfoContents_model->get_ic_contents_by_list($ic_id_list);
- $data['search_type'] = 'recommended';
- $this->load->view('bootstrap3/recommendlist', $data);
+ }
+
+ private function check_url($subject) {
+ $result = $subject;
+ $check_rules = [
+ '/^\/image\/(.*)/' => '//data.chinahighlights.com/image/',
+ '/^\/pic\/(.*)/' => '//data.chinahighlights.com/pic/',
+ '/^\/allpicture\/(.*)/' => '//data.chinahighlights.com/allpicture/',
+ '/^http:\/\/images.chinahighlights.com(.*)/' => '//images.chinahighlights.com',
+ '/^http:\/\/data.chinahighlights.com(.*)/' => '//data.chinahighlights.com',
+ '/^http:\/\/www.chinahighlights.com(.*)/' => '//www.chinahighlights.com'];
+
+ foreach ($check_rules as $pattern => $replace) {
+ $result = $this->replace_url($pattern, $replace, $result);
}
-
- /**
- * @description: 用于生成一个特殊的根结点is_level和is_sort都为0,CT移动优先项目用
- * @param {type}
- * @return:
- * @Date Changed:
- */
- public function AddRootNote(){
- $this->InfoContents_model->Add('', 'NewRootNote', 'root', 'NewRootNote', '', '', '', '', '', 0, 0, '', '', 0, 0, '', '', '', '', 0,
- '','');
- $this->InfoStructures_model->AddRootNote($this->InfoContents_model->insert_id);
- $is_id = $this->InfoStructures_model->insert_id;
- redirect(site_url('information/edit/' . $is_id));
+ return $result;
+ }
+
+ private function replace_url($pattern, $replace, $subject) {
+ $result = $subject;
+ $match_result = [];
+ preg_match($pattern, $subject, $match_result);
+ $result_count = count($match_result);
+ if ($result_count == 2) {
+ $result = $replace . $match_result[1];
}
+ return $result;
+ }
+
+ //生肖促销订单查询
+ public function coupon() {
+ $data['countryList'] = $this->Area_model->get_country_list();
+ $data['provinceList'] = $this->Area_model->get_province_list();
+ $data['city_list'] = $this->Area_model->get_municipalities_list();
+ $data['coupon'] = $this->Coupon_model->getlist();
+
+ $this->load->view('bootstrap/header', $data);
+ $this->load->view('bootstrap/welcome');
+ $this->load->view('bootstrap/footer');
+ }
+
+ public function set_path($is_id, $parent_path = '') {
+ $parent_path = str_replace('-', ',', $parent_path);
+ $parent_path = trim($parent_path, ',');
+ if ($parent_path != '') {
+ $parent_path .= ',';
+ }
+
+ $this->load->model('Import_model');
+ $this->Import_model->set_path($is_id, $parent_path);
+ echo 'ok';
+ }
+
+ public function search_by_icid() {
+ $ic_id_list = $this->input->post('ic_id_list');
+ $ic_id_list = rtrim(trim($ic_id_list), ',') . ',';
+ $this->load->model('InfoContents_model');
+ $data['search_list'] = $this->InfoContents_model->get_ic_contents_by_list($ic_id_list);
+ $data['search_type'] = 'recommended';
+ $this->load->view('bootstrap3/recommendlist', $data);
+ }
+
+ /**
+ * @description: 用于生成一个特殊的根结点is_level和is_sort都为0,CT移动优先项目用
+ * @param {type}
+ * @return:
+ * @Date Changed:
+ */
+ public function AddRootNote() {
+ $this->InfoContents_model->Add('', 'NewRootNote', 'root', 'NewRootNote', '', '', '', '', '', 0, 0, '', '', 0, 0, '', '', '', '', 0,
+ '', '');
+ $this->InfoStructures_model->AddRootNote($this->InfoContents_model->insert_id);
+ $is_id = $this->InfoStructures_model->insert_id;
+ redirect(site_url('information/edit/' . $is_id));
+ }
}
diff --git a/application/libraries/Amplib.php b/application/libraries/Amplib.php
index 026435ab..73866d9a 100644
--- a/application/libraries/Amplib.php
+++ b/application/libraries/Amplib.php
@@ -1,152 +1,149 @@
CI = &get_instance();
- $this->CI->load->model('Information_model');
- $this->CI->load->model('InfoMetas_model');
- $this->CI->load->model('Logs_model');
- }
+ var $CI;
- public function edit($ic_id)
- {
- $data = array();
- $data['information'] = $this->CI->Information_model->detail_by_ic_id($ic_id);
- if ($data['information'] == FALSE) {
- show_404();
- }
- //查询上一次保存记录
- $amp_log = $this->CI->Logs_model->get_last_edit_amp($ic_id);
- if (!empty($amp_log)) {
- $data['last_edit_amp_id'] = $amp_log->log_id;
- } else {
- $data['last_edit_amp_id'] = '';
- }
+ public function __construct() {
+ $this->CI = &get_instance();
+ $this->CI->load->model('Information_model');
+ $this->CI->load->model('InfoMetas_model');
+ $this->CI->load->model('Logs_model');
+ }
- $this->CI->load->view('bootstrap3/header', $data);
- $this->CI->load->view('amp_editor');
- $this->CI->load->view('bootstrap3/footer');
+ public function edit($ic_id) {
+ $data = [];
+ $data['information'] = $this->CI->Information_model->detail_by_ic_id($ic_id);
+ if ($data['information'] == FALSE) {
+ show_404();
+ }
+ //查询上一次保存记录
+ $amp_log = $this->CI->Logs_model->get_last_edit_amp($ic_id);
+ if (! empty($amp_log)) {
+ $data['last_edit_amp_id'] = $amp_log->log_id;
+ } else {
+ $data['last_edit_amp_id'] = '';
}
- public function auto_create($ic_id)
- {
- $data = array();
- if (strtolower($this->CI->config->item('site_code')) == 'cht') {
- $this->CI->Information_model->ic_type = "AND ic.ic_type != 'none'";
- }
- $data['information'] = $this->CI->Information_model->detail_by_ic_id($ic_id);
- if ($data['information'] == FALSE) {
- return json_encode(array('result' => 'no', 'data' => '找不到这个页面'));
- }
+ $this->CI->load->view('bootstrap3/header', $data);
+ $this->CI->load->view('amp_editor');
+ $this->CI->load->view('bootstrap3/footer');
+ }
- //144.76.185.44:8029
- //根据站点不同,配置不同参数
- $site_code = strtolower($this->CI->config->item('site_code'));
- switch ($site_code) {
- case 'ah':
- //websitehost是表示资源下载的域名,在网页代码中有/css/xxx.css之类的路径,程序需要添加域名组成完整URL去下载文件,一般是data域名或者www域名
- $websitehost = 'https://data.asiahighlights.com';
- $html_source_url = 'https://www.asiahighlights.com/index.php/information/detail/?no_cache=true&static_html_url=' . $data['information']->ic_url;
- break;
- case 'cht':
- $websitehost = 'https://data.chinahighlights.com';
- $html_source_url = 'http://169.54.172.35:3588' . $data['information']->ic_url;
- break;
- case 'gm':
- $websitehost = 'https://data.chinarundreisen.com';
- $html_source_url = 'https://www.chinarundreisen.com/' . $data['information']->ic_url;
- break;
- case 'ct':
- $websitehost = 'https://data.chinatravel.com';
- $html_source_url = 'http://158.85.210.78:2222' . $data['information']->ic_url;
- break;
- default:
- $websitehost = $this->CI->config->item('site_url');
- $html_source_url = $this->CI->config->item('site_url') . $data['information']->ic_url;
- }
- //获取网页当前源码,然后发送到信息平台
- $html_source = GET_HTTP($html_source_url);
- if (!empty($html_source)) {
- $post_data = array('websitehost' => $websitehost, 'template_name' => $site_code, 'create_amp' => 'true', 'htmlsource' => $html_source);
- //德语站点走另外一个控制器,其他站点还是走原来的流程
- if ($site_code == 'gm') {
- if ($data['information']->ic_url == '/massgeschneiderte-china-reisen/') {
- return json_encode(array());
- } else {
- return GET_HTTP(site_url('/apps/htmlcompressor/index_gm/choose_way'), $post_data, 'POST');
- }
- } elseif ($site_code == 'ah') {
- return GET_HTTP(site_url('/apps/htmlcompressor/index_ah/choose_way'), $post_data, 'POST');
- } else {
- return GET_HTTP(site_url('/apps/htmlcompressor/index/optimize'), $post_data, 'POST');
- }
- }
- return json_encode(array('result' => 'no', 'data' => '不知道哪里错了,看代码'));
+ public function auto_create($ic_id) {
+ $data = [];
+ if (strtolower($this->CI->config->item('site_code')) == 'cht') {
+ $this->CI->Information_model->ic_type = "AND ic.ic_type != 'none'";
+ }
+ $data['information'] = $this->CI->Information_model->detail_by_ic_id($ic_id);
+ if ($data['information'] == FALSE) {
+ return json_encode(['result' => 'no', 'data' => '找不到这个页面']);
}
- public function edit_save($ic_id = false, $textarea_htmlcode = false, $amp_status = false)
- {
- $data = array();
- if ($ic_id === false) {
- $ic_id = $this->CI->input->post('ic_id');
- }
- if ($textarea_htmlcode === false) {
- $textarea_htmlcode = $this->CI->input->post('textarea_htmlcode');
- }
- if ($amp_status === false) {
- $amp_status = $this->CI->input->post('amp_status');
+ //144.76.185.44:8029
+ //根据站点不同,配置不同参数
+ $site_code = strtolower($this->CI->config->item('site_code'));
+ switch ($site_code) {
+ case 'ah':
+ //websitehost是表示资源下载的域名,在网页代码中有/css/xxx.css之类的路径,程序需要添加域名组成完整URL去下载文件,一般是data域名或者www域名
+ $websitehost = 'https://data.asiahighlights.com';
+ $html_source_url = 'https://www.asiahighlights.com/index.php/information/detail/?no_cache=true&static_html_url=' . $data['information']->ic_url;
+ break;
+ case 'cht':
+ $websitehost = 'https://data.chinahighlights.com';
+ $html_source_url = 'http://169.54.172.35:3588' . $data['information']->ic_url;
+ break;
+ case 'gm':
+ $websitehost = 'https://data.chinahighlightstravel.de';
+ $html_source_url = 'https://www.chinarundreisen.com/' . $data['information']->ic_url;
+ break;
+ case 'ct':
+ $websitehost = 'https://data.chinatravel.com';
+ $html_source_url = 'http://158.85.210.78:2222' . $data['information']->ic_url;
+ break;
+ default:
+ $websitehost = $this->CI->config->item('site_url');
+ $html_source_url = $this->CI->config->item('site_url') . $data['information']->ic_url;
+ }
+ //获取网页当前源码,然后发送到信息平台
+ $html_source = GET_HTTP($html_source_url);
+ if (! empty($html_source)) {
+ $post_data = ['websitehost' => $websitehost, 'template_name' => $site_code, 'create_amp' => 'true', 'htmlsource' => $html_source];
+ //德语站点走另外一个控制器,其他站点还是走原来的流程
+ if ($site_code == 'gm') {
+ if ($data['information']->ic_url == '/massgeschneiderte-china-reisen/') {
+ return json_encode([]);
+ } else {
+ return GET_HTTP(site_url('/apps/htmlcompressor/index_gm/choose_way'), $post_data, 'POST');
}
- $data['information'] = $this->CI->Information_model->detail_by_ic_id($ic_id);
+ } elseif ($site_code == 'ah') {
+ return GET_HTTP(site_url('/apps/htmlcompressor/index_ah/choose_way'), $post_data, 'POST');
+ } else {
+ return GET_HTTP(site_url('/apps/htmlcompressor/index/optimize'), $post_data, 'POST');
+ }
+ }
+ return json_encode(['result' => 'no', 'data' => '不知道哪里错了,看代码']);
+ }
- if ($data['information'] == FALSE) {
- show_404();
- }
+ public function edit_save($ic_id = false, $textarea_htmlcode = false, $amp_status = false) {
+ $data = [];
+ if ($ic_id === false) {
+ $ic_id = $this->CI->input->post('ic_id');
+ }
+ if ($textarea_htmlcode === false) {
+ $textarea_htmlcode = $this->CI->input->post('textarea_htmlcode');
+ }
+ if ($amp_status === false) {
+ $amp_status = $this->CI->input->post('amp_status');
+ }
+ $data['information'] = $this->CI->Information_model->detail_by_ic_id($ic_id);
- //CH的页面没有canonical内容,在这里帮补上
- $textarea_htmlcode = str_replace('', $this->CI->config->item('site_url') . $data['information']->ic_url, $textarea_htmlcode);
-
- //备份修改的代码
- $this->CI->Logs_model->write('backup_amp', $ic_id, $textarea_htmlcode);
-
- //AMP格式验证
- if ($amp_status !== '0') {//只有发布的时候才需要验证
- //把AMP网页内容到purifycss处理,内置了AMP-Validator
- $purifycss_server = 'http://169.54.167.189:33033/';
- if ($this->CI->config->item('site_code' == 'gm')) {//德语站点使用自己的css处理服务器
- $purifycss_server = 'http://158.177.67.52:33033/';
- }
- $validator_result = GET_HTTP($purifycss_server, 'amp_source=' . urlencode($textarea_htmlcode), 'POST');
- $validator_result = json_decode($validator_result);
- if ($validator_result->status == 'FAIL') {
- return json_encode(array('name' => 'no', 'value' => $validator_result->errors));
- }
- }
- $amp = $this->CI->InfoMetas_model->get($ic_id, 'AMP');
- if ($amp === false) {
- $this->CI->InfoMetas_model->add($ic_id, 'AMP', $textarea_htmlcode);
- } else {
- $this->CI->InfoMetas_model->update($ic_id, 'AMP', $textarea_htmlcode);
- }
+ if ($data['information'] == FALSE) {
+ show_404();
+ }
- $amp_status_value = $this->CI->InfoMetas_model->get($ic_id, 'AMP_STATUS');
- if ($amp_status_value === false) {
- $this->CI->InfoMetas_model->add($ic_id, 'AMP_STATUS', $amp_status);
- } else {
- $this->CI->InfoMetas_model->update($ic_id, 'AMP_STATUS', $amp_status);
- }
+ //CH的页面没有canonical内容,在这里帮补上
+ $textarea_htmlcode = str_replace('', $this->CI->config->item('site_url') . $data['information']->ic_url, $textarea_htmlcode);
+
+ //备份修改的代码
+ $this->CI->Logs_model->write('backup_amp', $ic_id, $textarea_htmlcode);
+
+ //AMP格式验证
+ if ($amp_status !== '0') { //只有发布的时候才需要验证
+ //把AMP网页内容到purifycss处理,内置了AMP-Validator
+ $purifycss_server = 'http://169.54.167.189:33033/';
+ if ($this->CI->config->item('site_code' == 'gm')) { //德语站点使用自己的css处理服务器
+ $purifycss_server = 'http://158.177.67.52:33033/';
+ }
+ $validator_result = GET_HTTP($purifycss_server, 'amp_source=' . urlencode($textarea_htmlcode), 'POST');
+ $validator_result = json_decode($validator_result);
+ if ($validator_result->status == 'FAIL') {
+ return json_encode(['name' => 'no', 'value' => $validator_result->errors]);
+ }
+ }
+ $amp = $this->CI->InfoMetas_model->get($ic_id, 'AMP');
+ if ($amp === false) {
+ $this->CI->InfoMetas_model->add($ic_id, 'AMP', $textarea_htmlcode);
+ } else {
+ $this->CI->InfoMetas_model->update($ic_id, 'AMP', $textarea_htmlcode);
+ }
- return json_encode(array('name' => 'ok', 'value' => $this->CI->lang->line('form_info_success')));
+ $amp_status_value = $this->CI->InfoMetas_model->get($ic_id, 'AMP_STATUS');
+ if ($amp_status_value === false) {
+ $this->CI->InfoMetas_model->add($ic_id, 'AMP_STATUS', $amp_status);
+ } else {
+ $this->CI->InfoMetas_model->update($ic_id, 'AMP_STATUS', $amp_status);
}
+ return json_encode(['name' => 'ok', 'value' => $this->CI->lang->line('form_info_success')]);
+ }
+
}
diff --git a/application/third_party/htmlcompressor/controllers/index_ah.php b/application/third_party/htmlcompressor/controllers/index_ah.php
index f816bdbe..12b6fac1 100644
--- a/application/third_party/htmlcompressor/controllers/index_ah.php
+++ b/application/third_party/htmlcompressor/controllers/index_ah.php
@@ -1,167 +1,168 @@
load->library('simple_html_dom_lib');
- }
-
- public function index(){
- $this->load->view('welcome');
- }
-
- //选择处理方式
- public function choose_way(){
- $this->htmlsource = $this->input->post('htmlsource');
- $this->websitehost = $this->input->post('websitehost');
- $this->template_name = $this->input->post('template_name');
- $this->create_amp = $this->input->post('create_amp');
- $this->debug = $this->input->post('debug');
-
- /*$this->htmlsource = file_get_contents('aa.htm');
- $this->websitehost = 'https://data.chinarundreisen.com';
+if (! defined('BASEPATH')) {
+ exit('No direct script access allowed');
+}
+
+class Index_ah extends CI_Controller {
+
+ public function __construct() {
+ parent::__construct();
+ $this->load->library('simple_html_dom_lib');
+ }
+
+ public function index() {
+ $this->load->view('welcome');
+ }
+
+ //选择处理方式
+ public function choose_way() {
+ $this->htmlsource = $this->input->post('htmlsource');
+ $this->websitehost = $this->input->post('websitehost');
+ $this->template_name = $this->input->post('template_name');
+ $this->create_amp = $this->input->post('create_amp');
+ $this->debug = $this->input->post('debug');
+
+ /*$this->htmlsource = file_get_contents('aa.htm');
+ $this->websitehost = 'https://data.chinahighlightstravel.de';
$this->create_amp = 'true';
$this->template_name = 'gm';*/
-
- if (empty($this->htmlsource) || empty($this->websitehost)) {
- $this->output->set_status_header(500);
- echo 'error:htmlsource or websitehost is empty!';
- log_message('error', "htmlsource or websitehost is empty! " . $this->websitehost);
- return false;
+
+ if (empty($this->htmlsource) || empty($this->websitehost)) {
+ $this->output->set_status_header(500);
+ echo 'error:htmlsource or websitehost is empty!';
+ log_message('error', "htmlsource or websitehost is empty! " . $this->websitehost);
+ return false;
+ }
+
+ //域名后面不能有/
+ if (substr($this->websitehost, -1, 1) == '/') {
+ $this->websitehost = substr($this->websitehost, 0, -1);
+ }
+
+ //进行页面解析
+ $this->html_object = str_get_html($this->htmlsource);
+
+ //PC或AMP的构造方式
+ if (! empty($this->create_amp)) {
+ echo $this->create_amp();
+ return;
+ } else {
+ echo $this->optimize();
+ return;
+ }
+
+ }
+
+ //html优化处理
+ function optimize() {
+ //提取css样式地址
+ $link_css_array = [];
+ $css_content = '';
+ foreach ($this->html_object->find('link') as $link_css) {
+ //将所有的样式链接存储为一个数组
+ if ($link_css->rel == 'stylesheet' && ! empty($link_css->href)) {
+ $link_css_array[] = $link_css->href;
+ $link_css->outertext = ''; //删除链接
+ }
+ }
+
+ //循环下载所有的css样式,拼接成字符串
+ foreach ($link_css_array as $item) {
+ $get_http_temp = GET_HTTP($this->format_url($item, $this->websitehost));
+ if ($get_http_temp == false) {
+ $this->output->set_status_header(404);
+ echo 'CSS文件下载错误';
+ log_message('error', "optimize CSS文件下载错误! " . $item);
+ return FALSE;
+ }
+ $css_content .= $get_http_temp;
+ }
+
+ //找出所有style写的内置样式
+ foreach ($this->html_object->find('style') as $style_css) {
+ if ($style_css->type == "text/css") {
+ $css_content .= $style_css->innertext;
+ }
+ }
+
+ //提取和下载所有JS脚本,包括链接文件和页面脚本
+ $link_js_array = [];
+ $js_inline_content = '';
+ $js_jquery_content = '';
+ foreach ($this->html_object->find('script') as $link_script) {
+ if (! empty($link_script->src)) {
+ if (empty($link_script->defer) && empty($link_script->async)) { //没有defer标记的才处理,否则让js延后加载
+ $link_js_array[] = $link_script->src;
+ $link_script->outertext = ''; //删除链接,移动到页底
+ }
+ } else {
+ //网页内的js不需要提取
+ //$js_content.= $link_script->innertext;//js的内容
+ // $js_content.= $link_script;//js的内容,包含';
-
- $js_content = $js_scr_content . $js_jquery_content;
- //延迟加载js,需要把返回的js代码保存到一个文件中,然后替换占位符,以便加载js文件
- $lastload_js .= '';
- $lastload_js .= $js_inline_content;
-
- $this->html_object = str_replace('
-
+
-
+
-
+
-
+
-
-
+
+
-
+
Vielen Dank für die Buchung bei Chinarundreisen! Bitte füllen Sie das folgende Formular aus
@@ -117,7 +117,7 @@
!
Bitte prüfen Sie, ob Ihr Name richtig geschrieben ist (vollständiger Name wie im Reisepass) . Da wir die Folgekosten durch ein wegen falschem Namen stornierten Hotel oder Flugticketnicht tragen, ist die richtige Schreibweise Ihres Namens und Ihrer alle Daten unbedingt wichtig.
-
+
-
+
-
+
+ Mitreisende hinzufügen
-
+
Kontakttelefon
@@ -240,17 +240,17 @@
-
+
-
+
Kontaktinformationen für Notfälle (im Falle eines Notfalls während Ihrer Chinareise)
@@ -287,22 +287,22 @@ Andere Abfahrts-/Ankunftszeit für
-
+
-
+
-
Überprüfen & Absenden
-
+
Überprüfen & Absenden
+
-
+
-
-
+
+
@@ -333,7 +333,7 @@ $(function(){
changeYear: false,
timeFormat: 'H:mm'
});
-
+
//用on来绑定,防止新添加的元素无法相应初始化配置,但是有一个bug,如果第一次直接点击无法启用日历
$('body').on('click',function(){
//生日
@@ -346,7 +346,7 @@ $(function(){
yearRange: '1920:2015',
timeFormat: 'mm/dd/yy'
});
-
+
//护照过期时间
$('.passport_expiration_date').datepicker({
controlType: 'select',
@@ -357,17 +357,17 @@ $(function(){
timeFormat: 'mm/dd/yy'
});
});
-
+
//添加乘客
$('.addperson').click(function(){
var addhtml = '
';
-
+
$(this).before(addhtml);
-
+
});
-
- var coli_sn = COLI_SN;?>;
-
+
+ var coli_sn = COLI_SN; ?>;
+
//ajax获取新生成页面的url
$.ajax({
type: "post",
@@ -376,7 +376,7 @@ $(function(){
$('.addmemeber').attr('href',return_url);
}
});
-
+
//提交信息
$("#form-confirm-info").submit(function(event){
event.preventDefault();
diff --git a/application/third_party/order/views/gm/confirm_order_back.php b/application/third_party/order/views/gm/confirm_order_back.php
index 31578924..180b00ec 100644
--- a/application/third_party/order/views/gm/confirm_order_back.php
+++ b/application/third_party/order/views/gm/confirm_order_back.php
@@ -6,16 +6,16 @@
China Reisen und China Rundreisen individuell | Chinarundreisen.com
-
-
-
+
+
+
-
-
-
-
+
+
+
+
@@ -28,20 +28,24 @@
-
+86 773 OPI_Telephone; ?>(GMT+8)
+
+86 773 OPI_Telephone; ?>(GMT+8)
800-822-4462(gebührenfrei aus Deutschland)
@@ -79,7 +83,7 @@
@@ -92,7 +96,7 @@
Verfallsdatum des Reisepasses
-
+
Nationalität
@@ -124,13 +128,13 @@
-
+
-
+
@@ -141,7 +145,7 @@
-
+
-
+
@@ -203,7 +207,7 @@
- COLI_CustomerType!=44003){ ?>
+ COLI_CustomerType != 44003) {?>
-
+
@@ -288,7 +292,7 @@
- COLI_CustomerType!=44003){ ?>
+ COLI_CustomerType != 44003) {?>
- Kontaktinformationen für Notfälle
+ Kontaktinformationen für Notfälle
(im Falle eines Notfalls während Ihrer Chinareise)
-
+
-
+
Überprüfen & Absenden
-
Danke! Mit besten Grüßen, OPI_FirstName; ?>
+
Danke! Mit besten Grüßen, OPI_FirstName; ?>
@@ -477,7 +481,7 @@ $(document).ready(function(){
$currentbox.find('input').val('');
$currentbox.find('.datepicker').removeClass('hasDatepicker').attr('id','');
$currentbox.find('.bd_datepicker').removeClass('hasDatepicker').attr('id','');
-
+
$('.datepicker').datepicker({
controlType: 'select',
oneLine: true,
@@ -495,7 +499,7 @@ $(document).ready(function(){
yearRange: '1920:2015',
timeFormat: 'mm/dd/yy'
});
-
+
});
//日期初始化
diff --git a/application/third_party/order/views/gm/link_tips.php b/application/third_party/order/views/gm/link_tips.php
index ba6b04e5..f07d25af 100644
--- a/application/third_party/order/views/gm/link_tips.php
+++ b/application/third_party/order/views/gm/link_tips.php
@@ -7,13 +7,13 @@
China Reisen und China Rundreisen individuell | Chinarundreisen.com
-
-
+
+
-
-
+
+
@@ -26,7 +26,7 @@
diff --git a/application/views/bootstrap/footer.php b/application/views/bootstrap/footer.php
index 8964f436..b73c6a30 100644
--- a/application/views/bootstrap/footer.php
+++ b/application/views/bootstrap/footer.php
@@ -15,13 +15,13 @@
静态化更新-系列站专用
需要更新的URL
-
+
diff --git a/application/views/bootstrap3/header.php b/application/views/bootstrap3/header.php
index f60a1689..0c3385c0 100644
--- a/application/views/bootstrap3/header.php
+++ b/application/views/bootstrap3/header.php
@@ -37,18 +37,18 @@
// window.KCFinder = {};
// window.KCFinder.callBack = function (url) {
- // config->item('site_code')) {
- // case 'ah':
- // echo "alert(url.replace('/kcfinder/upload/ah/','https://data.asiahighlights.com/'));";
- // break;
- // case 'gm':
- // echo "alert(url.replace('/kcfinder/upload/gm/','https://data.chinarundreisen.com/'));";
- // break;
- // default:
- // echo 'alert(url);';
- // }
- // ?>
+ // config->item('site_code')) {
+ // case 'ah':
+ // echo "alert(url.replace('/kcfinder/upload/ah/','https://data.asiahighlights.com/'));";
+ // break;
+ // case 'gm':
+ // echo "alert(url.replace('/kcfinder/upload/gm/','https://data.chinahighlightstravel.de/'));";
+ // break;
+ // default:
+ // echo 'alert(url);';
+ // }
+ // ?>
// window.KCFinder = null;
// };
// window.open('/kcfinder/browse.php?type=config->item('site_code'); ?>', 'kcfinder_textbox', 'status=0, toolbar=0, location=0, menubar=0, directories=0,resizable=1, scrollbars=0, width=800, height=600');
@@ -202,21 +202,21 @@
搜索
- config->item('site_code'), array('jp', 'gm', 'vc', 'vac', 'ru', 'it', 'gh_jp', 'gh_gm', 'gh_vc', 'gh_vac', 'gh_ru', 'gh_it'))) { ?>
+ config->item('site_code'), ['jp', 'gm', 'vc', 'vac', 'ru', 'it', 'gh_jp', 'gh_gm', 'gh_vc', 'gh_vac', 'gh_ru', 'gh_it'])) {?>
session->userdata('session_admin');
+ echo 'https://multimedia.mycht.cn/authorise/' . $admin_info['OPI_SN'] . '/' . $this->config->item('site_code')?>"
target="_blank" class="btn btn-default btn-sm" title="多媒体图片">
-
+
session->userdata('session_admin');
+ echo 'https://multimedia.mycht.cn/authorise/' . $admin_info['OPI_SN'] . '/' . $this->config->item('site_code')?>"
class="btn btn-default btn-sm" title="多媒体图片">
-
+
ic_id))
- $current_msg = $information->ic_id;
- if (isset($task->t_id))
- $current_msg = $task->t_id;
- $total_count = $all_unread_sms['sms_count'] + $info_unread_sms['sms_count']; //计算未读消息总数
- $unread_sms_ic_id = 0; //用于设置所有收录消息为已读
- if ($total_count != 0) {
- ?>
-
- ic_id)) {
+ $current_msg = $information->ic_id;
}
- ?>
- t_id)) {
+ $current_msg = $task->t_id;
}
+
+ $total_count = $all_unread_sms['sms_count'] + $info_unread_sms['sms_count']; //计算未读消息总数
+ $unread_sms_ic_id = 0; //用于设置所有收录消息为已读
+ if ($total_count != 0) {
?>
+
+
+
-
+
config->item('site_code');
- echo ' -';
- $admin_info = $this->session->userdata('session_admin');
- echo $admin_info['OPI_Name'];
+ echo $this->config->item('site_code');
+ echo ' -';
+ $admin_info = $this->session->userdata('session_admin');
+ echo $admin_info['OPI_Name'];
?>
diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php
index 0804c4ec..34eaff3b 100644
--- a/application/views/bootstrap3/information_edit.php
+++ b/application/views/bootstrap3/information_edit.php
@@ -38,7 +38,7 @@
}
};
- zNodes = ;
+ zNodes = ;
function onClickzTree(e, treeId, treeNode, clickFlag) {
var urlReQuery = "";
@@ -342,7 +342,7 @@
//德语站点跳转测试页面
function goto_gmtest_page() {
- var site_url = 'https://www.chinarundreisen.com/gm.php/information/detail/?cache=false&static_html_url=';
+ var site_url = 'https://www.chinahighlightstravel.de/gm.php/information/detail/?cache=false&static_html_url=';
$('#goto_test_page_button').attr("href", site_url + $('#ic_url').val());
return true;
}
@@ -464,7 +464,7 @@
//}
}
//选择节点
- var node = zTree.getNodeByParam("id", is_id ?>);
+ var node = zTree.getNodeByParam("id", is_id ?>);
zTree.selectNode(node);
change_seo_count('ic_seo_title');
@@ -486,10 +486,10 @@
width: '100%',
height: '560px',
readOnly: false,
-
+
allowedContent: true,
autoParagraph: false,
-
+
filebrowserBrowseUrl: '/wysiwyg/ckfinder/ckfinder.php?sitecode=config->item('site_code'); ?>',
filebrowserUploadUrl: '/wysiwyg/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=image',
contentsCss: 'config->item("css_source_" . $this->config->item("site_code")); ?>'
@@ -602,12 +602,12 @@
@@ -633,23 +633,23 @@
session->userdata('session_admin');
- $usrcode = strtolower($amp_user['OPI_Code']);
- $show_photo_meta = get_meta($information->ic_id, 'meta_use_list_picture');
- $amp_photo = '';
- if ($information->ic_photo && $show_photo_meta !== 'no') {
- $amp_photo = $this->config->item('site_image_url') . $information->ic_photo;
- }
- $amp_build_url = "/amp_app/?icid=" . $information->ic_id . "&is_path=" . $information->is_path . "&usr=" . urlencode($amp_user['OPI_Name']) . "&url=" . urlencode($information->ic_url) . "&photo=" . urlencode($amp_photo) . "&site=" . urlencode($this->config->item('site_url')) . "&imgurl=" . urlencode($this->config->item('site_image_url'));
- ?>
- ic_id, 'AMP_BODY_PC_STATUS') == 'yes') {
- // $PcAmpChecked = 'checked';
- // } else {
- // $PcAmpChecked = '';
- // }
+ $amp_user = $this->session->userdata('session_admin');
+ $usrcode = strtolower($amp_user['OPI_Code']);
+ $show_photo_meta = get_meta($information->ic_id, 'meta_use_list_picture');
+ $amp_photo = '';
+ if ($information->ic_photo && $show_photo_meta !== 'no') {
+ $amp_photo = $this->config->item('site_image_url') . $information->ic_photo;
+ }
+ $amp_build_url = "/amp_app/?icid=" . $information->ic_id . "&is_path=" . $information->is_path . "&usr=" . urlencode($amp_user['OPI_Name']) . "&url=" . urlencode($information->ic_url) . "&photo=" . urlencode($amp_photo) . "&site=" . urlencode($this->config->item('site_url')) . "&imgurl=" . urlencode($this->config->item('site_image_url'));
?>
+ic_id, 'AMP_BODY_PC_STATUS') == 'yes') {
+ // $PcAmpChecked = 'checked';
+ // } else {
+ // $PcAmpChecked = '';
+ // }
+ ?>
', $template);
//额外样式
$meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
- if (!empty($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 {
@@ -2142,31 +2157,31 @@ class Information extends CI_Controller
}
//额外js
$meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
- if (!empty($meta_addon_js)) {
+ 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)) {
+ 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);
+ $template = str_replace('', $lazy_content, $template);
//社媒分享图片
$full_ic_photo = '';
- if (!empty($information->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)) {
+ if (! empty($full_ic_photo)) {
$template = str_replace('', '
', $template);
}
//设置图片尺寸
// 优化过图片目录:D:\wwwroot\origin-images.chinahighlights.com\optimize\
- $www_local_path = 'D:/wwwroot/origin-www.globalhighlights.com';
+ $www_local_path = 'D:/wwwroot/origin-www.globalhighlights.com';
$image_local_path = 'D:/wwwroot/origin-images.chinahighlights.com/optimize';
if (is_dir($www_local_path) && is_dir('D:/wwwroot/origin-www.globalhighlights.com')) {
$template = $this->html_optimize_lib->set_image_size_local($template, $www_local_path, $image_local_path);
@@ -2184,38 +2199,37 @@ class Information extends CI_Controller
file_put_contents($html_path, $template, LOCK_EX);
}
- public function make_www_cache_htravel($device, $information, $recommand_information)
- {
+ public function make_www_cache_htravel($device, $information, $recommand_information) {
- $data = array();
- $data['information'] = $information;
- $recommand_template = '';
- $meta_show_advertise = get_meta($information->ic_id, 'meta_show_advertise');
+ $data = [];
+ $data['information'] = $information;
+ $recommand_template = '';
+ $meta_show_advertise = get_meta($information->ic_id, 'meta_show_advertise');
$data['meta_show_advertise'] = $meta_show_advertise;
switch ($device) {
- case 'mobile':
- //获取移动优先的模板,如果有的话
- $template_path = 'mobile_first/' . $this->config->item('site_code');
- if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
- $template = $this->load->view($template_path, '', true);
- $html_path_ext = '-mobile.htm';
- } else {
- return false;
- }
- $recommand_template = 'mobile_first/htravel-next-mobile';
- 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', $data, true);
- $html_path_ext = '-pc.htm';
- } else {
- return false;
- }
- $recommand_template = 'mobile_first/htravel-next';
- break;
- default:
+ case 'mobile':
+ //获取移动优先的模板,如果有的话
+ $template_path = 'mobile_first/' . $this->config->item('site_code');
+ if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
+ $template = $this->load->view($template_path, '', true);
+ $html_path_ext = '-mobile.htm';
+ } else {
+ return false;
+ }
+ $recommand_template = 'mobile_first/htravel-next-mobile';
+ 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', $data, true);
+ $html_path_ext = '-pc.htm';
+ } else {
+ return false;
+ }
+ $recommand_template = 'mobile_first/htravel-next';
+ break;
+ default:
}
//替换模板中的标签
@@ -2225,11 +2239,11 @@ class Information extends CI_Controller
$template = str_replace('', $this->config->item('site_url') . $information->ic_url, $template);
//顶部视频
- $data['meta_news_video'] = get_meta($information->ic_id, 'meta_news_video');
+ $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');
} else {
@@ -2241,48 +2255,48 @@ class Information extends CI_Controller
// AH Home 下层节点名称和链接映射
$group_map = [
278002667 => [
- 'ic_url' => '/destinations',
+ 'ic_url' => '/destinations',
'ic_url_title' => 'Destinations',
],
278008885 => [
- 'ic_url' => '/about-us',
+ 'ic_url' => '/about-us',
'ic_url_title' => 'About Us',
],
];
- $breadcrumb_data = $this->Information_model->get_breadcrumb_data($information->is_id, $information->is_path, $group_map);
- $ads_by_google = !empty(get_meta($information->ic_id, 'meta_google_ad_article'));
+ $breadcrumb_data = $this->Information_model->get_breadcrumb_data($information->is_id, $information->is_path, $group_map);
+ $ads_by_google = ! empty(get_meta($information->ic_id, 'meta_google_ad_article'));
$data['meta_news_createdate'] = $this->get_publish_date_in_6_month($information);
- $data['ads_by_google'] = $ads_by_google;
- $data['author'] = ''; //获取作者信息
- $author_url = '';
- $author = $this->Operator_model->get_author_nikename($information->ic_author);
- if (!empty($author)) {
- $data['author'] = $author->OPI_FirstName;
- $data['OPI_Code'] = $author->OPI_Code;
+ $data['ads_by_google'] = $ads_by_google;
+ $data['author'] = ''; //获取作者信息
+ $author_url = '';
+ $author = $this->Operator_model->get_author_nikename($information->ic_author);
+ if (! empty($author)) {
+ $data['author'] = $author->OPI_FirstName;
+ $data['OPI_Code'] = $author->OPI_Code;
$data['author_url'] = $this->get_author_url('www.highlightstravel.com', $author->OPI_Code);
- $author_url = $this->get_author_url('www.highlightstravel.com', $author->OPI_Code);
+ $author_url = $this->get_author_url('www.highlightstravel.com', $author->OPI_Code);
} else {
$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['breadcrumb_data'] = $breadcrumb_data;
- $template_H1 = $this->load->view($template_path . '-h1', $data, true);
- $template = str_replace('', $template_H1, $template);
+ $template_H1 = $this->load->view($template_path . '-h1', $data, true);
+ $template = str_replace('', $template_H1, $template);
// 结构化标签:Article
$article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article',
- array('information' => $information, 'author_name' => $data['author'], 'author_url' => $author_url),
+ ['information' => $information, 'author_name' => $data['author'], 'author_url' => $author_url],
true
);
$template = str_replace('', $article_structured_data_content, $template);
// 结构化标签:BreadcrumbList
$breadcrumb_structured_data_content = $this->load->view(
$template_path . '-structured-data-breadcrumb',
- array('breadcrumb_data' => $breadcrumb_data, 'information' => $information),
+ ['breadcrumb_data' => $breadcrumb_data, 'information' => $information],
true
);
$template = str_replace(
@@ -2293,9 +2307,9 @@ class Information extends CI_Controller
//推荐信息或者产品
$template_recommand = $recommand_information;
- $template = str_replace('', $this->load->view($recommand_template, array('recommands' => $template_recommand), true), $template);
+ $template = str_replace('', $this->load->view($recommand_template, ['recommands' => $template_recommand], true), $template);
//广告,改叫tips,防止被插件屏蔽
- if (!empty($template_recommand['Tips Right']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) {
+ if (! empty($template_recommand['Tips Right']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) {
$template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template);
}
// 右侧列表广告
@@ -2324,11 +2338,11 @@ class Information extends CI_Controller
$tips_right_list_content = $this->load->view(
'mobile_first/htravel-tips-right-list',
- array(
+ [
'tips_right_a' => $tips_right_a,
'tips_right_b' => $tips_right_b,
'tips_right_c' => $tips_right_c,
- ),
+ ],
true
);
@@ -2338,17 +2352,17 @@ class Information extends CI_Controller
//文中的信息推荐
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);
+ $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-article', ['recommands' => $template_recommand], true), $information->ic_content);
}
//文中的线路推荐
if (strpos($information->ic_content, '') !== false) {
- $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), true), $information->ic_content);
+ $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-tour', ['recommands' => $template_recommand], true), $information->ic_content);
}
//替换内容中广告
- $temp_array = array();
+ $temp_array = [];
preg_match_all('^^', $information->ic_content, $temp_array);
- if (!empty($temp_array[1])) {
+ 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) {
@@ -2361,13 +2375,13 @@ class Information extends CI_Controller
// 非产品页面
if (empty($meta_product_code)) {
$addthis_widget = $this->load->view($template_path . '-add-this', false, true);
- $template = str_replace('', $addthis_widget, $template);
- $template = str_replace('?product_code=', '', $template);
+ $template = str_replace('', $addthis_widget, $template);
+ $template = str_replace('?product_code=', '', $template);
} 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(
$template_path . '-inquiry-form',
- array('meta_product_code' => $meta_product_code, 'information' => $information),
+ ['meta_product_code' => $meta_product_code, 'information' => $information],
true
);
$information->ic_content = str_replace('', $inquiry_form_template, $information->ic_content);
@@ -2375,7 +2389,7 @@ class Information extends CI_Controller
// GP 表单
$gp_form_content = $this->load->view(
$template_path . '-gp-form',
- array('meta_product_code' => $meta_product_code, 'information' => $information),
+ ['meta_product_code' => $meta_product_code, 'information' => $information],
true
);
$information->ic_content = str_replace('', $gp_form_content, $information->ic_content);
@@ -2383,7 +2397,7 @@ class Information extends CI_Controller
// tour-list 表单
$tour_list_form_content = $this->load->view(
$template_path . '-tour-list-form',
- array('meta_product_code' => $meta_product_code, 'information' => $information),
+ ['meta_product_code' => $meta_product_code, 'information' => $information],
true
);
$information->ic_content = str_replace('', $tour_list_form_content, $information->ic_content);
@@ -2391,7 +2405,7 @@ class Information extends CI_Controller
// 水灯节 GP 线路表单
$gp_form_content = $this->load->view(
$template_path . '-lantern-festival-gp-form',
- array('meta_product_code' => $meta_product_code, 'information' => $information),
+ ['meta_product_code' => $meta_product_code, 'information' => $information],
true
);
$information->ic_content = str_replace('', $gp_form_content, $information->ic_content);
@@ -2407,22 +2421,22 @@ class Information extends CI_Controller
);
}
// 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, $information->ic_content);
- $why_us_tour_detail_pc = $this->load->view($template_path . '-why-us-tour-detail-pc', false, true);
+ $why_us_tour_detail_pc = $this->load->view($template_path . '-why-us-tour-detail-pc', false, true);
$information->ic_content = str_replace('', $why_us_tour_detail_pc, $information->ic_content);
- $why_us_tour_list_pc = $this->load->view($template_path . '-why-us-tour-list-pc', false, true);
+ $why_us_tour_list_pc = $this->load->view($template_path . '-why-us-tour-list-pc', false, true);
$information->ic_content = str_replace('', $why_us_tour_list_pc, $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_content, $information->ic_content);
// 水灯节表单
$lantern_form_content = $this->load->view(
'mobile_first/htravel-lantern-form',
- array('information' => $information),
+ ['information' => $information],
true
);
$information->ic_content = str_replace('', $lantern_form_content, $information->ic_content);
@@ -2430,7 +2444,7 @@ class Information extends CI_Controller
// 水灯节2025表单
$lantern_form_content_2025 = $this->load->view(
'mobile_first/htravel-lantern-form-2025',
- array('information' => $information),
+ ['information' => $information],
true
);
$information->ic_content = str_replace('', $lantern_form_content_2025, $information->ic_content);
@@ -2438,16 +2452,15 @@ class Information extends CI_Controller
// Chiang Mai Authentic Sky Lantern Festival on Nov. 5, 2025
$lantern_form_content_authentic_sky = $this->load->view(
'mobile_first/htravel-chiang-mai-lantern-festival',
- array('information' => $information),
+ ['information' => $information],
true
);
$information->ic_content = str_replace('', $lantern_form_content_authentic_sky, $information->ic_content);
-
// CAD 跨年表单
$new_year_countdown_form_content = $this->load->view(
'mobile_first/htravel-new-year-countdown',
- array('information' => $information),
+ ['information' => $information],
true
);
$information->ic_content = str_replace(
@@ -2461,16 +2474,16 @@ class Information extends CI_Controller
// 解析结果:; Siem Reap,Bangkok
$feedback_array = [];
preg_match_all('^^', $information->ic_content, $feedback_array);
- if (!empty($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, FALSE);
+ $city_name_list = explode(',', $city_name_string);
+ $feedback_list = $this->Feedback_model->get_feedback_by_city_list($city_name_list, FALSE);
// 防止触发 Google 网络垃圾政策只返回前三条
$top3_feedback_list = array_slice($feedback_list, 0, 3);
- $feedback_content = $this->load->view(
+ $feedback_content = $this->load->view(
'mobile_first/htravel-feedback-list',
- array('feedback_list' => $top3_feedback_list),
+ ['feedback_list' => $top3_feedback_list],
true
);
$information->ic_content = str_replace(
@@ -2486,13 +2499,13 @@ class Information extends CI_Controller
// 解析结果:; Bangkok
$feedback30_array = [];
preg_match_all('^^', $information->ic_content, $feedback30_array);
- if (!empty($feedback30_array)) {
+ if (! empty($feedback30_array)) {
foreach ($feedback30_array[0] as $index => $tag_name) {
- $city_name = $feedback30_array[1][$index];
- $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 30, FALSE);
+ $city_name = $feedback30_array[1][$index];
+ $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 30, FALSE);
$feedback_30_content = $this->load->view(
'mobile_first/htravel-feedback-30-list',
- array('feedback_list' => $feedback_list),
+ ['feedback_list' => $feedback_list],
true
);
$information->ic_content = str_replace(
@@ -2506,14 +2519,14 @@ class Information extends CI_Controller
// 集合页面反馈标签
$feedback_city_array = [];
preg_match_all('^^', $information->ic_content, $feedback_city_array);
- if (!empty($feedback_city_array)) {
+ if (! empty($feedback_city_array)) {
foreach ($feedback_city_array[0] as $index => $tag_name) {
- $city_name_string = $feedback_city_array[1][$index];
- $city_name_list = explode(',', $city_name_string);
+ $city_name_string = $feedback_city_array[1][$index];
+ $city_name_list = explode(',', $city_name_string);
$feedback_city_list = [];
foreach ($city_name_list as $index => $city_name) {
- $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 5, FALSE);
- $data_name = str_replace(" ", "_", $city_name);
+ $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 5, FALSE);
+ $data_name = str_replace(" ", "_", $city_name);
$feedback_city_list[$data_name] = $feedback_list;
}
@@ -2534,16 +2547,16 @@ class Information extends CI_Controller
$feedback_advisor_array = [];
preg_match_all('^^', $information->ic_content, $feedback_advisor_array);
- if (!empty($feedback_advisor_array)) {
+ if (! empty($feedback_advisor_array)) {
foreach ($feedback_advisor_array[0] as $index => $tag_name) {
- $advisor_name = $feedback_advisor_array[1][$index];
- $feedback_list = $this->Feedback_model->get_feedback_by_advisor_name($advisor_name);
+ $advisor_name = $feedback_advisor_array[1][$index];
+ $feedback_list = $this->Feedback_model->get_feedback_by_advisor_name($advisor_name);
$feedback_content = $this->load->view(
'mobile_first/htravel-feedback-advisor-list',
- array(
+ [
'feedback_list' => $feedback_list,
- 'advisor_name' => $advisor_name
- ),
+ 'advisor_name' => $advisor_name,
+ ],
true
);
$information->ic_content = str_replace(
@@ -2554,7 +2567,7 @@ class Information extends CI_Controller
}
}
- //主样式表,内联模式
+ //主样式表,内联模式
if (is_file('D:/wwwroot/origin-www.highlightstravel.com/css/mobile-first.css')) { //主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
$main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-www.highlightstravel.com/css/mobile-first.css'));
} else {
@@ -2563,34 +2576,34 @@ class Information extends CI_Controller
$template = str_replace('', '', $template);
//额外样式
$meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
- if (!empty($meta_addon_css)) {
+ if (! empty($meta_addon_css)) {
//内联方式
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
- $template = str_replace('', '', $template);
+ $template = str_replace('', '', $template);
}
//额外js
$meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
- if (!empty($meta_addon_js)) {
+ if (! empty($meta_addon_js)) {
$template = str_replace('', '', $template);
}
$meta_note_ogtitle = get_meta($information->ic_id, 'meta_note_ogtitle');
- if (!empty($meta_note_ogtitle)) {
+ if (! empty($meta_note_ogtitle)) {
$template = str_replace('', '
', $template);
}
$meta_note = get_meta($information->ic_id, 'meta_note');
- if (!empty($meta_note)) {
+ if (! empty($meta_note)) {
$template = str_replace('', '
', $template);
}
$meta_index_set = get_meta($information->ic_id, 'meta_index_set');
- if (!empty($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.highlightstravel.com/grey.gif');
- $template = str_replace('', $lazy_content, $template);
+ $template = str_replace('', $lazy_content, $template);
//Google广告代码
//if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) {
@@ -2599,18 +2612,18 @@ class Information extends CI_Controller
//社媒分享图片
$full_ic_photo = '';
- if (!empty($information->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)) {
+ if (! empty($full_ic_photo)) {
$template = str_replace('', '
', $template);
}
// 设置图片尺寸
// 优化过图片目录:D:\wwwroot\origin-images.chinahighlights.com\optimize\
- $www_local_path = 'D:/wwwroot/origin-www.highlightstravel.com';
+ $www_local_path = 'D:/wwwroot/origin-www.highlightstravel.com';
$image_local_path = 'D:/wwwroot/origin-images.chinahighlights.com/optimize';
if (is_dir($www_local_path) && is_dir($image_local_path)) {
$template = $this->html_optimize_lib->set_image_size_local($template, $www_local_path, $image_local_path);
@@ -2628,39 +2641,37 @@ class Information extends CI_Controller
file_put_contents($html_path, $template, LOCK_EX);
}
+ public function make_www_cache_jh($device, $information, $recommand_information) {
- public function make_www_cache_jh($device, $information, $recommand_information)
- {
-
- $data = array();
- $data['information'] = $information;
- $recommand_template = '';
- $meta_show_advertise = get_meta($information->ic_id, 'meta_show_advertise');
+ $data = [];
+ $data['information'] = $information;
+ $recommand_template = '';
+ $meta_show_advertise = get_meta($information->ic_id, 'meta_show_advertise');
$data['meta_show_advertise'] = $meta_show_advertise;
switch ($device) {
- case 'mobile':
- //获取移动优先的模板,如果有的话
- $template_path = 'mobile_first/' . $this->config->item('site_code');
- if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
- $template = $this->load->view($template_path, '', true);
- $html_path_ext = '-mobile.htm';
- } else {
- return false;
- }
- $recommand_template = 'mobile_first/jh-next-mobile';
- 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', $data, true);
- $html_path_ext = '-pc.htm';
- } else {
- return false;
- }
- $recommand_template = 'mobile_first/jh-next';
- break;
- default:
+ case 'mobile':
+ //获取移动优先的模板,如果有的话
+ $template_path = 'mobile_first/' . $this->config->item('site_code');
+ if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
+ $template = $this->load->view($template_path, '', true);
+ $html_path_ext = '-mobile.htm';
+ } else {
+ return false;
+ }
+ $recommand_template = 'mobile_first/jh-next-mobile';
+ 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', $data, true);
+ $html_path_ext = '-pc.htm';
+ } else {
+ return false;
+ }
+ $recommand_template = 'mobile_first/jh-next';
+ break;
+ default:
}
//替换模板中的标签
@@ -2670,11 +2681,11 @@ class Information extends CI_Controller
$template = str_replace('', $this->config->item('site_url') . $information->ic_url, $template);
//顶部视频
- $data['meta_news_video'] = get_meta($information->ic_id, 'meta_news_video');
+ $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');
} else {
@@ -2686,45 +2697,45 @@ class Information extends CI_Controller
// AH Home 下层节点名称和链接映射
$group_map = [
278011836 => [
- 'ic_url' => '/about-us',
+ 'ic_url' => '/about-us',
'ic_url_title' => 'About Us',
],
];
- $breadcrumb_data = $this->Information_model->get_breadcrumb_data($information->is_id, $information->is_path, $group_map);
- $ads_by_google = !empty(get_meta($information->ic_id, 'meta_google_ad_article'));
+ $breadcrumb_data = $this->Information_model->get_breadcrumb_data($information->is_id, $information->is_path, $group_map);
+ $ads_by_google = ! empty(get_meta($information->ic_id, 'meta_google_ad_article'));
$data['meta_news_createdate'] = $this->get_publish_date_in_6_month($information);
- $data['ads_by_google'] = $ads_by_google;
- $data['author_name'] = ''; //获取作者信息
- $author = $this->Operator_model->get_author_nikename($information->ic_author);
- $data['author_info'] = ['url' => '', 'avatar' => '', 'expertise' => ''];
+ $data['ads_by_google'] = $ads_by_google;
+ $data['author_name'] = ''; //获取作者信息
+ $author = $this->Operator_model->get_author_nikename($information->ic_author);
+ $data['author_info'] = ['url' => '', 'avatar' => '', 'expertise' => ''];
- if (!empty($author)) {
+ if (! empty($author)) {
$data['author_name'] = $author->OPI_FirstName;
- $data['OPI_Code'] = $author->OPI_Code;
+ $data['OPI_Code'] = $author->OPI_Code;
- $author_info = $this->get_author_info('japanhighlights.com', $author->OPI_Code);
+ $author_info = $this->get_author_info('japanhighlights.com', $author->OPI_Code);
$data['author_info'] = $author_info;
} else {
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
- if (!empty($author_web)) {
+ if (! empty($author_web)) {
$data['author_name'] = $author_web->a_name;
}
}
$data['breadcrumb_data'] = $breadcrumb_data;
- $template_H1 = $this->load->view($template_path . '-h1', $data, true);
- $template = str_replace('', $template_H1, $template);
+ $template_H1 = $this->load->view($template_path . '-h1', $data, true);
+ $template = str_replace('', $template_H1, $template);
// 结构化标签:Article
$article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article',
- array('information' => $information, 'author_name' => $data['author_name'], 'author_url' => $author_info['url']),
+ ['information' => $information, 'author_name' => $data['author_name'], 'author_url' => $author_info['url']],
true
);
$template = str_replace('', $article_structured_data_content, $template);
// 结构化标签:BreadcrumbList
$breadcrumb_structured_data_content = $this->load->view(
$template_path . '-structured-data-breadcrumb',
- array('breadcrumb_data' => $breadcrumb_data, 'information' => $information),
+ ['breadcrumb_data' => $breadcrumb_data, 'information' => $information],
true
);
$template = str_replace(
@@ -2735,9 +2746,9 @@ class Information extends CI_Controller
//推荐信息或者产品
$template_recommand = $recommand_information;
- $template = str_replace('', $this->load->view($recommand_template, array('recommands' => $template_recommand), true), $template);
+ $template = str_replace('', $this->load->view($recommand_template, ['recommands' => $template_recommand], true), $template);
//广告,改叫tips,防止被插件屏蔽
- if (!empty($template_recommand['Tips Right']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) {
+ if (! empty($template_recommand['Tips Right']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) {
$template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template);
}
// 右侧列表广告
@@ -2766,11 +2777,11 @@ class Information extends CI_Controller
$tips_right_list_content = $this->load->view(
'mobile_first/jh-tips-right-list',
- array(
+ [
'tips_right_a' => $tips_right_a,
'tips_right_b' => $tips_right_b,
'tips_right_c' => $tips_right_c,
- ),
+ ],
true
);
@@ -2780,17 +2791,17 @@ class Information extends CI_Controller
//文中的信息推荐
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);
+ $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-article', ['recommands' => $template_recommand], true), $information->ic_content);
}
//文中的线路推荐
if (strpos($information->ic_content, '') !== false) {
- $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), true), $information->ic_content);
+ $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-tour', ['recommands' => $template_recommand], true), $information->ic_content);
}
//替换内容中广告
- $temp_array = array();
+ $temp_array = [];
preg_match_all('^^', $information->ic_content, $temp_array);
- if (!empty($temp_array[1])) {
+ 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) {
@@ -2804,10 +2815,10 @@ class Information extends CI_Controller
if (empty($meta_product_code)) {
} 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(
'mobile_first/jh-inquiry-form',
- array('meta_product_code' => $meta_product_code, 'information' => $information),
+ ['meta_product_code' => $meta_product_code, 'information' => $information],
true
);
$information->ic_content = str_replace('', $inquiry_form_template, $information->ic_content);
@@ -2815,7 +2826,7 @@ class Information extends CI_Controller
// GP 表单
$gp_form_content = $this->load->view(
'mobile_first/jh-gp-form',
- array('meta_product_code' => $meta_product_code, 'information' => $information),
+ ['meta_product_code' => $meta_product_code, 'information' => $information],
true
);
$information->ic_content = str_replace('', $gp_form_content, $information->ic_content);
@@ -2837,16 +2848,16 @@ class Information extends CI_Controller
// 解析结果:; Siem Reap,Bangkok
$feedback_array = [];
preg_match_all('^^', $information->ic_content, $feedback_array);
- if (!empty($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, FALSE);
+ $city_name_list = explode(',', $city_name_string);
+ $feedback_list = $this->Feedback_model->get_feedback_by_city_list($city_name_list, FALSE);
// 防止触发 Google 网络垃圾政策只返回前三条,但市场要求显示五条
$top3_feedback_list = array_slice($feedback_list, 0, 5);
- $feedback_content = $this->load->view(
+ $feedback_content = $this->load->view(
'mobile_first/jh-feedback-list',
- array('feedback_list' => $top3_feedback_list),
+ ['feedback_list' => $top3_feedback_list],
true
);
$information->ic_content = str_replace(
@@ -2862,13 +2873,13 @@ class Information extends CI_Controller
// 解析结果:; Bangkok
$feedback30_array = [];
preg_match_all('^^', $information->ic_content, $feedback30_array);
- if (!empty($feedback30_array)) {
+ if (! empty($feedback30_array)) {
foreach ($feedback30_array[0] as $index => $tag_name) {
- $city_name = $feedback30_array[1][$index];
- $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 30, FALSE);
+ $city_name = $feedback30_array[1][$index];
+ $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 30, FALSE);
$feedback_30_content = $this->load->view(
'mobile_first/jh-feedback-30-list',
- array('feedback_list' => $feedback_list),
+ ['feedback_list' => $feedback_list],
true
);
$information->ic_content = str_replace(
@@ -2882,14 +2893,14 @@ class Information extends CI_Controller
// 集合页面反馈标签
$feedback_city_array = [];
preg_match_all('^^', $information->ic_content, $feedback_city_array);
- if (!empty($feedback_city_array)) {
+ if (! empty($feedback_city_array)) {
foreach ($feedback_city_array[0] as $index => $tag_name) {
- $city_name_string = $feedback_city_array[1][$index];
- $city_name_list = explode(',', $city_name_string);
+ $city_name_string = $feedback_city_array[1][$index];
+ $city_name_list = explode(',', $city_name_string);
$feedback_city_list = [];
foreach ($city_name_list as $index => $city_name) {
- $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 5, FALSE);
- $data_name = str_replace(" ", "_", $city_name);
+ $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 5, FALSE);
+ $data_name = str_replace(" ", "_", $city_name);
$feedback_city_list[$data_name] = $feedback_list;
}
@@ -2906,7 +2917,7 @@ class Information extends CI_Controller
}
}
- //主样式表,内联模式
+ //主样式表,内联模式
if (is_file('D:/wwwroot/origin-www.japanhighlights.com/css/mobile-first.css')) { //主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
$main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-www.japanhighlights.com/css/mobile-first.css'));
} else {
@@ -2915,34 +2926,34 @@ class Information extends CI_Controller
$template = str_replace('', '', $template);
//额外样式
$meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
- if (!empty($meta_addon_css)) {
+ if (! empty($meta_addon_css)) {
//内联方式
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
- $template = str_replace('', '', $template);
+ $template = str_replace('', '', $template);
}
//额外js
$meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
- if (!empty($meta_addon_js)) {
+ if (! empty($meta_addon_js)) {
$template = str_replace('', '', $template);
}
$meta_note_ogtitle = get_meta($information->ic_id, 'meta_note_ogtitle');
- if (!empty($meta_note_ogtitle)) {
+ if (! empty($meta_note_ogtitle)) {
$template = str_replace('', '
', $template);
}
$meta_note = get_meta($information->ic_id, 'meta_note');
- if (!empty($meta_note)) {
+ if (! empty($meta_note)) {
$template = str_replace('', '
', $template);
}
$meta_index_set = get_meta($information->ic_id, 'meta_index_set');
- if (!empty($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.japanhighlights.com/grey.gif');
- $template = str_replace('', $lazy_content, $template);
+ $template = str_replace('', $lazy_content, $template);
//Google广告代码
//if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) {
@@ -2951,18 +2962,18 @@ class Information extends CI_Controller
//社媒分享图片
$full_ic_photo = '';
- if (!empty($information->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)) {
+ if (! empty($full_ic_photo)) {
$template = str_replace('', '
', $template);
}
// 设置图片尺寸
// 优化过图片目录:D:\wwwroot\origin-images.chinahighlights.com\optimize\
- $www_local_path = 'D:/wwwroot/origin-www.japanhighlights.com';
+ $www_local_path = 'D:/wwwroot/origin-www.japanhighlights.com';
$image_local_path = 'D:/wwwroot/origin-images.chinahighlights.com/optimize';
if (is_dir($www_local_path) && is_dir($image_local_path)) {
$template = $this->html_optimize_lib->set_image_size_local($template, $www_local_path, $image_local_path);
@@ -2985,26 +2996,25 @@ class Information extends CI_Controller
* @return:
* @Date Changed:
*/
- public function make_www_cache_ct($information)
- {
- $data = array();
+ public function make_www_cache_ct($information) {
+ $data = [];
- #region 公用数据
- //$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
+ #region 公用数据
+ //$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
$apiurl = "https://ct.mycht.cn/info.php"; //网前
//先准备数据,CT采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
- $data["TITLE"] = $information->ic_seo_title;
+ $data["TITLE"] = $information->ic_seo_title;
$data["DESCRIPTION"] = $information->ic_seo_description;
- $data["KEYWORDS"] = $information->ic_seo_keywords;
- $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
- $meta_ct_page_type = "";
- $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
- $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
- $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
+ $data["KEYWORDS"] = $information->ic_seo_keywords;
+ $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
+ $meta_ct_page_type = "";
+ $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
+ $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
+ $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
//面包屑
- $crumb = "";
+ $crumb = "";
$crumb_data = $this->Information_model->get_path_exclude_ct($information->is_id, $information->is_path);
if (count($crumb_data) > 0) { //至少有一个父类面包屑才显示
$crumb = "
Home ";
@@ -3016,31 +3026,31 @@ class Information extends CI_Controller
$data["crumb"] = $crumb;
//作者字符串,信息页或者城市天气页加载 2022-7-26
- $str_author = "";
- $author = $this->Operator_model->get_author_nikename($information->ic_author);
+ $str_author = "";
+ $author = $this->Operator_model->get_author_nikename($information->ic_author);
$meta_news_createdate = get_meta($information->ic_id, 'meta_news_createdate'); //信息发布时间
- 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';
- $EditTime = strtotime($information->ic_datetime); //如果有录入信息发布时间的属性,就读取这个
- if (!empty($meta_news_createdate)){
+ 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';
+ $EditTime = strtotime($information->ic_datetime); //如果有录入信息发布时间的属性,就读取这个
+ if (! empty($meta_news_createdate)) {
$EditTime = strtotime($meta_news_createdate);
}
$str_author = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", $EditTime) . '
';
}
- //火车票详细页搜索框添加 -- zp
- $meta_ct_page_trainform = get_meta($information->ic_id, 'meta_ct_page_trainform'); //是否插入火车票搜索框
+ //火车票详细页搜索框添加 -- zp
+ $meta_ct_page_trainform = get_meta($information->ic_id, 'meta_ct_page_trainform'); //是否插入火车票搜索框
$template_TrainDetailSearch = "";
if ($meta_ct_page_trainform == "yes" || $information->is_parent_id == "278014609") {
- $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai
- $data_TrainCity = array();
+ $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai
+ $data_TrainCity = [];
$data_TrainCity["from"] = "";
- $data_TrainCity["to"] = "";
- if (!empty($meta_train_city)) {
+ $data_TrainCity["to"] = "";
+ if (! empty($meta_train_city)) {
if (strpos($meta_train_city, '|') !== false) {
- $arrTrainCity = explode('|', $meta_train_city);
+ $arrTrainCity = explode('|', $meta_train_city);
$data_TrainCity["from"] = $arrTrainCity[0];
- $data_TrainCity["to"] = $arrTrainCity[1];
+ $data_TrainCity["to"] = $arrTrainCity[1];
}
}
@@ -3083,21 +3093,20 @@ class Information extends CI_Controller
$ic_content = str_replace('', $zodiacCalc, $ic_content);
}
-
// 动态加载反馈标签,按城市出前三条。左侧
// HTLM:
,显示全部用
// 解析结果:; Shanghai,Beijing
$feedback_array = [];
preg_match_all('^^', $information->ic_content, $feedback_array);
- if (!empty($feedback_array)) {
+ if (! empty($feedback_array)) {
foreach ($feedback_array[0] as $index => $tag_name) {
$city_name_string = $feedback_array[1][$index];
- $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string,30);
+ $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string, 30);
// 防止触发 Google 网络垃圾政策只返回前三条
$top3_feedback_list = array_slice($feedback_list, 0, 3);
- $feedback_content = $this->load->view(
+ $feedback_content = $this->load->view(
'mobile_first/chinatravel-feedback-list',
- array('feedback_list' => $top3_feedback_list),
+ ['feedback_list' => $top3_feedback_list],
true
);
$ic_content = str_replace(
@@ -3113,15 +3122,15 @@ class Information extends CI_Controller
// 解析结果:; Shanghai,Beijing
$feedback_array = [];
preg_match_all('^^', $information->ic_content, $feedback_array);
- if (!empty($feedback_array)) {
+ if (! empty($feedback_array)) {
foreach ($feedback_array[0] as $index => $tag_name) {
$city_name_string = $feedback_array[1][$index];
- $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string,30);
+ $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string, 30);
// 防止触发 Google 网络垃圾政策只返回前三条
$top3_feedback_list = array_slice($feedback_list, 0, 3);
- $feedback_content = $this->load->view(
+ $feedback_content = $this->load->view(
'mobile_first/chinatravel-feedback-cross',
- array('feedback_list' => $top3_feedback_list),
+ ['feedback_list' => $top3_feedback_list],
true
);
$ic_content = str_replace(
@@ -3132,7 +3141,6 @@ class Information extends CI_Controller
}
}
-
//图片加延迟
$ic_content = $this->html_optimize_lib->set_lazy_loader($ic_content, 'https://data.chinatravel.com/images/mobile-first/grey.gif');
@@ -3141,11 +3149,11 @@ class Information extends CI_Controller
$data["CUSTOMCONENT"] = $ic_content;
//非产品页面
- $data["PRODUCTJS"] = "";
- $data["ISPRODUCT"] = "no"; //判断是否是产品页
+ $data["PRODUCTJS"] = "";
+ $data["ISPRODUCT"] = "no"; //判断是否是产品页
$data["addthis_widget"] = "";
- $data["FloatIcon"] = ""; //浮动图标替代addthis
- $arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains");
+ $data["FloatIcon"] = ""; //浮动图标替代addthis
+ $arrExitUrl = ["/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains"];
if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) {
//$data["addthis_widget"] = $this->load->view($template_path . '-add-this', false, true); //社媒代码addthis
@@ -3156,33 +3164,33 @@ class Information extends CI_Controller
}
//顶部视频
- $data["TOPVIDEO"] = "";
- $meta_news_video = get_meta($information->ic_id, 'meta_news_video');
+ $data["TOPVIDEO"] = "";
+ $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)) {
+ if (! empty($meta_news_video) && ! empty($meta_video_picture)) {
$data["TOPVIDEO"] = '
';
}
//主样式表,内联模式
//$apiweb="http://202.103.68.104"; //本地测试
- $apiweb = "https://data.chinatravel.com";
- $cssUrl = $apiweb . "/css/newcss3/base.css?v=" . time();
+ $apiweb = "https://data.chinatravel.com";
+ $cssUrl = $apiweb . "/css/newcss3/base.css?v=" . time();
$main_css_string = compress_css(GET_HTTP($cssUrl));
$data["MAINCSS"] = '';
//额外样式
$data["ADDONCSS"] = "";
- $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
- if (!empty($meta_addon_css)) {
+ $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
+ if (! empty($meta_addon_css)) {
//引用方式
//$data["ADDONCSS"]= '
';
//内联方式
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
- $data["ADDONCSS"] = '';
+ $data["ADDONCSS"] = '';
}
//社媒分享图片
$data["OGIMAGE"] = "";
- if (!empty($information->ic_photo)) {
+ if (! empty($information->ic_photo)) {
if (strpos($information->ic_photo, "chinatravel.com") != false) {
$full_ic_photo = $information->ic_photo;
} else {
@@ -3193,21 +3201,20 @@ class Information extends CI_Controller
//结构化标签
$data["ConstructionCode"] = "";
- $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
- if (!empty($meta_construction_code)) {
+ $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
+ if (! empty($meta_construction_code)) {
$data["ConstructionCode"] = $meta_construction_code;
}
- $data["meta_index_set"]="";
- $meta_index_set = get_meta($information->ic_id, 'meta_index_set');
- if (!empty($meta_index_set)) {
+ $data["meta_index_set"] = "";
+ $meta_index_set = get_meta($information->ic_id, 'meta_index_set');
+ if (! empty($meta_index_set)) {
$data["meta_index_set"] = '
';
}
-
//总JS:为了方便以后js好维护,必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js,所以必须在这里进行判断
- $addBaseJs = false;
- $addonJs = "";
+ $addBaseJs = false;
+ $addonJs = "";
$meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
if ($meta_ct_page_price == "yes") {
@@ -3223,8 +3230,8 @@ class Information extends CI_Controller
//额外js
$data["ADDONJS"] = "";
- $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
- if (!empty($meta_addon_js)) {
+ $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
+ if (! empty($meta_addon_js)) {
$addonJs .= '';
}
//价格js
@@ -3233,22 +3240,22 @@ class Information extends CI_Controller
}
//列表js
- if (in_array($meta_ct_page_type, array('daytripindex', 'tourindex', 'attractionindex'))) {
+ if (in_array($meta_ct_page_type, ['daytripindex', 'tourindex', 'attractionindex'])) {
$addonJs .= '';
}
//天气
- if (in_array($meta_ct_page_type, array('weatherpage'))) {
+ if (in_array($meta_ct_page_type, ['weatherpage'])) {
$addonJs .= '';
}
//页面传递参数
$passParam = "";
- if (in_array($meta_ct_page_type, array("daytripindex", "tourindex", "attractionindex", "weatherpage"))) { //一日游和线路列表
- //产品首页
+ if (in_array($meta_ct_page_type, ["daytripindex", "tourindex", "attractionindex", "weatherpage"])) { //一日游和线路列表
+ //产品首页
$meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value');
- if (in_array($meta_ct_page_type, array("attractionindex"))) {
+ if (in_array($meta_ct_page_type, ["attractionindex"])) {
//旧信息id,景点等信息类
$passParam .= '
';
} else {
@@ -3265,11 +3272,11 @@ class Information extends CI_Controller
$productCode = "";
if ($meta_ct_page_type == "daytripdetail") {
//一日游
- if (!empty($meta_ct_page_type)) {
+ if (! empty($meta_ct_page_type)) {
$productType = $meta_ct_page_type;
}
$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;
}
$addonJs .= '';
@@ -3278,38 +3285,37 @@ class Information extends CI_Controller
}
if ($meta_ct_page_type == "tourdetail") {
//线路
- $productType = $meta_ct_page_type;
+ $productType = $meta_ct_page_type;
$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;
}
//获取cli_sn
- $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getCliSn/?param=" . $productCode));
+ $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getCliSn/?param=" . $productCode));
$data["clisn"] = $tourdata->clisn;
//调取模板
$dataform["TourCode"] = $productCode;
- $dataform["CLI_SN"] = $tourdata->clisn;
+ $dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
-
}
//游船详细页
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');
- if (!empty($meta_ct_page_value)) {
+ if (! empty($meta_ct_page_value)) {
$productCode = $meta_ct_page_value;
}
- $dataCruise["shipname"] = $productCode;
- $template_curisedetails = $this->load->view($template_path . '-cruisedetails-form', $dataCruise, true);
+ $dataCruise["shipname"] = $productCode;
+ $template_curisedetails = $this->load->view($template_path . '-cruisedetails-form', $dataCruise, true);
$data["template_curisedetails"] = $template_curisedetails;
}
//表单页
- if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform", "tourdetail"))) {
+ if (in_array($meta_ct_page_type, ["customize", "contactus", "pagewithform", "tourdetail"])) {
$productType = $meta_ct_page_type;
$addonJs .= '';
$data["ADDONCSS"] .= '
';
@@ -3319,34 +3325,34 @@ class Information extends CI_Controller
$data["productCode"] = $productCode;
//页面添加的元素
- $data["ADDONJS"] = $addonJs;
+ $data["ADDONJS"] = $addonJs;
$data["passParam"] = $passParam;
#endregion
#region 移动端和PC端差别处理区域
- $arrDevice = array("mobile", "pc");
- $data["showFormTourQi"]=true; //是否显示线路表单,默认显示
+ $arrDevice = ["mobile", "pc"];
+ $data["showFormTourQi"] = true; //是否显示线路表单,默认显示
foreach ($arrDevice as $device) {
//顶部全屏大图
- $data["TOPBANNER"] = "";
- $ImgText = ""; //图文字
- $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
+ $data["TOPBANNER"] = "";
+ $ImgText = ""; //图文字
+ $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
$meta_addon_picture_text = get_meta($information->ic_id, 'meta_addon_picture_text');
if ($device == 'mobile') { //移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
- $bannerImg = '
';
- if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
+ $bannerImg = '
';
+ if (! empty($meta_addon_picture_url) && ! empty($meta_addon_picture_text)) {
$ImgText = '
';
- } else if (!empty($meta_addon_picture_text)) {
+ } else if (! empty($meta_addon_picture_text)) {
$ImgText = '
' . $meta_addon_picture_text . '
';
}
} else {
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
- $bannerImg = '
';
- if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
+ $bannerImg = '
';
+ if (! empty($meta_addon_picture_url) && ! empty($meta_addon_picture_text)) {
$ImgText = '
';
- } else if (!empty($meta_addon_picture_text)) {
+ } else if (! empty($meta_addon_picture_text)) {
$ImgText = '
' . $meta_addon_picture_text . '
';
}
}
@@ -3356,69 +3362,68 @@ class Information extends CI_Controller
if ($information->ic_url == "/china-trains/hometest" || $information->ic_url == "/china-trains") {
//火车票首页
$template_TrainSearch = $this->load->view($template_path . '-train-index', null, true);
- $ImgText = "";
+ $ImgText = "";
//火车票移动端去掉头部图片,保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
- $data["TOPBANNER"] = '
' . $template_TrainSearch . '
';
+ $data["TOPBANNER"] = '
' . $template_TrainSearch . '
';
}
} else if ($information->ic_url == "/china-flights") {
//机票首页
$template_TrainSearch = $this->load->view($template_path . '-flight-index', null, true);
- $ImgText = "";
+ $ImgText = "";
//飞机票移动端去掉头部图片,保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
- $data["TOPBANNER"] = '
' . $template_TrainSearch . '
';
+ $data["TOPBANNER"] = '
' . $template_TrainSearch . '
';
}
}
- if (!empty($meta_addon_picture)) {
- if (!empty($meta_addon_picture_url)) {
+ if (! empty($meta_addon_picture)) {
+ if (! empty($meta_addon_picture_url)) {
$data["TOPBANNER"] = '
';
} else {
$data["TOPBANNER"] = '
' . $bannerImg . $ImgText . $template_TrainSearch . '
';
}
}
-
if ($meta_ct_page_type == "tourdetail") {
- $dataform['device'] = $device;
- $template_form_tourqi = $this->load->view($template_path . '-form-tourqi', $dataform, true);
+ $dataform['device'] = $device;
+ $template_form_tourqi = $this->load->view($template_path . '-form-tourqi', $dataform, true);
$data["template_form_tourqi"] = $template_form_tourqi; //表单模板字符串
/**替换左右结构的线路表单标签 2024-7-4*/
if (strpos($ic_content, '') !== false) {
- $template_form_tourqi = $this->load->view($template_path . '-form-tourqi-new', $dataform, true);
- $ic_content = str_replace('', $template_form_tourqi, $ic_content);
- $data["showFormTourQi"]=false; //如果有标签就不显示外面的表单,因为$ic_content会在第一次就替换掉标签,所以第二次pc端这里不执行。
- $data["CUSTOMCONENT"] = $ic_content;
+ $template_form_tourqi = $this->load->view($template_path . '-form-tourqi-new', $dataform, true);
+ $ic_content = str_replace('', $template_form_tourqi, $ic_content);
+ $data["showFormTourQi"] = false; //如果有标签就不显示外面的表单,因为$ic_content会在第一次就替换掉标签,所以第二次pc端这里不执行。
+ $data["CUSTOMCONENT"] = $ic_content;
}
}
//两种设备分别调用两种模板 ,静态化
switch ($device) {
- case 'mobile':
- //获取移动优先的模板,如果有的话
- $template_path = 'mobile_first/' . $this->config->item('site_code');
- if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
- $template = $this->load->view($template_path, $data, 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', $data, true);
- $html_path_ext = '-pc.htm';
- } else {
- return false;
- }
- break;
- default:
+ case 'mobile':
+ //获取移动优先的模板,如果有的话
+ $template_path = 'mobile_first/' . $this->config->item('site_code');
+ if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
+ $template = $this->load->view($template_path, $data, 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', $data, true);
+ $html_path_ext = '-pc.htm';
+ } else {
+ return false;
+ }
+ break;
+ default:
}
//生成静态文件
@@ -3438,26 +3443,25 @@ class Information extends CI_Controller
/**
* 上海站
*/
- public function make_www_cache_sh($information)
- {
- $data = array();
+ public function make_www_cache_sh($information) {
+ $data = [];
- #region 公用数据
- //$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
+ #region 公用数据
+ //$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
$apiurl = "https://ct.mycht.cn/info.php"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
- $data["TITLE"] = $information->ic_seo_title;
+ $data["TITLE"] = $information->ic_seo_title;
$data["DESCRIPTION"] = $information->ic_seo_description;
- $data["KEYWORDS"] = $information->ic_seo_keywords;
- $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
- $meta_ct_page_type = "";
- $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
- $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
- $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
+ $data["KEYWORDS"] = $information->ic_seo_keywords;
+ $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
+ $meta_ct_page_type = "";
+ $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
+ $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
+ $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
//面包屑
- $crumb = "";
+ $crumb = "";
$crumb_data = $this->Information_model->get_path_exclude_ct($information->is_id, $information->is_path);
if (count($crumb_data) > 0) { //至少有一个父类面包屑才显示
$crumb = "
Home ";
@@ -3470,53 +3474,51 @@ class Information extends CI_Controller
//作者字符串,信息页或者城市天气页加载 2022-7-26
$str_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") {
- $OPI_FirstName = !empty($author) ? $author->OPI_FirstName : 'author nickname';
- $str_author = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
+ $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") {
+ $OPI_FirstName = ! empty($author) ? $author->OPI_FirstName : 'author nickname';
+ $str_author = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
}
- //火车票详细页搜索框添加 -- zp
- $meta_ct_page_trainform = get_meta($information->ic_id, 'meta_ct_page_trainform'); //是否插入火车票搜索框
+ //火车票详细页搜索框添加 -- zp
+ $meta_ct_page_trainform = get_meta($information->ic_id, 'meta_ct_page_trainform'); //是否插入火车票搜索框
$template_TrainDetailSearch = "";
- if ($meta_ct_page_trainform == "yes" || strpos($information->ic_url,"/china-trains")!==false) {
- $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai
- $data_TrainCity = array();
+ if ($meta_ct_page_trainform == "yes" || strpos($information->ic_url, "/china-trains") !== false) {
+ $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai
+ $data_TrainCity = [];
$data_TrainCity["from"] = "";
- $data_TrainCity["to"] = "";
- if (!empty($meta_train_city)) {
+ $data_TrainCity["to"] = "";
+ if (! empty($meta_train_city)) {
if (strpos($meta_train_city, '|') !== false) {
- $arrTrainCity = explode('|', $meta_train_city);
+ $arrTrainCity = explode('|', $meta_train_city);
$data_TrainCity["from"] = $arrTrainCity[0];
- $data_TrainCity["to"] = $arrTrainCity[1];
+ $data_TrainCity["to"] = $arrTrainCity[1];
}
}
$template_TrainDetailSearch = $this->load->view($template_path . '-train-index', $data_TrainCity, true);
}
-
-
/* 详细内容 */
$ic_content = $information->ic_content;
/** 替换H1加面包屑,加作者 */
- $ic_content = preg_replace('/
(.*)<\/h1>/i', $crumb . "\r\n" . '$1 ' . "\r\n" . $str_author . $template_TrainDetailSearch . "\r\n", $ic_content, 1);
+ $ic_content = preg_replace('/(.*)<\/h1>/i', $crumb . "\r\n" . '$1 ' . "\r\n" . $str_author . $template_TrainDetailSearch . "\r\n", $ic_content, 1);
// 动态加载反馈标签,按城市出前三条。左侧
// HTLM:
,显示全部用
// 解析结果:; Shanghai,Beijing
$feedback_array = [];
preg_match_all('^^', $information->ic_content, $feedback_array);
- if (!empty($feedback_array)) {
+ if (! empty($feedback_array)) {
foreach ($feedback_array[0] as $index => $tag_name) {
$city_name_string = $feedback_array[1][$index];
- $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string,30);
+ $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string, 30);
// 防止触发 Google 网络垃圾政策只返回前三条
$top3_feedback_list = array_slice($feedback_list, 0, 3);
- $feedback_content = $this->load->view(
+ $feedback_content = $this->load->view(
'mobile_first/chinatravel-feedback-list',
- array('feedback_list' => $top3_feedback_list),
+ ['feedback_list' => $top3_feedback_list],
true
);
$ic_content = str_replace(
@@ -3532,15 +3534,15 @@ class Information extends CI_Controller
// 解析结果:; Shanghai,Beijing
$feedback_array = [];
preg_match_all('^^', $information->ic_content, $feedback_array);
- if (!empty($feedback_array)) {
+ if (! empty($feedback_array)) {
foreach ($feedback_array[0] as $index => $tag_name) {
$city_name_string = $feedback_array[1][$index];
- $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string,30);
+ $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string, 30);
// 防止触发 Google 网络垃圾政策只返回前三条
$top3_feedback_list = array_slice($feedback_list, 0, 3);
- $feedback_content = $this->load->view(
+ $feedback_content = $this->load->view(
'mobile_first/chinatravel-feedback-cross',
- array('feedback_list' => $top3_feedback_list),
+ ['feedback_list' => $top3_feedback_list],
true
);
$ic_content = str_replace(
@@ -3556,14 +3558,12 @@ class Information extends CI_Controller
$ic_content = $this->html_optimize_lib->set_image_size($ic_content);
-
-
//非产品页面
- $data["PRODUCTJS"] = "";
- $data["ISPRODUCT"] = "no"; //判断是否是产品页
+ $data["PRODUCTJS"] = "";
+ $data["ISPRODUCT"] = "no"; //判断是否是产品页
$data["addthis_widget"] = "";
- $data["FloatIcon"] = ""; //浮动图标替代addthis
- $arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains");
+ $data["FloatIcon"] = ""; //浮动图标替代addthis
+ $arrExitUrl = ["/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains"];
if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) {
$data["FloatIcon"] = "";
@@ -3572,33 +3572,33 @@ class Information extends CI_Controller
}
//顶部视频
- $data["TOPVIDEO"] = "";
- $meta_news_video = get_meta($information->ic_id, 'meta_news_video');
+ $data["TOPVIDEO"] = "";
+ $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)) {
+ if (! empty($meta_news_video) && ! empty($meta_video_picture)) {
$data["TOPVIDEO"] = '
';
}
//主样式表,内联模式
//$apiweb="http://202.103.68.104:81"; //本地测试
- $apiweb = "https://data.shanghaihighlights.com";
- $cssUrl = $apiweb . "/css/css3/base.css?v=" . time();
+ $apiweb = "https://data.shanghaihighlights.com";
+ $cssUrl = $apiweb . "/css/css3/base.css?v=" . time();
$main_css_string = compress_css(GET_HTTP($cssUrl));
$data["MAINCSS"] = '';
//额外样式
$data["ADDONCSS"] = "";
- $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
- if (!empty($meta_addon_css)) {
+ $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
+ if (! empty($meta_addon_css)) {
//引用方式
//$data["ADDONCSS"]= ' ';
//内联方式
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
- $data["ADDONCSS"] = '';
+ $data["ADDONCSS"] = '';
}
//社媒分享图片
$data["OGIMAGE"] = "";
- if (!empty($information->ic_photo)) {
+ if (! empty($information->ic_photo)) {
if (strpos($information->ic_photo, "shanghaihighlights.com") != false) {
$full_ic_photo = $information->ic_photo;
} else {
@@ -3609,20 +3609,20 @@ class Information extends CI_Controller
//结构化标签
$data["ConstructionCode"] = "";
- $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
- if (!empty($meta_construction_code)) {
+ $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
+ if (! empty($meta_construction_code)) {
$data["ConstructionCode"] = $meta_construction_code;
}
- $data["meta_index_set"]="";
- $meta_index_set = get_meta($information->ic_id, 'meta_index_set');
- if (!empty($meta_index_set)) {
+ $data["meta_index_set"] = "";
+ $meta_index_set = get_meta($information->ic_id, 'meta_index_set');
+ if (! empty($meta_index_set)) {
$data["meta_index_set"] = ' ';
}
//总JS:为了方便以后js好维护,必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js,所以必须在这里进行判断
- $addBaseJs = false;
- $addonJs = "";
+ $addBaseJs = false;
+ $addonJs = "";
$meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
if ($meta_ct_page_price == "yes") {
@@ -3638,8 +3638,8 @@ class Information extends CI_Controller
//额外js
$data["ADDONJS"] = "";
- $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
- if (!empty($meta_addon_js)) {
+ $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
+ if (! empty($meta_addon_js)) {
$addonJs .= '';
}
//价格js
@@ -3648,22 +3648,22 @@ class Information extends CI_Controller
}
//列表js
- if (in_array($meta_ct_page_type, array('daytripindex', 'tourindex', 'attractionindex'))) {
+ if (in_array($meta_ct_page_type, ['daytripindex', 'tourindex', 'attractionindex'])) {
$addonJs .= '';
}
//天气
- if (in_array($meta_ct_page_type, array('weatherpage'))) {
+ if (in_array($meta_ct_page_type, ['weatherpage'])) {
$addonJs .= '';
}
//页面传递参数
$passParam = "";
- if (in_array($meta_ct_page_type, array("daytripindex", "tourindex", "attractionindex", "weatherpage"))) { //一日游和线路列表
- //产品首页
+ if (in_array($meta_ct_page_type, ["daytripindex", "tourindex", "attractionindex", "weatherpage"])) { //一日游和线路列表
+ //产品首页
$meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value');
- if (in_array($meta_ct_page_type, array("attractionindex"))) {
+ if (in_array($meta_ct_page_type, ["attractionindex"])) {
//旧信息id,景点等信息类
$passParam .= ' ';
} else {
@@ -3680,11 +3680,11 @@ class Information extends CI_Controller
$productCode = "";
if ($meta_ct_page_type == "daytripdetail") {
//一日游
- if (!empty($meta_ct_page_type)) {
+ if (! empty($meta_ct_page_type)) {
$productType = $meta_ct_page_type;
}
$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;
}
$addonJs .= '';
@@ -3693,28 +3693,28 @@ class Information extends CI_Controller
//一日游表单的替换
$DayTripData["productCode"] = $productCode;
- $template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
- //使用simple_html_dom_lib库来进行表单添加
+ $template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
+ //使用simple_html_dom_lib库来进行表单添加
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, "#maincontent", $template_form_daydetail);
}
if ($meta_ct_page_type == "tourdetail") {
//线路
- $productType = $meta_ct_page_type;
+ $productType = $meta_ct_page_type;
$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;
}
//获取cli_sn
- $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apish/getCliSn/?param=" . $productCode));
+ $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apish/getCliSn/?param=" . $productCode));
$data["clisn"] = $tourdata->clisn;
//获取price
- $tourprice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apish/getTourPrice/?param=" . $productCode));
+ $tourprice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apish/getTourPrice/?param=" . $productCode));
$dataform["tourprice"] = $tourprice->price;
//调取模板
$dataform["TourCode"] = $productCode;
- $dataform["CLI_SN"] = $tourdata->clisn;
+ $dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
$dataform["ic_photo"] = $information->ic_photo;
$template_form_tourqi = $this->load->view($template_path . '-form-tourqi', $dataform, true);
@@ -3725,35 +3725,34 @@ class Information extends CI_Controller
if ($meta_ct_page_type == "tourlist") {
//线路类型列表
- $lineTypeList = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getLineTypeList/?webcode=shanghai"));
+ $lineTypeList = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getLineTypeList/?webcode=shanghai"));
$dataTourList["lineTypeList"] = $lineTypeList;
- $tourListData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourList/?webcode=shanghai"));
+ $tourListData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourList/?webcode=shanghai"));
$dataTourList["tourListData"] = $tourListData;
- //替换模板
+ //替换模板
$template_page_tourlist = $this->load->view($template_path . '-tour-list', $dataTourList, true); //模板内容
- $ic_content = str_replace('', $template_page_tourlist, $ic_content);
+ $ic_content = str_replace('', $template_page_tourlist, $ic_content);
$addonJs .= '';
}
if ($meta_ct_page_type == "daytriplist") {
//一日游类型
- $allTypeList = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getPagTypeList/?webcode=shanghai"));
- $dataDayTripList["allTypeList"] = $allTypeList;
- $dayTripListData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getSearchDaytripList/?webcode=shanghai"));
+ $allTypeList = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getPagTypeList/?webcode=shanghai"));
+ $dataDayTripList["allTypeList"] = $allTypeList;
+ $dayTripListData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getSearchDaytripList/?webcode=shanghai"));
$dataDayTripList["dayTripListData"] = $dayTripListData;
- //替换模板
+ //替换模板
$template_page_daytriplist = $this->load->view($template_path . '-daytrip-list', $dataDayTripList, true); //模板内容
- $ic_content = str_replace('', $template_page_daytriplist, $ic_content);
+ $ic_content = str_replace('', $template_page_daytriplist, $ic_content);
$addonJs .= '';
}
-
//表单页
- if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform", "tourdetail"))) {
+ if (in_array($meta_ct_page_type, ["customize", "contactus", "pagewithform", "tourdetail"])) {
$productType = $meta_ct_page_type;
$addonJs .= '';
$data["ADDONCSS"] .= ' ';
@@ -3769,7 +3768,7 @@ class Information extends CI_Controller
$data["productCode"] = $productCode;
//页面添加的元素
- $data["ADDONJS"] = $addonJs;
+ $data["ADDONJS"] = $addonJs;
$data["passParam"] = $passParam;
//页面详细内容放最后,这样上面都可以进行内容的替换,比如一日游表单
@@ -3778,27 +3777,27 @@ class Information extends CI_Controller
#endregion
#region 移动端和PC端差别处理区域
- $arrDevice = array("mobile", "pc");
+ $arrDevice = ["mobile", "pc"];
foreach ($arrDevice as $device) {
//顶部全屏大图
- $data["TOPBANNER"] = "";
- $ImgText = ""; //图文字
- $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
+ $data["TOPBANNER"] = "";
+ $ImgText = ""; //图文字
+ $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
$meta_addon_picture_text = get_meta($information->ic_id, 'meta_addon_picture_text');
if ($device == 'mobile') { //移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
- $bannerImg = ' ';
- if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
+ $bannerImg = ' ';
+ if (! empty($meta_addon_picture_url) && ! empty($meta_addon_picture_text)) {
$ImgText = '';
- } else if (!empty($meta_addon_picture_text)) {
+ } else if (! empty($meta_addon_picture_text)) {
$ImgText = '' . $meta_addon_picture_text . '
';
}
} else {
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
- $bannerImg = ' ';
- if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
+ $bannerImg = ' ';
+ if (! empty($meta_addon_picture_url) && ! empty($meta_addon_picture_text)) {
$ImgText = '';
- } else if (!empty($meta_addon_picture_text)) {
+ } else if (! empty($meta_addon_picture_text)) {
$ImgText = '' . $meta_addon_picture_text . '
';
}
}
@@ -3808,25 +3807,25 @@ class Information extends CI_Controller
if ($information->ic_url == "/china-trains/hometest" || $information->ic_url == "/trains") {
//火车票首页
$template_TrainSearch = $this->load->view($template_path . '-train-index', null, true);
- $ImgText = "";
+ $ImgText = "";
//火车票移动端去掉头部图片,保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
- $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
+ $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
}
} else if ($information->ic_url == "/china-flights") {
//机票首页
$template_TrainSearch = $this->load->view($template_path . '-flight-index', null, true);
- $ImgText = "";
+ $ImgText = "";
//飞机票移动端去掉头部图片,保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
- $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
+ $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
}
}
- if (!empty($meta_addon_picture)) {
- if (!empty($meta_addon_picture_url)) {
+ if (! empty($meta_addon_picture)) {
+ if (! empty($meta_addon_picture_url)) {
$data["TOPBANNER"] = '';
} else {
$data["TOPBANNER"] = '' . $bannerImg . $ImgText . $template_TrainSearch . '
';
@@ -3835,27 +3834,27 @@ class Information extends CI_Controller
//两种设备分别调用两种模板 ,静态化
switch ($device) {
- case 'mobile':
- //获取移动优先的模板,如果有的话
- $template_path = 'mobile_first/' . $this->config->item('site_code');
- if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
- $template = $this->load->view($template_path, $data, 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', $data, true);
- $html_path_ext = '-pc.htm';
- } else {
- return false;
- }
- break;
- default:
+ case 'mobile':
+ //获取移动优先的模板,如果有的话
+ $template_path = 'mobile_first/' . $this->config->item('site_code');
+ if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
+ $template = $this->load->view($template_path, $data, 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', $data, true);
+ $html_path_ext = '-pc.htm';
+ } else {
+ return false;
+ }
+ break;
+ default:
}
//生成静态文件
@@ -3875,25 +3874,25 @@ class Information extends CI_Controller
/**
* 北京站mybeijingchina.com
*/
- public function make_www_cache_bj($information){
- $data = array();
+ public function make_www_cache_bj($information) {
+ $data = [];
- #region 公用数据
- //$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
+ #region 公用数据
+ //$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
$apiurl = "https://ct.mycht.cn/info.php"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
- $data["TITLE"] = $information->ic_seo_title;
+ $data["TITLE"] = $information->ic_seo_title;
$data["DESCRIPTION"] = $information->ic_seo_description;
- $data["KEYWORDS"] = $information->ic_seo_keywords;
- $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
- $meta_ct_page_type = "";
- $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
- $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
- $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
+ $data["KEYWORDS"] = $information->ic_seo_keywords;
+ $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
+ $meta_ct_page_type = "";
+ $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
+ $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
+ $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
//面包屑
- $crumb = "";
+ $crumb = "";
$crumb_data = $this->Information_model->get_path_exclude_ct($information->is_id, $information->is_path);
if (count($crumb_data) > 0) { //至少有一个父类面包屑才显示
$crumb = "Home ";
@@ -3906,52 +3905,51 @@ class Information extends CI_Controller
//作者字符串,信息页或者城市天气页加载 2022-7-26
$str_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") {
- $OPI_FirstName = !empty($author) ? $author->OPI_FirstName : 'author nickname';
- $str_author = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
+ $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") {
+ $OPI_FirstName = ! empty($author) ? $author->OPI_FirstName : 'author nickname';
+ $str_author = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
}
- //火车票详细页搜索框添加 -- zp
- $meta_ct_page_trainform = get_meta($information->ic_id, 'meta_ct_page_trainform'); //是否插入火车票搜索框
+ //火车票详细页搜索框添加 -- zp
+ $meta_ct_page_trainform = get_meta($information->ic_id, 'meta_ct_page_trainform'); //是否插入火车票搜索框
$template_TrainDetailSearch = "";
- if ($meta_ct_page_trainform == "yes" || strpos($information->ic_url,"/china-trains")!==false) {
- $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai
- $data_TrainCity = array();
+ if ($meta_ct_page_trainform == "yes" || strpos($information->ic_url, "/china-trains") !== false) {
+ $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai
+ $data_TrainCity = [];
$data_TrainCity["from"] = "";
- $data_TrainCity["to"] = "";
- if (!empty($meta_train_city)) {
+ $data_TrainCity["to"] = "";
+ if (! empty($meta_train_city)) {
if (strpos($meta_train_city, '|') !== false) {
- $arrTrainCity = explode('|', $meta_train_city);
+ $arrTrainCity = explode('|', $meta_train_city);
$data_TrainCity["from"] = $arrTrainCity[0];
- $data_TrainCity["to"] = $arrTrainCity[1];
+ $data_TrainCity["to"] = $arrTrainCity[1];
}
}
$template_TrainDetailSearch = $this->load->view($template_path . '-train-index', $data_TrainCity, true);
}
-
/* 详细内容 */
$ic_content = $information->ic_content;
/** 替换H1加面包屑,加作者 */
- $ic_content = preg_replace('/
(.*)<\/h1>/i', $crumb . "\r\n" . '$1 ' . "\r\n" . $str_author .$template_TrainDetailSearch . "\r\n", $ic_content, 1);
+ $ic_content = preg_replace('/(.*)<\/h1>/i', $crumb . "\r\n" . '$1 ' . "\r\n" . $str_author . $template_TrainDetailSearch . "\r\n", $ic_content, 1);
- // 动态加载反馈标签,按城市出前三条。左侧
+ // 动态加载反馈标签,按城市出前三条。左侧
// HTLM:
,显示全部用
// 解析结果:; Shanghai,Beijing
$feedback_array = [];
preg_match_all('^^', $information->ic_content, $feedback_array);
- if (!empty($feedback_array)) {
+ if (! empty($feedback_array)) {
foreach ($feedback_array[0] as $index => $tag_name) {
$city_name_string = $feedback_array[1][$index];
- $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string,30);
+ $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string, 30);
// 防止触发 Google 网络垃圾政策只返回前三条
$top3_feedback_list = array_slice($feedback_list, 0, 3);
- $feedback_content = $this->load->view(
+ $feedback_content = $this->load->view(
'mobile_first/chinatravel-feedback-list',
- array('feedback_list' => $top3_feedback_list),
+ ['feedback_list' => $top3_feedback_list],
true
);
$ic_content = str_replace(
@@ -3967,15 +3965,15 @@ class Information extends CI_Controller
// 解析结果:; Shanghai,Beijing
$feedback_array = [];
preg_match_all('^^', $information->ic_content, $feedback_array);
- if (!empty($feedback_array)) {
+ if (! empty($feedback_array)) {
foreach ($feedback_array[0] as $index => $tag_name) {
$city_name_string = $feedback_array[1][$index];
- $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string,30);
+ $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string, 30);
// 防止触发 Google 网络垃圾政策只返回前三条
$top3_feedback_list = array_slice($feedback_list, 0, 3);
- $feedback_content = $this->load->view(
+ $feedback_content = $this->load->view(
'mobile_first/chinatravel-feedback-cross',
- array('feedback_list' => $top3_feedback_list),
+ ['feedback_list' => $top3_feedback_list],
true
);
$ic_content = str_replace(
@@ -3986,20 +3984,17 @@ class Information extends CI_Controller
}
}
-
//图片加延迟
$ic_content = $this->html_optimize_lib->set_lazy_loader($ic_content, 'https://www.mybeijingchina.com/images/grey.gif');
$ic_content = $this->html_optimize_lib->set_image_size($ic_content);
-
-
//非产品页面
- $data["PRODUCTJS"] = "";
- $data["ISPRODUCT"] = "no"; //判断是否是产品页
+ $data["PRODUCTJS"] = "";
+ $data["ISPRODUCT"] = "no"; //判断是否是产品页
$data["addthis_widget"] = "";
- $data["FloatIcon"] = ""; //浮动图标替代addthis
- $arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains");
+ $data["FloatIcon"] = ""; //浮动图标替代addthis
+ $arrExitUrl = ["/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains"];
if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) {
$data["FloatIcon"] = "";
@@ -4008,33 +4003,33 @@ class Information extends CI_Controller
}
//顶部视频
- $data["TOPVIDEO"] = "";
- $meta_news_video = get_meta($information->ic_id, 'meta_news_video');
+ $data["TOPVIDEO"] = "";
+ $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)) {
+ if (! empty($meta_news_video) && ! empty($meta_video_picture)) {
$data["TOPVIDEO"] = '
';
}
//主样式表,内联模式
//$apiweb="http://202.103.68.104:84"; //本地测试
- $apiweb = "https://www.mybeijingchina.com";
- $cssUrl = $apiweb . "/css/css3/base.css?v=" . time();
+ $apiweb = "https://www.mybeijingchina.com";
+ $cssUrl = $apiweb . "/css/css3/base.css?v=" . time();
$main_css_string = compress_css(GET_HTTP($cssUrl));
$data["MAINCSS"] = '';
//额外样式
$data["ADDONCSS"] = "";
- $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
- if (!empty($meta_addon_css)) {
+ $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
+ if (! empty($meta_addon_css)) {
//引用方式
//$data["ADDONCSS"]= ' ';
//内联方式
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
- $data["ADDONCSS"] = '';
+ $data["ADDONCSS"] = '';
}
//社媒分享图片
$data["OGIMAGE"] = "";
- if (!empty($information->ic_photo)) {
+ if (! empty($information->ic_photo)) {
if (strpos($information->ic_photo, "mybeijingchina.com") != false) {
$full_ic_photo = $information->ic_photo;
} else {
@@ -4045,20 +4040,20 @@ class Information extends CI_Controller
//结构化标签
$data["ConstructionCode"] = "";
- $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
- if (!empty($meta_construction_code)) {
+ $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
+ if (! empty($meta_construction_code)) {
$data["ConstructionCode"] = $meta_construction_code;
}
- $data["meta_index_set"]="";
- $meta_index_set = get_meta($information->ic_id, 'meta_index_set');
- if (!empty($meta_index_set)) {
+ $data["meta_index_set"] = "";
+ $meta_index_set = get_meta($information->ic_id, 'meta_index_set');
+ if (! empty($meta_index_set)) {
$data["meta_index_set"] = ' ';
}
//总JS:为了方便以后js好维护,必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js,所以必须在这里进行判断
- $addBaseJs = false;
- $addonJs = "";
+ $addBaseJs = false;
+ $addonJs = "";
$meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
if ($meta_ct_page_price == "yes") {
@@ -4074,8 +4069,8 @@ class Information extends CI_Controller
//额外js
$data["ADDONJS"] = "";
- $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
- if (!empty($meta_addon_js)) {
+ $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
+ if (! empty($meta_addon_js)) {
$addonJs .= '';
}
//价格js
@@ -4084,22 +4079,22 @@ class Information extends CI_Controller
}
//列表js
- if (in_array($meta_ct_page_type, array('daytripindex', 'tourindex', 'attractionindex'))) {
+ if (in_array($meta_ct_page_type, ['daytripindex', 'tourindex', 'attractionindex'])) {
$addonJs .= '';
}
//天气
- if (in_array($meta_ct_page_type, array('weatherpage'))) {
+ if (in_array($meta_ct_page_type, ['weatherpage'])) {
$addonJs .= '';
}
//页面传递参数
$passParam = "";
- if (in_array($meta_ct_page_type, array("daytripindex", "tourindex", "attractionindex", "weatherpage"))) { //一日游和线路列表
- //产品首页
+ if (in_array($meta_ct_page_type, ["daytripindex", "tourindex", "attractionindex", "weatherpage"])) { //一日游和线路列表
+ //产品首页
$meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value');
- if (in_array($meta_ct_page_type, array("attractionindex"))) {
+ if (in_array($meta_ct_page_type, ["attractionindex"])) {
//旧信息id,景点等信息类
$passParam .= ' ';
} else {
@@ -4116,11 +4111,11 @@ class Information extends CI_Controller
$productCode = "";
if ($meta_ct_page_type == "daytripdetail") {
//一日游
- if (!empty($meta_ct_page_type)) {
+ if (! empty($meta_ct_page_type)) {
$productType = $meta_ct_page_type;
}
$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;
}
$addonJs .= '';
@@ -4129,61 +4124,59 @@ class Information extends CI_Controller
//一日游表单的替换
$DayTripData["productCode"] = $productCode;
- $template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
- //使用simple_html_dom_lib库来进行表单添加
+ $template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
+ //使用simple_html_dom_lib库来进行表单添加
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, "#maincontent", $template_form_daydetail);
}
if ($meta_ct_page_type == "tourdetail") {
//线路
- $productType = $meta_ct_page_type;
+ $productType = $meta_ct_page_type;
$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;
}
//获取cli_sn
- $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apibj/getCliSn/?param=" . $productCode));
+ $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apibj/getCliSn/?param=" . $productCode));
$data["clisn"] = $tourdata->clisn;
//调取模板
$dataform["TourCode"] = $productCode;
- $dataform["CLI_SN"] = $tourdata->clisn;
+ $dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
-
}
-
if ($meta_ct_page_type == "tourlist") {
//线路类型列表
- $lineTypeList = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getLineTypeList/?webcode=beijing"));
+ $lineTypeList = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getLineTypeList/?webcode=beijing"));
$dataTourList["lineTypeList"] = $lineTypeList;
- $tourListData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourList/?webcode=beijing"));
+ $tourListData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourList/?webcode=beijing"));
$dataTourList["tourListData"] = $tourListData;
- //替换模板
+ //替换模板
$template_page_tourlist = $this->load->view('mobile_first/shanghai-tour-list', $dataTourList, true); //模板内容,统一用上海站模板
- $ic_content = str_replace('', $template_page_tourlist, $ic_content);
+ $ic_content = str_replace('', $template_page_tourlist, $ic_content);
$addonJs .= '';
}
if ($meta_ct_page_type == "daytriplist") {
//一日游类型
- $allTypeList = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getPagTypeList/?webcode=beijing"));
- $dataDayTripList["allTypeList"] = $allTypeList;
- $dayTripListData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getSearchDaytripList/?webcode=beijing"));
+ $allTypeList = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getPagTypeList/?webcode=beijing"));
+ $dataDayTripList["allTypeList"] = $allTypeList;
+ $dayTripListData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getSearchDaytripList/?webcode=beijing"));
$dataDayTripList["dayTripListData"] = $dayTripListData;
- //替换模板
+ //替换模板
$template_page_daytriplist = $this->load->view('mobile_first/shanghai-daytrip-list', $dataDayTripList, true); //模板内容,统一用上海站模板
- $ic_content = str_replace('', $template_page_daytriplist, $ic_content);
+ $ic_content = str_replace('', $template_page_daytriplist, $ic_content);
$addonJs .= '';
}
//表单页
- if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform", "tourdetail"))) {
+ if (in_array($meta_ct_page_type, ["customize", "contactus", "pagewithform", "tourdetail"])) {
$productType = $meta_ct_page_type;
$addonJs .= '';
$data["ADDONCSS"] .= ' ';
@@ -4199,7 +4192,7 @@ class Information extends CI_Controller
$data["productCode"] = $productCode;
//页面添加的元素
- $data["ADDONJS"] = $addonJs;
+ $data["ADDONJS"] = $addonJs;
$data["passParam"] = $passParam;
//页面详细内容放最后,这样上面都可以进行内容的替换,比如一日游表单
@@ -4208,27 +4201,27 @@ class Information extends CI_Controller
#endregion
#region 移动端和PC端差别处理区域
- $arrDevice = array("mobile", "pc");
+ $arrDevice = ["mobile", "pc"];
foreach ($arrDevice as $device) {
//顶部全屏大图
- $data["TOPBANNER"] = "";
- $ImgText = ""; //图文字
- $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
+ $data["TOPBANNER"] = "";
+ $ImgText = ""; //图文字
+ $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
$meta_addon_picture_text = get_meta($information->ic_id, 'meta_addon_picture_text');
if ($device == 'mobile') { //移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
- $bannerImg = ' ';
- if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
+ $bannerImg = ' ';
+ if (! empty($meta_addon_picture_url) && ! empty($meta_addon_picture_text)) {
$ImgText = '';
- } else if (!empty($meta_addon_picture_text)) {
+ } else if (! empty($meta_addon_picture_text)) {
$ImgText = '' . $meta_addon_picture_text . '
';
}
} else {
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
- $bannerImg = ' ';
- if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
+ $bannerImg = ' ';
+ if (! empty($meta_addon_picture_url) && ! empty($meta_addon_picture_text)) {
$ImgText = '';
- } else if (!empty($meta_addon_picture_text)) {
+ } else if (! empty($meta_addon_picture_text)) {
$ImgText = '' . $meta_addon_picture_text . '
';
}
}
@@ -4238,62 +4231,61 @@ class Information extends CI_Controller
if ($information->ic_url == "/china-trains/hometest" || $information->ic_url == "/trains") {
//火车票首页
$template_TrainSearch = $this->load->view($template_path . '-train-index', null, true);
- $ImgText = "";
+ $ImgText = "";
//火车票移动端去掉头部图片,保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
- $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
+ $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
}
} else if ($information->ic_url == "/china-flights") {
//机票首页
$template_TrainSearch = $this->load->view($template_path . '-flight-index', null, true);
- $ImgText = "";
+ $ImgText = "";
//飞机票移动端去掉头部图片,保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
- $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
+ $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
}
}
- if (!empty($meta_addon_picture)) {
- if (!empty($meta_addon_picture_url)) {
+ if (! empty($meta_addon_picture)) {
+ if (! empty($meta_addon_picture_url)) {
$data["TOPBANNER"] = '';
} else {
$data["TOPBANNER"] = '' . $bannerImg . $ImgText . $template_TrainSearch . '
';
}
}
-
if ($meta_ct_page_type == "tourdetail") { //线路表单,左右结构,用标签来做
- $dataform['device'] = $device;
+ $dataform['device'] = $device;
$template_form_tourqi = $this->load->view($template_path . '-form-tourqi-new', $dataform, true);
- $ic_content = str_replace('', $template_form_tourqi, $ic_content);
+ $ic_content = str_replace('', $template_form_tourqi, $ic_content);
$data["CUSTOMCONENT"] = $ic_content;
}
//两种设备分别调用两种模板 ,静态化
switch ($device) {
- case 'mobile':
- //获取移动优先的模板,如果有的话
- $template_path = 'mobile_first/' . $this->config->item('site_code');
- if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
- $template = $this->load->view($template_path, $data, 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', $data, true);
- $html_path_ext = '-pc.htm';
- } else {
- return false;
- }
- break;
- default:
+ case 'mobile':
+ //获取移动优先的模板,如果有的话
+ $template_path = 'mobile_first/' . $this->config->item('site_code');
+ if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
+ $template = $this->load->view($template_path, $data, 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', $data, true);
+ $html_path_ext = '-pc.htm';
+ } else {
+ return false;
+ }
+ break;
+ default:
}
//生成静态文件
@@ -4313,25 +4305,25 @@ class Information extends CI_Controller
/**
* TrainSpread网站静态化
*/
- public function make_www_cache_ts($information){
- $data = array();
+ public function make_www_cache_ts($information) {
+ $data = [];
- #region 公用数据
- //$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
+ #region 公用数据
+ //$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
$apiurl = "https://ct.mycht.cn/info.php"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
- $data["TITLE"] = $information->ic_seo_title;
+ $data["TITLE"] = $information->ic_seo_title;
$data["DESCRIPTION"] = $information->ic_seo_description;
- $data["KEYWORDS"] = $information->ic_seo_keywords;
- $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
- $meta_ct_page_type = "";
- $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
- $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
- $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
+ $data["KEYWORDS"] = $information->ic_seo_keywords;
+ $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
+ $meta_ct_page_type = "";
+ $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
+ $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
+ $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
//面包屑
- $crumb = "";
+ $crumb = "";
$crumb_data = $this->Information_model->get_path_exclude_ct($information->is_id, $information->is_path);
if (count($crumb_data) > 0) { //至少有一个父类面包屑才显示
$crumb = "Home ";
@@ -4344,52 +4336,48 @@ class Information extends CI_Controller
//作者字符串,信息页或者城市天气页加载 2022-7-26
$str_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") {
- $OPI_FirstName = !empty($author) ? $author->OPI_FirstName : 'author nickname';
- $str_author = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
+ $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") {
+ $OPI_FirstName = ! empty($author) ? $author->OPI_FirstName : 'author nickname';
+ $str_author = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
}
+ //火车票详细页搜索框添加 -- zp
+ $meta_ct_page_trainform = get_meta($information->ic_id, 'meta_ct_page_trainform'); //是否插入火车票搜索框
+ $template_TrainDetailSearch = "";
+ if ($meta_ct_page_trainform == "yes" || strpos($information->ic_url, "/china-trains") !== false) {
+ $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai
+ $data_TrainCity = [];
+ $data_TrainCity["from"] = "";
+ $data_TrainCity["to"] = "";
+ if (! empty($meta_train_city)) {
+ if (strpos($meta_train_city, '|') !== false) {
+ $arrTrainCity = explode('|', $meta_train_city);
+ $data_TrainCity["from"] = $arrTrainCity[0];
+ $data_TrainCity["to"] = $arrTrainCity[1];
- //火车票详细页搜索框添加 -- zp
- $meta_ct_page_trainform = get_meta($information->ic_id, 'meta_ct_page_trainform'); //是否插入火车票搜索框
- $template_TrainDetailSearch = "";
- if ($meta_ct_page_trainform == "yes" || strpos($information->ic_url,"/china-trains")!==false) {
- $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai
- $data_TrainCity = array();
- $data_TrainCity["from"] = "";
- $data_TrainCity["to"] = "";
- if (!empty($meta_train_city)) {
- if (strpos($meta_train_city, '|') !== false) {
- $arrTrainCity = explode('|', $meta_train_city);
- $data_TrainCity["from"] = $arrTrainCity[0];
- $data_TrainCity["to"] = $arrTrainCity[1];
-
- }
- }
- $template_TrainDetailSearch = $this->load->view($template_path . '-train-index', $data_TrainCity, true);
- }
-
+ }
+ }
+ $template_TrainDetailSearch = $this->load->view($template_path . '-train-index', $data_TrainCity, true);
+ }
/* 详细内容 */
$ic_content = $information->ic_content;
/** 替换H1加面包屑,加作者 */
- $ic_content = preg_replace('/
(.*)<\/h1>/i', $crumb . "\r\n" . '$1 ' . "\r\n" . $str_author . $template_TrainDetailSearch . "\r\n", $ic_content, 1);
+ $ic_content = preg_replace('/(.*)<\/h1>/i', $crumb . "\r\n" . '$1 ' . "\r\n" . $str_author . $template_TrainDetailSearch . "\r\n", $ic_content, 1);
//图片加延迟
$ic_content = $this->html_optimize_lib->set_lazy_loader($ic_content, 'https://www.trainspread.com/images/grey.gif');
$ic_content = $this->html_optimize_lib->set_image_size($ic_content);
-
-
//非产品页面
- $data["PRODUCTJS"] = "";
- $data["ISPRODUCT"] = "no"; //判断是否是产品页
+ $data["PRODUCTJS"] = "";
+ $data["ISPRODUCT"] = "no"; //判断是否是产品页
$data["addthis_widget"] = "";
- $data["FloatIcon"] = ""; //浮动图标替代addthis
- $arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains");
+ $data["FloatIcon"] = ""; //浮动图标替代addthis
+ $arrExitUrl = ["/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains"];
if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) {
$data["FloatIcon"] = "";
@@ -4398,67 +4386,67 @@ class Information extends CI_Controller
}
//顶部视频
- $data["TOPVIDEO"] = "";
- $meta_news_video = get_meta($information->ic_id, 'meta_news_video');
+ $data["TOPVIDEO"] = "";
+ $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)) {
+ if (! empty($meta_news_video) && ! empty($meta_video_picture)) {
$data["TOPVIDEO"] = '
';
}
//主样式表,内联模式
//$apiweb="http://202.103.68.104:71"; //本地测试
- $apiweb = "https://www.trainspread.com";
- $cssUrl = $apiweb . "/css/base.css?v=" . time();
+ $apiweb = "https://www.trainspread.com";
+ $cssUrl = $apiweb . "/css/base.css?v=" . time();
$main_css_string = compress_css(GET_HTTP($cssUrl));
$data["MAINCSS"] = '';
//额外样式
$data["ADDONCSS"] = "";
- $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
- if (!empty($meta_addon_css)) {
+ $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
+ if (! empty($meta_addon_css)) {
//引用方式
//$data["ADDONCSS"]= ' ';
//内联方式
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
- $data["ADDONCSS"] = '';
+ $data["ADDONCSS"] = '';
}
//社媒分享图片
- $data["OGIMAGE"] = "";
+ $data["OGIMAGE"] = "";
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
- if (!empty($information->ic_photo)) {
+ if (! empty($information->ic_photo)) {
// if (strpos($information->ic_photo, "trainspread.com") != false) {
// $full_ic_photo = $information->ic_photo;
// } else {
// $full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo;
// }
- $full_ic_photo = $information->ic_photo;
+ $full_ic_photo = $information->ic_photo;
$data["OGIMAGE"] = ' ';
- }else if (!empty($meta_addon_picture)){
+ } else if (! empty($meta_addon_picture)) {
// if (strpos($meta_addon_picture, "trainspread.com") != false) {
// $full_ic_photo = $meta_addon_picture;
// } else {
// $full_ic_photo = $this->config->item('site_image_url') . $meta_addon_picture;
// }
- $full_ic_photo = $meta_addon_picture;
+ $full_ic_photo = $meta_addon_picture;
$data["OGIMAGE"] = ' ';
}
//结构化标签
$data["ConstructionCode"] = "";
- $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
- if (!empty($meta_construction_code)) {
+ $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
+ if (! empty($meta_construction_code)) {
$data["ConstructionCode"] = $meta_construction_code;
}
- $data["meta_index_set"]="";
- $meta_index_set = get_meta($information->ic_id, 'meta_index_set');
- if (!empty($meta_index_set)) {
+ $data["meta_index_set"] = "";
+ $meta_index_set = get_meta($information->ic_id, 'meta_index_set');
+ if (! empty($meta_index_set)) {
$data["meta_index_set"] = ' ';
}
//总JS:为了方便以后js好维护,必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js,所以必须在这里进行判断
- $addBaseJs = false;
- $addonJs = "";
+ $addBaseJs = false;
+ $addonJs = "";
$meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
if ($meta_ct_page_price == "yes") {
@@ -4474,8 +4462,8 @@ class Information extends CI_Controller
//额外js
$data["ADDONJS"] = "";
- $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
- if (!empty($meta_addon_js)) {
+ $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
+ if (! empty($meta_addon_js)) {
$addonJs .= '';
}
//价格js
@@ -4484,22 +4472,22 @@ class Information extends CI_Controller
}
//列表js
- if (in_array($meta_ct_page_type, array('daytripindex', 'tourindex', 'attractionindex'))) {
+ if (in_array($meta_ct_page_type, ['daytripindex', 'tourindex', 'attractionindex'])) {
$addonJs .= '';
}
//天气
- if (in_array($meta_ct_page_type, array('weatherpage'))) {
+ if (in_array($meta_ct_page_type, ['weatherpage'])) {
$addonJs .= '';
}
//页面传递参数
$passParam = "";
- if (in_array($meta_ct_page_type, array("daytripindex", "tourindex", "attractionindex", "weatherpage"))) { //一日游和线路列表
- //产品首页
+ if (in_array($meta_ct_page_type, ["daytripindex", "tourindex", "attractionindex", "weatherpage"])) { //一日游和线路列表
+ //产品首页
$meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value');
- if (in_array($meta_ct_page_type, array("attractionindex"))) {
+ if (in_array($meta_ct_page_type, ["attractionindex"])) {
//旧信息id,景点等信息类
$passParam .= ' ';
} else {
@@ -4516,11 +4504,11 @@ class Information extends CI_Controller
$productCode = "";
if ($meta_ct_page_type == "daytripdetail") {
//一日游
- if (!empty($meta_ct_page_type)) {
+ if (! empty($meta_ct_page_type)) {
$productType = $meta_ct_page_type;
}
$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;
}
$addonJs .= '';
@@ -4532,26 +4520,25 @@ class Information extends CI_Controller
}
if ($meta_ct_page_type == "tourdetail") {
//线路
- $productType = $meta_ct_page_type;
+ $productType = $meta_ct_page_type;
$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;
}
//获取cli_sn
- $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apibj/getCliSn/?param=" . $productCode));
+ $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apibj/getCliSn/?param=" . $productCode));
$data["clisn"] = $tourdata->clisn;
//调取模板
$dataform["TourCode"] = $productCode;
- $dataform["CLI_SN"] = $tourdata->clisn;
+ $dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
-
}
//表单页
- if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform", "tourdetail"))) {
+ if (in_array($meta_ct_page_type, ["customize", "contactus", "pagewithform", "tourdetail"])) {
$productType = $meta_ct_page_type;
$addonJs .= '';
$data["ADDONCSS"] .= ' ';
@@ -4568,7 +4555,7 @@ class Information extends CI_Controller
$data["productCode"] = $productCode;
//页面添加的元素
- $data["ADDONJS"] = $addonJs;
+ $data["ADDONJS"] = $addonJs;
$data["passParam"] = $passParam;
//页面详细内容放最后,这样上面都可以进行内容的替换,比如一日游表单
@@ -4577,27 +4564,27 @@ class Information extends CI_Controller
#endregion
#region 移动端和PC端差别处理区域
- $arrDevice = array("mobile", "pc");
+ $arrDevice = ["mobile", "pc"];
foreach ($arrDevice as $device) {
//顶部全屏大图
- $data["TOPBANNER"] = "";
- $ImgText = ""; //图文字
- $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
+ $data["TOPBANNER"] = "";
+ $ImgText = ""; //图文字
+ $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
$meta_addon_picture_text = get_meta($information->ic_id, 'meta_addon_picture_text');
if ($device == 'mobile') { //移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
- $bannerImg = ' ';
- if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
+ $bannerImg = ' ';
+ if (! empty($meta_addon_picture_url) && ! empty($meta_addon_picture_text)) {
$ImgText = '';
- } else if (!empty($meta_addon_picture_text)) {
+ } else if (! empty($meta_addon_picture_text)) {
$ImgText = '' . $meta_addon_picture_text . '
';
}
} else {
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
- $bannerImg = ' ';
- if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
+ $bannerImg = ' ';
+ if (! empty($meta_addon_picture_url) && ! empty($meta_addon_picture_text)) {
$ImgText = '';
- } else if (!empty($meta_addon_picture_text)) {
+ } else if (! empty($meta_addon_picture_text)) {
$ImgText = '' . $meta_addon_picture_text . '
';
}
}
@@ -4607,209 +4594,205 @@ class Information extends CI_Controller
if ($information->ic_url == "/" || $information->ic_url == "/test" || $information->ic_url == "/china-trains") {
//火车票首页
$template_TrainSearch = $this->load->view($template_path . '-train-index', null, true);
- $ImgText = "";
+ $ImgText = "";
//火车票移动端去掉头部图片,保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
- $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
+ $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
}
} else if ($information->ic_url == "/china-flights") {
//机票首页
$template_TrainSearch = $this->load->view($template_path . '-flight-index', null, true);
- $ImgText = "";
+ $ImgText = "";
//飞机票移动端去掉头部图片,保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
- $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
+ $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
}
}
-
- if ($meta_ct_page_type == "daytripdetail") { //一日游产品的表单处理放这里,根据PC和移动端有所区别
+ if ($meta_ct_page_type == "daytripdetail") { //一日游产品的表单处理放这里,根据PC和移动端有所区别
$DayTripData['device'] = $device;
/**替换左右结构的线路表单标签 2024-7-4*/
if (strpos($ic_content, '') !== false) {
//准备数据
- $DayTripData["productCode"] = $productCode;
+ $DayTripData["productCode"] = $productCode;
$DayTripData["picture_mobile"] = get_meta($information->ic_id, 'meta_addon_picture_mobile');
- $DayTripData["picture_pc"] = get_meta($information->ic_id, 'meta_addon_picture');
- $DayTripData["TITLE"] = $information->ic_title;
+ $DayTripData["picture_pc"] = get_meta($information->ic_id, 'meta_addon_picture');
+ $DayTripData["TITLE"] = $information->ic_title;
//成人,儿童,婴儿的年龄显示信息
$AdultMsg = $this->infoBokunData_model->getBokunMetaList($information->ic_id, "AdultMsg");
if ($AdultMsg) {
- foreach ($AdultMsg as $AdultMsgItem) {
- $DayTripData["AdultMsg"] = $AdultMsgItem->ibd_Itemvalue;
- }
+ foreach ($AdultMsg as $AdultMsgItem) {
+ $DayTripData["AdultMsg"] = $AdultMsgItem->ibd_Itemvalue;
+ }
} else {
- $DayTripData["AdultMsg"] = null;
+ $DayTripData["AdultMsg"] = null;
}
$ChildMsg = $this->infoBokunData_model->getBokunMetaList($information->ic_id, "ChildMsg");
if ($ChildMsg) {
- foreach ($ChildMsg as $ChildMsgItem) {
- $DayTripData["ChildMsg"] = $ChildMsgItem->ibd_Itemvalue;
- }
+ foreach ($ChildMsg as $ChildMsgItem) {
+ $DayTripData["ChildMsg"] = $ChildMsgItem->ibd_Itemvalue;
+ }
} else {
- $DayTripData["ChildMsg"] = null;
+ $DayTripData["ChildMsg"] = null;
}
$InfantMsg = $this->infoBokunData_model->getBokunMetaList($information->ic_id, "InfantMsg");
if ($InfantMsg) {
- foreach ($InfantMsg as $InfantMsgItem) {
- $DayTripData["InfantMsg"] = $InfantMsgItem->ibd_Itemvalue;
- }
+ foreach ($InfantMsg as $InfantMsgItem) {
+ $DayTripData["InfantMsg"] = $InfantMsgItem->ibd_Itemvalue;
+ }
} else {
- $DayTripData["InfantMsg"] = null;
+ $DayTripData["InfantMsg"] = null;
}
//有些接送没有对应的成人及儿童只有一个Other
$Other_Msg = $this->infoBokunData_model->getBokunMetaList($information->ic_id, "Other_Msg");
if ($Other_Msg) {
- foreach ($Other_Msg as $Other_MsgItem) {
- $DayTripData["Other_Msg"] = $Other_MsgItem->ibd_Itemvalue;
- }
+ foreach ($Other_Msg as $Other_MsgItem) {
+ $DayTripData["Other_Msg"] = $Other_MsgItem->ibd_Itemvalue;
+ }
} else {
- $DayTripData["Other_Msg"] = null;
+ $DayTripData["Other_Msg"] = null;
}
- $InfoData = new stdClass(); //传递用来计算的信息平台数据
- $MinTravelers = get_meta($information->ic_id, 'meta_trippest_limitperson');
+ $InfoData = new stdClass(); //传递用来计算的信息平台数据
+ $MinTravelers = get_meta($information->ic_id, 'meta_trippest_limitperson');
$InfoData->MinTravelers = $MinTravelers == null ? 0 : $MinTravelers;
//选项一
- $TsOption1 = get_meta($information->ic_id, 'meta_trainspread_option1');
- $InfoData->Option1 = new stdClass();
- if ( $TsOption1 != false ){
+ $TsOption1 = get_meta($information->ic_id, 'meta_trainspread_option1');
+ $InfoData->Option1 = new stdClass();
+ if ($TsOption1 != false) {
$arrOption = explode(",", $TsOption1);
- $arrItem = array();
- $num = count($arrOption);
+ $arrItem = [];
+ $num = count($arrOption);
for ($i = 0; $i < $num; $i++) {
- if ($i==0){
+ if ($i == 0) {
$InfoData->Option1->OptionName = $arrOption[$i];
- }else{
- $arrItemClass = new stdClass();
- $arrItemClass->id = $i-1;
+ } else {
+ $arrItemClass = new stdClass();
+ $arrItemClass->id = $i - 1;
$arrItemClass->value = $arrOption[$i];
- $arrItem[$i-1] = $arrItemClass;
+ $arrItem[$i - 1] = $arrItemClass;
}
}
$InfoData->Option1->ItemList = $arrItem;
- }else{
+ } else {
$InfoData->Option1 = $TsOption1;
}
//Package
- $TsPackage = get_meta($information->ic_id, 'meta_trippest_package');
+ $TsPackage = get_meta($information->ic_id, 'meta_trippest_package');
$InfoData->Package = new stdClass();
- if ($TsPackage!=false){
+ if ($TsPackage != false) {
$arrOption = explode("|", $TsPackage);
- $arrItem = array();
- $num = count($arrOption);
+ $arrItem = [];
+ $num = count($arrOption);
for ($i = 0; $i < $num; $i++) {
- if ($i==0){
+ if ($i == 0) {
$InfoData->Package->PackageName = $arrOption[$i];
- }
- else{
+ } else {
$arr_Item = explode(",", $arrOption[$i]);
- for ($j=0;$jid = $i;
- $arrItemClass->ItemName = $arr_Item[0];
+ for ($j = 0; $j < count($arr_Item); $j++) {
+ $arrItemClass = new stdClass();
+ $arrItemClass->id = $i;
+ $arrItemClass->ItemName = $arr_Item[0];
$arrItemClass->ItemAdult = $arr_Item[1];
$arrItemClass->ItemChild = $arr_Item[2];
- $arrItem[$i-1] = $arrItemClass;
+ $arrItem[$i - 1] = $arrItemClass;
}
}
}
$InfoData->Package->ItemList = $arrItem;
- }else{
- $InfoData->Package = $TsPackage;
+ } else {
+ $InfoData->Package = $TsPackage;
}
//选项二
- $TsOption2 = get_meta($information->ic_id, 'meta_trainspread_option2');
+ $TsOption2 = get_meta($information->ic_id, 'meta_trainspread_option2');
$InfoData->Option2 = new stdClass();
- if ( $TsOption2 != false ){
+ if ($TsOption2 != false) {
$arrOption = explode(",", $TsOption2);
- $arrItem = array();
- $num = count($arrOption);
+ $arrItem = [];
+ $num = count($arrOption);
for ($i = 0; $i < $num; $i++) {
- if ($i==0){
+ if ($i == 0) {
$InfoData->Option2->OptionName = $arrOption[$i];
- }else{
- $arrItemClass = new stdClass();
- $arrItemClass->id = $i-1;
+ } else {
+ $arrItemClass = new stdClass();
+ $arrItemClass->id = $i - 1;
$arrItemClass->value = $arrOption[$i];
- $arrItem[$i-1] = $arrItemClass;
+ $arrItem[$i - 1] = $arrItemClass;
}
}
$InfoData->Option2->ItemList = $arrItem;
- }else{
+ } else {
$InfoData->Option2 = $TsOption2;
}
-
- //附加选项
+ //附加选项
$t_Type = get_meta($information->ic_id, "meta_trippest_type"); //产品类型
if ($t_Type) {
- $InfoData->t_Type = $t_Type;
+ $InfoData->t_Type = $t_Type;
} else {
- $InfoData->t_Type = "general";
+ $InfoData->t_Type = "general";
}
- $t_excludedate = get_meta($information->ic_id, "meta_trippest_excludedate");
- $t_includedate = get_meta($information->ic_id, "meta_trippest_includedate");
- $t_excludemonth = get_meta($information->ic_id, "meta_trippest_excludemonth");
- $InfoData->t_excludedate = $t_excludedate;
- $InfoData->t_includedate = $t_includedate;
+ $t_excludedate = get_meta($information->ic_id, "meta_trippest_excludedate");
+ $t_includedate = get_meta($information->ic_id, "meta_trippest_includedate");
+ $t_excludemonth = get_meta($information->ic_id, "meta_trippest_excludemonth");
+ $InfoData->t_excludedate = $t_excludedate;
+ $InfoData->t_includedate = $t_includedate;
$InfoData->t_excludemonth = $t_excludemonth;
$InfoData->t_hoteladdress = get_meta($information->ic_id, "meta_trippest_hoteladdress");
- $InfoData->t_defaultDate = get_meta($information->ic_id, "meta_trippest_defaultDate");
+ $InfoData->t_defaultDate = get_meta($information->ic_id, "meta_trippest_defaultDate");
$t_Cancellation = get_meta($information->ic_id, "meta_trainspread_Cancellation"); //取消条款类型
if ($t_Cancellation) {
$InfoData->t_Cancellation = $t_Cancellation;
- }else{
+ } else {
$InfoData->t_Cancellation = "";
}
$t_CustomCancel = get_meta($information->ic_id, "meta_trainspread_CustomCancel");
- if ($t_CustomCancel){
+ if ($t_CustomCancel) {
$InfoData->t_CustomCancelText = $t_CustomCancel;
- }else{
+ } else {
$InfoData->t_CustomCancelText = "";
}
-
- $DayTripData["InfoData"] = $InfoData; //传递信息平台数据
+ $DayTripData["InfoData"] = $InfoData; //传递信息平台数据
$linktour = get_meta($information->ic_id, 'meta_trainspread_linktour'); //关联线路
- if (!empty($linktour)){
- $paramCode = $productCode.",".$linktour;
- }else{
+ if (! empty($linktour)) {
+ $paramCode = $productCode . "," . $linktour;
+ } else {
$paramCode = $productCode;
}
//产品汉特信息,测试地址:http://202.103.68.104:61/info.php/thirdparty/ctmobilefirst/apits/getDaytripDetail/?param=TS-HKALC-1,TS-HKALC-2,TS-HKALC-3
- $TourData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apits/getDaytripDetail/?param=" . $paramCode));
+ $TourData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apits/getDaytripDetail/?param=" . $paramCode));
$DayTripData["TourData"] = $TourData;
$TourPrice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apits/getDaytripsPrice/?param=" . $productCode));
- if ($TourPrice->status == "ok"){
+ if ($TourPrice->status == "ok") {
+ $DayTripData["DaytripPrice"] = $TourPrice->price;
+ } else {
+ $TourPrice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apits/getDaytripsPrice/?param=" . $productCode . ",3"));
$DayTripData["DaytripPrice"] = $TourPrice->price;
- }else{
- $TourPrice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apits/getDaytripsPrice/?param=" . $productCode.",3"));
- $DayTripData["DaytripPrice"] = $TourPrice->price;
}
- //替换模板
- $TS_DayTripContent = $ic_content; //因为需要替换,所以要转给零时变量。不然手机端替换完了,PC端就没有了。
+ //替换模板
+ $TS_DayTripContent = $ic_content; //因为需要替换,所以要转给零时变量。不然手机端替换完了,PC端就没有了。
$template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
- $TS_DayTripContent = str_replace('', $template_form_daydetail, $TS_DayTripContent);
- $data["CUSTOMCONENT"] = $TS_DayTripContent;
+ $TS_DayTripContent = str_replace('', $template_form_daydetail, $TS_DayTripContent);
+ $data["CUSTOMCONENT"] = $TS_DayTripContent;
}
- }else{
+ } else {
//一日游产品有自己的图片展示效果
- if (!empty($meta_addon_picture)) {
- if (!empty($meta_addon_picture_url)) {
+ if (! empty($meta_addon_picture)) {
+ if (! empty($meta_addon_picture_url)) {
$data["TOPBANNER"] = '';
} else {
$data["TOPBANNER"] = '' . $bannerImg . $ImgText . $template_TrainSearch . '
';
@@ -4819,27 +4802,27 @@ class Information extends CI_Controller
//两种设备分别调用两种模板 ,静态化
switch ($device) {
- case 'mobile':
- //获取移动优先的模板,如果有的话
- $template_path = 'mobile_first/' . $this->config->item('site_code');
- if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
- $template = $this->load->view($template_path, $data, 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', $data, true);
- $html_path_ext = '-pc.htm';
- } else {
- return false;
- }
- break;
- default:
+ case 'mobile':
+ //获取移动优先的模板,如果有的话
+ $template_path = 'mobile_first/' . $this->config->item('site_code');
+ if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
+ $template = $this->load->view($template_path, $data, 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', $data, true);
+ $html_path_ext = '-pc.htm';
+ } else {
+ return false;
+ }
+ break;
+ default:
}
//生成静态文件
@@ -4858,25 +4841,25 @@ class Information extends CI_Controller
/**
* 桂林站 www.guilinchina.net
*/
- public function make_www_cache_gl($information){
- $data = array();
+ public function make_www_cache_gl($information) {
+ $data = [];
- #region 公用数据
- //$apiurl = "http://202.103.68.104:88/info.php"; //本地测试
+ #region 公用数据
+ //$apiurl = "http://202.103.68.104:88/info.php"; //本地测试
$apiurl = "https://ct.mycht.cn/info.php"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
- $data["TITLE"] = $information->ic_seo_title;
+ $data["TITLE"] = $information->ic_seo_title;
$data["DESCRIPTION"] = $information->ic_seo_description;
- $data["KEYWORDS"] = $information->ic_seo_keywords;
- $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
- $meta_ct_page_type = "";
- $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
- $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
- $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
+ $data["KEYWORDS"] = $information->ic_seo_keywords;
+ $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
+ $meta_ct_page_type = "";
+ $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
+ $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
+ $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
//面包屑
- $crumb = "";
+ $crumb = "";
$crumb_data = $this->Information_model->get_path_exclude_ct($information->is_id, $information->is_path);
if (count($crumb_data) > 0) { //至少有一个父类面包屑才显示
$crumb = "Home ";
@@ -4889,53 +4872,51 @@ class Information extends CI_Controller
//作者字符串,信息页或者城市天气页加载 2022-7-26
$str_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") {
- $OPI_FirstName = !empty($author) ? $author->OPI_FirstName : 'author nickname';
- $str_author = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
+ $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") {
+ $OPI_FirstName = ! empty($author) ? $author->OPI_FirstName : 'author nickname';
+ $str_author = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
}
- //火车票详细页搜索框添加 -- zp
- $meta_ct_page_trainform = get_meta($information->ic_id, 'meta_ct_page_trainform'); //是否插入火车票搜索框
+ //火车票详细页搜索框添加 -- zp
+ $meta_ct_page_trainform = get_meta($information->ic_id, 'meta_ct_page_trainform'); //是否插入火车票搜索框
$template_TrainDetailSearch = "";
- if ($meta_ct_page_trainform == "yes" || strpos($information->ic_url,"/china-trains")!==false) {
- $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai
- $data_TrainCity = array();
+ if ($meta_ct_page_trainform == "yes" || strpos($information->ic_url, "/china-trains") !== false) {
+ $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai
+ $data_TrainCity = [];
$data_TrainCity["from"] = "";
- $data_TrainCity["to"] = "";
- if (!empty($meta_train_city)) {
+ $data_TrainCity["to"] = "";
+ if (! empty($meta_train_city)) {
if (strpos($meta_train_city, '|') !== false) {
- $arrTrainCity = explode('|', $meta_train_city);
+ $arrTrainCity = explode('|', $meta_train_city);
$data_TrainCity["from"] = $arrTrainCity[0];
- $data_TrainCity["to"] = $arrTrainCity[1];
+ $data_TrainCity["to"] = $arrTrainCity[1];
}
}
$template_TrainDetailSearch = $this->load->view($template_path . '-train-index', $data_TrainCity, true);
}
-
-
/* 详细内容 */
$ic_content = $information->ic_content;
/** 替换H1加面包屑,加作者 */
- $ic_content = preg_replace('/
(.*)<\/h1>/i', $crumb . "\r\n" . '$1 ' . "\r\n" . $str_author . $template_TrainDetailSearch . "\r\n", $ic_content, 1);
+ $ic_content = preg_replace('/(.*)<\/h1>/i', $crumb . "\r\n" . '$1 ' . "\r\n" . $str_author . $template_TrainDetailSearch . "\r\n", $ic_content, 1);
// 动态加载反馈标签,按城市出前三条。左侧
// HTLM:
,显示全部用
// 解析结果:; Shanghai,Beijing
$feedback_array = [];
preg_match_all('^^', $information->ic_content, $feedback_array);
- if (!empty($feedback_array)) {
+ if (! empty($feedback_array)) {
foreach ($feedback_array[0] as $index => $tag_name) {
$city_name_string = $feedback_array[1][$index];
- $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string,30);
+ $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string, 30);
// 防止触发 Google 网络垃圾政策只返回前三条
$top3_feedback_list = array_slice($feedback_list, 0, 3);
- $feedback_content = $this->load->view(
+ $feedback_content = $this->load->view(
'mobile_first/chinatravel-feedback-list',
- array('feedback_list' => $top3_feedback_list),
+ ['feedback_list' => $top3_feedback_list],
true
);
$ic_content = str_replace(
@@ -4951,15 +4932,15 @@ class Information extends CI_Controller
// 解析结果:; Shanghai,Beijing
$feedback_array = [];
preg_match_all('^^', $information->ic_content, $feedback_array);
- if (!empty($feedback_array)) {
+ if (! empty($feedback_array)) {
foreach ($feedback_array[0] as $index => $tag_name) {
$city_name_string = $feedback_array[1][$index];
- $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string,30);
+ $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string, 30);
// 防止触发 Google 网络垃圾政策只返回前三条
$top3_feedback_list = array_slice($feedback_list, 0, 3);
- $feedback_content = $this->load->view(
+ $feedback_content = $this->load->view(
'mobile_first/chinatravel-feedback-cross',
- array('feedback_list' => $top3_feedback_list),
+ ['feedback_list' => $top3_feedback_list],
true
);
$ic_content = str_replace(
@@ -4975,14 +4956,12 @@ class Information extends CI_Controller
$ic_content = $this->html_optimize_lib->set_image_size($ic_content);
-
-
//非产品页面
- $data["PRODUCTJS"] = "";
- $data["ISPRODUCT"] = "no"; //判断是否是产品页
+ $data["PRODUCTJS"] = "";
+ $data["ISPRODUCT"] = "no"; //判断是否是产品页
$data["addthis_widget"] = "";
- $data["FloatIcon"] = ""; //浮动图标替代addthis
- $arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains");
+ $data["FloatIcon"] = ""; //浮动图标替代addthis
+ $arrExitUrl = ["/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains"];
if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) {
$data["FloatIcon"] = "";
@@ -4991,33 +4970,33 @@ class Information extends CI_Controller
}
//顶部视频
- $data["TOPVIDEO"] = "";
- $meta_news_video = get_meta($information->ic_id, 'meta_news_video');
+ $data["TOPVIDEO"] = "";
+ $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)) {
+ if (! empty($meta_news_video) && ! empty($meta_video_picture)) {
$data["TOPVIDEO"] = '
';
}
//主样式表,内联模式
//$apiweb="http://202.103.68.104:88"; //本地测试
- $apiweb = "https://data.guilinchina.net";
- $cssUrl = $apiweb . "/css/css3/base.css?v=" . time();
+ $apiweb = "https://data.guilinchina.net";
+ $cssUrl = $apiweb . "/css/css3/base.css?v=" . time();
$main_css_string = compress_css(GET_HTTP($cssUrl));
$data["MAINCSS"] = '';
//额外样式
$data["ADDONCSS"] = "";
- $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
- if (!empty($meta_addon_css)) {
+ $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
+ if (! empty($meta_addon_css)) {
//引用方式
//$data["ADDONCSS"]= ' ';
//内联方式
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
- $data["ADDONCSS"] = '';
+ $data["ADDONCSS"] = '';
}
//社媒分享图片
$data["OGIMAGE"] = "";
- if (!empty($information->ic_photo)) {
+ if (! empty($information->ic_photo)) {
if (strpos($information->ic_photo, "guilinchina.net") != false) {
$full_ic_photo = $information->ic_photo;
} else {
@@ -5028,14 +5007,14 @@ class Information extends CI_Controller
//结构化标签
$data["ConstructionCode"] = "";
- $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
- if (!empty($meta_construction_code)) {
+ $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
+ if (! empty($meta_construction_code)) {
$data["ConstructionCode"] = $meta_construction_code;
}
//总JS:为了方便以后js好维护,必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js,所以必须在这里进行判断
- $addBaseJs = false;
- $addonJs = "";
+ $addBaseJs = false;
+ $addonJs = "";
$meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
if ($meta_ct_page_price == "yes") {
@@ -5051,8 +5030,8 @@ class Information extends CI_Controller
//额外js
$data["ADDONJS"] = "";
- $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
- if (!empty($meta_addon_js)) {
+ $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
+ if (! empty($meta_addon_js)) {
$addonJs .= '';
}
//价格js
@@ -5065,22 +5044,22 @@ class Information extends CI_Controller
}
//列表js
- if (in_array($meta_ct_page_type, array('daytripindex', 'tourindex', 'attractionindex'))) {
+ if (in_array($meta_ct_page_type, ['daytripindex', 'tourindex', 'attractionindex'])) {
$addonJs .= '';
}
//天气
- if (in_array($meta_ct_page_type, array('weatherpage'))) {
+ if (in_array($meta_ct_page_type, ['weatherpage'])) {
$addonJs .= '';
}
//页面传递参数
$passParam = "";
- if (in_array($meta_ct_page_type, array("daytripindex", "tourindex", "attractionindex", "weatherpage"))) { //一日游和线路列表
- //产品首页
+ if (in_array($meta_ct_page_type, ["daytripindex", "tourindex", "attractionindex", "weatherpage"])) { //一日游和线路列表
+ //产品首页
$meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value');
- if (in_array($meta_ct_page_type, array("attractionindex"))) {
+ if (in_array($meta_ct_page_type, ["attractionindex"])) {
//旧信息id,景点等信息类
$passParam .= ' ';
} else {
@@ -5097,11 +5076,11 @@ class Information extends CI_Controller
$productCode = "";
if ($meta_ct_page_type == "daytripdetail") {
//一日游
- if (!empty($meta_ct_page_type)) {
+ if (! empty($meta_ct_page_type)) {
$productType = $meta_ct_page_type;
}
$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;
}
$addonJs .= '';
@@ -5110,36 +5089,34 @@ class Information extends CI_Controller
//一日游表单的替换
$DayTripData["productCode"] = $productCode;
- $template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
- //使用simple_html_dom_lib库来进行表单添加
+ $template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
+ //使用simple_html_dom_lib库来进行表单添加
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, "#maincontent", $template_form_daydetail);
}
if ($meta_ct_page_type == "tourdetail") {
//线路
- $productType = $meta_ct_page_type;
+ $productType = $meta_ct_page_type;
$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;
}
//获取cli_sn
- $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getCliSn/?param=" . $productCode."&webcode=guilin"));
+ $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getCliSn/?param=" . $productCode . "&webcode=guilin"));
$data["clisn"] = $tourdata->clisn;
-
//获取price
- $tourprice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourPrice/?param=" . $productCode."&webcode=guilin"));
+ $tourprice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourPrice/?param=" . $productCode . "&webcode=guilin"));
$dataform["tourprice"] = $tourprice->price;
//调取模板
$dataform["TourCode"] = $productCode;
- $dataform["CLI_SN"] = $tourdata->clisn;
+ $dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
}
-
//表单页
- if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform", "tourdetail"))) {
+ if (in_array($meta_ct_page_type, ["customize", "contactus", "pagewithform", "tourdetail"])) {
$productType = $meta_ct_page_type;
$addonJs .= '';
$data["ADDONCSS"] .= ' ';
@@ -5155,7 +5132,7 @@ class Information extends CI_Controller
$data["productCode"] = $productCode;
//页面添加的元素
- $data["ADDONJS"] = $addonJs;
+ $data["ADDONJS"] = $addonJs;
$data["passParam"] = $passParam;
//页面详细内容放最后,这样上面都可以进行内容的替换,比如一日游表单
@@ -5164,27 +5141,27 @@ class Information extends CI_Controller
#endregion
#region 移动端和PC端差别处理区域
- $arrDevice = array("mobile", "pc");
+ $arrDevice = ["mobile", "pc"];
foreach ($arrDevice as $device) {
//顶部全屏大图
- $data["TOPBANNER"] = "";
- $ImgText = ""; //图文字
- $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
+ $data["TOPBANNER"] = "";
+ $ImgText = ""; //图文字
+ $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
$meta_addon_picture_text = get_meta($information->ic_id, 'meta_addon_picture_text');
if ($device == 'mobile') { //移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
- $bannerImg = ' ';
- if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
+ $bannerImg = ' ';
+ if (! empty($meta_addon_picture_url) && ! empty($meta_addon_picture_text)) {
$ImgText = '';
- } else if (!empty($meta_addon_picture_text)) {
+ } else if (! empty($meta_addon_picture_text)) {
$ImgText = '' . $meta_addon_picture_text . '
';
}
} else {
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
- $bannerImg = ' ';
- if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) {
+ $bannerImg = ' ';
+ if (! empty($meta_addon_picture_url) && ! empty($meta_addon_picture_text)) {
$ImgText = '';
- } else if (!empty($meta_addon_picture_text)) {
+ } else if (! empty($meta_addon_picture_text)) {
$ImgText = '' . $meta_addon_picture_text . '
';
}
}
@@ -5194,62 +5171,61 @@ class Information extends CI_Controller
if ($information->ic_url == "/china-trains/hometest" || $information->ic_url == "/trains") {
//火车票首页
$template_TrainSearch = $this->load->view($template_path . '-train-index', null, true);
- $ImgText = "";
+ $ImgText = "";
//火车票移动端去掉头部图片,保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
- $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
+ $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
}
} else if ($information->ic_url == "/china-flights") {
//机票首页
$template_TrainSearch = $this->load->view($template_path . '-flight-index', null, true);
- $ImgText = "";
+ $ImgText = "";
//飞机票移动端去掉头部图片,保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
- $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
+ $data["TOPBANNER"] = '' . $template_TrainSearch . '
';
}
}
- if (!empty($meta_addon_picture)) {
- if (!empty($meta_addon_picture_url)) {
+ if (! empty($meta_addon_picture)) {
+ if (! empty($meta_addon_picture_url)) {
$data["TOPBANNER"] = '';
} else {
$data["TOPBANNER"] = '' . $bannerImg . $ImgText . $template_TrainSearch . '
';
}
}
-
if ($meta_ct_page_type == "tourdetail") { //线路表单,左右结构,用标签来做
- $dataform['device'] = $device;
+ $dataform['device'] = $device;
$template_form_tourqi = $this->load->view($template_path . '-form-tourqi-new', $dataform, true);
- $ic_content = str_replace('', $template_form_tourqi, $ic_content);
+ $ic_content = str_replace('', $template_form_tourqi, $ic_content);
$data["CUSTOMCONENT"] = $ic_content;
}
//两种设备分别调用两种模板 ,静态化
switch ($device) {
- case 'mobile':
- //获取移动优先的模板,如果有的话
- $template_path = 'mobile_first/' . $this->config->item('site_code');
- if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
- $template = $this->load->view($template_path, $data, 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', $data, true);
- $html_path_ext = '-pc.htm';
- } else {
- return false;
- }
- break;
- default:
+ case 'mobile':
+ //获取移动优先的模板,如果有的话
+ $template_path = 'mobile_first/' . $this->config->item('site_code');
+ if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
+ $template = $this->load->view($template_path, $data, 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', $data, true);
+ $html_path_ext = '-pc.htm';
+ } else {
+ return false;
+ }
+ break;
+ default:
}
//生成静态文件
@@ -5268,22 +5244,22 @@ class Information extends CI_Controller
/**
* 花梨鹰网站 www.hualiyingtravel.com的静态化
*/
- public function make_www_cache_hly($information){
- $data = array();
+ public function make_www_cache_hly($information) {
+ $data = [];
- #region 公用数据
- //$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
+ #region 公用数据
+ //$apiurl = "http://202.103.68.104:61/info.php"; //本地测试
$apiurl = "https://ct.mycht.cn/info.php"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
- $data["TITLE"] = $information->ic_seo_title;
+ $data["TITLE"] = $information->ic_seo_title;
$data["DESCRIPTION"] = $information->ic_seo_description;
- $data["KEYWORDS"] = $information->ic_seo_keywords;
- $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
- $meta_ct_page_type = "";
- $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
- $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
- $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
+ $data["KEYWORDS"] = $information->ic_seo_keywords;
+ $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url;
+ $meta_ct_page_type = "";
+ $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
+ $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号
+ $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置
//面包屑
$crumb = "";
@@ -5299,32 +5275,29 @@ class Information extends CI_Controller
//作者字符串,信息页或者城市天气页加载 2022-7-26
$str_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") {
- $OPI_FirstName = !empty($author) ? $author->OPI_FirstName : 'author nickname';
- $str_author = 'Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
+ $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") {
+ $OPI_FirstName = ! empty($author) ? $author->OPI_FirstName : 'author nickname';
+ $str_author = 'Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
}
-
/* 详细内容 */
$ic_content = $information->ic_content;
/** 替换H1加面包屑,加作者 */
- $ic_content = preg_replace('/(.*)<\/h1>/i', $crumb . "\r\n" . '$1 ' . "\r\n" . $str_author . "\r\n", $ic_content, 1);
+ $ic_content = preg_replace('/(.*)<\/h1>/i', $crumb . "\r\n" . '$1 ' . "\r\n" . $str_author . "\r\n", $ic_content, 1);
//图片加延迟
$ic_content = $this->html_optimize_lib->set_lazy_loader($ic_content, 'https://data.hualiyingtravel.com/image/grey.gif');
$ic_content = $this->html_optimize_lib->set_image_size($ic_content);
-
-
//非产品页面
- $data["PRODUCTJS"] = "";
- $data["ISPRODUCT"] = "no"; //判断是否是产品页
+ $data["PRODUCTJS"] = "";
+ $data["ISPRODUCT"] = "no"; //判断是否是产品页
$data["addthis_widget"] = "";
- $data["FloatIcon"] = ""; //浮动图标替代addthis
- $arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains");
+ $data["FloatIcon"] = ""; //浮动图标替代addthis
+ $arrExitUrl = ["/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains"];
if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) {
$data["FloatIcon"] = "";
@@ -5333,33 +5306,33 @@ class Information extends CI_Controller
}
//顶部视频
- $data["TOPVIDEO"] = "";
- $meta_news_video = get_meta($information->ic_id, 'meta_news_video');
+ $data["TOPVIDEO"] = "";
+ $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)) {
+ if (! empty($meta_news_video) && ! empty($meta_video_picture)) {
$data["TOPVIDEO"] = '
';
}
//主样式表,内联模式
//$apiweb="http://202.103.68.104:97"; //本地测试
- $apiweb = "https://data.hualiyingtravel.com";
- $cssUrl = $apiweb . "/css/css3/base.css?v=" . time();
+ $apiweb = "https://data.hualiyingtravel.com";
+ $cssUrl = $apiweb . "/css/css3/base.css?v=" . time();
$main_css_string = compress_css(GET_HTTP($cssUrl));
$data["MAINCSS"] = '';
//额外样式
$data["ADDONCSS"] = "";
- $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
- if (!empty($meta_addon_css)) {
+ $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
+ if (! empty($meta_addon_css)) {
//引用方式
//$data["ADDONCSS"]= ' ';
//内联方式
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
- $data["ADDONCSS"] = '';
+ $data["ADDONCSS"] = '';
}
//社媒分享图片
$data["OGIMAGE"] = "";
- if (!empty($information->ic_photo)) {
+ if (! empty($information->ic_photo)) {
if (strpos($information->ic_photo, "guilinchina.net") != false) {
$full_ic_photo = $information->ic_photo;
} else {
@@ -5370,28 +5343,28 @@ class Information extends CI_Controller
//结构化标签
$data["ConstructionCode"] = "";
- $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
- if (!empty($meta_construction_code)) {
+ $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code');
+ if (! empty($meta_construction_code)) {
$data["ConstructionCode"] = $meta_construction_code;
}
- $data["meta_index_set"]="";
- $meta_index_set = get_meta($information->ic_id, 'meta_index_set');
- if (!empty($meta_index_set)) {
+ $data["meta_index_set"] = "";
+ $meta_index_set = get_meta($information->ic_id, 'meta_index_set');
+ if (! empty($meta_index_set)) {
$data["meta_index_set"] = ' ';
}
//总JS:为了方便以后js好维护,必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js,所以必须在这里进行判断
- $addBaseJs = false;
- $addonJs = "";
- $meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
- $meta_ct_page_Carousel = get_meta($information->ic_id,'meta_ct_page_Carousel'); //是否有顶部轮播图
+ $addBaseJs = false;
+ $addonJs = "";
+ $meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
+ $meta_ct_page_Carousel = get_meta($information->ic_id, 'meta_ct_page_Carousel'); //是否有顶部轮播图
if ($meta_ct_page_price == "yes") {
$addBaseJs = true;
} else if ($meta_ct_page_type !== false && $meta_ct_page_type != "") {
$addBaseJs = true;
- }else if ($meta_ct_page_Carousel == "yes"){
+ } else if ($meta_ct_page_Carousel == "yes") {
$addBaseJs = true;
}
@@ -5402,8 +5375,8 @@ class Information extends CI_Controller
//额外js
$data["ADDONJS"] = "";
- $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
- if (!empty($meta_addon_js)) {
+ $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
+ if (! empty($meta_addon_js)) {
$addonJs .= '';
}
//价格js
@@ -5412,24 +5385,24 @@ class Information extends CI_Controller
}
//列表js
- if (in_array($meta_ct_page_type, array('daytripindex', 'tourindex', 'attractionindex'))) {
+ if (in_array($meta_ct_page_type, ['daytripindex', 'tourindex', 'attractionindex'])) {
$addonJs .= '';
}
//顶部轮播图
- if ($meta_ct_page_Carousel == "yes"){
- $addonJs .= '';
- $addonJs .= '';
+ if ($meta_ct_page_Carousel == "yes") {
+ $addonJs .= '';
+ $addonJs .= '';
$data["ADDONCSS"] .= ' ';
}
//页面传递参数
$passParam = "";
- if (in_array($meta_ct_page_type, array("daytripindex", "tourindex", "attractionindex", "weatherpage"))) { //一日游和线路列表
- //产品首页
+ if (in_array($meta_ct_page_type, ["daytripindex", "tourindex", "attractionindex", "weatherpage"])) { //一日游和线路列表
+ //产品首页
$meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value');
- if (in_array($meta_ct_page_type, array("attractionindex"))) {
+ if (in_array($meta_ct_page_type, ["attractionindex"])) {
//旧信息id,景点等信息类
$passParam .= ' ';
} else {
@@ -5446,92 +5419,88 @@ class Information extends CI_Controller
$productCode = "";
if ($meta_ct_page_type == "daytripdetail") {
//一日游
- if (!empty($meta_ct_page_type)) {
+ if (! empty($meta_ct_page_type)) {
$productType = $meta_ct_page_type;
}
$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;
}
-
//一日游表单的替换
- $DayTripData["productCode"] = $productCode;
+ $DayTripData["productCode"] = $productCode;
$DayTripData["picture_mobile"] = get_meta($information->ic_id, 'meta_addon_picture_mobile');
- $DayTripData["picture_pc"] = get_meta($information->ic_id, 'meta_addon_picture');
- $DayTripData["TITLE"] = $information->ic_title;
+ $DayTripData["picture_pc"] = get_meta($information->ic_id, 'meta_addon_picture');
+ $DayTripData["TITLE"] = $information->ic_title;
- $arrCAD = ['HLYCAD-S','HLYCAD-V','HLYCAD-P'];//水灯节
- $arrCAD_EN = ['QM-NUT-V', 'QM-NUT-P']; //水灯节英文
- //$arrTest = ['QM-9-A','QM-9-B','QM-9-C'];
+ $arrCAD = ['HLYCAD-S', 'HLYCAD-V', 'HLYCAD-P']; //水灯节
+ $arrCAD_EN = ['QM-NUT-V', 'QM-NUT-P']; //水灯节英文
+ //$arrTest = ['QM-9-A','QM-9-B','QM-9-C'];
- if (in_array($productCode,$arrCAD) || in_array($productCode,$arrCAD_EN)){ //水灯节,中英文分别调用不同模板
+ if (in_array($productCode, $arrCAD) || in_array($productCode, $arrCAD_EN)) { //水灯节,中英文分别调用不同模板
/**替换左右结构的线路表单标签 2024-7-4*/
if (strpos($ic_content, '') !== false) {
//准备数据
$InfoData = new stdClass(); //传递用来计算的信息平台数据
- //附加选项
- $t_excludedate = get_meta($information->ic_id, "meta_trippest_excludedate");
- $t_includedate = get_meta($information->ic_id, "meta_trippest_includedate");
- $t_excludemonth = get_meta($information->ic_id, "meta_trippest_excludemonth");
- $InfoData->t_excludedate = $t_excludedate;
- $InfoData->t_includedate = $t_includedate;
+ //附加选项
+ $t_excludedate = get_meta($information->ic_id, "meta_trippest_excludedate");
+ $t_includedate = get_meta($information->ic_id, "meta_trippest_includedate");
+ $t_excludemonth = get_meta($information->ic_id, "meta_trippest_excludemonth");
+ $InfoData->t_excludedate = $t_excludedate;
+ $InfoData->t_includedate = $t_includedate;
$InfoData->t_excludemonth = $t_excludemonth;
- $DayTripData["InfoData"] = $InfoData; //传递信息平台数据
+ $DayTripData["InfoData"] = $InfoData; //传递信息平台数据
$linktour = get_meta($information->ic_id, 'meta_trainspread_linktour'); //关联线路
- if (!empty($linktour)){
- $paramCode = $productCode.",".$linktour;
- }else{
+ if (! empty($linktour)) {
+ $paramCode = $productCode . "," . $linktour;
+ } else {
$paramCode = $productCode;
}
//产品汉特信息,测试地址:http://202.103.68.104:61/info.php/thirdparty/ctmobilefirst/api/getDaytripDetail/?webcode=hly¶m=QM-9-A,QM-9-B,QM-9-C
- $TourData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getDaytripDetail/?webcode=hly¶m=" . $paramCode));
+ $TourData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getDaytripDetail/?webcode=hly¶m=" . $paramCode));
$DayTripData["TourData"] = $TourData;
//替换模板
- if ( in_array($productCode,$arrCAD_EN)){
+ if (in_array($productCode, $arrCAD_EN)) {
$template_form_daydetail = $this->load->view($template_path . '-cad-form-en', $DayTripData, true); //英文模板内容
- }else{
+ } else {
$template_form_daydetail = $this->load->view($template_path . '-cad-form', $DayTripData, true); //中文模板内容
- }
+ }
$ic_content = str_replace('', $template_form_daydetail, $ic_content);
}
- }
- else if (1==2) { //默认,暂时没有
+ } else if (1 == 2) { //默认,暂时没有
$addonJs .= '';
$data["ADDONCSS"] .= ' ';
-
$template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
- //使用simple_html_dom_lib库来进行表单添加
+ //使用simple_html_dom_lib库来进行表单添加
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, "#maincontent", $template_form_daydetail);
}
}
if ($meta_ct_page_type == "tourdetail") {
//线路
- $productType = $meta_ct_page_type;
+ $productType = $meta_ct_page_type;
$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;
}
//获取cli_sn
- $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getCliSn/?param=" . $productCode."&webcode=hly"));
+ $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getCliSn/?param=" . $productCode . "&webcode=hly"));
$data["clisn"] = $tourdata->clisn;
-
//获取price
- $tourprice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourPrice/?param=" . $productCode."&webcode=hly"));
+ $tourprice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourPrice/?param=" . $productCode . "&webcode=hly"));
$dataform["tourprice"] = $tourprice->price;
//调取模板
$dataform["TourCode"] = $productCode;
- $dataform["CLI_SN"] = $tourdata->clisn;
+ $dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
$addonJs .= '';
@@ -5539,9 +5508,8 @@ class Information extends CI_Controller
}
-
//表单页
- if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform"))) {
+ if (in_array($meta_ct_page_type, ["customize", "contactus", "pagewithform"])) {
$productType = $meta_ct_page_type;
$addonJs .= '';
$data["ADDONCSS"] .= ' ';
@@ -5557,7 +5525,7 @@ class Information extends CI_Controller
$data["productCode"] = $productCode;
//页面添加的元素
- $data["ADDONJS"] = $addonJs;
+ $data["ADDONJS"] = $addonJs;
$data["passParam"] = $passParam;
//页面详细内容放最后,这样上面都可以进行内容的替换,比如一日游表单
@@ -5566,49 +5534,46 @@ class Information extends CI_Controller
#endregion
#region 移动端和PC端差别处理区域
- $arrDevice = array("mobile", "pc");
+ $arrDevice = ["mobile", "pc"];
foreach ($arrDevice as $device) {
//顶部全屏大图
- $data["TOPBANNER"] = "";
- $ImgText = ""; //图文字
- $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
+ $data["TOPBANNER"] = "";
+ $ImgText = ""; //图文字
+ $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
$meta_addon_picture_text = get_meta($information->ic_id, 'meta_addon_picture_text');
if ($device == 'mobile') { //移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
- $bannerImg = ' ';
+ $bannerImg = ' ';
} else {
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
- $bannerImg = ' ';
+ $bannerImg = ' ';
}
-
- if (!empty($meta_addon_picture)) {
- if (!empty($meta_addon_picture_url)) {
- $data["TOPBANNER"] = '';
+ if (! empty($meta_addon_picture)) {
+ if (! empty($meta_addon_picture_url)) {
+ $data["TOPBANNER"] = '';
} else {
- $data["TOPBANNER"] = '' . $bannerImg . $ImgText . '
';
+ $data["TOPBANNER"] = '' . $bannerImg . $ImgText . '
';
}
}
-
if ($meta_ct_page_type == "tourdetail") { //线路表单,左右结构,用标签来做
$dataform['device'] = $device;
if (strpos($ic_content, '') !== false) {
-
- $InfoData = new stdClass(); //传递用来计算的信息平台数据
- $t_excludedate = get_meta($information->ic_id, "meta_trippest_excludedate");
- $t_includedate = get_meta($information->ic_id, "meta_trippest_includedate");
- $t_excludemonth = get_meta($information->ic_id, "meta_trippest_excludemonth");
- $InfoData->t_excludedate = $t_excludedate;
- $InfoData->t_includedate = $t_includedate;
+ $InfoData = new stdClass(); //传递用来计算的信息平台数据
+ $t_excludedate = get_meta($information->ic_id, "meta_trippest_excludedate");
+ $t_includedate = get_meta($information->ic_id, "meta_trippest_includedate");
+ $t_excludemonth = get_meta($information->ic_id, "meta_trippest_excludemonth");
+ $InfoData->t_excludedate = $t_excludedate;
+ $InfoData->t_includedate = $t_includedate;
$InfoData->t_excludemonth = $t_excludemonth;
- $InfoData->t_defaultDate = get_meta($information->ic_id, "meta_trippest_defaultDate");
- $dataform["InfoData"] = $InfoData; //传递信息平台数据
+ $InfoData->t_defaultDate = get_meta($information->ic_id, "meta_trippest_defaultDate");
+ $dataform["InfoData"] = $InfoData; //传递信息平台数据
$template_form_tourqi = $this->load->view($template_path . '-form-tourqi', $dataform, true);
- $ic_content = str_replace('', $template_form_tourqi, $ic_content);
+ $ic_content = str_replace('', $template_form_tourqi, $ic_content);
$data["CUSTOMCONENT"] = $ic_content;
}
@@ -5617,27 +5582,27 @@ class Information extends CI_Controller
//两种设备分别调用两种模板 ,静态化
switch ($device) {
- case 'mobile':
- //获取移动优先的模板,如果有的话
- $template_path = 'mobile_first/' . $this->config->item('site_code');
- if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
- $template = $this->load->view($template_path, $data, 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', $data, true);
- $html_path_ext = '-pc.htm';
- } else {
- return false;
- }
- break;
- default:
+ case 'mobile':
+ //获取移动优先的模板,如果有的话
+ $template_path = 'mobile_first/' . $this->config->item('site_code');
+ if (is_file(APPPATH . 'views/' . $template_path . EXT)) {
+ $template = $this->load->view($template_path, $data, 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', $data, true);
+ $html_path_ext = '-pc.htm';
+ } else {
+ return false;
+ }
+ break;
+ default:
}
//生成静态文件
@@ -5654,11 +5619,10 @@ class Information extends CI_Controller
}
//通过内容找到第一张图片
- public function set_photo_content($ic_photo, $ic_content)
- {
+ public function set_photo_content($ic_photo, $ic_content) {
if (empty($ic_photo)) {
$images = get_image_url_by_source($ic_content);
- if (!empty($images) and !empty($images[1])) {
+ if (! empty($images) and ! empty($images[1])) {
return $images[1][0];
}
} else {
@@ -5668,90 +5632,88 @@ class Information extends CI_Controller
}
//根据推荐规则进行查询
- public function recommand_information_rule($information, $root_information, $recommand, &$exclude_ids)
- {
- $data = array();
+ public function recommand_information_rule($information, $root_information, $recommand, &$exclude_ids) {
+ $data = [];
switch ($recommand->ir_rule) {
- case 'rule_same_node_keyword': //同节点关键词
- $keywords = explode(',', $recommand->ir_keyword);
- $data = $this->Information_model->search_by_words_2($root_information->is_path, $keywords, $exclude_ids);
- break;
- case 'rule_same_url_keyword': //同URL关键词
- $keywords = explode(',', $recommand->ir_keyword);
- $url = trim($information->ic_url);
- $url = substr($url, 0, strpos($url, '/', 1) + 1);
- $data = $this->Information_model->search_by_words($url, $keywords, $exclude_ids);
- break;
- case 'rule_same_node_random': //同节点随机
- $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, 'is_path');
- if (!empty($ir_pointer)) {
- $data = $this->Information_model->random(1, $ir_pointer->is_path, $exclude_ids);
- }
- break;
- case 'rule_range_random': //范围内随机,同读取备用节点
- break;
- case 'rule_show_tips': //显示广告
- $data = $this->recommends_and_tips_model->tips_detail($recommand->ir_pointer_it_id);
- return array($recommand->ir_name => $data);
- //break;
- case 'rule_no_show': //不显示
- return array($recommand->ir_name => false);
- //break;
- default: //'rule_parent'://继承上级规则则留空,程序会循环一遍分组的规则
- return false;
+ case 'rule_same_node_keyword': //同节点关键词
+ $keywords = explode(',', $recommand->ir_keyword);
+ $data = $this->Information_model->search_by_words_2($root_information->is_path, $keywords, $exclude_ids);
+ break;
+ case 'rule_same_url_keyword': //同URL关键词
+ $keywords = explode(',', $recommand->ir_keyword);
+ $url = trim($information->ic_url);
+ $url = substr($url, 0, strpos($url, '/', 1) + 1);
+ $data = $this->Information_model->search_by_words($url, $keywords, $exclude_ids);
+ break;
+ case 'rule_same_node_random': //同节点随机
+ $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, 'is_path');
+ if (! empty($ir_pointer)) {
+ $data = $this->Information_model->random(1, $ir_pointer->is_path, $exclude_ids);
+ }
+ break;
+ case 'rule_range_random': //范围内随机,同读取备用节点
+ break;
+ case 'rule_show_tips': //显示广告
+ $data = $this->recommends_and_tips_model->tips_detail($recommand->ir_pointer_it_id);
+ return [$recommand->ir_name => $data];
+ //break;
+ case 'rule_no_show': //不显示
+ return [$recommand->ir_name => false];
+ //break;
+ default: //'rule_parent'://继承上级规则则留空,程序会循环一遍分组的规则
+ return false;
}
- //读取备用节点
- if (empty($data) && !empty($recommand->ir_urls)) { //查不到信息并且备选urls不为空,则随机选一条
- // $url_array = explode("\n", $recommand->ir_urls);
- // $data = $this->Information_model->Detail(trim($url_array[rand(0, count($url_array) - 1)]));
+ //读取备用节点
+ if (empty($data) && ! empty($recommand->ir_urls)) { //查不到信息并且备选urls不为空,则随机选一条
+ // $url_array = explode("\n", $recommand->ir_urls);
+ // $data = $this->Information_model->Detail(trim($url_array[rand(0, count($url_array) - 1)]));
$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);
}
- if (!empty($data)) {
- $exclude_ids[] = $data->is_id;
+ if (! empty($data)) {
+ $exclude_ids[] = $data->is_id;
$data->desktop_photo = get_meta($data->ic_id, 'meta_addon_picture');
- $data->mobile_photo = get_meta($data->ic_id, 'meta_addon_picture_mobile');
+ $data->mobile_photo = get_meta($data->ic_id, 'meta_addon_picture_mobile');
if (empty($data->mobile_photo)) {
- if (!empty($data->ic_photo)) {
+ if (! empty($data->ic_photo)) {
$data->mobile_photo = $this->config->item('site_image_url') . $data->ic_photo;
} else {
$data->mobile_photo = 'https://data.chinahighlights.com/image/travelguide/article/recommended-info-bottom-cover.jpg';
}
}
}
- return array($recommand->ir_name => $data);
+ return [$recommand->ir_name => $data];
}
//获取当前信息所有的推荐信息和广告内容
- public function recommand_information($information)
- {
- $data = array();
- $group_detail = $this->Information_model->get_detail_by_path($information->is_path, 0); //信息所属分组,根据分组进行不同推荐
+ public function recommand_information($information) {
+ $data = [];
+ $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); //节点下所有的推荐规则
- $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_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); //节点下所有的推荐规则
- $exclude_ids = array($information->is_id); //需要排除的is_id,防止通过页面显示相同内容,默认排除本身,每个推荐内容都需要排除已经推荐过的
+ $exclude_ids = [$information->is_id]; //需要排除的is_id,防止通过页面显示相同内容,默认排除本身,每个推荐内容都需要排除已经推荐过的
foreach ($root_recommands as $item) {
if ($this->config->item('site_code') == 'ah' or $this->config->item('site_code') == 'ch' or $this->config->item('site_code') == 'gh' or $this->config->item('site_code') == 'jh' or $this->config->item('site_code') == 'htravel') { //如果是AH CH GH的页面,取消重复检测
- $exclude_ids = array(0);
+ $exclude_ids = [0];
}
$result = $this->recommand_information_rule($information, $root_detail, $item, $exclude_ids);
- if (!empty($result)) {
+ if (! empty($result)) {
$data += $result;
}
}
foreach ($group_recommands as $item) {
if ($this->config->item('site_code') == 'ah' or $this->config->item('site_code') == 'ch' or $this->config->item('site_code') == 'gh' or $this->config->item('site_code') == 'jh' or $this->config->item('site_code') == 'htravel') { //如果是AH CH GH JH的页面,取消重复检测
- $exclude_ids = array(0);
+ $exclude_ids = [0];
}
if (empty($data[$item->ir_name])) {
$result = $this->recommand_information_rule($information, $root_detail, $item, $exclude_ids);
- if (!empty($result)) {
+ if (! empty($result)) {
$data += $result;
}
}
@@ -5761,111 +5723,110 @@ class Information extends CI_Controller
return $data;
}
- public function call_mobile_template_NEXT($template_path, $is_id)
- {
- $data['detail'] = $this->Information_model->Detail($is_id);
+ public function call_mobile_template_NEXT($template_path, $is_id) {
+ $data['detail'] = $this->Information_model->Detail($is_id);
$data['type_detail'] = $this->Information_model->get_detail_by_path($data['detail']->is_path, 0); //信息所属分组,根据分组进行不同推荐
$data['root_detail'] = $this->Information_model->get_detail_by_path($data['detail']->is_path, 1); //信息所属分类,获取信息顶级节点内容
switch (strtolower($data['type_detail']->is_id)) {
- case 278008010: //Inspiration
- //随机获取两个同级节点内容
- $random_array = $this->Information_model->random(2, $data['root_detail']->is_path, array($data['detail']->is_id));
- if (!empty($random_array[0])) {
- $data['info_howtoplan'] = $random_array[0];
- $data['info_howtoplan_root'] = $data['root_detail'];
- $data['info_howtoplan']->ic_photo = $this->set_photo_content($data['info_howtoplan']->ic_photo, $data['info_howtoplan']->ic_content);
- }
- if (!empty($random_array[1])) {
- $data['info_besttime'] = $random_array[1];
- $data['info_besttime_root'] = $data['root_detail'];
- $data['info_besttime']->ic_photo = $this->set_photo_content($data['info_besttime']->ic_photo, $data['info_besttime']->ic_content);
- }
- //漏斗作用的页面,随机挑选一篇
- $random_array = array(
- '/travelguide/china-facts.htm',
- '/travelguide/article-top-china-tourist-destination.htm',
- '/travelguide/most-beautiful-places.htm',
- '/weather/china-best-times.htm',
- '/travelguide/article-10-movies-to-watch.htm',
- '/travelguide/article-culture-shock-in-china.htm',
- '/travelguide/article-what-chinese-eat-for-breakfast.htm',
- '/travelguide/china-top-10-attractions.htm',
- '/travelguide/chinese-food/eight-chinese-dishes.htm',
- '/travelguide/china-travel-reopen-restrictions.htm',
- );
- $data['info_topthings'] = $this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]);
- if (!empty($data['info_topthings'])) {
- $data['info_topthings_root'] = $this->Information_model->get_detail_by_path($data['info_topthings']->is_path, 1);
- $data['info_topthings']->ic_photo = $this->set_photo_content($data['info_topthings']->ic_photo, $data['info_topthings']->ic_content);
- }
- //文化板块的页面,随机挑选一篇
- $random_array = array(
- '/travelguide/chinese-zodiac/',
- '/travelguide/culture/china-arts-crafts.htm',
- '/beijing/forbidden-city/',
- '/travelguide/culture/traditionalmedichine.htm',
- '/travelguide/chinese-tea/',
- '/travelguide/kungfu/',
- '/travelguide/culture/china-history.htm',
- '/travelguide/chinese-food/',
- '/travelguide/chinese-language/',
- );
- $data['info_hotel'] = $this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]);
- if (!empty($data['info_hotel'])) {
- $data['info_hotel_root'] = $this->Information_model->get_detail_by_path($data['info_hotel']->is_path, 1);
- $data['info_hotel']->ic_photo = $this->set_photo_content($data['info_hotel']->ic_photo, $data['info_hotel']->ic_content);
- }
- break;
- case 278008012: //'planing-1(guide)':
- case 278008013: //'planning-2 (decision tips)':
- case 278008011: //'destination': //url的第一段表示地区,根据第一段来搜索相关数据如/beijing/ 而不是根据is_parent_id因为可能信息和线路是在不同的分类下
- $destination_url = trim($data['detail']->ic_url);
- $destination_url = substr($destination_url, 0, strpos($destination_url, '/', 1) + 1);
- //how to plan
- $data['info_howtoplan'] = $this->Information_model->search_by_words($destination_url, array('how', 'plan'), array($data['detail']->is_id));
- if (empty($data['info_howtoplan'])) { //找不到对应信息则显示备用
- $data['info_howtoplan'] = $this->Information_model->Detail('/travelguide/plan-first-trip.htm');
- }
- $data['info_howtoplan_root'] = $this->Information_model->get_detail_by_path($data['info_howtoplan']->is_path, 1); //信息所属分类,获取信息顶级节点内容
- if (!empty($data['info_howtoplan'])) {
- $data['info_howtoplan']->ic_photo = $this->set_photo_content($data['info_howtoplan']->ic_photo, $data['info_howtoplan']->ic_content);
- }
- //best time to visit
- $data['info_besttime'] = $this->Information_model->search_by_words($destination_url, array('best', 'time'), array($data['detail']->is_id));
- if (empty($data['info_besttime'])) {
- $data['info_besttime'] = $this->Information_model->Detail('/weather/china-best-times.htm');
- }
- $data['info_besttime_root'] = $this->Information_model->get_detail_by_path($data['info_besttime']->is_path, 1); //信息所属分类,获取信息顶级节点内容
- if (!empty($data['info_besttime'])) {
- $data['info_besttime']->ic_photo = $this->set_photo_content($data['info_besttime']->ic_photo, $data['info_besttime']->ic_content);
- }
- //top things to do
- $data['info_topthings'] = $this->Information_model->search_by_words($destination_url, array('top', 'things'), array($data['detail']->is_id));
- if (empty($data['info_topthings'])) {
- $data['info_topthings'] = $this->Information_model->Detail('/travelguide/article-top-china-tourist-destination.htm');
- }
- $data['info_topthings_root'] = $this->Information_model->get_detail_by_path($data['info_topthings']->is_path, 1); //信息所属分类,获取信息顶级节点内容
- if (!empty($data['info_topthings'])) {
- $data['info_topthings']->ic_photo = $this->set_photo_content($data['info_topthings']->ic_photo, $data['info_topthings']->ic_content);
- }
- //第四篇,随机推荐下方url
- $random_array = array(
- '/feedback/',
- '/travelguide/how-chinahighlights-selects-your-hotel.htm',
- '/travelguide/article-private-tour-vs-group-tour.htm',
- '/aboutus/who-recommended.htm',
- '/aboutus/no-shops.htm',
- '/aboutus/company-history.htm',
- );
- $data['info_hotel'] = $this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]);
- if (!empty($data['info_hotel'])) {
- $data['info_hotel_root'] = $this->Information_model->get_detail_by_path($data['info_hotel']->is_path, 1);
- $data['info_hotel']->ic_photo = $this->set_photo_content($data['info_hotel']->ic_photo, $data['info_hotel']->ic_content);
- }
- break;
- default:
- return '';
+ case 278008010: //Inspiration
+ //随机获取两个同级节点内容
+ $random_array = $this->Information_model->random(2, $data['root_detail']->is_path, [$data['detail']->is_id]);
+ if (! empty($random_array[0])) {
+ $data['info_howtoplan'] = $random_array[0];
+ $data['info_howtoplan_root'] = $data['root_detail'];
+ $data['info_howtoplan']->ic_photo = $this->set_photo_content($data['info_howtoplan']->ic_photo, $data['info_howtoplan']->ic_content);
+ }
+ if (! empty($random_array[1])) {
+ $data['info_besttime'] = $random_array[1];
+ $data['info_besttime_root'] = $data['root_detail'];
+ $data['info_besttime']->ic_photo = $this->set_photo_content($data['info_besttime']->ic_photo, $data['info_besttime']->ic_content);
+ }
+ //漏斗作用的页面,随机挑选一篇
+ $random_array = [
+ '/travelguide/china-facts.htm',
+ '/travelguide/article-top-china-tourist-destination.htm',
+ '/travelguide/most-beautiful-places.htm',
+ '/weather/china-best-times.htm',
+ '/travelguide/article-10-movies-to-watch.htm',
+ '/travelguide/article-culture-shock-in-china.htm',
+ '/travelguide/article-what-chinese-eat-for-breakfast.htm',
+ '/travelguide/china-top-10-attractions.htm',
+ '/travelguide/chinese-food/eight-chinese-dishes.htm',
+ '/travelguide/china-travel-reopen-restrictions.htm',
+ ];
+ $data['info_topthings'] = $this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]);
+ if (! empty($data['info_topthings'])) {
+ $data['info_topthings_root'] = $this->Information_model->get_detail_by_path($data['info_topthings']->is_path, 1);
+ $data['info_topthings']->ic_photo = $this->set_photo_content($data['info_topthings']->ic_photo, $data['info_topthings']->ic_content);
+ }
+ //文化板块的页面,随机挑选一篇
+ $random_array = [
+ '/travelguide/chinese-zodiac/',
+ '/travelguide/culture/china-arts-crafts.htm',
+ '/beijing/forbidden-city/',
+ '/travelguide/culture/traditionalmedichine.htm',
+ '/travelguide/chinese-tea/',
+ '/travelguide/kungfu/',
+ '/travelguide/culture/china-history.htm',
+ '/travelguide/chinese-food/',
+ '/travelguide/chinese-language/',
+ ];
+ $data['info_hotel'] = $this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]);
+ if (! empty($data['info_hotel'])) {
+ $data['info_hotel_root'] = $this->Information_model->get_detail_by_path($data['info_hotel']->is_path, 1);
+ $data['info_hotel']->ic_photo = $this->set_photo_content($data['info_hotel']->ic_photo, $data['info_hotel']->ic_content);
+ }
+ break;
+ case 278008012: //'planing-1(guide)':
+ case 278008013: //'planning-2 (decision tips)':
+ case 278008011: //'destination': //url的第一段表示地区,根据第一段来搜索相关数据如/beijing/ 而不是根据is_parent_id因为可能信息和线路是在不同的分类下
+ $destination_url = trim($data['detail']->ic_url);
+ $destination_url = substr($destination_url, 0, strpos($destination_url, '/', 1) + 1);
+ //how to plan
+ $data['info_howtoplan'] = $this->Information_model->search_by_words($destination_url, ['how', 'plan'], [$data['detail']->is_id]);
+ if (empty($data['info_howtoplan'])) { //找不到对应信息则显示备用
+ $data['info_howtoplan'] = $this->Information_model->Detail('/travelguide/plan-first-trip.htm');
+ }
+ $data['info_howtoplan_root'] = $this->Information_model->get_detail_by_path($data['info_howtoplan']->is_path, 1); //信息所属分类,获取信息顶级节点内容
+ if (! empty($data['info_howtoplan'])) {
+ $data['info_howtoplan']->ic_photo = $this->set_photo_content($data['info_howtoplan']->ic_photo, $data['info_howtoplan']->ic_content);
+ }
+ //best time to visit
+ $data['info_besttime'] = $this->Information_model->search_by_words($destination_url, ['best', 'time'], [$data['detail']->is_id]);
+ if (empty($data['info_besttime'])) {
+ $data['info_besttime'] = $this->Information_model->Detail('/weather/china-best-times.htm');
+ }
+ $data['info_besttime_root'] = $this->Information_model->get_detail_by_path($data['info_besttime']->is_path, 1); //信息所属分类,获取信息顶级节点内容
+ if (! empty($data['info_besttime'])) {
+ $data['info_besttime']->ic_photo = $this->set_photo_content($data['info_besttime']->ic_photo, $data['info_besttime']->ic_content);
+ }
+ //top things to do
+ $data['info_topthings'] = $this->Information_model->search_by_words($destination_url, ['top', 'things'], [$data['detail']->is_id]);
+ if (empty($data['info_topthings'])) {
+ $data['info_topthings'] = $this->Information_model->Detail('/travelguide/article-top-china-tourist-destination.htm');
+ }
+ $data['info_topthings_root'] = $this->Information_model->get_detail_by_path($data['info_topthings']->is_path, 1); //信息所属分类,获取信息顶级节点内容
+ if (! empty($data['info_topthings'])) {
+ $data['info_topthings']->ic_photo = $this->set_photo_content($data['info_topthings']->ic_photo, $data['info_topthings']->ic_content);
+ }
+ //第四篇,随机推荐下方url
+ $random_array = [
+ '/feedback/',
+ '/travelguide/how-chinahighlights-selects-your-hotel.htm',
+ '/travelguide/article-private-tour-vs-group-tour.htm',
+ '/aboutus/who-recommended.htm',
+ '/aboutus/no-shops.htm',
+ '/aboutus/company-history.htm',
+ ];
+ $data['info_hotel'] = $this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]);
+ if (! empty($data['info_hotel'])) {
+ $data['info_hotel_root'] = $this->Information_model->get_detail_by_path($data['info_hotel']->is_path, 1);
+ $data['info_hotel']->ic_photo = $this->set_photo_content($data['info_hotel']->ic_photo, $data['info_hotel']->ic_content);
+ }
+ break;
+ default:
+ return '';
}
return $this->load->view($template_path . '-next', $data, true);
@@ -5873,82 +5834,81 @@ class Information extends CI_Controller
//更新静态文件
//不用参数提交的原因是可能url带有特殊字符,CI会报错
- public function update_cache($static_html_url = false, $delete_only = false)
- {
- $url = !empty($static_html_url) ? $static_html_url : $this->input->post('cache_url');
- $url = str_replace($this->config->item('site_url'), '', $url);
+ public function update_cache($static_html_url = false, $delete_only = false) {
+ $url = ! empty($static_html_url) ? $static_html_url : $this->input->post('cache_url');
+ $url = str_replace($this->config->item('site_url'), '', $url);
$original_url = $url; //原始链接
- $delete_only = !empty($delete_only) ? $delete_only : $this->input->get_post('delete_only');
+ $delete_only = ! empty($delete_only) ? $delete_only : $this->input->get_post('delete_only');
switch ($this->config->item('site_code')) {
- case 'cht':
- $search_list = $this->Information_model->search_url($url);
- $amp_request = false;
- foreach ($search_list as $key => $req_url) {
- $meta_amp_status = get_meta($req_url->ic_id, 'AMP_STATUS');
- if ($meta_amp_status) {
- $amp_request = true;
- }
+ case 'cht':
+ $search_list = $this->Information_model->search_url($url);
+ $amp_request = false;
+ foreach ($search_list as $key => $req_url) {
+ $meta_amp_status = get_meta($req_url->ic_id, 'AMP_STATUS');
+ if ($meta_amp_status) {
+ $amp_request = true;
}
- if ($amp_request) {
- $url = 'http://169.54.167.189:22224/ampreq' . $url;
+ }
+ if ($amp_request) {
+ $url = 'http://169.54.167.189:22224/ampreq' . $url;
+ } else {
+ $url = 'http://169.54.167.189:22224' . $url;
+ }
+ break;
+ case 'ah':
+ if ($delete_only === true) {
+ $url = 'https://www.asiahighlights.com/index.php/information/delete_cache_8X913mksJ/?static_html_url=' . $url;
+ } else { // static_html_optimize=comeon 启用静态化压缩和js、css延迟加载
+ $url = 'https://www.asiahighlights.com/index.php/information/detail/?static_html_url=' . $url . '&static_html_optimize=comeon';
+ }
+ break;
+ case 'htravel':
+ if ($delete_only === true) {
+ $url = 'https://www.highlightstravel.com/index.php/information/delete_cache_8X913mksJ/?static_html_url=' . $url;
+ } else { // static_html_optimize=comeon 启用静态化压缩和js、css延迟加载
+ $url = 'https://www.highlightstravel.com/index.php/information/detail/?static_html_url=' . $url . '&static_html_optimize=comeon';
+ }
+ break;
+ case 'gm':
+ //GET_HTTP("http://148.251.35.42:3300/create-cache/?url=" . urlencode($url)); //请求nodejs静态化更新页面,删除缓存,因为部分页面没有进入信息平台
+ //if ($delete_only) {
+ // $url = "https://www.chinahighlightstravel.de/gm.php/information/delete_cache_23Xd913mddkgssODII?static_html_url=" . urlencode($url);
+ //} else {
+ //先删除再生成,部分页面没有在信息平台中
+ GET_HTTP("https://www.chinahighlightstravel.de/gm.php/information/delete_cache_23Xd913mddkgssODII?static_html_url=" . urlencode($url));
+ $url = "https://www.chinahighlightstravel.deel.de/gm.php/information/detail/?static_html_url=" . $url;
+ //}
+ break;
+
+ //国际站
+ case 'vac':
+ case 'vc':
+ case 'it':
+ case 'ru':
+ case 'jp':
+ $information = $this->Information_model->Detail($url);
+ $meta_pc_amp = @get_meta($information->ic_id, 'AMP_BODY_PC_STATUS');
+ if ($delete_only) {
+ //只删除操作,在url修改和不发布信息的时候使用
+ $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $url;
+ } else {
+ $tmp = $url;
+ //判断是否是更新信息
+ // 产品页面不能生成静态页面,比如/beijing/hotel/只是为了在导航显示一个链接,如果生成了静态页面,网前只会显示一个空白页面了
+ if (! empty($information->ic_content) || ! empty($information->ic_summary) || $meta_pc_amp == 'yes') {
+ $url = $this->config->item('site_url') . '/index.php/information/detail/?static_html_url=' . $url;
} else {
- $url = 'http://169.54.167.189:22224' . $url;
- }
- break;
- case 'ah':
- if ($delete_only === true) {
- $url = 'https://www.asiahighlights.com/index.php/information/delete_cache_8X913mksJ/?static_html_url=' . $url;
- } else { // static_html_optimize=comeon 启用静态化压缩和js、css延迟加载
- $url = 'https://www.asiahighlights.com/index.php/information/detail/?static_html_url=' . $url . '&static_html_optimize=comeon';
+ $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $url;
+ //$url = $this->config->item('site_url') . '/index.php/information/detail/?static_html_url=' . $url;
}
- break;
- case 'htravel':
- if ($delete_only === true) {
- $url = 'https://www.highlightstravel.com/index.php/information/delete_cache_8X913mksJ/?static_html_url=' . $url;
- } else { // static_html_optimize=comeon 启用静态化压缩和js、css延迟加载
- $url = 'https://www.highlightstravel.com/index.php/information/detail/?static_html_url=' . $url . '&static_html_optimize=comeon';
+ if (isset($information->ic_type) && $information->ic_type == 'product') {
+ $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $tmp;
}
- break;
- case 'gm':
- //GET_HTTP("http://148.251.35.42:3300/create-cache/?url=" . urlencode($url)); //请求nodejs静态化更新页面,删除缓存,因为部分页面没有进入信息平台
- //if ($delete_only) {
- // $url = "https://www.chinarundreisen.com/gm.php/information/delete_cache_23Xd913mddkgssODII?static_html_url=" . urlencode($url);
- //} else {
- //先删除再生成,部分页面没有在信息平台中
- GET_HTTP("https://www.chinarundreisen.com/gm.php/information/delete_cache_23Xd913mddkgssODII?static_html_url=" . urlencode($url));
- $url = "https://www.chinarundreisen.com/gm.php/information/detail/?static_html_url=" . $url;
- //}
- break;
-
- //国际站
- case 'vac':
- case 'vc':
- case 'it':
- case 'ru':
- case 'jp':
- $information = $this->Information_model->Detail($url);
- $meta_pc_amp = @get_meta($information->ic_id, 'AMP_BODY_PC_STATUS');
- if ($delete_only) {
- //只删除操作,在url修改和不发布信息的时候使用
- $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $url;
- } else {
- $tmp = $url;
- //判断是否是更新信息
- // 产品页面不能生成静态页面,比如/beijing/hotel/只是为了在导航显示一个链接,如果生成了静态页面,网前只会显示一个空白页面了
- if (!empty($information->ic_content) || !empty($information->ic_summary) || $meta_pc_amp == 'yes') {
- $url = $this->config->item('site_url') . '/index.php/information/detail/?static_html_url=' . $url;
- } else {
- $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $url;
- //$url = $this->config->item('site_url') . '/index.php/information/detail/?static_html_url=' . $url;
- }
- if (isset($information->ic_type) && $information->ic_type == 'product') {
- $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $tmp;
- }
- //int return direct
- $cache_url = $this->input->post('cache_url');
- if ($url && !$cache_url) {
- /*
+ //int return direct
+ $cache_url = $this->input->post('cache_url');
+ if ($url && ! $cache_url) {
+ /*
ignore_user_abort(true);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
@@ -5963,51 +5923,51 @@ class Information extends CI_Controller
curl_exec($ch);
curl_close($ch);
*/
- $data['async_update'] = $url;
- $data[] = array('name' => 'ok', 'value' => '信息保存成功,请在8秒后检查更新页面。', 'url' => $url);
- //如果是外部调用就返回结果,内部就不返回了
- if ($cache_url) {
- echo json_encode($data);
- }
- return $data;
+ $data['async_update'] = $url;
+ $data[] = ['name' => 'ok', 'value' => '信息保存成功,请在8秒后检查更新页面。', 'url' => $url];
+ //如果是外部调用就返回结果,内部就不返回了
+ if ($cache_url) {
+ echo json_encode($data);
}
+ return $data;
}
- break;
- //国际站 - GH - add gm
- case 'gh_vac':
- case 'gh_vc':
- case 'gh_it':
- case 'gh_ru':
- case 'gh_jp':
- case 'gh_gm':
- $information = $this->Information_model->Detail($url);
- $meta_pc_amp = @get_meta($information->ic_id, 'AMP_BODY_PC_STATUS');
- if ($delete_only) {
- //只删除操作,在url修改和不发布信息的时候使用
- $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $url;
+ }
+ break;
+ //国际站 - GH - add gm
+ case 'gh_vac':
+ case 'gh_vc':
+ case 'gh_it':
+ case 'gh_ru':
+ case 'gh_jp':
+ case 'gh_gm':
+ $information = $this->Information_model->Detail($url);
+ $meta_pc_amp = @get_meta($information->ic_id, 'AMP_BODY_PC_STATUS');
+ if ($delete_only) {
+ //只删除操作,在url修改和不发布信息的时候使用
+ $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $url;
+ } else {
+ $tmp = $url;
+ //判断是否是更新信息
+ // 产品页面不能生成静态页面,比如/beijing/hotel/只是为了在导航显示一个链接,如果生成了静态页面,网前只会显示一个空白页面了
+ if (! empty($information->ic_content) || ! empty($information->ic_summary) || $meta_pc_amp == 'yes') {
+ $url = $this->config->item('site_url') . '/index.php/gh/info/detail/?static_html_url=' . $url;
} else {
- $tmp = $url;
- //判断是否是更新信息
- // 产品页面不能生成静态页面,比如/beijing/hotel/只是为了在导航显示一个链接,如果生成了静态页面,网前只会显示一个空白页面了
- if (!empty($information->ic_content) || !empty($information->ic_summary) || $meta_pc_amp == 'yes') {
- $url = $this->config->item('site_url') . '/index.php/gh/info/detail/?static_html_url=' . $url;
- } else {
- $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $url;
- //$url = $this->config->item('site_url') . '/index.php/information/detail/?static_html_url=' . $url;
- }
- if (isset($information->ic_type) && $information->ic_type == 'product') {
- $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $tmp;
- }
+ $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $url;
+ //$url = $this->config->item('site_url') . '/index.php/information/detail/?static_html_url=' . $url;
+ }
+ if (isset($information->ic_type) && $information->ic_type == 'product') {
+ $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $tmp;
+ }
- // GH国际 不发布的时候删除缓存
- if (isset($information) && !empty($information) && !$information->ic_status) {
- $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $tmp;
- }
+ // GH国际 不发布的时候删除缓存
+ if (isset($information) && ! empty($information) && ! $information->ic_status) {
+ $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $tmp;
+ }
- //int return direct
- $cache_url = $this->input->post('cache_url');
- if ($url && !$cache_url) {
- /*
+ //int return direct
+ $cache_url = $this->input->post('cache_url');
+ if ($url && ! $cache_url) {
+ /*
ignore_user_abort(true);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
@@ -6022,34 +5982,34 @@ class Information extends CI_Controller
curl_exec($ch);
curl_close($ch);
*/
- $data['async_update'] = $url;
- $data[] = array('name' => 'ok', 'value' => '信息保存成功,请在8秒后检查更新页面。', 'url' => $url);
- //如果是外部调用就返回结果,内部就不返回了
- if ($cache_url) {
- echo json_encode($data);
- }
- return $data;
+ $data['async_update'] = $url;
+ $data[] = ['name' => 'ok', 'value' => '信息保存成功,请在8秒后检查更新页面。', 'url' => $url];
+ //如果是外部调用就返回结果,内部就不返回了
+ if ($cache_url) {
+ echo json_encode($data);
}
+ return $data;
}
- break;
-
- case 'ct': //子站点使用
- $url = 'http://50.97.246.187:22223' . $url;
- break;
- case 'sht':
- case 'gl':
- case 'mbj':
- case 'yz':
- $url = $this->config->item('site_url') . $url . '@cache@refresh';
- break;
- default:
- return false;
+ }
+ break;
+
+ case 'ct': //子站点使用
+ $url = 'http://50.97.246.187:22223' . $url;
+ break;
+ case 'sht':
+ case 'gl':
+ case 'mbj':
+ case 'yz':
+ $url = $this->config->item('site_url') . $url . '@cache@refresh';
+ break;
+ default:
+ return false;
//break;
}
$content = GET_HTTP($url);
if ($content === false) {
- $data[] = array('name' => 'no', 'value' => sprintf($this->lang->line('update_cache_failed'), $url));
+ $data[] = ['name' => 'no', 'value' => sprintf($this->lang->line('update_cache_failed'), $url)];
} else {
//手动更新的话,接着更新CDN缓存
$msg = $this->lang->line('update_cache_success');
@@ -6062,7 +6022,7 @@ class Information extends CI_Controller
$msg .= $this->lang->line('update_cdn_failed') . ' ' . $notice;
}
}
- $data[] = array('name' => 'ok', 'value' => $msg, 'url' => $url);
+ $data[] = ['name' => 'ok', 'value' => $msg, 'url' => $url];
}
//如果是外部调用就返回结果,内部就不返回了
if ($this->input->post('cache_url')) {
@@ -6072,11 +6032,10 @@ class Information extends CI_Controller
}
//更新CDN缓存
- public function update_cdn($static_html_url = false)
- {
- $flag = false; //false:不更新,true:更新
- $update_site = array('jp', 'ru'); //需要更新CDN的站点
- //需要更新的url
+ public function update_cdn($static_html_url = false) {
+ $flag = false; //false:不更新,true:更新
+ $update_site = ['jp', 'ru']; //需要更新CDN的站点
+ //需要更新的url
$url = $static_html_url;
if (empty($url)) {
$url = $this->input->post('cache_url');
@@ -6085,8 +6044,8 @@ class Information extends CI_Controller
//如果传递进来的url是带有域名,则对域名进行判断
$tempu = parse_url($url);
if (isset($tempu['host'])) {
- $url = isset($tempu['path']) ? $tempu['path'] : '/';
- $pad = $tempu['host'];
+ $url = isset($tempu['path']) ? $tempu['path'] : '/';
+ $pad = $tempu['host'];
$flag = true;
} //如果传递进来的url没有域名,则使用当前站点的信息进行判断
else {
@@ -6112,30 +6071,28 @@ class Information extends CI_Controller
}
//获取产品信息,提供给用户选择进行绑定
- public function get_products()
- {
+ public function get_products() {
$HT_productType = $this->input->post('product_type');
$HT_productName = $this->input->post('product_name');
//产品类型
switch ($HT_productType) {
- case 't':
- $data['productList'] = $this->Landscape_model->search_list($HT_productName);
- break;
- default:
- $data['productList'] = array();
- break;
+ case 't':
+ $data['productList'] = $this->Landscape_model->search_list($HT_productName);
+ break;
+ default:
+ $data['productList'] = [];
+ break;
}
$data['product_type'] = $HT_productType;
- $product_list_page = $this->load->view('bootstrap/information_select_product', $data, true);
- $data = array();
- $data[] = array('name' => 'ok', 'value' => $product_list_page);
+ $product_list_page = $this->load->view('bootstrap/information_select_product', $data, true);
+ $data = [];
+ $data[] = ['name' => 'ok', 'value' => $product_list_page];
echo json_encode($data);
return true;
}
//显示备份的内容
- public function backup_content($log_id)
- {
+ public function backup_content($log_id) {
$data['log_info'] = $this->Logs_model->read($log_id);
if ($data['log_info']->log_action == 'backup_amp') {
$data['log_list'] = $this->Logs_model->get_all_backup_list($data['log_info']->log_res_id, true);
@@ -6148,10 +6105,9 @@ class Information extends CI_Controller
}
//保存自定义配置
- public function save_meta()
- {
+ public function save_meta() {
$im_ic_id = $this->input->post('im_ic_id');
- $im_key = $this->input->post('im_key');
+ $im_key = $this->input->post('im_key');
$im_value = $this->input->post('im_value');
if ($im_ic_id && $im_key && $im_value !== false) {
$meta = $this->InfoMetas_model->get($im_ic_id, $im_key);
@@ -6160,71 +6116,69 @@ class Information extends CI_Controller
} else {
$this->InfoMetas_model->update($im_ic_id, $im_key, $im_value);
}
- $data[] = array('name' => 'ok', 'value' => $this->lang->line('media_save_success'));
+ $data[] = ['name' => 'ok', 'value' => $this->lang->line('media_save_success')];
} else {
- $data[] = array('name' => 'no', 'value' => $this->lang->line('media_save_error'));
+ $data[] = ['name' => 'no', 'value' => $this->lang->line('media_save_error')];
}
echo json_encode($data);
return true;
}
//保存自定义配置
- public function delete_meta()
- {
+ public function delete_meta() {
$im_ic_id = $this->input->post('im_ic_id');
- $im_key = $this->input->post('im_key');
+ $im_key = $this->input->post('im_key');
if ($im_ic_id && $im_key) {
$this->InfoMetas_model->delete($im_ic_id, $im_key);
- $data[] = array('name' => 'ok', 'value' => $this->lang->line('media_delete_success'));
+ $data[] = ['name' => 'ok', 'value' => $this->lang->line('media_delete_success')];
} else {
- $data[] = array('name' => 'no', 'value' => $this->lang->line('media_save_error'));
+ $data[] = ['name' => 'no', 'value' => $this->lang->line('media_save_error')];
}
echo json_encode($data);
return true;
}
- public function get_author_url($domain_name, $OPI_Code)
- {
+ public function get_author_url($domain_name, $OPI_Code) {
$OPI_CodeUrls = [
- 'zzy' => 'https://' . $domain_name .'/aboutus/team/ruru-zhou',
- '2' => 'https://' . $domain_name .'/aboutus/team/ruru-zhou',
- 'HWT' => 'https://' . $domain_name .'/aboutus/team/mike-he',
- 'CA' => 'https://' . $domain_name .'/aboutus/team/carol-wang',
- 'SI' => 'https://' . $domain_name .'/aboutus/team/simon-huang',
- 'TJQ' => 'https://' . $domain_name .'/aboutus/team/cindy-tang',
- 'CLA' => 'https://' . $domain_name .'/aboutus/team/claire-wang',
- 'Albee' => 'https://' . $domain_name .'/aboutus/team/albee-ning',
- 'KM' => 'https://' . $domain_name .'/aboutus/team/kimi-huang',
- 'RY' => 'https://' . $domain_name .'/aboutus/team/rita-yu',
- 'QMY' => 'https://' . $domain_name .'/aboutus/team/chris-quan',
- 'CY' => 'https://' . $domain_name .'/aboutus/team/cynthia-li',
- 'Vicky' => 'https://' . $domain_name .'/aboutus/team/vicky-leng',
- 'LXW' => 'https://' . $domain_name .'/aboutus/team/carper-li',
- 'zzyGH' => 'https://' . $domain_name .'/aboutus/team/ruru-zhou',
+ 'zzy' => 'https://' . $domain_name . '/aboutus/team/ruru-zhou',
+ '2' => 'https://' . $domain_name . '/aboutus/team/ruru-zhou',
+ 'HWT' => 'https://' . $domain_name . '/aboutus/team/mike-he',
+ 'CA' => 'https://' . $domain_name . '/aboutus/team/carol-wang',
+ 'SI' => 'https://' . $domain_name . '/aboutus/team/simon-huang',
+ 'TJQ' => 'https://' . $domain_name . '/aboutus/team/cindy-tang',
+ 'CLA' => 'https://' . $domain_name . '/aboutus/team/claire-wang',
+ 'Albee' => 'https://' . $domain_name . '/aboutus/team/albee-ning',
+ 'KM' => 'https://' . $domain_name . '/aboutus/team/kimi-huang',
+ 'RY' => 'https://' . $domain_name . '/aboutus/team/rita-yu',
+ 'QMY' => 'https://' . $domain_name . '/aboutus/team/chris-quan',
+ 'CY' => 'https://' . $domain_name . '/aboutus/team/cynthia-li',
+ 'Vicky' => 'https://' . $domain_name . '/aboutus/team/vicky-leng',
+ 'LXW' => 'https://' . $domain_name . '/aboutus/team/carper-li',
+ 'zzyGH' => 'https://' . $domain_name . '/aboutus/team/ruru-zhou',
];
if ($domain_name == 'www.chinahighlights.com') {
$OPI_CodeUrls = [
- 'zzy' => 'https://www.chinahighlights.com/aboutus/team/ruru-zhou.htm',
- '2' => 'https://www.chinahighlights.com/aboutus/team/ruru-zhou.htm',
- 'HWT' => 'https://www.chinahighlights.com/aboutus/team/mike-he.htm',
- 'CA' => 'https://www.chinahighlights.com/aboutus/team/carol-wang.htm',
- 'SI' => 'https://www.chinahighlights.com/aboutus/team/simon-huang.htm',
- 'TJQ' => 'https://www.chinahighlights.com/aboutus/team/cindy-tang.htm',
- 'CLA' => 'https://www.chinahighlights.com/aboutus/team/claire-wang.htm',
+ 'zzy' => 'https://www.chinahighlights.com/aboutus/team/ruru-zhou.htm',
+ '2' => 'https://www.chinahighlights.com/aboutus/team/ruru-zhou.htm',
+ 'HWT' => 'https://www.chinahighlights.com/aboutus/team/mike-he.htm',
+ 'CA' => 'https://www.chinahighlights.com/aboutus/team/carol-wang.htm',
+ 'SI' => 'https://www.chinahighlights.com/aboutus/team/simon-huang.htm',
+ 'TJQ' => 'https://www.chinahighlights.com/aboutus/team/cindy-tang.htm',
+ 'CLA' => 'https://www.chinahighlights.com/aboutus/team/claire-wang.htm',
'Albee' => 'https://www.chinahighlights.com/aboutus/team/albee-ning.htm',
- 'KM' => 'https://www.chinahighlights.com/aboutus/team/kimi-huang.htm',
- 'RY' => 'https://www.chinahighlights.com/aboutus/team/rita-yu.htm',
- 'QMY' => 'https://www.chinahighlights.com/aboutus/team/chris-quan.htm',
- 'CY' => 'https://www.chinahighlights.com/aboutus/team/cynthia-li.htm',
+ 'KM' => 'https://www.chinahighlights.com/aboutus/team/kimi-huang.htm',
+ 'RY' => 'https://www.chinahighlights.com/aboutus/team/rita-yu.htm',
+ 'QMY' => 'https://www.chinahighlights.com/aboutus/team/chris-quan.htm',
+ 'CY' => 'https://www.chinahighlights.com/aboutus/team/cynthia-li.htm',
'Vicky' => 'https://www.chinahighlights.com/aboutus/team/vicky-leng.htm',
- 'LXW' => 'https://www.chinahighlights.com/aboutus/team/carper-li.htm',
+ 'LXW' => 'https://www.chinahighlights.com/aboutus/team/carper-li.htm',
'zzyGH' => 'https://www.chinahighlights.com/aboutus/team/ruru-zhou.htm',
];
}
- if (!empty($OPI_Code) && array_key_exists($OPI_Code, $OPI_CodeUrls)) {
+ if (! empty($OPI_Code) && array_key_exists($OPI_Code, $OPI_CodeUrls)) {
return $OPI_CodeUrls[$OPI_Code];
} else {
return '';
@@ -6232,88 +6186,87 @@ class Information extends CI_Controller
}
// 获取作者信息,包括头像、领域、主页
- private function get_author_info($domain_name, $OPI_Code)
- {
- // 定义URL模板
- $baseUrl = 'https://www.' . $domain_name;
- $about_us_url = $baseUrl . '/author-page-not-defined/';
+ private function get_author_info($domain_name, $OPI_Code) {
+ // 定义URL模板
+ $baseUrl = 'https://www.' . $domain_name;
+ $about_us_url = $baseUrl . '/author-page-not-defined/';
- if ($domain_name == 'chinahighlights.com' || $domain_name == 'globalhighlights.com') {
- $about_us_url = $baseUrl . '/aboutus/team/';
- } else if($domain_name == 'highlightstravel.com' || $domain_name == 'japanhighlights.com') {
- $about_us_url = $baseUrl . '/about-us/meet-our-team/';
- }
- $urlSuffix = ($domain_name == 'chinahighlights.com') ? '.htm' : '';
+ if ($domain_name == 'chinahighlights.com' || $domain_name == 'globalhighlights.com') {
+ $about_us_url = $baseUrl . '/aboutus/team/';
+ } else if ($domain_name == 'highlightstravel.com' || $domain_name == 'japanhighlights.com') {
+ $about_us_url = $baseUrl . '/about-us/meet-our-team/';
+ }
+ $urlSuffix = ($domain_name == 'chinahighlights.com') ? '.htm' : '';
- // 共享的URL结构
- $OPI_CodeUrls = [
- 'zzy' => $about_us_url . 'ruru-zhou' . $urlSuffix,
- 'HWT' => $about_us_url . 'mike-he' . $urlSuffix,
- 'CA' => $about_us_url . 'carol-wang' . $urlSuffix,
- 'SI' => $about_us_url . 'simon-huang' . $urlSuffix,
- 'TJQ' => $about_us_url . 'cindy-tang' . $urlSuffix,
- 'CLA' => $about_us_url . 'claire-wang' . $urlSuffix,
- 'Albee' => $about_us_url . 'albee-ning' . $urlSuffix,
- 'KM' => $about_us_url . 'kimi-huang' . $urlSuffix,
- 'RY' => $about_us_url . 'rita-yu' . $urlSuffix,
- 'QMY' => $about_us_url . 'chris-quan' . $urlSuffix,
- 'CY' => $about_us_url . 'cynthia-li' . $urlSuffix,
- 'Vicky' => $about_us_url . 'vicky-leng' . $urlSuffix,
- 'LXW' => $about_us_url . 'carper-li' . $urlSuffix,
- ];
+ // 共享的URL结构
+ $OPI_CodeUrls = [
+ 'zzy' => $about_us_url . 'ruru-zhou' . $urlSuffix,
+ 'HWT' => $about_us_url . 'mike-he' . $urlSuffix,
+ 'CA' => $about_us_url . 'carol-wang' . $urlSuffix,
+ 'SI' => $about_us_url . 'simon-huang' . $urlSuffix,
+ 'TJQ' => $about_us_url . 'cindy-tang' . $urlSuffix,
+ 'CLA' => $about_us_url . 'claire-wang' . $urlSuffix,
+ 'Albee' => $about_us_url . 'albee-ning' . $urlSuffix,
+ 'KM' => $about_us_url . 'kimi-huang' . $urlSuffix,
+ 'RY' => $about_us_url . 'rita-yu' . $urlSuffix,
+ 'QMY' => $about_us_url . 'chris-quan' . $urlSuffix,
+ 'CY' => $about_us_url . 'cynthia-li' . $urlSuffix,
+ 'Vicky' => $about_us_url . 'vicky-leng' . $urlSuffix,
+ 'LXW' => $about_us_url . 'carper-li' . $urlSuffix,
+ ];
- // 共享的头像和专长映射
- $expertiseMap = [
- 'zzy' => [
- 'expertise' => 'Japan Expert',
- 'avatar' => 'https://images.'. $domain_name . '/allpicture/2024/03/bc1583b921a24cc3be739e57d290f582_cut_300x300_608.JPG'
- ],
- 'HWT' => [
- 'expertise' => 'Thailand Expert',
- 'avatar' => 'https://images.'. $domain_name . '/allpicture/2024/03/5dc9f81961c24725895205d65123b8e7_cut_300x300_608.JPG'
- ],
- 'TJQ' => [
- 'expertise' => 'Thailand Expert',
- 'avatar' => 'https://images.'. $domain_name . '/allpicture/2024/03/513a1f2af9e54157932fbe157a8862d3_cut_300x300_608.JPG'
- ],
- 'RY' => [
- 'expertise' => 'Vietnam Expert',
- 'avatar' => 'https://images.'. $domain_name . '/allpicture/2024/03/8895dc76301e47a094c0c86048a2c39a_cut_300x300_608.JPG'
- ],
- 'QMY' => [
- 'expertise' => 'China Expert',
- 'avatar' => 'https://images.'. $domain_name . '/allpicture/2024/03/8097b02a5f2c4486824ffecc045a4125_cut_300x300_608.JPG'
- ],
- 'CY' => [
- 'expertise' => 'Japan Expert',
- 'avatar' => 'https://images.'. $domain_name . '/allpicture/2024/03/65499011c0714e0aa1271bc300d9399d_cut_300x300_608.JPG'
- ],
- 'Vicky' => [
- 'expertise' => 'Japan Expert',
- 'avatar' => 'https://images.'. $domain_name . '/allpicture/2024/03/a2d6ac5a7ccb4c06a3d8f1bbf939bdf5_cut_300x300_608.JPG'
- ],
- 'LXW' => [
- 'expertise' => 'Japan Expert',
- 'avatar' => 'https://images.'. $domain_name . '/allpicture/2024/03/b002b9e61b464e24956fea8f17e2ef37_cut_300x300_608.JPG',
- ],
+ // 共享的头像和专长映射
+ $expertiseMap = [
+ 'zzy' => [
+ 'expertise' => 'Japan Expert',
+ 'avatar' => 'https://images.' . $domain_name . '/allpicture/2024/03/bc1583b921a24cc3be739e57d290f582_cut_300x300_608.JPG',
+ ],
+ 'HWT' => [
+ 'expertise' => 'Thailand Expert',
+ 'avatar' => 'https://images.' . $domain_name . '/allpicture/2024/03/5dc9f81961c24725895205d65123b8e7_cut_300x300_608.JPG',
+ ],
+ 'TJQ' => [
+ 'expertise' => 'Thailand Expert',
+ 'avatar' => 'https://images.' . $domain_name . '/allpicture/2024/03/513a1f2af9e54157932fbe157a8862d3_cut_300x300_608.JPG',
+ ],
+ 'RY' => [
+ 'expertise' => 'Vietnam Expert',
+ 'avatar' => 'https://images.' . $domain_name . '/allpicture/2024/03/8895dc76301e47a094c0c86048a2c39a_cut_300x300_608.JPG',
+ ],
+ 'QMY' => [
+ 'expertise' => 'China Expert',
+ 'avatar' => 'https://images.' . $domain_name . '/allpicture/2024/03/8097b02a5f2c4486824ffecc045a4125_cut_300x300_608.JPG',
+ ],
+ 'CY' => [
+ 'expertise' => 'Japan Expert',
+ 'avatar' => 'https://images.' . $domain_name . '/allpicture/2024/03/65499011c0714e0aa1271bc300d9399d_cut_300x300_608.JPG',
+ ],
+ 'Vicky' => [
+ 'expertise' => 'Japan Expert',
+ 'avatar' => 'https://images.' . $domain_name . '/allpicture/2024/03/a2d6ac5a7ccb4c06a3d8f1bbf939bdf5_cut_300x300_608.JPG',
+ ],
+ 'LXW' => [
+ 'expertise' => 'Japan Expert',
+ 'avatar' => 'https://images.' . $domain_name . '/allpicture/2024/03/b002b9e61b464e24956fea8f17e2ef37_cut_300x300_608.JPG',
+ ],
];
- // 构建作者数据
- $authorData = [];
- foreach ($OPI_CodeUrls as $key => $url) {
- if (isset($expertiseMap[$key])) {
- $authorData[$key] = [
- 'url' => $url,
- 'avatar' => $expertiseMap[$key]['avatar'],
- 'expertise' => $expertiseMap[$key]['expertise'],
- ];
- }
+ // 构建作者数据
+ $authorData = [];
+ foreach ($OPI_CodeUrls as $key => $url) {
+ if (isset($expertiseMap[$key])) {
+ $authorData[$key] = [
+ 'url' => $url,
+ 'avatar' => $expertiseMap[$key]['avatar'],
+ 'expertise' => $expertiseMap[$key]['expertise'],
+ ];
}
+ }
- // 合并重复项
- $authorData['2'] = $authorData['zzy'];
- $authorData['zzyGH'] = $authorData['zzy'];
+ // 合并重复项
+ $authorData['2'] = $authorData['zzy'];
+ $authorData['zzyGH'] = $authorData['zzy'];
- return isset($authorData[$OPI_Code]) ? $authorData[$OPI_Code] : ['url' => '', 'avatar' => '', 'expertise' => ''];
+ return isset($authorData[$OPI_Code]) ? $authorData[$OPI_Code] : ['url' => '', 'avatar' => '', 'expertise' => ''];
}
}
From 6f02b1e2af03ce4d1b1f7c7987c3dfced2db0f03 Mon Sep 17 00:00:00 2001
From: LMR <59361885@qq.com>
Date: Thu, 21 Aug 2025 14:51:35 +0800
Subject: [PATCH 3/5] fix select bugs
---
.../views/bootstrap3/information_edit.php | 276 +++++++++---------
1 file changed, 138 insertions(+), 138 deletions(-)
diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php
index 34eaff3b..811dfd3a 100644
--- a/application/views/bootstrap3/information_edit.php
+++ b/application/views/bootstrap3/information_edit.php
@@ -38,7 +38,7 @@
}
};
- zNodes = ;
+ zNodes = ;
function onClickzTree(e, treeId, treeNode, clickFlag) {
var urlReQuery = "";
@@ -464,7 +464,7 @@
//}
}
//选择节点
- var node = zTree.getNodeByParam("id", is_id ?>);
+ var node = zTree.getNodeByParam("id", is_id ?>);
zTree.selectNode(node);
change_seo_count('ic_seo_title');
@@ -664,7 +664,7 @@
@@ -814,7 +814,7 @@
$setting_website_nav_active = trim(get_meta($information->ic_id, 'meta_website_nav'));
foreach ($setting_website_nav as $item) {
$strcasecmp_nav = strcasecmp($setting_website_nav_active, $item->im_value); ?>
- value="im_value ?>">
+ value="im_value ?>">
im_value ?>
- ic_id, 'meta_ct_page_type') === '' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === '' ? ' selected' : false; ?>>
无
- ic_id, 'meta_ct_page_type') === 'daytripindex' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'daytripindex' ? ' selected' : false; ?>>
一日游首页
- ic_id, 'meta_ct_page_type') === 'daytripdetail' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'daytripdetail' ? ' selected' : false; ?>>
一日游详细页
- ic_id, 'meta_ct_page_type') === 'daytriplist' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'daytriplist' ? ' selected' : false; ?>>
一日游列表页
- ic_id, 'meta_ct_page_type') === 'tourindex' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'tourindex' ? ' selected' : false; ?>>
线路首页
- ic_id, 'meta_ct_page_type') === 'tourdetail' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'tourdetail' ? ' selected' : false; ?>>
线路详细页
- ic_id, 'meta_ct_page_type') === 'tourlist' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'tourlist' ? ' selected' : false; ?>>
线路列表页
- ic_id, 'meta_ct_page_type') === 'attractionindex' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'attractionindex' ? ' selected' : false; ?>>
城市景点首页
- ic_id, 'meta_ct_page_type') === 'weatherpage' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'weatherpage' ? ' selected' : false; ?>>
城市天气页面
- ic_id, 'meta_ct_page_type') === 'customize' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'customize' ? ' selected' : false; ?>>
Customize表单
- ic_id, 'meta_ct_page_type') === 'contactus' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'contactus' ? ' selected' : false; ?>>
ContactUs表单
- ic_id, 'meta_ct_page_type') === 'pagewithform' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'pagewithform' ? ' selected' : false; ?>>
带表单信息页
- ic_id, 'meta_ct_page_type') === 'cruisedetails' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'cruisedetails' ? ' selected' : false; ?>>
游船详细页
- ic_id, 'meta_ct_page_type') === 'cruiseform' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'cruiseform' ? ' selected' : false; ?>>
游船预订表单
- ic_id, 'meta_ct_page_type') === 'daytripform' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'daytripform' ? ' selected' : false; ?>>
一日游预订表单
@@ -932,10 +932,10 @@
- ic_id, 'meta_ct_page_price') === 'no' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_price') === 'no' ? ' selected' : false; ?>>
否
- ic_id, 'meta_ct_page_price') === 'yes' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_price') === 'yes' ? ' selected' : false; ?>>
是
@@ -948,10 +948,10 @@
- ic_id, 'meta_ct_page_trainform') === 'no' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_trainform') === 'no' ? ' selected' : false; ?>>
否
- ic_id, 'meta_ct_page_trainform') === 'yes' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_trainform') === 'yes' ? ' selected' : false; ?>>
是
@@ -963,10 +963,10 @@
- ic_id, 'meta_ct_page_Carousel') === 'no' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_Carousel') === 'no' ? ' selected' : false; ?>>
否
- ic_id, 'meta_ct_page_Carousel') === 'yes' ? 'selected' : false; ?>>
+ ic_id, 'meta_ct_page_Carousel') === 'yes' ? ' selected' : false; ?>>
是
@@ -1053,7 +1053,7 @@
展示
- ic_id, 'meta_use_list_picture') === 'no' ? 'selected' : false; ?> value="no">不展示
+ ic_id, 'meta_use_list_picture') === 'no' ? ' selected' : false; ?> value="no">不展示
@@ -1096,7 +1096,7 @@
展示
- ic_id, 'meta_show_advertise') === 'no' ? 'selected' : false; ?> value='no'>不展示
+ ic_id, 'meta_show_advertise') === 'no' ? ' selected' : false; ?> value='no'>不展示
@@ -1116,15 +1116,15 @@
展示
- ic_id, 'meta_no_qa') === 'no' ? 'selected' : false; ?> value="no">不展示
+ ic_id, 'meta_no_qa') === 'no' ? ' selected' : false; ?> value="no">不展示
-
@@ -1172,7 +1172,7 @@
展示
- ic_id, 'meta_show_author') === 'no' ? 'selected' : false; ?> value="no">不展示
+ ic_id, 'meta_show_author') === 'no' ? ' selected' : false; ?> value="no">不展示
@@ -1201,7 +1201,7 @@
禁用
- ic_id, 'meta_pre_next_nav') === 'yes' ? 'selected' : false; ?>>
+ ic_id, 'meta_pre_next_nav') === 'yes' ? ' selected' : false; ?>>
启用
@@ -1274,7 +1274,7 @@
否
- ic_id, 'meta_festival_only_month') === 'yes' ? 'selected' : false; ?> value="yes">是
+ ic_id, 'meta_festival_only_month') === 'yes' ? ' selected' : false; ?> value="yes">是
@@ -1327,11 +1327,11 @@
index,follow
- ic_id, 'meta_index_set') === 'index,nofollow' ? 'selected' : false; ?> value="index,nofollow">index,nofollow
+ ic_id, 'meta_index_set') === 'index,nofollow' ? ' selected' : false; ?> value="index,nofollow">index,nofollow
- ic_id, 'meta_index_set') === 'noindex,follow' ? 'selected' : false; ?> value="noindex,follow">noindex,follow
+ ic_id, 'meta_index_set') === 'noindex,follow' ? ' selected' : false; ?> value="noindex,follow">noindex,follow
- ic_id, 'meta_index_set') === 'noindex,nofollow' ? 'selected' : false; ?> value="noindex,nofollow">noindex,nofollow
+ ic_id, 'meta_index_set') === 'noindex,nofollow' ? ' selected' : false; ?> value="noindex,nofollow">noindex,nofollow
@@ -1482,9 +1482,9 @@
ic_id, 'meta_haiwai'); ?>
selected="selected" value="">无
- selected="selected" value="info">海外信息
+ selected="selected" value="info">海外信息
- selected="selected" value="tour">海外线路
+ selected="selected" value="tour">海外线路
@@ -1514,9 +1514,9 @@
默认
- ic_id, 'meta_my_class') === 'newyear' ? 'selected' : false; ?> value="newyear">新年
+ ic_id, 'meta_my_class') === 'newyear' ? ' selected' : false; ?> value="newyear">新年
- ic_id, 'meta_my_class') === 'christmas' ? 'selected' : false; ?> value="christmas">圣诞
+ ic_id, 'meta_my_class') === 'christmas' ? ' selected' : false; ?> value="christmas">圣诞
@@ -1543,9 +1543,9 @@
ic_id, 'meta_haiwai'); ?>
selected="selected" value="">无
- selected="selected" value="info">海外信息
+ selected="selected" value="info">海外信息
- selected="selected" value="tour">海外线路
+ selected="selected" value="tour">海外线路
@@ -1602,7 +1602,7 @@
不展示
- ic_id, 'meta_use_like_author') === 'yes' ? 'selected' : false; ?>>
+ ic_id, 'meta_use_like_author') === 'yes' ? ' selected' : false; ?>>
展示
@@ -1635,7 +1635,7 @@
不隐藏
- ic_id, 'meta_media_button') === 'yes' ? 'selected' : false; ?>>
+ ic_id, 'meta_media_button') === 'yes' ? ' selected' : false; ?>>
隐藏
@@ -1654,52 +1654,52 @@
选择类别
- ic_id, 'meta_attraction_type') === 'Parks' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Parks' ? ' selected' : false; ?>>
Parks
- ic_id, 'meta_attraction_type') === 'Museums' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Museums' ? ' selected' : false; ?>>
Museums
- ic_id, 'meta_attraction_type') === 'Sights & Landmarks' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Sights & Landmarks' ? ' selected' : false; ?>>
Sights & Landmarks
- ic_id, 'meta_attraction_type') === 'Events' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Events' ? ' selected' : false; ?>>
Events
- ic_id, 'meta_attraction_type') === 'Religion Sites' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Religion Sites' ? ' selected' : false; ?>>
Religion Sites
- ic_id, 'meta_attraction_type') === 'Bridges' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Bridges' ? ' selected' : false; ?>>
Bridges
- ic_id, 'meta_attraction_type') === 'Nightlife' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Nightlife' ? ' selected' : false; ?>>
Nightlife
- ic_id, 'meta_attraction_type') === 'Zoos & Aquariums' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Zoos & Aquariums' ? ' selected' : false; ?>>
Zoos & Aquariums
- ic_id, 'meta_attraction_type') === 'Water & Amusement Parks' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Water & Amusement Parks' ? ' selected' : false; ?>>
Water & Amusement Parks
- ic_id, 'meta_attraction_type') === 'Shows' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Shows' ? ' selected' : false; ?>>
Shows
- ic_id, 'meta_attraction_type') === 'Food & Drinks' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Food & Drinks' ? ' selected' : false; ?>>
Food & Drinks
- ic_id, 'meta_attraction_type') === 'Shopping & Street' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Shopping & Street' ? ' selected' : false; ?>>
Shopping & Street
- ic_id, 'meta_attraction_type') === 'Wharf' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Wharf' ? ' selected' : false; ?>>
Wharf
- ic_id, 'meta_attraction_type') === 'Transports' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Transports' ? ' selected' : false; ?>>
Transports
- ic_id, 'meta_attraction_type') === 'Activities' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Activities' ? ' selected' : false; ?>>
Activities
- ic_id, 'meta_attraction_type') === 'Arts & Workshops' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Arts & Workshops' ? ' selected' : false; ?>>
Arts & Workshops
@@ -1713,19 +1713,19 @@
选择星级
- ic_id, 'meta_attraction_Star') === '1' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Star') === '1' ? ' selected' : false; ?>>
1
- ic_id, 'meta_attraction_Star') === '2' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Star') === '2' ? ' selected' : false; ?>>
2
- ic_id, 'meta_attraction_Star') === '3' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Star') === '3' ? ' selected' : false; ?>>
3
- ic_id, 'meta_attraction_Star') === '4' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Star') === '4' ? ' selected' : false; ?>>
4
- ic_id, 'meta_attraction_Star') === '5' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Star') === '5' ? ' selected' : false; ?>>
5
@@ -1739,34 +1739,34 @@
选择游览时间
- ic_id, 'meta_attraction_Hours') === '1' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '1' ? ' selected' : false; ?>>
1
- ic_id, 'meta_attraction_Hours') === '2' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '2' ? ' selected' : false; ?>>
2
- ic_id, 'meta_attraction_Hours') === '3' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '3' ? ' selected' : false; ?>>
3
- ic_id, 'meta_attraction_Hours') === '4' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '4' ? ' selected' : false; ?>>
4
- ic_id, 'meta_attraction_Hours') === '5' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '5' ? ' selected' : false; ?>>
5
- ic_id, 'meta_attraction_Hours') === '6' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '6' ? ' selected' : false; ?>>
6
- ic_id, 'meta_attraction_Hours') === '7' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '7' ? ' selected' : false; ?>>
7
- ic_id, 'meta_attraction_Hours') === '8' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '8' ? ' selected' : false; ?>>
8
- ic_id, 'meta_attraction_Hours') === '9' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '9' ? ' selected' : false; ?>>
9
- ic_id, 'meta_attraction_Hours') === '10' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '10' ? ' selected' : false; ?>>
10
@@ -1780,64 +1780,64 @@
选择排序
- ic_id, 'meta_attraction_Order') === '1' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '1' ? ' selected' : false; ?>>
1
- ic_id, 'meta_attraction_Order') === '2' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '2' ? ' selected' : false; ?>>
2
- ic_id, 'meta_attraction_Order') === '3' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '3' ? ' selected' : false; ?>>
3
- ic_id, 'meta_attraction_Order') === '4' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '4' ? ' selected' : false; ?>>
4
- ic_id, 'meta_attraction_Order') === '5' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '5' ? ' selected' : false; ?>>
5
- ic_id, 'meta_attraction_Order') === '6' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '6' ? ' selected' : false; ?>>
6
- ic_id, 'meta_attraction_Order') === '7' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '7' ? ' selected' : false; ?>>
7
- ic_id, 'meta_attraction_Order') === '8' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '8' ? ' selected' : false; ?>>
8
- ic_id, 'meta_attraction_Order') === '9' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '9' ? ' selected' : false; ?>>
9
- ic_id, 'meta_attraction_Order') === '10' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '10' ? ' selected' : false; ?>>
10
- ic_id, 'meta_attraction_Order') === '11' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '11' ? ' selected' : false; ?>>
11
- ic_id, 'meta_attraction_Order') === '12' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '12' ? ' selected' : false; ?>>
12
- ic_id, 'meta_attraction_Order') === '13' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '13' ? ' selected' : false; ?>>
13
- ic_id, 'meta_attraction_Order') === '14' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '14' ? ' selected' : false; ?>>
14
- ic_id, 'meta_attraction_Order') === '15' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '15' ? ' selected' : false; ?>>
15
- ic_id, 'meta_attraction_Order') === '16' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '16' ? ' selected' : false; ?>>
16
- ic_id, 'meta_attraction_Order') === '17' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '17' ? ' selected' : false; ?>>
17
- ic_id, 'meta_attraction_Order') === '18' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '18' ? ' selected' : false; ?>>
18
- ic_id, 'meta_attraction_Order') === '19' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '19' ? ' selected' : false; ?>>
19
- ic_id, 'meta_attraction_Order') === '20' ? 'selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '20' ? ' selected' : false; ?>>
20
@@ -1856,16 +1856,16 @@
- ic_id, 'meta_trippest_type') === 'general' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_type') === 'general' ? ' selected' : false; ?>>
普通
- ic_id, 'meta_trippest_type') === 'gg' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_type') === 'gg' ? ' selected' : false; ?>>
故宫
- ic_id, 'meta_trippest_type') === 'zjj' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_type') === 'zjj' ? ' selected' : false; ?>>
张家界
- ic_id, 'meta_trippest_type') === 'transfer' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_type') === 'transfer' ? ' selected' : false; ?>>
接送
@@ -1914,37 +1914,37 @@
- ic_id, 'meta_trippest_limitperson') === '0' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '0' ? ' selected' : false; ?>>
0
- ic_id, 'meta_trippest_limitperson') === '1' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '1' ? ' selected' : false; ?>>
1
- ic_id, 'meta_trippest_limitperson') === '2' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '2' ? ' selected' : false; ?>>
2
- ic_id, 'meta_trippest_limitperson') === '3' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '3' ? ' selected' : false; ?>>
3
- ic_id, 'meta_trippest_limitperson') === '4' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '4' ? ' selected' : false; ?>>
4
- ic_id, 'meta_trippest_limitperson') === '5' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '5' ? ' selected' : false; ?>>
5
- ic_id, 'meta_trippest_limitperson') === '6' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '6' ? ' selected' : false; ?>>
6
- ic_id, 'meta_trippest_limitperson') === '7' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '7' ? ' selected' : false; ?>>
7
- ic_id, 'meta_trippest_limitperson') === '8' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '8' ? ' selected' : false; ?>>
8
- ic_id, 'meta_trippest_limitperson') === '9' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '9' ? ' selected' : false; ?>>
9
- ic_id, 'meta_trippest_limitperson') === '-1' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '-1' ? ' selected' : false; ?>>
售完
@@ -1956,10 +1956,10 @@
- ic_id, 'meta_trippest_hoteladdress') === '是' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_hoteladdress') === '是' ? ' selected' : false; ?>>
是
- ic_id, 'meta_trippest_hoteladdress') === '否' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_hoteladdress') === '否' ? ' selected' : false; ?>>
否
@@ -1977,10 +1977,10 @@
- ic_id, 'meta_trippest_inquiryform') === 'common' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_inquiryform') === 'common' ? ' selected' : false; ?>>
普通预订
- ic_id, 'meta_trippest_inquiryform') === 'quickform' ? 'selected' : false; ?>>
+ ic_id, 'meta_trippest_inquiryform') === 'quickform' ? ' selected' : false; ?>>
快捷预订
@@ -2027,22 +2027,22 @@
- ic_id, 'meta_trainspread_Cancellation') === '' ? 'selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '' ? ' selected' : false; ?>>
通用模板
- ic_id, 'meta_trainspread_Cancellation') === '24小时' ? 'selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '24小时' ? ' selected' : false; ?>>
24小时
- ic_id, 'meta_trainspread_Cancellation') === '48小时' ? 'selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '48小时' ? ' selected' : false; ?>>
48小时
- ic_id, 'meta_trainspread_Cancellation') === '72小时' ? 'selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '72小时' ? ' selected' : false; ?>>
72小时
- ic_id, 'meta_trainspread_Cancellation') === '30天' ? 'selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '30天' ? ' selected' : false; ?>>
30天
- ic_id, 'meta_trainspread_Cancellation') === '不可取消' ? 'selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '不可取消' ? ' selected' : false; ?>>
不可取消
@@ -2128,7 +2128,7 @@
- ic_id, 'meta_google_ad_article')) ? '' : 'checked'; ?> />In
+ ic_id, 'meta_google_ad_article')) ? '' : 'checked'; ?> />In
Article 广告
@@ -2140,7 +2140,7 @@
$value) {
- $value == $information->ic_type ? $select_str = 'selected' : $select_str = ''; ?>
+ $value == $information->ic_type ? $select_str = ' selected' : $select_str = ''; ?>
value="">
@@ -2152,7 +2152,7 @@
$value) {
- $value == $information->ic_template ? $select_str = 'selected' : $select_str = ''; ?>
+ $value == $information->ic_template ? $select_str = ' selected' : $select_str = ''; ?>
value="">
@@ -2162,9 +2162,9 @@
是否作为面包屑显示
- ic_show_bread_crumbs == 0 ? 'selected' : false; ?> value="0">不显示
+ ic_show_bread_crumbs == 0 ? ' selected' : false; ?> value="0">不显示
- ic_show_bread_crumbs == 1 ? 'selected' : false; ?> value="1">显示
+ ic_show_bread_crumbs == 1 ? ' selected' : false; ?> value="1">显示
@@ -2176,7 +2176,7 @@
$userinfo = $this->session->userdata('session_admin');
$hasselected = false;
foreach ($editor_list as $editor_item) {
- //mb_strtolower($editor_item->OPI_Code) == mb_strtolower($information->ic_author) ? $select_str = 'selected' : $select_str = '';
+ //mb_strtolower($editor_item->OPI_Code) == mb_strtolower($information->ic_author) ? $select_str = ' selected' : $select_str = '';
if (mb_strtolower($editor_item->OPI_Code) == mb_strtolower($information->ic_author)) {
$select_str = 'selected';
$hasselected = true;
@@ -2194,7 +2194,7 @@
-
a_id == $information->ic_author) ? $select_str = 'selected' : $select_str = ''; ?>
+ ($author_item->a_id == $information->ic_author) ? $select_str = ' selected' : $select_str = ''; ?>
value="a_id; ?>">
a_name; ?>
@@ -2204,8 +2204,8 @@
是否发布
- ic_status == 0 ? 'selected' : false; ?> value="0">不发布
- ic_status == 1 ? 'selected' : false; ?> value="1">发布
+ ic_status == 0 ? ' selected' : false; ?> value="0">不发布
+ ic_status == 1 ? ' selected' : false; ?> value="1">发布
@@ -2227,9 +2227,9 @@
config->item('site_code'), ['cht', 'gm'])) {?>
- amp_status === '2') {
- echo 'disabled';
- }?> value="true" />AMP更新
+ amp_status === '2') {
+ echo 'disabled';
+ }?> value="true" />AMP更新
amp_status === '2') {
echo ' ';
}?>
@@ -2244,14 +2244,14 @@
";
@@ -464,7 +464,7 @@
//}
}
//选择节点
- var node = zTree.getNodeByParam("id", is_id ?>);
+ var node = zTree.getNodeByParam("id", is_id ?>);
zTree.selectNode(node);
change_seo_count('ic_seo_title');
@@ -664,7 +664,7 @@
@@ -869,49 +869,49 @@
- ic_id, 'meta_ct_page_type') === '' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === '' ? ' selected' : false; ?>>
无
- ic_id, 'meta_ct_page_type') === 'daytripindex' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'daytripindex' ? ' selected' : false; ?>>
一日游首页
- ic_id, 'meta_ct_page_type') === 'daytripdetail' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'daytripdetail' ? ' selected' : false; ?>>
一日游详细页
- ic_id, 'meta_ct_page_type') === 'daytriplist' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'daytriplist' ? ' selected' : false; ?>>
一日游列表页
- ic_id, 'meta_ct_page_type') === 'tourindex' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'tourindex' ? ' selected' : false; ?>>
线路首页
- ic_id, 'meta_ct_page_type') === 'tourdetail' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'tourdetail' ? ' selected' : false; ?>>
线路详细页
- ic_id, 'meta_ct_page_type') === 'tourlist' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'tourlist' ? ' selected' : false; ?>>
线路列表页
- ic_id, 'meta_ct_page_type') === 'attractionindex' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'attractionindex' ? ' selected' : false; ?>>
城市景点首页
- ic_id, 'meta_ct_page_type') === 'weatherpage' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'weatherpage' ? ' selected' : false; ?>>
城市天气页面
- ic_id, 'meta_ct_page_type') === 'customize' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'customize' ? ' selected' : false; ?>>
Customize表单
- ic_id, 'meta_ct_page_type') === 'contactus' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'contactus' ? ' selected' : false; ?>>
ContactUs表单
- ic_id, 'meta_ct_page_type') === 'pagewithform' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'pagewithform' ? ' selected' : false; ?>>
带表单信息页
- ic_id, 'meta_ct_page_type') === 'cruisedetails' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'cruisedetails' ? ' selected' : false; ?>>
游船详细页
- ic_id, 'meta_ct_page_type') === 'cruiseform' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'cruiseform' ? ' selected' : false; ?>>
游船预订表单
- ic_id, 'meta_ct_page_type') === 'daytripform' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_type') === 'daytripform' ? ' selected' : false; ?>>
一日游预订表单
@@ -932,10 +932,10 @@
- ic_id, 'meta_ct_page_price') === 'no' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_price') === 'no' ? ' selected' : false; ?>>
否
- ic_id, 'meta_ct_page_price') === 'yes' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_price') === 'yes' ? ' selected' : false; ?>>
是
@@ -948,10 +948,10 @@
- ic_id, 'meta_ct_page_trainform') === 'no' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_trainform') === 'no' ? ' selected' : false; ?>>
否
- ic_id, 'meta_ct_page_trainform') === 'yes' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_trainform') === 'yes' ? ' selected' : false; ?>>
是
@@ -963,10 +963,10 @@
- ic_id, 'meta_ct_page_Carousel') === 'no' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_Carousel') === 'no' ? ' selected' : false; ?>>
否
- ic_id, 'meta_ct_page_Carousel') === 'yes' ? ' selected' : false; ?>>
+ ic_id, 'meta_ct_page_Carousel') === 'yes' ? ' selected' : false; ?>>
是
@@ -1053,7 +1053,7 @@
展示
- ic_id, 'meta_use_list_picture') === 'no' ? ' selected' : false; ?> value="no">不展示
+ ic_id, 'meta_use_list_picture') === 'no' ? ' selected' : false; ?> value="no">不展示
@@ -1096,7 +1096,7 @@
展示
- ic_id, 'meta_show_advertise') === 'no' ? ' selected' : false; ?> value='no'>不展示
+ ic_id, 'meta_show_advertise') === 'no' ? ' selected' : false; ?> value='no'>不展示
@@ -1116,15 +1116,15 @@
展示
- ic_id, 'meta_no_qa') === 'no' ? ' selected' : false; ?> value="no">不展示
+ ic_id, 'meta_no_qa') === 'no' ? ' selected' : false; ?> value="no">不展示
-
@@ -1172,7 +1172,7 @@
展示
- ic_id, 'meta_show_author') === 'no' ? ' selected' : false; ?> value="no">不展示
+ ic_id, 'meta_show_author') === 'no' ? ' selected' : false; ?> value="no">不展示
@@ -1201,7 +1201,7 @@
禁用
- ic_id, 'meta_pre_next_nav') === 'yes' ? ' selected' : false; ?>>
+ ic_id, 'meta_pre_next_nav') === 'yes' ? ' selected' : false; ?>>
启用
@@ -1274,7 +1274,7 @@
否
- ic_id, 'meta_festival_only_month') === 'yes' ? ' selected' : false; ?> value="yes">是
+ ic_id, 'meta_festival_only_month') === 'yes' ? ' selected' : false; ?> value="yes">是
@@ -1327,11 +1327,11 @@
index,follow
- ic_id, 'meta_index_set') === 'index,nofollow' ? ' selected' : false; ?> value="index,nofollow">index,nofollow
+ ic_id, 'meta_index_set') === 'index,nofollow' ? ' selected' : false; ?> value="index,nofollow">index,nofollow
- ic_id, 'meta_index_set') === 'noindex,follow' ? ' selected' : false; ?> value="noindex,follow">noindex,follow
+ ic_id, 'meta_index_set') === 'noindex,follow' ? ' selected' : false; ?> value="noindex,follow">noindex,follow
- ic_id, 'meta_index_set') === 'noindex,nofollow' ? ' selected' : false; ?> value="noindex,nofollow">noindex,nofollow
+ ic_id, 'meta_index_set') === 'noindex,nofollow' ? ' selected' : false; ?> value="noindex,nofollow">noindex,nofollow
@@ -1482,9 +1482,9 @@
ic_id, 'meta_haiwai'); ?>
selected="selected" value="">无
- selected="selected" value="info">海外信息
+ selected="selected" value="info">海外信息
- selected="selected" value="tour">海外线路
+ selected="selected" value="tour">海外线路
@@ -1514,9 +1514,9 @@
默认
- ic_id, 'meta_my_class') === 'newyear' ? ' selected' : false; ?> value="newyear">新年
+ ic_id, 'meta_my_class') === 'newyear' ? ' selected' : false; ?> value="newyear">新年
- ic_id, 'meta_my_class') === 'christmas' ? ' selected' : false; ?> value="christmas">圣诞
+ ic_id, 'meta_my_class') === 'christmas' ? ' selected' : false; ?> value="christmas">圣诞
@@ -1543,9 +1543,9 @@
ic_id, 'meta_haiwai'); ?>
selected="selected" value="">无
- selected="selected" value="info">海外信息
+ selected="selected" value="info">海外信息
- selected="selected" value="tour">海外线路
+ selected="selected" value="tour">海外线路
@@ -1602,7 +1602,7 @@
不展示
- ic_id, 'meta_use_like_author') === 'yes' ? ' selected' : false; ?>>
+ ic_id, 'meta_use_like_author') === 'yes' ? ' selected' : false; ?>>
展示
@@ -1635,7 +1635,7 @@
不隐藏
- ic_id, 'meta_media_button') === 'yes' ? ' selected' : false; ?>>
+ ic_id, 'meta_media_button') === 'yes' ? ' selected' : false; ?>>
隐藏
@@ -1654,52 +1654,52 @@
选择类别
- ic_id, 'meta_attraction_type') === 'Parks' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Parks' ? ' selected' : false; ?>>
Parks
- ic_id, 'meta_attraction_type') === 'Museums' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Museums' ? ' selected' : false; ?>>
Museums
- ic_id, 'meta_attraction_type') === 'Sights & Landmarks' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Sights & Landmarks' ? ' selected' : false; ?>>
Sights & Landmarks
- ic_id, 'meta_attraction_type') === 'Events' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Events' ? ' selected' : false; ?>>
Events
- ic_id, 'meta_attraction_type') === 'Religion Sites' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Religion Sites' ? ' selected' : false; ?>>
Religion Sites
- ic_id, 'meta_attraction_type') === 'Bridges' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Bridges' ? ' selected' : false; ?>>
Bridges
- ic_id, 'meta_attraction_type') === 'Nightlife' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Nightlife' ? ' selected' : false; ?>>
Nightlife
- ic_id, 'meta_attraction_type') === 'Zoos & Aquariums' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Zoos & Aquariums' ? ' selected' : false; ?>>
Zoos & Aquariums
- ic_id, 'meta_attraction_type') === 'Water & Amusement Parks' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Water & Amusement Parks' ? ' selected' : false; ?>>
Water & Amusement Parks
- ic_id, 'meta_attraction_type') === 'Shows' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Shows' ? ' selected' : false; ?>>
Shows
- ic_id, 'meta_attraction_type') === 'Food & Drinks' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Food & Drinks' ? ' selected' : false; ?>>
Food & Drinks
- ic_id, 'meta_attraction_type') === 'Shopping & Street' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Shopping & Street' ? ' selected' : false; ?>>
Shopping & Street
- ic_id, 'meta_attraction_type') === 'Wharf' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Wharf' ? ' selected' : false; ?>>
Wharf
- ic_id, 'meta_attraction_type') === 'Transports' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Transports' ? ' selected' : false; ?>>
Transports
- ic_id, 'meta_attraction_type') === 'Activities' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Activities' ? ' selected' : false; ?>>
Activities
- ic_id, 'meta_attraction_type') === 'Arts & Workshops' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_type') === 'Arts & Workshops' ? ' selected' : false; ?>>
Arts & Workshops
@@ -1713,19 +1713,19 @@
选择星级
- ic_id, 'meta_attraction_Star') === '1' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Star') === '1' ? ' selected' : false; ?>>
1
- ic_id, 'meta_attraction_Star') === '2' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Star') === '2' ? ' selected' : false; ?>>
2
- ic_id, 'meta_attraction_Star') === '3' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Star') === '3' ? ' selected' : false; ?>>
3
- ic_id, 'meta_attraction_Star') === '4' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Star') === '4' ? ' selected' : false; ?>>
4
- ic_id, 'meta_attraction_Star') === '5' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Star') === '5' ? ' selected' : false; ?>>
5
@@ -1739,34 +1739,34 @@
选择游览时间
- ic_id, 'meta_attraction_Hours') === '1' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '1' ? ' selected' : false; ?>>
1
- ic_id, 'meta_attraction_Hours') === '2' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '2' ? ' selected' : false; ?>>
2
- ic_id, 'meta_attraction_Hours') === '3' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '3' ? ' selected' : false; ?>>
3
- ic_id, 'meta_attraction_Hours') === '4' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '4' ? ' selected' : false; ?>>
4
- ic_id, 'meta_attraction_Hours') === '5' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '5' ? ' selected' : false; ?>>
5
- ic_id, 'meta_attraction_Hours') === '6' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '6' ? ' selected' : false; ?>>
6
- ic_id, 'meta_attraction_Hours') === '7' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '7' ? ' selected' : false; ?>>
7
- ic_id, 'meta_attraction_Hours') === '8' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '8' ? ' selected' : false; ?>>
8
- ic_id, 'meta_attraction_Hours') === '9' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '9' ? ' selected' : false; ?>>
9
- ic_id, 'meta_attraction_Hours') === '10' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Hours') === '10' ? ' selected' : false; ?>>
10
@@ -1780,64 +1780,64 @@
选择排序
- ic_id, 'meta_attraction_Order') === '1' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '1' ? ' selected' : false; ?>>
1
- ic_id, 'meta_attraction_Order') === '2' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '2' ? ' selected' : false; ?>>
2
- ic_id, 'meta_attraction_Order') === '3' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '3' ? ' selected' : false; ?>>
3
- ic_id, 'meta_attraction_Order') === '4' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '4' ? ' selected' : false; ?>>
4
- ic_id, 'meta_attraction_Order') === '5' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '5' ? ' selected' : false; ?>>
5
- ic_id, 'meta_attraction_Order') === '6' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '6' ? ' selected' : false; ?>>
6
- ic_id, 'meta_attraction_Order') === '7' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '7' ? ' selected' : false; ?>>
7
- ic_id, 'meta_attraction_Order') === '8' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '8' ? ' selected' : false; ?>>
8
- ic_id, 'meta_attraction_Order') === '9' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '9' ? ' selected' : false; ?>>
9
- ic_id, 'meta_attraction_Order') === '10' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '10' ? ' selected' : false; ?>>
10
- ic_id, 'meta_attraction_Order') === '11' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '11' ? ' selected' : false; ?>>
11
- ic_id, 'meta_attraction_Order') === '12' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '12' ? ' selected' : false; ?>>
12
- ic_id, 'meta_attraction_Order') === '13' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '13' ? ' selected' : false; ?>>
13
- ic_id, 'meta_attraction_Order') === '14' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '14' ? ' selected' : false; ?>>
14
- ic_id, 'meta_attraction_Order') === '15' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '15' ? ' selected' : false; ?>>
15
- ic_id, 'meta_attraction_Order') === '16' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '16' ? ' selected' : false; ?>>
16
- ic_id, 'meta_attraction_Order') === '17' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '17' ? ' selected' : false; ?>>
17
- ic_id, 'meta_attraction_Order') === '18' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '18' ? ' selected' : false; ?>>
18
- ic_id, 'meta_attraction_Order') === '19' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '19' ? ' selected' : false; ?>>
19
- ic_id, 'meta_attraction_Order') === '20' ? ' selected' : false; ?>>
+ ic_id, 'meta_attraction_Order') === '20' ? ' selected' : false; ?>>
20
@@ -1856,16 +1856,16 @@
- ic_id, 'meta_trippest_type') === 'general' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_type') === 'general' ? ' selected' : false; ?>>
普通
- ic_id, 'meta_trippest_type') === 'gg' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_type') === 'gg' ? ' selected' : false; ?>>
故宫
- ic_id, 'meta_trippest_type') === 'zjj' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_type') === 'zjj' ? ' selected' : false; ?>>
张家界
- ic_id, 'meta_trippest_type') === 'transfer' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_type') === 'transfer' ? ' selected' : false; ?>>
接送
@@ -1914,37 +1914,37 @@
- ic_id, 'meta_trippest_limitperson') === '0' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '0' ? ' selected' : false; ?>>
0
- ic_id, 'meta_trippest_limitperson') === '1' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '1' ? ' selected' : false; ?>>
1
- ic_id, 'meta_trippest_limitperson') === '2' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '2' ? ' selected' : false; ?>>
2
- ic_id, 'meta_trippest_limitperson') === '3' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '3' ? ' selected' : false; ?>>
3
- ic_id, 'meta_trippest_limitperson') === '4' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '4' ? ' selected' : false; ?>>
4
- ic_id, 'meta_trippest_limitperson') === '5' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '5' ? ' selected' : false; ?>>
5
- ic_id, 'meta_trippest_limitperson') === '6' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '6' ? ' selected' : false; ?>>
6
- ic_id, 'meta_trippest_limitperson') === '7' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '7' ? ' selected' : false; ?>>
7
- ic_id, 'meta_trippest_limitperson') === '8' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '8' ? ' selected' : false; ?>>
8
- ic_id, 'meta_trippest_limitperson') === '9' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '9' ? ' selected' : false; ?>>
9
- ic_id, 'meta_trippest_limitperson') === '-1' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_limitperson') === '-1' ? ' selected' : false; ?>>
售完
@@ -1956,10 +1956,10 @@
- ic_id, 'meta_trippest_hoteladdress') === '是' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_hoteladdress') === '是' ? ' selected' : false; ?>>
是
- ic_id, 'meta_trippest_hoteladdress') === '否' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_hoteladdress') === '否' ? ' selected' : false; ?>>
否
@@ -1977,10 +1977,10 @@
- ic_id, 'meta_trippest_inquiryform') === 'common' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_inquiryform') === 'common' ? ' selected' : false; ?>>
普通预订
- ic_id, 'meta_trippest_inquiryform') === 'quickform' ? ' selected' : false; ?>>
+ ic_id, 'meta_trippest_inquiryform') === 'quickform' ? ' selected' : false; ?>>
快捷预订
@@ -2027,22 +2027,22 @@
- ic_id, 'meta_trainspread_Cancellation') === '' ? ' selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '' ? ' selected' : false; ?>>
通用模板
- ic_id, 'meta_trainspread_Cancellation') === '24小时' ? ' selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '24小时' ? ' selected' : false; ?>>
24小时
- ic_id, 'meta_trainspread_Cancellation') === '48小时' ? ' selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '48小时' ? ' selected' : false; ?>>
48小时
- ic_id, 'meta_trainspread_Cancellation') === '72小时' ? ' selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '72小时' ? ' selected' : false; ?>>
72小时
- ic_id, 'meta_trainspread_Cancellation') === '30天' ? ' selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '30天' ? ' selected' : false; ?>>
30天
- ic_id, 'meta_trainspread_Cancellation') === '不可取消' ? ' selected' : false; ?>>
+ ic_id, 'meta_trainspread_Cancellation') === '不可取消' ? ' selected' : false; ?>>
不可取消
@@ -2128,7 +2128,7 @@
- ic_id, 'meta_google_ad_article')) ? '' : 'checked'; ?> />In
+ ic_id, 'meta_google_ad_article')) ? '' : 'checked'; ?> />In
Article 广告
@@ -2162,9 +2162,9 @@
是否作为面包屑显示
- ic_show_bread_crumbs == 0 ? ' selected' : false; ?> value="0">不显示
+ ic_show_bread_crumbs == 0 ? ' selected' : false; ?> value="0">不显示
- ic_show_bread_crumbs == 1 ? ' selected' : false; ?> value="1">显示
+ ic_show_bread_crumbs == 1 ? ' selected' : false; ?> value="1">显示
@@ -2178,12 +2178,12 @@
foreach ($editor_list as $editor_item) {
//mb_strtolower($editor_item->OPI_Code) == mb_strtolower($information->ic_author) ? $select_str = ' selected' : $select_str = '';
if (mb_strtolower($editor_item->OPI_Code) == mb_strtolower($information->ic_author)) {
- $select_str = 'selected';
+ $select_str = ' selected';
$hasselected = true;
} else {
$select_str = '';
if (! $hasselected && ! empty($information->ic_content) && $information->ic_url_title != 'New Information' && $editor_item->OPI_Code == 'PKL') {
- $select_str = 'selected';
+ $select_str = ' selected';
}
}?>
value="OPI_Code; ?>">
@@ -2204,8 +2204,8 @@
是否发布
- ic_status == 0 ? ' selected' : false; ?> value="0">不发布
- ic_status == 1 ? ' selected' : false; ?> value="1">发布
+ ic_status == 0 ? ' selected' : false; ?> value="0">不发布
+ ic_status == 1 ? ' selected' : false; ?> value="1">发布
@@ -2227,9 +2227,9 @@
config->item('site_code'), ['cht', 'gm'])) {?>
- amp_status === '2') {
- echo 'disabled';
- }?> value="true" />AMP更新
+ amp_status === '2') {
+ echo 'disabled';
+ }?> value="true" />AMP更新
amp_status === '2') {
echo ' ';
}?>
@@ -2244,14 +2244,14 @@