Alpha V2.5.24

This commit is contained in:
Flatlogic Bot 2026-03-17 01:52:50 +00:00
parent f87f1357a4
commit 2ab31aabd7
2 changed files with 33 additions and 50 deletions

View File

@ -1,9 +1,33 @@
async function loadProfile(userId) {
console.log("loadProfile called for user:", userId);
const modal = document.getElementById('profileModal');
const content = document.getElementById('profileModalContent');
if (!modal || !content) {
console.error("Profile modal elements not found");
return;
}
try {
const response = await fetch('api/get_profile.php?user_id=' + userId);
const data = await response.json();
if (data.html) {
content.innerHTML = data.html;
modal.style.display = 'flex';
} else {
console.error("No HTML returned from profile API");
}
} catch (error) {
console.error('Error loading profile:', error);
}
}
document.addEventListener('DOMContentLoaded', () => {
const chatForm = document.getElementById('chat-form');
const chatInput = document.getElementById('chat-input');
const chatMessages = document.getElementById('chat-messages');
const appendMessage = (text, sender) => {
if (!chatMessages) return;
const msgDiv = document.createElement('div');
msgDiv.classList.add('message', sender);
msgDiv.textContent = text;
@ -39,20 +63,3 @@ document.addEventListener('DOMContentLoaded', () => {
});
}
});
async function loadProfile(userId) {
const modal = document.getElementById('profileModal');
const content = document.getElementById('profileModalContent');
if (!modal || !content) return;
try {
const response = await fetch('api/get_profile.php?user_id=' + userId);
const data = await response.json();
if (data.html) {
content.innerHTML = data.html;
modal.style.display = 'flex';
}
} catch (error) {
console.error('Error loading profile:', error);
}
}

View File

@ -4,9 +4,6 @@ require_once 'includes/status_helper.php';
session_start();
$db = db();
// HEADER IS NOW IN includes/header.php
// But we still need some data for the map and modals in index.php
$user_role = $_SESSION['user_role'] ?? 'user';
$view = isset($_GET['view']) ? $_GET['view'] : 'sector';
@ -176,6 +173,7 @@ function getStatusColor($status, $statuses_map) {
<title>Nexus - <?php echo $page_title; ?></title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<link href="assets/css/custom.css?v=<?php echo time(); ?>" rel="stylesheet">
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
<style>
body { background: #000; color: #fff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; }
#main-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
@ -426,6 +424,14 @@ function getStatusColor($status, $statuses_map) {
</div>
</div>
<!-- PROFILE MODAL -->
<div id="profileModal" class="modal-overlay" onclick="if(event.target === this) this.style.display='none'">
<div class="modal-container modal-nexus">
<div class="modal-header"><h2>Profil Public</h2><button class="modal-close" onclick="document.getElementById('profileModal').style.display='none'">&times;</button></div>
<div id="profileModalContent" class="modal-body"></div>
</div>
</div>
<?php if ($user_role === 'admin' || $user_role === 'gm'): ?>
<div class="admin-footer">
<a href="gm_console.php" class="btn-mj"><i class="fa-solid fa-headset"></i> CONSOLE MG</a>
@ -503,35 +509,5 @@ function getStatusColor($status, $statuses_map) {
}
function closePlanetModal() { document.getElementById('planetModal').style.display = 'none'; }
</script>
<!-- PROFILE MODAL -->
<div id="profileModal" class="modal-overlay" onclick="if(event.target === this) this.style.display='none'">
<div class="modal-container modal-nexus">
<div class="modal-header"><h2>Profil Public</h2><button class="modal-close" onclick="document.getElementById('profileModal').style.display='none'">&times;</button></div>
<div class="modal-body">
<div class="profile-top-section">
<div style="display: flex; align-items: center; justify-content: center; margin-bottom: 5px;">
<img src="<?php echo htmlspecialchars($_SESSION["grade_image"] ?? "assets/images/placeholder_grade.png"); ?>" class="profile-grade-img">
<span class="profile-username"><?php echo htmlspecialchars($_SESSION["grade_name"] ?? "Recrue"); ?> <?php echo htmlspecialchars($_SESSION["display_name"] ?? $_SESSION["username"]); ?></span>
</div>
<?php if (!empty($_SESSION['selected_title_name'])): ?><span class="profile-title-text">— <?php echo htmlspecialchars($_SESSION['selected_title_name']); ?> —</span><?php endif; ?>
<span class="profile-level-text">Niveau <?php echo htmlspecialchars($_SESSION["level"] ?? "1"); ?></span>
</div>
<div class="profile-section-header">Guilde</div>
<div class="guild-info-box">
<?php if (!empty($_SESSION['guild_id'])): ?>
<div class="guild-display"><div class="guild-icon-placeholder"><i class="fa-solid fa-building-shield"></i></div><span class="guild-tag-display">[<?php echo htmlspecialchars($_SESSION['guild_tag']); ?>]</span><span class="guild-name-display"><?php echo htmlspecialchars($_SESSION['guild_name']); ?></span></div>
<?php else: ?><div class="guild-display" style="opacity: 0.5;"><div class="guild-icon-placeholder"><i class="fa-solid fa-user"></i></div><span class="guild-name-display" style="font-style: italic;">Aucune guilde</span></div>
<?php endif; ?>
</div>
<div class="profile-bottom-grid">
<div class="profile-left-col"><div style="width: 100%; height: 100%; opacity: 0.1; background: url('https://www.transparenttextures.com/patterns/stardust.png');"></div></div>
<div class="profile-right-col"><div class="profile-section-header">Insigne Équipé</div><div class="badge-info-section">
<?php if (!empty($_SESSION['selected_badge_image'])): ?><img src="<?php echo htmlspecialchars($_SESSION['selected_badge_image']); ?>?v=<?php echo time(); ?>" class="badge-img-display" title="<?php echo htmlspecialchars($_SESSION['selected_badge_name'] ?? ''); ?>"><span class="badge-name-display"><?php echo htmlspecialchars($_SESSION['selected_badge_name'] ?? ''); ?></span>
<?php else: ?><div style="width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; opacity: 0.2; margin-bottom: 15px;"><i class="fa-solid fa-medal fa-3x"></i></div><span class="badge-name-display" style="opacity: 0.5; font-style: italic;">Aucun insigne</span><?php endif; ?>
</div></div>
</div>
</div>
</div>
</div>
</body>
</html>