Want to allow certain usergroups to collapse sidebars in vbAdvanced CPMS

Discussion in 'Programming' started by TenPercenter, Sep 12, 2009.

  1. #1
    Could you tell me how to do this please. I'd like to allow certain usergroups of my choice to be able to collapse sidebars, but others not.

    I have vbAdvanced CPMS, with this integration installed which adds forum integration of sidebars, then with this hack installed which allows all users to collapse them at will.


    Here is the code I think in a template called adv_portal:

    $stylevar[htmldoctype]
    <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]" xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <if condition="$pages['name'] == 'home'">
        <meta http-equiv="Cache-Control" content="no-cache" />
        <meta http-equiv="Pragma" content="no-cache" />
        <meta http-equiv="Expires" content="0" />
    </if>
    
    <title>$vboptions[hometitle] <if condition="$pagetitle">- $pagetitle</if></title>
    
    $headinclude
    <if condition="$show['inlinemod']"><script type="text/javascript" src="clientscript/vbulletin_inlinemod.js"></script></if>
    </head>
    <body>
    
    $header
    
    $navbar
    <if condition="$show[left_column] and $vboptions[allow_collapse_left_sidebar]">
    <a href="#top" onclick="return toggle_collapse('left_sidebar')" style="float:$stylevar[left]; margin-bottom:2px"><img alt="" border="0" src="$stylevar[imgdir_button]/$stylevar[left]_vbacollapse{$vbulletin->left_sidebar_image}.gif" id="collapseimg_left_sidebar" /></a>
    </if>
    <if condition="$show[right_column] and $vboptions[allow_collapse_right_sidebar]">
    <a href="#top" onclick="return toggle_collapse('right_sidebar')" style="float:$stylevar[right]; margin-bottom:2px"><img alt="" border="0" src="$stylevar[imgdir_button]/$stylevar[right]_vbacollapse{$vbulletin->right_sidebar_image}.gif" id="collapseimg_right_sidebar" /></a>
    </if>
    <br />
    <table align="center" class="page" cellspacing="0" cellpadding="0" width="100%">
        <tr valign="top">
            <if condition="$show['left_column']">
                <td width="$vba_style[portal_leftcolwidth]" id="collapseobj_left_sidebar" style="{$vbulletin->left_sidebar_style}"<if condition="$show['center_column'] OR $show['right_column']"> style="padding-$stylevar[right]: $vba_style[portal_colspacing]px"</if>>
                    $home[leftblocks]
                </td>
            <!-- Spacer Cell -->
            <td width="$vba_style[portal_colspacing]"><img alt="" src="$vboptions[bburl]/$vboptions[cleargifurl]" width="$vba_style[portal_colspacing]" /></td>
            <!-- / Spacer Cell -->
            </if>
            <if condition="$show['center_column']">
                <td valign="top">
                    $home[centerblocks]
                </td>
            </if>
            <if condition="$show['right_column']">
            <!-- Spacer Cell -->
            <td width="$vba_style[portal_colspacing]"><img alt="" src="$vboptions[bburl]/$vboptions[cleargifurl]" width="$vba_style[portal_colspacing]" /></td>
            <!-- / Spacer Cell -->
                <td valign="top" width="$vba_style[portal_rightcolwidth]" id="collapseobj_right_sidebar" style="{$vbulletin->right_sidebar_style}"<if condition="$show['center_column'] OR $show['left_column']"> style="padding-$stylevar[left]: $vba_style[portal_colspacing]px"</if>>
                    $home[rightblocks]
                </td>
            </if>
        </tr>
    </table>
    
    $footer
    
    </body>
    </html>
    Code (markup):

     
    Last edited: Sep 12, 2009
    TenPercenter, Sep 12, 2009 IP