Documentación de ComusThumbz
Iniciar Sesión

Gallery Review

Gallery Administration (admin.php)

Overview

The Gallery Administration page (admin.php) is the central hub for managing photo galleries in ComusThumbz. This comprehensive page provides tools for browsing, searching, filtering, reviewing, and batch processing galleries. It features both Card View and List View display modes, advanced filtering capabilities, bulk operations, integrated AI review tools, multi-threading support for background operations, and a full gallery scheduler.

Location: Navigate to Admin Panel → Galleries → Gallery Admin

[Screenshot: gallery-admin-main-view]


System Requirements

PHP Extensions Required

Extension Purpose Required
mysqli Database operations Yes
session Session management for filters/preferences Yes
json JSON encoding for JavaScript data Yes
gd Image processing for thumbnails Yes
curl URL scanning and 404 checks Yes (for scanning)
zlib Export compression (gzopen) Yes (for export)
mbstring Multi-byte string handling Yes

PHP Functions Required

Function Purpose Notes
filegetcontents() URL content fetching Required for scanning
fileputcontents() Temp file operations Required for multi-threading
fopen() / fwrite() Thread control files Required for batch operations
glob() Thread file cleanup Required for multi-threading
ignoreuserabort() Background processing Required for long operations

PHP Version

  • Minimum: PHP 8.0+
  • Recommended: PHP 8.2+

php.ini Settings

# For large galleries and batch operations
memorylimit = 256M
maxexecutiontime = 300
maxinputvars = 10000
postmaxsize = 50M

 

Configuration Required:
Performance Note: Multi-threaded operations require sufficient memory. For sites with 10,000+ galleries, increase memory
limit to 512M.

 

Folder Permissions Required

Folder Permission Purpose
ct/thumbs/ 755 Gallery thumbnail storage
ct/dat/auto/ 775 Multi-threading temp files
ct/dat/auto/0/ - ct/dat/auto/N/ 775 Thread-specific temp folders

Installation Requirements

Database Tables Used

The Gallery Administration page uses the following database tables:

Table Purpose Created By
tblTgp Main gallery table (all gallery data) Core install
tblCategories Category definitions Core install
tblGalleryCategories Multi-category junction table Core install
tblModels Model/performer definitions Core install
tblGalleryModels Gallery-to-model associations Core install
tblSponsors Sponsor definitions Core install
tblSettings System settings Core install
tblContentImpressions Impression tracking Phase 9
tblClickTracking Click analytics Phase 9
tblBlogs Blog post tracking Core install

Config Variables Required

From ct/dat/config.inc.php:

// Database connection
$dbhost = 'localhost';
$db = 'admincomus';
$dbuser = 'youruser';
$dbpasswd = 'yourpassword';

// Site paths
$domain
name = 'yourdomain.com';
$sitepath = '/ct';
$basepath = '/path/to/ct';


// Thumbnail settings
$wsize = 220; // Default thumbnail width
$hsize = 180; // Default thumbnail height
$minimgsize = 5000; // Minimum image size for auto-thumb


// Threading settings
$threads = 4; // Number of parallel threads for batch ops


// Auto-scan robot settings
$thumbstograb = 10; // Max thumbs to grab per gallery
$aspectratio = 0.75; // Thumbnail aspect ratio

 

File Dependencies

PHP Includes:

  • ct/admin/includes/inc.php - Core admin functions
  • ct/includes/scanning.php - URL scanning functions
  • ct/includes/grabthumb.inc.php - Thumbnail grabbing
  • ct/admin/autothumb.php - Auto-thumbnail processing

 

JavaScript:

  • ct/admin/ajaxgalleryupdate.php - AJAX updates
  • ct/admin/ajaxcategoryupdate.php - Category management
  • ct/admin/ajaxmodelupdate.php - Model management

 

CSS:

  • Inline styles for modern card/list view UI
  • Admin green theme styling

 


Features & UI Elements

Header Controls Bar

[Screenshot: gallery-admin-header-controls]

The sticky header contains primary controls:

Element Description
Save Changes Green button - submits all pending gallery edits
Approve Bulk action - sets all visible galleries to Approved
Disapprove Bulk action - sets all visible galleries to Disapproved
Delete Bulk action - marks all visible galleries for deletion
Warning: Bulk actions affect ALL galleries in the current search results, not just the visible page. Use with caution on large result sets.

Stats Cards

[Screenshot: gallery-admin-stats-cards]

Five statistic cards display real-time gallery counts:

Card Description
Total Galleries Complete gallery count in database
Pending Review Galleries awaiting moderation
Approved Galleries with Approved/Yes status
Disapproved Rejected galleries
Unreviewed Galleries not yet reviewed

View Toggle & Column Customizer

Button Description
Card View Gallery cards with thumbnail, all fields visible
List View Compact table format with sortable columns
Customize Columns Opens panel to show/hide and reorder list columns
Tip: List View is faster for bulk reviewing large numbers of galleries. Card View provides better visual context for thumbnail quality assessment.

Search & Filter Controls

[Screenshot: gallery-admin-search-filters]

Search Options

Field Description
Search Field Dropdown All Fields, URL Only, Title Only, Description, Keywords, Category, Model, Email, Nickname, IP, Sponsor Code
Search Input Text to search for
Sort By ID, Title, Date Submitted, Clicks, Rating (ascending/descending)
Records Limit 10, 20, 50, 100, 200 records per page
Search Button Execute the search

Toggle Controls

Checkbox Description
Show Stats Display category/status counts
Show Schedule Display 30/60/90 day scheduler grid
Search & Replace Enable search and replace panel
Hide Filters Collapse category/type filter sections

Category Filters

[Screenshot: gallery-admin-category-filters]

Displays all categories with checkboxes. When Show Stats is enabled, shows:

Color Meaning
[Black] Total galleries in category
[Red] Pending galleries in category
[Brown] Galleries with thumbnails

Filter galleries by status and attributes:

Status Filters:

  • Waiting, Pending, Approved, Archived
  • Blacklisted, Disapproved

 

Attribute Filters:

  • Has Photo / No Photo
  • Explicit / Non-Explicit
  • 404 / Has 302
  • Used, On Site, Reviewed/Unreviewed
  • Has Video / No Video
  • Not Resizable, In Starters

 

Special Commands Dropdown

[Screenshot: gallery-admin-special-commands]

Command Description
Detailed Standard gallery view (default)
Bulk Review Grid view for quick mass approval
Delete Delete selected/filtered galleries
Export Export galleries to CSV/text
Export All Export entire database
Blacklist Report Show blacklisted galleries
Keyword Density Analyze keyword frequency
Keyword Popularity Keyword performance analysis
Word Density All-text word frequency
Word Popularity All-text performance analysis
Remove Dupes Find and remove duplicate URLs
Randomize Votes Randomize vote values
Randomize Stats Randomize click statistics
Replace Search and replace in field values

Bulk Actions Panel

Located next to Special Commands:

Action Type Options
Category Add/Remove category to all results
Model Add/Remove model to all results
Flags Set flag on/off for all results
Vote Set vote value for all results
Warning: "Apply to All Results" affects the ENTIRE search result set (not just current page). Always verify your search criteria before applying bulk actions.

[Screenshot: gallery-admin-scheduler]

When Show Schedule is enabled, displays a 30/60/90 day calendar grid:

Display Meaning
Day Number Calendar day
Gallery Count Number of galleries scheduled for that day
Green Highlight Today's date
Blue Highlight Currently selected date
Orange Days with galleries
ZZ More than 620 galleries (overflow)

Click a day to filter galleries scheduled for that date.


[Screenshot: gallery-card-view-detail]

Each gallery card contains:

Card Header

  • Checkbox - Select for bulk operations
  • [ID] - Gallery database ID
  • Batch AI - Link to AI batch review
  • Review AI - AI single gallery analysis
  • Quick Actions: Approve (✓), Delete (✗), URL, Scan, Upload, Blog, Ban

Thumbnail Section

  • Gallery thumbnail image (80x60 preview)
  • File size indicator
  • Configured dimensions display

Control Fields

Row Fields
Row 1 Status dropdown, Vote dropdown, Schedule date picker
Row 2 Multi-category selector, Model selector
Row 3 URL input, Title input
Row 4 Description, Description 2
Row 5 Keywords input, Thumbnail filename
Row 6 Checkbox flags (No Ref, No Scan, Overlay, Rotate, Video, Path File, 404, XXX, Rev, Featured)

Statistics Row

  • Clks (period clicks), Tot (total clicks), Min (minimum clicks)
  • Blds (build periods), Days (periods shown), Used, Rating
  • CTR (click-through rate), Reciprocal status

Plus Buttons (+)

Each field has a (+) button to apply that value to ALL galleries on the page.

 

Tip:
Use the (+) buttons to quickly apply the same category, model, keywords, or status to multiple galleries during bulk editing sessions.

 


List View

[Screenshot: gallery-list-view]

Compact table format with sortable columns:

Default Columns

  • Checkbox, ID, Thumbnail, Title, Categories, Status
  • Vote, Pics, Clicks, Impressions, CTR, Rating
  • Reviewed, Explicit, Video, 404, Featured, Date

Column Customization

