How to Use a Single BBCode to Embed Contents with Multiple Iframes?

Get help developing custom BBCodes or request one.
Post Reply
odf
Registered User
Posts: 161
Joined: Sun Jan 22, 2017 8:55 pm

How to Use a Single BBCode to Embed Contents with Multiple Iframes?

Post by odf »

Hello Members,

I want to load/embed contents from various locations using a single BBCode but each content has the same parent/top-level domain in an iframe, here are two examples:

Code: Select all

<iframe src="https://www.domain.com/container/intl/en/products.html{SIMPLETEXT}" width="800" height="600" scrolling="no" allowfullscreen></iframe>
and

Code: Select all

<iframe src="https://www.domain.com/container/premium/intl_products.html{SIMPLETEXT}" width="800" height="600" scrolling="no" allowfullscreen </iframe>
The BBCode for either of the iframe can be

Code: Select all

[prod]{SIMPLETEXT}[/prod]
How can I use just one BBCode and be able to load contents from either of the two iframes above at a time?

Thanking you in advance.

odf
Last edited by HiFiKabin on Sat Sep 26, 2020 5:40 pm, edited 1 time in total.
Reason: Moved to Custom BBCode
User avatar
RoboYonk
Registered User
Posts: 5
Joined: Sat Sep 26, 2020 6:26 am
Name: Thomas

Re: How to Use a Single BBCode to Embed Contents with Multiple Iframes?

Post by RoboYonk »

Hi!

did you try just add such a bbcode?

For example In my board I have a bbcode mod from Advanced BBCode Box (but I can modify it however I want).
And it is quite complicated.

Code: Select all

[mod={TEXT1}]{TEXT2}[/mod]
is replaced to:

Code: Select all

<table class="ModTable" style="background-color:#FFFFFF;border:1px solid #000000;border-collapse:separate;border-spacing:5px;margin:1em 0;padding:0;width:100%;color:#333333;overflow:hidden;"><tr><td class="exclamation" rowspan="2" style="background-color:#ff6060;font-weight:bold;font-family:'Times New Roman',Verdana,sans-serif;font-size:4em;color:#ffffff;vertical-align:middle;text-align:center;width:1%;">&nbsp;!&nbsp;</td><td class="rowuser" style="border-bottom:1px solid #000000;font-weight:bold;">{L_MESSAGE} {L_FROM}{L_COLON} {TEXT1}</td></tr><tr><td class="rowtext">{TEXT2}</td></tr></table>
based on the example above, I don't see any problem with adding a new bbcode to the APC panel.
odf
Registered User
Posts: 161
Joined: Sun Jan 22, 2017 8:55 pm

Re: How to Use a Single BBCode to Embed Contents with Multiple Iframes?

Post by odf »

Thank you. The BBCode works just fine, the issue is I don't want to use/create a different BBCode for eache iframe.
User avatar
JoshyPHP
Code Contributor
Posts: 1177
Joined: Mon Jul 11, 2011 12:28 am

Re: How to Use a Single BBCode to Embed Contents with Multiple Iframes?

Post by JoshyPHP »

You need to explain how the proposed solution differs from what you need, with practical examples of what the users would enter and how it would be displayed.
I wrote the thing that does BBCodes in 3.2+.
odf
Registered User
Posts: 161
Joined: Sun Jan 22, 2017 8:55 pm

Re: How to Use a Single BBCode to Embed Contents with Multiple Iframes?

Post by odf »

JoshyPHP wrote:
Sun Sep 27, 2020 8:18 pm
You need to explain how the proposed solution differs from what you need, with practical examples of what the users would enter and how it would be displayed.
Hi JoshyPHP,

This is what I'm thinking:

Consider the iframe

Code: Select all

<iframe src="https://www.domain.com/container/intl/en/products.html{SIMPLETEXT}" width="100%" height="450" scrolling="no" allowfullscreen></iframe>
which can be used with the BBCode

Code: Select all

[prod]{SIMPLETEXT}[/prod]
Now, How to change the iframe to something like this

Code: Select all

<iframe src="https://www.domain.com/container/key={SIMPLETEXT}" width="100%" height="450" scrolling="no" allowfullscreen></iframe>
so that the user can embed contents by putting everything after "https://www.domain.com/container/" into the BBCode, that's

Code: Select all

[prod]intl/en/products.html[/prod]
for this example ?

odf
User avatar
JoshyPHP
Code Contributor
Posts: 1177
Joined: Mon Jul 11, 2011 12:28 am

Re: How to Use a Single BBCode to Embed Contents with Multiple Iframes?

Post by JoshyPHP »

You didn't explain how the definition you proposed does not achieve the thing you want to do, so I'm going to guess you need to replace {SIMPLETEXT} with {TEXT}. If that doesn't do the thing, you need to post practical examples of what the users would enter and the HTML it should produce.
I wrote the thing that does BBCodes in 3.2+.
odf
Registered User
Posts: 161
Joined: Sun Jan 22, 2017 8:55 pm

Re: How to Use a Single BBCode to Embed Contents with Multiple Iframes?

Post by odf »

JoshyPHP wrote:
Tue Sep 29, 2020 12:08 pm
You didn't explain how the definition you proposed does not achieve the thing you want to do, so I'm going to guess you need to replace {SIMPLETEXT} with {TEXT}. If that doesn't do the thing, you need to post practical examples of what the users would enter and the HTML it should produce.
Replacing key={SIMPLETEXT} with {TEXT} works by triggers a seemingly very serious security issue:

"The BBCode you are trying to add seems to use a {TEXT} token inside a HTML attribute. This is a possible XSS security issue. Try using the more restrictive {SIMPLETEXT} or {INTTEXT} types instead. Only proceed if you understand the risks involved and you consider the use of {TEXT} absolutely unavoidable."

Any secure solution? Neither {SIMPLETEXT} nor {INTTEXT} works!

odf
User avatar
JoshyPHP
Code Contributor
Posts: 1177
Joined: Mon Jul 11, 2011 12:28 am

Re: How to Use a Single BBCode to Embed Contents with Multiple Iframes?

Post by JoshyPHP »

If you're on phpBB 3.2 you can almost certainly ignore this warning.
I wrote the thing that does BBCodes in 3.2+.
User avatar
ViolaF
Registered User
Posts: 1543
Joined: Tue Aug 14, 2012 11:52 pm

Re: How to Use a Single BBCode to Embed Contents with Multiple Iframes?

Post by ViolaF »

And in 3.3.*?
you "can" or "should it not" ignore it .. or what??
User avatar
JoshyPHP
Code Contributor
Posts: 1177
Joined: Mon Jul 11, 2011 12:28 am

Re: How to Use a Single BBCode to Embed Contents with Multiple Iframes?

Post by JoshyPHP »

phpBB 3.3 won't produce a warning with that definition.
I wrote the thing that does BBCodes in 3.2+.
Post Reply

Return to “Custom BBCode Development and Requests”