PDA

View Full Version : Image BB Code Request


jkotlowski
06-05-2015, 07:21 AM
I've been searching google for the better part of an hour trying to figure this out, but I can't get it to work. :(

I want my members to have the ability to manually resize images with bbcode, I was on another site that did the same thing. The bbcode was pixel width[/COLOR]xpixel height]image url

I've been throwing code into the bbcode manager and using an {option} tag for both width and height, but in the example when I do my img=250x51 tag it just treats the height and width as being 200 each. I can't figure out how to get it correct. :(

cellarius
06-06-2015, 09:50 AM
You can't do that with a custom bbcode alone. You need to have underlying php code that splits width and height and sets the html tag accordingly.

You probably could do it using this:
https://vborg.vbsupport.ru/showthread.php?t=264896

Master Of Unive
06-06-2015, 01:02 PM
This mod can easily handle your problem

https://vborg.vbsupport.ru/showthread.php?t=189508&page=2

cellarius
06-07-2015, 03:50 AM
I just saw this is a vB5 request. Both addons will (likely, can't test) not work with vB5, since they rely on the plugin system, which was removed from vB5.

jkotlowski
06-07-2015, 10:45 AM
Thank you for the replies. I'm actually on VB Cloud, so I'm unable to do any kind of mods anyway. (I don't think I placed this in the VB5 requests, could have swore it was elsewhere) I was really just hoping this could be handled with BB Code alone. But if it cannot, thank you regardless for your responses.

Black Snow
06-09-2015, 12:13 PM
You can do it with BBCode if you are not bothered about the image height or width being adjusted accordingly.

Enter this as your replacement:
<img src="{param}" width="{option}" />{param}:</a>
Then further down, select yes on: Use {option}

Then when you use your BBCode, enter something like:
http://4.bp.blogspot.com/-JOqxgp-ZWe0/U3BtyEQlEiI/AAAAAAAAOfg/Doq6Q2MwIKA/s1600/google-logo-874x288.png

This will then keep your image 100px wide, and auto adjust the height to match.

cellarius
06-10-2015, 04:28 AM
Good idea! But this will lead to rather small landscape images, when height is smaller than width, and comparable big portrait images, when height is bigger than width.

With vB5 Cloud, is there any way to inject your own css code? Then you could use option to call predefined css classes.

--------------- Added 1433918543 at 1433918543 ---------------

Forget my last question, it won't help. To get around the issue I just mentioned, you'll always need some logic to check which side is bigger.

Black Snow
06-10-2015, 05:48 AM
Found this: https://vborg.vbsupport.ru/showthread.php?t=287476

Looks similar to what I posted.

PinkMilk
06-14-2015, 04:37 PM
Replacement:
<img src="{param}" style="width:{option}px;height:auto;" />
JSFiddle height:auto demo (https://jsfiddle.net/4u59zzra/); height:auto will allow you keep aspect ratio needing only width to be adjusted.

If adjusting both width and height is really necessary try this mod:
Multiple Options in Custom BBCode (https://vborg.vbsupport.ru/showthread.php?t=189508)

with this replacement:
<img src="{param}" style="width:{option1}px;height:{option2}px;" />

Members would then simply add highlighted text in option popup:

100;50[/COLOR]]image/link/here

Update:
Just noticed this request is for vb5 and mod mentioned above is for vb3, will leave post however for vb3 users that might be interested.