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
  #12  
Old 02-23-2005, 09:58 PM
SecTa SecTa is offline
 
Join Date: Dec 2004
Location: Alfa Centauri
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you don't want your logo to be resized, following changes should be done:
Styles & Templates-> Style Manager-> Edit Templates-> Header:
find
HTML Code:
<img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" />
replace with
HTML Code:
<img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" id="forumlogo"/>
Info was taken from here
Reply With Quote
  #13  
Old 06-04-2005, 09:43 PM
mustang_lex mustang_lex is offline
 
Join Date: May 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok .I got mine working. A few things I modified for others who may care.

I use vb 3.0.7 so I don't know if this will work for older boards

The original hack works once the thread has been posted. however I noticed that when you post a new thread and "preview" it or reply and "preview" it, the photo is still full size.

I thought I fixed it but I had 007pigs hack installed too and since removing it ( i like this one better because it works better) the "preview" still shows it full size.

I tried replacing the body tag in templetes newreply and newthread but got errors and the image link wouldn't work any ideas

Maybe its a javascript setting in newpost_preview templete?
Reply With Quote
  #14  
Old 06-06-2005, 03:38 PM
mustang_lex mustang_lex is offline
 
Join Date: May 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SecTa
If you don't want your logo to be resized, following changes should be done:
Styles & Templates-> Style Manager-> Edit Templates-> Header:
find
HTML Code:
<img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" />
replace with
HTML Code:
<img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" id="forumlogo"/>
Info was taken from here
Adding the
Quote:
id="forumlogo"
for any image works great. thanks. I have a image for my footer which was resized, but after adding the id part. It was fixed.
Reply With Quote
  #15  
Old 07-02-2005, 02:28 AM
mr.gamesbay's Avatar
mr.gamesbay mr.gamesbay is offline
 
Join Date: Sep 2004
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*click install* lol
The Demo Link has changed:
http://www.gamesbay.de/showthread.php?t=25
Reply With Quote
  #16  
Old 07-03-2005, 09:59 PM
mustang_lex mustang_lex is offline
 
Join Date: May 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way in the resizeall.js clientscript so any resized photos will have text under it saying something like "this photo has been resized automatically, click for full view"

Thanks
Reply With Quote
  #17  
Old 07-05-2005, 01:43 PM
mustang_lex mustang_lex is offline
 
Join Date: May 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had to uninstall this hack and use another because my smilies wouldn't work on new post or reply, but the new one is god awful slow on the server, so now I want this one back but I can have the problem. Has anyone encountered this?
Reply With Quote
  #18  
Old 07-05-2005, 03:00 PM
mustang_lex mustang_lex is offline
 
Join Date: May 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Quote:
<body onload="$onload">
or in my case
Quote:
<body$onload>
and replace it with

Quote:
<body onload="editInit();fiImageResize();">
And you will have this hack work for SHOWTHREAD , newreply and newthread!!

I think this should be added to the original hack :nervous:
Reply With Quote
  #19  
Old 07-24-2005, 04:00 PM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack! acidburn0520 clicks install!
Reply With Quote
  #20  
Old 07-25-2005, 06:50 PM
Blindchild02's Avatar
Blindchild02 Blindchild02 is offline
 
Join Date: Apr 2002
Location: USA
Posts: 741
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this isnt working for me, could i get some help :|
Reply With Quote
  #21  
Old 07-25-2005, 07:43 PM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's a fairly straight-forward modification, what's the problem?
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:58 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.04396 seconds
  • Memory Usage 2,316KB
  • 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
  • (4)bbcode_html
  • (5)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