ComusThumbz Documentation
Admin Login

Comments Moderation

Overview

The Comments Moderation page (commentsadmin.php) is a centralized administration interface for managing user comments across three content types: Videos, Models, and Cam Performers. It provides a unified dashboard with statistics, filtering capabilities, individual comment actions (approve, reject, delete), bulk operations for processing multiple comments simultaneously, and real-time AJAX updates without page reloads.

Location: Navigate to Admin Panel → Comments or access from the Dashboard navigation.

[Screenshot: comments-admin-main-view]


Getting to This Page

Log in to the Admin PanelFrom the Dashboard, click Comments in the navigation

  1. Alternatively, navigate directly to commentsadmin.php

 

Note:
The Comments Moderation page aggregates comments from three separate tables (tblVideoComments, tblModelComments, tblCamComments) into a single unified interface for efficient moderation.

 


System Requirements

 

Configuration Required:
This page requires the following system dependencies to function properly.

 

PHP Requirements

Requirement Minimum Recommended Notes
PHP Version 8.0 8.2+ Uses strict types, null coalescing
memorylimit 64M 128M For large comment datasets
maxexecutiontime 60 120 For bulk operations

Required PHP Extensions

Extension Required Purpose
mysqli Yes Database connectivity
session Yes CSRF protection, authentication
json Yes AJAX response encoding
mbstring Yes Multi-byte string handling

Required PHP Functions

Function Required For Notes
mysqliconnect() Database connection Core
jsonencode() AJAX responses Core
bin2hex() CSRF token generation Security
randombytes() CSRF token generation Security
hashequals() CSRF validation Security

Folder Permissions

Folder Permission Purpose
ct/admin/ 755 (read/execute) Page access

Network Requirements

Endpoint Protocol Purpose
Font Awesome CDN HTTPS Icon library (6.5.1)

Features & UI Elements

Page Header

[Screenshot: comments-admin-header]

Element Description
Title "Comments Moderation" with comments icon
Breadcrumb Dashboard → Comments navigation path
Back to Dashboard Returns to main.php
Users Button Quick link to users.php
Videos Button Quick link to video.admin.php

Statistics Bar

[Screenshot: comments-admin-stats-bar]

The statistics bar displays four stat cards showing pending comment counts:

Stat Card Icon Description
Pending Total Clock Total pending comments across all types
Video Comments Video Pending video comments count
Model Comments User Pending model comments count
Cam Comments Broadcast Pending cam performer comments count
Tip: Monitor the Pending Total stat card regularly. High pending counts may indicate spam or require immediate attention.

Filters Bar

[Screenshot: comments-admin-filters]

Element Options Description
Status Filter Pending, Approved, Rejected, Deleted, All Filter by comment status
Content Type Filter All Types, Videos, Models, Cam Performers Filter by content type
Approve Selected Button Bulk approve selected comments
Reject Selected Button Bulk reject selected comments
Delete Selected Button Bulk delete selected comments

Comments Table

[Screenshot: comments-admin-table]

Column Description
Checkbox Select individual comments for bulk actions
Type Color-coded badge (Video=blue, Model=purple, Cam=yellow)
User Username and email of commenter
Comment Comment text content (truncated for long comments)
Content Link to the related video, model, or performer
Status Current status badge (Pending, Approved, Rejected, Deleted)
Date Comment creation date and time
Actions Approve, Reject, Delete buttons (context-sensitive)

Status Badges

Status Color Description
Pending Yellow/Orange Awaiting moderation
Approved Green Visible to public
Rejected Red Hidden, not visible
Deleted Gray Soft-deleted

Content Type Badges

Type Color Description
Video Blue Comment on a video
Model Purple Comment on a model profile
Cam Yellow Comment on a cam performer

Action Buttons

Button Color Action
Approve Green Set status to 'approved'
Reject Orange Set status to 'rejected'
Delete Red Set status to 'deleted' (soft delete)
Note: Actions are performed via AJAX - the page updates in real-time without requiring a full reload.

Pagination

[Screenshot: comments-admin-pagination]

Element Description
Previous Navigate to previous page
Page Numbers Shows current page and nearby pages
Next Navigate to next page
25 per page Fixed pagination size

