Skip to:
Content
Pages
Categories
Search
Top
Bottom

Allow full HTML functionality for group admins (no code-stripping)?

  • Avatar of Joe Marino
    Joe Marino
    Participant

    @jmarino

    Is it possible?

    I am restricting the creation of groups to paid memberships so I would like to allow my group & site admins to have this functionality for their group descriptions and forum posts.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Avatar of Joe Marino
    Joe Marino
    Participant

    @jmarino

    Bump… anyone? Sorry, but it has been 4 days with no reply…

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    By default, you are allowed to use a limited set of HTML tags like [img]and [a]. What type of tags are you wanting to use but can’t?

    You could write a small plugin to either remove these restricting filters or expand the whitelist of allowed tags, but you have to have trust in your group admins!

    I’m using the former in the following example (put this snippet in your theme’s functions.php):

    http://pastebin.com/CWryrkDT

    Like I said, only do this if you trust your user base!

    Avatar of Joe Marino
    Joe Marino
    Participant

    @jmarino

    @r-a-y Thank you for the helpful information! To answer your question, I would like to give my group admins the ability to embed an iframe into their group descriptions to facilitate an external signup. Perhaps there is a way to limit the functionality of iframes to a specific domain or set of domains? I would also like to allow them to embed rich media into their forum posts such as youtube videos for example. In fact, I would like to grant this ability to all registered members on my site.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    The code I posted above should allow you to do what you mentioned.

    Youtube videos in forum posts for all users can be done with the oEmbed for BP plugin.

    Avatar of Joe Marino
    Joe Marino
    Participant

    @jmarino

    @r-a-y When you said “only do this if you trust your user base” it got me thinking… should I trust my group admins just because they paid for the ability to create a group on my site? Also, what if I want to open group creation to all users at a later date (when I can afford a better server)? Considering such, I’ve changed my mind about this. However, I would still like to allow site admins (not group admins) to have full HTML functionality in group descriptions and forum posts (and yes, I definitely trust my site admins). I’m guessing that I would use the same code – just remove the “bp_group_is_admin() ||” part?

    Thanks for bringing that plugin to my attention… I will certainly give that a try! :)

    Avatar of Wayne Moses Burke
    Wayne Moses Burke
    Participant

    @wayneburke

    I struggled with inserting the code that @r-a-y provided above until I realized that in copying it, the single quote marks became opening and closing quote marks. A simple fix with a lot of running around attached to it. Thought someone else may find this helpful.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Thanks Wayne. I’ve now put the snippet on Pastebin.

    I don’t seem to get this up and running. Where exactly should I paste these contents in functions.php? My requirement is simple, I want to have “class” attribute in the “a” tag!! Would this solution work?

    Sorry for the curiosity, made it to work ;-) Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.