Support Forum

iframe

9 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

https://simple-press.com/support-forum/sp5-coding-questions/installing-iframe-into-simple-press-post/

That shows you how to set it up so a forum admin can use iFrames in posts. If you want everyone to be able to do it then just remove the check for admin… but as always be very aware that this is a gaping security hole that anyone could exploit to do just about anything with.

DR DAVE RITCHIE
DAVE RITCHIE
Member

sorry to be such a newb …. is there a place that shows how to do that …. i know my way around code but not a pro …

DR DAVE RITCHIE
DAVE RITCHIE
Member

 

in spfuctions right ???

 

<?php
# ————————————————————————————–
#
# Simple:Press Theme custom function file
# Theme : Default
# File : custom functions
# Author : Simple:Press
#
# The ‘functions’ file can be used for custom functions & is loaded with each template
#
# ————————————————————————————–

add_action(‘init’, ‘spDefault_textdomain’);

# load the theme textdomain for tranlations
function spDefault_textdomain() {
sp_theme_localisation(‘spDefault’);
}

if (function_exists(‘sp_FontResizer’)) {
add_action(‘sph_BeforeDisplayStart’, ‘spDefault_spShowFontResize’);
}

function spDefault_spShowFontResize() {
$tipMinus = __sp(‘decrease forum font size’);
$tipReset = __sp(‘reset forum font size’);
$tipPlus = __sp(‘increase font size’);
sp_FontResizer(‘tagClass=spFontSizeControl spRight’, $tipMinus, $tipReset, $tipPlus);
sp_InsertBreak(‘direction-right’);
}

?>

YS Yellow Swordfish
Yellow Swordfish
Member

Yes – as good a place as any.
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/)

DR DAVE RITCHIE
DAVE RITCHIE
Member

so after the last question mark ? or before 

YS Yellow Swordfish
Yellow Swordfish
Member

All php needs to be within the php tags so somewhere before the end of the file.

DR DAVE RITCHIE
DAVE RITCHIE
Member

so like this correct

<?php
# ————————————————————————————–
#
# Simple:Press Theme custom function file
# Theme : Default
# File : custom functions
# Author : Simple:Press
#
# The ‘functions’ file can be used for custom functions & is loaded with each template
#
# ————————————————————————————–

add_action(‘init’, ‘spDefault_textdomain’);

# load the theme textdomain for tranlations
function spDefault_textdomain() {
sp_theme_localisation(‘spDefault’);
}

if (function_exists(‘sp_FontResizer’)) {
add_action(‘sph_BeforeDisplayStart’, ‘spDefault_spShowFontResize’);
}

function spDefault_spShowFontResize() {
$tipMinus = __sp(‘decrease forum font size’);
$tipReset = __sp(‘reset forum font size’);
$tipPlus = __sp(‘increase font size’);
sp_FontResizer(‘tagClass=spFontSizeControl spRight’, $tipMinus, $tipReset, $tipPlus);
sp_InsertBreak(‘direction-right’);
}
add_filter(‘sph_kses_allowed_tags’, ‘my_kses_array’);
function my_kses_array($tags) {
global $spThisUser;

if ($spThisUser->admin) {
$tags[‘iframe’] =
array(
‘width’ => array(),
‘height’ => array(),
‘frameborder’ => array(),
‘src’ => array(),
‘frameborder’ => array(),
‘marginwidth’ => array(),
‘marginheight’ => array()
);
}
return $tags;
?>

YS Yellow Swordfish
Yellow Swordfish
Member

Please ignore – performing messaging test