Thanks RedTyger - that was a very helpful answer!
Now I try to distinguish if a forum, thread, post or user profile is currently displayed and give only the appropriate autodiscovery link for that. E. g. when a post is viewed, don't give additional links for the thread or forum it is in.
I came up with this code that I included at the hook location you told me:
Code:
$vbulletin->input->clean_array_gpc('r', array( 'userid' => INT ));
if ($vbulletin->GPC['userid']) {
$headinclude .= '<link rel="meta" type="application/rdf+xml" title="SIOC" href="sioc.php?sioc_type=user&sioc_id='.$vbulletin->GPC['userid'].'" />';
} elseif ($vbulletin->GPC['postid']) {
$headinclude .= '<link rel="meta" type="application/rdf+xml" title="SIOC" href="sioc.php?sioc_type=post&sioc_id='.$vbulletin->GPC['postid'].'" />';
} elseif ($vbulletin->GPC['threadid']) {
$headinclude .= '<link rel="meta" type="application/rdf+xml" title="SIOC" href="sioc.php?sioc_type=thread&sioc_id='.$vbulletin->GPC['threadid'].'" />';
} elseif ($vbulletin->GPC['forumid']) {
$headinclude .= '<link rel="meta" type="application/rdf+xml" title="SIOC" href="sioc.php?sioc_type=forum&sioc_id='.$vbulletin->GPC['forumid'].'" />';
} else {
$headinclude .= '<link rel="meta" type="application/rdf+xml" title="SIOC" href="sioc.php?sioc_type=site" />';
}
I think this solution is a bit awkward, and I'm not sure if there are situations in which it might not work.
Is there another, more elegant solution for that?