记住多个项目之间已读/未读状态的最有效方法是什么?
例如,让我们采用论坛的格式,其中有多个用户和多个主题。假设此论坛希望跟踪哪些用户已经阅读了哪些线程,并且说,使用这些信息来标记查看线程列表时未读的线程。
For example, let's take the format of a forum, where we have multiple users and multiple threads. Say this forum wants to track which users have read which threads and, say, use that information to mark which threads are unread when viewing the thread list.
我唯一的解决方案可以想象的是,每当用户访问一个线程时,就会在数据库中添加一条记录。我想可能会有一个将所有内容标记为已读按钮,该按钮可以使用时间戳来帮助减少数据库的泛滥……无论这不是给我留下深刻印象的解决方案。
The only solution I can imagine is something that drops a record into the database each time a user visits a thread. I suppose there could be a 'mark all as read' button, which could employ a time stamp to help lessen the sprawl in the database... regardless this isn't a solution that impresses me.
我有一种感觉,我在这里想念一些东西……也许感恩节的早晨不是时候考虑一个人的编程问题。
I have a feeling that I'm missing something here... maybe Thanksgiving morning isn't the time to think over one's programming problems.
对此是否有更好的解决方案?有想法吗?
Is there a better solution out there for this? Any ideas?
- 为每个用户线程组合在数据库中删除一条记录
- 或将此信息存储在文件中-每个用户一个文件。如果允许同一用户多次登录,则可能需要锁定/解锁。