BBCode inside BBCode

Get help developing custom BBCodes or request one.
chinfarm2
Registered User
Posts: 3
Joined: Sat Nov 25, 2023 11:08 am

BBCode inside BBCode

Post by chinfarm2 »

Hi guys,

Im a Freshman in phpBB and webdev in generall, my codes are mostly made with snippets from somebody else and the help of a friend + some trial and error.

I made this code:

Code: Select all

[item]{URL},{TEXT}[/item]

Code: Select all

<br /><div style="width:;min-height:100px;border:2px solid #1b1626; background-color:#2a2640">
<div style="float:left; padding:0 10px;">
<img id="img" src="{URL}" style="width:auto;height:100px"></div>{TEXT}</div>
the goal of the code ist to display a box, which at least as huge as the picture. The Picture needs to float left and have a fixed size in height. The code does this perfectly.

But;
I want to use things like Size, Bold, Color in the text part. But it wont get replaced it just displays all other BBCode as the Code.

Whats the problem here? Can i fix this?

Thanks for every help.
chinfarm2
Registered User
Posts: 3
Joined: Sat Nov 25, 2023 11:08 am

Re: BBCode inside BBCode

Post by chinfarm2 »

Fixed it.

I dont know why;

Code: Select all

[item]{URL},{TEXT}[/item]
i did

Code: Select all

[item={URL}]{TEXT}[/item]
and it works with all BBCode now

confusing,

maybe somebody can explain for future reference.
User avatar
warmweer
Jr. Extension Validator
Posts: 11467
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: BBCode inside BBCode

Post by warmweer »

Why create an item BBcode for something that exists already (the url BBcode ... with options)?

[url=http://www.examplesite.com]the [b]same[/b] example site[/url] >>> the same example site

[url=https://www.examplesite.com][u]the[/u] same example site[/url] >>> the same example site

[url=https://www.examplesite.com][u][color=#FF0000]the[/u] same example site[/color][/url] >>> the same example site
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
chinfarm2
Registered User
Posts: 3
Joined: Sat Nov 25, 2023 11:08 am

Re: BBCode inside BBCode

Post by chinfarm2 »

The BBCode i made generates a box in a certain color, in side the box there is a a image on the fixed to the left side with a fixed size in height and text on the right size. Its used for a RPG-forum to display a item the character is in possession of.
ItemTest.png
funny enough, while i tested it again to screenshot it for you, i saw that text goes beneath the picture if long enough, this behaivor isn´t wanted. Any ideas how to fix this?
FailedTest.png
i want the text to be always seperated from the picture.
You do not have the required permissions to view the files attached to this post.
User avatar
cabot
Registered User
Posts: 733
Joined: Sat Jan 07, 2012 4:16 pm

Re: BBCode inside BBCode

Post by cabot »

Hello,

Code: Select all

<div style="border:2px solid #1b1626; background-color:#2a2640; display: flex;">
<img src="{URL}" style="width:auto;height:100px; padding: 0 10px;" alt="">
<div>{TEXT}</div>
</div>

Return to “Custom BBCode Development and Requests”