MyBB Community Forums

Full Version: [IMGW] MyBB code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi! Well, since I dont really like the idea of auto-resizing the images that the users post, I wanted to have an extra [img] code, something like [imgw] to make the image fit with the forum, and behind the image a link provided to see the image in its real size.
Thanks for reading! Big Grin


saludos
I've made one for you, it's also support 'title' attribute. It's not suggested to use this MyCode with small images

[img fit]<image url>[/img]
[img fit title="My Image"]<image url>[/img]

Regular Expression:
\[img\sfit(\stitle="([^"]+?)")?\](.+?)\[/img\]
Replacement:
<a href="$3" style="display:block; text-align:center" title="Click to see the image in a full size">$2<img src="$3" alt="$2" title="$2" style="display:block; width:100%; border:0" /></a>
You can change and modify the replacement how you want, it's only html. $3 $represent the image url and $2 the image title (if exists)

Please report any issue, I've made only minimal testing
(2009-03-11, 03:16 PM)dvb Wrote: [ -> ]I've made one for you, it's also support 'title' attribute. It's not suggested to use this MyCode with small images

[img fit]<image url>[/img]
[img fit title="My Image"]<image url>[/img]

Regular Expression:
\[img\sfit(\stitle="([^"]+?)")?\](.+?)\[/img\]
Replacement:
<a href="$3" style="display:block; text-align:center" title="Click to see the image in a full size">$2<img src="$3" alt="$2" title="$2" style="display:block; width:100%; border:0" /></a>
You can change and modify the replacement how you want, it's only html. $3 $represent the image url and $2 the image title (if exists)

Please report any issue, I've made only minimal testing

Thank you very much! =D It works perfectly ^^

Is there any way to make the image look smaller than to just fit, and put a text right behind the image that says something like "This image has been resized, click here to view it full size."
And also it would be great if the link opens in another tab/window

And again, thank you so much for your help =)
See this?
<a href="$3" style="display:block; text-align:center" title="Click to see the image in a full size">$2<img src="$3" alt="$2" title="$2" style="display:block; width:100%; border:0" /></a>
This is called HTML Toungue , if you don't know how to change things - go and learn!
You can't be a forum admin without to know the basic stuff...

Anyway, if I've understand you, here is what you want:
<a href="$3" target="_blank" style="display:block; text-align:center" title="Click to see the image in a full size">$2<img src="$3" alt="$2" title="$2" style="display:block; width:90%; border:0" />(This image has been resized, click here to view it full size)</a>
(2009-03-11, 08:11 PM)dvb Wrote: [ -> ]See this?
<a href="$3" style="display:block; text-align:center" title="Click to see the image in a full size">$2<img src="$3" alt="$2" title="$2" style="display:block; width:100%; border:0" /></a>
This is called HTML Toungue , if you don't know how to change things - go and learn!
You can't be a forum admin without to know the basic stuff...

Anyway, if I've understand you, here is what you want:
<a href="$3" target="_blank" style="display:block; text-align:center" title="Click to see the image in a full size">$2<img src="$3" alt="$2" title="$2" style="display:block; width:90%; border:0" />(This image has been resized, click here to view it full size)</a>

Hehe, yes youre right. Im not a coder but i understand a basic things of php and html. I've used a lot of different forum softwares, but that was a long time ago si i've forgotten a lot of things hehe, but im quickly leraning them again. I've made already my owen GoEar and YouTube MyBB code hahah Toungue
Well thanks again for your help, lets see if this works

edit: its perfect! thank you for your patience and understanding =D