TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 18, 2024, 07:49:21 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 112
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 64
  • Total: 64

"shrink or expand the header" button in Babylon

Started by peterstaley, April 11, 2006, 10:03:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

peterstaley

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

Crip

I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



peterstaley

#2
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/, where I have "Show userinfo/news at the top" set to "no", so only one, non-functioning button is showing.

Crip

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>
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



peterstaley

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

Crip

I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



peterstaley

that's what I couldn't find.  could you point me to where this link coding is?

Crip

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.
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes




Crip

I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



ThunderBolt

#10
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

Round11

Thank goodness I found this.  Searching with SMF is so much easier than phpBB.  This was driving me nuts!

Crip

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.
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



IchBin

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. :)