Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: JOSHSKORN on June 21, 2014, 01:42:15 AM

Title: Custom Profile Field - Add Embed Code
Post by: JOSHSKORN on June 21, 2014, 01:42:15 AM
I would like to be able to add a custom profile field where users can embed their own code.  An example of this would be to add a field called Twitch where users input their embedded code so one can see their Twitch TV.  How could I go about doing this?

I've enabled Advanced Profile Fields but there's no option for this.
Title: Re: Custom Profile Field - Add Embed Code
Post by: Sir Osis of Liver on June 21, 2014, 01:50:37 AM
You can add a profile field where members can post a link to a video source, but if you want to embed the code for a video player, that can't be done.  It would be a security nightmare.
Title: Re: Custom Profile Field - Add Embed Code
Post by: JOSHSKORN on June 22, 2014, 08:05:00 PM
Quote from: Krash on June 21, 2014, 01:50:37 AM
You can add a profile field where members can post a link to a video source, but if you want to embed the code for a video player, that can't be done.  It would be a security nightmare.

That's really too bad. I would really want that.  BTW, when I first saw your reply, I was reaching for the Raid, then I realized it was just your avatar. Luckily I didn't spray my monitor.  LOL

I might just still search around for a way to do it.
Title: Re: Custom Profile Field - Add Embed Code
Post by: Kindred on June 22, 2014, 08:10:28 PM
There is no good way to do it by default, for a very good reason...   Allowing embed code is a major potential security hole...

Although, You can look at the way the YouTube mods allow embed in the bbc...   And then make a bbc embed for twitch... As long as you clean the input and parse the output on your system instead of just accepting random embed....
Title: Re: Custom Profile Field - Add Embed Code
Post by: JOSHSKORN on June 22, 2014, 08:20:34 PM
Quote from: Kindred on June 22, 2014, 08:10:28 PM
There is no good way to do it by default, for a very good reason...   Allowing embed code is a major potential security hole...

Although, You can look at the way the YouTube mods allow embed in the bbc...   And then make a bbc embed for twitch... As long as you clean the input and parse the output on your system instead of just accepting random embed....
OK I'll look into that.  Twitch.tv is probably the main reason I'd want to do something like this.  I'm a bit old school and really know nothing about it, but it sounds cool so I want to see if I can make it happen.