GH article 增加作者 URL

master
LiaoYijun 1 year ago
parent 9059be466c
commit ca412a0de9

@ -1837,6 +1837,7 @@ class Information extends CI_Controller
if (!empty($author)) {
$data_H1['author'] = $author->OPI_FirstName;
$data_H1['OPI_Code'] = $author->OPI_Code;
$data_H1['author_url'] = $this->get_author_url($author->OPI_Code);
} else {
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if (!empty($author_web)) {
@ -1856,8 +1857,8 @@ 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']),
'mobile_first/gh-structured-data-article',
array('information' => $information, 'author_name' => $data_H1['author'], 'author_url' => $data_H1['author_url']),
true
);
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
@ -3129,7 +3130,7 @@ class Information extends CI_Controller
if (!empty($meta_index_set)) {
$data["meta_index_set"] = '<meta name="robots" content="' . $meta_index_set . '" />';
}
//总JS为了方便以后js好维护必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js所以必须在这里进行判断
$addBaseJs = false;
@ -5635,4 +5636,31 @@ class Information extends CI_Controller
echo json_encode($data);
return true;
}
public function get_author_url($OPI_Code)
{
$OPI_CodeUrls = [
'zzy' => 'https://www.globalhighlights.com/aboutus/team/ruru-zhou',
'2' => 'https://www.globalhighlights.com/aboutus/team/ruru-zhou',
'HWT' => 'https://www.globalhighlights.com/aboutus/team/mike-he',
'CA' => 'https://www.globalhighlights.com/aboutus/team/carol-wang',
'SI' => 'https://www.globalhighlights.com/aboutus/team/simon-huang',
'TJQ' => 'https://www.globalhighlights.com/aboutus/team/cindy-tang',
'CLA' => 'https://www.globalhighlights.com/aboutus/team/claire-wang',
'Albee' => 'https://www.globalhighlights.com/aboutus/team/albee-ning',
'KM' => 'https://www.globalhighlights.com/aboutus/team/kimi-huang',
'RY' => 'https://www.globalhighlights.com/aboutus/team/rita-yu',
'QMY' => 'https://www.globalhighlights.com/aboutus/team/chris-quan',
'CY' => 'https://www.globalhighlights.com/aboutus/team/cynthia-li',
'Vicky' => 'https://www.globalhighlights.com/aboutus/team/vicky-leng',
'LXW' => 'https://www.globalhighlights.com/aboutus/team/carper-li',
'zzyGH' => 'https://www.globalhighlights.com/aboutus/team/ruru-zhou',
];
if (!empty($OPI_Code) && array_key_exists($OPI_Code, $OPI_CodeUrls)) {
return $OPI_CodeUrls[$OPI_Code];
} else {
return '';
}
}
}

Loading…
Cancel
Save