News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Signatures Causing Reloading in IE

Started by SleePy, December 06, 2005, 06:37:54 PM

Previous topic - Next topic

SleePy

Some Users of our users on our board cause pages to refresh in IE. we noticed it was mainly 2 users that had really big signatures.
Even though IE is a piece of junk some people still use it over fire-fox no mater what we try to say to them But IE is giving this error and no other browser.
I do not have IE (Mac user) and do not see it but about 20 others who use IE see this error and continually reporting it. The Error Log on SMF and Server do not report any thing at all so i have no clue as to what is causing this.
I had a IE user disable signatures of users though his profile Look and Layout Preferences.
As of right now i just added it so signatures are forced to a certain height.
There is a little thing in the index.template.php in our themes folder and it has this

// This is an interesting bug in Internet Explorer AND Safari.  Rather annoying, it makes overflows just not tall enough.
if ((($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari']))
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}';
else
{
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}';
}

echo '
// ]]></script>';
}


I thought that was the error but i have removed it and it continues to Refresh.

I am down to nothing but forcing Signature sizes and really wish not to. Does anyone know anything Else that could cause this.

Running SMF 1.1 RC1
Using Theme: Helios Multi design by Bloc
My Current SMF version is: SMF 1.1 RC1
Operating system   Linux
PHP version   4.4.1
MySQL version   4.0.25-standard
Apache version   1.3.34 (Unix)
Machine Type   i686

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Advertisement: