ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Set SAEF html-format to 'all' (User Module)

October 04, 2008 9:50am

Subscribe [1]
  • #1 / Oct 04, 2008 9:50am

    Dutchee

    12 posts

    Hi,

    This is the situation:
    I’d like to allow users to add an youtube/vimeo/slideshare-embed to their profile. The problem is: profile fields don’t support embed-codes by default.

    I already managed to change the following in the source code of the Solspace User Module i’m using.

    I changed:

    'text_format'   => $this->mfields[$key]['format'],
    'html_format'   => 'safe'

    into:

    'text_format'   => $this->mfields[$key]['format'],
    'html_format'   => 'all'

    This works great, but only if I add a YouTube-embed-code to a profile using the build-in profile editor in the Admin-panel.

    Now I would like to do the same for the profile edit fields which I created in the front-end.

    I use this textarea to edit fields:

    {exp:user:edit member_id="{member_id}" return = "{path=profielsucces}"}
    <textarea name="youtube" rows="5" cols="40">{youtube}</textarea>
    {/exp:user:edit}

    This results in the following (wrong formatted) text on the public profile page:

    ----> I can't show you guys, because this forum is displaying the source-code correct.. I see these kinds of characters which are not parsed correctly: & lt; & lt; (ASCII? Stands for " < ", needed to open <object tags and <embed tags. Hope this is clear to you.

    Now I’m looking for the right source template (or another solution) to change this front-end profile edit field to ‘html_format’  => ‘all’

    Hopefully someone can trace the needed source-code. Thanks!

  • #2 / Oct 10, 2008 4:43pm

    Robin Sowell

    13255 posts

    Hm- are you trying to put the full embed in?  Be careful with that- as you have to allow my script than I’d be comfortable with.

    What you might do- take a look at how it was done in this extensions to add vids to the forum- they don’t allow the whole embed, just the id bit.  Then build the player code around it.  Another option- I think the flv player will pull from youtube.

    But basically?  What I’d shoot for is getting a simple link that you can build the player around- and slap some security on that link submission, just to be sure.

    That help at all?

  • #3 / Oct 13, 2008 12:38pm

    Dutchee

    12 posts

    Thanks Robin. The JW Media Player is pulling content from youtube indeed, so it did the job. You can see it live here: http://www.studentennetwork.nl/contact/

    Maybe we need another embed using User Profiles (SlideShare? Vimeo?) in the future but then we will search again to set HTML-format to ‘all’. For now this solution is great for what we need!

  • #4 / Nov 16, 2008 7:07pm

    Dutchee

    12 posts

    I think I found a solution. Inside core.regex.php, both ‘embed’ and ‘object’ are mentioned as ‘naughty’ tags. Removing them automaticly allows YouTube-embeds (and Scribd, Slideshare etc) to be published by users on forums, wiki’s and user-profiles. (only tested on Wiki Module). Update: this solution has some security problems.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases