Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-05-2015, 07:21 AM
jkotlowski jkotlowski is offline
 
Join Date: May 2015
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 06-06-2015, 09:50 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 06-06-2015, 01:02 PM
Master Of Unive Master Of Unive is offline
 
Join Date: Oct 2009
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This mod can easily handle your problem

https://vborg.vbsupport.ru/showthrea...=189508&page=2
Reply With Quote
  #4  
Old 06-07-2015, 03:50 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 06-07-2015, 10:45 AM
jkotlowski jkotlowski is offline
 
Join Date: May 2015
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 06-09-2015, 12:13 PM
Black Snow Black Snow is offline
 
Join Date: Jul 2012
Location: Scotland
Posts: 471
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 06-10-2015, 04:28 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
Black Snow
  #8  
Old 06-10-2015, 05:48 AM
Black Snow Black Snow is offline
 
Join Date: Jul 2012
Location: Scotland
Posts: 471
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Found this: https://vborg.vbsupport.ru/showthread.php?t=287476

Looks similar to what I posted.
Reply With Quote
  #9  
Old 06-14-2015, 04:37 PM
PinkMilk PinkMilk is offline
 
Join Date: May 2010
Location: Earth
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
2 благодарности(ей) от:
jkotlowski, Scandal
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04754 seconds
  • Memory Usage 2,248KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (3)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete