ComusThumbz 文档
管理员登录

Sponsors Management

Overview

The Sponsors Management page allows administrators to create and manage advertising sponsors (also called partners or advertisers) in the ComusThumbz advertising system. Sponsors are organizations or individuals who provide banners and advertising content for the website.

Key Features

  • Create and manage sponsor profiles
  • Assign categories to sponsors for targeted advertising
  • Track banner counts per sponsor
  • Track sub-sponsor counts per sponsor
  • Set partner types (affiliate, sponsor, advertiser, network)
  • Configure banner limits and monthly budgets
  • Enable/disable sponsors with active/inactive status

Sponsor Hierarchy

The advertising system uses a hierarchical structure:

Sponsor (Main Partner)
├── Sub-Sponsors (Individual Sites/Properties)
│   └── Banners (Ad Creatives)
└── Banners (Direct ads from main sponsor)

 

Note: Sponsors represent the main advertising partner (e.g., "TrafficJunky"), while Sub-Sponsors represent individual sites or properties under that partner (e.g., "Pornhub", "RedTube"). This structure allows flexible banner management and reporting.

 


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+ Required for null coalescing operator
memorylimit 64M 128M Standard page operations
maxexecutiontime 30 60 For large sponsor lists

Required PHP Extensions

Extension Required Purpose
mysqli Yes Database connectivity
json Yes AJAX response handling
session Yes CSRF protection, authentication

Required PHP Functions

Function Required For
bin2hex() CSRF token generation
randombytes() Secure CSRF token generation
mysqlibegintransaction() Safe delete operations
mysqlicommit() / mysqlirollback() Transaction management

Database Requirements

  • MySQL 5.7+ / MariaDB 10.3+
  • InnoDB engine for transaction support
  • User must have SELECT, INSERT, UPDATE, DELETE permissions

External Dependencies

Dependency Version Purpose
Font Awesome 6.5.1 Icons (CDN loaded)

Accessing the Page

Navigation Path

  1. Log into the admin panel
  2. Navigate to Advertising section in the main menu
  3. Click Sponsors or Sponsor Management

Direct URL

https://yourdomain.com/ct/admin/sponsorsmanagement.php

Navigation Buttons

The page header includes navigation buttons to related advertising pages:

Button Destination Purpose
Sponsors sponsorsmanagement.php Current page (highlighted)
Banners bannermanagement.php Manage banner ads
Add Banner addbanner.php Create new banner
Banner Zones bannerzones.php Manage placement zones
Sub-Sponsors subsponsors.php Manage sub-sponsors
Statistics statistics.php View advertising stats

[Screenshot: Header with navigation buttons showing Sponsors as active]


Page Layout

Header Section

The page header contains:

Element Description
Breadcrumb Dashboard / Sponsor Management
Page Title "Sponsor Management" with building icon
Subtitle "Manage sponsors, categories, and partner relationships"
Navigation Buttons Quick links to related advertising pages

[Screenshot: Page header with navigation buttons]

Controls Section

Below the header, a control bar provides:

Element Description
Search Box Real-time search by name, code, or URL
Add New Sponsor Green button to open add sponsor modal

[Screenshot: Controls section with search and add button]

Sponsor Grid

Sponsors are displayed in a responsive card grid layout:

  • Desktop: Multiple columns (auto-fill, minimum 350px per card)
  • Mobile: Single column layout
  • Cards show sponsor details with green left border accent

[Screenshot: Sponsor grid showing multiple sponsor cards]


Sponsor Management

Sponsor Card Layout

Each sponsor card displays:

Section Content
Header Sponsor name, sponsor code, status badge
Actions Edit and Delete buttons
URL Website link (truncated if long)
Stats Banner count and Sub-sponsor count
Categories Up to 3 category tags with "+X more" indicator

[Screenshot: Single sponsor card with all elements labeled]

Status Badges

Status Badge Color Meaning
Active Green Sponsor is active, banners display
Inactive Red Sponsor disabled, banners hidden

Statistics Display

Each card shows two statistics:

  • Banners - Total number of banners assigned to this sponsor
  • Sub-Sponsors - Number of sub-sponsors under this sponsor

 

Note: These counts are calculated in real-time from the database and help you understand the sponsor's advertising footprint.

 


Adding a New Sponsor

Step 1: Open the Add Modal

Click the green "Add New Sponsor" button in the controls section.

[Screenshot: Add New Sponsor button highlighted]

Step 2: Fill in Sponsor Details

The modal form contains the following fields:

Basic Information

Sponsor Name (Required)
Field Details
Label Sponsor Name
Type Text input
Validation Required
Example "TrafficJunky"
Sponsor Code (Required)
Field Details
Label Sponsor Code
Type Text input
Validation Required, unique
Example "TJ001"
Tip: Use short, memorable codes that identify the sponsor. This code appears in reports and is used for tracking.
Website URL
Field Details
Label Website URL
Type URL input
Validation Optional, valid URL format
Example "https://www.trafficjunky.com"

