From cf72526b4689a27a602a185c1602ce26fc95f371 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Mon, 4 Mar 2024 11:00:12 +0800 Subject: [PATCH] fix gm update cache --- application/controllers/information.php | 11 +- application/libraries/Amplib.php | 67 +- .../views/bootstrap3/information_edit.php | 3442 ++++++++--------- 3 files changed, 1736 insertions(+), 1784 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index 968fd572..82b1e887 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -1713,7 +1713,7 @@ class Information extends CI_Controller ); $information->ic_content = str_replace('', $tour_form_content, $information->ic_content); } - + // CH: 1; AH: 28; GH : 33 $price_tag_list = $this->parse_price_tag($information->ic_content, 33); @@ -1989,7 +1989,8 @@ class Information extends CI_Controller $template = str_replace( '', $feedback_newest_10_content, - $template); + $template + ); //文中的信息推荐 if (strpos($information->ic_content, '') !== false) { @@ -3180,11 +3181,11 @@ class Information extends CI_Controller case 'gm': //GET_HTTP("http://148.251.35.42:3300/create-cache/?url=" . urlencode($url)); //请求nodejs静态化更新页面,删除缓存,因为部分页面没有进入信息平台 //if ($delete_only) { - // $url = "http://144.76.185.44:8029/gm.php/information/delete_cache_23Xd913mddkgssODII?static_html_url=" . urlencode($url); + // $url = "https://www.chinarundreisen.com/gm.php/information/delete_cache_23Xd913mddkgssODII?static_html_url=" . urlencode($url); //} else { //先删除再生成,部分页面没有在信息平台中 - GET_HTTP("http://144.76.185.44:8029/gm.php/information/delete_cache_23Xd913mddkgssODII?static_html_url=" . urlencode($url)); - $url = "http://144.76.185.44:8029/gm.php/information/detail/?static_html_url=" . $url; + GET_HTTP("https://www.chinarundreisen.com/gm.php/information/delete_cache_23Xd913mddkgssODII?static_html_url=" . urlencode($url)); + $url = "https://www.chinarundreisen.com/gm.php/information/detail/?static_html_url=" . $url; //} break; diff --git a/application/libraries/Amplib.php b/application/libraries/Amplib.php index e76bd514..026435ab 100644 --- a/application/libraries/Amplib.php +++ b/application/libraries/Amplib.php @@ -6,41 +6,45 @@ if (!defined('BASEPATH')) * AMP的相关方法 */ -class Amplib { +class Amplib +{ var $CI; - public function __construct() { - $this->CI = & get_instance(); + public function __construct() + { + $this->CI = &get_instance(); $this->CI->load->model('Information_model'); $this->CI->load->model('InfoMetas_model'); $this->CI->load->model('Logs_model'); } - public function edit($ic_id) { + public function edit($ic_id) + { $data = array(); $data['information'] = $this->CI->Information_model->detail_by_ic_id($ic_id); if ($data['information'] == FALSE) { show_404(); } - //查询上一次保存记录 - $amp_log = $this->CI->Logs_model->get_last_edit_amp($ic_id); - if(!empty($amp_log)){ - $data['last_edit_amp_id'] = $amp_log->log_id; - }else{ - $data['last_edit_amp_id'] = ''; - } + //查询上一次保存记录 + $amp_log = $this->CI->Logs_model->get_last_edit_amp($ic_id); + if (!empty($amp_log)) { + $data['last_edit_amp_id'] = $amp_log->log_id; + } else { + $data['last_edit_amp_id'] = ''; + } $this->CI->load->view('bootstrap3/header', $data); $this->CI->load->view('amp_editor'); $this->CI->load->view('bootstrap3/footer'); } - public function auto_create($ic_id) { + public function auto_create($ic_id) + { $data = array(); - if(strtolower($this->CI->config->item('site_code')) == 'cht'){ - $this->CI->Information_model->ic_type = "AND ic.ic_type != 'none'"; - } + if (strtolower($this->CI->config->item('site_code')) == 'cht') { + $this->CI->Information_model->ic_type = "AND ic.ic_type != 'none'"; + } $data['information'] = $this->CI->Information_model->detail_by_ic_id($ic_id); if ($data['information'] == FALSE) { return json_encode(array('result' => 'no', 'data' => '找不到这个页面')); @@ -61,7 +65,7 @@ class Amplib { break; case 'gm': $websitehost = 'https://data.chinarundreisen.com'; - $html_source_url = 'http://144.76.185.44:8029' . $data['information']->ic_url; + $html_source_url = 'https://www.chinarundreisen.com/' . $data['information']->ic_url; break; case 'ct': $websitehost = 'https://data.chinatravel.com'; @@ -75,23 +79,24 @@ class Amplib { $html_source = GET_HTTP($html_source_url); if (!empty($html_source)) { $post_data = array('websitehost' => $websitehost, 'template_name' => $site_code, 'create_amp' => 'true', 'htmlsource' => $html_source); - //德语站点走另外一个控制器,其他站点还是走原来的流程 - if($site_code == 'gm'){ - if($data['information']->ic_url == '/massgeschneiderte-china-reisen/'){ - return json_encode(array()); - }else{ - return GET_HTTP(site_url('/apps/htmlcompressor/index_gm/choose_way'), $post_data, 'POST'); - } - }elseif($site_code == 'ah'){ - return GET_HTTP(site_url('/apps/htmlcompressor/index_ah/choose_way'), $post_data, 'POST'); - }else{ - return GET_HTTP(site_url('/apps/htmlcompressor/index/optimize'), $post_data, 'POST'); - } + //德语站点走另外一个控制器,其他站点还是走原来的流程 + if ($site_code == 'gm') { + if ($data['information']->ic_url == '/massgeschneiderte-china-reisen/') { + return json_encode(array()); + } else { + return GET_HTTP(site_url('/apps/htmlcompressor/index_gm/choose_way'), $post_data, 'POST'); + } + } elseif ($site_code == 'ah') { + return GET_HTTP(site_url('/apps/htmlcompressor/index_ah/choose_way'), $post_data, 'POST'); + } else { + return GET_HTTP(site_url('/apps/htmlcompressor/index/optimize'), $post_data, 'POST'); + } } return json_encode(array('result' => 'no', 'data' => '不知道哪里错了,看代码')); } - public function edit_save($ic_id = false, $textarea_htmlcode = false, $amp_status = false) { + public function edit_save($ic_id = false, $textarea_htmlcode = false, $amp_status = false) + { $data = array(); if ($ic_id === false) { $ic_id = $this->CI->input->post('ic_id'); @@ -111,8 +116,8 @@ class Amplib { //CH的页面没有canonical内容,在这里帮补上 $textarea_htmlcode = str_replace('', $this->CI->config->item('site_url') . $data['information']->ic_url, $textarea_htmlcode); - //备份修改的代码 - $this->CI->Logs_model->write('backup_amp', $ic_id, $textarea_htmlcode); + //备份修改的代码 + $this->CI->Logs_model->write('backup_amp', $ic_id, $textarea_htmlcode); //AMP格式验证 if ($amp_status !== '0') {//只有发布的时候才需要验证 diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index b03a69b0..8f935525 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -2,190 +2,316 @@ ?>
@@ -584,15 +584,15 @@ function copyOldUrl(id) {
@@ -621,72 +621,72 @@ function copyOldUrl(id) {
session->userdata('session_admin'); -$show_photo_meta = get_meta($information->ic_id, 'meta_use_list_picture'); -$amp_photo = ''; -if ($information->ic_photo && $show_photo_meta !== 'no') { - $amp_photo = $this->config->item('site_image_url') . $information->ic_photo; -} -$amp_build_url = "/amp_app/?icid=" . $information->ic_id . "&is_path=" . $information->is_path . "&usr=" . urlencode($amp_user['OPI_Name']) . "&url=" . urlencode($information->ic_url) . "&photo=" . urlencode($amp_photo) . "&site=" . urlencode($this->config->item('site_url')) . "&imgurl=" . urlencode($this->config->item('site_image_url')); -?> - ic_id, 'AMP_BODY_PC_STATUS') == 'yes') { - $PcAmpChecked = 'checked'; - } else { - $PcAmpChecked = ''; - }?> - - | - | - - - amp_status === '1') {?> - - - amp_status === '2') {?> - - - amp_status === '0') {?> - - + $PcAmpChecked = ''; + } ?> + + | + | + + + amp_status === '1') { ?> + + + amp_status === '2') { ?> + + + amp_status === '0') { ?> + +
+ if ($embody == 1) { + echo 'border-color:green;'; + } + ?>" name="ic_title" value="ic_title; ?>">
@@ -722,44 +722,44 @@ if ($embody == 1) { target="_blank" title="查看"> - ic_sitecode == 'ch') {?> - - - ic_sitecode == 'gm') {?> - - - ic_sitecode == 'ah') {?> - - + ic_sitecode == 'ch') { ?> + + + ic_sitecode == 'gm') { ?> + + + ic_sitecode == 'ah') { ?> + + - ic_sitecode == 'ct' || $information->ic_sitecode == 'chinatravel') {?> -
- - -
- + ic_sitecode == 'ct' || $information->ic_sitecode == 'chinatravel') { ?> +
+ + +
+
@@ -827,239 +827,223 @@ if ($embody == 1) { - ic_sitecode == 'chinatravel' || $information->ic_sitecode == 'shanghai' ) { - ?> -
-
- - -
+ ic_sitecode == 'chinatravel' || $information->ic_sitecode == 'shanghai') { + ?> +
+
+ + +
-
- - -
+
+ + +
-
- - +
+ + +
-
-
-
- - -
-
- - -
-
- - -
+
+
+ + +
+
+ + +
+
+ + +
-
- - + + - -
-
- - +
+
+ + -
+ +
-
-
-
- - 1.点击生成游船总数据文件  2.点击生成当前页面游船数据文件 - + } + +
-
- + @@ -1082,9 +1066,9 @@ if (!empty($setting_website_nav)) {

- ic_sitecode == "trippest") {?> - - + ic_sitecode == "trippest") { ?> + +
@@ -1176,171 +1158,168 @@ if (!empty($setting_website_nav)) { ic_sitecode == 'cht' || $information->ic_sitecode == "ct") { - ?> + ?> + +
+
+ + +
+ +
"> + + +
+ +
+ + +
+ +
+ + +
-
-
- - -
+
+ + +
-
"> - -
-
- - -
+ $vin) { + if ( + in_array($information->is_id, explode(",", $vin->is_path)) && $vin->status == 1 && $vin->id != $information->is_id + ) { + $children_cnt++; + } + } + echo ""; + if ($children_cnt > 0) { + ?> +
+
+ + +
+
+
+
+ +
+
+ + + +
-
- - -
-
- -
-
- - $vin) { - if ( - in_array($information->is_id, explode(",", $vin->is_path)) && $vin->status == 1 && $vin->id != $information->is_id - ) { - $children_cnt++; - } - } - echo ""; - if ($children_cnt > 0) { - ?> -
-
- - -
-
-
-
- -
-
- - - -
- - -
- - +
@@ -1448,365 +1425,397 @@ if ($information->ic_ht_area_type == 'c') { onclick="meta('delete', 'ic_id; ?>', 'meta_news_video', $('#meta_news_video').val())"> - - - -
-
- - -
- -
- - - -
- - -
- - - -
- - - - - -
-
- - -
-
- '首页', - 'tour' => '中国线路', - 'asia_tour' => '亚洲线路', - 'dest' => '目的地', - 'tailormade' => 'tailormade', - 'train' => '火车', - 'ship' => '游船', - 'hotel' => '酒店', - 'flight' => '机票', - 'info' => '信息', - 'deal' => '促销', - '2015' => '2015', - 'tour2017' => '2017', - 'op' => 'OP', - 'best' => '实用信息', - 'culture' => '文化', - 'top10' => 'TOP10', - 'lifestyle' => '生活方式', - 'aboutus' => '关于我们', -); - ?> - - -
-
- - -
-
- - -
- -
- - -
- -
- - -
- ic_ht_area_type == 'err') {?> -
- - -
- -
- - -
- -
- - - config->item('site_code') == 'gm') {?> -
- - -
- - - ic_ht_area_type == 'g') {?> -
- - -
- + +
+
+ - +
-
-