The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Image BB Code Request
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 [img=pixel widthxpixel height]image url[/img] 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. |
#2
|
||||
|
||||
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 |
#3
|
|||
|
|||
|
#4
|
||||
|
||||
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.
|
#5
|
|||
|
|||
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.
|
#6
|
|||
|
|||
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: Code:
<img src="{param}" width="{option}" />{param}:</a> Then when you use your BBCode, enter something like: Code:
[imgW=100]http://4.bp.blogspot.com/-JOqxgp-ZWe0/U3BtyEQlEiI/AAAAAAAAOfg/Doq6Q2MwIKA/s1600/google-logo-874x288.png[/imgW] |
#7
|
||||
|
||||
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 [DATE]1433918543[/DATE] at [TIME]1433918543[/TIME] --------------- 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 |
#8
|
|||
|
|||
|
#9
|
|||
|
|||
Replacement:
Code:
<img src="{param}" style="width:{option}px;height:auto;" /> If adjusting both width and height is really necessary try this mod: Multiple Options in Custom BBCode with this replacement: Code:
<img src="{param}" style="width:{option1}px;height:{option2}px;" /> Code:
[somebbcode=100;50]image/link/here[/somebbcode] 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. |
2 благодарности(ей) от: | ||
jkotlowski, Scandal |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|