Hi,
I wanted to show a block called 'Recent View', Recently viewed Nodes to online user's.
I tried this using views, but don't know how to filter according to the current online user.

How can i do this?

Comments

Anandyrh’s picture

I added a Filter called User: Current it says (Filter the view to the currently logged in user.)

After doing this, Block is getting disappeared for the logged in users.

beautifulmind’s picture

I am suggesting you a solution with understanding that you wanna display recently viewed nodes to logged in users.
I am not sure if any views plugin/filter is available for this.
But you can refer to history table in Drupal installation.
If you can write some code, you can do without views.

Regards.

Regards.
🪷 Beautifulmind

Anandyrh’s picture

That's exactly what i wanted to do.

Let me know how to do that using code. (If we are not able to do using views)

I am ready for it, Let's do it to it!

Regards,
AnAnD

beautifulmind’s picture

If you wanna print the output as a block, first, you have to create a custom module.
Then code in hook_block().
You can refer to hook_block() at http://api.drupal.org

Regards.

Regards.
🪷 Beautifulmind

Anandyrh’s picture

Seems like time taking job...

beautifulmind’s picture

Two hours!

Regards.
🪷 Beautifulmind

Anandyrh’s picture

Which i don't have now :(

Anandyrh’s picture

Any other solution....?

open social’s picture

joodas’s picture

I've just writen a how-to article about how you can use combination of existing modules to accomplish this task.

1) A per-user flag to mark nodes as user's browsing away.
2) Rules module to automate the process and re-flag the node each time it's viewed.
3) Views to display the list itself in the form of page or block.

http://jan.tomka.name/blog/list-recently-viewed-nodes-drupal

Hope it helps.

Yuki’s picture

sbscrbd