mycred_total_since

Codex / mycred/log / Shortcodes / mycred_total_since

Description

This shortcode will show the total number of points a user has gained in a given timeframe. For example you can show the total number of points a user has gained today (default).

Available since version 1.7

Shortcode Attributes

Attribute Type Required Default Description
from int or string No - Option to set from when we should start adding up points. Accepts: today for today, a UNIX timestamp or a well formatted date. See strtotime for further information on available options.
until int or string No - Option to set what time to stop counting. Accepts: now for now, a UNIX timestamp or a well formatted date. See strtotime for further information on available options.
type string No MYCRED_DEFAULT_TYPE_KEY Option to count a specific point type.
ref string No - Option to filter results by reference.
user_id int or string No - Option to set the requirement for a particular user. Should not be used unless you must check a different user, than the one viewing the shortcode.
formatted int No 1 Option to set if the results should be returned raw (0) or formatted (1). Defaults to formatted.

CSS Styling

This shortcode does not return any stylable elements.

Examples

Example 1: Show the total number of points a user has gained from Approved Comments today.

[mycred_total_since ref="approved_comment"]

Example 2: Show the total number of points a user has gained since January 1st, 2016

[mycred_total_since from="2016-01-01"]

Example 2: Used inside the Loop, show the total number of points the posts author has received since they joined.

[mycred_total_since user_id="author" from=0]

Last edited June 23, 2016