The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Trying to disable color tags for some users
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']); } 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). |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|