TinyPortal

Development => Support => Topic started by: peterstaley on April 11, 2006, 10:03:37 AM

Title: "shrink or expand the header" button in Babylon
Post by: peterstaley on April 11, 2006, 10:03:37 AM
When I'm looking at this page using Babylon, I see 2 shrink or expand the header buttons to the left of the Home button.  The first one works (and is generated by TP, I think).  The 2nd one doesn't do anything.

If I change my TP settings so that "Show userinfo/news at the top" is set to "no", then the first header button disappears, but the 2nd, non-functioning button remains.  Is there a way to get rid of this 2nd, non-functioning "shrink or expand the header" button?

Peter
Title: Re: "shrink or expand the header" button in Babylon
Post by: Crip on April 11, 2006, 10:09:38 AM
May I see a link to it?
Title: Re: "shrink or expand the header" button in Babylon
Post by: peterstaley on April 11, 2006, 10:16:23 AM
I'm seeing it now, on this page (The Bloc Zone's forums), when I have it set to Babylon Theme. There are 2 shrink header buttons, and the 2nd one doesn't do anything.

My site is at http://forums.poz.com/ (http://forums.poz.com/), where I have "Show userinfo/news at the top" set to "no", so only one, non-functioning button is showing.
Title: Re: "shrink or expand the header" button in Babylon
Post by: Crip on April 11, 2006, 10:44:51 AM
Replace with this in your index.template.php file and all 3 upshrinks will work correct..if you want.


  <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 '
                        document.getElementById("upshrinkTempLeftbar").src = "', $scripturl, '?action=jsoption;var=collapse_leftbar;val=" + (mode ? 1 : 0) + ";sesc=', $context['session_id'], ';" + (new Date().getTime());';

        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 '
                        document.getElementById("upshrinkTempRightbar").src = "', $scripturl, '?action=jsoption;var=collapse_rightbar;val=" + (mode ? 1 : 0) + ";sesc=', $context['session_id'], ';" + (new Date().getTime());';

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

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

                        current_rightbar = mode;
                }
       // --></script>
Title: Re: "shrink or expand the header" button in Babylon
Post by: peterstaley on April 11, 2006, 12:41:26 PM
Thanks, that works!  One more thing, if I decide to hide these buttons, what's the easiest way?  What lines to I comment out?

Peter
Title: Re: "shrink or expand the header" button in Babylon
Post by: Crip on April 11, 2006, 12:44:58 PM
Remove the link to it.
Title: Re: "shrink or expand the header" button in Babylon
Post by: peterstaley on April 11, 2006, 12:52:26 PM
that's what I couldn't find.  could you point me to where this link coding is?
Title: Re: "shrink or expand the header" button in Babylon
Post by: Crip on April 11, 2006, 12:59:55 PM
line 360 in your index.template.file is this:

';
// TinyPortal

if($context['TPortal']['showtop'])
echo '<a href="javascript:void(0);" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTemp" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 1ex;" /> ';
if($context['TPortal']['leftbar'])
echo '<a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="', $settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempLeftbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" />';
if($context['TPortal']['rightbar'])
echo '<a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="', $settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempRightbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" />';
// TinyPortal end


You just remove the link you want too.
Title: Re: "shrink or expand the header" button in Babylon
Post by: peterstaley on April 11, 2006, 01:05:51 PM
Thanks!

Peter
Title: Re: "shrink or expand the header" button in Babylon
Post by: Crip on April 11, 2006, 01:07:11 PM
;)
Title: Re: "shrink or expand the header" button in Babylon
Post by: ThunderBolt on May 13, 2006, 12:47:57 AM
Thanks for the tip on removing the buttons. 

I have a little problem.  I don't want the header to show at all since I have the same information in the left bar "Users".  If I remove the buttons to collapse the header and remove the buttons then thats fine.  How can I just remove the header all together?

  I have some users that don't have the header collapsed and if I remove the buttons then they won't be able to collapse it.  I think I just want to remove the header all together since TP does a GREAT job of allowing user information on the sidebars.

Can you point me to the code to remove the header "Users" information at the top header for ALL users and then I can remove the buttons.

I guess the same would apply for the side buttons too.  I want the sidebars to show all the time even if the user had selected previously to collapse them.

Thanks.

T
Title: Re: "shrink or expand the header" button in Babylon
Post by: Round11 on June 16, 2006, 01:57:30 PM
Thank goodness I found this.  Searching with SMF is so much easier than phpBB.  This was driving me nuts!
Title: Re: "shrink or expand the header" button in Babylon
Post by: Crip on June 16, 2006, 02:05:42 PM
Quote from: ThunderBolt on May 13, 2006, 12:47:57 AM
Thanks for the tip on removing the buttons. 

I have a little problem.  I don't want the header to show at all since I have the same information in the left bar "Users".  If I remove the buttons to collapse the header and remove the buttons then thats fine.  How can I just remove the header all together?

  I have some users that don't have the header collapsed and if I remove the buttons then they won't be able to collapse it.  I think I just want to remove the header all together since TP does a GREAT job of allowing user information on the sidebars.

Can you point me to the code to remove the header "Users" information at the top header for ALL users and then I can remove the buttons.

I guess the same would apply for the side buttons too.  I want the sidebars to show all the time even if the user had selected previously to collapse them.

Thanks.

T

T,
in your [index.template.php] file you can remove all of that, But you have to be careful or you will get parse errors..so just remove whats needed..removing that can be tricky.
Title: Re: "shrink or expand the header" button in Babylon
Post by: IchBin on June 16, 2006, 02:16:59 PM
One thing I like to do so that you don't actually have to delete any code is comment out the code. You can put a // in front of each line, or you can surround a bunch of code with /* and */. Then if it doesn't work, then you can just remove or adjust where your commenting marks are without having to worry about code. :)