توثيق ComusThumbz
تسجيل دخول المسؤول

Notifications Manager

Overview

The Admin Notifications Manager provides comprehensive control over the user notification system. Administrators can view all notifications across the platform, send system-wide announcements, monitor notification statistics, and manage notification delivery to specific user segments.

Key capabilities include:

  • View all user notifications in a timeline format
  • Send system-wide or targeted notifications
  • Filter notifications by type, priority, and read status
  • View notification statistics and read rates
  • Delete individual or bulk notifications
  • Preview notification details in a modal

 


System Requirements

PHP Requirements

Requirement Minimum Recommended
PHP Version 7.4+ 8.0+
Memory Limit 32M 64M

PHP Extensions Required

  • mysqli - Database connectivity
  • json - JSON encoding for metadata and AJAX responses
  • session - Session management for CSRF protection

PHP Settings

session.autostart = Off
date.timezone = Your/Timezone

Features & UI Elements

Page Header

[Screenshot: notifications-header]

The page header displays:

  • Title: "Notifications Manager"
  • Breadcrumb: Dashboard / Notifications

 

Alert Messages

Success and error messages appear below the header:

  • Success (green): "Notification sent to X user(s)"
  • Error (red): "Invalid security token" or "No target users found"

 

Statistics Cards

[Screenshot: notifications-stats]

Four statistics cards show notification overview:

Card Color Description
Total Notifications Green All active notifications
Unread Orange Notifications not yet read
Last 24 Hours Blue Notifications created today
Last 7 Days Purple Notifications created this week

Notifications by Type

[Screenshot: notifications-by-type]

A grid of clickable type cards showing:

  • Icon - Visual representation of notification type
  • Type Name - comment, like, follow, subscription, etc.
  • Count - Total notifications of this type
  • Read Rate - Percentage of notifications read

 

Click a type card to filter the timeline by that type.

Send Notification Form

[Screenshot: notifications-send-form]

A form to send new system notifications:

Field Type Description
Title Text Notification headline (max 255 chars)
Message Textarea Notification content
Type Select Notification category
Priority Select Urgency level
Icon Text Font Awesome class (e.g., fas fa-info-circle)
Action URL Text Optional link (e.g., /admin/some-page.php)
Target Audience * Select Who receives the notification
User IDs Text Comma-separated IDs (for "Specific Users" target)

Notification Types

Type Icon Description
system fa-cog System announcements
content fa-file-alt Content-related notifications
payment fa-dollar-sign Payment/billing notifications
subscription fa-star Subscription updates
message fa-envelope Direct messages
comment fa-comment Comments on content
like fa-heart Likes on content
follow fa-user-plus New followers

Priority Levels

Priority Badge Color Description
low Gray Informational, not urgent
normal Gray Standard notifications
high Yellow Important, needs attention
urgent Red Critical, immediate action

Target Audience Options

Target Query Description
All Active Users accountstatus = 'active' All users with active accounts
Active Subscribers status = 'active' AND expirydate > NOW() Users with paid subscriptions
Verified Creators isverified = 1 Verified content creators
Specific Users User IDs input Comma-separated user IDs

Notifications Timeline

[Screenshot: notifications-timeline]

The main timeline shows all notifications with:

Timeline Header:

  • Title and icon
  • Filter buttons: All, Unread, Urgent, High

 

Each Notification Item:

  • Icon - Color-coded by notification type
  • Username - Recipient user
  • Timestamp - When notification was created
  • Title - Notification headline
  • Message - Content preview (150 chars)
  • Badges - Type, priority, and "NEW" for unread
  • Delete Button - Remove the notification

 

Unread Indicator:

  • Yellow background with left border
  • "NEW" badge displayed

 

Click Action:

  • Click a notification to open the detail modal

 

Notification Detail Modal

[Screenshot: notifications-detail-modal]

When clicking a notification, a modal shows:

