Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
BBCode: Resize Image with Text Wrap Details »»
BBCode: Resize Image with Text Wrap
Version: 1.01, by midnz midnz is offline
Developer Last Online: Jan 2023 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 4.0.6 Rating:
Released: 08-17-2010 Last Update: Never Installs: 31
Re-useable Code Translations  
No support by the author.

Resize Image with Text Wrap BBCode

I created this BB Code for my own forum and thought I'd share it with the community.
This BB Code allows images to be posted at 200px Wide with text wrapping. Double-clicking the image enlarges it to 600px Wide. Single-clicking reduces the image size back to 200px Wide. The size/resize dimensions can easily be altered to suit your individual requirements. Just change the width= dimensions in the code below.

Demo Here

Instructions:
Open the BBCode Manager/Add New BBCode

Title: Resize Image

BB Code Tag Name: RI

Replacement:
Code:
<img src="{param}" width="200"  ondblclick='this.src="{param}";this.width=600' onclick='this.src="{param}";this.width=200' align="left" hspace="10">


Example:
[RI]image web address goes here[/RI]

Description: Post image at 200px Wide with text wrap. Double-click to enlarge to 600px Wide. Single-click to reduce back to 200px Wide.

Use {option}: No
Button Image (Optional): images/editor/ri.png (upload the attached image via FTP to /images/editor folder) Kindly supplied by VonDoom Post#6
Remove Tag If Empty: Yes
Disable BB Code Within This BB Code: Yes
Disable Smilies Within This BB Code: Yes
Disable Word Wrapping Within This BB Code: Yes
Disable Automatic Link Parsing Within This BB Code: Yes


Please mark as installed if you use this

__________________________________________________ ______________

V. 1.01
  • Removed height attributes to maintain image proportions (Thanks to djbaxter )

Screenshots

File Type: jpg Image Resize 1.JPG (170.7 KB, 0 views)
File Type: jpg Image Resize 2.JPG (121.1 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 05-19-2012, 03:57 PM
ricardoNJ ricardoNJ is offline
 
Join Date: Sep 2008
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

alt=" blablabla"
Reply With Quote
  #43  
Old 05-19-2012, 04:56 PM
midnz's Avatar
midnz midnz is offline
 
Join Date: Jul 2010
Location: New Zealand
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ricardoNJ View Post
Great but...is possible add a text in, like: "click to rezise this picture"???
Quote:
Originally Posted by ricardoNJ View Post
alt=" blablabla"
You're probably best to use: title="blablabla"

title provides the image hover message whereas alt is meant to display a message if the image doesn't display.
alt
might work like title is some, but not all browsers.
Reply With Quote
  #44  
Old 05-19-2012, 06:46 PM
ricardoNJ ricardoNJ is offline
 
Join Date: Sep 2008
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by midnz View Post
You're probably best to use: title="blablabla"

title provides the image hover message whereas alt is meant to display a message if the image doesn't display.
alt
might work like title is some, but not all browsers.
Ok, then could you please add a modification about my question, up there?
Reply With Quote
  #45  
Old 05-20-2012, 06:30 AM
midnz's Avatar
midnz midnz is offline
 
Join Date: Jul 2010
Location: New Zealand
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ricardoNJ View Post
Ok, then could you please add a modification about my question, up there?
Sure, try this:

Code:
<img src="{param}" title="double mouse click to enlarge image/ single mouse click to reduce back to original size" width="200"  ondblclick='this.src="{param}";this.width=600' onclick='this.src="{param}";this.width=200' align="left" hspace="10">
Change the title text to suit what you want.
Reply With Quote
  #46  
Old 10-21-2012, 09:04 AM
ar15dcm ar15dcm is offline
 
Join Date: Apr 2012
Location: Georgia
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What if you have a mix of large and small images, is there a way if the image is smaller to not change its size?
Reply With Quote
  #47  
Old 10-21-2012, 04:15 PM
midnz's Avatar
midnz midnz is offline
 
Join Date: Jul 2010
Location: New Zealand
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ar15dcm View Post
What if you have a mix of large and small images, is there a way if the image is smaller to not change its size?
Create a new BB Code but change all 3 instances of width=XXX to the same value.

Example:
Code:
<img src="{param}" width="100"  ondblclick='this.src="{param}";this.width=100' onclick='this.src="{param}";this.width=100' align="left" hspace="10">
OR

You can download Borgs' [BB Code] Pack For vB 4.0.2+ and use the "Float Left" BB Code from that package
Reply With Quote
  #48  
Old 10-27-2012, 08:30 PM
ar15dcm ar15dcm is offline
 
Join Date: Apr 2012
Location: Georgia
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess what I was asking is more javascript related. If I did that, then by big images would be small.

But, another question... Is there any way to add a style like a radius corner on the images using this in the code;


Code:
style="border-radius:8px;"
When tried it, it worked on the corners but I lost the padding on the preview article.

Thanks,
Reply With Quote
  #49  
Old 10-30-2012, 06:16 PM
midnz's Avatar
midnz midnz is offline
 
Join Date: Jul 2010
Location: New Zealand
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ar15dcm View Post
I guess what I was asking is more javascript related. If I did that, then by big images would be small.

But, another question... Is there any way to add a style like a radius corner on the images using this in the code;


Code:
style="border-radius:8px;"
When tried it, it worked on the corners but I lost the padding on the preview article.

Thanks,
Rather than just ignore you I thought I'd reply and let you know that I don't currently have any spare time to investigate a way to accomplish what you want to do ... I'm sorry.
Reply With Quote
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 05:53 AM.


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.07313 seconds
  • Memory Usage 2,325KB
  • Queries Executed 26 (?)
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
  • (5)bbcode_code
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (2)postbit_attachment
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete