My Board Style - How much control?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
jtryptophan
Registered User
Posts: 299
Joined: Wed Apr 09, 2008 5:38 pm
Location: Baltimore, MD
Contact:

My Board Style - How much control?

Post by jtryptophan »

I'm looking for a way to allow only certain groups like donors and moderators the ability to switch board styles. I've found that by ticking not to allow override of default you can force all the users to only see the default style. Is it possible to allow on a few groups this freedom; if so how? Thanks.
User avatar
COD3M4ST3R-X
Registered User
Posts: 2269
Joined: Sat Aug 02, 2008 5:47 am
Location: Lahore,Pakistan

Re: My Board Style - How much control?

Post by COD3M4ST3R-X »

Set the default style,you want all other members to have.
Than do the following modification
RMcGirr83 wrote:This will allow an admin of a board to make it so that "if user is a member of group X, then display message X".

Open: includes/functions.php

FIND:

Code: Select all

 // The following assigns all _common_ variables that may be used at any point in a template.     

BEFORE ADD:

Code: Select all

if ( !function_exists('group_memberships') )
    {
        include($phpbb_root_path . 'includes/functions_user.'.$phpEx);
    }
    $groups = group_memberships(false,$user->data['user_id']);
    foreach ($groups as $grouprec)
    {
        $template->assign_vars(array(
        'S_GROUP_' . $grouprec['group_id'] => true
        ));
    }   

then use the switch like so in an html file, where the number is the group_id.

Code: Select all

<!-- IF S_GROUP_2 -->ad code here<!-- ENDIF -->
Alternatively, you can also use

Code: Select all

<!-- IF not S_GROUP_2 -->ad code here<!-- ENDIF -->
if you would like those not in the group to see the code. Helpful for displaying advertisements to those in a specific group, for example.
Than in yourstyle/template/ucp_prefs_personal.html
Find:

Code: Select all

    <!-- IF S_STYLE_OPTIONS -->
        <dl>
            <dt><label for="style">{L_BOARD_STYLE}:</label></dt>
            <dd><select name="style" id="style">{S_STYLE_OPTIONS}</select></dd>
        </dl>
    <!-- ENDIF --> 
and than place an IF switch as stated in the previous modification :)
it should look something like this:

Code: Select all

<!-- IF S_GROUP_2 -->
    <!-- IF S_STYLE_OPTIONS -->
        <dl>
            <dt><label for="style">{L_BOARD_STYLE}:</label></dt>
            <dd><select name="style" id="style">{S_STYLE_OPTIONS}</select></dd>
        </dl>
    <!-- ENDIF -->
<!-- ENDIF -->  
“Need and struggle are what excite and inspire us.”
Locked

Return to “[3.0.x] Support Forum”