From e5b22791642927e51b1f80c12f965724cd36940f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Tue, 19 Oct 2021 17:04:11 +0800 Subject: [PATCH] =?UTF-8?q?GH=E7=9A=84=E9=9D=99=E6=80=81=E5=8C=96=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/config/config.php | 1 + application/controllers/information.php | 80 ++--- .../views/bootstrap3/information_edit.php | 2 +- application/views/mobile_first/gh-h1.php | 21 ++ application/views/mobile_first/gh-pc.php | 275 ++++++++++++++++++ .../mobile_first/gh-recommended-articles | 179 ++++++++++++ .../gh-structured-data-breadcrumb.php | 28 ++ application/views/mobile_first/gh.php | 229 +++++++++++++++ 8 files changed, 775 insertions(+), 40 deletions(-) create mode 100644 application/views/mobile_first/gh-h1.php create mode 100644 application/views/mobile_first/gh-pc.php create mode 100644 application/views/mobile_first/gh-recommended-articles create mode 100644 application/views/mobile_first/gh-structured-data-breadcrumb.php create mode 100644 application/views/mobile_first/gh.php diff --git a/application/config/config.php b/application/config/config.php index 144c754e..eb0ef45a 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -727,6 +727,7 @@ $config['cache']['ru']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\chinahighlights. $config['cache']['it']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\viaggio-in-cina.it'; $config['cache']['ch']['cache_path'] = 'D:\wwwcache\chinahighlights.com'; $config['cache']['ah']['cache_path'] = 'D:\wwwcache\asiahighlights.com'; +$config['cache']['gh']['cache_path'] = 'D:\wwwcache\globalhighlights.com'; $config['cache']['chinatravel']['cache_path'] = 'D:\wwwcache\mobile-first\chinatravel.com'; //静态文件更新接口 diff --git a/application/controllers/information.php b/application/controllers/information.php index 80ac6ae7..c8185c5b 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -423,8 +423,10 @@ class Information extends CI_Controller $this->make_www_cache_ah('mobile', $information_new, $recommand_information); $this->make_www_cache_ah('pc', $information_new, $recommand_information); } else if (strcasecmp($site_code, "gh") == 0 && !empty($auto_update_cache)) { + $recommand_information = $this->recommand_information($information); $information_new = $this->Information_model->Detail($this->input->post('is_id')); - $this->make_www_cache_gh($information_new); + $this->make_www_cache_gh('mobile', $information_new, $recommand_information); + $this->make_www_cache_gh('pc', $information_new, $recommand_information); } else if (strcasecmp($site_code, "chinatravel") == 0 && !empty($auto_update_cache)) { //chinatravel读取模板生成PC和移动优先文件 $information_new = $this->Information_model->Detail($this->input->post('is_id')); @@ -977,40 +979,40 @@ class Information extends CI_Controller $template_H1 = $this->load->view($template_path . '-h1', $data_H1, TRUE); $template = str_replace('', $template_H1, $template); - $addthis_widget = $this->load->view($template_path . '-add-this', false, true); - $template = str_replace('', $addthis_widget, $template); +// $addthis_widget = $this->load->view($template_path . '-add-this', false, true); +// $template = str_replace('', $addthis_widget, $template); - $article_structured_data_content = $this->load->view( - $template_path . '-structured-data-article', - array('information' => $information, 'author' => $author), - true); - $template = str_replace('', $article_structured_data_content, $template); +// $article_structured_data_content = $this->load->view( +// $template_path . '-structured-data-article', +// array('information' => $information, 'author' => $author), +// true); +// $template = str_replace('', $article_structured_data_content, $template); } else { - $template = str_replace('', '', $template); - $inquiry_form_template = $this->load->view($template_path . '-inquiry-form', array('meta_product_code' => $meta_product_code), true); - $information->ic_content = str_replace('', $inquiry_form_template, $information->ic_content); - - $breadcrumb_content = $this->load->view($template_path . '-breadcrumb', array('breadcrumb_data' => $breadcrumb_data), true); - $information->ic_content = str_replace('', $breadcrumb_content, $information->ic_content); +// $template = str_replace('', '', $template); +// $inquiry_form_template = $this->load->view($template_path . '-inquiry-form', array('meta_product_code' => $meta_product_code), true); +// $information->ic_content = str_replace('', $inquiry_form_template, $information->ic_content); +// +// $breadcrumb_content = $this->load->view($template_path . '-breadcrumb', array('breadcrumb_data' => $breadcrumb_data), true); +// $information->ic_content = str_replace('', $breadcrumb_content, $information->ic_content); } //信息推荐 $template_recommand = $recommand_information; //$this->recommand_information($information); 从外面传进来,pc和移动只需要查一次,减少数据库负担 - $template = str_replace('', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template); + // $template = str_replace('', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template); // //广告,改叫tips,防止被插件屏蔽 if (!empty($template_recommand['Tips Right TOP'])) { - $template = str_replace('', "
", $template); + // $template = str_replace('', "
", $template); } if (!empty($template_recommand['Tips Right'])) { - $template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template); + // $template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template); } //文中的信息推荐 if (strpos($information->ic_content, '') !== false) { - $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-article', array('recommands' => $template_recommand), TRUE), $information->ic_content); + // $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-article', array('recommands' => $template_recommand), TRUE), $information->ic_content); } //文中的线路推荐 if (strpos($information->ic_content, '') !== false) { - $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), TRUE), $information->ic_content); + // $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), TRUE), $information->ic_content); } //替换内容中广告 @@ -1036,32 +1038,32 @@ class Information extends CI_Controller $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url'); if (!empty($meta_addon_picture)) { if (!empty($meta_addon_picture_url)) { - $template = str_replace('', '
' . $information->ic_title . '
', $template); + // $template = str_replace('', '
' . $information->ic_title . '
', $template); } else { - $template = str_replace('', '
' . $information->ic_title . '' . $template_TrainSearch . '
', $template); + // $template = str_replace('', '
' . $information->ic_title . '' . $template_TrainSearch . '
', $template); } } //顶部视频 - $meta_news_video = get_meta($information->ic_id, 'meta_news_video'); - $meta_video_picture = get_meta($information->ic_id, 'meta_video_picture'); - if (!empty($meta_news_video) && !empty($meta_video_picture)) { - $template = str_replace('', '
', $template); - } - - if (is_file('D:/wwwroot/origin-data.chinahighlights.com/css/mobile-first.css')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速 - $main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-data.chinahighlights.com/css/mobile-first.css')); +// $meta_news_video = get_meta($information->ic_id, 'meta_news_video'); +// $meta_video_picture = get_meta($information->ic_id, 'meta_video_picture'); +// if (!empty($meta_news_video) && !empty($meta_video_picture)) { +// $template = str_replace('', '
', $template); +// } + + if (is_file('D:/wwwroot/origin-www.globalhighlights.com/css/gh-global.css')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速 + $main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-www.globalhighlights.com/css/gh-global.css')); } else { - $main_css_string = compress_css(GET_HTTP('https://proxy-data.chinahighlights.com/css/mobile-first.css')); + $main_css_string = compress_css(GET_HTTP('https://origin-www.globalhighlights.com/css/gh-global.css')); } $template = str_replace('', '', $template); //额外样式 $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); if (!empty($meta_addon_css)) { - if ($meta_addon_css == 'https://proxy-data.chinahighlights.com/css/tour-detail-former.css' && is_file('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css')) { - $meta_addon_css_string = compress_css(file_get_contents('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css')); - } else { + // if ($meta_addon_css == 'https://proxy-data.chinahighlights.com/css/tour-detail-former.css' && is_file('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css')) { + //$meta_addon_css_string = compress_css(file_get_contents('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css')); + // } else { $meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css)); - } + // } $template = str_replace('', '', $template); } //额外js @@ -1074,12 +1076,12 @@ class Information extends CI_Controller $template = str_replace('', $lazy_content, $template); //替换内容中各种标签 - $tag_why_us = $this->load->view($template_path . '-why-us', false, true); - $template = str_replace('', $tag_why_us, $template); + //$tag_why_us = $this->load->view($template_path . '-why-us', false, true); + // $template = str_replace('', $tag_why_us, $template); //Google广告代码 //if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) { - $template = str_replace('', '', $template); + //$template = str_replace('', '', $template); //} //社媒分享图片 $full_ic_photo = ''; @@ -1092,8 +1094,8 @@ class Information extends CI_Controller $template = str_replace('', '', $template); } //设置图片尺寸 - if (is_dir('D:/wwwroot/origin-images.chinahighlights.com') && is_dir('D:/wwwroot/origin-www.chinahighlights.com')) { - $template = $this->html_optimize_lib->set_image_size_local($template, 'D:/wwwroot/origin-www.chinahighlights.com', 'D:/wwwroot/origin-images.chinahighlights.com'); + if (is_dir('D:/wwwroot/origin-images.chinahighlights.com') && is_dir('D:/wwwroot/origin-www.globalhighlights.com')) { + $template = $this->html_optimize_lib->set_image_size_local($template, 'D:/wwwroot/origin-www.globalhighlights.com', 'D:/wwwroot/origin-images.chinahighlights.com'); } else { $template = $this->html_optimize_lib->set_image_size($template); } diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index 050bf014..53bc8d4e 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -2312,7 +2312,7 @@ 忽略URL重复
- config->item('site_code'), array('ch', 'cht', 'gm', 'ah', 'ct','chinatravel'))) { ?> + config->item('site_code'), array('ch', 'cht', 'gm', 'ah', 'gh', 'ct','chinatravel'))) { ?>