MyBB Community Forums

Full Version: Custom MyCode + Permissions?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Seems like this would be complicated but is there perchance a way I can limit certain Custom MyCodes to a specific usergroup? Like, lets say, Admin only?

I'd like to start using iframes in my posts but of course it would be preferable if the whole wide world wasn't able to post any pages with dodgy content or nasty h@x.

Any suggestions would rock!

Many thanks...
Yes you can do that with a plugin. The best is if the custom code is part of the plugin already instead of the mybb admincp mycode settings.

For 1.2x I had a "HTML permissions per group" plugin that would be effective for your use. It would allow you to set a group or uid that could create HTML.

I plan to update it to 1.4x asap. I just updated 5 plugins the past couple days.
That sounds awesome. =)
Personally, I allow IFrames, but they're loaded via DHTML. I personally dislike the idea of having usergroup based MyCode capabilities, mainly if someone else quotes your post and it becomes a general mess...
(2008-09-24, 07:07 AM)ZiNgA BuRgA Wrote: [ -> ]Personally, I allow IFrames, but they're loaded via DHTML. I personally dislike the idea of having usergroup based MyCode capabilities, mainly if someone else quotes your post and it becomes a general mess...

Unless there was a way to make it show as just plain text (i.e. no MyCode or tags) if the user quotes a post that has MyCode they can't use??

Personally I can't find much use for this but still...
(2008-09-24, 07:07 AM)ZiNgA BuRgA Wrote: [ -> ]Personally, I allow IFrames, but they're loaded via DHTML. I personally dislike the idea of having usergroup based MyCode capabilities, mainly if someone else quotes your post and it becomes a general mess...

I echo your concerns. It would take more than a simple REGEX to make it work intuitively. In essence, you'd have to scan the original post for any BB tags the current user doesn't have rights to, then convert those blocks to HTML (using the parser), then attempting to convert the resultant HTML into BB Code using only the codes the current user has rights to. Of course, we probably should do the same for some existing codes (such as displaying the username of either the poster or viewer).
Some good points raised, I knew this wasn't going to be simple. Toungue

*sigh*
(2008-09-24, 09:46 AM)Matt_ Wrote: [ -> ]Unless there was a way to make it show as just plain text (i.e. no MyCode or tags) if the user quotes a post that has MyCode they can't use??
That could probably be done (strip_tags()) - only works for HTML though.
Another thought regarding this: What about adding the option to limit Custom MyCodes in forum settings.

Similar to the Yes, allow [img] code in posts already in place, other MyCodes could have the same option. It's not permissions but it at least stops it being used in undesired areas.
That could be quite a good addition actually.
Pages: 1 2