vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Miscellaneous Hacks - Image Resizer Javascript (https://vborg.vbsupport.ru/showthread.php?t=162192)

yoyoyoyo 11-07-2007 10:00 PM

Image Resizer Javascript
 
Image Resizer Javascript

With this simple javascript, if an image posted in your forum in a thread has a width that is larger then 80% of your browser resolution, it will be automagically resized. The image will also resize as you increase or decrease your browser size, so it is great for fluid styles. This javascript only affects images that are shown when viewing showthread.

NOTE: This is only a simple javascript to resize the image, there is no option to view the image at it's original size, etc., if you want to do that all you need to do is right-click on the image and choose "View Image." It does not do server side resizing of images, since everything is done client side. It also does not prevent long loading times, since the images have to be downloaded by the user before the script can resize them. If a user does not have javascript enabled then the image will not be resized - however if a person is browsing the internet, and do not have javascript enabled then an image that is too large will be the least of their worries.

This should work with all versions of vbulletin

Unlike other image resizing mods, this mod only requires one simple template edit, and no additional files , plugins, database changes or file edits.

DEMO LINK: CLICK HERE

Screenshots:
Imagine a picture that is too large, now imagine it smaller. ;)

Installation:
If you have TMS (Template Modification System) installed, then download the templateedits-resizeimage.xml and upload it via TMS, and it will automatically edit the template.

If you do not have TMS installed, then download the image_resizer.txt file and follow the directions.

If you find this useful, please click install.
If you REALLY like it then please nominate it as Mod of the Month. :D

yoyoyoyo 11-08-2007 04:20 AM

HERE IS A DEMO LINK

PLEASE NOTE: the XML included in the first post is NOT a product! It is a TMS file, for use with the Template Modification System.

If you do not have TMS installed, then you will need to do the template edit manually (which is not really a big deal - it is only one very simple template edit).

If you do have TMS installed, then it is even easier! Simply go to the "Template-Modifications Manager" and click on [Up-/Download Template-Modifications] and then browse to the XML on your hard drive, and set "Allow Overwrite" to "Yes" and click on the "Import" button. If you are not using vb 3.6.8 then set the "Ignore File Version" to "Yes."

Allan 11-08-2007 04:40 AM

No demo ?

Lionel 11-08-2007 04:41 AM

nice one yoyo

Karline 11-08-2007 05:50 AM

Thank you yoyoyoyo

Installed & Nominated for MotM :up:

yoyoyoyo 11-08-2007 10:11 AM

Thanks for the installs and for the nominations :D

HERE IS A DEMO LINK

If anyone else wants to post a demo link I will add it to the first post.

youradhere4222 11-08-2007 10:20 AM

It says "Invalid File Specified" when uploading the XML.

yoyoyoyo 11-08-2007 11:45 AM

Quote:

Originally Posted by youradhere4222 (Post 1378337)
It says "Invalid File Specified" when uploading the XML.

are you uploading the xml via TMS? it is not a product - it can only be used with TMS, otherwise you will need to do the edit manually (which is no big deal - it is very simple). If you are using TMS, then re-download it, because I just tried again and it works fine.

projectego 11-08-2007 05:18 PM

[high]* projectego clicks install :)[/high]

Sunsetdriver 11-08-2007 11:33 PM

It doesn't work when I edit/quote posts with huge images.

yoyoyoyo 11-08-2007 11:34 PM

Quote:

Originally Posted by Sunsetdriver (Post 1378749)
It doesn't work when I edit/quote posts with huge images.

there's no reason it shouldn't - clear your web cache and try again. I just tried doing it and it works the same with edited posts as it does with freshly posted images. If you clear your web cache and are still having problems, then please PM me a URL of your site so I can take a look at what you are referring to.

You can see an example of a resized image in a quote HERE

testebr 11-09-2007 02:33 AM

Live demo?

yoyoyoyo 11-09-2007 11:39 AM

the mod takes a few seconds to install, and will not break your site - install it, then upload a large image to your forums. If you do not like it uninstall it.

HERE IS A DEMO LINK

edenx 11-10-2007 06:25 PM

Does this resize big signatures?

yoyoyoyo 11-10-2007 06:45 PM

yes, but only if the signatures contain images that are wider than the screen.

Magnumutz 11-10-2007 08:07 PM

People are still asking for a Demo guys...

yoyoyoyo 11-10-2007 10:26 PM

<a href="http://ftaonpc.com/forums/showthread.php?p=1#post1" target="_blank">HERE IS A DEMO LINK</a>

Lionel 11-10-2007 11:52 PM

I love the fact that image scales down if you make browser smaller.

Magnumutz 11-11-2007 05:48 AM

Pretty nice, but can't it be shown un-resized in a new window or something like that?

yoyoyoyo 11-11-2007 06:03 AM

Quote:

Originally Posted by Magnumutz (Post 1380168)
Pretty nice, but can't it be shown un-resized in a new window or something like that?

read the first post

