TinyPortal

Development => Support => Installation => Topic started by: ipoco on March 20, 2006, 11:03:32 PM

Title: Foobared upshrink in index.template.php
Post by: ipoco on March 20, 2006, 11:03:32 PM
I've instally TP with no problems on a new SMF 1.0.6 board but noticed one tiny error - the upshrink - hide header function doesn't seem to work.  Where do I look to fix this?

I DID have to manually update index.template.php based on TP_mod-instructions and have rechecked what I did.

Everything else seems to work like a charm.

Thanks

C

you can see the problem herehttp://ipoco.com/xforums/index.php (http://ipoco.com/xforums/index.php)
Title: Re: Foobared upshrink in index.template.php
Post by: Crip on March 20, 2006, 11:32:03 PM
On around Line 120 in the - index.template.php file add:

       <script language="JavaScript" type="text/javascript">
                var current_leftbar = ', empty($options['collapse_leftbar']) ? 'false' : 'true', ';

                function shrinkHeaderLeftbar(mode)
                {';

        // Guests don't have theme options!!
        if ($context['user']['is_guest'])
                echo '
                        document.cookie = "upshrink=" + (mode ? 1 : 0);';
        else
                echo '
                        smf_setThemeOption("collapse_leftbar", mode ? 1 : 0, null, "', $context['session_id'], '");';
        echo '
                        document.getElementById("upshrinkLeftbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("leftbarHeader").style.display = mode ? "none" : "";

                        current_leftbar = mode;
                }
          // ]]></script>
       <script language="JavaScript" type="text/javascript">
                var current_rightbar = ', empty($options['collapse_rightbar']) ? 'false' : 'true', ';

                function shrinkHeaderRightbar(mode)
                {';

        // Guests don't have theme options!!
        if ($context['user']['is_guest'])
                echo '
                        document.cookie = "upshrink=" + (mode ? 1 : 0);';
        else
                echo '
                        smf_setThemeOption("collapse_rightbar", mode ? 1 : 0, null, "', $context['session_id'], '");';

        echo '
                        document.getElementById("upshrinkRightbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("rightbarHeader").style.display = mode ? "none" : "";

                        current_rightbar = mode;
                }
        // ]]></script>

<script language="JavaScript" type="text/javascript">
var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

function shrinkHeader(mode)
{';

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>';

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript">
var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

function shrinkHeaderIC(mode)
{';

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>


down to the </head>  tag.
Title: Re: Foobared upshrink in index.template.php
Post by: ipoco on March 20, 2006, 11:56:00 PM
thanks for the reply - I've copied and pasted your code into the file and still no luck. :-\
Title: Re: Foobared upshrink in index.template.php
Post by: IchBin on March 21, 2006, 05:49:08 AM
Can you attach your file to this thread please?
Title: Re: Foobared upshrink in index.template.php
Post by: ipoco on March 21, 2006, 12:31:21 PM
Here it is - found a few items wrong - now I have two instances of the upshrink gif and a java script error.

www.ipoco.com/xforums
Title: Re: Foobared upshrink in index.template.php
Post by: G6Cad on March 21, 2006, 12:52:06 PM
Try this one, you have some codestring twise in there
I havent been able to test it cause im not running on SMF 1.0.6

Installed 1.0.6 and installed tinyportal to that to.
Found out that there were some more faults on the first one.
Use the other one i attached, i couldent remove the firt file for some reason.

Use this
Quote* index.template.php (28.35 KB - downloaded 0 times.)
Title: Re: Foobared upshrink in index.template.php
Post by: Crip on March 21, 2006, 01:13:03 PM
Try adding this:

</head>
<body>';

neither attachment had a </head> tag: should look like this :
_______
</head>
<body>';
Title: Re: Foobared upshrink in index.template.php
Post by: Crip on March 21, 2006, 01:14:47 PM
You got it G6! ;)
Title: Re: Foobared upshrink in index.template.php
Post by: ipoco on March 22, 2006, 01:59:36 PM
Thanks everyone - got it!
Title: Re: Foobared upshrink in index.template.php
Post by: G6Cad on March 22, 2006, 02:03:38 PM
Glad it worked out :)