This site uses cookies and similar technologies.

If you don't change browser settings, you agree to it.

I understand
45 Posts
webchun
21 days 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 VIP membership
2361 Posts
Klasadministrator
20 days 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

45 Posts
webchun
20 days 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?

2361 Posts
Klasadministrator
20 days ago
0
Level 3

You can use beforeRender plugin from Code pack

Get a Book for SEBLOD