HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Developer's Guide: OCF groups

» Return to Contents



sources/ocf_groups.php

Global_functions_ocf_groups.php

Function summary

void init__ocf_groups ()
tempcode ocf_nice_get_usergroups (?AUTO_LINK it)
GROUP get_first_default_group ()
array ocf_get_all_default_groups (boolean include_primary)
void ocf_ensure_groups_cached (mixed groups)
tempcode ocf_get_group_link (GROUP id)
string ocf_get_group_name (GROUP group)
mixed ocf_get_group_property (GROUP group, ID_TEXT property)
mixed ocf_get_member_best_group_property (MEMBER member_id, ID_TEXT property)
mixed ocf_get_best_group_property (array groups, ID_TEXT property)
array ocf_get_members_groups (?MEMBER member_id, boolean skip_secret, boolean handle_probation)
?AUTO_LINK find_usergroup_id (SHORT_TEXT title)

void init__ocf_groups()

Standard code module initialisation function.

Parameters…

(No return value)


Return to the function index for this class Expand: View the source code to this function

tempcode ocf_nice_get_usergroups(?AUTO_LINK it)

Get a nice list for selection from the usergroups.

Parameters…

Name it
Description Usergroup selected by default (NULL: no specific default).
Default value
Type ?AUTO_LINK

Returns…

Description The list.
Type tempcode

Return to the function index for this class Expand: View the source code to this function

GROUP get_first_default_group()

Find the first default group.

Parameters…

Returns…

Description The first default group.
Type GROUP

Return to the function index for this class Expand: View the source code to this function

array ocf_get_all_default_groups(boolean include_primary)

Get a list of the default usergroups (the usergroups a member is put in when they join).

Parameters…

Name include_primary
Description Whether to include the default primary.
Default value boolean-false
Type boolean

Returns…

Description The list of default IDs.
Type array

Return to the function index for this class Expand: View the source code to this function

void ocf_ensure_groups_cached(mixed groups)

Ensure a list of usergroups are cached in memory.

Parameters…

Name groups
Description The list of usergroups (array) or '*'.
Type mixed

(No return value)


Return to the function index for this class Expand: View the source code to this function

tempcode ocf_get_group_link(GROUP id)

Get a rendered link to a usergroup.

Parameters…

Name id
Description The ID of the group.
Type GROUP

Returns…

Description The link.
Type tempcode

Return to the function index for this class Expand: View the source code to this function

string ocf_get_group_name(GROUP group)

Get a usergroup name.

Parameters…

Name group
Description The ID of the group.
Type GROUP

Returns…

Description The usergroup name.
Type string

Return to the function index for this class Expand: View the source code to this function

mixed ocf_get_group_property(GROUP group, ID_TEXT property)

Get a certain property of a certain.

Parameters…

Name group
Description The ID of the group.
Type GROUP

Name property
Description The identifier of the property.
Type ID_TEXT

Returns…

Description The property value.
Type mixed

Return to the function index for this class Expand: View the source code to this function

mixed ocf_get_member_best_group_property(MEMBER member_id, ID_TEXT property)

Get the best value of all values of a property for a member (due to members being in multiple usergroups).

Parameters…

Name member_id
Description The ID of the member.
Type MEMBER

Name property
Description The identifier of the property.
Type ID_TEXT

Returns…

Description The property value.
Type mixed

Return to the function index for this class Expand: View the source code to this function

mixed ocf_get_best_group_property(array groups, ID_TEXT property)

Get the best value of all values of a property for a list of usergroups.

Parameters…

Name groups
Description The list of usergroups.
Type array

Name property
Description The identifier of the property.
Type ID_TEXT

Returns…

Description The best property value ('best' is dependant on the property we are looking at).
Type mixed

Return to the function index for this class Expand: View the source code to this function

array ocf_get_members_groups(?MEMBER member_id, boolean skip_secret, boolean handle_probation)

Get a list of the usergroups a member is in (keys say the usergroups, values are irrelevant).

Parameters…

Name member_id
Description The member to find the usergroups of (NULL: current member).
Default value
Type ?MEMBER

Name skip_secret
Description Whether to skip looking at secret usergroups.
Default value boolean-false
Type boolean

Name handle_probation
Description Whether to take probation into account
Default value boolean-true
Type boolean

Returns…

Description Reverse list (e.g. array(1=>1,2=>1,3=>1) for someone in (1,2,3)).
Type array

Return to the function index for this class Expand: View the source code to this function

?AUTO_LINK find_usergroup_id(SHORT_TEXT title)

Get the ID for a usergroup if we only know the title. Warning: Only use this with custom code, never core code! It assumes a single language and that usergroups aren't renamed.

Parameters…

Name title
Description The title.
Type SHORT_TEXT

Returns…

Description The ID (NULL: could not find).
Type ?AUTO_LINK

Return to the function index for this class Expand: View the source code to this function

sources/ocf_groups_action.php

Global_functions_ocf_groups_action.php

