Page 2 of 2

Resize photos automatically

Posted: 07 Jul 2007, 07:07
by Ryom
One week bump!

Resize photos automatically

Posted: 08 Jul 2007, 00:24
by skipclarke
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

&lt;script&gt; 

   window.onload = resizeimg;
   function resizeimg()
   {
      if (document.getElementsByTagName)
      {
         for (i=0; i&lt;document.getElementsByTagName('img').length; i++)
         {
            im = document.getElementsByTagName('img')[i];
            if (im.width &gt; 853)
            {
               im.style.width = '853px';
               eval(&quot;pop&quot; + String(i) + &quot; = new Function(&quot;pop = window.open('&quot; + im.src + &quot; ','fullscale','width=900,height=500,scrollbars=1,resizable=1'); pop.focus();&quot;)&quot;);
               eval(&quot;im.onclick = pop&quot; + String(i) + &quot;;&quot;);
               if (document.all) im.style.cursor = 'hand';
               if (!document.all) im.style.cursor = 'pointer';
               im.title = 'Click Here To See Image Full Size ';
            }
         }
      }
   }
   
   &lt;/script&gt;


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.

Resize photos automatically

Posted: 08 Jul 2007, 00:29
by g00seberry
Testing, testing! 1, 2 testing!



o0 nice work

Resize photos automatically

Posted: 08 Jul 2007, 03:43
by Ryom
Sweet, thanks :)

Not going to be able to help with the javascript though... hopefully someone knows.

Resize photos automatically

Posted: 08 Jul 2007, 11:05
by ctrlsteef
And what about that "this pic is resized" line. Is that also possible?

Nice work btw. :wink:

Resize photos automatically

Posted: 08 Jul 2007, 14:06
by Evil Incarnate
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.

Code: Select all

&lt;script&gt;

   window.onload = resizeimg;
   function resizeimg()
   {
      if (document.getElementsByTagName)
      {
         for (i=0; i&lt;document.getElementsByTagName('img').length; i++)
         {
            im = document.getElementsByTagName('img')[i];
            if (im.width &gt; 768)
            {
               origW = im.width + 10; // Original Width
                  if (origW &gt; screen.width) origW = screen.width; // Check if Original Width is too big for user's resolution
               origH = im.height + 10; // Original Height
                  if (origH &gt; screen.height) origH = screen.height; // Check if Original Height is too big for user's resolution
               im.style.width = '768px';
               eval(&quot;pop&quot; + String(i) + &quot; = new Function(&quot;pop = window.open('&quot; + im.src + &quot; ','fullscale','width=&quot; + origW + &quot;,height=&quot; + origH + &quot;,scrollbars=1,resizable=1'); pop.focus();&quot;)&quot;);
               eval(&quot;im.onclick = pop&quot; + String(i) + &quot;;&quot;);
               if (document.all) im.style.cursor = 'hand';
               if (!document.all) im.style.cursor = 'pointer';
               im.title = 'Click Here To See Image Full Size ';
            }
         }
      }
   }
   
   &lt;/script&gt;

Resize photos automatically

Posted: 09 Jul 2007, 00:04
by Ryom
Now to add a mod that truncates ridiculously long lines/urls and then the forum will never have horizontal scrolling again :)

Resize photos automatically

Posted: 09 Jul 2007, 03:16
by NightBlade
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

Posted: 09 Jul 2007, 04:19
by Ryom
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 :)

Resize photos automatically

Posted: 09 Jul 2007, 10:52
by P-Storm
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.

Resize photos automatically

Posted: 09 Jul 2007, 13:36
by skipclarke
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

Posted: 09 Jul 2007, 15:00
by ctrlsteef
Exactly. It's not that hard. :P

Resize photos automatically

Posted: 09 Jul 2007, 15:08
by P-Storm
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

Posted: 10 Jul 2007, 16:47
by ctrlsteef
Thank god for this mod.

http://www.widescreengamingforum.com/node/7847#comment-156144

:bowdown :bowdown

:lol:

Resize photos automatically

Posted: 10 Jul 2007, 17:04
by g00seberry
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!

Resize photos automatically

Posted: 10 Jul 2007, 17:09
by ctrlsteef
Yeah, totally. And since the anti spam measures are working pretty well aswell it's all a lot more easy going for us. :D

Resize photos automatically

Posted: 11 Jul 2007, 03:02
by skipclarke
Adjusted to 853px wide, to maintain aspect in the Detailed Reports.