The Arcive of vBulletin Modifications Site. |
|
Auto resize large image Details »»
|
|||||||||||||||||||||||||
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">
function largerThan(a,b)
{
return a>b;
}
</script>
http://talkmusic.org/showthread.php?t=3165 Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
good grazie ... .-)
|
|
#3
|
||||
|
||||
|
Simple effective, I like
![]() congratulation "Click Install"
|
|
#4
|
|||
|
|||
|
congratulation
|
|
#5
|
|||
|
|||
|
*Clicks Install*
Thanks
|
|
#6
|
|||
|
|||
|
This is the best image resizer i have seen,,
thank u very much |
|
#7
|
||||
|
||||
|
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 />';
|
|
#8
|
||||
|
||||
|
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 |
|
#9
|
|||
|
|||
|
This belongs in the code modification forum as it it edits one of the orignal vB scripts.
|
|
#10
|
||||
|
||||
|
I've been looking for this. Thanks!
|
![]() |
|
|