From d5f11a9acb2b9d0fe777cd5ee4ca94a892d5fe07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Tue, 25 Feb 2025 09:56:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E6=B5=B7=E7=AB=99=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=81=AB=E8=BD=A6=E7=A5=A8=E6=90=9C=E7=B4=A2=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 34 ++++++- .../mobile_first/shanghai-train-index.php | 93 +++++++++++++++++++ 2 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 application/views/mobile_first/shanghai-train-index.php diff --git a/application/controllers/information.php b/application/controllers/information.php index 86dc86a7..7ab52f5f 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -735,6 +735,9 @@ class Information extends CI_Controller } else if (strcasecmp($site_code, "trainspread") == 0 && !empty($auto_update_cache)) { $information_new = $this->Information_model->Detail($this->input->post('is_id')); $this->make_www_cache_ts($information_new); + } else if (strcasecmp($site_code, "guilin") == 0 && !empty($auto_update_cache)) { + $information_new = $this->Information_model->Detail($this->input->post('is_id')); + $this->make_www_cache_gl($information_new); } else if (strcasecmp($site_code, "cht") == 0 && !empty($auto_update_cache)) { $update_info_log = $this->update_cache($ic_url); } else if (strcasecmp($site_code, "ah") == 0 && !empty($auto_update_cache)) { @@ -3021,12 +3024,32 @@ class Information extends CI_Controller $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 = 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); + } + + /* 详细内容 */ $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 . $template_TrainDetailSearch . "\r\n", $ic_content, 1); //图片加延迟 $ic_content = $this->html_optimize_lib->set_lazy_loader($ic_content, 'https://data.shanghaihighlights.com/image/grey.gif'); @@ -3248,7 +3271,7 @@ class Information extends CI_Controller // 搜索框 $template_TrainSearch = ""; - if ($information->ic_url == "/china-trains/hometest" || $information->ic_url == "/china-trains") { + if ($information->ic_url == "/china-trains/hometest" || $information->ic_url == "/trains") { //火车票首页 $template_TrainSearch = $this->load->view($template_path . '-train-index', null, true); $ImgText = ""; @@ -4244,6 +4267,13 @@ class Information extends CI_Controller #endregion } + /** + * 桂林站 www.guilinchina.net + */ + public function make_www_cache_gl($information){ + + } + //通过内容找到第一张图片 public function set_photo_content($ic_photo, $ic_content) { diff --git a/application/views/mobile_first/shanghai-train-index.php b/application/views/mobile_first/shanghai-train-index.php new file mode 100644 index 00000000..5ee33ec7 --- /dev/null +++ b/application/views/mobile_first/shanghai-train-index.php @@ -0,0 +1,93 @@ + + +
+

China Train Ticket Service

+ +
+ + + + \ No newline at end of file