MyBB Community Forums

Full Version: How can I align images in posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi! I just wanted to do a mycode which allows me to align images in posts so i did two peronalizrd codes
[img left] and [image right]
The problem is that whit this two codes i can't resize images as i can do with the simple IMG code. How should I change the two personalized ones to do the resize possible?
[align=right][img=WxH]url[/img][/align] 
well...it just don't fix my problem...I need something paragonable to
<img align="left" weight=x height="y"
you can do the same thing with the way that LeX- provide it..

example

[Image: bigbanner.gif]

the bb code to do that it's
[align=right][img]http://mybbpics.googlepages.com/bigbanner.gif[/img][/align]

[Image: bigbanner.gif]
[align=center][img]http://mybbpics.googlepages.com/bigbanner.gif[/img][/align]
[Image: bigbanner.gif]
[align=left][img]http://mybbpics.googlepages.com/bigbanner.gif[/img][/align]

you already can control the posetion for your message without any modefy

if you meant another thing please show us an example
You can also control width and height of your images:
[img=50x80]http://mybbpics.googlepages.com/bigbanner.gif[/img]

[Image: bigbanner.gif]
yes but my problem is that in this way I can't align the text too (i've got to align text and images as in an article)
You can use this ?

[align=left]TEXT[/align][align=right][img=400x400]URL[/img][/align]
I donìt work Sad
What i want is something similar to
<img  src="URL" width="x" height="y" alt="" align="right (or left)"/>
[img=WxH align=center]URL[/img] 
Is a premade MyCode in MyBB.

Edit:

You need to change the MyCode in the core file, probably a "bug" [ http://community.mybboard.net/showthread.php?tid=24424 ].
Open ./inc/class_parser.php
Find
			$message = preg_replace("#\[img=([0-9]{1,3})x([0-9]{1,3}) align=([a-z]+)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#ise", "\$this->mycode_parse_img('$5', array('$1', '$2', '$3'));", $message);

Replace By
			$message = preg_replace("#\[img=([0-9]{1,3})x([0-9]{1,3}) align=([a-z]+)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#ise", "\$this->mycode_parse_img('$5', array('$1', '$2'), '$3');", $message);
thanks! It works perfectly!