diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 29a2ab27d8f..532ae51da97 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -397,7 +397,7 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri */ function includeContainer($containerref) { - global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers. + global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers. global $includehtmlcontentopened; global $websitekey, $websitepagefile; @@ -434,7 +434,63 @@ function includeContainer($containerref) $includehtmlcontentopened--; } +/** + * Return HTML content to add structured data for an article, news or Blog Post. + * + * @param WebsitePage $websitepage Website page object + * @return string HTML content + */ +function getStructuredDataForBlogPost(WebsitePage $websitepage) +{ + global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $weblangs; // Very important. Required to have var available when running inluded containers. + global $includehtmlcontentopened; + global $websitekey, $websitepagefile; + if ($websitepage->fk_user_creat > 0) + { + include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $tmpuser = new User($db); + $restmpuser = $tmpuser->fetch($websitepage->fk_user_creat); + + if ($restmpuser > 0) + { + $ret = ''."\n"; + $ret .= ''."\n"; + } + } + + return $ret; +} /** * Download all images found into page content $tmp.