Functions

Make an award type.

add_award_type(\SHORT_TEXT $title, \LONG_TEXT $description, integer $points, \ID_TEXT $content_type, \BINARY $hide_awardee, integer $update_time_hours) : \AUTO_LINK

Parameters

$title

\SHORT_TEXT

The title

$description

\LONG_TEXT

The description

$points

integer

How many points are given to the awardee

$content_type

\ID_TEXT

The content type the award type is for

$hide_awardee

\BINARY

Whether to not show the awardee when displaying this award

$update_time_hours

integer

The approximate time in hours between awards (e.g. 168 for a week)

Returns

\AUTO_LINKThe ID

Delete an award type.

delete_award_type(\AUTO_LINK $id) 

Parameters

$id

\AUTO_LINK

The ID

Edit an award type

edit_award_type(\AUTO_LINK $id, \SHORT_TEXT $title, \LONG_TEXT $description, integer $points, \ID_TEXT $content_type, \BINARY $hide_awardee, integer $update_time_hours) 

Parameters

$id

\AUTO_LINK

The ID

$title

\SHORT_TEXT

The title

$description

\LONG_TEXT

The description

$points

integer

How many points are given to the awardee

$content_type

\ID_TEXT

The content type the award type is for

$hide_awardee

\BINARY

Whether to not show the awardee when displaying this award

$update_time_hours

integer

The approximate time in hours between awards (e.g. 168 for a week)

Get details of awards won for a content item.

find_awards_for(\ID_TEXT $content_type, \ID_TEXT $id) : array

Parameters

$content_type

\ID_TEXT

The award content type

$id

\ID_TEXT

The content ID

Returns

arrayList of awards won

Get all the award selection fields for a content type and content ID

get_award_fields(\ID_TEXT $content_type, \?ID_TEXT $id) : \tempcode

Parameters

$content_type

\ID_TEXT

The content type

$id

\?ID_TEXT

The content ID (NULL: not added yet - therefore can't be holding the award yet)

Returns

\tempcodeThe fields

Give an award.

give_award(\AUTO_LINK $award_id, \ID_TEXT $content_id, \?TIME $time) 

Parameters

$award_id

\AUTO_LINK

The award ID

$content_id

\ID_TEXT

The content ID

$time

\?TIME

Time the award was given (NULL: now)

Situation: something that may have awards has just been added/edited.

handle_award_setting(\ID_TEXT $content_type, \ID_TEXT $id) 

Action: add any specified awards.

Parameters

$content_type

\ID_TEXT

The content type

$id

\ID_TEXT

The content ID