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

Reply
 
Thread Tools
Dynamic Picture Resize for [IMG] tag Details »»
Dynamic Picture Resize for [IMG] tag
Version: 1.0.1, by TECK TECK is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.6.8 Rating:
Released: 09-06-2007 Last Update: 09-07-2007 Installs: 165
Uses Plugins
Code Changes  
No support by the author.

If an image submited by a user (using the [IMG] bbcode tag) is to big, chances are that it will break your current vBulletin style. This hack will dynamically resize that image to acceptable dimensions, that you previously specified. It will do it for pictures inserted into postbit or user signature.

The code modifications listed below were tested into a clean installed vBulletin board. They work 100%.

Installation
In order to perform an efficient modification of your files, I recommend you to use Komodo Edit or Textpad.
Both editors will allow you to complete all steps without any coding errors.

You will need to make one small change for each of the following files:

? vbulletin_global.js (folder /clientscript)
? class_bbcode.php (folder /includes)


Make sure you modify, save and upload one file at the time to your server.
Then, simply run the product-dynamicpic.xml file.

Once the product installed, don't forget to enable it.
Go to your vBulletin Options, click on Dynamic Picture Resize setting group and set all your options.
If you encounter any problems, feel free to post in the support thread.

Learn how to open the image into a new tab/window.
But you should stop using the target tag, since it will be deprecated soon.
There is a reason why all browsers have now the Shift and CTRL options to open a new tab/window with the link you click on.

Show Your Support

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

Comments
  #142  
Old 05-09-2008, 08:35 PM
ski diva ski diva is offline
 
Join Date: Jun 2006
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this be installed on with 3.7 after you've upgraded?
Reply With Quote
  #143  
Old 05-09-2008, 11:15 PM
ski diva ski diva is offline
 
Join Date: Jun 2006
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Attempting to install this, I've run into what's probably a simple problem. When I attempt to edit the file vbulletin_global.js, its entire content shows up in my text editor as one long line. I can "soft wrap" the text, but the line endings remain arbitrary.

This is preventing me from finding and replacing the necessary lines.

I'm on a Mac, using Komodo Edit and/or TextWrangler.
Thanks for any help.
Reply With Quote
  #144  
Old 05-11-2008, 05:13 PM
Taragon's Avatar
Taragon Taragon is offline
 
Join Date: Sep 2007
Location: The Netherlands
Posts: 390
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed

Quote:
Originally Posted by Jpax View Post
I get this errror The following dependencies were not met:
This product is not compatible with version 3.7.0 of vBulletin. (Compatible starting with 3.6.8 / Incompatible with 3.7.0 and greater)
In the product-dynamicpic.xml find:
Code:
		<dependency dependencytype="vbulletin" minversion="3.6.8" maxversion="3.7.0" />
and replace this with:
Code:
		<dependency dependencytype="vbulletin" minversion="3.7.0" maxversion="3.7.99" />

Quote:
Originally Posted by ski diva View Post
Attempting to install this, I've run into what's probably a simple problem. When I attempt to edit the file vbulletin_global.js, its entire content shows up in my text editor as one long line. I can "soft wrap" the text, but the line endings remain arbitrary.

This is preventing me from finding and replacing the necessary lines.

I'm on a Mac, using Komodo Edit and/or TextWrangler.
Thanks for any help.

Quote:
Originally Posted by Lizard King View Post
In compessed js search for
Code:
{this[C]=this[C+1]}this.length--;return A}}
Just add after
Code:
function resize_image(obj, link, maxwidth){if (obj.width > maxwidth){obj.style.cursor = 'pointer';obj.style.width = maxwidth + 'px';obj.style.height = parseInt(obj.height * maxwidth / obj.width) + 'px';obj.onclick = function(){window.location.href = link;return false;};}}
and you'are good to go
Reply With Quote
  #145  
Old 05-14-2008, 06:04 PM
ThreeD ThreeD is offline
 
Join Date: Aug 2006
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this does not seem to work with IE7 if you're running VB3.7 Can anyone else confirm this?
Reply With Quote
  #146  
Old 07-20-2008, 07:01 PM
Stefanus Stefanus is offline
 
Join Date: Aug 2007
Location: RSA - Boerland
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ThreeD View Post
this does not seem to work with IE7 if you're running VB3.7 Can anyone else confirm this?
Yep, working with IE7 on 3.7.2
" Rob of Zimbabwe "
Reply With Quote
  #147  
Old 07-25-2008, 09:52 AM
Taragon's Avatar
Taragon Taragon is offline
 
Join Date: Sep 2007
Location: The Netherlands
Posts: 390
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm receiving a css validation error
Code:
606  	 * html .resizeimage  	 Value Error : width  Lexical error at line 606, column 60. Encountered: "?" (63), after : ""  ? '800px' : 'auto');
606 	* html .resizeimage 	Value Error : width Parse error - Unrecognized }
Would this be fixable perhaps? (I'm using the compessed js)
Reply With Quote
  #148  
Old 08-15-2008, 09:15 PM
chrisbeau chrisbeau is offline
 
Join Date: May 2007
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TECK View Post
About your request to open the link into a new tab/window:
Open vbulletin_global.js file (where you edited the code originally) and find:
Code:
window.location.href = link;
Replace it with:
Code:
window.open(link, '_blank');

You are done.
I did this but it still doesnt work. Any Ideas ???
Reply With Quote
  #149  
Old 09-16-2008, 03:34 PM
ApexSpeed ApexSpeed is offline
 
Join Date: Jul 2006
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone installed this on a 3.7.* board and had everything work properly?
Reply With Quote
  #150  
Old 09-16-2008, 05:01 PM
ski diva ski diva is offline
 
Join Date: Jun 2006
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm using it with 3.7, no problem.
Reply With Quote
  #151  
Old 10-05-2008, 10:36 PM
Taragon's Avatar
Taragon Taragon is offline
 
Join Date: Sep 2007
Location: The Netherlands
Posts: 390
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ski diva View Post
I'm using it with 3.7, no problem.
Except from this that is. It should work fine though.
Quote:
Originally Posted by Taragon View Post
I'm receiving a css validation error
Code:
606  	 * html .resizeimage  	 Value Error : width  Lexical error at line 606, column 60. Encountered: "?" (63), after : ""  ? '800px' : 'auto');
606 	* html .resizeimage 	Value Error : width Parse error - Unrecognized }
Would this be fixable perhaps? (I'm using the compessed js)
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 06:15 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.05067 seconds
  • Memory Usage 2,320KB
  • Queries Executed 25 (?)
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
  • (8)bbcode_code
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete