|
|
|
|
@ -1095,12 +1095,13 @@ class Information extends CI_Controller
|
|
|
|
|
$data_H1 = array();
|
|
|
|
|
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
|
|
|
|
|
$data_H1['author'] = ''; //获取作者信息
|
|
|
|
|
$data_H1['meta_news_createdate'] = get_meta($information->ic_id, 'meta_news_createdate');
|
|
|
|
|
$data_H1['meta_news_createdate'] = $this->get_publish_date_in_6_month($information);
|
|
|
|
|
$author_url = '';
|
|
|
|
|
$author = $this->Operator_model->get_author_nikename($information->ic_author);
|
|
|
|
|
if (!empty($author)) {
|
|
|
|
|
$data_H1['author'] = $author->OPI_FirstName;
|
|
|
|
|
$data_H1['OPI_Code'] = $author->OPI_Code;
|
|
|
|
|
$data_H1['author_url'] = $this->get_author_url('www.chinahighlights.com', $author->OPI_Code);
|
|
|
|
|
$author_url = $this->get_author_url('www.chinahighlights.com', $author->OPI_Code);
|
|
|
|
|
} else {
|
|
|
|
|
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
|
|
|
|
|
if (!empty($author_web)) {
|
|
|
|
|
@ -1154,7 +1155,7 @@ class Information extends CI_Controller
|
|
|
|
|
|
|
|
|
|
$article_structured_data_content = $this->load->view(
|
|
|
|
|
$template_path . '-structured-data-article',
|
|
|
|
|
array('information' => $information, 'author_name' => $data_H1['author'], 'author_url' => $data_H1['author_url']),
|
|
|
|
|
array('information' => $information, 'author_name' => $data_H1['author'], 'author_url' => $author_url),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
|
|
|
|
|
@ -1485,6 +1486,26 @@ class Information extends CI_Controller
|
|
|
|
|
file_put_contents($html_path, $template, LOCK_EX);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 六个月以前的文章不显示发布时间
|
|
|
|
|
private function get_publish_date_in_6_month($information)
|
|
|
|
|
{
|
|
|
|
|
$publish_date_in_6_month = NULL;
|
|
|
|
|
$meta_news_createdate = get_meta($information->ic_id, 'meta_news_createdate');
|
|
|
|
|
|
|
|
|
|
if (!empty($meta_news_createdate) && strtotime($meta_news_createdate)) {
|
|
|
|
|
$publish_date = new DateTime($meta_news_createdate, new DateTimeZone('UTC'));
|
|
|
|
|
$current_date = new DateTime('now', new DateTimeZone('UTC'));
|
|
|
|
|
$interval = $current_date->diff($publish_date);
|
|
|
|
|
$total_months = $interval->y * 12 + $interval->m;
|
|
|
|
|
|
|
|
|
|
if ($total_months < 6) {
|
|
|
|
|
$publish_date_in_6_month = $meta_news_createdate;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $publish_date_in_6_month;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function test_recommand()
|
|
|
|
|
{
|
|
|
|
|
$information = $this->Information_model->Detail($this->input->get('is_id'));
|
|
|
|
|
@ -1835,13 +1856,13 @@ class Information extends CI_Controller
|
|
|
|
|
$data_H1 = array();
|
|
|
|
|
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
|
|
|
|
|
$data_H1['author'] = ''; //获取作者信息
|
|
|
|
|
$data_H1['meta_news_createdate'] = get_meta($information->ic_id, 'meta_news_createdate');
|
|
|
|
|
$data_H1['meta_news_createdate'] = $this->get_publish_date_in_6_month($information);
|
|
|
|
|
$author = $this->Operator_model->get_author_nikename($information->ic_author);
|
|
|
|
|
|
|
|
|
|
$author_url = '';
|
|
|
|
|
if (!empty($author)) {
|
|
|
|
|
$data_H1['author'] = $author->OPI_FirstName;
|
|
|
|
|
$data_H1['OPI_Code'] = $author->OPI_Code;
|
|
|
|
|
$data_H1['author_url'] = $this->get_author_url('www.globalhighlights.com', $author->OPI_Code);
|
|
|
|
|
$author_url = $this->get_author_url('www.globalhighlights.com', $author->OPI_Code);
|
|
|
|
|
} else {
|
|
|
|
|
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
|
|
|
|
|
if (!empty($author_web)) {
|
|
|
|
|
@ -1862,7 +1883,7 @@ class Information extends CI_Controller
|
|
|
|
|
|
|
|
|
|
$article_structured_data_content = $this->load->view(
|
|
|
|
|
'mobile_first/gh-structured-data-article',
|
|
|
|
|
array('information' => $information, 'author_name' => $data_H1['author'], 'author_url' => $data_H1['author_url']),
|
|
|
|
|
array('information' => $information, 'author_name' => $data_H1['author'], 'author_url' => $author_url),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
|
|
|
|
|
@ -2224,14 +2245,17 @@ class Information extends CI_Controller
|
|
|
|
|
|
|
|
|
|
$breadcrumb_data = $this->Information_model->get_breadcrumb_data($information->is_id, $information->is_path, $group_map);
|
|
|
|
|
$ads_by_google = !empty(get_meta($information->ic_id, 'meta_google_ad_article'));
|
|
|
|
|
$data['meta_news_createdate'] = get_meta($information->ic_id, 'meta_news_createdate');
|
|
|
|
|
$data['meta_news_createdate'] = $this->get_publish_date_in_6_month($information);
|
|
|
|
|
$data['ads_by_google'] = $ads_by_google;
|
|
|
|
|
$data['author'] = ''; //获取作者信息
|
|
|
|
|
$author_url = '';
|
|
|
|
|
$author = $this->Operator_model->get_author_nikename($information->ic_author);
|
|
|
|
|
if (!empty($author)) {
|
|
|
|
|
$data['author'] = $author->OPI_FirstName;
|
|
|
|
|
$data['OPI_Code'] = $author->OPI_Code;
|
|
|
|
|
$data['author_url'] = $this->get_author_url('www.asiahighlights.com', $author->OPI_Code);
|
|
|
|
|
$author_url = $this->get_author_url('www.asiahighlights.com', $author->OPI_Code);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
|
|
|
|
|
if (!empty($author_web)) {
|
|
|
|
|
@ -2244,7 +2268,7 @@ class Information extends CI_Controller
|
|
|
|
|
// 结构化标签:Article
|
|
|
|
|
$article_structured_data_content = $this->load->view(
|
|
|
|
|
$template_path . '-structured-data-article',
|
|
|
|
|
array('information' => $information, 'author_name' => $data['author'], 'author_url' => $data['author_url']),
|
|
|
|
|
array('information' => $information, 'author_name' => $data['author'], 'author_url' => $author_url),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
|
|
|
|
|
@ -2630,14 +2654,15 @@ class Information extends CI_Controller
|
|
|
|
|
|
|
|
|
|
$breadcrumb_data = $this->Information_model->get_breadcrumb_data($information->is_id, $information->is_path, $group_map);
|
|
|
|
|
$ads_by_google = !empty(get_meta($information->ic_id, 'meta_google_ad_article'));
|
|
|
|
|
$data['meta_news_createdate'] = get_meta($information->ic_id, 'meta_news_createdate');
|
|
|
|
|
$data['meta_news_createdate'] = $this->get_publish_date_in_6_month($information);
|
|
|
|
|
$data['ads_by_google'] = $ads_by_google;
|
|
|
|
|
$data['author'] = ''; //获取作者信息
|
|
|
|
|
$author = $this->Operator_model->get_author_nikename($information->ic_author);
|
|
|
|
|
$author_url = '';
|
|
|
|
|
if (!empty($author)) {
|
|
|
|
|
$data['author'] = $author->OPI_FirstName;
|
|
|
|
|
$data['OPI_Code'] = $author->OPI_Code;
|
|
|
|
|
$data['author_url'] = $this->get_author_url('www.japanhighlights.com', $author->OPI_Code);
|
|
|
|
|
$author_url = $this->get_author_url('www.japanhighlights.com', $author->OPI_Code);
|
|
|
|
|
} else {
|
|
|
|
|
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
|
|
|
|
|
if (!empty($author_web)) {
|
|
|
|
|
@ -2650,7 +2675,7 @@ class Information extends CI_Controller
|
|
|
|
|
// 结构化标签:Article
|
|
|
|
|
$article_structured_data_content = $this->load->view(
|
|
|
|
|
$template_path . '-structured-data-article',
|
|
|
|
|
array('information' => $information, 'author_name' => $data['author'], 'author_url' => $data['author_url']),
|
|
|
|
|
array('information' => $information, 'author_name' => $data['author'], 'author_url' => $author_url),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
|
|
|
|
|
|