Toast Notifications

[Screenshot: comments-admin-toast]

Type Color When Shown
Success Green Action completed successfully
Error Red Action failed

Step-by-Step Usage

Reviewing Pending Comments

  1. Navigate to Admin Panel → Comments
  2. The page loads with Pending filter selected by default
  3. Review each comment in the table
  4. Click Approve to make the comment visible
  5. Click Reject to hide the comment
  6. Click Delete to soft-delete the comment

 

Tip:
Start with the oldest pending comments first - they're sorted by date with newest at top, but users waiting longer for approval may become frustrated.

 

Filtering Comments

  1. Use the Status dropdown to filter by status:
  • Pending - Comments awaiting moderation
  • Approved - Publicly visible comments
  • Rejected - Hidden comments
  • Deleted - Soft-deleted comments
  • All - Show all statuses
  1. Use the Content Type dropdown to filter by type:
  • All Types - Show all content types
  • Videos - Only video comments
  • Models - Only model comments
  • Cam Performers - Only cam comments

Bulk Operations

  1. Click the checkbox in the header row to Select All visible comments
  2. Or click individual checkboxes to select specific comments
  3. Click one of the bulk action buttons:
  • Approve Selected - Approve all selected comments
  • Reject Selected - Reject all selected comments
  • Delete Selected - Delete all selected comments
  1. A toast notification confirms the action
  2. The page automatically reloads after 1 second

 

Warning:
Bulk operations are processed by content type. If you select comments from multiple types (Video, Model, Cam), each type is processed separately.

 

Viewing Comment Content

  1. The Content column shows a link to the related content
  2. Click the link to open the video/model/performer page in a new tab
  3. For video comments: Opens videoplayer.php?id=X
  4. For model comments: Opens modeldetails.php?id=X
  5. For cam comments: Shows performer name (no link)

Identifying Reply Threads

Look for "Reply to #123" text below the comment contentThis indicates the comment is a reply to another comment

  1. The parentid column tracks the threading relationship

AJAX Actions

Available Actions

Action HTTP Method Parameters Response
approve POST commentid, contenttype, csrftoken JSON success/error
reject POST commentid, contenttype, csrftoken JSON success/error
delete POST commentid, contenttype, csrftoken JSON success/error
harddelete POST commentid, contenttype, csrftoken JSON success/error
bulkapprove POST commentids[], contenttype, csrftoken JSON success/error
bulkreject POST commentids[], contenttype, csrftoken JSON success/error
bulkdelete POST commentids[], contenttype, csrftoken JSON success/error

Response Format

{
    "success": true,
    "message": "Comment approved"
}
{
    "success": false,
    "error": "Invalid comment ID"
}

Security Features

CSRF Protection

 

Configuration Required:
All POST requests require a valid CSRF token. The token is:
  • Generated using bin2hex(randombytes(32))
  • Stored in the PHP session
  • Validated using hashequals() for timing-safe comparison
  • Logged on failure with IP address

 

Input Validation

Parameter Validation
commentid Cast to integer, must be > 0
contenttype Must be 'video', 'model', or 'cam'
commentids[] Array of integers
action Must match defined action list

Error Handling

Scenario HTTP Code Response
CSRF failure 403 Security validation failed
Invalid content type 200 Invalid content type error
Invalid comment ID 200 Invalid comment ID error
Empty bulk selection 200 No comments selected error
Database error 200 Action failed message

Troubleshooting

Common Errors

 

Error:
"Security validation failed. Please refresh the page and try again."


Cause: CSRF token expired or mismatched
Solution:

  1. Refresh the page to get a new CSRF token
  2. Check if session has expired (re-login if needed)
  3. Ensure cookies are enabled

 

 

Error:
"Invalid content type"


Cause: The contenttype parameter is not 'video', 'model', or 'cam'
Solution:

  1. Use only the provided filter options
  2. Don't manually modify URL parameters

 

 

Error:
"Invalid comment ID"


Cause: No comment ID provided or ID is 0
Solution:

  1. Click action buttons from the table rows
  2. Ensure JavaScript is enabled

 

 

Error:
"No comments selected"


Cause: Attempting bulk action with no checkboxes selected
Solution:

  1. Select at least one comment checkbox
  2. Use the header checkbox to select all

 

 

