change the <iframe></iframe> with BBCode
2 posters
Page 1 of 1
Re: change the <iframe></iframe> with BBCode
Hello erchima,
You could probably write a small bit of javascript to convert your bbcode in posts to HTML.
For example :
Write
This will just display as plain text since we have nothing to parse the bbcode server side.
We can add a small script :
Modules > javascript codes management > create a new script
Title : your choice
Placement : either in the topics or in all pages
Paste the code below and submit :
frameHeight and frameWidth are the dimensions of the iframe. Change these in the script to the size of your choice.
You could probably write a small bit of javascript to convert your bbcode in posts to HTML.
For example :
Write
- Code:
[iframe src="/myurl"][/iframe]
This will just display as plain text since we have nothing to parse the bbcode server side.
We can add a small script :
Modules > javascript codes management > create a new script
Title : your choice
Placement : either in the topics or in all pages
Paste the code below and submit :
- Code:
$(function() {
var frameHeight = 250;
var frameWidth = 500;
var d = document.getElementsByTagName('DIV');
for (i = 0; i < d.length; i++) {
if (d[i].className == 'postbody') {
if (/\[iframe src="(.*?)"\]\[\/iframe\]/.test(d[i].innerHTML)) {
d[i].innerHTML = d[i].innerHTML.replace(/\[iframe src="(.*?)"\]\[\/iframe\]/ig,'<iframe src="$1" height="'+frameHeight+'" width="'+frameWidth+'"></iframe>');
}
}
}
});
frameHeight and frameWidth are the dimensions of the iframe. Change these in the script to the size of your choice.
Similar topics
» iFrame BBcode?
» [suggestion] Add Iframe video BBCode on forumotion
» How to change bbcode icons?
» Iframe Issue
» iframe code help
» [suggestion] Add Iframe video BBCode on forumotion
» How to change bbcode icons?
» Iframe Issue
» iframe code help
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum