mycred_add

Description

This filter is one of the most central filters in myCRED. Each time a user is to gain or loose points, the request is passed through this filter to allow external parties or custom code snippets from stopping a transaction.

When using this filter, keep in mind other scripts that also use this filter. Code snippets using this filter before your code snippet fires might have already declined the transaction which you will need to honour.

Available since version 1.0

Parameters

Param Type Required Description
$reply bool Yes

The result of this filter. Should either be true (run the request) or false (stop the request).

$request array No

The request array with information that will be passed on to the processor if the request is approved. The array structure is the same as the log structure.

$mycred obj No

The current myCRED_Settings class object.

You should not change a users balance or add log entries in this filter or you will create an infinite loop.

Used By

Package Prio. Description
mycred/banking 1 The central banking service uses this filter to stop transactions if the central bank runs out of points.

Examples

Example 1: Stop user 1 from gaining points for approved comments.

Example 2: Prevent your users balance from going minus.