Commit d3860445 by Scott

Fix errors with microformats

Slightly hacky since answers/comments don’t have titles. Probably need
to switch to schema.org microdata instead.
parent e770dcef
......@@ -516,7 +516,7 @@
$fields['when']=qa_when_to_html($post['created'], @$options['fulldatedays']);
if ($microformats)
$fields['when']['data']='<span class="published"><span class="value-title" title="'.gmdate('Y-m-d\TH:i:sO', $post['created']).'"></span>'.$fields['when']['data'].'</span>';
$fields['when']['data']='<span class="published"><span class="value-title" title="'.gmdate('Y-m-d\TH:i:sO', $post['created']).'">'.$fields['when']['data'].'</span></span>';
}
if (@$options['whoview']) {
......@@ -593,12 +593,15 @@
$fields['when_2']=qa_when_to_html($post['updated'], @$options['fulldatedays']);
if ($microformats)
$fields['when_2']['data']='<span class="updated"><span class="value-title" title="'.gmdate('Y-m-d\TH:i:sO', $post['updated']).'"></span>'.$fields['when_2']['data'].'</span>';
$fields['when_2']['data']='<span class="updated"><span class="value-title" title="'.gmdate('Y-m-d\TH:i:sO', $post['updated']).'">'.$fields['when_2']['data'].'</span></span>';
}
if (isset($post['lastuserid']) && @$options['whoview'])
$fields['who_2']=qa_who_to_html(isset($userid) && ($post['lastuserid']==$userid), $post['lastuserid'], $usershtml, @$options['ipview'] ? $post['lastip'] : null, false);
}
elseif ($microformats) { // quick fix for incorrect microformats (missing 'updated' class)
$fields['when']['data'] = str_replace('<span class="published">', '<span class="published updated">', $fields['when']['data']);
}
// That's it!
......
......@@ -460,7 +460,7 @@
$url = qa_path_html('user/'.$handle);
$favclass = $favorited ? ' qa-user-favorited' : '';
$mfclass = $microformats ? ' url nickname' : '';
$mfclass = $microformats ? ' url fn entry-title nickname' : '';
return '<a href="'.$url.'" class="qa-user-link'.$favclass.$mfclass.'">'.qa_html($handle).'</a>';
}
......
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