Resize photos automatically
- skipclarke
- Founder

- Posts: 7358
- Joined: 13 Oct 2003, 05:00
Resize photos automatically
Here are two more quick mods to try:
http://phpbbhacks.com/download/7842 <--- Same as my first link, but coded differently... worth a shot.
This one worked:
Code: Select all
<script>
window.onload = resizeimg;
function resizeimg()
{
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img')[i];
if (im.width > 853)
{
im.style.width = '853px';
eval("pop" + String(i) + " = new Function("pop = window.open('" + im.src + " ','fullscale','width=900,height=500,scrollbars=1,resizable=1'); pop.focus();")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = 'Click Here To See Image Full Size ';
}
}
}
}
</script> Glad it worked too. The other one had you editing 5 files and running some JavaScript...
I set the width to 768, which should work for everyone. The one thing I'd like to do is figure out how to make the width and height of the pop-up the size of the actual pic. I tried taking out the width and height, and I tried making them 100%. Neither worked. I set at 900x500 as I decent compromise. Any suggestions.
- g00seberry
- Editors

- Posts: 1317
- Joined: 24 Sep 2006, 16:57
Resize photos automatically
Testing, testing! 1, 2 testing!
o0 nice work
o0 nice work
Resize photos automatically
Sweet, thanks :)
Not going to be able to help with the javascript though... hopefully someone knows.
Not going to be able to help with the javascript though... hopefully someone knows.
Resize photos automatically
And what about that "this pic is resized" line. Is that also possible?
Nice work btw. :wink:
Nice work btw. :wink:
-
Evil Incarnate
- Posts: 59
- Joined: 30 Apr 2006, 23:06
Resize photos automatically
Ibrin-
This should make the popup the original size of the image, plus 10 pixels for the body margins; if the image is larger than the user's resolution, the popup should become the size of their screen.
Let me know if that works or not; I am looking into adding the text to notify the user that the image has been resized, but that will take more work.
This should make the popup the original size of the image, plus 10 pixels for the body margins; if the image is larger than the user's resolution, the popup should become the size of their screen.
Let me know if that works or not; I am looking into adding the text to notify the user that the image has been resized, but that will take more work.
Code: Select all
<script>
window.onload = resizeimg;
function resizeimg()
{
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img')[i];
if (im.width > 768)
{
origW = im.width + 10; // Original Width
if (origW > screen.width) origW = screen.width; // Check if Original Width is too big for user's resolution
origH = im.height + 10; // Original Height
if (origH > screen.height) origH = screen.height; // Check if Original Height is too big for user's resolution
im.style.width = '768px';
eval("pop" + String(i) + " = new Function("pop = window.open('" + im.src + " ','fullscale','width=" + origW + ",height=" + origH + ",scrollbars=1,resizable=1'); pop.focus();")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = 'Click Here To See Image Full Size ';
}
}
}
}
</script>Resize photos automatically
Now to add a mod that truncates ridiculously long lines/urls and then the forum will never have horizontal scrolling again :)
-
NightBlade
- Posts: 43
- Joined: 31 May 2007, 09:43
Resize photos automatically
Now to add a mod that truncates ridiculously long lines/urls and then the forum will never have horizontal scrolling again :)
Horizontal scrolling? I thought everyone here had a widescreen monitor :P As for long urls, you can always use http://tinyurl.com/ to fix that up (though of course there's the hidden danger of now knowing exactly what you're clicking into).
Resize photos automatically
The idea behind the two mods would be so that the work is done automatically and transparently :)
I've got the 2nd highest consumer resolution widely available (1920px) and I still get horizontal scrollbars from people posting massive URLs on occasion. We've fixed scrolling due to images now, so URL scrolling is the only thing thats left :)
I've got the 2nd highest consumer resolution widely available (1920px) and I still get horizontal scrollbars from people posting massive URLs on occasion. We've fixed scrolling due to images now, so URL scrolling is the only thing thats left :)
Resize photos automatically
My little "problem" with that resizing is that the window is first almost the original size, so you have to resize the window with it. But that is just me :roll:
And yeah long links can be a pain, but couldn't you do something like http://wwwthisisarealylonglink.com/ex...../forum so that the ... replace a large chunk of the link.
And yeah long links can be a pain, but couldn't you do something like http://wwwthisisarealylonglink.com/ex...../forum so that the ... replace a large chunk of the link.
- skipclarke
- Founder

- Posts: 7358
- Joined: 13 Oct 2003, 05:00
Resize photos automatically
The idea behind the two mods would be so that the work is done automatically and transparently :)
I've got the 2nd highest consumer resolution widely available (1920px) and I still get horizontal scrollbars from people posting massive URLs on occasion. We've fixed scrolling due to images now, so URL scrolling is the only thing thats left :)
People simply need to use the proper BB Code. They need to use
Code: Select all
<a href="http:......">link</a>Instead of just pasting the link.
Resize photos automatically
Exactly. It's not that hard. :P
Resize photos automatically
Yeah i know it isn't that hard, but we have mutch lazy people on this forum (or getting it when we make this mod happen)
Resize photos automatically
Thank god for this mod.
http://www.widescreengamingforum.com/node/7847#comment-156144
:bowdown :bowdown
:lol:
http://www.widescreengamingforum.com/node/7847#comment-156144
:bowdown :bowdown
:lol:
- g00seberry
- Editors

- Posts: 1317
- Joined: 24 Sep 2006, 16:57
Resize photos automatically
lol! i was just about to post in that thread and say the same thing :D
Suppose it ends up being a lot less work for the mods!
Suppose it ends up being a lot less work for the mods!
Resize photos automatically
Yeah, totally. And since the anti spam measures are working pretty well aswell it's all a lot more easy going for us. :D
- skipclarke
- Founder

- Posts: 7358
- Joined: 13 Oct 2003, 05:00
Resize photos automatically
Adjusted to 853px wide, to maintain aspect in the Detailed Reports.
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 3 guests

