Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
auto resize huge images Details »»
auto resize huge images
Version: 1.00, by Tradjick Tradjick is offline
Developer Last Online: Jan 2009 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 12-19-2004 Last Update: Never Installs: 20
 
No support by the author.

This Hack has been published by mr.gamesbay in this thread at vbulletin-germany.com who let me translate this hack for vb.org.

It resizes the pictures from the [img] tag after showthread.php has been loaded. It doesn?t need any editing of php files.

Other similar hacks:

https://vborg.vbsupport.ru/showthread.php?t=67743 from St.Lauren which has the drawback of beeing slow.
https://vborg.vbsupport.ru/showthread.php?t=68677 fron 007pig which doesn?t always cut down the img size of each picture and makes each picture as a link.
and the hack from Aurous: an ideal version, very fast and no problems with broken links. But there are problems with the use of the WYSIWYG editor and caching. (BTW, this hack doesn?t solve the WYSIWYG thingy. If you find a solution, feel free to share it with the rest)

Advantages of this version:

-fast
-works with cache enabled
-no editing of php files, just template edits

Here?s what you need to do:

Styles & Templates > Style Manager > All Style options > Additional CSS Definitions:
go to the bottom of it and add the following:

.imglimit {cursor: pointer;border: dotted 1px black;}

Styles & Templates > Style Manager > Common Templates > headinclude:
Find:

HTML Code:
<script type="text/javascript"><!--var SESSIONURL = "$session[sessionurl]";var IMGDIR_MISC = "$stylevar[imgdir_misc]";// --></script>


Behind that, add the following code:

HTML Code:
<script type="text/javascript" src="clientscript/resizeall.js"></script>


Styles & Templates > Edit Templates > showthread:

Find:

HTML Code:
<body onload="$onload">


Replace with:

HTML Code:
<body onload="$onload; fiImageResize()">


Then, you will have to updload resizeall.js to your clientscript directory and that?s all.

In the file resizeall.js you have the option to choose the size for the images.


Demo: http://www.gamesbay.de/showthread.php?t=3316

Show Your Support

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

Comments
  #22  
Old 07-25-2005, 07:45 PM
Blindchild02's Avatar
Blindchild02 Blindchild02 is offline
 
Join Date: Apr 2002
Location: USA
Posts: 741
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i dont know, i did all the modifications and uploaded the file.... but it doesnt seem to work.

do i have to refresh anything, or something like that?
Reply With Quote
  #23  
Old 07-26-2005, 01:15 AM
Blindchild02's Avatar
Blindchild02 Blindchild02 is offline
 
Join Date: Apr 2002
Location: USA
Posts: 741
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well, i did it again ... still doesnt work, are there any certain settings i need to change or anything... please help i really need this hack
Reply With Quote
  #24  
Old 08-02-2005, 04:32 AM
Marris Marris is offline
 
Join Date: Jul 2005
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone have any idea how to make this so the full sized image is opened in a window sized to fit the image?

I tried the following changes below, but it's not working. It seems to work on some images but not on others.

If someone could suggest how to return the proper height and width values from the clicked image, that would be a great help towards making this work.

TIA

Code:
function fiImageWinOpen(e) {
	if( window.event ){
		var wwidth = window.event.srcElement.width+140;
		var wheight = window.event.srcElement.height+140;
	   window.open(window.event.srcElement.src,'OriginalSize','menubar=no, toolbar=no, location=no, directories=no, fullscreen=no, titlebar=no, hotkeys=no, status=no, scrollbars=yes, resizable=yes, width='+wwidth+', Height='+wheight);   
}	else {
	   var wwidth = E.target.width+140;
	   var wheight = E.target.height+140;
	   window.open(e.target.src,'OriginalSize','menubar=no, toolbar=no, location=no, directories=no, fullscreen=no, titlebar=no, hotkeys=no, status=no, scrollbars=yes, resizable=yes, width='+wwidth+', Height='+wheight); 
	  }
}
Reply With Quote
  #25  
