合并产品页信息页头部

master
Jimmy Liow 1 year ago
parent d2b39cdaf9
commit 6b2f5f0671

@ -1094,8 +1094,37 @@ class Information extends CI_Controller
$template = str_replace('?product_code=', '?product_code=' . $meta_product_code, $template);
$information->ic_content = str_replace('<!--@INQUIRY-FORM@-->', $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-BLOCK@-->', $breadcrumb_content, $information->ic_content);
$ads_by_google = !empty ($meta_google_ad_article);
//H1模板替换
$data_H1 = array();
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$data_H1['author'] = ''; //获取作者信息
$author = $this->Operator_model->get_author_nikename($information->ic_author);
if (!empty ($author)) {
$data_H1['author'] = $author->OPI_FirstName;
} else {
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if (!empty ($author_web)) {
$data_H1['author'] = $author_web->a_name;
}
}
// 检查图片地址格式
$parsed_photo = $information->ic_photo;
$parsed_photo_url = parse_url($information->ic_photo);
if (
(!isset ($parsed_photo_url['host']) || !isset ($parsed_photo_url['scheme'])) && isset ($parsed_photo_url['path'])
) {
$parsed_photo = 'https://images.chinahighlights.com' . $parsed_photo_url['path'];
}
$data_H1['ic_title'] = $information->ic_title;
$data_H1['ic_photo'] = $parsed_photo;
$data_H1['breadcrumb_data'] = $breadcrumb_data;
$data_H1['ads_by_google'] = $ads_by_google;
$data_H1['ic_datetime'] = $information->ic_datetime;
$template_H1 = $this->load->view($template_path . '-h1', $data_H1, true);
$template = str_replace('<!--@HEAD_1@-->', $template_H1, $template);
}
// CH: 1; AH: 28; GH : 33

Loading…
Cancel
Save