abhimation 11-11-2007 11:11 AM

Its really handy. Thnx Yoyo.. marked as Installed !

Magnumutz 11-11-2007 04:14 PM

Quote:

Originally Posted by yoyoyoyo (Post 1380174)
read the first post

My bad... i didn't read that carefully.

livethedream 11-12-2007 12:18 PM

Livethedream clicks *installed* :)

Calash 11-12-2007 02:57 PM

It is not working on IE 6 where I work. Firefox it is working fine. It is a nice effect, simple but it gets the job done.

yoyoyoyo 11-12-2007 04:08 PM

Quote:

Originally Posted by Calash (Post 1381042)
It is not working on IE 6 where I work. Firefox it is working fine. It is a nice effect, simple but it gets the job done.

I have tested it in safari, IE6, IE7, opera and firefox and it works fine in all of them. Make sure you have javascript enabled at your work browser - your sysadmin may have disabled it for some reason.

Calash 11-12-2007 07:47 PM

I'm in the IT group, so I know it is not disabled. It may be the version the Java VM that we have installed, though I have not see issues before. I will troubleshoot it a bit more and let you know if I find what the cause it.

stan111 11-13-2007 12:36 AM

this is awsome, love it
here is another suggestion:
if you would make the the image in the quote would show only the link, it would be awesome

yoyoyoyo 11-13-2007 12:52 PM

Quote:

Originally Posted by stan111 (Post 1381425)
this is awsome, love it
here is another suggestion:
if you would make the the image in the quote would show only the link, it would be awesome

Glad you like it, but I do not plan on extending or modifying this hack at this point - it is a simple javascript, and it works in all major browsers that I have tested. I see no need for extra features, especially ones that would require file edits.

agitated 11-13-2007 02:55 PM

Demo works fine in firefox but not in IE7. . :confused:
Unfortunately IE7 is still the most popular browser.

yoyoyoyo 11-13-2007 03:51 PM

Quote:

Originally Posted by agitated (Post 1381780)
Demo works fine in firefox but not in IE7. . :confused:

make sure you have javascript enabled in IE7 - I am testing it right now and it works for me.

JavaScript - to enable this in:

IE Tools/Internet Options/Security/Custom Level button/Settings/Scripting/
Ensure the "Active Scripting" radio button selected.

Netscape Edit/Preferences/Category Advanced/Scripts and Plugins/
Under "Enable JavaScript for", tick the "Navigator" setting.
Under "Allow script to", tick "Change images" and "Change status bar".

Firefox Tools/Options/Web Features/
Ensure the "Enable JavaScript" radio button selected.

agitated 11-13-2007 04:49 PM

Quote:

IE Tools/Internet Options/Security/Custom Level button/Settings/Scripting/
Ensure the "Active Scripting" radio button selected.
"Active Scripting" Enabled. Makes no diffrence in IE7.

yoyoyoyo 11-13-2007 05:28 PM

hmm - I guess I have been testing it in IE6, and not IE7 - strange that they would break functionality of a javascript function from one version to the next, but then again it is microshaft

agitated 11-13-2007 06:08 PM

Pass the buck !!
Why not attempt to fix your code, which is what I would have expected.
Internet Explorer is still the most popular browser.
From a Webmasters point of view, code must be compatible with Firefox and Internet Explorer. Otherwise you risk loosing visitors and members.

yoyoyoyo 11-13-2007 06:17 PM

Quote:

Originally Posted by agitated (Post 1381902)
Pass the buck !!
Why not attempt to fix your code, which is what I would have expected.
Internet Explorer is still the most popular browser.
From a Webmasters point of view, code must be compatible with Firefox and Internet Explorer. Otherwise you risk loosing visitors and members.

who says I am not attempting to fix it to be compatible with IE7? That is your assumption, which is not based on any concrete facts or statements on my part.

FaNtAzY 11-16-2007 09:55 AM

Thanks for that script it works really fine :)

centurius 02-19-2008 06:42 PM

Hi, don't know if this is something I'm doing wrong, but here's my problem:

The image resizes fine but the forum is still stretching as if the image was still it's original size. Only seems an issue in IE 6 (tested and works brilliantly in firefox).

Any ideas?

ADDED: Just tested in IE 7 and it's doing the same thing.

Powerofdreams 02-21-2008 04:22 AM

Works fine in Firefox but There is a problem with IE7 :(

Support 02-23-2008 08:18 PM

demo not workin

rapidphim 02-29-2008 04:49 AM

will there be anyway to make this beautiful image resize javascript work on cmps when pulling the img tag from thread?

justchil 03-02-2008 10:54 PM

Works great in FF 2.0.0.12

IE7 7.0.6000.16609 (all default options) is not working and another couple users are using IE6 and it's not working.

Perhaps there is an addition plugin or function that could be added to make it work for everything? It's a great plugin!


All times are GMT. The time now is 12:07 AM.

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.01281 seconds
  • Memory Usage 1,819KB
  • 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
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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