Basic message implementation

This commit is contained in:
2025-12-15 11:08:23 +01:00
parent 2b6d4c49f5
commit aa9b3359b1
10 changed files with 783 additions and 1 deletions

View File

@@ -35,6 +35,16 @@
<td><?= ($user->user_active == 0 ? 'No' : 'Yes'); ?></td>
<td>
<a href="<?= Config::get('URL') . 'profile/showProfile/' . $user->user_id; ?>">Profile</a>
<?php
// Show unread message count for each user
if (Session::userIsLoggedIn()) {
$current_user_id = Session::get('user_id');
$unread_count = MessageModel::getUnreadCountForUser($current_user_id, $user->user_id);
if ($unread_count > 0) {
echo ' <span class="badge" style="background-color: #d9534f; color: white; padding: 2px 5px; border-radius: 50%;">' . $unread_count . '</span>';
}
}
?>
</td>
</tr>
<?php } ?>