diff --git a/application/controllers/information.php b/application/controllers/information.php
index 5905397f..0838e361 100644
--- a/application/controllers/information.php
+++ b/application/controllers/information.php
@@ -4,9 +4,11 @@ if (! defined('BASEPATH')) {
exit('No direct script access allowed');
}
-class Information extends CI_Controller {
+class Information extends CI_Controller
+{
- public function __construct() {
+ public function __construct()
+ {
parent::__construct();
$this->permission->is_admin();
//$this->output->enable_profiler(TRUE);
@@ -32,11 +34,13 @@ class Information extends CI_Controller {
}
- public function index() {
+ public function index()
+ {
echo '信息首页';
}
- public function add($is_parent_id) {
+ public function add($is_parent_id)
+ {
//添加空内容.
$this->InfoContents_model->Add('', 'New Information', '', '', '', '', '', '', '', 0, 0, '', '', 0, 0, '', '', 0, '', 0, '', '');
$infocontent = $this->InfoContents_model->get_ic_contents($this->InfoContents_model->insert_id);
@@ -54,7 +58,8 @@ class Information extends CI_Controller {
}
//移动结构顺序
- public function move() {
+ public function move()
+ {
//网站会提交一个同级节点id列表字符串,按照这个去排序
$parent_id = $this->input->post('pid');
$idsStr = $this->input->post('ids');
@@ -75,7 +80,8 @@ class Information extends CI_Controller {
//把文章移动到任意板块文章下
//is_id 信息结构ID,is_parent_id即将转移到的信息结构id
- public function move_by_is_id() {
+ public function move_by_is_id()
+ {
$data = [];
$is_id = $this->input->post('is_id');
$is_parent_id = $this->input->post('is_parent_id');
@@ -102,7 +108,8 @@ class Information extends CI_Controller {
//[国际->国际]复制节点结构到任意站点的节点下面。-- lmr
//is_id 信息结构ID,
- public function copy_by_is_id($src_is_id, $dest_is_id) {
+ public function copy_by_is_id($src_is_id, $dest_is_id)
+ {
if (empty($src_is_id) || empty($src_is_id)) {
echo 'need 2 is_id v1';
return false;
@@ -243,7 +250,6 @@ class Information extends CI_Controller {
// 添加节点
$this->InfoStructures_model->Add_with_sitecode($target_is_id, $this->InfoContents_model->insert_id, 999, $dest->is_sitecode);
$node_map[$item->is_id] = $this->InfoStructures_model->insert_id;
-
}
print_r($node_map);
@@ -260,7 +266,8 @@ class Information extends CI_Controller {
//[国际<-德语][在int.mycht.cn上执行]复制节点结构到任意站点的节点下面。-- lmr
//is_id 信息结构ID,
- public function copy_by_is_id_gm($src_is_id, $dest_is_id) {
+ public function copy_by_is_id_gm($src_is_id, $dest_is_id)
+ {
if (empty($src_is_id) || empty($src_is_id)) {
echo 'need 2 is_id v1';
return false;
@@ -408,7 +415,6 @@ class Information extends CI_Controller {
// 添加节点
$this->InfoStructures_model->Add_with_sitecode($target_is_id, $this->InfoContents_model->insert_id, 999, $dest->is_sitecode);
$node_map[$item->is_id] = $this->InfoStructures_model->insert_id;
-
}
print_r($node_map);
@@ -423,7 +429,8 @@ class Information extends CI_Controller {
return true;
}
- public function delete($is_id) {
+ public function delete($is_id)
+ {
//查询结构信息
$Structure = $this->InfoStructures_model->Detail($is_id);
if ($Structure == false) {
@@ -466,7 +473,8 @@ class Information extends CI_Controller {
}
}
- public function edit($is_id) {
+ public function edit($is_id)
+ {
set_time_limit(30);
//$this->output->enable_profiler(true);
//查询结构信息
@@ -507,7 +515,7 @@ class Information extends CI_Controller {
$data['unlink_landscape_list'] = [];
//可选的展示模板
- if (in_array($this->config->item('site_code'), ['vac', 'vc', 'jp', 'ru', 'it'])) {
+ if (in_array($this->config->item('site_code'), ['vac', 'vc', 'jp', 'ru', 'it', 'gm_jp'])) {
$this->config->set_item('templates', $this->config->item('templates_i'));
}
@@ -541,47 +549,47 @@ class Information extends CI_Controller {
$data['infoTypeList'] = $this->config->item('InfoType_htravel');
} else {
switch ($data['rootInformation']->ic_ht_area_type) {
- case 'c': //城市
- $data['infoTypeList'] = $this->config->item('InfoType_city');
- $data['unlink_landscape_list'] = $this->Information_model->get_unlink_landscape_list($data['rootInformation']->ic_ht_area_id);
- break;
- case 'p': //省份
- $data['infoTypeList'] = $this->config->item('InfoType_province');
- break;
- case 'n': //国家
- $data['infoTypeList'] = $this->config->item('InfoType_country');
- break;
- case 't': //特殊区域
- $data['infoTypeList'] = $this->config->item('InfoType_special');
- break;
- case 'e': //大洲
- $data['infoTypeList'] = [];
- break;
- case 'z': //公民游
- $data['infoTypeList'] = $this->config->item('InfoType_citizen');
- break;
- case 'v': //视频
- $data['infoTypeList'] = $this->config->item('InfoType_video');
- break;
- case 'f': //节庆
- $data['infoTypeList'] = $this->config->item('InfoType_festival');
- break;
- case 'pd': //产品管理
- $data['infoTypeList'] = $this->config->item('InfoType_product');
- //LMR 2016-7-14
- if (in_array($this->config->item('site_code'), ['vac', 'vc', 'jp', 'ru', 'it'])) {
- $this->config->set_item('templates', $this->config->item('templates_product_i'));
- } else if ($this->config->item('site_code') === 'gm') {
- $this->config->set_item('templates', $this->config->item('templates_product_gm'));
- $data['infoTypeList'] = $this->config->item('InfoType_product_gm');
- } else {
- $this->config->set_item('templates', $this->config->item('templates_product'));
- }
+ case 'c': //城市
+ $data['infoTypeList'] = $this->config->item('InfoType_city');
+ $data['unlink_landscape_list'] = $this->Information_model->get_unlink_landscape_list($data['rootInformation']->ic_ht_area_id);
+ break;
+ case 'p': //省份
+ $data['infoTypeList'] = $this->config->item('InfoType_province');
+ break;
+ case 'n': //国家
+ $data['infoTypeList'] = $this->config->item('InfoType_country');
+ break;
+ case 't': //特殊区域
+ $data['infoTypeList'] = $this->config->item('InfoType_special');
+ break;
+ case 'e': //大洲
+ $data['infoTypeList'] = [];
+ break;
+ case 'z': //公民游
+ $data['infoTypeList'] = $this->config->item('InfoType_citizen');
+ break;
+ case 'v': //视频
+ $data['infoTypeList'] = $this->config->item('InfoType_video');
+ break;
+ case 'f': //节庆
+ $data['infoTypeList'] = $this->config->item('InfoType_festival');
+ break;
+ case 'pd': //产品管理
+ $data['infoTypeList'] = $this->config->item('InfoType_product');
+ //LMR 2016-7-14
+ if (in_array($this->config->item('site_code'), ['vac', 'vc', 'jp', 'ru', 'it'])) {
+ $this->config->set_item('templates', $this->config->item('templates_product_i'));
+ } else if ($this->config->item('site_code') === 'gm') {
+ $this->config->set_item('templates', $this->config->item('templates_product_gm'));
+ $data['infoTypeList'] = $this->config->item('InfoType_product_gm');
+ } else {
+ $this->config->set_item('templates', $this->config->item('templates_product'));
+ }
- break;
- default:
- $data['infoTypeList'] = ['不设置' => 'none', '首页' => 'root', '线路' => 'pd_tour'];
- break;
+ break;
+ default:
+ $data['infoTypeList'] = ['不设置' => 'none', '首页' => 'root', '线路' => 'pd_tour'];
+ break;
}
}
@@ -590,12 +598,12 @@ class Information extends CI_Controller {
$data['productTypeList'] = $this->config->item('ProductType_HT');
//获取绑定的产品名称
switch ($data['information']->ic_ht_product_type) {
- case 't':
- $data['product_title'] = $this->Landscape_model->get_landscape_title($data['information']->ic_ht_product_id);
- break;
- default:
- $data['product_title'] = '';
- break;
+ case 't':
+ $data['product_title'] = $this->Landscape_model->get_landscape_title($data['information']->ic_ht_product_id);
+ break;
+ default:
+ $data['product_title'] = '';
+ break;
}
//获取最后更新者信息
$data['last_edit_info'] = $this->Logs_model->get_last_edit($is_id);
@@ -666,7 +674,8 @@ class Information extends CI_Controller {
$this->load->view('bootstrap3/footer');
}
- public function edit_save() {
+ public function edit_save()
+ {
header('Cache-Control: no-cache');
$information = $this->Information_model->Detail($this->input->post('is_id'));
if ($information === false) {
@@ -794,7 +803,7 @@ class Information extends CI_Controller {
} else if (strcasecmp($site_code, "cht") == 0 && ! empty($auto_update_cache)) {
$update_info_log = $this->update_cache($ic_url);
} else if (strcasecmp($site_code, "htravel") == 0 && ! empty($auto_update_cache)) {
- //$update_info_log = $this->update_cache($ic_url);
+ //$update_info_log = $this->update_cache($ic_url);
} else if (strcasecmp($site_code, "cht") != 0 && strcasecmp($site_code, "gm") != 0 && strcasecmp($site_code, "htravel") != 0) { //非cht站点并且非GM并且非AH
$update_info_log = $this->update_cache($ic_url);
} else if (strcasecmp($site_code, "ct") == 0 && ! empty($auto_update_cache)) {
@@ -839,7 +848,8 @@ class Information extends CI_Controller {
}
//URL不重复检查
- public function ic_url_check() {
+ public function ic_url_check()
+ {
if ($this->input->post('ignore_url_check')) {
return true;
}
@@ -853,14 +863,16 @@ class Information extends CI_Controller {
}
//URL格式检查,不能包含大小写、空格等特殊字符
- public function ic_url_format($url) {
+ public function ic_url_format($url)
+ {
if ($url != mb_strtolower($url) || strpos($url, ' ') !== false || strpos($url, '--') !== false || strpos($url, ')') !== false || strpos($url, '(') !== false || strpos($url, '//') !== false || strpos($url, '\\') !== false) {
return false;
}
return true;
}
- public function update_www_cache($ic_id) {
+ public function update_www_cache($ic_id)
+ {
$information = $this->Information_model->detail_by_ic_id($ic_id);
if (empty($information)) {
echo json_encode(['name' => 'no', 'data' => '找不到这个页面']);
@@ -878,7 +890,7 @@ class Information extends CI_Controller {
} else if ($this->config->item('site_code') == 'jh') {
$this->make_www_cache_jh('pc', $information, $recommand_information);
$this->make_www_cache_jh('mobile', $information, $recommand_information);
- }else if ($this->config->item('site_code') == 'thailand') {
+ } else if ($this->config->item('site_code') == 'thailand') {
$this->make_www_cache_thailand('pc', $information, $recommand_information);
$this->make_www_cache_thailand('mobile', $information, $recommand_information);
} else if ($this->config->item('site_code') == 'chinatravel') {
@@ -910,7 +922,8 @@ class Information extends CI_Controller {
}
//静态文件操作
- public function html_file_helper($active = 'find', $ic_url = false) {
+ public function html_file_helper($active = 'find', $ic_url = false)
+ {
if (empty($ic_url)) {
$ic_url = $this->input->get_post('ic_url');
}
@@ -926,53 +939,54 @@ class Information extends CI_Controller {
$html_file_pc = $html_file . '-pc.htm';
switch ($active) {
- case 'find': //寻找静态文件
- if (is_file($html_file_mobile) || is_file($html_file_pc)) {
- return true;
- } else {
+ case 'find': //寻找静态文件
+ if (is_file($html_file_mobile) || is_file($html_file_pc)) {
+ return true;
+ } else {
+ return false;
+ }
+ // break;
+ case 'delete':
+ if (is_file($html_file_mobile)) {
+ unlink($html_file_mobile);
+ }
+ if (is_file($html_file_pc)) {
+ unlink($html_file_pc);
+ }
+ echo '删除静态文件成功! ' . $ic_url;
+ break;
+ default:
return false;
- }
- // break;
- case 'delete':
- if (is_file($html_file_mobile)) {
- unlink($html_file_mobile);
- }
- if (is_file($html_file_pc)) {
- unlink($html_file_pc);
- }
- echo '删除静态文件成功! ' . $ic_url;
- break;
- default:
- return false;
}
return false;
}
//生成静态文件 $device='mobile' or 'pc'
- public function make_www_cache($device, $information, $recommand_information) {
+ public function make_www_cache($device, $information, $recommand_information)
+ {
$data = [];
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;
- }
- break;
- case 'pc':
- //获取PC的模板,如果有的话
- $template_path = 'mobile_first/' . $this->config->item('site_code');
- if (is_file(APPPATH . 'views/' . $template_path . '-pc' . EXT)) {
- $template = $this->load->view($template_path . '-pc', '', true);
- $html_path_ext = '-pc.htm';
- } else {
- return false;
- }
- break;
- default:
+ 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;
+ }
+ break;
+ case 'pc':
+ //获取PC的模板,如果有的话
+ $template_path = 'mobile_first/' . $this->config->item('site_code');
+ if (is_file(APPPATH . 'views/' . $template_path . '-pc' . EXT)) {
+ $template = $this->load->view($template_path . '-pc', '', true);
+ $html_path_ext = '-pc.htm';
+ } else {
+ return false;
+ }
+ break;
+ default:
}
// CH Home 下层节点名称和链接映射
@@ -1115,9 +1129,9 @@ class Information extends CI_Controller {
);
}
- //火车票搜索框添加 -- zp
+ //火车票搜索框添加 -- zp
if ($information->is_parent_id == "278008234" && $information->ic_url != "/china-trains/") { //20240403 字节
- //本地测试的火车父类ID为:278035939 。网前为:278008234
+ //本地测试的火车父类ID为:278035939 。网前为:278008234
$meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai
$data_TrainCity = [];
$data_TrainCity["from"] = "";
@@ -1271,30 +1285,30 @@ class Information extends CI_Controller {
if (isset($dataTrippest['PagDetail']) && $dataTrippest['PagDetail'] != null) {
$PAG_SourceType = $dataTrippest['PagDetail']->PAG_SourceType;
switch ($PAG_SourceType) {
- case '132001':
- $dataTrippest['PAG_SourceType'] = "beijing";
- break;
- case '132002':
- $dataTrippest['PAG_SourceType'] = "shanghai";
- break;
- case '132003':
- $dataTrippest['PAG_SourceType'] = "xian";
- break;
- case '132004':
- $dataTrippest['PAG_SourceType'] = "guilin";
- break;
- case '132005':
- $dataTrippest['PAG_SourceType'] = "chengdu";
- break;
- case '132006':
- $dataTrippest['PAG_SourceType'] = "zhangjiajie";
- break;
- case '132007':
- $dataTrippest['PAG_SourceType'] = "huangshan";
- break;
- default:
- $dataTrippest['PAG_SourceType'] = "";
- break;
+ case '132001':
+ $dataTrippest['PAG_SourceType'] = "beijing";
+ break;
+ case '132002':
+ $dataTrippest['PAG_SourceType'] = "shanghai";
+ break;
+ case '132003':
+ $dataTrippest['PAG_SourceType'] = "xian";
+ break;
+ case '132004':
+ $dataTrippest['PAG_SourceType'] = "guilin";
+ break;
+ case '132005':
+ $dataTrippest['PAG_SourceType'] = "chengdu";
+ break;
+ case '132006':
+ $dataTrippest['PAG_SourceType'] = "zhangjiajie";
+ break;
+ case '132007':
+ $dataTrippest['PAG_SourceType'] = "huangshan";
+ break;
+ default:
+ $dataTrippest['PAG_SourceType'] = "";
+ break;
}
//每周发团
@@ -1333,7 +1347,7 @@ class Information extends CI_Controller {
//---day tours end ----
- //信息推荐
+ //信息推荐
$template_recommand = $recommand_information; //$this->recommand_information($information); 从外面传进来,pc和移动只需要查一次,减少数据库负担
$template = str_replace('', $this->load->view($template_path . '-next', ['recommands' => $template_recommand], true), $template);
$meta_show_advertise = get_meta($information->ic_id, 'meta_show_advertise');
@@ -1422,7 +1436,7 @@ class Information extends CI_Controller {
}
}
- //顶部全屏大图
+ //顶部全屏大图
if ($device == 'mobile') { //移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
} else {
@@ -1434,7 +1448,6 @@ class Information extends CI_Controller {
$meta_video_picture = get_meta($information->ic_id, 'meta_video_picture');
if (! empty($meta_news_video) && ! empty($meta_video_picture)) {
$template = str_replace('', '
', $template);
-
}
if (is_file('D:/wwwroot/origin-data.chinahighlights.com/css/mobile-first.css')) { //主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
@@ -1532,7 +1545,8 @@ class Information extends CI_Controller {
}
// 六个月以前的文章不显示发布时间
- private function get_publish_date_in_6_month($information) {
+ private function get_publish_date_in_6_month($information)
+ {
$publish_date_in_6_month = NULL;
$meta_news_createdate = get_meta($information->ic_id, 'meta_news_createdate');
@@ -1550,7 +1564,8 @@ class Information extends CI_Controller {
return $publish_date_in_6_month;
}
- public function test_recommand() {
+ public function test_recommand()
+ {
$information = $this->Information_model->Detail($this->input->get('is_id'));
$recommand_information = $this->recommand_information($information);
// var_dump($recommand_information);
@@ -1592,7 +1607,8 @@ class Information extends CI_Controller {
echo $tips_right_list_content;
}
- public function test_feedback() {
+ public function test_feedback()
+ {
$city_name_list = [];
$city_name_list[] = 'Bangkok';
$feedback_list = $this->Feedback_model->get_feedback_by_city_list($city_name_list);
@@ -1602,7 +1618,8 @@ class Information extends CI_Controller {
var_dump($feedback_list);
}
- public function test_ch_feedback30() {
+ public function test_ch_feedback30()
+ {
$feedback30_array = [];
preg_match_all('^^', '', $feedback30_array);
if (! empty($feedback30_array)) {
@@ -1619,13 +1636,15 @@ class Information extends CI_Controller {
}
}
- public function test_get_feedback_by_city_name() {
+ public function test_get_feedback_by_city_name()
+ {
$feedback_list = $this->Feedback_model->get_feedback_by_city_name('Bangkok', 5);
var_dump($feedback_list);
}
- public function test_feedback_city_list() {
+ public function test_feedback_city_list()
+ {
$feedback_city_array = [];
preg_match_all('^^', '', $feedback_city_array);
if (! empty($feedback_city_array)) {
@@ -1654,7 +1673,8 @@ class Information extends CI_Controller {
// #ah-mtc-3,st,2#
// CH: 1; AH: 28; GH : 33
- public function test_price() {
+ public function test_price()
+ {
$price_rule = base64_decode($this->input->get('price_rule'));
$dept_sn = $this->input->get('dept_sn');
$price_item_array = $this->price_pregmatch($price_rule);
@@ -1673,7 +1693,8 @@ class Information extends CI_Controller {
* @param string $price_content 包含价格标签的内容
* @return array 包含价格与占位符的数组
*/
- public function parse_price_tag($price_content, $dept_sn = 28) {
+ public function parse_price_tag($price_content, $dept_sn = 28)
+ {
$price_item_array = $this->price_pregmatch($price_content);
$price_tag_list = [];
if (! empty($price_item_array)) {
@@ -1684,76 +1705,76 @@ class Information extends CI_Controller {
$price = $this->PrimeLinePrice_model->search($price_item->cli_no, 1, $price_item->cli_grade, $price_item->person_size, $price_date, $dept_sn);
if (! empty($price)) {
switch (strtoupper($price_item->price_people)) {
- case 'A':
- $price_number = $price->PLP_AdultUnitPrice;
- break;
- case 'C':
- $price_number = $price->PLP_ChildUnitPrice;
- break;
- case 'B':
- $price_number = $price->PLP_BabyUnitPrice;
- break;
- case 'R':
- $price_number = $price->PLP_RoomDiffPrice;
- break;
- case 'AR':
- $price_number = $price->PLP_AdultUnitPrice + $price->PLP_RoomDiffPrice; //成人加单间房差
- break;
- default:
- $price_number = $price->PLP_AdultUnitPrice;
- }
- } else {
- $price = $this->Price_model->search($price_item->cli_no, 1, $price_item->cli_grade, false, $price_date);
- if (! empty($price)) {
-
- switch (strtoupper($price_item->price_people)) {
case 'A':
- switch ($price_item->person_size) {
- case '1':
- $price_number = $price->CLP_OneAdultPriceRMB;
- break;
- case '2': //25
- $price_number = $price->CLP_TwoToFiveAdultPriceRMB;
- break;
- case '6': //69
- $price_number = $price->CLP_SixToNineAdultPriceRMB;
- break;
- case '10':
- $price_number = $price->CLP_OverTenAdultPriceRMB;
- break;
- default:
- $price_number = $price->CLP_TwoToFiveAdultPriceRMB;
- }
+ $price_number = $price->PLP_AdultUnitPrice;
break;
case 'C':
- $price_number = 0;
+ $price_number = $price->PLP_ChildUnitPrice;
break;
case 'B':
- $price_number = 0;
+ $price_number = $price->PLP_BabyUnitPrice;
break;
case 'R':
- switch ($price_item->person_size) {
- case '1':
- $price_number = $price->CLP_OneRoomDiffPriceRMB;
+ $price_number = $price->PLP_RoomDiffPrice;
+ break;
+ case 'AR':
+ $price_number = $price->PLP_AdultUnitPrice + $price->PLP_RoomDiffPrice; //成人加单间房差
+ break;
+ default:
+ $price_number = $price->PLP_AdultUnitPrice;
+ }
+ } else {
+ $price = $this->Price_model->search($price_item->cli_no, 1, $price_item->cli_grade, false, $price_date);
+ if (! empty($price)) {
+
+ switch (strtoupper($price_item->price_people)) {
+ case 'A':
+ switch ($price_item->person_size) {
+ case '1':
+ $price_number = $price->CLP_OneAdultPriceRMB;
+ break;
+ case '2': //25
+ $price_number = $price->CLP_TwoToFiveAdultPriceRMB;
+ break;
+ case '6': //69
+ $price_number = $price->CLP_SixToNineAdultPriceRMB;
+ break;
+ case '10':
+ $price_number = $price->CLP_OverTenAdultPriceRMB;
+ break;
+ default:
+ $price_number = $price->CLP_TwoToFiveAdultPriceRMB;
+ }
break;
- case '2': //25
- $price_number = $price->CLP_TwoToFiveRoomDiffPriceRMB;
+ case 'C':
+ $price_number = 0;
break;
- case '6': //69
- $price_number = $price->CLP_SixToNineRoomDiffPriceRMB;
+ case 'B':
+ $price_number = 0;
+ break;
+ case 'R':
+ switch ($price_item->person_size) {
+ case '1':
+ $price_number = $price->CLP_OneRoomDiffPriceRMB;
+ break;
+ case '2': //25
+ $price_number = $price->CLP_TwoToFiveRoomDiffPriceRMB;
+ break;
+ case '6': //69
+ $price_number = $price->CLP_SixToNineRoomDiffPriceRMB;
+ break;
+ case '10':
+ $price_number = $price->CLP_OverTenRoomDiffPriceRMB;
+ break;
+ default:
+ $price_number = $price->CLP_TwoToFiveRoomDiffPriceRMB;
+ }
break;
- case '10':
- $price_number = $price->CLP_OverTenRoomDiffPriceRMB;
+ case 'AR': //成人加单间房差
+ $price_number = 0;
break;
default:
- $price_number = $price->CLP_TwoToFiveRoomDiffPriceRMB;
- }
- break;
- case 'AR': //成人加单间房差
- $price_number = 0;
- break;
- default:
- $price_number = 0;
+ $price_number = 0;
}
}
}
@@ -1776,7 +1797,8 @@ class Information extends CI_Controller {
}
//使用正则匹配出价格标签,返回一个价格数组
- private function price_pregmatch($content) {
+ private function price_pregmatch($content)
+ {
$price_array = [];
$temp_array = [];
$result = false;
@@ -1793,27 +1815,27 @@ class Information extends CI_Controller {
}
$cli_grade = ! empty($price_array[1]) ? $price_array[1] : false; //标准7001、豪华7002、经济7003
switch (strtoupper($cli_grade)) {
- case 'ST':
- $cli_grade = '7001';
- break;
- case 'LX':
- $cli_grade = '7002';
- break;
- case 'EC':
- $cli_grade = '7003';
- break;
- default:
- $cli_grade = '7001';
+ case 'ST':
+ $cli_grade = '7001';
+ break;
+ case 'LX':
+ $cli_grade = '7002';
+ break;
+ case 'EC':
+ $cli_grade = '7003';
+ break;
+ default:
+ $cli_grade = '7001';
}
$person_size = (! empty($price_array[2]) && is_numeric($price_array[2])) ? $price_array[2] : 2; //人等1,2-5,6-9,10,默认2人等
- //为了兼容以前的人等方式,把算数人等转换为单数 25=>2
+ //为了兼容以前的人等方式,把算数人等转换为单数 25=>2
switch ($person_size) {
- case '25':
- $person_size = '2';
- break;
- case '69':
- $person_size = '6';
- break;
+ case '25':
+ $person_size = '2';
+ break;
+ case '69':
+ $person_size = '6';
+ break;
}
$price_date = ! empty($price_array[3]) ? $price_array[3] : false; //价格时间
$price_people = ! empty($price_array[4]) ? $price_array[4] : 'A'; //A成人、C小孩、B婴儿、R单间房差
@@ -1822,32 +1844,33 @@ class Information extends CI_Controller {
return $result;
}
- public function make_www_cache_gh($device, $information, $recommand_information) {
+ public function make_www_cache_gh($device, $information, $recommand_information)
+ {
$data = [];
$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;
- }
- 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, '', 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:
}
// GH Home 下层节点名称和链接映射
@@ -1880,7 +1903,7 @@ class Information extends CI_Controller {
$template = str_replace('', $information->ic_seo_keywords, $template);
$template = str_replace('', $this->config->item('site_url') . $information->ic_url, $template);
- //顶部全屏大图
+ //顶部全屏大图
if ($device == 'mobile') { //移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
} else {
@@ -1937,7 +1960,7 @@ class Information extends CI_Controller {
$template = str_replace('?product_code=', '?product_code=' . $meta_product_code, $template);
}
- //信息推荐
+ //信息推荐
$template_recommand = $recommand_information; //$this->recommand_information($information); 从外面传进来,pc和移动只需要查一次,减少数据库负担
$template = str_replace('', $this->load->view($template_path . '-next', ['recommands' => $template_recommand], true), $template);
// //广告,改叫tips,防止被插件屏蔽
@@ -2212,7 +2235,8 @@ 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 = [];
$data['information'] = $information;
@@ -2220,29 +2244,29 @@ class Information extends CI_Controller {
$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:
}
//替换模板中的标签
@@ -2255,8 +2279,8 @@ class Information extends CI_Controller {
$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 {
@@ -2289,7 +2313,6 @@ class Information extends CI_Controller {
$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);
-
} else {
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if (! empty($author_web)) {
@@ -2588,7 +2611,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 {
@@ -2663,7 +2686,8 @@ class Information extends CI_Controller {
}
- public function make_www_cache_thailand($device, $information, $recommand_information) {
+ public function make_www_cache_thailand($device, $information, $recommand_information)
+ {
$data = [];
$data['information'] = $information;
@@ -2671,29 +2695,29 @@ class Information extends CI_Controller {
$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/thailand-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/thailand-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/thailand-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/thailand-next';
+ break;
+ default:
}
//替换模板中的标签
@@ -2706,8 +2730,8 @@ class Information extends CI_Controller {
$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 {
@@ -2740,7 +2764,6 @@ class Information extends CI_Controller {
$data['OPI_Code'] = $author->OPI_Code;
$data['author_url'] = $this->get_author_url('www.thailandhighlights.com', $author->OPI_Code);
$author_url = $this->get_author_url('www.thailandhighlights.com', $author->OPI_Code);
-
} else {
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if (! empty($author_web)) {
@@ -2998,7 +3021,7 @@ class Information extends CI_Controller {
}
}
- //主样式表,内联模式
+ //主样式表,内联模式
if (is_file('D:/wwwroot/origin-www.thailandhighlights.com/css/mobile-first.css')) { //主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
$main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-www.thailandhighlights.com/css/mobile-first.css'));
} else {
@@ -3072,7 +3095,8 @@ 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 = [];
$data['information'] = $information;
@@ -3080,29 +3104,29 @@ class Information extends CI_Controller {
$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:
}
//替换模板中的标签
@@ -3115,8 +3139,8 @@ class Information extends CI_Controller {
$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 {
@@ -3245,7 +3269,6 @@ class Information extends CI_Controller {
$meta_product_code = get_meta($information->ic_id, 'meta_product_code');
// 非产品页面
if (empty($meta_product_code)) {
-
} else {
$template = str_replace('?product_code=', '?product_code=' . $meta_product_code, $template);
$inquiry_form_template = $this->load->view(
@@ -3262,7 +3285,6 @@ class Information extends CI_Controller {
true
);
$information->ic_content = str_replace('', $gp_form_content, $information->ic_content);
-
}
$price_tag_list = $this->parse_price_tag($information->ic_content);
@@ -3349,7 +3371,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 {
@@ -3428,11 +3450,12 @@ class Information extends CI_Controller {
* @return:
* @Date Changed:
*/
- public function make_www_cache_ct($information) {
+ 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采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
@@ -3470,7 +3493,7 @@ class Information extends CI_Controller {
$str_author = 'Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", $EditTime) . '
';
}
- //火车票详细页搜索框添加 -- zp
+ //火车票详细页搜索框添加 -- 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") {
@@ -3483,7 +3506,6 @@ class Information extends CI_Controller {
$arrTrainCity = explode('|', $meta_train_city);
$data_TrainCity["from"] = $arrTrainCity[0];
$data_TrainCity["to"] = $arrTrainCity[1];
-
}
}
$template_TrainDetailSearch = $this->load->view($template_path . '-train-detail', $data_TrainCity, true);
@@ -3684,7 +3706,7 @@ class Information extends CI_Controller {
//页面传递参数
$passParam = "";
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, ["attractionindex"])) {
@@ -3728,10 +3750,10 @@ class Information extends CI_Controller {
$data["clisn"] = $tourdata->clisn;
$tourdetail = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourDetail/?param=" . $productCode));
- if ($tourdetail->status =="ok"){
+ if ($tourdetail->status == "ok") {
$tourDays = $tourdetail->data->CLI_Days;
$tourPassCity = $tourdetail->data->CLI2_PassCity;
- }else{
+ } else {
$tourDays = 0;
$tourPassCity = "";
}
@@ -3739,8 +3761,7 @@ class Information extends CI_Controller {
//调取模板
$dataform["TourCode"] = $productCode;
$dataform["CLI_SN"] = $tourdata->clisn;
- $dataform["TourName"] = $tourDays."-day ".$information->ic_title." (".$tourPassCity.")";
-
+ $dataform["TourName"] = $tourDays . "-day " . $information->ic_title . " (" . $tourPassCity . ")";
}
//游船详细页
@@ -3845,27 +3866,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:
}
//生成静态文件
@@ -3885,11 +3906,12 @@ class Information extends CI_Controller {
/**
* 上海站
*/
- public function make_www_cache_sh($information) {
+ 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"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
@@ -3922,7 +3944,7 @@ class Information extends CI_Controller {
$str_author = 'Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
}
- //火车票详细页搜索框添加 -- zp
+ //火车票详细页搜索框添加 -- 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) {
@@ -3935,7 +3957,6 @@ class Information extends CI_Controller {
$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);
@@ -4102,7 +4123,7 @@ class Information extends CI_Controller {
//页面传递参数
$passParam = "";
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, ["attractionindex"])) {
@@ -4136,7 +4157,7 @@ class Information extends CI_Controller {
//一日游表单的替换
$DayTripData["productCode"] = $productCode;
$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") {
@@ -4162,7 +4183,6 @@ class Information extends CI_Controller {
$template_form_tourqi = $this->load->view($template_path . '-form-tourqi', $dataform, true);
//使用simple_html_dom_lib库来进行表单添加
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, "#maincontent", $template_form_tourqi);
-
}
if ($meta_ct_page_type == "tourlist") {
@@ -4172,7 +4192,7 @@ class Information extends CI_Controller {
$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);
@@ -4186,7 +4206,7 @@ class Information extends CI_Controller {
$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);
@@ -4276,27 +4296,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:
}
//生成静态文件
@@ -4316,11 +4336,12 @@ class Information extends CI_Controller {
/**
* 北京站mybeijingchina.com
*/
- public function make_www_cache_bj($information) {
+ 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"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
@@ -4353,7 +4374,7 @@ class Information extends CI_Controller {
$str_author = 'Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
}
- //火车票详细页搜索框添加 -- zp
+ //火车票详细页搜索框添加 -- 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) {
@@ -4366,7 +4387,6 @@ class Information extends CI_Controller {
$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);
@@ -4533,7 +4553,7 @@ class Information extends CI_Controller {
//页面传递参数
$passParam = "";
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, ["attractionindex"])) {
@@ -4564,7 +4584,7 @@ class Information extends CI_Controller {
//$addonJs .= '';
$data["ADDONCSS"] .= '';
- //一日游表单的替换,放到下面的区分PC端和移动端
+ //一日游表单的替换,放到下面的区分PC端和移动端
}
if ($meta_ct_page_type == "tourdetail") {
@@ -4583,7 +4603,6 @@ class Information extends CI_Controller {
$dataform["TourCode"] = $productCode;
$dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
-
}
if ($meta_ct_page_type == "tourlist") {
@@ -4593,7 +4612,7 @@ class Information extends CI_Controller {
$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);
@@ -4607,7 +4626,7 @@ class Information extends CI_Controller {
$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);
@@ -4767,27 +4786,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:
}
//生成静态文件
@@ -4807,7 +4826,8 @@ class Information extends CI_Controller {
/**
* TrainSpread网站静态化
*/
- public function make_www_cache_ts($information) {
+ public function make_www_cache_ts($information)
+ {
$data = [];
#region 公用数据
@@ -4844,7 +4864,7 @@ class Information extends CI_Controller {
$str_author = 'Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
}
- //火车票详细页搜索框添加 -- zp
+ //火车票详细页搜索框添加 -- 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) {
@@ -4857,7 +4877,6 @@ class Information extends CI_Controller {
$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);
@@ -4986,7 +5005,7 @@ class Information extends CI_Controller {
//页面传递参数
$passParam = "";
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, ["attractionindex"])) {
@@ -5013,20 +5032,18 @@ class Information extends CI_Controller {
if (! empty($meta_ct_page_value)) {
$productCode = $meta_ct_page_value;
}
- $addonJs .= '';
+ $addonJs .= '';
// $addonJs .= '';
$data["ADDONCSS"] .= '';
//一日游表单的替换,放到下面的区分PC端和移动端
//浮动按钮
$floatButton = '';
- if ( strpos($ic_content, 'container-right') !== false){
+ if (strpos($ic_content, 'container-right') !== false) {
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, ".container-right", $floatButton);
- }else{
+ } else {
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, ".container-details", $floatButton);
}
-
-
}
if ($meta_ct_page_type == "tourdetail") {
//线路
@@ -5044,7 +5061,6 @@ class Information extends CI_Controller {
$dataform["TourCode"] = $productCode;
$dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
-
}
//表单页
@@ -5316,27 +5332,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:
}
//生成静态文件
@@ -5355,11 +5371,12 @@ class Information extends CI_Controller {
/**
* 桂林站 www.guilinchina.net
*/
- public function make_www_cache_gl($information) {
+ 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"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
@@ -5392,7 +5409,7 @@ class Information extends CI_Controller {
$str_author = 'Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
';
}
- //火车票详细页搜索框添加 -- zp
+ //火车票详细页搜索框添加 -- 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) {
@@ -5405,7 +5422,6 @@ class Information extends CI_Controller {
$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);
@@ -5570,7 +5586,7 @@ class Information extends CI_Controller {
//页面传递参数
$passParam = "";
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, ["attractionindex"])) {
@@ -5604,7 +5620,7 @@ class Information extends CI_Controller {
//一日游表单的替换
$DayTripData["productCode"] = $productCode;
$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") {
@@ -5626,7 +5642,6 @@ class Information extends CI_Controller {
$dataform["TourCode"] = $productCode;
$dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
-
}
if ($meta_ct_page_type == "tourlist") {
@@ -5636,7 +5651,7 @@ class Information extends CI_Controller {
$tourListData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourList/?webcode=guilin"));
$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);
@@ -5650,7 +5665,7 @@ class Information extends CI_Controller {
$dayTripListData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getSearchDaytripList/?webcode=guilin"));
$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);
@@ -5748,27 +5763,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:
}
//生成静态文件
@@ -5787,11 +5802,12 @@ class Information extends CI_Controller {
/**
* 花梨鹰网站 www.hualiyingtravel.com的静态化
*/
- public function make_www_cache_hly($information) {
+ 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"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
@@ -5942,7 +5958,7 @@ class Information extends CI_Controller {
//页面传递参数
$passParam = "";
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, ["attractionindex"])) {
@@ -5978,7 +5994,7 @@ class Information extends CI_Controller {
$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'];
+ //$arrTest = ['QM-9-A','QM-9-B','QM-9-C'];
if (in_array($productCode, $arrCAD) || in_array($productCode, $arrCAD_EN)) { //水灯节,中英文分别调用不同模板
/**替换左右结构的线路表单标签 2024-7-4*/
@@ -5986,7 +6002,7 @@ class Information extends CI_Controller {
//准备数据
$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");
@@ -6021,10 +6037,9 @@ class Information extends CI_Controller {
$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") {
//线路
@@ -6048,7 +6063,6 @@ class Information extends CI_Controller {
$addonJs .= '';
$data["ADDONCSS"] .= '';
-
}
//表单页
@@ -6119,34 +6133,32 @@ class Information extends CI_Controller {
$ic_content_pc = $ic_content; //需要一个变量来过渡,不然$ic_content改变以后,PC端就没有标签了
$ic_content_pc = str_replace('', $template_form_tourqi, $ic_content_pc);
$data["CUSTOMCONENT"] = $ic_content_pc;
-
}
-
}
//两种设备分别调用两种模板 ,静态化
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:
}
//生成静态文件
@@ -6165,7 +6177,8 @@ class Information extends CI_Controller {
/**
* 花梨鹰 英文站 chiangmaiyipengfestival.com 的静态化方法
*/
- public function make_www_cache_hlyen($information){
+ public function make_www_cache_hlyen($information)
+ {
$data = [];
#region 公用数据
@@ -6303,7 +6316,6 @@ class Information extends CI_Controller {
$productCode = "";
if ($meta_ct_page_type == "daytripdetail") {
$addonJs .= '';
-
}
if ($meta_ct_page_type == "tourdetail") {
//线路
@@ -6327,7 +6339,6 @@ class Information extends CI_Controller {
$addonJs .= '';
$data["ADDONCSS"] .= '';
-
}
//表单页
@@ -6398,34 +6409,32 @@ class Information extends CI_Controller {
$ic_content_pc = $ic_content; //需要一个变量来过渡,不然$ic_content改变以后,PC端就没有标签了
$ic_content_pc = str_replace('', $template_form_tourqi, $ic_content_pc);
$data["CUSTOMCONENT"] = $ic_content_pc;
-
}
-
}
//两种设备分别调用两种模板 ,静态化
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:
}
//生成静态文件
@@ -6443,7 +6452,8 @@ 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])) {
@@ -6456,44 +6466,45 @@ class Information extends CI_Controller {
}
//根据推荐规则进行查询
- public function recommand_information_rule($information, $root_information, $recommand, &$exclude_ids) {
+ 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 [$recommand->ir_name => $data];
- //break;
- case 'rule_no_show': //不显示
- return [$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)]));
+ // $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);
}
@@ -6513,7 +6524,8 @@ class Information extends CI_Controller {
}
//获取当前信息所有的推荐信息和广告内容
- public function recommand_information($information) {
+ 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); //节点下所有的推荐规则
@@ -6547,110 +6559,111 @@ class Information extends CI_Controller {
return $data;
}
- public function call_mobile_template_NEXT($template_path, $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, [$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 '';
+ 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);
@@ -6658,81 +6671,82 @@ class Information extends CI_Controller {
//更新静态文件
//不用参数提交的原因是可能url带有特殊字符,CI会报错
- public function update_cache($static_html_url = false, $delete_only = false) {
+ 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');
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;
- } 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=" . $url);
- $url = "https://www.chinahighlightstravel.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;
+ if ($amp_request) {
+ $url = 'http://169.54.167.189:22224/ampreq' . $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;
+ $url = 'http://169.54.167.189:22224' . $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;
+ 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';
}
- //int return direct
- $cache_url = $this->input->post('cache_url');
- if ($url && ! $cache_url) {
- /*
+ 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=" . $url);
+ $url = "https://www.chinahighlightstravel.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 = $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) {
+ /*
ignore_user_abort(true);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
@@ -6747,51 +6761,51 @@ class Information extends CI_Controller {
curl_exec($ch);
curl_close($ch);
*/
- $data['async_update'] = $url;
- $data[] = ['name' => 'ok', 'value' => '信息保存成功,请在8秒后检查更新页面。', 'url' => $url];
- //如果是外部调用就返回结果,内部就不返回了
- if ($cache_url) {
- echo json_encode($data);
+ $data['async_update'] = $url;
+ $data[] = ['name' => 'ok', 'value' => '信息保存成功,请在8秒后检查更新页面。', 'url' => $url];
+ //如果是外部调用就返回结果,内部就不返回了
+ if ($cache_url) {
+ echo json_encode($data);
+ }
+ return $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;
- } 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;
+ 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 {
- $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;
- }
+ $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;
+ }
- // 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);
@@ -6806,29 +6820,29 @@ class Information extends CI_Controller {
curl_exec($ch);
curl_close($ch);
*/
- $data['async_update'] = $url;
- $data[] = ['name' => 'ok', 'value' => '信息保存成功,请在8秒后检查更新页面。', 'url' => $url];
- //如果是外部调用就返回结果,内部就不返回了
- if ($cache_url) {
- echo json_encode($data);
+ $data['async_update'] = $url;
+ $data[] = ['name' => 'ok', 'value' => '信息保存成功,请在8秒后检查更新页面。', 'url' => $url];
+ //如果是外部调用就返回结果,内部就不返回了
+ if ($cache_url) {
+ echo json_encode($data);
+ }
+ return $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;
+ 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);
@@ -6856,10 +6870,11 @@ class Information extends CI_Controller {
}
//更新CDN缓存
- public function update_cdn($static_html_url = false) {
+ public function update_cdn($static_html_url = false)
+ {
$flag = false; //false:不更新,true:更新
$update_site = ['jp', 'ru']; //需要更新CDN的站点
- //需要更新的url
+ //需要更新的url
$url = $static_html_url;
if (empty($url)) {
$url = $this->input->post('cache_url');
@@ -6878,7 +6893,6 @@ class Information extends CI_Controller {
if (in_array($this->config->item('site_code'), $update_site)) {
$flag = true;
}
-
}
//默认更新成功,如果不成功,则返回错误提示信息
@@ -6889,23 +6903,23 @@ class Information extends CI_Controller {
if ($result['resultCode'] != 200) {
$notice = $result['notice'] . $result['details'];
}
-
}
return $notice;
}
//获取产品信息,提供给用户选择进行绑定
- 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'] = [];
- 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);
@@ -6916,7 +6930,8 @@ class Information extends CI_Controller {
}
//显示备份的内容
- 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);
@@ -6929,7 +6944,8 @@ 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_value = $this->input->post('im_value');
@@ -6949,7 +6965,8 @@ class Information extends CI_Controller {
}
//保存自定义配置
- public function delete_meta() {
+ public function delete_meta()
+ {
$im_ic_id = $this->input->post('im_ic_id');
$im_key = $this->input->post('im_key');
if ($im_ic_id && $im_key) {
@@ -6963,7 +6980,8 @@ class Information extends CI_Controller {
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',
@@ -7010,7 +7028,8 @@ class Information extends CI_Controller {
}
// 获取作者信息,包括头像、领域、主页
- private function get_author_info($domain_name, $OPI_Code) {
+ private function get_author_info($domain_name, $OPI_Code)
+ {
// 定义URL模板
$baseUrl = 'https://www.' . $domain_name;
$about_us_url = $baseUrl . '/author-page-not-defined/';