perf: author_url

master
LiaoYijun 9 months ago
parent 9953cb3901
commit 441214074e

@ -2697,7 +2697,7 @@ class Information extends CI_Controller
$data['ads_by_google'] = $ads_by_google; $data['ads_by_google'] = $ads_by_google;
$data['author_name'] = ''; //获取作者信息 $data['author_name'] = ''; //获取作者信息
$author = $this->Operator_model->get_author_nikename($information->ic_author); $author = $this->Operator_model->get_author_nikename($information->ic_author);
$author_url = ''; $data['author_info'] = ['url' => '', 'avatar' => '', 'expertise' => ''];
if (!empty($author)) { if (!empty($author)) {
$data['author_name'] = $author->OPI_FirstName; $data['author_name'] = $author->OPI_FirstName;
@ -2705,13 +2705,10 @@ class Information extends CI_Controller
$author_info = $this->get_author_info('japanhighlights.com', $author->OPI_Code); $author_info = $this->get_author_info('japanhighlights.com', $author->OPI_Code);
$data['author_info'] = $author_info; $data['author_info'] = $author_info;
$author_url = $this->get_author_url('www.japanhighlights.com', $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)) {
$data['author_name'] = $author_web->a_name; $data['author_name'] = $author_web->a_name;
$data['author_info'] = ['url' => '', 'avatar' => '', 'expertise' => ''];
} }
} }
$data['breadcrumb_data'] = $breadcrumb_data; $data['breadcrumb_data'] = $breadcrumb_data;
@ -2720,7 +2717,7 @@ class Information extends CI_Controller
// 结构化标签Article // 结构化标签Article
$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_name' => $data['author_name'], 'author_url' => $author_url), array('information' => $information, 'author_name' => $data['author_name'], 'author_url' => $author_info['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);

Loading…
Cancel
Save