Contact Information

Contact Email
Field Details
Label Contact Email
Type Email input
Validation Optional, valid email format
Example "partner@trafficjunky.com"
Partner Type
Field Details
Label Partner Type
Type Dropdown select
Options Affiliate, Sponsor, Advertiser, Network
Default None selected
Note: Partner types help categorize your advertising relationships:
  • Affiliate - Commission-based partner
  • Sponsor - Direct sponsor paying for exposure
  • Advertiser - Pay-per-click/impression advertiser
  • Network - Advertising network aggregator

Business Details

Banner Limit
Field Details
Label Banner Limit
Type Number input
Default 0 (unlimited)
Example 10
Configuration Required: Set to 0 for unlimited banners, or specify a number to cap the sponsor's banner inventory.
Monthly Budget
Field Details
Label Monthly Budget ($)
Type Decimal number
Default 0.00
Example 5000.00
Payment Processor
Field Details
Label Payment Processor
Type Text input
Placeholder "e.g., PayPal, Stripe, Wire Transfer"
Example "Wire Transfer"

Additional Details

Description
Field Details
Label Description
Type Textarea (3 rows)
Validation Optional
Example "Premium adult advertising network"
Keywords
Field Details
Label Keywords
Type Textarea (2 rows)
Placeholder "Comma-separated keywords"
Example "adult, premium, video, cams"
Tip: Keywords help with internal organization and searching. Use comma-separated values.
Status
Field Details
Label Status
Type Dropdown select
Options Active, Inactive
Default Active

Step 3: Assign Categories (Optional)

The Categories section allows assigning up to 10 categories to the sponsor:

  1. Scroll down to the Categories section
  2. Check the boxes next to relevant categories
  3. Maximum 10 categories can be selected
  4. A warning appears if you exceed the limit

 

Warning: Category assignments help target banner display to relevant content. Sponsors with no category assignments will have their banners shown across all categories.

 

[Screenshot: Categories selection grid in the modal]

Step 4: Save the Sponsor

Click "Save Sponsor" to create the sponsor.

Success Response:

  • Modal closes automatically
  • Sponsor grid refreshes
  • Success notification appears
  • New sponsor appears in the grid

 

Error Response:

  • Error message displays
  • Form remains open for correction

 

[Screenshot: Save Sponsor button and Cancel button]


Editing Sponsors

Accessing Edit Mode

  1. Find the sponsor card in the grid
  2. Click the Edit button (green with pencil icon)

[Screenshot: Edit button on sponsor card]

Edit Modal

The edit modal is identical to the add modal, pre-populated with existing data:

  • All fields can be modified
  • Category assignments can be updated
  • Click Save Sponsor to apply changes

 

Warning: Changing the sponsor code may break existing reports and tracking. Only modify codes when absolutely necessary.

 


Deleting Sponsors

Delete Process

  1. Find the sponsor card
  2. Click the Delete button (red with trash icon)
  3. Confirm in the popup dialog

Delete Restrictions

 

Error: You cannot delete a sponsor that has active banners. Remove or reassign all banners first.

 

The system checks for associated banners before deletion:

If banners exist:
   → Error: "Cannot delete sponsor with active banners"
   → Deletion blocked

If no banners:
→ Sponsor deleted
→ Associated category mappings removed (CASCADE)

 

Confirmation Dialog

A JavaScript confirmation appears:

"Are you sure you want to delete this sponsor? This action cannot be undone."

[Screenshot: Delete confirmation dialog]


Category Assignment

How Categories Work

Sponsors can be assigned to categories to enable targeted advertising:

  • Assigned Categories - Banners show on matching category pages
  • No Categories - Banners may show site-wide (depends on configuration)
  • Multiple Categories - Enables broader reach

Category Limit

Maximum 10 categories per sponsor.

If you try to select more than 10:

  1. The 11th selection is automatically unchecked
  2. Warning message appears: "Maximum 10 categories allowed"
  3. Warning auto-hides after 3 seconds

 

[Screenshot: Category limit warning message]

Category Display on Cards

Sponsor cards show category assignments:

  • First 3 categories displayed as tags
  • Additional categories shown as "+X more"
  • Hover or edit to see all categories

Best Practices

Naming Conventions

 

Tip: Use consistent naming for sponsors:

 

Type Format Example
Network Network name "TrafficJunky"
Direct Company name "ExampleCorp"
Affiliate Program name "AWE Affiliate"

Sponsor Codes

 

Tip: Create meaningful, consistent sponsor codes:

 

Pattern Example Meaning
TJ001 TJ001 TrafficJunky #1
NETEXOCLICK NETEXOCLICK Network - ExoClick
AFFAWE AFFAWE Affiliate - AWE

