mycred_history

Description

This shortcode allows you to show your log in the front end. You can select to show all log entries or show a specific users log entries. Perfect for a “History” page for your users if you do not allow them into the admin area.

Available since version 1.1

Parameters

Attribute Type Required Default Description
user_id string No "current" Option to filter the log based on a particular user. Set to empty to show all log entries.
number int No 10 The number of entries to show per page.
time string No - Option to filter the history based on time or date. Accepts the keywords "today", "yesterday", "thisweek", "thismonth" or a comma separated list of two dates. See strtotime for further information on available options.
ref string No - Option to filter the log based on a particular reference or a comma separated list of references.
order string No - Option to set the order of the log entries. Accepts "DESC" for descending or "ASC" for ascending.
show_user int No 0 Option to show the user column in the table (1) or hide it (0).
show_nav int No 1 Option to show navigation for the log table (1) or not (0).
login string No - Optional message to show when a visitor views the log. Leave empty if you want to show the log for visitors as well.
type string No mycred_default Option to filter the history based on point type. Should not be used if you only have one point type installed.
pagination int No 10 New in 1.7, this sets the number of pages to show in the pagination.
inlinenav int No 0 Insert custom CSS to style navigation to be inline. Should only be used when the navigation is rendered vertically (0) instead of horizontal (1). Added in 1.7.5.

CSS Styling

// The wrapper
.mycred-history-wrapper { }

// The table
table.mycred-table { }

// Table columns
table.mycred-table .column-time { }
table.mycred-table .column-username { }
table.mycred-table .column-creds { }
table.mycred-table .column-entry { }

// Navigation
.mycred-history-wrapper nav { }
.mycred-history-wrapper nav ul { }
.mycred-history-wrapper nav ul li { }

Examples

Example 1: Show current user’s last 20 entries.

[mycred_history user_id="current" number=20]

Example 2: Show all log entries including the user column.

[mycred_history show_user=1]

Example 3: Show the user with the ID 1′s history for the custom point type “mytype”.

[mycred_history user_id=1 type="customtypekey"]

Example 4: Show todays log entries for everyone.

[mycred_history show_user=1 time="today"]

Example 5: Show log entries for a specific reference. In this example, show all buyCRED Points purchases made via PayPal

[mycred_history show_user=1 ref="buy_creds_with_paypal_standard"]

Example 6: Show log entries for all point types in a single table (requires 1.7.5 or higher)

[mycred_history show_user=1 type=""]