更新 GH 文章名字可以使用在线作者

hotfix/paypal-note
LiaoYijun 3 years ago
parent 595e146c60
commit d9545594cd

@ -1019,6 +1019,7 @@ class Information extends CI_Controller
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容 $data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$data_H1['author'] = ''; //获取作者信息 $data_H1['author'] = ''; //获取作者信息
$author = $this->Operator_model->get_author_nikename($information->ic_author); $author = $this->Operator_model->get_author_nikename($information->ic_author);
if(!empty($author)){ if(!empty($author)){
$data_H1['author']=$author->OPI_FirstName; $data_H1['author']=$author->OPI_FirstName;
}else{ }else{
@ -1041,7 +1042,7 @@ class Information extends CI_Controller
$article_structured_data_content = $this->load->view( $article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article', $template_path . '-structured-data-article',
array('information' => $information, 'author' => $author), array('information' => $information, 'author_name' => $data_H1['author']),
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);

@ -14,7 +14,7 @@
"dateModified": "<?php echo date('Y-m-d\TH:i:s'); ?>", "dateModified": "<?php echo date('Y-m-d\TH:i:s'); ?>",
"author": { "author": {
"@type": "Person", "@type": "Person",
"name": "<?php echo $author->OPI_FirstName; ?>" "name": "<?php echo $author_name; ?>"
}, },
"publisher": { "publisher": {
"@type": "Organization", "@type": "Organization",

Loading…
Cancel
Save