Autosave: 20260220-193038

This commit is contained in:
Flatlogic Bot 2026-02-20 19:30:38 +00:00
parent 0845f0ea7f
commit 0984d84431
2 changed files with 16 additions and 4 deletions

View File

@ -3424,7 +3424,7 @@ document.addEventListener('DOMContentLoaded', () => {
const resp = await fetch('api_v1_events.php', { method: 'POST', body: formData });
const result = await resp.json();
if (result.success) {
deleteBtn.closest('.col-12').remove();
location.reload();
} else {
alert(result.error || 'Erreur lors de la suppression');
}

View File

@ -198,7 +198,7 @@ if ($is_dm_view) {
$active_server_id = $_GET['server_id'] ?? ($servers[0]['id'] ?? 1);
// Fetch channels
$stmt = db()->prepare("SELECT * FROM channels WHERE server_id = ? ORDER BY position ASC, id ASC");
$stmt = db()->prepare("SELECT c.*, (SELECT COUNT(*) FROM channel_events e WHERE e.channel_id = c.id AND (e.is_permanent = 1 OR CONCAT(e.end_date, ' ', e.end_time) >= NOW())) as event_count FROM channels c WHERE c.server_id = ? ORDER BY c.position ASC, c.id ASC");
$stmt->execute([$active_server_id]);
$all_channels = $stmt->fetchAll();
@ -349,7 +349,14 @@ if ($is_dm_view) {
}
$current_channel_name = 'general';
foreach($channels as $c) if($c['id'] == $active_channel_id) $current_channel_name = $c['name'];
foreach($channels as $c) {
if($c['id'] == $active_channel_id) {
$current_channel_name = $c['name'];
if ($c['type'] === 'event' && !empty($c['event_count'])) {
$current_channel_name .= " (" . $c['event_count'] . ")";
}
}
}
// Fetch voice sessions for the sidebar
$stmt_vs = db()->prepare("
@ -602,7 +609,12 @@ $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
<?php if (!empty($c['icon'])): ?>
<span class="me-1" style="font-size: 14px;"><?php echo renderRoleIcon($c['icon'], '14px'); ?></span>
<?php endif; ?>
<span class="channel-name-text"><?php echo htmlspecialchars($c['name']); ?></span>
<span class="channel-name-text">
<?php echo htmlspecialchars($c['name']); ?>
<?php if ($c['type'] === 'event' && !empty($c['event_count'])): ?>
<span class="ms-1">(<?php echo $c['event_count']; ?>)</span>
<?php endif; ?>
</span>
</span>
<?php if ($c['type'] === 'voice' && !empty($c['status'])): ?>
<div class="channel-status small text-muted ms-4" style="font-size: 0.75em; margin-top: -2px;"><?php echo htmlspecialchars($c['status']); ?></div>