Click Customize Columns to:

  1. Check/uncheck columns to show/hide
  2. Drag columns to reorder
  3. Yellow items are mandatory (cannot hide)
  4. Click Apply to save changes
  5. Click Reset to Default to restore

 

Sortable Headers

Click any column header to sort. Arrows indicate:

  • ↑ Ascending order
  • ↓ Descending order

Search & Replace

[Screenshot: gallery-search-replace]

When Search & Replace is enabled:

Field Description
Operate On Select field to modify
Replace This Text to find
With This Replacement text

Available Fields: Category, Clicks, Click Power, CPR, CTR, Date, Description, Email, Explicit, Exposure, EPR, ETR, Has Video, Num Pic, IP, Keywords, Last Modified, Nickname, Desc Two, Title, On Site, On Page, Rating, Recip, Reports, Status, Thumb Height, Thumb Size, Thumb Width, Total Clicks, TPR, URL, Src URL, Used, Vote

 

Warning:
Search & Replace operates on ALL galleries matching current filters. Test with a small subset first.

 


Batch Operations

Scanning Operations

Operation Description
Auto Scan Apply auto-hold/restore/delete rules
Auto Scan All Scan entire database
404 Check Test URLs for dead links
302 Check Detect redirect URLs
Scan URLs Audit stats (pics, movies, checksums)

Thumbnail Operations

Operation Description
Auto Thumb Grab thumbnails for galleries without them
Auto Thumb All Re-thumbnail entire database
Resize Resize existing thumbnails to configured size
Resize All Resize all thumbnails

Metadata Operations

Operation Description
Auto Description Extract descriptions from gallery pages
Auto Title Extract titles from gallery pages
Auto Keyword Extract keywords from gallery content
Artificial Age Distribute galleries across schedule

Multi-Threading

Batch operations support multi-threading when $threads > 1 in config:

[Screenshot: gallery-admin-multithreading]

  • Displays thread status (Idle, Processing, Completed)
  • Shows progress: Total to Process, Started, Finished
  • Average speed calculation per gallery
  • Supports Ignore User Abort - operations continue after browser close

 

Note:
Multi-threaded operations create control files in ct/dat/auto/. These are automatically cleaned up on completion.

 


Export Functions

Export Selected

Exports galleries matching current search criteria to:

File Format
export.txt CSV format
export.tar.gz Compressed CSV
export.html Visual thumbnail gallery
exportdata.html HTML table format

Export All

Same formats but exports entire database.

Export Fields

URL, Category, Description, NumPic, Vote, Thumbnail URL, Keywords, Hash, Clicks, Click Periods, Rating, Date, Status, Click Power, Source coords (srcx, srcy, srcw, srch, srcu), Has Video, Explicit, 404 Error, Reviewed, Sponsor Code, Title, Description2, Path As File


Duplicate Removal

The Remove Dupes command:

  1. Scans all galleries for matching URLs
  2. Keeps the most recently modified entry
  3. Deletes older duplicates
  4. Cleans up model and category associations
  5. Displays detailed report:
  • [R] = Removed
  • [S] = Skipped (unique)

 

Warning:
Duplicate removal is permanent. Create a database backup before running on large datasets.

 


AI Integration

Review AI Button

Links to aigalleryreview.php?id={galleryid} for single gallery AI analysis.

Batch AI Button

Links to aibatchreview.php for processing multiple galleries.

Visual Indicators:

  • Green with pulse animation = Not yet reviewed
  • Red = Already reviewed

 

See the AI Gallery Review and AI Batch Review user guides for detailed AI features.


Quick Update Functions

AJAX Quick Actions

Action Behavior
Approve (✓) Sets status to Approved, green flash confirmation
Delete (✗) Removes gallery with fade-out animation

These use AJAX (admin.php with action=quickupdatestatus) for instant updates without page reload.

JavaScript Functions

setapps(status)        // Set all status dropdowns
quickUpdateStatus(id, status, token)  // AJAX single update
applyToAll(id, field)  // Apply field value to all
toggleCardViewSelectAll(checkbox)     // Select/deselect all

Step-by-Step Usage

Finding Galleries

  1. Navigate to Admin Panel → Galleries → Gallery Admin
  2. Select search field (All Fields, URL Only, etc.)
  3. Enter search term
  4. Optionally select category checkboxes
  5. Optionally select gallery type filters
  6. Click Search

Reviewing Galleries

  1. Search for pending galleries (check "Pending" filter)
  2. For each gallery:
  • Review thumbnail and URL
  • Set appropriate status (Approved/Disapproved)
  • Assign categories using multi-category selector
  • Add models if applicable
  • Mark as Explicit if needed
  1. Click Save Changes

