vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Image BB Code Request (https://vborg.vbsupport.ru/showthread.php?t=318949)

jkotlowski 06-05-2015 07:21 AM

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. :(

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/showthrea...=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:
Code:

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

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]
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 [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 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:
Code:

<img src="{param}" style="width:{option}px;height:auto;" />
JSFiddle height:auto demo; 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

with this replacement:
Code:

<img src="{param}" style="width:{option1}px;height:{option2}px;" />
Members would then simply add highlighted text in option popup:

Code:

[somebbcode=100;50]image/link/here[/somebbcode]
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.


All times are GMT. The time now is 11:31 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08510 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete