Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

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
  #52  
Old 11-15-2005, 03:25 PM
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Location: Buenos Aires
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This just works with BBCode, your Logo image uses HTML (i believe), thus this hack wont touch your website logo size properties.

-

This is working under firefox like some peepz said. It is working for me under IE only when I wanna see individual post, not on the usual threadview. Weird.
Reply With Quote
  #53  
Old 11-16-2005, 09:14 PM
dknelson dknelson is offline
 
Join Date: Oct 2004
Posts: 412
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This problem probably won't affect many here but just a heads up. If you are running vBPortals and running a RSS feed in a block on your portal page, this will prevent the feed from working. Don't know why, I just know that it does.

Don
Reply With Quote
  #54  
Old 11-16-2005, 10:09 PM
Flow Fusion Flow Fusion is offline
 
Join Date: Jul 2003
Location: Georgia
Posts: 512
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any way to fix this just for avatars that are linked from other sites?
Reply With Quote
  #55  
Old 11-18-2005, 07:15 PM
hollyboy's Avatar
hollyboy hollyboy is offline
 
Join Date: Mar 2004
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Barakat
return '<div style="width: 800px; overflow: auto;"><img src="' . $link . '" border="0" alt="" /></div>';
wow!
I use your code dude!
great
Reply With Quote
  #56  
Old 11-19-2005, 11:47 AM
TF|Scorpion TF|Scorpion is offline
 
Join Date: Oct 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I love it, clicks install!
Reply With Quote
  #57  
Old 11-19-2005, 12:04 PM
TF|Scorpion TF|Scorpion is offline
 
Join Date: Oct 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is one problem, it does not resize image attachments!
Reply With Quote
  #58  
Old 11-22-2005, 09:42 AM
Exernon Exernon is offline
 
Join Date: Oct 2004
Location: 127.0.0.1
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought I works perfectly but then... I when I tried to open the thread again. It didn't resize. But when refreshed, it works again... weird...
Reply With Quote
  #59  
Old 11-22-2005, 07:41 PM
VaaKo VaaKo is offline
 
Join Date: Jul 2005
Location: Lebanon
Posts: 400
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thx mate, worked like magic after changing 700 to 540
Reply With Quote
  #60  
Old 11-22-2005, 07:52 PM
VaaKo VaaKo is offline
 
Join Date: Jul 2005
Location: Lebanon
Posts: 400
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

after I refreshed the pic got big again.. it didn't work
Reply With Quote
  #61  
Old 11-23-2005, 02:15 AM
Exernon Exernon is offline
 
Join Date: Oct 2004
Location: 127.0.0.1
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Don Corleone
after I refreshed the pic got big again.. it didn't work
Same as my problem...

Anyone?
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 06:04 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.05145 seconds
  • Memory Usage 2,298KB
  • 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
  • (3)bbcode_code
  • (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
  • (4)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