![]() |
Auto resize large image
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="" />'; 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" />'; Add this to the headinclude section: Code:
<script type="text/javascript"> http://talkmusic.org/showthread.php?t=3165 |
good grazie ... .-)
|
Simple effective, I like ;)
congratulation "Click Install" ;) |
congratulation
|
*Clicks Install* :) Thanks
|
This is the best image resizer i have seen,,
thank u very much |
What's the way for adding a text that says something like "Click on the image to see orginial size"?
ORIGINAL MOD: 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=\'hand\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />'; WITH TEXT BELOW: 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=\'hand\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" /><br /><p>Click on the image to see original size<p />'; |
iam useing this and its usefull also .
in the same file and the same code just find this code :- PHP Code:
PHP Code:
just choose the width as u want the picture to be shown and thats all ... any way i will try ur code also |
This belongs in the code modification forum as it it edits one of the orignal vB scripts.
|
I've been looking for this. Thanks!
|
<a href="https://vborg.vbsupport.ru/showpost.php?p=742150&postcount=5" target="_blank">https://vborg.vbsupport.ru/showp...50&postcount=5</a>
|
Can this be a module/product? :)
|
wokred perfectly!
Also no weird codes when i quote a post with a resized image!! |
Quote:
No more big pages :) |
so , don't work with IE
|
Quote:
|
Can this be made via plugins / products? I'd rather not modify my code unless I absolutely have to.
|
Quote:
work perfectly with Firefox, but with IE, don't work :( |
This is not working for me. :(
EDIT: This is working in Firefox and not IE. |
Thnx DanLai, working 100% with IE ;)
IE users, try to install java from microsoft |
I have java installed.
._. |
Quote:
|
Could this be adapted to shrink profile pictures?
Does anyone know how? If so I could then let members upload bigger pics without it throwing their profiles out of alignment |
Quote:
|
Please look into this Firefox works fine, IE it does not resize. Im not the only one IM sure it's just a tweak needed..
|
It's working for perfectly on my site, both IE and Firefox.
|
I dont understand why does this work on some and not all IE machines? does it matter where you place the code in the header!? shouldnt can some please verify this I need it working BADLY on IE!
|
you don't put it in your header template, you put it in your headinclude template
|
Sorry thats what I meant!! I did do that, and I installed Java
still nothing. |
Quote:
|
Well, what I don't like about this so far is that it's never working on IE for me, and it also limits the size in the signatures. I'm looking for something that is only limited in the post and the signature limits do their own work. >_<;
|
Quote:
|
What version of IE are you guys using? I'm using IE6 and it seems to be working fine.
|
Mabey it has something to do with where you place it? Vtec please post a few lines above and below where you posted the text and anything else that might help us. I cannot get it to work either on my site Firefox fine, but ie 6+ does not.
|
Some guide questions for users in trouble (with IE), please answer them so I could have the clue to solve your problem. :rolleyes:
1. Can you see the demo working on IE? (Can -> 2, Cannot->3) 2. Please let me see your forum page where this mod is applied. 3. If you cannot see it working, what version of IE are you using? Thanks! DanLai. |
Example:
http://www.sonyverse.com/forum/showthread.php?t=11 here is my 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=\'hand\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />'; in Firefox it resizes fine in IE this is what I get.. |
Quote:
Also, as an addition, there is no need to define the largerThan() function. Using Code:
if (this.width > 700) |
Kongo IM new sorry can you please explain where and what needs modified for us so we can enjoy the benifits of this mod?
Thanks in advnace.. Look at my code above thats in the bbcode php file |
I have modified the original HTML a bit, since I didn't like it. I use the title attribute instead of the alt attribute, since HTML standards state that the alt attribute is to be used by screen reading software, whereas the title attribute is usually used to display a 'tooltip' when the mouse is positioned above the element in question.
Also, the hand pointer one sees when the mouse is moved over a link is actually a cursor called pointer, not hand, in the standards. So, I use this code: Code:
return '<img onload="if (this.width > 700) {this.width=700; this.title=\'Click to view normal size\';}" onmouseover="if (this.title) {this.style.cursor=\'pointer\';}" onclick="if (this.title) {window.open(\'' . $link . '\');}" src="' . $link . '" border="0" alt="" />'; Works in all browsers I've tested it in. If it works in Firefox but not IE, I would say the best bet is to check the IE settings. JavaScript may be fully or partially disabled. |
Quote:
Quote:
Good to see everyone helping out each other. :rolleyes: Thanks, DanLai. |
All times are GMT. The time now is 08:48 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|