Old 08-04-2005, 10:35 AM
majorj0nny majorj0nny is offline
 
Join Date: May 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Im really eager to use this great hack... Ive set it up with the additions for header exclusion and replythread stuff... but I still have a random resized image on the bottom of posts and I cant find where this area is ? to try to do a similar thing that was done with the header. (if you know what I mean?)

here is an example :



the image itself is clear.gif - which is only 1x1 pixels, but clear is a spacer aint it? so perhaps its stretched/repeated over that length...

I just want to find how to exclude this image element from the re-size process to make this hack perfect for my forums...

thanks in advance.

Jon

EDIT - not a brilliant example in that pic really - but that resized bar appears like that at the bottom of every post 'block' in a thread.

better example :

Reply With Quote
  #26  
Old 08-05-2005, 09:10 AM
majorj0nny majorj0nny is offline
 
Join Date: May 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok =- sorted the issue of the resized box at the bottom of the forum posts - by adding the id=forumlogo thing to the clear.gif in the postbit? ... still have one in the legacy part though? will look see
Reply With Quote
  #27  
Old 10-11-2005, 10:04 AM
majorj0nny majorj0nny is offline
 
Join Date: May 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ahhh.... NAVBAR
Reply With Quote
  #28  
Old 10-12-2005, 02:19 PM
majorj0nny majorj0nny is offline
 
Join Date: May 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mustang_lex
Ok the problem with this hack is that it doesn't work with newreply or newpost and it has to do with the editInit() for the body onload part. So I'm trying to figure out how to load to variables in the body tag. I tried using a Javascript call but doesn't work

here the out put if I just do as the hack suggests and change the BODY tag in the newreply or repost . the end result is <body onload="editInit();" onload="fiImageResize();">

If we can load both the editInit() AND fiImageResize() in the <BODY> it will work I believe. BUT HOW!!!


****************************
THIS IS THE FIX TO MAKE IT WORK!!
****************************

As I stated I had a problem with this hack when it came to new threads (when you do a preview) and new replys. I been doing some research and I'm sure this was no brainer for many, but I'm pretty happy with it.

In newreply and newthread

look for

or in my case


and replace it with



And you will have this hack work for SHOWTHREAD , newreply and newthread!!

I think this should be added to the original hack :nervous:
hmmm.... this worked perfectly with 3.0.7 but since updating to 3.5.0 the newreply/newthread parts dont seem to resize anymore ?

normal showthread pics are resizing normally ?

PLEASE HELP!
Reply With Quote
  #29  
Old 10-14-2005, 01:43 PM
majorj0nny majorj0nny is offline
 
Join Date: May 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this seems to have changed in vb3.5 for some reason...

now on accessing a new reply to a thread that's images have been successfully resized - it brings up errors on page as follows :

Quote:
Line : 543
Char: 1
Error: Object Expected
Code: 0
URL: http://www.50klicks.com/forum/newrep...wreply&p=33762
anyone have any ideas ?
Reply With Quote
  #30  
Old 10-15-2005, 10:04 AM
majorj0nny majorj0nny is offline
 
Join Date: May 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by majorj0nny
this seems to have changed in vb3.5 for some reason...

now on accessing a new reply to a thread that's images have been successfully resized - it brings up errors on page as follows :



anyone have any ideas ?

ok seems to have fixed this ... for some reason it no longer liked

<body onload="editInit();fiImageResize();">

in the newreply/newthread bits...

instead I used

<body onload="$onload; fiImageResize()">

which worked fine.
Reply With Quote
  #31  
Old 02-12-2006, 08:01 PM
mustang_lex mustang_lex is offline
 
Join Date: May 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't have 3.5 but I'm glad you got it working
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:54 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.05778 seconds
  • Memory Usage 2,315KB
  • 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
  • (1)bbcode_code
  • (3)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
  • (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