Commit 5bab3483 by Scott

Add microdata for unregistered/anonymous users

parent f394a34c
...@@ -755,6 +755,11 @@ function qa_who_to_html($isbyuser, $postuserid, $usershtml, $ip = null, $microda ...@@ -755,6 +755,11 @@ function qa_who_to_html($isbyuser, $postuserid, $usershtml, $ip = null, $microda
else else
$whohtml = qa_lang_html('main/anonymous'); $whohtml = qa_lang_html('main/anonymous');
if ($microdata) {
// duplicate HTML from qa_get_one_user_html()
$whohtml = '<span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">' . $whohtml . '</span></span>';
}
if (isset($ip)) if (isset($ip))
$whohtml = qa_ip_anchor_html($ip, $whohtml); $whohtml = qa_ip_anchor_html($ip, $whohtml);
} }
......
...@@ -552,11 +552,16 @@ if (QA_FINAL_EXTERNAL_USERS) { ...@@ -552,11 +552,16 @@ if (QA_FINAL_EXTERNAL_USERS) {
$url = qa_path_html('user/' . $handle); $url = qa_path_html('user/' . $handle);
$favclass = $favorited ? ' qa-user-favorited' : ''; $favclass = $favorited ? ' qa-user-favorited' : '';
$mfAttr = $microdata ? ' itemprop="name"' : ''; $mfAttr = $microdata ? ' itemprop="url"' : '';
$mfPrefix = $microdata ? '<span itemprop="author" itemscope itemtype="http://schema.org/Person">' : '';
$mfSuffix = $microdata ? '</span>' : '';
return $mfPrefix . '<a href="' . $url . '" class="qa-user-link' . $favclass . '"' . $mfAttr . '>' . qa_html($handle) . '</a>' . $mfSuffix; $userHandle = $microdata ? '<span itemprop="name">' . qa_html($handle) . '</span>' : qa_html($handle);
$userHtml = '<a href="' . $url . '" class="qa-user-link' . $favclass . '"' . $mfAttr . '>' . $userHandle . '</a>';
if ($microdata) {
$userHtml = '<span itemprop="author" itemscope itemtype="http://schema.org/Person">' . $userHtml . '</span>';
}
return $userHtml;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment