vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Show Thread Enhancements - Dynamic Picture Resize for [IMG] tag (https://vborg.vbsupport.ru/showthread.php?t=157228)

TECK 09-06-2007 10:00 PM

Dynamic Picture Resize for [IMG] tag
 
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.

TECK 09-07-2007 03:52 AM

For a quick look, visit this vBulletin Blog entry on Lizard King's server.
As you notice, my hack works on the vBulletin forum and blog. :)

Hornstar 09-07-2007 04:17 AM

Thanks, when I get a chance I will take a look at this for sure. thanks.

TECK 09-07-2007 04:30 AM

NeutralizeR was begging the site administration guys to help him with the hack, but nobody wanted to.
It took me 10min to write and implement the hack and one hour to make the readme file. Go figure...

Honestly, I felt bad because nobody wanted to help him. NeutralizeR, my new friend... there are people who still care. Enjoy the hack, I did it especially for you.

Njm 09-07-2007 04:42 AM

thanx man ..

but is there any problom in my site 4 load server same the other products that resizer the image

another que can u edit the product soo the image may open in new Window

thanx agin ...

njm

TECK 09-07-2007 04:54 AM

Njm, my hack will not generate any server load. The process is completed through JavaScript.
In other words, the client (browser) does the job, not the server. :)

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

2ndCz 09-07-2007 05:39 AM

Read the other thread... Wow, this was nice of you to do for them. :)

Clicked install. This is what I've been hoping for as well, something dynamic.
Thank you for sharing with everyone, TECK. I can now replace my old re-sizer. :)

kambiz 09-07-2007 06:32 AM

Thanks a lot. was looking for this a long time.

Clicked install.

kambiz 09-07-2007 06:49 AM

hmmm is it possible to show a message (or alert ) on the top of the picture to indicate the picture has been resized?

valdet 09-07-2007 08:18 AM

This feature is similar to this hack..
https://vborg.vbsupport.ru/showthread.php?t=125500


All times are GMT. The time now is 10:03 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.01065 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete