Functions

Add an entry to the change log.

add_to_charge_log(\MEMBER $member_id, integer $amount, \SHORT_TEXT $reason, \?TIME $time) 

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

Parameters

$member

\MEMBER

The member

Returns

integerThe number of points the member has

Charge points from a specified member's account.

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

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

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

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

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, boolean $send_email) 

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

Standard code module initialisation function.

init__points() 

Standard code module initialisation function.

init__points2() 

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

point_info(\MEMBER $member) : array

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

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

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

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) 

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) : integer

Parameters

$member

\MEMBER

The member

Returns

integerThe number of points the member has