diff --git a/application/controllers/information.php b/application/controllers/information.php index c8d4d937..54d63a79 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -1186,9 +1186,26 @@ class Information extends CI_Controller { if (empty($meta_product_code)) { $template = str_replace('?product_code=', '', $template); + $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); + $meta_addon_picture_mobile = get_meta($information->ic_id, 'meta_addon_picture_mobile'); + + $article_image_list = [$meta_addon_picture, $meta_addon_picture_mobile]; + $article_image_list = array_values(array_filter($article_image_list, function($value) { + return !empty($value); + })); + $article_image_json = json_encode($article_image_list, JSON_UNESCAPED_SLASHES); + + $article_published_date = new DateTime($information->is_datetime, new DateTimeZone('UTC')); + $article_modified_date = new DateTime('now', new DateTimeZone('UTC')); + $article_structured_data_content = $this->load->view( - $template_path . '-structured-data-article', - ['information' => $information, 'author_name' => $data_H1['author'], 'author_url' => $author_url], + $template_path . '-structured-data-article', [ + 'information' => $information, + 'article_published_date' => $article_published_date, + 'article_modified_date' => $article_modified_date, + 'author_name' => $data['author'], 'author_url' => $author_url, + 'article_image_urls' => $article_image_json + ], true ); $template = str_replace('', $article_structured_data_content, $template); diff --git a/application/views/mobile_first/ch-structured-data-article.php b/application/views/mobile_first/ch-structured-data-article.php index 9c503cc1..032b8df8 100644 --- a/application/views/mobile_first/ch-structured-data-article.php +++ b/application/views/mobile_first/ch-structured-data-article.php @@ -7,11 +7,9 @@ "@id": "https://www.chinahighlights.comic_url; ?>" }, "headline": "ic_seo_title; ?>", - "image": [ - "https://images.chinahighlights.comic_photo; ?>" - ], - "datePublished": "is_datetime; ?>", - "dateModified": "", + "image": , + "datePublished": "format('c'); ?>", + "dateModified": "format('c'); ?>", "author": { "@type": "Person", "name": "",