Documentación de ComusThumbz
Iniciar Sesión

Banner Management

Overview

The Banner Management page is the central hub for viewing, managing, and organizing all banner advertisements in ComusThumbz. It provides a card-based grid display of banners with filtering, searching, performance statistics (impressions, clicks, CTR), and quick actions for editing, copying, testing, and deleting banners. The page supports both image and HTML banner types.

Location: Navigate to this page via Admin Panel → Advertising → Banner Management or access directly via ct/admin/bannermanagement.php

[Screenshot: banner-management-main-interface]


Getting to This Page

Navigate to Admin Panel → AdvertisingClick Banner Management or Banners link

  1. Alternatively, access directly via ct/admin/bannermanagement.php

 

Note:
This page displays all banners across all sponsors and zones. Use the filters to narrow down to specific sponsors, placements, or statuses.

 


System Requirements

 

Configuration Required:
This page requires the banner advertising system to be configured with sponsors, banner zones, and categories. Banners can be image files (uploaded or hotlinked) or HTML content.

 

PHP Requirements

Requirement Minimum Recommended Notes
PHP Version 8.0 8.2+ Uses modern PHP syntax and randombytes()
memorylimit 64M 128M For image processing and pagination
maxexecutiontime 30 60 Standard page load
uploadmaxfilesize 5M 10M For banner image uploads
postmaxsize 8M 16M Must be larger than uploadmaxfilesize

Required PHP Extensions

Extension Required Purpose
mysqli Yes Database connectivity
session Yes CSRF protection, authentication
json Yes AJAX response handling
gd Recommended Image dimension detection for hotlinks

Required PHP Functions

Function Required For Notes
mysqliprepare() SQL queries Prepared statements
mysqlistmtbindparam() Query parameters Core
mysqlistmtexecute() Query execution Core
mysqlibegintransaction() Transaction support Data integrity
mysqlicommit() Transaction commit Core
mysqlirollback() Transaction rollback Error handling
bin2hex() CSRF token generation Security
randombytes() CSRF token generation Security
unlink() File deletion Banner cleanup
fileexists() File verification Cleanup

Folder Permissions

Folder Permission Purpose
ct/admin/ 755 (read) Page access
images/banners/ 755 (write) Banner image storage

Network Requirements

Endpoint Protocol Purpose
Font Awesome CDN HTTPS Icons

Features & UI Elements

Page Header

[Screenshot: banner-management-header]

Element Description
Title "Banner Management" with image icon
Breadcrumb Dashboard → Banner Management
Subtitle "Manage banner assets, placements, and performance tracking"

Navigation Buttons

[Screenshot: banner-management-navigation]

Button Action
Sponsors Navigate to sponsorsmanagement.php
Banners Current page (highlighted)
Add Banner Navigate to addbanner.php
Banner Zones Navigate to bannerzones.php
Sub-Sponsors Navigate to subsponsors.php
Statistics Navigate to statistics.php

Filter Controls

[Screenshot: banner-management-filters]

Control Description
Search Box Search by banner title or sponsor name (debounced 500ms)
Sponsor Filter Dropdown to filter by sponsor
Placement Filter Dropdown to filter by banner zone
Status Filter Dropdown: All, Active, Inactive, Paused, Scheduled, Expired
Add New Banner Button linking to addbanner.php

Banner Cards Grid

[Screenshot: banner-management-grid]

Displays banners in a responsive card grid (auto-fill, min 350px):

Card Header:

Element Description
Title Banner title
Sponsor Name Associated sponsor
Type Badge "IMAGE" (blue) or "HTML" (purple)


Action Buttons:

Button Color Action
Copy Orange Duplicate banner to addbanner.php with pre-filled data
Edit Green Edit banner in addbanner.php
Test Blue Test click URL and track test click
Delete Red Delete banner with confirmation


Banner Preview:

Type Display
Image Thumbnail preview (max 150px height, clickable for full preview)
HTML Scaled HTML preview (30% scale) or placeholder


Banner Info Grid:

Field Description
Zone Banner zone name
Dimensions Width × Height or "Auto"
Status Status badge with appropriate color


Statistics:

Stat Description
Impressions Total times banner was shown
Clicks Total clicks on banner
CTR Click-through rate percentage


Categories:
Shows up to 3 category tags with "+N more" if additional categories assigned.

Banner Preview Modal

[Screenshot: banner-management-preview-modal]

Clicking a banner preview opens a fullscreen modal:

For Image Banners:

  • Full-size image display
  • Click anywhere to close

 

For HTML Banners:

  • HTML content rendered with click URL
  • Shows click URL and dimensions
  • Click outside to close

 

Pagination

[Screenshot: banner-management-pagination]

Element Description
Previous Previous page (disabled if on first page)
Page Numbers Shows current page ± 2
Next Next page (disabled if on last page)

Status Badges

Status Background Text Color Description
Active #d4edda #155724 Banner is live and showing
Inactive #f8d7da #721c24 Banner is disabled
Paused #fff3cd #856404 Temporarily paused
Scheduled #d1ecf1 #0c5460 Scheduled for future date
Expired #f8d7da #721c24 Past end date

Step-by-Step Usage

Viewing All Banners

  1. Navigate to Admin Panel → Advertising → Banner Management
  2. Banners load automatically in grid view
  3. Scroll to view all banners
  4. Use pagination for large banner collections

Searching for Banners

  1. Type in the Search box
  2. Search matches banner title or sponsor name
  3. Results update automatically after 500ms
  4. Clear search box to show all banners

Filtering Banners

  1. Select a Sponsor from the dropdown to show only their banners
  2. Select a Placement to show banners for a specific zone
  3. Select a Status to filter by active/inactive/etc.
  4. Combine filters for precise results
  5. Pagination resets to page 1 when filters change

Copying a Banner

  1. Find the banner you want to copy
  2. Click the Copy button (orange)
  3. Redirected to addbanner.php with pre-filled data
  4. Title becomes "[Original Title] (Copy)"
  5. Status set to "inactive" by default
  6. Modify any fields and save as new banner

Editing a Banner

  1. Find the banner to edit
  2. Click the Edit button (green)
  3. Redirected to addbanner.php?id=[bannerid]
  4. Make changes and save

Testing a Banner Click

  1. Find the banner to test
  2. Click the Test button (blue)
  3. Confirmation dialog shows click URL
  4. Click OK to open URL in new tab
  5. Test click is tracked and statistics updated
  6. Banner stats refresh automatically

Deleting a Banner

  1. Find the banner to delete
  2. Click the Delete button (red)
  3. Confirm deletion in dialog
  4. Banner and associated file are permanently deleted

 

Warning:
Deleting a banner is permanent and cannot be undone. The physical image file (if uploaded) will also be deleted from the server.

 

Previewing a Banner

  1. Click on the banner preview image/HTML area
  2. Modal opens with full-size preview
  3. For HTML banners, shows rendered content and metadata
  4. Click anywhere to close the modal

AJAX Actions

The page uses POST requests with CSRF protection:

Action Parameters Description
getbanners page, limit, search, sponsorfilter, placementfilter, statusfilter Paginated banner list
deletebanner id Delete banner and file
updatebannerstatus id, status Change banner status
getsponsors - Get active sponsors for filter
getplacements - Get active zones for filter
getbannercategories bannerid Get category IDs for copying
tracktestclick bannerid Record test click

Troubleshooting

Common Errors

 

Error:
"Invalid CSRF token"


Cause: Session expired or token mismatch
Solution:

  1. Refresh the page to get new CSRF token
  2. Clear browser cookies if issue persists
  3. Check session configuration

 

 

Error:
"Failed to delete banner"


Cause: Database error or file permission issue
Solution:

  1. Check database connection
  2. Verify images/banners/ folder has write permissions
  3. Check if bannerid exists

 

 

Error:
Banners not loading


Cause: AJAX request failed
Solution:

  1. Check browser console for JavaScript errors
  2. Verify database connection
  3. Check PHP error logs

 

 

Warning:
Banner images not displaying


Cause: Missing files or incorrect paths
Solution:

  1. Verify images/banners/ folder exists
  2. Check filepath in tblBannerAssets
  3. Confirm files exist on server
  4. For hotlinks, verify external URLs are accessible

 

Performance Issues

 

Tip:
For sites with many banners:
  1. Use filters to narrow results
  2. Add database indexes on frequently queried columns
  3. Consider archiving old/expired banners
  4. Implement lazy loading for banner images

 


Translatable Strings

The following strings should be added to backendtranslations.md:

bannermanagementtitle = "Banner Management"
bannermanagementbreadcrumb = "Banner Management"
bannermanagementsubtitle = "Manage banner assets, placements, and performance tracking"
bannermanagementsponsors = "Sponsors"
bannermanagementbanners = "Banners"
bannermanagementaddbanner = "Add Banner"
bannermanagementbannerzones = "Banner Zones"
bannermanagementsubsponsors = "Sub-Sponsors"
bannermanagementstatistics = "Statistics"
bannermanagementsearch = "Search banners..."
bannermanagementallsponsors = "All Sponsors"
bannermanagementallplacements = "All Placements"
bannermanagementallstatus = "All Status"
bannermanagementstatusactive = "Active"
bannermanagementstatusinactive = "Inactive"
bannermanagementstatuspaused = "Paused"
bannermanagementstatusscheduled = "Scheduled"
bannermanagementstatusexpired = "Expired"
bannermanagementaddnewbanner = "Add New Banner"
bannermanagementnobanners = "No banners found"
bannermanagementcreatefirst = "Click \"Add New Banner\" to create your first banner."
bannermanagementtypeimage = "IMAGE"
bannermanagementtypehtml = "HTML"
bannermanagementcopy = "Copy"
bannermanagementedit = "Edit"
bannermanagementtest = "Test"
bannermanagementdelete = "Delete"
bannermanagementzone = "Zone"
bannermanagementdimensions = "Dimensions"
bannermanagementstatus = "Status"
bannermanagementimpressions = "Impressions"
bannermanagementclicks = "Clicks"
bannermanagementctr = "CTR"
bannermanagementmorecategories = "+{count} more"
bannermanagementhtmlbanner = "HTML Banner"
bannermanagementhtmlpreview = "HTML Banner Preview"
bannermanagementclickurl = "Click URL"
bannermanagementnotset = "Not set"
bannermanagementauto = "Auto"
bannermanagementprevious = "Previous"
bannermanagementnext = "Next"
bannermanagementconfirmdelete = "Are you sure you want to delete this banner? This action cannot be undone."
bannermanagementtestclick = "Test click for \"{title}\"?\n\nThis will open: {url}"
bannermanagementtesttracked = "Test click tracked!"
bannermanagementerrorloading = "Error loading banners"
bannermanagementerrordeleting = "Error deleting banner"
bannermanagementdeletedsuccess = "Banner deleted successfully"
bannermanagementloading = "Loading banners..."

Version History

Version Date Changes
1.0 2024-10 Initial release with basic CRUD
1.1 2024-11 Added HTML banner support
1.2 2024-12 Added copy functionality, improved preview modal
1.3 2025-01 Added test click tracking, category support