Open: includes/functions.php
Code: Select all
// application/xhtml+xml not used because of IE
header('Content-type: text/html; charset=UTF-8');
Code: Select all
if (!function_exists('group_memberships'))
{
include($phpbb_root_path . 'includes/functions_user.'.$phpEx);
}
$groups = group_memberships(false,$user->data['user_id']);
if (sizeof($groups))
{
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 -->
and to check for multiple groups
Code: Select all
<!-- IF (S_GROUP_2 and S_GROUP_3) -->
Code: Select all
<!-- IF (S_GROUP_2 or S_GROUP_3) -->
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.