php - Reporting spam or abuse -


how allow users in sites such forum/blog comments .etc mark content spam or abusive? know can use services such askimet , create bayesian spam filter classes, best way implement system allows users report content?

would add field item table called spam and/or flagged , how differentiate betweeen two? how set such system, database structure?

is there in php?

database

you'd want keep detailed track of flagged each post, you'd want allow multiple people flag post well. if 1 person flags post, judgment questionable, if 20 people flag it, know there's issue.

i'd create table looks 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 | know hate spam. | true        3 |    2283 |          joebob1 | 2010-01-24 08:09:57 | vulgar language       | true 

keeping track of each flag individually allow more advanced things administration or moderation level.

  • you can keep track of who's flagging stuff (in case abusing feature i.e. joebob1 doesn't *i_hate_spam* keep flagging posts offensive).
  • you can quick count doing select count(*) flag_table post_id = '1431'.
  • you can remove flags individually targeting flag_seq of flagged post.
  • give user ability include own comments know , why they're reporting this. opt give them predefined options in <select> box well.
  • setting active flag, never delete flags after they've been dealt with. useful taking stats on flagged posts. can use information justify more moderation staff or justify time commitment researching new methods of fighting spam, etc.

flag post

once have database set up, need put "flag post" link somewhere on each post. link form submits newly created database. sure sanitize data before inserting database using mysql_real_escape_string or pg_escape_string or using prepared statements.

moderation

you can handful of different things once post flagged.

  • you write cron check amount of flags on each post , take actions @ thresholds.
  • you write moderation page lists active flags different ways handle them. (e.g. delete post, edit post, ban poster, of above, etc.)

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -