Function __global->cns_make_or_edit_group

Definitions

sources/cns_groups_action.php

  • Add or edit a usergroup with simple settings.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$group_id ?AUTO_LINK No No required parameter N/A N/A The ID of the usergroup to edit (null: adding)
$name SHORT_TEXT No No required parameter N/A N/A The name of the usergroup
$is_default BINARY No No 0 N/A N/A Whether members are automatically put into the when they join
$is_super_admin BINARY No No 0 N/A N/A Whether members of this usergroup are all super-administrators
$is_super_moderator BINARY No No 0 N/A N/A Whether members of this usergroup are all super-moderators
$title SHORT_TEXT No No Blank (empty string) N/A N/A The title for primary members of this usergroup that don't have their own title
$rank_image URLPATH No No Blank (empty string) N/A N/A The rank image for this
$promotion_target ?GROUP No No Null N/A N/A The that members of this usergroup get promoted to at point threshold (null: no promotion prospects)
$promotion_threshold ?integer No No Null N/A N/A The point threshold for promotion (null: no promotion prospects)
$promotion_approval BINARY No No 0 N/A N/A Whether usergroup promotion should require manual approval

Returns

  • The ID of the usergroup
  • Type: AUTO_LINK
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Add or edit a usergroup with simple settings.
 *
 * @param  ?AUTO_LINK $group_id The ID of the usergroup to edit (null: adding)
 * @param  SHORT_TEXT $name The name of the usergroup
 * @param  BINARY $is_default Whether members are automatically put into the when they join
 * @param  BINARY $is_super_admin Whether members of this usergroup are all super-administrators
 * @param  BINARY $is_super_moderator Whether members of this usergroup are all super-moderators
 * @param  SHORT_TEXT $title The title for primary members of this usergroup that don't have their own title
 * @param  URLPATH $rank_image The rank image for this
 * @param  ?GROUP $promotion_target The that members of this usergroup get promoted to at point threshold (null: no promotion prospects)
 * @param  ?integer $promotion_threshold The point threshold for promotion (null: no promotion prospects)
 * @param  BINARY $promotion_approval Whether usergroup promotion should require manual approval
 * @return AUTO_LINK The ID of the usergroup
 */

function cns_make_or_edit_group(?int $group_id, string $name, int $is_default = 0, int $is_super_admin = 0, int $is_super_moderator = 0, string $title = '', string $rank_image = '', ?int $promotion_target = null, ?int $promotion_threshold = null, int $promotion_approval = 0) : int