Field Description
User Username and user ID
Type Notification type badge
Priority Priority level badge
Title Full notification title
Message Complete message content
Action URL Clickable link (if present)
Status Read/Unread with timestamp
Created Creation date and time
Metadata JSON data (if present)

Pagination

  • 20 notifications per page
  • Previous/Next navigation
  • Page number links
  • Maintains filter parameters across pages

Step-by-Step Usage

Sending a System-Wide Notification

  1. Navigate to Admin Panel → Users → Notifications
  2. Scroll to the Send System Notification form
  3. Enter a Title (e.g., "System Maintenance Notice")
  4. Enter a Message with details
  5. Select Type: System
  6. Select Priority: Normal (or higher if urgent)
  7. Leave Icon as default or enter custom class
  8. Optionally add Action URL for more info
  9. Select Target Audience: All Active Users
  10. Click Send Notification

 

Success: Notification sent to X user(s)

 

Sending to Specific Users

  1. Open the Send System Notification form
  2. Fill in Title and Message
  3. Select Target Audience: Specific Users
  4. A new field appears for User IDs
  5. Enter comma-separated user IDs: 1, 5, 23, 45
  6. Click Send Notification

Sending to Subscribers Only

  1. Open the Send System Notification form
  2. Fill in Title and Message
  3. Select Type: Subscription
  4. Select Priority: High (to emphasize importance)
  5. Select Target Audience: Active Subscribers Only
  6. Click Send Notification

Filtering Notifications

By Type:

  1. Click a type card in the "Notifications by Type" section
  2. Timeline filters to show only that type
  3. URL updates with ?type=comment parameter

 

By Status:

  1. Click filter buttons in the timeline header:

 

  • All - Show all notifications
  • Unread - Only unread notifications
  • Urgent - Priority = urgent
  • High - Priority = high

 

Viewing Notification Details

  1. Click any notification in the timeline
  2. Modal opens with full details
  3. View all fields including metadata
  4. Click Close or press ESC to dismiss
  5. Click outside the modal to close

Deleting Notifications

Single Notification:

  1. Find the notification in the timeline
  2. Click the trash icon button
  3. Confirm the deletion
  4. Notification is soft-deleted (isdeleted = 1)

 

 

Warning: Deleted notifications are hidden but remain in the database with isdeleted = 1 and deletedat timestamp.

 


Best Practices

Notification Content

 

Tip: Effective notifications are concise and actionable:

 

  1. Titles:
  • Keep under 50 characters
  • Start with action word (e.g., "New", "Update", "Action Required")
  • Be specific about the notification purpose
  1. Messages:
  • Keep under 200 characters for preview
  • Include essential information first
  • Provide context for the action
  1. Action URLs:
  • Always use relative paths (e.g., /settings/profile.php)
  • Ensure the linked page is accessible to the user
  • Don't link to admin-only pages for regular users

Priority Guidelines

Use Priority When
low Nice-to-know information, no action needed
normal Standard notifications, general updates
high Important updates requiring attention soon
urgent Critical issues requiring immediate action
Warning: Use "urgent" priority sparingly. Overuse diminishes its impact.

Target Audience Selection

 

Tip: Choose the most specific audience to avoid notification fatigue:

 

  • All Users: Major announcements, terms updates, system-wide changes
  • Subscribers: Subscription-specific news, premium features
  • Creators: Creator program updates, payout notifications
  • Specific Users: Individual issues, support follow-ups

Troubleshooting

Common Issues

"No target users found"

Cause: Selected audience has no matching users

Solutions:

Check if there are active subscribers (for Subscribers Only)Check if there are verified creators (for Creators Only)Verify user IDs exist (for Specific Users)

  1. Check accountstatus = 'active' in tblCMSUsers

 

Notification Not Appearing

Cause: Notification was soft-deleted or not created

Solutions:

  1. Check tblUserNotifications for the record
  2. Verify isdeleted = 0
  3. Check userid matches the target user
  4. Verify createdat is recent

 

Modal Not Opening

