Go Back   The Green Dragon Empire > The Underground > Testbed
Headquarters Clan CP Battle Arena Monster Arena Healing Center Itemshop Lottery

Testbed WARNING! Important! Digital override required. Please present security clearance.

Reply
 
Thread Tools Search this Thread Display Modes

autoresize
  #1  
Old 10-25-2006, 11:23 AM
peter's Avatar
†peter
Fight poison with poison.
View Extended RPG Stats
Eternity Council Member: With Honor - Issue reason: officer 
 
Join Date: Oct 2006
Posts: 463

autoresize

Hello first post \o/. I'm a long time vB lover/coder, first time poster here (having purchased my own liscence earlier... no more hanging off friend's forums for me).

Brief outline:

This mod is designed to prevent images horizontally stretching the screen, while giving you the ability to revert them to their full size if you wish.

How does this affect the user

This is a silent script - after its installation, there is no configuration or further modification required.

Lets see it then!

There are two images of the mod in action attached.

What versions will this support?

Defiantly 3.5.3 and 3.5.0 (I believe it was RC2) although it was a slightly different string you needed to search for in the php file, but it's in essentially exactly the same.

Installation:

First, download the attached zip file (autoresize.zip). A copy of these instructions are also there.

Upload autoresize.js to /clientscripts/ from your forum directory.

Log into your forum admin panel, go to styles & templates > style manager > edit templates.

Edit the "SHOWTHREAD" template (Under Show Thread templates), find </head>

Just above it, add

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

Save it.

Repeat, adding it in the same place to the newthread template.

Now, from your forum directory, open /includes/class_bbcode.php

search for:

Code:
return '<img src="' . $link . '" border="0" alt="" />';

Replace it with:

Code:
return '<div style= "display: none; background-color: black; color: white" onClick="catflap_toggle_image_size(this); return false">&nbsp;</div><img src="' . $link . '" onLoad="catflap_resize_image(this); return false;" border="0" />';

Give it a test, under different templates with different boundaries, it may well still stretch the table a little/be a little too small.

Should this be the case, open /clientscript/autoresize.js

modify the 100 in

Code:
size_available = winwidth - 100;

either up or down (start by moving it up and down in 100s, then when it gets closer to perfect, 10s) until an image that would normally stretch the table fits completely within the forum boundaries. 100 is perfect for the default vbulletin 3.5.3 template.

Enjoy! If you have any problems, just give a shout and I'll put you right.

************************************************** *************
** **
** **
** Legal **
** **
** **
************************************************** *************

This code may be used by anyone at no charge for use on a vBulletin forum with a legal vBulletin liscence. You may modify this code in any way you wish, you may redistribute this code including your modifications in any way you wish as long as the code remains free. Please, however, do not claim our work as your own. This code was created by Tim Bashford and Jamie Jones - please give credit to us in your readme/docs!



 
__________________
Troll of The Green Dragon Empire
(peter@greendragonempire.com)

Last edited by peter : 10-25-2006 at 11:23 AM. Reason: Automerged Doublepost

peter has a reputation beyond repute peter has a reputation beyond repute peter has a reputation beyond repute peter has a reputation beyond repute peter has a reputation beyond repute peter has a reputation beyond repute peter has a reputation beyond repute peter has a reputation beyond repute peter has a reputation beyond repute peter has a reputation beyond repute peter has a reputation beyond repute peter has a reputation beyond repute
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 05:34 PM.