Comment:
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
#
#-----[ BEFORE, ADD ]------------------------------------------
#
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
- Code: Select all
// application/xhtml+xml not used because of IE
header('Content-type: text/html; charset=UTF-8');
#
#-----[ BEFORE, ADD ]------------------------------------------
#
- Code: Select all
// Check what group a user is in
if ( !function_exists('group_memberships') )
{
include_once($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
));
}
Now on any page, you should be able to use this switch
- Code: Select all
<!-- IF S_GROUP_X -->
Just replace X with ID of the group. You can also expand on that and add multiple groups and/or any other template function that is built into phpBB
- Code: Select all
<!-- IF S_GROUP_1 or S_GROUP_2 --> // if user is in either of the groups
- Code: Select all
<!-- IF S_GROUP_1 and S_GROUP_2 --> // User has to be in both groups to return true
- Code: Select all
<!-- IF not S_GROUP_X --> // Show for all except that group


