Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
enable iframe?
Avatar
Dan Kleiman
Member
Free Members
sp_UserOfflineSmall Offline
Apr 9, 2012 - 10:26 am

Hi,

 

Is there any way to enable iframe for embedding? I understand the security concerns, but on my membership site right now, it seems to be the only way I can share embedded video with iPad/iPhone users....

 

Any suggestions for how to get them video?

 

Thanks,
Dan

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 9, 2012 - 11:40 am

iFrames are under constant discussion but there is an enormous security concern over their use.

Have you tried using the oEmbed method? Where you just paste the actual url into the post and turn on the oEmbed support in WordPress (settings > media panel).

andy-signature.png
YELLOW
SWORDFISH
Avatar
Brandon
U.S.
SP Wrangler
Free Members
sp_UserOfflineSmall Offline
Apr 9, 2012 - 12:04 pm

Most all of the new browsers support HTML5 video before trying to open up iframes you may want to give that a try.

Using the TinyMCE embed media icon you can open it up and add a video. Select HTML5 video and enter the filename.

Depending on what type of videos you are sharing mp4,ogg this may be a solution.

Simple:Press also works with WordPress's Oembed feature http://codex.wordpress.org/Embeds you may want to look at that also.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 9, 2012 - 10:26 pm

or if you really want to take the security risk (eek) we can tell you how to use a filter to change the allowed html...

Avatar
jkswopes
Member
Free Members
sp_UserOfflineSmall Offline
Apr 10, 2012 - 12:37 pm

I'm looking for an answer to this question as well, I have a private membership so I'm not concerned with the security issues, how do we use the filters to enable this option?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 10, 2012 - 2:23 pm

OK - this is untested as I am doing it quickly but I think this should do the trick.

Open up the spFunctions.php file in the SP theme templates folder and add this code:

add_filter('sph_custom_kses', 'my_function');
function my_function($allowedforumtags) {
    $allowedforumtags['iframe'] = array('class' => array(), 'style' => array(), 'height' => array(), 'width' => array(). 'src' => array(), 'scrolling' => array());
    return $allowedforumtags;
}

Of course - you should supply your own function name to replace 'my_function'.

As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/codex/themes/theme-basics/creating-a-theme/)

andy-signature.png
YELLOW
SWORDFISH
Avatar
jkswopes
Member
Free Members
sp_UserOfflineSmall Offline
Apr 10, 2012 - 3:41 pm

By "my function" does that mean whatever name I want or am I looking for a certain function in my existing template code?  

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 10, 2012 - 4:18 pm

Sorry not clear - you can call it whatever you like. Even 'my_function' if you wish. 🙂

But is usually better to come up with something unique - like putting your initials in front of it. No spaces of course. Note there are two instances of the function name to change - they must be the same.

andy-signature.png
YELLOW
SWORDFISH
Avatar
jkswopes
Member
Free Members
sp_UserOfflineSmall Offline
Apr 10, 2012 - 4:23 pm

cool, thanks 🙂

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 10, 2012 - 8:15 pm

np. let us know how it goes.

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626