View Full Version : Auto resize large image
DanLai
10-24-2005, 10:00 PM
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):
return '<img src="' . $link . '" border="0" alt="" />';
Replace with:
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:
<script type="text/javascript">
function largerThan(a,b)
{
return a>b;
}
</script>
Demo:
http://talkmusic.org/showthread.php?t=3165
swantonio
10-25-2005, 05:28 PM
good grazie ... .-)
Allan
10-25-2005, 05:41 PM
Simple effective, I like ;)
congratulation
"Click Install" ;)
nokturno
10-25-2005, 06:30 PM
congratulation
Pramodinfo
10-25-2005, 07:23 PM
*Clicks Install* :) Thanks
This is the best image resizer i have seen,,
thank u very much
COBRAws
10-25-2005, 09:25 PM
What's the way for adding a text that says something like "Click on the image to see orginial size"?
ORIGINAL MOD:
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:
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 />';
Someone please tell me if this is ok.
Barakat
10-25-2005, 11:48 PM
iam useing this and its usefull also .
in the same file and the same code just find this code :-
return '<img src="' . $link . '" border="0" alt="" />';
replace it with :-
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
Xplorer4x4
10-26-2005, 07:57 AM
This belongs in the code modification forum as it it edits one of the orignal vB scripts.
Snake
10-26-2005, 08:24 AM
I've been looking for this. Thanks!
xware
10-26-2005, 09:17 AM
<a href="https://vborg.vbsupport.ru/showpost.php?p=742150&postcount=5" target="_blank">https://vborg.vbsupport.ru/showp...50&postcount=5</a>
Freezerator
10-26-2005, 01:46 PM
Can this be a module/product? :)
GuaRRand
10-26-2005, 08:47 PM
wokred perfectly!
Also no weird codes when i quote a post with a resized image!!
moonclamp
10-26-2005, 10:30 PM
wokred perfectly!
Also no weird codes when i quote a post with a resized image!!
Yep ... this one works properly.
No more big pages :)
Allan
10-27-2005, 09:39 AM
so , don't work with IE
moonclamp
10-27-2005, 06:25 PM
so , don't work with IE
try changing the dimensions in the script down to '540' rather than '700'
evenmonkeys
10-27-2005, 08:04 PM
Can this be made via plugins / products? I'd rather not modify my code unless I absolutely have to.
Allan
10-27-2005, 08:32 PM
try changing the dimensions in the script down to '540' rather than '700'
tested and no change
work perfectly with Firefox, but with IE, don't work :(
evenmonkeys
10-28-2005, 03:07 AM
This is not working for me. :(
EDIT: This is working in Firefox and not IE.
Rhoads
10-28-2005, 04:01 AM
Thnx DanLai, working 100% with IE ;)
IE users, try to install java from microsoft
evenmonkeys
10-28-2005, 04:18 PM
I have java installed.
._.
Allan
10-28-2005, 04:23 PM
I have java installed.
._.
also to install
moonclamp
10-28-2005, 07:01 PM
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
evenmonkeys
10-28-2005, 11:56 PM
also to install
Huh?
ggiersdorf
10-29-2005, 09:33 PM
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..
Vtec44
10-30-2005, 05:46 AM
It's working for perfectly on my site, both IE and Firefox.
ggiersdorf
10-30-2005, 09:39 AM
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!
moonclamp
10-30-2005, 09:55 AM
you don't put it in your header template, you put it in your headinclude template
ggiersdorf
10-30-2005, 11:06 AM
Sorry thats what I meant!! I did do that, and I installed Java
still nothing.
Vtec44
10-30-2005, 02:51 PM
https://vborg.vbsupport.ru/showpost.php?p=742150&postcount=5
The problem with that code is that it won't work if a user quotes the picture.
evenmonkeys
10-31-2005, 01:42 AM
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. >_<;
ferrarislave
11-01-2005, 12:20 AM
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. >_<;
Mod is not working for me in IE either, only in FireFox, what gives? Can someone help!!?
Vtec44
11-01-2005, 12:52 AM
What version of IE are you guys using? I'm using IE6 and it seems to be working fine.
ggiersdorf
11-01-2005, 11:32 AM
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.
DanLai
11-01-2005, 01:17 PM
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.
ggiersdorf
11-01-2005, 01:22 PM
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..
kONGO
11-01-2005, 01:24 PM
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.It's in the PHP function handle_bbcode_img_match you need to make the change. In that function it is quite clear where the change must be applied (it's a very small function).
Also, as an addition, there is no need to define the largerThan() function. Using if (this.width > 700)works just as well. I've tested this and it works beautifully on Firefox 1.5b2, IE6sp1, Opera 8.
ggiersdorf
11-01-2005, 01:55 PM
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
kONGO
11-01-2005, 02:12 PM
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: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="" />';I modified the handle_bbcode_img_match function in the file includes/class_bbcode.php.
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.
DanLai
11-01-2005, 04:01 PM
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..
I see the mod working for your site in IE. Maybe the mod is affected by some Javascript settings in IE? What version of IE are you using?
It's in the PHP function handle_bbcode_img_match you need to make the change. In that function it is quite clear where the change must be applied (it's a very small function).
Also, as an addition, there is no need to define the largerThan() function. Using if (this.width > 700)works just as well. I've tested this and it works beautifully on Firefox 1.5b2, IE6sp1, Opera 8.
The ">" will cause problem when you try to edit the post. :)
Good to see everyone helping out each other. :rolleyes:
Thanks,
DanLai.
DanLai
11-01-2005, 04:02 PM
Moreover, the mod has changed the "hand" to "pointer", as kONGO suggested. :devious: Thank you kONGO for this.
Thanks,
DanLai.
kONGO
11-01-2005, 05:54 PM
The ">" will cause problem when you try to edit the post. :)Right you are. I knew there was a reason for that function definition, just couldn't figure out why so I changed it. Slap me twice and call me Rhonda.
Glad I could help re: the cursor thing.
evenmonkeys
11-01-2005, 10:29 PM
It's sort of working on IE now, 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. >_<;
wrang
11-11-2005, 08:27 PM
Great i run VB3.5.1 and it work realy nice
and it work on IE 6.0.290
Great job
My link that it works
http://www.saltvattensguiden.se/forumet/showthread.php?t=9172
(The hole site is in Swedish and about marinaquarium)
COBRAws
11-12-2005, 01:43 AM
It's sort of working on IE now, 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. >_<;
how u made it work? Its not working for me under IE, but it works on FireFox. hehehe Uncle Bill doing funny things again :P
ggiersdorf
11-12-2005, 09:32 AM
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: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="" />';I modified the handle_bbcode_img_match function in the file includes/class_bbcode.php.
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.
what did you modify in /includes/bbcode I found handle_bbcode_img_match twice but what do I need to modify in those lines!?
ggiersdorf
11-12-2005, 09:33 AM
I added your code, but didnt understand what elese you modified or how?
ggiersdorf
11-12-2005, 02:02 PM
ok guys I figured out something here. For whatever reason and I hope you can tell me. The First time I go to the site the image will resize in IE. after that it never does it again unless I totally clean my IE settings cache etc. Than it works again 1 time
I tried this from 3 seperate PC's using ie and got the same problem in Firefox it works 100% all the time. Anyone know how to fix that on IE 6+??
mustang_lex
11-12-2005, 06:01 PM
How does it effect the top main logo if its dimentions are more then the resize limit. Will it effect the logo like other auto resize scripts.
ggiersdorf
11-14-2005, 10:51 PM
anyone supporting this anymore!?
COBRAws
11-15-2005, 03:25 PM
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.
dknelson
11-16-2005, 09:14 PM
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
Flow Fusion
11-16-2005, 10:09 PM
Any way to fix this just for avatars that are linked from other sites?
hollyboy
11-18-2005, 07:15 PM
return '<div style="width: 800px; overflow: auto;"><img src="' . $link . '" border="0" alt="" /></div>';
wow!
I use your code dude!
great
TF|Scorpion
11-19-2005, 11:47 AM
I love it, clicks install! :D
TF|Scorpion
11-19-2005, 12:04 PM
There is one problem, it does not resize image attachments!
Exernon
11-22-2005, 09:42 AM
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...
VaaKo
11-22-2005, 07:41 PM
thx mate, worked like magic after changing 700 to 540
VaaKo
11-22-2005, 07:52 PM
after I refreshed the pic got big again.. it didn't work
Exernon
11-23-2005, 02:15 AM
after I refreshed the pic got big again.. it didn't work
Same as my problem...
Anyone?
lefthome
11-27-2005, 08:23 PM
Changing the setting from 700 to 540 in IE takes care of the issue with the problem with the picture getting big again...
COBRAws
11-27-2005, 09:35 PM
Changing the setting from 700 to 540 in IE takes care of the issue with the problem with the picture getting big again...
i got mine to 550 and doesnt work pal
NineToez
11-28-2005, 03:11 AM
Worked perfectly!! Just what I wanted and needed! Thank you so much!
Installed. :D
vtx1800
11-28-2005, 03:31 AM
I did the same thing, but did this for the change:
return '<a href="' . $link . '" target="_blank"><img src="' . $link . '" border="0" width="100" height="100" alt="User Image" /></a>';
However, it still effects the sig images. It works perfectly, with only that one modification, but I want it to not alter sig images.
This one change will work for any browser, no other changes needed.
smdani
11-28-2005, 08:27 AM
It works fine for me in firefox, but not in IE like some of you notice, but have some other problem that want to post:
When I show my posts in a non vbpage, with something like this https://vborg.vbsupport.ru/showthread.php?t=82693&page=1&pp=15
(It uses the vB_BbCodeParser in the /includes/class_bbcode.php to convert the code from the post)
With this hack of auto resize, I have this error message in those pages:
Error: largerThan is not defined
And, of course the image don?t resizes
?Could anybody help me or improve the hack to make it work in non vb pages like parser do?
I have redden from Kongo that the function largerThan() is not needed so much
?would it solve the problem if I do that he said?
It's in the PHP function handle_bbcode_img_match you need to make the change. In that function it is quite clear where the change must be applied (it's a very small function).
Also, as an addition, there is no need to define the largerThan() function. Using if (this.width > 700)works just as well. I've tested this and it works beautifully on Firefox 1.5b2, IE6sp1, Opera 8.
?It brings many other problems like DanLai said?
I see the mod working for your site in IE. Maybe the mod is affected by some Javascript settings in IE? What version of IE are you using?
The ">" will cause problem when you try to edit the post. :)
Good to see everyone helping out each other. :rolleyes:
Thanks,
DanLai.
?Could it be solved in other way?
By the way I want to say that this hack was wonderful for my forum, our moderation team was wondering something like this for so long. Thanks a lot for developing it
Sychev_S
12-03-2005, 09:02 PM
is there anyway to do the same thing but for attached images?
s1l3NCER
12-14-2005, 12:00 AM
Same as my problem...
Anyone?
works perfectly install it
Justice
12-16-2005, 06:31 AM
cool hack...
does this add any server load to the showthread.php, or is this all done from the user/browser end?
nuxvirg
12-22-2005, 11:13 AM
it wasnt work in IE..
Me2Be
12-24-2005, 01:32 AM
Another one that works fine on Firefox but not on IE 6.0.28 (changed size to 480)
ggiersdorf
12-24-2005, 11:36 AM
I had problems like all the rest of you, but I got it working with some modifications on IE-(Maxathon), IE, Firefox, and Opera..
this is what I came up with, along with the code in the original post in headincludes section.
class_bbcode.php
/* Start Image RESIZE */
$navigator_user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
if (stristr($navigator_user_agent, "msie")) {
return '<img src="' . $link . '" border="0" alt="" style="width: expression(this.width > 640 ? 480 : true);" />';
} else {
return '<img src="' . $link . '" border="0" alt="" style="max-width: 730px;" />';
}
/* End Image RESIZE */
Only thing I need help with now is making that image clikcable to open in full screen when clicked. Can anyone modify this, and make this the defacto Image resize code!??
Marris
12-25-2005, 09:47 PM
I had problems like all the rest of you, but I got it working with some modifications on IE-(Maxathon), IE, Firefox, and Opera..
this is what I came up with, along with the code in the original post in headincludes section.
...
Only thing I need help with now is making that image clikcable to open in full screen when clicked. Can anyone modify this, and make this the defacto Image resize code!??
Thanks ggiersdorf, your IE code is a lot more consistent for me than the javascript. Your IE conditional along with DanLai's original code for other browsers seems to work best for me. Firefox was fine with either, but the DanLai's code seemed to work better in Opera than the max-width line.
I also hope someone can help with adding a "click to resize" link to ggiersdorf's IE code.
ggiersdorf
12-27-2005, 01:42 PM
Thanks Marris, I love how it is functioning and Im working on the Clickable code also, though Im not very refined on this stuff. Please anyone with coding experience please help us out and finish off the code above for clickable fullsize images..
Glad I could help..
coloradok5
12-31-2005, 07:10 PM
Anyone have ideas to make this clickable?
LittleBoy1
01-05-2006, 08:59 PM
ThanckYou! The Best Hack for Images ultra Small!
SeeYa!
Marris
01-07-2006, 08:08 PM
Well, I've got a semi-working popup in IE with ggiersdorf's code. This is the most consistent for me, but still not perfect:
$navigator_user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
if (stristr($navigator_user_agent, "msie")) {
return '<img src="' . $link . '" border="0" onload="if(this.width >= 400) {this.alt=\'Click here to see the orignal image\';}" style="width: expression(this.width > 400 ? 400 : true);" onmouseover="if(this.width >= 400) {this.style.cursor=\'pointer\';}" onclick="if(this.width >= 400) window.open(\'' . $link . '\',\'Image\',\'toolbar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes\');"/>';
} else {
return '<img src="' . $link . '" onload="if(largerThan(this.width,400)) {this.width=400;this.alt=\'Click here to see the orignal image\';}" onmouseover="if(this.alt) this.style.cursor=\'pointer\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />';
}
Replace all occurances of 400 with your desired width value.
In the IE code, instead of if(this.width >= 400), you are welcome to try combinations of these other if statements:
if(largerThan(this.width,400))
if(this.width > 400)
if(this.alt)
But neither of those worked consistently for me. I tried many different combinations and the code block above is what works best for me across IE, Firefox and Opera.
I welcome improvements.
Bieddos
01-10-2006, 06:02 PM
Very good mod!!!
JaeTea
01-20-2006, 01:09 AM
Well, I've got a semi-working popup in IE with ggiersdorf's code. This is the most consistent for me, but still not perfect:
Haha..holy crap it's actually working for me in Firefox AND IE! :surprised:
crash resistant
01-26-2006, 02:58 AM
omg. best. hack. ever.
( the latest modification of it on this page )
TY Marris!!!!!!!!!!!!!!!!!!!!!!
evenmonkeys
01-26-2006, 04:51 AM
Well, I've got a semi-working popup in IE with ggiersdorf's code. This is the most consistent for me, but still not perfect:
$navigator_user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
if (stristr($navigator_user_agent, "msie")) {
return '<img src="' . $link . '" border="0" onload="if(this.width >= 400) {this.alt=\'Click here to see the orignal image\';}" style="width: expression(this.width > 400 ? 400 : true);" onmouseover="if(this.width >= 400) {this.style.cursor=\'pointer\';}" onclick="if(this.width >= 400) window.open(\'' . $link . '\',\'Image\',\'toolbar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes\');"/>';
} else {
return '<img src="' . $link . '" onload="if(largerThan(this.width,400)) {this.width=400;this.alt=\'Click here to see the orignal image\';}" onmouseover="if(this.alt) this.style.cursor=\'pointer\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />';
}
Replace all occurances of 400 with your desired width value.
In the IE code, instead of if(this.width >= 400), you are welcome to try combinations of these other if statements:
if(largerThan(this.width,400))
if(this.width > 400)
if(this.alt)
But neither of those worked consistently for me. I tried many different combinations and the code block above is what works best for me across IE, Firefox and Opera.
I welcome improvements.
Oh my god... it finally works. You are truly me hero.
S@NL - BlackBik
01-26-2006, 11:48 PM
Hi Marris,
I tried your code, but it doesn't work for me:
- In IE the image is resized and opens in a pop-up, but the alt tag doesn't show when hoovering over the image with my mouse, although I see it in the source of the page (this.alt='text')
- In FF the images are not affected at all. They don't resize (FF 1.5). In the source of the page I see the script, but it's doing nothing I'm afraid.
S@NL - BlackBik
01-26-2006, 11:57 PM
Sorry mate, forget it.
I forgot to edit the headinclude template.....
My bad, hack works like a charm :)
evenmonkeys
02-10-2006, 04:55 PM
Well, I've got a semi-working popup in IE with ggiersdorf's code. This is the most consistent for me, but still not perfect:
$navigator_user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
if (stristr($navigator_user_agent, "msie")) {
return '<img src="' . $link . '" border="0" onload="if(this.width >= 400) {this.alt=\'Click here to see the orignal image\';}" style="width: expression(this.width > 400 ? 400 : true);" onmouseover="if(this.width >= 400) {this.style.cursor=\'pointer\';}" onclick="if(this.width >= 400) window.open(\'' . $link . '\',\'Image\',\'toolbar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes\');"/>';
} else {
return '<img src="' . $link . '" onload="if(largerThan(this.width,400)) {this.width=400;this.alt=\'Click here to see the orignal image\';}" onmouseover="if(this.alt) this.style.cursor=\'pointer\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />';
}
Replace all occurances of 400 with your desired width value.
In the IE code, instead of if(this.width >= 400), you are welcome to try combinations of these other if statements:
if(largerThan(this.width,400))
if(this.width > 400)
if(this.alt)
But neither of those worked consistently for me. I tried many different combinations and the code block above is what works best for me across IE, Firefox and Opera.
I welcome improvements.
I am having an issue with this. When I go to edit my signature a second time, it displayed the html for that in the signature. It just shows the huge code instead of the image I put it. It doesn't do it the first time around, but it does it if I edit it.
Gizmo999
02-10-2006, 09:24 PM
Ok, lets see if I get this right,
I replace the code in includes/class_bbcode with ggiersdorf/Marris's code and then alter the template, no other mods needed??
chrisisonfire
02-19-2006, 01:19 AM
This mod worked fine for me, except when you view the same page after you've been automatically forwarded after posting, and then only some images wouldn't resize. However, for a while now I've personally had a problem with posting URL links, in that I'd post a normal link, but the link would open in the form of; http://"http://www..." and of course wouldn't work. So, it appears that my trouble was in the bbcode file we need to edit. I don't suppose anyone else got this problem, did they? o_O
I'd actually like to reinstall this script, as it's one of the best I've seen, but I'd rather be able to post working links, hehe.
Allan
02-19-2006, 08:27 AM
don't work for me with vB3.5.3 :(
emtee
02-19-2006, 10:09 AM
This works perfect with 3.5.3! Thanks Marris! How about images that are attachments? It'd be great if they can be automatically resized too.
Edit: For attached images, I found a simple, built-in solution. Just rebuild your thumnails with your desired size, and 1 image per row (in vbulletin options message attachment).
Allan
02-19-2006, 10:25 AM
It's possible to create un new thraed but it's the brothel :p
Tralala
02-21-2006, 12:33 PM
Marris' version working nicely for me. Thanks, gang!
ffevo
02-24-2006, 02:02 AM
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: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="" />';I modified the handle_bbcode_img_match function in the file includes/class_bbcode.php.
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.
Does not work in IE at all and when i click on the image to enlarge it, it doesnt do anything.
Freesteyelz
02-27-2006, 07:44 PM
iam useing this and its usefull also .
in the same file and the same code just find this code :-
return '<img src="' . $link . '" border="0" alt="" />';
replace it with :-
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:
<!-- message -->
<div id="post_message_$post[postid]">$post[message]</div> <!-- / message -->
Replace with:
<!-- 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:
#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.
Mr Chad
03-04-2006, 09:11 PM
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
drewclark
03-27-2006, 03:25 AM
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...
bhxtyrant
07-09-2006, 10:02 PM
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.
jamiepryer@hotm
07-09-2006, 10:42 PM
anyone got an example of this working please?
some screen shots please :tu
bhxtyrant
07-10-2006, 02:13 AM
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?
bhxtyrant
07-12-2006, 06:11 PM
Is this mod still supported?
PJSkiboy
07-13-2006, 03:39 AM
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.
WeArab
08-07-2006, 08:45 AM
Hello,
Great add-on, thank you!
When VB 3.6.0 would be supported?
Eagle Creek
08-08-2006, 01:24 AM
Extreme great!!!!!!!
Thankyou!
I found this is the easiest mod for image resize.
I have modified the code slight, and there is only one modification to be made at class_bbcode.php:
replace:
return '<img src="' . $link . '" border="0" alt="" />';
with
There is nothing to be done at headinclude.
return '<img src="' . $link . '" onload="if(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" />';
GlitterKill
05-04-2007, 01:51 PM
Still a great working hack with vb 3.6.5. I use it alot and love it. :)
radarhunter
06-20-2007, 06:28 AM
i wanted sumthin` which can reduce the size of the file on Vbadvanced cmps too
cause this code works only for the forum.
BabyNameAddict
08-21-2007, 12:17 PM
I am hoping someone will be able to help me out. Somehow I ended up having both lines (the "find" and the "replace") deleted, and now I can't figure out where to put back the "find" text! If someone could cut and paste the line of code before return '<img src="' . $link . '" border="0" alt="" />'; or the block it's in, I would really appreciate it! Thanks!
FCS-Webmaster
08-23-2007, 07:25 PM
This is the best image resizer i have seen,,
thank u very much
Years passing by...and I still do agree with this!!!!!!
evervoid
07-03-2009, 03:03 PM
Does this work with 3.8.x?
Saqibm
07-04-2009, 06:14 AM
Yes I have it working on 3.8.2.
Best tip for autoresize. No more slowly mods;]
Works on 372 and 383
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.