Does your mode produces XHTML compliant code?atnbueno wrote: If you mean to style the floated image, check out the style attribute of the img tag after <!-- BEGIN left --> in http://www.mundoplus.tv/atnbueno/left-right_162.mod
Does your mode produces XHTML compliant code?atnbueno wrote: If you mean to style the floated image, check out the style attribute of the img tag after <!-- BEGIN left --> in http://www.mundoplus.tv/atnbueno/left-right_162.mod
kulinar wrote: Does your mode produces XHTML compliant code?
atnbueno wrote: Hello all.
dcz wrote:[...] I was wondering if I needed to change the #i into #si in the rest of the code before applying this code change (including #si's)
The "s" is a regex modifier that enables single-line mode. You can decide if you want to allow linebreaks in your [img] bbcodes.
Regards,
Code: Select all
[img=left:ed3fce9a9e]http://fish-hawk.net/phpBB2/templates/subSilver/images/logo_phpBB.gif[/img:ed3fce9a9e] this is some text that should be besdie the image.
Code: Select all
#
#-----[ OPEN ]---------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]---------------------------------------------
# Line 194
$patterns[] = "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i";
$replacements[] = $bbcode_tpl['img'];
// matches a [url]xxxx://www.phpbb.com[/url] code..
$patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url1'];
// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";
#
#-----[ REPLACE WITH ]---------------------------------------------
#
$patterns[] = "#\[img:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/img:$uid\]#i";
$replacements[] = $bbcode_tpl['img'];
// matches a [url]xxxx://www.phpbb.com[/url] code..
$patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url1'];
// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";
Code: Select all
// LEFT-RIGHT-start
// [img=left]image_url_here[/img] code..
$patterns[] = "#\[img=left:$uid\](.*?)\[/img:$uid\]#si";
$replacements[] = $bbcode_tpl['left'];
// [img=right]image_url_here[/img] code..
$patterns[] = "#\[img=right:$uid\](.*?)\[/img:$uid\]#si";
$replacements[] = $bbcode_tpl['right'];
// LEFT-RIGHT-end
Code: Select all
// LEFT-RIGHT-start
// [img=left]image_url_here[/img] code..
$patterns[] = "#\[img=left:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/img:$uid\]#si";
$replacements[] = $bbcode_tpl['left'];
// [img=right]image_url_here[/img] code..
$patterns[] = "#\[img=right:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/img:$uid\]#si";
$replacements[] = $bbcode_tpl['right'];
// LEFT-RIGHT-end
congoclash wrote: Thanks a lot, it worked on 2.0.20 but witout padding around images the effect is a bit ugly. Any ideas on how to introduce 2-4 px of padding?
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
ROOT/templates/subSilver/bbcode.tpl
#
#-----[ FIND ]------------------------------------------
#
# NOTE: the full line to look for is:
#<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->
#
<!-- BEGIN img -->
#
#-----[ AFTER, ADD ]------------------------------------------ // Similar lines of code should already be there; modify them according to the space you want around your images (here, 10px vertical and horizontal)
#
<!-- BEGIN left --><img src="{URL}" border="0" align="left" hspace="10" vspace="10" /><!-- END left -->
<!-- BEGIN right --><img src="{URL}" border="0" align="right" hspace="10" vspace="10" /><!-- END right -->
Code: Select all
<!-- BEGIN left --><img src="{URL}" alt="" border="0" align="left" /><!-- END left -->
<!-- BEGIN right --><img src="{URL}" alt="" border="0" align="right" /><!-- END right -->
Code: Select all
<!-- BEGIN left --><img src="{URL}" alt="" border="0" align="left" hspace="2" /><!-- END left -->
<!-- BEGIN right --><img src="{URL}" alt="" border="0" align="right" hspace="2" /><!-- END right -->