From 1aca8477492c08da811c5240b11dc9ec4fbfeee1 Mon Sep 17 00:00:00 2001 From: ycc Date: Tue, 29 Dec 2020 11:38:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=A7=E5=93=81=E5=92=8C?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=8C=BA=E5=88=AB=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E4=BA=86=E7=BA=BF=E8=B7=AF=E4=BB=A3=E5=8F=B7?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E6=98=AF=E4=BA=A7=E5=93=81=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E9=9B=86=E5=90=88=E7=9A=84=E4=BA=A7=E5=93=81=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=9C=80=E7=BB=91=E5=AE=9A=E8=99=9A=E6=8B=9F=E7=BA=BF?= =?UTF-8?q?=E8=B7=AF=E4=BB=A3=E5=8F=B7=20=E4=BA=A7=E5=93=81=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8C=BA=E5=88=AB=E6=98=AF=E6=B2=A1=E6=9C=89H1?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=92=8C=E5=BA=95=E9=83=A8=E7=9A=84=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 37 +++++++++++++++---------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index b6c8eb62..1eed388c 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -330,7 +330,9 @@ class Information extends CI_Controller if (is_file(APPPATH . 'views/' . $mobile_first_template_path . EXT)) { $mobile_template_H1 = $this->call_mobile_template_H1($mobile_first_template_path, $data['information']->is_path, $data['information']->ic_author, $data['information']->ic_title, $data['information']->ic_photo);//H1模板替换 $data['mobile_first_template'] = $this->load->view($mobile_first_template_path, '', TRUE); - $data['mobile_first_template'] = str_replace('', $mobile_template_H1, $data['mobile_first_template']); + if (empty(get_meta($data['information']->ic_id, 'meta_product_code'))) { + $data['mobile_first_template'] = str_replace('', $mobile_template_H1, $data['mobile_first_template']); + } } else { $data['mobile_first_template'] = '没有找到移动模板'; } @@ -562,12 +564,12 @@ 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'); + if (empty($ic_url)) { + $ic_url = $this->input->get_post('ic_url'); } - if(empty($ic_url)){ + if (empty($ic_url)) { return false; } $html_file = $this->config->item('cache')[$this->config->item('site_code')]['cache_path'] . $ic_url; @@ -615,8 +617,14 @@ class Information extends CI_Controller $mobile_template = str_replace('', $this->input->post('ic_seo_description'), $mobile_template); $mobile_template = str_replace('', $this->input->post('ic_seo_keywords'), $mobile_template); $mobile_template = str_replace('', $this->input->post('site_url') . $this->input->post('ic_url'), $mobile_template); - $mobile_template_H1 = $this->call_mobile_template_H1($mobile_first_template_path, $this->input->post('is_path'), $this->input->post('ic_author'), $this->input->post('ic_title'), $this->input->post('ic_photo'));//H1模板替换 - $mobile_template = str_replace('', $mobile_template_H1, $mobile_template); + if (empty(get_meta($information->ic_id, 'meta_product_code'))) { + //H1标题样式 + $mobile_template_H1 = $this->call_mobile_template_H1($mobile_first_template_path, $this->input->post('is_path'), $this->input->post('ic_author'), $this->input->post('ic_title'), $this->input->post('ic_photo'));//H1模板替换 + $mobile_template = str_replace('', $mobile_template_H1, $mobile_template); + //信息推荐 + $template_NEXT = $this->call_mobile_template_NEXT($mobile_first_template_path, $this->input->post('is_id')); + $mobile_template = str_replace('', $template_NEXT, $mobile_template); + } //额外样式 $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); if (!empty($meta_addon_css)) { @@ -630,9 +638,6 @@ class Information extends CI_Controller if (!empty(get_meta($information->ic_id, 'meta_google_ad_article'))) { $mobile_template = str_replace('', '', $mobile_template); } - //信息推荐 - $template_NEXT = $this->call_mobile_template_NEXT($mobile_first_template_path, $this->input->post('is_id')); - $mobile_template = str_replace('', $template_NEXT, $mobile_template); //社媒分享图片 if (!empty($information->ic_photo)) { $full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo; @@ -664,8 +669,13 @@ class Information extends CI_Controller $template = str_replace('', $this->input->post('ic_seo_description'), $template); $template = str_replace('', $this->input->post('ic_seo_keywords'), $template); $template = str_replace('', $this->input->post('site_url') . $this->input->post('ic_url'), $template); - $template_H1 = $this->call_mobile_template_H1($template_path, $this->input->post('is_path'), $this->input->post('ic_author'), $this->input->post('ic_title'), $this->input->post('ic_photo'));//H1模板替换 - $template = str_replace('', $template_H1, $template); + if (empty(get_meta($information->ic_id, 'meta_product_code'))) { + $template_H1 = $this->call_mobile_template_H1($template_path, $this->input->post('is_path'), $this->input->post('ic_author'), $this->input->post('ic_title'), $this->input->post('ic_photo'));//H1模板替换 + $template = str_replace('', $template_H1, $template); + //信息推荐 + $template_NEXT = $this->call_mobile_template_NEXT($template_path, $this->input->post('is_id')); + $template = str_replace('', $template_NEXT, $template); + } //额外样式 $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); if (!empty($meta_addon_css)) { @@ -679,9 +689,6 @@ class Information extends CI_Controller if (!empty(get_meta($information->ic_id, 'meta_google_ad_article'))) { $template = str_replace('', '', $template); } - //信息推荐 - $template_NEXT = $this->call_mobile_template_NEXT($template_path, $this->input->post('is_id')); - $template = str_replace('', $template_NEXT, $template); //社媒分享图片 if (!empty($information->ic_photo)) { $full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo;