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
  #2  
Old 12-23-2004, 10:11 PM
Mechanical Mind's Avatar
Mechanical Mind Mechanical Mind is offline
 
Join Date: Sep 2004
Location: USA
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am not sure what the "clientscript directory" is?
Reply With Quote
  #3  
Old 12-23-2004, 10:42 PM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's one of the directories off your forum root one. It's usually listed in FTP after admincp and archive and is actually called clientscript.
Reply With Quote
  #4  
Old 12-23-2004, 10:43 PM
Mechanical Mind's Avatar
Mechanical Mind Mechanical Mind is offline
 
Join Date: Sep 2004
Location: USA
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found it in httpdocs/forums/...
I've uploaded it and can't seem to get it functioning.

Have you had any luck?
Reply With Quote
  #5  
Old 12-23-2004, 11:00 PM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've not actually tried it as I'm upto my neck in writing a hack at the moment which is just doing my head in but I don't want to change anything else on my localhost until thats finished and I never do a live install untill I've done a localhost one as my site is that hacked.
Reply With Quote
  #6  
Old 12-26-2004, 05:03 AM
imported_SloChild imported_SloChild is offline
 
Join Date: Nov 2004
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This worked perfect on my 3.0.3 install - thanks for a great mod!
Reply With Quote
  #7  
Old 12-26-2004, 01:40 PM
Mechanical Mind's Avatar
Mechanical Mind Mechanical Mind is offline
 
Join Date: Sep 2004
Location: USA
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was originally having problems with this, so I decided to wipe it out and try again. Next time, I made more progress. (I think the first time I uploaded the file to the wrong directory). This time, I followed the directions to the word, very closely.

Now, this is happening: I can resize the image inside of the text editor, but when you save and view the thread, the image is still the original dimensions?

Any follow-up? I really need this hack to work.
Reply With Quote
  #8  
Old 12-26-2004, 04:11 PM
Tradjick Tradjick is offline
 
Join Date: Jan 2004
Posts: 219
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I´m sorry, but i don´t have a solution to the problem with the WYSIWYG editor and when you return to the thread after posting a message.
You might try to ask the question at the link to vulletin-germany.com but i once asked and nobody came up with a solution.
You might try to set a fix width in maincss unstead of having it set to 100%.
Reply With Quote
  #9  
Old 12-26-2004, 04:16 PM
Mechanical Mind's Avatar
Mechanical Mind Mechanical Mind is offline
 
Join Date: Sep 2004
Location: USA
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Tradj
I?m sorry, but i don?t have a solution to the problem with the WYSIWYG editor and when you return to the thread after posting a message.
You might try to ask the question at the link to vulletin-germany.com but i once asked and nobody came up with a solution.
You might try to set a fix width in maincss unstead of having it set to 100%.
So does this hack just not work with the WYSIWYG editor? Or doesn't it work at all? I am a little bit confused...

Could I change my editor setting to "standard" and this would work? Or no?
Reply With Quote
  #10  
Old 12-27-2004, 02:40 AM
Tradjick Tradjick is offline
 
Join Date: Jan 2004
Posts: 219
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works very well for me. It´s quick and doesn´t have any problem with broken links.

I suggest that you properly install it on a testserver, so that you can play around and test things with standart/wysiwyg editor, replying, etc.
In your case you´d have to place the file in httpdocs/forums/clientscript/resizeall.js
Make sure that directory is chmoded to 777. You can do that with an ftp client.

Inform me if you should have any more problems, and i´ll take more time to have a look.
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 09:01 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.05251 seconds
  • Memory Usage 2,293KB
  • Queries Executed 23 (?)
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_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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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