Functions

Add an entry to the change log.

add_to_charge_log(\MEMBER $member_id, integer $amount, \SHORT_TEXT $reason, \?TIME $time = null
package points

Parameters

$member_id

\MEMBER

The member that is being charged

$amount

integer

The amount being charged

$reason

\SHORT_TEXT

The reason for the charging

$time

\?TIME

The time this is recorded to have happened (null: use current time)

Get the total points the specified member has

available_points(\MEMBER $member) : integer
package points

Parameters

$member

\MEMBER

The member

Returns

integerThe number of points the member has

Calculate the leader-board.

calculate_latest_leader_board(boolean $retrieve = true) : \?array
package points

Parameters

$retrieve

boolean

Whether to retrieve results too (no retrieve -> faster call)

Returns

\?arrayA map of member-IDs to points, sorted by leader-board status (null: not retrieving)

Charge points from a specified member's account.

charge_member(\MEMBER $member_id, integer $amount, \SHORT_TEXT $reason) 
package points

Parameters

$member_id

\MEMBER

The member that is being charged

$amount

integer

The amount being charged

$reason

\SHORT_TEXT

The reason for the charging

Get the number of gifts points to give that the given member has.

get_gift_points_to_give(\MEMBER $member) : integer
package points

Parameters

$member

\MEMBER

The member we want it for

Returns

integerThe number of gifts points to give that the given member has

Get the number of gift points used by the given member.

get_gift_points_used(\MEMBER $member) : integer
package points

Parameters

$member

\MEMBER

The member we want it for

Returns

integerThe number of gift points used by the member

Get the price of the specified item for sale in the Point Store (only for tableless items).

get_price(\ID_TEXT $item) : integer
package points

Parameters

$item

\ID_TEXT

The name of the item

Returns

integerThe price of the item

Give a member some points, from another member.

give_points(integer $amount, \MEMBER $recipient_id, \MEMBER $sender_id, \SHORT_TEXT $reason, boolean $anonymous = false, boolean $send_email = true
package points

Parameters

$amount

integer

The amount being given

$recipient_id

\MEMBER

The member receiving the points

$sender_id

\MEMBER

The member sending the points

$reason

\SHORT_TEXT

The reason for the gift

$anonymous

boolean

Does the sender want to remain anonymous?

$send_email

boolean

Whether to send out an email about it

See if a leader-board has been calculated since a particular cut-off time.

has_leader_board_since(\TIME $cutoff) : boolean
package points

Parameters

$cutoff

\TIME

Cut-off time

Returns

booleanWhether it has

Get all sorts of information about a specified member's point account.

point_info(\MEMBER $member) : array
package points

Parameters

$member

\MEMBER

The member the point info is of

Returns

arrayThe map containing the members point info (fields as enumerated in description)

Show the point transactions a member has had.

points_get_transactions(\ID_TEXT $type, \MEMBER $member_id_of, \MEMBER $member_id_viewing) : \Tempcode
package points
set from to

Parameters

$type

\ID_TEXT

The type of transactions we are looking for

$member_id_of

\MEMBER

Who we are looking at transactions for

$member_id_viewing

\MEMBER

Who we are looking at transactions using the account of

Returns

\TempcodeThe UI

The UI for a points profile.

points_profile(\MEMBER $member_id_of, \?MEMBER $member_id_viewing) : \Tempcode
package points

Parameters

$member_id_of

\MEMBER

The ID of the member who is being viewed

$member_id_viewing

\?MEMBER

The ID of the member who is doing the viewing (null: current member)

Returns

\TempcodeThe UI

Get the total points the specified member has used (spent).

points_used(\MEMBER $member) : integer
package points

Parameters

$member

\MEMBER

The member

Returns

integerThe number of points the member has spent

Transfer gift-points into the specified member's account, courtesy of the system.

system_gift_transfer(\SHORT_TEXT $reason, integer $amount, \MEMBER $member_id) 
package points

Parameters

$reason

\SHORT_TEXT

The reason for the transfer

$amount

integer

The size of the transfer

$member_id

\MEMBER

The member the transfer is to

Get the total points in the specified member's account; some of these will probably have been spent already

total_points(\MEMBER $member, \?TIME $timestamp = null) : integer
package points

Parameters

$member

\MEMBER

The member

$timestamp

\?TIME

Time to get for (null: now)

Returns

integerThe number of points the member has