GH article 增加作者 URL

master
LiaoYijun 1 year ago
parent 9059be466c
commit ca412a0de9

@ -1837,6 +1837,7 @@ class Information extends CI_Controller
if (!empty($author)) { if (!empty($author)) {
$data_H1['author'] = $author->OPI_FirstName; $data_H1['author'] = $author->OPI_FirstName;
$data_H1['OPI_Code'] = $author->OPI_Code; $data_H1['OPI_Code'] = $author->OPI_Code;
$data_H1['author_url'] = $this->get_author_url($author->OPI_Code);
} else { } else {
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等 $author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if (!empty($author_web)) { if (!empty($author_web)) {
@ -1856,8 +1857,8 @@ class Information extends CI_Controller
} }
$article_structured_data_content = $this->load->view( $article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article', 'mobile_first/gh-structured-data-article',
array('information' => $information, 'author_name' => $data_H1['author']), array('information' => $information, 'author_name' => $data_H1['author'], 'author_url' => $data_H1['author_url']),
true true
); );
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template); $template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
@ -5635,4 +5636,31 @@ class Information extends CI_Controller
echo json_encode($data); echo json_encode($data);
return true; 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