Admin Note — Moderation and Approval
This page is for information only. There is no approve button on this page, so that no one without access can publish content. Approval and rejection are done only by changing flags directly in the database.
Automated moderation (v1 scorer)
Every new question, answer and discussion comment is scored by inc/moderation.php — a deterministic, rules-based scorer that runs offline in PHP. Honest note: it does not call any external AI API. It is the v1 automated-moderation layer; a future version may replace it with a real model API.
It scores: spam keywords/phrases, number of links, contact solicitation (phone / WhatsApp / Telegram), promotional link patterns, ALL-CAPS shouting, excessive emojis/symbols, very short gibberish / repeated characters / repeated words, and duplicate or near-duplicate text.
- Score ≥ 80 — AUTO-REJECT: not published, never shown publicly. Logged to the
rejected_itemstable with score and reasons. The user sees only a generic "could not be published due to our spam policy" message — scoring details are never revealed to the submitter. - Score 40–79 — PENDING: held for manual review, not public until approved via DB flag.
- Score < 40 — PUBLISH: clean content goes live immediately, with no manual wait.
To tune: edit the weights and keyword list in inc/moderation.php (constants MOD_REJECT_AT / MOD_PENDING_AT), then re-run the test cases in README.md.
What stays pending
- Questions: from ask.php, saved in
postswithstatus='pending'— not shown on home, category or search. - Answers: saved in
answerswithstatus='pending'— not shown on the question page. - Comments: saved in
commentswithstatus='pending'— not shown in the discussion section.
Manual steps
- Open the SQLite database on the server:
sqlite3 data/indiaask.sqlite - View pending content:
SELECT id, title, status FROM posts WHERE status='pending';SELECT id, post_id, author, substr(body,1,80) FROM answers WHERE status='pending';SELECT id, post_id, author, substr(body,1,80) FROM comments WHERE status='pending'; - After checking, approve only correct, original, policy-compliant content:
UPDATE posts SET status='published' WHERE id=123;UPDATE answers SET status='approved' WHERE id=45;UPDATE comments SET status='approved' WHERE id=67; - View auto-rejected items (never approve these from this list without re-checking — they were rejected for a scored reason):
SELECT id, item_type, author, score, reasons FROM rejected_items ORDER BY id DESC;
To delete a wrong item:DELETE FROM answers WHERE id=45;
Rule: never approve abusive, misleading, defamatory, copyrighted or rumour-spreading content.