Documentation  •  Changelog


User Vote History

You can easily see what votes have been cast by a particular user...


If you don't specify a user, it will return the history of the currently logged-in user by default.

Optionally, you can specify a particular user by passing in a valid UserModel...

{% for member in craft.users.group('members') %}

    {% set memberHistory = craft.upvote.userHistory(member) %}

    {# Do stuff with memberHistory #}

{% endfor %}

History Format

The history results will be an array of element IDs and the user's corresponding vote.

    14:  1
    33:  1
    39: -1
    42:  1

The array keys are the element IDs of the elements being voted on.

The array values represent the direction of the vote. An upvote is 1, a downvote is -1.

Requires Logged-in Users

Only logged-in users will have their votes recorded. Voting history is not available in anonymous voting systems.