Organization

  1. Group by Partner Type - Use partner types to categorize
  2. Accurate Budgets - Track monthly budgets for reporting
  3. Regular Review - Deactivate inactive sponsors
  4. Category Relevance - Only assign truly relevant categories

Troubleshooting

Common Issues

"Cannot delete sponsor with active banners"

Cause: The sponsor has banners assigned that must be removed first.

Solution:

  1. Navigate to Banner Management
  2. Filter by this sponsor
  3. Delete or reassign banners
  4. Return to delete sponsor

 

Sponsor not appearing after save

Possible Causes:

  • Name or code already exists
  • Database error
  • CSRF token expired

 

Solutions:

  1. Check browser console for errors
  2. Refresh the page and try again
  3. Use unique sponsor code
  4. Check if sponsor code already exists

 

Categories not loading

Cause: Database connection issue or tblCategories empty.

Solution:

  1. Verify database connection
  2. Check if categories exist in system
  3. Ensure categories have hide = 0

 

Search not working

Cause: JavaScript error or AJAX failure.

Solution:

  1. Refresh the page
  2. Check browser console for errors
  3. Verify server is responding

 

Database Queries for Debugging

Check Sponsor Exists

SELECT id, name, sponsorcode, active
FROM tblSponsors
WHERE name LIKE '%searchterm%'
   OR sponsorcode LIKE '%searchterm%';

Count Banners by Sponsor

SELECT s.name, s.sponsorcode, COUNT(b.id) as bannercount
FROM tblSponsors s
LEFT JOIN tblBannerAssets b ON s.id = b.sponsorid
GROUP BY s.id
ORDER BY bannercount DESC;

View Sponsor Categories

SELECT s.name as sponsor, c.Category
FROM tblSponsorCategories sc
JOIN tblSponsors s ON sc.sponsorid = s.id
JOIN tblCategories c ON sc.categoryid = c.id
ORDER BY s.name, c.Category;

Translatable Strings

The following strings should be added to backendtranslations.md for internationalization:

Page Title and Navigation

sponsorsmanagementtitle = "Sponsor Management"
sponsorsmanagementsubtitle = "Manage sponsors, categories, and partner relationships"
breadcrumbsponsors = "Sponsor Management"

Buttons and Actions

btnaddsponsor = "Add New Sponsor"
btnsavesponsor = "Save Sponsor"
btnedit = "Edit"
btndelete = "Delete"
btncancel = "Cancel"

Form Labels

labelsponsorname = "Sponsor Name"
labelsponsorcode = "Sponsor Code"
labelwebsiteurl = "Website URL"
labelcontactemail = "Contact Email"
labelpartnertype = "Partner Type"
labelbannerlimit = "Banner Limit"
labelmonthlybudget = "Monthly Budget ($)"
labelpaymentprocessor = "Payment Processor"
labeldescription = "Description"
labelkeywords = "Keywords"
labelstatus = "Status"
labelcategories = "Categories"

Partner Types

partnertypeaffiliate = "Affiliate"
partnertypesponsor = "Sponsor"
partnertypeadvertiser = "Advertiser"
partnertypenetwork = "Network"

Status Options

statusactive = "Active"
statusinactive = "Inactive"

Card Labels

statbanners = "Banners"
statsubsponsors = "Sub-Sponsors"

Messages and Notifications

msgsponsorsaved = "Sponsor saved successfully"
msgsponsordeleted = "Sponsor deleted successfully"
msgconfirmdelete = "Are you sure you want to delete this sponsor? This action cannot be undone."
msgnosponsors = "No sponsors found"
msgclickadd = "Click \"Add New Sponsor\" to create your first sponsor."
msgmaxcategories = "Maximum 10 categories allowed"

Error Messages

errornamecoderequired = "Name and sponsor code are required"
errorcannotdeletebanners = "Cannot delete sponsor with active banners"
errorsponsornotfound = "Sponsor not found"
errorloadingsponsors = "Error loading sponsors"
errorsavingsponsor = "Error saving sponsor"
errordeletingsponsor = "Error deleting sponsor"
errorinvalidcsrf = "Invalid CSRF token"

Placeholders

placeholdersearch = "Search sponsors..."
placeholderprocessor = "e.g., PayPal, Stripe, Wire Transfer"
placeholderkeywords = "Comma-separated keywords"
placeholderselecttype = "Select Type"

Section Headers

sectioncategories = "Categories (Select up to 10)"

Navigation Buttons

navsponsors = "Sponsors"
navbanners = "Banners"
navaddbanner = "Add Banner"
navbannerzones = "Banner Zones"
navsubsponsors = "Sub-Sponsors"
navstatistics = "Statistics"


Changelog

Date Version Changes
2025-01-02 1.0 Initial documentation

This documentation is part of the ComusThumbz Admin Guide series.