Code to add [img align=right] and [img align=left] to bbcode
This bbcode is using in xoops in others cms..
'#\[img align=right]([\w:;&,~%+!=@\/\.\-\#\?]+)\[/img(?::\w+)?\]#si' => '<img src="\\1" alt="" align="right" class="bb-image" />',
'#\[img align=left]([\w:;&,~%+!=@\/\.\-\#\?]+)\[/img(?::\w+)?\]#si' => '<img src="\\1" alt="" align="left" class="bb-image" />',Add this code next to this line(107):
// Images without or with client-side sizing
| Comment | File | Size | Author |
|---|---|---|---|
| bbcode1.png | 47.81 KB | int |
Comments
Comment #1
int commentedput also the [img align=center]
Comment #2
naudefj commentedTry the following:
[float=right][img]http://upload.wikimedia.org/wikipedia/en/0/0b/Drupallogo.png[/img][/float]Comment #3
int commentedyes, this are two tag instead only one.
And i'm add this to my bbcode filter because, my data from xoops cms, use this style of align.
Comment #4
naudefj commentedPlease test this regex. If it works I will add it to the module:
'#\[img align=(left|right|center)(?::\w+)?\]([\w:;&,~%+!=@\/\.\-\#\?]+)\[/img(?::\w+)?\]#si' => '<img src="\\2" alt="" align="\\1" class="bb-image" />',Comment #5
naudefj commentedAdded to CVS.
Comment #6
(not verified) commentedComment #7
int commented"Added to CVS."
I donwload the CVS version and don't have this new tag..
Comment #8
naudefj commentedWell, it's definitely in CVS. As proof, look at http://cvs.drupal.org/viewcvs/drupal/contributions/modules/bbcode/bbcode...
Are you sure you've downloaded the CVS version???
Comment #9
naudefj commentedComment #10
(not verified) commented