pc模板调整

ct-mobile-first
ycc 5 years ago
parent 485dd90bf2
commit a7cf6501a6

@ -329,7 +329,7 @@ class Information extends CI_Controller
//获取移动优先的模板,如果有的话 //获取移动优先的模板,如果有的话
$mobile_first_template_path='mobile_first/'.$this->config->item('site_code'); $mobile_first_template_path='mobile_first/'.$this->config->item('site_code');
if(is_file(APPPATH.'views/'.$mobile_first_template_path.EXT)){ 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_parent_id,$data['information']->ic_author,$data['information']->ic_title);//H1模板替换 $mobile_template_H1=$this->call_mobile_template_H1($mobile_first_template_path,$data['information']->is_parent_id,$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']=$this->load->view($mobile_first_template_path, '', TRUE);
$data['mobile_first_template']=str_replace('<!--@HEAD_1@-->', $mobile_template_H1, $data['mobile_first_template']); $data['mobile_first_template']=str_replace('<!--@HEAD_1@-->', $mobile_template_H1, $data['mobile_first_template']);
}else{ }else{
@ -571,7 +571,7 @@ class Information extends CI_Controller
$mobile_template=str_replace('<!--@DESCRIPTION@-->', $this->input->post('ic_seo_description'), $mobile_template); $mobile_template=str_replace('<!--@DESCRIPTION@-->', $this->input->post('ic_seo_description'), $mobile_template);
$mobile_template=str_replace('<!--@KEYWORDS@-->', $this->input->post('ic_seo_keywords'), $mobile_template); $mobile_template=str_replace('<!--@KEYWORDS@-->', $this->input->post('ic_seo_keywords'), $mobile_template);
$mobile_template=str_replace('<!--@CANONICAL@-->', $this->input->post('site_url').$this->input->post('ic_url'), $mobile_template); $mobile_template=str_replace('<!--@CANONICAL@-->', $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_parent_id'),$this->input->post('ic_author'),$this->input->post('ic_title'));//H1模板替换 $mobile_template_H1=$this->call_mobile_template_H1($mobile_first_template_path,$this->input->post('is_parent_id'),$this->input->post('ic_author'),$this->input->post('ic_title'),$this->input->post('ic_photo'));//H1模板替换
$mobile_template=str_replace('<!--@HEAD_1@-->', $mobile_template_H1, $mobile_template); $mobile_template=str_replace('<!--@HEAD_1@-->', $mobile_template_H1, $mobile_template);
$mobile_template=str_replace('<!--@CUSTOM-CONENT@-->', $this->input->post('ic_content'), $mobile_template); $mobile_template=str_replace('<!--@CUSTOM-CONENT@-->', $this->input->post('ic_content'), $mobile_template);
@ -600,7 +600,7 @@ class Information extends CI_Controller
$template=str_replace('<!--@DESCRIPTION@-->', $this->input->post('ic_seo_description'), $template); $template=str_replace('<!--@DESCRIPTION@-->', $this->input->post('ic_seo_description'), $template);
$template=str_replace('<!--@KEYWORDS@-->', $this->input->post('ic_seo_keywords'), $template); $template=str_replace('<!--@KEYWORDS@-->', $this->input->post('ic_seo_keywords'), $template);
$template=str_replace('<!--@CANONICAL@-->', $this->input->post('site_url').$this->input->post('ic_url'), $template); $template=str_replace('<!--@CANONICAL@-->', $this->input->post('site_url').$this->input->post('ic_url'), $template);
$template_H1=$this->call_mobile_template_H1($template_path,$this->input->post('is_parent_id'),$this->input->post('ic_author'),$this->input->post('ic_title'));//H1模板替换 $template_H1=$this->call_mobile_template_H1($template_path,$this->input->post('is_parent_id'),$this->input->post('ic_author'),$this->input->post('ic_title'),$this->input->post('ic_photo'));//H1模板替换
$template=str_replace('<!--@HEAD_1@-->', $template_H1, $template); $template=str_replace('<!--@HEAD_1@-->', $template_H1, $template);
$template=str_replace('<!--@CUSTOM-CONENT@-->', $this->input->post('ic_content'), $template); $template=str_replace('<!--@CUSTOM-CONENT@-->', $this->input->post('ic_content'), $template);
@ -615,10 +615,11 @@ class Information extends CI_Controller
file_put_contents($html_path, $template, LOCK_EX); file_put_contents($html_path, $template, LOCK_EX);
} }
function call_mobile_template_H1($mobile_first_template_path,$is_parent_id,$ic_author,$ic_title){ function call_mobile_template_H1($mobile_first_template_path,$is_parent_id,$ic_author,$ic_title,$ic_photo){
$data['infocategory']=$this->Information_model->Detail($is_parent_id);//信息所属分类获取信息父级节点url title $data['infocategory']=$this->Information_model->Detail($is_parent_id);//信息所属分类获取信息父级节点url title
$data['author']=$this->Operator_model->get_author_nikename($ic_author);//获取作者信息 $data['author']=$this->Operator_model->get_author_nikename($ic_author);//获取作者信息
$data['ic_title']=$ic_title; $data['ic_title']=$ic_title;
$data['ic_photo']=$ic_photo;
return $this->load->view($mobile_first_template_path.'-h1', $data, TRUE); return $this->load->view($mobile_first_template_path.'-h1', $data, TRUE);
} }

@ -1,7 +1,8 @@
<div class=topcontent> <div class=topcontent>
<div class="infotopimage"> <div class="infotopimage">
<img src="https://www.chinahighlights.com/image/tour-detail/china-tour/china-tours-2020-top-amp.jpg" alt="xxx" class="img-responsive"> <img src="<?php echo !empty($ic_photo)?'https://images.chinahighlights.com'.$ic_photo:'https://data.chinahighlights.com/image/tour-detail/harbin/harbin-ice-snow-festival-2020-info-top.jpg'; ?>"
alt="<?php echo !empty($ic_title)?$ic_title:'H1 title Chinahighlights mobile first template'; ?>" class="img-responsive">
</div> </div>
<div class="infocategory"><?php echo !empty($infocategory)?$infocategory->ic_url_title:'infocategory'; ?></div> <div class="infocategory"><?php echo !empty($infocategory)?$infocategory->ic_url_title:'infocategory'; ?></div>

Loading…
Cancel
Save