From 2d3902209c5f5b5fcc02e604dbc53eb51fce2d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Fri, 26 Apr 2024 11:52:03 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E7=81=AB=E8=BD=A6=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=A1=86=E6=9B=BF=E6=8D=A2=E6=A0=87=E7=AD=BE=20=202.=E5=8F=AF=E4=BB=A5=E8=AE=BE=E7=BD=AE=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=9F=8E=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 23 ++++++++++++++++--- .../mobile_first/chinatravel-train-detail.php | 4 ++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index 644e188e..196f4a6b 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -2461,7 +2461,18 @@ class Information extends CI_Controller $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") { - $template_TrainDetailSearch = $this->load->view($template_path . '-train-detail', null, true); + $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-detail', $data_TrainCity, true); } /* 详细内容 */ @@ -2485,8 +2496,14 @@ class Information extends CI_Controller // },$ic_content); #enregion - /** 替换H1加面包屑,加作者 */ - $ic_content = preg_replace('/

(.*)<\/h1>/i', $crumb . "\r\n" . '

$1

' . "\r\n" . $str_author . $template_TrainDetailSearch . "\r\n", $ic_content, 1); + /** 替换H1加面包屑,加作者. 2024-4-26不在H1放火车搜索框,改为替换标签 */ + //$ic_content = preg_replace('/

(.*)<\/h1>/i', $crumb . "\r\n" . '

$1

' . "\r\n" . $str_author . $template_TrainDetailSearch . "\r\n", $ic_content, 1); + $ic_content = preg_replace('/

(.*)<\/h1>/i', $crumb . "\r\n" . '

$1

' . "\r\n" . $str_author . "\r\n", $ic_content, 1); + + /**替换火车标签 */ + if (strpos($ic_content, '') !== false) { + $ic_content = str_replace('', $template_TrainDetailSearch, $ic_content); + } /**替换zodiac标签 */ if (strpos($ic_content, '') !== false) { diff --git a/application/views/mobile_first/chinatravel-train-detail.php b/application/views/mobile_first/chinatravel-train-detail.php index 653a3b0e..a71e7770 100644 --- a/application/views/mobile_first/chinatravel-train-detail.php +++ b/application/views/mobile_first/chinatravel-train-detail.php @@ -8,11 +8,11 @@
- +
- +