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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,022
  • Total Topics: 21,332
  • Online today: 363
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 442
  • Total: 442

how to disable members from collapsing left/ right panels?

Started by cru, August 06, 2007, 03:08:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cru

hi,

how do i disable members from collapsing left/ right panels?

and how can i remove the + and - buttons that allows the users collapse left and right panels?
im using the default theme 1.1.3 and tpv0.9.8

IchBin

If you look at the manual modifications codes posted in the docs board you will see what code does this. The first bit for the index.template.php file is for the left/right collapse stuff. Just remove that from your theme. One of the last bits for the index.template.php file is the upshrink buttons. Remove that code from your theme as well.

Dark_Zero

i think i found an option for each block that lets you set an option of whether or not you want members to be able to collapse them. it's a block-by-block setting though. not the three arrows up top.

falguni1

yes do this
go to the admin panel ok
now look under tinyportal
click block manager ok
now
click edit ok for blocks u dont want to collapse
now select Do not allow block to collapse
and save ok

IchBin

If you remove the button code and don't remove the javascript code, they could still have the columns upshrinked with no way to unshrink them. I think its a good idea to remove all the code for the buttons/javascript.

Crip

you simply remove the upshrink link in the index.template.php -- be careful or you'll get parse errors
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



Crip

In smf default theme you'd remove this bit:

// The end of tab section.
echo '
<td class="maintab_' , $last , '">&nbsp;</td>
';
// TinyPortal
if($context['TPortal']['leftbar'])
             echo '<td style="padding-left: 1ex;"><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;" /></td>';
         if($context['TPortal']['rightbar'])
             echo '<td style="padding-left: 1ex;"><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;" /></td>';
// TinyPortal end
echo '
</tr>
</table>';

}


So it looks like so:

// The end of tab section.
echo '
<td class="maintab_' , $last , '">&nbsp;</td>
</tr>
</table>';

}


This way there are nothing to click -- and No errors this way !
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



IchBin

The only problem with only removing the buttons is if the member has already upshrinked, they will be stuck with no way to make the unshrink. You should remove the javascript code. The code you had an error with was only part of what you should remove.

IchBin

<search for>
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
</search for>
<remove>
        <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>
</remove>


This website is proudly hosted on Crocweb Cloud Website Hosting.