Function summary

AUTO_LINK ocf_make_group (SHORT_TEXT name, BINARY is_default, BINARY is_super_admin, BINARY is_super_moderator, SHORT_TEXT title, URLPATH rank_image, ?GROUP promotion_target, ?integer promotion_threshold, ?MEMBER group_leader, integer flood_control_submit_secs, integer flood_control_access_secs, integer max_daily_upload_mb, integer max_attachments_per_post, integer max_avatar_width, integer max_avatar_height, integer max_post_length_comcode, integer max_sig_length_comcode, integer gift_points_base, integer gift_points_per_day, BINARY enquire_on_new_ips, BINARY is_presented_at_install, BINARY hidden, ?integer order, BINARY rank_image_pri_only, BINARY open_membership, BINARY is_private_club)

AUTO_LINK ocf_make_group(SHORT_TEXT name, BINARY is_default, BINARY is_super_admin, BINARY is_super_moderator, SHORT_TEXT title, URLPATH rank_image, ?GROUP promotion_target, ?integer promotion_threshold, ?MEMBER group_leader, integer flood_control_submit_secs, integer flood_control_access_secs, integer max_daily_upload_mb, integer max_attachments_per_post, integer max_avatar_width, integer max_avatar_height, integer max_post_length_comcode, integer max_sig_length_comcode, integer gift_points_base, integer gift_points_per_day, BINARY enquire_on_new_ips, BINARY is_presented_at_install, BINARY hidden, ?integer order, BINARY rank_image_pri_only, BINARY open_membership, BINARY is_private_club)

Add a usergroup.

Parameters…

Name name
Description The name of the usergroup.
Type SHORT_TEXT

Name is_default
Description Whether members are automatically put into the when they join.
Type BINARY

Name is_super_admin
Description Whether members of this usergroup are all super administrators.
Type BINARY

Name is_super_moderator
Description Whether members of this usergroup are all super moderators.
Type BINARY

Name title
Description The title for primary members of this usergroup that don't have their own title.
Type SHORT_TEXT

Name rank_image
Description The rank image for this.
Default value
Type URLPATH

Name promotion_target
Description The that members of this usergroup get promoted to at point threshold (NULL: no promotion prospects).
Default value
Type ?GROUP

Name promotion_threshold
Description The point threshold for promotion (NULL: no promotion prospects).
Default value
Type ?integer

Name group_leader
Description The leader of this usergroup (NULL: none).
Default value
Type ?MEMBER

Name flood_control_submit_secs
Description The number of seconds that members of this usergroup must endure between submits (group 'best of' applies).
Default value 5
Type integer

Name flood_control_access_secs
Description The number of seconds that members of this usergroup must endure between accesses (group 'best of' applies).
Default value 0
Type integer

Name max_daily_upload_mb
Description The number of megabytes that members of this usergroup may attach per day (group 'best of' applies).
Default value 70
Type integer

Name max_attachments_per_post
Description The number of attachments that members of this usergroup may attach to something (group 'best of' applies).
Default value 50
Type integer

Name max_avatar_width
Description The maximum avatar width that members of this usergroup may have (group 'best of' applies).
Default value 100
Type integer

Name max_avatar_height
Description The maximum avatar height that members of this usergroup may have (group 'best of' applies).
Default value 100
Type integer

Name max_post_length_comcode
Description The maximum post length that members of this usergroup may make (group 'best of' applies).
Default value 30000
Type integer

Name max_sig_length_comcode
Description The maximum signature length that members of this usergroup may make (group 'best of' applies).
Default value 700
Type integer

Name gift_points_base
Description The number of gift points that members of this usergroup start with (group 'best of' applies).
Default value 25
Type integer

Name gift_points_per_day
Description The number of gift points that members of this usergroup get per day (group 'best of' applies).
Default value 1
Type integer

Name enquire_on_new_ips
Description Whether e-mail confirmation is needed for new IP addresses seen for any member of this usergroup (group 'best of' applies).
Default value 0
Type BINARY

Name is_presented_at_install
Description Whether the usergroup is presented for joining at joining (implies anyone may be in the, but only choosable at joining)
Default value 0
Type BINARY

Name hidden
Description Whether the name and membership of the is hidden
Default value 0
Type BINARY

Name order
Description The display order this will be given, relative to other usergroups. Lower numbered usergroups display before higher numbered usergroups (NULL: next).
Default value
Type ?integer

Name rank_image_pri_only
Description Whether the rank image will not be shown for secondary membership
Default value 1
Type BINARY

Name open_membership
Description Whether members may join this usergroup without requiring any special permission
Default value 0
Type BINARY

Name is_private_club
Description Whether this usergroup is a private club. Private clubs may be managed in the CMS zone, and do not have any special permissions - except over their own associated forum.
Default value 0
Type BINARY

Returns…

Description The ID of the new.
Type AUTO_LINK

Return to the function index for this class Expand: View the source code to this function