![]() |
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") { 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). |
You could do this: create a new style and then in a plugin using hook bbcode_fetch_tags:
Code:
global $style; where the X is the new style id. I think this works because posts are cached by style. If you used a profile field instead I don't think it would work because of post caching. Obviously this isn't a good solution if you already have a number of styles that a user can choose. I'm not sure where you are putting the code in your example, maybe there's another way to do it (like maybe you could replace all <span color="xxx">whatever</span> in the post text). |
Sorry forgot to mention this is in a plugin at the postbit_display_complete hook.
A new style is not a viable option. |
OK, how about this:
Code:
if ($vbulletin->userinfo['field5'] == "Yes") |
Hey that worked great! Thanks!
|
Thinking about it more, it's probably not going to work in all situations since the SIZE and FONT bbcodes also end up as <font> tags, so something like:
This is red and big still red would probably end up with "still red" being size 5 instead of normal. |
Quote:
|
All times are GMT. The time now is 05:36 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|