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;