Ok i do it!
Follow that instructions to enable the autoresieze of images that are linked directly:
follow that instructions ONLY AFTER installed "Image Resize using Lytebox" and edit file includes/class_bbcode.php
Edit file clientscript/lytebox.js and ADD at end of file:
Code:
/*
"RedFoxy Resize Image" based on "Resize Avatars Based on Max Width and Height" for phpBB (c) Christian Fecteau 2005
WebSite: http://www.redfoxy.it
http://www.forum.redfoxy.it
http://www.softairmania.it
Original Credits must be given with my full name (Christian Fecteau)
and a link to my portfolio: http://portfolio.christianfecteau.com/
Removal or alteration of this notice is strongly prohibited.
*/
function rfrs_im(rfrs_obj, rfrs_max_width, rfrs_max_height)
{
if (!document.getElementsByTagName || !document.createElement)
{
return;
}
var rfrs_real_width = rfrs_real_height = rfrs_offset_width = rfrs_offset_height = false;
if (rfrs_obj.width && rfrs_obj.height)
{
rfrs_real_width = rfrs_obj.width;
rfrs_real_height = rfrs_obj.height;
}
if (!rfrs_real_width || isNaN(rfrs_real_width) || (rfrs_real_width <= 0) || !rfrs_real_height || isNaN(rfrs_real_height) || (rfrs_real_height <= 0))
{
var rfrs_rand1 = String(rfrs_count++);
eval("rfrs_retry" + rfrs_rand1 + " = rfrs_obj;");
eval("rfrs_x" + rfrs_rand1 + " = rfrs_max_width;");
eval("rfrs_y" + rfrs_rand1 + " = rfrs_max_height;");
eval("window.setTimeout('rfrs_img_loaded(rfrs_retry" + rfrs_rand1 + ",rfrs_x" + rfrs_rand1 + ",rfrs_y" + rfrs_rand1 + ")',1000);");
return;
}
if (rfrs_real_width > rfrs_max_width) { rfrs_offset_width = rfrs_real_width - rfrs_max_width; }
if (rfrs_real_height > rfrs_max_height) { rfrs_offset_height = rfrs_real_height - rfrs_max_height; }
if (!rfrs_offset_width && !rfrs_offset_height) { return; }
if (rfrs_offset_width > rfrs_offset_height)
{
rfrs_obj.style.width = String(rfrs_max_width) + 'px';
document.all ? rfrs_obj.style.cursor = 'hand' : rfrs_obj.style.cursor = 'pointer';
}
else
{
rfrs_obj.style.height = String(rfrs_max_height) + 'px';
document.all ? rfrs_obj.style.cursor = 'hand' : rfrs_obj.style.cursor = 'pointer';
}
}
Edit file includes/class_bbcode.php and find:
Code:
return '<a target="_blank" href="' . $link . '" rel="lytebox"><img src="' . $link . '" border="0" alt="" /></a>';
Replace with:
Code:
return '<a target="_blank" href="' . $link . '" rel="lytebox"><img onload="rfrs(this, 200, 200)" src="' . $link . '" border="0" alt="" /></a>';
Save all
Note: to change max width and max height for resize, just change the value in includes/class_bbcode.php at rfrs(this, 200, 200)