Warning:
Comments not appearing after approval


Cause: Frontend may cache comment lists
Solution:

  1. Clear browser cache
  2. Check frontend comment display logic
  3. Verify the status was actually updated (check "Approved" filter)

 

Debug Tips

  1. Check browser console - JavaScript errors appear here
  2. Check Network tab - AJAX requests and responses
  3. Verify database - Query comment tables directly to confirm status changes
  4. Check error logs - PHP errors logged to server error log

Database Schema Reference

tblVideoComments

Column Type Description
commentid INT(11) PK Unique comment identifier
videoid INT(11) Reference to tblVideos
userid INT(11) Reference to tblCMSUsers (nullable for guests)
parentid INT(11) Parent comment for replies
comment TEXT Comment content
likescount INT(11) Number of likes
dislikescount INT(11) Number of dislikes
replycount INT(11) Number of replies
isedited TINYINT(1) Whether comment was edited
editedat DATETIME When comment was edited
ispinned TINYINT(1) Whether comment is pinned
isflagged TINYINT(1) Whether comment is flagged
status ENUM pending, approved, rejected, deleted
ipaddress VARCHAR(45) Commenter's IP address
useragent VARCHAR(255) Commenter's browser info
createdat DATETIME Creation timestamp
updatedat TIMESTAMP Last update timestamp

tblModelComments

Same schema as tblVideoComments, except:

  • modelid instead of videoid

 

tblCamComments

Same schema as tblVideoComments, except:

  • performername (VARCHAR 255) instead of content ID
  • performersite (INT 11) for cam site reference

 


Translatable Strings

The following strings should be added to backendtranslations.md:

commentsadmintitle = "Comments Moderation"
commentsadminbreadcrumb = "Comments"
commentsadminback = "Back to Dashboard"
commentsadminusers = "Users"
commentsadminvideos = "Videos"
commentsadminpendingtotal = "Pending Total"
commentsadminvideocomments = "Video Comments"
commentsadminmodelcomments = "Model Comments"
commentsadmincamcomments = "Cam Comments"
commentsadminstatus = "Status:"
commentsadmincontenttype = "Content Type:"
commentsadminstatuspending = "Pending"
commentsadminstatusapproved = "Approved"
commentsadminstatusrejected = "Rejected"
commentsadminstatusdeleted = "Deleted"
commentsadminstatusall = "All"
commentsadmintypeall = "All Types"
commentsadmintypevideos = "Videos"
commentsadmintypemodels = "Models"
commentsadmintypecams = "Cam Performers"
commentsadminapproveselected = "Approve Selected"
commentsadminrejectselected = "Reject Selected"
commentsadmindeleteselected = "Delete Selected"
commentsadmincoltype = "Type"
commentsadmincoluser = "User"
commentsadmincolcomment = "Comment"
commentsadmincolcontent = "Content"
commentsadmincolstatus = "Status"
commentsadmincoldate = "Date"
commentsadmincolactions = "Actions"
commentsadminbtnapprove = "Approve"
commentsadminbtnreject = "Reject"
commentsadminbtndelete = "Delete"
commentsadminnocomments = "No comments found matching your filters."
commentsadminguest = "Guest"
commentsadminreplyto = "Reply to"
commentsadminvideolink = "Video"
commentsadminmodellink = "Model"
commentsadminprevious = "Previous"
commentsadminnext = "Next"
commentsadmintoastapproved = "Comment approved"
commentsadmintoastrejected = "Comment rejected"
commentsadmintoastdeleted = "Comment deleted"
commentsadmintoastfailed = "Action failed"
commentsadmintoastselectone = "Please select at least one comment"
commentsadminbulkapproved = "Approved {count} comments"
commentsadminbulkrejected = "Rejected {count} comments"
commentsadminbulkdeleted = "Deleted {count} comments"
commentsadmincsrferror = "Security validation failed. Please refresh the page and try again."
commentsadmininvalidtype = "Invalid content type"
commentsadmininvalidid = "Invalid comment ID"
commentsadminno_selection = "No comments selected"

Version History

Version Date Changes
1.0.0 2025-12-08 Initial release with multi-table comment moderation