[B]I’ve got this code for resize image with my forum [ phpBB ]
[CODE]#
#—–[ OPEN ]——————————————
#
News/bbcode.tpl
#
#—–[FIND]——————————————
#
<!– BEGIN img –><img src=”{URL}” border=”0″ /><!– END img –>
#
#—–[REPLACE WITH]——————————————
#
<!– BEGIN img –>
<script language=”javascript” type=”text/javascript”>
<!–
function pointercursor(){document.body.style.cursor = “move”;}
function unpointercursor(){document.body.style.cursor=””;}
//–>
</script>
<img src=”{URL}” border=”0″ onmouseout=”unpointercursor();” onmouseover=”if(this.width == 600) {pointercursor();}” onclick=”if(this.width == 600) { window.open(‘templates/News/resizefix.php?originalsize={URL}’, ‘_blank’ ,’scrollbars=1,toolbar=no,resizable=1,menubar=no,directories=no,status=yes’); return false; }” alt=”” />
<!– END img –>
#
#—–[ OPEN ]——————————————
#
News/overall_header.tpl
#
#—–[FIND]——————————————
#
<!– END switch_enable_pm_popup –>
#
#—–[ AFTER, ADD ]——————————————
#
<script language=”javascript” type=”text/javascript”>
<!–
function resize_images()
{
for (i = 0; i < document.images.length; i++)
{
while ( !document.images[i].load )
{
break;
}
if ( document.images[i].width > 600 )
{
document.images[i].width = 600;
}
}
}
//–>
</script>
#
#—–[FIND]——————————————
#
<body bgcolor=”{T_BODY_BGCOLOR}” text=”{T_BODY_TEXT}” link=”{T_BODY_LINK}” vlink=”{T_BODY_VLINK}”>
#
#—–[ IN-LINE FIND ]——————————————
#
vlink=”{T_BODY_VLINK}”
#
#—–[ IN-LINE AFTER, ADD ]——————————————
#
onload=”resize_images()”
[B]and this Js file
[CODE]<html>
<head>
<!–
ResizeFix 1.0.0 for phpBB
www.mikelothar.com (c) 2004
//–>
<title>Original size</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>
<style type=”text/css”>
<!–
body {
background-color: #EBEBEB;
/*
scrollbar-face-color: #E3E3E3;
scrollbar-highlight-color: #E3E3E3;
scrollbar-shadow-color: #E3E3E3;
scrollbar-3dlight-color: #E3E3E3;
scrollbar-arrow-color: #E3E3E3;
scrollbar-track-color: #EBEBEB;
scrollbar-darkshadow-color: #E3E3E3;
*/
}
table { font-family: Verdana, Arial, Helvetica, sans-serif; font-size : 10; }
a:link,a:active,a:visited { text-decoration: none; color : #111111; }
a:hover { text-decoration: underline; color : #C51E21; }
//–>
</style>
<script language=”JavaScript”>
window.onload = maxWindow;
function maxWindow()
{
window.moveTo(0,0);
if (document.all)
{
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById)
{
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
{
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}
</script>
<body leftmargin=”0″ topmargin=”0″ marginwidth=”0″ marginheight=”0″>
<table width=”100%” height=”99%” border=”0″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td bordercolor=”#FFFFFF”><div align=”center”>
<table width=”50″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td align=”center”><table width=”1″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td bgcolor=”#000000″><a href=”javascript:window.close();”><img src=”<?PHP print $HTTP_GET_VARS[originalsize];?>” alt=”Close this window” border=”0″></a></td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><div align=”center”><br />
<a href=”javascript:window.close();”>Close this window</a></div></td>
</tr>
</table>
</div></td>
</tr>
</table>
</body>
</html>
=====================
This script seem to be OK but, a problem is onload image , this script will resize image after load complete, but before loading it’s still show full size
I’m not good in JS script , Someone Please add onload option [ resize when loading image ]
[B]Thank you very much
Umpol