phpBB

Development Wiki

Function.group set user default

From phpBB Development Wiki

Description

void   group_set_user_default($group_id, $user_id_ary, [$group_attributes = false], [$update_listing = false])

This function should be used to set a default group for users. The default group is their primary role and what appears in the user list (as a color). Admin have to have a default user group of 5.

Parameters

Parameter Usage
group_id The user group id to set as the default.
user_id_arry Users ids, has to be an array.
group_attributes An array of group attributes to update (optional).
update_listing Will update the group listing (call function group_update_listings($group_id)) (optional)

Return Values

Returns void. There are no return values.

Examples

Example 1

Will set the user id 55 to a default group of Global Moderators group (group_id = 4).

<?php
group_set_user_default
(4, array(55));
?>


--Mfairchild365 19:19, 18 May 2011 (BST)