Resize photos automatically
Posted: 07 Jul 2007, 07:07
One week bump!
[-noun] Web community dedicated to ensuring PC games run properly on your tablet, netbook, personal computer, HDTV and multi-monitor gaming rig.
https://www.wsgf.org/phpBB3/
Here are two more quick mods to try:
http://phpbbhacks.com/download/7842 <--- Same as my first link, but coded differently... worth a shot.
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>
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>Now to add a mod that truncates ridiculously long lines/urls and then the forum will never have horizontal scrolling again :)
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 :)
Code: Select all
<a href="http:......">link</a>