Account Settings

Profile Information

🌟 Recognition Wall

Celebrating the granters who make wishes come true

0
Total Recognitions
0
Recognized Granters
0
Recognition Points
0
This Month

Recognize a Granter

Show appreciation for granters who have made your wishes come true

<!-- OPTIMIZED INLINE JAVASCRIPT - NO EXTERNAL CALLS --> <script> // Global variables let currentUserData = null; // Load user data and initialize header async function loadUserData() { try { console.log("Loading user data..."); const response = await fetch("/get-user-data.php?t=" + Date.now()); const userData = await response.json(); console.log("User data received:", userData); currentUserData = userData; // Update header based on login status if (userData.logged_in) { // User is logged in - show logged-in state console.log("User is logged in:", userData.display_name); // Show coins badge const coinsBadge = document.getElementById("coinsBadge"); const coinsCount = document.getElementById("coinsCount"); const coinsSpacer = document.getElementById("coinsSpacer"); if (coinsBadge && coinsCount) { coinsCount.textContent = userData.coins.toLocaleString(); coinsBadge.style.display = "flex"; if (coinsSpacer) coinsSpacer.style.display = "block"; } // Show diamonds badge const diamondsBadge = document.getElementById("diamondsBadge"); const diamondsCount = document.getElementById("diamondsCount"); const diamondsSpacer = document.getElementById("diamondsSpacer"); if (diamondsBadge && diamondsCount) { diamondsCount.textContent = userData.diamonds.toLocaleString(); diamondsBadge.style.display = "flex"; if (diamondsSpacer) diamondsSpacer.style.display = "block"; } // Update profile button with real name const profileText = document.getElementById("profileText"); if (profileText) { profileText.textContent = userData.display_name; } // Update profile dropdown with logged-in content const profileDropdown = document.getElementById("profileDropdown"); if (profileDropdown) { profileDropdown.innerHTML = ` <div class="dropdown-item"> <a href="/profile.php" class="dropdown-link"> <span class="dropdown-icon">=�d�</span> Go to Profile </a> </div> <div class="dropdown-item" onclick="showSettingsModal()"> <span class="dropdown-icon">�&�</span> Account Settings </div> <div class="dropdown-item" onclick="handleLogout()"> <span class="dropdown-icon">=ت�</span> Logout </div> `; } } else { // User is not logged in - show login option console.log("User is not logged in"); // Update profile button to show "Account" const profileText = document.getElementById("profileText"); if (profileText) { profileText.textContent = "Account"; } // Update profile dropdown with login option const profileDropdown = document.getElementById("profileDropdown"); if (profileDropdown) { profileDropdown.innerHTML = ` <div class="dropdown-item" onclick="showLoginModal()"> <span class="dropdown-icon">=��</span> Login </div> <div class="dropdown-item"> <a href="/wisher-signup" class="dropdown-link"> <span class="dropdown-icon">=�d�</span> Create Account </a> </div> `; } } console.log("Header updated successfully"); } catch (error) { console.error("Error loading user data:", error); } } // Profile dropdown functionality function toggleProfileDropdown() { const dropdown = document.getElementById("profileDropdown"); const profileBtn = document.getElementById("profileBtn"); if (dropdown) { const isActive = dropdown.classList.contains("active"); if (isActive) { dropdown.classList.remove("active"); if (profileBtn) profileBtn.classList.remove("active"); } else { dropdown.classList.add("active"); if (profileBtn) profileBtn.classList.add("active"); } } } // Login modal functionality function showLoginModal() { const modal = document.getElementById("loginModal"); const overlay = document.getElementById("loginModalOverlay"); if (modal) { modal.style.display = "block"; if (overlay) overlay.style.display = "block"; document.body.style.overflow = "hidden"; } } function hideLoginModal() { const modal = document.getElementById("loginModal"); const overlay = document.getElementById("loginModalOverlay"); if (modal) { modal.style.display = "none"; if (overlay) overlay.style.display = "none"; document.body.style.overflow = ""; } } // Settings modal functionality function showSettingsModal() { const modal = document.getElementById("settingsModal"); if (modal && currentUserData) { // Populate settings with user data const nicknameInput = document.getElementById("settingsNickname"); const emailInput = document.getElementById("settingsEmail"); const userIdInput = document.getElementById("settingsUserId"); if (nicknameInput) { nicknameInput.value = currentUserData.display_name; nicknameInput.disabled = false; } if (emailInput) { emailInput.value = currentUserData.email; } if (userIdInput) { userIdInput.value = currentUserData.user_id; } modal.style.display = "block"; document.body.style.overflow = "hidden"; // Close profile dropdown const profileDropdown = document.getElementById("profileDropdown"); if (profileDropdown) { profileDropdown.classList.remove("active"); } } } function closeSettingsModal() { const modal = document.getElementById("settingsModal"); if (modal) { modal.style.display = "none"; document.body.style.overflow = ""; } } // Login form handling document.addEventListener("DOMContentLoaded", function() { const loginForm = document.getElementById("loginForm"); if (loginForm) { loginForm.addEventListener("submit", async function(e) { e.preventDefault(); const submitBtn = document.getElementById("loginSubmitBtn"); const originalText = submitBtn.textContent; submitBtn.textContent = "Signing In..."; submitBtn.disabled = true; try { const formData = new FormData(); formData.append("log", document.getElementById("loginEmail").value); formData.append("pwd", document.getElementById("loginPassword").value); formData.append("wp-submit", "Log In"); formData.append("redirect_to", window.location.href.split("?")[0]); // Remove query parameters to avoid redirect loops formData.append("testcookie", "1"); const response = await fetch("/wp-login.php", { method: "POST", body: formData, credentials: "same-origin" }); if (response.redirected) { // Successful login - redirect to current page with success parameter window.location.href = window.location.pathname + "?login=success"; } else { const responseText = await response.text(); if (responseText.includes("incorrect")) { alert("Login failed. Please check your credentials."); } else { console.error("Login response:", responseText); alert("Login failed. Please try again."); } } } catch (error) { console.error("Login error:", error); alert("Login failed. Please try again."); } finally { submitBtn.textContent = originalText; submitBtn.disabled = false; } }); } // Profile button click handler const profileBtn = document.getElementById("profileBtn"); if (profileBtn) { profileBtn.addEventListener("click", function(e) { e.preventDefault(); toggleProfileDropdown(); }); } // Close dropdowns when clicking outside document.addEventListener("click", function(e) { const profileContainer = document.getElementById("profileContainer"); const profileDropdown = document.getElementById("profileDropdown"); if (profileContainer && profileDropdown && !profileContainer.contains(e.target)) { profileDropdown.classList.remove("active"); const profileBtn = document.getElementById("profileBtn"); if (profileBtn) profileBtn.classList.remove("active"); } }); // Check for login success parameter const urlParams = new URLSearchParams(window.location.search); if (urlParams.get("login") === "success") { // Clean URL and reload user data const cleanUrl = window.location.pathname; window.history.replaceState(null, null, cleanUrl); setTimeout(() => loadUserData(), 100); } }); // Logout functionality async function handleLogout() { try { console.log("Starting optimized header logout..."); // Show immediate feedback const logoutButton = document.querySelector(".dropdown-item[onclick*=\"handleLogout\"]"); if (logoutButton) { logoutButton.innerHTML = "<span class=\"dropdown-icon\">�#</span>Logging out..."; logoutButton.style.pointerEvents = "none"; } const response = await fetch("/logout.php", { method: "GET", credentials: "same-origin" }); if (response.redirected) { console.log("Optimized header logout successful"); // Clear all client-side data immediately localStorage.clear(); sessionStorage.clear(); // Clean URL and redirect instantly (no setTimeout delay) const cleanUrl = window.location.pathname; window.location.href = cleanUrl; } else { // Fallback window.location.href = "/wp-login.php?action=logout"; } } catch (error) { console.error("Optimized header logout error:", error); // Ultimate fallback window.location.href = "/wp-login.php?action=logout"; } } // Load user data now that functions are available loadUserData(); </script> <!-- INLINE CSS FOR HEADER - NO EXTERNAL STYLESHEETS --> <style> /* Header Styles */ header { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; position: fixed; top: 0; left: 0; right: 0; z-index: 1000; } .logo-link { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 12px; transition: all 0.3s ease; } .logo-link:hover { transform: scale(1.02); } .logo { display: flex; align-items: center; gap: 12px; } .mark { width: 44px; height: 44px; border-radius: 10px; background: url("https://buymywishes.com/wp-content/uploads/2025/09/bmw-logo-only.jpg") center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #000; box-shadow: 0 20px 60px rgba(255, 215, 0, 0.3); border: 2px solid rgba(255, 215, 0, 0.3); } .logo-text { font-size: 18px; font-weight: 700; color: #FFD700; text-shadow: 0 0 10px rgba(255, 215, 0, 0.3); letter-spacing: -0.5px; } .muted { font-size: 0.6rem; color: rgba(255, 255, 255, 0.7); font-weight: 500; } nav { display: flex; gap: 8px; align-items: center; } .btn { background: transparent; border: 1px solid rgba(255, 215, 0, 0.3); padding: 10px 14px; border-radius: 10px; color: #FFD700; cursor: pointer; font-weight: 600; transition: all 0.3s ease; text-decoration: none; display: inline-block; } .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3); border-color: #FFD700; } .btn.fill { background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%); color: #000; border: 0; } .btn.fill:hover { box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3); } /* Currency Badges */ .coins-badge, .diamonds-badge { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; border: none; padding: 8px 12px; border-radius: 20px; font-weight: 700; font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3); transition: all 0.3s ease; } .coins-badge:hover, .diamonds-badge:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4); } .diamonds-badge { background: linear-gradient(135deg, #B9F2FF, #4A90E2); } /* Profile Dropdown */ .profile-dropdown-container { position: relative; display: inline-block; } .profile-btn { background: transparent; border: 1px solid rgba(255, 215, 0, 0.3); padding: 10px 14px; border-radius: 10px; color: #FFD700; cursor: pointer; font-weight: 600; transition: all 0.3s ease; display: flex; align-items: center; gap: 0.5rem; } .profile-btn:hover { border-color: #FFD700; } .profile-btn.active { border-color: #FFD700; background: rgba(255, 215, 0, 0.1); } .dropdown-arrow { font-size: 0.8rem; transition: transform 0.3s ease; } .profile-btn.active .dropdown-arrow { transform: rotate(180deg); } .profile-dropdown { position: absolute; top: 100%; right: 0; background: rgba(0, 0, 0, 0.95); border: 1px solid rgba(255, 215, 0, 0.3); border-radius: 10px; min-width: 180px; z-index: 1000; display: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); } .profile-dropdown.active { display: block; } .dropdown-item { padding: 12px 16px; cursor: pointer; transition: all 0.3s ease; border-bottom: 1px solid rgba(255, 255, 255, 0.1); } .dropdown-item:last-child { border-bottom: none; } .dropdown-item:hover { background: rgba(255, 215, 0, 0.1); color: #FFD700; } .dropdown-link { color: inherit; text-decoration: none; display: block; } .dropdown-icon { margin-right: 8px; } /* Modal Styles */ .login-modal-content { background: rgba(0, 0, 0, 0.95); border: 1px solid rgba(255, 215, 0, 0.3); border-radius: 15px; padding: 30px; max-width: 400px; width: 90%; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px); } .login-close { position: absolute; top: 15px; right: 15px; background: none; border: none; color: #FFD700; font-size: 24px; cursor: pointer; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; } .login-modal-header { text-align: center; margin-bottom: 25px; } .login-modal-title { font-size: 24px; font-weight: 700; color: #FFD700; margin-bottom: 5px; } .login-modal-subtitle { font-size: 14px; color: rgba(255, 255, 255, 0.7); } .login-form-group { margin-bottom: 20px; } .login-form-label { display: block; margin-bottom: 5px; font-weight: 600; color: #FFD700; } .login-form-input { width: 100%; padding: 12px; border: 1px solid rgba(255, 215, 0, 0.3); border-radius: 8px; background: rgba(255, 255, 255, 0.1); color: white; font-size: 16px; } .login-form-input:focus { outline: none; border-color: #FFD700; box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2); } .login-btn { width: 100%; padding: 12px; background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%); border: none; border-radius: 8px; color: #000; font-weight: 700; font-size: 16px; cursor: pointer; transition: all 0.3s ease; } .login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3); } .login-links { text-align: center; margin-top: 20px; } .login-link { color: #FFD700; text-decoration: none; font-size: 14px; } .login-link:hover { text-decoration: underline; } /* Settings Modal Styles */ .settings-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(10px); z-index: 10000; align-items: center; justify-content: center; } .settings-modal-content { background: rgba(0, 0, 0, 0.95); border: 1px solid rgba(255, 215, 0, 0.3); border-radius: 15px; padding: 30px; max-width: 500px; width: 90%; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); } .settings-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; } .settings-modal-title { font-size: 24px; font-weight: 700; color: #FFD700; } .settings-close-btn { background: none; border: none; color: #FFD700; font-size: 24px; cursor: pointer; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; } .settings-modal-body { max-height: 60vh; overflow-y: auto; } .settings-section h4 { color: #FFD700; margin-bottom: 15px; font-size: 18px; } .settings-field { margin-bottom: 20px; } .settings-field label { display: block; margin-bottom: 5px; font-weight: 600; color: #FFD700; } .nickname-input-container { display: flex; gap: 10px; } .nickname-input-container input { flex: 1; padding: 8px 12px; border: 1px solid rgba(255, 215, 0, 0.3); border-radius: 6px; background: rgba(255, 255, 255, 0.1); color: white; } .edit-nickname-btn { background: rgba(255, 215, 0, 0.2); border: 1px solid rgba(255, 215, 0, 0.3); border-radius: 6px; padding: 8px 12px; color: #FFD700; cursor: pointer; transition: all 0.3s ease; } .edit-nickname-btn:hover { background: rgba(255, 215, 0, 0.3); border-color: #FFD700; } .settings-field input { width: 100%; padding: 8px 12px; border: 1px solid rgba(255, 215, 0, 0.3); border-radius: 6px; background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.7); } .settings-field input:disabled { opacity: 0.7; cursor: not-allowed; } </style> </script> <!-- OPTIMIZED INLINE JAVASCRIPT - NO EXTERNAL CALLS --> <script> // Global variables let currentUserData = null; // Load user data and initialize header async function loadUserData() { try { console.log("Loading user data..."); const response = await fetch("/get-user-data.php?t=" + Date.now()); const userData = await response.json(); console.log("User data received:", userData); currentUserData = userData; // Update header based on login status if (userData.logged_in) { // User is logged in - show logged-in state console.log("User is logged in:", userData.display_name); // Show coins badge const coinsBadge = document.getElementById("coinsBadge"); const coinsCount = document.getElementById("coinsCount"); const coinsSpacer = document.getElementById("coinsSpacer"); if (coinsBadge && coinsCount) { coinsCount.textContent = userData.coins.toLocaleString(); coinsBadge.style.display = "flex"; if (coinsSpacer) coinsSpacer.style.display = "block"; } // Show diamonds badge const diamondsBadge = document.getElementById("diamondsBadge"); const diamondsCount = document.getElementById("diamondsCount"); const diamondsSpacer = document.getElementById("diamondsSpacer"); if (diamondsBadge && diamondsCount) { diamondsCount.textContent = userData.diamonds.toLocaleString(); diamondsBadge.style.display = "flex"; if (diamondsSpacer) diamondsSpacer.style.display = "block"; } // Update profile button with real name const profileText = document.getElementById("profileText"); if (profileText) { profileText.textContent = userData.display_name; } // Update profile dropdown with logged-in content const profileDropdown = document.getElementById("profileDropdown"); if (profileDropdown) { profileDropdown.innerHTML = ` <div class="dropdown-item"> <a href="/profile.php" class="dropdown-link"> <span class="dropdown-icon">=�d�</span> Go to Profile </a> </div> <div class="dropdown-item" onclick="showSettingsModal()"> <span class="dropdown-icon">�&�</span> Account Settings </div> <div class="dropdown-item" onclick="handleLogout()"> <span class="dropdown-icon">=ت�</span> Logout </div> `; } } else { // User is not logged in - show login option console.log("User is not logged in"); // Update profile button to show "Account" const profileText = document.getElementById("profileText"); if (profileText) { profileText.textContent = "Account"; } // Update profile dropdown with login option const profileDropdown = document.getElementById("profileDropdown"); if (profileDropdown) { profileDropdown.innerHTML = ` <div class="dropdown-item" onclick="showLoginModal()"> <span class="dropdown-icon">=��</span> Login </div> <div class="dropdown-item"> <a href="/wisher-signup" class="dropdown-link"> <span class="dropdown-icon">=�d�</span> Create Account </a> </div> `; } } console.log("Header updated successfully"); } catch (error) { console.error("Error loading user data:", error); } } // Profile dropdown functionality function toggleProfileDropdown() { const dropdown = document.getElementById("profileDropdown"); const profileBtn = document.getElementById("profileBtn"); if (dropdown) { const isActive = dropdown.classList.contains("active"); if (isActive) { dropdown.classList.remove("active"); if (profileBtn) profileBtn.classList.remove("active"); } else { dropdown.classList.add("active"); if (profileBtn) profileBtn.classList.add("active"); } } } // Login modal functionality function showLoginModal() { const modal = document.getElementById("loginModal"); const overlay = document.getElementById("loginModalOverlay"); if (modal) { modal.style.display = "block"; if (overlay) overlay.style.display = "block"; document.body.style.overflow = "hidden"; } } function hideLoginModal() { const modal = document.getElementById("loginModal"); const overlay = document.getElementById("loginModalOverlay"); if (modal) { modal.style.display = "none"; if (overlay) overlay.style.display = "none"; document.body.style.overflow = ""; } } // Settings modal functionality function showSettingsModal() { const modal = document.getElementById("settingsModal"); if (modal && currentUserData) { // Populate settings with user data const nicknameInput = document.getElementById("settingsNickname"); const emailInput = document.getElementById("settingsEmail"); const userIdInput = document.getElementById("settingsUserId"); if (nicknameInput) { nicknameInput.value = currentUserData.display_name; nicknameInput.disabled = false; } if (emailInput) { emailInput.value = currentUserData.email; } if (userIdInput) { userIdInput.value = currentUserData.user_id; } modal.style.display = "block"; document.body.style.overflow = "hidden"; // Close profile dropdown const profileDropdown = document.getElementById("profileDropdown"); if (profileDropdown) { profileDropdown.classList.remove("active"); } } } function closeSettingsModal() { const modal = document.getElementById("settingsModal"); if (modal) { modal.style.display = "none"; document.body.style.overflow = ""; } } // Login form handling document.addEventListener("DOMContentLoaded", function() { const loginForm = document.getElementById("loginForm"); if (loginForm) { loginForm.addEventListener("submit", async function(e) { e.preventDefault(); const submitBtn = document.getElementById("loginSubmitBtn"); const originalText = submitBtn.textContent; submitBtn.textContent = "Signing In..."; submitBtn.disabled = true; try { const formData = new FormData(); formData.append("log", document.getElementById("loginEmail").value); formData.append("pwd", document.getElementById("loginPassword").value); formData.append("wp-submit", "Log In"); formData.append("redirect_to", window.location.href.split("?")[0]); // Remove query parameters to avoid redirect loops formData.append("testcookie", "1"); const response = await fetch("/wp-login.php", { method: "POST", body: formData, credentials: "same-origin" }); if (response.redirected) { // Successful login - redirect to current page with success parameter window.location.href = window.location.pathname + "?login=success"; } else { const responseText = await response.text(); if (responseText.includes("incorrect")) { alert("Login failed. Please check your credentials."); } else { console.error("Login response:", responseText); alert("Login failed. Please try again."); } } } catch (error) { console.error("Login error:", error); alert("Login failed. Please try again."); } finally { submitBtn.textContent = originalText; submitBtn.disabled = false; } }); } // Profile button click handler const profileBtn = document.getElementById("profileBtn"); if (profileBtn) { profileBtn.addEventListener("click", function(e) { e.preventDefault(); toggleProfileDropdown(); }); } // Close dropdowns when clicking outside document.addEventListener("click", function(e) { const profileContainer = document.getElementById("profileContainer"); const profileDropdown = document.getElementById("profileDropdown"); if (profileContainer && profileDropdown && !profileContainer.contains(e.target)) { profileDropdown.classList.remove("active"); const profileBtn = document.getElementById("profileBtn"); if (profileBtn) profileBtn.classList.remove("active"); } }); // Check for login success parameter const urlParams = new URLSearchParams(window.location.search); if (urlParams.get("login") === "success") { // Clean URL and reload user data const cleanUrl = window.location.pathname; window.history.replaceState(null, null, cleanUrl); setTimeout(() => loadUserData(), 100); } }); // Logout functionality async function handleLogout() { try { console.log("Starting optimized header logout..."); // Show immediate feedback const logoutButton = document.querySelector(".dropdown-item[onclick*=\"handleLogout\"]"); if (logoutButton) { logoutButton.innerHTML = "<span class=\"dropdown-icon\">�#</span>Logging out..."; logoutButton.style.pointerEvents = "none"; } const response = await fetch("/logout.php", { method: "GET", credentials: "same-origin" }); if (response.redirected) { console.log("Optimized header logout successful"); // Clear all client-side data immediately localStorage.clear(); sessionStorage.clear(); // Clean URL and redirect instantly (no setTimeout delay) const cleanUrl = window.location.pathname; window.location.href = cleanUrl; } else { // Fallback window.location.href = "/wp-login.php?action=logout"; } } catch (error) { console.error("Optimized header logout error:", error); // Ultimate fallback window.location.href = "/wp-login.php?action=logout"; } } // Load user data now that functions are available loadUserData(); </script> </body> </html>