Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Auto resize large image Details »»
Auto resize large image
Version: 1.00, by DanLai DanLai is offline
Developer Last Online: May 2008 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 10-24-2005 Last Update: Never Installs: 145
 
No support by the author.

In fact this is a work around for the auto resize feature to work with the WYSIWYG editor.

Step1. In includes/class_bbcode.php

Find (in line around 18xx):
Code:
return '<img src="' .  $link . '" border="0" alt="" />';
Replace with:
Code:
return '<img src="' . $link . '" onload="if(largerThan(this.width,700)) {this.width=700;this.alt=\'Click here to see a large version\';}" onmouseover="if(this.alt) this.style.cursor=\'pointer\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />';
Step2. Modify the common template of your template set

Add this to the headinclude section:
Code:
<script type="text/javascript">
function largerThan(a,b)
{
return a>b;
}
</script>
Demo:
http://talkmusic.org/showthread.php?t=3165

Show Your Support

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

Comments
  #92  
Old 02-27-2006, 07:44 PM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Barakat
iam useing this and its usefull also .
in the same file and the same code just find this code :-

PHP Code:
return '<img src="' $link '" border="0" alt="" />'
replace it with :-

PHP Code:
return '<div style="width: 800px; overflow: auto;"><img src="' $link '" border="0" alt="" /></div>'
it will give u a frame on large pictures and will save ur style as it is .
just choose the width as u want the picture to be shown and thats all ...

any way i will try ur code also
Actually a better way (without editing a .php core file) is to modify the template "postbit" or "posbit_legacy" such as:

Find:

Code:
<!-- message -->
<div id="post_message_$post[postid]">$post[message]</div> <!-- / message -->
Replace with:

Code:
<!-- message -->
				<div id="hideauto">
<div id="post_message_$post[postid]">$post[message]</div>
				</div>
<!-- / message -->
And in the Main CSS in the " Additional CSS Definitions " add:

Code:
#hideauto {
width:540px;
padding-bottom:10px;
overflow:auto;
}
1. Change width to specified dimension.
2. Padding is to prevent images (smilies) from being cut off.
3. Overflow can be set to "auto" (for scrollbars) or "hidden" (cutoff excessive images).

*Again, no .php files have been modified for this to work.
Reply With Quote
  #93  
Old 03-04-2006, 09:11 PM
Mr Chad's Avatar
Mr Chad Mr Chad is offline
 
Join Date: Jul 2005
Posts: 911
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Allan
so , don't work with IE
Works great with IE and FF... Only one out that works this good.

Currently useing it on VB 3.5.4
Reply With Quote
  #94  
Old 03-27-2006, 03:25 AM
drewclark drewclark is offline
 
Join Date: Feb 2006
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is working great in my forums but I use CMPS and it doesn't resize the images that get featured in the news section (pulled from the forums). Any clues on how to get those resized, too? They're the bigger problem for me as the oversized images distort the homepage worse than the forums...
Reply With Quote
  #95  
Old 07-09-2006, 10:02 PM
bhxtyrant bhxtyrant is offline
 
Join Date: Jun 2005
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey guys,I was looking for something like this for my forums but having a bit of a problem.I installed this mod and it seems to work sometimes but other times it doesnt.For example i made a test thread and posted a large image around 1024x768 width.I have the mod set to reduce the image to 600px width.It seems to work but if i refresh the page then it is huge again and the only way to get it back to the reduced size is edit the post and save it again.

Small edit:
This seems to work in firefox but the problem occurs in the latest version of IE6.Peraps due to cookies?I tryed deleting temp files to see if that was the cause but problem persists.
Reply With Quote
  #96  
Old 07-09-2006, 10:42 PM
jamiepryer@hotm jamiepryer@hotm is offline
 
Join Date: Jan 2005
Location: Hove - UK
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone got an example of this working please?
some screen shots please :tu
Reply With Quote
  #97  
Old 07-10-2006, 02:13 AM
bhxtyrant bhxtyrant is offline
 
Join Date: Jun 2005
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Small update again.I notice that this mod is working in other area's such as "view single post" but only not in "Showthread" it seems to be my custom theme that is causing the issue and it seems to work fine on Vb's default theme.I've been going through the code in Showthread template but i cant seem to find whats causing the problem.Anyone think they can assist me?
Reply With Quote
  #98  
Old 07-12-2006, 06:11 PM
bhxtyrant bhxtyrant is offline
 
Join Date: Jun 2005
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this mod still supported?
Reply With Quote
  #99  
Old 07-13-2006, 03:39 AM
PJSkiboy PJSkiboy is offline
 
Join Date: Nov 2002
Location: Bowling Green, KY
Posts: 139
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed this in my custom theme and it does not work. I have no idea which mod has this messed up. That's a lot of mods to look through.........eeeeesh.
Reply With Quote
  #100  
Old 08-07-2006, 08:45 AM
WeArab WeArab is offline
 
Join Date: Nov 2005
Location: State of Qatar Arab world
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

Great add-on, thank you!

When VB 3.6.0 would be supported?
Reply With Quote
  #101  
Old 08-08-2006, 01:24 AM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Extreme great!!!!!!!

Thankyou!
Reply With Quote
Reply

Thread Tools

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 07:24 PM.


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.04910 seconds
  • Memory Usage 2,304KB
  • 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
  • (6)bbcode_code
  • (2)bbcode_php
  • (2)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