[RFC] BBCode permissions and moving to all custom

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] BBCode permissions and moving to all custom

Post by brunoais »

And you want that for CSS?
If not, what's the use of that for you?

ecwpa
Registered User
Posts: 181
Joined: Mon Jan 24, 2005 2:10 am
Contact:

Re: [RFC] BBCode permissions and moving to all custom

Post by ecwpa »

Javascript, as I mentioned, the main use would be any library that uses element ID. JS charts, JS galleries, etc, there're a lot of uses for it.
Slightly better English than it was in 2005, still improving :D

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] BBCode permissions and moving to all custom

Post by brunoais »

Why the id? Why not an @class or a data-* parameter or something in the lines of that?
You can find what you want using a selector, so... what gives, huh?

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] BBCode permissions and moving to all custom

Post by EXreaction »

I see. As brunoais said, why is the id required? Javascript selectors should work fine on either the id, class, data, or other parameters, are you sure these libraries only work off of specific id tags (could you link to an example if one does)?

I believe you can use the current custom bbcode system to do this if you must, you would just need to add an attribute that the user would need to enter as an id (problem being that they'd need to manually make something up and if the person uses something simple, like "1," another person could use that and cause issues).

User avatar
Pony99CA
Registered User
Posts: 986
Joined: Sun Feb 08, 2009 2:35 am
Location: Hollister, CA
Contact:

Re: [RFC] BBCode permissions and moving to all custom

Post by Pony99CA »

VSE+ wrote:To the point of the OP, I don't think permissions need to be expanded to all BBcodes - does anybody really need to restrict anybody from using bold, italics, quotes or lists? The current flash and img bbcode permissions seem adequate enough to me.
Maybe you don't want new users to go crazy with formatting until they're used to the board's culture.

Or, as mentioned in an earlier post here, I certainly think that phpBB should have a specific permission for URLs (which would also prevent "magic URLs" from becoming true links). URLs seem a lot easier to misuse than images.
imkingdavid wrote:
VSE+ wrote:To the point of the OP, I don't think permissions need to be expanded to all BBcodes - does anybody really need to restrict anybody from using bold, italics, quotes or lists? The current flash and img bbcode permissions seem adequate enough to me.
I don't think it would hurt to allow permissions to be set for all BBCodes. After all, if all BBCodes are made to be custom BBCodes, there would be no nice way to programmatically determine which BBCodes are supplied natively and which are user-created.
In my proposal, the standard ones aren't necessarily truly implemented as Custom BBCodes. They show up in the BBCodes list, but may only be reordered or disabled, not deleted or edited (although you may want allow partial editing, like the button's display text and help text). In order to accommodate that, there would be a flag indicating if a BBCode is standard or custom.
imkingdavid wrote:
VSE+ wrote:However, I really do think that Custom BBcodes should have a Group assignments option. Because the custom bbcodes are where lots of Admins add bbcodes with abilities they may only want certain users to have. The ability to assign a custom bbcode to specific user groups only would be really nice.
We do need to tackle the issue of whether to or not to apply a restricted BBCode when a post is quoted. Because a quote is not actually tied to a user with anything more than a username, and it is impossible to tell if that user actually said those words exactly, users could circumvent BBCode permissions by simply quoting and using an authorized user's username. I suppose an acceptable solution would be to replace any restricted bbcodes with something like [Restricted content removed] or something.
If you can do that, that would be great, but at the very least, quoting a BBCode that you can't use would result in displaying the BBCode as text.

For example, consider a MOD BBCode that moderators can use to include moderation notes in a topic. The BBCode definition is:

Code: Select all

[mod]{TEXT}[/mod]
The HTML Replacement is:

Code: Select all

<div style="border: 5px solid yellow;">
<b>MODERATED</b><br />
{TEXT}
</div>
A use might include the following:

Code: Select all

[mod]Please do not discuss that in this topic[/mod]
NOTE: You can see an example at my board.

