My members have requested the ability to disable color tags just as they can disable images. I created a profile field for this and have been trying to determine the correct hook and code to make this work. The closest I've gotten is:
Code:
if ($vbulletin->userinfo['field5'] == "Yes") {
global $vbphrase, $db;
$post_text = $db->query_first("SELECT pagetext FROM " . TABLE_PREFIX . "post WHERE postid = $post[postid] ORDER BY dateline ASC");
$post_color['pagetext'] = preg_replace('#\[color=sienna\](.*?)\[/color\]#si', '\1', $post_text[pagetext]);
$post_color['pagetext'] = preg_replace('#\[color=black\](.*?)\[/color\]#si', '\1', $post_color[pagetext]);
$post['message'] = nl2br($post_color['pagetext']);
}
While this removes the sienna and black color tags, it leaves the rest of the BBcode unparsed.
I'm looking for a way to just remove the tags without unparsing everything else, and possibly a more efficient way of removing colors (than one at a time).