118 Posts
webchun
7 years ago
3
Topic

Hi guys, I'd like to add a 'Mark as read' function to my seblod articles so when a user logged in and read an article, it will add a 'read' count/mark to the article for that user. Is that possible to do that?

Any idea or suggestion are welcome. Thanks!

Get a Book for SEBLOD
4229 Posts
Kadministrator
7 years ago
2
Level 1

You could add new database table with id, article_id and user_id fields, then on each read use beforeRender event and just inser tnew row with this value into that table.

To show number of reads by user you can then do SELECT COUNT id from your_table WHERE article_id=YOURATICLEID and user_id=USERID

118 Posts
webchun
7 years ago
1
Level 2

Hi Klas thanks for the answer, so I need to create a plugin for this or this can be done from seblod backend?

4229 Posts
Kadministrator
7 years ago
0
Level 3

You can use beforeRender plugin from Code pack

Get a VIP membership