Page 22 of 23

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Wed Jul 11, 2007 12:25 am
by Bullfn33
I'm sorry, but does that mean it is or isn't suppose to show up? I thought that users just click on the picture to go to the URL for the original size.

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Fri Jul 13, 2007 6:56 pm
by Brad-sd
This is a very handy mod. I've been running it on phpbb 2.0.22 for a month with no problems.

Is there a way to have this mod apply to images posted as attachments? I no longer have the attachment mod running, but when I did, those images were blowing out my layouts.

-Thanks

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Tue Aug 21, 2007 6:23 am
by xmenfile
Hi,

I installed this with "resize avatars base on max width and height", but somehow only 1 of them works. can anyone help me how to make them both works together?

Thanks,

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Wed Aug 22, 2007 1:49 pm
by xmenfile
Anyone????

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Sat Aug 25, 2007 6:17 pm
by diabolic.bg
I have installed this mod with Resize Uploaded Avatars and Remote Avatar Resize.
All 3 mods works fine. Maybe you must change your choice. :D

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Fri Aug 31, 2007 6:01 pm
by cornick
cornick wrote:Not a huge fan of the border around the images, is there a way of removing that?
No ideas on this one?

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Fri Aug 31, 2007 11:13 pm
by Irn-Bru
cornick wrote:No ideas on this one?
Yeah I managed to change it.

If you open your <your template>/overall_header.tpl file and find:

Code: Select all

var rmw_max_width = 400; // you can change this number, this is the max width in pixels for posted images
var rmw_border_1 = '1px solid {T_BODY_LINK}';
var rmw_border_2 = '2px dotted {T_BODY_LINK}';
var rmw_image_title = '{L_RMW_IMAGE_TITLE}';
...you can change the solid or dotted line(s) to:

Code: Select all

var rmw_max_width = 400; // you can change this number, this is the max width in pixels for posted images
var rmw_border_1 = '0px solid {T_BODY_LINK}';
var rmw_border_2 = '0px dotted {T_BODY_LINK}';
var rmw_image_title = '{L_RMW_IMAGE_TITLE}';
...and it'll remove the border. You might have to change it in your <your template>/simple_header.tpl as well, but I only needed to change it in the first file I mentioned.

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Sat Sep 01, 2007 3:12 pm
by binhaus
Hi.. this it great MOD i have used it for long time.. no issue at all
but now i have some sponsor and they would like to put some type of banner on the popup images, they may be java, iframe, or images ..
any one have ideas ...!!
thanks for any information
:cry: :cry:

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Tue Sep 04, 2007 6:09 pm
by cornick
Awesome, thanks Irn-Bru.

Has anyone thought of making this mod an option for users? Some users want to use it...some users don't. So it's an option in their CP?

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Tue Sep 25, 2007 3:25 am
by rickyboyce
is there anyway of removing the popup link!!! cause banners that get resized down have a popup instead of a link!!!

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Tue Sep 25, 2007 4:49 pm
by Grashopr
Blisk wrote:This mod doesn't work ok.
So I installed this one.
find this in bbcode.tpl it is only a part of file

Code: Select all

<!-- BEGIN img -->
and replace with this

Code: Select all

<!-- BEGIN img --><img src="{URL}" alt="Image" title="Image" border="0" onload="if(this.width > screen.width-454) {this.width=(screen.width-454); this.className='clickable'; }" onclick="if(this.width >= screen.width-454) { window.open('{URL}', '_blank'); return false; }" alt="Klikni za večjo sliko" /><!-- END img -->
It works in IE and Firefox

This works PERFECTLY on IE. No need for the rest of the stuff, this is exactly what I was looking for. THANK YOU.

I altered it a bit for my own needs:

Code: Select all

<!-- BEGIN img --><img src="{URL}" alt="Image" title="Image" border="0" onload="if(this.width > 400) {this.width='400'; this.className='clickable'; }" onclick="if(this.width >= 400) { window.open('{URL}', '_blank'); return false; }" /><!-- END img -->

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Wed Sep 26, 2007 2:35 am
by rickyboyce
Please Help Someone!

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Fri Sep 28, 2007 10:27 am
by rickyboyce
Hey there Guys Don't worry! i figired out how to dissable the url, so it dosn't cause problems to over sized image links AKA Banners!!!!