Cause: JavaScript error or overlay issue

Solutions:

  1. Check browser console for JavaScript errors
  2. Ensure Font Awesome is loaded
  3. Clear browser cache and reload
  4. Check for CSS conflicts

 

Filter Not Working

Cause: URL parameter issue

Solutions:

  1. Check URL contains correct parameters
  2. Verify SQL query is using parameters
  3. Check for special characters in filter values

 

Database Issues

Table Does Not Exist

Cause: Migration not run

Solutions:

  1. Run the CREATE TABLE statements from Installation Requirements
  2. Verify foreign key references (tblCMSUsers must exist)

 

Foreign Key Constraint Error

Cause: Referenced user doesn't exist

Solutions:

  1. Check userid exists in tblCMSUsers
  2. Verify user hasn't been deleted
  3. Use valid user IDs when sending to specific users

 


Translatable Strings

{
    "notificationstitle": "Notifications Manager",
    "notificationsbreadcrumb": "Dashboard / Notifications",
    "notificationstotal": "Total Notifications",
    "notificationsunread": "Unread",
    "notificationslast24h": "Last 24 Hours",
    "notificationslast7d": "Last 7 Days",
    "notificationssendtitle": "Send System Notification",
    "notificationsformtitle": "Title",
    "notificationsformmessage": "Message",
    "notificationsformtype": "Type",
    "notificationsformpriority": "Priority",
    "notificationsformicon": "Icon (Font Awesome class)",
    "notificationsformactionurl": "Action URL (optional)",
    "notificationsformtarget": "Target Audience",
    "notificationsformuserids": "User IDs (comma-separated)",
    "notificationsformsend": "Send Notification",
    "notificationstimelinetitle": "Notification Timeline",
    "notificationsfilterall": "All",
    "notificationsfilterunread": "Unread",
    "notificationsfilterurgent": "Urgent",
    "notificationsfilterhigh": "High",
    "notificationsdetailtitle": "Notification Details",
    "notificationsdetailuser": "User",
    "notificationsdetailtype": "Type",
    "notificationsdetailpriority": "Priority",
    "notificationsdetailmessage": "Message",
    "notificationsdetailaction": "Action URL",
    "notificationsdetailstatus": "Status",
    "notificationsdetailcreated": "Created",
    "notificationsdetailmetadata": "Metadata",
    "notificationsstatusread": "Read",
    "notificationsstatusunread": "Unread",
    "notificationsempty": "No notifications found",
    "notificationsemptyfiltered": "No notifications matching your filters",
    "notificationssuccesssent": "Notification sent to {count} user(s)",
    "notificationserrorcsrf": "Invalid security token",
    "notificationserrorrequired": "Title and message are required",
    "notificationserrornousers": "No target users found",
    "notificationserrordelete": "Failed to delete notification",
    "notificationsconfirmdelete": "Delete this notification?",
    "notificationstargetall": "All Active Users",
    "notificationstargetsubscribers": "Active Subscribers Only",
    "notificationstargetcreators": "Verified Creators Only",
    "notificationstargetspecific": "Specific Users (comma-separated IDs)",
    "notificationstypecomment": "Comment",
    "notificationstypelike": "Like",
    "notificationstypefollow": "Follow",
    "notificationstypesubscription": "Subscription",
    "notificationstypepayment": "Payment",
    "notificationstypesystem": "System",
    "notificationstypemessage": "Message",
    "notificationstypecontent": "Content",
    "notificationsprioritylow": "Low",
    "notificationsprioritynormal": "Normal",
    "notificationspriorityhigh": "High",
    "notificationspriorityurgent": "Urgent"
}


Version History

Version Date Changes
1.0.0 2025-10-20 Initial notifications admin page
1.1.0 2025-11-01 Added type statistics with read rates
1.2.0 2025-11-15 Added notification detail modal
1.3.0 2025-12-15 Modern UI with green theme
1.4.0 2025-01-02 Added target audience selector