Function __global->add_leader_board
Definitions
sources/leader_board2.php
- Create a new leader-board.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: int
Parameters
Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
---|---|---|---|---|---|---|---|
$title | SHORT_TEXT | No | No | required parameter | N/A | N/A | The leader-board title |
$board_type | SHORT_TEXT | No | No | required parameter | holders earners | N/A | The type of leader-board |
$member_count | integer | No | No | required parameter | N/A | N/A | The number of top members to use for this leader-board |
$timeframe | SHORT_TEXT | No | No | required parameter | week month year | N/A | The frequency which to re-calculate the leader-board |
$rolling | BINARY | No | No | required parameter | N/A | N/A | Whether or not re-calculation should be relative to the creation time of the leader-board |
$include_staff | BINARY | No | No | required parameter | N/A | N/A | Whether or not to include staff in the leader-board |
$usergroups | ?array | No | No | [] | N/A | N/A | Only allow members in one or more of the defined usergroup IDs to be in the leader-board (null: do nothing) (empty array: no usergroup filtering) |
$calculate_voting_power | BINARY | No | No | 0 | N/A | N/A | Whether this leader-board should also calculate voting power and control percentages for leaders to display |
$creation_time | ?TIME | No | No | Null | N/A | N/A | The forced creation time of the leader-board (null: do not force / use current time) |
Returns
- The ID of the new leader-board
- Type: AUTO_LINK
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Create a new leader-board.
*
* @param SHORT_TEXT $title The leader-board title
* @param SHORT_TEXT $board_type The type of leader-board
* @set holders earners
* @param integer $member_count The number of top members to use for this leader-board
* @param SHORT_TEXT $timeframe The frequency which to re-calculate the leader-board
* @set week month year
* @param BINARY $rolling Whether or not re-calculation should be relative to the creation time of the leader-board
* @param BINARY $include_staff Whether or not to include staff in the leader-board
* @param ?array $usergroups Only allow members in one or more of the defined usergroup IDs to be in the leader-board (null: do nothing) (empty array: no usergroup filtering)
* @param BINARY $calculate_voting_power Whether this leader-board should also calculate voting power and control percentages for leaders to display
* @param ?TIME $creation_time The forced creation time of the leader-board (null: do not force / use current time)
* @return AUTO_LINK The ID of the new leader-board
*/
function add_leader_board(string $title, string $board_type, int $member_count, string $timeframe, int $rolling, int $include_staff, ?array $usergroups = [], int $calculate_voting_power = 0, ?int $creation_time = null) : int
* Create a new leader-board.
*
* @param SHORT_TEXT $title The leader-board title
* @param SHORT_TEXT $board_type The type of leader-board
* @set holders earners
* @param integer $member_count The number of top members to use for this leader-board
* @param SHORT_TEXT $timeframe The frequency which to re-calculate the leader-board
* @set week month year
* @param BINARY $rolling Whether or not re-calculation should be relative to the creation time of the leader-board
* @param BINARY $include_staff Whether or not to include staff in the leader-board
* @param ?array $usergroups Only allow members in one or more of the defined usergroup IDs to be in the leader-board (null: do nothing) (empty array: no usergroup filtering)
* @param BINARY $calculate_voting_power Whether this leader-board should also calculate voting power and control percentages for leaders to display
* @param ?TIME $creation_time The forced creation time of the leader-board (null: do not force / use current time)
* @return AUTO_LINK The ID of the new leader-board
*/
function add_leader_board(string $title, string $board_type, int $member_count, string $timeframe, int $rolling, int $include_staff, ?array $usergroups = [], int $calculate_voting_power = 0, ?int $creation_time = null) : int