Ok here is how i did it (if anyone is still roaming this thread lol) :)

OK open up your "rmw_jslib.js" file!

Now delete ALL the code in it!

Insert this instead!
/*

"Resize Posted Images Based on Max Width" 2.4.5
A phpBB MOD originally created by Christian Fecteau.

This MOD is copyright (c) Christian Fecteau 2004-2005

This MOD is released under the Creative Commons licence:
http://creativecommons.org/licenses/by-nc-sa/2.0/
Read carefully this licence before making any use of my code.

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.

*/

// don't change anything below

function rmw_go()
{
var rmw_img_array = document.getElementsByTagName("IMG");
for (var i = 0; i < rmw_img_array.length; i++)
{
var rmw_img = rmw_img_array;
if (String(rmw_img.getAttribute('resizemod')) == 'on')
{
if (rmw_wait_for_width && rmw_img.width && !isNaN(rmw_img.width))
{
if (rmw_img.width > Number(rmw_max_width))
{
rmw_img.setAttribute('resizemod','off');
rmw_img.onload = null;
rmw_img.removeAttribute('onload');
var rmw_clone = rmw_img.cloneNode(false);
var rmw_parent = rmw_img.parentNode;
rmw_clone.setAttribute('width',String(rmw_max_width));
rmw_parent.replaceChild(rmw_clone,rmw_img);
rmw_make_pop(rmw_clone);
}
}
else if (!rmw_wait_for_width)
{
rmw_img.setAttribute('resizemod','off');
var rmw_clone = rmw_img.cloneNode(false);
rmw_img.onload = null;
rmw_img.removeAttribute('onload');
var rmw_parent = rmw_img.parentNode;
var rmw_ind = rmw_count++;
rmw_clone.setAttribute('resizemod',String(rmw_ind));
rmw_preload[rmw_ind] = new Image();
rmw_preload[rmw_ind].src = rmw_img.src;
if (window.showModelessDialog)
{
rmw_clone.style.margin = '2px';
}
rmw_clone.style.border = rmw_border_1;
rmw_clone.style.width = '28px';
rmw_parent.replaceChild(rmw_clone,rmw_img);
}
}
}
if (!rmw_over && document.getElementById('resizemod'))
{
rmw_over = true;
rmw_go();
}
else if (!rmw_over)
{
window.setTimeout('rmw_go()',2000);
}
}
function rmw_img_loaded(rmw_obj)
{
if (!document.getElementsByTagName || !document.createElement) {return;}
var rmw_att = String(rmw_obj.getAttribute('resizemod'));
var rmw_real_width = false;
if ((rmw_att != 'on') && (rmw_att != 'off'))
{
var rmw_index = Number(rmw_att);
if (rmw_preload[rmw_index].width)
{
rmw_real_width = rmw_preload[rmw_index].width;
}
}
else
{
rmw_obj.setAttribute('resizemod','off');
if (rmw_obj.width)
{
rmw_real_width = rmw_obj.width;
}
}
if (!rmw_real_width || isNaN(rmw_real_width) || (rmw_real_width <= 0))
{
var rmw_rand1 = String(rmw_count++);
eval("rmw_retry" + rmw_rand1 + " = rmw_obj;");
eval("window.setTimeout('rmw_img_loaded(rmw_retry" + rmw_rand1 + ")',2000);");
return;
}
if (rmw_real_width > Number(rmw_max_width))
{
if (window.showModelessDialog)
{
rmw_obj.style.margin = '2px';
}
rmw_make_pop(rmw_obj);
}
else if (!rmw_wait_for_width)
{
rmw_obj.style.width = String(rmw_real_width) + 'px';
rmw_obj.style.border = '0';
if (window.showModelessDialog)
{
rmw_obj.style.margin = '0px';
}
}
if (window.ActiveXObject) // IE on Mac and Windows
{
window.clearTimeout(rmw_timer1);
rmw_timer1 = window.setTimeout('rmw_refresh_tables()',10000);
}
}
function rmw_refresh_tables()
{
var rmw_tables = document.getElementsByTagName("TABLE");
for (var j = 0; j < rmw_tables.length; j++)
{
rmw_tables[j].refresh();
}
}
function rmw_make_pop(rmw_ref)
{
rmw_ref.style.border = rmw_border_2;
rmw_ref.style.width = String(rmw_max_width) + 'px';
if (!window.opera)
{
rmw_ref.onclick = function()
{
/*if (!rmw_pop.closed)
{
rmw_pop.close();
}
rmw_pop = window.open('about:blank','christianfecteaudotcom',rmw_pop_features);
rmw_pop.resizeTo(window.screen.availWidth,window.screen.availHeight);
rmw_pop.moveTo(0,0);
rmw_pop.focus();
rmw_pop.location.href = this.src;*/
}
}
else
{
var rmw_rand2 = String(rmw_count++);
eval("rmw_pop" + rmw_rand2 + " = new Function(\"rmw_pop = window.open('" + rmw_ref.src + "','christianfecteaudotcom','" + rmw_pop_features + "'); if (rmw_pop) {rmw_pop.focus();}\")");
eval("rmw_ref.onclick = rmw_pop" + rmw_rand2 + ";");
}
/*document.all ? rmw_ref.style.cursor = 'hand' : rmw_ref.style.cursor = 'pointer';
rmw_ref.title = rmw_image_title;
if (window.showModelessDialog)
{
rmw_ref.style.margin = '0px';
}*/
}
if (document.getElementsByTagName && document.createElement) // W3C DOM browsers
{
rmw_preload = new Array();
if (window.GeckoActiveXObject || window.showModelessDialog) // Firefox, NN7.1+, and IE5+ for Win
{
rmw_wait_for_width = false;
}
else
{
rmw_wait_for_width = true;
}
rmw_pop_features = 'top=0,left=0,width=' + String(window.screen.width-80) + ',height=' + String(window.screen.height-190) + ',scrollbars=1,resizable=1';
rmw_over = false;
rmw_count = 1;
rmw_timer1 = null;
if (!window.opera)
{
rmw_pop = new Object();
rmw_pop.closed = true;
rmw_old_onunload = window.onunload;
window.onunload = function()
{
if (rmw_old_onunload)
{
rmw_old_onunload();
rmw_old_onunload = null;
}
if (!rmw_pop.closed)
{
rmw_pop.close();
}
}
}
window.setTimeout('rmw_go()',2000);
}


