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
  #22  
Old 08-20-2010, 11:42 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Regarding the imaghe distortion, this seems to work:

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


I've just kept the width parameters and deleted the height paramaters. This shrinks the width and the height shrinks proportionately.

Now there's just the problem of the signature wrapping.
Reply With Quote
  #23  
Old 08-20-2010, 11:47 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For me the above code displays the large picture when the page first loads- it should show the small image until it gets clicked.
Reply With Quote
  #24  
Old 08-20-2010, 11:52 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well with height removed now you could add an option, probably best to define the large width so you can use:

Code:
<img src="{param}" width="200" ondblclick='this.src="{param}";this.width={option}' onclick='this.src="{param}";this.width=200' align="left" hspace="10">
[RI="800"]http://yourwebsite/image.gif[/RI]

Double clicking enlarges the image to 800px wide.
Reply With Quote
  #25  
Old 08-20-2010, 11:55 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change max-width to just width and it displays the small image by default I think:

Code:
<img src="{param}" width="200"  ondblclick='this.src="{param}";this.width=600' onclick='this.src="{param}";this.width=200' align="left" hspace="10">
Then no option necessary.
Reply With Quote
  #26  
Old 08-21-2010, 01:40 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 djbaxter View Post
I have NOT made those edits and it is still wrapping the sig. See the attachment in my post above.

I use postbit, not postbit_legacy, as you can see from the screen capture in the attachment.
I also use postbit_legacy and it works for me without signature wrapping. I wonder what I did .
When I was looking for reasons/solutions to fix the sig wrapping I tested adding/removing that Postbit.css edit mentioned in post#12 and replacing it with the following code and that fixed the issue for me. Prior to that I found that any example of image align="left" or align="right" caused signature wrapping. Would you mind trying the Postbit.css edit below to see if that fixes it for you please?
NOTE: That edit did affect the postbit_legacy display for me.

Postbit.css
find:
Code:
/*post bit*/  
add under:
Code:
.postbitlegacy .after_content { 
    position: relative; 
    width: 100%; 
    clear:both; 
}
My apologies for assuming you must've made edits that contributed to the sig wrapping. I assumed that because your attached image shows there is very little space between your post content and your signature. Or is that attachment an image of Preview Post?
If that edit doesn't work I'll be happy to provide you with copies of any templates that might help find clues to resolve it for you.

Quote:
Originally Posted by djbaxter View Post
Change max-width top just width and it displays the small image by default I think:

Code:
<img src="{param}" width="200"  ondblclick='this.src="{param}";this.width=600' onclick='this.src="{param}";this.width=200' align="left" hspace="10">
Then no option necessary.
I thought I had already tried removing the height attributes to maintain image proportions. Clearly I hadn't . Awesome work! Thank you so much for bothering to help. I really do appreciate it .
I'm hoping the sig wrapping might be easily solved for you now.
Reply With Quote
  #27  
Old 08-21-2010, 01:55 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 BirdOPrey5 View Post
Well with height removed now you could add an option, probably best to define the large width so you can use:

Code:
<img src="{param}" width="200" ondblclick='this.src="{param}";this.width={option}' onclick='this.src="{param}";this.width=200' align="left" hspace="10">
[RI="800"]http://yourwebsite/image.gif[/RI]

Double clicking enlarges the image to 800px wide.
Although it's not necessary now your idea is a very good one for allowing that extra option of max display size per image. That will no doubt be useful to me later .
Reply With Quote
  #28  
Old 08-21-2010, 02:33 AM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by djbaxter View Post
I use postbit, not postbit_legacy, as you can see from the screen capture in the attachment.
Quote:
Originally Posted by midnz View Post
I also use postbit_legacy and it works for me without signature wrapping.
No. I said I do NOT use postbit_legacy. I use postbit.
Reply With Quote
  #29  
Old 08-21-2010, 02:39 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 djbaxter View Post
No. I said I do NOT use postbit_legacy. I use postbit.
Duh, sorry about that. It's sunken in now .

Do you think that altering the code edit from postbitlegacy that I used, to postbit, might help?

Code:
.postbit .after_content { 
    position: relative; 
    width: 100%; 
    clear:both; 
}
Reply With Quote
  #30  
Old 08-21-2010, 03:15 AM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't see how that would make a difference, since it's code I'm not using.
Reply With Quote
  #31  
Old 08-21-2010, 06:29 AM
midnz's Avatar
midnz midnz is offline
 
Join Date: Jul 2010
Location: New Zealand
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It won't make any difference. I've checked myself.

The best that can be achieved at present is to remove the align="left" from the code and forget about text wrapping until a solution can be found for those using the newer horizontal postbit layout.

I came from vB3.6 where align="left" worked to vB4.0.5/6 where it doesn't work any more with the newer horizontal postbit display because of the signature interference issue.

If I were still using 3.6 I'd find the signature code in the template and place <p></p> right before it to move signatures down. vB4 is somewhat more complex for me and I'm still coming to grips how it all works. The solution appears to me to be changing how the signature is displayed using the newer horizontal postbit layout.
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 08:14 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.07947 seconds
  • Memory Usage 2,350KB
  • 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
  • (9)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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_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