Hook bbcode_create
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;
// Excempt Mods+ and Users with mor then 50 Posts
$parsedurl = $parser->handle_bbcode_url($text, $link);
if (is_member_of($post, 5, 6, 7) OR $post['posts'] > 50)
{
return $parsedurl;
}
else
{
return str_replace('href="', 'rel="nofollow" href="', $parsedurl);
}
}
}
Or (simpler, but might affect mor then just [url])
Hook: bbcode_parse_complete
PHP Code:
global $post;
if (!is_member_of($post, 5, 6, 7) AND !($post['posts'] > 50))
{
$text = str_replace('href="', 'rel="nofollow" href="', $text);
}