Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3794048
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:52:11+00:00 2026-05-19T12:52:11+00:00

How would you allow users in sites such as a forum/blog comments .etc mark

  • 0

How would you allow users in sites such as a forum/blog comments .etc mark content as spam or abusive? I know you can use services such as askimet and create Bayesian spam filter classes, but what would be the best way to implement a system that allows users to report content?

Would you add an extra field to the item table called spam and/or flagged and how would you differentiate betweeen the two? Basically how would you set up such a system, what would be the database structure?

Is there something that does this already in php?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T12:52:12+00:00Added an answer on May 19, 2026 at 12:52 pm

    Database

    You’d want to keep detailed track of who flagged each post, but you’d also probably want to allow multiple people to flag a post as well. If one person flags a post, their judgment could be questionable, but if 20 people flag it, you immediately know there’s an issue.

    I’d create a table that looks something like this:

    flag_seq | post_id | flagger_username |       timestamp     |       user_notes      | active
    ============================================================================================
           1 |    1431 |          joebob1 | 2010-01-25 13:41:12 | it's spam             | TRUE
           2 |    1431 |      i_hate_spam | 2010-01-25 14:01:23 | You know I hate spam. | TRUE
           3 |    2283 |          joebob1 | 2010-01-24 08:09:57 | vulgar language       | TRUE
    

    Keeping track of each flag individually will allow you to do some more advanced things from a administration or moderation level.

    • You can keep track of who’s flagging stuff (in case someone is abusing that feature i.e. joebob1 doesn’t like *i_hate_spam* so they keep flagging their posts as offensive).
    • You can do a quick count by doing SELECT COUNT(*) FROM flag_table WHERE post_id = '1431'.
    • You can remove certain flags individually by targeting the flag_seq of the flagged post.
    • Give the user the ability to include their own comments so you know exactly what and why they’re reporting this. You could opt to give them predefined options in a <select> box as well.
    • Setting an active flag, you never delete your flags even after they’ve been dealt with. This is useful for taking stats on flagged posts. You can use this information to justify more moderation staff or justify a time commitment to researching new methods of fighting spam, etc.

    Flag this post

    Once you have your database set up, you would simply need to put a “Flag this post” link somewhere on each post. Link this to a form that submits to your newly created database. Be sure to sanitize your data properly before inserting it into your database using mysql_real_escape_string or pg_escape_string or by using prepared statements.

    Moderation

    You can do a handful of different things once a post is flagged.

    • You could write a cron that will check the amount of flags on each post and take certain actions at certain thresholds.
    • You could write a moderation page that lists all active flags with different ways to handle them. (e.g. Delete the post, edit the post, ban the poster, all of the above, etc.)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to add some functionality to a site that would allow users to
I would like to create a simple file format/DSL which would allow my users
How would I only allow users authenticated via Python code to access certain files
I would like to allow users to call my ruby on rails app as
I have a ASP.NET 3.5 web application and I would like to allow users
I'm using CKEditor and would like to be able to allow users to upload
I would like to allow users to post HTML to a site but need
I would like to allow only mobile devices on my web site, such as
Lots of sites today have APIs that allow users to get data from the
My app allows users to embed videos from popular sites like youtube, etc. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.