Category Management
Overview
The Category Management page is the central hub for creating, editing, and managing content categories in ComusThumbz. Categories organize galleries, videos, and webcam content into browsable sections for the frontend. This page provides comprehensive category administration including image uploads with cropping, statistics tracking, and detailed configuration options for traffic management, content types, and submission settings.
Location: Navigate to Admin Panel → Categories or directly from the Dashboard
[Screenshot: categories-main-grid-view]
Getting to This Page
- Log into the Admin Panel
- From the Dashboard (
main.php), click on Categories in the navigation - Alternatively, click the Categories link in the sidebar menu
- Direct URL:
ct/admin/categories.php
This page has three distinct modes:
- Grid/Table View - Default view showing all categories
- Edit Mode - Full category configuration (accessed via Edit button)
- Crop Mode - Image cropping interface (accessed after uploading an image)
System Requirements
This page requires the following system dependencies to function properly.
PHP Requirements
Required PHP Extensions
Required PHP Functions
Folder Permissions
Features & UI Elements
Page Header
[Screenshot: categories-page-header]
Statistics Dashboard
[Screenshot: categories-stats-dashboard]
Eight statistic cards display overall category metrics:
- Regular Clicks (TGP Clicks, Video Clicks): These can be manipulated/overridden values for display purposes
- True Clicks: Actual click tracking data from tblClickTracking - more accurate for analytics
Action Bar
[Screenshot: categories-action-bar]
View Controls
Column Customizer (Table View Only)
[Screenshot: categories-column-customizer]
An expandable accordion that allows customizing which columns appear in table view:
Available Columns:
- Image, Category Name (mandatory), Galleries, Videos, Approved
- TGP Clicks, TGP True Clicks, Video Clicks, Video True Clicks, Camgirls True Clicks
- Thumb Size, Max Galleries, Content Types, Status, Actions (mandatory)
Card View
[Screenshot: categories-card-view]
Each category card displays:
Card Image Section
- Category Image - If uploaded, displays the cropped category image
- Placeholder Icon - Folder icon if no image uploaded
Card Body
Card Actions
Table View
[Screenshot: categories-table-view]
Compact list format with customizable columns:
Edit Mode
[Screenshot: categories-edit-mode]
The full category editor is accessed by clicking Edit Category on any category card or clicking the category name in table view.
Basic Settings Section
Content Types Section
Traffic Settings Section
Submission Settings Section
Advanced Settings Section
Skim Settings Section (Future Use)
Crop Mode
[Screenshot: categories-crop-mode]
After uploading an image, the crop interface appears:
Crop Canvas
- Source Image - Displayed with max 800px width
- Dark Overlay - Covers non-selected areas
- Selection Box - Green-bordered selection area
- Aspect Ratio Lock - Selection maintains $CATWSIZE:$CATHSIZE ratio
Preview Panel
- Live Preview - Real-time preview at target dimensions
- Dimensions Display - Shows target size (e.g., "260×400px")
Crop Controls
How to Crop
- Click and drag on the source image to define selection
- The aspect ratio is automatically maintained
- Watch the preview update in real-time
- Click Save Cropped Image when satisfied
Step-by-Step Usage
Adding a New Category
- Navigate to Admin Panel → Categories
- In the Action Bar, type the new category name
- Click Add Category
- Success message confirms creation
- New category appears in the grid with default settings
Editing a Category
- Find the category in grid or table view
- Click Edit Category button
- Modify desired settings in each section
- Click Save Changes at the bottom
- Redirected back to category list with success message
Uploading a Category Image
- Click Add Image (or Change Image) on a category card
- Modal opens with file selector
- Choose JPG, PNG, or GIF image
- Click Upload and Crop
- Crop interface loads with your image
- Draw selection box to define crop area
- Preview updates in real-time
- Click Save Cropped Image
- Redirected to category list with success message
Deleting a Category Image
- Find category with existing image
- Click Delete Image button
- Confirm the deletion
- Image is removed, placeholder icon appears
Deleting a Category
- Find the category to delete
- Click Delete Category (orange button)
- Read the confirmation warning carefully
- Confirm deletion
- Category and its image are permanently removed
Deleting a category does NOT delete associated galleries or videos. Content remains in the database but loses its category association. You may want to reassign content before deleting categories.
Refreshing Statistics
- Click Update Stats button in action bar
- Wait for calculation to complete (may take several seconds with large datasets)
- Success message confirms update
- All statistics cards refresh with new values
Statistics are cached for 1 hour (3600 seconds) in
ct/dat/cstats.dat. The cache is automatically refreshed when it expires or when you click Update Stats.
Switching Between Views
- Use the Cards / Table toggle buttons
- View preference is saved to localStorage
- Table view shows column customizer accordion
- Drag columns to reorder, check/uncheck to show/hide
- Click Apply to save column configuration
Statistics Explained
Gallery Statistics
Video Statistics
Webcam Statistics
Image Processing
File Handling Workflow
- Upload → File saved to
ct/images/cats/astempcat{id}{timestamp}.{ext} - Crop → User defines selection area on canvas
- Process → GD library extracts and resizes selection
- Save → Final image saved as
cat{id}.jpgwith 85% JPEG quality - Cleanup → Temporary file deleted
- Database →
categoryimagecolumn updated
Supported Formats
Output Specifications
Troubleshooting
Common Errors
"Connection failed"
Cause: Database connection error
Solution:
- Verify database credentials in
ct/dat/config.inc.php - Check MySQL service is running
- Verify database user has SELECT, INSERT, UPDATE, DELETE permissions
"Error updating category"
Cause: SQL UPDATE query failed
Solution:
- Check database connection
- Verify tblCategories has all required columns
- Check for database locks or quota issues
Image not displaying after upload
Cause: File permissions or path issues
Solution:
- Verify
ct/images/cats/folder exists and is writable (755) - Check the
categoryimagevalue in database matches actual filename - Verify image file exists at expected path
"Failed to move uploaded file"
Cause: PHP upload or permission issue
Solution:
- Check
uploadmaxfilesizeandpostmaxsizein php.ini - Verify
ct/images/cats/is writable by web server - Check available disk space
Crop not saving correctly
Cause: GD library issue or coordinate calculation error
Solution:
Verify GD extension is installed and enabled
- Check PHP memorylimit is sufficient (128M+)
- Ensure source image loaded correctly before cropping
Statistics not updating
Cause: Cache not invalidating or calculation error
Solution:
- Click Update Stats to force recalculation
- Delete
ct/dat/cstats.datmanually to clear cache - Check for database query errors in PHP logs
Category not appearing on frontend
Cause: Category may be hidden or have no content
Solution:
- Check the Hide checkbox is unchecked in Edit mode
- Verify category has content (galleries/videos) assigned
- Check content type toggles (Gallery Support, Video Support) are enabled
Performance Issues
Page loads slowly
Solutions:
- Statistics calculation can be slow with many categories/content
- Use cached statistics (automatic after first load)
- Reduce number of categories if possible
- Ensure database indexes exist on tblTgp.category and tblVideoCategories.categoryid
JavaScript Features
LocalStorage Keys
Client-Side Functions
Drag and Drop
The column customizer supports full drag-and-drop reordering:
- Drag handle icon on each column item
- Visual feedback during drag operation
- Automatic index recalculation on drop
Translatable Strings
The following strings should be added to backendtranslations.md:
categoriestitle = "Category Management"
categoriesbreadcrumb = "Categories"
categoriesbackdashboard = "Back to Dashboard"
categoriesgalleries = "Galleries"
categoriesvideos = "Videos"
categoriesmodels = "Models"
categoriesoverallstats = "Overall Statistics"
categoriestotalcategories = "Total Categories"
categoriestotalgalleries = "Total Galleries"
categoriestotalvideos = "Total Videos"
categoriestgpclicks = "TGP Clicks"
categoriestgptrueclicks = "TGP True Clicks"
categoriesvideoclicks = "Video Clicks"
categoriesvideotrueclicks = "Video True Clicks"
categoriescamgirlstrueclicks = "Camgirls True Clicks"
categoriesaddcategory = "Add Category"
categoriesaddcategoryplaceholder = "Enter new category name..."
categoriesupdatestats = "Update Stats"
categoriesviewoptions = "View Options"
categoriesviewcards = "Cards"
categoriesviewtable = "Table"
categoriescustomizecolumns = "Customize List Columns"
categoriescolumndraginfo = "Drag items to reorder. Check/uncheck to show/hide columns. Yellow items are mandatory."
categoriesapply = "Apply"
categoriesresetdefault = "Reset to Default"
categorieseditcategory = "Edit Category"
categoriesaddimage = "Add Image"
categorieschangeimage = "Change Image"
categoriesdeleteimage = "Delete Image"
categoriesdeletecategory = "Delete Category"
categoriesuploadcategoryimage = "Upload Category Image"
categoriesuploadinstructions = "Select an image to upload. You'll be able to crop it to {width}x{height}px after upload."
categoriesallowedformats = "Allowed formats:"
categoriesuploadandcrop = "Upload and Crop"
categoriescancel = "Cancel"
categoriescropimage = "Crop Image for Category"
categoriescropinstructions = "Draw a selection box on the image below. The selected area will be resized to {width} x {height} pixels."
categoriespreview = "Preview"
categoriessavecropped = "Save Cropped Image"
categoriesedittitle = "Edit Category"
categoriesbasicsettings = "Basic Settings"
categoriescategoryname = "Category Name"
categoriesthumbnailwidth = "Thumbnail Width"
categoriesthumbnailheight = "Thumbnail Height"
categoriesmaxgalleries = "Max Galleries"
categoriescontenttypes = "Content Types"
categoriesgallerysupport = "Gallery Support"
categoriesvideosupport = "Video Support"
categorieswebcamssupport = "Webcams Support"
categoriestrafficsettings = "Traffic Settings"
categoriesclickperiod = "Click Period (hours)"
categoriesholdperiod = "Hold Period (hours)"
categoriesshave = "Shave %"
categoriesshave1 = "Shave1 %"
categoriesimmune = "Immune"
categoriesspin = "Spin"
categorieshide = "Hide"
categoriessubmissionsettings = "Submission Settings"
categoriesmaxsubmits = "Max Submits"
categoriesentrypage = "Entry Page"
categorieslocked = "Locked"
categorieshosted = "Hosted"
categoriesnotrade = "No Trade"
categoriesadvancedsettings = "Advanced Settings"
categoriessubcategory = "Subcategory"
categoriesalternate = "Alternate"
categorieskeywords = "Keywords"
categoriesoverlay = "Overlay"
categoriesdefaultoverlayon = "Default Overlay On"
categoriescensorthumbnail = "Censor Thumbnail"
categorieskeepbest = "Keep Best"
categoriesskimsettings = "Skim Settings"
categoriesskimurl = "Skim URL"
categoriesskimpercent = "Skim Percent"
categoriestextskimurl = "Text Skim URL"
categoriestextskimpercent = "Text Skim Percent"
categoriessavechanges = "Save Changes"
categoriesfutureuse = "(For Future Use)"
categoriessuccessadded = "Category '{name}' added successfully!"
categoriessuccessupdated = "Category updated successfully!"
categoriessuccessimagesaved = "Category image saved successfully!"
categoriessuccessimagedeleted = "Category image deleted successfully!"
categoriessuccessdeleted = "Category '{name}' deleted successfully!"
categoriessuccessstatsupdated = "Statistics updated successfully!"
categoriesconfirmdeleteimage = "Delete this category image?"
categoriesconfirmdelete = "Are you sure you want to delete this entire category? This will remove the category and its image. This action cannot be undone."
categorieserrorupdating = "Error updating category"
categoriesapproved = "Approved"
categoriesthumbsize = "Thumb Size"
categoriescontenttypescol = "Content Types"
categoriesstatus = "Status"
categoriesactions = "Actions"
Version History
Related Documentation
- Gallery Administration (admin.md) - Gallery management
- Video Administration (video.admin.md) - Video management
- Models Administration (models.md) - Model management
- Click Tracking - Click tracking system