Pergunta

Introduction

I am designing a social networking website for college students. To facilitate moderation, some students will be designated as moderators with elevated abilities to delete inappropriate posts and review flagged content.

Question

When a moderator finds a post or an event page that is inappropriate - how should the website proceed to hide or delete it without breaking the entire application?

Background

The issue becomes increasingly difficult when event pages need to be deleted but the page is linked to possibly couple thousand users. Connected users should have the ability to know an event page was deleted - so there would be no confusion.

An ability to "undo" deletion would be a huge plus. Since students will be the ones moderating, I would want the ability for superusers (i.e. website admins) to override moderator actions.

Considerations

  • The backend is run on MySQL with the Innodb engine.
  • Data integrity is important:
    • Foreign keys come into mind - but as it currently stands - the database schema does not employ them.
    • Deleted posts/pages should not come up in general search.
  • The ability to "undo" a delete action is preferable. Deleting an entire event page could ensue anger from the masses.

Current Solution

When content is found to violate the terms of use - add a special flag in the database (i.e. column status is changed to 1 -> indicating "inappropriate"). Content is then hidden according to this flag.

However - how does this tactic work in the whole scheme of a RELATIONAL database? Especially when it comes to search?

Case Study

Users can search and view all events that their friends are attending.

Table: Users

user_id
name

Table: Events

event_id
event_name
datetime
status (0 -> okay, 1 -> hide)

Table: Users_events

user_id
event_id

Issue with the Current Solution

How should the website filter out all the hidden or flagged content? Should there be a special covering index?

Conclusion

Designig a social networking website that has advanced moderation capabilities. How to flag content and hide potentially harmful and abusive posts/event pages while maintaining integral relationships in the database? How to optimize search to show only approved (non-flagged content?

Foi útil?

Solução

You have the right approach.

By setting a status value and coding the application so that it behaves differently based on the value of the status, you preserve the integrity of the data and get the behavior you want.

Your searches, when you want just visible entries, just have to have "WHERE status = 0" in them so you don't get the ones that are hidden.

One small change - if you are only determining whether to hide or not, a better name for the column is hide. Then the values make sense: 0 is don't hide, and 1 is do hide.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top