Quote:
Originally Posted by oldengine
A whitelist ability for your own forum's domain name would be an excellent add-on to this mod.
|
That's an easy fix. I tried to write it so it would work universaly, but I can't seem to get $vbulletin->options from within the plugin...
Anyway, use this but replace 'DOMAIN_NAME' with your domain. For instance, if vbulletin.org used this mod they would replace 'DOMAIN_NAME' with 'vbulletin'
PHP Code:
$this->tag_list['no_option']['url']['callback'] = 'handle_external';
$this->tag_list['no_option']['url']['external_callback'] = 'handle_bbcode_url_relnofollow';
$this->tag_list['option']['url']['callback'] = 'handle_external';
$this->tag_list['option']['url']['external_callback'] = 'handle_bbcode_url_relnofollow';
if (!function_exists('handle_bbcode_url_relnofollow'))
{
function handle_bbcode_url_relnofollow($parser, $text, $link)
{
global $post;
$parsedurl = $parser->handle_bbcode_url($text, $link);
if (is_member_of($post, 5, 6) || strpos($parsedurl, 'DOMAIN_NAME') !== false)
{
return $parsedurl;
}
else
{
return str_replace('href="', 'rel="nofollow" href="', $parsedurl);
}
}
}