Bulk Approval Workflow

  1. Search for galleries to review
  2. Review thumbnails visually
  3. Use Approve bulk action for acceptable galleries
  4. Or select individual galleries and use (+) button on status

Scheduling Galleries

  1. Enable Show Schedule checkbox
  2. Click a future date on the scheduler
  3. Or use the date picker on individual gallery cards
  4. Galleries with future refresh delay appear on scheduled date

Removing Duplicates

  1. Search for galleries (or select all)
  2. Select Remove Dupes from Special Commands
  3. Click Execute
  4. Review the report showing kept vs. removed entries
  5. Click link to continue

Exporting Data

  1. Filter galleries to export (or leave blank for all)
  2. Select Export or Export All
  3. Click Execute
  4. Download from provided links:
  • export.txt - CSV
  • export.tar.gz - Compressed
  • exportdata.html - HTML table

Troubleshooting

Common Errors

 

Error:
"Query preparation failed"


Cause: MySQL syntax error or missing table
Solution: Check that all required tables exist. Run database installation script.

 

 

Error:
"Failed to create directory: ct/dat/auto"


Cause: Permission denied for temp directory
Solution: Set permissions: chmod 775 ct/dat/auto

 

 

Error:
"Cannot write to file"


Cause: Thread control file write failed
Solution: Check folder permissions for ct/dat/auto/0/ through ct/dat/auto/N/

 

 

Error:
Multi-threading stuck on "All slots used"


Cause: Thread workers not responding
Solution:

  1. Clear temp files: Delete all .thd files in ct/dat/auto/
  2. Check that grabthumb.inc.php is accessible via web URL
  3. Verify $domainname and $sitepath in config

 

 

Error:
Thumbnails not displaying


Cause: Incorrect $sitepath or missing files
Solution:

  1. Check ct/thumbs/ folder exists and is readable
  2. Verify thumbnail filenames in database match actual files
  3. Check $sitepath configuration

 

Session Issues

 

Error:
Filters not persisting between page loads


Cause: Session not starting or being destroyed
Solution:

  1. Ensure sessionstart() called before output
  2. Check PHP session configuration
  3. Verify session cookie settings

 

Performance Issues

 

Warning:
Page loads slowly with large galleries


Solutions:

  1. Reduce records per page (use 20 instead of 100)
  2. Disable Show Stats checkbox
  3. Use List View instead of Card View
  4. Add database indexes on frequently filtered columns

 


AJAX Endpoints

Endpoint Method Purpose
admin.php (action=quickupdatestatus) POST Quick status update
ajaxgalleryupdate.php POST Field updates
ajaxcategoryupdate.php POST Category add/remove
ajaxmodelupdate.php POST Model associations

Translatable Strings

The following strings should be added to backendtranslations.md:

galleryadmintitle = "Gallery Administration"
galleryadminsave = "Save Changes"
galleryadminapprove = "Approve"
galleryadmindisapprove = "Disapprove"
galleryadmindelete = "Delete"
galleryadmintotal = "Total Galleries"
galleryadminpending = "Pending Review"
galleryadminapproved = "Approved"
galleryadmindisapproved = "Disapproved"
galleryadminunreviewed = "Unreviewed"
galleryadmincardview = "Card View"
galleryadminlistview = "List View"
galleryadmincustomize = "Customize Columns"
galleryadminsearch = "Search"
galleryadminexecute = "Execute"
galleryadminapplyall = "Apply to All Results"
galleryadminselectall = "Select All on This Page"
galleryadminselectnone = "Select None"
galleryadmininvert = "Invert Selection"
galleryadminselected = "selected"
galleryadminscheduler = "Gallery Scheduler"
galleryadminshowall = "Show All"
galleryadminbulkactions = "Bulk Actions"
galleryadminspecialcommands = "Special Commands"
galleryadmindetailed = "Detailed"
galleryadminbulkreview = "Bulk Review"
galleryadminexport = "Export"
galleryadminexportall = "Export All"
galleryadminremovedupes = "Remove Dupes"
galleryadminreplace = "Replace"
galleryadminscanurls = "Scan URLs"
galleryadminautoscan = "Auto Scan"
galleryadminautothumb = "Auto Thumb"
galleryadminresize = "Resize"
galleryadmin404check = "404 Check"
galleryadmin302check = "302 Check"

Version History

Version Date Changes
2.0 2025-01 Modern card/list view UI, column customization
1.9 2024-12 AI review integration, quick update AJAX
1.8 2024-11 Multi-category support, model selectors
1.7 2024-10 Scheduler grid, bulk actions panel
1.0 Original Initial gallery administration

Turbo Cropper (thumbscan.md) - Manual thumbnail scanning