TinyPortal

Development => Support => Topic started by: MrApples on June 25, 2007, 09:26:45 PM

Title: Adding in a custom hide panel link?
Post by: MrApples on June 25, 2007, 09:26:45 PM
What is the link to hide the right, left, and center panels? If not a link, how do I do it.
Title: Re: Adding in a custom hide panel link?
Post by: Nokonium on June 25, 2007, 09:39:38 PM
Available panel settings can be found here Admin>TinyPortal>Settings>Panels.

There will be more options in TP 1.0.
Title: Re: Adding in a custom hide panel link?
Post by: MrApples on June 25, 2007, 10:07:42 PM
For adding the actual button in the theme that minimizes the panels though. Not through admin but for a member.
Title: Re: Adding in a custom hide panel link?
Post by: Nokonium on June 25, 2007, 10:39:44 PM
Are you designing a theme?

All the necessary code to convert an SMF index.template to a TP capable one can be found in the manual modification instructions. The parts that you want will include the upshrink.gif and upshrink2.gif.
Title: Re: Adding in a custom hide panel link?
Post by: MrApples on June 25, 2007, 11:51:12 PM

        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                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"><!-- // --><![CDATA[
                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>


Looks complicated. No, I'm not designing a theme, I just want to add the button to a theme that doesn't have it. This is the right code though right?