Fix url for youtube

This commit is contained in:
Laurent Destailleur 2020-05-17 20:08:01 +02:00
parent 9370f71d01
commit 02d4ecb21c

View File

@ -582,14 +582,17 @@ function getStructuredData($type, $data = array())
"@type": "ContactPoint", "@type": "ContactPoint",
"contactType": "Contact", "contactType": "Contact",
"email": "'.dol_escape_json($mysoc->email).'" "email": "'.dol_escape_json($mysoc->email).'"
},'; },'."\n";
if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) { if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
$ret .= '"sameAs": ['; $ret .= '"sameAs": [';
$i = 0; $i = 0;
foreach($mysoc->socialnetworks as $key => $value) { foreach($mysoc->socialnetworks as $key => $value) {
if ($key == 'linkedin') { if ($key == 'linkedin') {
$ret.= '"https://www.'.$key.'.com/company/'.dol_escape_json($value).'"'; $ret.= '"https://www.'.$key.'.com/company/'.dol_escape_json($value).'"';
} else { } elseif ($key == 'youtube') {
$ret.= '"https://www.'.$key.'.com/user/'.dol_escape_json($value).'"';
}
else {
$ret.= '"https://www.'.$key.'.com/'.dol_escape_json($value).'"'; $ret.= '"https://www.'.$key.'.com/'.dol_escape_json($value).'"';
} }
$i++; $i++;