Currently, this has two potential problems: Anybody can use that tag (if they know about it, which they will once it's used the first time) and you may not want it to appear if somebody quotes that post. If we solve the first problem, when somebody quotes a post with that in it, the quote would just show up containing the text shown in the previous CODE tags. That may be sufficient.

Just in case that it's not clear, I think that the permission part of the RFC is about who can post a given BBCode, not who can see the formatted results. Anybody not authorized to post a tag will just have the tag displayed as plain text in their post. If we can solve the problem for quotes, it may also solve the problem of even having the BBCode text show up anywhere.

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

ecwpa
Registered User
Posts: 181
Joined: Mon Jan 24, 2005 2:10 am
Contact:

Re: [RFC] BBCode permissions and moving to all custom

Post by ecwpa »

EXreaction wrote:I see. As brunoais said, why is the id required? Javascript selectors should work fine on either the id, class, data, or other parameters, are you sure these libraries only work off of specific id tags (could you link to an example if one does)?

I believe you can use the current custom bbcode system to do this if you must, you would just need to add an attribute that the user would need to enter as an id (problem being that they'd need to manually make something up and if the person uses something simple, like "1," another person could use that and cause issues).
I guess that depends of the JS library. jqPlot for example uses ID to identify where the chart is going to be drawn, I've tried quite a few charts libraries and most of them use ID too.
EXreaction wrote: I believe you can use the current custom bbcode system to do this if you must, you would just need to add an attribute that the user would need to enter as an id (problem being that they'd need to manually make something up and if the person uses something simple, like "1," another person could use that and cause issues).
Now we're talking, i considered that but leaving it to users is not a good idea. I even considered combining post IDs and time stamps in some way but that doesn't work if there're 2 bbcodes of the same in the same post.
Slightly better English than it was in 2005, still improving :D

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] BBCode permissions and moving to all custom

Post by EXreaction »

I see. For what it's worth, that should be possible with the BBCode engine that brunoais is working on. The engine will support writing your own PHP code to parse the text, so in it you could have a unique (or close to unique, an md5 of microtime should be fine) identifier generated for each instance of the bbcode.

User avatar
Pony99CA
Registered User
Posts: 986
Joined: Sun Feb 08, 2009 2:35 am
Location: Hollister, CA
Contact:

Re: [RFC] BBCode permissions and moving to all custom

Post by Pony99CA »

EXreaction wrote:I believe you can use the current custom bbcode system to do this if you must, you would just need to add an attribute that the user would need to enter as an id (problem being that they'd need to manually make something up and if the person uses something simple, like "1," another person could use that and cause issues).
And that latter part is probably why a unique ID is being asked for. It only needs to be unique for the given page, though, so the ID needs to be generated at the time of page generation, not posting time.

I'd also like to see some predefined variables (like template variables) for including things like the user name, post ID, topic ID and forum ID of the post being quoted (useful for cross-reference linking) and maybe the current date and time (as of the time the post was submitted). The date and time would be replaced when submitted with the appropriate values (so they aren't updated every time the page is viewed).

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] BBCode permissions and moving to all custom

Post by EXreaction »

I don't think it really matters if the id is generated at page generation or posting time, the easiest way for either is to essentially generate a random-ish string.

As far as having additional tokens available, I'm not sure what brunoais's plans are for tokens, but perhaps it could be a simple plugin system that would allow additional tokens to be added easily in extensions.

User avatar
tbackoff
Registered User
Posts: 180
Joined: Sat Jun 12, 2010 3:25 am

Re: [RFC] BBCode permissions and moving to all custom

Post by tbackoff »

VSE+ wrote:To the point of the OP, I don't think permissions need to be expanded to all BBcodes - does anybody really need to restrict anybody from using bold, italics, quotes or lists?
You've obviously never seen posts on .com (before moderator intervention) where users are using TEXT LIKE THIS in their posts. :D :lol: [/endjoke]

Post Reply