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)
System Requirements
PHP Requirements
Required PHP Extensions
Required PHP Functions
Database Requirements
- MySQL 5.7+ / MariaDB 10.3+
- InnoDB engine for transaction support
- User must have SELECT, INSERT, UPDATE, DELETE permissions
External Dependencies
Accessing the Page
Navigation Path
- Log into the admin panel
- Navigate to Advertising section in the main menu
- 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:
[Screenshot: Header with navigation buttons showing Sponsors as active]
Page Layout
Header Section
The page header contains:
[Screenshot: Page header with navigation buttons]
Controls Section
Below the header, a control bar provides:
[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:
[Screenshot: Single sponsor card with all elements labeled]
Status Badges
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
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)
Sponsor Code (Required)
Website URL
Contact Information
Contact Email
Partner Type
- Affiliate - Commission-based partner
- Sponsor - Direct sponsor paying for exposure
- Advertiser - Pay-per-click/impression advertiser
- Network - Advertising network aggregator
Business Details
Banner Limit
Monthly Budget
Payment Processor
Additional Details
Description
Keywords
Status
Step 3: Assign Categories (Optional)
The Categories section allows assigning up to 10 categories to the sponsor:
- Scroll down to the Categories section
- Check the boxes next to relevant categories
- Maximum 10 categories can be selected
- A warning appears if you exceed the limit
[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
- Find the sponsor card in the grid
- 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
Deleting Sponsors
Delete Process
- Find the sponsor card
- Click the Delete button (red with trash icon)
- Confirm in the popup dialog
Delete Restrictions
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:
- The 11th selection is automatically unchecked
- Warning message appears: "Maximum 10 categories allowed"
- 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
Sponsor Codes
Organization
- Group by Partner Type - Use partner types to categorize
- Accurate Budgets - Track monthly budgets for reporting
- Regular Review - Deactivate inactive sponsors
- 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:
- Navigate to Banner Management
- Filter by this sponsor
- Delete or reassign banners
- Return to delete sponsor
Sponsor not appearing after save
Possible Causes:
- Name or code already exists
- Database error
- CSRF token expired
Solutions:
- Check browser console for errors
- Refresh the page and try again
- Use unique sponsor code
- Check if sponsor code already exists
Categories not loading
Cause: Database connection issue or tblCategories empty.
Solution:
- Verify database connection
- Check if categories exist in system
- Ensure categories have
hide = 0
Search not working
Cause: JavaScript error or AJAX failure.
Solution:
- Refresh the page
- Check browser console for errors
- 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"
Related Documentation
- Banner Management - Manage banner ads
- Add Banner - Create new banners
- Banner Zones - Manage placement zones
- Sub-Sponsors - Manage sub-sponsors
Changelog
This documentation is part of the ComusThumbz Admin Guide series.