MyBB Community Forums

Full Version: How to add a bbcode [float]?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want to add a img layout bbcode like [float=right][/float] around img that will cause the following html

<span style="float: right;"></span>

What I need to do?

Thanks
(2010-02-18, 05:17 AM)elim Wrote: [ -> ]I want to add a img layout bbcode like [float=right][/float] around img that will cause the following html

<span style="float: right;"></span>

What I need to do?

Thanks

Why would you want to do that it would make the image float out side the thread.
Just to make small img surrounded by text instead of letting it define
the hight of the line or taking whole paragraph like this [Image: MagicPuzzles.gif]. I saw some other forum has that option.
[Image: php.gif]
[img align=right]http://www.php.net/images/php.gif[/img]

It looks like[Image: MagicPuzzles.gif] this works pretty good.
Wow, so far I never used the stock MyCode img combination with align. [Image: php.gif] You live and learn.
(2010-02-19, 03:42 AM)Yumi Wrote: [ -> ][Image: php.gif]
[img align=right]http://www.php.net/images/php.gif[/img]
Great! Thanks a lot. See how nice this can be in math discussion:
http://mathtoc.yi.org/showthread.php?tid=9&pid=12#pid12

Also see the red 'Let's say' part there.
But the solution right new is for url image. I'm still looking for a solution to layout attached image in the post. That's why I'm asking for bbcode [float=right]..[/float]

My real problem is that I don't know how bbcode is working. That's why I don't know how to extend it.
Regular Expression;
\[float=(.*?)\](.*?)\[/float\]

Replacement;
<span style="float: $1;">$2</span>
(2010-02-19, 08:55 PM)elim Wrote: [ -> ]
(2010-02-19, 03:42 AM)Yumi Wrote: [ -> ][Image: php.gif]
[img align=right]http://www.php.net/images/php.gif[/img]
Great! Thanks a lot. See how nice this can be in math discussion:
http://mathtoc.yi.org/showthread.php?tid=9&pid=12#pid12

Also see the red 'Let's say' part there.
But the solution right new is for url image. I'm still looking for a solution to layout attached image in the post. That's why I'm asking for bbcode [float=right]..[/float]

My real problem is that I don't know how bbcode is working. That's why I don't know how to extend it.

You can add the align=right to anything. A link, an image, anything.
[attachment=17412 align=right] ---- the wrong way.

While using 'align=right tag around attachment=xxx worked (sort of).
You see that not all bbcode tags support align attribute in the same sense. Here the little ok is NOT ok. It occupies a whole block while [img align=right] behaves quite differently.

Therefore the challenge is still there: find a way to layout inserted attached image nicely: [float=right]..[/float]
Pages: 1 2