What i did was added these /**/ infront and behind both of these codes:

if (!rmw_pop.closed)
{
rmw_pop.close();
}
rmw_pop = window.open('about:blank','christianfecteaudotcom',rmw_pop_features);
rmw_pop.resizeTo(window.screen.availWidth,window.screen.availHeight);
rmw_pop.moveTo(0,0);
rmw_pop.focus();
rmw_pop.location.href = this.src;


and

document.all ? rmw_ref.style.cursor = 'hand' : rmw_ref.style.cursor = 'pointer';
rmw_ref.title = rmw_image_title;
if (window.showModelessDialog)
{
rmw_ref.style.margin = '0px';
}


as this dissables the link, link curser(hand) and the rollover"click to see full size image"!!!!!!
It only turns it into a comment as you can easily change the code back by deleting the quotes!!!!

Thanks, would be appricaited if you found this usefull!!! :D :D :D
Ricky!

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Tue Oct 02, 2007 1:44 pm
by rrjbeals
Hmm... I wonder if anyone can help. I've installed this mod manually, and rechecked everything. It works fine in Firefox, but not IE-6.

Here's the test page:
http://www.rjbeals.com/viewtopic.php?t=8

I get an invalid argument error warning in the bottom left of the page. I don't know javascript, but it may have to do with that? Thanks.

Re: [2.0.11] Resize Posted Images Based on Max Width

Posted: Tue Oct 02, 2007 2:07 pm
by diabolic.bg
The problem is in IE. Don't use it. :D In my board I redirect IE to Opera download... :lol: