Original EE1 module by ninefour. Updated for EE2 by agathongroup.
The "Recently Viewed Entries" module allows you to keep a record of recently viewed entries on a per member basis and display that data back to the user in your page templates. The module uses the members session ID so they need not be logged in.
Usage example:
Record views for entries 1-5:
{exp:recently_viewed:add_entry channel="channel_name" entry_id="1"}
{exp:recently_viewed:add_entry channel="channel_name" entry_id="2"}
...
Retrieve recently viewed entries:
{exp:recently_viewed:get_entries channel="channel_name" distinct="yes"} // EE1: distinct="on"
Will output:
1|2|3|4|5
The EE2 version of this module also lets you set a limit
parameter on {exp:recently_viewed:add_entry}
, to control how many entries are stored in the database. The default number is 5. The EE1 module will store a maximum of 5 entries.
{exp:recently_viewed:add_entry channel="channel_name" entry_id="{entry_id}" limit="10"}