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
- Alternatively, navigate directly to
commentsadmin.php
The Comments Moderation page aggregates comments from three separate tables (tblVideoComments, tblModelComments, tblCamComments) into a single unified interface for efficient moderation.
System Requirements
This page requires the following system dependencies to function properly.
PHP Requirements
Required PHP Extensions
Required PHP Functions
Folder Permissions
Network Requirements
Features & UI Elements
Page Header
[Screenshot: comments-admin-header]
Statistics Bar
[Screenshot: comments-admin-stats-bar]
The statistics bar displays four stat cards showing pending comment counts:
Filters Bar
[Screenshot: comments-admin-filters]
Comments Table
[Screenshot: comments-admin-table]
Status Badges
Content Type Badges
Action Buttons
Pagination
[Screenshot: comments-admin-pagination]
Toast Notifications
[Screenshot: comments-admin-toast]
Step-by-Step Usage
Reviewing Pending Comments
- Navigate to Admin Panel → Comments
- The page loads with Pending filter selected by default
- Review each comment in the table
- Click Approve to make the comment visible
- Click Reject to hide the comment
- Click Delete to soft-delete the comment
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
- 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
- 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
- Click the checkbox in the header row to Select All visible comments
- Or click individual checkboxes to select specific comments
- 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
- A toast notification confirms the action
- The page automatically reloads after 1 second
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
- The Content column shows a link to the related content
- Click the link to open the video/model/performer page in a new tab
- For video comments: Opens videoplayer.php?id=X
- For model comments: Opens modeldetails.php?id=X
- 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
- The parentid column tracks the threading relationship
AJAX Actions
Available Actions
Response Format
{
"success": true,
"message": "Comment approved"
}
{
"success": false,
"error": "Invalid comment ID"
}
Security Features
CSRF Protection
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
Error Handling
Troubleshooting
Common Errors
"Security validation failed. Please refresh the page and try again."
Cause: CSRF token expired or mismatched
Solution:
- Refresh the page to get a new CSRF token
- Check if session has expired (re-login if needed)
- Ensure cookies are enabled
"Invalid content type"
Cause: The contenttype parameter is not 'video', 'model', or 'cam'
Solution:
- Use only the provided filter options
- Don't manually modify URL parameters
"Invalid comment ID"
Cause: No comment ID provided or ID is 0
Solution:
- Click action buttons from the table rows
- Ensure JavaScript is enabled
"No comments selected"
Cause: Attempting bulk action with no checkboxes selected
Solution:
- Select at least one comment checkbox
- Use the header checkbox to select all
Comments not appearing after approval
Cause: Frontend may cache comment lists
Solution:
- Clear browser cache
- Check frontend comment display logic
- Verify the status was actually updated (check "Approved" filter)
Debug Tips
- Check browser console - JavaScript errors appear here
- Check Network tab - AJAX requests and responses
- Verify database - Query comment tables directly to confirm status changes
- Check error logs - PHP errors logged to server error log
Database Schema Reference
tblVideoComments
tblModelComments
Same schema as tblVideoComments, except:
modelidinstead ofvideoid
tblCamComments
Same schema as tblVideoComments, except:
performername(VARCHAR 255) instead of content IDperformersite(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
Related Documentation
- Video Administration - Managing video content
- Models Administration - Managing model profiles
- Users Administration - Managing user accounts
- API Comments Endpoint - REST API for comments